wiki-viewer 1.14.2 → 2.0.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 (250) hide show
  1. package/.next/standalone/.next/BUILD_ID +1 -1
  2. package/.next/standalone/.next/build-manifest.json +3 -3
  3. package/.next/standalone/.next/server/app/_global-error.html +1 -1
  4. package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
  5. package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  6. package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  7. package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  8. package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  9. package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  10. package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  11. package/.next/standalone/.next/server/app/_not-found.html +1 -1
  12. package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
  13. package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  14. package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  15. package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  16. package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  17. package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  18. package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  19. package/.next/standalone/.next/server/app/api/agent/activity/route.js +6 -6
  20. package/.next/standalone/.next/server/app/api/agent/activity/route.js.nft.json +1 -1
  21. package/.next/standalone/.next/server/app/api/agent/events/[...path]/route.js +8 -8
  22. package/.next/standalone/.next/server/app/api/agent/events/[...path]/route.js.nft.json +1 -1
  23. package/.next/standalone/.next/server/app/api/agent/files/[...path]/route.js +9 -9
  24. package/.next/standalone/.next/server/app/api/agent/files/[...path]/route.js.nft.json +1 -1
  25. package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route.js +8 -8
  26. package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route.js.nft.json +1 -1
  27. package/.next/standalone/.next/server/app/api/agent/fs/ls/[[...path]]/route.js +8 -8
  28. package/.next/standalone/.next/server/app/api/agent/fs/ls/[[...path]]/route.js.nft.json +1 -1
  29. package/.next/standalone/.next/server/app/api/agent/fs/move/route.js +8 -8
  30. package/.next/standalone/.next/server/app/api/agent/fs/move/route.js.nft.json +1 -1
  31. package/.next/standalone/.next/server/app/api/agent/fs/search/route.js +9 -9
  32. package/.next/standalone/.next/server/app/api/agent/fs/search/route.js.nft.json +1 -1
  33. package/.next/standalone/.next/server/app/api/agent/internal/span/route.js +8 -8
  34. package/.next/standalone/.next/server/app/api/agent/internal/span/route.js.nft.json +1 -1
  35. package/.next/standalone/.next/server/app/api/agent/settings/route.js +7 -7
  36. package/.next/standalone/.next/server/app/api/agent/settings/route.js.nft.json +1 -1
  37. package/.next/standalone/.next/server/app/api/agent/sidecar/[...path]/route.js +6 -6
  38. package/.next/standalone/.next/server/app/api/agent/sidecar/[...path]/route.js.nft.json +1 -1
  39. package/.next/standalone/.next/server/app/api/app-proxy/[...path]/route.js.nft.json +1 -1
  40. package/.next/standalone/.next/server/app/api/assets/[...path]/route.js +5 -5
  41. package/.next/standalone/.next/server/app/api/assets/[...path]/route.js.nft.json +1 -1
  42. package/.next/standalone/.next/server/app/api/share/[token]/route.js +6 -5
  43. package/.next/standalone/.next/server/app/api/share/[token]/route.js.nft.json +1 -1
  44. package/.next/standalone/.next/server/app/api/share/route.js +4 -4
  45. package/.next/standalone/.next/server/app/api/share/route.js.nft.json +1 -1
  46. package/.next/standalone/.next/server/app/api/system/browse/route.js.nft.json +1 -1
  47. package/.next/standalone/.next/server/app/api/system/clear-root/route.js.nft.json +1 -1
  48. package/.next/standalone/.next/server/app/api/system/reveal/route.js +6 -6
  49. package/.next/standalone/.next/server/app/api/system/reveal/route.js.nft.json +1 -1
  50. package/.next/standalone/.next/server/app/api/system/root-status/route.js.nft.json +1 -1
  51. package/.next/standalone/.next/server/app/api/system/set-root/route.js +6 -5
  52. package/.next/standalone/.next/server/app/api/system/set-root/route.js.nft.json +1 -1
  53. package/.next/standalone/.next/server/app/api/system/workspaces/[id]/open/route.js +5 -4
  54. package/.next/standalone/.next/server/app/api/system/workspaces/[id]/open/route.js.nft.json +1 -1
  55. package/.next/standalone/.next/server/app/api/system/workspaces/[id]/refresh/route.js +6 -5
  56. package/.next/standalone/.next/server/app/api/system/workspaces/[id]/refresh/route.js.nft.json +1 -1
  57. package/.next/standalone/.next/server/app/api/system/workspaces/[id]/route.js +5 -4
  58. package/.next/standalone/.next/server/app/api/system/workspaces/[id]/route.js.nft.json +1 -1
  59. package/.next/standalone/.next/server/app/api/system/workspaces/route.js +7 -6
  60. package/.next/standalone/.next/server/app/api/system/workspaces/route.js.nft.json +1 -1
  61. package/.next/standalone/.next/server/app/api/upload/[...path]/route.js +5 -5
  62. package/.next/standalone/.next/server/app/api/upload/[...path]/route.js.nft.json +1 -1
  63. package/.next/standalone/.next/server/app/api/wiki/app/route.js +7 -7
  64. package/.next/standalone/.next/server/app/api/wiki/app/route.js.nft.json +1 -1
  65. package/.next/standalone/.next/server/app/api/wiki/backlinks/route.js +7 -7
  66. package/.next/standalone/.next/server/app/api/wiki/backlinks/route.js.nft.json +1 -1
  67. package/.next/standalone/.next/server/app/api/wiki/content/route.js +7 -7
  68. package/.next/standalone/.next/server/app/api/wiki/content/route.js.nft.json +1 -1
  69. package/.next/standalone/.next/server/app/api/wiki/download/route.js +6 -6
  70. package/.next/standalone/.next/server/app/api/wiki/download/route.js.nft.json +1 -1
  71. package/.next/standalone/.next/server/app/api/wiki/file/route.js +5 -5
  72. package/.next/standalone/.next/server/app/api/wiki/file/route.js.nft.json +1 -1
  73. package/.next/standalone/.next/server/app/api/wiki/folder/route.js +5 -5
  74. package/.next/standalone/.next/server/app/api/wiki/folder/route.js.nft.json +1 -1
  75. package/.next/standalone/.next/server/app/api/wiki/git-branches/route.js +4 -4
  76. package/.next/standalone/.next/server/app/api/wiki/git-branches/route.js.nft.json +1 -1
  77. package/.next/standalone/.next/server/app/api/wiki/git-checkout/route.js +6 -6
  78. package/.next/standalone/.next/server/app/api/wiki/git-checkout/route.js.nft.json +1 -1
  79. package/.next/standalone/.next/server/app/api/wiki/git-diff/route.js +4 -4
  80. package/.next/standalone/.next/server/app/api/wiki/git-diff/route.js.nft.json +1 -1
  81. package/.next/standalone/.next/server/app/api/wiki/git-file-info/route.js +4 -4
  82. package/.next/standalone/.next/server/app/api/wiki/git-file-info/route.js.nft.json +1 -1
  83. package/.next/standalone/.next/server/app/api/wiki/git-history/route.js +4 -4
  84. package/.next/standalone/.next/server/app/api/wiki/git-history/route.js.nft.json +1 -1
  85. package/.next/standalone/.next/server/app/api/wiki/git-pull/route.js +8 -8
  86. package/.next/standalone/.next/server/app/api/wiki/git-pull/route.js.nft.json +1 -1
  87. package/.next/standalone/.next/server/app/api/wiki/move/route.js +6 -6
  88. package/.next/standalone/.next/server/app/api/wiki/move/route.js.nft.json +1 -1
  89. package/.next/standalone/.next/server/app/api/wiki/new-file/route.js +5 -5
  90. package/.next/standalone/.next/server/app/api/wiki/new-file/route.js.nft.json +1 -1
  91. package/.next/standalone/.next/server/app/api/wiki/outlinks/route.js +7 -7
  92. package/.next/standalone/.next/server/app/api/wiki/outlinks/route.js.nft.json +1 -1
  93. package/.next/standalone/.next/server/app/api/wiki/page/route.js +5 -5
  94. package/.next/standalone/.next/server/app/api/wiki/page/route.js.nft.json +1 -1
  95. package/.next/standalone/.next/server/app/api/wiki/presence/route.js +6 -6
  96. package/.next/standalone/.next/server/app/api/wiki/presence/route.js.nft.json +1 -1
  97. package/.next/standalone/.next/server/app/api/wiki/route.js +5 -5
  98. package/.next/standalone/.next/server/app/api/wiki/route.js.nft.json +1 -1
  99. package/.next/standalone/.next/server/app/api/wiki/search/route.js +5 -5
  100. package/.next/standalone/.next/server/app/api/wiki/search/route.js.nft.json +1 -1
  101. package/.next/standalone/.next/server/app/api/wiki/slugs/route.js +5 -5
  102. package/.next/standalone/.next/server/app/api/wiki/slugs/route.js.nft.json +1 -1
  103. package/.next/standalone/.next/server/app/api/wiki/upload/route.js +5 -5
  104. package/.next/standalone/.next/server/app/api/wiki/upload/route.js.nft.json +1 -1
  105. package/.next/standalone/.next/server/app/api/wiki/watch/route.js +5 -5
  106. package/.next/standalone/.next/server/app/api/wiki/watch/route.js.nft.json +1 -1
  107. package/.next/standalone/.next/server/app/index.html +1 -1
  108. package/.next/standalone/.next/server/app/index.rsc +3 -3
  109. package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
  110. package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
  111. package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
  112. package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
  113. package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  114. package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
  115. package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
  116. package/.next/standalone/.next/server/app/s/[token]/page_client-reference-manifest.js +1 -1
  117. package/.next/standalone/.next/server/app/signin/page_client-reference-manifest.js +1 -1
  118. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-jzw2_._.js +3 -0
  119. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.-oq-7._.js +3 -0
  120. package/.next/standalone/.next/server/chunks/[root-of-the-server]__000spch._.js +3 -0
  121. package/.next/standalone/.next/server/chunks/[root-of-the-server]__01oin-a._.js +3 -0
  122. package/.next/standalone/.next/server/chunks/[root-of-the-server]__01qcera._.js +16 -0
  123. package/.next/standalone/.next/server/chunks/[root-of-the-server]__02.uul~._.js +3 -0
  124. package/.next/standalone/.next/server/chunks/[root-of-the-server]__024967n._.js +3 -0
  125. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06booxp._.js +3 -0
  126. package/.next/standalone/.next/server/chunks/[root-of-the-server]__071_pmz._.js +3 -0
  127. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_0bqpg._.js +3 -0
  128. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_1f2cw._.js +3 -0
  129. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0a6j6r4._.js +3 -0
  130. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0aoqat-._.js +3 -0
  131. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0as-u6z._.js +3 -0
  132. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0bvtbax._.js +3 -0
  133. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0c-ee48._.js +5 -0
  134. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0e_9pc5._.js +3 -0
  135. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0esmskc._.js +3 -0
  136. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fshk._._.js +20 -0
  137. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fu72o7._.js +3 -0
  138. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0k9mili._.js +3 -0
  139. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0l-wu5u._.js +3 -0
  140. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0lvz22t._.js +20 -0
  141. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0n-chxk._.js +16 -0
  142. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0n9zdf0._.js +3 -0
  143. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nmx3k2._.js +12 -0
  144. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nzlmkb._.js +3 -0
  145. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o0v6hf._.js +3 -0
  146. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0s38pid._.js +3 -0
  147. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0s_8poz._.js +3 -0
  148. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0sfrx~.._.js +3 -0
  149. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0sggstu._.js +3 -0
  150. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0u81k~2._.js +3 -0
  151. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0uibxf_._.js +3 -0
  152. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wfv_by._.js +3 -0
  153. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wlj-yw._.js +3 -0
  154. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0w~__xz._.js +3 -0
  155. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0yat~ul._.js +3 -0
  156. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0yxauu6._.js +3 -0
  157. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zbkgnr._.js +3 -0
  158. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zv_j05._.js +3 -0
  159. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~rntxj._.js +3 -0
  160. package/.next/standalone/.next/server/chunks/src_lib_search_0d-_j3u._.js +4 -4
  161. package/.next/standalone/.next/server/chunks/src_lib_search_0ymmp0c._.js +3 -3
  162. package/.next/standalone/.next/server/chunks/src_lib_workspaces_ts_0qon40u._.js +4 -0
  163. package/.next/standalone/.next/server/chunks/ssr/{0~w0_katex_dist_katex_mjs_029cdbg._.js → 0~w0_katex_dist_katex_mjs_0s4yb1t._.js} +1 -1
  164. package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0z41nrr._.js → [root-of-the-server]__10te1ye._.js} +2 -2
  165. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_13p348f._.js → node_modules__pnpm_0-a_zjq._.js} +1 -1
  166. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0gos._c._.js → node_modules__pnpm_02l_1_8._.js} +1 -1
  167. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0ru1i2-._.js → node_modules__pnpm_03rzttw._.js} +2 -2
  168. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_08xpp3w._.js → node_modules__pnpm_04frxp9._.js} +1 -1
  169. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0b8odbc._.js → node_modules__pnpm_057-t6m._.js} +1 -1
  170. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0f_n_zp._.js → node_modules__pnpm_05_oahi._.js} +1 -1
  171. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0~i3a.i._.js → node_modules__pnpm_05ans~m._.js} +1 -1
  172. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0i2m0b.._.js → node_modules__pnpm_06-2ia.._.js} +2 -2
  173. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0aha1~u._.js → node_modules__pnpm_086.ow4._.js} +1 -1
  174. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0w.kwue._.js → node_modules__pnpm_0cahog3._.js} +1 -1
  175. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0e0r_qk._.js → node_modules__pnpm_0cxanql._.js} +2 -2
  176. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0ajqqlq._.js → node_modules__pnpm_0e09gmf._.js} +1 -1
  177. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0hzzx9d._.js → node_modules__pnpm_0eqjo2f._.js} +1 -1
  178. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_02bje_g._.js → node_modules__pnpm_0f-yazg._.js} +1 -1
  179. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0xk042~._.js → node_modules__pnpm_0iu44jv._.js} +1 -1
  180. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_11ede0p._.js → node_modules__pnpm_0jh8q66._.js} +2 -2
  181. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0k-7uzm._.js → node_modules__pnpm_0m39f~t._.js} +1 -1
  182. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0xr.ztu._.js → node_modules__pnpm_0ma-8l.._.js} +1 -1
  183. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0i6_kfe._.js → node_modules__pnpm_0met6sx._.js} +2 -2
  184. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_04v1_ty._.js → node_modules__pnpm_0mtrsi0._.js} +2 -2
  185. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0607~kg._.js → node_modules__pnpm_0n_swwn._.js} +2 -2
  186. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0t4l89_._.js → node_modules__pnpm_0ndyy93._.js} +1 -1
  187. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0-_58b8._.js → node_modules__pnpm_0s-cj7c._.js} +1 -1
  188. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0y2h_cz._.js → node_modules__pnpm_0tr41-t._.js} +1 -1
  189. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_08edl1n._.js → node_modules__pnpm_0u.uija._.js} +1 -1
  190. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0026mgr._.js → node_modules__pnpm_0wiyn6d._.js} +1 -1
  191. package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_09o_spj._.js → node_modules__pnpm_0ygzt82._.js} +1 -1
  192. package/.next/standalone/.next/server/chunks/ssr/src_app_page_tsx_0ss2.w7._.js +2 -2
  193. package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
  194. package/.next/standalone/.next/server/middleware-manifest.json +1 -1
  195. package/.next/standalone/.next/server/pages/404.html +1 -1
  196. package/.next/standalone/.next/server/pages/500.html +1 -1
  197. package/.next/standalone/.next/static/chunks/0.69aou29w6ma.js +17 -0
  198. package/.next/standalone/.next/static/chunks/0sx~65~lg4mgl.css +5 -0
  199. package/.next/standalone/package.json +1 -1
  200. package/README.md +88 -17
  201. package/bin/wiki-viewer.js +198 -6
  202. package/package.json +1 -1
  203. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-.y6im._.js +0 -3
  204. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-3_t2y._.js +0 -3
  205. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-kjkzt._.js +0 -3
  206. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-puax4._.js +0 -4
  207. package/.next/standalone/.next/server/chunks/[root-of-the-server]__01h996g._.js +0 -3
  208. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0329ktu._.js +0 -3
  209. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03_xj4r._.js +0 -3
  210. package/.next/standalone/.next/server/chunks/[root-of-the-server]__05398dt._.js +0 -4
  211. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06lfvxh._.js +0 -3
  212. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06w0aet._.js +0 -3
  213. package/.next/standalone/.next/server/chunks/[root-of-the-server]__070_p2a._.js +0 -4
  214. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0905hi1._.js +0 -21
  215. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0aa63~j._.js +0 -5
  216. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0avcplk._.js +0 -4
  217. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0b8_kyo._.js +0 -16
  218. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0bticq1._.js +0 -3
  219. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0bwevvu._.js +0 -3
  220. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0c__k3q._.js +0 -4
  221. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0cp~z4x._.js +0 -3
  222. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fmdv9h._.js +0 -20
  223. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0h0qbwr._.js +0 -3
  224. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0jk~oyi._.js +0 -3
  225. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ndq77b._.js +0 -3
  226. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nvgpuk._.js +0 -3
  227. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ocvng2._.js +0 -3
  228. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ps4h~.._.js +0 -3
  229. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q7jqwp._.js +0 -12
  230. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qew~6p._.js +0 -3
  231. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0s_9f-a._.js +0 -3
  232. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0uv7b8u._.js +0 -3
  233. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0uv8.9i._.js +0 -3
  234. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0vfe2io._.js +0 -4
  235. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0w11kjy._.js +0 -3
  236. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wc-.e4._.js +0 -3
  237. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ymovmp._.js +0 -3
  238. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~c6ouv._.js +0 -3
  239. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~rhs0u._.js +0 -16
  240. package/.next/standalone/.next/server/chunks/[root-of-the-server]__10h9tid._.js +0 -3
  241. package/.next/standalone/.next/server/chunks/[root-of-the-server]__10yk-u1._.js +0 -3
  242. package/.next/standalone/.next/server/chunks/[root-of-the-server]__11105ew._.js +0 -3
  243. package/.next/standalone/.next/server/chunks/[root-of-the-server]__11a3dhw._.js +0 -3
  244. package/.next/standalone/.next/server/chunks/[root-of-the-server]__13420tt._.js +0 -3
  245. package/.next/standalone/.next/server/chunks/[root-of-the-server]__13h~pdf._.js +0 -3
  246. package/.next/standalone/.next/static/chunks/02kg.lbkfi1yc.css +0 -5
  247. package/.next/standalone/.next/static/chunks/0rcwd6-.iu~nd.js +0 -17
  248. /package/.next/standalone/.next/static/{rRyvFORvJoc5OWbCR2A_P → nbWvTsOgKt53BB3Gl0swc}/_buildManifest.js +0 -0
  249. /package/.next/standalone/.next/static/{rRyvFORvJoc5OWbCR2A_P → nbWvTsOgKt53BB3Gl0swc}/_clientMiddlewareManifest.js +0 -0
  250. /package/.next/standalone/.next/static/{rRyvFORvJoc5OWbCR2A_P → nbWvTsOgKt53BB3Gl0swc}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
1
  globalThis.__RSC_MANIFEST = globalThis.__RSC_MANIFEST || {};
