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
@@ -1,140 +0,0 @@
1
- /**
2
- * Per-user agent ownership tests.
3
- *
4
- * User A approves an agent → only user A sees it / can revoke it.
5
- * User B cannot see or revoke user A's agents.
6
- */
7
- import { test, before, after, beforeEach } from "node:test";
8
- import assert from "node:assert/strict";
9
- import { mkdtemp, rm } from "node:fs/promises";
10
- import { tmpdir } from "node:os";
11
- import path from "node:path";
12
-
13
- let tmpHome: string;
14
-
15
- before(async () => {
16
- tmpHome = await mkdtemp(path.join(tmpdir(), "agent-ownership-test-"));
17
- process.env.HOME = tmpHome;
18
- });
19
-
20
- after(async () => {
21
- await rm(tmpHome, { recursive: true, force: true });
22
- });
23
-
24
- import { POST as registerPOST } from "../../app/api/agent/register/route.js";
25
- import { POST as approvePOST } from "../../app/api/agent/admin/registrations/[regId]/approve/route.js";
26
- import { GET as listAgentsGET } from "../../app/api/agent/admin/agents/route.js";
27
- import { POST as revokeAgentPOST } from "../../app/api/agent/admin/agents/[agentId]/revoke/route.js";
28
- import { ensureRegistry } from "../../lib/proof/registry.js";
29
-
30
- beforeEach(async () => {
31
- const { _resetRegisterBuckets } = await import("../../lib/proof/register-rate-limit");
32
- _resetRegisterBuckets();
33
- });
34
-
35
- async function makeUserCookie(tag: string): Promise<string> {
36
- await ensureRegistry();
37
- const { auth, authReady } = await import("../../lib/auth/server.js");
38
- await authReady();
39
- const res = await auth.api.signUpEmail({
40
- body: {
41
- email: `${tag}${Date.now()}@test.local`,
42
- password: "test1234!",
43
- name: tag,
44
- },
45
- asResponse: true,
46
- });
47
- if (!res.ok) throw new Error("signUpEmail failed: " + res.status);
48
- const setCookie = res.headers.get("set-cookie") ?? "";
49
- return setCookie
50
- .split(/,(?=[^ ])/)
51
- .map((c) => c.split(";")[0].trim())
52
- .join("; ");
53
- }
54
-
55
- async function registerAgent(agentId: string): Promise<string> {
56
- const req = new Request("http://localhost:3000/api/agent/register", {
57
- method: "POST",
58
- headers: { "Content-Type": "application/json" },
59
- body: JSON.stringify({
60
- id: agentId,
61
- displayName: `Agent ${agentId}`,
62
- scope: { paths: ["**/*"], ops: ["read"] },
63
- }),
64
- });
65
- const res = await registerPOST(req);
66
- const data = (await res.json()) as { registrationId: string };
67
- return data.registrationId;
68
- }
69
-
70
- async function approveAgent(regId: string, cookie: string): Promise<void> {
71
- const req = new Request(
72
- `http://localhost:3000/api/agent/admin/registrations/${regId}/approve`,
73
- { method: "POST", headers: { Cookie: cookie } },
74
- );
75
- const res = await approvePOST(req, { params: Promise.resolve({ regId }) });
76
- assert.equal(res.status, 200, `approve failed: ${await res.text()}`);
77
- }
78
-
79
- test("User A approves agent → appears in user A's agent list", async () => {
80
- const cookieA = await makeUserCookie("usera");
81
- const regId = await registerAgent("ai:agent-a1");
82
- await approveAgent(regId, cookieA);
83
-
84
- const listReq = new Request("http://localhost:3000/api/agent/admin/agents", {
85
- headers: { Cookie: cookieA },
86
- });
87
- const res = await listAgentsGET(listReq);
88
- assert.equal(res.status, 200);
89
- const data = (await res.json()) as { agents: Array<{ id: string }> };
90
- assert.ok(data.agents.some((a) => a.id === "ai:agent-a1"));
91
- });
92
-
93
- test("User B cannot see user A's agent", async () => {
94
- const cookieA = await makeUserCookie("usera2");
95
- const cookieB = await makeUserCookie("userb2");
96
-
97
- const regId = await registerAgent("ai:agent-a2");
98
- await approveAgent(regId, cookieA);
99
-
100
- const listReq = new Request("http://localhost:3000/api/agent/admin/agents", {
101
- headers: { Cookie: cookieB },
102
- });
103
- const res = await listAgentsGET(listReq);
104
- assert.equal(res.status, 200);
105
- const data = (await res.json()) as { agents: Array<{ id: string }> };
106
- assert.ok(!data.agents.some((a) => a.id === "ai:agent-a2"), "User B should not see user A's agent");
107
- });
108
-
109
- test("User B cannot revoke user A's agent → 403", async () => {
110
- const cookieA = await makeUserCookie("usera3");
111
- const cookieB = await makeUserCookie("userb3");
112
-
113
- const regId = await registerAgent("ai:agent-a3");
114
- await approveAgent(regId, cookieA);
115
-
116
- const revokeReq = new Request(
117
- "http://localhost:3000/api/agent/admin/agents/ai:agent-a3/revoke",
118
- { method: "POST", headers: { Cookie: cookieB } },
119
- );
120
- const res = await revokeAgentPOST(revokeReq, {
121
- params: Promise.resolve({ agentId: "ai:agent-a3" }),
122
- });
123
- assert.equal(res.status, 403);
124
- });
125
-
126
- test("User A can revoke their own agent", async () => {
127
- const cookieA = await makeUserCookie("usera4");
128
-
129
- const regId = await registerAgent("ai:agent-a4");
130
- await approveAgent(regId, cookieA);
131
-
132
- const revokeReq = new Request(
133
- "http://localhost:3000/api/agent/admin/agents/ai:agent-a4/revoke",
134
- { method: "POST", headers: { Cookie: cookieA } },
135
- );
136
- const res = await revokeAgentPOST(revokeReq, {
137
- params: Promise.resolve({ agentId: "ai:agent-a4" }),
138
- });
139
- assert.equal(res.status, 200);
140
- });
@@ -1,134 +0,0 @@
1
- /**
2
- * Phase C — Agent workspace scoping.
3
- *
4
- * Proves an agent whose scope.workspaceId is pinned to one workspace is
5
- * rejected (403) when a request resolves to a DIFFERENT workspace, and
6
- * allowed (200) when it matches. An agent with no workspaceId (wildcard)
7
- * works in any workspace.
8
- */
9
- import { test, before, after } from "node:test";
10
- import assert from "node:assert/strict";
11
- import { mkdtemp, rm, writeFile, mkdir } from "node:fs/promises";
12
- import { tmpdir } from "node:os";
13
- import path from "node:path";
14
- import { randomBytes } from "node:crypto";
15
-
16
- import { setRootDir } from "../../lib/root-dir.js";
17
- import { ensureRegistry, addAgent, hashToken } from "../../lib/proof/registry.js";
18
- import { writeConfig } from "../../lib/config.js";
19
- import type { Workspace } from "../../lib/workspaces.js";
20
-
21
- let tmpHome: string;
22
- let rootA: string;
23
- let rootB: string;
24
- let wsA: Workspace;
25
- let wsB: Workspace;
26
-
27
- let fileGET: (req: Request, ctx: { params: Promise<{ path: string[] }> }) => Promise<Response>;
28
-
29
- const PINNED_TOKEN = randomBytes(32).toString("hex");
30
- const WILDCARD_TOKEN = randomBytes(32).toString("hex");
31
-
32
- function headers(token: string, id: string): Record<string, string> {
33
- return { Authorization: `Bearer ${token}`, "X-Agent-Id": id };
34
- }
35
-
36
- function makeCtx(segments: string[]): { params: Promise<{ path: string[] }> } {
37
- return { params: Promise.resolve({ path: segments }) };
38
- }
39
-
40
- before(async () => {
41
- tmpHome = await mkdtemp(path.join(tmpdir(), "ws-scope-home-"));
42
- rootA = await mkdtemp(path.join(tmpdir(), "ws-scope-A-"));
43
- rootB = await mkdtemp(path.join(tmpdir(), "ws-scope-B-"));
44
- process.env.HOME = tmpHome;
45
- setRootDir(rootA); // fallback (unused once registry has workspaces)
46
-
47
- wsA = {
48
- id: "ws_AAAAAA",
49
- name: "A",
50
- rootDir: rootA,
51
- createdAt: new Date().toISOString(),
52
- lastOpenedAt: new Date().toISOString(),
53
- };
54
- wsB = {
55
- id: "ws_BBBBBB",
56
- name: "B",
57
- rootDir: rootB,
58
- createdAt: new Date().toISOString(),
59
- lastOpenedAt: new Date().toISOString(),
60
- };
61
- // Seed registry so resolveWorkspaceForAgent picks by ?ws= instead of fallback.
62
- await writeConfig({ workspaces: [wsA, wsB] });
63
-
64
- await ensureRegistry();
65
- await addAgent({
66
- id: "ai:pinned",
67
- displayName: "Pinned to A",
68
- tokenHash: hashToken(PINNED_TOKEN),
69
- scope: { paths: ["**/*"], ops: ["read", "mutate"], workspaceId: wsA.id },
70
- createdAt: new Date().toISOString(),
71
- lastSeen: new Date().toISOString(),
72
- });
73
- await addAgent({
74
- id: "ai:wildcard",
75
- displayName: "Wildcard",
76
- tokenHash: hashToken(WILDCARD_TOKEN),
77
- scope: { paths: ["**/*"], ops: ["read", "mutate"] }, // no workspaceId
78
- createdAt: new Date().toISOString(),
79
- lastSeen: new Date().toISOString(),
80
- });
81
-
82
- await writeFile(path.join(rootA, "a.txt"), "in A");
83
- await writeFile(path.join(rootB, "b.txt"), "in B");
84
-
85
- const fileRoute = await import("../../app/api/agent/fs/file/[...path]/route.js");
86
- fileGET = fileRoute.GET;
87
- });
88
-
89
- async function rmQuiet(p: string): Promise<void> {
90
- // File-lock sentinels may be written concurrently during teardown → retry.
91
- for (let i = 0; i < 3; i++) {
92
- try {
93
- await rm(p, { recursive: true, force: true });
94
- return;
95
- } catch {
96
- await new Promise((r) => setTimeout(r, 50));
97
- }
98
- }
99
- }
100
-
101
- after(async () => {
102
- await rmQuiet(tmpHome);
103
- await rmQuiet(rootA);
104
- await rmQuiet(rootB);
105
- });
106
-
107
- test("pinned agent: 200 in its own workspace", async () => {
108
- const req = new Request(`http://localhost/api/agent/fs/file/a.txt?ws=${wsA.id}`, {
109
- headers: headers(PINNED_TOKEN, "ai:pinned"),
110
- });
111
- const res = await fileGET(req, makeCtx(["a.txt"]));
112
- assert.equal(res.status, 200);
113
- assert.equal(await res.text(), "in A");
114
- });
115
-
116
- test("pinned agent: 403 when request resolves to a different workspace", async () => {
117
- const req = new Request(`http://localhost/api/agent/fs/file/b.txt?ws=${wsB.id}`, {
118
- headers: headers(PINNED_TOKEN, "ai:pinned"),
119
- });
120
- const res = await fileGET(req, makeCtx(["b.txt"]));
121
- assert.equal(res.status, 403);
122
- });
123
-
124
- test("wildcard agent: 200 in either workspace", async () => {
125
- const reqA = new Request(`http://localhost/api/agent/fs/file/a.txt?ws=${wsA.id}`, {
126
- headers: headers(WILDCARD_TOKEN, "ai:wildcard"),
127
- });
128
- assert.equal((await fileGET(reqA, makeCtx(["a.txt"]))).status, 200);
129
-
130
- const reqB = new Request(`http://localhost/api/agent/fs/file/b.txt?ws=${wsB.id}`, {
131
- headers: headers(WILDCARD_TOKEN, "ai:wildcard"),
132
- });
133
- assert.equal((await fileGET(reqB, makeCtx(["b.txt"]))).status, 200);
134
- });
@@ -1,110 +0,0 @@
1
- /**
2
- * Tests for /api/agents/install, /api/agents/skill, /api/agents/skill.tar.gz
3
- */
4
- import { test } from "node:test";
5
- import assert from "node:assert/strict";
6
-
7
- function makeMockRequest(url: string): Request {
8
- return new Request(url, { method: "GET" });
9
- }
10
-
11
- // Import routes
12
- import { GET as installGET } from "../../app/api/agents/install/route.js";
13
- import { GET as skillGET } from "../../app/api/agents/skill/route.js";
14
- import { GET as tarGET } from "../../app/api/agents/skill.tar.gz/route.js";
15
-
16
- test("GET /api/agents/install returns 200 with expected shape", async () => {
17
- const req = makeMockRequest("http://localhost:3000/api/agents/install");
18
- const res = await installGET(req as Parameters<typeof installGET>[0]);
19
- assert.equal(res.status, 200);
20
-
21
- const body = await res.json() as Record<string, unknown>;
22
- assert.equal(body.name, "wiki-viewer");
23
- assert.ok(typeof body.version === "string" && body.version.length > 0);
24
- assert.ok(typeof body.endpoint === "string" && body.endpoint.startsWith("http"));
25
- assert.ok(Array.isArray(body.routes) && (body.routes as unknown[]).length > 0);
26
- assert.ok(typeof body.skillTarball === "string");
27
- assert.ok(typeof body.bootstrapPrompt === "string" && body.bootstrapPrompt.length > 0);
28
- assert.ok(typeof body.humanInstructions === "string" && body.humanInstructions.length > 0);
29
- assert.ok(Array.isArray(body.ops) && (body.ops as unknown[]).length > 0);
30
- });
31
-
32
- test("GET /api/agents/install manifest includes fs/* routes, capabilities, scopeOps, modes, mcpAdapter", async () => {
33
- const req = makeMockRequest("http://localhost:3000/api/agents/install");
34
- const res = await installGET(req as Parameters<typeof installGET>[0]);
35
- const body = await res.json() as Record<string, unknown>;
36
-
37
- // fs routes present
38
- const routes = body.routes as Array<Record<string, string>>;
39
- const fsPaths = routes.map((r) => r.path);
40
- assert.ok(fsPaths.some((p) => p.includes("/api/agent/fs/file")), "missing GET/PUT/DELETE fs/file route");
41
- assert.ok(fsPaths.some((p) => p.includes("/api/agent/fs/ls")), "missing fs/ls route");
42
- assert.ok(fsPaths.some((p) => p.includes("/api/agent/fs/move")), "missing fs/move route");
43
- assert.ok(fsPaths.some((p) => p.includes("/api/agent/fs/search")), "missing fs/search route");
44
-
45
- // capabilities block
46
- const caps = body.capabilities as Record<string, unknown>;
47
- assert.ok(caps, "capabilities block missing");
48
- assert.ok(typeof caps.maxFileBytes === "number" && caps.maxFileBytes > 0, "maxFileBytes missing");
49
- assert.equal(caps.supportsRange, true);
50
- assert.equal(caps.ifMatchRequired, true);
51
- assert.equal(caps.forceBypass, true);
52
- assert.deepEqual(caps.search, ["grep", "glob"]);
53
- assert.equal(caps.collabPrecondition, "If-Collab-Match");
54
-
55
- // scopeOps includes delete
56
- const scopeOps = caps.scopeOps as string[];
57
- assert.ok(Array.isArray(scopeOps), "scopeOps missing");
58
- assert.ok(scopeOps.includes("read"), "scopeOps missing read");
59
- assert.ok(scopeOps.includes("mutate"), "scopeOps missing mutate");
60
- assert.ok(scopeOps.includes("delete"), "scopeOps missing delete");
61
-
62
- // collabStates
63
- const collabStates = caps.collabStates as string[];
64
- assert.ok(Array.isArray(collabStates));
65
- assert.ok(collabStates.includes("active"));
66
- assert.ok(collabStates.includes("not-markdown"));
67
-
68
- // modes block
69
- const modes = body.modes as Record<string, unknown>;
70
- assert.ok(modes, "modes block missing");
71
- assert.ok(typeof modes.rule === "string" && modes.rule.includes("X-Collab-State"), "modes.rule missing mode distinction");
72
- const tiers = modes.tiers as Record<string, string>;
73
- assert.ok(tiers && tiers.tier1 && tiers.tier2, "modes.tiers missing");
74
-
75
- // mcpAdapter
76
- const mcp = body.mcpAdapter as Record<string, unknown>;
77
- assert.ok(mcp, "mcpAdapter missing");
78
- assert.equal(mcp.package, "wiki-viewer-mcp");
79
- assert.ok(typeof mcp.invoke === "string" && mcp.invoke.includes("npx"));
80
- const env = mcp.env as string[];
81
- assert.ok(env.includes("WIKI_VIEWER_URL"));
82
- assert.ok(env.includes("WIKI_VIEWER_TOKEN"));
83
- });
84
-
85
- test("GET /api/agents/skill returns 200 text/markdown with SKILL.md content", async () => {
86
- const req = makeMockRequest("http://localhost:3000/api/agents/skill");
87
- const res = await skillGET(req as Parameters<typeof skillGET>[0]);
88
- assert.equal(res.status, 200);
89
-
90
- const ct = res.headers.get("content-type") ?? "";
91
- assert.ok(ct.startsWith("text/markdown"), `Expected text/markdown, got: ${ct}`);
92
-
93
- const body = await res.text();
94
- assert.ok(body.startsWith("---\nname: wiki-viewer"), `Unexpected start: ${body.slice(0, 40)}`);
95
- });
96
-
97
- test("GET /api/agents/skill.tar.gz returns 200 gzip with magic bytes", async () => {
98
- const req = makeMockRequest("http://localhost:3000/api/agents/skill.tar.gz");
99
- const res = await tarGET(req as Parameters<typeof tarGET>[0]);
100
- assert.equal(res.status, 200);
101
-
102
- const ct = res.headers.get("content-type") ?? "";
103
- assert.equal(ct, "application/gzip");
104
-
105
- const buf = Buffer.from(await res.arrayBuffer());
106
- assert.ok(buf.length > 0, "tarball should not be empty");
107
- // gzip magic bytes
108
- assert.equal(buf[0], 0x1f);
109
- assert.equal(buf[1], 0x8b);
110
- });
@@ -1,179 +0,0 @@
1
- /**
2
- * Isolated write-path benchmark — NOT a test, NOT touching production state.
3
- *
4
- * Drives the real Tier-1 route handlers (filePUT / fileGET) against a throwaway
5
- * temp rootDir + temp HOME (lock dir), exactly like agent-fs.test.ts, and
6
- * measures end-to-end server-side latency for the write path:
7
- * - non-.md overwrite (raw, no lock/sidecar)
8
- * - .md overwrite (cross-proc lock + reconcile + sidecar write + datasync)
9
- * - edit_file equivalent (GET + PUT round-trip on .md)
10
- *
11
- * Run: npx tsx src/tests/proof/bench-write.ts
12
- * Optional env: BENCH_ITERS (default 300), BENCH_WARMUP (default 30)
13
- */
14
- import { mkdtemp, writeFile, rm } from "node:fs/promises";
15
- import { tmpdir } from "node:os";
16
- import path from "node:path";
17
- import { createHash, randomBytes } from "node:crypto";
18
-
19
- import { setRootDir } from "../../lib/root-dir.js";
20
- import { ensureRegistry, addAgent, hashToken } from "../../lib/proof/registry.js";
21
-
22
- const ITERS = Number(process.env.BENCH_ITERS) || 300;
23
- const WARMUP = Number(process.env.BENCH_WARMUP) || 30;
24
-
25
- function sha256(buf: Buffer): string {
26
- return "sha256:" + createHash("sha256").update(buf).digest("hex");
27
- }
28
- function hdrs(token: string, id: string): Record<string, string> {
29
- return { Authorization: `Bearer ${token}`, "X-Agent-Id": id };
30
- }
31
- function fileUrl(rel: string, qs = ""): string {
32
- return `http://localhost/api/agent/fs/file/${rel}${qs}`;
33
- }
34
-
35
- function pct(sorted: number[], p: number): number {
36
- const i = Math.min(sorted.length - 1, Math.floor((p / 100) * sorted.length));
37
- return sorted[i];
38
- }
39
- function stats(label: string, samples: number[]) {
40
- const s = [...samples].sort((a, b) => a - b);
41
- const sum = s.reduce((a, b) => a + b, 0);
42
- const mean = sum / s.length;
43
- return {
44
- label,
45
- n: s.length,
46
- mean: +mean.toFixed(3),
47
- p50: +pct(s, 50).toFixed(3),
48
- p95: +pct(s, 95).toFixed(3),
49
- p99: +pct(s, 99).toFixed(3),
50
- min: +s[0].toFixed(3),
51
- max: +s[s.length - 1].toFixed(3),
52
- };
53
- }
54
-
55
- async function timeIt(fn: () => Promise<void>): Promise<number> {
56
- const t0 = performance.now();
57
- await fn();
58
- return performance.now() - t0;
59
- }
60
-
61
- async function main() {
62
- const tmpHome = await mkdtemp(path.join(tmpdir(), "bench-home-"));
63
- const tmpRoot = await mkdtemp(path.join(tmpdir(), "bench-root-"));
64
- process.env.HOME = tmpHome;
65
- setRootDir(tmpRoot);
66
- await ensureRegistry();
67
-
68
- const TOKEN = randomBytes(32).toString("hex");
69
- await addAgent({
70
- id: "ai:bench",
71
- displayName: "Bench",
72
- tokenHash: hashToken(TOKEN),
73
- scope: { paths: ["**/*"], ops: ["read", "mutate", "delete"] },
74
- createdAt: new Date().toISOString(),
75
- lastSeen: new Date().toISOString(),
76
- });
77
-
78
- const fileRoute = await import("../../app/api/agent/fs/file/[...path]/route.js");
79
- const filePUT = fileRoute.PUT;
80
- const fileGET = fileRoute.GET;
81
- const H = hdrs(TOKEN, "ai:bench");
82
-
83
- const ctx = (rel: string) => ({ params: Promise.resolve({ path: rel.split("/") }) });
84
-
85
- // Seed bodies (~1KB, realistic small doc)
86
- const body = Buffer.from("# Doc\n\n" + "lorem ipsum dolor sit amet. ".repeat(40));
87
- const txtBody = Buffer.from("config_value = " + "x".repeat(900));
88
-
89
- async function putOnce(rel: string, data: Buffer, ifMatch?: string, ifCollab?: string): Promise<Response> {
90
- const headers: Record<string, string> = { ...H, "Content-Type": "application/octet-stream" };
91
- if (ifMatch) headers["If-Match"] = ifMatch;
92
- if (ifCollab) headers["If-Collab-Match"] = ifCollab;
93
- return filePUT(new Request(fileUrl(rel), { method: "PUT", headers, body: new Uint8Array(data) }), ctx(rel));
94
- }
95
- async function getSha(rel: string): Promise<{ sha: string; collabRev: string | null }> {
96
- const res = await fileGET(new Request(fileUrl(rel), { headers: H }), ctx(rel));
97
- const etag = (res.headers.get("ETag") ?? "").replace(/"/g, "");
98
- return { sha: etag, collabRev: res.headers.get("X-Collab-Revision") };
99
- }
100
-
101
- // ── Scenario A: non-.md overwrite (lean path) ──────────────────────────────
102
- await putOnce("bench.txt", txtBody, undefined); // create
103
- const txtSamples: number[] = [];
104
- {
105
- let sha = (await getSha("bench.txt")).sha;
106
- for (let i = 0; i < WARMUP + ITERS; i++) {
107
- const data = Buffer.from(txtBody.toString() + i);
108
- const t = await timeIt(async () => {
109
- const res = await putOnce("bench.txt", data, sha);
110
- if (res.status !== 200) throw new Error("txt PUT " + res.status);
111
- sha = (await res.json() as { sha256: string }).sha256;
112
- });
113
- if (i >= WARMUP) txtSamples.push(t);
114
- }
115
- }
116
-
117
- // ── Scenario B: .md overwrite (lock + reconcile + sidecar + datasync) ──────
118
- await putOnce("bench.md", body, undefined); // create
119
- const mdSamples: number[] = [];
120
- {
121
- let sha = (await getSha("bench.md")).sha;
122
- for (let i = 0; i < WARMUP + ITERS; i++) {
123
- const data = Buffer.from(body.toString() + "\n\nedit " + i);
124
- const t = await timeIt(async () => {
125
- const res = await putOnce("bench.md", data, sha);
126
- if (res.status !== 200) throw new Error("md PUT " + res.status + " " + await res.text());
127
- sha = (await res.json() as { sha256: string }).sha256;
128
- });
129
- if (i >= WARMUP) mdSamples.push(t);
130
- }
131
- }
132
-
133
- // ── Scenario C: edit_file equivalent — GET + PUT round-trip on .md ─────────
134
- const editSamples: number[] = [];
135
- {
136
- for (let i = 0; i < WARMUP + ITERS; i++) {
137
- const data = Buffer.from(body.toString() + "\n\nrt " + i);
138
- const t = await timeIt(async () => {
139
- const { sha } = await getSha("bench.md");
140
- const res = await putOnce("bench.md", data, sha);
141
- if (res.status !== 200) throw new Error("edit PUT " + res.status);
142
- await res.json();
143
- });
144
- if (i >= WARMUP) editSamples.push(t);
145
- }
146
- }
147
-
148
- const results = [
149
- stats("non-.md overwrite (lean)", txtSamples),
150
- stats(".md overwrite (lock+reconcile+sidecar+datasync)", mdSamples),
151
- stats("edit_file (GET+PUT .md round-trip)", editSamples),
152
- ];
153
-
154
- console.log(`\nwrite-path benchmark (iters=${ITERS}, warmup=${WARMUP}, ~1KB bodies)\n`);
155
- console.log(
156
- ["scenario".padEnd(48), "p50", "p95", "p99", "mean", "max"].join(" "),
157
- );
158
- for (const r of results) {
159
- console.log(
160
- [
161
- r.label.padEnd(48),
162
- `${r.p50}ms`.padStart(7),
163
- `${r.p95}ms`.padStart(7),
164
- `${r.p99}ms`.padStart(7),
165
- `${r.mean}ms`.padStart(7),
166
- `${r.max}ms`.padStart(7),
167
- ].join(" "),
168
- );
169
- }
170
- console.log("");
171
-
172
- await rm(tmpHome, { recursive: true, force: true });
173
- await rm(tmpRoot, { recursive: true, force: true });
174
- }
175
-
176
- main().catch((e) => {
177
- console.error(e);
178
- process.exit(1);
179
- });
@@ -1,68 +0,0 @@
1
- import { test } from "node:test";
2
- import assert from "node:assert/strict";
3
- import { isEmailAllowed } from "../../lib/auth/allowlist";
4
-
5
- function resetEnv() {
6
- delete process.env.AUTH_ALLOWED_EMAILS;
7
- delete process.env.AUTH_ALLOWED_DOMAIN;
8
- }
9
-
10
- // These tests exercise the env-fallback path. They assume no allowlist is set
11
- // in ~/.wiki-viewer/config.json (config takes precedence over env when present).
12
-
13
- test("isEmailAllowed: no env vars allows any email", async () => {
14
- resetEnv();
15
- assert.equal(await isEmailAllowed("anyone@example.com"), true);
16
- assert.equal(await isEmailAllowed("eve@evil.com"), true);
17
- });
18
-
19
- test("isEmailAllowed: explicit allowlist (case-insensitive)", async () => {
20
- resetEnv();
21
- process.env.AUTH_ALLOWED_EMAILS = "alice@example.com,bob@example.com";
22
- try {
23
- assert.equal(await isEmailAllowed("alice@example.com"), true);
24
- assert.equal(await isEmailAllowed("ALICE@EXAMPLE.COM"), true);
25
- assert.equal(await isEmailAllowed("bob@example.com"), true);
26
- assert.equal(await isEmailAllowed("eve@example.com"), false);
27
- } finally {
28
- resetEnv();
29
- }
30
- });
31
-
32
- test("isEmailAllowed: domain allowlist", async () => {
33
- resetEnv();
34
- process.env.AUTH_ALLOWED_DOMAIN = "example.com,trusted.org";
35
- try {
36
- assert.equal(await isEmailAllowed("anyone@example.com"), true);
37
- assert.equal(await isEmailAllowed("user@trusted.org"), true);
38
- assert.equal(await isEmailAllowed("user@TRUSTED.ORG"), true);
39
- assert.equal(await isEmailAllowed("eve@evil.com"), false);
40
- } finally {
41
- resetEnv();
42
- }
43
- });
44
-
45
- test("isEmailAllowed: both lists, either match wins", async () => {
46
- resetEnv();
47
- process.env.AUTH_ALLOWED_EMAILS = "guest@anywhere.com";
48
- process.env.AUTH_ALLOWED_DOMAIN = "example.com";
49
- try {
50
- assert.equal(await isEmailAllowed("alice@example.com"), true);
51
- assert.equal(await isEmailAllowed("guest@anywhere.com"), true);
52
- assert.equal(await isEmailAllowed("eve@evil.com"), false);
53
- } finally {
54
- resetEnv();
55
- }
56
- });
57
-
58
- test("isEmailAllowed: handles whitespace and empty entries", async () => {
59
- resetEnv();
60
- process.env.AUTH_ALLOWED_EMAILS = " alice@example.com , , bob@example.com ";
61
- try {
62
- assert.equal(await isEmailAllowed("alice@example.com"), true);
63
- assert.equal(await isEmailAllowed("bob@example.com"), true);
64
- assert.equal(await isEmailAllowed("eve@example.com"), false);
65
- } finally {
66
- resetEnv();
67
- }
68
- });