wiki-viewer 1.4.2 → 1.5.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 +5 -0
- package/.next/standalone/.next/build-manifest.json +3 -3
- package/.next/standalone/.next/prerender-manifest.json +3 -27
- package/.next/standalone/.next/routes-manifest.json +34 -0
- package/.next/standalone/.next/server/app/_global-error/page.js +2 -2
- package/.next/standalone/.next/server/app/_global-error/page.js.nft.json +1 -1
- 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.js +4 -4
- package/.next/standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- 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 +1 -1
- 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 +1 -1
- package/.next/standalone/.next/server/app/api/agent/activity/route.js +5 -5
- 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 +6 -6
- 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 +4 -4
- 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 +4 -4
- 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 +5 -5
- 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 +11 -10
- 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/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route.js +17 -0
- package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/agent/fs/file/[...path]/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/agent/fs/ls/[[...path]]/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/agent/fs/ls/[[...path]]/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/agent/fs/ls/[[...path]]/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/agent/fs/ls/[[...path]]/route.js +15 -0
- package/.next/standalone/.next/server/app/api/agent/fs/ls/[[...path]]/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/agent/fs/ls/[[...path]]/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/agent/fs/ls/[[...path]]/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/agent/fs/move/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/agent/fs/move/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/agent/fs/move/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/agent/fs/move/route.js +15 -0
- package/.next/standalone/.next/server/app/api/agent/fs/move/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/agent/fs/move/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/agent/fs/move/route_client-reference-manifest.js +3 -0
- package/.next/standalone/.next/server/app/api/agent/fs/search/route/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/agent/fs/search/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/agent/fs/search/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/agent/fs/search/route.js +15 -0
- package/.next/standalone/.next/server/app/api/agent/fs/search/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/agent/fs/search/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/agent/fs/search/route_client-reference-manifest.js +3 -0
- 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 +8 -8
- 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 +7 -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 +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.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/auth/[...all]/route.js +3 -3
- package/.next/standalone/.next/server/app/api/auth/[...all]/route.js.nft.json +1 -1
- package/.next/standalone/.next/server/app/api/system/auth-config/route.js +5 -5
- 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 +6 -6
- 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 +5 -5
- 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 +4 -4
- 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 +4 -4
- 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 +5 -5
- package/.next/standalone/.next/server/app/api/system/set-root/route.js.nft.json +1 -1
- 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 +6 -6
- 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/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/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/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/app-paths-manifest.json +3 -0
- package/.next/standalone/.next/server/app/api/wiki/presence/route/build-manifest.json +9 -0
- package/.next/standalone/.next/server/app/api/wiki/presence/route/server-reference-manifest.json +4 -0
- package/.next/standalone/.next/server/app/api/wiki/presence/route.js +14 -0
- package/.next/standalone/.next/server/app/api/wiki/presence/route.js.map +5 -0
- package/.next/standalone/.next/server/app/api/wiki/presence/route.js.nft.json +1 -0
- package/.next/standalone/.next/server/app/api/wiki/presence/route_client-reference-manifest.js +3 -0
- 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/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 +6 -6
- 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 +2 -2
- package/.next/standalone/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/page.js +4 -4
- 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 +9 -4
- 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 +5 -0
- package/.next/standalone/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_0d2jbo5.js +3 -0
- package/.next/standalone/.next/server/chunks/0p91_next_dist_esm_build_templates_app-route_0ytral2.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0269d2e._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__03h3~3e._.js → [root-of-the-server]__04udrya._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__05f6x0i._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06-dtd0._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__06sek6_._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__09s9qkd._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d75a5q._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0d_da6q._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0e7si9p._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0hhhvm7._.js +1 -1
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__04g0j8i._.js → [root-of-the-server]__0kdn1le._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kk26wc._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0kur4ro._.js +15 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0p12-6~._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0qc2~6l._.js +15 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0s~i040._.js +3 -0
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0w47wil._.js +1 -1
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0xq124z._.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0l..bxz._.js → [root-of-the-server]__0xz-_0v._.js} +2 -2
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__10w2q~o._.js +1 -1
- package/.next/standalone/.next/server/chunks/_079xuln._.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_agent_fs_file_[___path]_route_actions_0gb11t~.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_agent_fs_ls_[[___path]]_route_actions_0wfg4nl.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_agent_fs_move_route_actions_0z34mqq.js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_agent_fs_search_route_actions_0ut_ug..js +3 -0
- package/.next/standalone/.next/server/chunks/_next-internal_server_app_api_wiki_presence_route_actions_0x9d7f4.js +3 -0
- package/.next/standalone/.next/server/chunks/{[root-of-the-server]__0d89o98._.js → src_lib_auth_server_ts_00f4e0h._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/0biy_@better-auth_core_dist_121m_lh._.js +5 -0
- package/.next/standalone/.next/server/chunks/ssr/0dhv_better-auth_dist_adapters_kysely-adapter_index_mjs_08ymlcb._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/0dti_kysely_dist_esm_0-t3o9q._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/0dti_kysely_dist_esm_01._58q._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/0p91_next_0f40gy0._.js +6 -0
- package/.next/standalone/.next/server/chunks/ssr/{0p91_next_dist_0~2d1tl._.js → 0p91_next_dist_10ud_sa._.js} +2 -2
- package/.next/standalone/.next/server/chunks/ssr/0sag_@better-auth_memory-adapter_dist_index_mjs_07-_ka6._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/0ugq_@better-auth_kysely-adapter_dist_bun-sqlite-dialect-DzNwOpKv_mjs_0lruvb8._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/0ugq_@better-auth_kysely-adapter_dist_d1-sqlite-dialect-C2B7YsIT_mjs_03n6~tc._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/0ugq_@better-auth_kysely-adapter_dist_index_mjs_0gi5w.w._.js +4 -0
- package/.next/standalone/.next/server/chunks/ssr/0ugq_@better-auth_kysely-adapter_dist_node-sqlite-dialect_mjs_0l4.y~0._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_diagram-OG6HWLK6_mjs_0t5sus6._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/12y~_mermaid_dist_chunks_mermaid_core_sankeyDiagram-5OEKKPKP_mjs_11ifrnu._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__026s8~z._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__06mzg2t._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0btcd4o._.js +12 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0c~og-9._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__134_q7l._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/_0pqaawz._.js +3 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_051tcva._.js +3 -0
- package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0o~d81.._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0y9k6h~._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0znncy9._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_12-ni1n._.js +1 -1
- package/.next/standalone/.next/server/chunks/ssr/src_app_signin_00yk0vm._.js +452 -0
- package/.next/standalone/.next/server/chunks/ssr/src_app_signin_signin-form_tsx_0eznlbd._.js +3 -0
- package/.next/standalone/.next/server/functions-config-manifest.json +5 -0
- package/.next/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/.next/standalone/.next/server/middleware-manifest.json +5 -5
- 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/09-jtayuhrq~b.js +1 -0
- package/.next/standalone/.next/static/chunks/0uv7ozzpiyp2_.js +1 -0
- package/.next/standalone/.next/static/chunks/135c~rq_ux73w.js +1 -0
- package/.next/standalone/.next/static/chunks/{11s9zwr7edrs7.js → 14luv~jq7e6-n.js} +12 -12
- package/.next/standalone/README.md +79 -16
- package/.next/standalone/agents/bootstrap-prompt.md +12 -1
- package/.next/standalone/agents/wiki-viewer-skill/SKILL.md +199 -6
- package/.next/standalone/docs/agent-fs-plan.md +65 -7
- package/.next/standalone/docs/file-vs-collab-authority.md +124 -0
- package/.next/standalone/package.json +1 -1
- package/.next/standalone/packages/wiki-viewer-mcp/README.md +194 -0
- package/.next/standalone/packages/wiki-viewer-mcp/dist/http-client.js +220 -0
- package/.next/standalone/packages/wiki-viewer-mcp/dist/index.js +472 -0
- package/.next/standalone/packages/wiki-viewer-mcp/dist/register.js +94 -0
- package/.next/standalone/packages/wiki-viewer-mcp/dist/state-cache.js +26 -0
- package/.next/standalone/packages/wiki-viewer-mcp/package-lock.json +1716 -0
- package/.next/standalone/packages/wiki-viewer-mcp/package.json +41 -0
- package/.next/standalone/packages/wiki-viewer-mcp/src/http-client.ts +344 -0
- package/.next/standalone/packages/wiki-viewer-mcp/src/index.ts +575 -0
- package/.next/standalone/packages/wiki-viewer-mcp/src/register.ts +144 -0
- package/.next/standalone/packages/wiki-viewer-mcp/src/state-cache.ts +45 -0
- package/.next/standalone/packages/wiki-viewer-mcp/tsconfig.json +19 -0
- package/.next/standalone/pnpm-lock.yaml +9 -9
- package/.next/standalone/src/app/api/agent/files/[...path]/route.ts +11 -1
- package/.next/standalone/src/app/api/agent/fs/file/[...path]/route.ts +344 -0
- package/.next/standalone/src/app/api/agent/fs/ls/[[...path]]/route.ts +147 -0
- package/.next/standalone/src/app/api/agent/fs/move/route.ts +125 -0
- package/.next/standalone/src/app/api/agent/fs/search/route.ts +236 -0
- package/.next/standalone/src/app/api/agent/register/route.ts +3 -3
- package/.next/standalone/src/app/api/agents/install/route.ts +44 -2
- package/.next/standalone/src/app/api/wiki/move/route.ts +10 -1
- package/.next/standalone/src/app/api/wiki/presence/route.ts +55 -0
- package/.next/standalone/src/app/signin/page.tsx +10 -225
- package/.next/standalone/src/app/signin/signin-form.tsx +238 -0
- package/.next/standalone/src/components/ai-panel/ai-panel.tsx +49 -0
- package/.next/standalone/src/components/editor/editor.tsx +38 -0
- package/.next/standalone/src/lib/proof/audit.ts +79 -0
- package/.next/standalone/src/lib/proof/auth.ts +2 -2
- package/.next/standalone/src/lib/proof/collab-state.ts +79 -0
- package/.next/standalone/src/lib/proof/lease.ts +104 -0
- package/.next/standalone/src/lib/proof/ops-applier.ts +74 -25
- package/.next/standalone/src/lib/proof/raw-fs.ts +198 -0
- package/.next/standalone/src/lib/proof/registry.ts +1 -1
- package/.next/standalone/src/lib/proof/sidecar.ts +38 -1
- package/.next/standalone/src/lib/proof/types.ts +13 -1
- package/.next/standalone/src/tests/proof/agent-fs.test.ts +824 -0
- package/.next/standalone/src/tests/proof/agents-install.test.ts +53 -0
- package/.next/standalone/src/tests/proof/collab-state.test.ts +499 -0
- package/.next/standalone/src/tests/proof/reconcile-sidecar.test.ts +195 -0
- package/.next/standalone/src/tests/proof/sidecar-lifecycle.test.ts +177 -0
- package/.next/standalone/tsconfig.tsbuildinfo +1 -1
- package/README.md +79 -16
- package/package.json +1 -1
- package/.next/standalone/.next/server/app/signin.html +0 -1
- package/.next/standalone/.next/server/app/signin.meta +0 -15
- package/.next/standalone/.next/server/app/signin.rsc +0 -23
- package/.next/standalone/.next/server/app/signin.segments/_full.segment.rsc +0 -23
- package/.next/standalone/.next/server/app/signin.segments/_head.segment.rsc +0 -6
- package/.next/standalone/.next/server/app/signin.segments/_index.segment.rsc +0 -7
- package/.next/standalone/.next/server/app/signin.segments/_tree.segment.rsc +0 -3
- package/.next/standalone/.next/server/app/signin.segments/signin/__PAGE__.segment.rsc +0 -9
- package/.next/standalone/.next/server/app/signin.segments/signin.segment.rsc +0 -5
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__09~~-nd._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__0w87kiz._.js +0 -3
- package/.next/standalone/.next/server/chunks/[root-of-the-server]__12ssbhv._.js +0 -3
- package/.next/standalone/.next/server/chunks/node_modules__pnpm_0g0fhfk._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__088hqzy._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0c147fo._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__0z.1v1z._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/[root-of-the-server]__12zp2dm._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/node_modules__pnpm_0exqvyf._.js +0 -3
- package/.next/standalone/.next/server/chunks/ssr/src_app_signin_page_tsx_1143y49._.js +0 -3
- package/.next/standalone/.next/static/chunks/0-_39e4awbk8y.js +0 -1
- package/.next/standalone/.next/static/chunks/02bxx~2cg~s6~.js +0 -1
- package/.next/standalone/.next/static/chunks/0mj_f8ncf2tks.js +0 -1
- /package/.next/standalone/.next/static/{OwXjVuoXDC_gda_BKji1J → 19j4-_brJLoulXAMekpM2}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{OwXjVuoXDC_gda_BKji1J → 19j4-_brJLoulXAMekpM2}/_clientMiddlewareManifest.js +0 -0
- /package/.next/standalone/.next/static/{OwXjVuoXDC_gda_BKji1J → 19j4-_brJLoulXAMekpM2}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "wiki-viewer-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP filesystem adapter for wiki-viewer agent API",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"wiki-viewer-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"main": "dist/index.js",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist",
|
|
14
|
+
"README.md"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc",
|
|
18
|
+
"postbuild": "node -e \"const fs=require('fs'),f='dist/index.js',c=fs.readFileSync(f,'utf8');if(!c.startsWith('#!'))fs.writeFileSync(f,'#!/usr/bin/env node\\n'+c);fs.chmodSync(f,'755');\"",
|
|
19
|
+
"dev": "tsc --watch",
|
|
20
|
+
"start": "node dist/index.js",
|
|
21
|
+
"test": "tsx --test src/__tests__/*.test.ts",
|
|
22
|
+
"prepublishOnly": "npm run build"
|
|
23
|
+
},
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=18.0.0"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@modelcontextprotocol/sdk": "^1.13.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^22.0.0",
|
|
32
|
+
"tsx": "^4.22.3",
|
|
33
|
+
"typescript": "^5.8.0"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"mcp",
|
|
37
|
+
"wiki-viewer",
|
|
38
|
+
"filesystem",
|
|
39
|
+
"agent"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed HTTP client over the wiki-viewer agent filesystem API.
|
|
3
|
+
* Contract: docs/agent-fs-plan.md §2.
|
|
4
|
+
*
|
|
5
|
+
* All methods throw WikiViewerError on non-2xx unless noted.
|
|
6
|
+
* The caller (index.ts) catches 409/412 and surfaces them cleanly to the agent.
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import * as cache from "./state-cache.js";
|
|
10
|
+
import type { CollabState, PathState } from "./state-cache.js";
|
|
11
|
+
|
|
12
|
+
// ─── Config ──────────────────────────────────────────────────────────────────
|
|
13
|
+
|
|
14
|
+
export interface ClientConfig {
|
|
15
|
+
baseUrl: string; // e.g. "https://notes.example.com"
|
|
16
|
+
token: string; // Bearer token from TOFU registration
|
|
17
|
+
agentId: string; // X-Agent-Id header
|
|
18
|
+
/** Override fetch implementation (for testing) */
|
|
19
|
+
fetch?: typeof fetch;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// ─── Errors ──────────────────────────────────────────────────────────────────
|
|
23
|
+
|
|
24
|
+
export class WikiViewerError extends Error {
|
|
25
|
+
constructor(
|
|
26
|
+
public readonly status: number,
|
|
27
|
+
public readonly code: string,
|
|
28
|
+
message: string,
|
|
29
|
+
public readonly body?: unknown,
|
|
30
|
+
) {
|
|
31
|
+
super(message);
|
|
32
|
+
this.name = "WikiViewerError";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export class IfMatchError extends WikiViewerError {
|
|
37
|
+
constructor(path: string, body?: unknown) {
|
|
38
|
+
super(412, "IF_MATCH_MISMATCH", `If-Match mismatch for ${path} — re-read before writing`, body);
|
|
39
|
+
this.name = "IfMatchError";
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export class CollabActiveError extends WikiViewerError {
|
|
44
|
+
constructor(
|
|
45
|
+
path: string,
|
|
46
|
+
public readonly snapshotUrl: string | null,
|
|
47
|
+
body?: unknown,
|
|
48
|
+
) {
|
|
49
|
+
super(409, "COLLAB_ACTIVE", `${path} is being actively collaborated on — use Tier-2 block-ops`, body);
|
|
50
|
+
this.name = "CollabActiveError";
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// ─── Response shapes ─────────────────────────────────────────────────────────
|
|
55
|
+
|
|
56
|
+
export interface ReadResult {
|
|
57
|
+
/** Raw response bytes */
|
|
58
|
+
body: Uint8Array;
|
|
59
|
+
/** UTF-8 text, if the content-type is text */
|
|
60
|
+
text: string | null;
|
|
61
|
+
sha256: string;
|
|
62
|
+
size: number;
|
|
63
|
+
mtime: string;
|
|
64
|
+
contentType: string;
|
|
65
|
+
collabState: CollabState;
|
|
66
|
+
collabRevision: number | null;
|
|
67
|
+
collabSnapshot: string | null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface WriteResult {
|
|
71
|
+
path: string;
|
|
72
|
+
sha256: string;
|
|
73
|
+
size: number;
|
|
74
|
+
mtime: string;
|
|
75
|
+
created: boolean;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export interface DirEntry {
|
|
79
|
+
name: string;
|
|
80
|
+
path: string;
|
|
81
|
+
type: "file" | "directory";
|
|
82
|
+
size: number | null;
|
|
83
|
+
mtime: string | null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface SearchMatch {
|
|
87
|
+
path: string;
|
|
88
|
+
line?: number;
|
|
89
|
+
text?: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export interface SearchResult {
|
|
93
|
+
kind: "grep" | "glob";
|
|
94
|
+
matches: SearchMatch[];
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// ─── Client ──────────────────────────────────────────────────────────────────
|
|
98
|
+
|
|
99
|
+
export class WikiViewerClient {
|
|
100
|
+
private readonly baseUrl: string;
|
|
101
|
+
private readonly token: string;
|
|
102
|
+
private readonly agentId: string;
|
|
103
|
+
private readonly _fetch: typeof fetch;
|
|
104
|
+
|
|
105
|
+
constructor(config: ClientConfig) {
|
|
106
|
+
this.baseUrl = config.baseUrl.replace(/\/$/, "");
|
|
107
|
+
this.token = config.token;
|
|
108
|
+
this.agentId = config.agentId;
|
|
109
|
+
this._fetch = config.fetch ?? globalThis.fetch;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// ── Helpers ────────────────────────────────────────────────────────────────
|
|
113
|
+
|
|
114
|
+
private headers(extra: Record<string, string> = {}): Record<string, string> {
|
|
115
|
+
return {
|
|
116
|
+
Authorization: `Bearer ${this.token}`,
|
|
117
|
+
"X-Agent-Id": this.agentId,
|
|
118
|
+
...extra,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
private url(path: string, params?: Record<string, string>): string {
|
|
123
|
+
const u = new URL(`${this.baseUrl}${path}`);
|
|
124
|
+
if (params) {
|
|
125
|
+
for (const [k, v] of Object.entries(params)) {
|
|
126
|
+
u.searchParams.set(k, v);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return u.toString();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
private async assertOk(res: Response, path: string): Promise<void> {
|
|
133
|
+
if (res.ok) return;
|
|
134
|
+
let body: unknown;
|
|
135
|
+
try { body = await res.json(); } catch { body = await res.text().catch(() => undefined); }
|
|
136
|
+
if (res.status === 412) throw new IfMatchError(path, body);
|
|
137
|
+
if (res.status === 409) {
|
|
138
|
+
const snapshotUrl = (body as Record<string, unknown>)?.snapshotUrl as string | null ?? null;
|
|
139
|
+
throw new CollabActiveError(path, snapshotUrl, body);
|
|
140
|
+
}
|
|
141
|
+
throw new WikiViewerError(
|
|
142
|
+
res.status,
|
|
143
|
+
`HTTP_${res.status}`,
|
|
144
|
+
`wiki-viewer ${res.status} for ${path}: ${res.statusText}`,
|
|
145
|
+
body,
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
private parseCollabHeaders(res: Response): Pick<ReadResult, "collabState" | "collabRevision" | "collabSnapshot"> {
|
|
150
|
+
const raw = (res.headers.get("X-Collab-State") ?? "not-markdown") as CollabState;
|
|
151
|
+
const validStates: CollabState[] = ["active", "tracked", "untracked", "not-markdown"];
|
|
152
|
+
const collabState: CollabState = validStates.includes(raw) ? raw : "not-markdown";
|
|
153
|
+
const revRaw = res.headers.get("X-Collab-Revision");
|
|
154
|
+
const collabRevision = revRaw !== null ? parseInt(revRaw, 10) : null;
|
|
155
|
+
const collabSnapshot = res.headers.get("X-Collab-Snapshot") ?? null;
|
|
156
|
+
return { collabState, collabRevision, collabSnapshot };
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// ── read_file ──────────────────────────────────────────────────────────────
|
|
160
|
+
|
|
161
|
+
async readFile(path: string, range?: string): Promise<ReadResult> {
|
|
162
|
+
const extraHeaders: Record<string, string> = {};
|
|
163
|
+
if (range) extraHeaders["Range"] = range;
|
|
164
|
+
|
|
165
|
+
const res = await this._fetch(
|
|
166
|
+
this.url(`/api/agent/fs/file/${encodeFilePath(path)}`),
|
|
167
|
+
{ headers: this.headers(extraHeaders) },
|
|
168
|
+
);
|
|
169
|
+
await this.assertOk(res, path);
|
|
170
|
+
|
|
171
|
+
const sha256 = stripQuotes(res.headers.get("ETag") ?? "");
|
|
172
|
+
const size = parseInt(res.headers.get("X-File-Size") ?? "0", 10);
|
|
173
|
+
const mtime = res.headers.get("X-File-Mtime") ?? "";
|
|
174
|
+
const contentType = res.headers.get("Content-Type") ?? "application/octet-stream";
|
|
175
|
+
const collab = this.parseCollabHeaders(res);
|
|
176
|
+
|
|
177
|
+
const bodyBuf = new Uint8Array(await res.arrayBuffer());
|
|
178
|
+
const isText = contentType.startsWith("text/") ||
|
|
179
|
+
contentType.includes("json") ||
|
|
180
|
+
contentType.includes("xml") ||
|
|
181
|
+
contentType.includes("javascript") ||
|
|
182
|
+
contentType.includes("typescript");
|
|
183
|
+
|
|
184
|
+
const text = isText ? new TextDecoder().decode(bodyBuf) : null;
|
|
185
|
+
|
|
186
|
+
const state: PathState = {
|
|
187
|
+
sha256,
|
|
188
|
+
collabState: collab.collabState,
|
|
189
|
+
collabRevision: collab.collabRevision,
|
|
190
|
+
collabSnapshot: collab.collabSnapshot,
|
|
191
|
+
fetchedAt: Date.now(),
|
|
192
|
+
};
|
|
193
|
+
cache.set(path, state);
|
|
194
|
+
|
|
195
|
+
return { body: bodyBuf, text, sha256, size, mtime, contentType, ...collab };
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// ── write_file ─────────────────────────────────────────────────────────────
|
|
199
|
+
|
|
200
|
+
async writeFile(
|
|
201
|
+
path: string,
|
|
202
|
+
content: string | Uint8Array,
|
|
203
|
+
opts: {
|
|
204
|
+
ifMatch?: string;
|
|
205
|
+
mkdirs?: boolean;
|
|
206
|
+
force?: boolean;
|
|
207
|
+
/** If-Collab-Match: X-Collab-Revision value (when knowingly writing to a tracked .md) */
|
|
208
|
+
ifCollabMatch?: number;
|
|
209
|
+
} = {},
|
|
210
|
+
): Promise<WriteResult> {
|
|
211
|
+
const extraHeaders: Record<string, string> = {};
|
|
212
|
+
// Auto-fill If-Match from the last-read sha (cache) on overwrite, unless the
|
|
213
|
+
// caller explicitly supplied one or is forcing. A create (no cached sha) omits it.
|
|
214
|
+
const ifMatch = opts.ifMatch ?? (opts.force ? undefined : cache.get(path)?.sha256);
|
|
215
|
+
if (ifMatch) extraHeaders["If-Match"] = ifMatch;
|
|
216
|
+
if (opts.ifCollabMatch !== undefined) {
|
|
217
|
+
extraHeaders["If-Collab-Match"] = String(opts.ifCollabMatch);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const params: Record<string, string> = {};
|
|
221
|
+
if (opts.mkdirs) params["mkdirs"] = "true";
|
|
222
|
+
if (opts.force) params["force"] = "true";
|
|
223
|
+
|
|
224
|
+
const body: BodyInit = typeof content === "string"
|
|
225
|
+
? (new TextEncoder().encode(content) as unknown as Uint8Array<ArrayBuffer>)
|
|
226
|
+
: (content as unknown as Uint8Array<ArrayBuffer>);
|
|
227
|
+
|
|
228
|
+
const res = await this._fetch(
|
|
229
|
+
this.url(`/api/agent/fs/file/${encodeFilePath(path)}`, params),
|
|
230
|
+
{
|
|
231
|
+
method: "PUT",
|
|
232
|
+
headers: this.headers({ "Content-Type": "application/octet-stream", ...extraHeaders }),
|
|
233
|
+
body,
|
|
234
|
+
},
|
|
235
|
+
);
|
|
236
|
+
await this.assertOk(res, path);
|
|
237
|
+
|
|
238
|
+
const result: WriteResult = await res.json() as WriteResult;
|
|
239
|
+
// Update cache after successful write
|
|
240
|
+
cache.set(path, {
|
|
241
|
+
sha256: result.sha256,
|
|
242
|
+
collabState: "not-markdown",
|
|
243
|
+
collabRevision: null,
|
|
244
|
+
collabSnapshot: null,
|
|
245
|
+
fetchedAt: Date.now(),
|
|
246
|
+
});
|
|
247
|
+
return result;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// ── delete_file ────────────────────────────────────────────────────────────
|
|
251
|
+
|
|
252
|
+
async deleteFile(
|
|
253
|
+
path: string,
|
|
254
|
+
ifMatch: string,
|
|
255
|
+
opts: { recursive?: boolean; force?: boolean } = {},
|
|
256
|
+
): Promise<void> {
|
|
257
|
+
const params: Record<string, string> = {};
|
|
258
|
+
if (opts.recursive) params["recursive"] = "true";
|
|
259
|
+
if (opts.force) params["force"] = "true";
|
|
260
|
+
|
|
261
|
+
const res = await this._fetch(
|
|
262
|
+
this.url(`/api/agent/fs/file/${encodeFilePath(path)}`, params),
|
|
263
|
+
{
|
|
264
|
+
method: "DELETE",
|
|
265
|
+
headers: this.headers({ "If-Match": ifMatch }),
|
|
266
|
+
},
|
|
267
|
+
);
|
|
268
|
+
await this.assertOk(res, path);
|
|
269
|
+
cache.del(path);
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// ── list_directory ─────────────────────────────────────────────────────────
|
|
273
|
+
|
|
274
|
+
async listDirectory(
|
|
275
|
+
path: string,
|
|
276
|
+
opts: { recursive?: boolean; depth?: number; limit?: number } = {},
|
|
277
|
+
): Promise<DirEntry[]> {
|
|
278
|
+
const params: Record<string, string> = {};
|
|
279
|
+
if (opts.recursive) params["recursive"] = "true";
|
|
280
|
+
if (opts.depth !== undefined) params["depth"] = String(opts.depth);
|
|
281
|
+
if (opts.limit !== undefined) params["limit"] = String(opts.limit);
|
|
282
|
+
|
|
283
|
+
const res = await this._fetch(
|
|
284
|
+
this.url(`/api/agent/fs/ls/${encodeFilePath(path)}`, params),
|
|
285
|
+
{ headers: this.headers() },
|
|
286
|
+
);
|
|
287
|
+
await this.assertOk(res, path);
|
|
288
|
+
return res.json() as Promise<DirEntry[]>;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// ── search ────────────────────────────────────────────────────────────────
|
|
292
|
+
|
|
293
|
+
async search(body: {
|
|
294
|
+
kind: "grep" | "glob";
|
|
295
|
+
query: string;
|
|
296
|
+
path?: string;
|
|
297
|
+
glob?: string;
|
|
298
|
+
limit?: number;
|
|
299
|
+
}): Promise<SearchResult> {
|
|
300
|
+
const res = await this._fetch(
|
|
301
|
+
this.url("/api/agent/fs/search"),
|
|
302
|
+
{
|
|
303
|
+
method: "POST",
|
|
304
|
+
headers: this.headers({ "Content-Type": "application/json" }),
|
|
305
|
+
body: JSON.stringify(body),
|
|
306
|
+
},
|
|
307
|
+
);
|
|
308
|
+
await this.assertOk(res, "search");
|
|
309
|
+
return res.json() as Promise<SearchResult>;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
// ── move_file ─────────────────────────────────────────────────────────────
|
|
313
|
+
|
|
314
|
+
async moveFile(from: string, to: string, ifMatch?: string): Promise<void> {
|
|
315
|
+
const body: Record<string, string> = { from, to };
|
|
316
|
+
if (ifMatch) body["ifMatch"] = ifMatch;
|
|
317
|
+
|
|
318
|
+
const res = await this._fetch(
|
|
319
|
+
this.url("/api/agent/fs/move"),
|
|
320
|
+
{
|
|
321
|
+
method: "POST",
|
|
322
|
+
headers: this.headers({ "Content-Type": "application/json" }),
|
|
323
|
+
body: JSON.stringify(body),
|
|
324
|
+
},
|
|
325
|
+
);
|
|
326
|
+
await this.assertOk(res, from);
|
|
327
|
+
cache.rename(from, to);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
// ─── Helpers ─────────────────────────────────────────────────────────────────
|
|
332
|
+
|
|
333
|
+
/** Encode path segments but preserve slashes */
|
|
334
|
+
function encodeFilePath(path: string): string {
|
|
335
|
+
return path
|
|
336
|
+
.replace(/^\/+/, "")
|
|
337
|
+
.split("/")
|
|
338
|
+
.map((seg) => encodeURIComponent(seg))
|
|
339
|
+
.join("/");
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
function stripQuotes(etag: string): string {
|
|
343
|
+
return etag.replace(/^"/, "").replace(/"$/, "");
|
|
344
|
+
}
|