2
- globalThis.__RSC_MANIFEST["/s/[token]/page"] = {"moduleLoading":{"prefix":"","crossOrigin":null},"clientModules":{"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/layout-router.js <module evaluation>":{"id":902063,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/layout-router.js":{"id":902063,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/render-from-template-context.js <module evaluation>":{"id":259666,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":259666,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/client-page.js <module evaluation>":{"id":687919,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/client-page.js":{"id":687919,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/client-segment.js <module evaluation>":{"id":767206,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/client-segment.js":{"id":767206,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js <module evaluation>":{"id":845990,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":845990,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/lib/framework/boundary-components.js <module evaluation>":{"id":62711,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":62711,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js <module evaluation>":{"id":319772,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":319772,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/sonner@2.0.7_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/sonner/dist/index.mjs <module evaluation>":{"id":187014,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/sonner@2.0.7_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/sonner/dist/index.mjs":{"id":187014,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/src/components/theme-provider.tsx <module evaluation>":{"id":427423,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/src/components/theme-provider.tsx":{"id":427423,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/client/components/builtin/global-error.js <module evaluation>":{"id":514743,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/client/components/builtin/global-error.js":{"id":514743,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/src/app/s/[token]/page.tsx <module evaluation>":{"id":670977,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js","/_next/static/chunks/02c9264uigqjd.js","/_next/static/chunks/0ey6h_rkpuzxs.js","/_next/static/chunks/0wxju9pxda4c2.js"],"async":false},"[project]/src/app/s/[token]/page.tsx":{"id":670977,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js","/_next/static/chunks/02c9264uigqjd.js","/_next/static/chunks/0ey6h_rkpuzxs.js","/_next/static/chunks/0wxju9pxda4c2.js"],"async":false}},"ssrModuleMapping":{"902063":{"*":{"id":800569,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"259666":{"*":{"id":692096,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"687919":{"*":{"id":910705,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"767206":{"*":{"id":973597,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"845990":{"*":{"id":456088,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"62711":{"*":{"id":42369,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"319772":{"*":{"id":302990,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"187014":{"*":{"id":263265,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"427423":{"*":{"id":301148,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"514743":{"*":{"id":33695,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js","server/chunks/ssr/node_modules__pnpm_0z5l~h-._.js"],"async":false}},"670977":{"*":{"id":973220,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js","server/chunks/ssr/[root-of-the-server]__10m6c40._.js","server/chunks/ssr/_0~a9dyk._.js","server/chunks/ssr/_0wmhtx3._.js"],"async":false}}},"edgeSSRModuleMapping":{},"rscModuleMapping":{"902063":{"*":{"id":898685,"name":"*","chunks":[],"async":false}},"259666":{"*":{"id":595703,"name":"*","chunks":[],"async":false}},"687919":{"*":{"id":608475,"name":"*","chunks":[],"async":false}},"767206":{"*":{"id":701451,"name":"*","chunks":[],"async":false}},"845990":{"*":{"id":210941,"name":"*","chunks":[],"async":false}},"62711":{"*":{"id":335288,"name":"*","chunks":[],"async":false}},"319772":{"*":{"id":385836,"name":"*","chunks":[],"async":false}},"187014":{"*":{"id":508023,"name":"*","chunks":[],"async":false}},"427423":{"*":{"id":425790,"name":"*","chunks":[],"async":false}},"514743":{"*":{"id":316138,"name":"*","chunks":[],"async":false}},"670977":{"*":{"id":686486,"name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{},"entryCSSFiles":{"[project]/src/app/layout":[{"path":"static/chunks/02kg.lbkfi1yc.css","inlined":false}],"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/client/components/builtin/global-error":[{"path":"static/chunks/02kg.lbkfi1yc.css","inlined":false}],"[project]/src/app/s/[token]/page":[{"path":"static/chunks/02kg.lbkfi1yc.css","inlined":false}]},"entryJSFiles":{"[project]/src/app/layout":["static/chunks/0umlolnxs~j3r.js","static/chunks/057umwogp53v_.js","static/chunks/0ky8fha87kp0_.js"],"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/client/components/builtin/global-error":["static/chunks/0umlolnxs~j3r.js","static/chunks/057umwogp53v_.js","static/chunks/0ky8fha87kp0_.js"],"[project]/src/app/s/[token]/page":["static/chunks/0umlolnxs~j3r.js","static/chunks/057umwogp53v_.js","static/chunks/0ky8fha87kp0_.js","static/chunks/02c9264uigqjd.js","static/chunks/0ey6h_rkpuzxs.js","static/chunks/0wxju9pxda4c2.js"]}};
2
+ globalThis.__RSC_MANIFEST["/s/[token]/page"] = {"moduleLoading":{"prefix":"","crossOrigin":null},"clientModules":{"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/layout-router.js <module evaluation>":{"id":902063,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/layout-router.js":{"id":902063,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/render-from-template-context.js <module evaluation>":{"id":259666,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":259666,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/client-page.js <module evaluation>":{"id":687919,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/client-page.js":{"id":687919,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/client-segment.js <module evaluation>":{"id":767206,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/client-segment.js":{"id":767206,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js <module evaluation>":{"id":845990,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":845990,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/lib/framework/boundary-components.js <module evaluation>":{"id":62711,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":62711,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js <module evaluation>":{"id":319772,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":319772,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/sonner@2.0.7_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/sonner/dist/index.mjs <module evaluation>":{"id":187014,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/sonner@2.0.7_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/sonner/dist/index.mjs":{"id":187014,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/src/components/theme-provider.tsx <module evaluation>":{"id":427423,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/src/components/theme-provider.tsx":{"id":427423,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/client/components/builtin/global-error.js <module evaluation>":{"id":514743,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/client/components/builtin/global-error.js":{"id":514743,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/src/app/s/[token]/page.tsx <module evaluation>":{"id":670977,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js","/_next/static/chunks/02c9264uigqjd.js","/_next/static/chunks/0ey6h_rkpuzxs.js","/_next/static/chunks/0wxju9pxda4c2.js"],"async":false},"[project]/src/app/s/[token]/page.tsx":{"id":670977,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js","/_next/static/chunks/02c9264uigqjd.js","/_next/static/chunks/0ey6h_rkpuzxs.js","/_next/static/chunks/0wxju9pxda4c2.js"],"async":false}},"ssrModuleMapping":{"902063":{"*":{"id":800569,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"259666":{"*":{"id":692096,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"687919":{"*":{"id":910705,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"767206":{"*":{"id":973597,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"845990":{"*":{"id":456088,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"62711":{"*":{"id":42369,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"319772":{"*":{"id":302990,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"187014":{"*":{"id":263265,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"427423":{"*":{"id":301148,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"514743":{"*":{"id":33695,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js","server/chunks/ssr/node_modules__pnpm_0z5l~h-._.js"],"async":false}},"670977":{"*":{"id":973220,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js","server/chunks/ssr/[root-of-the-server]__10m6c40._.js","server/chunks/ssr/_0~a9dyk._.js","server/chunks/ssr/_0wmhtx3._.js"],"async":false}}},"edgeSSRModuleMapping":{},"rscModuleMapping":{"902063":{"*":{"id":898685,"name":"*","chunks":[],"async":false}},"259666":{"*":{"id":595703,"name":"*","chunks":[],"async":false}},"687919":{"*":{"id":608475,"name":"*","chunks":[],"async":false}},"767206":{"*":{"id":701451,"name":"*","chunks":[],"async":false}},"845990":{"*":{"id":210941,"name":"*","chunks":[],"async":false}},"62711":{"*":{"id":335288,"name":"*","chunks":[],"async":false}},"319772":{"*":{"id":385836,"name":"*","chunks":[],"async":false}},"187014":{"*":{"id":508023,"name":"*","chunks":[],"async":false}},"427423":{"*":{"id":425790,"name":"*","chunks":[],"async":false}},"514743":{"*":{"id":316138,"name":"*","chunks":[],"async":false}},"670977":{"*":{"id":686486,"name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{},"entryCSSFiles":{"[project]/src/app/layout":[{"path":"static/chunks/0sx~65~lg4mgl.css","inlined":false}],"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/client/components/builtin/global-error":[{"path":"static/chunks/0sx~65~lg4mgl.css","inlined":false}],"[project]/src/app/s/[token]/page":[{"path":"static/chunks/0sx~65~lg4mgl.css","inlined":false}]},"entryJSFiles":{"[project]/src/app/layout":["static/chunks/0umlolnxs~j3r.js","static/chunks/057umwogp53v_.js","static/chunks/0ky8fha87kp0_.js"],"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/client/components/builtin/global-error":["static/chunks/0umlolnxs~j3r.js","static/chunks/057umwogp53v_.js","static/chunks/0ky8fha87kp0_.js"],"[project]/src/app/s/[token]/page":["static/chunks/0umlolnxs~j3r.js","static/chunks/057umwogp53v_.js","static/chunks/0ky8fha87kp0_.js","static/chunks/02c9264uigqjd.js","static/chunks/0ey6h_rkpuzxs.js","static/chunks/0wxju9pxda4c2.js"]}};
3
3
 
@@ -1,3 +1,3 @@
1
1
  globalThis.__RSC_MANIFEST = globalThis.__RSC_MANIFEST || {};
2
- globalThis.__RSC_MANIFEST["/signin/page"] = {"moduleLoading":{"prefix":"","crossOrigin":null},"clientModules":{"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/layout-router.js <module evaluation>":{"id":902063,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/layout-router.js":{"id":902063,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/render-from-template-context.js <module evaluation>":{"id":259666,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":259666,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/client-page.js <module evaluation>":{"id":687919,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/client-page.js":{"id":687919,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/client-segment.js <module evaluation>":{"id":767206,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/client-segment.js":{"id":767206,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js <module evaluation>":{"id":845990,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":845990,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/lib/framework/boundary-components.js <module evaluation>":{"id":62711,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":62711,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js <module evaluation>":{"id":319772,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":319772,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/sonner@2.0.7_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/sonner/dist/index.mjs <module evaluation>":{"id":187014,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/sonner@2.0.7_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/sonner/dist/index.mjs":{"id":187014,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/src/components/theme-provider.tsx <module evaluation>":{"id":427423,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/src/components/theme-provider.tsx":{"id":427423,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/client/components/builtin/global-error.js <module evaluation>":{"id":514743,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/client/components/builtin/global-error.js":{"id":514743,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/src/app/signin/signin-form.tsx <module evaluation>":{"id":419564,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js","/_next/static/chunks/0uv7ozzpiyp2_.js","/_next/static/chunks/07mgvytssm8ww.js"],"async":false},"[project]/src/app/signin/signin-form.tsx":{"id":419564,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js","/_next/static/chunks/0uv7ozzpiyp2_.js","/_next/static/chunks/07mgvytssm8ww.js"],"async":false}},"ssrModuleMapping":{"902063":{"*":{"id":800569,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"259666":{"*":{"id":692096,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"687919":{"*":{"id":910705,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"767206":{"*":{"id":973597,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"845990":{"*":{"id":456088,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"62711":{"*":{"id":42369,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"319772":{"*":{"id":302990,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"187014":{"*":{"id":263265,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"427423":{"*":{"id":301148,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"514743":{"*":{"id":33695,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js","server/chunks/ssr/node_modules__pnpm_0z5l~h-._.js"],"async":false}},"419564":{"*":{"id":59558,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js","server/chunks/ssr/src_app_signin_signin-form_tsx_0eznlbd._.js","server/chunks/ssr/src_lib_auth_client_ts_0sk~n1k._.js"],"async":false}}},"edgeSSRModuleMapping":{},"rscModuleMapping":{"902063":{"*":{"id":898685,"name":"*","chunks":[],"async":false}},"259666":{"*":{"id":595703,"name":"*","chunks":[],"async":false}},"687919":{"*":{"id":608475,"name":"*","chunks":[],"async":false}},"767206":{"*":{"id":701451,"name":"*","chunks":[],"async":false}},"845990":{"*":{"id":210941,"name":"*","chunks":[],"async":false}},"62711":{"*":{"id":335288,"name":"*","chunks":[],"async":false}},"319772":{"*":{"id":385836,"name":"*","chunks":[],"async":false}},"187014":{"*":{"id":508023,"name":"*","chunks":[],"async":false}},"427423":{"*":{"id":425790,"name":"*","chunks":[],"async":false}},"514743":{"*":{"id":316138,"name":"*","chunks":[],"async":false}},"419564":{"*":{"id":465274,"name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{},"entryCSSFiles":{"[project]/src/app/layout":[{"path":"static/chunks/02kg.lbkfi1yc.css","inlined":false}],"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/client/components/builtin/global-error":[{"path":"static/chunks/02kg.lbkfi1yc.css","inlined":false}],"[project]/src/app/signin/page":[{"path":"static/chunks/02kg.lbkfi1yc.css","inlined":false}]},"entryJSFiles":{"[project]/src/app/layout":["static/chunks/0umlolnxs~j3r.js","static/chunks/057umwogp53v_.js","static/chunks/0ky8fha87kp0_.js"],"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/client/components/builtin/global-error":["static/chunks/0umlolnxs~j3r.js","static/chunks/057umwogp53v_.js","static/chunks/0ky8fha87kp0_.js"],"[project]/src/app/signin/page":["static/chunks/0umlolnxs~j3r.js","static/chunks/057umwogp53v_.js","static/chunks/0ky8fha87kp0_.js","static/chunks/0uv7ozzpiyp2_.js","static/chunks/07mgvytssm8ww.js"]}};
2
+ globalThis.__RSC_MANIFEST["/signin/page"] = {"moduleLoading":{"prefix":"","crossOrigin":null},"clientModules":{"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/layout-router.js <module evaluation>":{"id":902063,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/layout-router.js":{"id":902063,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/render-from-template-context.js <module evaluation>":{"id":259666,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/render-from-template-context.js":{"id":259666,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/client-page.js <module evaluation>":{"id":687919,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/client-page.js":{"id":687919,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/client-segment.js <module evaluation>":{"id":767206,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/client-segment.js":{"id":767206,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js <module evaluation>":{"id":845990,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/client/components/http-access-fallback/error-boundary.js":{"id":845990,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/lib/framework/boundary-components.js <module evaluation>":{"id":62711,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/lib/framework/boundary-components.js":{"id":62711,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js <module evaluation>":{"id":319772,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/esm/lib/metadata/generate/icon-mark.js":{"id":319772,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/sonner@2.0.7_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/sonner/dist/index.mjs <module evaluation>":{"id":187014,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/sonner@2.0.7_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/sonner/dist/index.mjs":{"id":187014,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/src/components/theme-provider.tsx <module evaluation>":{"id":427423,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/src/components/theme-provider.tsx":{"id":427423,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/client/components/builtin/global-error.js <module evaluation>":{"id":514743,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/client/components/builtin/global-error.js":{"id":514743,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js"],"async":false},"[project]/src/app/signin/signin-form.tsx <module evaluation>":{"id":419564,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js","/_next/static/chunks/0uv7ozzpiyp2_.js","/_next/static/chunks/07mgvytssm8ww.js"],"async":false},"[project]/src/app/signin/signin-form.tsx":{"id":419564,"name":"*","chunks":["/_next/static/chunks/0umlolnxs~j3r.js","/_next/static/chunks/057umwogp53v_.js","/_next/static/chunks/0ky8fha87kp0_.js","/_next/static/chunks/0uv7ozzpiyp2_.js","/_next/static/chunks/07mgvytssm8ww.js"],"async":false}},"ssrModuleMapping":{"902063":{"*":{"id":800569,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"259666":{"*":{"id":692096,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"687919":{"*":{"id":910705,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"767206":{"*":{"id":973597,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"845990":{"*":{"id":456088,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"62711":{"*":{"id":42369,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"319772":{"*":{"id":302990,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"187014":{"*":{"id":263265,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"427423":{"*":{"id":301148,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js"],"async":false}},"514743":{"*":{"id":33695,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js","server/chunks/ssr/node_modules__pnpm_0z5l~h-._.js"],"async":false}},"419564":{"*":{"id":59558,"name":"*","chunks":["server/chunks/ssr/[root-of-the-server]__0a3bjyp._.js","server/chunks/ssr/0p91_next_dist_0cdz3_i._.js","server/chunks/ssr/node_modules__pnpm_0bt7d39._.js","server/chunks/ssr/src_app_signin_signin-form_tsx_0eznlbd._.js","server/chunks/ssr/src_lib_auth_client_ts_0sk~n1k._.js"],"async":false}}},"edgeSSRModuleMapping":{},"rscModuleMapping":{"902063":{"*":{"id":898685,"name":"*","chunks":[],"async":false}},"259666":{"*":{"id":595703,"name":"*","chunks":[],"async":false}},"687919":{"*":{"id":608475,"name":"*","chunks":[],"async":false}},"767206":{"*":{"id":701451,"name":"*","chunks":[],"async":false}},"845990":{"*":{"id":210941,"name":"*","chunks":[],"async":false}},"62711":{"*":{"id":335288,"name":"*","chunks":[],"async":false}},"319772":{"*":{"id":385836,"name":"*","chunks":[],"async":false}},"187014":{"*":{"id":508023,"name":"*","chunks":[],"async":false}},"427423":{"*":{"id":425790,"name":"*","chunks":[],"async":false}},"514743":{"*":{"id":316138,"name":"*","chunks":[],"async":false}},"419564":{"*":{"id":465274,"name":"*","chunks":[],"async":false}}},"edgeRscModuleMapping":{},"entryCSSFiles":{"[project]/src/app/layout":[{"path":"static/chunks/0sx~65~lg4mgl.css","inlined":false}],"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/client/components/builtin/global-error":[{"path":"static/chunks/0sx~65~lg4mgl.css","inlined":false}],"[project]/src/app/signin/page":[{"path":"static/chunks/0sx~65~lg4mgl.css","inlined":false}]},"entryJSFiles":{"[project]/src/app/layout":["static/chunks/0umlolnxs~j3r.js","static/chunks/057umwogp53v_.js","static/chunks/0ky8fha87kp0_.js"],"[project]/node_modules/.pnpm/next@16.2.4_react-dom@19.2.5_react@19.2.5__react@19.2.5/node_modules/next/dist/client/components/builtin/global-error":["static/chunks/0umlolnxs~j3r.js","static/chunks/057umwogp53v_.js","static/chunks/0ky8fha87kp0_.js"],"[project]/src/app/signin/page":["static/chunks/0umlolnxs~j3r.js","static/chunks/057umwogp53v_.js","static/chunks/0ky8fha87kp0_.js","static/chunks/0uv7ozzpiyp2_.js","static/chunks/07mgvytssm8ww.js"]}};
3
3
 
@@ -0,0 +1,3 @@
1
+ module.exports=[583627,e=>{"use strict";var t=e.i(798003),r=e.i(254226);function s(){return(process.env.WIKI_ADMIN_EMAILS??"").split(",").map(e=>e.trim().toLowerCase()).filter(Boolean)}async function a(e,r){if(r){let e=s();if(e.length>0&&e.includes(r.toLowerCase()))return!0}return((await (0,t.readConfig)()).adminUserIds??[]).includes(e)}async function i(){return(await (0,t.readConfig)()).adminUserIds??[]}async function n(e){await (0,t.updateConfig)(t=>{let r=t.adminUserIds??[];return r.includes(e)?t:{...t,adminUserIds:[...r,e]}})}async function o(e){let r=s().length>0,a=!1;if(await (0,t.updateConfig)(t=>{let s=(t.adminUserIds??[]).filter(t=>t!==e);return 0!==s.length||r?{...t,adminUserIds:s}:(a=!0,t)}),a)throw Error("LAST_ADMIN: cannot remove the last admin with no WIKI_ADMIN_EMAILS configured")}async function l(e){if(s().length>0||((await (0,t.readConfig)()).adminUserIds??[]).length>0)return;let r=!1;await (0,t.updateConfig)(t=>(t.adminUserIds??[]).length>0?t:(r=!0,{...t,adminUserIds:[e]})),r&&console.log(`[wiki-viewer] Bootstrap: first user ${e} promoted to admin`)}async function u(e){if("1"===process.env.WIKI_NO_AUTH)return{ok:!0,user:{id:"local",email:"local@localhost",name:"local"}};let t=await (0,r.requireUser)(e);return t.ok?await a(t.user.id,t.user.email)?{ok:!0,user:t.user}:{ok:!1,status:403,code:"ADMIN_REQUIRED"}:{ok:!1,status:401,code:"UNAUTHORIZED"}}e.s(["addAdmin",0,n,"ensureBootstrapAdmin",0,l,"isAdmin",0,a,"listAdmins",0,i,"removeAdmin",0,o,"requireAdmin",0,u])},874533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},812057,(e,t,r)=>{t.exports=e.x("node:util",()=>require("node:util"))},834938,e=>{"use strict";let t;var r=e.i(874533),s=e.i(812057),a=e.i(912714),i=e.i(750227),n=e.i(660526);let o=(0,s.promisify)(r.execFile),l=/[;|&$`<>(){}\n\r\0]/;function u(){return i.default.join(n.default.homedir(),".wiki-viewer","mounts")}async function c(){if(!0!==t)try{await o("sshfs",["--version"]),t=!0}catch{throw Error("sshfs binary not found. Install sshfs + FUSE (e.g. `apt install sshfs`, `brew install macfuse sshfs`) and ensure it is on PATH.")}}async function d(t){var r;let s=i.default.resolve(t),n=!1;try{n=(await (0,a.readFile)("/proc/mounts","utf8")).split("\n").some(e=>{let t=e.split(" ");return t[1]===s&&/fuse/.test(t[2]??"")})}catch{n=!1}return!!n&&(r=s,new Promise(t=>{let s=!1,a=setTimeout(()=>{s||(s=!0,t(!1))},4e3);e.A(687903).then(({readdir:e})=>e(r)).then(()=>{s||(s=!0,clearTimeout(a),t(!0))}).catch(()=>{s||(s=!0,clearTimeout(a),t(!1))})}))}async function p(e){await c(),await (0,a.mkdir)(e.mountpoint,{recursive:!0});let t=function(e){let{target:t,mountpoint:r,port:s,authMethod:a,keyPath:i,readOnly:n}=e,o=t.user?`${t.user}@`:"",l=[`${o}${t.host}:${t.remotePath}`,r];s&&Number.isInteger(s)&&s>0&&s<65536&&l.push("-p",String(s));let u=["reconnect","ServerAliveInterval=15","ServerAliveCountMax=3","compression=yes","cache=yes","kernel_cache","StrictHostKeyChecking=accept-new","BatchMode=yes"];if(n&&u.push("ro"),"keyfile"===a&&i&&(u.push(`IdentityFile=${i}`),u.push("IdentitiesOnly=yes")),"password"===a){let e=u.indexOf("BatchMode=yes");e>=0&&u.splice(e,1),u.push("password_stdin"),u.push("PreferredAuthentications=password,keyboard-interactive"),u.push("PubkeyAuthentication=no"),u.push("NumberOfPasswordPrompts=1")}return e.extraOptions&&u.push(...e.extraOptions),l.push("-o",u.join(",")),l}(e);if(await new Promise((s,a)=>{let i=(0,r.spawn)("sshfs",t,{stdio:["pipe","ignore","pipe"]}),n="",o=setTimeout(()=>{i.kill("SIGKILL"),a(Error("sshfs mount timed out after 25s."))},25e3);i.stderr?.on("data",e=>{n+=e.toString()}),i.on("error",e=>{clearTimeout(o),a(e.message.includes("ENOENT")?Error("sshfs binary not found on PATH."):e)}),i.on("close",e=>{clearTimeout(o),0===e?s():a(Error(`sshfs exited ${e}: ${n.trim()||"mount failed"}`))}),"password"===e.authMethod&&i.stdin?.write((e.password??"")+"\n"),i.stdin?.end()}),!await d(e.mountpoint))throw Error("sshfs reported success but the mount is not live.")}async function h(e){let t=i.default.resolve(e);for(let[e,r]of[["fusermount",["-u","-z",t]],["umount",[t]]])try{await o(e,r);break}catch{}try{await (0,a.rmdir)(t)}catch{}}e.s(["assertSshfsAvailable",0,c,"isMounted",0,d,"isValidKeyPath",0,function(e){return!(!e||l.test(e)||e.includes(".."))&&(e.startsWith("/")||e.startsWith("~/"))},"mountSshfs",0,p,"mountpointFor",0,function(e){return i.default.join(u(),e)},"mountsDir",0,u,"parseSshTarget",0,function(e){let t;if(!e||l.test(e))return null;let r=e.trim(),s=r.indexOf(":");if(s<=0)return null;let a=r.slice(0,s),i=r.slice(s+1);if(!i.startsWith("/")||i.includes(".."))return null;let n=a,o=a.indexOf("@");return o>=0&&(t=a.slice(0,o),n=a.slice(o+1),!t)?null:n&&/^[a-zA-Z0-9.\-]+$/.test(n)&&(!t||/^[a-zA-Z0-9._\-]+$/.test(t))?{user:t,host:n,remotePath:i}:null},"unmountSshfs",0,h])},504445,e=>{"use strict";var t=e.i(750227);let r=globalThis;!r.__wikiRootDir&&process.env.ROOT_DIR&&(r.__wikiRootDir=t.default.resolve(process.env.ROOT_DIR)),e.s(["clearRootDir",0,function(){r.__wikiRootDir=void 0},"getRootDir",0,function(){return r.__wikiRootDir??""},"isRootDirSet",0,function(){return!!r.__wikiRootDir},"setRootDir",0,function(e){r.__wikiRootDir=t.default.resolve(e)}])},660038,e=>{"use strict";var t=e.i(750227),r=e.i(254226),s=e.i(583627),a=e.i(504445),i=e.i(359211);async function n(e){let r;await (0,i.migrateConfigToWorkspaces)();let s=new URL(e.url).searchParams.get("ws")??e.headers.get("x-workspace")??null;if(s)r=await (0,i.getWorkspace)(s)??null;else{let e=await (0,i.listWorkspaces)();if(0===e.length){let e;r=(e=(0,a.getRootDir)())?{id:"ws_default",name:t.default.basename(e)||"workspace",rootDir:e,createdAt:new Date(0).toISOString()}:null}else r=e.slice().sort((e,t)=>{let r=e.lastOpenedAt?new Date(e.lastOpenedAt).getTime():0,s=t.lastOpenedAt?new Date(t.lastOpenedAt).getTime():0;return s!==r?s-r:e.id<t.id?-1:+(e.id>t.id)})[0]}return r?.ssh&&await (0,i.ensureWorkspaceMounted)(r),r}async function o(e,t="read"){if("1"===process.env.WIKI_NO_AUTH){let r=await n(e);return r?"write"===t&&r.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:r,rootDir:r.rootDir,userId:"local",isAdmin:!0}:{ok:!1,status:400,code:"WORKSPACE_REQUIRED"}}let a=await (0,r.requireUser)(e);if(!a.ok)return{ok:!1,status:401,code:"UNAUTHORIZED"};let l=await (0,s.isAdmin)(a.user.id,a.user.email),u=new URL(e.url).searchParams.get("ws")??e.headers.get("x-workspace")??null,c=await n(e);return c?(0,i.userCanAccess)(c,a.user.id,l)?"write"===t&&c.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:c,rootDir:c.rootDir,userId:a.user.id,isAdmin:l}:{ok:!1,status:403,code:"WORKSPACE_FORBIDDEN"}:{ok:!1,status:u?404:400,code:u?"WORKSPACE_NOT_FOUND":"WORKSPACE_REQUIRED"}}async function l(e,t="read"){let r=await n(e);if(!r){let t=new URL(e.url).searchParams.get("ws")??e.headers.get("x-workspace")??null;return{ok:!1,status:t?404:400,code:t?"WORKSPACE_NOT_FOUND":"WORKSPACE_REQUIRED"}}return"write"===t&&r.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:r,rootDir:r.rootDir}}e.s(["resolveWorkspaceForAgent",0,l,"resolveWorkspaceForUser",0,o])},719126,e=>{"use strict";var t=e.i(666680),r=e.i(912714),s=e.i(750227);function a(e){let t=e.replace(/\\/g,"/");return".proof"===t||t.startsWith(".proof/")||".git"===t||t.startsWith(".git/")}async function i(e,t){if(!e)return null;let i=s.default.normalize(t);if(i.startsWith("..")||s.default.isAbsolute(i)||a(i))return null;let n=s.default.join(e,i);if(n!==e&&!n.startsWith(e+s.default.sep))return null;try{let t=await (0,r.realpath)(n);if(t!==e&&!t.startsWith(e+s.default.sep))return null}catch{let t=s.default.dirname(n);if(t!==n)try{let a=await (0,r.realpath)(t);if(a!==e&&!a.startsWith(e+s.default.sep))return null}catch{}}return n}let n={".md":"text/markdown; charset=utf-8",".markdown":"text/markdown; charset=utf-8",".txt":"text/plain; charset=utf-8",".json":"application/json; charset=utf-8",".jsonc":"application/json; charset=utf-8",".ts":"text/typescript; charset=utf-8",".tsx":"text/typescript; charset=utf-8",".mts":"text/typescript; charset=utf-8",".js":"text/javascript; charset=utf-8",".jsx":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".html":"text/html; charset=utf-8",".htm":"text/html; charset=utf-8",".css":"text/css; charset=utf-8",".yaml":"text/yaml; charset=utf-8",".yml":"text/yaml; charset=utf-8",".toml":"text/toml; charset=utf-8",".xml":"application/xml; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".pdf":"application/pdf",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".py":"text/x-python; charset=utf-8",".rs":"text/x-rustsrc; charset=utf-8",".go":"text/x-go; charset=utf-8",".sh":"text/x-shellscript; charset=utf-8",".csv":"text/csv; charset=utf-8",".env":"text/plain; charset=utf-8"};async function o(e,t){let s=420;try{let t=await (0,r.stat)(e);s=511&t.mode}catch{}let a=e+".~"+process.pid+"."+Date.now()+".tmp",i=await (0,r.open)(a,"w",s);try{await i.write(t),await i.datasync()}finally{await i.close()}await (0,r.rename)(a,e)}async function l(e,t){let a=s.default.dirname(e);if(t)return await (0,r.mkdir)(a,{recursive:!0}),!0;try{return await (0,r.stat)(a),!0}catch{return!1}}e.s(["atomicWrite",0,o,"ensureParentDir",0,l,"extractShaHex",0,function(e){return e.replace(/^"/,"").replace(/"$/,"").replace(/^sha256:/,"")},"isDeniedRelPath",0,a,"isMarkdown",0,function(e){return e.endsWith(".md")||e.endsWith(".markdown")},"looksLikeBinary",0,function(e){return e.slice(0,Math.min(e.length,8192)).includes(0)},"mimeByExt",0,function(e){return n[s.default.extname(e).toLowerCase()]??"application/octet-stream"},"safeAbsPath",0,i,"sha256ofBuf",0,function(e){return"sha256:"+(0,t.createHash)("sha256").update(e).digest("hex")}])},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},687769,(e,t,r)=>{t.exports=e.x("node:events",()=>require("node:events"))},275859,e=>{"use strict";var t=e.i(912714),r=e.i(750227);async function s(e,s){try{let a=r.default.join(e,s,"package.json");return(await (0,t.stat)(a)).isFile()}catch{return!1}}async function a(e,s){try{let a=r.default.join(e,s,"index.html");return(await (0,t.stat)(a)).isFile()}catch{return!1}}e.s(["isAppFolder",0,a,"isNodeApp",0,s])},26004,e=>{"use strict";var t=e.i(364564),r=e.i(102095),s=e.i(691091),a=e.i(475331),i=e.i(490301),n=e.i(670943),o=e.i(690324),l=e.i(243133),u=e.i(404870),c=e.i(420180),d=e.i(867883),p=e.i(336708),h=e.i(682278),f=e.i(157569),m=e.i(844146),w=e.i(193695);e.i(105888);var v=e.i(530564),g=e.i(702414),R=e.i(660038),_=e.i(437856);async function y(e){let t=await (0,R.resolveWorkspaceForUser)(e);if(!t.ok)return g.NextResponse.json({error:t.code},{status:t.status});let r=new URL(e.url).searchParams.get("path")??"",s=(r.split("/").pop()??r).replace(/\.md$/i,"");if(!s)return g.NextResponse.json({backlinks:[]});(0,_.ensureIndexer)(t.ws.id,t.rootDir).catch(e=>console.error("[backlinks] ensureIndexer failed",e));let a=(0,_.resolveBacklinks)(t.ws.id,s,r,50);return g.NextResponse.json({backlinks:a})}e.s(["GET",0,y,"runtime",0,"nodejs"],983155);var x=e.i(983155);let k=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/wiki/backlinks/route",pathname:"/api/wiki/backlinks",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/wiki/backlinks/route.ts",nextConfigOutput:"standalone",userland:x,...{}}),{workAsyncStorage:A,workUnitAsyncStorage:E,serverHooks:O}=k;async function I(e,t,s){s.requestMeta&&(0,a.setRequestMeta)(e,s.requestMeta),k.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/wiki/backlinks/route";g=g.replace(/\/index$/,"")||"/";let R=await k.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==s.waitUntil||s.waitUntil.call(s,Promise.resolve()),null;let{buildId:_,params:y,nextConfig:x,parsedUrl:A,isDraftMode:E,prerenderManifest:O,routerServerContext:I,isOnDemandRevalidate:C,revalidateOnlyGenerated:P,resolvedPathname:D,clientReferenceManifest:b,serverActionsManifest:N}=R,T=(0,o.normalizeAppPath)(g),S=!!(O.dynamicRoutes[T]||O.routes[D]),U=async()=>((null==I?void 0:I.render404)?await I.render404(e,t,A,!1):t.end("This page could not be found"),null);if(S&&!E){let e=!!O.routes[D],t=O.dynamicRoutes[T];if(t&&!1===t.fallback&&!e){if(x.adapterPath)return await U();throw new w.NoFallbackError}}let j=null;!S||k.isDev||E||(j="/index"===(j=D)?"/":j);let W=!0===k.isDev||!S,q=S&&!W;N&&b&&(0,n.setManifestsSingleton)({page:g,clientReferenceManifest:b,serverActionsManifest:N});let M=e.method||"GET",H=(0,i.getTracer)(),K=H.getActiveScopeSpan(),F=!!(null==I?void 0:I.isWrappedByNextServer),$=!!(0,a.getRequestMeta)(e,"minimalMode"),L=(0,a.getRequestMeta)(e,"incrementalCache")||await k.getIncrementalCache(e,x,O,$);null==L||L.resetRequestCache(),globalThis.__incrementalCache=L;let B={params:y,previewProps:O.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:W,incrementalCache:L,cacheLifeProfiles:x.cacheLife,waitUntil:s.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,s,a)=>k.onRequestError(e,t,s,a,I)},sharedContext:{buildId:_}},z=new l.NodeNextRequest(e),G=new l.NodeNextResponse(t),Z=u.NextRequestAdapter.fromNodeNextRequest(z,(0,u.signalFromNodeResponse)(t));try{let a,n=async e=>k.handle(Z,B).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=H.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let s=r.get("next.route");if(s){let t=`${M} ${s}`;e.setAttributes({"next.route":s,"http.route":s,"next.span_name":t}),e.updateName(t),a&&a!==e&&(a.setAttribute("http.route",s),a.updateName(t))}else e.updateName(`${M} ${g}`)}),o=async a=>{var i,o;let l=async({previousCacheEntry:r})=>{try{if(!$&&C&&P&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await n(a);e.fetchMetrics=B.renderOpts.fetchMetrics;let o=B.renderOpts.pendingWaitUntil;o&&s.waitUntil&&(s.waitUntil(o),o=void 0);let l=B.renderOpts.collectedTags;if(!S)return await (0,p.sendResponse)(z,G,i,B.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);l&&(t[m.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==B.renderOpts.collectedRevalidate&&!(B.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&B.renderOpts.collectedRevalidate,s=void 0===B.renderOpts.collectedExpire||B.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:B.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:s}}}}catch(t){throw(null==r?void 0:r.isStale)&&await k.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:q,isOnDemandRevalidate:C})},!1,I),t}},u=await k.handleResponse({req:e,nextConfig:x,cacheKey:j,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:O,isRoutePPREnabled:!1,isOnDemandRevalidate:C,revalidateOnlyGenerated:P,responseGenerator:l,waitUntil:s.waitUntil,isMinimalMode:$});if(!S)return null;if((null==u||null==(i=u.value)?void 0:i.kind)!==v.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(o=u.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});$||t.setHeader("x-nextjs-cache",C?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),E&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let c=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return $&&S||c.delete(m.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||c.get("Cache-Control")||c.set("Cache-Control",(0,f.getCacheControlHeader)(u.cacheControl)),await (0,p.sendResponse)(z,G,new Response(u.value.body,{headers:c,status:u.value.status||200})),null};F&&K?await o(K):(a=H.getActiveScopeSpan(),await H.withPropagatedContext(e.headers,()=>H.trace(c.BaseServerSpan.handleRequest,{spanName:`${M} ${g}`,kind:i.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},o),void 0,!F))}catch(t){if(t instanceof w.NoFallbackError||await k.onRequestError(e,t,{routerKind:"App Router",routePath:T,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:q,isOnDemandRevalidate:C})},!1,I),S)throw t;return await (0,p.sendResponse)(z,G,new Response(null,{status:500})),null}}e.s(["handler",0,I,"patchFetch",0,function(){return(0,s.patchFetch)({workAsyncStorage:A,workUnitAsyncStorage:E})},"routeModule",0,k,"serverHooks",0,O,"workAsyncStorage",0,A,"workUnitAsyncStorage",0,E],26004)},168315,e=>{e.v(t=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(t=>e.l(t))).then(()=>t(862112)))},317691,e=>{e.v(t=>Promise.all(["server/chunks/0dhv_better-auth_dist_adapters_kysely-adapter_index_mjs_0t4t4z8._.js"].map(t=>e.l(t))).then(()=>t(833412)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(t=>e.l(t))).then(()=>t(495181)))},715018,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(t=>e.l(t))).then(()=>t(698370)))},146843,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(t=>e.l(t))).then(()=>t(143740)))},84040,e=>{e.v(t=>Promise.all(["server/chunks/0p91_next_0h94sj1._.js"].map(t=>e.l(t))).then(()=>t(815068)))},427669,e=>{e.v(e=>Promise.resolve().then(()=>e(177730)))},687903,e=>{e.v(e=>Promise.resolve().then(()=>e(912714)))},754121,e=>{e.v(e=>Promise.resolve().then(()=>e(437856)))}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__0-jzw2_._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[583627,e=>{"use strict";var t=e.i(798003),r=e.i(254226);function s(){return(process.env.WIKI_ADMIN_EMAILS??"").split(",").map(e=>e.trim().toLowerCase()).filter(Boolean)}async function a(e,r){if(r){let e=s();if(e.length>0&&e.includes(r.toLowerCase()))return!0}return((await (0,t.readConfig)()).adminUserIds??[]).includes(e)}async function n(){return(await (0,t.readConfig)()).adminUserIds??[]}async function i(e){await (0,t.updateConfig)(t=>{let r=t.adminUserIds??[];return r.includes(e)?t:{...t,adminUserIds:[...r,e]}})}async function o(e){let r=s().length>0,a=!1;if(await (0,t.updateConfig)(t=>{let s=(t.adminUserIds??[]).filter(t=>t!==e);return 0!==s.length||r?{...t,adminUserIds:s}:(a=!0,t)}),a)throw Error("LAST_ADMIN: cannot remove the last admin with no WIKI_ADMIN_EMAILS configured")}async function l(e){if(s().length>0||((await (0,t.readConfig)()).adminUserIds??[]).length>0)return;let r=!1;await (0,t.updateConfig)(t=>(t.adminUserIds??[]).length>0?t:(r=!0,{...t,adminUserIds:[e]})),r&&console.log(`[wiki-viewer] Bootstrap: first user ${e} promoted to admin`)}async function u(e){if("1"===process.env.WIKI_NO_AUTH)return{ok:!0,user:{id:"local",email:"local@localhost",name:"local"}};let t=await (0,r.requireUser)(e);return t.ok?await a(t.user.id,t.user.email)?{ok:!0,user:t.user}:{ok:!1,status:403,code:"ADMIN_REQUIRED"}:{ok:!1,status:401,code:"UNAUTHORIZED"}}e.s(["addAdmin",0,i,"ensureBootstrapAdmin",0,l,"isAdmin",0,a,"listAdmins",0,n,"removeAdmin",0,o,"requireAdmin",0,u])},874533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},812057,(e,t,r)=>{t.exports=e.x("node:util",()=>require("node:util"))},834938,e=>{"use strict";let t;var r=e.i(874533),s=e.i(812057),a=e.i(912714),n=e.i(750227),i=e.i(660526);let o=(0,s.promisify)(r.execFile),l=/[;|&$`<>(){}\n\r\0]/;function u(){return n.default.join(i.default.homedir(),".wiki-viewer","mounts")}async function d(){if(!0!==t)try{await o("sshfs",["--version"]),t=!0}catch{throw Error("sshfs binary not found. Install sshfs + FUSE (e.g. `apt install sshfs`, `brew install macfuse sshfs`) and ensure it is on PATH.")}}async function c(t){var r;let s=n.default.resolve(t),i=!1;try{i=(await (0,a.readFile)("/proc/mounts","utf8")).split("\n").some(e=>{let t=e.split(" ");return t[1]===s&&/fuse/.test(t[2]??"")})}catch{i=!1}return!!i&&(r=s,new Promise(t=>{let s=!1,a=setTimeout(()=>{s||(s=!0,t(!1))},4e3);e.A(687903).then(({readdir:e})=>e(r)).then(()=>{s||(s=!0,clearTimeout(a),t(!0))}).catch(()=>{s||(s=!0,clearTimeout(a),t(!1))})}))}async function p(e){await d(),await (0,a.mkdir)(e.mountpoint,{recursive:!0});let t=function(e){let{target:t,mountpoint:r,port:s,authMethod:a,keyPath:n,readOnly:i}=e,o=t.user?`${t.user}@`:"",l=[`${o}${t.host}:${t.remotePath}`,r];s&&Number.isInteger(s)&&s>0&&s<65536&&l.push("-p",String(s));let u=["reconnect","ServerAliveInterval=15","ServerAliveCountMax=3","compression=yes","cache=yes","kernel_cache","StrictHostKeyChecking=accept-new","BatchMode=yes"];if(i&&u.push("ro"),"keyfile"===a&&n&&(u.push(`IdentityFile=${n}`),u.push("IdentitiesOnly=yes")),"password"===a){let e=u.indexOf("BatchMode=yes");e>=0&&u.splice(e,1),u.push("password_stdin"),u.push("PreferredAuthentications=password,keyboard-interactive"),u.push("PubkeyAuthentication=no"),u.push("NumberOfPasswordPrompts=1")}return e.extraOptions&&u.push(...e.extraOptions),l.push("-o",u.join(",")),l}(e);if(await new Promise((s,a)=>{let n=(0,r.spawn)("sshfs",t,{stdio:["pipe","ignore","pipe"]}),i="",o=setTimeout(()=>{n.kill("SIGKILL"),a(Error("sshfs mount timed out after 25s."))},25e3);n.stderr?.on("data",e=>{i+=e.toString()}),n.on("error",e=>{clearTimeout(o),a(e.message.includes("ENOENT")?Error("sshfs binary not found on PATH."):e)}),n.on("close",e=>{clearTimeout(o),0===e?s():a(Error(`sshfs exited ${e}: ${i.trim()||"mount failed"}`))}),"password"===e.authMethod&&n.stdin?.write((e.password??"")+"\n"),n.stdin?.end()}),!await c(e.mountpoint))throw Error("sshfs reported success but the mount is not live.")}async function h(e){let t=n.default.resolve(e);for(let[e,r]of[["fusermount",["-u","-z",t]],["umount",[t]]])try{await o(e,r);break}catch{}try{await (0,a.rmdir)(t)}catch{}}e.s(["assertSshfsAvailable",0,d,"isMounted",0,c,"isValidKeyPath",0,function(e){return!(!e||l.test(e)||e.includes(".."))&&(e.startsWith("/")||e.startsWith("~/"))},"mountSshfs",0,p,"mountpointFor",0,function(e){return n.default.join(u(),e)},"mountsDir",0,u,"parseSshTarget",0,function(e){let t;if(!e||l.test(e))return null;let r=e.trim(),s=r.indexOf(":");if(s<=0)return null;let a=r.slice(0,s),n=r.slice(s+1);if(!n.startsWith("/")||n.includes(".."))return null;let i=a,o=a.indexOf("@");return o>=0&&(t=a.slice(0,o),i=a.slice(o+1),!t)?null:i&&/^[a-zA-Z0-9.\-]+$/.test(i)&&(!t||/^[a-zA-Z0-9._\-]+$/.test(t))?{user:t,host:i,remotePath:n}:null},"unmountSshfs",0,h])},504445,e=>{"use strict";var t=e.i(750227);let r=globalThis;!r.__wikiRootDir&&process.env.ROOT_DIR&&(r.__wikiRootDir=t.default.resolve(process.env.ROOT_DIR)),e.s(["clearRootDir",0,function(){r.__wikiRootDir=void 0},"getRootDir",0,function(){return r.__wikiRootDir??""},"isRootDirSet",0,function(){return!!r.__wikiRootDir},"setRootDir",0,function(e){r.__wikiRootDir=t.default.resolve(e)}])},660038,e=>{"use strict";var t=e.i(750227),r=e.i(254226),s=e.i(583627),a=e.i(504445),n=e.i(359211);async function i(e){let r;await (0,n.migrateConfigToWorkspaces)();let s=new URL(e.url).searchParams.get("ws")??e.headers.get("x-workspace")??null;if(s)r=await (0,n.getWorkspace)(s)??null;else{let e=await (0,n.listWorkspaces)();if(0===e.length){let e;r=(e=(0,a.getRootDir)())?{id:"ws_default",name:t.default.basename(e)||"workspace",rootDir:e,createdAt:new Date(0).toISOString()}:null}else r=e.slice().sort((e,t)=>{let r=e.lastOpenedAt?new Date(e.lastOpenedAt).getTime():0,s=t.lastOpenedAt?new Date(t.lastOpenedAt).getTime():0;return s!==r?s-r:e.id<t.id?-1:+(e.id>t.id)})[0]}return r?.ssh&&await (0,n.ensureWorkspaceMounted)(r),r}async function o(e,t="read"){if("1"===process.env.WIKI_NO_AUTH){let r=await i(e);return r?"write"===t&&r.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:r,rootDir:r.rootDir,userId:"local",isAdmin:!0}:{ok:!1,status:400,code:"WORKSPACE_REQUIRED"}}let a=await (0,r.requireUser)(e);if(!a.ok)return{ok:!1,status:401,code:"UNAUTHORIZED"};let l=await (0,s.isAdmin)(a.user.id,a.user.email),u=new URL(e.url).searchParams.get("ws")??e.headers.get("x-workspace")??null,d=await i(e);return d?(0,n.userCanAccess)(d,a.user.id,l)?"write"===t&&d.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:d,rootDir:d.rootDir,userId:a.user.id,isAdmin:l}:{ok:!1,status:403,code:"WORKSPACE_FORBIDDEN"}:{ok:!1,status:u?404:400,code:u?"WORKSPACE_NOT_FOUND":"WORKSPACE_REQUIRED"}}async function l(e,t="read"){let r=await i(e);if(!r){let t=new URL(e.url).searchParams.get("ws")??e.headers.get("x-workspace")??null;return{ok:!1,status:t?404:400,code:t?"WORKSPACE_NOT_FOUND":"WORKSPACE_REQUIRED"}}return"write"===t&&r.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:r,rootDir:r.rootDir}}e.s(["resolveWorkspaceForAgent",0,l,"resolveWorkspaceForUser",0,o])},866072,e=>{"use strict";var t=e.i(364564),r=e.i(102095),s=e.i(691091),a=e.i(475331),n=e.i(490301),i=e.i(670943),o=e.i(690324),l=e.i(243133),u=e.i(404870),d=e.i(420180),c=e.i(867883),p=e.i(336708),h=e.i(682278),m=e.i(157569),f=e.i(844146),w=e.i(193695);e.i(105888);var _=e.i(530564),v=e.i(702414),R=e.i(787140),g=e.i(660038),A=e.i(359211);async function y(e){let t=await (0,g.resolveWorkspaceForUser)(e);if(!t.ok)return v.NextResponse.json({error:t.code},{status:t.status});let{rootDir:r}=t,{searchParams:s}=new URL(e.url),a=s.get("path")??"";if(!a)return v.NextResponse.json({error:"Invalid path"},{status:400});let n=(0,A.safeWorkspacePath)(r,a);if(!n||n===r)return v.NextResponse.json({error:"Invalid path"},{status:400});if(!await (0,R.detectGitRepo)(n))return v.NextResponse.json({error:"Not a git repository"},{status:400});try{let e=await (0,R.gitBranches)(n),t=e.find(e=>e.current)?.name??"";return v.NextResponse.json({branches:e,current:t})}catch{return v.NextResponse.json({error:"Failed to list branches"},{status:500})}}e.s(["GET",0,y],814251);var E=e.i(814251);let k=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/wiki/git-branches/route",pathname:"/api/wiki/git-branches",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/wiki/git-branches/route.ts",nextConfigOutput:"standalone",userland:E,...{}}),{workAsyncStorage:O,workUnitAsyncStorage:I,serverHooks:C}=k;async function P(e,t,s){s.requestMeta&&(0,a.setRequestMeta)(e,s.requestMeta),k.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let v="/api/wiki/git-branches/route";v=v.replace(/\/index$/,"")||"/";let R=await k.prepare(e,t,{srcPage:v,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==s.waitUntil||s.waitUntil.call(s,Promise.resolve()),null;let{buildId:g,params:A,nextConfig:y,parsedUrl:E,isDraftMode:O,prerenderManifest:I,routerServerContext:C,isOnDemandRevalidate:P,revalidateOnlyGenerated:x,resolvedPathname:D,clientReferenceManifest:N,serverActionsManifest:T}=R,S=(0,o.normalizeAppPath)(v),b=!!(I.dynamicRoutes[S]||I.routes[D]),U=async()=>((null==C?void 0:C.render404)?await C.render404(e,t,E,!1):t.end("This page could not be found"),null);if(b&&!O){let e=!!I.routes[D],t=I.dynamicRoutes[S];if(t&&!1===t.fallback&&!e){if(y.adapterPath)return await U();throw new w.NoFallbackError}}let j=null;!b||k.isDev||O||(j="/index"===(j=D)?"/":j);let q=!0===k.isDev||!b,M=b&&!q;T&&N&&(0,i.setManifestsSingleton)({page:v,clientReferenceManifest:N,serverActionsManifest:T});let W=e.method||"GET",K=(0,n.getTracer)(),H=K.getActiveScopeSpan(),F=!!(null==C?void 0:C.isWrappedByNextServer),$=!!(0,a.getRequestMeta)(e,"minimalMode"),L=(0,a.getRequestMeta)(e,"incrementalCache")||await k.getIncrementalCache(e,y,I,$);null==L||L.resetRequestCache(),globalThis.__incrementalCache=L;let B={params:A,previewProps:I.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:q,incrementalCache:L,cacheLifeProfiles:y.cacheLife,waitUntil:s.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,s,a)=>k.onRequestError(e,t,s,a,C)},sharedContext:{buildId:g}},z=new l.NodeNextRequest(e),G=new l.NodeNextResponse(t),Z=u.NextRequestAdapter.fromNodeNextRequest(z,(0,u.signalFromNodeResponse)(t));try{let a,i=async e=>k.handle(Z,B).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=K.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let s=r.get("next.route");if(s){let t=`${W} ${s}`;e.setAttributes({"next.route":s,"http.route":s,"next.span_name":t}),e.updateName(t),a&&a!==e&&(a.setAttribute("http.route",s),a.updateName(t))}else e.updateName(`${W} ${v}`)}),o=async a=>{var n,o;let l=async({previousCacheEntry:r})=>{try{if(!$&&P&&x&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await i(a);e.fetchMetrics=B.renderOpts.fetchMetrics;let o=B.renderOpts.pendingWaitUntil;o&&s.waitUntil&&(s.waitUntil(o),o=void 0);let l=B.renderOpts.collectedTags;if(!b)return await (0,p.sendResponse)(z,G,n,B.renderOpts.pendingWaitUntil),null;{let e=await n.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(n.headers);l&&(t[f.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==B.renderOpts.collectedRevalidate&&!(B.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&B.renderOpts.collectedRevalidate,s=void 0===B.renderOpts.collectedExpire||B.renderOpts.collectedExpire>=f.INFINITE_CACHE?void 0:B.renderOpts.collectedExpire;return{value:{kind:_.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:s}}}}catch(t){throw(null==r?void 0:r.isStale)&&await k.onRequestError(e,t,{routerKind:"App Router",routePath:v,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:P})},!1,C),t}},u=await k.handleResponse({req:e,nextConfig:y,cacheKey:j,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:I,isRoutePPREnabled:!1,isOnDemandRevalidate:P,revalidateOnlyGenerated:x,responseGenerator:l,waitUntil:s.waitUntil,isMinimalMode:$});if(!b)return null;if((null==u||null==(n=u.value)?void 0:n.kind)!==_.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(o=u.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});$||t.setHeader("x-nextjs-cache",P?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),O&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let d=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return $&&b||d.delete(f.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||d.get("Cache-Control")||d.set("Cache-Control",(0,m.getCacheControlHeader)(u.cacheControl)),await (0,p.sendResponse)(z,G,new Response(u.value.body,{headers:d,status:u.value.status||200})),null};F&&H?await o(H):(a=K.getActiveScopeSpan(),await K.withPropagatedContext(e.headers,()=>K.trace(d.BaseServerSpan.handleRequest,{spanName:`${W} ${v}`,kind:n.SpanKind.SERVER,attributes:{"http.method":W,"http.target":e.url}},o),void 0,!F))}catch(t){if(t instanceof w.NoFallbackError||await k.onRequestError(e,t,{routerKind:"App Router",routePath:S,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:P})},!1,C),b)throw t;return await (0,p.sendResponse)(z,G,new Response(null,{status:500})),null}}e.s(["handler",0,P,"patchFetch",0,function(){return(0,s.patchFetch)({workAsyncStorage:O,workUnitAsyncStorage:I})},"routeModule",0,k,"serverHooks",0,C,"workAsyncStorage",0,O,"workUnitAsyncStorage",0,I],866072)},168315,e=>{e.v(t=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(t=>e.l(t))).then(()=>t(862112)))},317691,e=>{e.v(t=>Promise.all(["server/chunks/0dhv_better-auth_dist_adapters_kysely-adapter_index_mjs_0t4t4z8._.js"].map(t=>e.l(t))).then(()=>t(833412)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(t=>e.l(t))).then(()=>t(495181)))},715018,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(t=>e.l(t))).then(()=>t(698370)))},146843,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(t=>e.l(t))).then(()=>t(143740)))},84040,e=>{e.v(t=>Promise.all(["server/chunks/0p91_next_0h94sj1._.js"].map(t=>e.l(t))).then(()=>t(815068)))},427669,e=>{e.v(e=>Promise.resolve().then(()=>e(177730)))},687903,e=>{e.v(e=>Promise.resolve().then(()=>e(912714)))},754121,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__0d7zxm_._.js","server/chunks/src_lib_search_0ymmp0c._.js"].map(t=>e.l(t))).then(()=>t(437856)))}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__0.-oq-7._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[583627,e=>{"use strict";var t=e.i(798003),r=e.i(254226);function n(){return(process.env.WIKI_ADMIN_EMAILS??"").split(",").map(e=>e.trim().toLowerCase()).filter(Boolean)}async function s(e,r){if(r){let e=n();if(e.length>0&&e.includes(r.toLowerCase()))return!0}return((await (0,t.readConfig)()).adminUserIds??[]).includes(e)}async function a(){return(await (0,t.readConfig)()).adminUserIds??[]}async function i(e){await (0,t.updateConfig)(t=>{let r=t.adminUserIds??[];return r.includes(e)?t:{...t,adminUserIds:[...r,e]}})}async function o(e){let r=n().length>0,s=!1;if(await (0,t.updateConfig)(t=>{let n=(t.adminUserIds??[]).filter(t=>t!==e);return 0!==n.length||r?{...t,adminUserIds:n}:(s=!0,t)}),s)throw Error("LAST_ADMIN: cannot remove the last admin with no WIKI_ADMIN_EMAILS configured")}async function l(e){if(n().length>0||((await (0,t.readConfig)()).adminUserIds??[]).length>0)return;let r=!1;await (0,t.updateConfig)(t=>(t.adminUserIds??[]).length>0?t:(r=!0,{...t,adminUserIds:[e]})),r&&console.log(`[wiki-viewer] Bootstrap: first user ${e} promoted to admin`)}async function u(e){if("1"===process.env.WIKI_NO_AUTH)return{ok:!0,user:{id:"local",email:"local@localhost",name:"local"}};let t=await (0,r.requireUser)(e);return t.ok?await s(t.user.id,t.user.email)?{ok:!0,user:t.user}:{ok:!1,status:403,code:"ADMIN_REQUIRED"}:{ok:!1,status:401,code:"UNAUTHORIZED"}}e.s(["addAdmin",0,i,"ensureBootstrapAdmin",0,l,"isAdmin",0,s,"listAdmins",0,a,"removeAdmin",0,o,"requireAdmin",0,u])},874533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},812057,(e,t,r)=>{t.exports=e.x("node:util",()=>require("node:util"))},834938,e=>{"use strict";let t;var r=e.i(874533),n=e.i(812057),s=e.i(912714),a=e.i(750227),i=e.i(660526);let o=(0,n.promisify)(r.execFile),l=/[;|&$`<>(){}\n\r\0]/;function u(){return a.default.join(i.default.homedir(),".wiki-viewer","mounts")}async function d(){if(!0!==t)try{await o("sshfs",["--version"]),t=!0}catch{throw Error("sshfs binary not found. Install sshfs + FUSE (e.g. `apt install sshfs`, `brew install macfuse sshfs`) and ensure it is on PATH.")}}async function c(t){var r;let n=a.default.resolve(t),i=!1;try{i=(await (0,s.readFile)("/proc/mounts","utf8")).split("\n").some(e=>{let t=e.split(" ");return t[1]===n&&/fuse/.test(t[2]??"")})}catch{i=!1}return!!i&&(r=n,new Promise(t=>{let n=!1,s=setTimeout(()=>{n||(n=!0,t(!1))},4e3);e.A(687903).then(({readdir:e})=>e(r)).then(()=>{n||(n=!0,clearTimeout(s),t(!0))}).catch(()=>{n||(n=!0,clearTimeout(s),t(!1))})}))}async function p(e){await d(),await (0,s.mkdir)(e.mountpoint,{recursive:!0});let t=function(e){let{target:t,mountpoint:r,port:n,authMethod:s,keyPath:a,readOnly:i}=e,o=t.user?`${t.user}@`:"",l=[`${o}${t.host}:${t.remotePath}`,r];n&&Number.isInteger(n)&&n>0&&n<65536&&l.push("-p",String(n));let u=["reconnect","ServerAliveInterval=15","ServerAliveCountMax=3","compression=yes","cache=yes","kernel_cache","StrictHostKeyChecking=accept-new","BatchMode=yes"];if(i&&u.push("ro"),"keyfile"===s&&a&&(u.push(`IdentityFile=${a}`),u.push("IdentitiesOnly=yes")),"password"===s){let e=u.indexOf("BatchMode=yes");e>=0&&u.splice(e,1),u.push("password_stdin"),u.push("PreferredAuthentications=password,keyboard-interactive"),u.push("PubkeyAuthentication=no"),u.push("NumberOfPasswordPrompts=1")}return e.extraOptions&&u.push(...e.extraOptions),l.push("-o",u.join(",")),l}(e);if(await new Promise((n,s)=>{let a=(0,r.spawn)("sshfs",t,{stdio:["pipe","ignore","pipe"]}),i="",o=setTimeout(()=>{a.kill("SIGKILL"),s(Error("sshfs mount timed out after 25s."))},25e3);a.stderr?.on("data",e=>{i+=e.toString()}),a.on("error",e=>{clearTimeout(o),s(e.message.includes("ENOENT")?Error("sshfs binary not found on PATH."):e)}),a.on("close",e=>{clearTimeout(o),0===e?n():s(Error(`sshfs exited ${e}: ${i.trim()||"mount failed"}`))}),"password"===e.authMethod&&a.stdin?.write((e.password??"")+"\n"),a.stdin?.end()}),!await c(e.mountpoint))throw Error("sshfs reported success but the mount is not live.")}async function h(e){let t=a.default.resolve(e);for(let[e,r]of[["fusermount",["-u","-z",t]],["umount",[t]]])try{await o(e,r);break}catch{}try{await (0,s.rmdir)(t)}catch{}}e.s(["assertSshfsAvailable",0,d,"isMounted",0,c,"isValidKeyPath",0,function(e){return!(!e||l.test(e)||e.includes(".."))&&(e.startsWith("/")||e.startsWith("~/"))},"mountSshfs",0,p,"mountpointFor",0,function(e){return a.default.join(u(),e)},"mountsDir",0,u,"parseSshTarget",0,function(e){let t;if(!e||l.test(e))return null;let r=e.trim(),n=r.indexOf(":");if(n<=0)return null;let s=r.slice(0,n),a=r.slice(n+1);if(!a.startsWith("/")||a.includes(".."))return null;let i=s,o=s.indexOf("@");return o>=0&&(t=s.slice(0,o),i=s.slice(o+1),!t)?null:i&&/^[a-zA-Z0-9.\-]+$/.test(i)&&(!t||/^[a-zA-Z0-9._\-]+$/.test(t))?{user:t,host:i,remotePath:a}:null},"unmountSshfs",0,h])},504445,e=>{"use strict";var t=e.i(750227);let r=globalThis;!r.__wikiRootDir&&process.env.ROOT_DIR&&(r.__wikiRootDir=t.default.resolve(process.env.ROOT_DIR)),e.s(["clearRootDir",0,function(){r.__wikiRootDir=void 0},"getRootDir",0,function(){return r.__wikiRootDir??""},"isRootDirSet",0,function(){return!!r.__wikiRootDir},"setRootDir",0,function(e){r.__wikiRootDir=t.default.resolve(e)}])},660038,e=>{"use strict";var t=e.i(750227),r=e.i(254226),n=e.i(583627),s=e.i(504445),a=e.i(359211);async function i(e){let r;await (0,a.migrateConfigToWorkspaces)();let n=new URL(e.url).searchParams.get("ws")??e.headers.get("x-workspace")??null;if(n)r=await (0,a.getWorkspace)(n)??null;else{let e=await (0,a.listWorkspaces)();if(0===e.length){let e;r=(e=(0,s.getRootDir)())?{id:"ws_default",name:t.default.basename(e)||"workspace",rootDir:e,createdAt:new Date(0).toISOString()}:null}else r=e.slice().sort((e,t)=>{let r=e.lastOpenedAt?new Date(e.lastOpenedAt).getTime():0,n=t.lastOpenedAt?new Date(t.lastOpenedAt).getTime():0;return n!==r?n-r:e.id<t.id?-1:+(e.id>t.id)})[0]}return r?.ssh&&await (0,a.ensureWorkspaceMounted)(r),r}async function o(e,t="read"){if("1"===process.env.WIKI_NO_AUTH){let r=await i(e);return r?"write"===t&&r.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:r,rootDir:r.rootDir,userId:"local",isAdmin:!0}:{ok:!1,status:400,code:"WORKSPACE_REQUIRED"}}let s=await (0,r.requireUser)(e);if(!s.ok)return{ok:!1,status:401,code:"UNAUTHORIZED"};let l=await (0,n.isAdmin)(s.user.id,s.user.email),u=new URL(e.url).searchParams.get("ws")??e.headers.get("x-workspace")??null,d=await i(e);return d?(0,a.userCanAccess)(d,s.user.id,l)?"write"===t&&d.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:d,rootDir:d.rootDir,userId:s.user.id,isAdmin:l}:{ok:!1,status:403,code:"WORKSPACE_FORBIDDEN"}:{ok:!1,status:u?404:400,code:u?"WORKSPACE_NOT_FOUND":"WORKSPACE_REQUIRED"}}async function l(e,t="read"){let r=await i(e);if(!r){let t=new URL(e.url).searchParams.get("ws")??e.headers.get("x-workspace")??null;return{ok:!1,status:t?404:400,code:t?"WORKSPACE_NOT_FOUND":"WORKSPACE_REQUIRED"}}return"write"===t&&r.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:r,rootDir:r.rootDir}}e.s(["resolveWorkspaceForAgent",0,l,"resolveWorkspaceForUser",0,o])},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},224361,(e,t,r)=>{t.exports=e.x("util",()=>require("util"))},688947,(e,t,r)=>{t.exports=e.x("stream",()=>require("stream"))},427699,(e,t,r)=>{t.exports=e.x("events",()=>require("events"))},228064,e=>{"use strict";var t=e.i(666680),r=e.i(912714),n=e.i(660526),s=e.i(750227),a=e.i(832852);let i="__registry__",o=new Map;function l(){let e=process.env.HOME??n.default.homedir();return s.default.join(e,".wiki-viewer")}function u(){return s.default.join(l(),"agents.json")}function d(e){return(0,t.createHash)("sha256").update(e,"utf8").digest("hex")}async function c(){try{let e=await (0,r.readFile)(u(),"utf8"),t=JSON.parse(e);return{version:1,agents:Array.isArray(t.agents)?t.agents:[]}}catch{return null}}async function p(e){await (0,r.mkdir)(l(),{recursive:!0});let t=u()+".tmp";await (0,r.writeFile)(t,JSON.stringify(e,null,2),{encoding:"utf8",mode:384});try{await (0,r.chmod)(t,384)}catch{}await (0,r.rename)(t,u())}async function h(){let e=await c();if(e)return e;let t={version:1,agents:[]};return await p(t),t}async function f(e){let r=await c();if(!r)return null;let n=d(e);for(let e of r.agents)if(function(e,r){let n=Buffer.from(e.padEnd(64,"0"),"utf8"),s=Buffer.from(r.padEnd(64,"0"),"utf8");return n.length===s.length&&(0,t.timingSafeEqual)(n,s)&&e.length===r.length}(e.tokenHash,n))return e;return null}async function g(e){await (0,a.withFileMutex)(i,async()=>{let t=await h(),r=t.agents.findIndex(t=>t.id===e.id);r>=0?t.agents[r]=e:t.agents.push(e),await p(t)})}async function m(e){return(0,a.withFileMutex)(i,async()=>{let t=await c();if(!t)return!1;let r=t.agents.length;return t.agents=t.agents.filter(t=>t.id!==e),t.agents.length!==r&&(await p(t),!0)})}async function w(e){Date.now()-(o.get(e)??0)<3e4||await (0,a.withFileMutex)(i,async()=>{let t=await c();if(!t)return;let r=t.agents.find(t=>t.id===e);r&&(r.lastSeen=new Date().toISOString(),o.set(e,Date.now()),await p(t))})}e.s(["addAgent",0,g,"hashToken",0,d,"lookupAgentByToken",0,f,"readRegistry",0,c,"removeAgent",0,m,"updateLastSeen",0,w])},215043,552350,e=>{"use strict";var t=e.i(228064);function r(e,t){return(function(e){let t="^",r=0;for(;r<e.length;)"*"===e[r]&&"*"===e[r+1]?(t+=".*","/"===e[r+=2]&&(t+="(?:.+/)?",r++)):("*"===e[r]?t+="[^/]*":"?"===e[r]?t+="[^/]":t+=e[r].replace(/[.+^${}()|[\]\\]/g,"\\$&"),r++);return new RegExp(t+="$")})(e).test(t)}e.s(["matchGlob",0,r],552350);var n=e.i(254226);async function s(e){let r=await (0,n.getSessionFromRequest)(e);if(r?.user){let e=r.user;return{ok:!0,agent:{id:`user:${e.id}`,displayName:e.name,tokenHash:"",scope:{paths:["**/*"],ops:["read","mutate","delete"]},createdAt:"",lastSeen:""}}}let s=e.headers.get("authorization")??"",a=s.startsWith("Bearer ")?s.slice(7).trim():"";if(!a)return{ok:!1,code:"UNAUTHORIZED",message:"No credentials"};let i=await (0,t.lookupAgentByToken)(a);if(!i)return{ok:!1,code:"UNAUTHORIZED",message:"Unknown or invalid token"};let o=e.headers.get("x-agent-id")??"";return o?o!==i.id?{ok:!1,code:"UNAUTHORIZED",message:"X-Agent-Id does not match token owner"}:((0,t.updateLastSeen)(i.id),{ok:!0,agent:i}):{ok:!1,code:"UNAUTHORIZED",message:"X-Agent-Id header required"}}process.env.AGENT_BEARER_TOKEN&&console.warn("[wiki-viewer] AGENT_BEARER_TOKEN is no longer used; manage agents via the AI Panel."),e.s(["checkAuth",0,s,"enforceScope",0,function(e,t){let{scope:n}=e;return void 0!==n.workspaceId&&void 0!==t.workspaceId&&n.workspaceId!==t.workspaceId?{ok:!1,code:"FORBIDDEN",message:`Agent scope does not cover workspace "${t.workspaceId}" (granted: "${n.workspaceId}")`}:n.ops.includes(t.op)?t.filePath&&!n.paths.some(e=>r(e,t.filePath))?{ok:!1,code:"FORBIDDEN",message:`Agent scope does not cover path "${t.filePath}"`}:{ok:!0}:{ok:!1,code:"FORBIDDEN",message:`Agent scope does not allow "${t.op}"`}},"verifyBy",0,function(e,t){return e.id.startsWith("user:")?!t||"owner"===t||"human"===t||t.startsWith("human:")||t===e.id?{ok:!0}:{ok:!1,code:"FORBIDDEN",message:'User agent must use "human", "owner", or own id in "by" field'}:t!==e.id?{ok:!1,code:"FORBIDDEN",message:`"by" field must equal agent id "${e.id}"`}:{ok:!0}}],215043)},413895,e=>{"use strict";var t=e.i(666680);let r=globalThis;r.__wvPendingRegs||(r.__wvPendingRegs=new Map);let n=r.__wvPendingRegs;e.s(["approveRegistration",0,function(e,t){let r=n.get(e);return!!r&&"pending"===r.status&&(r.status="approved",r.tokenPlaintext=t,r.resolvedAt=new Date().toISOString(),!0)},"consumeRegistration",0,function(e){let t=n.get(e);if(!t||"approved"!==t.status||!t.tokenPlaintext)return null;let r=t.tokenPlaintext;return t.status="consumed",t.tokenPlaintext=void 0,r},"createRegistration",0,function(e){let r=`reg_${(0,t.randomBytes)(16).toString("hex")}`,s={registrationId:r,agentId:e.agentId,displayName:e.displayName,requestedScope:e.requestedScope??{paths:["**/*"],ops:["read","mutate"]},requestedAt:new Date().toISOString(),status:"pending"};return n.set(r,s),s},"denyRegistration",0,function(e){let t=n.get(e);return!!t&&"pending"===t.status&&(t.status="denied",t.resolvedAt=new Date().toISOString(),!0)},"getRegistration",0,function(e){return n.get(e)},"listPendingRegistrations",0,function(){return[...n.values()].filter(e=>"pending"===e.status)}])},280137,e=>{"use strict";var t=e.i(364564),r=e.i(102095),n=e.i(691091),s=e.i(475331),a=e.i(490301),i=e.i(670943),o=e.i(690324),l=e.i(243133),u=e.i(404870),d=e.i(420180),c=e.i(867883),p=e.i(336708),h=e.i(682278),f=e.i(157569),g=e.i(844146),m=e.i(193695);e.i(105888);var w=e.i(530564),v=e.i(702414),R=e.i(215043),_=e.i(660038),k=e.i(228064),A=e.i(413895);async function y(e){let t=await (0,R.checkAuth)(e);if(!t.ok)return v.NextResponse.json({error:"UNAUTHORIZED"},{status:401});let r=await (0,_.resolveWorkspaceForAgent)(e);if(!r.ok)return v.NextResponse.json({error:r.code},{status:r.status});let{ws:n,rootDir:s}=r,a=(0,R.enforceScope)(t.agent,{op:"read",workspaceId:n.id});if(!a.ok)return v.NextResponse.json({error:a.code,message:a.message},{status:403});let i=await (0,k.readRegistry)(),o=i?.agents.length??0,l=(0,A.listPendingRegistrations)().length;return v.NextResponse.json({rateLimit:Number(process.env.AGENT_RATE_LIMIT)||60,root:s,registeredAgents:o,pendingRegistrations:l})}e.s(["GET",0,y,"runtime",0,"nodejs"],232229);var E=e.i(232229);let I=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/agent/settings/route",pathname:"/api/agent/settings",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/agent/settings/route.ts",nextConfigOutput:"standalone",userland:E,...{}}),{workAsyncStorage:O,workUnitAsyncStorage:D,serverHooks:x}=I;async function N(e,t,n){n.requestMeta&&(0,s.setRequestMeta)(e,n.requestMeta),I.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let v="/api/agent/settings/route";v=v.replace(/\/index$/,"")||"/";let R=await I.prepare(e,t,{srcPage:v,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==n.waitUntil||n.waitUntil.call(n,Promise.resolve()),null;let{buildId:_,params:k,nextConfig:A,parsedUrl:y,isDraftMode:E,prerenderManifest:O,routerServerContext:D,isOnDemandRevalidate:x,revalidateOnlyGenerated:N,resolvedPathname:P,clientReferenceManifest:S,serverActionsManifest:T}=R,C=(0,o.normalizeAppPath)(v),U=!!(O.dynamicRoutes[C]||O.routes[P]),b=async()=>((null==D?void 0:D.render404)?await D.render404(e,t,y,!1):t.end("This page could not be found"),null);if(U&&!E){let e=!!O.routes[P],t=O.dynamicRoutes[C];if(t&&!1===t.fallback&&!e){if(A.adapterPath)return await b();throw new m.NoFallbackError}}let q=null;!U||I.isDev||E||(q="/index"===(q=P)?"/":q);let M=!0===I.isDev||!U,j=U&&!M;T&&S&&(0,i.setManifestsSingleton)({page:v,clientReferenceManifest:S,serverActionsManifest:T});let H=e.method||"GET",F=(0,a.getTracer)(),$=F.getActiveScopeSpan(),W=!!(null==D?void 0:D.isWrappedByNextServer),B=!!(0,s.getRequestMeta)(e,"minimalMode"),K=(0,s.getRequestMeta)(e,"incrementalCache")||await I.getIncrementalCache(e,A,O,B);null==K||K.resetRequestCache(),globalThis.__incrementalCache=K;let L={params:k,previewProps:O.preview,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts},cacheComponents:!!A.cacheComponents,supportsDynamicResponse:M,incrementalCache:K,cacheLifeProfiles:A.cacheLife,waitUntil:n.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,n,s)=>I.onRequestError(e,t,n,s,D)},sharedContext:{buildId:_}},z=new l.NodeNextRequest(e),Z=new l.NodeNextResponse(t),G=u.NextRequestAdapter.fromNodeNextRequest(z,(0,u.signalFromNodeResponse)(t));try{let s,i=async e=>I.handle(G,L).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=F.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let n=r.get("next.route");if(n){let t=`${H} ${n}`;e.setAttributes({"next.route":n,"http.route":n,"next.span_name":t}),e.updateName(t),s&&s!==e&&(s.setAttribute("http.route",n),s.updateName(t))}else e.updateName(`${H} ${v}`)}),o=async s=>{var a,o;let l=async({previousCacheEntry:r})=>{try{if(!B&&x&&N&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await i(s);e.fetchMetrics=L.renderOpts.fetchMetrics;let o=L.renderOpts.pendingWaitUntil;o&&n.waitUntil&&(n.waitUntil(o),o=void 0);let l=L.renderOpts.collectedTags;if(!U)return await (0,p.sendResponse)(z,Z,a,L.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[g.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==L.renderOpts.collectedRevalidate&&!(L.renderOpts.collectedRevalidate>=g.INFINITE_CACHE)&&L.renderOpts.collectedRevalidate,n=void 0===L.renderOpts.collectedExpire||L.renderOpts.collectedExpire>=g.INFINITE_CACHE?void 0:L.renderOpts.collectedExpire;return{value:{kind:w.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:n}}}}catch(t){throw(null==r?void 0:r.isStale)&&await I.onRequestError(e,t,{routerKind:"App Router",routePath:v,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:j,isOnDemandRevalidate:x})},!1,D),t}},u=await I.handleResponse({req:e,nextConfig:A,cacheKey:q,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:O,isRoutePPREnabled:!1,isOnDemandRevalidate:x,revalidateOnlyGenerated:N,responseGenerator:l,waitUntil:n.waitUntil,isMinimalMode:B});if(!U)return null;if((null==u||null==(a=u.value)?void 0:a.kind)!==w.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(o=u.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});B||t.setHeader("x-nextjs-cache",x?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),E&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let d=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return B&&U||d.delete(g.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||d.get("Cache-Control")||d.set("Cache-Control",(0,f.getCacheControlHeader)(u.cacheControl)),await (0,p.sendResponse)(z,Z,new Response(u.value.body,{headers:d,status:u.value.status||200})),null};W&&$?await o($):(s=F.getActiveScopeSpan(),await F.withPropagatedContext(e.headers,()=>F.trace(d.BaseServerSpan.handleRequest,{spanName:`${H} ${v}`,kind:a.SpanKind.SERVER,attributes:{"http.method":H,"http.target":e.url}},o),void 0,!W))}catch(t){if(t instanceof m.NoFallbackError||await I.onRequestError(e,t,{routerKind:"App Router",routePath:C,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:j,isOnDemandRevalidate:x})},!1,D),U)throw t;return await (0,p.sendResponse)(z,Z,new Response(null,{status:500})),null}}e.s(["handler",0,N,"patchFetch",0,function(){return(0,n.patchFetch)({workAsyncStorage:O,workUnitAsyncStorage:D})},"routeModule",0,I,"serverHooks",0,x,"workAsyncStorage",0,O,"workUnitAsyncStorage",0,D],280137)},168315,e=>{e.v(t=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(t=>e.l(t))).then(()=>t(862112)))},317691,e=>{e.v(t=>Promise.all(["server/chunks/0dhv_better-auth_dist_adapters_kysely-adapter_index_mjs_0t4t4z8._.js"].map(t=>e.l(t))).then(()=>t(833412)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(t=>e.l(t))).then(()=>t(495181)))},715018,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(t=>e.l(t))).then(()=>t(698370)))},146843,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(t=>e.l(t))).then(()=>t(143740)))},84040,e=>{e.v(t=>Promise.all(["server/chunks/0p91_next_0h94sj1._.js"].map(t=>e.l(t))).then(()=>t(815068)))},427669,e=>{e.v(e=>Promise.resolve().then(()=>e(177730)))},687903,e=>{e.v(e=>Promise.resolve().then(()=>e(912714)))},754121,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__0d7zxm_._.js","server/chunks/src_lib_search_0ymmp0c._.js"].map(t=>e.l(t))).then(()=>t(437856)))}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__000spch._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[874533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},812057,(e,t,r)=>{t.exports=e.x("node:util",()=>require("node:util"))},834938,e=>{"use strict";let t;var r=e.i(874533),s=e.i(812057),n=e.i(912714),i=e.i(750227),a=e.i(660526);let o=(0,s.promisify)(r.execFile),l=/[;|&$`<>(){}\n\r\0]/;function u(){return i.default.join(a.default.homedir(),".wiki-viewer","mounts")}async function d(){if(!0!==t)try{await o("sshfs",["--version"]),t=!0}catch{throw Error("sshfs binary not found. Install sshfs + FUSE (e.g. `apt install sshfs`, `brew install macfuse sshfs`) and ensure it is on PATH.")}}async function c(t){var r;let s=i.default.resolve(t),a=!1;try{a=(await (0,n.readFile)("/proc/mounts","utf8")).split("\n").some(e=>{let t=e.split(" ");return t[1]===s&&/fuse/.test(t[2]??"")})}catch{a=!1}return!!a&&(r=s,new Promise(t=>{let s=!1,n=setTimeout(()=>{s||(s=!0,t(!1))},4e3);e.A(687903).then(({readdir:e})=>e(r)).then(()=>{s||(s=!0,clearTimeout(n),t(!0))}).catch(()=>{s||(s=!0,clearTimeout(n),t(!1))})}))}async function p(e){await d(),await (0,n.mkdir)(e.mountpoint,{recursive:!0});let t=function(e){let{target:t,mountpoint:r,port:s,authMethod:n,keyPath:i,readOnly:a}=e,o=t.user?`${t.user}@`:"",l=[`${o}${t.host}:${t.remotePath}`,r];s&&Number.isInteger(s)&&s>0&&s<65536&&l.push("-p",String(s));let u=["reconnect","ServerAliveInterval=15","ServerAliveCountMax=3","compression=yes","cache=yes","kernel_cache","StrictHostKeyChecking=accept-new","BatchMode=yes"];if(a&&u.push("ro"),"keyfile"===n&&i&&(u.push(`IdentityFile=${i}`),u.push("IdentitiesOnly=yes")),"password"===n){let e=u.indexOf("BatchMode=yes");e>=0&&u.splice(e,1),u.push("password_stdin"),u.push("PreferredAuthentications=password,keyboard-interactive"),u.push("PubkeyAuthentication=no"),u.push("NumberOfPasswordPrompts=1")}return e.extraOptions&&u.push(...e.extraOptions),l.push("-o",u.join(",")),l}(e);if(await new Promise((s,n)=>{let i=(0,r.spawn)("sshfs",t,{stdio:["pipe","ignore","pipe"]}),a="",o=setTimeout(()=>{i.kill("SIGKILL"),n(Error("sshfs mount timed out after 25s."))},25e3);i.stderr?.on("data",e=>{a+=e.toString()}),i.on("error",e=>{clearTimeout(o),n(e.message.includes("ENOENT")?Error("sshfs binary not found on PATH."):e)}),i.on("close",e=>{clearTimeout(o),0===e?s():n(Error(`sshfs exited ${e}: ${a.trim()||"mount failed"}`))}),"password"===e.authMethod&&i.stdin?.write((e.password??"")+"\n"),i.stdin?.end()}),!await c(e.mountpoint))throw Error("sshfs reported success but the mount is not live.")}async function h(e){let t=i.default.resolve(e);for(let[e,r]of[["fusermount",["-u","-z",t]],["umount",[t]]])try{await o(e,r);break}catch{}try{await (0,n.rmdir)(t)}catch{}}e.s(["assertSshfsAvailable",0,d,"isMounted",0,c,"isValidKeyPath",0,function(e){return!(!e||l.test(e)||e.includes(".."))&&(e.startsWith("/")||e.startsWith("~/"))},"mountSshfs",0,p,"mountpointFor",0,function(e){return i.default.join(u(),e)},"mountsDir",0,u,"parseSshTarget",0,function(e){let t;if(!e||l.test(e))return null;let r=e.trim(),s=r.indexOf(":");if(s<=0)return null;let n=r.slice(0,s),i=r.slice(s+1);if(!i.startsWith("/")||i.includes(".."))return null;let a=n,o=n.indexOf("@");return o>=0&&(t=n.slice(0,o),a=n.slice(o+1),!t)?null:a&&/^[a-zA-Z0-9.\-]+$/.test(a)&&(!t||/^[a-zA-Z0-9._\-]+$/.test(t))?{user:t,host:a,remotePath:i}:null},"unmountSshfs",0,h])},504445,e=>{"use strict";var t=e.i(750227);let r=globalThis;!r.__wikiRootDir&&process.env.ROOT_DIR&&(r.__wikiRootDir=t.default.resolve(process.env.ROOT_DIR)),e.s(["clearRootDir",0,function(){r.__wikiRootDir=void 0},"getRootDir",0,function(){return r.__wikiRootDir??""},"isRootDirSet",0,function(){return!!r.__wikiRootDir},"setRootDir",0,function(e){r.__wikiRootDir=t.default.resolve(e)}])},402662,e=>{"use strict";var t=e.i(702414);e.s(["checkOrigin",0,function(e){let r=e.method.toUpperCase();if("GET"===r||"HEAD"===r||"OPTIONS"===r)return null;let s=e.headers.get("origin"),n=e.headers.get("referer");if(!s&&!n)return null;let i=function(e){let t=Array.from(new Set(["localhost","127.0.0.1",e.split(":")[0],...(process.env.WIKI_OWNER_HOSTS??"").split(",").map(e=>e.trim()).filter(Boolean)])),r=["",":3000",":3003"];e.includes(":")&&r.push(":"+e.split(":")[1]);let s=new Set;for(let e of t)for(let t of["http","https"])for(let n of r)s.add(`${t}://${e}${n}`);return s}(e.headers.get("host")??"");if(s)return i.has(s)?null:t.NextResponse.json({error:"FORBIDDEN",message:"Bad origin"},{status:403});if(n){try{let{protocol:e,host:t}=new URL(n);if(i.has(`${e}//${t}`))return null}catch{}return t.NextResponse.json({error:"FORBIDDEN",message:"Bad referer"},{status:403})}return null}])},522530,e=>{"use strict";var t=e.i(364564),r=e.i(102095),s=e.i(691091),n=e.i(475331),i=e.i(490301),a=e.i(670943),o=e.i(690324),l=e.i(243133),u=e.i(404870),d=e.i(420180),c=e.i(867883),p=e.i(336708),h=e.i(682278),f=e.i(157569),m=e.i(844146),v=e.i(193695);e.i(105888);var _=e.i(530564),R=e.i(912714),w=e.i(702414),y=e.i(402662),g=e.i(254226),E=e.i(798003),x=e.i(504445),k=e.i(359211),P=e.i(750227);async function O(e){let t=(0,y.checkOrigin)(e);if(t)return t;let r=await (0,g.requireUser)(e);if(!r.ok)return w.NextResponse.json({error:"UNAUTHORIZED"},{status:401});let s=await e.json(),n=s.path?.trim();if(!n)return w.NextResponse.json({error:"Missing path"},{status:400});try{if(!(await (0,R.stat)(n)).isDirectory())return w.NextResponse.json({error:"Not a directory"},{status:400})}catch{return w.NextResponse.json({error:"Directory not found"},{status:404})}(0,x.setRootDir)(n),await (0,E.writeConfig)({lastOpenedPath:n});let i=P.default.resolve(n),a=(await (0,k.listWorkspaces)()).find(e=>e.rootDir===i)??await (0,k.createWorkspace)({rootDir:n,createdBy:r.user.id});return w.NextResponse.json({ok:!0,path:n,workspaceId:a.id})}e.s(["POST",0,O],346549);var A=e.i(346549);let T=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/system/set-root/route",pathname:"/api/system/set-root",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/system/set-root/route.ts",nextConfigOutput:"standalone",userland:A,...{}}),{workAsyncStorage:N,workUnitAsyncStorage:C,serverHooks:b}=T;async function S(e,t,s){s.requestMeta&&(0,n.setRequestMeta)(e,s.requestMeta),T.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let R="/api/system/set-root/route";R=R.replace(/\/index$/,"")||"/";let w=await T.prepare(e,t,{srcPage:R,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==s.waitUntil||s.waitUntil.call(s,Promise.resolve()),null;let{buildId:y,params:g,nextConfig:E,parsedUrl:x,isDraftMode:k,prerenderManifest:P,routerServerContext:O,isOnDemandRevalidate:A,revalidateOnlyGenerated:N,resolvedPathname:C,clientReferenceManifest:b,serverActionsManifest:S}=w,D=(0,o.normalizeAppPath)(R),j=!!(P.dynamicRoutes[D]||P.routes[C]),I=async()=>((null==O?void 0:O.render404)?await O.render404(e,t,x,!1):t.end("This page could not be found"),null);if(j&&!k){let e=!!P.routes[C],t=P.dynamicRoutes[D];if(t&&!1===t.fallback&&!e){if(E.adapterPath)return await I();throw new v.NoFallbackError}}let q=null;!j||T.isDev||k||(q="/index"===(q=C)?"/":q);let $=!0===T.isDev||!j,H=j&&!$;S&&b&&(0,a.setManifestsSingleton)({page:R,clientReferenceManifest:b,serverActionsManifest:S});let U=e.method||"GET",M=(0,i.getTracer)(),B=M.getActiveScopeSpan(),F=!!(null==O?void 0:O.isWrappedByNextServer),K=!!(0,n.getRequestMeta)(e,"minimalMode"),z=(0,n.getRequestMeta)(e,"incrementalCache")||await T.getIncrementalCache(e,E,P,K);null==z||z.resetRequestCache(),globalThis.__incrementalCache=z;let W={params:g,previewProps:P.preview,renderOpts:{experimental:{authInterrupts:!!E.experimental.authInterrupts},cacheComponents:!!E.cacheComponents,supportsDynamicResponse:$,incrementalCache:z,cacheLifeProfiles:E.cacheLife,waitUntil:s.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,s,n)=>T.onRequestError(e,t,s,n,O)},sharedContext:{buildId:y}},L=new l.NodeNextRequest(e),G=new l.NodeNextResponse(t),V=u.NextRequestAdapter.fromNodeNextRequest(L,(0,u.signalFromNodeResponse)(t));try{let n,a=async e=>T.handle(V,W).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=M.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let s=r.get("next.route");if(s){let t=`${U} ${s}`;e.setAttributes({"next.route":s,"http.route":s,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",s),n.updateName(t))}else e.updateName(`${U} ${R}`)}),o=async n=>{var i,o;let l=async({previousCacheEntry:r})=>{try{if(!K&&A&&N&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await a(n);e.fetchMetrics=W.renderOpts.fetchMetrics;let o=W.renderOpts.pendingWaitUntil;o&&s.waitUntil&&(s.waitUntil(o),o=void 0);let l=W.renderOpts.collectedTags;if(!j)return await (0,p.sendResponse)(L,G,i,W.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);l&&(t[m.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==W.renderOpts.collectedRevalidate&&!(W.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&W.renderOpts.collectedRevalidate,s=void 0===W.renderOpts.collectedExpire||W.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:W.renderOpts.collectedExpire;return{value:{kind:_.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:s}}}}catch(t){throw(null==r?void 0:r.isStale)&&await T.onRequestError(e,t,{routerKind:"App Router",routePath:R,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:A})},!1,O),t}},u=await T.handleResponse({req:e,nextConfig:E,cacheKey:q,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:P,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:N,responseGenerator:l,waitUntil:s.waitUntil,isMinimalMode:K});if(!j)return null;if((null==u||null==(i=u.value)?void 0:i.kind)!==_.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(o=u.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",A?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),k&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let d=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return K&&j||d.delete(m.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||d.get("Cache-Control")||d.set("Cache-Control",(0,f.getCacheControlHeader)(u.cacheControl)),await (0,p.sendResponse)(L,G,new Response(u.value.body,{headers:d,status:u.value.status||200})),null};F&&B?await o(B):(n=M.getActiveScopeSpan(),await M.withPropagatedContext(e.headers,()=>M.trace(d.BaseServerSpan.handleRequest,{spanName:`${U} ${R}`,kind:i.SpanKind.SERVER,attributes:{"http.method":U,"http.target":e.url}},o),void 0,!F))}catch(t){if(t instanceof v.NoFallbackError||await T.onRequestError(e,t,{routerKind:"App Router",routePath:D,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:H,isOnDemandRevalidate:A})},!1,O),j)throw t;return await (0,p.sendResponse)(L,G,new Response(null,{status:500})),null}}e.s(["handler",0,S,"patchFetch",0,function(){return(0,s.patchFetch)({workAsyncStorage:N,workUnitAsyncStorage:C})},"routeModule",0,T,"serverHooks",0,b,"workAsyncStorage",0,N,"workUnitAsyncStorage",0,C],522530)},168315,e=>{e.v(t=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(t=>e.l(t))).then(()=>t(862112)))},317691,e=>{e.v(t=>Promise.all(["server/chunks/0dhv_better-auth_dist_adapters_kysely-adapter_index_mjs_0t4t4z8._.js"].map(t=>e.l(t))).then(()=>t(833412)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(t=>e.l(t))).then(()=>t(495181)))},715018,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(t=>e.l(t))).then(()=>t(698370)))},146843,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(t=>e.l(t))).then(()=>t(143740)))},84040,e=>{e.v(t=>Promise.all(["server/chunks/0p91_next_0h94sj1._.js"].map(t=>e.l(t))).then(()=>t(815068)))},427669,e=>{e.v(e=>Promise.resolve().then(()=>e(177730)))},687903,e=>{e.v(e=>Promise.resolve().then(()=>e(912714)))},754121,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__0d7zxm_._.js","server/chunks/src_lib_search_0ymmp0c._.js"].map(t=>e.l(t))).then(()=>t(437856)))}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__01oin-a._.js.map
@@ -0,0 +1,16 @@
1
+ module.exports=[583627,e=>{"use strict";var t=e.i(798003),r=e.i(254226);function a(){return(process.env.WIKI_ADMIN_EMAILS??"").split(",").map(e=>e.trim().toLowerCase()).filter(Boolean)}async function n(e,r){if(r){let e=a();if(e.length>0&&e.includes(r.toLowerCase()))return!0}return((await (0,t.readConfig)()).adminUserIds??[]).includes(e)}async function i(){return(await (0,t.readConfig)()).adminUserIds??[]}async function s(e){await (0,t.updateConfig)(t=>{let r=t.adminUserIds??[];return r.includes(e)?t:{...t,adminUserIds:[...r,e]}})}async function o(e){let r=a().length>0,n=!1;if(await (0,t.updateConfig)(t=>{let a=(t.adminUserIds??[]).filter(t=>t!==e);return 0!==a.length||r?{...t,adminUserIds:a}:(n=!0,t)}),n)throw Error("LAST_ADMIN: cannot remove the last admin with no WIKI_ADMIN_EMAILS configured")}async function u(e){if(a().length>0||((await (0,t.readConfig)()).adminUserIds??[]).length>0)return;let r=!1;await (0,t.updateConfig)(t=>(t.adminUserIds??[]).length>0?t:(r=!0,{...t,adminUserIds:[e]})),r&&console.log(`[wiki-viewer] Bootstrap: first user ${e} promoted to admin`)}async function l(e){if("1"===process.env.WIKI_NO_AUTH)return{ok:!0,user:{id:"local",email:"local@localhost",name:"local"}};let t=await (0,r.requireUser)(e);return t.ok?await n(t.user.id,t.user.email)?{ok:!0,user:t.user}:{ok:!1,status:403,code:"ADMIN_REQUIRED"}:{ok:!1,status:401,code:"UNAUTHORIZED"}}e.s(["addAdmin",0,s,"ensureBootstrapAdmin",0,u,"isAdmin",0,n,"listAdmins",0,i,"removeAdmin",0,o,"requireAdmin",0,l])},874533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},812057,(e,t,r)=>{t.exports=e.x("node:util",()=>require("node:util"))},834938,e=>{"use strict";let t;var r=e.i(874533),a=e.i(812057),n=e.i(912714),i=e.i(750227),s=e.i(660526);let o=(0,a.promisify)(r.execFile),u=/[;|&$`<>(){}\n\r\0]/;function l(){return i.default.join(s.default.homedir(),".wiki-viewer","mounts")}async function c(){if(!0!==t)try{await o("sshfs",["--version"]),t=!0}catch{throw Error("sshfs binary not found. Install sshfs + FUSE (e.g. `apt install sshfs`, `brew install macfuse sshfs`) and ensure it is on PATH.")}}async function d(t){var r;let a=i.default.resolve(t),s=!1;try{s=(await (0,n.readFile)("/proc/mounts","utf8")).split("\n").some(e=>{let t=e.split(" ");return t[1]===a&&/fuse/.test(t[2]??"")})}catch{s=!1}return!!s&&(r=a,new Promise(t=>{let a=!1,n=setTimeout(()=>{a||(a=!0,t(!1))},4e3);e.A(687903).then(({readdir:e})=>e(r)).then(()=>{a||(a=!0,clearTimeout(n),t(!0))}).catch(()=>{a||(a=!0,clearTimeout(n),t(!1))})}))}async function p(e){await c(),await (0,n.mkdir)(e.mountpoint,{recursive:!0});let t=function(e){let{target:t,mountpoint:r,port:a,authMethod:n,keyPath:i,readOnly:s}=e,o=t.user?`${t.user}@`:"",u=[`${o}${t.host}:${t.remotePath}`,r];a&&Number.isInteger(a)&&a>0&&a<65536&&u.push("-p",String(a));let l=["reconnect","ServerAliveInterval=15","ServerAliveCountMax=3","compression=yes","cache=yes","kernel_cache","StrictHostKeyChecking=accept-new","BatchMode=yes"];if(s&&l.push("ro"),"keyfile"===n&&i&&(l.push(`IdentityFile=${i}`),l.push("IdentitiesOnly=yes")),"password"===n){let e=l.indexOf("BatchMode=yes");e>=0&&l.splice(e,1),l.push("password_stdin"),l.push("PreferredAuthentications=password,keyboard-interactive"),l.push("PubkeyAuthentication=no"),l.push("NumberOfPasswordPrompts=1")}return e.extraOptions&&l.push(...e.extraOptions),u.push("-o",l.join(",")),u}(e);if(await new Promise((a,n)=>{let i=(0,r.spawn)("sshfs",t,{stdio:["pipe","ignore","pipe"]}),s="",o=setTimeout(()=>{i.kill("SIGKILL"),n(Error("sshfs mount timed out after 25s."))},25e3);i.stderr?.on("data",e=>{s+=e.toString()}),i.on("error",e=>{clearTimeout(o),n(e.message.includes("ENOENT")?Error("sshfs binary not found on PATH."):e)}),i.on("close",e=>{clearTimeout(o),0===e?a():n(Error(`sshfs exited ${e}: ${s.trim()||"mount failed"}`))}),"password"===e.authMethod&&i.stdin?.write((e.password??"")+"\n"),i.stdin?.end()}),!await d(e.mountpoint))throw Error("sshfs reported success but the mount is not live.")}async function f(e){let t=i.default.resolve(e);for(let[e,r]of[["fusermount",["-u","-z",t]],["umount",[t]]])try{await o(e,r);break}catch{}try{await (0,n.rmdir)(t)}catch{}}e.s(["assertSshfsAvailable",0,c,"isMounted",0,d,"isValidKeyPath",0,function(e){return!(!e||u.test(e)||e.includes(".."))&&(e.startsWith("/")||e.startsWith("~/"))},"mountSshfs",0,p,"mountpointFor",0,function(e){return i.default.join(l(),e)},"mountsDir",0,l,"parseSshTarget",0,function(e){let t;if(!e||u.test(e))return null;let r=e.trim(),a=r.indexOf(":");if(a<=0)return null;let n=r.slice(0,a),i=r.slice(a+1);if(!i.startsWith("/")||i.includes(".."))return null;let s=n,o=n.indexOf("@");return o>=0&&(t=n.slice(0,o),s=n.slice(o+1),!t)?null:s&&/^[a-zA-Z0-9.\-]+$/.test(s)&&(!t||/^[a-zA-Z0-9._\-]+$/.test(t))?{user:t,host:s,remotePath:i}:null},"unmountSshfs",0,f])},504445,e=>{"use strict";var t=e.i(750227);let r=globalThis;!r.__wikiRootDir&&process.env.ROOT_DIR&&(r.__wikiRootDir=t.default.resolve(process.env.ROOT_DIR)),e.s(["clearRootDir",0,function(){r.__wikiRootDir=void 0},"getRootDir",0,function(){return r.__wikiRootDir??""},"isRootDirSet",0,function(){return!!r.__wikiRootDir},"setRootDir",0,function(e){r.__wikiRootDir=t.default.resolve(e)}])},660038,e=>{"use strict";var t=e.i(750227),r=e.i(254226),a=e.i(583627),n=e.i(504445),i=e.i(359211);async function s(e){let r;await (0,i.migrateConfigToWorkspaces)();let a=new URL(e.url).searchParams.get("ws")??e.headers.get("x-workspace")??null;if(a)r=await (0,i.getWorkspace)(a)??null;else{let e=await (0,i.listWorkspaces)();if(0===e.length){let e;r=(e=(0,n.getRootDir)())?{id:"ws_default",name:t.default.basename(e)||"workspace",rootDir:e,createdAt:new Date(0).toISOString()}:null}else r=e.slice().sort((e,t)=>{let r=e.lastOpenedAt?new Date(e.lastOpenedAt).getTime():0,a=t.lastOpenedAt?new Date(t.lastOpenedAt).getTime():0;return a!==r?a-r:e.id<t.id?-1:+(e.id>t.id)})[0]}return r?.ssh&&await (0,i.ensureWorkspaceMounted)(r),r}async function o(e,t="read"){if("1"===process.env.WIKI_NO_AUTH){let r=await s(e);return r?"write"===t&&r.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:r,rootDir:r.rootDir,userId:"local",isAdmin:!0}:{ok:!1,status:400,code:"WORKSPACE_REQUIRED"}}let n=await (0,r.requireUser)(e);if(!n.ok)return{ok:!1,status:401,code:"UNAUTHORIZED"};let u=await (0,a.isAdmin)(n.user.id,n.user.email),l=new URL(e.url).searchParams.get("ws")??e.headers.get("x-workspace")??null,c=await s(e);return c?(0,i.userCanAccess)(c,n.user.id,u)?"write"===t&&c.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:c,rootDir:c.rootDir,userId:n.user.id,isAdmin:u}:{ok:!1,status:403,code:"WORKSPACE_FORBIDDEN"}:{ok:!1,status:l?404:400,code:l?"WORKSPACE_NOT_FOUND":"WORKSPACE_REQUIRED"}}async function u(e,t="read"){let r=await s(e);if(!r){let t=new URL(e.url).searchParams.get("ws")??e.headers.get("x-workspace")??null;return{ok:!1,status:t?404:400,code:t?"WORKSPACE_NOT_FOUND":"WORKSPACE_REQUIRED"}}return"write"===t&&r.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:r,rootDir:r.rootDir}}e.s(["resolveWorkspaceForAgent",0,u,"resolveWorkspaceForUser",0,o])},719126,e=>{"use strict";var t=e.i(666680),r=e.i(912714),a=e.i(750227);function n(e){let t=e.replace(/\\/g,"/");return".proof"===t||t.startsWith(".proof/")||".git"===t||t.startsWith(".git/")}async function i(e,t){if(!e)return null;let i=a.default.normalize(t);if(i.startsWith("..")||a.default.isAbsolute(i)||n(i))return null;let s=a.default.join(e,i);if(s!==e&&!s.startsWith(e+a.default.sep))return null;try{let t=await (0,r.realpath)(s);if(t!==e&&!t.startsWith(e+a.default.sep))return null}catch{let t=a.default.dirname(s);if(t!==s)try{let n=await (0,r.realpath)(t);if(n!==e&&!n.startsWith(e+a.default.sep))return null}catch{}}return s}let s={".md":"text/markdown; charset=utf-8",".markdown":"text/markdown; charset=utf-8",".txt":"text/plain; charset=utf-8",".json":"application/json; charset=utf-8",".jsonc":"application/json; charset=utf-8",".ts":"text/typescript; charset=utf-8",".tsx":"text/typescript; charset=utf-8",".mts":"text/typescript; charset=utf-8",".js":"text/javascript; charset=utf-8",".jsx":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".html":"text/html; charset=utf-8",".htm":"text/html; charset=utf-8",".css":"text/css; charset=utf-8",".yaml":"text/yaml; charset=utf-8",".yml":"text/yaml; charset=utf-8",".toml":"text/toml; charset=utf-8",".xml":"application/xml; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".pdf":"application/pdf",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".py":"text/x-python; charset=utf-8",".rs":"text/x-rustsrc; charset=utf-8",".go":"text/x-go; charset=utf-8",".sh":"text/x-shellscript; charset=utf-8",".csv":"text/csv; charset=utf-8",".env":"text/plain; charset=utf-8"};async function o(e,t){let a=420;try{let t=await (0,r.stat)(e);a=511&t.mode}catch{}let n=e+".~"+process.pid+"."+Date.now()+".tmp",i=await (0,r.open)(n,"w",a);try{await i.write(t),await i.datasync()}finally{await i.close()}await (0,r.rename)(n,e)}async function u(e,t){let n=a.default.dirname(e);if(t)return await (0,r.mkdir)(n,{recursive:!0}),!0;try{return await (0,r.stat)(n),!0}catch{return!1}}e.s(["atomicWrite",0,o,"ensureParentDir",0,u,"extractShaHex",0,function(e){return e.replace(/^"/,"").replace(/"$/,"").replace(/^sha256:/,"")},"isDeniedRelPath",0,n,"isMarkdown",0,function(e){return e.endsWith(".md")||e.endsWith(".markdown")},"looksLikeBinary",0,function(e){return e.slice(0,Math.min(e.length,8192)).includes(0)},"mimeByExt",0,function(e){return s[a.default.extname(e).toLowerCase()]??"application/octet-stream"},"safeAbsPath",0,i,"sha256ofBuf",0,function(e){return"sha256:"+(0,t.createHash)("sha256").update(e).digest("hex")}])},814747,(e,t,r)=>{t.exports=e.x("path",()=>require("path"))},224361,(e,t,r)=>{t.exports=e.x("util",()=>require("util"))},688947,(e,t,r)=>{t.exports=e.x("stream",()=>require("stream"))},427699,(e,t,r)=>{t.exports=e.x("events",()=>require("events"))},228064,e=>{"use strict";var t=e.i(666680),r=e.i(912714),a=e.i(660526),n=e.i(750227),i=e.i(832852);let s="__registry__",o=new Map;function u(){let e=process.env.HOME??a.default.homedir();return n.default.join(e,".wiki-viewer")}function l(){return n.default.join(u(),"agents.json")}function c(e){return(0,t.createHash)("sha256").update(e,"utf8").digest("hex")}async function d(){try{let e=await (0,r.readFile)(l(),"utf8"),t=JSON.parse(e);return{version:1,agents:Array.isArray(t.agents)?t.agents:[]}}catch{return null}}async function p(e){await (0,r.mkdir)(u(),{recursive:!0});let t=l()+".tmp";await (0,r.writeFile)(t,JSON.stringify(e,null,2),{encoding:"utf8",mode:384});try{await (0,r.chmod)(t,384)}catch{}await (0,r.rename)(t,l())}async function f(){let e=await d();if(e)return e;let t={version:1,agents:[]};return await p(t),t}async function h(e){let r=await d();if(!r)return null;let a=c(e);for(let e of r.agents)if(function(e,r){let a=Buffer.from(e.padEnd(64,"0"),"utf8"),n=Buffer.from(r.padEnd(64,"0"),"utf8");return a.length===n.length&&(0,t.timingSafeEqual)(a,n)&&e.length===r.length}(e.tokenHash,a))return e;return null}async function m(e){await (0,i.withFileMutex)(s,async()=>{let t=await f(),r=t.agents.findIndex(t=>t.id===e.id);r>=0?t.agents[r]=e:t.agents.push(e),await p(t)})}async function w(e){return(0,i.withFileMutex)(s,async()=>{let t=await d();if(!t)return!1;let r=t.agents.length;return t.agents=t.agents.filter(t=>t.id!==e),t.agents.length!==r&&(await p(t),!0)})}async function g(e){Date.now()-(o.get(e)??0)<3e4||await (0,i.withFileMutex)(s,async()=>{let t=await d();if(!t)return;let r=t.agents.find(t=>t.id===e);r&&(r.lastSeen=new Date().toISOString(),o.set(e,Date.now()),await p(t))})}e.s(["addAgent",0,m,"hashToken",0,c,"lookupAgentByToken",0,h,"readRegistry",0,d,"removeAgent",0,w,"updateLastSeen",0,g])},215043,552350,e=>{"use strict";var t=e.i(228064);function r(e,t){return(function(e){let t="^",r=0;for(;r<e.length;)"*"===e[r]&&"*"===e[r+1]?(t+=".*","/"===e[r+=2]&&(t+="(?:.+/)?",r++)):("*"===e[r]?t+="[^/]*":"?"===e[r]?t+="[^/]":t+=e[r].replace(/[.+^${}()|[\]\\]/g,"\\$&"),r++);return new RegExp(t+="$")})(e).test(t)}e.s(["matchGlob",0,r],552350);var a=e.i(254226);async function n(e){let r=await (0,a.getSessionFromRequest)(e);if(r?.user){let e=r.user;return{ok:!0,agent:{id:`user:${e.id}`,displayName:e.name,tokenHash:"",scope:{paths:["**/*"],ops:["read","mutate","delete"]},createdAt:"",lastSeen:""}}}let n=e.headers.get("authorization")??"",i=n.startsWith("Bearer ")?n.slice(7).trim():"";if(!i)return{ok:!1,code:"UNAUTHORIZED",message:"No credentials"};let s=await (0,t.lookupAgentByToken)(i);if(!s)return{ok:!1,code:"UNAUTHORIZED",message:"Unknown or invalid token"};let o=e.headers.get("x-agent-id")??"";return o?o!==s.id?{ok:!1,code:"UNAUTHORIZED",message:"X-Agent-Id does not match token owner"}:((0,t.updateLastSeen)(s.id),{ok:!0,agent:s}):{ok:!1,code:"UNAUTHORIZED",message:"X-Agent-Id header required"}}process.env.AGENT_BEARER_TOKEN&&console.warn("[wiki-viewer] AGENT_BEARER_TOKEN is no longer used; manage agents via the AI Panel."),e.s(["checkAuth",0,n,"enforceScope",0,function(e,t){let{scope:a}=e;return void 0!==a.workspaceId&&void 0!==t.workspaceId&&a.workspaceId!==t.workspaceId?{ok:!1,code:"FORBIDDEN",message:`Agent scope does not cover workspace "${t.workspaceId}" (granted: "${a.workspaceId}")`}:a.ops.includes(t.op)?t.filePath&&!a.paths.some(e=>r(e,t.filePath))?{ok:!1,code:"FORBIDDEN",message:`Agent scope does not cover path "${t.filePath}"`}:{ok:!0}:{ok:!1,code:"FORBIDDEN",message:`Agent scope does not allow "${t.op}"`}},"verifyBy",0,function(e,t){return e.id.startsWith("user:")?!t||"owner"===t||"human"===t||t.startsWith("human:")||t===e.id?{ok:!0}:{ok:!1,code:"FORBIDDEN",message:'User agent must use "human", "owner", or own id in "by" field'}:t!==e.id?{ok:!1,code:"FORBIDDEN",message:`"by" field must equal agent id "${e.id}"`}:{ok:!0}}],215043)},973909,e=>{"use strict";var t=e.i(912714),r=e.i(750227);function a(e,t){return r.default.join(e,".proof",t+".json")}async function n(e,r){let n=a(e,r);try{let e=await (0,t.readFile)(n,"utf-8"),r=JSON.parse(e);if(1!==r.schemaVersion)throw Error(`Sidecar schema version mismatch: expected 1, got ${r.schemaVersion}`);return r}catch(e){if(e instanceof Error&&"code"in e&&"ENOENT"===e.code)return null;throw e}}async function i(e,n,i){let s=a(e,n);await (0,t.mkdir)(r.default.dirname(s),{recursive:!0});let o=s+".tmp";await (0,t.writeFile)(o,JSON.stringify(i,null,2),"utf-8"),await (0,t.rename)(o,s)}async function s(e,n,i){let s=a(e,n),o=a(e,i);try{await (0,t.mkdir)(r.default.dirname(o),{recursive:!0}),await (0,t.rename)(s,o)}catch(e){if("ENOENT"===e.code)return;throw e}}async function o(e,r){let n=a(e,r);try{await (0,t.unlink)(n)}catch(e){if("ENOENT"===e.code)return;throw e}}e.s(["deleteSidecar",0,o,"emptySidecar",0,function(e){let t=new Date().toISOString();return{schemaVersion:1,path:e,revision:0,createdAt:t,updatedAt:t,refMap:{},refAliases:{},comments:[],suggestions:[],archivedSuggestions:[],events:[],nextEventId:1,lastAck:{},fingerprint:"",blockProvenance:{}}},"moveSidecar",0,s,"readSidecar",0,n,"writeSidecar",0,i])},670910,e=>{"use strict";var t=e.i(286607),r=e.i(750227),a=e.i(660526),n=e.i(902157);let i=null;e.s(["writeAuditRow",0,function(e){try{(function(){if(i)return i;let e=r.default.join(process.env.HOME??a.default.homedir(),".wiki-viewer");(0,n.mkdirSync)(e,{recursive:!0});let s=r.default.join(e,"auth.db");(i=new t.default(s)).pragma("journal_mode = WAL"),i.exec(`
2
+ CREATE TABLE IF NOT EXISTS agent_fs_audit (
3
+ id INTEGER PRIMARY KEY AUTOINCREMENT,
4
+ agent_id TEXT NOT NULL,
5
+ op TEXT NOT NULL,
6
+ path TEXT NOT NULL,
7
+ old_sha TEXT,
8
+ new_sha TEXT,
9
+ forced INTEGER NOT NULL DEFAULT 0,
10
+ at TEXT NOT NULL,
11
+ workspace_id TEXT
12
+ )
13
+ `);try{i.exec("ALTER TABLE agent_fs_audit ADD COLUMN workspace_id TEXT")}catch{}return i})().prepare(`INSERT INTO agent_fs_audit (agent_id, op, path, old_sha, new_sha, forced, at, workspace_id)
14
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?)`).run(e.agentId,e.op,e.path,e.oldSha??null,e.newSha??null,+!!e.forced,new Date().toISOString(),e.workspaceId??null)}catch(e){console.error("[agent-fs audit] write failed:",e)}}])},142343,e=>{"use strict";var t=e.i(364564),r=e.i(102095),a=e.i(691091),n=e.i(475331),i=e.i(490301),s=e.i(670943),o=e.i(690324),u=e.i(243133),l=e.i(404870),c=e.i(420180),d=e.i(867883),p=e.i(336708),f=e.i(682278),h=e.i(157569),m=e.i(844146),w=e.i(193695);e.i(105888);var g=e.i(530564),v=e.i(912714),_=e.i(750227),A=e.i(702414),y=e.i(215043),k=e.i(660038),E=e.i(359211),R=e.i(832852),I=e.i(973909),x=e.i(670910),N=e.i(719126);function T(e,t,r){return A.NextResponse.json({error:e,message:t},{status:r})}async function O(e){let t,r,a=await (0,y.checkAuth)(e);if(!a.ok)return T("UNAUTHORIZED",a.message??"Unauthorized",401);try{t=await e.json()}catch{return T("INVALID_PAYLOAD","Invalid JSON body",400)}if("string"!=typeof t.from||!t.from)return T("INVALID_PAYLOAD","from (string) required",400);if("string"!=typeof t.to||!t.to)return T("INVALID_PAYLOAD","to (string) required",400);let n=t.from,i=t.to,s="string"==typeof t.ifMatch?t.ifMatch:void 0,o=await (0,k.resolveWorkspaceForAgent)(e,"write");if(!o.ok)return T(o.code,o.code,o.status);let{ws:u,rootDir:l}=o;if(!(0,E.safeWorkspacePath)(l,n))return T("INVALID_PATH","from: path traversal rejected",400);if(!(0,E.safeWorkspacePath)(l,i))return T("INVALID_PATH","to: path traversal rejected",400);let c=await (0,N.safeAbsPath)(l,n);if(!c)return T("INVALID_PATH","from: path rejected (symlink escape or denied)",400);let d=await (0,N.safeAbsPath)(l,i);if(!d)return T("INVALID_PATH","to: path rejected (symlink escape or denied)",400);if(c===d)return T("INVALID_PATH","from and to are the same path",400);if(d.startsWith(c+_.default.sep))return T("INVALID_PATH","Cannot move a directory into itself",400);let p=(0,y.enforceScope)(a.agent,{filePath:n,op:"read",workspaceId:u.id});if(!p.ok)return T(p.code,p.message,403);let f=(0,y.enforceScope)(a.agent,{filePath:n,op:"mutate",workspaceId:u.id});if(!f.ok)return T(f.code,f.message,403);let h=(0,y.enforceScope)(a.agent,{filePath:i,op:"mutate",workspaceId:u.id});if(!h.ok)return T(h.code,h.message,403);try{await (0,v.stat)(c)}catch(e){if("ENOENT"===e.code)return T("NOT_FOUND","Source file not found",404);throw e}if(s){let e;try{e=await (0,v.readFile)(c)}catch{return T("NOT_FOUND","Source file not found",404)}if(r=(0,N.sha256ofBuf)(e),(0,N.extractShaHex)(s)!==(0,N.extractShaHex)(r))return T("PRECONDITION_FAILED","If-Match sha256 mismatch",412)}let m=(0,N.isMarkdown)(n),[w,g]=[n,i].sort(),O=async()=>{await (0,v.rename)(c,d),m&&await (0,I.moveSidecar)(l,n,i),(0,x.writeAuditRow)({agentId:a.agent.id,op:"move",path:n,newSha:i,forced:!1,workspaceId:u.id})};return await (0,R.withFileMutex)(`${l}\u0000${w}`,()=>(0,R.withFileMutex)(`${l}\u0000${g}`,O)),A.NextResponse.json({from:n,to:i})}e.s(["POST",0,O,"runtime",0,"nodejs"],672679);var D=e.i(672679);let S=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/agent/fs/move/route",pathname:"/api/agent/fs/move",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/agent/fs/move/route.ts",nextConfigOutput:"standalone",userland:D,...{}}),{workAsyncStorage:P,workUnitAsyncStorage:U,serverHooks:C}=S;async function j(e,t,a){a.requestMeta&&(0,n.setRequestMeta)(e,a.requestMeta),S.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let v="/api/agent/fs/move/route";v=v.replace(/\/index$/,"")||"/";let _=await S.prepare(e,t,{srcPage:v,multiZoneDraftMode:!1});if(!_)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:A,params:y,nextConfig:k,parsedUrl:E,isDraftMode:R,prerenderManifest:I,routerServerContext:x,isOnDemandRevalidate:N,revalidateOnlyGenerated:T,resolvedPathname:O,clientReferenceManifest:D,serverActionsManifest:P}=_,U=(0,o.normalizeAppPath)(v),C=!!(I.dynamicRoutes[U]||I.routes[O]),j=async()=>((null==x?void 0:x.render404)?await x.render404(e,t,E,!1):t.end("This page could not be found"),null);if(C&&!R){let e=!!I.routes[O],t=I.dynamicRoutes[U];if(t&&!1===t.fallback&&!e){if(k.adapterPath)return await j();throw new w.NoFallbackError}}let b=null;!C||S.isDev||R||(b="/index"===(b=O)?"/":b);let L=!0===S.isDev||!C,M=C&&!L;P&&D&&(0,s.setManifestsSingleton)({page:v,clientReferenceManifest:D,serverActionsManifest:P});let H=e.method||"GET",W=(0,i.getTracer)(),q=W.getActiveScopeSpan(),F=!!(null==x?void 0:x.isWrappedByNextServer),$=!!(0,n.getRequestMeta)(e,"minimalMode"),B=(0,n.getRequestMeta)(e,"incrementalCache")||await S.getIncrementalCache(e,k,I,$);null==B||B.resetRequestCache(),globalThis.__incrementalCache=B;let K={params:y,previewProps:I.preview,renderOpts:{experimental:{authInterrupts:!!k.experimental.authInterrupts},cacheComponents:!!k.cacheComponents,supportsDynamicResponse:L,incrementalCache:B,cacheLifeProfiles:k.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,n)=>S.onRequestError(e,t,a,n,x)},sharedContext:{buildId:A}},V=new u.NodeNextRequest(e),z=new u.NodeNextResponse(t),X=l.NextRequestAdapter.fromNodeNextRequest(V,(0,l.signalFromNodeResponse)(t));try{let n,s=async e=>S.handle(X,K).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=W.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let a=r.get("next.route");if(a){let t=`${H} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),n&&n!==e&&(n.setAttribute("http.route",a),n.updateName(t))}else e.updateName(`${H} ${v}`)}),o=async n=>{var i,o;let u=async({previousCacheEntry:r})=>{try{if(!$&&N&&T&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await s(n);e.fetchMetrics=K.renderOpts.fetchMetrics;let o=K.renderOpts.pendingWaitUntil;o&&a.waitUntil&&(a.waitUntil(o),o=void 0);let u=K.renderOpts.collectedTags;if(!C)return await (0,p.sendResponse)(V,z,i,K.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,f.toNodeOutgoingHttpHeaders)(i.headers);u&&(t[m.NEXT_CACHE_TAGS_HEADER]=u),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==K.renderOpts.collectedRevalidate&&!(K.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&K.renderOpts.collectedRevalidate,a=void 0===K.renderOpts.collectedExpire||K.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:K.renderOpts.collectedExpire;return{value:{kind:g.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await S.onRequestError(e,t,{routerKind:"App Router",routePath:v,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:N})},!1,x),t}},l=await S.handleResponse({req:e,nextConfig:k,cacheKey:b,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:I,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:T,responseGenerator:u,waitUntil:a.waitUntil,isMinimalMode:$});if(!C)return null;if((null==l||null==(i=l.value)?void 0:i.kind)!==g.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==l||null==(o=l.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});$||t.setHeader("x-nextjs-cache",N?"REVALIDATED":l.isMiss?"MISS":l.isStale?"STALE":"HIT"),R&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let c=(0,f.fromNodeOutgoingHttpHeaders)(l.value.headers);return $&&C||c.delete(m.NEXT_CACHE_TAGS_HEADER),!l.cacheControl||t.getHeader("Cache-Control")||c.get("Cache-Control")||c.set("Cache-Control",(0,h.getCacheControlHeader)(l.cacheControl)),await (0,p.sendResponse)(V,z,new Response(l.value.body,{headers:c,status:l.value.status||200})),null};F&&q?await o(q):(n=W.getActiveScopeSpan(),await W.withPropagatedContext(e.headers,()=>W.trace(c.BaseServerSpan.handleRequest,{spanName:`${H} ${v}`,kind:i.SpanKind.SERVER,attributes:{"http.method":H,"http.target":e.url}},o),void 0,!F))}catch(t){if(t instanceof w.NoFallbackError||await S.onRequestError(e,t,{routerKind:"App Router",routePath:U,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:M,isOnDemandRevalidate:N})},!1,x),C)throw t;return await (0,p.sendResponse)(V,z,new Response(null,{status:500})),null}}e.s(["handler",0,j,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:P,workUnitAsyncStorage:U})},"routeModule",0,S,"serverHooks",0,C,"workAsyncStorage",0,P,"workUnitAsyncStorage",0,U],142343)},168315,e=>{e.v(t=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(t=>e.l(t))).then(()=>t(862112)))},317691,e=>{e.v(t=>Promise.all(["server/chunks/0dhv_better-auth_dist_adapters_kysely-adapter_index_mjs_0t4t4z8._.js"].map(t=>e.l(t))).then(()=>t(833412)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(t=>e.l(t))).then(()=>t(495181)))},715018,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(t=>e.l(t))).then(()=>t(698370)))},146843,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(t=>e.l(t))).then(()=>t(143740)))},84040,e=>{e.v(t=>Promise.all(["server/chunks/0p91_next_0h94sj1._.js"].map(t=>e.l(t))).then(()=>t(815068)))},427669,e=>{e.v(e=>Promise.resolve().then(()=>e(177730)))},687903,e=>{e.v(e=>Promise.resolve().then(()=>e(912714)))},754121,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__00mtevo._.js","server/chunks/src_lib_search_0ymmp0c._.js"].map(t=>e.l(t))).then(()=>t(437856)))}];
15
+
16
+ //# sourceMappingURL=%5Broot-of-the-server%5D__01qcera._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[583627,e=>{"use strict";var t=e.i(798003),r=e.i(254226);function s(){return(process.env.WIKI_ADMIN_EMAILS??"").split(",").map(e=>e.trim().toLowerCase()).filter(Boolean)}async function a(e,r){if(r){let e=s();if(e.length>0&&e.includes(r.toLowerCase()))return!0}return((await (0,t.readConfig)()).adminUserIds??[]).includes(e)}async function i(){return(await (0,t.readConfig)()).adminUserIds??[]}async function n(e){await (0,t.updateConfig)(t=>{let r=t.adminUserIds??[];return r.includes(e)?t:{...t,adminUserIds:[...r,e]}})}async function o(e){let r=s().length>0,a=!1;if(await (0,t.updateConfig)(t=>{let s=(t.adminUserIds??[]).filter(t=>t!==e);return 0!==s.length||r?{...t,adminUserIds:s}:(a=!0,t)}),a)throw Error("LAST_ADMIN: cannot remove the last admin with no WIKI_ADMIN_EMAILS configured")}async function l(e){if(s().length>0||((await (0,t.readConfig)()).adminUserIds??[]).length>0)return;let r=!1;await (0,t.updateConfig)(t=>(t.adminUserIds??[]).length>0?t:(r=!0,{...t,adminUserIds:[e]})),r&&console.log(`[wiki-viewer] Bootstrap: first user ${e} promoted to admin`)}async function u(e){if("1"===process.env.WIKI_NO_AUTH)return{ok:!0,user:{id:"local",email:"local@localhost",name:"local"}};let t=await (0,r.requireUser)(e);return t.ok?await a(t.user.id,t.user.email)?{ok:!0,user:t.user}:{ok:!1,status:403,code:"ADMIN_REQUIRED"}:{ok:!1,status:401,code:"UNAUTHORIZED"}}e.s(["addAdmin",0,n,"ensureBootstrapAdmin",0,l,"isAdmin",0,a,"listAdmins",0,i,"removeAdmin",0,o,"requireAdmin",0,u])},874533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},812057,(e,t,r)=>{t.exports=e.x("node:util",()=>require("node:util"))},834938,e=>{"use strict";let t;var r=e.i(874533),s=e.i(812057),a=e.i(912714),i=e.i(750227),n=e.i(660526);let o=(0,s.promisify)(r.execFile),l=/[;|&$`<>(){}\n\r\0]/;function u(){return i.default.join(n.default.homedir(),".wiki-viewer","mounts")}async function c(){if(!0!==t)try{await o("sshfs",["--version"]),t=!0}catch{throw Error("sshfs binary not found. Install sshfs + FUSE (e.g. `apt install sshfs`, `brew install macfuse sshfs`) and ensure it is on PATH.")}}async function d(t){var r;let s=i.default.resolve(t),n=!1;try{n=(await (0,a.readFile)("/proc/mounts","utf8")).split("\n").some(e=>{let t=e.split(" ");return t[1]===s&&/fuse/.test(t[2]??"")})}catch{n=!1}return!!n&&(r=s,new Promise(t=>{let s=!1,a=setTimeout(()=>{s||(s=!0,t(!1))},4e3);e.A(687903).then(({readdir:e})=>e(r)).then(()=>{s||(s=!0,clearTimeout(a),t(!0))}).catch(()=>{s||(s=!0,clearTimeout(a),t(!1))})}))}async function p(e){await c(),await (0,a.mkdir)(e.mountpoint,{recursive:!0});let t=function(e){let{target:t,mountpoint:r,port:s,authMethod:a,keyPath:i,readOnly:n}=e,o=t.user?`${t.user}@`:"",l=[`${o}${t.host}:${t.remotePath}`,r];s&&Number.isInteger(s)&&s>0&&s<65536&&l.push("-p",String(s));let u=["reconnect","ServerAliveInterval=15","ServerAliveCountMax=3","compression=yes","cache=yes","kernel_cache","StrictHostKeyChecking=accept-new","BatchMode=yes"];if(n&&u.push("ro"),"keyfile"===a&&i&&(u.push(`IdentityFile=${i}`),u.push("IdentitiesOnly=yes")),"password"===a){let e=u.indexOf("BatchMode=yes");e>=0&&u.splice(e,1),u.push("password_stdin"),u.push("PreferredAuthentications=password,keyboard-interactive"),u.push("PubkeyAuthentication=no"),u.push("NumberOfPasswordPrompts=1")}return e.extraOptions&&u.push(...e.extraOptions),l.push("-o",u.join(",")),l}(e);if(await new Promise((s,a)=>{let i=(0,r.spawn)("sshfs",t,{stdio:["pipe","ignore","pipe"]}),n="",o=setTimeout(()=>{i.kill("SIGKILL"),a(Error("sshfs mount timed out after 25s."))},25e3);i.stderr?.on("data",e=>{n+=e.toString()}),i.on("error",e=>{clearTimeout(o),a(e.message.includes("ENOENT")?Error("sshfs binary not found on PATH."):e)}),i.on("close",e=>{clearTimeout(o),0===e?s():a(Error(`sshfs exited ${e}: ${n.trim()||"mount failed"}`))}),"password"===e.authMethod&&i.stdin?.write((e.password??"")+"\n"),i.stdin?.end()}),!await d(e.mountpoint))throw Error("sshfs reported success but the mount is not live.")}async function h(e){let t=i.default.resolve(e);for(let[e,r]of[["fusermount",["-u","-z",t]],["umount",[t]]])try{await o(e,r);break}catch{}try{await (0,a.rmdir)(t)}catch{}}e.s(["assertSshfsAvailable",0,c,"isMounted",0,d,"isValidKeyPath",0,function(e){return!(!e||l.test(e)||e.includes(".."))&&(e.startsWith("/")||e.startsWith("~/"))},"mountSshfs",0,p,"mountpointFor",0,function(e){return i.default.join(u(),e)},"mountsDir",0,u,"parseSshTarget",0,function(e){let t;if(!e||l.test(e))return null;let r=e.trim(),s=r.indexOf(":");if(s<=0)return null;let a=r.slice(0,s),i=r.slice(s+1);if(!i.startsWith("/")||i.includes(".."))return null;let n=a,o=a.indexOf("@");return o>=0&&(t=a.slice(0,o),n=a.slice(o+1),!t)?null:n&&/^[a-zA-Z0-9.\-]+$/.test(n)&&(!t||/^[a-zA-Z0-9._\-]+$/.test(t))?{user:t,host:n,remotePath:i}:null},"unmountSshfs",0,h])},504445,e=>{"use strict";var t=e.i(750227);let r=globalThis;!r.__wikiRootDir&&process.env.ROOT_DIR&&(r.__wikiRootDir=t.default.resolve(process.env.ROOT_DIR)),e.s(["clearRootDir",0,function(){r.__wikiRootDir=void 0},"getRootDir",0,function(){return r.__wikiRootDir??""},"isRootDirSet",0,function(){return!!r.__wikiRootDir},"setRootDir",0,function(e){r.__wikiRootDir=t.default.resolve(e)}])},660038,e=>{"use strict";var t=e.i(750227),r=e.i(254226),s=e.i(583627),a=e.i(504445),i=e.i(359211);async function n(e){let r;await (0,i.migrateConfigToWorkspaces)();let s=new URL(e.url).searchParams.get("ws")??e.headers.get("x-workspace")??null;if(s)r=await (0,i.getWorkspace)(s)??null;else{let e=await (0,i.listWorkspaces)();if(0===e.length){let e;r=(e=(0,a.getRootDir)())?{id:"ws_default",name:t.default.basename(e)||"workspace",rootDir:e,createdAt:new Date(0).toISOString()}:null}else r=e.slice().sort((e,t)=>{let r=e.lastOpenedAt?new Date(e.lastOpenedAt).getTime():0,s=t.lastOpenedAt?new Date(t.lastOpenedAt).getTime():0;return s!==r?s-r:e.id<t.id?-1:+(e.id>t.id)})[0]}return r?.ssh&&await (0,i.ensureWorkspaceMounted)(r),r}async function o(e,t="read"){if("1"===process.env.WIKI_NO_AUTH){let r=await n(e);return r?"write"===t&&r.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:r,rootDir:r.rootDir,userId:"local",isAdmin:!0}:{ok:!1,status:400,code:"WORKSPACE_REQUIRED"}}let a=await (0,r.requireUser)(e);if(!a.ok)return{ok:!1,status:401,code:"UNAUTHORIZED"};let l=await (0,s.isAdmin)(a.user.id,a.user.email),u=new URL(e.url).searchParams.get("ws")??e.headers.get("x-workspace")??null,c=await n(e);return c?(0,i.userCanAccess)(c,a.user.id,l)?"write"===t&&c.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:c,rootDir:c.rootDir,userId:a.user.id,isAdmin:l}:{ok:!1,status:403,code:"WORKSPACE_FORBIDDEN"}:{ok:!1,status:u?404:400,code:u?"WORKSPACE_NOT_FOUND":"WORKSPACE_REQUIRED"}}async function l(e,t="read"){let r=await n(e);if(!r){let t=new URL(e.url).searchParams.get("ws")??e.headers.get("x-workspace")??null;return{ok:!1,status:t?404:400,code:t?"WORKSPACE_NOT_FOUND":"WORKSPACE_REQUIRED"}}return"write"===t&&r.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:r,rootDir:r.rootDir}}e.s(["resolveWorkspaceForAgent",0,l,"resolveWorkspaceForUser",0,o])},719126,e=>{"use strict";var t=e.i(666680),r=e.i(912714),s=e.i(750227);function a(e){let t=e.replace(/\\/g,"/");return".proof"===t||t.startsWith(".proof/")||".git"===t||t.startsWith(".git/")}async function i(e,t){if(!e)return null;let i=s.default.normalize(t);if(i.startsWith("..")||s.default.isAbsolute(i)||a(i))return null;let n=s.default.join(e,i);if(n!==e&&!n.startsWith(e+s.default.sep))return null;try{let t=await (0,r.realpath)(n);if(t!==e&&!t.startsWith(e+s.default.sep))return null}catch{let t=s.default.dirname(n);if(t!==n)try{let a=await (0,r.realpath)(t);if(a!==e&&!a.startsWith(e+s.default.sep))return null}catch{}}return n}let n={".md":"text/markdown; charset=utf-8",".markdown":"text/markdown; charset=utf-8",".txt":"text/plain; charset=utf-8",".json":"application/json; charset=utf-8",".jsonc":"application/json; charset=utf-8",".ts":"text/typescript; charset=utf-8",".tsx":"text/typescript; charset=utf-8",".mts":"text/typescript; charset=utf-8",".js":"text/javascript; charset=utf-8",".jsx":"text/javascript; charset=utf-8",".mjs":"text/javascript; charset=utf-8",".html":"text/html; charset=utf-8",".htm":"text/html; charset=utf-8",".css":"text/css; charset=utf-8",".yaml":"text/yaml; charset=utf-8",".yml":"text/yaml; charset=utf-8",".toml":"text/toml; charset=utf-8",".xml":"application/xml; charset=utf-8",".svg":"image/svg+xml",".png":"image/png",".jpg":"image/jpeg",".jpeg":"image/jpeg",".gif":"image/gif",".webp":"image/webp",".pdf":"application/pdf",".zip":"application/zip",".tar":"application/x-tar",".gz":"application/gzip",".py":"text/x-python; charset=utf-8",".rs":"text/x-rustsrc; charset=utf-8",".go":"text/x-go; charset=utf-8",".sh":"text/x-shellscript; charset=utf-8",".csv":"text/csv; charset=utf-8",".env":"text/plain; charset=utf-8"};async function o(e,t){let s=420;try{let t=await (0,r.stat)(e);s=511&t.mode}catch{}let a=e+".~"+process.pid+"."+Date.now()+".tmp",i=await (0,r.open)(a,"w",s);try{await i.write(t),await i.datasync()}finally{await i.close()}await (0,r.rename)(a,e)}async function l(e,t){let a=s.default.dirname(e);if(t)return await (0,r.mkdir)(a,{recursive:!0}),!0;try{return await (0,r.stat)(a),!0}catch{return!1}}e.s(["atomicWrite",0,o,"ensureParentDir",0,l,"extractShaHex",0,function(e){return e.replace(/^"/,"").replace(/"$/,"").replace(/^sha256:/,"")},"isDeniedRelPath",0,a,"isMarkdown",0,function(e){return e.endsWith(".md")||e.endsWith(".markdown")},"looksLikeBinary",0,function(e){return e.slice(0,Math.min(e.length,8192)).includes(0)},"mimeByExt",0,function(e){return n[s.default.extname(e).toLowerCase()]??"application/octet-stream"},"safeAbsPath",0,i,"sha256ofBuf",0,function(e){return"sha256:"+(0,t.createHash)("sha256").update(e).digest("hex")}])},81111,(e,t,r)=>{t.exports=e.x("node:stream",()=>require("node:stream"))},687769,(e,t,r)=>{t.exports=e.x("node:events",()=>require("node:events"))},275859,e=>{"use strict";var t=e.i(912714),r=e.i(750227);async function s(e,s){try{let a=r.default.join(e,s,"package.json");return(await (0,t.stat)(a)).isFile()}catch{return!1}}async function a(e,s){try{let a=r.default.join(e,s,"index.html");return(await (0,t.stat)(a)).isFile()}catch{return!1}}e.s(["isAppFolder",0,a,"isNodeApp",0,s])},352876,e=>{"use strict";var t=e.i(364564),r=e.i(102095),s=e.i(691091),a=e.i(475331),i=e.i(490301),n=e.i(670943),o=e.i(690324),l=e.i(243133),u=e.i(404870),c=e.i(420180),d=e.i(867883),p=e.i(336708),h=e.i(682278),f=e.i(157569),m=e.i(844146),w=e.i(193695);e.i(105888);var v=e.i(530564),g=e.i(702414),R=e.i(660038),_=e.i(123368),x=e.i(437856);let y=/\[\[([a-z0-9-]+)(?:\|[^\]#|]+|#[a-z0-9-]+)?\]\]/gi;async function k(e){let t,r=await (0,R.resolveWorkspaceForUser)(e);if(!r.ok)return g.NextResponse.json({error:r.code},{status:r.status});let s=new URL(e.url).searchParams.get("path")??"";if(!s)return g.NextResponse.json({error:"path required"},{status:400});(0,x.ensureIndexer)(r.ws.id,r.rootDir).catch(e=>console.error("[outlinks] ensureIndexer failed",e));let a=(0,_.getSearchDb)(),i=a.prepare("SELECT body FROM docs WHERE ws = ? AND path = ?").get(r.ws.id,s);if(!i)return g.NextResponse.json({error:"file not indexed"},{status:404});let n=new Set,o=RegExp(y.source,"gi");for(;null!==(t=o.exec(i.body));)t[1]&&n.add(t[1].toLowerCase());if(0===n.size)return g.NextResponse.json({links:[]});let l=a.prepare("SELECT path FROM docs WHERE ws = ? AND path LIKE '%.md'").all(r.ws.id),u=new Map;for(let{path:e}of l)u.set((e.split("/").pop()??e).replace(/\.md$/i,"").toLowerCase(),e);let c=Array.from(n).map(e=>{let t=u.get(e)??null;return{slug:e,resolved_path:t,exists:null!==t}});return g.NextResponse.json({links:c})}e.s(["GET",0,k,"runtime",0,"nodejs"],834552);var A=e.i(834552);let E=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/wiki/outlinks/route",pathname:"/api/wiki/outlinks",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/wiki/outlinks/route.ts",nextConfigOutput:"standalone",userland:A,...{}}),{workAsyncStorage:O,workUnitAsyncStorage:C,serverHooks:D}=E;async function I(e,t,s){s.requestMeta&&(0,a.setRequestMeta)(e,s.requestMeta),E.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let g="/api/wiki/outlinks/route";g=g.replace(/\/index$/,"")||"/";let R=await E.prepare(e,t,{srcPage:g,multiZoneDraftMode:!1});if(!R)return t.statusCode=400,t.end("Bad Request"),null==s.waitUntil||s.waitUntil.call(s,Promise.resolve()),null;let{buildId:_,params:x,nextConfig:y,parsedUrl:k,isDraftMode:A,prerenderManifest:O,routerServerContext:C,isOnDemandRevalidate:D,revalidateOnlyGenerated:I,resolvedPathname:P,clientReferenceManifest:N,serverActionsManifest:S}=R,T=(0,o.normalizeAppPath)(g),b=!!(O.dynamicRoutes[T]||O.routes[P]),j=async()=>((null==C?void 0:C.render404)?await C.render404(e,t,k,!1):t.end("This page could not be found"),null);if(b&&!A){let e=!!O.routes[P],t=O.dynamicRoutes[T];if(t&&!1===t.fallback&&!e){if(y.adapterPath)return await j();throw new w.NoFallbackError}}let U=null;!b||E.isDev||A||(U="/index"===(U=P)?"/":U);let W=!0===E.isDev||!b,q=b&&!W;S&&N&&(0,n.setManifestsSingleton)({page:g,clientReferenceManifest:N,serverActionsManifest:S});let M=e.method||"GET",H=(0,i.getTracer)(),K=H.getActiveScopeSpan(),L=!!(null==C?void 0:C.isWrappedByNextServer),F=!!(0,a.getRequestMeta)(e,"minimalMode"),$=(0,a.getRequestMeta)(e,"incrementalCache")||await E.getIncrementalCache(e,y,O,F);null==$||$.resetRequestCache(),globalThis.__incrementalCache=$;let z={params:x,previewProps:O.preview,renderOpts:{experimental:{authInterrupts:!!y.experimental.authInterrupts},cacheComponents:!!y.cacheComponents,supportsDynamicResponse:W,incrementalCache:$,cacheLifeProfiles:y.cacheLife,waitUntil:s.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,s,a)=>E.onRequestError(e,t,s,a,C)},sharedContext:{buildId:_}},B=new l.NodeNextRequest(e),G=new l.NodeNextResponse(t),Z=u.NextRequestAdapter.fromNodeNextRequest(B,(0,u.signalFromNodeResponse)(t));try{let a,n=async e=>E.handle(Z,z).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=H.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==c.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let s=r.get("next.route");if(s){let t=`${M} ${s}`;e.setAttributes({"next.route":s,"http.route":s,"next.span_name":t}),e.updateName(t),a&&a!==e&&(a.setAttribute("http.route",s),a.updateName(t))}else e.updateName(`${M} ${g}`)}),o=async a=>{var i,o;let l=async({previousCacheEntry:r})=>{try{if(!F&&D&&I&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await n(a);e.fetchMetrics=z.renderOpts.fetchMetrics;let o=z.renderOpts.pendingWaitUntil;o&&s.waitUntil&&(s.waitUntil(o),o=void 0);let l=z.renderOpts.collectedTags;if(!b)return await (0,p.sendResponse)(B,G,i,z.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);l&&(t[m.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==z.renderOpts.collectedRevalidate&&!(z.renderOpts.collectedRevalidate>=m.INFINITE_CACHE)&&z.renderOpts.collectedRevalidate,s=void 0===z.renderOpts.collectedExpire||z.renderOpts.collectedExpire>=m.INFINITE_CACHE?void 0:z.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:s}}}}catch(t){throw(null==r?void 0:r.isStale)&&await E.onRequestError(e,t,{routerKind:"App Router",routePath:g,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:q,isOnDemandRevalidate:D})},!1,C),t}},u=await E.handleResponse({req:e,nextConfig:y,cacheKey:U,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:O,isRoutePPREnabled:!1,isOnDemandRevalidate:D,revalidateOnlyGenerated:I,responseGenerator:l,waitUntil:s.waitUntil,isMinimalMode:F});if(!b)return null;if((null==u||null==(i=u.value)?void 0:i.kind)!==v.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(o=u.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});F||t.setHeader("x-nextjs-cache",D?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),A&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let c=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return F&&b||c.delete(m.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||c.get("Cache-Control")||c.set("Cache-Control",(0,f.getCacheControlHeader)(u.cacheControl)),await (0,p.sendResponse)(B,G,new Response(u.value.body,{headers:c,status:u.value.status||200})),null};L&&K?await o(K):(a=H.getActiveScopeSpan(),await H.withPropagatedContext(e.headers,()=>H.trace(c.BaseServerSpan.handleRequest,{spanName:`${M} ${g}`,kind:i.SpanKind.SERVER,attributes:{"http.method":M,"http.target":e.url}},o),void 0,!L))}catch(t){if(t instanceof w.NoFallbackError||await E.onRequestError(e,t,{routerKind:"App Router",routePath:T,routeType:"route",revalidateReason:(0,d.getRevalidateReason)({isStaticGeneration:q,isOnDemandRevalidate:D})},!1,C),b)throw t;return await (0,p.sendResponse)(B,G,new Response(null,{status:500})),null}}e.s(["handler",0,I,"patchFetch",0,function(){return(0,s.patchFetch)({workAsyncStorage:O,workUnitAsyncStorage:C})},"routeModule",0,E,"serverHooks",0,D,"workAsyncStorage",0,O,"workUnitAsyncStorage",0,C],352876)},168315,e=>{e.v(t=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(t=>e.l(t))).then(()=>t(862112)))},317691,e=>{e.v(t=>Promise.all(["server/chunks/0dhv_better-auth_dist_adapters_kysely-adapter_index_mjs_0t4t4z8._.js"].map(t=>e.l(t))).then(()=>t(833412)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(t=>e.l(t))).then(()=>t(495181)))},715018,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(t=>e.l(t))).then(()=>t(698370)))},146843,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(t=>e.l(t))).then(()=>t(143740)))},84040,e=>{e.v(t=>Promise.all(["server/chunks/0p91_next_0h94sj1._.js"].map(t=>e.l(t))).then(()=>t(815068)))},427669,e=>{e.v(e=>Promise.resolve().then(()=>e(177730)))},687903,e=>{e.v(e=>Promise.resolve().then(()=>e(912714)))},754121,e=>{e.v(e=>Promise.resolve().then(()=>e(437856)))}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__02.uul~._.js.map
@@ -0,0 +1,3 @@
1
+ module.exports=[583627,e=>{"use strict";var t=e.i(798003),r=e.i(254226);function s(){return(process.env.WIKI_ADMIN_EMAILS??"").split(",").map(e=>e.trim().toLowerCase()).filter(Boolean)}async function a(e,r){if(r){let e=s();if(e.length>0&&e.includes(r.toLowerCase()))return!0}return((await (0,t.readConfig)()).adminUserIds??[]).includes(e)}async function i(){return(await (0,t.readConfig)()).adminUserIds??[]}async function n(e){await (0,t.updateConfig)(t=>{let r=t.adminUserIds??[];return r.includes(e)?t:{...t,adminUserIds:[...r,e]}})}async function o(e){let r=s().length>0,a=!1;if(await (0,t.updateConfig)(t=>{let s=(t.adminUserIds??[]).filter(t=>t!==e);return 0!==s.length||r?{...t,adminUserIds:s}:(a=!0,t)}),a)throw Error("LAST_ADMIN: cannot remove the last admin with no WIKI_ADMIN_EMAILS configured")}async function l(e){if(s().length>0||((await (0,t.readConfig)()).adminUserIds??[]).length>0)return;let r=!1;await (0,t.updateConfig)(t=>(t.adminUserIds??[]).length>0?t:(r=!0,{...t,adminUserIds:[e]})),r&&console.log(`[wiki-viewer] Bootstrap: first user ${e} promoted to admin`)}async function u(e){if("1"===process.env.WIKI_NO_AUTH)return{ok:!0,user:{id:"local",email:"local@localhost",name:"local"}};let t=await (0,r.requireUser)(e);return t.ok?await a(t.user.id,t.user.email)?{ok:!0,user:t.user}:{ok:!1,status:403,code:"ADMIN_REQUIRED"}:{ok:!1,status:401,code:"UNAUTHORIZED"}}e.s(["addAdmin",0,n,"ensureBootstrapAdmin",0,l,"isAdmin",0,a,"listAdmins",0,i,"removeAdmin",0,o,"requireAdmin",0,u])},874533,(e,t,r)=>{t.exports=e.x("node:child_process",()=>require("node:child_process"))},812057,(e,t,r)=>{t.exports=e.x("node:util",()=>require("node:util"))},834938,e=>{"use strict";let t;var r=e.i(874533),s=e.i(812057),a=e.i(912714),i=e.i(750227),n=e.i(660526);let o=(0,s.promisify)(r.execFile),l=/[;|&$`<>(){}\n\r\0]/;function u(){return i.default.join(n.default.homedir(),".wiki-viewer","mounts")}async function d(){if(!0!==t)try{await o("sshfs",["--version"]),t=!0}catch{throw Error("sshfs binary not found. Install sshfs + FUSE (e.g. `apt install sshfs`, `brew install macfuse sshfs`) and ensure it is on PATH.")}}async function c(t){var r;let s=i.default.resolve(t),n=!1;try{n=(await (0,a.readFile)("/proc/mounts","utf8")).split("\n").some(e=>{let t=e.split(" ");return t[1]===s&&/fuse/.test(t[2]??"")})}catch{n=!1}return!!n&&(r=s,new Promise(t=>{let s=!1,a=setTimeout(()=>{s||(s=!0,t(!1))},4e3);e.A(687903).then(({readdir:e})=>e(r)).then(()=>{s||(s=!0,clearTimeout(a),t(!0))}).catch(()=>{s||(s=!0,clearTimeout(a),t(!1))})}))}async function p(e){await d(),await (0,a.mkdir)(e.mountpoint,{recursive:!0});let t=function(e){let{target:t,mountpoint:r,port:s,authMethod:a,keyPath:i,readOnly:n}=e,o=t.user?`${t.user}@`:"",l=[`${o}${t.host}:${t.remotePath}`,r];s&&Number.isInteger(s)&&s>0&&s<65536&&l.push("-p",String(s));let u=["reconnect","ServerAliveInterval=15","ServerAliveCountMax=3","compression=yes","cache=yes","kernel_cache","StrictHostKeyChecking=accept-new","BatchMode=yes"];if(n&&u.push("ro"),"keyfile"===a&&i&&(u.push(`IdentityFile=${i}`),u.push("IdentitiesOnly=yes")),"password"===a){let e=u.indexOf("BatchMode=yes");e>=0&&u.splice(e,1),u.push("password_stdin"),u.push("PreferredAuthentications=password,keyboard-interactive"),u.push("PubkeyAuthentication=no"),u.push("NumberOfPasswordPrompts=1")}return e.extraOptions&&u.push(...e.extraOptions),l.push("-o",u.join(",")),l}(e);if(await new Promise((s,a)=>{let i=(0,r.spawn)("sshfs",t,{stdio:["pipe","ignore","pipe"]}),n="",o=setTimeout(()=>{i.kill("SIGKILL"),a(Error("sshfs mount timed out after 25s."))},25e3);i.stderr?.on("data",e=>{n+=e.toString()}),i.on("error",e=>{clearTimeout(o),a(e.message.includes("ENOENT")?Error("sshfs binary not found on PATH."):e)}),i.on("close",e=>{clearTimeout(o),0===e?s():a(Error(`sshfs exited ${e}: ${n.trim()||"mount failed"}`))}),"password"===e.authMethod&&i.stdin?.write((e.password??"")+"\n"),i.stdin?.end()}),!await c(e.mountpoint))throw Error("sshfs reported success but the mount is not live.")}async function h(e){let t=i.default.resolve(e);for(let[e,r]of[["fusermount",["-u","-z",t]],["umount",[t]]])try{await o(e,r);break}catch{}try{await (0,a.rmdir)(t)}catch{}}e.s(["assertSshfsAvailable",0,d,"isMounted",0,c,"isValidKeyPath",0,function(e){return!(!e||l.test(e)||e.includes(".."))&&(e.startsWith("/")||e.startsWith("~/"))},"mountSshfs",0,p,"mountpointFor",0,function(e){return i.default.join(u(),e)},"mountsDir",0,u,"parseSshTarget",0,function(e){let t;if(!e||l.test(e))return null;let r=e.trim(),s=r.indexOf(":");if(s<=0)return null;let a=r.slice(0,s),i=r.slice(s+1);if(!i.startsWith("/")||i.includes(".."))return null;let n=a,o=a.indexOf("@");return o>=0&&(t=a.slice(0,o),n=a.slice(o+1),!t)?null:n&&/^[a-zA-Z0-9.\-]+$/.test(n)&&(!t||/^[a-zA-Z0-9._\-]+$/.test(t))?{user:t,host:n,remotePath:i}:null},"unmountSshfs",0,h])},504445,e=>{"use strict";var t=e.i(750227);let r=globalThis;!r.__wikiRootDir&&process.env.ROOT_DIR&&(r.__wikiRootDir=t.default.resolve(process.env.ROOT_DIR)),e.s(["clearRootDir",0,function(){r.__wikiRootDir=void 0},"getRootDir",0,function(){return r.__wikiRootDir??""},"isRootDirSet",0,function(){return!!r.__wikiRootDir},"setRootDir",0,function(e){r.__wikiRootDir=t.default.resolve(e)}])},660038,e=>{"use strict";var t=e.i(750227),r=e.i(254226),s=e.i(583627),a=e.i(504445),i=e.i(359211);async function n(e){let r;await (0,i.migrateConfigToWorkspaces)();let s=new URL(e.url).searchParams.get("ws")??e.headers.get("x-workspace")??null;if(s)r=await (0,i.getWorkspace)(s)??null;else{let e=await (0,i.listWorkspaces)();if(0===e.length){let e;r=(e=(0,a.getRootDir)())?{id:"ws_default",name:t.default.basename(e)||"workspace",rootDir:e,createdAt:new Date(0).toISOString()}:null}else r=e.slice().sort((e,t)=>{let r=e.lastOpenedAt?new Date(e.lastOpenedAt).getTime():0,s=t.lastOpenedAt?new Date(t.lastOpenedAt).getTime():0;return s!==r?s-r:e.id<t.id?-1:+(e.id>t.id)})[0]}return r?.ssh&&await (0,i.ensureWorkspaceMounted)(r),r}async function o(e,t="read"){if("1"===process.env.WIKI_NO_AUTH){let r=await n(e);return r?"write"===t&&r.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:r,rootDir:r.rootDir,userId:"local",isAdmin:!0}:{ok:!1,status:400,code:"WORKSPACE_REQUIRED"}}let a=await (0,r.requireUser)(e);if(!a.ok)return{ok:!1,status:401,code:"UNAUTHORIZED"};let l=await (0,s.isAdmin)(a.user.id,a.user.email),u=new URL(e.url).searchParams.get("ws")??e.headers.get("x-workspace")??null,d=await n(e);return d?(0,i.userCanAccess)(d,a.user.id,l)?"write"===t&&d.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:d,rootDir:d.rootDir,userId:a.user.id,isAdmin:l}:{ok:!1,status:403,code:"WORKSPACE_FORBIDDEN"}:{ok:!1,status:u?404:400,code:u?"WORKSPACE_NOT_FOUND":"WORKSPACE_REQUIRED"}}async function l(e,t="read"){let r=await n(e);if(!r){let t=new URL(e.url).searchParams.get("ws")??e.headers.get("x-workspace")??null;return{ok:!1,status:t?404:400,code:t?"WORKSPACE_NOT_FOUND":"WORKSPACE_REQUIRED"}}return"write"===t&&r.readOnly?{ok:!1,status:403,code:"WORKSPACE_READ_ONLY"}:{ok:!0,ws:r,rootDir:r.rootDir}}e.s(["resolveWorkspaceForAgent",0,l,"resolveWorkspaceForUser",0,o])},402662,e=>{"use strict";var t=e.i(702414);e.s(["checkOrigin",0,function(e){let r=e.method.toUpperCase();if("GET"===r||"HEAD"===r||"OPTIONS"===r)return null;let s=e.headers.get("origin"),a=e.headers.get("referer");if(!s&&!a)return null;let i=function(e){let t=Array.from(new Set(["localhost","127.0.0.1",e.split(":")[0],...(process.env.WIKI_OWNER_HOSTS??"").split(",").map(e=>e.trim()).filter(Boolean)])),r=["",":3000",":3003"];e.includes(":")&&r.push(":"+e.split(":")[1]);let s=new Set;for(let e of t)for(let t of["http","https"])for(let a of r)s.add(`${t}://${e}${a}`);return s}(e.headers.get("host")??"");if(s)return i.has(s)?null:t.NextResponse.json({error:"FORBIDDEN",message:"Bad origin"},{status:403});if(a){try{let{protocol:e,host:t}=new URL(a);if(i.has(`${e}//${t}`))return null}catch{}return t.NextResponse.json({error:"FORBIDDEN",message:"Bad referer"},{status:403})}return null}])},37715,e=>{"use strict";var t=e.i(364564),r=e.i(102095),s=e.i(691091),a=e.i(475331),i=e.i(490301),n=e.i(670943),o=e.i(690324),l=e.i(243133),u=e.i(404870),d=e.i(420180),c=e.i(867883),p=e.i(336708),h=e.i(682278),m=e.i(157569),f=e.i(844146),w=e.i(193695);e.i(105888);var v=e.i(530564),_=e.i(912714),g=e.i(750227),R=e.i(702414),y=e.i(402662),A=e.i(660038),E=e.i(359211);let k=new Set(["application/pdf","text/plain","text/markdown","application/msword","application/vnd.openxmlformats-officedocument.wordprocessingml.document","application/vnd.ms-excel","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-powerpoint","application/vnd.openxmlformats-officedocument.presentationml.presentation","image/jpeg","image/png","image/gif","image/webp","image/svg+xml","application/octet-stream"]),x=new Set(["pdf","txt","md","doc","docx","xls","xlsx","ppt","pptx","jpg","jpeg","png","gif","webp","svg","csv","json","yaml","yml","xml","html","sh","mp4","webm","mov","mp3","wav","ogg","m4a","aac","ipynb","mmd"]);async function O(e){let t,r=(0,y.checkOrigin)(e);if(r)return r;let s=await (0,A.resolveWorkspaceForUser)(e,"write");if(!s.ok)return R.NextResponse.json({error:s.code},{status:s.status});let{rootDir:a}=s;try{t=await e.formData()}catch{return R.NextResponse.json({error:"Invalid form data"},{status:400})}let i=t.get("file");if(!i||!(i instanceof File))return R.NextResponse.json({error:"No file provided"},{status:400});let n=t.get("dir")??"",o=(0,E.safeWorkspacePath)(a,n);if(!o)return R.NextResponse.json({error:"Invalid directory"},{status:400});let l=i.name.split(".").pop()?.toLowerCase()??"";if(!k.has(i.type)&&!x.has(l))return R.NextResponse.json({error:`File type not allowed: ${i.name}`},{status:400});if(i.size>0x6400000)return R.NextResponse.json({error:"File exceeds 100MB limit"},{status:400});let u=i.name.replace(/\.[^.]+$/,"").replace(/[^a-zA-Z0-9._-]/g,"_").replace(/_{2,}/g,"_"),d=`${u}.${l}`,c=g.default.join(o,d);try{await (0,_.mkdir)(o,{recursive:!0});let e=Buffer.from(await i.arrayBuffer());await (0,_.writeFile)(c,e)}catch{return R.NextResponse.json({error:"Failed to save file"},{status:500})}let p=n?`${n}/${d}`:d;return R.NextResponse.json({filename:d,path:p,originalName:i.name})}e.s(["POST",0,O],488439);var I=e.i(488439);let N=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/wiki/upload/route",pathname:"/api/wiki/upload",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/wiki/upload/route.ts",nextConfigOutput:"standalone",userland:I,...{}}),{workAsyncStorage:C,workUnitAsyncStorage:D,serverHooks:P}=N;async function S(e,t,s){s.requestMeta&&(0,a.setRequestMeta)(e,s.requestMeta),N.isDev&&(0,a.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let _="/api/wiki/upload/route";_=_.replace(/\/index$/,"")||"/";let g=await N.prepare(e,t,{srcPage:_,multiZoneDraftMode:!1});if(!g)return t.statusCode=400,t.end("Bad Request"),null==s.waitUntil||s.waitUntil.call(s,Promise.resolve()),null;let{buildId:R,params:y,nextConfig:A,parsedUrl:E,isDraftMode:k,prerenderManifest:x,routerServerContext:O,isOnDemandRevalidate:I,revalidateOnlyGenerated:C,resolvedPathname:D,clientReferenceManifest:P,serverActionsManifest:S}=g,T=(0,o.normalizeAppPath)(_),U=!!(x.dynamicRoutes[T]||x.routes[D]),b=async()=>((null==O?void 0:O.render404)?await O.render404(e,t,E,!1):t.end("This page could not be found"),null);if(U&&!k){let e=!!x.routes[D],t=x.dynamicRoutes[T];if(t&&!1===t.fallback&&!e){if(A.adapterPath)return await b();throw new w.NoFallbackError}}let j=null;!U||N.isDev||k||(j="/index"===(j=D)?"/":j);let q=!0===N.isDev||!U,$=U&&!q;S&&P&&(0,n.setManifestsSingleton)({page:_,clientReferenceManifest:P,serverActionsManifest:S});let W=e.method||"GET",M=(0,i.getTracer)(),F=M.getActiveScopeSpan(),H=!!(null==O?void 0:O.isWrappedByNextServer),K=!!(0,a.getRequestMeta)(e,"minimalMode"),B=(0,a.getRequestMeta)(e,"incrementalCache")||await N.getIncrementalCache(e,A,x,K);null==B||B.resetRequestCache(),globalThis.__incrementalCache=B;let L={params:y,previewProps:x.preview,renderOpts:{experimental:{authInterrupts:!!A.experimental.authInterrupts},cacheComponents:!!A.cacheComponents,supportsDynamicResponse:q,incrementalCache:B,cacheLifeProfiles:A.cacheLife,waitUntil:s.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,s,a)=>N.onRequestError(e,t,s,a,O)},sharedContext:{buildId:R}},z=new l.NodeNextRequest(e),Z=new l.NodeNextResponse(t),G=u.NextRequestAdapter.fromNodeNextRequest(z,(0,u.signalFromNodeResponse)(t));try{let a,n=async e=>N.handle(G,L).finally(()=>{if(!e)return;e.setAttributes({"http.status_code":t.statusCode,"next.rsc":!1});let r=M.getRootSpanAttributes();if(!r)return;if(r.get("next.span_type")!==d.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${r.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let s=r.get("next.route");if(s){let t=`${W} ${s}`;e.setAttributes({"next.route":s,"http.route":s,"next.span_name":t}),e.updateName(t),a&&a!==e&&(a.setAttribute("http.route",s),a.updateName(t))}else e.updateName(`${W} ${_}`)}),o=async a=>{var i,o;let l=async({previousCacheEntry:r})=>{try{if(!K&&I&&C&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let i=await n(a);e.fetchMetrics=L.renderOpts.fetchMetrics;let o=L.renderOpts.pendingWaitUntil;o&&s.waitUntil&&(s.waitUntil(o),o=void 0);let l=L.renderOpts.collectedTags;if(!U)return await (0,p.sendResponse)(z,Z,i,L.renderOpts.pendingWaitUntil),null;{let e=await i.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(i.headers);l&&(t[f.NEXT_CACHE_TAGS_HEADER]=l),!t["content-type"]&&e.type&&(t["content-type"]=e.type);let r=void 0!==L.renderOpts.collectedRevalidate&&!(L.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&L.renderOpts.collectedRevalidate,s=void 0===L.renderOpts.collectedExpire||L.renderOpts.collectedExpire>=f.INFINITE_CACHE?void 0:L.renderOpts.collectedExpire;return{value:{kind:v.CachedRouteKind.APP_ROUTE,status:i.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:s}}}}catch(t){throw(null==r?void 0:r.isStale)&&await N.onRequestError(e,t,{routerKind:"App Router",routePath:_,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:I})},!1,O),t}},u=await N.handleResponse({req:e,nextConfig:A,cacheKey:j,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:x,isRoutePPREnabled:!1,isOnDemandRevalidate:I,revalidateOnlyGenerated:C,responseGenerator:l,waitUntil:s.waitUntil,isMinimalMode:K});if(!U)return null;if((null==u||null==(i=u.value)?void 0:i.kind)!==v.CachedRouteKind.APP_ROUTE)throw Object.defineProperty(Error(`Invariant: app-route received invalid cache entry ${null==u||null==(o=u.value)?void 0:o.kind}`),"__NEXT_ERROR_CODE",{value:"E701",enumerable:!1,configurable:!0});K||t.setHeader("x-nextjs-cache",I?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),k&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let d=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return K&&U||d.delete(f.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||d.get("Cache-Control")||d.set("Cache-Control",(0,m.getCacheControlHeader)(u.cacheControl)),await (0,p.sendResponse)(z,Z,new Response(u.value.body,{headers:d,status:u.value.status||200})),null};H&&F?await o(F):(a=M.getActiveScopeSpan(),await M.withPropagatedContext(e.headers,()=>M.trace(d.BaseServerSpan.handleRequest,{spanName:`${W} ${_}`,kind:i.SpanKind.SERVER,attributes:{"http.method":W,"http.target":e.url}},o),void 0,!H))}catch(t){if(t instanceof w.NoFallbackError||await N.onRequestError(e,t,{routerKind:"App Router",routePath:T,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:I})},!1,O),U)throw t;return await (0,p.sendResponse)(z,Z,new Response(null,{status:500})),null}}e.s(["handler",0,S,"patchFetch",0,function(){return(0,s.patchFetch)({workAsyncStorage:C,workUnitAsyncStorage:D})},"routeModule",0,N,"serverHooks",0,P,"workAsyncStorage",0,C,"workUnitAsyncStorage",0,D],37715)},168315,e=>{e.v(t=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(t=>e.l(t))).then(()=>t(862112)))},317691,e=>{e.v(t=>Promise.all(["server/chunks/0dhv_better-auth_dist_adapters_kysely-adapter_index_mjs_0t4t4z8._.js"].map(t=>e.l(t))).then(()=>t(833412)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(t=>e.l(t))).then(()=>t(495181)))},715018,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(t=>e.l(t))).then(()=>t(698370)))},146843,e=>{e.v(t=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(t=>e.l(t))).then(()=>t(143740)))},84040,e=>{e.v(t=>Promise.all(["server/chunks/0p91_next_0h94sj1._.js"].map(t=>e.l(t))).then(()=>t(815068)))},427669,e=>{e.v(e=>Promise.resolve().then(()=>e(177730)))},687903,e=>{e.v(e=>Promise.resolve().then(()=>e(912714)))},754121,e=>{e.v(t=>Promise.all(["server/chunks/[root-of-the-server]__0d7zxm_._.js","server/chunks/src_lib_search_0ymmp0c._.js"].map(t=>e.l(t))).then(()=>t(437856)))}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__024967n._.js.map