wiki-viewer 1.14.1 → 2.0.0

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 (559) 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/0ci7khnv7i~7_.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/postbuild.js +21 -0
  202. package/bin/wiki-viewer.js +198 -6
  203. package/package.json +1 -1
  204. package/.next/standalone/.github/workflows/publish.yml +0 -37
  205. package/.next/standalone/.handoffs/archive/handoff-20260612-113332.md +0 -98
  206. package/.next/standalone/.handoffs/archive/handoff-20260612-141032.md +0 -73
  207. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-.y6im._.js +0 -3
  208. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-3_t2y._.js +0 -3
  209. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-kjkzt._.js +0 -3
  210. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-puax4._.js +0 -4
  211. package/.next/standalone/.next/server/chunks/[root-of-the-server]__01h996g._.js +0 -3
  212. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0329ktu._.js +0 -3
  213. package/.next/standalone/.next/server/chunks/[root-of-the-server]__03_xj4r._.js +0 -3
  214. package/.next/standalone/.next/server/chunks/[root-of-the-server]__05398dt._.js +0 -4
  215. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06lfvxh._.js +0 -3
  216. package/.next/standalone/.next/server/chunks/[root-of-the-server]__06w0aet._.js +0 -3
  217. package/.next/standalone/.next/server/chunks/[root-of-the-server]__070_p2a._.js +0 -4
  218. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0905hi1._.js +0 -21
  219. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0aa63~j._.js +0 -5
  220. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0avcplk._.js +0 -4
  221. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0b8_kyo._.js +0 -16
  222. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0bticq1._.js +0 -3
  223. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0bwevvu._.js +0 -3
  224. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0c__k3q._.js +0 -4
  225. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0cp~z4x._.js +0 -3
  226. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fmdv9h._.js +0 -20
  227. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0h0qbwr._.js +0 -3
  228. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0jk~oyi._.js +0 -3
  229. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ndq77b._.js +0 -3
  230. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nvgpuk._.js +0 -3
  231. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ocvng2._.js +0 -3
  232. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ps4h~.._.js +0 -3
  233. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q7jqwp._.js +0 -12
  234. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qew~6p._.js +0 -3
  235. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0s_9f-a._.js +0 -3
  236. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0uv7b8u._.js +0 -3
  237. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0uv8.9i._.js +0 -3
  238. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0vfe2io._.js +0 -4
  239. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0w11kjy._.js +0 -3
  240. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wc-.e4._.js +0 -3
  241. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ymovmp._.js +0 -3
  242. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~c6ouv._.js +0 -3
  243. package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~rhs0u._.js +0 -16
  244. package/.next/standalone/.next/server/chunks/[root-of-the-server]__10h9tid._.js +0 -3
  245. package/.next/standalone/.next/server/chunks/[root-of-the-server]__10yk-u1._.js +0 -3
  246. package/.next/standalone/.next/server/chunks/[root-of-the-server]__11105ew._.js +0 -3
  247. package/.next/standalone/.next/server/chunks/[root-of-the-server]__11a3dhw._.js +0 -3
  248. package/.next/standalone/.next/server/chunks/[root-of-the-server]__13420tt._.js +0 -3
  249. package/.next/standalone/.next/server/chunks/[root-of-the-server]__13h~pdf._.js +0 -3
  250. package/.next/standalone/.next/static/chunks/02kg.lbkfi1yc.css +0 -5
  251. package/.next/standalone/.next/static/chunks/0rcwd6-.iu~nd.js +0 -17
  252. package/.next/standalone/.pi/ownership.json +0 -3
  253. package/.next/standalone/AGENTS.md +0 -114
  254. package/.next/standalone/DESIGN.md +0 -521
  255. package/.next/standalone/README.md +0 -821
  256. package/.next/standalone/TODO.md +0 -20
  257. package/.next/standalone/agents/bootstrap-prompt.md +0 -14
  258. package/.next/standalone/agents/wiki-viewer-skill/SKILL.md +0 -456
  259. package/.next/standalone/bin/postbuild.js +0 -78
  260. package/.next/standalone/bin/wiki-viewer.js +0 -922
  261. package/.next/standalone/certificates/localhost-key.pem +0 -28
  262. package/.next/standalone/certificates/localhost.pem +0 -24
  263. package/.next/standalone/docs/agent-collab-plan.md +0 -1615
  264. package/.next/standalone/docs/agent-collab-v2-plan.md +0 -771
  265. package/.next/standalone/docs/agent-fs-plan.md +0 -232
  266. package/.next/standalone/docs/editorial-skin-spec.md +0 -242
  267. package/.next/standalone/docs/file-vs-collab-authority.md +0 -124
  268. package/.next/standalone/docs/mobile-readiness-spec.md +0 -229
  269. package/.next/standalone/docs/workspacing-plan.md +0 -364
  270. package/.next/standalone/packages/wiki-viewer-mcp/README.md +0 -195
  271. package/.next/standalone/packages/wiki-viewer-mcp/bench-e2e.mjs +0 -166
  272. package/.next/standalone/packages/wiki-viewer-mcp/bench-latency.mjs +0 -87
  273. package/.next/standalone/packages/wiki-viewer-mcp/bench-payload.mjs +0 -45
  274. package/.next/standalone/packages/wiki-viewer-mcp/dist/http-client.js +0 -331
  275. package/.next/standalone/packages/wiki-viewer-mcp/dist/index.js +0 -531
  276. package/.next/standalone/packages/wiki-viewer-mcp/dist/register.js +0 -94
  277. package/.next/standalone/packages/wiki-viewer-mcp/dist/state-cache.js +0 -28
  278. package/.next/standalone/packages/wiki-viewer-mcp/package-lock.json +0 -1716
  279. package/.next/standalone/packages/wiki-viewer-mcp/package.json +0 -41
  280. package/.next/standalone/packages/wiki-viewer-mcp/src/http-client.ts +0 -459
  281. package/.next/standalone/packages/wiki-viewer-mcp/src/index.ts +0 -638
  282. package/.next/standalone/packages/wiki-viewer-mcp/src/register.ts +0 -144
  283. package/.next/standalone/packages/wiki-viewer-mcp/src/state-cache.ts +0 -55
  284. package/.next/standalone/packages/wiki-viewer-mcp/tsconfig.json +0 -19
  285. package/.next/standalone/pnpm-lock.yaml +0 -6697
  286. package/.next/standalone/pnpm-workspace.yaml +0 -8
  287. package/.next/standalone/postcss.config.mjs +0 -2
  288. package/.next/standalone/src/app/api/agent/activity/route.ts +0 -59
  289. package/.next/standalone/src/app/api/agent/admin/agents/[agentId]/revoke/route.ts +0 -40
  290. package/.next/standalone/src/app/api/agent/admin/agents/route.ts +0 -33
  291. package/.next/standalone/src/app/api/agent/admin/registrations/[regId]/approve/route.ts +0 -83
  292. package/.next/standalone/src/app/api/agent/admin/registrations/[regId]/deny/route.ts +0 -36
  293. package/.next/standalone/src/app/api/agent/admin/registrations/route.ts +0 -27
  294. package/.next/standalone/src/app/api/agent/events/[...path]/route.ts +0 -148
  295. package/.next/standalone/src/app/api/agent/files/[...path]/route.ts +0 -219
  296. package/.next/standalone/src/app/api/agent/fs/file/[...path]/route.ts +0 -446
  297. package/.next/standalone/src/app/api/agent/fs/ls/[[...path]]/route.ts +0 -152
  298. package/.next/standalone/src/app/api/agent/fs/move/route.ts +0 -130
  299. package/.next/standalone/src/app/api/agent/fs/search/route.ts +0 -272
  300. package/.next/standalone/src/app/api/agent/internal/span/route.ts +0 -121
  301. package/.next/standalone/src/app/api/agent/register/[regId]/route.ts +0 -50
  302. package/.next/standalone/src/app/api/agent/register/route.ts +0 -118
  303. package/.next/standalone/src/app/api/agent/settings/route.ts +0 -34
  304. package/.next/standalone/src/app/api/agent/settings/token/regenerate/route.ts +0 -20
  305. package/.next/standalone/src/app/api/agent/sidecar/[...path]/route.ts +0 -53
  306. package/.next/standalone/src/app/api/agents/install/route.ts +0 -143
  307. package/.next/standalone/src/app/api/agents/skill/route.ts +0 -20
  308. package/.next/standalone/src/app/api/agents/skill.tar.gz/route.ts +0 -87
  309. package/.next/standalone/src/app/api/app-proxy/[...path]/route.ts +0 -247
  310. package/.next/standalone/src/app/api/assets/[...path]/route.ts +0 -75
  311. package/.next/standalone/src/app/api/auth/[...all]/route.ts +0 -7
  312. package/.next/standalone/src/app/api/owner/init/route.ts +0 -14
  313. package/.next/standalone/src/app/api/share/[token]/route.ts +0 -269
  314. package/.next/standalone/src/app/api/share/route.ts +0 -127
  315. package/.next/standalone/src/app/api/system/admins/route.ts +0 -103
  316. package/.next/standalone/src/app/api/system/auth-config/route.ts +0 -22
  317. package/.next/standalone/src/app/api/system/auth-settings/route.ts +0 -86
  318. package/.next/standalone/src/app/api/system/browse/route.ts +0 -82
  319. package/.next/standalone/src/app/api/system/clear-root/route.ts +0 -16
  320. package/.next/standalone/src/app/api/system/config/route.ts +0 -14
  321. package/.next/standalone/src/app/api/system/pins/route.ts +0 -38
  322. package/.next/standalone/src/app/api/system/reveal/route.ts +0 -36
  323. package/.next/standalone/src/app/api/system/root-status/route.ts +0 -13
  324. package/.next/standalone/src/app/api/system/set-root/route.ts +0 -53
  325. package/.next/standalone/src/app/api/system/users/route.ts +0 -120
  326. package/.next/standalone/src/app/api/system/workspaces/[id]/open/route.ts +0 -34
  327. package/.next/standalone/src/app/api/system/workspaces/[id]/refresh/route.ts +0 -32
  328. package/.next/standalone/src/app/api/system/workspaces/[id]/route.ts +0 -78
  329. package/.next/standalone/src/app/api/system/workspaces/route.ts +0 -128
  330. package/.next/standalone/src/app/api/upload/[...path]/route.ts +0 -85
  331. package/.next/standalone/src/app/api/wiki/app/route.ts +0 -60
  332. package/.next/standalone/src/app/api/wiki/backlinks/route.ts +0 -29
  333. package/.next/standalone/src/app/api/wiki/content/route.ts +0 -159
  334. package/.next/standalone/src/app/api/wiki/download/route.ts +0 -100
  335. package/.next/standalone/src/app/api/wiki/file/route.ts +0 -57
  336. package/.next/standalone/src/app/api/wiki/folder/route.ts +0 -34
  337. package/.next/standalone/src/app/api/wiki/git-branches/route.ts +0 -32
  338. package/.next/standalone/src/app/api/wiki/git-checkout/route.ts +0 -45
  339. package/.next/standalone/src/app/api/wiki/git-diff/route.ts +0 -33
  340. package/.next/standalone/src/app/api/wiki/git-file-info/route.ts +0 -27
  341. package/.next/standalone/src/app/api/wiki/git-history/route.ts +0 -27
  342. package/.next/standalone/src/app/api/wiki/git-pull/route.ts +0 -48
  343. package/.next/standalone/src/app/api/wiki/move/route.ts +0 -61
  344. package/.next/standalone/src/app/api/wiki/new-file/route.ts +0 -56
  345. package/.next/standalone/src/app/api/wiki/outlinks/route.ts +0 -76
  346. package/.next/standalone/src/app/api/wiki/page/route.ts +0 -92
  347. package/.next/standalone/src/app/api/wiki/presence/route.ts +0 -56
  348. package/.next/standalone/src/app/api/wiki/route.ts +0 -116
  349. package/.next/standalone/src/app/api/wiki/search/route.ts +0 -44
  350. package/.next/standalone/src/app/api/wiki/slugs/route.ts +0 -54
  351. package/.next/standalone/src/app/api/wiki/upload/route.ts +0 -95
  352. package/.next/standalone/src/app/api/wiki/watch/route.ts +0 -67
  353. package/.next/standalone/src/app/globals.css +0 -1249
  354. package/.next/standalone/src/app/icon.svg +0 -11
  355. package/.next/standalone/src/app/layout.tsx +0 -78
  356. package/.next/standalone/src/app/manifest.ts +0 -30
  357. package/.next/standalone/src/app/page.tsx +0 -3260
  358. package/.next/standalone/src/app/s/[token]/page.tsx +0 -357
  359. package/.next/standalone/src/app/signin/page.tsx +0 -16
  360. package/.next/standalone/src/app/signin/signin-form.tsx +0 -238
  361. package/.next/standalone/src/components/ai-panel/activity-row.tsx +0 -284
  362. package/.next/standalone/src/components/ai-panel/ai-panel.tsx +0 -311
  363. package/.next/standalone/src/components/ai-panel/token-section.tsx +0 -313
  364. package/.next/standalone/src/components/auth-settings-sheet.tsx +0 -474
  365. package/.next/standalone/src/components/confirm-dialog.tsx +0 -56
  366. package/.next/standalone/src/components/dir-picker.tsx +0 -606
  367. package/.next/standalone/src/components/editor/backlinks-panel.tsx +0 -139
  368. package/.next/standalone/src/components/editor/bubble-menu.tsx +0 -346
  369. package/.next/standalone/src/components/editor/callout-extension.ts +0 -36
  370. package/.next/standalone/src/components/editor/comment-pip.tsx +0 -56
  371. package/.next/standalone/src/components/editor/comment-thread.tsx +0 -254
  372. package/.next/standalone/src/components/editor/csv-viewer.tsx +0 -379
  373. package/.next/standalone/src/components/editor/document-outline.tsx +0 -230
  374. package/.next/standalone/src/components/editor/editor-toolbar.tsx +0 -564
  375. package/.next/standalone/src/components/editor/editor.tsx +0 -1327
  376. package/.next/standalone/src/components/editor/extensions/drag-handle.ts +0 -325
  377. package/.next/standalone/src/components/editor/extensions/heading-anchors.ts +0 -55
  378. package/.next/standalone/src/components/editor/extensions/proof-span.ts +0 -60
  379. package/.next/standalone/src/components/editor/extensions/resizable-image.tsx +0 -159
  380. package/.next/standalone/src/components/editor/extensions.ts +0 -150
  381. package/.next/standalone/src/components/editor/file-fallback-viewer.tsx +0 -75
  382. package/.next/standalone/src/components/editor/folder-index.tsx +0 -236
  383. package/.next/standalone/src/components/editor/google-doc-viewer.tsx +0 -73
  384. package/.next/standalone/src/components/editor/image-viewer.tsx +0 -57
  385. package/.next/standalone/src/components/editor/large-file-gate.tsx +0 -108
  386. package/.next/standalone/src/components/editor/link-popover.tsx +0 -111
  387. package/.next/standalone/src/components/editor/media-popover.tsx +0 -212
  388. package/.next/standalone/src/components/editor/media-viewer.tsx +0 -70
  389. package/.next/standalone/src/components/editor/mermaid-viewer.tsx +0 -286
  390. package/.next/standalone/src/components/editor/node-app-viewer.tsx +0 -328
  391. package/.next/standalone/src/components/editor/notebook-viewer.tsx +0 -371
  392. package/.next/standalone/src/components/editor/office/docx-viewer.tsx +0 -93
  393. package/.next/standalone/src/components/editor/office/office-chrome.tsx +0 -83
  394. package/.next/standalone/src/components/editor/office/pptx-viewer.tsx +0 -104
  395. package/.next/standalone/src/components/editor/office/xlsx-viewer.tsx +0 -192
  396. package/.next/standalone/src/components/editor/pdf-viewer.tsx +0 -32
  397. package/.next/standalone/src/components/editor/proof-span-popover.tsx +0 -162
  398. package/.next/standalone/src/components/editor/slash-commands.tsx +0 -629
  399. package/.next/standalone/src/components/editor/source-viewer.tsx +0 -289
  400. package/.next/standalone/src/components/editor/suggest-edit-popover.tsx +0 -229
  401. package/.next/standalone/src/components/editor/suggestion-card.tsx +0 -206
  402. package/.next/standalone/src/components/editor/table-menu.tsx +0 -232
  403. package/.next/standalone/src/components/editor/view-mode-comment-button.tsx +0 -77
  404. package/.next/standalone/src/components/editor/website-viewer.tsx +0 -75
  405. package/.next/standalone/src/components/editor/wiki-link-create-dialog.tsx +0 -189
  406. package/.next/standalone/src/components/editor/wiki-link-decorator.ts +0 -79
  407. package/.next/standalone/src/components/editor/wiki-link-extension.ts +0 -120
  408. package/.next/standalone/src/components/editor/wiki-link-picker.tsx +0 -250
  409. package/.next/standalone/src/components/layout/viewer-toolbar.tsx +0 -54
  410. package/.next/standalone/src/components/search/search-command-dialog.tsx +0 -246
  411. package/.next/standalone/src/components/search/sidebar-search-box.tsx +0 -121
  412. package/.next/standalone/src/components/search/snippet-text.tsx +0 -48
  413. package/.next/standalone/src/components/share-dialog.tsx +0 -307
  414. package/.next/standalone/src/components/theme-provider.tsx +0 -16
  415. package/.next/standalone/src/components/theme-toggle.tsx +0 -24
  416. package/.next/standalone/src/components/ui/badge.tsx +0 -35
  417. package/.next/standalone/src/components/ui/button.tsx +0 -56
  418. package/.next/standalone/src/components/ui/card.tsx +0 -63
  419. package/.next/standalone/src/components/ui/collapsible.tsx +0 -9
  420. package/.next/standalone/src/components/ui/command.tsx +0 -151
  421. package/.next/standalone/src/components/ui/context-menu.tsx +0 -191
  422. package/.next/standalone/src/components/ui/dialog.tsx +0 -119
  423. package/.next/standalone/src/components/ui/dropdown-menu.tsx +0 -194
  424. package/.next/standalone/src/components/ui/input.tsx +0 -22
  425. package/.next/standalone/src/components/ui/label.tsx +0 -25
  426. package/.next/standalone/src/components/ui/popover.tsx +0 -33
  427. package/.next/standalone/src/components/ui/scroll-area.tsx +0 -47
  428. package/.next/standalone/src/components/ui/select.tsx +0 -156
  429. package/.next/standalone/src/components/ui/separator.tsx +0 -30
  430. package/.next/standalone/src/components/ui/sheet.tsx +0 -140
  431. package/.next/standalone/src/components/ui/skeleton.tsx +0 -15
  432. package/.next/standalone/src/components/ui/switch.tsx +0 -28
  433. package/.next/standalone/src/components/ui/tabs.tsx +0 -54
  434. package/.next/standalone/src/components/ui/textarea.tsx +0 -21
  435. package/.next/standalone/src/components/ui/tip.tsx +0 -23
  436. package/.next/standalone/src/components/ui/toggle-group.tsx +0 -41
  437. package/.next/standalone/src/components/ui/tooltip.tsx +0 -27
  438. package/.next/standalone/src/components/view-width-toggle.tsx +0 -70
  439. package/.next/standalone/src/components/wiki/frontmatter-header.tsx +0 -164
  440. package/.next/standalone/src/hooks/use-is-mobile.ts +0 -14
  441. package/.next/standalone/src/lib/app-runner.ts +0 -272
  442. package/.next/standalone/src/lib/auth/admin.ts +0 -120
  443. package/.next/standalone/src/lib/auth/allowlist.ts +0 -50
  444. package/.next/standalone/src/lib/auth/client.ts +0 -4
  445. package/.next/standalone/src/lib/auth/csrf.ts +0 -68
  446. package/.next/standalone/src/lib/auth/server.ts +0 -215
  447. package/.next/standalone/src/lib/cabinets/tree.ts +0 -75
  448. package/.next/standalone/src/lib/config.ts +0 -114
  449. package/.next/standalone/src/lib/embeds/detect.ts +0 -142
  450. package/.next/standalone/src/lib/git-secrets.ts +0 -65
  451. package/.next/standalone/src/lib/git.ts +0 -503
  452. package/.next/standalone/src/lib/google/detect.ts +0 -107
  453. package/.next/standalone/src/lib/markdown/parse-frontmatter.ts +0 -104
  454. package/.next/standalone/src/lib/markdown/remark-wikilinks.ts +0 -100
  455. package/.next/standalone/src/lib/markdown/sanitize-schema.ts +0 -106
  456. package/.next/standalone/src/lib/markdown/to-html.ts +0 -282
  457. package/.next/standalone/src/lib/markdown/to-markdown.ts +0 -252
  458. package/.next/standalone/src/lib/proof/activity-shared.ts +0 -31
  459. package/.next/standalone/src/lib/proof/activity.ts +0 -74
  460. package/.next/standalone/src/lib/proof/audit.ts +0 -88
  461. package/.next/standalone/src/lib/proof/auth.ts +0 -143
  462. package/.next/standalone/src/lib/proof/block-refs.ts +0 -133
  463. package/.next/standalone/src/lib/proof/blocks.ts +0 -73
  464. package/.next/standalone/src/lib/proof/client-auth.ts +0 -23
  465. package/.next/standalone/src/lib/proof/collab-state.ts +0 -81
  466. package/.next/standalone/src/lib/proof/event-bus.ts +0 -47
  467. package/.next/standalone/src/lib/proof/file-lock.ts +0 -43
  468. package/.next/standalone/src/lib/proof/glob.ts +0 -51
  469. package/.next/standalone/src/lib/proof/idempotency.ts +0 -37
  470. package/.next/standalone/src/lib/proof/lease.ts +0 -117
  471. package/.next/standalone/src/lib/proof/mutex.ts +0 -36
  472. package/.next/standalone/src/lib/proof/ops-applier.ts +0 -727
  473. package/.next/standalone/src/lib/proof/owner-auth.ts +0 -2
  474. package/.next/standalone/src/lib/proof/pending.ts +0 -97
  475. package/.next/standalone/src/lib/proof/proof-span.ts +0 -141
  476. package/.next/standalone/src/lib/proof/rate-limit.ts +0 -53
  477. package/.next/standalone/src/lib/proof/raw-fs.ts +0 -197
  478. package/.next/standalone/src/lib/proof/register-rate-limit.ts +0 -53
  479. package/.next/standalone/src/lib/proof/registry.ts +0 -195
  480. package/.next/standalone/src/lib/proof/sidecar.ts +0 -103
  481. package/.next/standalone/src/lib/proof/suggest-capture.ts +0 -69
  482. package/.next/standalone/src/lib/proof/types.ts +0 -182
  483. package/.next/standalone/src/lib/proof-config.ts +0 -14
  484. package/.next/standalone/src/lib/root-dir.ts +0 -35
  485. package/.next/standalone/src/lib/search/indexable-exts.ts +0 -25
  486. package/.next/standalone/src/lib/search/indexer.ts +0 -634
  487. package/.next/standalone/src/lib/search/sanitize.ts +0 -35
  488. package/.next/standalone/src/lib/search/search-db.ts +0 -57
  489. package/.next/standalone/src/lib/search/watcher-pool.ts +0 -79
  490. package/.next/standalone/src/lib/shared-docs/db.ts +0 -177
  491. package/.next/standalone/src/lib/toast.ts +0 -9
  492. package/.next/standalone/src/lib/utils.ts +0 -6
  493. package/.next/standalone/src/lib/wiki-helpers.ts +0 -36
  494. package/.next/standalone/src/lib/workspace-client.ts +0 -82
  495. package/.next/standalone/src/lib/workspace-context.ts +0 -173
  496. package/.next/standalone/src/lib/workspaces.ts +0 -400
  497. package/.next/standalone/src/middleware.ts +0 -44
  498. package/.next/standalone/src/stores/ai-panel-store.ts +0 -79
  499. package/.next/standalone/src/stores/editor-store.ts +0 -439
  500. package/.next/standalone/src/stores/pin-store.ts +0 -56
  501. package/.next/standalone/src/stores/proof-store.ts +0 -124
  502. package/.next/standalone/src/stores/recent-store.ts +0 -51
  503. package/.next/standalone/src/stores/search-store.ts +0 -104
  504. package/.next/standalone/src/stores/show-hidden-store.ts +0 -26
  505. package/.next/standalone/src/stores/sidebar-width-store.ts +0 -39
  506. package/.next/standalone/src/stores/skin-store.ts +0 -42
  507. package/.next/standalone/src/stores/tree-store.ts +0 -52
  508. package/.next/standalone/src/stores/view-width-store.ts +0 -101
  509. package/.next/standalone/src/stores/wiki-slugs-store.ts +0 -75
  510. package/.next/standalone/src/tests/proof/activity-aggregator.test.ts +0 -146
  511. package/.next/standalone/src/tests/proof/admin-create-user.test.ts +0 -43
  512. package/.next/standalone/src/tests/proof/agent-fs.test.ts +0 -973
  513. package/.next/standalone/src/tests/proof/agent-ownership.test.ts +0 -140
  514. package/.next/standalone/src/tests/proof/agent-workspace-scope.test.ts +0 -134
  515. package/.next/standalone/src/tests/proof/agents-install.test.ts +0 -110
  516. package/.next/standalone/src/tests/proof/bench-write.ts +0 -179
  517. package/.next/standalone/src/tests/proof/better-auth.test.ts +0 -68
  518. package/.next/standalone/src/tests/proof/block-refs.test.ts +0 -108
  519. package/.next/standalone/src/tests/proof/blocks.test.ts +0 -92
  520. package/.next/standalone/src/tests/proof/collab-state.test.ts +0 -501
  521. package/.next/standalone/src/tests/proof/comments-ops.test.ts +0 -177
  522. package/.next/standalone/src/tests/proof/editor-roundtrip.test.ts +0 -85
  523. package/.next/standalone/src/tests/proof/external-edit.test.ts +0 -58
  524. package/.next/standalone/src/tests/proof/file-lock.test.ts +0 -80
  525. package/.next/standalone/src/tests/proof/git-branches-checkout.test.ts +0 -136
  526. package/.next/standalone/src/tests/proof/git-read-features.test.ts +0 -473
  527. package/.next/standalone/src/tests/proof/git-secrets.test.ts +0 -138
  528. package/.next/standalone/src/tests/proof/git-sparse.test.ts +0 -257
  529. package/.next/standalone/src/tests/proof/git-workspace.test.ts +0 -135
  530. package/.next/standalone/src/tests/proof/git.test.ts +0 -243
  531. package/.next/standalone/src/tests/proof/glob.test.ts +0 -82
  532. package/.next/standalone/src/tests/proof/helpers/auth-session.ts +0 -27
  533. package/.next/standalone/src/tests/proof/markdown-to-html.test.ts +0 -46
  534. package/.next/standalone/src/tests/proof/ops-applier.test.ts +0 -368
  535. package/.next/standalone/src/tests/proof/owner-init.test.ts +0 -2
  536. package/.next/standalone/src/tests/proof/parse-frontmatter.test.ts +0 -60
  537. package/.next/standalone/src/tests/proof/preload.ts +0 -21
  538. package/.next/standalone/src/tests/proof/proof-span.test.ts +0 -98
  539. package/.next/standalone/src/tests/proof/rate-limit.test.ts +0 -54
  540. package/.next/standalone/src/tests/proof/readonly-enforcement.test.ts +0 -161
  541. package/.next/standalone/src/tests/proof/reconcile-sidecar.test.ts +0 -195
  542. package/.next/standalone/src/tests/proof/registration-flow.test.ts +0 -330
  543. package/.next/standalone/src/tests/proof/registry.test.ts +0 -169
  544. package/.next/standalone/src/tests/proof/routes.test.ts +0 -516
  545. package/.next/standalone/src/tests/proof/search-index.test.ts +0 -376
  546. package/.next/standalone/src/tests/proof/sidecar-lifecycle.test.ts +0 -177
  547. package/.next/standalone/src/tests/proof/sidecar-trim.test.ts +0 -58
  548. package/.next/standalone/src/tests/proof/suggestion-ops.test.ts +0 -280
  549. package/.next/standalone/src/tests/proof/wiki-content-put.test.ts +0 -140
  550. package/.next/standalone/src/tests/proof/wiki-routes-auth.test.ts +0 -208
  551. package/.next/standalone/src/tests/proof/workspace-isolation.test.ts +0 -87
  552. package/.next/standalone/src/tests/proof/workspaces-api.test.ts +0 -227
  553. package/.next/standalone/src/types/index.ts +0 -47
  554. package/.next/standalone/tailwind.config.ts +0 -191
  555. package/.next/standalone/tsconfig.json +0 -41
  556. package/.next/standalone/tsconfig.tsbuildinfo +0 -1
  557. /package/.next/standalone/.next/static/{WMOTgfV82apmdovxzgbMx → ecpoWt_SP3WkUTh0NsnuT}/_buildManifest.js +0 -0
  558. /package/.next/standalone/.next/static/{WMOTgfV82apmdovxzgbMx → ecpoWt_SP3WkUTh0NsnuT}/_clientMiddlewareManifest.js +0 -0
  559. /package/.next/standalone/.next/static/{WMOTgfV82apmdovxzgbMx → ecpoWt_SP3WkUTh0NsnuT}/_ssgManifest.js +0 -0
