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,531 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* wiki-viewer-mcp — MCP filesystem adapter for wiki-viewer agent API.
|
|
4
|
-
*
|
|
5
|
-
* Maps standard MCP filesystem tools onto the wiki-viewer HTTP agent API
|
|
6
|
-
* described in docs/agent-fs-plan.md §2 + §3.5 + §6.
|
|
7
|
-
*
|
|
8
|
-
* Configuration (env vars):
|
|
9
|
-
* WIKI_VIEWER_URL Base URL of wiki-viewer instance (required)
|
|
10
|
-
* WIKI_VIEWER_TOKEN Bearer token from TOFU registration (required)
|
|
11
|
-
* WIKI_VIEWER_AGENT_ID X-Agent-Id header value (required)
|
|
12
|
-
* WIKI_VIEWER_WORKSPACE Workspace id for X-Workspace header (optional; targets one workspace)
|
|
13
|
-
*
|
|
14
|
-
* Mode-awareness:
|
|
15
|
-
* Before any raw write to a .md file, the shim checks the cached
|
|
16
|
-
* X-Collab-State from the last read. If "active", it blocks the write
|
|
17
|
-
* and instructs the agent to use Tier-2 block-ops instead.
|
|
18
|
-
* The server also enforces this (409 COLLAB_ACTIVE), which the shim
|
|
19
|
-
* surfaces cleanly.
|
|
20
|
-
*/
|
|
21
|
-
import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
22
|
-
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
23
|
-
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
24
|
-
import * as z from "zod";
|
|
25
|
-
import { parseArgs } from "node:util";
|
|
26
|
-
import { WikiViewerClient, IfMatchError, CollabActiveError, WikiViewerError, PatchUnsupportedError, MatchCountError } from "./http-client.js";
|
|
27
|
-
import * as stateCache from "./state-cache.js";
|
|
28
|
-
/**
|
|
29
|
-
* Enable pooled HTTP keep-alive for the global fetch the client uses.
|
|
30
|
-
*
|
|
31
|
-
* Without this, every tool call opens a fresh connection and pays a full
|
|
32
|
-
* TCP + TLS handshake (~3 RTT) before the request even goes out. Over a WAN
|
|
33
|
-
* link that turns a sub-100ms write into 300ms-1s+, and multiplies across the
|
|
34
|
-
* GET+PUT an edit performs. Reusing connections removes that per-call penalty.
|
|
35
|
-
*
|
|
36
|
-
* Wrapped in try/catch + dynamic import so a missing/edge undici never breaks
|
|
37
|
-
* startup; it just falls back to default (non-pooled) fetch.
|
|
38
|
-
*/
|
|
39
|
-
async function enableKeepAlive() {
|
|
40
|
-
try {
|
|
41
|
-
const { Agent, setGlobalDispatcher } = await import("undici");
|
|
42
|
-
setGlobalDispatcher(new Agent({
|
|
43
|
-
keepAliveTimeout: 30_000,
|
|
44
|
-
keepAliveMaxTimeout: 60_000,
|
|
45
|
-
connections: 16,
|
|
46
|
-
pipelining: 1,
|
|
47
|
-
}));
|
|
48
|
-
}
|
|
49
|
-
catch {
|
|
50
|
-
// undici unavailable — default fetch still works, just without pooling.
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
import { register, RegistrationDeniedError, RegistrationExpiredError, RegistrationTimeoutError, } from "./register.js";
|
|
54
|
-
// ─── Config ───────────────────────────────────────────────────────────────────
|
|
55
|
-
function requireEnv(name) {
|
|
56
|
-
const v = process.env[name];
|
|
57
|
-
if (!v)
|
|
58
|
-
throw new Error(`Missing required env var: ${name}`);
|
|
59
|
-
return v;
|
|
60
|
-
}
|
|
61
|
-
export function createClient(overrides) {
|
|
62
|
-
return new WikiViewerClient({
|
|
63
|
-
baseUrl: overrides?.baseUrl ?? requireEnv("WIKI_VIEWER_URL"),
|
|
64
|
-
token: overrides?.token ?? requireEnv("WIKI_VIEWER_TOKEN"),
|
|
65
|
-
agentId: overrides?.agentId ?? requireEnv("WIKI_VIEWER_AGENT_ID"),
|
|
66
|
-
workspace: overrides?.workspace ?? process.env.WIKI_VIEWER_WORKSPACE,
|
|
67
|
-
fetch: overrides?.fetch,
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
// ─── Tool schemas ─────────────────────────────────────────────────────────────
|
|
71
|
-
const ReadFileInput = z.object({
|
|
72
|
-
path: z.string().describe("File path relative to wiki root"),
|
|
73
|
-
range: z.string().optional().describe("HTTP Range header value, e.g. 'bytes=0-1023'"),
|
|
74
|
-
});
|
|
75
|
-
const WriteFileInput = z.object({
|
|
76
|
-
path: z.string().describe("File path relative to wiki root"),
|
|
77
|
-
content: z.string().describe("File content (text)"),
|
|
78
|
-
mkdirs: z.boolean().optional().describe("Create parent directories if missing"),
|
|
79
|
-
force: z.boolean().optional().describe("Skip If-Match guard (audited)"),
|
|
80
|
-
ifCollabMatch: z.number().optional().describe("If-Collab-Match revision (for tracked .md)"),
|
|
81
|
-
});
|
|
82
|
-
const EditFileInput = z.object({
|
|
83
|
-
path: z.string().describe("File path relative to wiki root"),
|
|
84
|
-
find: z.string().describe("Exact string to find (first occurrence)"),
|
|
85
|
-
replace: z.string().describe("Replacement string"),
|
|
86
|
-
});
|
|
87
|
-
const ListDirectoryInput = z.object({
|
|
88
|
-
path: z.string().describe("Directory path relative to wiki root"),
|
|
89
|
-
recursive: z.boolean().optional().describe("List recursively"),
|
|
90
|
-
depth: z.number().optional().describe("Max depth for recursive listing"),
|
|
91
|
-
limit: z.number().optional().describe("Max entries to return"),
|
|
92
|
-
});
|
|
93
|
-
const SearchInput = z.object({
|
|
94
|
-
kind: z.enum(["grep", "glob"]).describe("grep = text search, glob = path pattern"),
|
|
95
|
-
query: z.string().describe("Search query or glob pattern"),
|
|
96
|
-
path: z.string().optional().describe("Root path to search within"),
|
|
97
|
-
glob: z.string().optional().describe("File glob filter for grep"),
|
|
98
|
-
limit: z.number().optional().describe("Max matches to return"),
|
|
99
|
-
});
|
|
100
|
-
const MoveFileInput = z.object({
|
|
101
|
-
from: z.string().describe("Source path"),
|
|
102
|
-
to: z.string().describe("Destination path"),
|
|
103
|
-
});
|
|
104
|
-
const DeleteFileInput = z.object({
|
|
105
|
-
path: z.string().describe("File path to delete"),
|
|
106
|
-
recursive: z.boolean().optional().describe("Delete directory recursively"),
|
|
107
|
-
force: z.boolean().optional().describe("Skip If-Match guard (audited)"),
|
|
108
|
-
});
|
|
109
|
-
// ─── Tool definitions ─────────────────────────────────────────────────────────
|
|
110
|
-
export const TOOLS = [
|
|
111
|
-
{
|
|
112
|
-
name: "read_file",
|
|
113
|
-
description: "Read a file from the wiki-viewer instance. Returns content and metadata. " +
|
|
114
|
-
"Captures sha256 (ETag) and X-Collab-State for subsequent writes. " +
|
|
115
|
-
"Always read before writing to get the current sha.",
|
|
116
|
-
inputSchema: zodToJsonSchema(ReadFileInput),
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
name: "write_file",
|
|
120
|
-
description: "Write (create or overwrite) a file. " +
|
|
121
|
-
"If you have previously read the file, the last known sha is sent as If-Match automatically — " +
|
|
122
|
-
"you get a 412 error if the file changed since your read. " +
|
|
123
|
-
"WARNING: for .md files with X-Collab-State 'active', raw writes are blocked — " +
|
|
124
|
-
"use wiki-viewer block-ops (Tier 2) instead so the human can review your changes.",
|
|
125
|
-
inputSchema: zodToJsonSchema(WriteFileInput),
|
|
126
|
-
},
|
|
127
|
-
{
|
|
128
|
-
name: "edit_file",
|
|
129
|
-
description: "Edit a file by exact string replacement (first occurrence). " +
|
|
130
|
-
"Implemented client-side as: read → str-replace → PUT with If-Match. " +
|
|
131
|
-
"Returns an error if the find string is not found or the file is collab-active. " +
|
|
132
|
-
"For .md files, prefer block-ops if X-Collab-State is 'active'.",
|
|
133
|
-
inputSchema: zodToJsonSchema(EditFileInput),
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
name: "list_directory",
|
|
137
|
-
description: "List directory contents. Scope-filtered; .proof/ is hidden.",
|
|
138
|
-
inputSchema: zodToJsonSchema(ListDirectoryInput),
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
name: "search",
|
|
142
|
-
description: "Search files. kind='grep' searches file contents; kind='glob' matches paths. " +
|
|
143
|
-
"Server-side — avoids round-trip explosion from ls+read patterns.",
|
|
144
|
-
inputSchema: zodToJsonSchema(SearchInput),
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
name: "move_file",
|
|
148
|
-
description: "Move or rename a file. Sidecar (.proof/*.json) is moved automatically for .md files.",
|
|
149
|
-
inputSchema: zodToJsonSchema(MoveFileInput),
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
name: "delete_file",
|
|
153
|
-
description: "Delete a file. Requires 'delete' scope. You must have read the file first " +
|
|
154
|
-
"(its sha is sent as If-Match). .md sidecars are removed automatically.",
|
|
155
|
-
inputSchema: zodToJsonSchema(DeleteFileInput),
|
|
156
|
-
},
|
|
157
|
-
];
|
|
158
|
-
// ─── Handler helpers ──────────────────────────────────────────────────────────
|
|
159
|
-
function isMd(path) {
|
|
160
|
-
return path.endsWith(".md") || path.endsWith(".markdown");
|
|
161
|
-
}
|
|
162
|
-
function collabActiveMessage(path, snapshotUrl) {
|
|
163
|
-
const tier2 = snapshotUrl
|
|
164
|
-
? `\nTier-2 block-ops snapshot: ${snapshotUrl}`
|
|
165
|
-
: "";
|
|
166
|
-
return (`⚠️ COLLAB ACTIVE: "${path}" is being actively collaborated on by a human.\n` +
|
|
167
|
-
`Raw writes are blocked to protect pending review artifacts.\n` +
|
|
168
|
-
`→ Use wiki-viewer Tier-2 block-ops (POST /api/agent/files/<path>.md with block.replace / suggestion.*) so your edit becomes a reviewable suggestion.${tier2}\n` +
|
|
169
|
-
`→ Alternatively, re-read the file and pass ifCollabMatch with the current X-Collab-Revision if you have confirmed with the human that a direct raw write is intended.`);
|
|
170
|
-
}
|
|
171
|
-
function ifMatchMismatchMessage(path) {
|
|
172
|
-
return (`412 If-Match mismatch for "${path}" — the file changed since you last read it.\n` +
|
|
173
|
-
`Re-read the file with read_file to get the current content and sha, then retry.`);
|
|
174
|
-
}
|
|
175
|
-
function ok(text) {
|
|
176
|
-
return { content: [{ type: "text", text }] };
|
|
177
|
-
}
|
|
178
|
-
function err(text) {
|
|
179
|
-
return { content: [{ type: "text", text: `ERROR: ${text}` }] };
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Check cached collab state before a write.
|
|
183
|
-
* Returns a blocking error message if write should not proceed, or null if ok.
|
|
184
|
-
*/
|
|
185
|
-
function checkCollabBlock(path) {
|
|
186
|
-
if (!isMd(path))
|
|
187
|
-
return null;
|
|
188
|
-
const cached = stateCache.get(path);
|
|
189
|
-
if (!cached)
|
|
190
|
-
return null; // no prior read — let server enforce
|
|
191
|
-
if (cached.collabState === "active") {
|
|
192
|
-
return collabActiveMessage(path, cached.collabSnapshot);
|
|
193
|
-
}
|
|
194
|
-
return null;
|
|
195
|
-
}
|
|
196
|
-
// ─── Server factory ───────────────────────────────────────────────────────────
|
|
197
|
-
export function createServer(client) {
|
|
198
|
-
const server = new Server({ name: "wiki-viewer-mcp", version: "0.1.0" }, { capabilities: { tools: {} } });
|
|
199
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
200
|
-
tools: TOOLS,
|
|
201
|
-
}));
|
|
202
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
203
|
-
const { name, arguments: args } = request.params;
|
|
204
|
-
try {
|
|
205
|
-
switch (name) {
|
|
206
|
-
// ── read_file ───────────────────────────────────────────────────────
|
|
207
|
-
case "read_file": {
|
|
208
|
-
const { path, range } = ReadFileInput.parse(args);
|
|
209
|
-
const result = await client.readFile(path, range);
|
|
210
|
-
const collabNote = result.collabState !== "not-markdown"
|
|
211
|
-
? `\nX-Collab-State: ${result.collabState}` +
|
|
212
|
-
(result.collabRevision !== null ? `\nX-Collab-Revision: ${result.collabRevision}` : "") +
|
|
213
|
-
(result.collabSnapshot ? `\nX-Collab-Snapshot: ${result.collabSnapshot}` : "") +
|
|
214
|
-
(result.collabState === "active"
|
|
215
|
-
? "\n⚠️ File is COLLAB ACTIVE — use block-ops for edits so human can review."
|
|
216
|
-
: result.collabState === "tracked"
|
|
217
|
-
? "\nFile is tracked — prefer block-ops for prose/semantic edits."
|
|
218
|
-
: "")
|
|
219
|
-
: "";
|
|
220
|
-
if (result.text !== null) {
|
|
221
|
-
return ok(`File: ${path}\nSize: ${result.size} bytes | ETag: ${result.sha256}${collabNote}\n\n${result.text}`);
|
|
222
|
-
}
|
|
223
|
-
else {
|
|
224
|
-
return ok(`File: ${path}\nSize: ${result.size} bytes | ETag: ${result.sha256}\nContent-Type: ${result.contentType} (binary — use range reads for partial content)${collabNote}`);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
// ── write_file ──────────────────────────────────────────────────────
|
|
228
|
-
case "write_file": {
|
|
229
|
-
const { path, content, mkdirs, force, ifCollabMatch } = WriteFileInput.parse(args);
|
|
230
|
-
// Client-side collab guard
|
|
231
|
-
const block = checkCollabBlock(path);
|
|
232
|
-
if (block)
|
|
233
|
-
return err(block);
|
|
234
|
-
const cached = stateCache.get(path);
|
|
235
|
-
const ifMatch = cached?.sha256;
|
|
236
|
-
const result = await client.writeFile(path, content, {
|
|
237
|
-
ifMatch,
|
|
238
|
-
mkdirs,
|
|
239
|
-
force,
|
|
240
|
-
ifCollabMatch,
|
|
241
|
-
});
|
|
242
|
-
return ok(`Written: ${path}\nSha256: ${result.sha256}\nSize: ${result.size} bytes\n${result.created ? "Created (new file)" : "Overwritten"}`);
|
|
243
|
-
}
|
|
244
|
-
// ── edit_file ───────────────────────────────────────────────────────
|
|
245
|
-
case "edit_file": {
|
|
246
|
-
const { path, find, replace } = EditFileInput.parse(args);
|
|
247
|
-
// Client-side collab guard
|
|
248
|
-
const block = checkCollabBlock(path);
|
|
249
|
-
if (block)
|
|
250
|
-
return err(block);
|
|
251
|
-
// Best path: server-side PATCH str-replace — sends only {find,replace}
|
|
252
|
-
// (~hundreds of bytes) instead of the whole file. One small request.
|
|
253
|
-
// Requires a known sha (If-Match); use cached sha if present, else the
|
|
254
|
-
// server's 412-recover path handles it. Falls back to read+PUT if the
|
|
255
|
-
// server has no PATCH route (older version).
|
|
256
|
-
const cachedForPatch = stateCache.get(path);
|
|
257
|
-
if (cachedForPatch?.collabState !== "active") {
|
|
258
|
-
try {
|
|
259
|
-
const r = await client.patchFile(path, find, replace, {
|
|
260
|
-
ifMatch: cachedForPatch?.sha256,
|
|
261
|
-
});
|
|
262
|
-
return ok(`Edited: ${path}\nReplaced ${JSON.stringify(find)} → ${JSON.stringify(replace)}\nNew sha256: ${r.sha256}`);
|
|
263
|
-
}
|
|
264
|
-
catch (e) {
|
|
265
|
-
if (e instanceof MatchCountError) {
|
|
266
|
-
return err(`edit_file: expected to replace exactly 1 occurrence of ${JSON.stringify(find)} in "${path}", ` +
|
|
267
|
-
`but found ${e.found}. Re-read the file or make the search string unique.`);
|
|
268
|
-
}
|
|
269
|
-
if (e instanceof CollabActiveError) {
|
|
270
|
-
return err(collabActiveMessage(path, e.snapshotUrl));
|
|
271
|
-
}
|
|
272
|
-
if (e instanceof IfMatchError) {
|
|
273
|
-
// sha was stale — fall through to read+retry below.
|
|
274
|
-
}
|
|
275
|
-
else if (!(e instanceof PatchUnsupportedError)) {
|
|
276
|
-
throw e;
|
|
277
|
-
}
|
|
278
|
-
// PatchUnsupportedError or stale If-Match → fall back to read+PUT.
|
|
279
|
-
}
|
|
280
|
-
}
|
|
281
|
-
// Fallback path: read → transform → PUT with If-Match.
|
|
282
|
-
const readResult = await client.readFile(path);
|
|
283
|
-
if (readResult.text === null) {
|
|
284
|
-
return err(`edit_file: "${path}" appears to be binary — cannot do text replacement.`);
|
|
285
|
-
}
|
|
286
|
-
if (readResult.collabState === "active") {
|
|
287
|
-
return err(collabActiveMessage(path, readResult.collabSnapshot));
|
|
288
|
-
}
|
|
289
|
-
if (!readResult.text.includes(find)) {
|
|
290
|
-
return err(`edit_file: string not found in "${path}".\n` +
|
|
291
|
-
`Search for: ${JSON.stringify(find)}\n` +
|
|
292
|
-
`Tip: re-read the file to see current content.`);
|
|
293
|
-
}
|
|
294
|
-
const newContent = readResult.text.replace(find, replace);
|
|
295
|
-
const writeResult = await client.writeFile(path, newContent, {
|
|
296
|
-
ifMatch: readResult.sha256,
|
|
297
|
-
});
|
|
298
|
-
return ok(`Edited: ${path}\nReplaced ${JSON.stringify(find)} → ${JSON.stringify(replace)}\nNew sha256: ${writeResult.sha256}`);
|
|
299
|
-
}
|
|
300
|
-
// ── list_directory ──────────────────────────────────────────────────
|
|
301
|
-
case "list_directory": {
|
|
302
|
-
const { path, recursive, depth, limit } = ListDirectoryInput.parse(args);
|
|
303
|
-
const entries = await client.listDirectory(path, { recursive, depth, limit });
|
|
304
|
-
const lines = entries.map((e) => `${e.type === "directory" ? "DIR " : "FILE"} ${e.path}` +
|
|
305
|
-
(e.size !== null ? ` (${e.size}b)` : "") +
|
|
306
|
-
(e.mtime ? ` [${e.mtime}]` : ""));
|
|
307
|
-
return ok(lines.length > 0 ? lines.join("\n") : "(empty directory)");
|
|
308
|
-
}
|
|
309
|
-
// ── search ──────────────────────────────────────────────────────────
|
|
310
|
-
case "search": {
|
|
311
|
-
const body = SearchInput.parse(args);
|
|
312
|
-
const result = await client.search(body);
|
|
313
|
-
if (result.matches.length === 0) {
|
|
314
|
-
return ok("No matches found.");
|
|
315
|
-
}
|
|
316
|
-
const lines = result.matches.map((m) => {
|
|
317
|
-
if (result.kind === "grep" && m.line !== undefined) {
|
|
318
|
-
return `${m.path}:${m.line}: ${m.text ?? ""}`;
|
|
319
|
-
}
|
|
320
|
-
return m.path;
|
|
321
|
-
});
|
|
322
|
-
return ok(`${result.matches.length} match(es):\n${lines.join("\n")}`);
|
|
323
|
-
}
|
|
324
|
-
// ── move_file ───────────────────────────────────────────────────────
|
|
325
|
-
case "move_file": {
|
|
326
|
-
const { from, to } = MoveFileInput.parse(args);
|
|
327
|
-
const cached = stateCache.get(from);
|
|
328
|
-
await client.moveFile(from, to, cached?.sha256);
|
|
329
|
-
return ok(`Moved: ${from} → ${to}`);
|
|
330
|
-
}
|
|
331
|
-
// ── delete_file ─────────────────────────────────────────────────────
|
|
332
|
-
case "delete_file": {
|
|
333
|
-
const { path, recursive, force } = DeleteFileInput.parse(args);
|
|
334
|
-
const cached = stateCache.get(path);
|
|
335
|
-
if (!cached?.sha256) {
|
|
336
|
-
return err(`delete_file: no cached sha for "${path}" — read the file first with read_file so the current sha can be sent as If-Match.`);
|
|
337
|
-
}
|
|
338
|
-
await client.deleteFile(path, cached.sha256, { recursive, force });
|
|
339
|
-
return ok(`Deleted: ${path}`);
|
|
340
|
-
}
|
|
341
|
-
default:
|
|
342
|
-
return err(`Unknown tool: ${name}`);
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
catch (e) {
|
|
346
|
-
if (e instanceof IfMatchError) {
|
|
347
|
-
return err(ifMatchMismatchMessage(e.message.match(/"([^"]+)"/)?.at(1) ?? "file"));
|
|
348
|
-
}
|
|
349
|
-
if (e instanceof CollabActiveError) {
|
|
350
|
-
return err(collabActiveMessage(e.message, e.snapshotUrl));
|
|
351
|
-
}
|
|
352
|
-
if (e instanceof WikiViewerError) {
|
|
353
|
-
return err(`wiki-viewer error ${e.status} (${e.code}): ${e.message}`);
|
|
354
|
-
}
|
|
355
|
-
if (e instanceof z.ZodError) {
|
|
356
|
-
return err(`Invalid arguments: ${e.message}`);
|
|
357
|
-
}
|
|
358
|
-
throw e; // unexpected — let MCP transport handle
|
|
359
|
-
}
|
|
360
|
-
});
|
|
361
|
-
return server;
|
|
362
|
-
}
|
|
363
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
364
|
-
function zodToJsonSchema(schema) {
|
|
365
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
366
|
-
const shape = schema.shape;
|
|
367
|
-
const properties = {};
|
|
368
|
-
const required = [];
|
|
369
|
-
for (const [key, val] of Object.entries(shape)) {
|
|
370
|
-
const v = val;
|
|
371
|
-
const isOptional = v._def.type === "optional";
|
|
372
|
-
const inner = isOptional ? (v.unwrap ? v.unwrap() : v._def.innerType ?? v) : v;
|
|
373
|
-
properties[key] = buildJsonSchema(inner);
|
|
374
|
-
if (!isOptional)
|
|
375
|
-
required.push(key);
|
|
376
|
-
}
|
|
377
|
-
return { type: "object", properties, required };
|
|
378
|
-
}
|
|
379
|
-
function buildJsonSchema(val) {
|
|
380
|
-
const desc = val.description ?? val._def.description;
|
|
381
|
-
const withDesc = (s) => { if (desc)
|
|
382
|
-
s["description"] = desc; return s; };
|
|
383
|
-
switch (val._def.type) {
|
|
384
|
-
case "string": return withDesc({ type: "string" });
|
|
385
|
-
case "number": return withDesc({ type: "number" });
|
|
386
|
-
case "boolean": return withDesc({ type: "boolean" });
|
|
387
|
-
case "enum": {
|
|
388
|
-
const opts = val.options ?? Object.keys(val._def.entries ?? {});
|
|
389
|
-
return withDesc({ type: "string", enum: opts });
|
|
390
|
-
}
|
|
391
|
-
case "optional": return buildJsonSchema(val.unwrap ? val.unwrap() : val._def.innerType ?? val);
|
|
392
|
-
default: return withDesc({ type: "string" });
|
|
393
|
-
}
|
|
394
|
-
}
|
|
395
|
-
// ─── Entrypoints ─────────────────────────────────────────────────────────────
|
|
396
|
-
async function main() {
|
|
397
|
-
await enableKeepAlive();
|
|
398
|
-
const client = createClient();
|
|
399
|
-
const server = createServer(client);
|
|
400
|
-
const transport = new StdioServerTransport();
|
|
401
|
-
await server.connect(transport);
|
|
402
|
-
// Server runs until stdin closes
|
|
403
|
-
}
|
|
404
|
-
/**
|
|
405
|
-
* CLI entry: routes to `register` subcommand or MCP stdio server.
|
|
406
|
-
* Only called when the file is the actual entry point (not imported in tests).
|
|
407
|
-
*/
|
|
408
|
-
async function runCli() {
|
|
409
|
-
// Detect subcommand: first positional arg
|
|
410
|
-
const positional = process.argv.slice(2).filter((a) => !a.startsWith("-"));
|
|
411
|
-
const subcommand = positional[0];
|
|
412
|
-
if (subcommand === "register") {
|
|
413
|
-
await runRegister();
|
|
414
|
-
}
|
|
415
|
-
else {
|
|
416
|
-
await main();
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
async function runRegister() {
|
|
420
|
-
const { values } = parseArgs({
|
|
421
|
-
args: process.argv.slice(2),
|
|
422
|
-
options: {
|
|
423
|
-
url: { type: "string" },
|
|
424
|
-
id: { type: "string" },
|
|
425
|
-
name: { type: "string" },
|
|
426
|
-
"scope-paths": { type: "string", default: "**/*" },
|
|
427
|
-
ops: { type: "string", default: "read,mutate" },
|
|
428
|
-
timeout: { type: "string", default: "300" },
|
|
429
|
-
workspace: { type: "string" },
|
|
430
|
-
},
|
|
431
|
-
allowPositionals: true,
|
|
432
|
-
});
|
|
433
|
-
if (!values.url) {
|
|
434
|
-
console.error("Error: --url is required (e.g. https://notes.example.com)");
|
|
435
|
-
process.exit(1);
|
|
436
|
-
}
|
|
437
|
-
if (!values.id) {
|
|
438
|
-
console.error("Error: --id is required (e.g. ai:myagent)");
|
|
439
|
-
process.exit(1);
|
|
440
|
-
}
|
|
441
|
-
if (!values.name) {
|
|
442
|
-
console.error("Error: --name is required (e.g. \"My Agent\")");
|
|
443
|
-
process.exit(1);
|
|
444
|
-
}
|
|
445
|
-
if (!values.id.match(/^ai:[a-z][a-z0-9-]{0,30}$/)) {
|
|
446
|
-
console.error("Error: --id must match ^ai:[a-z][a-z0-9-]{0,30}$ (e.g. ai:myagent)");
|
|
447
|
-
process.exit(1);
|
|
448
|
-
}
|
|
449
|
-
const scopePaths = (values["scope-paths"] ?? "**/*").split(",").map((p) => p.trim());
|
|
450
|
-
const rawOps = (values.ops ?? "read,mutate").split(",").map((o) => o.trim());
|
|
451
|
-
const validOps = ["read", "mutate", "delete"];
|
|
452
|
-
const ops = rawOps.filter((o) => validOps.includes(o));
|
|
453
|
-
if (ops.length === 0) {
|
|
454
|
-
console.error("Error: --ops must include at least one of: read, mutate, delete");
|
|
455
|
-
process.exit(1);
|
|
456
|
-
}
|
|
457
|
-
const scope = { paths: scopePaths, ops };
|
|
458
|
-
const timeoutMs = parseInt(values.timeout ?? "300", 10) * 1000;
|
|
459
|
-
console.log(`Registering agent ${values.id} with ${values.url} …`);
|
|
460
|
-
console.log(`Scope: paths=${JSON.stringify(scopePaths)}, ops=${JSON.stringify(ops)}`);
|
|
461
|
-
console.log();
|
|
462
|
-
try {
|
|
463
|
-
const result = await register({
|
|
464
|
-
baseUrl: values.url,
|
|
465
|
-
id: values.id,
|
|
466
|
-
displayName: values.name,
|
|
467
|
-
scope,
|
|
468
|
-
timeoutMs,
|
|
469
|
-
onPending: (_id, attempt) => {
|
|
470
|
-
if (attempt === 1) {
|
|
471
|
-
console.log(`⏳ Waiting for approval. Open the wiki-viewer AI Panel and approve agent "${values.id}".`);
|
|
472
|
-
}
|
|
473
|
-
else if (attempt % 10 === 0) {
|
|
474
|
-
console.log(` Still waiting… (${attempt * 3}s elapsed)`);
|
|
475
|
-
}
|
|
476
|
-
},
|
|
477
|
-
});
|
|
478
|
-
console.log();
|
|
479
|
-
console.log("✅ Approved!");
|
|
480
|
-
console.log();
|
|
481
|
-
console.log(`Agent ID : ${result.agentId}`);
|
|
482
|
-
console.log(`Token : ${result.token}`);
|
|
483
|
-
console.log();
|
|
484
|
-
console.log("Paste this into your mcp.json:");
|
|
485
|
-
console.log();
|
|
486
|
-
console.log(JSON.stringify({
|
|
487
|
-
servers: {
|
|
488
|
-
"wiki-viewer": {
|
|
489
|
-
command: "npx",
|
|
490
|
-
args: ["wiki-viewer-mcp"],
|
|
491
|
-
env: {
|
|
492
|
-
WIKI_VIEWER_URL: values.url,
|
|
493
|
-
WIKI_VIEWER_TOKEN: result.token,
|
|
494
|
-
WIKI_VIEWER_AGENT_ID: result.agentId,
|
|
495
|
-
...(values.workspace ? { WIKI_VIEWER_WORKSPACE: values.workspace } : {}),
|
|
496
|
-
},
|
|
497
|
-
},
|
|
498
|
-
},
|
|
499
|
-
}, null, 2));
|
|
500
|
-
process.exit(0);
|
|
501
|
-
}
|
|
502
|
-
catch (e) {
|
|
503
|
-
if (e instanceof RegistrationDeniedError ||
|
|
504
|
-
e instanceof RegistrationExpiredError ||
|
|
505
|
-
e instanceof RegistrationTimeoutError) {
|
|
506
|
-
console.error(`\n❌ ${e.message}`);
|
|
507
|
-
}
|
|
508
|
-
else {
|
|
509
|
-
console.error("\n❌ Unexpected error:", e);
|
|
510
|
-
}
|
|
511
|
-
process.exit(1);
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
// Only auto-start when this file is the entry point, not when imported in tests.
|
|
515
|
-
if (process.argv[1] && import.meta.url.endsWith(process.argv[1].replace(/\/dist\//, "/src/").replace(/\.js$/, ".ts"))) {
|
|
516
|
-
runCli().catch((e) => {
|
|
517
|
-
console.error("wiki-viewer-mcp fatal:", e);
|
|
518
|
-
process.exit(1);
|
|
519
|
-
});
|
|
520
|
-
}
|
|
521
|
-
else if (
|
|
522
|
-
// Also run when invoked as the compiled binary
|
|
523
|
-
process.argv[1] &&
|
|
524
|
-
(process.argv[1].endsWith("wiki-viewer-mcp") || process.argv[1].endsWith("index.js")) &&
|
|
525
|
-
!process.argv[1].includes("__tests__")) {
|
|
526
|
-
runCli().catch((e) => {
|
|
527
|
-
console.error("wiki-viewer-mcp fatal:", e);
|
|
528
|
-
process.exit(1);
|
|
529
|
-
});
|
|
530
|
-
}
|
|
531
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* TOFU registration flow for wiki-viewer.
|
|
3
|
-
*
|
|
4
|
-
* Pure function `register()` is testable with a mock fetch.
|
|
5
|
-
* The CLI wrapper lives in index.ts.
|
|
6
|
-
*
|
|
7
|
-
* Flow:
|
|
8
|
-
* POST /api/agent/register → {registrationId, pollUrl, status:"pending"}
|
|
9
|
-
* human approves in AI Panel
|
|
10
|
-
* GET <pollUrl> → 202 pending | 200 approved | 410 denied | 404 expired
|
|
11
|
-
* returns {token, agentId}
|
|
12
|
-
*/
|
|
13
|
-
export async function register(opts) {
|
|
14
|
-
const _fetch = opts.fetch ?? globalThis.fetch;
|
|
15
|
-
const pollIntervalMs = opts.pollIntervalMs ?? 3_000;
|
|
16
|
-
const timeoutMs = opts.timeoutMs ?? 300_000;
|
|
17
|
-
const base = opts.baseUrl.replace(/\/$/, "");
|
|
18
|
-
// ── Step 1: POST registration ──────────────────────────────────────────────
|
|
19
|
-
const postRes = await _fetch(`${base}/api/agent/register`, {
|
|
20
|
-
method: "POST",
|
|
21
|
-
headers: { "Content-Type": "application/json" },
|
|
22
|
-
body: JSON.stringify({
|
|
23
|
-
id: opts.id,
|
|
24
|
-
displayName: opts.displayName,
|
|
25
|
-
scope: opts.scope,
|
|
26
|
-
}),
|
|
27
|
-
});
|
|
28
|
-
if (!postRes.ok) {
|
|
29
|
-
const body = await postRes.text().catch(() => "");
|
|
30
|
-
throw new Error(`Registration request failed (${postRes.status}): ${body}`);
|
|
31
|
-
}
|
|
32
|
-
const { registrationId, pollUrl } = await postRes.json();
|
|
33
|
-
// Resolve pollUrl — may be absolute or relative
|
|
34
|
-
const resolvedPollUrl = pollUrl.startsWith("http")
|
|
35
|
-
? pollUrl
|
|
36
|
-
: `${base}${pollUrl.startsWith("/") ? "" : "/"}${pollUrl}`;
|
|
37
|
-
// ── Step 2: Poll until approved / denied / timeout ─────────────────────────
|
|
38
|
-
const deadline = Date.now() + timeoutMs;
|
|
39
|
-
let attempt = 0;
|
|
40
|
-
while (Date.now() < deadline) {
|
|
41
|
-
await sleep(pollIntervalMs);
|
|
42
|
-
attempt++;
|
|
43
|
-
const pollRes = await _fetch(resolvedPollUrl);
|
|
44
|
-
if (pollRes.status === 200) {
|
|
45
|
-
const body = await pollRes.json();
|
|
46
|
-
if (body.status === "approved" && body.agentId && body.token) {
|
|
47
|
-
return { token: body.token, agentId: body.agentId };
|
|
48
|
-
}
|
|
49
|
-
if (body.status === "denied") {
|
|
50
|
-
throw new RegistrationDeniedError("Registration denied by the operator.");
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else if (pollRes.status === 202) {
|
|
54
|
-
// Still pending — fire callback and loop
|
|
55
|
-
opts.onPending?.(registrationId, attempt);
|
|
56
|
-
}
|
|
57
|
-
else if (pollRes.status === 410) {
|
|
58
|
-
const body = await pollRes.json().catch(() => ({}));
|
|
59
|
-
throw new RegistrationDeniedError(`Registration ${body.status ?? "denied/consumed"} — it can no longer be approved.`);
|
|
60
|
-
}
|
|
61
|
-
else if (pollRes.status === 404) {
|
|
62
|
-
throw new RegistrationExpiredError("Registration expired (404). Try registering again.");
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
throw new Error(`Unexpected poll status ${pollRes.status}.`);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
throw new RegistrationTimeoutError(`Timed out after ${Math.round(timeoutMs / 1000)}s. ` +
|
|
69
|
-
`The request may still be pending in the wiki-viewer AI Panel (id: ${registrationId}).`);
|
|
70
|
-
}
|
|
71
|
-
// ── Typed errors ──────────────────────────────────────────────────────────────
|
|
72
|
-
export class RegistrationDeniedError extends Error {
|
|
73
|
-
constructor(message) {
|
|
74
|
-
super(message);
|
|
75
|
-
this.name = "RegistrationDeniedError";
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
export class RegistrationExpiredError extends Error {
|
|
79
|
-
constructor(message) {
|
|
80
|
-
super(message);
|
|
81
|
-
this.name = "RegistrationExpiredError";
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
export class RegistrationTimeoutError extends Error {
|
|
85
|
-
constructor(message) {
|
|
86
|
-
super(message);
|
|
87
|
-
this.name = "RegistrationTimeoutError";
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
// ── Helpers ───────────────────────────────────────────────────────────────────
|
|
91
|
-
function sleep(ms) {
|
|
92
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
93
|
-
}
|
|
94
|
-
//# sourceMappingURL=register.js.map
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Per-path cache for last-known file metadata from GET responses.
|
|
3
|
-
* Drives If-Match and collab-state checks on subsequent writes.
|
|
4
|
-
*/
|
|
5
|
-
/** Don't cache bodies larger than this (avoid unbounded memory). */
|
|
6
|
-
export const MAX_CACHED_BODY_BYTES = 256 * 1024;
|
|
7
|
-
const cache = new Map();
|
|
8
|
-
export function set(path, state) {
|
|
9
|
-
cache.set(normalisePath(path), state);
|
|
10
|
-
}
|
|
11
|
-
export function get(path) {
|
|
12
|
-
return cache.get(normalisePath(path));
|
|
13
|
-
}
|
|
14
|
-
export function del(path) {
|
|
15
|
-
cache.delete(normalisePath(path));
|
|
16
|
-
}
|
|
17
|
-
export function rename(from, to) {
|
|
18
|
-
const s = cache.get(normalisePath(from));
|
|
19
|
-
if (s) {
|
|
20
|
-
cache.delete(normalisePath(from));
|
|
21
|
-
cache.set(normalisePath(to), s);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
/** Normalise leading slash away so 'foo/bar' and '/foo/bar' are the same key */
|
|
25
|
-
function normalisePath(p) {
|
|
26
|
-
return p.replace(/^\/+/, "");
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=state-cache.js.map
|