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.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/api/agent/activity/route.js +6 -6
- package/.next/standalone/.next/server/app/api/agent/activity/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/events/[...path]/route.js +8 -8
- package/.next/standalone/.next/server/app/api/agent/events/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/files/[...path]/route.js +9 -9
- package/.next/standalone/.next/server/app/api/agent/files/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route.js +8 -8
- package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/ls/[[...path]]/route.js +8 -8
- package/.next/standalone/.next/server/app/api/agent/fs/ls/[[...path]]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/move/route.js +8 -8
- package/.next/standalone/.next/server/app/api/agent/fs/move/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/fs/search/route.js +9 -9
- package/.next/standalone/.next/server/app/api/agent/fs/search/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/internal/span/route.js +8 -8
- package/.next/standalone/.next/server/app/api/agent/internal/span/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/settings/route.js +7 -7
- package/.next/standalone/.next/server/app/api/agent/settings/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/sidecar/[...path]/route.js +6 -6
- package/.next/standalone/.next/server/app/api/agent/sidecar/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/app-proxy/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/assets/[...path]/route.js +5 -5
- package/.next/standalone/.next/server/app/api/assets/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/share/[token]/route.js +6 -5
- package/.next/standalone/.next/server/app/api/share/[token]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/share/route.js +4 -4
- package/.next/standalone/.next/server/app/api/share/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/browse/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/clear-root/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/reveal/route.js +6 -6
- package/.next/standalone/.next/server/app/api/system/reveal/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/root-status/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/set-root/route.js +6 -5
- package/.next/standalone/.next/server/app/api/system/set-root/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/open/route.js +5 -4
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/open/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/refresh/route.js +6 -5
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/refresh/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/route.js +5 -4
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/workspaces/route.js +7 -6
- package/.next/standalone/.next/server/app/api/system/workspaces/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/upload/[...path]/route.js +5 -5
- package/.next/standalone/.next/server/app/api/upload/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/app/route.js +7 -7
- package/.next/standalone/.next/server/app/api/wiki/app/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/backlinks/route.js +7 -7
- package/.next/standalone/.next/server/app/api/wiki/backlinks/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/content/route.js +7 -7
- package/.next/standalone/.next/server/app/api/wiki/content/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/download/route.js +6 -6
- package/.next/standalone/.next/server/app/api/wiki/download/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/file/route.js +5 -5
- package/.next/standalone/.next/server/app/api/wiki/file/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/folder/route.js +5 -5
- package/.next/standalone/.next/server/app/api/wiki/folder/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/git-branches/route.js +4 -4
- package/.next/standalone/.next/server/app/api/wiki/git-branches/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/git-checkout/route.js +6 -6
- package/.next/standalone/.next/server/app/api/wiki/git-checkout/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/git-diff/route.js +4 -4
- package/.next/standalone/.next/server/app/api/wiki/git-diff/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/git-file-info/route.js +4 -4
- package/.next/standalone/.next/server/app/api/wiki/git-file-info/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/git-history/route.js +4 -4
- package/.next/standalone/.next/server/app/api/wiki/git-history/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/git-pull/route.js +8 -8
- package/.next/standalone/.next/server/app/api/wiki/git-pull/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/move/route.js +6 -6
- package/.next/standalone/.next/server/app/api/wiki/move/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/new-file/route.js +5 -5
- package/.next/standalone/.next/server/app/api/wiki/new-file/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/outlinks/route.js +7 -7
- package/.next/standalone/.next/server/app/api/wiki/outlinks/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/page/route.js +5 -5
- package/.next/standalone/.next/server/app/api/wiki/page/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/presence/route.js +6 -6
- package/.next/standalone/.next/server/app/api/wiki/presence/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/route.js +5 -5
- package/.next/standalone/.next/server/app/api/wiki/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/search/route.js +5 -5
- package/.next/standalone/.next/server/app/api/wiki/search/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/slugs/route.js +5 -5
- package/.next/standalone/.next/server/app/api/wiki/slugs/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/upload/route.js +5 -5
- package/.next/standalone/.next/server/app/api/wiki/upload/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/watch/route.js +5 -5
- package/.next/standalone/.next/server/app/api/wiki/watch/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/s/[token]/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/signin/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-jzw2_._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.-oq-7._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__000spch._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__01oin-a._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__01qcera._.js +16 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__02.uul~._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__024967n._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06booxp._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__071_pmz._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_0bqpg._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_1f2cw._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0a6j6r4._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0aoqat-._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0as-u6z._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0bvtbax._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0c-ee48._.js +5 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0e_9pc5._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0esmskc._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fshk._._.js +20 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fu72o7._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0k9mili._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0l-wu5u._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0lvz22t._.js +20 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0n-chxk._.js +16 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0n9zdf0._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nmx3k2._.js +12 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nzlmkb._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0o0v6hf._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0s38pid._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0s_8poz._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0sfrx~.._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0sggstu._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0u81k~2._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0uibxf_._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wfv_by._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wlj-yw._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0w~__xz._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0yat~ul._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0yxauu6._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zbkgnr._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0zv_j05._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~rntxj._.js +3 -0
- package/.next/standalone/.next/server/chunks/src_lib_search_0d-_j3u._.js +4 -4
- package/.next/standalone/.next/server/chunks/src_lib_search_0ymmp0c._.js +3 -3
- package/.next/standalone/.next/server/chunks/src_lib_workspaces_ts_0qon40u._.js +4 -0
- 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
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0z41nrr._.js → [root-of-the-server]__10te1ye._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_13p348f._.js → node_modules__pnpm_0-a_zjq._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0gos._c._.js → node_modules__pnpm_02l_1_8._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0ru1i2-._.js → node_modules__pnpm_03rzttw._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_08xpp3w._.js → node_modules__pnpm_04frxp9._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0b8odbc._.js → node_modules__pnpm_057-t6m._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0f_n_zp._.js → node_modules__pnpm_05_oahi._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0~i3a.i._.js → node_modules__pnpm_05ans~m._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0i2m0b.._.js → node_modules__pnpm_06-2ia.._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0aha1~u._.js → node_modules__pnpm_086.ow4._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0w.kwue._.js → node_modules__pnpm_0cahog3._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0e0r_qk._.js → node_modules__pnpm_0cxanql._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0ajqqlq._.js → node_modules__pnpm_0e09gmf._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0hzzx9d._.js → node_modules__pnpm_0eqjo2f._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_02bje_g._.js → node_modules__pnpm_0f-yazg._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0xk042~._.js → node_modules__pnpm_0iu44jv._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_11ede0p._.js → node_modules__pnpm_0jh8q66._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0k-7uzm._.js → node_modules__pnpm_0m39f~t._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0xr.ztu._.js → node_modules__pnpm_0ma-8l.._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0i6_kfe._.js → node_modules__pnpm_0met6sx._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_04v1_ty._.js → node_modules__pnpm_0mtrsi0._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0607~kg._.js → node_modules__pnpm_0n_swwn._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0t4l89_._.js → node_modules__pnpm_0ndyy93._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0-_58b8._.js → node_modules__pnpm_0s-cj7c._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0y2h_cz._.js → node_modules__pnpm_0tr41-t._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_08edl1n._.js → node_modules__pnpm_0u.uija._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0026mgr._.js → node_modules__pnpm_0wiyn6d._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_09o_spj._.js → node_modules__pnpm_0ygzt82._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_page_tsx_0ss2.w7._.js +2 -2
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/middleware-manifest.json +1 -1
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/static/chunks/0ci7khnv7i~7_.js +17 -0
- package/.next/standalone/.next/static/chunks/0sx~65~lg4mgl.css +5 -0
- package/.next/standalone/package.json +1 -1
- package/README.md +88 -17
- package/bin/postbuild.js +21 -0
- package/bin/wiki-viewer.js +198 -6
- package/package.json +1 -1
- package/.next/standalone/.github/workflows/publish.yml +0 -37
- package/.next/standalone/.handoffs/archive/handoff-20260612-113332.md +0 -98
- package/.next/standalone/.handoffs/archive/handoff-20260612-141032.md +0 -73
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-.y6im._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-3_t2y._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-kjkzt._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-puax4._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__01h996g._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0329ktu._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__03_xj4r._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__05398dt._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06lfvxh._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06w0aet._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__070_p2a._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0905hi1._.js +0 -21
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0aa63~j._.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0avcplk._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0b8_kyo._.js +0 -16
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0bticq1._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0bwevvu._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0c__k3q._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0cp~z4x._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fmdv9h._.js +0 -20
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0h0qbwr._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0jk~oyi._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ndq77b._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nvgpuk._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ocvng2._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ps4h~.._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0q7jqwp._.js +0 -12
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qew~6p._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0s_9f-a._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0uv7b8u._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0uv8.9i._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0vfe2io._.js +0 -4
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0w11kjy._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wc-.e4._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ymovmp._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~c6ouv._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0~rhs0u._.js +0 -16
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__10h9tid._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__10yk-u1._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__11105ew._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__11a3dhw._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__13420tt._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__13h~pdf._.js +0 -3
- package/.next/standalone/.next/static/chunks/02kg.lbkfi1yc.css +0 -5
- package/.next/standalone/.next/static/chunks/0rcwd6-.iu~nd.js +0 -17
- package/.next/standalone/.pi/ownership.json +0 -3
- package/.next/standalone/AGENTS.md +0 -114
- package/.next/standalone/DESIGN.md +0 -521
- package/.next/standalone/README.md +0 -821
- package/.next/standalone/TODO.md +0 -20
- package/.next/standalone/agents/bootstrap-prompt.md +0 -14
- package/.next/standalone/agents/wiki-viewer-skill/SKILL.md +0 -456
- package/.next/standalone/bin/postbuild.js +0 -78
- package/.next/standalone/bin/wiki-viewer.js +0 -922
- package/.next/standalone/certificates/localhost-key.pem +0 -28
- package/.next/standalone/certificates/localhost.pem +0 -24
- package/.next/standalone/docs/agent-collab-plan.md +0 -1615
- package/.next/standalone/docs/agent-collab-v2-plan.md +0 -771
- package/.next/standalone/docs/agent-fs-plan.md +0 -232
- package/.next/standalone/docs/editorial-skin-spec.md +0 -242
- package/.next/standalone/docs/file-vs-collab-authority.md +0 -124
- package/.next/standalone/docs/mobile-readiness-spec.md +0 -229
- package/.next/standalone/docs/workspacing-plan.md +0 -364
- package/.next/standalone/packages/wiki-viewer-mcp/README.md +0 -195
- package/.next/standalone/packages/wiki-viewer-mcp/bench-e2e.mjs +0 -166
- package/.next/standalone/packages/wiki-viewer-mcp/bench-latency.mjs +0 -87
- package/.next/standalone/packages/wiki-viewer-mcp/bench-payload.mjs +0 -45
- package/.next/standalone/packages/wiki-viewer-mcp/dist/http-client.js +0 -331
- package/.next/standalone/packages/wiki-viewer-mcp/dist/index.js +0 -531
- package/.next/standalone/packages/wiki-viewer-mcp/dist/register.js +0 -94
- package/.next/standalone/packages/wiki-viewer-mcp/dist/state-cache.js +0 -28
- package/.next/standalone/packages/wiki-viewer-mcp/package-lock.json +0 -1716
- package/.next/standalone/packages/wiki-viewer-mcp/package.json +0 -41
- package/.next/standalone/packages/wiki-viewer-mcp/src/http-client.ts +0 -459
- package/.next/standalone/packages/wiki-viewer-mcp/src/index.ts +0 -638
- package/.next/standalone/packages/wiki-viewer-mcp/src/register.ts +0 -144
- package/.next/standalone/packages/wiki-viewer-mcp/src/state-cache.ts +0 -55
- package/.next/standalone/packages/wiki-viewer-mcp/tsconfig.json +0 -19
- package/.next/standalone/pnpm-lock.yaml +0 -6697
- package/.next/standalone/pnpm-workspace.yaml +0 -8
- package/.next/standalone/postcss.config.mjs +0 -2
- package/.next/standalone/src/app/api/agent/activity/route.ts +0 -59
- package/.next/standalone/src/app/api/agent/admin/agents/[agentId]/revoke/route.ts +0 -40
- package/.next/standalone/src/app/api/agent/admin/agents/route.ts +0 -33
- package/.next/standalone/src/app/api/agent/admin/registrations/[regId]/approve/route.ts +0 -83
- package/.next/standalone/src/app/api/agent/admin/registrations/[regId]/deny/route.ts +0 -36
- package/.next/standalone/src/app/api/agent/admin/registrations/route.ts +0 -27
- package/.next/standalone/src/app/api/agent/events/[...path]/route.ts +0 -148
- package/.next/standalone/src/app/api/agent/files/[...path]/route.ts +0 -219
- package/.next/standalone/src/app/api/agent/fs/file/[...path]/route.ts +0 -446
- package/.next/standalone/src/app/api/agent/fs/ls/[[...path]]/route.ts +0 -152
- package/.next/standalone/src/app/api/agent/fs/move/route.ts +0 -130
- package/.next/standalone/src/app/api/agent/fs/search/route.ts +0 -272
- package/.next/standalone/src/app/api/agent/internal/span/route.ts +0 -121
- package/.next/standalone/src/app/api/agent/register/[regId]/route.ts +0 -50
- package/.next/standalone/src/app/api/agent/register/route.ts +0 -118
- package/.next/standalone/src/app/api/agent/settings/route.ts +0 -34
- package/.next/standalone/src/app/api/agent/settings/token/regenerate/route.ts +0 -20
- package/.next/standalone/src/app/api/agent/sidecar/[...path]/route.ts +0 -53
- package/.next/standalone/src/app/api/agents/install/route.ts +0 -143
- package/.next/standalone/src/app/api/agents/skill/route.ts +0 -20
- package/.next/standalone/src/app/api/agents/skill.tar.gz/route.ts +0 -87
- package/.next/standalone/src/app/api/app-proxy/[...path]/route.ts +0 -247
- package/.next/standalone/src/app/api/assets/[...path]/route.ts +0 -75
- package/.next/standalone/src/app/api/auth/[...all]/route.ts +0 -7
- package/.next/standalone/src/app/api/owner/init/route.ts +0 -14
- package/.next/standalone/src/app/api/share/[token]/route.ts +0 -269
- package/.next/standalone/src/app/api/share/route.ts +0 -127
- package/.next/standalone/src/app/api/system/admins/route.ts +0 -103
- package/.next/standalone/src/app/api/system/auth-config/route.ts +0 -22
- package/.next/standalone/src/app/api/system/auth-settings/route.ts +0 -86
- package/.next/standalone/src/app/api/system/browse/route.ts +0 -82
- package/.next/standalone/src/app/api/system/clear-root/route.ts +0 -16
- package/.next/standalone/src/app/api/system/config/route.ts +0 -14
- package/.next/standalone/src/app/api/system/pins/route.ts +0 -38
- package/.next/standalone/src/app/api/system/reveal/route.ts +0 -36
- package/.next/standalone/src/app/api/system/root-status/route.ts +0 -13
- package/.next/standalone/src/app/api/system/set-root/route.ts +0 -53
- package/.next/standalone/src/app/api/system/users/route.ts +0 -120
- package/.next/standalone/src/app/api/system/workspaces/[id]/open/route.ts +0 -34
- package/.next/standalone/src/app/api/system/workspaces/[id]/refresh/route.ts +0 -32
- package/.next/standalone/src/app/api/system/workspaces/[id]/route.ts +0 -78
- package/.next/standalone/src/app/api/system/workspaces/route.ts +0 -128
- package/.next/standalone/src/app/api/upload/[...path]/route.ts +0 -85
- package/.next/standalone/src/app/api/wiki/app/route.ts +0 -60
- package/.next/standalone/src/app/api/wiki/backlinks/route.ts +0 -29
- package/.next/standalone/src/app/api/wiki/content/route.ts +0 -159
- package/.next/standalone/src/app/api/wiki/download/route.ts +0 -100
- package/.next/standalone/src/app/api/wiki/file/route.ts +0 -57
- package/.next/standalone/src/app/api/wiki/folder/route.ts +0 -34
- package/.next/standalone/src/app/api/wiki/git-branches/route.ts +0 -32
- package/.next/standalone/src/app/api/wiki/git-checkout/route.ts +0 -45
- package/.next/standalone/src/app/api/wiki/git-diff/route.ts +0 -33
- package/.next/standalone/src/app/api/wiki/git-file-info/route.ts +0 -27
- package/.next/standalone/src/app/api/wiki/git-history/route.ts +0 -27
- package/.next/standalone/src/app/api/wiki/git-pull/route.ts +0 -48
- package/.next/standalone/src/app/api/wiki/move/route.ts +0 -61
- package/.next/standalone/src/app/api/wiki/new-file/route.ts +0 -56
- package/.next/standalone/src/app/api/wiki/outlinks/route.ts +0 -76
- package/.next/standalone/src/app/api/wiki/page/route.ts +0 -92
- package/.next/standalone/src/app/api/wiki/presence/route.ts +0 -56
- package/.next/standalone/src/app/api/wiki/route.ts +0 -116
- package/.next/standalone/src/app/api/wiki/search/route.ts +0 -44
- package/.next/standalone/src/app/api/wiki/slugs/route.ts +0 -54
- package/.next/standalone/src/app/api/wiki/upload/route.ts +0 -95
- package/.next/standalone/src/app/api/wiki/watch/route.ts +0 -67
- package/.next/standalone/src/app/globals.css +0 -1249
- package/.next/standalone/src/app/icon.svg +0 -11
- package/.next/standalone/src/app/layout.tsx +0 -78
- package/.next/standalone/src/app/manifest.ts +0 -30
- package/.next/standalone/src/app/page.tsx +0 -3260
- package/.next/standalone/src/app/s/[token]/page.tsx +0 -357
- package/.next/standalone/src/app/signin/page.tsx +0 -16
- package/.next/standalone/src/app/signin/signin-form.tsx +0 -238
- package/.next/standalone/src/components/ai-panel/activity-row.tsx +0 -284
- package/.next/standalone/src/components/ai-panel/ai-panel.tsx +0 -311
- package/.next/standalone/src/components/ai-panel/token-section.tsx +0 -313
- package/.next/standalone/src/components/auth-settings-sheet.tsx +0 -474
- package/.next/standalone/src/components/confirm-dialog.tsx +0 -56
- package/.next/standalone/src/components/dir-picker.tsx +0 -606
- package/.next/standalone/src/components/editor/backlinks-panel.tsx +0 -139
- package/.next/standalone/src/components/editor/bubble-menu.tsx +0 -346
- package/.next/standalone/src/components/editor/callout-extension.ts +0 -36
- package/.next/standalone/src/components/editor/comment-pip.tsx +0 -56
- package/.next/standalone/src/components/editor/comment-thread.tsx +0 -254
- package/.next/standalone/src/components/editor/csv-viewer.tsx +0 -379
- package/.next/standalone/src/components/editor/document-outline.tsx +0 -230
- package/.next/standalone/src/components/editor/editor-toolbar.tsx +0 -564
- package/.next/standalone/src/components/editor/editor.tsx +0 -1327
- package/.next/standalone/src/components/editor/extensions/drag-handle.ts +0 -325
- package/.next/standalone/src/components/editor/extensions/heading-anchors.ts +0 -55
- package/.next/standalone/src/components/editor/extensions/proof-span.ts +0 -60
- package/.next/standalone/src/components/editor/extensions/resizable-image.tsx +0 -159
- package/.next/standalone/src/components/editor/extensions.ts +0 -150
- package/.next/standalone/src/components/editor/file-fallback-viewer.tsx +0 -75
- package/.next/standalone/src/components/editor/folder-index.tsx +0 -236
- package/.next/standalone/src/components/editor/google-doc-viewer.tsx +0 -73
- package/.next/standalone/src/components/editor/image-viewer.tsx +0 -57
- package/.next/standalone/src/components/editor/large-file-gate.tsx +0 -108
- package/.next/standalone/src/components/editor/link-popover.tsx +0 -111
- package/.next/standalone/src/components/editor/media-popover.tsx +0 -212
- package/.next/standalone/src/components/editor/media-viewer.tsx +0 -70
- package/.next/standalone/src/components/editor/mermaid-viewer.tsx +0 -286
- package/.next/standalone/src/components/editor/node-app-viewer.tsx +0 -328
- package/.next/standalone/src/components/editor/notebook-viewer.tsx +0 -371
- package/.next/standalone/src/components/editor/office/docx-viewer.tsx +0 -93
- package/.next/standalone/src/components/editor/office/office-chrome.tsx +0 -83
- package/.next/standalone/src/components/editor/office/pptx-viewer.tsx +0 -104
- package/.next/standalone/src/components/editor/office/xlsx-viewer.tsx +0 -192
- package/.next/standalone/src/components/editor/pdf-viewer.tsx +0 -32
- package/.next/standalone/src/components/editor/proof-span-popover.tsx +0 -162
- package/.next/standalone/src/components/editor/slash-commands.tsx +0 -629
- package/.next/standalone/src/components/editor/source-viewer.tsx +0 -289
- package/.next/standalone/src/components/editor/suggest-edit-popover.tsx +0 -229
- package/.next/standalone/src/components/editor/suggestion-card.tsx +0 -206
- package/.next/standalone/src/components/editor/table-menu.tsx +0 -232
- package/.next/standalone/src/components/editor/view-mode-comment-button.tsx +0 -77
- package/.next/standalone/src/components/editor/website-viewer.tsx +0 -75
- package/.next/standalone/src/components/editor/wiki-link-create-dialog.tsx +0 -189
- package/.next/standalone/src/components/editor/wiki-link-decorator.ts +0 -79
- package/.next/standalone/src/components/editor/wiki-link-extension.ts +0 -120
- package/.next/standalone/src/components/editor/wiki-link-picker.tsx +0 -250
- package/.next/standalone/src/components/layout/viewer-toolbar.tsx +0 -54
- package/.next/standalone/src/components/search/search-command-dialog.tsx +0 -246
- package/.next/standalone/src/components/search/sidebar-search-box.tsx +0 -121
- package/.next/standalone/src/components/search/snippet-text.tsx +0 -48
- package/.next/standalone/src/components/share-dialog.tsx +0 -307
- package/.next/standalone/src/components/theme-provider.tsx +0 -16
- package/.next/standalone/src/components/theme-toggle.tsx +0 -24
- package/.next/standalone/src/components/ui/badge.tsx +0 -35
- package/.next/standalone/src/components/ui/button.tsx +0 -56
- package/.next/standalone/src/components/ui/card.tsx +0 -63
- package/.next/standalone/src/components/ui/collapsible.tsx +0 -9
- package/.next/standalone/src/components/ui/command.tsx +0 -151
- package/.next/standalone/src/components/ui/context-menu.tsx +0 -191
- package/.next/standalone/src/components/ui/dialog.tsx +0 -119
- package/.next/standalone/src/components/ui/dropdown-menu.tsx +0 -194
- package/.next/standalone/src/components/ui/input.tsx +0 -22
- package/.next/standalone/src/components/ui/label.tsx +0 -25
- package/.next/standalone/src/components/ui/popover.tsx +0 -33
- package/.next/standalone/src/components/ui/scroll-area.tsx +0 -47
- package/.next/standalone/src/components/ui/select.tsx +0 -156
- package/.next/standalone/src/components/ui/separator.tsx +0 -30
- package/.next/standalone/src/components/ui/sheet.tsx +0 -140
- package/.next/standalone/src/components/ui/skeleton.tsx +0 -15
- package/.next/standalone/src/components/ui/switch.tsx +0 -28
- package/.next/standalone/src/components/ui/tabs.tsx +0 -54
- package/.next/standalone/src/components/ui/textarea.tsx +0 -21
- package/.next/standalone/src/components/ui/tip.tsx +0 -23
- package/.next/standalone/src/components/ui/toggle-group.tsx +0 -41
- package/.next/standalone/src/components/ui/tooltip.tsx +0 -27
- package/.next/standalone/src/components/view-width-toggle.tsx +0 -70
- package/.next/standalone/src/components/wiki/frontmatter-header.tsx +0 -164
- package/.next/standalone/src/hooks/use-is-mobile.ts +0 -14
- package/.next/standalone/src/lib/app-runner.ts +0 -272
- package/.next/standalone/src/lib/auth/admin.ts +0 -120
- package/.next/standalone/src/lib/auth/allowlist.ts +0 -50
- package/.next/standalone/src/lib/auth/client.ts +0 -4
- package/.next/standalone/src/lib/auth/csrf.ts +0 -68
- package/.next/standalone/src/lib/auth/server.ts +0 -215
- package/.next/standalone/src/lib/cabinets/tree.ts +0 -75
- package/.next/standalone/src/lib/config.ts +0 -114
- package/.next/standalone/src/lib/embeds/detect.ts +0 -142
- package/.next/standalone/src/lib/git-secrets.ts +0 -65
- package/.next/standalone/src/lib/git.ts +0 -503
- package/.next/standalone/src/lib/google/detect.ts +0 -107
- package/.next/standalone/src/lib/markdown/parse-frontmatter.ts +0 -104
- package/.next/standalone/src/lib/markdown/remark-wikilinks.ts +0 -100
- package/.next/standalone/src/lib/markdown/sanitize-schema.ts +0 -106
- package/.next/standalone/src/lib/markdown/to-html.ts +0 -282
- package/.next/standalone/src/lib/markdown/to-markdown.ts +0 -252
- package/.next/standalone/src/lib/proof/activity-shared.ts +0 -31
- package/.next/standalone/src/lib/proof/activity.ts +0 -74
- package/.next/standalone/src/lib/proof/audit.ts +0 -88
- package/.next/standalone/src/lib/proof/auth.ts +0 -143
- package/.next/standalone/src/lib/proof/block-refs.ts +0 -133
- package/.next/standalone/src/lib/proof/blocks.ts +0 -73
- package/.next/standalone/src/lib/proof/client-auth.ts +0 -23
- package/.next/standalone/src/lib/proof/collab-state.ts +0 -81
- package/.next/standalone/src/lib/proof/event-bus.ts +0 -47
- package/.next/standalone/src/lib/proof/file-lock.ts +0 -43
- package/.next/standalone/src/lib/proof/glob.ts +0 -51
- package/.next/standalone/src/lib/proof/idempotency.ts +0 -37
- package/.next/standalone/src/lib/proof/lease.ts +0 -117
- package/.next/standalone/src/lib/proof/mutex.ts +0 -36
- package/.next/standalone/src/lib/proof/ops-applier.ts +0 -727
- package/.next/standalone/src/lib/proof/owner-auth.ts +0 -2
- package/.next/standalone/src/lib/proof/pending.ts +0 -97
- package/.next/standalone/src/lib/proof/proof-span.ts +0 -141
- package/.next/standalone/src/lib/proof/rate-limit.ts +0 -53
- package/.next/standalone/src/lib/proof/raw-fs.ts +0 -197
- package/.next/standalone/src/lib/proof/register-rate-limit.ts +0 -53
- package/.next/standalone/src/lib/proof/registry.ts +0 -195
- package/.next/standalone/src/lib/proof/sidecar.ts +0 -103
- package/.next/standalone/src/lib/proof/suggest-capture.ts +0 -69
- package/.next/standalone/src/lib/proof/types.ts +0 -182
- package/.next/standalone/src/lib/proof-config.ts +0 -14
- package/.next/standalone/src/lib/root-dir.ts +0 -35
- package/.next/standalone/src/lib/search/indexable-exts.ts +0 -25
- package/.next/standalone/src/lib/search/indexer.ts +0 -634
- package/.next/standalone/src/lib/search/sanitize.ts +0 -35
- package/.next/standalone/src/lib/search/search-db.ts +0 -57
- package/.next/standalone/src/lib/search/watcher-pool.ts +0 -79
- package/.next/standalone/src/lib/shared-docs/db.ts +0 -177
- package/.next/standalone/src/lib/toast.ts +0 -9
- package/.next/standalone/src/lib/utils.ts +0 -6
- package/.next/standalone/src/lib/wiki-helpers.ts +0 -36
- package/.next/standalone/src/lib/workspace-client.ts +0 -82
- package/.next/standalone/src/lib/workspace-context.ts +0 -173
- package/.next/standalone/src/lib/workspaces.ts +0 -400
- package/.next/standalone/src/middleware.ts +0 -44
- package/.next/standalone/src/stores/ai-panel-store.ts +0 -79
- package/.next/standalone/src/stores/editor-store.ts +0 -439
- package/.next/standalone/src/stores/pin-store.ts +0 -56
- package/.next/standalone/src/stores/proof-store.ts +0 -124
- package/.next/standalone/src/stores/recent-store.ts +0 -51
- package/.next/standalone/src/stores/search-store.ts +0 -104
- package/.next/standalone/src/stores/show-hidden-store.ts +0 -26
- package/.next/standalone/src/stores/sidebar-width-store.ts +0 -39
- package/.next/standalone/src/stores/skin-store.ts +0 -42
- package/.next/standalone/src/stores/tree-store.ts +0 -52
- package/.next/standalone/src/stores/view-width-store.ts +0 -101
- package/.next/standalone/src/stores/wiki-slugs-store.ts +0 -75
- package/.next/standalone/src/tests/proof/activity-aggregator.test.ts +0 -146
- package/.next/standalone/src/tests/proof/admin-create-user.test.ts +0 -43
- package/.next/standalone/src/tests/proof/agent-fs.test.ts +0 -973
- package/.next/standalone/src/tests/proof/agent-ownership.test.ts +0 -140
- package/.next/standalone/src/tests/proof/agent-workspace-scope.test.ts +0 -134
- package/.next/standalone/src/tests/proof/agents-install.test.ts +0 -110
- package/.next/standalone/src/tests/proof/bench-write.ts +0 -179
- package/.next/standalone/src/tests/proof/better-auth.test.ts +0 -68
- package/.next/standalone/src/tests/proof/block-refs.test.ts +0 -108
- package/.next/standalone/src/tests/proof/blocks.test.ts +0 -92
- package/.next/standalone/src/tests/proof/collab-state.test.ts +0 -501
- package/.next/standalone/src/tests/proof/comments-ops.test.ts +0 -177
- package/.next/standalone/src/tests/proof/editor-roundtrip.test.ts +0 -85
- package/.next/standalone/src/tests/proof/external-edit.test.ts +0 -58
- package/.next/standalone/src/tests/proof/file-lock.test.ts +0 -80
- package/.next/standalone/src/tests/proof/git-branches-checkout.test.ts +0 -136
- package/.next/standalone/src/tests/proof/git-read-features.test.ts +0 -473
- package/.next/standalone/src/tests/proof/git-secrets.test.ts +0 -138
- package/.next/standalone/src/tests/proof/git-sparse.test.ts +0 -257
- package/.next/standalone/src/tests/proof/git-workspace.test.ts +0 -135
- package/.next/standalone/src/tests/proof/git.test.ts +0 -243
- package/.next/standalone/src/tests/proof/glob.test.ts +0 -82
- package/.next/standalone/src/tests/proof/helpers/auth-session.ts +0 -27
- package/.next/standalone/src/tests/proof/markdown-to-html.test.ts +0 -46
- package/.next/standalone/src/tests/proof/ops-applier.test.ts +0 -368
- package/.next/standalone/src/tests/proof/owner-init.test.ts +0 -2
- package/.next/standalone/src/tests/proof/parse-frontmatter.test.ts +0 -60
- package/.next/standalone/src/tests/proof/preload.ts +0 -21
- package/.next/standalone/src/tests/proof/proof-span.test.ts +0 -98
- package/.next/standalone/src/tests/proof/rate-limit.test.ts +0 -54
- package/.next/standalone/src/tests/proof/readonly-enforcement.test.ts +0 -161
- package/.next/standalone/src/tests/proof/reconcile-sidecar.test.ts +0 -195
- package/.next/standalone/src/tests/proof/registration-flow.test.ts +0 -330
- package/.next/standalone/src/tests/proof/registry.test.ts +0 -169
- package/.next/standalone/src/tests/proof/routes.test.ts +0 -516
- package/.next/standalone/src/tests/proof/search-index.test.ts +0 -376
- package/.next/standalone/src/tests/proof/sidecar-lifecycle.test.ts +0 -177
- package/.next/standalone/src/tests/proof/sidecar-trim.test.ts +0 -58
- package/.next/standalone/src/tests/proof/suggestion-ops.test.ts +0 -280
- package/.next/standalone/src/tests/proof/wiki-content-put.test.ts +0 -140
- package/.next/standalone/src/tests/proof/wiki-routes-auth.test.ts +0 -208
- package/.next/standalone/src/tests/proof/workspace-isolation.test.ts +0 -87
- package/.next/standalone/src/tests/proof/workspaces-api.test.ts +0 -227
- package/.next/standalone/src/types/index.ts +0 -47
- package/.next/standalone/tailwind.config.ts +0 -191
- package/.next/standalone/tsconfig.json +0 -41
- package/.next/standalone/tsconfig.tsbuildinfo +0 -1
- /package/.next/standalone/.next/static/{WMOTgfV82apmdovxzgbMx → ecpoWt_SP3WkUTh0NsnuT}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{WMOTgfV82apmdovxzgbMx → ecpoWt_SP3WkUTh0NsnuT}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{WMOTgfV82apmdovxzgbMx → ecpoWt_SP3WkUTh0NsnuT}/_ssgManifest.js +0 -0
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { ChevronDown, ChevronRight } from "lucide-react";
|
|
3
|
-
import { Fragment, useState } from "react";
|
|
4
|
-
import { Badge } from "@/components/ui/badge";
|
|
5
|
-
|
|
6
|
-
type FmValue =
|
|
7
|
-
| string
|
|
8
|
-
| number
|
|
9
|
-
| boolean
|
|
10
|
-
| string[]
|
|
11
|
-
| Record<string, unknown>
|
|
12
|
-
| null;
|
|
13
|
-
|
|
14
|
-
interface Props {
|
|
15
|
-
data: Record<string, FmValue>;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const KNOWN_KEYS = new Set([
|
|
19
|
-
"title",
|
|
20
|
-
"type",
|
|
21
|
-
"status",
|
|
22
|
-
"created",
|
|
23
|
-
"updated",
|
|
24
|
-
"date",
|
|
25
|
-
"tags",
|
|
26
|
-
"sources",
|
|
27
|
-
"private",
|
|
28
|
-
"supersedes",
|
|
29
|
-
"superseded_by",
|
|
30
|
-
]);
|
|
31
|
-
|
|
32
|
-
function fmt(v: unknown): string {
|
|
33
|
-
if (v === null || v === undefined) return "";
|
|
34
|
-
if (typeof v === "string") return v;
|
|
35
|
-
if (typeof v === "number" || typeof v === "boolean") return String(v);
|
|
36
|
-
if (Array.isArray(v)) return v.map(fmt).join(", ");
|
|
37
|
-
try {
|
|
38
|
-
return JSON.stringify(v);
|
|
39
|
-
} catch {
|
|
40
|
-
return String(v);
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export function FrontmatterHeader({ data }: Props) {
|
|
45
|
-
const [showRaw, setShowRaw] = useState(false);
|
|
46
|
-
const keys = Object.keys(data);
|
|
47
|
-
if (keys.length === 0) return null;
|
|
48
|
-
|
|
49
|
-
const title = typeof data.title === "string" ? data.title : null;
|
|
50
|
-
const type = typeof data.type === "string" ? data.type : null;
|
|
51
|
-
const status = typeof data.status === "string" ? data.status : null;
|
|
52
|
-
const created = typeof data.created === "string" ? data.created : null;
|
|
53
|
-
const updated = typeof data.updated === "string" ? data.updated : null;
|
|
54
|
-
const isPrivate = data.private === true;
|
|
55
|
-
const tags = Array.isArray(data.tags) ? (data.tags as string[]) : [];
|
|
56
|
-
const sources = Array.isArray(data.sources) ? (data.sources as string[]) : [];
|
|
57
|
-
const supersededBy =
|
|
58
|
-
typeof data.superseded_by === "string" ? data.superseded_by : null;
|
|
59
|
-
|
|
60
|
-
const otherKeys = keys.filter((k) => !KNOWN_KEYS.has(k));
|
|
61
|
-
|
|
62
|
-
return (
|
|
63
|
-
<div className="mb-6 rounded-sm border bg-card/40 px-4 py-3 text-xs">
|
|
64
|
-
{title && (
|
|
65
|
-
<div className="mb-2 text-base font-normal text-foreground">
|
|
66
|
-
{title}
|
|
67
|
-
</div>
|
|
68
|
-
)}
|
|
69
|
-
|
|
70
|
-
<div className="flex flex-wrap items-center gap-x-3 gap-y-1.5 text-muted-foreground">
|
|
71
|
-
{type && (
|
|
72
|
-
<Badge variant="outline" className="font-normal">
|
|
73
|
-
{type}
|
|
74
|
-
</Badge>
|
|
75
|
-
)}
|
|
76
|
-
{status && (
|
|
77
|
-
<Badge variant="outline" className="font-normal">
|
|
78
|
-
{status}
|
|
79
|
-
</Badge>
|
|
80
|
-
)}
|
|
81
|
-
{isPrivate && (
|
|
82
|
-
<Badge
|
|
83
|
-
variant="outline"
|
|
84
|
-
className="border-warning-ink/40 font-normal text-warning-ink"
|
|
85
|
-
>
|
|
86
|
-
private
|
|
87
|
-
</Badge>
|
|
88
|
-
)}
|
|
89
|
-
{supersededBy && (
|
|
90
|
-
<Badge
|
|
91
|
-
variant="outline"
|
|
92
|
-
className="border-destructive/40 font-normal text-destructive"
|
|
93
|
-
>
|
|
94
|
-
superseded → {supersededBy}
|
|
95
|
-
</Badge>
|
|
96
|
-
)}
|
|
97
|
-
{created && (
|
|
98
|
-
<span>
|
|
99
|
-
<span className="opacity-60">created</span>{" "}
|
|
100
|
-
<span className="text-foreground/80">{created}</span>
|
|
101
|
-
</span>
|
|
102
|
-
)}
|
|
103
|
-
{updated && updated !== created && (
|
|
104
|
-
<span>
|
|
105
|
-
<span className="opacity-60">updated</span>{" "}
|
|
106
|
-
<span className="text-foreground/80">{updated}</span>
|
|
107
|
-
</span>
|
|
108
|
-
)}
|
|
109
|
-
</div>
|
|
110
|
-
|
|
111
|
-
{tags.length > 0 && (
|
|
112
|
-
<div className="mt-2 flex flex-wrap gap-1">
|
|
113
|
-
{tags.map((t) => (
|
|
114
|
-
<Badge
|
|
115
|
-
key={t}
|
|
116
|
-
variant="secondary"
|
|
117
|
-
className="font-normal text-[11px]"
|
|
118
|
-
>
|
|
119
|
-
#{t}
|
|
120
|
-
</Badge>
|
|
121
|
-
))}
|
|
122
|
-
</div>
|
|
123
|
-
)}
|
|
124
|
-
|
|
125
|
-
{sources.length > 0 && (
|
|
126
|
-
<div className="mt-2">
|
|
127
|
-
<span className="opacity-60">sources:</span>{" "}
|
|
128
|
-
<span className="text-foreground/80">{sources.join(", ")}</span>
|
|
129
|
-
</div>
|
|
130
|
-
)}
|
|
131
|
-
|
|
132
|
-
{otherKeys.length > 0 && (
|
|
133
|
-
<div className="mt-2 border-t pt-2">
|
|
134
|
-
<button
|
|
135
|
-
type="button"
|
|
136
|
-
onClick={() => setShowRaw((v) => !v)}
|
|
137
|
-
className="flex items-center gap-1 text-muted-foreground hover:text-foreground"
|
|
138
|
-
>
|
|
139
|
-
{showRaw ? (
|
|
140
|
-
<ChevronDown className="h-3 w-3" />
|
|
141
|
-
) : (
|
|
142
|
-
<ChevronRight className="h-3 w-3" />
|
|
143
|
-
)}
|
|
144
|
-
<span>
|
|
145
|
-
{otherKeys.length} more field{otherKeys.length === 1 ? "" : "s"}
|
|
146
|
-
</span>
|
|
147
|
-
</button>
|
|
148
|
-
{showRaw && (
|
|
149
|
-
<dl className="mt-1.5 grid grid-cols-[max-content_1fr] gap-x-3 gap-y-0.5">
|
|
150
|
-
{otherKeys.map((k) => (
|
|
151
|
-
<Fragment key={k}>
|
|
152
|
-
<dt className="opacity-60">{k}</dt>
|
|
153
|
-
<dd className="text-foreground/80 break-words">
|
|
154
|
-
{fmt(data[k])}
|
|
155
|
-
</dd>
|
|
156
|
-
</Fragment>
|
|
157
|
-
))}
|
|
158
|
-
</dl>
|
|
159
|
-
)}
|
|
160
|
-
</div>
|
|
161
|
-
)}
|
|
162
|
-
</div>
|
|
163
|
-
);
|
|
164
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
|
|
4
|
-
export function useIsMobile(query = "(max-width: 767px)") {
|
|
5
|
-
const [isMobile, setIsMobile] = useState(false); // SSR-safe default
|
|
6
|
-
useEffect(() => {
|
|
7
|
-
const mql = window.matchMedia(query);
|
|
8
|
-
const on = () => setIsMobile(mql.matches);
|
|
9
|
-
on();
|
|
10
|
-
mql.addEventListener("change", on);
|
|
11
|
-
return () => mql.removeEventListener("change", on);
|
|
12
|
-
}, [query]);
|
|
13
|
-
return isMobile;
|
|
14
|
-
}
|
|
@@ -1,272 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Server-side singleton that manages child processes for node-app directories.
|
|
3
|
-
* Lives as a module-level Map so it persists across requests in both dev and
|
|
4
|
-
* the Next.js standalone production server.
|
|
5
|
-
*/
|
|
6
|
-
import { spawn, type ChildProcess, execSync } from "node:child_process";
|
|
7
|
-
import { existsSync, readFileSync } from "node:fs";
|
|
8
|
-
import { createConnection, createServer } from "node:net";
|
|
9
|
-
import path from "node:path";
|
|
10
|
-
|
|
11
|
-
export type AppStatus = "stopped" | "installing" | "starting" | "running" | "error";
|
|
12
|
-
|
|
13
|
-
interface RunningApp {
|
|
14
|
-
port: number;
|
|
15
|
-
process: ChildProcess | null;
|
|
16
|
-
status: AppStatus;
|
|
17
|
-
error?: string;
|
|
18
|
-
logs: string[];
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
// ── singleton ────────────────────────────────────────────────────────────────
|
|
22
|
-
const apps = new Map<string, RunningApp>();
|
|
23
|
-
|
|
24
|
-
// ── helpers ──────────────────────────────────────────────────────────────────
|
|
25
|
-
|
|
26
|
-
function findFreePort(): Promise<number> {
|
|
27
|
-
return new Promise((resolve, reject) => {
|
|
28
|
-
const s = createServer();
|
|
29
|
-
s.listen(0, "127.0.0.1", () => {
|
|
30
|
-
const addr = s.address();
|
|
31
|
-
const port = typeof addr === "object" && addr ? addr.port : 0;
|
|
32
|
-
s.close(() => resolve(port));
|
|
33
|
-
});
|
|
34
|
-
s.on("error", reject);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function canConnect(port: number, host: string): Promise<boolean> {
|
|
39
|
-
return new Promise((resolve) => {
|
|
40
|
-
const sock = createConnection(port, host);
|
|
41
|
-
sock.setTimeout(800);
|
|
42
|
-
sock.on("connect", () => { sock.destroy(); resolve(true); });
|
|
43
|
-
sock.on("error", () => { sock.destroy(); resolve(false); });
|
|
44
|
-
sock.on("timeout", () => { sock.destroy(); resolve(false); });
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
// Probe both IPv4 (127.0.0.1) and IPv6 (::1) — Vite binds to ::1 by default.
|
|
49
|
-
async function waitForPort(port: number, timeoutMs = 30_000): Promise<boolean> {
|
|
50
|
-
const deadline = Date.now() + timeoutMs;
|
|
51
|
-
while (Date.now() < deadline) {
|
|
52
|
-
const [v4, v6] = await Promise.all([
|
|
53
|
-
canConnect(port, "127.0.0.1"),
|
|
54
|
-
canConnect(port, "::1"),
|
|
55
|
-
]);
|
|
56
|
-
if (v4 || v6) return true;
|
|
57
|
-
await new Promise((r) => setTimeout(r, 400));
|
|
58
|
-
}
|
|
59
|
-
return false;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
type PM = "npm" | "pnpm" | "yarn";
|
|
63
|
-
|
|
64
|
-
function detectPM(dir: string): PM {
|
|
65
|
-
if (existsSync(path.join(dir, "pnpm-lock.yaml"))) return "pnpm";
|
|
66
|
-
if (existsSync(path.join(dir, "yarn.lock"))) return "yarn";
|
|
67
|
-
return "npm";
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
interface Cmd {
|
|
71
|
-
bin: string;
|
|
72
|
-
args: string[];
|
|
73
|
-
isVite: boolean;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
interface Pkg {
|
|
77
|
-
scripts?: Record<string, string>;
|
|
78
|
-
main?: string;
|
|
79
|
-
dependencies?: Record<string, string>;
|
|
80
|
-
devDependencies?: Record<string, string>;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
function readPkg(dir: string): Pkg | null {
|
|
84
|
-
const pkgPath = path.join(dir, "package.json");
|
|
85
|
-
if (!existsSync(pkgPath)) return null;
|
|
86
|
-
try {
|
|
87
|
-
return JSON.parse(readFileSync(pkgPath, "utf-8")) as Pkg;
|
|
88
|
-
} catch {
|
|
89
|
-
return null;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
function hasViteDep(pkg: Pkg): boolean {
|
|
94
|
-
const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
|
|
95
|
-
return Object.keys(allDeps).some((k) => k === "vite" || k.includes("vite"));
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* Default script chosen when the user doesn't pick one explicitly.
|
|
100
|
-
* Priority: start > preview (built) > dev.
|
|
101
|
-
*/
|
|
102
|
-
function defaultScript(dir: string, scripts: Record<string, string>): string | null {
|
|
103
|
-
if (scripts.start) return "start";
|
|
104
|
-
if (scripts.preview && existsSync(path.join(dir, "dist"))) return "preview";
|
|
105
|
-
if (scripts.dev) return "dev";
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* List the npm scripts available to launch, plus which one is the default.
|
|
111
|
-
* Returns empty scripts list when only `main` is runnable (node entry).
|
|
112
|
-
*/
|
|
113
|
-
export function getScripts(absPath: string): { scripts: string[]; defaultScript: string | null } {
|
|
114
|
-
const pkg = readPkg(absPath);
|
|
115
|
-
if (!pkg) return { scripts: [], defaultScript: null };
|
|
116
|
-
const scripts = pkg.scripts ?? {};
|
|
117
|
-
return {
|
|
118
|
-
scripts: Object.keys(scripts),
|
|
119
|
-
defaultScript: defaultScript(absPath, scripts),
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
function detectCmd(dir: string, pm: PM, script?: string): Cmd | null {
|
|
124
|
-
const pkg = readPkg(dir);
|
|
125
|
-
if (!pkg) return null;
|
|
126
|
-
|
|
127
|
-
const scripts = pkg.scripts ?? {};
|
|
128
|
-
const hasVite = hasViteDep(pkg);
|
|
129
|
-
|
|
130
|
-
const run = (s: string, extraArgs: string[] = []): Cmd => ({
|
|
131
|
-
bin: pm,
|
|
132
|
-
args: ["run", s, ...(extraArgs.length ? ["--", ...extraArgs] : [])],
|
|
133
|
-
isVite: hasVite,
|
|
134
|
-
});
|
|
135
|
-
|
|
136
|
-
// Explicit script choice wins
|
|
137
|
-
if (script && scripts[script]) return run(script);
|
|
138
|
-
|
|
139
|
-
const def = defaultScript(dir, scripts);
|
|
140
|
-
if (def) return run(def);
|
|
141
|
-
if (pkg.main) return { bin: "node", args: [pkg.main], isVite: false };
|
|
142
|
-
return null;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
function needsInstall(dir: string): boolean {
|
|
146
|
-
return !existsSync(path.join(dir, "node_modules"));
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
function runInstall(dir: string, pm: PM): Promise<void> {
|
|
150
|
-
return new Promise((resolve, reject) => {
|
|
151
|
-
const child = spawn(pm, ["install"], { cwd: dir, stdio: "pipe" });
|
|
152
|
-
child.on("exit", (code) => (code === 0 ? resolve() : reject(new Error(`${pm} install failed (exit ${code})`))));
|
|
153
|
-
child.on("error", reject);
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
// ── public API ───────────────────────────────────────────────────────────────
|
|
158
|
-
|
|
159
|
-
export function getStatus(relPath: string): { status: AppStatus; port?: number; error?: string; logs: string[] } {
|
|
160
|
-
const app = apps.get(relPath);
|
|
161
|
-
if (!app) return { status: "stopped", logs: [] };
|
|
162
|
-
return { status: app.status, port: app.port || undefined, error: app.error, logs: app.logs };
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
export async function startApp(relPath: string, absPath: string, script?: string): Promise<{ port: number }> {
|
|
166
|
-
const existing = apps.get(relPath);
|
|
167
|
-
if (existing && existing.status !== "stopped" && existing.status !== "error") {
|
|
168
|
-
return { port: existing.port };
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
const port = await findFreePort();
|
|
172
|
-
const pm = detectPM(absPath);
|
|
173
|
-
const cmd = detectCmd(absPath, pm, script);
|
|
174
|
-
if (!cmd) throw new Error("No runnable script found in package.json (need start, preview, or dev)");
|
|
175
|
-
|
|
176
|
-
const entry: RunningApp = { port, process: null, status: "installing", logs: [] };
|
|
177
|
-
apps.set(relPath, entry);
|
|
178
|
-
|
|
179
|
-
const pushLog = (line: string) => {
|
|
180
|
-
entry.logs.push(line);
|
|
181
|
-
if (entry.logs.length > 200) entry.logs.shift();
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
// Install if needed
|
|
185
|
-
if (needsInstall(absPath)) {
|
|
186
|
-
try {
|
|
187
|
-
pushLog(`[wiki-viewer] Running ${pm} install…`);
|
|
188
|
-
await runInstall(absPath, pm);
|
|
189
|
-
} catch (e) {
|
|
190
|
-
entry.status = "error";
|
|
191
|
-
entry.error = String(e);
|
|
192
|
-
return { port };
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
entry.status = "starting";
|
|
197
|
-
pushLog(`[wiki-viewer] Starting on port ${port}: ${cmd.bin} ${cmd.args.join(" ")}`);
|
|
198
|
-
|
|
199
|
-
const portArgs = cmd.isVite ? ["--port", String(port)] : [];
|
|
200
|
-
const child = spawn(cmd.bin, [...cmd.args, ...portArgs], {
|
|
201
|
-
cwd: absPath,
|
|
202
|
-
stdio: "pipe",
|
|
203
|
-
env: {
|
|
204
|
-
...process.env,
|
|
205
|
-
PORT: String(port),
|
|
206
|
-
VITE_PORT: String(port),
|
|
207
|
-
},
|
|
208
|
-
});
|
|
209
|
-
entry.process = child;
|
|
210
|
-
|
|
211
|
-
const handleOutput = (data: Buffer) => {
|
|
212
|
-
for (const line of data.toString().split("\n")) {
|
|
213
|
-
if (line.trim()) pushLog(line);
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
child.stdout?.on("data", handleOutput);
|
|
217
|
-
child.stderr?.on("data", handleOutput);
|
|
218
|
-
|
|
219
|
-
child.on("exit", (code) => {
|
|
220
|
-
const a = apps.get(relPath);
|
|
221
|
-
if (a?.process === child) {
|
|
222
|
-
a.status = code === 0 || code === null ? "stopped" : "error";
|
|
223
|
-
a.error = code ? `Process exited with code ${code}` : undefined;
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
// Wait for port in background
|
|
228
|
-
waitForPort(port).then((ok) => {
|
|
229
|
-
const a = apps.get(relPath);
|
|
230
|
-
if (a?.process === child) {
|
|
231
|
-
a.status = ok ? "running" : "error";
|
|
232
|
-
if (!ok) a.error = "Port never became reachable (30 s timeout)";
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
return { port };
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
export function stopApp(relPath: string): void {
|
|
240
|
-
const app = apps.get(relPath);
|
|
241
|
-
if (!app?.process) return;
|
|
242
|
-
try {
|
|
243
|
-
app.process.kill("SIGTERM");
|
|
244
|
-
} catch {}
|
|
245
|
-
app.status = "stopped";
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
export function listApps(): Array<{ relPath: string; status: AppStatus; port?: number }> {
|
|
249
|
-
return [...apps.entries()].map(([relPath, a]) => ({
|
|
250
|
-
relPath,
|
|
251
|
-
status: a.status,
|
|
252
|
-
port: a.port || undefined,
|
|
253
|
-
}));
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
/**
|
|
257
|
-
* Given URL path segments, find the longest prefix that matches a running app.
|
|
258
|
-
* e.g. ["apps", "roadmap-server", "api", "specs"] → { relPath: "apps/roadmap-server", port, rest: "/api/specs" }
|
|
259
|
-
*/
|
|
260
|
-
export function resolveByPrefix(
|
|
261
|
-
segments: string[],
|
|
262
|
-
): { relPath: string; port: number; rest: string } | null {
|
|
263
|
-
for (let i = segments.length; i > 0; i--) {
|
|
264
|
-
const relPath = segments.slice(0, i).join("/");
|
|
265
|
-
const app = apps.get(relPath);
|
|
266
|
-
if (app && app.status === "running" && app.port) {
|
|
267
|
-
const rest = "/" + segments.slice(i).join("/");
|
|
268
|
-
return { relPath, port: app.port, rest };
|
|
269
|
-
}
|
|
270
|
-
}
|
|
271
|
-
return null;
|
|
272
|
-
}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Global admin role.
|
|
3
|
-
*
|
|
4
|
-
* Resolution order:
|
|
5
|
-
* 1. WIKI_ADMIN_EMAILS env (csv, case-insensitive) — seed/override, headless-friendly.
|
|
6
|
-
* 2. config.adminUserIds — persisted list managed via the admin API.
|
|
7
|
-
*
|
|
8
|
-
* Bootstrap: if adminUserIds is empty AND no WIKI_ADMIN_EMAILS is set,
|
|
9
|
-
* the first call to ensureBootstrapAdmin(userId) writes that user as admin.
|
|
10
|
-
* Called lazily on the first authenticated request (race-safe: re-read inside).
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
import { readConfig, updateConfig } from "@/lib/config";
|
|
14
|
-
import { requireUser } from "@/lib/auth/server";
|
|
15
|
-
|
|
16
|
-
// ── Internal helpers ───────────────────────────────────────────────────────────
|
|
17
|
-
|
|
18
|
-
function adminEmailsFromEnv(): string[] {
|
|
19
|
-
return (process.env.WIKI_ADMIN_EMAILS ?? "")
|
|
20
|
-
.split(",")
|
|
21
|
-
.map((e) => e.trim().toLowerCase())
|
|
22
|
-
.filter(Boolean);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
// ── Public API ─────────────────────────────────────────────────────────────────
|
|
26
|
-
|
|
27
|
-
export async function isAdmin(userId: string, email?: string): Promise<boolean> {
|
|
28
|
-
// Env override: any matching email is admin
|
|
29
|
-
if (email) {
|
|
30
|
-
const envAdmins = adminEmailsFromEnv();
|
|
31
|
-
if (envAdmins.length > 0 && envAdmins.includes(email.toLowerCase())) {
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
const cfg = await readConfig();
|
|
36
|
-
return (cfg.adminUserIds ?? []).includes(userId);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export async function listAdmins(): Promise<string[]> {
|
|
40
|
-
const cfg = await readConfig();
|
|
41
|
-
return cfg.adminUserIds ?? [];
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export async function addAdmin(userId: string): Promise<void> {
|
|
45
|
-
await updateConfig((cfg) => {
|
|
46
|
-
const current = cfg.adminUserIds ?? [];
|
|
47
|
-
if (current.includes(userId)) return cfg;
|
|
48
|
-
return { ...cfg, adminUserIds: [...current, userId] };
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export async function removeAdmin(userId: string): Promise<void> {
|
|
53
|
-
const hasEnvFallback = adminEmailsFromEnv().length > 0;
|
|
54
|
-
let rejected = false;
|
|
55
|
-
await updateConfig((cfg) => {
|
|
56
|
-
const current = cfg.adminUserIds ?? [];
|
|
57
|
-
const next = current.filter((id) => id !== userId);
|
|
58
|
-
// Refuse to remove last admin if no env fallback exists
|
|
59
|
-
if (next.length === 0 && !hasEnvFallback) {
|
|
60
|
-
rejected = true;
|
|
61
|
-
return cfg;
|
|
62
|
-
}
|
|
63
|
-
return { ...cfg, adminUserIds: next };
|
|
64
|
-
});
|
|
65
|
-
if (rejected) {
|
|
66
|
-
throw new Error(
|
|
67
|
-
"LAST_ADMIN: cannot remove the last admin with no WIKI_ADMIN_EMAILS configured",
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* If adminUserIds is empty AND no WIKI_ADMIN_EMAILS, write userId as the first
|
|
74
|
-
* admin. Safe to call concurrently: re-reads inside before writing.
|
|
75
|
-
*/
|
|
76
|
-
export async function ensureBootstrapAdmin(userId: string): Promise<void> {
|
|
77
|
-
if (adminEmailsFromEnv().length > 0) return; // env handles it
|
|
78
|
-
|
|
79
|
-
// Fast-path read to avoid the serialized write when an admin already exists.
|
|
80
|
-
const cfg = await readConfig();
|
|
81
|
-
if ((cfg.adminUserIds ?? []).length > 0) return;
|
|
82
|
-
|
|
83
|
-
let promoted = false;
|
|
84
|
-
// Atomic: re-check inside the lock so only one concurrent caller writes.
|
|
85
|
-
await updateConfig((fresh) => {
|
|
86
|
-
if ((fresh.adminUserIds ?? []).length > 0) return fresh;
|
|
87
|
-
promoted = true;
|
|
88
|
-
return { ...fresh, adminUserIds: [userId] };
|
|
89
|
-
});
|
|
90
|
-
if (promoted) {
|
|
91
|
-
console.log(`[wiki-viewer] Bootstrap: first user ${userId} promoted to admin`);
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Use in route handlers.
|
|
97
|
-
* Returns { ok: true, user } or { ok: false, status, code } ready for NextResponse.
|
|
98
|
-
*/
|
|
99
|
-
export async function requireAdmin(
|
|
100
|
-
req: Request,
|
|
101
|
-
): Promise<
|
|
102
|
-
| { ok: true; user: { id: string; email: string; name: string } }
|
|
103
|
-
| { ok: false; status: number; code: string }
|
|
104
|
-
> {
|
|
105
|
-
// --no-auth bypass
|
|
106
|
-
if (process.env.WIKI_NO_AUTH === "1") {
|
|
107
|
-
return {
|
|
108
|
-
ok: true,
|
|
109
|
-
user: { id: "local", email: "local@localhost", name: "local" },
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
const auth = await requireUser(req);
|
|
114
|
-
if (!auth.ok) return { ok: false, status: 401, code: "UNAUTHORIZED" };
|
|
115
|
-
|
|
116
|
-
const admin = await isAdmin(auth.user.id, auth.user.email);
|
|
117
|
-
if (!admin) return { ok: false, status: 403, code: "ADMIN_REQUIRED" };
|
|
118
|
-
|
|
119
|
-
return { ok: true, user: auth.user };
|
|
120
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Email allowlist check.
|
|
3
|
-
*
|
|
4
|
-
* Source of truth is ~/.wiki-viewer/config.json (allowedEmails / allowedDomains),
|
|
5
|
-
* editable at runtime via the UI. Env vars AUTH_ALLOWED_EMAILS and
|
|
6
|
-
* AUTH_ALLOWED_DOMAIN act as a fallback seed when config is empty, so existing
|
|
7
|
-
* deployments keep working without a config file.
|
|
8
|
-
*
|
|
9
|
-
* If neither config nor env sets any restriction, all emails are allowed.
|
|
10
|
-
*/
|
|
11
|
-
import { readConfig } from "@/lib/config";
|
|
12
|
-
|
|
13
|
-
function splitList(raw: string | undefined): string[] {
|
|
14
|
-
return (raw ?? "")
|
|
15
|
-
.split(",")
|
|
16
|
-
.map((s) => s.trim().toLowerCase())
|
|
17
|
-
.filter(Boolean);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/** Resolve the effective allowlist: config wins, env is the fallback. */
|
|
21
|
-
export async function getAllowlist(): Promise<{
|
|
22
|
-
emails: string[];
|
|
23
|
-
domains: string[];
|
|
24
|
-
}> {
|
|
25
|
-
const config = await readConfig();
|
|
26
|
-
const emails =
|
|
27
|
-
config.allowedEmails && config.allowedEmails.length > 0
|
|
28
|
-
? config.allowedEmails.map((s) => s.trim().toLowerCase()).filter(Boolean)
|
|
29
|
-
: splitList(process.env.AUTH_ALLOWED_EMAILS);
|
|
30
|
-
const domains =
|
|
31
|
-
config.allowedDomains && config.allowedDomains.length > 0
|
|
32
|
-
? config.allowedDomains.map((s) => s.trim().toLowerCase()).filter(Boolean)
|
|
33
|
-
: splitList(process.env.AUTH_ALLOWED_DOMAIN);
|
|
34
|
-
return { emails, domains };
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export async function isEmailAllowed(email: string): Promise<boolean> {
|
|
38
|
-
const { emails, domains } = await getAllowlist();
|
|
39
|
-
|
|
40
|
-
// No restrictions set — allow all
|
|
41
|
-
if (emails.length === 0 && domains.length === 0) return true;
|
|
42
|
-
|
|
43
|
-
const e = email.toLowerCase();
|
|
44
|
-
if (emails.includes(e)) return true;
|
|
45
|
-
|
|
46
|
-
const at = e.lastIndexOf("@");
|
|
47
|
-
if (at >= 0 && domains.includes(e.slice(at + 1))) return true;
|
|
48
|
-
|
|
49
|
-
return false;
|
|
50
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from "next/server";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Reject cross-origin state-changing requests that arrive with a session cookie.
|
|
5
|
-
* Bearer-only requests (no Origin/Referer) pass through — they are authenticated
|
|
6
|
-
* separately and are not vulnerable to CSRF.
|
|
7
|
-
*
|
|
8
|
-
* Returns null if the request may proceed, or a NextResponse(403) to return.
|
|
9
|
-
*
|
|
10
|
-
* Call at the top of every POST/PUT/DELETE/PATCH handler in /api/wiki/* and
|
|
11
|
-
* /api/system/* before requireUser.
|
|
12
|
-
*/
|
|
13
|
-
export function checkOrigin(req: Request): NextResponse | null {
|
|
14
|
-
const method = req.method.toUpperCase();
|
|
15
|
-
if (method === "GET" || method === "HEAD" || method === "OPTIONS") return null;
|
|
16
|
-
|
|
17
|
-
// Bearer-auth agents typically omit Origin/Referer — let checkAuth handle them.
|
|
18
|
-
const origin = req.headers.get("origin");
|
|
19
|
-
const referer = req.headers.get("referer");
|
|
20
|
-
if (!origin && !referer) return null;
|
|
21
|
-
|
|
22
|
-
const allowed = buildAllowedOrigins(req.headers.get("host") ?? "");
|
|
23
|
-
|
|
24
|
-
if (origin) {
|
|
25
|
-
if (allowed.has(origin)) return null;
|
|
26
|
-
return NextResponse.json(
|
|
27
|
-
{ error: "FORBIDDEN", message: "Bad origin" },
|
|
28
|
-
{ status: 403 },
|
|
29
|
-
);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
if (referer) {
|
|
33
|
-
try {
|
|
34
|
-
const { protocol, host } = new URL(referer);
|
|
35
|
-
if (allowed.has(`${protocol}//${host}`)) return null;
|
|
36
|
-
} catch {
|
|
37
|
-
// malformed Referer — reject
|
|
38
|
-
}
|
|
39
|
-
return NextResponse.json(
|
|
40
|
-
{ error: "FORBIDDEN", message: "Bad referer" },
|
|
41
|
-
{ status: 403 },
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return null;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function buildAllowedOrigins(hostHeader: string): Set<string> {
|
|
49
|
-
const hostname = hostHeader.split(":")[0];
|
|
50
|
-
const extra = (process.env.WIKI_OWNER_HOSTS ?? "")
|
|
51
|
-
.split(",")
|
|
52
|
-
.map((h) => h.trim())
|
|
53
|
-
.filter(Boolean);
|
|
54
|
-
|
|
55
|
-
const hosts = Array.from(new Set(["localhost", "127.0.0.1", hostname, ...extra]));
|
|
56
|
-
const ports = ["", ":3000", ":3003"];
|
|
57
|
-
if (hostHeader.includes(":")) ports.push(":" + hostHeader.split(":")[1]);
|
|
58
|
-
|
|
59
|
-
const allowed = new Set<string>();
|
|
60
|
-
for (const h of hosts) {
|
|
61
|
-
for (const proto of ["http", "https"]) {
|
|
62
|
-
for (const port of ports) {
|
|
63
|
-
allowed.add(`${proto}://${h}${port}`);
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
return allowed;
|
|
68
|
-
}
|