@@ -26,13 +26,19 @@ function printUsage() {
26
26
  console.error("Usage: wiki-viewer [directory] [options]");
27
27
  console.error(" wiki-viewer <command> [args]");
28
28
  console.error("");
29
- console.error(" directory Directory to serve (optional — pick in browser if omitted)");
29
+ console.error(" directory Directory to serve (optional — pick in browser if omitted).");
30
+ console.error(" May also be an SSH target (user@host:/path) — mounted via");
31
+ console.error(" sshfs and served live, no local clone.");
30
32
  console.error("");
31
33
  console.error("Options:");
32
34
  console.error(" -p, --port <port> Port to listen on (default: 3000)");
33
35
  console.error(" -H, --host <host> Host to bind to (default: localhost)");
34
36
  console.error(" --https Enable HTTPS (self-signed cert, enables service workers)");
35
37
  console.error(" --no-auth Run without authentication — no sign-in, no session check");
38
+ console.error(" --ssh-key <path> Private key for the SSH target (default: ssh-agent / host keys)");
39
+ console.error(" --ssh-port <port> SSH port for the target (default: 22)");
40
+ console.error(" --ssh-password Prompt for an SSH password (or set WIKI_SSH_PASSWORD)");
41
+ console.error(" --ssh-readonly Mount the SSH target read-only");
36
42
  console.error(" -v, --version Print version");
37
43
  console.error("");
38
44
  console.error(" -e, --env <KEY=VALUE> Set an app env var (repeatable; persisted with service install)");
@@ -55,6 +61,8 @@ function printUsage() {
55
61
  console.error(" wiki-viewer ~/notes");
56
62
  console.error(" wiki-viewer ~/notes --https");
57
63
  console.error(" wiki-viewer ~/notes -p 8080 -H 0.0.0.0");
64
+ console.error(" wiki-viewer me@server:/srv/docs");
65
+ console.error(" wiki-viewer me@server:/srv/docs --ssh-key ~/.ssh/id_ed25519 --ssh-readonly");
58
66
  console.error(" wiki-viewer service install ~/notes -H 0.0.0.0 -p 3003 --https");
59
67
  console.error(" wiki-viewer service install ~/notes --env GOOGLE_CLIENT_ID=... --env GOOGLE_CLIENT_SECRET=...");
60
68
  console.error(" wiki-viewer config set AUTH_ALLOWED_DOMAIN=example.com");
@@ -70,6 +78,10 @@ function parseServeArgs(args) {
70
78
  let userSpecifiedPort = false;
71
79
  let rootDir;
72
80
  let noAuth;
81
+ let sshKey;
82
+ let sshPort;
83
+ let sshPassword;
84
+ let sshReadOnly;
73
85
 
74
86
  for (let i = 0; i < args.length; i++) {
75
87
  const a = args[i];
@@ -78,12 +90,151 @@ function parseServeArgs(args) {
78
90
  else if (a === "-e" || a === "--env") { i++; } // consumed by parseEnvFlags
79
91
  else if (a === "--https") useHttps = true;
80
92
  else if (a === "--no-auth") noAuth = true;
93
+ else if (a === "--ssh-key") sshKey = args[++i];
94
+ else if (a === "--ssh-port") sshPort = args[++i];
95
+ else if (a === "--ssh-password") sshPassword = true;
96
+ else if (a === "--ssh-readonly") sshReadOnly = true;
81
97
  else if (!a.startsWith("-") && rootDir === undefined) rootDir = a;
82
98
  }
83
99
 
84
- return { rootDir, port, host, useHttps, userSpecifiedPort, noAuth: Boolean(noAuth) };
100
+ return { rootDir, port, host, useHttps, userSpecifiedPort, noAuth: Boolean(noAuth), sshKey, sshPort, sshPassword: Boolean(sshPassword), sshReadOnly: Boolean(sshReadOnly) };
85
101
  }
86
102
 
103
+ // ── ssh (sshfs) targets ──────────────────────────────────────────────────────
104
+ // Symmetry with the local-directory arg: `wiki-viewer user@host:/path` mounts a
105
+ // remote directory over sshfs and serves it as ROOT_DIR — no local clone. The
106
+ // mount is ephemeral (under ~/.wiki-viewer/mounts) and unmounted on exit. Auth:
107
+ // ssh-agent/host keys by default, --ssh-key <path>, or --ssh-password.
108
+
109
+ const mountsDir = path.join(configDir, "mounts");
110
+ const FORBIDDEN_SSH = /[;|&$`<>(){}\n\r\0]/;
111
+ let activeMount = null;
112
+
113
+ function looksLikeSshTarget(s) {
114
+ if (!s || FORBIDDEN_SSH.test(s)) return false;
115
+ // [user@]host:/abs/path — host has no slash, remote path is absolute. An
116
+ // existing local path (e.g. a real dir literally named like this) wins.
117
+ return /^([\w.-]+@)?[\w.-]+:\/.+/.test(s) && !existsSync(s);
118
+ }
119
+
120
+ function parseSshTarget(s) {
121
+ if (!s || FORBIDDEN_SSH.test(s)) return null;
122
+ const colon = s.indexOf(":");
123
+ if (colon <= 0) return null;
124
+ const hostPart = s.slice(0, colon);
125
+ const remotePath = s.slice(colon + 1);
126
+ if (!remotePath.startsWith("/") || remotePath.includes("..")) return null;
127
+ let user;
128
+ let host = hostPart;
129
+ const at = hostPart.indexOf("@");
130
+ if (at >= 0) { user = hostPart.slice(0, at); host = hostPart.slice(at + 1); if (!user) return null; }
131
+ if (!host || !/^[a-zA-Z0-9.-]+$/.test(host)) return null;
132
+ if (user && !/^[a-zA-Z0-9._-]+$/.test(user)) return null;
133
+ return { user, host, remotePath };
134
+ }
135
+
136
+ // Mirror of src/lib/sshfs.ts buildSshfsArgs — kept in sync intentionally so the
137
+ // bin stays dependency-light (no TS import at runtime).
138
+ function buildSshfsArgs({ target, mountpoint, port, keyPath, password, readOnly }) {
139
+ const userPart = target.user ? `${target.user}@` : "";
140
+ const args = [`${userPart}${target.host}:${target.remotePath}`, mountpoint];
141
+ if (port && Number.isInteger(Number(port)) && Number(port) > 0 && Number(port) < 65536) {
142
+ args.push("-p", String(port));
143
+ }
144
+ const o = [
145
+ "reconnect", "ServerAliveInterval=15", "ServerAliveCountMax=3",
146
+ "compression=yes", "cache=yes", "kernel_cache",
147
+ "StrictHostKeyChecking=accept-new", "BatchMode=yes",
148
+ ];
149
+ if (readOnly) o.push("ro");
150
+ if (keyPath) { o.push(`IdentityFile=${keyPath}`, "IdentitiesOnly=yes"); }
151
+ if (password != null) {
152
+ const i = o.indexOf("BatchMode=yes"); if (i >= 0) o.splice(i, 1);
153
+ o.push("password_stdin", "PreferredAuthentications=password,keyboard-interactive", "PubkeyAuthentication=no", "NumberOfPasswordPrompts=1");
154
+ }
155
+ args.push("-o", o.join(","));
156
+ return args;
157
+ }
158
+
159
+ function isMountedSync(mp) {
160
+ try {
161
+ if (process.platform === "linux") {
162
+ const m = readFileSync("/proc/mounts", "utf8");
163
+ return m.split("\n").some((l) => { const p = l.split(" "); return p[1] === mp && /fuse/.test(p[2] || ""); });
164
+ }
165
+ const out = execFileSync("mount", [], { encoding: "utf8" });
166
+ return out.split("\n").some((l) => l.includes(` on ${mp} `));
167
+ } catch { return false; }
168
+ }
169
+
170
+ function unmountSync(mp) {
171
+ const tries = process.platform === "linux"
172
+ ? [["fusermount", ["-u", "-z", mp]], ["umount", [mp]]]
173
+ : [["umount", [mp]], ["diskutil", ["unmount", "force", mp]]];
174
+ for (const [bin, a] of tries) { try { execFileSync(bin, a, { stdio: "ignore" }); break; } catch { /* try next */ } }
175
+ try { rmSync(mp, { recursive: false, force: true }); } catch { /* best-effort */ }
176
+ }
177
+
178
+ function registerMountCleanup() {
179
+ const cleanup = () => { if (activeMount) { const mp = activeMount; activeMount = null; unmountSync(mp); } };
180
+ process.on("exit", cleanup);
181
+ for (const sig of ["SIGINT", "SIGTERM", "SIGHUP"]) {
182
+ process.on(sig, () => { cleanup(); process.exit(0); });
183
+ }
184
+ }
185
+
186
+ async function mountSshTarget({ targetStr, port, keyPath, password, readOnly }) {
187
+ const target = parseSshTarget(targetStr);
188
+ if (!target) {
189
+ console.error(`Error: invalid SSH target '${targetStr}'. Use the form user@host:/abs/path.`);
190
+ process.exit(1);
191
+ }
192
+ try { execFileSync("sshfs", ["--version"], { stdio: "ignore" }); }
193
+ catch {
194
+ console.error("Error: sshfs not found. Install sshfs + FUSE (e.g. `apt install sshfs`, `brew install macfuse sshfs`).");
195
+ process.exit(1);
196
+ }
197
+
198
+ mkdirSync(mountsDir, { recursive: true });
199
+ const mp = path.join(mountsDir, `cli-${process.pid}`);
200
+ // Reuse-or-clear a stale mountpoint from a previous crashed run.
201
+ if (isMountedSync(mp)) unmountSync(mp);
202
+ mkdirSync(mp, { recursive: true });
203
+
204
+ const args = buildSshfsArgs({ target, mountpoint: mp, port, keyPath, password, readOnly });
205
+ registerMountCleanup();
206
+ await new Promise((resolve, reject) => {
207
+ const child = spawn("sshfs", args, { stdio: ["pipe", "ignore", "pipe"] });
208
+ let err = "";
209
+ const t = setTimeout(() => { child.kill("SIGKILL"); reject(new Error("sshfs mount timed out after 25s")); }, 25_000);
210
+ child.stderr.on("data", (d) => { err += d.toString(); });
211
+ child.on("error", (e) => { clearTimeout(t); reject(e); });
212
+ child.on("close", (code) => { clearTimeout(t); code === 0 ? resolve() : reject(new Error(err.trim() || `sshfs exited ${code}`)); });
213
+ if (password != null) child.stdin.write(password + "\n");
214
+ child.stdin.end();
215
+ }).catch((e) => {
216
+ console.error(`Error: sshfs mount failed: ${e.message}`);
217
+ try { unmountSync(mp); } catch { /* ignore */ }
218
+ process.exit(1);
219
+ });
220
+
221
+ if (!isMountedSync(mp)) {
222
+ console.error("Error: sshfs reported success but the mount is not live.");
223
+ unmountSync(mp);
224
+ process.exit(1);
225
+ }
226
+ activeMount = mp;
227
+ return mp;
228
+ }
229
+
230
+ // One-shot line prompt (echoes input). Used for --ssh-password when the
231
+ // WIKI_SSH_PASSWORD env var is not set.
232
+ async function promptLine(text) {
233
+ const io = makePrompter();
234
+ const ans = await io.prompt(text);
235
+ io.close();
236
+ return ans;
237
+ }
87
238
  // ── config file ────────────────────────────────────────────────────────────
88
239
 
89
240
  function loadConfig() {
@@ -108,8 +259,11 @@ function saveConfig(cfg) {
108
259
  function resolveServeOptions(args) {
109
260
  const cli = parseServeArgs(args);
110
261
  const cfg = loadConfig();
262
+ const isSsh = cli.rootDir != null && looksLikeSshTarget(cli.rootDir);
111
263
  return {
112
- rootDir: cli.rootDir ? path.resolve(cli.rootDir) : null,
264
+ rootDir: cli.rootDir && !isSsh ? path.resolve(cli.rootDir) : null,
265
+ sshTarget: isSsh ? cli.rootDir : null,
266
+ sshKey: cli.sshKey, sshPort: cli.sshPort, sshPassword: cli.sshPassword, sshReadOnly: cli.sshReadOnly,
113
267
  port: String(cli.port ?? "3000"),
114
268
  host: cli.host ?? "localhost",
115
269
  useHttps: Boolean(cli.useHttps),
@@ -133,8 +287,15 @@ function resolveRunOptions(args) {
133
287
  // A config-pinned port is explicit too (don't auto-bump to next free port).
134
288
  const userSpecifiedPort = cli.userSpecifiedPort || cfg.port != null;
135
289
 
290
+ const isSsh = rootDir != null && looksLikeSshTarget(rootDir);
136
291
  return {
137
- rootDir: rootDir ? path.resolve(rootDir) : null,
292
+ rootDir: rootDir && !isSsh ? path.resolve(rootDir) : null,
293
+ sshTarget: isSsh ? rootDir : null,
294
+ // CLI flags win; otherwise fall back to persisted ssh settings (cfg.ssh).
295
+ sshKey: cli.sshKey ?? cfg.ssh?.key,
296
+ sshPort: cli.sshPort ?? cfg.ssh?.port,
297
+ sshPassword: cli.sshPassword,
298
+ sshReadOnly: cli.sshReadOnly || Boolean(cfg.ssh?.readOnly),
138
299
  port: String(port),
139
300
  host,
140
301
  useHttps: Boolean(useHttps),
@@ -279,7 +440,8 @@ function getNetworkAddress() {
279
440
  // ── start ──────────────────────────────────────────────────────────────────
280
441
 
281
442
  async function start(opts) {
282
- const { rootDir: resolvedRoot, useHttps, configEnv = {} } = opts;
443
+ const { useHttps, configEnv = {} } = opts;
444
+ let resolvedRoot = opts.rootDir;
283
445
  let { port, host, userSpecifiedPort } = opts;
284
446
 
285
447
  if (!existsSync(serverJs)) {
@@ -288,6 +450,24 @@ async function start(opts) {
288
450
  process.exit(1);
289
451
  }
290
452
 
453
+ // SSH target: mount it over sshfs and serve the mount point as ROOT_DIR.
454
+ if (opts.sshTarget) {
455
+ let password = null;
456
+ if (opts.sshPassword) {
457
+ password = process.env.WIKI_SSH_PASSWORD
458
+ ?? await promptLine(`SSH password for ${opts.sshTarget}: `);
459
+ }
460
+ console.log(`🔗 Mounting ${opts.sshTarget} over SSH…`);
461
+ resolvedRoot = await mountSshTarget({
462
+ targetStr: opts.sshTarget,
463
+ port: opts.sshPort,
464
+ keyPath: opts.sshKey,
465
+ password,
466
+ readOnly: opts.sshReadOnly,
467
+ });
468
+ console.log(` mounted at ${resolvedRoot}${opts.sshReadOnly ? " (read-only)" : ""}`);
469
+ }
470
+
291
471
  if (resolvedRoot) {
292
472
  console.log(`�� ${resolvedRoot}`);
293
473
  } else {
@@ -433,13 +613,25 @@ function serviceInstall(args) {
433
613
  const envFlags = parseEnvFlags(args);
434
614
  const existing = loadConfig();
435
615
  const mergedEnv = { ...(existing.env ?? {}), ...envFlags };
616
+ const cliIsSsh = cli.rootDir != null && looksLikeSshTarget(cli.rootDir);
436
617
  const cfg = {
437
- rootDir: cli.rootDir != null ? path.resolve(cli.rootDir) : existing.rootDir ?? null,
618
+ rootDir: cli.rootDir != null
619
+ ? (cliIsSsh ? cli.rootDir : path.resolve(cli.rootDir))
620
+ : existing.rootDir ?? null,
438
621
  host: cli.host ?? existing.host ?? "localhost",
439
622
  port: cli.port ?? existing.port ?? "3000",
440
623
  https: cli.useHttps ?? existing.https ?? false,
624
+ // Persist ssh options so `service run` can remount on boot. Password auth is
625
+ // intentionally NOT persisted — services run non-interactively, so use
626
+ // ssh-agent or --ssh-key for a reboot-persistent SSH workspace.
627
+ ...(cliIsSsh
628
+ ? { ssh: { ...(cli.sshKey ? { key: cli.sshKey } : {}), ...(cli.sshPort ? { port: cli.sshPort } : {}), ...(cli.sshReadOnly ? { readOnly: true } : {}) } }
629
+ : existing.ssh ? { ssh: existing.ssh } : {}),
441
630
  ...(Object.keys(mergedEnv).length ? { env: mergedEnv } : {}),
442
631
  };
632
+ if (cliIsSsh && cli.sshPassword) {
633
+ console.log("⚠️ --ssh-password is ignored for services (non-interactive). Use ssh-agent or --ssh-key.\n");
634
+ }
443
635
  saveConfig(cfg);
444
636
  console.log(`Saved config to ${configPath}`);
445
637
  console.log(` dir: ${cfg.rootDir ?? "(choose in browser)"}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wiki-viewer",
3
- "version": "1.14.1",
3
+ "version": "2.0.0",
4
4
  "description": "Local file viewer and wiki — view markdown, HTML, PDFs, notebooks, office docs, and more from any directory",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,37 +0,0 @@
1
- name: Publish to npm
2
-
3
- on:
4
- release:
5
- types: [created]
6
-
7
- jobs:
8
- publish:
9
- runs-on: ubuntu-latest
10
- steps:
11
- - uses: actions/checkout@v4
12
-
13
- - uses: pnpm/action-setup@v4
14
- with:
15
- version: 10
16
-
17
- - uses: actions/setup-node@v4
18
- with:
19
- node-version: 22
20
- cache: pnpm
21
- registry-url: https://registry.npmjs.org
22
-
23
- - name: Install dependencies
24
- run: pnpm install --frozen-lockfile
25
-
26
- - name: Build
27
- run: pnpm build
28
-
29
- - name: Copy static assets into standalone
30
- run: |
31
- cp -r .next/static .next/standalone/.next/static
32
- cp -r public .next/standalone/public
33
-
34
- - name: Publish
35
- run: npm publish --access public
36
- env:
37
- NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
@@ -1,98 +0,0 @@
1
- # Handoff: Git-backed read-only workspaces (feature complete + perf optimization shipped)
2
-
3
- - **Written:** 2026-06-12 11:33:32 UTC
4
- - **From session:** unknown (pi agent, not Claude Code CLI; no .jsonl pointer)
5
- - **Working dir:** /home/sil/wiki-viewer
6
- - **Resume raw transcript (fallback only):** n/a (pi session, no --resume id captured)
7
-
8
- ## Goal
9
-
10
- Let teams browse docs that live in a remote git repo (GitHub/GitLab/Bitbucket/Gitea/GHE)
11
- with the full wiki-viewer UI, instead of reading raw files on the host. Scope was locked
12
- early: **read-only**, **private repos via HTTPS PAT**, **manual refresh** (no webhook/cron).
13
- "Done" = admin pastes a repo URL, server clones it, it shows up as a normal workspace that
14
- is read-only, with a Refresh button. Plus a perf path for repos whose docs sit in a subdir.
15
-
16
- This work is **shipped and complete**. Both commits pushed to origin/main. There is no
17
- pending task. This handoff exists to orient a fresh agent if the feature is extended.
18
-
19
- ## Current state
20
-
21
- DONE and pushed. Two commits on `main`:
22
-
23
- - `750f1e6` feat: git-backed read-only workspaces (backend spine + UI + tests)
24
- - `52edf40` perf(git): optional subpath via sparse checkout
25
-
26
- Working tree clean. `pnpm test` = 371 pass / 0 fail. `pnpm exec tsc --noEmit` clean.
27
- `pnpm build` succeeds (only the unrelated Better Auth base-URL warning, expected without env).
28
-
29
- What works end-to-end:
30
-
31
- - Add a git workspace via the directory picker "From Git" tab (URL, branch, subdir, username, token, name).
32
- - Server clones to `~/.wiki-viewer/repos/<wsId>/`, registers a `readOnly: true` workspace.
33
- - Optional subdir does a blobless partial clone + cone sparse-checkout; rootDir points at the subdir.
34
- - Every fs-mutating route rejects writes on a read-only workspace with 403 WORKSPACE_READ_ONLY.
35
- - Manual Refresh button in the switcher runs `git pull --ff-only`, shows synced time + last error.
36
- - PAT stored 0600 in `~/.wiki-viewer/git-secrets.json`, never in config.json, never logged, never in any API response.
37
-
38
- Nothing is half-built or untested in this feature.
39
-
40
- ## Next action (do this first)
41
-
42
- Nothing pending. If asked to extend, the most likely next features (all explicitly deferred,
43
- not bugs) are listed under "Open questions". Start by reading the two key lib files below to
44
- rebuild the mental model, then `pnpm test` to confirm green baseline before any change.
45
-
46
- ## Then
47
-
48
- Only if extending. Each item is a fresh mini-feature, use `/feature`:
49
-
50
- 1. Config UI for `git.allowedHosts` / `git.allowInsecureHttp` (currently config.json only, no UI). Verify: admin can restrict clone hosts from settings.
51
- 2. Write-back (commit + push or PR flow). This is the big scope cliff deliberately not built. Would require lifting read-only on a write path + conflict/precondition handling. Verify: edit in a git workspace reaches upstream.
52
- 3. Auto-refresh (webhook or cron). Deferred by design; manual-only shipped. Verify: clone updates without a manual click.
53
-
54
- ## Key files
55
-
56
- - `src/lib/git.ts` — git binary wrapper. `cloneRepo` (askpass auth so token never in argv/.git/config), `validateRemoteUrl` (https-only scheme gate + host allowlist + metachar reject), `validateSubpath`, `pullRepo` (ff-only), `headSha`, `currentBranch`, `assertGitAvailable`. Clone args: whole-repo `["clone","--depth","1","--single-branch","--no-tags",url,dest]`; subpath adds `--filter=blob:none --sparse` then `sparse-checkout set --cone <subpath>`.
57
- - `src/lib/git-secrets.ts` — PAT store, 0600 file, genTokenRef/setToken/getToken/deleteToken. Frozen, do not modify.
58
- - `src/lib/workspaces.ts` — `Workspace.readOnly` + `git{remoteUrl,branch,tokenRef,username,subpath,cloneRoot,lastPulledAt,lastSha,lastError}`. `createGitWorkspace`, `refreshGitWorkspace`, `removeWorkspace` (deletes cloneRoot, path.relative guard), `sanitizeWorkspace` (strips tokenRef from all responses).
59
- - `src/lib/workspace-context.ts` — `resolveWorkspaceForUser/Agent(req, intent)`. `intent:"write"` + `ws.readOnly` → 403 WORKSPACE_READ_ONLY. This is the single read-only chokepoint; every write route passes "write".
60
- - `src/lib/config.ts` — `reposDir()`, `WorkspaceGitEntry` (mirror of WorkspaceGit), `git.allowedHosts`/`git.allowInsecureHttp` config keys.
61
- - `src/app/api/system/workspaces/route.ts` — POST branches to createGitWorkspace when body.remoteUrl present; masks tokenRef.
62
- - `src/app/api/system/workspaces/[id]/refresh/route.ts` — admin+CSRF, calls refreshGitWorkspace.
63
- - `src/components/dir-picker.tsx` — "Local folder" / "From Git" mode toggle + the From Git form.
64
- - `src/app/page.tsx` — workspace switcher: read-only badge, Refresh button (handleRefreshWorkspace ~line 862, switcher render ~line 2015), timeAgo helper (~line 107).
65
- - `src/tests/proof/git.test.ts`, `git-secrets.test.ts`, `git-workspace.test.ts`, `readonly-enforcement.test.ts`, `git-sparse.test.ts` — full coverage.
66
-
67
- ## Decisions & rationale
68
-
69
- - **Full clone, not API/lazy fetch.** Keeps reads as native fs (fast) and viewer/search/agent paths unchanged + provider-agnostic. API-based reads would be per-host and slow. See the read-perf discussion in session.
70
- - **Read-only is a policy, not a tech limit.** The clone is a writable dir, but edits there would be silently lost on `git pull --ff-only` (divergence) and never reach upstream. Read-only protects the user from edits with nowhere to go. Lift it only when write-back exists.
71
- - **Subpath uses sparse cone + blobless,** the only change that improves setup time without sacrificing read perf. `rootDir = cloneRoot/subpath` so `.git` sits outside rootDir (cleaner isolation). `cloneRoot` stored separately so refresh/remove target the real clone, not the subdir.
72
- - **Generalized beyond GitHub** because read-only clone+pull is provider-agnostic; only auth differs and HTTPS-token auth is uniform. Cheap to support all hosts.
73
- - **`--no-tags` on whole-repo, blobless only on subpath.** Depth-1 already fetches only tip blobs, so blobless adds negotiation cost for no gain on a full clone.
74
-
75
- ## Gotchas & landmines
76
-
77
- - **`.git/` is already excluded** in indexer (SKIP_DIRS), fs/ls (SKIP_NAMES), and raw-fs (isDeniedRelPath). Do NOT re-add exclusions; subpath clones keep .git outside rootDir anyway.
78
- - **Local-protocol clones (`file://` or local path) IGNORE `--filter`** (git prints "filtering not recognized by server, ignoring"). Tests use local fixtures so they assert END STATE (only subpath files in rootDir), not transfer savings. Real https hosts get the blobless benefit.
79
- - **`agent-workspace-scope.test.ts` has a pre-existing flaky teardown race** (async agents.json write lands after the test's `rm`, ENOENT unhandledRejection). NOT caused by this feature; surfaced once under parallel load, then passed consistently. If the full suite flakes on exactly that file, it is this known race, not the git code.
80
- - **Symlink subpath attack is blocked twice:** git's `sparse-checkout set --cone` refuses a non-directory, AND createGitWorkspace does lstat + realpath-under-cloneRoot. Test `git-sparse.test.ts` covers it. The error message can be either "not a directory" (git) or "not found" (our guard) so the test regex accepts both.
81
- - **removeWorkspace delete guard** uses `path.relative(managed, cloneDir)` not raw `startsWith`, to stop a tampered config cloneRoot from deleting outside reposDir. Keep that if you touch cleanup.
82
- - **pnpm only.** `kysely` pinned 0.28.5 via overrides, do not bump. No em-dashes in any copy/comments (user rule). No AI attribution in commits.
83
- - Tests run from repo root: `pnpm exec tsx --import ./src/tests/proof/preload.ts --test src/tests/proof/<name>.test.ts`. preload.ts overrides HOME to a temp dir so tests never touch real ~/.wiki-viewer.
84
-
85
- ## Open questions / waiting on
86
-
87
- None blocking. Deferred-by-design (not bugs): write-back/push, auto-refresh (webhook/cron),
88
- GHE-host config UI. All would be net-new features needing `/feature`, not continuations.
89
-
90
- ## Mental model
91
-
92
- A git-backed workspace IS a normal workspace whose `rootDir` happens to be a server-managed
93
- clone. That single insight is why the feature is small: the entire read path (browser, editor
94
- view, search, agent reads) is untouched, because it just sees files on disk. Only two things
95
- are new: the clone/pull/secret orchestration (lib/git\*.ts + createGitWorkspace), and a
96
- read-only write gate centralized in one place (workspace-context resolver `intent` param).
97
- Everything else is wiring. When extending, ask "is this a read concern (already works) or a
98
- write concern (must go through the read-only gate)?" before touching anything.
@@ -1,73 +0,0 @@
1
- # Handoff: Sub-folder git repo detection + branch badge + pull refresh
2
-
3
- - **Written:** 2026-06-12 14:10:32 UTC
4
- - **From session:** unknown (Pi agent, not Claude Code CLI)
5
- - **Working dir:** /home/sil/wiki-viewer
6
- - **Resume raw transcript (fallback only):** n/a (Pi session, no --resume id captured)
7
-
8
- ## Goal
9
-
10
- Let users see git status for sub-folder git repos inside a normal workspace. When expanding a directory in the file tree sidebar, auto-detect any subdirectory that is a git repo root, show branch name + dirty indicator as an inline badge next to the folder name, and provide a pull-to-refresh button.
11
-
12
- "Done" = expand a folder in the sidebar, see `main` or `master` next to repo folders, click the refresh icon and see it pull latest + reload tree.
13
-
14
- ## Current state
15
-
16
- Shipped and committed at `310cb72`. Working tree clean. `pnpm test` = 371 pass / 0 fail. `pnpm exec tsc --noEmit` clean.
17
-
18
- What works end-to-end:
19
-
20
- - `GET /api/wiki?dir=...` returns `git: {branch, dirty}` for each subdirectory that is a git repo root.
21
- - File tree sidebar shows `GitBranch icon branch [* if dirty] [↩ button]` inline.
22
- - Clicking ↩ calls `POST /api/wiki/git-pull` with `{path}`, runs `git pull --ff-only`, shows toast on success/fail, refreshes parent listing.
23
- - Reuses `detectGitRepo` in both listing and pull endpoint for consistent validation.
24
- - Pull endpoint uses `resolveWorkspaceForUser(request, "write")` — blocked on read-only workspaces.
25
- - Node-app entries also get git detection (review fix).
26
- - Follows existing patterns: CSRF, safeWorkspacePath, wsFetch, showError/showSuccess.
27
-
28
- ## Next action (do this first)
29
-
30
- Nothing pending. If asked to extend, read the four changed files below to rebuild mental model, then `pnpm test` to confirm green baseline.
31
-
32
- ## Then
33
-
34
- Possible extensions (all net-new, not continuations):
35
-
36
- 1. **`.gitignore`-aware file listing** — hide ignored files from the tree. Requires running `git ls-files` in the sub-repo and filtering against `fetchDir` results.
37
- 2. **Modification badges in tree** — `M`/`?`/`D` next to files when inside a detected git repo. Requires `git status --porcelain` on the sub-repo.
38
- 3. **Git log / history panel** — show recent commits when clicking the branch badge.
39
- 4. **Write-back (commit + push)** — big scope cliff. Would lift read-only and add commit UI.
40
-
41
- ## Key files
42
-
43
- - `src/lib/git.ts` — added `detectGitRepo(dirPath)` at end of file. Returns `{branch, dirty}` or `null`. Uses `stat(.git)` then `rev-parse --show-toplevel` to confirm repo root, then `currentBranch()` + `status --porcelain`. Also added `GitRepoInfo` interface.
44
- - `src/app/api/wiki/route.ts` — GET handler extended to call `detectGitRepo` for each directory entry. Also restructured to apply git detection uniformly for all directory types (dir, app, node-app).
45
- - `src/app/api/wiki/git-pull/route.ts` — NEW file, POST endpoint. CSRF-protected, uses `resolveWorkspaceForUser(request, "write")`, validates path via `safeWorkspacePath`, reuses `detectGitRepo` for repo validation, runs `pullRepo` then returns `{branch, sha}`.
46
- - `src/app/page.tsx` — `TreeNode.git?` field; `fetchDir` passes through git from API; `pullingRepo` state + `handleGitPull` callback (after reloadDir definition); git badge + refresh button in `renderNodes` between node name and agent presence dot.
47
-
48
- ## Decisions & rationale
49
-
50
- - **Auto-detect, not opt-in.** Scanning for `.git` on directory expand is cheap (one stat per subdirectory). Extra git commands only run for directories WITH `.git`. Zero config burden.
51
- - **Inline badge in tree row**, not status bar or tooltip. Always visible, no extra clicks. Same pattern as VSCode explorer.
52
- - **Reuse `detectGitRepo` in pull endpoint.** Ensures same validation (toplevel check, not just `.git` existence) prevents pulling on non-root repos or submodules.
53
- - **Pull on read-only workspaces blocked.** `resolveWorkspaceForUser(request, "write")` in git-pull endpoint prevents mutating a read-only git-backed workspace by pulling inside it.
54
- - **Node-app entries included.** Review flagged the early-return gap; restructured to detect git before type-specific branching. Node-app folders that are also git repos get the badge.
55
- - **Parent directory reloaded after pull.** Simpler and more accurate than trying to predict new dirty state.
56
- - **No rate limiting.** Frontend guard prevents concurrent pulls per path. Server-side throttle deferred until abuse surfaces.
57
-
58
- ## Gotchas & landmines
59
-
60
- - **`reloadDir` defined before `handleGitPull`** in page.tsx. The callback depends on `reloadDir` being declared first. If you move callbacks around, keep this ordering.
61
- - **Submodules**: `.git` is a file (not dir) in submodule checkouts. `detectGitRepo` handles this because `stat()` works on both files and dirs. The `rev-parse --show-toplevel` check also handles this correctly.
62
- - **Symlink `.git`**: `stat` follows symlinks by default, so detection works. But `rev-parse --show-toplevel` resolves realpath, so comparison against symlinked dirPath would fail. This is acceptable — symlinked `.git` pointing outside the workspace is an unusual case.
63
- - **Nested git repos**: If a git repo has submodules, the submodule dirs are git repos too but `rev-parse --show-toplevel` returns the submodule root, not the superproject root. They each get their own badge, which is correct.
64
- - **pnpm only.** `kysely` pinned 0.28.5 via overrides, do not bump. No em-dashes in copy/comments (user rule). No AI attribution in commits.
65
- - **Tests run from repo root.** `pnpm exec tsx --import ./src/tests/proof/preload.ts --test src/tests/proof/<name>.test.ts`. preload.ts overrides HOME to temp dir.
66
-
67
- ## Open questions / waiting on
68
-
69
- None. Feature is complete and committed.
70
-
71
- ## Mental model
72
-
73
- A sub-folder git repo inside a workspace is just a normal directory with a `.git` file/dir. The whole feature is three layers: (1) detection — one stat + a couple git commands per directory on expand, (2) display — branch badge inline in the existing tree row, (3) refresh — pull endpoint reusing existing `pullRepo` from the git-backed workspace feature. The detection and pull share the same validation helper. No new auth concepts, no new workspace types, no new state management patterns. When extending, focus on "is this a read concern (already works) or a write concern (must gate through workspace read-only policy)?"
@@ -1,3 +0,0 @@
1
- module.exports=[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 a=e.headers.get("origin"),s=e.headers.get("referer");if(!a&&!s)return null;let n=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 a=new Set;for(let e of t)for(let t of["http","https"])for(let s of r)a.add(`${t}://${e}${s}`);return a}(e.headers.get("host")??"");if(a)return n.has(a)?null:t.NextResponse.json({error:"FORBIDDEN",message:"Bad origin"},{status:403});if(s){try{let{protocol:e,host:t}=new URL(s);if(n.has(`${e}//${t}`))return null}catch{}return t.NextResponse.json({error:"FORBIDDEN",message:"Bad referer"},{status:403})}return null}])},365026,e=>{"use strict";var t=e.i(364564),r=e.i(102095),a=e.i(691091),s=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),p=e.i(867883),c=e.i(336708),h=e.i(682278),v=e.i(157569),f=e.i(844146),m=e.i(193695);e.i(105888);var R=e.i(530564),_=e.i(912714),w=e.i(750227),g=e.i(702414),E=e.i(402662),x=e.i(660038),y=e.i(359211);async function N(e){let t=(0,E.checkOrigin)(e);if(t)return t;let r=await (0,x.resolveWorkspaceForUser)(e,"write");if(!r.ok)return g.NextResponse.json({error:r.code},{status:r.status});let{rootDir:a}=r,s=(await e.json()).path;if(!s||"string"!=typeof s||/[<>:"|?*]/.test(s)||s.endsWith("/"))return g.NextResponse.json({error:"Invalid file path"},{status:400});let n=(0,y.safeWorkspacePath)(a,s);if(!n)return g.NextResponse.json({error:"Invalid path"},{status:400});try{return await (0,_.stat)(n),g.NextResponse.json({error:"File already exists",path:s},{status:409})}catch(e){if("ENOENT"!==e.code)return g.NextResponse.json({error:"Failed to create file"},{status:500})}try{return await (0,_.mkdir)(w.default.dirname(n),{recursive:!0}),await (0,_.writeFile)(n,"","utf-8"),g.NextResponse.json({ok:!0,path:s})}catch{return g.NextResponse.json({error:"Failed to create file"},{status:500})}}e.s(["POST",0,N],316516);var C=e.i(316516);let P=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/wiki/new-file/route",pathname:"/api/wiki/new-file",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/wiki/new-file/route.ts",nextConfigOutput:"standalone",userland:C,...{}}),{workAsyncStorage:k,workUnitAsyncStorage:A,serverHooks:j}=P;async function O(e,t,a){a.requestMeta&&(0,s.setRequestMeta)(e,a.requestMeta),P.isDev&&(0,s.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let _="/api/wiki/new-file/route";_=_.replace(/\/index$/,"")||"/";let w=await P.prepare(e,t,{srcPage:_,multiZoneDraftMode:!1});if(!w)return t.statusCode=400,t.end("Bad Request"),null==a.waitUntil||a.waitUntil.call(a,Promise.resolve()),null;let{buildId:g,params:E,nextConfig:x,parsedUrl:y,isDraftMode:N,prerenderManifest:C,routerServerContext:k,isOnDemandRevalidate:A,revalidateOnlyGenerated:j,resolvedPathname:O,clientReferenceManifest:T,serverActionsManifest:b}=w,S=(0,o.normalizeAppPath)(_),q=!!(C.dynamicRoutes[S]||C.routes[O]),I=async()=>((null==k?void 0:k.render404)?await k.render404(e,t,y,!1):t.end("This page could not be found"),null);if(q&&!N){let e=!!C.routes[O],t=C.dynamicRoutes[S];if(t&&!1===t.fallback&&!e){if(x.adapterPath)return await I();throw new m.NoFallbackError}}let D=null;!q||P.isDev||N||(D="/index"===(D=O)?"/":D);let H=!0===P.isDev||!q,U=q&&!H;b&&T&&(0,i.setManifestsSingleton)({page:_,clientReferenceManifest:T,serverActionsManifest:b});let F=e.method||"GET",M=(0,n.getTracer)(),$=M.getActiveScopeSpan(),B=!!(null==k?void 0:k.isWrappedByNextServer),K=!!(0,s.getRequestMeta)(e,"minimalMode"),W=(0,s.getRequestMeta)(e,"incrementalCache")||await P.getIncrementalCache(e,x,C,K);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let z={params:E,previewProps:C.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:H,incrementalCache:W,cacheLifeProfiles:x.cacheLife,waitUntil:a.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,a,s)=>P.onRequestError(e,t,a,s,k)},sharedContext:{buildId:g}},L=new l.NodeNextRequest(e),G=new l.NodeNextResponse(t),V=u.NextRequestAdapter.fromNodeNextRequest(L,(0,u.signalFromNodeResponse)(t));try{let s,i=async e=>P.handle(V,z).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 a=r.get("next.route");if(a){let t=`${F} ${a}`;e.setAttributes({"next.route":a,"http.route":a,"next.span_name":t}),e.updateName(t),s&&s!==e&&(s.setAttribute("http.route",a),s.updateName(t))}else e.updateName(`${F} ${_}`)}),o=async s=>{var n,o;let l=async({previousCacheEntry:r})=>{try{if(!K&&A&&j&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let n=await i(s);e.fetchMetrics=z.renderOpts.fetchMetrics;let o=z.renderOpts.pendingWaitUntil;o&&a.waitUntil&&(a.waitUntil(o),o=void 0);let l=z.renderOpts.collectedTags;if(!q)return await (0,c.sendResponse)(L,G,n,z.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!==z.renderOpts.collectedRevalidate&&!(z.renderOpts.collectedRevalidate>=f.INFINITE_CACHE)&&z.renderOpts.collectedRevalidate,a=void 0===z.renderOpts.collectedExpire||z.renderOpts.collectedExpire>=f.INFINITE_CACHE?void 0:z.renderOpts.collectedExpire;return{value:{kind:R.CachedRouteKind.APP_ROUTE,status:n.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:a}}}}catch(t){throw(null==r?void 0:r.isStale)&&await P.onRequestError(e,t,{routerKind:"App Router",routePath:_,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:A})},!1,k),t}},u=await P.handleResponse({req:e,nextConfig:x,cacheKey:D,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:C,isRoutePPREnabled:!1,isOnDemandRevalidate:A,revalidateOnlyGenerated:j,responseGenerator:l,waitUntil:a.waitUntil,isMinimalMode:K});if(!q)return null;if((null==u||null==(n=u.value)?void 0:n.kind)!==R.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"),N&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let d=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return K&&q||d.delete(f.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||d.get("Cache-Control")||d.set("Cache-Control",(0,v.getCacheControlHeader)(u.cacheControl)),await (0,c.sendResponse)(L,G,new Response(u.value.body,{headers:d,status:u.value.status||200})),null};B&&$?await o($):(s=M.getActiveScopeSpan(),await M.withPropagatedContext(e.headers,()=>M.trace(d.BaseServerSpan.handleRequest,{spanName:`${F} ${_}`,kind:n.SpanKind.SERVER,attributes:{"http.method":F,"http.target":e.url}},o),void 0,!B))}catch(t){if(t instanceof m.NoFallbackError||await P.onRequestError(e,t,{routerKind:"App Router",routePath:S,routeType:"route",revalidateReason:(0,p.getRevalidateReason)({isStaticGeneration:U,isOnDemandRevalidate:A})},!1,k),q)throw t;return await (0,c.sendResponse)(L,G,new Response(null,{status:500})),null}}e.s(["handler",0,O,"patchFetch",0,function(){return(0,a.patchFetch)({workAsyncStorage:k,workUnitAsyncStorage:A})},"routeModule",0,P,"serverHooks",0,j,"workAsyncStorage",0,k,"workUnitAsyncStorage",0,A],365026)},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-.y6im._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[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 a=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 a.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(a.has(`${e}//${t}`))return null}catch{}return t.NextResponse.json({error:"FORBIDDEN",message:"Bad referer"},{status:403})}return null}])},761095,(e,t,r)=>{t.exports=e.x("node:net",()=>require("node:net"))},345212,e=>{"use strict";var t=e.i(874533),r=e.i(902157),s=e.i(761095),n=e.i(750227);let a=new Map;function i(e,t){return new Promise(r=>{let n=(0,s.createConnection)(e,t);n.setTimeout(800),n.on("connect",()=>{n.destroy(),r(!0)}),n.on("error",()=>{n.destroy(),r(!1)}),n.on("timeout",()=>{n.destroy(),r(!1)})})}async function o(e,t=3e4){let r=Date.now()+t;for(;Date.now()<r;){let[t,r]=await Promise.all([i(e,"127.0.0.1"),i(e,"::1")]);if(t||r)return!0;await new Promise(e=>setTimeout(e,400))}return!1}function l(e){let t=n.default.join(e,"package.json");if(!(0,r.existsSync)(t))return null;try{return JSON.parse((0,r.readFileSync)(t,"utf-8"))}catch{return null}}function u(e,t){return t.start?"start":t.preview&&(0,r.existsSync)(n.default.join(e,"dist"))?"preview":t.dev?"dev":null}async function p(e,i,p){let c=a.get(e);if(c&&"stopped"!==c.status&&"error"!==c.status)return{port:c.port};let d=await new Promise((e,t)=>{let r=(0,s.createServer)();r.listen(0,"127.0.0.1",()=>{let t=r.address(),s="object"==typeof t&&t?t.port:0;r.close(()=>e(s))}),r.on("error",t)}),h=(0,r.existsSync)(n.default.join(i,"pnpm-lock.yaml"))?"pnpm":(0,r.existsSync)(n.default.join(i,"yarn.lock"))?"yarn":"npm",f=function(e,t,r){let s=l(e);if(!s)return null;let n=s.scripts??{},a=Object.keys({...s.dependencies,...s.devDependencies}).some(e=>"vite"===e||e.includes("vite")),i=(e,r=[])=>({bin:t,args:["run",e,...r.length?["--",...r]:[]],isVite:a});if(r&&n[r])return i(r);let o=u(e,n);return o?i(o):s.main?{bin:"node",args:[s.main],isVite:!1}:null}(i,h,p);if(!f)throw Error("No runnable script found in package.json (need start, preview, or dev)");let v={port:d,process:null,status:"installing",logs:[]};a.set(e,v);let g=e=>{v.logs.push(e),v.logs.length>200&&v.logs.shift()};if(!(0,r.existsSync)(n.default.join(i,"node_modules")))try{g(`[wiki-viewer] Running ${h} install…`),await new Promise((e,r)=>{let s=(0,t.spawn)(h,["install"],{cwd:i,stdio:"pipe"});s.on("exit",t=>0===t?e():r(Error(`${h} install failed (exit ${t})`))),s.on("error",r)})}catch(e){return v.status="error",v.error=String(e),{port:d}}v.status="starting",g(`[wiki-viewer] Starting on port ${d}: ${f.bin} ${f.args.join(" ")}`);let m=f.isVite?["--port",String(d)]:[],w=(0,t.spawn)(f.bin,[...f.args,...m],{cwd:i,stdio:"pipe",env:{...process.env,PORT:String(d),VITE_PORT:String(d)}});v.process=w;let R=e=>{for(let t of e.toString().split("\n"))t.trim()&&g(t)};return w.stdout?.on("data",R),w.stderr?.on("data",R),w.on("exit",t=>{let r=a.get(e);r?.process===w&&(r.status=0===t||null===t?"stopped":"error",r.error=t?`Process exited with code ${t}`:void 0)}),o(d).then(t=>{let r=a.get(e);r?.process===w&&(r.status=t?"running":"error",t||(r.error="Port never became reachable (30 s timeout)"))}),{port:d}}e.s(["getScripts",0,function(e){let t=l(e);if(!t)return{scripts:[],defaultScript:null};let r=t.scripts??{};return{scripts:Object.keys(r),defaultScript:u(e,r)}},"getStatus",0,function(e){let t=a.get(e);return t?{status:t.status,port:t.port||void 0,error:t.error,logs:t.logs}:{status:"stopped",logs:[]}},"resolveByPrefix",0,function(e){for(let t=e.length;t>0;t--){let r=e.slice(0,t).join("/"),s=a.get(r);if(s&&"running"===s.status&&s.port){let n="/"+e.slice(t).join("/");return{relPath:r,port:s.port,rest:n}}}return null},"startApp",0,p,"stopApp",0,function(e){let t=a.get(e);if(t?.process){try{t.process.kill("SIGTERM")}catch{}t.status="stopped"}}])},80520,e=>{"use strict";var t=e.i(364564),r=e.i(102095),s=e.i(691091),n=e.i(475331),a=e.i(490301),i=e.i(670943),o=e.i(690324),l=e.i(243133),u=e.i(404870),p=e.i(420180),c=e.i(867883),d=e.i(336708),h=e.i(682278),f=e.i(157569),v=e.i(844146),g=e.i(193695);e.i(105888);var m=e.i(530564),w=e.i(702414),R=e.i(402662),_=e.i(660038),y=e.i(359211),x=e.i(345212);async function E(e){let t=await (0,_.resolveWorkspaceForUser)(e);if(!t.ok)return w.NextResponse.json({error:t.code},{status:t.status});let{searchParams:r}=new URL(e.url),s=r.get("path")??"",n=(0,x.getStatus)(s),a=(0,y.safeWorkspacePath)(t.rootDir,s),i=a?(0,x.getScripts)(a):{scripts:[],defaultScript:null};return w.NextResponse.json({...n,...i})}async function S(e){let t=(0,R.checkOrigin)(e);if(t)return t;let r=await (0,_.resolveWorkspaceForUser)(e,"write");if(!r.ok)return w.NextResponse.json({error:r.code},{status:r.status});let{rootDir:s}=r,n=await e.json(),a=n.path;if(!a||"string"!=typeof a)return w.NextResponse.json({error:"Missing path"},{status:400});let i=(0,y.safeWorkspacePath)(s,a);if(!i)return w.NextResponse.json({error:"Invalid path"},{status:400});try{let e=await (0,x.startApp)(a,i,n.script);return w.NextResponse.json(e)}catch(e){return w.NextResponse.json({error:String(e)},{status:500})}}async function k(e){let t=(0,R.checkOrigin)(e);if(t)return t;let r=await (0,_.resolveWorkspaceForUser)(e,"write");if(!r.ok)return w.NextResponse.json({error:r.code},{status:r.status});let s=(await e.json()).path;return s&&"string"==typeof s?((0,x.stopApp)(s),w.NextResponse.json({ok:!0})):w.NextResponse.json({error:"Missing path"},{status:400})}e.s(["DELETE",0,k,"GET",0,E,"POST",0,S],41743);var j=e.i(41743);let P=new t.AppRouteRouteModule({definition:{kind:r.RouteKind.APP_ROUTE,page:"/api/wiki/app/route",pathname:"/api/wiki/app",filename:"route",bundlePath:""},distDir:".next",relativeProjectDir:"",resolvedPagePath:"[project]/src/app/api/wiki/app/route.ts",nextConfigOutput:"standalone",userland:j,...{}}),{workAsyncStorage:N,workUnitAsyncStorage:b,serverHooks:C}=P;async function T(e,t,s){s.requestMeta&&(0,n.setRequestMeta)(e,s.requestMeta),P.isDev&&(0,n.addRequestMeta)(e,"devRequestTimingInternalsEnd",process.hrtime.bigint());let w="/api/wiki/app/route";w=w.replace(/\/index$/,"")||"/";let R=await P.prepare(e,t,{srcPage:w,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:E,isDraftMode:S,prerenderManifest:k,routerServerContext:j,isOnDemandRevalidate:N,revalidateOnlyGenerated:b,resolvedPathname:C,clientReferenceManifest:T,serverActionsManifest:A}=R,O=(0,o.normalizeAppPath)(w),q=!!(k.dynamicRoutes[O]||k.routes[C]),I=async()=>((null==j?void 0:j.render404)?await j.render404(e,t,E,!1):t.end("This page could not be found"),null);if(q&&!S){let e=!!k.routes[C],t=k.dynamicRoutes[O];if(t&&!1===t.fallback&&!e){if(x.adapterPath)return await I();throw new g.NoFallbackError}}let D=null;!q||P.isDev||S||(D="/index"===(D=C)?"/":D);let U=!0===P.isDev||!q,$=q&&!U;A&&T&&(0,i.setManifestsSingleton)({page:w,clientReferenceManifest:T,serverActionsManifest:A});let H=e.method||"GET",M=(0,a.getTracer)(),F=M.getActiveScopeSpan(),B=!!(null==j?void 0:j.isWrappedByNextServer),K=!!(0,n.getRequestMeta)(e,"minimalMode"),W=(0,n.getRequestMeta)(e,"incrementalCache")||await P.getIncrementalCache(e,x,k,K);null==W||W.resetRequestCache(),globalThis.__incrementalCache=W;let L={params:y,previewProps:k.preview,renderOpts:{experimental:{authInterrupts:!!x.experimental.authInterrupts},cacheComponents:!!x.cacheComponents,supportsDynamicResponse:U,incrementalCache:W,cacheLifeProfiles:x.cacheLife,waitUntil:s.waitUntil,onClose:e=>{t.on("close",e)},onAfterTaskError:void 0,onInstrumentationRequestError:(t,r,s,n)=>P.onRequestError(e,t,s,n,j)},sharedContext:{buildId:_}},z=new l.NodeNextRequest(e),V=new l.NodeNextResponse(t),G=u.NextRequestAdapter.fromNodeNextRequest(z,(0,u.signalFromNodeResponse)(t));try{let n,i=async e=>P.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")!==p.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=`${H} ${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(`${H} ${w}`)}),o=async n=>{var a,o;let l=async({previousCacheEntry:r})=>{try{if(!K&&N&&b&&!r)return t.statusCode=404,t.setHeader("x-nextjs-cache","REVALIDATED"),t.end("This page could not be found"),null;let a=await i(n);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(!q)return await (0,d.sendResponse)(z,V,a,L.renderOpts.pendingWaitUntil),null;{let e=await a.blob(),t=(0,h.toNodeOutgoingHttpHeaders)(a.headers);l&&(t[v.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>=v.INFINITE_CACHE)&&L.renderOpts.collectedRevalidate,s=void 0===L.renderOpts.collectedExpire||L.renderOpts.collectedExpire>=v.INFINITE_CACHE?void 0:L.renderOpts.collectedExpire;return{value:{kind:m.CachedRouteKind.APP_ROUTE,status:a.status,body:Buffer.from(await e.arrayBuffer()),headers:t},cacheControl:{revalidate:r,expire:s}}}}catch(t){throw(null==r?void 0:r.isStale)&&await P.onRequestError(e,t,{routerKind:"App Router",routePath:w,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:N})},!1,j),t}},u=await P.handleResponse({req:e,nextConfig:x,cacheKey:D,routeKind:r.RouteKind.APP_ROUTE,isFallback:!1,prerenderManifest:k,isRoutePPREnabled:!1,isOnDemandRevalidate:N,revalidateOnlyGenerated:b,responseGenerator:l,waitUntil:s.waitUntil,isMinimalMode:K});if(!q)return null;if((null==u||null==(a=u.value)?void 0:a.kind)!==m.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",N?"REVALIDATED":u.isMiss?"MISS":u.isStale?"STALE":"HIT"),S&&t.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate");let p=(0,h.fromNodeOutgoingHttpHeaders)(u.value.headers);return K&&q||p.delete(v.NEXT_CACHE_TAGS_HEADER),!u.cacheControl||t.getHeader("Cache-Control")||p.get("Cache-Control")||p.set("Cache-Control",(0,f.getCacheControlHeader)(u.cacheControl)),await (0,d.sendResponse)(z,V,new Response(u.value.body,{headers:p,status:u.value.status||200})),null};B&&F?await o(F):(n=M.getActiveScopeSpan(),await M.withPropagatedContext(e.headers,()=>M.trace(p.BaseServerSpan.handleRequest,{spanName:`${H} ${w}`,kind:a.SpanKind.SERVER,attributes:{"http.method":H,"http.target":e.url}},o),void 0,!B))}catch(t){if(t instanceof g.NoFallbackError||await P.onRequestError(e,t,{routerKind:"App Router",routePath:O,routeType:"route",revalidateReason:(0,c.getRevalidateReason)({isStaticGeneration:$,isOnDemandRevalidate:N})},!1,j),q)throw t;return await (0,d.sendResponse)(z,V,new Response(null,{status:500})),null}}e.s(["handler",0,T,"patchFetch",0,function(){return(0,s.patchFetch)({workAsyncStorage:N,workUnitAsyncStorage:b})},"routeModule",0,P,"serverHooks",0,C,"workAsyncStorage",0,N,"workUnitAsyncStorage",0,b],80520)},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-3_t2y._.js.map
@@ -1,3 +0,0 @@
1
- module.exports=[224361,(e,s,r)=>{s.exports=e.x("util",()=>require("util"))},688947,(e,s,r)=>{s.exports=e.x("stream",()=>require("stream"))},427699,(e,s,r)=>{s.exports=e.x("events",()=>require("events"))},81111,(e,s,r)=>{s.exports=e.x("node:stream",()=>require("node:stream"))},500874,(e,s,r)=>{s.exports=e.x("buffer",()=>require("buffer"))},168315,e=>{e.v(s=>Promise.all(["server/chunks/0sag_@better-auth_memory-adapter_dist_index_mjs_0pvj6im._.js"].map(s=>e.l(s))).then(()=>s(862112)))},317691,e=>{e.v(s=>Promise.all(["server/chunks/0dhv_better-auth_dist_adapters_kysely-adapter_index_mjs_0t4t4z8._.js"].map(s=>e.l(s))).then(()=>s(833412)))},580632,e=>{e.v(e=>Promise.resolve().then(()=>e(270406)))},947559,e=>{e.v(s=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0z1z6m4._.js"].map(s=>e.l(s))).then(()=>s(495181)))},715018,e=>{e.v(s=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0qqlvhl._.js"].map(s=>e.l(s))).then(()=>s(698370)))},146843,e=>{e.v(s=>Promise.all(["server/chunks/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_0wynrz3._.js"].map(s=>e.l(s))).then(()=>s(143740)))},84040,e=>{e.v(s=>Promise.all(["server/chunks/0p91_next_0h94sj1._.js"].map(s=>e.l(s))).then(()=>s(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(s=>Promise.all(["server/chunks/[root-of-the-server]__068ni_k._.js","server/chunks/src_lib_search_0ymmp0c._.js"].map(s=>e.l(s))).then(()=>s(437856)))}];
2
-
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__0-kjkzt._.js.map