kontexta 4.3.1
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/LICENSE +191 -0
- package/README.md +58 -0
- package/bundle/standalone/CHANGELOG.md +382 -0
- package/bundle/standalone/apps/web/.next/BUILD_ID +1 -0
- package/bundle/standalone/apps/web/.next/app-build-manifest.json +403 -0
- package/bundle/standalone/apps/web/.next/app-path-routes-manifest.json +60 -0
- package/bundle/standalone/apps/web/.next/build-manifest.json +33 -0
- package/bundle/standalone/apps/web/.next/package.json +1 -0
- package/bundle/standalone/apps/web/.next/prerender-manifest.json +148 -0
- package/bundle/standalone/apps/web/.next/react-loadable-manifest.json +300 -0
- package/bundle/standalone/apps/web/.next/required-server-files.json +344 -0
- package/bundle/standalone/apps/web/.next/routes-manifest.json +210 -0
- package/bundle/standalone/apps/web/.next/server/app/_not-found/page.js +2 -0
- package/bundle/standalone/apps/web/.next/server/app/_not-found/page.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/_not-found.html +1 -0
- package/bundle/standalone/apps/web/.next/server/app/_not-found.meta +8 -0
- package/bundle/standalone/apps/web/.next/server/app/_not-found.rsc +22 -0
- package/bundle/standalone/apps/web/.next/server/app/api/about/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/about/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/about/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/auth/login/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/auth/login/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/auth/logout/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/auth/logout/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/auth/setup/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/auth/setup/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/auth/setup/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/auth/status/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/auth/status/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/auth/token/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/auth/token/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/auth/token/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/conflicts/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/conflicts/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/conflicts/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/[id]/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/[id]/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/[id]/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/entities/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/[id]/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/[id]/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/[id]/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/events/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/ics/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/ics/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/ics/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/links/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/links/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/links/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/settings/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/settings/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/calendar/settings/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/clip/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/clip/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/clip/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/docker-config/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/docker-config/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/docker-config/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/export/zip/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/export/zip/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/export/zip/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/download/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/download/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/download/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/export-pdf/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/export-pdf/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/export-pdf/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/restore/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/restore/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/restore/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/history/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/move/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/move/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/move/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/[id]/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/upload/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/upload/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/files/upload/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/folders/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/folders/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/folders/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/git/remote/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/git/remote/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/git/remote/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/git/sync-all/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/git/sync-all/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/git/sync-all/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/hands/test-pattern/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/hands/test-pattern/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/hands/test-pattern/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/hands/validate/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/hands/validate/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/hands/validate/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/health/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/health/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/health/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/install-snippets/route.js +17 -0
- package/bundle/standalone/apps/web/.next/server/app/api/install-snippets/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/install-snippets/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/mcp-tools/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/mcp-tools/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/mcp-tools/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/profile/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/profile/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/profile/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/hands-config/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/hands-config/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/hands-config/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-config/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-config/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-config/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-status/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-status/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/journal-status/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/onboard/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/onboard/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/onboard/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/refresh/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/refresh/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/refresh/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/sync/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/sync/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/[id]/sync/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/onboard/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/onboard/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/onboard/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/projects/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/publish/html/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/publish/html/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/publish/html/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/publish/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/publish/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/publish/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/refresh/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/refresh/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/refresh/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/reindex/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/reindex/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/reindex/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/search/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/search/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/search/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/tags/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/tags/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/tags/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/ws-config/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/ws-config/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/api/ws-config/route_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/apple-icon.png/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/apple-icon.png/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/apple-icon.png.body +0 -0
- package/bundle/standalone/apps/web/.next/server/app/apple-icon.png.meta +1 -0
- package/bundle/standalone/apps/web/.next/server/app/calendar/page.js +2 -0
- package/bundle/standalone/apps/web/.next/server/app/calendar/page.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/calendar/page_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/favicon.ico/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/favicon.ico/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/favicon.ico.body +0 -0
- package/bundle/standalone/apps/web/.next/server/app/favicon.ico.meta +1 -0
- package/bundle/standalone/apps/web/.next/server/app/icon.png/route.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/icon.png/route.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/icon.png.body +0 -0
- package/bundle/standalone/apps/web/.next/server/app/icon.png.meta +1 -0
- package/bundle/standalone/apps/web/.next/server/app/login/page.js +2 -0
- package/bundle/standalone/apps/web/.next/server/app/login/page.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/login/page_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/page.js +9 -0
- package/bundle/standalone/apps/web/.next/server/app/page.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/page_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/preview/motifs/page.js +6 -0
- package/bundle/standalone/apps/web/.next/server/app/preview/motifs/page.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/app/preview/motifs/page_client-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/app/preview/motifs.html +5 -0
- package/bundle/standalone/apps/web/.next/server/app/preview/motifs.meta +7 -0
- package/bundle/standalone/apps/web/.next/server/app/preview/motifs.rsc +29 -0
- package/bundle/standalone/apps/web/.next/server/app-paths-manifest.json +60 -0
- package/bundle/standalone/apps/web/.next/server/chunks/1018.js +115 -0
- package/bundle/standalone/apps/web/.next/server/chunks/1096.js +23 -0
- package/bundle/standalone/apps/web/.next/server/chunks/1139.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/128.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/1921.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/2034.js +36 -0
- package/bundle/standalone/apps/web/.next/server/chunks/2048.js +64 -0
- package/bundle/standalone/apps/web/.next/server/chunks/2065.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/2144.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/2151.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/2161.js +153 -0
- package/bundle/standalone/apps/web/.next/server/chunks/2450.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/246.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/260.js +24 -0
- package/bundle/standalone/apps/web/.next/server/chunks/269.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/2792.js +287 -0
- package/bundle/standalone/apps/web/.next/server/chunks/2923.js +22 -0
- package/bundle/standalone/apps/web/.next/server/chunks/2944.js +77 -0
- package/bundle/standalone/apps/web/.next/server/chunks/3334.js +141 -0
- package/bundle/standalone/apps/web/.next/server/chunks/3668.js +9 -0
- package/bundle/standalone/apps/web/.next/server/chunks/3758.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/3833.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/3990.js +2 -0
- package/bundle/standalone/apps/web/.next/server/chunks/4274.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/4290.js +252 -0
- package/bundle/standalone/apps/web/.next/server/chunks/4347.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/4550.js +226 -0
- package/bundle/standalone/apps/web/.next/server/chunks/4824.js +166 -0
- package/bundle/standalone/apps/web/.next/server/chunks/509.js +43 -0
- package/bundle/standalone/apps/web/.next/server/chunks/5104.js +215 -0
- package/bundle/standalone/apps/web/.next/server/chunks/5186.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/5400.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/5558.js +80 -0
- package/bundle/standalone/apps/web/.next/server/chunks/6496.js +93 -0
- package/bundle/standalone/apps/web/.next/server/chunks/6693.js +148 -0
- package/bundle/standalone/apps/web/.next/server/chunks/6775.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/7020.js +29 -0
- package/bundle/standalone/apps/web/.next/server/chunks/7098.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/7117.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/7204.js +104 -0
- package/bundle/standalone/apps/web/.next/server/chunks/7342.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/7629.js +80 -0
- package/bundle/standalone/apps/web/.next/server/chunks/7784.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/8286.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/8349.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/8620.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/8675.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/8860.js +24 -0
- package/bundle/standalone/apps/web/.next/server/chunks/8896.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/8950.js +5 -0
- package/bundle/standalone/apps/web/.next/server/chunks/8960.js +79 -0
- package/bundle/standalone/apps/web/.next/server/chunks/899.js +2 -0
- package/bundle/standalone/apps/web/.next/server/chunks/9069.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/9315.js +34 -0
- package/bundle/standalone/apps/web/.next/server/chunks/9372.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/9555.js +6 -0
- package/bundle/standalone/apps/web/.next/server/chunks/9571.js +9 -0
- package/bundle/standalone/apps/web/.next/server/chunks/9681.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/97.js +90 -0
- package/bundle/standalone/apps/web/.next/server/chunks/9797.js +1 -0
- package/bundle/standalone/apps/web/.next/server/chunks/989.js +1 -0
- package/bundle/standalone/apps/web/.next/server/functions-config-manifest.json +4 -0
- package/bundle/standalone/apps/web/.next/server/instrumentation.js +1 -0
- package/bundle/standalone/apps/web/.next/server/middleware-build-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/middleware-manifest.json +6 -0
- package/bundle/standalone/apps/web/.next/server/middleware-react-loadable-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/next-font-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/next-font-manifest.json +1 -0
- package/bundle/standalone/apps/web/.next/server/pages/404.html +1 -0
- package/bundle/standalone/apps/web/.next/server/pages/500.html +1 -0
- package/bundle/standalone/apps/web/.next/server/pages/_app.js +1 -0
- package/bundle/standalone/apps/web/.next/server/pages/_app.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/pages/_document.js +1 -0
- package/bundle/standalone/apps/web/.next/server/pages/_document.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/pages/_error.js +19 -0
- package/bundle/standalone/apps/web/.next/server/pages/_error.js.nft.json +1 -0
- package/bundle/standalone/apps/web/.next/server/pages-manifest.json +6 -0
- package/bundle/standalone/apps/web/.next/server/server-reference-manifest.js +1 -0
- package/bundle/standalone/apps/web/.next/server/server-reference-manifest.json +1 -0
- package/bundle/standalone/apps/web/.next/server/webpack-runtime.js +1 -0
- package/bundle/standalone/apps/web/.next/static/TwaiLte1NHCp3gRYUc-go/_buildManifest.js +1 -0
- package/bundle/standalone/apps/web/.next/static/TwaiLte1NHCp3gRYUc-go/_ssgManifest.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/02852184.a3b62691cdc349cf.js +80 -0
- package/bundle/standalone/apps/web/.next/static/chunks/1226.49d217dc03a1770f.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/1286.8da72129ab3aa8fd.js +77 -0
- package/bundle/standalone/apps/web/.next/static/chunks/1403cfaa-33c2b74c127517c2.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/171.a4732e77e941b2cd.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/1733.3a6dae5cc3785d0b.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/2081.313746c212bfc5c9.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/2086.0b05a08670aae1db.js +226 -0
- package/bundle/standalone/apps/web/.next/static/chunks/2377-956eb9b333193ac6.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/3034.e1171cbeeed85923.js +5 -0
- package/bundle/standalone/apps/web/.next/static/chunks/3068-293b252158eb9d15.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/3297.7664b51ee69c7513.js +23 -0
- package/bundle/standalone/apps/web/.next/static/chunks/338.77f45c7810885961.js +115 -0
- package/bundle/standalone/apps/web/.next/static/chunks/3471.7790a4192ef84a1a.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/3514.14aa56fe189fd052.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/3696.5d462babda0c0b9e.js +34 -0
- package/bundle/standalone/apps/web/.next/static/chunks/408.82356d1e11e880d9.js +93 -0
- package/bundle/standalone/apps/web/.next/static/chunks/46.9922e50f2158e1a9.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/4798.d851e8027b2db933.js +287 -0
- package/bundle/standalone/apps/web/.next/static/chunks/4908.2fed0b6fbc391b55.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/4915.97b9c59991c26fa7.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/492.234794e12315e4bb.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/4936.c65cdd63440ade70.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/5127.e5e917b5cb9c4e52.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/5141.93a42ebd1580da60.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/5159-7bcf68ab11c1091e.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/5514.f969d5c86c590512.js +73 -0
- package/bundle/standalone/apps/web/.next/static/chunks/559.c4615787d977bf47.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/5667.e0097b2112faa29b.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/6367.fd87728718a97771.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/6394.c2172a59c01bd0bd.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/6396.d288334e13a70139.js +24 -0
- package/bundle/standalone/apps/web/.next/static/chunks/6483.88695b22b21b10f1.js +9 -0
- package/bundle/standalone/apps/web/.next/static/chunks/6561.176d35e576df3f9d.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/6584.87fc375a0510108d.js +104 -0
- package/bundle/standalone/apps/web/.next/static/chunks/693.71c8b97896628a66.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/6934.45e50410379dc377.js +79 -0
- package/bundle/standalone/apps/web/.next/static/chunks/6a2ca82e.c26cb70da3106c1c.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/6b5bb80a.c511153adad62faf.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/7216.d1b096d2a35967fd.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/7342.fcb52cf5f7ce0e17.js +29 -0
- package/bundle/standalone/apps/web/.next/static/chunks/7541.43ff810bb14fd5c0.js +43 -0
- package/bundle/standalone/apps/web/.next/static/chunks/7563.376c2692778a62b3.js +148 -0
- package/bundle/standalone/apps/web/.next/static/chunks/7756.b0dd00e996549a39.js +24 -0
- package/bundle/standalone/apps/web/.next/static/chunks/8052.69c066e56bbd5d6c.js +64 -0
- package/bundle/standalone/apps/web/.next/static/chunks/8080c6f4.ed360e7424d6fe99.js +62 -0
- package/bundle/standalone/apps/web/.next/static/chunks/8280.81c2b0d61e27a576.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/8547.5bef8f1afd162429.js +90 -0
- package/bundle/standalone/apps/web/.next/static/chunks/8602.0b457ca55bd2c08e.js +141 -0
- package/bundle/standalone/apps/web/.next/static/chunks/8794.401ab179d53aa5d5.js +80 -0
- package/bundle/standalone/apps/web/.next/static/chunks/9053.c953d758ff5dc6ee.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/9122.cf7fd16fc8d7fad0.js +36 -0
- package/bundle/standalone/apps/web/.next/static/chunks/9255.78469e88fa06e186.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/944.ba7dcdca1c72114a.js +166 -0
- package/bundle/standalone/apps/web/.next/static/chunks/9794-16144bed6de4bf26.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/9852.e1937ca867a99475.js +215 -0
- package/bundle/standalone/apps/web/.next/static/chunks/9981.8fa0bb90a26c66eb.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/a118fb18.9c3b4291884abee0.js +119 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/_not-found/page-972b01bf23ed0942.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/about/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/login/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/logout/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/setup/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/status/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/auth/token/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/conflicts/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/entities/[id]/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/entities/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/events/[id]/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/events/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/ics/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/links/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/calendar/settings/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/clip/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/docker-config/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/export/zip/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/download/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/export-pdf/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/history/restore/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/history/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/move/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/[id]/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/files/upload/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/folders/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/git/remote/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/git/sync-all/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/hands/test-pattern/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/hands/validate/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/health/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/install-snippets/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/mcp-tools/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/profile/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/hands-config/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/journal-config/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/journal-status/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/onboard/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/refresh/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/[id]/sync/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/onboard/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/projects/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/publish/html/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/publish/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/refresh/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/reindex/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/search/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/tags/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/api/ws-config/route-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/calendar/page-180fba7a5e149d79.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/layout-9a9569fc88cd95d2.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/login/page-d299785546ea6ab6.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/page-2b151d30cb29d2e5.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/app/preview/motifs/page-c1d02d72a16497fa.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/d185f5cd.71b8f43667fbf60d.js +153 -0
- package/bundle/standalone/apps/web/.next/static/chunks/framework-d5846a86e24c79c9.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/main-0205543fb3b69ad5.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/main-app-20d292116f434ff3.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/pages/_app-fe81927504f65cde.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/pages/_error-2973b69c43483f0b.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/polyfills-42372ed130431b0a.js +1 -0
- package/bundle/standalone/apps/web/.next/static/chunks/webpack-8818fea786a923fe.js +1 -0
- package/bundle/standalone/apps/web/.next/static/css/c00514317f297826.css +3 -0
- package/bundle/standalone/apps/web/.next/static/media/0aa834ed78bf6d07-s.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/19cfc7226ec3afaa-s.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/21350d82a1f187e9-s.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/438aa629764e75f3-s.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/4c9affa5bc8f420e-s.p.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/51251f8b9793cdb3-s.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/67957d42bae0796d-s.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/875ae681bfde4580-s.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/886030b0b59bc5a7-s.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/8e9860b6e62d6359-s.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/939c4f875ee75fbb-s.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/9b01607e2f794050-s.p.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/a5ded5fed781d3c1-s.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/ba9851c3c22cd980-s.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/bb3ef058b751a6ad-s.p.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/c5fe6dc8356a8c31-s.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/cc978ac5ee68c2b6-s.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/df0a9ae256c0569c-s.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/e4af272ccee01ff0-s.p.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/e857b654a2caa584-s.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/f28ff2d15b1e9bd8-s.woff2 +0 -0
- package/bundle/standalone/apps/web/.next/static/media/f911b923c6adde36-s.woff2 +0 -0
- package/bundle/standalone/apps/web/package.json +66 -0
- package/bundle/standalone/apps/web/public/logo-dark.png +0 -0
- package/bundle/standalone/apps/web/public/logo.png +0 -0
- package/bundle/standalone/apps/web/server.js +38 -0
- package/bundle/standalone/apps/web/src/lib/mcp-tools.json +1941 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/agent-rules/rules-block.md +185 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/calendar-tools.d.ts +2 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/calendar-tools.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/calendar-tools.js +205 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/calendar-tools.js.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/confirm.d.ts +25 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/confirm.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/confirm.js +40 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/confirm.js.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/executor.d.ts +13 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/executor.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/executor.js +250 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/executor.js.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/formatter.d.ts +11 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/formatter.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/formatter.js +39 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/formatter.js.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/loader.d.ts +4 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/loader.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/loader.js +164 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/loader.js.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/registry.d.ts +42 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/registry.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/registry.js +143 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/registry.js.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/sanitizer.d.ts +16 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/sanitizer.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/sanitizer.js +86 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/sanitizer.js.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/schema-doc.d.ts +2 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/schema-doc.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/schema-doc.js +202 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/schema-doc.js.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/types.d.ts +50 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/types.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/types.js +2 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/hands/types.js.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/index.d.ts +3 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/index.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/index.js +2117 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/index.js.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-capture.d.ts +31 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-capture.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-capture.js +293 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-capture.js.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-commit-upgrades-tool.d.ts +2 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-commit-upgrades-tool.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-commit-upgrades-tool.js +24 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-commit-upgrades-tool.js.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-housekeep-tool.d.ts +2 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-housekeep-tool.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-housekeep-tool.js +24 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-housekeep-tool.js.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-tools.d.ts +2 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-tools.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-tools.js +57 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/journal-tools.js.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/migrations/001-initial.sql +72 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/migrations/002-remote-git.sql +2 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/migrations/003-source-path-index.sql +2 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/migrations/004-journaling.sql +44 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/migrations/005-auth.sql +7 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/migrations/006-journal-locks.sql +11 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/migrations/007-calendar.sql +49 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/profile-tool.d.ts +9 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/profile-tool.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/profile-tool.js +25 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/profile-tool.js.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/re2-compat.d.ts +4 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/re2-compat.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/re2-compat.js +14 -0
- package/bundle/standalone/node_modules/kontexta-mcp/dist/re2-compat.js.map +1 -0
- package/bundle/standalone/node_modules/kontexta-mcp/package.json +66 -0
- package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/index.d.ts +73 -0
- package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/index.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/index.js +436 -0
- package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/index.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/agent-rules/rules-block.md +185 -0
- package/bundle/standalone/node_modules/kxta-core/dist/bundle/index.d.ts +26 -0
- package/bundle/standalone/node_modules/kxta-core/dist/bundle/index.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/bundle/index.js +115 -0
- package/bundle/standalone/node_modules/kxta-core/dist/bundle/index.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/conflicts.d.ts +32 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/conflicts.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/conflicts.js +129 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/conflicts.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/ics.d.ts +16 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/ics.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/ics.js +73 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/ics.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/index.d.ts +9 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/index.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/index.js +7 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/index.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/repository.d.ts +65 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/repository.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/repository.js +219 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/repository.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/types.d.ts +52 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/types.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/types.js +2 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/types.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/validate.d.ts +11 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/validate.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/validate.js +39 -0
- package/bundle/standalone/node_modules/kxta-core/dist/calendar/validate.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/clip/extract.d.ts +26 -0
- package/bundle/standalone/node_modules/kxta-core/dist/clip/extract.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/clip/extract.js +315 -0
- package/bundle/standalone/node_modules/kxta-core/dist/clip/extract.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/clip/frontmatter.d.ts +10 -0
- package/bundle/standalone/node_modules/kxta-core/dist/clip/frontmatter.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/clip/frontmatter.js +53 -0
- package/bundle/standalone/node_modules/kxta-core/dist/clip/frontmatter.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/clip/index.d.ts +12 -0
- package/bundle/standalone/node_modules/kxta-core/dist/clip/index.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/clip/index.js +38 -0
- package/bundle/standalone/node_modules/kxta-core/dist/clip/index.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/compat/env-shim.d.ts +2 -0
- package/bundle/standalone/node_modules/kxta-core/dist/compat/env-shim.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/compat/env-shim.js +26 -0
- package/bundle/standalone/node_modules/kxta-core/dist/compat/env-shim.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/compat/file-migration.d.ts +3 -0
- package/bundle/standalone/node_modules/kxta-core/dist/compat/file-migration.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/compat/file-migration.js +30 -0
- package/bundle/standalone/node_modules/kxta-core/dist/compat/file-migration.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/db/index.d.ts +37 -0
- package/bundle/standalone/node_modules/kxta-core/dist/db/index.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/db/index.js +182 -0
- package/bundle/standalone/node_modules/kxta-core/dist/db/index.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/db/migrations/001-initial.sql +72 -0
- package/bundle/standalone/node_modules/kxta-core/dist/db/migrations/002-remote-git.sql +2 -0
- package/bundle/standalone/node_modules/kxta-core/dist/db/migrations/003-source-path-index.sql +2 -0
- package/bundle/standalone/node_modules/kxta-core/dist/db/migrations/004-journaling.sql +44 -0
- package/bundle/standalone/node_modules/kxta-core/dist/db/migrations/005-auth.sql +7 -0
- package/bundle/standalone/node_modules/kxta-core/dist/db/migrations/006-journal-locks.sql +11 -0
- package/bundle/standalone/node_modules/kxta-core/dist/db/migrations/007-calendar.sql +49 -0
- package/bundle/standalone/node_modules/kxta-core/dist/files/index.d.ts +84 -0
- package/bundle/standalone/node_modules/kxta-core/dist/files/index.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/files/index.js +631 -0
- package/bundle/standalone/node_modules/kxta-core/dist/files/index.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/files/sections.d.ts +48 -0
- package/bundle/standalone/node_modules/kxta-core/dist/files/sections.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/files/sections.js +112 -0
- package/bundle/standalone/node_modules/kxta-core/dist/files/sections.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/git/index.d.ts +92 -0
- package/bundle/standalone/node_modules/kxta-core/dist/git/index.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/git/index.js +801 -0
- package/bundle/standalone/node_modules/kxta-core/dist/git/index.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/index.d.ts +24 -0
- package/bundle/standalone/node_modules/kxta-core/dist/index.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/index.js +22 -0
- package/bundle/standalone/node_modules/kxta-core/dist/index.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/cooldown.d.ts +28 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/cooldown.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/cooldown.js +61 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/cooldown.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/distill.d.ts +16 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/distill.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/distill.js +311 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/distill.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/engine.d.ts +45 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/engine.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/engine.js +198 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/engine.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/git-watcher.d.ts +11 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/git-watcher.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/git-watcher.js +41 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/git-watcher.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/high-water.d.ts +16 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/high-water.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/high-water.js +30 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/high-water.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/housekeep.d.ts +22 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/housekeep.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/housekeep.js +104 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/housekeep.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/index.d.ts +27 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/index.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/index.js +18 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/index.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/build-failure-recovery.d.ts +3 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/build-failure-recovery.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/build-failure-recovery.js +31 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/build-failure-recovery.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/error-recovery.d.ts +3 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/error-recovery.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/error-recovery.js +31 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/error-recovery.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/exploration.d.ts +3 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/exploration.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/exploration.js +28 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/exploration.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/extra-loader.d.ts +13 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/extra-loader.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/extra-loader.js +45 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/extra-loader.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/feature-development.d.ts +3 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/feature-development.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/feature-development.js +21 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/feature-development.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/incident-response.d.ts +3 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/incident-response.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/incident-response.js +21 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/incident-response.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/index.d.ts +16 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/index.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/index.js +40 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/index.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/pivot.d.ts +3 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/pivot.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/pivot.js +15 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/pivot.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/read-only-investigation.d.ts +3 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/read-only-investigation.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/read-only-investigation.js +24 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/read-only-investigation.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/refactor.d.ts +3 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/refactor.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/refactor.js +42 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/refactor.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tagging-pass.d.ts +3 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tagging-pass.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tagging-pass.js +22 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/tagging-pass.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/test-cycle.d.ts +3 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/test-cycle.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/test-cycle.js +23 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/patterns/test-cycle.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/presence.d.ts +2 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/presence.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/presence.js +17 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/presence.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/redact.d.ts +8 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/redact.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/redact.js +40 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/redact.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/renderer.d.ts +10 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/renderer.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/renderer.js +40 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/renderer.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/repository.d.ts +30 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/repository.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/repository.js +66 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/repository.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/strict-mode.d.ts +9 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/strict-mode.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/strict-mode.js +32 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/strict-mode.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/topic-detector.d.ts +4 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/topic-detector.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/topic-detector.js +71 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/topic-detector.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/types.d.ts +59 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/types.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/types.js +3 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/types.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/writer.d.ts +16 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/writer.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/writer.js +44 -0
- package/bundle/standalone/node_modules/kxta-core/dist/journal/writer.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/metadata/index.d.ts +97 -0
- package/bundle/standalone/node_modules/kxta-core/dist/metadata/index.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/metadata/index.js +517 -0
- package/bundle/standalone/node_modules/kxta-core/dist/metadata/index.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/metadata/settings.d.ts +13 -0
- package/bundle/standalone/node_modules/kxta-core/dist/metadata/settings.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/metadata/settings.js +33 -0
- package/bundle/standalone/node_modules/kxta-core/dist/metadata/settings.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/profile/index.d.ts +23 -0
- package/bundle/standalone/node_modules/kxta-core/dist/profile/index.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/profile/index.js +161 -0
- package/bundle/standalone/node_modules/kxta-core/dist/profile/index.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/project-map/index.d.ts +34 -0
- package/bundle/standalone/node_modules/kxta-core/dist/project-map/index.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/project-map/index.js +157 -0
- package/bundle/standalone/node_modules/kxta-core/dist/project-map/index.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/types.d.ts +69 -0
- package/bundle/standalone/node_modules/kxta-core/dist/types.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/types.js +5 -0
- package/bundle/standalone/node_modules/kxta-core/dist/types.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/util/extensions.d.ts +15 -0
- package/bundle/standalone/node_modules/kxta-core/dist/util/extensions.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/util/extensions.js +26 -0
- package/bundle/standalone/node_modules/kxta-core/dist/util/extensions.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/util/paths.d.ts +31 -0
- package/bundle/standalone/node_modules/kxta-core/dist/util/paths.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/util/paths.js +179 -0
- package/bundle/standalone/node_modules/kxta-core/dist/util/paths.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/util/safety.d.ts +37 -0
- package/bundle/standalone/node_modules/kxta-core/dist/util/safety.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/util/safety.js +156 -0
- package/bundle/standalone/node_modules/kxta-core/dist/util/safety.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/util/tokens.d.ts +3 -0
- package/bundle/standalone/node_modules/kxta-core/dist/util/tokens.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/util/tokens.js +13 -0
- package/bundle/standalone/node_modules/kxta-core/dist/util/tokens.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/watcher/index.d.ts +9 -0
- package/bundle/standalone/node_modules/kxta-core/dist/watcher/index.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/watcher/index.js +214 -0
- package/bundle/standalone/node_modules/kxta-core/dist/watcher/index.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/whats-new/index.d.ts +36 -0
- package/bundle/standalone/node_modules/kxta-core/dist/whats-new/index.d.ts.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/dist/whats-new/index.js +94 -0
- package/bundle/standalone/node_modules/kxta-core/dist/whats-new/index.js.map +1 -0
- package/bundle/standalone/node_modules/kxta-core/package.json +20 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/cli.d.ts +9 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/cli.js +139 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/config.d.ts +25 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/config.js +62 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/index.d.ts +2 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/index.js +45 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/pipeline.d.ts +14 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/pipeline.js +42 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/render/blocks/endpoints.d.ts +6 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/render/blocks/endpoints.js +112 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/render/blocks/glossary.d.ts +2 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/render/blocks/glossary.js +42 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/render/blocks/mermaid.d.ts +2 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/render/blocks/mermaid.js +17 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/render/llms.d.ts +3 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/render/llms.js +52 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/render/markdown.d.ts +24 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/render/markdown.js +87 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/render/nav.d.ts +21 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/render/nav.js +107 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/render/pdf.d.ts +10 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/render/pdf.js +70 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/seeds/01-overview.md +74 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/seeds/02-api.md +169 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/seeds/03-improvements.md +90 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/seeds/04-glossary.md +55 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/seeds/seeds.d.ts +3 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/seeds/seeds.js +53 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/source/enumerate.d.ts +3 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/source/enumerate.js +50 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/source/reader.d.ts +20 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/source/reader.js +20 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/template/api-ref.css +593 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/template/app.js +297 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/template/brutalist.css +57 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/template/flat.css +182 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/template/minimal.css +578 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/template/ocean.css +179 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/template/paper.css +33 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/template/shell.d.ts +8 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/template/shell.js +181 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/template/solarized.css +162 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/template/terminal.css +37 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/template/theme.css +701 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/types.d.ts +97 -0
- package/bundle/standalone/node_modules/kxta-publish/dist/types.js +1 -0
- package/bundle/standalone/node_modules/kxta-publish/package.json +25 -0
- package/bundle/standalone/package.json +26 -0
- package/dist/chunk-KQTCKRN2.js +31 -0
- package/dist/doctor-W733U3FD.js +46 -0
- package/dist/index.js +45 -0
- package/dist/mcp-DGMGR3MZ.js +34 -0
- package/dist/start-RCW7AKUK.js +121 -0
- package/package.json +89 -0
|
@@ -0,0 +1,801 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git operations module for Kontexta
|
|
3
|
+
* Handles commit, history, diff, restore, and backup sync operations
|
|
4
|
+
*/
|
|
5
|
+
import { createHash } from "node:crypto";
|
|
6
|
+
import simpleGit from "simple-git";
|
|
7
|
+
import { readFileSync, writeFileSync, copyFileSync, mkdirSync, existsSync, rmSync, readdirSync, statSync, lstatSync, unlinkSync, renameSync } from "node:fs";
|
|
8
|
+
import { join, relative, dirname, isAbsolute, resolve, sep } from "node:path";
|
|
9
|
+
import { spawnSync } from "node:child_process";
|
|
10
|
+
import { getDatabase } from "../db/index.js";
|
|
11
|
+
import { withLock } from "../util/safety.js";
|
|
12
|
+
import { stripIndexedExt } from "../util/extensions.js";
|
|
13
|
+
/** Git tree paths always use forward slashes, regardless of host OS. */
|
|
14
|
+
const toGitPath = (p) => p.split(sep).join("/");
|
|
15
|
+
// Strip `user:pass@` from URLs in git stderr before logging or returning.
|
|
16
|
+
function redactCredentials(s) {
|
|
17
|
+
return s.replace(/([a-z][a-z0-9+.-]*:\/\/)([^:@\/\s]+:[^@\/\s]+)@/gi, "$1***:***@");
|
|
18
|
+
}
|
|
19
|
+
// Strip env that would let git spawn an editor/pager/credential helper —
|
|
20
|
+
// any of those would hang a server-side request. Also strips vars that could
|
|
21
|
+
// redirect git operations (SSH commands, exec paths, external diffs).
|
|
22
|
+
function buildGitEnv() {
|
|
23
|
+
const env = { ...process.env, GIT_TERMINAL_PROMPT: "0" };
|
|
24
|
+
for (const k of [
|
|
25
|
+
"PAGER", "EDITOR", "VISUAL",
|
|
26
|
+
"GIT_EDITOR", "GIT_PAGER", "GIT_SEQUENCE_EDITOR",
|
|
27
|
+
"GIT_ASKPASS", "SSH_ASKPASS",
|
|
28
|
+
"GIT_PROXY_COMMAND", "GIT_HTTP_USER_AGENT", "GIT_EXTERNAL_DIFF",
|
|
29
|
+
// Prevent SSH/command redirection
|
|
30
|
+
"GIT_SSH", "GIT_SSH_COMMAND",
|
|
31
|
+
// Prevent exec path manipulation
|
|
32
|
+
"GIT_EXEC_PATH",
|
|
33
|
+
// Prevent credential helper injection
|
|
34
|
+
"GIT_CONFIG_COUNT", // clears GIT_CONFIG_COUNT + GIT_CONFIG_KEY_N/VALUE_N pairs
|
|
35
|
+
// Prevent host env from pointing git at attacker-controlled config files.
|
|
36
|
+
"GIT_CONFIG_GLOBAL", "GIT_CONFIG_SYSTEM", "GIT_CONFIG_NOSYSTEM",
|
|
37
|
+
// Prevent trace logs from leaking sensitive data (and from being a side-channel).
|
|
38
|
+
"GIT_TRACE", "GIT_TRACE_PACK_ACCESS", "GIT_TRACE_PACKET",
|
|
39
|
+
"GIT_TRACE_PERFORMANCE", "GIT_TRACE_SETUP", "GIT_TRACE_CURL",
|
|
40
|
+
]) {
|
|
41
|
+
delete env[k];
|
|
42
|
+
}
|
|
43
|
+
return env;
|
|
44
|
+
}
|
|
45
|
+
function gitFor(dir) {
|
|
46
|
+
return simpleGit(dir).env(buildGitEnv());
|
|
47
|
+
}
|
|
48
|
+
// Make sure the local repo's HEAD is on `main` before pushing to `origin main`.
|
|
49
|
+
// Historically this code did `git branch -M main` unconditionally, which
|
|
50
|
+
// force-renamed (and clobbered) whatever branch the user happened to be on.
|
|
51
|
+
// New behavior: rename only the legacy default `master`; for any other branch
|
|
52
|
+
// name, leave it alone so we don't destroy a deliberate checkout.
|
|
53
|
+
async function ensureOnMain(git) {
|
|
54
|
+
let current;
|
|
55
|
+
try {
|
|
56
|
+
current = (await git.raw(["symbolic-ref", "--short", "HEAD"])).trim();
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
if (current === "main" || current === "")
|
|
62
|
+
return;
|
|
63
|
+
if (current === "master") {
|
|
64
|
+
await git.branch(["-m", "master", "main"]);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
throw new Error(`Refusing to push: local HEAD is on '${current}', not 'main'. ` +
|
|
68
|
+
`Switch to 'main' (git checkout main) before syncing, or rename the branch yourself.`);
|
|
69
|
+
}
|
|
70
|
+
/** Validate a git remote URL. Allows https://, ssh://, git://, scp-form (user@host:path).
|
|
71
|
+
*
|
|
72
|
+
* Rejects http:// — backups containing source code shouldn't transit cleartext
|
|
73
|
+
* (especially if the URL embeds credentials). Use https:// or ssh:// instead.
|
|
74
|
+
*/
|
|
75
|
+
export function isValidGitRemoteUrl(url) {
|
|
76
|
+
if (typeof url !== "string" || url.length === 0 || url.length > 2048)
|
|
77
|
+
return false;
|
|
78
|
+
if (/[\s\x00-\x1f]/.test(url))
|
|
79
|
+
return false;
|
|
80
|
+
if (/^(file|ext):/i.test(url))
|
|
81
|
+
return false;
|
|
82
|
+
if (/^[A-Za-z0-9_.+-]+@[A-Za-z0-9.-]+:[^\s]+$/.test(url))
|
|
83
|
+
return true; // scp-form
|
|
84
|
+
try {
|
|
85
|
+
const u = new URL(url);
|
|
86
|
+
return u.protocol === "https:" || u.protocol === "ssh:" || u.protocol === "git:";
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Ensure a directory is a git repository
|
|
94
|
+
* @param dir - Directory path
|
|
95
|
+
*/
|
|
96
|
+
export async function ensureGitRepo(dir) {
|
|
97
|
+
if (existsSync(join(dir, ".git")))
|
|
98
|
+
return;
|
|
99
|
+
const git = gitFor(dir);
|
|
100
|
+
try {
|
|
101
|
+
await git.init();
|
|
102
|
+
// Prevent "dubious ownership" errors in Docker/mounted volumes
|
|
103
|
+
try {
|
|
104
|
+
await git.addConfig("safe.directory", dir, true, "global");
|
|
105
|
+
}
|
|
106
|
+
catch (e) {
|
|
107
|
+
// Ignore if global config is not writable, though it usually is in Docker.
|
|
108
|
+
}
|
|
109
|
+
await git.addConfig("user.email", "kontexta@local");
|
|
110
|
+
await git.addConfig("user.name", "Kontexta");
|
|
111
|
+
await git.addConfig("commit.gpgsign", "false");
|
|
112
|
+
await git.addConfig("tag.gpgsign", "false");
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
console.warn(`Failed to initialize git in ${dir}:`, error);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Commit a file to git repository
|
|
120
|
+
* @param repoDir - Root directory of the git repository
|
|
121
|
+
* @param filePath - Absolute path to the file to commit
|
|
122
|
+
* @param message - Commit message
|
|
123
|
+
*/
|
|
124
|
+
export async function commitFile(repoDir, filePath, message) {
|
|
125
|
+
await withLock(`git:${resolve(repoDir)}`, async () => {
|
|
126
|
+
await ensureGitRepo(repoDir);
|
|
127
|
+
const git = gitFor(repoDir);
|
|
128
|
+
const relativePath = toGitPath(relative(repoDir, filePath));
|
|
129
|
+
await git.add(["-f", relativePath]);
|
|
130
|
+
// Path-scoped commit so concurrent activity in the repo can't get swept in.
|
|
131
|
+
await git.commit(message, [relativePath], { "--no-verify": null, "--no-gpg-sign": null });
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Record a file deletion in git: `git rm -f <path>` + commit.
|
|
136
|
+
*
|
|
137
|
+
* Symmetric with `commitFile` — without this, deleteFile() unlinks the file
|
|
138
|
+
* from disk but git still has it in HEAD. Any subsequent operation that
|
|
139
|
+
* touches the working tree (a `git pull` from syncGlobalVault, a manual
|
|
140
|
+
* `git restore`, a stash pop) resurrects the file, and the watcher's `add`
|
|
141
|
+
* handler then re-indexes it as a new row, making it look like delete
|
|
142
|
+
* silently "came back".
|
|
143
|
+
*
|
|
144
|
+
* Best-effort: if the file isn't in git (untracked) or git fails, we swallow
|
|
145
|
+
* the error rather than block the delete. The DB/disk delete already
|
|
146
|
+
* succeeded — leaving an uncommitted delete in the working tree is better
|
|
147
|
+
* than failing the user's delete action.
|
|
148
|
+
*/
|
|
149
|
+
export async function commitDelete(repoDir, filePath, message) {
|
|
150
|
+
await withLock(`git:${resolve(repoDir)}`, async () => {
|
|
151
|
+
try {
|
|
152
|
+
await ensureGitRepo(repoDir);
|
|
153
|
+
const git = gitFor(repoDir);
|
|
154
|
+
const relativePath = toGitPath(relative(repoDir, filePath));
|
|
155
|
+
// Use `git rm -f --ignore-unmatch` so it's a no-op when the path was
|
|
156
|
+
// never tracked. --cached would only update the index; we want both
|
|
157
|
+
// index AND remove-from-working-tree-if-still-there.
|
|
158
|
+
try {
|
|
159
|
+
await git.raw(["rm", "-f", "--ignore-unmatch", "--", relativePath]);
|
|
160
|
+
}
|
|
161
|
+
catch (rmErr) {
|
|
162
|
+
// Even if `git rm` itself errors, fall through to commit attempt —
|
|
163
|
+
// the disk file is already gone, so `git status` should still see
|
|
164
|
+
// the deletion.
|
|
165
|
+
console.warn(`commitDelete: git rm failed for ${relativePath}:`, rmErr.message);
|
|
166
|
+
}
|
|
167
|
+
// Commit the deletion, scoped to this path. `--allow-empty` so we
|
|
168
|
+
// don't bomb when the file wasn't tracked at all (nothing staged).
|
|
169
|
+
try {
|
|
170
|
+
await git.commit(message, [relativePath], {
|
|
171
|
+
"--no-verify": null,
|
|
172
|
+
"--no-gpg-sign": null,
|
|
173
|
+
"--allow-empty": null,
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
catch (commitErr) {
|
|
177
|
+
console.warn(`commitDelete: git commit failed for ${relativePath}:`, commitErr.message);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
catch (e) {
|
|
181
|
+
console.warn(`commitDelete: failed for ${filePath}:`, e.message);
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Get commit history for a file
|
|
187
|
+
* @param repoDir - Root directory of the git repository
|
|
188
|
+
* @param filePath - Absolute path to the file
|
|
189
|
+
* @returns Array of commit history objects
|
|
190
|
+
*/
|
|
191
|
+
export async function getHistory(repoDir, filePath) {
|
|
192
|
+
const git = gitFor(repoDir);
|
|
193
|
+
const relativePath = toGitPath(relative(repoDir, filePath));
|
|
194
|
+
const log = await git.log({ file: relativePath });
|
|
195
|
+
return log.all.map((commit) => ({
|
|
196
|
+
hash: commit.hash,
|
|
197
|
+
message: commit.message,
|
|
198
|
+
date: commit.date,
|
|
199
|
+
author: commit.author_name,
|
|
200
|
+
}));
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Get diff between two commits for a file
|
|
204
|
+
* @param repoDir - Root directory of the git repository
|
|
205
|
+
* @param filePath - Absolute path to the file
|
|
206
|
+
* @param commitA - First commit hash
|
|
207
|
+
* @param commitB - Second commit hash
|
|
208
|
+
* @returns Diff string
|
|
209
|
+
*/
|
|
210
|
+
export async function getDiff(repoDir, filePath, commitA, commitB) {
|
|
211
|
+
const git = gitFor(repoDir);
|
|
212
|
+
const relativePath = toGitPath(relative(repoDir, filePath));
|
|
213
|
+
const diff = await git.diff([`${commitA}..${commitB}`, "--", relativePath]);
|
|
214
|
+
return diff;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Restore a file to a specific commit version
|
|
218
|
+
* @param repoDir - Root directory of the git repository
|
|
219
|
+
* @param filePath - Absolute path to the file
|
|
220
|
+
* @param commitHash - Commit hash to restore from
|
|
221
|
+
* @returns Content of the file at the specified commit
|
|
222
|
+
*/
|
|
223
|
+
export async function restoreVersion(repoDir, filePath, commitHash) {
|
|
224
|
+
return await withLock(`git:${resolve(repoDir)}`, async () => {
|
|
225
|
+
const git = gitFor(repoDir);
|
|
226
|
+
const relativePath = toGitPath(relative(repoDir, filePath));
|
|
227
|
+
// Reject anything that doesn't look like a hex commit hash (or a
|
|
228
|
+
// strict short hash). HEAD~N / branch names / arbitrary revspecs are
|
|
229
|
+
// intentionally NOT allowed via this entry point — restoreVersion is
|
|
230
|
+
// meant for points reachable via getHistory(), all of which return
|
|
231
|
+
// full SHAs. A value beginning with `-` would otherwise be parsed by
|
|
232
|
+
// git as a flag.
|
|
233
|
+
if (!/^[A-Fa-f0-9]{4,64}$/.test(commitHash)) {
|
|
234
|
+
throw new Error(`restoreVersion: commitHash must be a hex SHA, got: ${JSON.stringify(commitHash)}`);
|
|
235
|
+
}
|
|
236
|
+
// cat-file (not simple-git's `show`) so non-utf-8 bytes survive intact.
|
|
237
|
+
// The `--` separator forces git to treat the next token as a positional,
|
|
238
|
+
// not a flag — defense-in-depth on top of the hex-only validation above.
|
|
239
|
+
const result = spawnSync("git", ["-C", repoDir, "cat-file", "-p", "--", `${commitHash}:${relativePath}`], { env: buildGitEnv(), encoding: "buffer", maxBuffer: 64 * 1024 * 1024 });
|
|
240
|
+
if (result.status !== 0) {
|
|
241
|
+
const err = result.stderr ? result.stderr.toString() : "unknown";
|
|
242
|
+
throw new Error(`git cat-file failed: ${err.trim()}`);
|
|
243
|
+
}
|
|
244
|
+
const contentBuffer = result.stdout;
|
|
245
|
+
const contentForFts = contentBuffer.toString("utf-8");
|
|
246
|
+
// Atomic disk write via tmp + rename: if the rename fails, the
|
|
247
|
+
// original file content is preserved AND we haven't touched the DB.
|
|
248
|
+
// If the rename succeeds, we then update DB+FTS — and if that throws,
|
|
249
|
+
// we have a known-good disk state to compare against (the old hash
|
|
250
|
+
// recorded in DB no longer matches but the watcher will reconcile
|
|
251
|
+
// on the next change event).
|
|
252
|
+
const tmpPath = `${filePath}.kontexta-restore-${process.pid}-${Date.now()}`;
|
|
253
|
+
writeFileSync(tmpPath, contentBuffer);
|
|
254
|
+
try {
|
|
255
|
+
renameSync(tmpPath, filePath); // atomic on same filesystem
|
|
256
|
+
}
|
|
257
|
+
catch (e) {
|
|
258
|
+
try {
|
|
259
|
+
unlinkSync(tmpPath);
|
|
260
|
+
}
|
|
261
|
+
catch { }
|
|
262
|
+
throw e;
|
|
263
|
+
}
|
|
264
|
+
const db = getDatabase();
|
|
265
|
+
const file = db.prepare("SELECT id, title FROM files WHERE path = ?").get(filePath);
|
|
266
|
+
if (!file) {
|
|
267
|
+
// Disk has been restored, but no DB row exists for this path. The
|
|
268
|
+
// watcher will ingest it on the next change event; surface so this
|
|
269
|
+
// window of FTS-staleness isn't silent.
|
|
270
|
+
console.warn(`restoreVersion: no DB row for ${filePath}; disk restored, relying on watcher to (re-)ingest`);
|
|
271
|
+
}
|
|
272
|
+
if (file) {
|
|
273
|
+
const hash = createHash("sha256").update(contentBuffer).digest("hex");
|
|
274
|
+
const updateStmt = db.prepare("UPDATE files SET content_hash = ?, updated_at = datetime('now') WHERE id = ?");
|
|
275
|
+
const deleteFtsStmt = db.prepare("DELETE FROM fts_index WHERE rowid = ?");
|
|
276
|
+
const insertFtsStmt = db.prepare("INSERT INTO fts_index (rowid, title, content) VALUES (?, ?, ?)");
|
|
277
|
+
try {
|
|
278
|
+
db.transaction(() => {
|
|
279
|
+
updateStmt.run(hash, file.id);
|
|
280
|
+
deleteFtsStmt.run(file.id);
|
|
281
|
+
insertFtsStmt.run(file.id, file.title, contentForFts);
|
|
282
|
+
})();
|
|
283
|
+
}
|
|
284
|
+
catch (e) {
|
|
285
|
+
// Disk is the source of truth; the watcher will re-sync FTS on
|
|
286
|
+
// the next change. Surface so the API layer can warn the user.
|
|
287
|
+
console.error("restoreVersion: DB/FTS sync failed (disk is restored):", e);
|
|
288
|
+
throw new Error(`Restored on disk but DB/FTS update failed: ${e?.message ?? e}`);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
try {
|
|
292
|
+
// -f matches commitFile so a restored gitignored file isn't silently skipped.
|
|
293
|
+
await git.add(["-f", relativePath]);
|
|
294
|
+
// Path-scoped: unrelated staged changes are not committed here.
|
|
295
|
+
await git.commit(`Restore version ${commitHash.slice(0, 7)}`, [relativePath], { "--no-verify": null, "--no-gpg-sign": null });
|
|
296
|
+
}
|
|
297
|
+
catch (e) {
|
|
298
|
+
// Swallow only the no-op case (restored content matches HEAD).
|
|
299
|
+
const msg = String(e?.message ?? e);
|
|
300
|
+
const isNoop = /nothing to commit|no changes added to commit|nothing added to commit/i.test(msg);
|
|
301
|
+
if (!isNoop) {
|
|
302
|
+
throw new Error(`Restored on disk but git commit failed: ${msg}`);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return contentForFts;
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Sync backup copies of project reference files
|
|
310
|
+
* @param projectId - ID of the project
|
|
311
|
+
* @param dataDir - Data directory path
|
|
312
|
+
* @returns Array of copied file paths
|
|
313
|
+
*/
|
|
314
|
+
/**
|
|
315
|
+
* Sync the global "vault" — dataDir's own git repo — against the configured
|
|
316
|
+
* global remote, INDEPENDENT of any project. Picks up KB file commits that
|
|
317
|
+
* commitFile() made during creates/edits and pushes them upstream.
|
|
318
|
+
*
|
|
319
|
+
* Sync All previously only ran pull/push as a side-effect of per-project
|
|
320
|
+
* `syncBackup` calls, so users with zero projects never had their KB
|
|
321
|
+
* synced even with a global remote URL configured.
|
|
322
|
+
*/
|
|
323
|
+
export async function syncGlobalVault(dataDir, onStage) {
|
|
324
|
+
return await withLock(`git:${resolve(dataDir)}`, async () => {
|
|
325
|
+
const stage = (s) => { try {
|
|
326
|
+
onStage?.(s);
|
|
327
|
+
}
|
|
328
|
+
catch { } };
|
|
329
|
+
stage("preparing");
|
|
330
|
+
const git = gitFor(dataDir);
|
|
331
|
+
try {
|
|
332
|
+
await git.status();
|
|
333
|
+
}
|
|
334
|
+
catch {
|
|
335
|
+
await git.init();
|
|
336
|
+
await git.addConfig("user.email", "kontexta@local");
|
|
337
|
+
await git.addConfig("user.name", "Kontexta");
|
|
338
|
+
await git.addConfig("commit.gpgsign", "false");
|
|
339
|
+
await git.addConfig("tag.gpgsign", "false");
|
|
340
|
+
}
|
|
341
|
+
const globalRemoteUrl = await getGlobalRemote(dataDir);
|
|
342
|
+
if (!globalRemoteUrl) {
|
|
343
|
+
stage("done");
|
|
344
|
+
return; // nothing to sync against
|
|
345
|
+
}
|
|
346
|
+
if (!isValidGitRemoteUrl(globalRemoteUrl)) {
|
|
347
|
+
throw new Error("Configured global remote URL is not a valid git remote");
|
|
348
|
+
}
|
|
349
|
+
// Make sure HEAD exists; an empty repo can't push.
|
|
350
|
+
try {
|
|
351
|
+
await git.raw(["rev-parse", "HEAD"]);
|
|
352
|
+
}
|
|
353
|
+
catch {
|
|
354
|
+
await git.commit("Initial commit", ["--allow-empty"], { "--no-gpg-sign": null });
|
|
355
|
+
}
|
|
356
|
+
// Pull → merge → push.
|
|
357
|
+
let pullSucceeded = false;
|
|
358
|
+
stage("pulling remote");
|
|
359
|
+
try {
|
|
360
|
+
await git.pull("origin", "main", { "--rebase": "false" });
|
|
361
|
+
pullSucceeded = true;
|
|
362
|
+
stage("merging remote");
|
|
363
|
+
}
|
|
364
|
+
catch (e) {
|
|
365
|
+
const msg = redactCredentials(String(e?.message ?? e));
|
|
366
|
+
console.warn("syncGlobalVault: pull failed; aborting any in-progress merge", msg);
|
|
367
|
+
try {
|
|
368
|
+
await git.raw(["merge", "--abort"]);
|
|
369
|
+
}
|
|
370
|
+
catch { }
|
|
371
|
+
try {
|
|
372
|
+
await git.raw(["rebase", "--abort"]);
|
|
373
|
+
}
|
|
374
|
+
catch { }
|
|
375
|
+
throw new Error(`Sync failed during pull: ${msg}`);
|
|
376
|
+
}
|
|
377
|
+
if (pullSucceeded) {
|
|
378
|
+
stage("pushing");
|
|
379
|
+
try {
|
|
380
|
+
await ensureOnMain(git);
|
|
381
|
+
await git.push("origin", "main");
|
|
382
|
+
}
|
|
383
|
+
catch (error) {
|
|
384
|
+
const msg = redactCredentials(String(error?.message ?? error));
|
|
385
|
+
console.error("syncGlobalVault: push failed:", msg);
|
|
386
|
+
throw new Error(`Push failed: ${msg}`);
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
stage("done");
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
export async function getGlobalRemote(dataDir) {
|
|
393
|
+
try {
|
|
394
|
+
const git = gitFor(dataDir);
|
|
395
|
+
const remotes = await git.getRemotes(true);
|
|
396
|
+
const origin = remotes.find((r) => r.name === "origin");
|
|
397
|
+
return origin?.refs.fetch || null;
|
|
398
|
+
}
|
|
399
|
+
catch (error) {
|
|
400
|
+
return null;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
export async function setGlobalRemote(dataDir, url) {
|
|
404
|
+
if (url && !isValidGitRemoteUrl(url)) {
|
|
405
|
+
throw new Error("Invalid remote URL: must be https://, ssh://, git://, or user@host:path");
|
|
406
|
+
}
|
|
407
|
+
// Take the same lock syncBackup uses — otherwise we can swap origin
|
|
408
|
+
// between a sync's pull and push and end up pushing to the wrong remote.
|
|
409
|
+
await withLock(`git:${resolve(dataDir)}`, async () => {
|
|
410
|
+
const git = gitFor(dataDir);
|
|
411
|
+
try {
|
|
412
|
+
await git.status();
|
|
413
|
+
}
|
|
414
|
+
catch (error) {
|
|
415
|
+
await git.init();
|
|
416
|
+
await git.addConfig("user.email", "kontexta@local");
|
|
417
|
+
await git.addConfig("user.name", "Kontexta");
|
|
418
|
+
await git.addConfig("commit.gpgsign", "false");
|
|
419
|
+
await git.addConfig("tag.gpgsign", "false");
|
|
420
|
+
}
|
|
421
|
+
// Snapshot origin so we can restore it if addRemote fails partway
|
|
422
|
+
// through — otherwise the user is left with no remote configured.
|
|
423
|
+
let previousOriginUrl = null;
|
|
424
|
+
try {
|
|
425
|
+
const remotes = await git.getRemotes(true);
|
|
426
|
+
previousOriginUrl = remotes.find((r) => r.name === "origin")?.refs.fetch || null;
|
|
427
|
+
}
|
|
428
|
+
catch { }
|
|
429
|
+
let removed = false;
|
|
430
|
+
try {
|
|
431
|
+
await git.removeRemote("origin");
|
|
432
|
+
removed = true;
|
|
433
|
+
}
|
|
434
|
+
catch { }
|
|
435
|
+
if (url) {
|
|
436
|
+
try {
|
|
437
|
+
await git.addRemote("origin", url);
|
|
438
|
+
}
|
|
439
|
+
catch (e) {
|
|
440
|
+
if (removed && previousOriginUrl) {
|
|
441
|
+
try {
|
|
442
|
+
await git.addRemote("origin", previousOriginUrl);
|
|
443
|
+
}
|
|
444
|
+
catch { }
|
|
445
|
+
}
|
|
446
|
+
throw new Error(redactCredentials(String(e?.message ?? e)));
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
});
|
|
450
|
+
}
|
|
451
|
+
export async function syncBackup(projectId, dataDir, onStage) {
|
|
452
|
+
// Per-dataDir git lock prevents commitFile from interleaving with the pipeline.
|
|
453
|
+
return await withLock(`git:${resolve(dataDir)}`, () => _syncBackupLocked(projectId, dataDir, onStage));
|
|
454
|
+
}
|
|
455
|
+
async function _syncBackupLocked(projectId, dataDir, onStage) {
|
|
456
|
+
const stage = (s) => { try {
|
|
457
|
+
onStage?.(s);
|
|
458
|
+
}
|
|
459
|
+
catch { } };
|
|
460
|
+
stage("preparing");
|
|
461
|
+
const db = getDatabase();
|
|
462
|
+
const project = db
|
|
463
|
+
.prepare("SELECT * FROM projects WHERE id = ?")
|
|
464
|
+
.get(projectId);
|
|
465
|
+
if (!project) {
|
|
466
|
+
throw new Error(`Project with id ${projectId} not found`);
|
|
467
|
+
}
|
|
468
|
+
const files = db
|
|
469
|
+
.prepare("SELECT * FROM files WHERE project_id = ? AND storage_type = 'reference'")
|
|
470
|
+
.all(projectId);
|
|
471
|
+
const copiedPaths = [];
|
|
472
|
+
const backupDir = join(dataDir, "backups", project.slug);
|
|
473
|
+
mkdirSync(backupDir, { recursive: true });
|
|
474
|
+
const git = gitFor(dataDir);
|
|
475
|
+
try {
|
|
476
|
+
await git.status();
|
|
477
|
+
}
|
|
478
|
+
catch {
|
|
479
|
+
await git.init();
|
|
480
|
+
await git.addConfig("user.email", "kontexta@local");
|
|
481
|
+
await git.addConfig("user.name", "Kontexta");
|
|
482
|
+
await git.addConfig("commit.gpgsign", "false");
|
|
483
|
+
await git.addConfig("tag.gpgsign", "false");
|
|
484
|
+
}
|
|
485
|
+
const globalRemoteUrl = await getGlobalRemote(dataDir);
|
|
486
|
+
if (globalRemoteUrl) {
|
|
487
|
+
if (!isValidGitRemoteUrl(globalRemoteUrl)) {
|
|
488
|
+
throw new Error("Configured global remote URL is not a valid git remote");
|
|
489
|
+
}
|
|
490
|
+
try {
|
|
491
|
+
try {
|
|
492
|
+
await git.removeRemote("origin");
|
|
493
|
+
}
|
|
494
|
+
catch { }
|
|
495
|
+
await git.addRemote("origin", globalRemoteUrl);
|
|
496
|
+
try {
|
|
497
|
+
await git.raw(["rev-parse", "HEAD"]);
|
|
498
|
+
}
|
|
499
|
+
catch {
|
|
500
|
+
await git.commit("Initial commit", ["--allow-empty"], { "--no-gpg-sign": null });
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
catch (error) {
|
|
504
|
+
console.warn("Git remote setup failed:", redactCredentials(String(error?.message ?? error)));
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
// Capture HEAD pre-pull so STEP 3 can ask git which files were genuinely
|
|
508
|
+
// deleted upstream (vs inferring deletion from a local-snapshot diff).
|
|
509
|
+
let preHead = null;
|
|
510
|
+
try {
|
|
511
|
+
preHead = (await git.revparse(["HEAD"])).trim();
|
|
512
|
+
}
|
|
513
|
+
catch {
|
|
514
|
+
preHead = null;
|
|
515
|
+
}
|
|
516
|
+
// STEP 1 — refresh backup tree from disk. We do NOT rmSync first: a
|
|
517
|
+
// transient EACCES would leave the file absent from the rebuild,
|
|
518
|
+
// `git add -A` would stage it as a deletion, and the next pull would
|
|
519
|
+
// unlink it from the user's source tree (the data-loss path STEP 3's
|
|
520
|
+
// diff guard was meant to prevent). Instead, overwrite in place and
|
|
521
|
+
// only prune orphans when every source file was accounted for.
|
|
522
|
+
stage("staging local");
|
|
523
|
+
const expectedBackupPaths = new Set();
|
|
524
|
+
let copyFailures = 0;
|
|
525
|
+
// Skip the copy phase entirely for projects without a registered path —
|
|
526
|
+
// there's nothing to copy, and locking on `resolve("") === cwd` would
|
|
527
|
+
// collapse every such project onto a shared lock keyed on the CWD.
|
|
528
|
+
// Also skip the inner lock when project.path resolves to dataDir: we
|
|
529
|
+
// already hold `git:${resolve(dataDir)}` (the outer syncBackup lock),
|
|
530
|
+
// and re-entering the same key would deadlock because withLock chains
|
|
531
|
+
// onto the previous tail and that tail can't settle until we return.
|
|
532
|
+
const sameAsDataDir = !!project.path && resolve(project.path) === resolve(dataDir);
|
|
533
|
+
const copyBody = async () => {
|
|
534
|
+
for (const file of files) {
|
|
535
|
+
if (!file.path || !project.path)
|
|
536
|
+
continue;
|
|
537
|
+
const relativePath = relative(project.path, file.path);
|
|
538
|
+
if (relativePath.startsWith("..") || isAbsolute(relativePath))
|
|
539
|
+
continue;
|
|
540
|
+
const backupPath = join(backupDir, relativePath);
|
|
541
|
+
if (!existsSync(file.path)) {
|
|
542
|
+
if (existsSync(backupPath))
|
|
543
|
+
expectedBackupPaths.add(backupPath);
|
|
544
|
+
continue;
|
|
545
|
+
}
|
|
546
|
+
mkdirSync(dirname(backupPath), { recursive: true });
|
|
547
|
+
try {
|
|
548
|
+
copyFileSync(file.path, backupPath);
|
|
549
|
+
expectedBackupPaths.add(backupPath);
|
|
550
|
+
copiedPaths.push(backupPath);
|
|
551
|
+
}
|
|
552
|
+
catch (e) {
|
|
553
|
+
console.warn(`syncBackup: failed to copy ${file.path}:`, e);
|
|
554
|
+
copyFailures++;
|
|
555
|
+
if (existsSync(backupPath))
|
|
556
|
+
expectedBackupPaths.add(backupPath);
|
|
557
|
+
}
|
|
558
|
+
}
|
|
559
|
+
};
|
|
560
|
+
if (project.path) {
|
|
561
|
+
if (sameAsDataDir) {
|
|
562
|
+
await copyBody();
|
|
563
|
+
}
|
|
564
|
+
else {
|
|
565
|
+
await withLock(`git:${resolve(project.path)}`, copyBody);
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
if (copyFailures === 0) {
|
|
569
|
+
const pruneOrphans = (dir) => {
|
|
570
|
+
if (!existsSync(dir))
|
|
571
|
+
return;
|
|
572
|
+
let entries;
|
|
573
|
+
try {
|
|
574
|
+
entries = readdirSync(dir);
|
|
575
|
+
}
|
|
576
|
+
catch {
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
for (const entry of entries) {
|
|
580
|
+
if (entry === ".git")
|
|
581
|
+
continue;
|
|
582
|
+
const fullPath = join(dir, entry);
|
|
583
|
+
let st;
|
|
584
|
+
try {
|
|
585
|
+
st = statSync(fullPath);
|
|
586
|
+
}
|
|
587
|
+
catch {
|
|
588
|
+
continue;
|
|
589
|
+
}
|
|
590
|
+
if (st.isDirectory()) {
|
|
591
|
+
pruneOrphans(fullPath);
|
|
592
|
+
try {
|
|
593
|
+
if (readdirSync(fullPath).length === 0)
|
|
594
|
+
rmSync(fullPath, { recursive: true, force: true });
|
|
595
|
+
}
|
|
596
|
+
catch { }
|
|
597
|
+
}
|
|
598
|
+
else if (!expectedBackupPaths.has(fullPath)) {
|
|
599
|
+
try {
|
|
600
|
+
unlinkSync(fullPath);
|
|
601
|
+
}
|
|
602
|
+
catch { }
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
};
|
|
606
|
+
pruneOrphans(backupDir);
|
|
607
|
+
}
|
|
608
|
+
else {
|
|
609
|
+
console.warn(`syncBackup: ${copyFailures} source file(s) failed to copy; skipping orphan pruning to avoid propagating phantom deletions`);
|
|
610
|
+
}
|
|
611
|
+
const backupRelativeDir = toGitPath(relative(dataDir, backupDir));
|
|
612
|
+
await git.add(["-A", "-f", backupRelativeDir]);
|
|
613
|
+
const status = await git.status();
|
|
614
|
+
if (status.staged.length > 0 || status.created.length > 0 || status.deleted.length > 0 || status.modified.length > 0) {
|
|
615
|
+
stage("committing local");
|
|
616
|
+
await git.commit(`Sync local changes for project: ${project.name}`, [backupRelativeDir], { "--no-verify": null, "--no-gpg-sign": null });
|
|
617
|
+
}
|
|
618
|
+
// STEP 2 — pull remote.
|
|
619
|
+
let pullSucceeded = false;
|
|
620
|
+
if (globalRemoteUrl) {
|
|
621
|
+
stage("pulling remote");
|
|
622
|
+
try {
|
|
623
|
+
await git.pull("origin", "main", { "--rebase": "false" });
|
|
624
|
+
pullSucceeded = true;
|
|
625
|
+
stage("merging remote");
|
|
626
|
+
}
|
|
627
|
+
catch (e) {
|
|
628
|
+
const msg = redactCredentials(String(e?.message ?? e));
|
|
629
|
+
console.warn("Pull/Merge failed; aborting any in-progress merge and skipping push", msg);
|
|
630
|
+
// Don't leave a half-applied merge in the working tree, and don't
|
|
631
|
+
// proceed to push — pushing now would either reject or silently
|
|
632
|
+
// overwrite the remote with a state that never integrated upstream.
|
|
633
|
+
try {
|
|
634
|
+
await git.raw(["merge", "--abort"]);
|
|
635
|
+
}
|
|
636
|
+
catch { }
|
|
637
|
+
try {
|
|
638
|
+
await git.raw(["rebase", "--abort"]);
|
|
639
|
+
}
|
|
640
|
+
catch { }
|
|
641
|
+
throw new Error(`Sync failed during pull: ${msg}`);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
// STEP 3 — sync merged truth back to local workspace.
|
|
645
|
+
function walkDir(dir, fileList = []) {
|
|
646
|
+
if (!existsSync(dir))
|
|
647
|
+
return fileList;
|
|
648
|
+
const entries = readdirSync(dir);
|
|
649
|
+
for (const entry of entries) {
|
|
650
|
+
if (entry === ".git")
|
|
651
|
+
continue;
|
|
652
|
+
const fullPath = join(dir, entry);
|
|
653
|
+
// lstatSync to avoid following symlinks — a symlink loop in the
|
|
654
|
+
// backup tree would otherwise recurse forever.
|
|
655
|
+
let st;
|
|
656
|
+
try {
|
|
657
|
+
st = lstatSync(fullPath);
|
|
658
|
+
}
|
|
659
|
+
catch {
|
|
660
|
+
continue;
|
|
661
|
+
}
|
|
662
|
+
if (st.isSymbolicLink())
|
|
663
|
+
continue;
|
|
664
|
+
if (st.isDirectory()) {
|
|
665
|
+
walkDir(fullPath, fileList);
|
|
666
|
+
}
|
|
667
|
+
else if (st.isFile()) {
|
|
668
|
+
fileList.push(fullPath);
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
return fileList;
|
|
672
|
+
}
|
|
673
|
+
const mergedFiles = walkDir(backupDir);
|
|
674
|
+
const existingDbPaths = new Set(files.map((f) => f.path));
|
|
675
|
+
for (const backupPath of mergedFiles) {
|
|
676
|
+
// Per-file try/catch — a single bad file (EACCES, transient FS error,
|
|
677
|
+
// huge content, etc.) must not abort the whole merge.
|
|
678
|
+
try {
|
|
679
|
+
const relativePath = relative(backupDir, backupPath);
|
|
680
|
+
if (project.path) {
|
|
681
|
+
const localAbsolutePath = join(project.path, relativePath);
|
|
682
|
+
// Defense-in-depth: never write outside the project dir.
|
|
683
|
+
const projectResolved = resolve(project.path);
|
|
684
|
+
if (resolve(localAbsolutePath) !== projectResolved && !resolve(localAbsolutePath).startsWith(projectResolved + sep)) {
|
|
685
|
+
continue;
|
|
686
|
+
}
|
|
687
|
+
mkdirSync(dirname(localAbsolutePath), { recursive: true });
|
|
688
|
+
// Skip the write when local already matches — avoids mtime bumps
|
|
689
|
+
// that trigger a watcher refresh storm. Warn loudly when local
|
|
690
|
+
// diverged (we still take the merge result as truth).
|
|
691
|
+
let localBuf = null;
|
|
692
|
+
try {
|
|
693
|
+
localBuf = readFileSync(localAbsolutePath);
|
|
694
|
+
}
|
|
695
|
+
catch { }
|
|
696
|
+
const backupBuf = readFileSync(backupPath);
|
|
697
|
+
if (localBuf?.equals(backupBuf)) {
|
|
698
|
+
// already in sync
|
|
699
|
+
}
|
|
700
|
+
else {
|
|
701
|
+
if (localBuf) {
|
|
702
|
+
console.warn(`syncBackup: overwriting locally-modified ${localAbsolutePath} ` +
|
|
703
|
+
"with merged remote content (use git history if you need to recover)");
|
|
704
|
+
}
|
|
705
|
+
writeFileSync(localAbsolutePath, backupBuf);
|
|
706
|
+
}
|
|
707
|
+
if (!existingDbPaths.has(localAbsolutePath)) {
|
|
708
|
+
const basename = relativePath.split("/").pop() || "";
|
|
709
|
+
const title = stripIndexedExt(basename) || "Untitled";
|
|
710
|
+
const content = readFileSync(localAbsolutePath, "utf-8");
|
|
711
|
+
const contentHash = createHash("sha256").update(content).digest("hex");
|
|
712
|
+
const insertFileStmt = db.prepare("INSERT OR IGNORE INTO files (path, title, project_id, storage_type, content_hash) VALUES (?, ?, ?, ?, ?)");
|
|
713
|
+
const insertFtsStmt = db.prepare("INSERT INTO fts_index (rowid, title, content) VALUES (?, ?, ?)");
|
|
714
|
+
db.transaction(() => {
|
|
715
|
+
const result = insertFileStmt.run(localAbsolutePath, title, project.id, "reference", contentHash);
|
|
716
|
+
if (result.changes > 0) {
|
|
717
|
+
insertFtsStmt.run(result.lastInsertRowid, title, content);
|
|
718
|
+
}
|
|
719
|
+
})();
|
|
720
|
+
copiedPaths.push(localAbsolutePath);
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
}
|
|
724
|
+
catch (e) {
|
|
725
|
+
console.warn(`syncBackup: failed to apply merged file ${backupPath}:`, e);
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
// Remote-side deletions: trust git's own diff between preHead and the
|
|
729
|
+
// post-pull HEAD. Inferring from "missing in local snapshot" would
|
|
730
|
+
// unlink files in the user's source tree on any local copy hiccup.
|
|
731
|
+
if (pullSucceeded && preHead && project.path) {
|
|
732
|
+
let postHead = null;
|
|
733
|
+
try {
|
|
734
|
+
postHead = (await git.revparse(["HEAD"])).trim();
|
|
735
|
+
}
|
|
736
|
+
catch {
|
|
737
|
+
postHead = null;
|
|
738
|
+
}
|
|
739
|
+
if (postHead && postHead !== preHead) {
|
|
740
|
+
let deletedRel = [];
|
|
741
|
+
try {
|
|
742
|
+
const out = await git.raw([
|
|
743
|
+
"diff",
|
|
744
|
+
"--name-only",
|
|
745
|
+
"--diff-filter=D",
|
|
746
|
+
`${preHead}..${postHead}`,
|
|
747
|
+
"--",
|
|
748
|
+
backupRelativeDir,
|
|
749
|
+
]);
|
|
750
|
+
deletedRel = out.split("\n").map((s) => s.trim()).filter(Boolean).map((p) => p.split("/").join(sep));
|
|
751
|
+
}
|
|
752
|
+
catch (e) {
|
|
753
|
+
console.warn("syncBackup: failed to diff for deletions:", e);
|
|
754
|
+
}
|
|
755
|
+
const projectResolved = resolve(project.path);
|
|
756
|
+
for (const repoRel of deletedRel) {
|
|
757
|
+
const insideBackup = relative(backupRelativeDir, repoRel);
|
|
758
|
+
if (insideBackup.startsWith("..") || isAbsolute(insideBackup))
|
|
759
|
+
continue;
|
|
760
|
+
const localAbsolutePath = join(project.path, insideBackup);
|
|
761
|
+
const resolvedLocal = resolve(localAbsolutePath);
|
|
762
|
+
if (resolvedLocal !== projectResolved && !resolvedLocal.startsWith(projectResolved + sep)) {
|
|
763
|
+
continue;
|
|
764
|
+
}
|
|
765
|
+
try {
|
|
766
|
+
if (existsSync(localAbsolutePath)) {
|
|
767
|
+
unlinkSync(localAbsolutePath);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
catch (e) {
|
|
771
|
+
console.warn(`syncBackup: failed to remove ${localAbsolutePath}:`, e);
|
|
772
|
+
}
|
|
773
|
+
const dbRow = db.prepare("SELECT id FROM files WHERE path = ?").get(localAbsolutePath);
|
|
774
|
+
if (dbRow) {
|
|
775
|
+
const deleteFtsStmt = db.prepare("DELETE FROM fts_index WHERE rowid = ?");
|
|
776
|
+
const deleteFileStmt = db.prepare("DELETE FROM files WHERE id = ?");
|
|
777
|
+
db.transaction(() => {
|
|
778
|
+
deleteFtsStmt.run(dbRow.id);
|
|
779
|
+
deleteFileStmt.run(dbRow.id);
|
|
780
|
+
})();
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
// STEP 4 — push.
|
|
786
|
+
if (globalRemoteUrl) {
|
|
787
|
+
stage("pushing");
|
|
788
|
+
try {
|
|
789
|
+
await ensureOnMain(git);
|
|
790
|
+
await git.push("origin", "main");
|
|
791
|
+
}
|
|
792
|
+
catch (error) {
|
|
793
|
+
const msg = redactCredentials(String(error?.message ?? error));
|
|
794
|
+
console.error("Git push failed:", msg);
|
|
795
|
+
throw new Error(`Git push failed: ${msg}`);
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
stage("done");
|
|
799
|
+
return copiedPaths;
|
|
800
|
+
}
|
|
801
|
+
//# sourceMappingURL=index.js.map
|