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,82 +0,0 @@
|
|
|
1
|
-
import { readdir, stat } from "node:fs/promises";
|
|
2
|
-
import os from "node:os";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import { NextResponse } from "next/server";
|
|
5
|
-
import { requireUser } from "@/lib/auth/server";
|
|
6
|
-
|
|
7
|
-
interface BrowseEntry {
|
|
8
|
-
name: string;
|
|
9
|
-
path: string;
|
|
10
|
-
accessible: boolean;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export async function GET(request: Request) {
|
|
14
|
-
const auth = await requireUser(request);
|
|
15
|
-
if (!auth.ok) return NextResponse.json({ error: "UNAUTHORIZED" }, { status: 401 });
|
|
16
|
-
|
|
17
|
-
const { searchParams } = new URL(request.url);
|
|
18
|
-
const rawPath = searchParams.get("path");
|
|
19
|
-
|
|
20
|
-
// Default to home dir
|
|
21
|
-
const target = rawPath ? path.resolve(rawPath) : os.homedir();
|
|
22
|
-
|
|
23
|
-
// Verify it's a directory
|
|
24
|
-
try {
|
|
25
|
-
const info = await stat(target);
|
|
26
|
-
if (!info.isDirectory()) {
|
|
27
|
-
return NextResponse.json({ error: "Not a directory" }, { status: 400 });
|
|
28
|
-
}
|
|
29
|
-
} catch {
|
|
30
|
-
return NextResponse.json({ error: "Path not found" }, { status: 404 });
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// List entries — only directories
|
|
34
|
-
let entries: BrowseEntry[] = [];
|
|
35
|
-
try {
|
|
36
|
-
const names = await readdir(target);
|
|
37
|
-
const infos = await Promise.allSettled(
|
|
38
|
-
names.map(async (name) => {
|
|
39
|
-
const full = path.join(target, name);
|
|
40
|
-
const info = await stat(full);
|
|
41
|
-
return { name, full, isDir: info.isDirectory() };
|
|
42
|
-
}),
|
|
43
|
-
);
|
|
44
|
-
entries = infos
|
|
45
|
-
.filter(
|
|
46
|
-
(r): r is PromiseFulfilledResult<{ name: string; full: string; isDir: boolean }> =>
|
|
47
|
-
r.status === "fulfilled" && r.value.isDir,
|
|
48
|
-
)
|
|
49
|
-
.map((r) => ({ name: r.value.name, path: r.value.full, accessible: true }))
|
|
50
|
-
.sort((a, b) => a.name.localeCompare(b.name));
|
|
51
|
-
} catch {
|
|
52
|
-
// Permission denied or similar — return empty list but still allow selection
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// Parent path (null at filesystem root)
|
|
56
|
-
const parent = target === path.parse(target).root ? null : path.dirname(target);
|
|
57
|
-
|
|
58
|
-
// Quick-access shortcuts
|
|
59
|
-
const home = os.homedir();
|
|
60
|
-
const shortcuts = [
|
|
61
|
-
{ label: "Home", path: home },
|
|
62
|
-
{ label: "Root", path: "/" },
|
|
63
|
-
];
|
|
64
|
-
// Add common paths that exist
|
|
65
|
-
for (const [label, p] of [
|
|
66
|
-
["Desktop", path.join(home, "Desktop")],
|
|
67
|
-
["Documents", path.join(home, "Documents")],
|
|
68
|
-
["Downloads", path.join(home, "Downloads")],
|
|
69
|
-
] as [string, string][]) {
|
|
70
|
-
try {
|
|
71
|
-
await stat(p);
|
|
72
|
-
shortcuts.push({ label, path: p });
|
|
73
|
-
} catch {}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
return NextResponse.json({
|
|
77
|
-
path: target,
|
|
78
|
-
parent,
|
|
79
|
-
entries,
|
|
80
|
-
shortcuts,
|
|
81
|
-
});
|
|
82
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from "next/server";
|
|
2
|
-
import { checkOrigin } from "@/lib/auth/csrf";
|
|
3
|
-
import { requireUser } from "@/lib/auth/server";
|
|
4
|
-
import { writeConfig } from "@/lib/config";
|
|
5
|
-
import { clearRootDir } from "@/lib/root-dir";
|
|
6
|
-
|
|
7
|
-
export async function POST(request: Request) {
|
|
8
|
-
const csrf = checkOrigin(request);
|
|
9
|
-
if (csrf) return csrf;
|
|
10
|
-
const auth = await requireUser(request);
|
|
11
|
-
if (!auth.ok) return NextResponse.json({ error: "UNAUTHORIZED" }, { status: 401 });
|
|
12
|
-
|
|
13
|
-
clearRootDir();
|
|
14
|
-
await writeConfig({ lastOpenedPath: undefined });
|
|
15
|
-
return NextResponse.json({ ok: true });
|
|
16
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from "next/server";
|
|
2
|
-
import { requireUser } from "@/lib/auth/server";
|
|
3
|
-
import { readConfig } from "@/lib/config";
|
|
4
|
-
|
|
5
|
-
export async function GET(request: Request) {
|
|
6
|
-
const auth = await requireUser(request);
|
|
7
|
-
if (!auth.ok) return NextResponse.json({ error: "UNAUTHORIZED" }, { status: 401 });
|
|
8
|
-
|
|
9
|
-
const config = await readConfig();
|
|
10
|
-
return NextResponse.json({
|
|
11
|
-
pinnedPaths: config.pinnedPaths ?? [],
|
|
12
|
-
lastOpenedPath: config.lastOpenedPath ?? null,
|
|
13
|
-
});
|
|
14
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { stat } from "node:fs/promises";
|
|
2
|
-
import { NextResponse } from "next/server";
|
|
3
|
-
import { checkOrigin } from "@/lib/auth/csrf";
|
|
4
|
-
import { requireUser } from "@/lib/auth/server";
|
|
5
|
-
import { readConfig, writeConfig } from "@/lib/config";
|
|
6
|
-
|
|
7
|
-
export async function POST(request: Request) {
|
|
8
|
-
const csrf = checkOrigin(request);
|
|
9
|
-
if (csrf) return csrf;
|
|
10
|
-
const auth = await requireUser(request);
|
|
11
|
-
if (!auth.ok) return NextResponse.json({ error: "UNAUTHORIZED" }, { status: 401 });
|
|
12
|
-
|
|
13
|
-
const body: { path?: string; action?: "pin" | "unpin" } = await request.json();
|
|
14
|
-
const p = body.path?.trim();
|
|
15
|
-
const action = body.action ?? "pin";
|
|
16
|
-
if (!p) return NextResponse.json({ error: "Missing path" }, { status: 400 });
|
|
17
|
-
|
|
18
|
-
if (action === "pin") {
|
|
19
|
-
try {
|
|
20
|
-
const info = await stat(p);
|
|
21
|
-
if (!info.isDirectory())
|
|
22
|
-
return NextResponse.json({ error: "Not a directory" }, { status: 400 });
|
|
23
|
-
} catch {
|
|
24
|
-
return NextResponse.json({ error: "Path not found" }, { status: 404 });
|
|
25
|
-
}
|
|
26
|
-
const config = await readConfig();
|
|
27
|
-
const pins = config.pinnedPaths ?? [];
|
|
28
|
-
if (!pins.includes(p)) {
|
|
29
|
-
await writeConfig({ pinnedPaths: [...pins, p] });
|
|
30
|
-
}
|
|
31
|
-
} else {
|
|
32
|
-
const config = await readConfig();
|
|
33
|
-
const pins = (config.pinnedPaths ?? []).filter((x) => x !== p);
|
|
34
|
-
await writeConfig({ pinnedPaths: pins });
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return NextResponse.json({ ok: true });
|
|
38
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { exec } from "node:child_process";
|
|
2
|
-
import path from "node:path";
|
|
3
|
-
import { NextResponse } from "next/server";
|
|
4
|
-
import { checkOrigin } from "@/lib/auth/csrf";
|
|
5
|
-
import { resolveWorkspaceForUser } from "@/lib/workspace-context";
|
|
6
|
-
import { safeWorkspacePath } from "@/lib/workspaces";
|
|
7
|
-
|
|
8
|
-
export async function POST(request: Request) {
|
|
9
|
-
const csrf = checkOrigin(request);
|
|
10
|
-
if (csrf) return csrf;
|
|
11
|
-
const ctx = await resolveWorkspaceForUser(request);
|
|
12
|
-
if (!ctx.ok) return NextResponse.json({ error: ctx.code }, { status: ctx.status });
|
|
13
|
-
const { rootDir } = ctx;
|
|
14
|
-
|
|
15
|
-
const body: { path?: string } = await request.json();
|
|
16
|
-
const rel = body.path;
|
|
17
|
-
if (!rel || typeof rel !== "string")
|
|
18
|
-
return NextResponse.json({ error: "Invalid path" }, { status: 400 });
|
|
19
|
-
|
|
20
|
-
// Path traversal guard
|
|
21
|
-
const resolved = safeWorkspacePath(rootDir, rel);
|
|
22
|
-
if (!resolved)
|
|
23
|
-
return NextResponse.json({ error: "Invalid path" }, { status: 400 });
|
|
24
|
-
|
|
25
|
-
// Open in system file manager
|
|
26
|
-
const platform = process.platform;
|
|
27
|
-
const cmd =
|
|
28
|
-
platform === "darwin"
|
|
29
|
-
? `open -R "${resolved}"`
|
|
30
|
-
: platform === "win32"
|
|
31
|
-
? `explorer /select,"${resolved}"`
|
|
32
|
-
: `xdg-open "${path.dirname(resolved)}"`;
|
|
33
|
-
|
|
34
|
-
exec(cmd, () => {});
|
|
35
|
-
return NextResponse.json({ ok: true });
|
|
36
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { NextResponse } from "next/server";
|
|
2
|
-
import { requireUser } from "@/lib/auth/server";
|
|
3
|
-
import { getRootDir, isRootDirSet } from "@/lib/root-dir";
|
|
4
|
-
|
|
5
|
-
export async function GET(request: Request) {
|
|
6
|
-
const auth = await requireUser(request);
|
|
7
|
-
if (!auth.ok) return NextResponse.json({ error: "UNAUTHORIZED" }, { status: 401 });
|
|
8
|
-
|
|
9
|
-
return NextResponse.json({
|
|
10
|
-
configured: isRootDirSet(),
|
|
11
|
-
path: isRootDirSet() ? getRootDir() : null,
|
|
12
|
-
});
|
|
13
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Legacy set-root endpoint — back-compat shim for D1.
|
|
3
|
-
*
|
|
4
|
-
* Behaviour:
|
|
5
|
-
* 1. Validate dir (same as before).
|
|
6
|
-
* 2. Create (or find) a workspace for rootDir in the registry.
|
|
7
|
-
* 3. Keep setting the process-global rootDir + writing lastOpenedPath to config
|
|
8
|
-
* so the legacy fallback path still works for the existing client.
|
|
9
|
-
* 4. Return { ok, path, workspaceId } — added workspaceId for D2 migration.
|
|
10
|
-
*
|
|
11
|
-
* NOTE: NOT admin-gated here so the current single-user flow is unaffected.
|
|
12
|
-
* The new POST /api/system/workspaces route is admin-gated; D2 will switch the
|
|
13
|
-
* UI to use that endpoint.
|
|
14
|
-
*/
|
|
15
|
-
import { stat } from "node:fs/promises";
|
|
16
|
-
import { NextResponse } from "next/server";
|
|
17
|
-
import { checkOrigin } from "@/lib/auth/csrf";
|
|
18
|
-
import { requireUser } from "@/lib/auth/server";
|
|
19
|
-
import { writeConfig } from "@/lib/config";
|
|
20
|
-
import { setRootDir } from "@/lib/root-dir";
|
|
21
|
-
import { listWorkspaces, createWorkspace } from "@/lib/workspaces";
|
|
22
|
-
import path from "node:path";
|
|
23
|
-
|
|
24
|
-
export async function POST(request: Request) {
|
|
25
|
-
const csrf = checkOrigin(request);
|
|
26
|
-
if (csrf) return csrf;
|
|
27
|
-
const auth = await requireUser(request);
|
|
28
|
-
if (!auth.ok) return NextResponse.json({ error: "UNAUTHORIZED" }, { status: 401 });
|
|
29
|
-
|
|
30
|
-
const body: { path?: string } = await request.json();
|
|
31
|
-
const dir = body.path?.trim();
|
|
32
|
-
if (!dir) return NextResponse.json({ error: "Missing path" }, { status: 400 });
|
|
33
|
-
|
|
34
|
-
// Verify it exists and is a directory
|
|
35
|
-
try {
|
|
36
|
-
const info = await stat(dir);
|
|
37
|
-
if (!info.isDirectory())
|
|
38
|
-
return NextResponse.json({ error: "Not a directory" }, { status: 400 });
|
|
39
|
-
} catch {
|
|
40
|
-
return NextResponse.json({ error: "Directory not found" }, { status: 404 });
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// Legacy: keep the global + config in sync for the fallback resolver.
|
|
44
|
-
setRootDir(dir);
|
|
45
|
-
await writeConfig({ lastOpenedPath: dir });
|
|
46
|
-
|
|
47
|
-
// Find or create a workspace for this rootDir so the registry is populated.
|
|
48
|
-
const resolved = path.resolve(dir);
|
|
49
|
-
const existing = (await listWorkspaces()).find((w) => w.rootDir === resolved);
|
|
50
|
-
const ws = existing ?? (await createWorkspace({ rootDir: dir, createdBy: auth.user.id }));
|
|
51
|
-
|
|
52
|
-
return NextResponse.json({ ok: true, path: dir, workspaceId: ws.id });
|
|
53
|
-
}
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* POST /api/system/users (admin only)
|
|
3
|
-
*
|
|
4
|
-
* Admin creates a new account with a generated temporary password, returned
|
|
5
|
-
* once in the response. The new user signs in and changes it. The signup
|
|
6
|
-
* allowlist is bypassed for admin-initiated creation (the admin is the gate).
|
|
7
|
-
*
|
|
8
|
-
* This calls auth.api.signUpEmail server-side; the session it would mint for
|
|
9
|
-
* the new user is discarded (we never forward those Set-Cookie headers), so
|
|
10
|
-
* the admin's own session is untouched.
|
|
11
|
-
*/
|
|
12
|
-
export const runtime = "nodejs";
|
|
13
|
-
|
|
14
|
-
import { NextResponse } from "next/server";
|
|
15
|
-
import { randomBytes } from "node:crypto";
|
|
16
|
-
import { checkOrigin } from "@/lib/auth/csrf";
|
|
17
|
-
import { requireAdmin } from "@/lib/auth/admin";
|
|
18
|
-
import { auth, authReady, withAdminUserCreate, passwordAuthEnabled, db } from "@/lib/auth/server";
|
|
19
|
-
|
|
20
|
-
const EMAIL_RE = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
|
|
21
|
-
|
|
22
|
-
/** Readable temp password: 4 groups, mixed case + digits, no ambiguous chars. */
|
|
23
|
-
function generateTempPassword(): string {
|
|
24
|
-
const alphabet = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789";
|
|
25
|
-
const bytes = randomBytes(16);
|
|
26
|
-
let out = "";
|
|
27
|
-
for (let i = 0; i < 16; i++) {
|
|
28
|
-
out += alphabet[bytes[i] % alphabet.length];
|
|
29
|
-
if (i % 4 === 3 && i < 15) out += "-";
|
|
30
|
-
}
|
|
31
|
-
return out; // e.g. "k7Pm-9QrT-x2Vn-bL4w"
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export async function POST(req: Request): Promise<NextResponse> {
|
|
35
|
-
const csrf = checkOrigin(req);
|
|
36
|
-
if (csrf) return csrf;
|
|
37
|
-
|
|
38
|
-
const admin = await requireAdmin(req);
|
|
39
|
-
if (!admin.ok) {
|
|
40
|
-
return NextResponse.json({ error: admin.code }, { status: admin.status });
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (!passwordAuthEnabled) {
|
|
44
|
-
return NextResponse.json(
|
|
45
|
-
{ error: "PASSWORD_AUTH_DISABLED", message: "Email/password sign-in is disabled; cannot create password accounts." },
|
|
46
|
-
{ status: 400 },
|
|
47
|
-
);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
let body: { email?: unknown; name?: unknown };
|
|
51
|
-
try {
|
|
52
|
-
body = (await req.json()) as { email?: unknown; name?: unknown };
|
|
53
|
-
} catch {
|
|
54
|
-
return NextResponse.json({ error: "INVALID_PAYLOAD", message: "Invalid JSON" }, { status: 400 });
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const email = typeof body.email === "string" ? body.email.trim().toLowerCase() : "";
|
|
58
|
-
const name = typeof body.name === "string" && body.name.trim() ? body.name.trim() : email.split("@")[0];
|
|
59
|
-
|
|
60
|
-
if (!EMAIL_RE.test(email)) {
|
|
61
|
-
return NextResponse.json({ error: "INVALID_EMAIL", message: "A valid email is required" }, { status: 400 });
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const tempPassword = generateTempPassword();
|
|
65
|
-
|
|
66
|
-
await authReady();
|
|
67
|
-
// Reject duplicates up front (signUpEmail may otherwise create a second
|
|
68
|
-
// credential row or silently succeed depending on Better Auth internals).
|
|
69
|
-
try {
|
|
70
|
-
const existing = db
|
|
71
|
-
.prepare("SELECT 1 FROM user WHERE lower(email) = ? LIMIT 1")
|
|
72
|
-
.get(email);
|
|
73
|
-
if (existing) {
|
|
74
|
-
return NextResponse.json(
|
|
75
|
-
{ error: "USER_EXISTS", message: "A user with that email already exists." },
|
|
76
|
-
{ status: 409 },
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
} catch {
|
|
80
|
-
// If the lookup fails, fall through and let signUpEmail decide.
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
try {
|
|
84
|
-
// Bypass the signup allowlist for this admin-initiated creation. The
|
|
85
|
-
// returned response (and any session cookie) is intentionally discarded.
|
|
86
|
-
const result = await withAdminUserCreate(() =>
|
|
87
|
-
auth.api.signUpEmail({
|
|
88
|
-
body: { email, password: tempPassword, name },
|
|
89
|
-
asResponse: true,
|
|
90
|
-
}),
|
|
91
|
-
);
|
|
92
|
-
if (!result.ok) {
|
|
93
|
-
const text = await result.text().catch(() => "");
|
|
94
|
-
if (/exist|unique|already/i.test(text)) {
|
|
95
|
-
return NextResponse.json(
|
|
96
|
-
{ error: "USER_EXISTS", message: "A user with that email already exists." },
|
|
97
|
-
{ status: 409 },
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
return NextResponse.json(
|
|
101
|
-
{ error: "CREATE_FAILED", message: text || "Failed to create user" },
|
|
102
|
-
{ status: 500 },
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
} catch (e) {
|
|
106
|
-
const msg = e instanceof Error ? e.message : "";
|
|
107
|
-
if (/exist|unique|already/i.test(msg)) {
|
|
108
|
-
return NextResponse.json(
|
|
109
|
-
{ error: "USER_EXISTS", message: "A user with that email already exists." },
|
|
110
|
-
{ status: 409 },
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
return NextResponse.json(
|
|
114
|
-
{ error: "CREATE_FAILED", message: msg || "Failed to create user" },
|
|
115
|
-
{ status: 500 },
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
return NextResponse.json({ ok: true, email, name, tempPassword });
|
|
120
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* POST /api/system/workspaces/[id]/open
|
|
3
|
-
*
|
|
4
|
-
* Client calls this when switching to a workspace. Records lastOpenedAt so
|
|
5
|
-
* the most-recently-used workspace can be selected on next load.
|
|
6
|
-
*/
|
|
7
|
-
import { NextResponse } from "next/server";
|
|
8
|
-
import { checkOrigin } from "@/lib/auth/csrf";
|
|
9
|
-
import { requireUser } from "@/lib/auth/server";
|
|
10
|
-
import { isAdmin } from "@/lib/auth/admin";
|
|
11
|
-
import { getWorkspace, touchWorkspace, userCanAccess } from "@/lib/workspaces";
|
|
12
|
-
|
|
13
|
-
export const runtime = "nodejs";
|
|
14
|
-
|
|
15
|
-
type Params = { params: Promise<{ id: string }> };
|
|
16
|
-
|
|
17
|
-
export async function POST(request: Request, { params }: Params) {
|
|
18
|
-
const csrf = checkOrigin(request);
|
|
19
|
-
if (csrf) return csrf;
|
|
20
|
-
|
|
21
|
-
const auth = await requireUser(request);
|
|
22
|
-
if (!auth.ok) return NextResponse.json({ error: "UNAUTHORIZED" }, { status: 401 });
|
|
23
|
-
|
|
24
|
-
const { id } = await params;
|
|
25
|
-
const ws = await getWorkspace(id);
|
|
26
|
-
if (!ws) return NextResponse.json({ error: "WORKSPACE_NOT_FOUND" }, { status: 404 });
|
|
27
|
-
|
|
28
|
-
const admin = await isAdmin(auth.user.id, auth.user.email);
|
|
29
|
-
if (!userCanAccess(ws, auth.user.id, admin))
|
|
30
|
-
return NextResponse.json({ error: "WORKSPACE_FORBIDDEN" }, { status: 403 });
|
|
31
|
-
|
|
32
|
-
await touchWorkspace(id);
|
|
33
|
-
return NextResponse.json({ ok: true });
|
|
34
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* POST /api/system/workspaces/[id]/refresh
|
|
3
|
-
*
|
|
4
|
-
* Admin-only: pull the latest commit for a git-backed workspace (ff-only).
|
|
5
|
-
* Returns the new HEAD sha and pull time. Never returns any token.
|
|
6
|
-
*/
|
|
7
|
-
import { NextResponse } from "next/server";
|
|
8
|
-
import { checkOrigin } from "@/lib/auth/csrf";
|
|
9
|
-
import { requireAdmin } from "@/lib/auth/admin";
|
|
10
|
-
import { refreshGitWorkspace } from "@/lib/workspaces";
|
|
11
|
-
|
|
12
|
-
export const runtime = "nodejs";
|
|
13
|
-
|
|
14
|
-
type Params = { params: Promise<{ id: string }> };
|
|
15
|
-
|
|
16
|
-
export async function POST(request: Request, { params }: Params) {
|
|
17
|
-
const csrf = checkOrigin(request);
|
|
18
|
-
if (csrf) return csrf;
|
|
19
|
-
|
|
20
|
-
const authResult = await requireAdmin(request);
|
|
21
|
-
if (!authResult.ok)
|
|
22
|
-
return NextResponse.json({ error: authResult.code }, { status: authResult.status });
|
|
23
|
-
|
|
24
|
-
const { id } = await params;
|
|
25
|
-
try {
|
|
26
|
-
const result = await refreshGitWorkspace(id);
|
|
27
|
-
return NextResponse.json({ ok: true, ...result });
|
|
28
|
-
} catch (err) {
|
|
29
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
30
|
-
return NextResponse.json({ error: msg }, { status: 400 });
|
|
31
|
-
}
|
|
32
|
-
}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Per-workspace management API.
|
|
3
|
-
*
|
|
4
|
-
* PATCH /api/system/workspaces/[id] — update name, pinnedPaths (any user with
|
|
5
|
-
* access), or allowedUserIds (admin-only).
|
|
6
|
-
* DELETE /api/system/workspaces/[id] — admin-only: remove workspace from registry
|
|
7
|
-
* (never touches the filesystem directory).
|
|
8
|
-
*/
|
|
9
|
-
import { NextResponse } from "next/server";
|
|
10
|
-
import { checkOrigin } from "@/lib/auth/csrf";
|
|
11
|
-
import { requireUser } from "@/lib/auth/server";
|
|
12
|
-
import { isAdmin, requireAdmin } from "@/lib/auth/admin";
|
|
13
|
-
import {
|
|
14
|
-
getWorkspace,
|
|
15
|
-
renameWorkspace,
|
|
16
|
-
removeWorkspace,
|
|
17
|
-
setWorkspaceAccess,
|
|
18
|
-
setWorkspacePins,
|
|
19
|
-
userCanAccess,
|
|
20
|
-
sanitizeWorkspace,
|
|
21
|
-
} from "@/lib/workspaces";
|
|
22
|
-
|
|
23
|
-
export const runtime = "nodejs";
|
|
24
|
-
|
|
25
|
-
type Params = { params: Promise<{ id: string }> };
|
|
26
|
-
|
|
27
|
-
export async function PATCH(request: Request, { params }: Params) {
|
|
28
|
-
const csrf = checkOrigin(request);
|
|
29
|
-
if (csrf) return csrf;
|
|
30
|
-
|
|
31
|
-
const auth = await requireUser(request);
|
|
32
|
-
if (!auth.ok) return NextResponse.json({ error: "UNAUTHORIZED" }, { status: 401 });
|
|
33
|
-
|
|
34
|
-
const { id } = await params;
|
|
35
|
-
const ws = await getWorkspace(id);
|
|
36
|
-
if (!ws) return NextResponse.json({ error: "WORKSPACE_NOT_FOUND" }, { status: 404 });
|
|
37
|
-
|
|
38
|
-
const admin = await isAdmin(auth.user.id, auth.user.email);
|
|
39
|
-
if (!userCanAccess(ws, auth.user.id, admin))
|
|
40
|
-
return NextResponse.json({ error: "WORKSPACE_FORBIDDEN" }, { status: 403 });
|
|
41
|
-
|
|
42
|
-
const body: {
|
|
43
|
-
name?: string;
|
|
44
|
-
pinnedPaths?: string[];
|
|
45
|
-
allowedUserIds?: string[];
|
|
46
|
-
} = await request.json();
|
|
47
|
-
|
|
48
|
-
// allowedUserIds is admin-only
|
|
49
|
-
if (body.allowedUserIds !== undefined && !admin)
|
|
50
|
-
return NextResponse.json({ error: "ADMIN_REQUIRED" }, { status: 403 });
|
|
51
|
-
|
|
52
|
-
// Apply each field
|
|
53
|
-
if (body.name !== undefined) await renameWorkspace(id, body.name.trim());
|
|
54
|
-
if (body.pinnedPaths !== undefined) await setWorkspacePins(id, body.pinnedPaths);
|
|
55
|
-
if (body.allowedUserIds !== undefined) await setWorkspaceAccess(id, body.allowedUserIds);
|
|
56
|
-
|
|
57
|
-
const updated = await getWorkspace(id);
|
|
58
|
-
return NextResponse.json({
|
|
59
|
-
ok: true,
|
|
60
|
-
workspace: updated ? sanitizeWorkspace(updated) : updated,
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export async function DELETE(request: Request, { params }: Params) {
|
|
65
|
-
const csrf = checkOrigin(request);
|
|
66
|
-
if (csrf) return csrf;
|
|
67
|
-
|
|
68
|
-
const authResult = await requireAdmin(request);
|
|
69
|
-
if (!authResult.ok)
|
|
70
|
-
return NextResponse.json({ error: authResult.code }, { status: authResult.status });
|
|
71
|
-
|
|
72
|
-
const { id } = await params;
|
|
73
|
-
const ws = await getWorkspace(id);
|
|
74
|
-
if (!ws) return NextResponse.json({ error: "WORKSPACE_NOT_FOUND" }, { status: 404 });
|
|
75
|
-
|
|
76
|
-
await removeWorkspace(id);
|
|
77
|
-
return NextResponse.json({ ok: true });
|
|
78
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Workspace management API — list and create.
|
|
3
|
-
*
|
|
4
|
-
* GET /api/system/workspaces — any signed-in user; returns workspaces the
|
|
5
|
-
* caller can access + isAdmin flag.
|
|
6
|
-
* POST { rootDir, name? } — admin-only: create a new workspace.
|
|
7
|
-
*
|
|
8
|
-
* Bootstrap: first authenticated request triggers ensureBootstrapAdmin.
|
|
9
|
-
*/
|
|
10
|
-
import { stat } from "node:fs/promises";
|
|
11
|
-
import { NextResponse } from "next/server";
|
|
12
|
-
import { checkOrigin } from "@/lib/auth/csrf";
|
|
13
|
-
import { requireUser } from "@/lib/auth/server";
|
|
14
|
-
import { isAdmin, requireAdmin, ensureBootstrapAdmin } from "@/lib/auth/admin";
|
|
15
|
-
import { readConfig } from "@/lib/config";
|
|
16
|
-
import {
|
|
17
|
-
listWorkspaces,
|
|
18
|
-
createWorkspace,
|
|
19
|
-
createGitWorkspace,
|
|
20
|
-
migrateConfigToWorkspaces,
|
|
21
|
-
userCanAccess,
|
|
22
|
-
sanitizeWorkspace,
|
|
23
|
-
} from "@/lib/workspaces";
|
|
24
|
-
|
|
25
|
-
export const runtime = "nodejs";
|
|
26
|
-
|
|
27
|
-
export async function GET(request: Request) {
|
|
28
|
-
// --no-auth bypass: single-user local mode has no session. Treat the local
|
|
29
|
-
// user as admin so workspace management (add/delete) is available, matching
|
|
30
|
-
// requireAdmin and resolveWorkspaceForUser.
|
|
31
|
-
if (process.env.WIKI_NO_AUTH === "1") {
|
|
32
|
-
await migrateConfigToWorkspaces();
|
|
33
|
-
const workspaces = (await listWorkspaces()).map(sanitizeWorkspace);
|
|
34
|
-
return NextResponse.json({ workspaces, isAdmin: true });
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const auth = await requireUser(request);
|
|
38
|
-
if (!auth.ok) return NextResponse.json({ error: "UNAUTHORIZED" }, { status: 401 });
|
|
39
|
-
|
|
40
|
-
// Bootstrap: first authenticated user becomes admin if no admin set yet.
|
|
41
|
-
await ensureBootstrapAdmin(auth.user.id);
|
|
42
|
-
await migrateConfigToWorkspaces();
|
|
43
|
-
|
|
44
|
-
const admin = await isAdmin(auth.user.id, auth.user.email);
|
|
45
|
-
const all = await listWorkspaces();
|
|
46
|
-
const workspaces = all
|
|
47
|
-
.filter((ws) => userCanAccess(ws, auth.user.id, admin))
|
|
48
|
-
.map(sanitizeWorkspace);
|
|
49
|
-
|
|
50
|
-
return NextResponse.json({ workspaces, isAdmin: admin });
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
export async function POST(request: Request) {
|
|
54
|
-
const csrf = checkOrigin(request);
|
|
55
|
-
if (csrf) return csrf;
|
|
56
|
-
|
|
57
|
-
const authResult = await requireAdmin(request);
|
|
58
|
-
if (!authResult.ok)
|
|
59
|
-
return NextResponse.json({ error: authResult.code }, { status: authResult.status });
|
|
60
|
-
|
|
61
|
-
const body: {
|
|
62
|
-
rootDir?: string;
|
|
63
|
-
name?: string;
|
|
64
|
-
remoteUrl?: string;
|
|
65
|
-
branch?: string;
|
|
66
|
-
token?: string;
|
|
67
|
-
username?: string;
|
|
68
|
-
subpath?: string;
|
|
69
|
-
} = await request.json();
|
|
70
|
-
|
|
71
|
-
// Git-backed workspace path
|
|
72
|
-
if (body.remoteUrl) {
|
|
73
|
-
// Fast subpath validation before hitting git.
|
|
74
|
-
if (body.subpath !== undefined && typeof body.subpath !== "string") {
|
|
75
|
-
return NextResponse.json({ error: "Invalid subpath" }, { status: 400 });
|
|
76
|
-
}
|
|
77
|
-
const rawSubpath = body.subpath?.trim() || undefined;
|
|
78
|
-
if (rawSubpath) {
|
|
79
|
-
if (
|
|
80
|
-
rawSubpath.startsWith("/") ||
|
|
81
|
-
rawSubpath.includes("..") ||
|
|
82
|
-
/[;|&$`<>(){}\n\0]/.test(rawSubpath)
|
|
83
|
-
) {
|
|
84
|
-
return NextResponse.json({ error: "Invalid subpath" }, { status: 400 });
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
const cfg = await readConfig();
|
|
88
|
-
try {
|
|
89
|
-
const workspace = await createGitWorkspace({
|
|
90
|
-
remoteUrl: body.remoteUrl,
|
|
91
|
-
branch: body.branch?.trim() || undefined,
|
|
92
|
-
token: body.token || undefined,
|
|
93
|
-
username: body.username?.trim() || undefined,
|
|
94
|
-
name: body.name?.trim() || undefined,
|
|
95
|
-
createdBy: authResult.user.id,
|
|
96
|
-
allowedHosts: cfg.git?.allowedHosts,
|
|
97
|
-
allowInsecureHttp: cfg.git?.allowInsecureHttp,
|
|
98
|
-
subpath: rawSubpath,
|
|
99
|
-
});
|
|
100
|
-
// Never echo token in response; sanitizeWorkspace strips tokenRef.
|
|
101
|
-
return NextResponse.json({ ok: true, workspace: sanitizeWorkspace(workspace) });
|
|
102
|
-
} catch (err) {
|
|
103
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
104
|
-
return NextResponse.json({ error: msg }, { status: 400 });
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// Plain local workspace path
|
|
109
|
-
const rootDir = body.rootDir?.trim();
|
|
110
|
-
if (!rootDir) return NextResponse.json({ error: "Missing rootDir" }, { status: 400 });
|
|
111
|
-
|
|
112
|
-
// Validate directory
|
|
113
|
-
try {
|
|
114
|
-
const info = await stat(rootDir);
|
|
115
|
-
if (!info.isDirectory())
|
|
116
|
-
return NextResponse.json({ error: "Not a directory" }, { status: 400 });
|
|
117
|
-
} catch {
|
|
118
|
-
return NextResponse.json({ error: "Directory not found" }, { status: 404 });
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const workspace = await createWorkspace({
|
|
122
|
-
rootDir,
|
|
123
|
-
name: body.name?.trim() || undefined,
|
|
124
|
-
createdBy: authResult.user.id,
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
return NextResponse.json({ ok: true, workspace: sanitizeWorkspace(workspace) });
|
|
128
|
-
}
|