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,503 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Thin wrapper around the system git binary.
|
|
3
|
-
* Provider-agnostic: works with GitHub, GitLab, Bitbucket, Gitea, GHE, etc.
|
|
4
|
-
* Tokens are injected via GIT_ASKPASS so they never appear in process args,
|
|
5
|
-
* .git/config, or ps output.
|
|
6
|
-
*/
|
|
7
|
-
import { execFile as _execFile } from "node:child_process";
|
|
8
|
-
import { promisify } from "node:util";
|
|
9
|
-
import { writeFileSync, unlinkSync, rmSync, chmodSync } from "node:fs";
|
|
10
|
-
import { mkdtemp, stat } from "node:fs/promises";
|
|
11
|
-
import { tmpdir } from "node:os";
|
|
12
|
-
import path from "node:path";
|
|
13
|
-
|
|
14
|
-
const execFile = promisify(_execFile);
|
|
15
|
-
|
|
16
|
-
// Cached availability check result
|
|
17
|
-
let gitAvailable: boolean | undefined;
|
|
18
|
-
|
|
19
|
-
/** Verify the system git binary exists. Throws if not found. Cached after first call. */
|
|
20
|
-
export async function assertGitAvailable(): Promise<void> {
|
|
21
|
-
if (gitAvailable === true) return;
|
|
22
|
-
try {
|
|
23
|
-
await execFile("git", ["--version"]);
|
|
24
|
-
gitAvailable = true;
|
|
25
|
-
} catch {
|
|
26
|
-
throw new Error(
|
|
27
|
-
"git binary not found. Install git and ensure it is on PATH.",
|
|
28
|
-
);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// Characters that must not appear in a remote URL even when passed to execFile,
|
|
33
|
-
// as defense-in-depth against malformed input reaching git config or log output.
|
|
34
|
-
const FORBIDDEN_CHARS = /[;\|&$`<>(){}\n\0]/;
|
|
35
|
-
|
|
36
|
-
export interface ValidateRemoteUrlOpts {
|
|
37
|
-
allowedHosts?: string[];
|
|
38
|
-
allowInsecureHttp?: boolean;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export type ValidateRemoteUrlResult =
|
|
42
|
-
| { ok: true; url: URL }
|
|
43
|
-
| { ok: false; reason: string };
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* Validate a remote URL before passing it to git.
|
|
47
|
-
* Security contract:
|
|
48
|
-
* - Only https: allowed by default (opt-in http: via allowInsecureHttp).
|
|
49
|
-
* - file:, ext:, git:, ssh:, and all other schemes are rejected.
|
|
50
|
-
* - Shell metacharacters and control chars are rejected (defense-in-depth).
|
|
51
|
-
* - If allowedHosts is non-empty, the hostname must be in the list.
|
|
52
|
-
*/
|
|
53
|
-
export function validateRemoteUrl(
|
|
54
|
-
remoteUrl: string,
|
|
55
|
-
opts: ValidateRemoteUrlOpts = {},
|
|
56
|
-
): ValidateRemoteUrlResult {
|
|
57
|
-
if (FORBIDDEN_CHARS.test(remoteUrl)) {
|
|
58
|
-
return { ok: false, reason: "URL contains forbidden characters" };
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
let url: URL;
|
|
62
|
-
try {
|
|
63
|
-
url = new URL(remoteUrl);
|
|
64
|
-
} catch {
|
|
65
|
-
return { ok: false, reason: "URL could not be parsed" };
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const scheme = url.protocol; // includes trailing colon, e.g. "https:"
|
|
69
|
-
if (scheme === "https:") {
|
|
70
|
-
// ok
|
|
71
|
-
} else if (scheme === "http:" && opts.allowInsecureHttp) {
|
|
72
|
-
// ok only when explicitly permitted
|
|
73
|
-
} else if (scheme === "http:") {
|
|
74
|
-
return { ok: false, reason: "http: is not allowed (set allowInsecureHttp to permit)" };
|
|
75
|
-
} else {
|
|
76
|
-
return {
|
|
77
|
-
ok: false,
|
|
78
|
-
reason: `Scheme '${scheme.replace(":", "")}' is not allowed. Use https.`,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const { allowedHosts } = opts;
|
|
83
|
-
if (allowedHosts && allowedHosts.length > 0) {
|
|
84
|
-
const hostname = url.hostname.toLowerCase();
|
|
85
|
-
const allowed = allowedHosts.map((h) => h.toLowerCase());
|
|
86
|
-
if (!allowed.includes(hostname)) {
|
|
87
|
-
return {
|
|
88
|
-
ok: false,
|
|
89
|
-
reason: `Host '${url.hostname}' is not in the allowed hosts list`,
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
return { ok: true, url };
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Write a temporary askpass helper script that prints `token` to stdout.
|
|
99
|
-
* Returns the path. Caller MUST delete it in a finally block.
|
|
100
|
-
* The script is mode 0700 (exec + owner-only).
|
|
101
|
-
*/
|
|
102
|
-
async function writeAskpassScript(token: string): Promise<string> {
|
|
103
|
-
const dir = await mkdtemp(path.join(tmpdir(), "wiki-git-"));
|
|
104
|
-
const scriptPath = path.join(dir, "askpass.sh");
|
|
105
|
-
// The GIT_ASKPASS contract: git invokes the script with the prompt string
|
|
106
|
-
// as $1. The script prints the credential to stdout. We always print the
|
|
107
|
-
// token regardless of prompt, which covers the password prompt. The username
|
|
108
|
-
// is embedded in the URL userinfo so git skips the username prompt.
|
|
109
|
-
const body = `#!/bin/sh\nprintf '%s' '${token.replace(/'/g, "'\\''")}'`;
|
|
110
|
-
writeFileSync(scriptPath, body, { mode: 0o700 });
|
|
111
|
-
try {
|
|
112
|
-
chmodSync(scriptPath, 0o700);
|
|
113
|
-
} catch {
|
|
114
|
-
// best-effort
|
|
115
|
-
}
|
|
116
|
-
return scriptPath;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
function removeAskpassScript(scriptPath: string): void {
|
|
120
|
-
try {
|
|
121
|
-
unlinkSync(scriptPath);
|
|
122
|
-
} catch {
|
|
123
|
-
// best-effort cleanup
|
|
124
|
-
}
|
|
125
|
-
// Remove the parent temp dir created by mkdtemp.
|
|
126
|
-
const dir = path.dirname(scriptPath);
|
|
127
|
-
if (dir !== tmpdir()) {
|
|
128
|
-
try { rmSync(dir, { recursive: true, force: true }); } catch { /* ignore */ }
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* Build env vars for git commands that need token auth.
|
|
134
|
-
* Caller is responsible for cleaning up the temp askpass script.
|
|
135
|
-
*/
|
|
136
|
-
async function buildAuthEnv(token: string): Promise<{ env: NodeJS.ProcessEnv; askpassPath: string }> {
|
|
137
|
-
const askpassPath = await writeAskpassScript(token);
|
|
138
|
-
const env: NodeJS.ProcessEnv = {
|
|
139
|
-
...process.env,
|
|
140
|
-
GIT_ASKPASS: askpassPath,
|
|
141
|
-
GIT_TERMINAL_PROMPT: "0",
|
|
142
|
-
};
|
|
143
|
-
return { env, askpassPath };
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* Build a clone URL with username embedded in userinfo (in-memory only).
|
|
148
|
-
* Token is NOT in the URL - it comes from the askpass script.
|
|
149
|
-
*/
|
|
150
|
-
function buildAuthUrl(remoteUrl: string, username: string): string {
|
|
151
|
-
try {
|
|
152
|
-
const u = new URL(remoteUrl);
|
|
153
|
-
u.username = username;
|
|
154
|
-
u.password = ""; // token comes from askpass, not URL
|
|
155
|
-
return u.toString();
|
|
156
|
-
} catch {
|
|
157
|
-
// not a parseable URL (e.g. local path) - return as-is
|
|
158
|
-
return remoteUrl;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
export interface CloneArgs {
|
|
163
|
-
remoteUrl: string;
|
|
164
|
-
branch?: string;
|
|
165
|
-
token?: string;
|
|
166
|
-
username?: string;
|
|
167
|
-
destDir: string;
|
|
168
|
-
depth?: number;
|
|
169
|
-
/** Sparse cone path (e.g. "docs"). When set, uses --filter=blob:none + sparse-checkout. */
|
|
170
|
-
subpath?: string;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/** Validate a subpath for sparse checkout. Throws on invalid input. Returns normalized subpath. */
|
|
174
|
-
function validateSubpath(subpath: string): string {
|
|
175
|
-
if (path.isAbsolute(subpath)) throw new Error("subpath must be relative");
|
|
176
|
-
if (subpath.includes("..")) throw new Error("subpath must not contain '..'");
|
|
177
|
-
if (/[\0\n]/.test(subpath)) throw new Error("subpath contains forbidden characters");
|
|
178
|
-
if (FORBIDDEN_CHARS.test(subpath)) throw new Error("subpath contains forbidden characters");
|
|
179
|
-
const normalized = subpath.split(path.sep).join("/").replace(/\/+$/, "");
|
|
180
|
-
if (normalized === ".git" || normalized.startsWith(".git/"))
|
|
181
|
-
throw new Error("subpath must not point at .git");
|
|
182
|
-
return normalized;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
/** Clone a remote repository. Shallow (depth=1) by default. */
|
|
186
|
-
export async function cloneRepo(args: CloneArgs): Promise<void> {
|
|
187
|
-
const { branch, token, destDir, subpath } = args;
|
|
188
|
-
const depth = args.depth ?? 1;
|
|
189
|
-
const username = args.username ?? "x-access-token";
|
|
190
|
-
|
|
191
|
-
let normalizedSubpath: string | undefined;
|
|
192
|
-
if (subpath) {
|
|
193
|
-
normalizedSubpath = validateSubpath(subpath);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const cloneArgs: string[] = ["clone", "--depth", String(depth), "--single-branch", "--no-tags"];
|
|
197
|
-
if (branch) {
|
|
198
|
-
cloneArgs.push("--branch", branch);
|
|
199
|
-
}
|
|
200
|
-
if (normalizedSubpath) {
|
|
201
|
-
cloneArgs.push("--filter=blob:none", "--sparse");
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// For auth: embed username in URL userinfo; token comes from askpass env.
|
|
205
|
-
const remoteUrlForGit = token
|
|
206
|
-
? buildAuthUrl(args.remoteUrl, username)
|
|
207
|
-
: args.remoteUrl;
|
|
208
|
-
|
|
209
|
-
cloneArgs.push(remoteUrlForGit, destDir);
|
|
210
|
-
|
|
211
|
-
let askpassPath: string | undefined;
|
|
212
|
-
try {
|
|
213
|
-
if (token) {
|
|
214
|
-
const auth = await buildAuthEnv(token);
|
|
215
|
-
askpassPath = auth.askpassPath;
|
|
216
|
-
await execFile("git", cloneArgs, { env: auth.env });
|
|
217
|
-
} else {
|
|
218
|
-
await execFile("git", cloneArgs, {
|
|
219
|
-
env: { ...process.env, GIT_TERMINAL_PROMPT: "0" },
|
|
220
|
-
});
|
|
221
|
-
}
|
|
222
|
-
// Apply sparse cone after clone if subpath specified.
|
|
223
|
-
if (normalizedSubpath) {
|
|
224
|
-
await execFile(
|
|
225
|
-
"git",
|
|
226
|
-
["-C", destDir, "sparse-checkout", "set", "--cone", normalizedSubpath],
|
|
227
|
-
{ env: { ...process.env, GIT_TERMINAL_PROMPT: "0" } },
|
|
228
|
-
);
|
|
229
|
-
}
|
|
230
|
-
} finally {
|
|
231
|
-
if (askpassPath) removeAskpassScript(askpassPath);
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
export interface PullArgs {
|
|
236
|
-
rootDir: string;
|
|
237
|
-
token?: string;
|
|
238
|
-
username?: string;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/** Pull latest changes in a cloned repo using --ff-only. */
|
|
242
|
-
export async function pullRepo(args: PullArgs): Promise<void> {
|
|
243
|
-
const { rootDir, token } = args;
|
|
244
|
-
const pullArgs = ["-C", rootDir, "pull", "--ff-only"];
|
|
245
|
-
|
|
246
|
-
let askpassPath: string | undefined;
|
|
247
|
-
try {
|
|
248
|
-
if (token) {
|
|
249
|
-
const auth = await buildAuthEnv(token);
|
|
250
|
-
askpassPath = auth.askpassPath;
|
|
251
|
-
await execFile("git", pullArgs, { env: auth.env });
|
|
252
|
-
} else {
|
|
253
|
-
await execFile("git", pullArgs, {
|
|
254
|
-
env: { ...process.env, GIT_TERMINAL_PROMPT: "0" },
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
} finally {
|
|
258
|
-
if (askpassPath) removeAskpassScript(askpassPath);
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
/** Return the full SHA of HEAD in the given repo. */
|
|
263
|
-
export async function headSha(rootDir: string): Promise<string> {
|
|
264
|
-
const { stdout } = await execFile("git", ["-C", rootDir, "rev-parse", "HEAD"]);
|
|
265
|
-
return stdout.trim();
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/** Return the current branch name (or "HEAD" if detached). */
|
|
269
|
-
export async function currentBranch(rootDir: string): Promise<string> {
|
|
270
|
-
const { stdout } = await execFile("git", [
|
|
271
|
-
"-C",
|
|
272
|
-
rootDir,
|
|
273
|
-
"rev-parse",
|
|
274
|
-
"--abbrev-ref",
|
|
275
|
-
"HEAD",
|
|
276
|
-
]);
|
|
277
|
-
return stdout.trim();
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
export interface GitRepoInfo {
|
|
281
|
-
branch: string;
|
|
282
|
-
dirty: boolean;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
// ---------------------------------------------------------------------------
|
|
286
|
-
// Read-only history / diff / branch helpers
|
|
287
|
-
// ---------------------------------------------------------------------------
|
|
288
|
-
|
|
289
|
-
export interface GitCommit {
|
|
290
|
-
sha: string;
|
|
291
|
-
shortSha: string;
|
|
292
|
-
message: string;
|
|
293
|
-
author: string;
|
|
294
|
-
date: string; // ISO 8601
|
|
295
|
-
}
|
|
296
|
-
|
|
297
|
-
/** Return up to `limit` commits that touched `filePath` inside `repoDir`. */
|
|
298
|
-
export async function gitFileHistory(
|
|
299
|
-
repoDir: string,
|
|
300
|
-
filePath: string,
|
|
301
|
-
limit = 50,
|
|
302
|
-
): Promise<GitCommit[]> {
|
|
303
|
-
const SEP = "\x1f";
|
|
304
|
-
const { stdout } = await execFile("git", [
|
|
305
|
-
"-C", repoDir,
|
|
306
|
-
"log",
|
|
307
|
-
"--follow",
|
|
308
|
-
`--max-count=${limit}`,
|
|
309
|
-
`--pretty=format:%H${SEP}%s${SEP}%an${SEP}%aI`,
|
|
310
|
-
"--",
|
|
311
|
-
filePath,
|
|
312
|
-
]);
|
|
313
|
-
if (!stdout.trim()) return [];
|
|
314
|
-
return stdout.trim().split("\n").map((line) => {
|
|
315
|
-
const parts = line.split(SEP);
|
|
316
|
-
const sha = (parts[0] ?? "").trim();
|
|
317
|
-
return {
|
|
318
|
-
sha,
|
|
319
|
-
shortSha: sha.slice(0, 7),
|
|
320
|
-
message: (parts[1] ?? "").trim(),
|
|
321
|
-
author: (parts[2] ?? "").trim(),
|
|
322
|
-
date: (parts[3] ?? "").trim(),
|
|
323
|
-
};
|
|
324
|
-
});
|
|
325
|
-
}
|
|
326
|
-
|
|
327
|
-
/**
|
|
328
|
-
* Return unified diff for a single commit affecting `filePath`.
|
|
329
|
-
* Falls back to `git show` for the initial commit (no parent).
|
|
330
|
-
*/
|
|
331
|
-
export async function gitFileDiff(
|
|
332
|
-
repoDir: string,
|
|
333
|
-
filePath: string,
|
|
334
|
-
sha: string,
|
|
335
|
-
): Promise<string> {
|
|
336
|
-
try {
|
|
337
|
-
const { stdout } = await execFile("git", [
|
|
338
|
-
"-C", repoDir,
|
|
339
|
-
"diff",
|
|
340
|
-
`${sha}^`,
|
|
341
|
-
sha,
|
|
342
|
-
"--",
|
|
343
|
-
filePath,
|
|
344
|
-
]);
|
|
345
|
-
return stdout;
|
|
346
|
-
} catch {
|
|
347
|
-
const { stdout } = await execFile("git", [
|
|
348
|
-
"-C", repoDir,
|
|
349
|
-
"show",
|
|
350
|
-
sha,
|
|
351
|
-
"--",
|
|
352
|
-
filePath,
|
|
353
|
-
]);
|
|
354
|
-
return stdout;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
|
|
358
|
-
export interface GitFileInfo {
|
|
359
|
-
sha: string;
|
|
360
|
-
author: string;
|
|
361
|
-
date: string; // ISO 8601
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
/** Return metadata for the last commit that touched `filePath`. */
|
|
365
|
-
export async function gitFileInfo(
|
|
366
|
-
repoDir: string,
|
|
367
|
-
filePath: string,
|
|
368
|
-
): Promise<GitFileInfo | null> {
|
|
369
|
-
const SEP = "\x1f";
|
|
370
|
-
try {
|
|
371
|
-
const { stdout } = await execFile("git", [
|
|
372
|
-
"-C", repoDir,
|
|
373
|
-
"log", "-1",
|
|
374
|
-
`--pretty=format:%H${SEP}%an${SEP}%aI`,
|
|
375
|
-
"--",
|
|
376
|
-
filePath,
|
|
377
|
-
]);
|
|
378
|
-
if (!stdout.trim()) return null;
|
|
379
|
-
const parts = stdout.trim().split(SEP);
|
|
380
|
-
return {
|
|
381
|
-
sha: (parts[0] ?? "").trim(),
|
|
382
|
-
author: (parts[1] ?? "").trim(),
|
|
383
|
-
date: (parts[2] ?? "").trim(),
|
|
384
|
-
};
|
|
385
|
-
} catch {
|
|
386
|
-
return null;
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
export interface GitBranch {
|
|
391
|
-
name: string;
|
|
392
|
-
current: boolean;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
/** List local branches in `repoDir`. */
|
|
396
|
-
export async function gitBranches(repoDir: string): Promise<GitBranch[]> {
|
|
397
|
-
const { stdout } = await execFile("git", ["-C", repoDir, "branch"]);
|
|
398
|
-
return stdout
|
|
399
|
-
.split("\n")
|
|
400
|
-
.filter(Boolean)
|
|
401
|
-
.map((line) => ({
|
|
402
|
-
current: line.startsWith("*"),
|
|
403
|
-
name: line.replace(/^\*?\s+/, "").trim(),
|
|
404
|
-
}));
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
/** Validate a local branch name before passing it to git. */
|
|
408
|
-
function isValidBranchName(name: string): boolean {
|
|
409
|
-
if (!name || name.length > 200) return false;
|
|
410
|
-
if (FORBIDDEN_CHARS.test(name)) return false;
|
|
411
|
-
if (name.includes("..")) return false;
|
|
412
|
-
if (name.startsWith("-") || name.startsWith("/") || name.endsWith("/")) return false;
|
|
413
|
-
if (!/^[a-zA-Z0-9._\-/]+$/.test(name)) return false;
|
|
414
|
-
return true;
|
|
415
|
-
}
|
|
416
|
-
|
|
417
|
-
/**
|
|
418
|
-
* Checkout `branch` in `repoDir`.
|
|
419
|
-
* Throws with `.dirty = true` if the working tree has uncommitted changes.
|
|
420
|
-
* Throws with `.invalidBranch = true` for bad branch names.
|
|
421
|
-
*/
|
|
422
|
-
export async function gitCheckout(
|
|
423
|
-
repoDir: string,
|
|
424
|
-
branch: string,
|
|
425
|
-
): Promise<{ branch: string; sha: string }> {
|
|
426
|
-
if (!isValidBranchName(branch)) {
|
|
427
|
-
const err = new Error("Invalid branch name") as Error & { invalidBranch?: boolean };
|
|
428
|
-
err.invalidBranch = true;
|
|
429
|
-
throw err;
|
|
430
|
-
}
|
|
431
|
-
const { stdout: statusOut } = await execFile("git", [
|
|
432
|
-
"-C", repoDir, "status", "--porcelain",
|
|
433
|
-
]);
|
|
434
|
-
if (statusOut.trim().length > 0) {
|
|
435
|
-
const err = new Error("Repository has uncommitted changes") as Error & { dirty?: boolean };
|
|
436
|
-
err.dirty = true;
|
|
437
|
-
throw err;
|
|
438
|
-
}
|
|
439
|
-
await execFile("git", ["-C", repoDir, "checkout", branch]);
|
|
440
|
-
const [sha, br] = await Promise.all([headSha(repoDir), currentBranch(repoDir)]);
|
|
441
|
-
return { sha, branch: br };
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
/**
|
|
445
|
-
* Walk up from `relFilePath` inside `rootDir`, looking for a git repo root.
|
|
446
|
-
* Returns `{ repoDir, relFromRepo }` for the nearest enclosing repo, or null.
|
|
447
|
-
*/
|
|
448
|
-
export async function findEnclosingGitRepo(
|
|
449
|
-
rootDir: string,
|
|
450
|
-
relFilePath: string,
|
|
451
|
-
): Promise<{ repoDir: string; relFromRepo: string } | null> {
|
|
452
|
-
const parts = relFilePath.split("/").filter(Boolean);
|
|
453
|
-
for (let depth = parts.length - 1; depth >= 0; depth--) {
|
|
454
|
-
const candidate =
|
|
455
|
-
depth === 0 ? rootDir : path.join(rootDir, ...parts.slice(0, depth));
|
|
456
|
-
const gitInfo = await detectGitRepo(candidate);
|
|
457
|
-
if (gitInfo) {
|
|
458
|
-
const relFromRepo = parts.slice(depth).join("/");
|
|
459
|
-
return { repoDir: candidate, relFromRepo };
|
|
460
|
-
}
|
|
461
|
-
}
|
|
462
|
-
return null;
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
/**
|
|
466
|
-
* Check if a directory is a git repo root and return branch + dirty status.
|
|
467
|
-
* Returns null if dirPath is not a git repo root.
|
|
468
|
-
*/
|
|
469
|
-
export async function detectGitRepo(
|
|
470
|
-
dirPath: string,
|
|
471
|
-
): Promise<GitRepoInfo | null> {
|
|
472
|
-
try {
|
|
473
|
-
// stat .git (file for submodules, dir for regular repos)
|
|
474
|
-
await stat(path.join(dirPath, ".git"));
|
|
475
|
-
} catch {
|
|
476
|
-
return null;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
try {
|
|
480
|
-
// Verify it's the repo root, not inside a submodule
|
|
481
|
-
const { stdout: toplevel } = await execFile("git", [
|
|
482
|
-
"-C",
|
|
483
|
-
dirPath,
|
|
484
|
-
"rev-parse",
|
|
485
|
-
"--show-toplevel",
|
|
486
|
-
]);
|
|
487
|
-
if (toplevel.trim() !== dirPath) return null;
|
|
488
|
-
|
|
489
|
-
const branch = await currentBranch(dirPath);
|
|
490
|
-
|
|
491
|
-
const { stdout: statusOut } = await execFile("git", [
|
|
492
|
-
"-C",
|
|
493
|
-
dirPath,
|
|
494
|
-
"status",
|
|
495
|
-
"--porcelain",
|
|
496
|
-
]);
|
|
497
|
-
const dirty = statusOut.trim().length > 0;
|
|
498
|
-
|
|
499
|
-
return { branch, dirty };
|
|
500
|
-
} catch {
|
|
501
|
-
return null;
|
|
502
|
-
}
|
|
503
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
export type GoogleKind = "sheets" | "slides" | "docs" | "forms" | "drive";
|
|
2
|
-
|
|
3
|
-
export interface GoogleLink {
|
|
4
|
-
kind: GoogleKind;
|
|
5
|
-
id: string;
|
|
6
|
-
/** URL suitable for embedding in an iframe. May require "Publish to Web". */
|
|
7
|
-
embedUrl: string;
|
|
8
|
-
/** URL to open in a new tab to view/edit in Google's own UI. */
|
|
9
|
-
openUrl: string;
|
|
10
|
-
/** Raw input URL. */
|
|
11
|
-
rawUrl: string;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const PATTERNS: Array<{ re: RegExp; kind: GoogleKind }> = [
|
|
15
|
-
{
|
|
16
|
-
re: /^https?:\/\/docs\.google\.com\/spreadsheets\/d\/(?:e\/)?([A-Za-z0-9_-]+)/,
|
|
17
|
-
kind: "sheets",
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
re: /^https?:\/\/docs\.google\.com\/presentation\/d\/(?:e\/)?([A-Za-z0-9_-]+)/,
|
|
21
|
-
kind: "slides",
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
re: /^https?:\/\/docs\.google\.com\/document\/d\/(?:e\/)?([A-Za-z0-9_-]+)/,
|
|
25
|
-
kind: "docs",
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
re: /^https?:\/\/docs\.google\.com\/forms\/d\/(?:e\/)?([A-Za-z0-9_-]+)/,
|
|
29
|
-
kind: "forms",
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
re: /^https?:\/\/drive\.google\.com\/file\/d\/([A-Za-z0-9_-]+)/,
|
|
33
|
-
kind: "drive",
|
|
34
|
-
},
|
|
35
|
-
];
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Inspect a URL and resolve it to a Google document we know how to embed.
|
|
39
|
-
* Returns null for any URL that isn't a Google Workspace link.
|
|
40
|
-
*/
|
|
41
|
-
export function detectGoogle(rawUrl: string): GoogleLink | null {
|
|
42
|
-
const url = rawUrl.trim();
|
|
43
|
-
if (!url) return null;
|
|
44
|
-
for (const { re, kind } of PATTERNS) {
|
|
45
|
-
const m = url.match(re);
|
|
46
|
-
if (!m) continue;
|
|
47
|
-
const id = m[1];
|
|
48
|
-
return {
|
|
49
|
-
kind,
|
|
50
|
-
id,
|
|
51
|
-
embedUrl: computeEmbedUrl(kind, id, url),
|
|
52
|
-
openUrl: computeOpenUrl(kind, id),
|
|
53
|
-
rawUrl,
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
function computeEmbedUrl(kind: GoogleKind, id: string, rawUrl: string): string {
|
|
60
|
-
// Preserve any `?e=` / share-link variant Google already generated
|
|
61
|
-
const hasE = /\/d\/e\//.test(rawUrl);
|
|
62
|
-
const idSeg = hasE ? `e/${id}` : id;
|
|
63
|
-
switch (kind) {
|
|
64
|
-
case "sheets":
|
|
65
|
-
// `pubhtml` renders as a scrollable table; `edit?embed=true` keeps full UI
|
|
66
|
-
// when the doc is published. Prefer `pubhtml` for minimal chrome.
|
|
67
|
-
return `https://docs.google.com/spreadsheets/d/${idSeg}/pubhtml?widget=true&headers=false`;
|
|
68
|
-
case "slides":
|
|
69
|
-
return `https://docs.google.com/presentation/d/${idSeg}/embed?start=false&loop=false&delayms=3000`;
|
|
70
|
-
case "docs":
|
|
71
|
-
return `https://docs.google.com/document/d/${idSeg}/pub?embedded=true`;
|
|
72
|
-
case "forms":
|
|
73
|
-
return `https://docs.google.com/forms/d/${idSeg}/viewform?embedded=true`;
|
|
74
|
-
case "drive":
|
|
75
|
-
return `https://drive.google.com/file/d/${id}/preview`;
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function computeOpenUrl(kind: GoogleKind, id: string): string {
|
|
80
|
-
switch (kind) {
|
|
81
|
-
case "sheets":
|
|
82
|
-
return `https://docs.google.com/spreadsheets/d/${id}/edit`;
|
|
83
|
-
case "slides":
|
|
84
|
-
return `https://docs.google.com/presentation/d/${id}/edit`;
|
|
85
|
-
case "docs":
|
|
86
|
-
return `https://docs.google.com/document/d/${id}/edit`;
|
|
87
|
-
case "forms":
|
|
88
|
-
return `https://docs.google.com/forms/d/${id}/edit`;
|
|
89
|
-
case "drive":
|
|
90
|
-
return `https://drive.google.com/file/d/${id}/view`;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export function googleKindLabel(kind: GoogleKind): string {
|
|
95
|
-
switch (kind) {
|
|
96
|
-
case "sheets":
|
|
97
|
-
return "Google Sheets";
|
|
98
|
-
case "slides":
|
|
99
|
-
return "Google Slides";
|
|
100
|
-
case "docs":
|
|
101
|
-
return "Google Docs";
|
|
102
|
-
case "forms":
|
|
103
|
-
return "Google Forms";
|
|
104
|
-
case "drive":
|
|
105
|
-
return "Google Drive";
|
|
106
|
-
}
|
|
107
|
-
}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tiny client-safe frontmatter parser for wiki YAML.
|
|
3
|
-
* Handles the subset we use: scalars, inline arrays, and block arrays.
|
|
4
|
-
* Not a full YAML parser. For complex structures, fall back to server.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
export interface ParsedFrontmatter {
|
|
8
|
-
data: Record<string, unknown>;
|
|
9
|
-
body: string;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
const BLOCK_RE = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?/;
|
|
13
|
-
|
|
14
|
-
function parseScalar(raw: string): unknown {
|
|
15
|
-
const v = raw.trim();
|
|
16
|
-
if (v === "") return "";
|
|
17
|
-
if (v === "true") return true;
|
|
18
|
-
if (v === "false") return false;
|
|
19
|
-
if (v === "null" || v === "~") return null;
|
|
20
|
-
if (/^-?\d+$/.test(v)) return Number(v);
|
|
21
|
-
if (/^-?\d*\.\d+$/.test(v)) return Number(v);
|
|
22
|
-
// Quoted string
|
|
23
|
-
if (
|
|
24
|
-
(v.startsWith('"') && v.endsWith('"')) ||
|
|
25
|
-
(v.startsWith("'") && v.endsWith("'"))
|
|
26
|
-
) {
|
|
27
|
-
return v.slice(1, -1);
|
|
28
|
-
}
|
|
29
|
-
// Inline array: [a, b, c]
|
|
30
|
-
if (v.startsWith("[") && v.endsWith("]")) {
|
|
31
|
-
const inner = v.slice(1, -1).trim();
|
|
32
|
-
if (inner === "") return [];
|
|
33
|
-
return inner.split(",").map((s) => parseScalar(s));
|
|
34
|
-
}
|
|
35
|
-
return v;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
export function parseFrontmatter(text: string): ParsedFrontmatter {
|
|
39
|
-
const match = BLOCK_RE.exec(text);
|
|
40
|
-
if (!match) return { data: {}, body: text };
|
|
41
|
-
|
|
42
|
-
const block = match[1];
|
|
43
|
-
const body = text.slice(match[0].length);
|
|
44
|
-
|
|
45
|
-
// Guard against runaway capture. BLOCK_RE matches from the opening `---`
|
|
46
|
-
// to the FIRST `\n---\n`, which may be a markdown horizontal rule far down
|
|
47
|
-
// the document rather than a real closing fence. If the block does not look
|
|
48
|
-
// like YAML (a markdown heading or HTML on the first non-empty line, or a
|
|
49
|
-
// blank line gap typical of body content), bail out and treat the whole
|
|
50
|
-
// text as body so the document still renders.
|
|
51
|
-
const blockLines = block.split(/\r?\n/);
|
|
52
|
-
const firstContent = blockLines.find((l) => l.trim() !== "") ?? "";
|
|
53
|
-
if (/^\s*(#{1,6}\s|<|>|-\s|\*\s|\d+\.\s)/.test(firstContent)) {
|
|
54
|
-
return { data: {}, body: text };
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const data: Record<string, unknown> = {};
|
|
58
|
-
|
|
59
|
-
const lines = block.split(/\r?\n/);
|
|
60
|
-
let i = 0;
|
|
61
|
-
while (i < lines.length) {
|
|
62
|
-
const line = lines[i];
|
|
63
|
-
if (!line || /^\s*#/.test(line)) {
|
|
64
|
-
i += 1;
|
|
65
|
-
continue;
|
|
66
|
-
}
|
|
67
|
-
const m = /^([A-Za-z_][\w-]*)\s*:\s*(.*)$/.exec(line);
|
|
68
|
-
if (!m) {
|
|
69
|
-
i += 1;
|
|
70
|
-
continue;
|
|
71
|
-
}
|
|
72
|
-
const key = m[1];
|
|
73
|
-
const rest = m[2];
|
|
74
|
-
if (rest.trim() === "") {
|
|
75
|
-
// Possibly a block array on following indented lines
|
|
76
|
-
const items: unknown[] = [];
|
|
77
|
-
let j = i + 1;
|
|
78
|
-
while (j < lines.length && /^\s+-\s+/.test(lines[j])) {
|
|
79
|
-
const itemMatch = /^\s+-\s+(.*)$/.exec(lines[j]);
|
|
80
|
-
if (itemMatch) items.push(parseScalar(itemMatch[1]));
|
|
81
|
-
j += 1;
|
|
82
|
-
}
|
|
83
|
-
if (items.length > 0) {
|
|
84
|
-
data[key] = items;
|
|
85
|
-
i = j;
|
|
86
|
-
continue;
|
|
87
|
-
}
|
|
88
|
-
data[key] = "";
|
|
89
|
-
i += 1;
|
|
90
|
-
continue;
|
|
91
|
-
}
|
|
92
|
-
data[key] = parseScalar(rest);
|
|
93
|
-
i += 1;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
// A valid frontmatter block always yields at least one key. Zero keys means
|
|
97
|
-
// BLOCK_RE consumed body content up to a stray `---` (e.g. a horizontal
|
|
98
|
-
// rule). Reject so the body is not swallowed.
|
|
99
|
-
if (Object.keys(data).length === 0) {
|
|
100
|
-
return { data: {}, body: text };
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return { data, body };
|
|
104
|
-
}
|