wiki-viewer 1.7.1 → 1.8.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/app-path-routes-manifest.json +7 -0
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +32 -3
- package/.next/standalone/.next/routes-manifest.json +46 -0
- package/.next/standalone/.next/server/app/_global-error.html +1 -1
- package/.next/standalone/.next/server/app/_global-error.rsc +2 -2
- 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 +2 -2
- 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 +4 -4
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
- 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/admin/agents/[agentId]/revoke/route.js +6 -6
- package/.next/standalone/.next/server/app/api/agent/admin/agents/[agentId]/revoke/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/admin/agents/route.js +6 -6
- package/.next/standalone/.next/server/app/api/agent/admin/agents/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/admin/registrations/[regId]/approve/route.js +7 -7
- package/.next/standalone/.next/server/app/api/agent/admin/registrations/[regId]/approve/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/admin/registrations/[regId]/deny/route.js +5 -5
- package/.next/standalone/.next/server/app/api/agent/admin/registrations/[regId]/deny/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/admin/registrations/route.js +5 -5
- package/.next/standalone/.next/server/app/api/agent/admin/registrations/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/agent/events/[...path]/route.js +8 -7
- 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 -8
- 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 -7
- 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 +7 -7
- 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 +6 -5
- 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 +7 -6
- 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 +6 -5
- 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 +8 -7
- 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 +2 -2
- 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 +8 -2
- package/.next/standalone/.next/server/app/api/assets/[...path]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/[...all]/route.js +5 -5
- package/.next/standalone/.next/server/app/api/auth/[...all]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/admins/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/system/admins/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/system/admins/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/system/admins/route.js +14 -0
- package/.next/standalone/.next/server/app/api/system/admins/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/system/admins/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/system/admins/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/system/auth-config/route.js +6 -6
- package/.next/standalone/.next/server/app/api/system/auth-config/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/auth-settings/route.js +4 -4
- package/.next/standalone/.next/server/app/api/system/auth-settings/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/browse/route.js +4 -4
- 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 +5 -5
- package/.next/standalone/.next/server/app/api/system/clear-root/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/config/route.js +6 -6
- package/.next/standalone/.next/server/app/api/system/config/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/pins/route.js +4 -4
- package/.next/standalone/.next/server/app/api/system/pins/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 +5 -5
- 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 -6
- package/.next/standalone/.next/server/app/api/system/set-root/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/users/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/system/users/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/system/users/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/system/users/route.js +14 -0
- package/.next/standalone/.next/server/app/api/system/users/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/system/users/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/system/users/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/open/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/open/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/open/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/open/route.js +14 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/open/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/open/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/open/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/route.js +14 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/[id]/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/route.js +14 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/system/workspaces/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/upload/[...path]/route.js +8 -2
- 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 +5 -5
- package/.next/standalone/.next/server/app/api/wiki/app/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/content/route.js +6 -6
- 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 +7 -7
- 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 +8 -2
- 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 +6 -6
- package/.next/standalone/.next/server/app/api/wiki/folder/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 +7 -7
- package/.next/standalone/.next/server/app/api/wiki/new-file/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/page/route.js +7 -7
- 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 +7 -7
- 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 +6 -6
- package/.next/standalone/.next/server/app/api/wiki/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/wiki/search/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/wiki/search/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/wiki/search/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/wiki/search/route.js +15 -0
- package/.next/standalone/.next/server/app/api/wiki/search/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/wiki/search/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/wiki/search/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/wiki/slugs/route.js +6 -6
- 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 +7 -7
- 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 +7 -9
- 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 +5 -5
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +5 -5
- 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/manifest.webmanifest/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/manifest.webmanifest/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/manifest.webmanifest/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/manifest.webmanifest/route.js +9 -0
- package/.next/standalone/.next/server/app/manifest.webmanifest/route.js.map +5 -0
- package/.next/standalone/.next/server/app/manifest.webmanifest/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/manifest.webmanifest.body +1 -0
- package/.next/standalone/.next/server/app/manifest.webmanifest.meta +1 -0
- 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/signin/page.js +1 -1
- package/.next/standalone/.next/server/app/signin/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/signin/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +7 -0
- package/.next/standalone/.next/server/chunks/0p91_next_dist_1195ub1._.js +18 -0
- package/.next/standalone/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_0d2jbo5.js +1 -1
- package/.next/standalone/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_0ytral2.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0-244bv._.js +16 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0xz-_0v._.js → [root-of-the-server]__0-inabx._.js} +2 -2
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0-ao6a_._.js → [root-of-the-server]__0.-9jt0._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0~-r-8f._.js → [root-of-the-server]__00c1-dr._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__00lep-u._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__00mtevo._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__00qu86p._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__012753j._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__01hp8ax._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0jhr.ex._.js → [root-of-the-server]__02n6z97._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__036mhjp._.js +5 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__03p0ob1._.js +16 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__05t~v6l._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__068ni_k._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06yp.08._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__082nhm6._.js → [root-of-the-server]__07vphbd._.js} +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0pg6dn-._.js → [root-of-the-server]__08lkuwa._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__09cqzem._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0p_ox-k._.js → [root-of-the-server]__09k4q9e._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0_0_601._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ae3dk6._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0s28.4-._.js → [root-of-the-server]__0af-x45._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0cqu-wm._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d75a5q._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d7x3e1._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d7zxm_._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0e7vs98._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0fxzg4v._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0gda_iu._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0hu~q20._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0jk1uf4._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0l-8clq._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0lhka0x._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0kdn1le._.js → [root-of-the-server]__0na11h0._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0nd.b_c._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0otb8ra._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0p0-p__._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0piofm3._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0rrf-jr._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0s6_lzw._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0sh13v5._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ta~flu._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0v4im4p._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0qn8e~s._.js → [root-of-the-server]__0v_kyp-._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0vatqe-._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0vdb2nr._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0wdh63w._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0z3wg9x._.js +12 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0mzo03s._.js → [root-of-the-server]__0~.-3yk._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__123._fe._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__12800b1._.js → [root-of-the-server]__12ee_s6._.js} +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__12onytt._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__04udrya._.js → [root-of-the-server]__12q8ch8._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1377.79._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__1378-ox._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__13aid91._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__13hp4tw._.js +12 -0
- package/.next/standalone/.next/server/chunks/_079xuln._.js +1 -1
- package/.next/standalone/.next/server/chunks/_0dr1r1g._.js +452 -0
- package/.next/standalone/.next/server/chunks/_101exke._.js +452 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_system_admins_route_actions_0dsm7cx.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_system_users_route_actions_0whj5cy.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_system_workspaces_[id]_open_route_actions_1087xu7.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_system_workspaces_[id]_route_actions_0~h7-8s.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_system_workspaces_route_actions_0mkalc3.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_wiki_search_route_actions_0inxu93.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_manifest_webmanifest_route_actions_04wfv0d.js +3 -0
- package/.next/standalone/.next/server/chunks/node_modules__pnpm_0aj5g-w._.js +1 -1
- package/.next/standalone/.next/server/chunks/src_lib_search_0d-_j3u._.js +46 -0
- package/.next/standalone/.next/server/chunks/src_lib_search_0ymmp0c._.js +46 -0
- package/.next/standalone/.next/server/chunks/ssr/0p91_next_dist_esm_build_templates_app-page_042apsk.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/0p91_next_dist_esm_build_templates_app-page_08q3u1e.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/0p91_next_dist_esm_build_templates_app-page_0nflz3~.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/0p91_next_dist_esm_build_templates_app-page_0p5k29e.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{0~w0_katex_dist_katex_mjs_0b8ra51._.js → 0~w0_katex_dist_katex_mjs_04mhawr._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_erDiagram-TEJ5UH35_mjs_0v6rnqy._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_mermaid_core_mjs_0hj_n-~._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0btcd4o._.js → [root-of-the-server]__02twzph._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{[root-of-the-server]__0ytvlzs._.js → [root-of-the-server]__09~x2v~._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0hvvps3._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0pqaawz._.js +18 -18
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0c71i8a._.js → node_modules__pnpm_0.96tmo._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0lm8e2c._.js → node_modules__pnpm_011vy_q._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0ezm2us._.js → node_modules__pnpm_01o_5qt._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0j3mvgg._.js → node_modules__pnpm_04n0h6.._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0~ln0by._.js → node_modules__pnpm_093dp2q._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_11e~j49._.js → node_modules__pnpm_09ej62_._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0de8xt-._.js → node_modules__pnpm_09ljbdz._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0-x6zex._.js → node_modules__pnpm_09~_ob2._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0yq5z.h._.js → node_modules__pnpm_0a01ng7._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0kwc-vs._.js → node_modules__pnpm_0b8qx0g._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0hrbz84._.js → node_modules__pnpm_0bbc---._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0hobcbs._.js → node_modules__pnpm_0c.309.._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0rw91-f._.js → node_modules__pnpm_0c8aunj._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0o.c1z8._.js → node_modules__pnpm_0hk6xys._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0dboa_e._.js → node_modules__pnpm_0hlzy8f._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0j53hti._.js → node_modules__pnpm_0nw5ou2._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0xrmzh1._.js → node_modules__pnpm_0o.dn8o._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0cxwhfd._.js → node_modules__pnpm_0s0ur~d._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_07rxv2x._.js → node_modules__pnpm_0shlang._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0i.pw_m._.js → node_modules__pnpm_0sq3c2r._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0ajzar9._.js → node_modules__pnpm_0t9jb7d._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_012nt.s._.js → node_modules__pnpm_0wmx9kq._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0z~h2ow._.js → node_modules__pnpm_0xfx0sf._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0cbsnwf._.js → node_modules__pnpm_0yiz.-t._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0bum3-3._.js → node_modules__pnpm_11sut1u._.js} +1 -1
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0mdo4i3._.js → node_modules__pnpm_124u4o2._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/{node_modules__pnpm_0il8j.j._.js → node_modules__pnpm_13tajgx._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/src_app_signin_00yk0vm._.js +2 -2
- package/.next/standalone/.next/server/edge/chunks/{08yl_next_dist_esm_build_templates_edge-wrapper_0o9h3w_.js → 08yl_next_dist_esm_build_templates_edge-wrapper_0xbpts6.js} +2 -2
- package/.next/standalone/.next/server/edge/chunks/[root-of-the-server]__0.pmgt2._.js +3 -0
- package/.next/standalone/.next/server/functions-config-manifest.json +6 -0
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/middleware-manifest.json +8 -8
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/0c_~zevf2n0r4.css +2 -0
- package/.next/standalone/.next/static/chunks/0l4842ez-0_66.js +129 -0
- package/.next/standalone/README.md +46 -2
- package/.next/standalone/docs/workspacing-plan.md +364 -0
- package/.next/standalone/package.json +2 -2
- package/.next/standalone/packages/wiki-viewer-mcp/package.json +1 -1
- package/.next/standalone/public/icon-192.png +0 -0
- package/.next/standalone/public/icon-512.png +0 -0
- package/.next/standalone/public/icon-maskable-512.png +0 -0
- package/.next/standalone/src/app/api/agent/activity/route.ts +9 -8
- package/.next/standalone/src/app/api/agent/events/[...path]/route.ts +20 -8
- package/.next/standalone/src/app/api/agent/files/[...path]/route.ts +16 -9
- package/.next/standalone/src/app/api/agent/fs/file/[...path]/route.ts +28 -18
- package/.next/standalone/src/app/api/agent/fs/ls/[[...path]]/route.ts +12 -7
- package/.next/standalone/src/app/api/agent/fs/move/route.ts +16 -11
- package/.next/standalone/src/app/api/agent/fs/search/route.ts +49 -13
- package/.next/standalone/src/app/api/agent/internal/span/route.ts +9 -5
- package/.next/standalone/src/app/api/agent/register/route.ts +9 -1
- package/.next/standalone/src/app/api/agent/settings/route.ts +7 -3
- package/.next/standalone/src/app/api/agent/sidecar/[...path]/route.ts +8 -4
- package/.next/standalone/src/app/api/assets/[...path]/route.ts +9 -4
- package/.next/standalone/src/app/api/system/admins/route.ts +103 -0
- package/.next/standalone/src/app/api/system/reveal/route.ts +7 -6
- package/.next/standalone/src/app/api/system/set-root/route.ts +24 -1
- package/.next/standalone/src/app/api/system/users/route.ts +120 -0
- package/.next/standalone/src/app/api/system/workspaces/[id]/open/route.ts +34 -0
- package/.next/standalone/src/app/api/system/workspaces/[id]/route.ts +74 -0
- package/.next/standalone/src/app/api/system/workspaces/route.ts +67 -0
- package/.next/standalone/src/app/api/upload/[...path]/route.ts +10 -5
- package/.next/standalone/src/app/api/wiki/app/route.ts +10 -9
- package/.next/standalone/src/app/api/wiki/content/route.ts +14 -14
- package/.next/standalone/src/app/api/wiki/download/route.ts +7 -6
- package/.next/standalone/src/app/api/wiki/file/route.ts +7 -2
- package/.next/standalone/src/app/api/wiki/folder/route.ts +6 -5
- package/.next/standalone/src/app/api/wiki/move/route.ts +7 -7
- package/.next/standalone/src/app/api/wiki/new-file/route.ts +7 -6
- package/.next/standalone/src/app/api/wiki/page/route.ts +6 -5
- package/.next/standalone/src/app/api/wiki/presence/route.ts +8 -7
- package/.next/standalone/src/app/api/wiki/route.ts +13 -11
- package/.next/standalone/src/app/api/wiki/search/route.ts +44 -0
- package/.next/standalone/src/app/api/wiki/slugs/route.ts +8 -8
- package/.next/standalone/src/app/api/wiki/upload/route.ts +6 -5
- package/.next/standalone/src/app/api/wiki/watch/route.ts +16 -40
- package/.next/standalone/src/app/globals.css +484 -484
- package/.next/standalone/src/app/layout.tsx +15 -1
- package/.next/standalone/src/app/manifest.ts +30 -0
- package/.next/standalone/src/app/page.tsx +163 -49
- package/.next/standalone/src/components/auth-settings-sheet.tsx +171 -2
- package/.next/standalone/src/components/dir-picker.tsx +8 -6
- package/.next/standalone/src/components/editor/comment-thread.tsx +2 -1
- package/.next/standalone/src/components/editor/csv-viewer.tsx +3 -2
- package/.next/standalone/src/components/editor/editor-toolbar.tsx +2 -2
- package/.next/standalone/src/components/editor/editor.tsx +6 -5
- package/.next/standalone/src/components/editor/file-fallback-viewer.tsx +3 -2
- package/.next/standalone/src/components/editor/folder-index.tsx +2 -1
- package/.next/standalone/src/components/editor/image-viewer.tsx +2 -1
- package/.next/standalone/src/components/editor/media-popover.tsx +2 -1
- package/.next/standalone/src/components/editor/media-viewer.tsx +2 -1
- package/.next/standalone/src/components/editor/mermaid-viewer.tsx +3 -2
- package/.next/standalone/src/components/editor/node-app-viewer.tsx +4 -3
- package/.next/standalone/src/components/editor/notebook-viewer.tsx +3 -2
- package/.next/standalone/src/components/editor/office/docx-viewer.tsx +2 -1
- package/.next/standalone/src/components/editor/office/office-chrome.tsx +3 -2
- package/.next/standalone/src/components/editor/office/pptx-viewer.tsx +2 -1
- package/.next/standalone/src/components/editor/office/xlsx-viewer.tsx +2 -1
- package/.next/standalone/src/components/editor/pdf-viewer.tsx +2 -1
- package/.next/standalone/src/components/editor/proof-span-popover.tsx +2 -1
- package/.next/standalone/src/components/editor/source-viewer.tsx +3 -2
- package/.next/standalone/src/components/editor/suggest-edit-popover.tsx +2 -1
- package/.next/standalone/src/components/editor/suggestion-card.tsx +2 -1
- package/.next/standalone/src/components/editor/website-viewer.tsx +2 -1
- package/.next/standalone/src/components/editor/wiki-link-create-dialog.tsx +2 -1
- package/.next/standalone/src/components/search/search-command-dialog.tsx +109 -0
- package/.next/standalone/src/components/search/sidebar-search-box.tsx +121 -0
- package/.next/standalone/src/components/search/snippet-text.tsx +48 -0
- package/.next/standalone/src/components/ui/command.tsx +3 -2
- package/.next/standalone/src/lib/auth/admin.ts +112 -0
- package/.next/standalone/src/lib/auth/server.ts +13 -2
- package/.next/standalone/src/lib/config.ts +56 -4
- package/.next/standalone/src/lib/proof/audit.ts +19 -10
- package/.next/standalone/src/lib/proof/auth.ts +11 -0
- package/.next/standalone/src/lib/proof/collab-state.ts +4 -2
- package/.next/standalone/src/lib/proof/file-lock.ts +5 -0
- package/.next/standalone/src/lib/proof/idempotency.ts +5 -0
- package/.next/standalone/src/lib/proof/lease.ts +40 -27
- package/.next/standalone/src/lib/proof/mutex.ts +4 -0
- package/.next/standalone/src/lib/proof/raw-fs.ts +2 -3
- package/.next/standalone/src/lib/proof/registry.ts +5 -0
- package/.next/standalone/src/lib/search/indexable-exts.ts +25 -0
- package/.next/standalone/src/lib/search/indexer.ts +567 -0
- package/.next/standalone/src/lib/search/sanitize.ts +35 -0
- package/.next/standalone/src/lib/search/search-db.ts +57 -0
- package/.next/standalone/src/lib/search/watcher-pool.ts +79 -0
- package/.next/standalone/src/lib/workspace-client.ts +82 -0
- package/.next/standalone/src/lib/workspace-context.ts +142 -0
- package/.next/standalone/src/lib/workspaces.ts +196 -0
- package/.next/standalone/src/stores/ai-panel-store.ts +3 -2
- package/.next/standalone/src/stores/editor-store.ts +4 -3
- package/.next/standalone/src/stores/proof-store.ts +4 -3
- package/.next/standalone/src/stores/search-store.ts +86 -0
- package/.next/standalone/src/stores/wiki-slugs-store.ts +2 -1
- package/.next/standalone/src/tests/proof/admin-create-user.test.ts +43 -0
- package/.next/standalone/src/tests/proof/agent-workspace-scope.test.ts +134 -0
- package/.next/standalone/src/tests/proof/collab-state.test.ts +43 -41
- package/.next/standalone/src/tests/proof/preload.ts +21 -0
- package/.next/standalone/src/tests/proof/search-index.test.ts +339 -0
- package/.next/standalone/src/tests/proof/workspace-isolation.test.ts +87 -0
- package/.next/standalone/src/tests/proof/workspaces-api.test.ts +227 -0
- package/.next/standalone/tsconfig.tsbuildinfo +1 -1
- package/README.md +46 -2
- package/package.json +2 -2
- package/.next/standalone/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_0o~h4zq.js +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.hb9q2._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0.uux34._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0092hkp._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__05f6x0i._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__05idwm9._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06-dtd0._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06sek6_._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__07fpqks._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__094q5bj._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0awzyon._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d_da6q._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0hhhvm7._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kk26wc._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0km8suj._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kur4ro._.js +0 -15
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0mkwoul._.js +0 -12
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qc2~6l._.js +0 -15
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qyd-o8._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0rkve~v._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0rzo40z._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0sjocwy._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0ssj9~d._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0s~i040._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t220d-._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0t5mg.n._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0trsqf4._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xq124z._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__106uw_c._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__10w2q~o._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__13w-0iy._.js +0 -3
- package/.next/standalone/.next/server/chunks/src_lib_auth_server_ts_00f4e0h._.js +0 -452
- package/.next/standalone/.next/server/edge/chunks/[root-of-the-server]__0ug2rvl._.js +0 -3
- package/.next/standalone/.next/static/chunks/0vwkqw_rofm-c.js +0 -129
- package/.next/standalone/.next/static/chunks/0zay6349~v_wc.css +0 -2
- /package/.next/standalone/.next/static/{H0E5wVJm9tAuN5CrU6zG2 → t7B6nXaoD1jo9f61t3aeK}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{H0E5wVJm9tAuN5CrU6zG2 → t7B6nXaoD1jo9f61t3aeK}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{H0E5wVJm9tAuN5CrU6zG2 → t7B6nXaoD1jo9f61t3aeK}/_ssgManifest.js +0 -0
|
@@ -4,6 +4,7 @@ import * as Popover from "@radix-ui/react-popover";
|
|
|
4
4
|
import { useEffect, useRef, useState } from "react";
|
|
5
5
|
import { authHeaders } from "@/lib/proof/client-auth";
|
|
6
6
|
import { useProofStore } from "@/stores/proof-store";
|
|
7
|
+
import { wsFetch } from "@/lib/workspace-client";
|
|
7
8
|
import type { Comment } from "@/lib/proof/types";
|
|
8
9
|
|
|
9
10
|
// ── helpers ──────────────────────────────────────────────────────────────────
|
|
@@ -28,7 +29,7 @@ async function postOp(
|
|
|
28
29
|
ops: object[],
|
|
29
30
|
): Promise<{ ok: boolean; stale: boolean; newRevision?: number }> {
|
|
30
31
|
const encoded = encodeURIComponent(path).replace(/%2F/g, "/");
|
|
31
|
-
const res = await
|
|
32
|
+
const res = await wsFetch(`/api/agent/files/${encoded}`, {
|
|
32
33
|
method: "POST",
|
|
33
34
|
headers: {
|
|
34
35
|
"Content-Type": "application/json",
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { Code2, Download, Save } from "lucide-react";
|
|
4
4
|
import { useCallback, useEffect, useState } from "react";
|
|
5
|
+
import { wsFetch } from "@/lib/workspace-client";
|
|
5
6
|
import { ViewerToolbar } from "@/components/layout/viewer-toolbar";
|
|
6
7
|
import { Button } from "@/components/ui/button";
|
|
7
8
|
|
|
@@ -80,7 +81,7 @@ export function CsvViewer({ path }: CsvViewerProps) {
|
|
|
80
81
|
const csvUrl = `/api/assets/${path}`;
|
|
81
82
|
|
|
82
83
|
useEffect(() => {
|
|
83
|
-
|
|
84
|
+
wsFetch(csvUrl)
|
|
84
85
|
.then((r) => r.text())
|
|
85
86
|
.then((text) => {
|
|
86
87
|
setRawText(text);
|
|
@@ -121,7 +122,7 @@ export function CsvViewer({ path }: CsvViewerProps) {
|
|
|
121
122
|
setSaving(true);
|
|
122
123
|
const csv = sourceMode ? rawText : rowsToCsv(rows);
|
|
123
124
|
try {
|
|
124
|
-
await
|
|
125
|
+
await wsFetch(`/api/assets/${path}`, {
|
|
125
126
|
method: "PUT",
|
|
126
127
|
headers: { "Content-Type": "text/plain" },
|
|
127
128
|
body: csv,
|
|
@@ -85,9 +85,9 @@ function ToolButton({
|
|
|
85
85
|
onAction(e);
|
|
86
86
|
}}
|
|
87
87
|
className={cn(
|
|
88
|
-
"h-8 w-8 shrink-0 inline-flex items-center justify-center rounded-md text-foreground/80 hover:bg-accent transition-colors disabled:opacity-40",
|
|
88
|
+
"h-8 w-8 shrink-0 inline-flex items-center justify-center rounded-md text-foreground/80 hover:bg-accent hover:text-accent-foreground transition-colors disabled:opacity-40",
|
|
89
89
|
active &&
|
|
90
|
-
"bg-accent text-foreground ring-1 ring-inset ring-foreground/15",
|
|
90
|
+
"bg-accent text-accent-foreground ring-1 ring-inset ring-foreground/15",
|
|
91
91
|
)}
|
|
92
92
|
>
|
|
93
93
|
<Icon className="h-4 w-4" />
|
|
@@ -15,6 +15,7 @@ import { useWikiSlugsStore } from "@/stores/wiki-slugs-store";
|
|
|
15
15
|
import type { TreeNode } from "@/types";
|
|
16
16
|
import { useProofStore } from "@/stores/proof-store";
|
|
17
17
|
import { captureSuggestion } from "@/lib/proof/suggest-capture";
|
|
18
|
+
import { wsFetch, withWs } from "@/lib/workspace-client";
|
|
18
19
|
import { EditorBubbleMenu } from "./bubble-menu";
|
|
19
20
|
import { EditorToolbar } from "./editor-toolbar";
|
|
20
21
|
import { editorExtensions } from "./extensions";
|
|
@@ -39,7 +40,7 @@ async function uploadFile(
|
|
|
39
40
|
const formData = new FormData();
|
|
40
41
|
formData.append("file", file);
|
|
41
42
|
try {
|
|
42
|
-
const res = await
|
|
43
|
+
const res = await wsFetch(`/api/upload/${pagePath}`, {
|
|
43
44
|
method: "POST",
|
|
44
45
|
body: formData,
|
|
45
46
|
});
|
|
@@ -197,7 +198,7 @@ export function KBEditor() {
|
|
|
197
198
|
const path = currentPath;
|
|
198
199
|
const ping = (action: "open" | "heartbeat" | "close") => {
|
|
199
200
|
// keepalive lets the "close" beacon survive page unload.
|
|
200
|
-
void
|
|
201
|
+
void wsFetch("/api/wiki/presence", {
|
|
201
202
|
method: "POST",
|
|
202
203
|
headers: { "Content-Type": "application/json" },
|
|
203
204
|
body: JSON.stringify({ path, action }),
|
|
@@ -225,7 +226,7 @@ export function KBEditor() {
|
|
|
225
226
|
// Subscribe to chokidar SSE: when current file changes on disk, reload sidecar.
|
|
226
227
|
useEffect(() => {
|
|
227
228
|
if (typeof window === "undefined") return;
|
|
228
|
-
const es = new EventSource("/api/wiki/watch");
|
|
229
|
+
const es = new EventSource(withWs("/api/wiki/watch"));
|
|
229
230
|
es.onmessage = (evt: MessageEvent<string>) => {
|
|
230
231
|
try {
|
|
231
232
|
const data = JSON.parse(evt.data) as { type: string; path: string };
|
|
@@ -1139,7 +1140,7 @@ export function KBEditor() {
|
|
|
1139
1140
|
className={`px-2 py-0.5 transition-colors ${
|
|
1140
1141
|
editMode === "editing"
|
|
1141
1142
|
? "bg-primary text-primary-foreground"
|
|
1142
|
-
: "text-muted-foreground hover:bg-accent"
|
|
1143
|
+
: "text-muted-foreground hover:bg-accent hover:text-accent-foreground"
|
|
1143
1144
|
}`}
|
|
1144
1145
|
>
|
|
1145
1146
|
Editing
|
|
@@ -1152,7 +1153,7 @@ export function KBEditor() {
|
|
|
1152
1153
|
className={`px-2 py-0.5 transition-colors ${
|
|
1153
1154
|
editMode === "suggesting"
|
|
1154
1155
|
? "bg-primary text-primary-foreground"
|
|
1155
|
-
: "text-muted-foreground hover:bg-accent"
|
|
1156
|
+
: "text-muted-foreground hover:bg-accent hover:text-accent-foreground"
|
|
1156
1157
|
}`}
|
|
1157
1158
|
>
|
|
1158
1159
|
Suggesting
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { Download, File, FolderOpen } from "lucide-react";
|
|
4
4
|
import { ViewerToolbar } from "@/components/layout/viewer-toolbar";
|
|
5
5
|
import { Button } from "@/components/ui/button";
|
|
6
|
+
import { withWs, wsFetch } from "@/lib/workspace-client";
|
|
6
7
|
|
|
7
8
|
interface FileFallbackViewerProps {
|
|
8
9
|
path: string;
|
|
@@ -10,7 +11,7 @@ interface FileFallbackViewerProps {
|
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export function FileFallbackViewer({ path }: FileFallbackViewerProps) {
|
|
13
|
-
const assetUrl = `/api/assets/${path}
|
|
14
|
+
const assetUrl = withWs(`/api/assets/${path}`);
|
|
14
15
|
const filename = path.split("/").pop() || path;
|
|
15
16
|
const ext = filename.includes(".")
|
|
16
17
|
? filename.split(".").pop()?.toUpperCase()
|
|
@@ -18,7 +19,7 @@ export function FileFallbackViewer({ path }: FileFallbackViewerProps) {
|
|
|
18
19
|
|
|
19
20
|
const revealInFinder = async () => {
|
|
20
21
|
try {
|
|
21
|
-
await
|
|
22
|
+
await wsFetch("/api/system/reveal", {
|
|
22
23
|
method: "POST",
|
|
23
24
|
headers: { "Content-Type": "application/json" },
|
|
24
25
|
body: JSON.stringify({ path }),
|
|
@@ -17,6 +17,7 @@ import { useMemo, useState } from "react";
|
|
|
17
17
|
import { useEditorStore } from "@/stores/editor-store";
|
|
18
18
|
import { useTreeStore } from "@/stores/tree-store";
|
|
19
19
|
import type { TreeNode } from "@/types";
|
|
20
|
+
import { withWs } from "@/lib/workspace-client";
|
|
20
21
|
|
|
21
22
|
type ViewMode = "list" | "gallery";
|
|
22
23
|
|
|
@@ -199,7 +200,7 @@ export function FolderIndex({ folderPath, entries }: FolderIndexProps) {
|
|
|
199
200
|
>
|
|
200
201
|
<div className="aspect-square w-full overflow-hidden rounded-md border border-border bg-muted">
|
|
201
202
|
<img
|
|
202
|
-
src={`/api/assets/${child.path}`}
|
|
203
|
+
src={withWs(`/api/assets/${child.path}`)}
|
|
203
204
|
alt={title}
|
|
204
205
|
loading="lazy"
|
|
205
206
|
className="h-full w-full object-cover transition-transform group-hover:scale-[1.02]"
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { Download, ExternalLink } from "lucide-react";
|
|
4
4
|
import { ViewerToolbar } from "@/components/layout/viewer-toolbar";
|
|
5
5
|
import { Button } from "@/components/ui/button";
|
|
6
|
+
import { withWs } from "@/lib/workspace-client";
|
|
6
7
|
|
|
7
8
|
interface ImageViewerProps {
|
|
8
9
|
path: string;
|
|
@@ -10,7 +11,7 @@ interface ImageViewerProps {
|
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export function ImageViewer({ path, title }: ImageViewerProps) {
|
|
13
|
-
const src = `/api/assets/${path}
|
|
14
|
+
const src = withWs(`/api/assets/${path}`);
|
|
14
15
|
const filename = path.split("/").pop() || path;
|
|
15
16
|
const ext = filename.includes(".")
|
|
16
17
|
? filename.split(".").pop()?.toUpperCase()
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { Clipboard, Link as LinkIcon, Upload } from "lucide-react";
|
|
4
4
|
import { useRef, useState } from "react";
|
|
5
5
|
import { cn } from "@/lib/utils";
|
|
6
|
+
import { wsFetch } from "@/lib/workspace-client";
|
|
6
7
|
|
|
7
8
|
export type MediaKind = "image" | "video" | "file";
|
|
8
9
|
|
|
@@ -21,7 +22,7 @@ async function uploadFile(
|
|
|
21
22
|
const formData = new FormData();
|
|
22
23
|
formData.append("file", file);
|
|
23
24
|
try {
|
|
24
|
-
const res = await
|
|
25
|
+
const res = await wsFetch(`/api/upload/${pagePath}`, {
|
|
25
26
|
method: "POST",
|
|
26
27
|
body: formData,
|
|
27
28
|
});
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { Download, ExternalLink } from "lucide-react";
|
|
4
4
|
import { ViewerToolbar } from "@/components/layout/viewer-toolbar";
|
|
5
5
|
import { Button } from "@/components/ui/button";
|
|
6
|
+
import { withWs } from "@/lib/workspace-client";
|
|
6
7
|
|
|
7
8
|
interface MediaViewerProps {
|
|
8
9
|
path: string;
|
|
@@ -11,7 +12,7 @@ interface MediaViewerProps {
|
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export function MediaViewer({ path, type }: MediaViewerProps) {
|
|
14
|
-
const src = `/api/assets/${path}
|
|
15
|
+
const src = withWs(`/api/assets/${path}`);
|
|
15
16
|
const filename = path.split("/").pop() || path;
|
|
16
17
|
const ext = filename.includes(".")
|
|
17
18
|
? filename.split(".").pop()?.toUpperCase()
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
14
14
|
import { ViewerToolbar } from "@/components/layout/viewer-toolbar";
|
|
15
15
|
import { Button } from "@/components/ui/button";
|
|
16
|
+
import { withWs, wsFetch } from "@/lib/workspace-client";
|
|
16
17
|
|
|
17
18
|
interface MermaidViewerProps {
|
|
18
19
|
path: string;
|
|
@@ -85,14 +86,14 @@ export function MermaidViewer({ path, title }: MermaidViewerProps) {
|
|
|
85
86
|
setIsPanning(false);
|
|
86
87
|
}, []);
|
|
87
88
|
|
|
88
|
-
const assetUrl = `/api/assets/${path}
|
|
89
|
+
const assetUrl = withWs(`/api/assets/${path}`);
|
|
89
90
|
const _filename = path.split("/").pop() || path;
|
|
90
91
|
|
|
91
92
|
const fetchAndRender = useCallback(async () => {
|
|
92
93
|
setLoading(true);
|
|
93
94
|
setError("");
|
|
94
95
|
try {
|
|
95
|
-
const res = await
|
|
96
|
+
const res = await wsFetch(assetUrl);
|
|
96
97
|
if (!res.ok) throw new Error("Failed to fetch file");
|
|
97
98
|
const text = await res.text();
|
|
98
99
|
setSource(text);
|
|
@@ -13,6 +13,7 @@ import { useCallback, useEffect, useRef, useState } from "react";
|
|
|
13
13
|
import { ViewerToolbar } from "@/components/layout/viewer-toolbar";
|
|
14
14
|
import { Button } from "@/components/ui/button";
|
|
15
15
|
import type { AppStatus } from "@/lib/app-runner";
|
|
16
|
+
import { wsFetch } from "@/lib/workspace-client";
|
|
16
17
|
|
|
17
18
|
interface Props {
|
|
18
19
|
path: string;
|
|
@@ -56,7 +57,7 @@ export function NodeAppViewer({ path, title }: Props) {
|
|
|
56
57
|
|
|
57
58
|
const fetchStatus = useCallback(async () => {
|
|
58
59
|
try {
|
|
59
|
-
const res = await
|
|
60
|
+
const res = await wsFetch(`/api/wiki/app?path=${encodeURIComponent(path)}`);
|
|
60
61
|
if (!res.ok) return;
|
|
61
62
|
const data: StatusResponse = await res.json();
|
|
62
63
|
setStatus(data.status);
|
|
@@ -96,7 +97,7 @@ export function NodeAppViewer({ path, title }: Props) {
|
|
|
96
97
|
setLogs([]);
|
|
97
98
|
setStatus("starting");
|
|
98
99
|
try {
|
|
99
|
-
const res = await
|
|
100
|
+
const res = await wsFetch("/api/wiki/app", {
|
|
100
101
|
method: "POST",
|
|
101
102
|
headers: { "Content-Type": "application/json" },
|
|
102
103
|
body: JSON.stringify({ path }),
|
|
@@ -117,7 +118,7 @@ export function NodeAppViewer({ path, title }: Props) {
|
|
|
117
118
|
};
|
|
118
119
|
|
|
119
120
|
const handleStop = async () => {
|
|
120
|
-
await
|
|
121
|
+
await wsFetch("/api/wiki/app", {
|
|
121
122
|
method: "DELETE",
|
|
122
123
|
headers: { "Content-Type": "application/json" },
|
|
123
124
|
body: JSON.stringify({ path }),
|
|
@@ -7,6 +7,7 @@ import { useCallback, useEffect, useMemo, useState } from "react";
|
|
|
7
7
|
import { ViewerToolbar } from "@/components/layout/viewer-toolbar";
|
|
8
8
|
import { Button } from "@/components/ui/button";
|
|
9
9
|
import { markdownToHtml } from "@/lib/markdown/to-html";
|
|
10
|
+
import { withWs, wsFetch } from "@/lib/workspace-client";
|
|
10
11
|
|
|
11
12
|
interface NotebookViewerProps {
|
|
12
13
|
path: string;
|
|
@@ -247,14 +248,14 @@ export function NotebookViewer({ path }: NotebookViewerProps) {
|
|
|
247
248
|
const [error, setError] = useState<string | null>(null);
|
|
248
249
|
const [copied, setCopied] = useState(false);
|
|
249
250
|
|
|
250
|
-
const assetUrl = `/api/assets/${path}
|
|
251
|
+
const assetUrl = withWs(`/api/assets/${path}`);
|
|
251
252
|
const filename = path.split("/").pop() || path;
|
|
252
253
|
|
|
253
254
|
const fetchNotebook = useCallback(async () => {
|
|
254
255
|
setLoading(true);
|
|
255
256
|
setError(null);
|
|
256
257
|
try {
|
|
257
|
-
const res = await
|
|
258
|
+
const res = await wsFetch(assetUrl);
|
|
258
259
|
if (!res.ok) throw new Error(`HTTP ${res.status}`);
|
|
259
260
|
const json = (await res.json()) as Notebook;
|
|
260
261
|
setNotebook(json);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { Loader2 } from "lucide-react";
|
|
4
|
+
import { wsFetch } from "@/lib/workspace-client";
|
|
4
5
|
import { useEffect, useRef, useState } from "react";
|
|
5
6
|
import { OfficeChrome } from "./office-chrome";
|
|
6
7
|
|
|
@@ -28,7 +29,7 @@ export function DocxViewer({ path, title }: Props) {
|
|
|
28
29
|
try {
|
|
29
30
|
const [{ renderAsync }, res] = await Promise.all([
|
|
30
31
|
import("docx-preview"),
|
|
31
|
-
|
|
32
|
+
wsFetch(`/api/assets/${path}`),
|
|
32
33
|
]);
|
|
33
34
|
if (cancelled) return;
|
|
34
35
|
if (!res.ok) throw new Error(`Failed to load file (${res.status})`);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { Download, ExternalLink, FolderOpen } from "lucide-react";
|
|
4
4
|
import { ViewerToolbar } from "@/components/layout/viewer-toolbar";
|
|
5
5
|
import { Button } from "@/components/ui/button";
|
|
6
|
+
import { withWs, wsFetch } from "@/lib/workspace-client";
|
|
6
7
|
|
|
7
8
|
interface OfficeChromeProps {
|
|
8
9
|
path: string;
|
|
@@ -20,12 +21,12 @@ export function OfficeChrome({
|
|
|
20
21
|
external,
|
|
21
22
|
hideFinder,
|
|
22
23
|
}: OfficeChromeProps) {
|
|
23
|
-
const assetUrl = `/api/assets/${path}
|
|
24
|
+
const assetUrl = withWs(`/api/assets/${path}`);
|
|
24
25
|
const filename = path.split("/").pop() || path;
|
|
25
26
|
|
|
26
27
|
const revealInFinder = async () => {
|
|
27
28
|
try {
|
|
28
|
-
await
|
|
29
|
+
await wsFetch("/api/system/reveal", {
|
|
29
30
|
method: "POST",
|
|
30
31
|
headers: { "Content-Type": "application/json" },
|
|
31
32
|
body: JSON.stringify({ path }),
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { Loader2 } from "lucide-react";
|
|
4
|
+
import { wsFetch } from "@/lib/workspace-client";
|
|
4
5
|
import { useEffect, useRef, useState } from "react";
|
|
5
6
|
import { OfficeChrome } from "./office-chrome";
|
|
6
7
|
|
|
@@ -28,7 +29,7 @@ export function PptxViewer({ path, title }: Props) {
|
|
|
28
29
|
try {
|
|
29
30
|
const [{ init }, res] = await Promise.all([
|
|
30
31
|
import("pptx-preview"),
|
|
31
|
-
|
|
32
|
+
wsFetch(`/api/assets/${path}`),
|
|
32
33
|
]);
|
|
33
34
|
if (cancelled) return;
|
|
34
35
|
if (!res.ok) throw new Error(`Failed to load file (${res.status})`);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { Loader2 } from "lucide-react";
|
|
4
|
+
import { wsFetch } from "@/lib/workspace-client";
|
|
4
5
|
import { useEffect, useMemo, useState } from "react";
|
|
5
6
|
import { cn } from "@/lib/utils";
|
|
6
7
|
import { OfficeChrome } from "./office-chrome";
|
|
@@ -30,7 +31,7 @@ export function XlsxViewer({ path, title }: Props) {
|
|
|
30
31
|
try {
|
|
31
32
|
const [XLSX, res] = await Promise.all([
|
|
32
33
|
import("xlsx"),
|
|
33
|
-
|
|
34
|
+
wsFetch(`/api/assets/${path}`),
|
|
34
35
|
]);
|
|
35
36
|
if (cancelled) return;
|
|
36
37
|
if (!res.ok) throw new Error(`Failed to load file (${res.status})`);
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { ExternalLink } from "lucide-react";
|
|
4
4
|
import { ViewerToolbar } from "@/components/layout/viewer-toolbar";
|
|
5
5
|
import { Button } from "@/components/ui/button";
|
|
6
|
+
import { withWs } from "@/lib/workspace-client";
|
|
6
7
|
|
|
7
8
|
interface PdfViewerProps {
|
|
8
9
|
path: string;
|
|
@@ -10,7 +11,7 @@ interface PdfViewerProps {
|
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export function PdfViewer({ path, title }: PdfViewerProps) {
|
|
13
|
-
const pdfSrc = `/api/assets/${path}
|
|
14
|
+
const pdfSrc = withWs(`/api/assets/${path}`);
|
|
14
15
|
|
|
15
16
|
return (
|
|
16
17
|
<div className="flex-1 flex flex-col overflow-hidden">
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import * as Popover from "@radix-ui/react-popover";
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
5
|
import { authHeaders } from "@/lib/proof/client-auth";
|
|
6
|
+
import { wsFetch } from "@/lib/workspace-client";
|
|
6
7
|
|
|
7
8
|
interface SpanMeta {
|
|
8
9
|
spanId: string;
|
|
@@ -74,7 +75,7 @@ export function ProofSpanPopover({ targetEl, path, onClose, onComment }: Props)
|
|
|
74
75
|
if (busy || !meta) return;
|
|
75
76
|
setBusy(true);
|
|
76
77
|
try {
|
|
77
|
-
await
|
|
78
|
+
await wsFetch("/api/agent/internal/span", {
|
|
78
79
|
method: "POST",
|
|
79
80
|
headers: { "Content-Type": "application/json", ...authHeaders() },
|
|
80
81
|
body: JSON.stringify({
|
|
@@ -6,6 +6,7 @@ import { Check, Copy, Download, ExternalLink, WrapText } from "lucide-react";
|
|
|
6
6
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
7
7
|
import { ViewerToolbar } from "@/components/layout/viewer-toolbar";
|
|
8
8
|
import { Button } from "@/components/ui/button";
|
|
9
|
+
import { withWs, wsFetch } from "@/lib/workspace-client";
|
|
9
10
|
|
|
10
11
|
interface SourceViewerProps {
|
|
11
12
|
path: string;
|
|
@@ -76,14 +77,14 @@ export function SourceViewer({ path }: SourceViewerProps) {
|
|
|
76
77
|
const [wrap, setWrap] = useState(false);
|
|
77
78
|
const [copied, setCopied] = useState(false);
|
|
78
79
|
|
|
79
|
-
const assetUrl = `/api/assets/${path}
|
|
80
|
+
const assetUrl = withWs(`/api/assets/${path}`);
|
|
80
81
|
const filename = path.split("/").pop() || path;
|
|
81
82
|
const language = detectLanguage(filename);
|
|
82
83
|
|
|
83
84
|
const fetchContent = useCallback(async () => {
|
|
84
85
|
setLoading(true);
|
|
85
86
|
try {
|
|
86
|
-
const res = await
|
|
87
|
+
const res = await wsFetch(assetUrl);
|
|
87
88
|
if (res.ok) {
|
|
88
89
|
const text = await res.text();
|
|
89
90
|
setContent(text);
|
|
@@ -4,6 +4,7 @@ import * as Popover from "@radix-ui/react-popover";
|
|
|
4
4
|
import { useEffect, useRef, useState } from "react";
|
|
5
5
|
import { authHeaders } from "@/lib/proof/client-auth";
|
|
6
6
|
import { useProofStore } from "@/stores/proof-store";
|
|
7
|
+
import { wsFetch } from "@/lib/workspace-client";
|
|
7
8
|
import type { SuggestionKind } from "@/lib/proof/types";
|
|
8
9
|
|
|
9
10
|
async function postOp(
|
|
@@ -12,7 +13,7 @@ async function postOp(
|
|
|
12
13
|
ops: object[],
|
|
13
14
|
): Promise<{ ok: boolean; stale: boolean; newRevision?: number }> {
|
|
14
15
|
const encoded = encodeURIComponent(path).replace(/%2F/g, "/");
|
|
15
|
-
const res = await
|
|
16
|
+
const res = await wsFetch(`/api/agent/files/${encoded}`, {
|
|
16
17
|
method: "POST",
|
|
17
18
|
headers: {
|
|
18
19
|
"Content-Type": "application/json",
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { useState } from "react";
|
|
4
4
|
import { authHeaders } from "@/lib/proof/client-auth";
|
|
5
|
+
import { wsFetch } from "@/lib/workspace-client";
|
|
5
6
|
import type { Suggestion } from "@/lib/proof/types";
|
|
6
7
|
|
|
7
8
|
interface Props {
|
|
@@ -33,7 +34,7 @@ async function postOp(
|
|
|
33
34
|
suggestionId: string,
|
|
34
35
|
): Promise<{ ok: boolean; status: number }> {
|
|
35
36
|
const encodedPath = encodeURIComponent(path).replace(/%2F/g, "/");
|
|
36
|
-
const res = await
|
|
37
|
+
const res = await wsFetch(`/api/agent/files/${encodedPath}`, {
|
|
37
38
|
method: "POST",
|
|
38
39
|
headers: {
|
|
39
40
|
"Content-Type": "application/json",
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { ArrowLeft, ExternalLink } from "lucide-react";
|
|
4
4
|
import { ViewerToolbar } from "@/components/layout/viewer-toolbar";
|
|
5
5
|
import { Button } from "@/components/ui/button";
|
|
6
|
+
import { withWs } from "@/lib/workspace-client";
|
|
6
7
|
|
|
7
8
|
interface WebsiteViewerProps {
|
|
8
9
|
path: string;
|
|
@@ -20,7 +21,7 @@ export function WebsiteViewer({
|
|
|
20
21
|
fullscreen,
|
|
21
22
|
onExit,
|
|
22
23
|
}: WebsiteViewerProps) {
|
|
23
|
-
const iframeSrc = src ?? `/api/assets/${path}/index.html
|
|
24
|
+
const iframeSrc = withWs(src ?? `/api/assets/${path}/index.html`);
|
|
24
25
|
const exitButton =
|
|
25
26
|
fullscreen && onExit ? (
|
|
26
27
|
<Button
|
|
@@ -14,6 +14,7 @@ import { Input } from "@/components/ui/input";
|
|
|
14
14
|
import { Label } from "@/components/ui/label";
|
|
15
15
|
import { showError } from "@/lib/toast";
|
|
16
16
|
import { useWikiSlugsStore } from "@/stores/wiki-slugs-store";
|
|
17
|
+
import { wsFetch } from "@/lib/workspace-client";
|
|
17
18
|
|
|
18
19
|
type Dir = "entities" | "concepts" | "comparisons";
|
|
19
20
|
|
|
@@ -74,7 +75,7 @@ export function useWikiLinkCreate(): {
|
|
|
74
75
|
const { slug, dir, title } = dialogState;
|
|
75
76
|
setIsSubmitting(true);
|
|
76
77
|
try {
|
|
77
|
-
const res = await
|
|
78
|
+
const res = await wsFetch("/api/wiki/page", {
|
|
78
79
|
method: "POST",
|
|
79
80
|
headers: { "Content-Type": "application/json" },
|
|
80
81
|
body: JSON.stringify({
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Command palette (cmd+k / ctrl+k) for full-text search.
|
|
5
|
+
* Mounts once in the app shell; visibility is driven by the search store.
|
|
6
|
+
*/
|
|
7
|
+
import { useEffect } from "react";
|
|
8
|
+
import {
|
|
9
|
+
CommandDialog,
|
|
10
|
+
CommandEmpty,
|
|
11
|
+
CommandGroup,
|
|
12
|
+
CommandInput,
|
|
13
|
+
CommandItem,
|
|
14
|
+
CommandList,
|
|
15
|
+
} from "@/components/ui/command";
|
|
16
|
+
import { useSearchStore } from "@/stores/search-store";
|
|
17
|
+
import { SnippetText } from "./snippet-text";
|
|
18
|
+
|
|
19
|
+
export function SearchCommandDialog({
|
|
20
|
+
onOpenFile,
|
|
21
|
+
}: {
|
|
22
|
+
onOpenFile: (relPath: string) => void;
|
|
23
|
+
}) {
|
|
24
|
+
const open = useSearchStore((s) => s.open);
|
|
25
|
+
const setOpen = useSearchStore((s) => s.setOpen);
|
|
26
|
+
const query = useSearchStore((s) => s.query);
|
|
27
|
+
const setQuery = useSearchStore((s) => s.setQuery);
|
|
28
|
+
const results = useSearchStore((s) => s.results);
|
|
29
|
+
const loading = useSearchStore((s) => s.loading);
|
|
30
|
+
const truncated = useSearchStore((s) => s.truncated);
|
|
31
|
+
const search = useSearchStore((s) => s.search);
|
|
32
|
+
|
|
33
|
+
// Global cmd+k / ctrl+k toggle.
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
function onKey(e: KeyboardEvent) {
|
|
36
|
+
if ((e.metaKey || e.ctrlKey) && e.key.toLowerCase() === "k") {
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
setOpen(!open);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
window.addEventListener("keydown", onKey);
|
|
42
|
+
return () => window.removeEventListener("keydown", onKey);
|
|
43
|
+
}, [open, setOpen]);
|
|
44
|
+
|
|
45
|
+
// Debounced search as the query changes while the palette is open.
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
if (!open) return;
|
|
48
|
+
const id = setTimeout(() => {
|
|
49
|
+
void search(query);
|
|
50
|
+
}, 120);
|
|
51
|
+
return () => clearTimeout(id);
|
|
52
|
+
}, [query, open, search]);
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<CommandDialog
|
|
56
|
+
open={open}
|
|
57
|
+
onOpenChange={setOpen}
|
|
58
|
+
// cmdk's built-in fuzzy filter would re-rank our BM25 results; disable it.
|
|
59
|
+
shouldFilter={false}
|
|
60
|
+
>
|
|
61
|
+
<CommandInput
|
|
62
|
+
placeholder="Search files…"
|
|
63
|
+
value={query}
|
|
64
|
+
onValueChange={setQuery}
|
|
65
|
+
/>
|
|
66
|
+
<CommandList>
|
|
67
|
+
{loading && (
|
|
68
|
+
<div className="px-3 py-2 text-xs text-muted-foreground">
|
|
69
|
+
Searching…
|
|
70
|
+
</div>
|
|
71
|
+
)}
|
|
72
|
+
{!loading && query.trim() !== "" && results.length === 0 && (
|
|
73
|
+
<CommandEmpty>No matches.</CommandEmpty>
|
|
74
|
+
)}
|
|
75
|
+
{results.length > 0 && (
|
|
76
|
+
<CommandGroup
|
|
77
|
+
heading={
|
|
78
|
+
truncated
|
|
79
|
+
? "Top results (refine query for more)"
|
|
80
|
+
: "Results"
|
|
81
|
+
}
|
|
82
|
+
>
|
|
83
|
+
{results.map((r) => (
|
|
84
|
+
<CommandItem
|
|
85
|
+
key={r.path}
|
|
86
|
+
value={r.path}
|
|
87
|
+
onSelect={() => {
|
|
88
|
+
onOpenFile(r.path);
|
|
89
|
+
setOpen(false);
|
|
90
|
+
}}
|
|
91
|
+
>
|
|
92
|
+
<div className="flex min-w-0 flex-col gap-0.5">
|
|
93
|
+
<span className="truncate font-mono text-xs">
|
|
94
|
+
{r.path}
|
|
95
|
+
</span>
|
|
96
|
+
{r.snippet && (
|
|
97
|
+
<span className="truncate text-xs text-muted-foreground">
|
|
98
|
+
<SnippetText html={r.snippet} />
|
|
99
|
+
</span>
|
|
100
|
+
)}
|
|
101
|
+
</div>
|
|
102
|
+
</CommandItem>
|
|
103
|
+
))}
|
|
104
|
+
</CommandGroup>
|
|
105
|
+
)}
|
|
106
|
+
</CommandList>
|
|
107
|
+
</CommandDialog>
|
|
108
|
+
);
|
|
109
|
+
}
|