@geminilight/mindos 0.7.2 → 0.7.4
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/_standalone/.mindos-build-version +1 -1
- package/_standalone/.next/BUILD_ID +1 -1
- package/_standalone/.next/app-path-routes-manifest.json +19 -19
- package/_standalone/.next/build-manifest.json +3 -3
- package/_standalone/.next/cache/.previewinfo +1 -1
- package/_standalone/.next/cache/.rscinfo +1 -1
- package/_standalone/.next/cache/config.json +3 -3
- package/_standalone/.next/prerender-manifest.json +3 -3
- package/_standalone/.next/react-loadable-manifest.json +4 -4
- package/_standalone/.next/server/app/.well-known/agent-card.json/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/_global-error.html +2 -2
- package/_standalone/.next/server/app/_global-error.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/_standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/_standalone/.next/server/app/_not-found/page.js +1 -1
- package/_standalone/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/agents/[agentKey]/page.js +1 -1
- package/_standalone/.next/server/app/agents/[agentKey]/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/agents/[agentKey]/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/agents/page.js +1 -1
- package/_standalone/.next/server/app/agents/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/agents/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/agents/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/delegations/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/discover/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/a2a/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/config/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/detect/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/install/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/registry/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/acp/session/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/agent-activity/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/agents/copy-skill/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/agents/custom/detect/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/agents/custom/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/ask/route.js +4 -4
- package/_standalone/.next/server/app/api/ask/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/ask-sessions/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/auth/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/backlinks/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/bootstrap/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/changes/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/channels/verify/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/connect/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/embedding/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/export/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/extract-docx/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/extract-pdf/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/file/import/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/file/raw/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/file/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/graph/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/activity/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/config/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/feishu/long-connection/event/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/feishu/long-connection/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/status/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/test/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/webhook/feishu/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/im/webhook-status/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/inbox/clip/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/inbox/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/lint/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/agents/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/direct-tools/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/install/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/install-skill/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/restart/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/status/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/tools/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/mcp/uninstall/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/monitoring/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/obsidian/compat-report/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/obsidian/import/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/recent-files/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/restart/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/search/prewarm/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/search/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/list-models/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/reset-token/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/settings/test-key/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/check-path/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/check-port/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/generate-token/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/ls/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/setup/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/space-overview/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/sync/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/tree-version/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/uninstall/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/update/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/update-check/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/update-status/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/workflows/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/capture/history/page.js +1 -1
- package/_standalone/.next/server/app/capture/history/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/capture/history/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/capture/page.js +1 -1
- package/_standalone/.next/server/app/capture/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/capture/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/changelog/page.js +1 -1
- package/_standalone/.next/server/app/changelog/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/changelog/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/changes/page.js +1 -1
- package/_standalone/.next/server/app/changes/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/changes/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/echo/[segment]/page.js +1 -1
- package/_standalone/.next/server/app/echo/[segment]/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/echo/[segment]/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/echo/page.js +1 -1
- package/_standalone/.next/server/app/echo/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/echo/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/explore/page.js +1 -1
- package/_standalone/.next/server/app/explore/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/explore/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/help/page.js +1 -1
- package/_standalone/.next/server/app/help/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/help/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/inbox/history/page.js +1 -1
- package/_standalone/.next/server/app/inbox/history/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/inbox/history/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/login/page.js +1 -1
- package/_standalone/.next/server/app/login/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/page.js +1 -1
- package/_standalone/.next/server/app/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/setup/page.js +1 -1
- package/_standalone/.next/server/app/setup/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/setup/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/todo/page.js +1 -1
- package/_standalone/.next/server/app/todo/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/todo/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/trash/page.js +2 -2
- package/_standalone/.next/server/app/trash/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/view/[...path]/page.js +2 -2
- package/_standalone/.next/server/app/view/[...path]/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/view/[...path]/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/wiki/page.js +2 -0
- package/_standalone/.next/server/app/wiki/page.js.nft.json +1 -0
- package/_standalone/.next/server/app/wiki/page_client-reference-manifest.js +1 -0
- package/_standalone/.next/server/app-paths-manifest.json +19 -19
- package/_standalone/.next/server/chunks/2250.js +1 -1
- package/_standalone/.next/server/chunks/{1057.js → 3861.js} +2 -2
- package/_standalone/.next/server/chunks/4802.js +30 -30
- package/_standalone/.next/server/chunks/8388.js +1 -1
- package/_standalone/.next/server/middleware-build-manifest.js +1 -1
- package/_standalone/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/_standalone/.next/server/pages/500.html +2 -2
- package/_standalone/.next/server/server-reference-manifest.js +1 -1
- package/_standalone/.next/server/server-reference-manifest.json +1 -1
- package/_standalone/.next/static/chunks/{5581-bae715e40d227b5f.js → 5581-beecbc4ca5625aa9.js} +2 -2
- package/_standalone/.next/static/chunks/6762.c871d0bf3f45ba87.js +1 -0
- package/_standalone/.next/static/chunks/{8064-e65acd2762132099.js → 8064-acac37daf946082b.js} +1 -1
- package/_standalone/.next/static/chunks/{3985.695651f6b5cd768c.js → 8984.91fb8cde1983c564.js} +2 -2
- package/_standalone/.next/static/chunks/app/{layout-0cf6f2a65f605a0d.js → layout-20faba3bc0af7cd2.js} +19 -19
- package/_standalone/.next/static/chunks/app/trash/page-0c2c67929b71ef71.js +1 -0
- package/_standalone/.next/static/chunks/app/view/[...path]/not-found-fd06cc989103ebe7.js +1 -0
- package/_standalone/.next/static/chunks/app/view/[...path]/page-dba70888697ba910.js +12 -0
- package/_standalone/.next/static/chunks/app/wiki/page-9bc1fec84d343290.js +14 -0
- package/_standalone/.next/static/chunks/webpack-3c1d0331f1da64b8.js +1 -0
- package/_standalone/.next/trace +97 -97
- package/_standalone/MINDOS_ARCHITECTURE_DIAGRAM.md +488 -0
- package/_standalone/MINDOS_EXPLORATION_SUMMARY.md +229 -0
- package/_standalone/MINDOS_INFRASTRUCTURE_ANALYSIS.md +732 -0
- package/_standalone/__tests__/api/mcp-install.test.ts +8 -2
- package/_standalone/__tests__/core/embedding-provider.test.ts +78 -0
- package/_standalone/__tests__/skills/mindos-skill-copy-alignment.test.ts +10 -4
- package/_standalone/components/ask/AskHeader.tsx +25 -18
- package/_standalone/components/ask/SessionHistoryPanel.tsx +21 -12
- package/_standalone/components/settings/AiTab.tsx +3 -0
- package/_standalone/data/skills/mindos/SKILL.md +269 -0
- package/_standalone/data/skills/mindos/references/write-supplement.md +119 -0
- package/_standalone/data/skills/mindos-zh/SKILL.md +227 -0
- package/_standalone/data/skills/mindos-zh/references/write-supplement.md +119 -0
- package/app/__tests__/api/mcp-install.test.ts +8 -2
- package/app/__tests__/core/embedding-provider.test.ts +78 -0
- package/app/__tests__/skills/mindos-skill-copy-alignment.test.ts +10 -4
- package/app/app/api/ask/route.ts +14 -9
- package/app/app/view/[...path]/ViewPageClient.tsx +15 -12
- package/app/app/view/[...path]/not-found.tsx +9 -5
- package/app/components/ask/AskHeader.tsx +25 -18
- package/app/components/ask/SessionHistoryPanel.tsx +21 -12
- package/app/components/settings/AiTab.tsx +3 -0
- package/app/eslint.config.mjs +18 -0
- package/app/lib/core/embedding-provider.ts +12 -4
- package/app/lib/i18n/modules/settings.ts +2 -0
- package/app/package-lock.json +20214 -0
- package/app/tsconfig.tsbuildinfo +1 -0
- package/app/vitest.config.ts +14 -0
- package/assets/demo-flow-zh.html +622 -0
- package/assets/images/demo-flow-dark.png +0 -0
- package/assets/images/demo-flow-dark.webp +0 -0
- package/assets/images/demo-flow-light.png +0 -0
- package/assets/images/demo-flow-light.webp +0 -0
- package/assets/images/demo-flow-zh-dark.png +0 -0
- package/assets/images/demo-flow-zh-dark.webp +0 -0
- package/assets/images/demo-flow-zh-light.png +0 -0
- package/assets/images/demo-flow-zh-light.webp +0 -0
- package/assets/images/gui-sync-cv.png +0 -0
- package/assets/images/gui-sync-cv.webp +0 -0
- package/assets/images/mindos-chat.png +0 -0
- package/assets/images/mindos-chat.webp +0 -0
- package/assets/images/mindos-dashboard.png +0 -0
- package/assets/images/mindos-dashboard.webp +0 -0
- package/assets/images/mindos-echo.png +0 -0
- package/assets/images/mindos-echo.webp +0 -0
- package/assets/images/mindos-home.png +0 -0
- package/assets/images/mindos-home.webp +0 -0
- package/assets/images/wechat-qr.png +0 -0
- package/bin/lib/mcp-build.js +8 -0
- package/mcp/package-lock.json +2202 -0
- package/mcp/src/index.ts +783 -0
- package/package.json +13 -1
- package/.env.local.example +0 -38
- package/.playwright-cli/page-2026-04-12T12-26-53-393Z.yml +0 -6
- package/.playwright-cli/page-2026-04-12T12-27-20-256Z.yml +0 -120
- package/.syncinclude +0 -105
- package/MINDOS_SEARCH_DIAGRAM.txt +0 -243
- package/_standalone/.next/static/chunks/576.3cae31209383ddbd.js +0 -1
- package/_standalone/.next/static/chunks/app/trash/page-085f121c0815d542.js +0 -1
- package/_standalone/.next/static/chunks/app/view/[...path]/not-found-2a6eec67e91eaaf9.js +0 -1
- package/_standalone/.next/static/chunks/app/view/[...path]/page-faeaf8c09c1c6d7c.js +0 -12
- package/_standalone/.next/static/chunks/webpack-a1bb35f2d540e463.js +0 -1
- package/scripts/build-runtime-archive.sh +0 -151
- package/scripts/fix-postcss-deps.cjs +0 -75
- package/scripts/gen-renderer-index.js +0 -64
- package/scripts/hooks/block-public-merge.sh +0 -42
- package/scripts/hooks/pre-merge-commit +0 -4
- package/scripts/hooks/pre-push +0 -37
- package/scripts/hooks/prepare-commit-msg +0 -12
- package/scripts/migrate-agent-audit-log.js +0 -170
- package/scripts/migrate-agent-diff.js +0 -146
- package/scripts/parse-syncinclude.sh +0 -92
- package/scripts/prepare-standalone.mjs +0 -83
- package/scripts/release.sh +0 -145
- package/scripts/setup.js +0 -1427
- package/scripts/test-oss-upload.sh +0 -100
- package/scripts/verify-standalone.mjs +0 -129
- package/scripts/write-build-stamp.js +0 -40
- /package/_standalone/.next/static/{q5RP_Mx8BrCfvVDnLpRRc → 0UlbV2rA2i4B-8YYg41wQ}/_buildManifest.js +0 -0
- /package/_standalone/.next/static/{q5RP_Mx8BrCfvVDnLpRRc → 0UlbV2rA2i4B-8YYg41wQ}/_ssgManifest.js +0 -0
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3399,9508],{382:(e,t,r)=>{"use strict";r.d(t,{Y:()=>n});var s=r(9339);let n=(0,s.createServerReference)("40ff0f55435e3bd7691bb0b6280dbf7dce03eaab38",s.callServer,void 0,s.findSourceMapURL,"undoDeleteAction")},565:(e,t,r)=>{"use strict";r.d(t,{a:()=>n});let s=/!\[[^\]]*\]\(https?:\/\/cdn\.jsdelivr\.net\/gh\/twitter\/twemoji@[^/]+\/assets\/svg\/([a-f0-9-]+)\.svg\s*(?:"[^"]*")?\)/g;function n(e){return e.replace(s,(e,t)=>{try{return String.fromCodePoint(...t.split("-").map(e=>parseInt(e,16)))}catch{return e}})}},3109:(e,t,r)=>{"use strict";r.d(t,{default:()=>I});var s=r(95155),n=r(12115),a=r(98500),o=r.n(a),i=r(73321),l=r(38798),d=r(33078),c=r(48368),u=r(42129),m=r(97810),x=r(6296),p=r(41585),f=r(86901),h=r(94514),g=r(997),v=r(67635),b=r(93631),j=r(37595),y=r(38194),w=r(44406),N=r(91337),k=r(82125),C=r(35581);async function E(e){try{await navigator.clipboard.writeText(e)}catch{}}function A({node:e}){return"directory"===e.type?(0,s.jsx)(l.A,{size:16,className:"text-yellow-400 shrink-0"}):".csv"===e.extension?(0,s.jsx)(d.A,{size:16,className:"text-success shrink-0"}):(0,s.jsx)(c.A,{size:16,className:"text-muted-foreground shrink-0"})}function S({node:e}){return"directory"===e.type?(0,s.jsx)(u.A,{size:28,className:"text-yellow-400"}):".csv"===e.extension?(0,s.jsx)(d.A,{size:28,className:"text-success"}):(0,s.jsx)(c.A,{size:28,className:"text-muted-foreground"})}let z="mindos-dir-view",T="show-hidden-files";function R(e){let t=t=>{t.key===T&&e()},r=()=>e();return window.addEventListener("storage",t),window.addEventListener("mindos:hidden-files-changed",r),()=>{window.removeEventListener("storage",t),window.removeEventListener("mindos:hidden-files-changed",r)}}function L(){return"true"===localStorage.getItem(T)}function P({icon:e,title:t,lines:r,viewAllHref:n,viewAllLabel:a,trailing:i,footer:l}){return 0===r.length?null:(0,s.jsxs)("div",{className:"bg-muted/30 border border-border/40 rounded-lg px-4 py-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[e,(0,s.jsx)("span",{className:"text-sm font-medium text-muted-foreground flex-1",children:t}),i]}),(0,s.jsx)("div",{className:"space-y-1",children:r.map((e,t)=>(0,s.jsxs)("p",{className:"text-sm text-muted-foreground/80 leading-relaxed",suppressHydrationWarning:!0,children:["\xb7 ",e]},t))}),(0,s.jsxs)("div",{className:"flex items-center justify-between mt-2",children:[l||(0,s.jsx)("span",{}),(0,s.jsx)(o(),{href:n,className:"text-xs hover:underline transition-colors text-[var(--amber)]",children:a})]})]})}function F({dirPath:e}){let{t}=(0,C.Y)(),r=(0,i.useRouter)(),[a,l]=(0,n.useState)("idle"),[d,c]=(0,n.useState)(""),u=function(e){let[t,r]=(0,n.useState)(null);return(0,n.useEffect)(()=>{fetch(`/api/space-overview?space=${encodeURIComponent(e)}`).then(e=>e.json()).then(e=>r(e.fileCount??0)).catch(()=>r(null))},[e]),t}(e),h=async()=>{l("loading"),c("");try{let t=await fetch("/api/space-overview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({space:e})}),s=await t.json();if(!t.ok){c(s.error||"Unknown error"),l("error");return}r.refresh()}catch(e){c(e instanceof Error?e.message:"Network error"),l("error")}};return(0,s.jsxs)("div",{className:"bg-muted/30 border border-border/40 rounded-lg px-4 py-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mb-3",children:[(0,s.jsx)(m.A,{size:14,className:"text-muted-foreground shrink-0"}),(0,s.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:t.fileTree.about})]}),"loading"===a?(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2 py-3",children:[(0,s.jsx)(x.A,{size:20,className:"text-[var(--amber)] animate-spin"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:t.dirView.overviewGenerating}),null!=u&&u>0&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground/60",children:t.dirView.overviewScanningFiles(u)})]}):"error"===a?(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2 py-3",children:[(0,s.jsx)(p.A,{size:18,className:"text-error"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:t.dirView.overviewError}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground/60 text-center max-w-[280px]",children:d}),(0,s.jsxs)("div",{className:"flex items-center gap-3 mt-1",children:[(0,s.jsx)("button",{onClick:h,className:"text-xs text-[var(--amber)] hover:underline",children:t.dirView.overviewRetry}),(0,s.jsx)(o(),{href:"/settings",className:"text-xs text-muted-foreground hover:text-foreground",children:t.dirView.uninitSettings})]})]}):(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2.5 py-2",children:[null!=u&&u>0?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-sm text-muted-foreground text-center",children:t.dirView.overviewCtaHint(u)}),(0,s.jsxs)("button",{onClick:h,className:"inline-flex items-center gap-1.5 px-4 py-2 text-sm rounded-lg transition-colors bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90",children:[(0,s.jsx)(f.A,{size:14}),t.dirView.overviewCta]})]}):0===u?(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:t.dirView.overviewNoFiles}):null,(0,s.jsx)(o(),{href:`/view/${(0,N.O0)(`${e}/README.md`)}`,className:"text-xs text-muted-foreground hover:text-foreground transition-colors",children:t.dirView.overviewOrEdit})]})]})}function M({dirPath:e,preview:t}){let{t:r}=(0,C.Y)(),a=(0,i.useRouter)(),[o,l]=(0,n.useState)("idle"),[d,c]=(0,n.useState)(""),[u,p]=(0,n.useState)(!1),[g,v]=(0,n.useState)(""),b=(0,n.useRef)(null);(0,n.useEffect)(()=>{if(!u)return;let e=e=>{b.current&&!b.current.contains(e.target)&&p(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[u]);let j=async()=>{p(!1),l("loading"),c(""),v("");try{let t=await fetch("/api/space-overview",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({space:e})}),s=await t.json().catch(()=>({}));if(!t.ok){c(s.error||"Unknown error"),l("error");return}s.unchanged?(l("unchanged"),setTimeout(()=>l("idle"),3e3)):(s.stats?.mode==="incremental"&&(v(r.dirView.overviewIncremental(s.stats.scannedFiles)),setTimeout(()=>v(""),4e3)),a.refresh(),l("idle"))}catch(e){c(e instanceof Error?e.message:"Network error"),l("error")}};if("loading"===o)return(0,s.jsxs)("div",{className:"bg-muted/30 border border-border/40 rounded-lg px-4 py-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,s.jsx)(m.A,{size:14,className:"text-muted-foreground shrink-0"}),(0,s.jsx)("span",{className:"text-sm font-medium text-muted-foreground flex-1",children:r.fileTree.about})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 py-2",children:[(0,s.jsx)(x.A,{size:14,className:"text-[var(--amber)] animate-spin"}),(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:r.dirView.overviewGenerating})]})]});if("error"===o)return(0,s.jsxs)("div",{className:"bg-muted/30 border border-border/40 rounded-lg px-4 py-3",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mb-2",children:[(0,s.jsx)(m.A,{size:14,className:"text-muted-foreground shrink-0"}),(0,s.jsx)("span",{className:"text-sm font-medium text-muted-foreground flex-1",children:r.fileTree.about})]}),(0,s.jsxs)("div",{className:"flex flex-col items-center gap-1.5 py-2",children:[(0,s.jsx)("p",{className:"text-xs text-error",children:r.dirView.overviewError}),d&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground/60 text-center",children:d}),(0,s.jsx)("button",{onClick:j,className:"text-xs text-[var(--amber)] hover:underline mt-1",children:r.dirView.overviewRetry})]})]});let y=(0,s.jsxs)("div",{className:"relative",ref:b,children:[(0,s.jsxs)("button",{onClick:()=>p(!0),className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs text-muted-foreground/60 hover:text-[var(--amber)] hover:bg-[var(--amber)]/10 transition-colors",title:r.dirView.overviewRegenerate,children:[(0,s.jsx)(f.A,{size:13}),(0,s.jsx)("span",{className:"hidden sm:inline",children:r.dirView.overviewRegenerateLabel})]}),u&&(0,s.jsxs)("div",{className:"absolute right-0 top-full mt-1.5 z-30 w-[260px] bg-card border border-border rounded-lg shadow-lg p-3",children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground leading-relaxed mb-3",children:r.dirView.overviewRegenerateConfirm}),(0,s.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,s.jsx)("button",{onClick:()=>p(!1),className:"px-2.5 py-1 text-xs rounded-md text-muted-foreground hover:bg-muted transition-colors",children:r.dirView.overviewRegenerateCancel}),(0,s.jsxs)("button",{onClick:j,className:"inline-flex items-center gap-1 px-2.5 py-1 text-xs rounded-md bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-colors",children:[(0,s.jsx)(f.A,{size:11}),r.dirView.overviewRegenerateStart]})]})]})]}),w=(0,s.jsx)("span",{className:"text-2xs text-muted-foreground/50",suppressHydrationWarning:!0,children:"unchanged"===o?(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 text-success",children:[(0,s.jsx)(h.A,{size:10}),r.dirView.overviewUnchanged]}):g?(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 text-success",children:[(0,s.jsx)(h.A,{size:10}),g]}):t.lastCompiled?r.dirView.overviewLastCompiled((0,N.KW)(new Date(t.lastCompiled).getTime(),r.home.relativeTime)):null});return(0,s.jsx)(P,{icon:(0,s.jsx)(m.A,{size:14,className:"text-muted-foreground shrink-0"}),title:r.fileTree.about,lines:t.readmeLines,viewAllHref:`/view/${(0,N.O0)(`${e}/README.md`)}`,viewAllLabel:r.fileTree.viewAll,trailing:y,footer:w})}function $({preview:e,dirPath:t}){let{t:r}=(0,C.Y)(),n=e.instructionLines.length>0,a=!(e.readmeLines.length>0)||e.readmeIsTemplate||e.isTemplate;return(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-6",children:[n&&(0,s.jsx)(P,{icon:(0,s.jsx)(g.A,{size:14,className:"text-muted-foreground shrink-0"}),title:r.fileTree.rules,lines:e.instructionLines,viewAllHref:`/view/${(0,N.O0)(`${t}/INSTRUCTION.md`)}`,viewAllLabel:r.fileTree.viewAll}),a?(0,s.jsx)(F,{dirPath:t}):(0,s.jsx)(M,{dirPath:t,preview:e})]})}function D({x:e,y:t,path:r,label:a,onClose:o}){let i=(0,n.useRef)(null),{t:l}=(0,C.Y)();(0,n.useEffect)(()=>{let e=e=>{i.current&&!i.current.contains(e.target)&&o()},t=e=>{"Escape"===e.key&&o()};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[o]);let d=Math.min(e,window.innerWidth-200),c=Math.min(t,window.innerHeight-60);return(0,s.jsx)("div",{ref:i,className:"fixed z-50 min-w-[160px] bg-card border border-border rounded-lg shadow-lg py-1",style:{top:c,left:d},children:(0,s.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{E(r),o()},children:[(0,s.jsx)(v.A,{size:14,className:"shrink-0"})," ",l.fileTree.copyPath]})})}function I({dirPath:e,entries:t,spacePreview:r}){let[a,i]=[(0,n.useSyncExternalStore)(e=>{let t=()=>e();return window.addEventListener("mindos-dir-view-change",t),()=>window.removeEventListener("mindos-dir-view-change",t)},()=>{let e=localStorage.getItem(z);return"list"===e||"grid"===e?e:"grid"},()=>"grid"),e=>{localStorage.setItem(z,e),window.dispatchEvent(new Event("mindos-dir-view-change"))}],l=(0,n.useSyncExternalStore)(R,L,()=>!1),{t:d}=(0,C.Y)(),c=e=>(0,N.KW)(e,d.home.relativeTime),[m,x]=(0,n.useState)(null),p=(0,n.useCallback)((e,t)=>{e.preventDefault(),e.stopPropagation(),x({x:e.clientX,y:e.clientY,path:t})},[]),f=(0,n.useMemo)(()=>l?t:t.filter(e=>"file"!==e.type||!k.C.has(e.name)),[t,l]),h=(0,n.useMemo)(()=>{let e=new Map;for(let t of f)e.set(t.path,function e(t){return"file"===t.type?1:(t.children||[]).reduce((t,r)=>t+e(r),0)}(t));return e},[f]);return(0,s.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,s.jsx)("div",{className:"sticky top-[52px] md:top-0 z-20 border-b border-border px-4 md:px-6 h-[46px] flex items-center bg-background",children:(0,s.jsxs)("div",{className:"w-full flex items-center justify-between gap-2",children:[(0,s.jsx)("div",{className:"min-w-0 flex-1",children:(0,s.jsx)(w.A,{filePath:e})}),(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,s.jsxs)(o(),{href:`/view/${(0,N.O0)(e?`${e}/Untitled.md`:"Untitled.md")}`,className:"flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-lg transition-colors text-muted-foreground hover:text-foreground hover:bg-muted",children:[(0,s.jsx)(b.A,{size:13}),(0,s.jsx)("span",{className:"hidden sm:inline",children:d.dirView.newFile})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1 p-1 bg-muted rounded-lg",children:[(0,s.jsx)("button",{onClick:()=>i("grid"),className:`p-1.5 rounded transition-colors ${"grid"===a?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,title:d.dirView.gridView,children:(0,s.jsx)(j.A,{size:14})}),(0,s.jsx)("button",{onClick:()=>i("list"),className:`p-1.5 rounded transition-colors ${"list"===a?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,title:d.dirView.listView,children:(0,s.jsx)(y.A,{size:14})})]})]})]})}),(0,s.jsx)("div",{className:"flex-1 px-4 md:px-6 py-6",children:(0,s.jsxs)("div",{className:"max-w-[860px] mx-auto",children:[r&&(0,s.jsx)($,{preview:r,dirPath:e}),0===f.length?(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:d.dirView.emptyFolder}):"grid"===a?(0,s.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 xl:grid-cols-5 gap-3",children:f.map(e=>(0,s.jsxs)(o(),{href:`/view/${(0,N.O0)(e.path)}`,onContextMenu:t=>p(t,e.path),className:"directory"===e.type?"flex flex-col items-center gap-1.5 p-3 rounded-xl border border-border bg-card hover:bg-accent hover:border-border/80 transition-all duration-100 text-center":"flex flex-col items-center gap-2 p-4 rounded-xl border border-border bg-card hover:bg-accent hover:border-border/80 transition-all duration-100 text-center",children:["directory"===e.type?(0,s.jsx)(u.A,{size:22,className:"text-yellow-400"}):(0,s.jsx)(S,{node:e}),(0,s.jsx)("span",{className:"text-xs text-foreground leading-snug line-clamp-2 w-full",title:e.name,suppressHydrationWarning:!0,children:e.name}),"directory"===e.type&&(0,s.jsx)("span",{className:"text-2xs text-muted-foreground",children:d.dirView.fileCount(h.get(e.path)??0)}),"file"===e.type&&e.mtime&&(0,s.jsx)("span",{className:"text-2xs text-muted-foreground",suppressHydrationWarning:!0,children:c(e.mtime)})]},e.path))}):(0,s.jsx)("div",{className:"flex flex-col divide-y divide-border border border-border rounded-xl overflow-hidden",children:f.map(e=>(0,s.jsxs)(o(),{href:`/view/${(0,N.O0)(e.path)}`,onContextMenu:t=>p(t,e.path),className:"flex items-center gap-3 px-4 py-3 bg-card hover:bg-accent transition-colors duration-100",children:[(0,s.jsx)(A,{node:e}),(0,s.jsx)("span",{className:"flex-1 text-sm text-foreground truncate",title:e.name,suppressHydrationWarning:!0,children:e.name}),"directory"===e.type?(0,s.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:d.dirView.fileCount(h.get(e.path)??0)}):e.mtime?(0,s.jsx)("span",{className:"text-xs text-muted-foreground shrink-0 tabular-nums",suppressHydrationWarning:!0,children:c(e.mtime)}):null]},e.path))})]})}),m&&(0,s.jsx)(D,{x:m.x,y:m.y,path:m.path,label:d.fileTree.copyPath,onClose:()=>x(null)})]})}},4056:(e,t,r)=>{"use strict";r.d(t,{f:()=>n});var s=r(9339);let n=(0,s.createServerReference)("60ae163089bdeddef638e4f656e8c128e2338885e8",s.callServer,void 0,s.findSourceMapURL,"renameFileAction")},7834:(e,t,r)=>{"use strict";async function s(e){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(e),!0}catch{}try{let t=document.createElement("textarea");t.value=e,t.style.position="fixed",t.style.opacity="0",document.body.appendChild(t),t.select();let r=document.execCommand("copy");return document.body.removeChild(t),r}catch{return!1}}r.d(t,{l:()=>s})},10377:(e,t,r)=>{"use strict";r.d(t,{Z:()=>f});var s=r(12115);let n="mindos-pinned-files",a="mindos:pins-changed";function o(){try{let e=localStorage.getItem(n);return e?JSON.parse(e):[]}catch{return[]}}function i(){return c}let l=[];function d(){return l}let c=[],u=!1;function m(){u||(c=o(),u=!0)}function x(e){m();let t=t=>{t.key===n&&(c=o(),e())},r=()=>{c=o(),e()};return window.addEventListener("storage",t),window.addEventListener(a,r),()=>{window.removeEventListener("storage",t),window.removeEventListener(a,r)}}function p(e){c=e;try{localStorage.setItem(n,JSON.stringify(e))}catch{}window.dispatchEvent(new Event(a))}function f(){m();let e=(0,s.useSyncExternalStore)(x,i,d),t=(0,s.useCallback)(t=>e.includes(t),[e]),r=(0,s.useCallback)(e=>{let t=o(),r=t.indexOf(e);r>=0?t.splice(r,1):t.unshift(e),p(t)},[]);return{pinnedFiles:e,isPinned:t,togglePin:r,reorderPins:(0,s.useCallback)(e=>{p(e)},[]),removePin:(0,s.useCallback)(e=>{p(o().filter(t=>t!==e))},[])}}},22356:(e,t,r)=>{"use strict";r.d(t,{h:()=>s,n:()=>n});class s extends Error{constructor(e,t,r){super(e),this.name="ApiError",this.status=t,this.code=r}}async function n(e,t={}){let r,a,o,{timeout:i=3e4,signal:l,...d}=t;if((i>0||l)&&(r=new AbortController),i>0&&r&&(a=setTimeout(()=>{r.abort(Error(`Request timed out after ${Math.round(i/1e3)}s`))},i)),l&&r)if(l.aborted)r.abort();else{let e=()=>r?.abort();l.addEventListener("abort",e,{once:!0}),o=()=>{l.removeEventListener("abort",e)}}let c=r?.signal??l;try{let t=await fetch(e,{...d,signal:c});if(!t.ok){let e,r=`Request failed (${t.status})`;try{let s=await t.json();s?.error?.code&&s?.error?.message?(r=s.error.message,e=s.error.code):s?.error&&(r="string"==typeof s.error?s.error:s.error.message??r)}catch{}throw new s(r,t.status,e)}return await t.json()}finally{a&&clearTimeout(a),o&&o()}}},36862:(e,t,r)=>{"use strict";r.d(t,{e:()=>o});var s=r(1934);let n=[{id:"system",label:"System",description:"Match app colors"},{id:"crepe",label:"Crepe",description:"Warm parchment"},{id:"crepe-dark",label:"Crepe Dark",description:"Warm dark"},{id:"nord",label:"Nord",description:"Cool blue"},{id:"nord-dark",label:"Nord Dark",description:"Arctic night"},{id:"frame",label:"Frame",description:"Clean minimal"},{id:"frame-dark",label:"Frame Dark",description:"Dark minimal"}],a="editor-theme",o=(0,s.v)(e=>{let t;return{theme:(t=localStorage.getItem(a),n.some(e=>e.id===t)?t:"system"),setTheme:t=>{localStorage.setItem(a,t),e({theme:t})}}})},44406:(e,t,r)=>{"use strict";r.d(t,{A:()=>f});var s=r(95155),n=r(98500),a=r.n(n),o=r(50538),i=r(33078),l=r(48368),d=r(38798),c=r(66614),u=r(21362),m=r(35581);let x={".mindos/change-log.json":{icon:(0,s.jsx)(o.A,{size:13,className:"text-[var(--amber)] shrink-0"}),getLabel:e=>e.changes.title}};function p({name:e}){let t=e.includes(".")?e.slice(e.lastIndexOf(".")).toLowerCase():"";return".csv"===t?(0,s.jsx)(i.A,{size:13,className:"text-success shrink-0"}):t?(0,s.jsx)(l.A,{size:13,className:"text-muted-foreground shrink-0"}):(0,s.jsx)(d.A,{size:13,className:"text-yellow-400 shrink-0"})}function f({filePath:e}){let{t}=(0,m.Y)(),r=x[e];if(r)return(0,s.jsxs)("nav",{className:"flex min-w-0 items-center gap-1 text-xs text-muted-foreground flex-nowrap overflow-hidden",children:[(0,s.jsx)(a(),{href:"/",className:"inline-flex items-center justify-center h-7 w-7 rounded-md hover:bg-muted/50 hover:text-foreground transition-colors shrink-0",title:"Home",children:(0,s.jsx)(c.A,{size:14})}),(0,s.jsx)(u.A,{size:12,className:"text-muted-foreground/50 shrink-0"}),(0,s.jsxs)("span",{className:"min-w-0 flex items-center gap-1.5 px-1.5 py-1 text-foreground font-medium",children:[r.icon,(0,s.jsx)("span",{className:"block truncate max-w-[180px] sm:max-w-[260px] md:max-w-[360px]",children:r.getLabel(t)})]})]});let n=e.split("/");return(0,s.jsxs)("nav",{className:"flex min-w-0 items-center gap-1 text-xs text-muted-foreground flex-nowrap overflow-hidden",children:[(0,s.jsx)(a(),{href:"/",className:"inline-flex items-center justify-center h-7 w-7 rounded-md hover:bg-muted/50 hover:text-foreground transition-colors shrink-0",title:"Home",children:(0,s.jsx)(c.A,{size:14})}),n.map((e,t)=>{let r=t===n.length-1,o="/view/"+n.slice(0,t+1).map(encodeURIComponent).join("/");return(0,s.jsxs)("span",{className:"flex items-center gap-1 min-w-0",children:[(0,s.jsx)(u.A,{size:12,className:"text-muted-foreground/50 shrink-0"}),r?(0,s.jsxs)("span",{className:"min-w-0 flex items-center gap-1.5 px-1.5 py-1 text-foreground font-medium",children:[(0,s.jsx)(p,{name:e}),(0,s.jsx)("span",{className:"block truncate max-w-[180px] sm:max-w-[260px] md:max-w-[360px]",suppressHydrationWarning:!0,children:e})]}):(0,s.jsx)(a(),{href:o,className:"block px-1.5 py-1 rounded-md hover:bg-muted/50 hover:text-foreground transition-colors truncate max-w-[120px] sm:max-w-[160px] md:max-w-[200px]",title:e,children:(0,s.jsx)("span",{suppressHydrationWarning:!0,children:e})})]},t)})]})}},46838:(e,t,r)=>{"use strict";r.d(t,{$7:()=>o,MZ:()=>c,TS:()=>l,UG:()=>a,YB:()=>d,pl:()=>i});let s=[],n=new Set;function a(){try{let e=localStorage.getItem("mindos-disabled-renderers");n=new Set(e?JSON.parse(e):[])}catch{n=new Set}}function o(e,t){let r=s.find(t=>t.id===e);r?.core||(t?n.delete(e):n.add(e),localStorage.setItem("mindos-disabled-renderers",JSON.stringify([...n])))}function i(e){let t=s.find(t=>t.id===e);return!!t?.core||!n.has(e)}function l(e){s.find(t=>t.id===e.id)||s.push(e)}function d(e,t,r){if(r){let e=s.find(e=>e.id===r);return e&&i(e.id)?e:void 0}return s.find(r=>i(r.id)&&r.match({filePath:e,extension:t}))}function c(){return s.filter(e=>!e.appBuiltinFeature)}},50037:(e,t,r)=>{"use strict";r.d(t,{default:()=>eh});var s=r(95155),n=r(12115),a=r(73321),o=r(80723),i=r(6296),l=r(95057),d=r(52475),c=r(49387),u=r(12710),m=r(7915),x=r(37618),p=r(33210),f=r(55243),h=r(94290),g=r(60285),v=r(48368),b=r(53810),j=r(6962),y=r(67635),w=r(68459),N=r(83399);function k({content:e}){let t=(0,n.useMemo)(()=>{try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}},[e]);return(0,s.jsx)("pre",{className:"rounded-xl border border-border bg-card px-4 py-3 overflow-x-auto text-sm leading-relaxed font-display",children:(0,s.jsx)("code",{suppressHydrationWarning:!0,children:t})})}var C=r(59386),E=r.n(C),A=r(9921),S=r(66088),z=r(56563),T=r(51914);function R(e,t){return E().unparse([e,...t])}function L({value:e,editable:t,onCommit:r}){let[a,o]=(0,n.useState)(!1),[i,l]=(0,n.useState)(e),d=(0,n.useRef)(null);function c(){o(!1),i!==e&&r(i)}return((0,n.useEffect)(()=>{a&&d.current?.select()},[a]),a)?(0,s.jsx)("input",{ref:d,value:i,onChange:e=>l(e.target.value),onBlur:c,onKeyDown:t=>{"Enter"===t.key&&c(),"Escape"===t.key&&(l(e),o(!1))},className:"w-full bg-transparent outline-none text-sm",style:{color:"var(--foreground)",borderBottom:"1px solid var(--amber)",minWidth:60},onClick:e=>e.stopPropagation()}):(0,s.jsx)("div",{className:`truncate text-sm ${t?"cursor-text":""}`,style:{color:"var(--foreground)",minWidth:60},onClick:t?function(){t&&(l(e),o(!0))}:void 0,title:e,children:e||(0,s.jsx)("span",{style:{color:"var(--muted-foreground)",opacity:.4},children:"—"})})}function P({headers:e,onAdd:t,onCancel:r}){let[a,o]=(0,n.useState)(()=>Array(e.length).fill("")),i=(0,n.useRef)(null);return(0,s.jsxs)("tr",{style:{background:"color-mix(in srgb, var(--amber) 6%, transparent)",borderTop:"1px solid var(--amber)"},children:[e.map((e,n)=>(0,s.jsx)("td",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:(0,s.jsx)("input",{ref:0===n?i:void 0,autoFocus:0===n,value:a[n],onChange:e=>{var t;return t=e.target.value,void o(e=>{let r=[...e];return r[n]=t,r})},onKeyDown:e=>{"Enter"===e.key&&t(a),"Escape"===e.key&&r()},placeholder:e,className:"w-full bg-transparent outline-none text-sm placeholder:opacity-30",style:{color:"var(--foreground)",borderBottom:"1px solid var(--border)"}})},n)),(0,s.jsx)("td",{className:"px-2 py-2",style:{borderBottom:"1px solid var(--border)"}})]})}function F({content:e,appendAction:t,saveAction:r}){let[a,o]=(0,n.useState)(e),[l,d]=(0,n.useState)(null),[c,u]=(0,n.useState)(null),[m,x]=(0,n.useState)(!1),[p,f]=(0,n.useState)(!1),h=(0,n.useMemo)(()=>E().parse(a,{skipEmptyLines:!0}).data,[a]),g=h[0]||[],v=h.slice(1),b=(0,n.useMemo)(()=>null===l||null===c?v:[...v].sort((e,t)=>{let r=e[l]??"",s=t[l]??"",n=parseFloat(r),a=parseFloat(s);return isNaN(n)||isNaN(a)?"asc"===c?r.localeCompare(s):s.localeCompare(r):"asc"===c?n-a:a-n}),[v,l,c]),j=(0,n.useCallback)(async(e,t,s)=>{if(!r)return;let n=R(g,v.map(r=>r===b[e]?r.map((e,r)=>r===t?s:e):r));o(n),f(!0);try{await r(n)}catch(e){console.error("[CsvView] Cell save failed:",e)}finally{f(!1)}},[r,v,b,g]),y=(0,n.useCallback)(async e=>{if(!r||p)return;let t=b[e],s=R(g,v.filter(e=>e!==t));o(s),f(!0);try{await r(s)}catch(e){console.error("[CsvView] Row delete failed:",e)}finally{f(!1)}},[r,v,b,g,p]),N=(0,n.useCallback)(async e=>{f(!0);try{if(t){let r=await t(e);o(r.newContent)}else if(r){let t=R(g,[...v,e]);o(t),await r(t)}x(!1)}catch(e){console.error("[CsvView] Add row failed:",e)}finally{f(!1)}},[t,r,g,v]),k=!!r||!!t;return 0===g.length?(0,s.jsx)("div",{className:"text-sm py-4",style:{color:"var(--muted-foreground)"},children:"Empty CSV file"}):(0,s.jsxs)("div",{className:"w-full rounded-xl overflow-hidden border",style:{borderColor:"var(--border)"},children:[(0,s.jsx)("div",{className:"overflow-x-auto",children:(0,s.jsxs)("table",{className:"min-w-full text-sm border-collapse",children:[(0,s.jsx)("thead",{children:(0,s.jsxs)("tr",{style:{background:"var(--muted)"},children:[g.map((e,t)=>(0,s.jsx)("th",{onClick:()=>(function(e){if(l!==e){d(e),u("asc");return}"asc"===c?u("desc"):(d(null),u(null))})(t),className:"px-4 py-2.5 text-left font-semibold cursor-pointer select-none whitespace-nowrap transition-colors hover:bg-accent",style:{color:"var(--foreground)",borderBottom:"1px solid var(--border)",fontSize:"0.75rem",letterSpacing:"0.04em",textTransform:"uppercase"},children:(0,s.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,s.jsx)("span",{children:e}),l===t?"asc"===c?(0,s.jsx)(A.A,{size:11,style:{color:"var(--amber)"}}):(0,s.jsx)(S.A,{size:11,style:{color:"var(--amber)"}}):(0,s.jsx)(z.A,{size:11,style:{color:"var(--muted-foreground)",opacity:.4}})]})},t)),k&&(0,s.jsx)("th",{className:"w-8",style:{borderBottom:"1px solid var(--border)",background:"var(--muted)"}})]})}),(0,s.jsxs)("tbody",{children:[b.map((e,t)=>(0,s.jsxs)("tr",{className:"group transition-colors",style:{background:t%2==0?"var(--background)":"var(--card)"},onMouseEnter:e=>e.currentTarget.style.background="var(--muted)",onMouseLeave:e=>e.currentTarget.style.background=t%2==0?"var(--background)":"var(--card)",children:[g.map((n,a)=>(0,s.jsx)("td",{className:"px-4 py-2.5 max-w-xs",style:{borderBottom:"1px solid var(--border)"},children:(0,s.jsx)(L,{value:e[a]??"",editable:!!r,onCommit:e=>j(t,a,e)})},a)),k&&(0,s.jsx)("td",{className:"px-2 py-2",style:{borderBottom:"1px solid var(--border)"},children:r&&(0,s.jsx)("button",{onClick:()=>y(t),disabled:p,className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/10 disabled:opacity-30",style:{color:"var(--muted-foreground)"},title:p?"Saving...":"Delete row",children:(0,s.jsx)(w.A,{size:12})})})]},t)),m&&(0,s.jsx)(P,{headers:g,onAdd:N,onCancel:()=>x(!1)})]})]})}),(0,s.jsxs)("div",{className:"px-4 py-2 flex items-center justify-between",style:{background:"var(--muted)",borderTop:"1px solid var(--border)"},children:[(0,s.jsxs)("span",{className:"text-xs font-display flex items-center gap-1.5",style:{color:"var(--muted-foreground)"},children:[v.length," rows \xb7 ",g.length," cols",p&&(0,s.jsx)(i.A,{size:10,className:"animate-spin",style:{color:"var(--amber)"}})]}),k&&!m&&(0,s.jsxs)("button",{onClick:()=>x(!0),className:"flex items-center gap-1 text-xs px-2.5 py-1 rounded-md transition-colors font-display",style:{color:"var(--amber)",background:"var(--amber-dim)"},children:[(0,s.jsx)(T.A,{size:12}),"Add row"]}),m&&(0,s.jsx)("button",{onClick:()=>x(!1),className:"text-xs px-2.5 py-1 rounded-md transition-colors font-display",style:{color:"var(--muted-foreground)"},children:"Cancel"})]})]})}var M=r(98500),$=r.n(M),D=r(47834),I=r(35581),O=r(22356);function V({filePath:e}){let[t,r]=(0,n.useState)([]),[a,o]=(0,n.useState)(!0),{t:i}=(0,I.Y)();return((0,n.useEffect)(()=>{o(!0),(0,O.n)(`/api/backlinks?path=${encodeURIComponent(e)}`).then(e=>{r(Array.isArray(e)?e:[]),o(!1)}).catch(()=>{r([]),o(!1)})},[e]),a||0!==t.length)?(0,s.jsxs)("div",{className:"mt-12 pt-8 border-t border-border",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-6 text-muted-foreground",children:[(0,s.jsx)(D.A,{size:16,className:"text-[var(--amber)]/70"}),(0,s.jsx)("h3",{className:"text-sm font-semibold tracking-wider uppercase",children:i.common?.relatedFiles||"Related Files"}),(0,s.jsx)("span",{className:"text-xs bg-muted px-1.5 py-0.5 rounded-full font-mono",children:t.length})]}),(0,s.jsx)("div",{className:"grid gap-3",children:a?(0,s.jsx)("div",{className:"space-y-3",children:[1,2].map(e=>(0,s.jsx)("div",{className:"h-20 bg-muted/30 rounded-lg animate-pulse"},e))}):t.map(e=>(0,s.jsx)($(),{href:`/view/${e.filePath.split("/").map(encodeURIComponent).join("/")}`,className:"group block p-4 rounded-xl border border-border/50 bg-card/30 hover:bg-muted/30 hover:border-[var(--amber)]/30 transition-all duration-200",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("div",{className:"mt-1 p-1.5 rounded-md bg-muted group-hover:bg-[var(--amber)]/10 transition-colors",children:(0,s.jsx)(v.A,{size:14,className:"text-muted-foreground group-hover:text-[var(--amber)]"})}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("div",{className:"font-medium text-sm text-foreground group-hover:text-[var(--amber)] transition-colors truncate mb-1",title:e.filePath,children:e.filePath}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground line-clamp-2 leading-relaxed italic opacity-80 group-hover:opacity-100 transition-opacity",title:e.snippets[0]||"",children:e.snippets[0]||""})]})]})},e.filePath))})]}):null}var H=r(77148),W=r(44406),U=r(37206);let B=(0,U.default)(()=>Promise.all([r.e(6079),r.e(2320),r.e(2774),r.e(3307),r.e(144),r.e(7154),r.e(2733),r.e(7086)]).then(r.bind(r,87086)),{loadableGenerated:{webpack:()=>[87086]},ssr:!1,loading:()=>(0,s.jsx)("div",{className:"h-full w-full min-h-[400px] rounded-lg border border-border bg-background flex items-center justify-center",children:(0,s.jsxs)("div",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[(0,s.jsx)("div",{className:"w-4 h-4 border-2 border-border border-t-foreground rounded-full animate-spin"}),(0,s.jsx)("span",{children:"Loading editor..."})]})})}),Y=(0,U.default)(()=>Promise.all([r.e(9971),r.e(9781),r.e(6079),r.e(5004),r.e(4949),r.e(8834),r.e(7154),r.e(9538),r.e(7844),r.e(6087)]).then(r.bind(r,16087)),{loadableGenerated:{webpack:()=>[16087]},ssr:!1});function J({value:e,onChange:t,viewMode:r}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"min-h-[50vh]",style:{display:"wysiwyg"===r?void 0:"none"},children:(0,s.jsx)(Y,{value:e,onChange:t})}),"source"===r&&(0,s.jsx)("div",{className:"rounded-xl overflow-hidden border border-border flex",style:{height:"calc(100vh - 160px)"},children:(0,s.jsx)("div",{className:"w-full h-full overflow-auto",children:(0,s.jsx)(B,{value:e,onChange:t,language:"markdown"})})})]})}var K=r(21362),G=r(36306),_=r(91337);function q(e){if(0===e.length)return[];for(let t of[...document.querySelectorAll(".prose"),...document.querySelectorAll(".ProseMirror")]){let r=!1,s=t;for(;s;){if("none"===s.style.display){r=!0;break}s=s.parentElement}if(r)continue;let n=Array.from(t.querySelectorAll("h1, h2, h3, h4, h5, h6")).filter(e=>!e.closest('.milkdown-code-block, .milkdown-toolbar, .language-picker, [role="toolbar"], [role="menu"]'));if(n.length>0)return e.map((e,t)=>n[t]??null)}return e.map(()=>null)}function Z({content:e}){let{t}=(0,I.Y)(),{headings:r,minLevel:a}=(0,n.useMemo)(()=>{let t=function(e){let t=new G.A,r=e.split("\n"),s=[],n=!1;for(let e of r){if(/^(`{3,}|~{3,})/.test(e)){n=!n;continue}if(n)continue;let r=e.match(/^(#{1,4})\s+(.+)/);if(r){let e=r[1].length,n=r[2].trim(),a=t.slug(n);s.push({id:a,text:n,level:e})}}return s}(e);return{headings:t,minLevel:t.length>0?Math.min(...t.map(e=>e.level)):1}},[e]),[o,i]=(0,n.useState)(-1),[l,d]=(0,n.useState)(!1);(0,n.useEffect)(()=>{let e=document.documentElement.style;return e.setProperty("--toc-width",l?"0px":"212px"),l?e.removeProperty("--toc-margin"):e.setProperty("--toc-margin","220px"),()=>{e.removeProperty("--toc-width"),e.removeProperty("--toc-margin")}},[l]);let c=(0,n.useRef)(null),u=(0,n.useRef)(null),m=(0,n.useRef)(new Map),x=(0,n.useRef)([]),p=(0,n.useCallback)(e=>{let t=m.current.get(e),r=u.current;if(!t||!r||!t.isConnected)return;let s=r.getBoundingClientRect(),n=t.getBoundingClientRect(),a=n.top<s.top+40,o=n.bottom>s.bottom-40;(a||o)&&t.scrollIntoView({block:"center",behavior:"auto"})},[]);return((0,n.useEffect)(()=>{if(0===r.length)return;let e=setTimeout(()=>{let e=q(r);x.current=e;let t=e.filter(Boolean);0!==t.length&&(c.current?.disconnect(),c.current=new IntersectionObserver(t=>{for(let r of t)if(r.isIntersecting){let t=e.indexOf(r.target);t>=0&&(i(t),p(t));break}},{rootMargin:"-58px 0% -70% 0%",threshold:0}),t.forEach(e=>c.current?.observe(e)))},300);return()=>{clearTimeout(e),c.current?.disconnect()}},[r]),r.length<2)?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:()=>d(e=>!e),className:"hidden xl:flex fixed z-10 top-[46px] flex items-center justify-center w-5 h-8 rounded-l-md border border-r-0 border-border hover:bg-muted transition-colors",style:{right:`calc(var(--right-panel-width, 0px) + ${212*!l}px)`,background:"var(--background)",transition:"right 200ms ease-in-out"},title:l?t.view.tocExpand:t.view.tocCollapse,children:(0,s.jsx)(K.A,{size:11,className:"text-muted-foreground/60 transition-transform duration-200",style:{transform:l?"rotate(180deg)":"rotate(0deg)"}})}),(0,s.jsxs)("aside",{className:"hidden xl:flex flex-col fixed z-10 overflow-hidden",style:{top:46,height:"calc(100vh - 46px)",width:212,right:"var(--right-panel-width, 0px)",transform:l?"translateX(212px)":"translateX(0)",transition:"transform 200ms ease-in-out, right 200ms ease-out"},children:[(0,s.jsx)("div",{className:"flex items-center h-[46px] px-4 border-l border-b border-border",style:{background:"var(--background)"},children:(0,s.jsx)("p",{className:"text-2xs font-semibold uppercase tracking-wider text-muted-foreground/55 shrink-0",children:t.view.tocTitle})}),(0,s.jsx)("nav",{ref:u,"aria-label":t.view.tocTitle,className:"flex flex-col gap-0.5 overflow-y-auto min-h-0 flex-1 pt-3 pb-5 pl-2 pr-3 border-l border-border",style:{background:"var(--background)"},children:r.map((e,t)=>{let n=(e.level-a)*14,l=o===t,d=e.level>a;return(0,s.jsx)("a",{ref:e=>{e?m.current.set(t,e):m.current.delete(t)},href:`#${e.id}`,onClick:e=>((e,t)=>{e.preventDefault();let s=q(r);x.current=s;let n=s[t];if(!n)return;let a=n.getBoundingClientRect().top+window.scrollY-58;window.scrollTo({top:a,behavior:"smooth"}),i(t)})(e,t),className:(0,_.cn)("block text-xs py-1 rounded transition-colors duration-100 leading-snug shrink-0 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",l&&"font-medium"),style:{paddingLeft:`${8+n}px`,paddingRight:"8px",borderLeft:"2px solid",borderLeftColor:l?"var(--amber)":d?"var(--border)":"transparent",marginLeft:d?"7px":"0",...l?{color:"var(--amber)",background:"var(--amber-dim)"}:{color:"var(--muted-foreground)"}},title:e.text,children:(0,s.jsx)("span",{className:"block truncate",suppressHydrationWarning:!0,children:e.text})},`${e.id}-${t}`)})})]})]})}let X="findip-highlight",Q="findip-active";function ee({containerRef:e,onClose:t}){let{t:r}=(0,I.Y)(),[a,o]=(0,n.useState)(""),[i,l]=(0,n.useState)(0),d=(0,n.useRef)(null),c=(0,n.useRef)([]);(0,n.useEffect)(()=>{d.current?.focus()},[]);let u=(0,n.useCallback)(()=>{for(let e of c.current){let t=e.parentNode;t&&(t.replaceChild(document.createTextNode(e.textContent||""),e),t.normalize())}c.current=[]},[]);(0,n.useEffect)(()=>{u(),l(0);let t=e.current;if(!t||!a.trim())return;let r=a.toLowerCase(),s=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode:e=>e.parentElement?.closest("[data-find-in-page]")?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}),n=[];for(;s.nextNode();)n.push(s.currentNode);let o=[];for(let e of n){let t=e.textContent||"",s=t.toLowerCase(),n=0,a=[];for(;;){let e=s.indexOf(r,n);if(-1===e)break;a.push(e),n=e+r.length}if(0===a.length)continue;let i=e.parentNode;if(!i)continue;let l=document.createDocumentFragment(),d=0;for(let e of a){e>d&&l.appendChild(document.createTextNode(t.slice(d,e)));let s=document.createElement("mark");s.className=X,s.textContent=t.slice(e,e+r.length),l.appendChild(s),o.push(s),d=e+r.length}d<t.length&&l.appendChild(document.createTextNode(t.slice(d))),i.replaceChild(l,e)}return c.current=o,l(+(o.length>0)),o.length>0&&(o[0].classList.add(Q),o[0].scrollIntoView({block:"center",behavior:"smooth"})),()=>{}},[a,e,u]),(0,n.useEffect)(()=>()=>{u()},[u]);let m=c.current.length,x=(0,n.useCallback)(e=>{let t=c.current;if(0===t.length)return;for(let e of t)e.classList.remove(Q);let r=((e-1)%t.length+t.length)%t.length;t[r].classList.add(Q),t[r].scrollIntoView({block:"center",behavior:"smooth"}),l(r+1)},[]),f=(0,n.useCallback)(()=>x(i+1),[i,x]),h=(0,n.useCallback)(()=>x(i-1),[i,x]),g=(0,n.useCallback)(e=>{"Escape"===e.key?(e.preventDefault(),t()):"Enter"===e.key&&(e.preventDefault(),e.shiftKey?h():f())},[t,f,h]);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("style",{children:`
|
|
2
|
-
mark.${X} {
|
|
3
|
-
background: rgba(250, 204, 21, 0.3);
|
|
4
|
-
color: inherit;
|
|
5
|
-
border-radius: 2px;
|
|
6
|
-
padding: 0;
|
|
7
|
-
}
|
|
8
|
-
mark.${Q} {
|
|
9
|
-
background: rgba(250, 204, 21, 0.7);
|
|
10
|
-
outline: 2px solid rgba(250, 204, 21, 0.5);
|
|
11
|
-
}
|
|
12
|
-
`}),(0,s.jsx)("div",{className:"sticky top-[98px] md:top-[46px] z-30 flex justify-end px-4 md:px-6 pointer-events-none","data-find-in-page":!0,children:(0,s.jsxs)("div",{className:"pointer-events-auto flex items-center gap-1.5 px-3 py-1.5 rounded-lg border border-border bg-card shadow-lg",children:[(0,s.jsx)("input",{ref:d,type:"text",value:a,onChange:e=>o(e.target.value),onKeyDown:g,placeholder:r.findInPage.placeholder,className:"w-[180px] sm:w-[220px] px-2 py-1 text-sm bg-transparent text-foreground placeholder:text-muted-foreground outline-none"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums shrink-0 min-w-[48px] text-center font-display",children:a.trim()?m>0?r.findInPage.matchCount(i,m):r.findInPage.noResults:""}),(0,s.jsx)("button",{onClick:h,disabled:0===m,className:"p-1 rounded text-muted-foreground hover:text-foreground disabled:opacity-30 transition-colors","aria-label":"Previous match",children:(0,s.jsx)(A.A,{size:14})}),(0,s.jsx)("button",{onClick:f,disabled:0===m,className:"p-1 rounded text-muted-foreground hover:text-foreground disabled:opacity-30 transition-colors","aria-label":"Next match",children:(0,s.jsx)(S.A,{size:14})}),(0,s.jsx)("button",{onClick:t,className:"p-1 rounded text-muted-foreground hover:text-foreground transition-colors","aria-label":"Close find",children:(0,s.jsx)(p.A,{size:14})})]})})]})}var et=r(46838),er=r(70620),es=r(4056),en=r(61182),ea=r(382),eo=r(4235),ei=r(39498),el=r(97631),ed=r(10377),ec=r(24332),eu=r(92451),em=r(94514);function ex({open:e,onClose:t,filePath:r,isDirectory:a,fileName:o}){let{t:l}=(0,I.Y)(),[d,c]=(0,n.useState)(a?"zip":"md"),[u,m]=(0,n.useState)("idle"),[x,f]=(0,n.useState)(""),h=(0,n.useRef)(null),g=(0,n.useCallback)(()=>{m("exporting"),f("");let e=new AbortController;h.current=e,fetch(`/api/export?path=${encodeURIComponent(r)}&format=${d}`,{signal:e.signal}).then(e=>{if(!e.ok){if((e.headers.get("content-type")??"").includes("json"))return e.json().then(e=>{throw Error(e.error||"Export failed")});throw Error(`Export failed (${e.status})`)}return e.blob().then(t=>({blob:t,res:e}))}).then(({blob:e,res:t})=>{let r=(t.headers.get("Content-Disposition")??"").match(/filename="?([^"]+)"?/),s=r?decodeURIComponent(r[1]):o,n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=s,document.body.appendChild(n),n.click(),document.body.removeChild(n),URL.revokeObjectURL(n.href),m("done"),eo.oR.success(l.export?.downloaded??"Downloaded")}).catch(e=>{"AbortError"!==e.name&&(m("error"),f(e.message??"Export failed"))}).finally(()=>{h.current=null})},[r,d,o,l]),b=(0,n.useCallback)(()=>{h.current&&(h.current.abort(),h.current=null),m("idle"),f("")},[]),y=(0,n.useCallback)(()=>{m("idle"),f("")},[]),w=(0,n.useCallback)(()=>{h.current&&h.current.abort(),h.current=null,m("idle"),f(""),t()},[t]);if(!e)return null;let N=a?[{value:"zip",label:l.export?.formatZipMd??"Markdown ZIP",desc:l.export?.formatZipMdDesc??"All files in original format",icon:(0,s.jsx)(ec.A,{size:14})},{value:"zip-html",label:l.export?.formatZipHtml??"HTML ZIP",desc:l.export?.formatZipHtmlDesc??"All files as webpages",icon:(0,s.jsx)(eu.A,{size:14})}]:[{value:"md",label:l.export?.formatMd??"Markdown (.md)",desc:l.export?.formatMdDesc??"Original format, editable",icon:(0,s.jsx)(v.A,{size:14})},{value:"html",label:l.export?.formatHtml??"HTML (.html)",desc:l.export?.formatHtmlDesc??"Static webpage, shareable",icon:(0,s.jsx)(eu.A,{size:14})}];return(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center modal-backdrop",onClick:"exporting"===u?void 0:w,children:(0,s.jsxs)("div",{className:"bg-card border border-border rounded-xl shadow-xl max-w-md w-full mx-4 animate-in fade-in-0 zoom-in-95 duration-200",role:"dialog","aria-modal":"true","aria-labelledby":"export-modal-title",onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(j.A,{size:15,className:"text-[var(--amber)]"}),(0,s.jsx)("h3",{id:"export-modal-title",className:"text-sm font-semibold",children:a?l.export?.exportSpace??"Export Space":l.export?.exportFile??"Export File"})]}),(0,s.jsx)("button",{onClick:w,className:"p-1 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","aria-label":l.export?.cancel??"Close",children:(0,s.jsx)(p.A,{size:14})})]}),(0,s.jsx)("div",{className:"px-5 py-4",children:"done"===u?(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"w-10 h-10 rounded-full bg-success/10 flex items-center justify-center mx-auto mb-3",children:(0,s.jsx)(em.A,{size:20,className:"text-success"})}),(0,s.jsx)("p",{className:"text-sm font-medium",children:l.export?.done??"Export Complete"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:o})]}):"error"===u?(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-error",children:l.export?.error??"Export failed"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:x})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-xs text-muted-foreground mb-3 truncate",title:r,children:r}),(0,s.jsx)("p",{className:"text-xs font-medium text-foreground mb-2",children:l.export?.chooseFormat??"Choose format"}),(0,s.jsx)("div",{className:"space-y-1.5",children:N.map(e=>(0,s.jsxs)("label",{className:`flex items-start gap-3 p-3 rounded-lg border cursor-pointer transition-all ${d===e.value?"border-[var(--amber)]/40 bg-[var(--amber-dim)]":"border-border hover:border-border/80 hover:bg-muted/30"} ${e.disabled?"opacity-40 cursor-not-allowed":""}`,children:[(0,s.jsx)("input",{type:"radio",name:"export-format",value:e.value,checked:d===e.value,onChange:()=>!e.disabled&&c(e.value),disabled:e.disabled,className:"sr-only"}),(0,s.jsx)("span",{className:`mt-0.5 ${d===e.value?"text-[var(--amber)]":"text-muted-foreground"}`,children:e.icon}),(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-sm font-medium text-foreground",children:e.label}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground block mt-0.5",children:e.desc})]})]},e.value))})]})}),(0,s.jsx)("div",{className:"flex items-center justify-end gap-2 px-5 py-3 border-t border-border",children:"done"===u?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:y,className:"px-3 py-1.5 rounded-md text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:l.export?.downloadAgain??"Download Again"}),(0,s.jsx)("button",{onClick:w,className:"px-3 py-1.5 rounded-md text-xs font-medium bg-[var(--amber-dim)] text-[var(--amber-text)] hover:opacity-80 transition-colors",children:l.export?.close??"Done"})]}):"error"===u?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:w,className:"px-3 py-1.5 rounded-md text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:l.export?.cancel??"Cancel"}),(0,s.jsx)("button",{onClick:y,className:"px-3 py-1.5 rounded-md text-xs font-medium bg-[var(--amber-dim)] text-[var(--amber-text)] hover:opacity-80 transition-colors",children:l.export?.retry??"Retry"})]}):"exporting"===u?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:b,className:"px-3 py-1.5 rounded-md text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:l.export?.cancel??"Cancel"}),(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium text-[var(--amber-text)] opacity-70",children:[(0,s.jsx)(i.A,{size:12,className:"animate-spin"})," ",l.export?.exporting??"Exporting..."]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:w,className:"px-3 py-1.5 rounded-md text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:l.export?.cancel??"Cancel"}),(0,s.jsxs)("button",{onClick:g,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium bg-[var(--amber-dim)] text-[var(--amber-text)] hover:opacity-80 transition-colors",children:[(0,s.jsx)(j.A,{size:12})," ",l.export?.exportButton??"Export"]})]})})]})})}var ep=r(36862),ef=r(565);function eh({filePath:e,content:t,extension:r,saveAction:C,appendRowAction:E,initialEditing:A=!1,isDraft:S=!1,draftDirectories:z=[],createDraftAction:T}){let{t:R}=(0,I.Y)(),{isPinned:L,togglePin:P}=(0,ed.Z)(),M=L(e),[$,D]=(0,n.useState)(!1);(0,ep.e)(e=>e.theme);let O=(0,n.useSyncExternalStore)(()=>()=>{},()=>!0,()=>!1),[U,Y]=(0,H.Un)("_raw",e,!1),[K,G]=(0,n.useState)(!1),q=(0,a.useRouter)(),X=["pdf","png","jpg","jpeg","gif","webp","svg","bmp","ico","mp3","wav","m4a","ogg","flac","aac","mp4","webm","mov","mkv"].includes(r),Q="md"===r,[ec,eu]=(0,n.useState)(()=>!X&&(!!A||""===t||(!Q||"preview"!==localStorage.getItem("md-view-mode"))&&Q)),[em,eh]=(0,n.useState)(t),[eg,ev]=(0,n.useState)(t),eb=(0,n.useRef)(t);(0,n.useEffect)(()=>{t!==eb.current&&(eb.current=t,ec||ev(t))},[t,ec]);let[ej,ey]=(0,n.useTransition)(),[ew,eN]=(0,n.useState)(null),[ek,eC]=(0,n.useState)(!1),eE=(0,n.useRef)(null),eA=(0,n.useRef)(!1),eS=(0,n.useRef)(!0),[ez,eT]=(0,n.useState)("idle");(0,n.useEffect)(()=>(eS.current=!0,()=>{eS.current=!1}),[]),(0,n.useEffect)(()=>{if(Q&&ec&&!S&&em!==eg)return eE.current&&clearTimeout(eE.current),eE.current=setTimeout(async()=>{if(!eA.current){eA.current=!0;try{if(!eS.current)return;eT("saving");let e=(0,ef.a)(em);if(await C(e),!eS.current)return;ev(e),eT("saved"),setTimeout(()=>{eS.current&&eT("idle")},1500)}catch{eS.current&&eT("idle")}finally{eA.current=!1}}},1e3),()=>{eE.current&&clearTimeout(eE.current)}},[em,eg,ec,Q,S,C]);let[eR,eL]=(0,n.useState)(()=>{let e=localStorage.getItem("md-view-mode");return"wysiwyg"===e||"source"===e||"preview"===e?e:"wysiwyg"}),[eP,eF]=(0,n.useState)(!1),eM=(0,n.useRef)(null),[e$,eD]=(0,n.useState)(!1),eI=(0,n.useRef)(null),eO=(0,n.useRef)(null),[eV,eH]=(0,n.useState)(!1),[eW,eU]=(0,n.useState)(!1),[eB,eY]=(0,n.useState)(""),[,eJ]=(0,n.useTransition)(),eK=e.split("/").pop()||"Untitled.md",[eG,e_]=(0,n.useState)(S),[eq,eZ]=(0,n.useState)(""),[eX,eQ]=(0,n.useState)(eK);(0,n.useEffect)(()=>{if(!e$)return;let e=e=>{eI.current&&!eI.current.contains(e.target)&&eO.current&&!eO.current.contains(e.target)&&eD(!1)},t=e=>{"Escape"===e.key&&eD(!1)};return document.addEventListener("mousedown",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("keydown",t)}},[e$]);let e0=(0,n.useCallback)(()=>{navigator.clipboard.writeText(e).catch(()=>{}),eD(!1)},[e]),e1=(0,n.useCallback)(()=>{eD(!1),eY(e.split("/").pop()??""),eU(!0)},[e]),e5=(0,n.useCallback)(()=>{let t=eB.trim();t&&t!==e.split("/").pop()?eJ(async()=>{let r=await (0,es.f)(e,t);eU(!1),r.success&&r.newPath&&(q.push(`/view/${(0,_.O0)(r.newPath)}`),q.refresh(),window.dispatchEvent(new Event("mindos:files-changed")))}):eU(!1)},[eB,e,q]),e3=(0,n.useCallback)(()=>{eH(!1);let t=e.split("/").pop()??e;ey(async()=>{let r=await (0,en.i)(e);if(r.success){if(r.trashId){let e=r.trashId;eo.oR.undo(`${R.trash?.movedToTrash??"Deleted"} ${t}`,async()=>{let t=await (0,ea.Y)(e);t.success?(q.refresh(),window.dispatchEvent(new Event("mindos:files-changed"))):eo.oR.error(t.error??"Undo failed")},{label:R.trash?.undo??"Undo"})}q.push("/"),q.refresh(),window.dispatchEvent(new Event("mindos:files-changed"))}})},[e,q,R]),e2=!!O&&U,e4=(0,n.useCallback)(()=>{Y(e=>!e)},[Y]),e6=(0,n.useCallback)(()=>{G(e=>!e)},[G]),e8=(0,et.YB)(e,r),e9="md"===r&&K?(0,et.YB)(e,r,"graph"):void 0,e7=e9||e8,te="csv"===r,tt=!ec&&!!e7&&(!e2||!!e9),tr=(0,n.useMemo)(()=>e7?e7.component?e7.component:e7.load?(0,n.lazy)(e7.load):null:null,[e7]),ts=(0,n.useCallback)(()=>{eh(eg),eu(!0),eN(null),eC(!1)},[eg]),tn=(0,n.useCallback)(()=>{S?q.push("/"):(eu(!1),eN(null))},[S,q]),ta=(0,n.useCallback)(()=>{let e=eX.trim();if(!e)return void eN("Please enter a file name");if(/[/\\:*?"<>|]/.test(e)||e.includes(".."))return void eN("File name contains invalid characters");if(!T)return void eN("Draft save is not available");let t=e.endsWith(".md")||e.endsWith(".csv")?e:`${e}.md`,r=eq?`${eq}/${t}`:t;eN(null),ey(async()=>{try{await T(r,em),ev(em),eu(!1),e_(!1),eC(!0),setTimeout(()=>eC(!1),2500),q.push(`/view/${(0,_.O0)(r)}`),q.refresh()}catch(e){eN(e instanceof Error?e.message:"Failed to save")}})},[eX,T,eq,em,q]),to=(0,n.useCallback)(()=>{if(te){eu(!1),eC(!0),setTimeout(()=>eC(!1),2500);return}S?e_(!0):(eN(null),ey(async()=>{try{let e=(0,ef.a)(em);await C(e),ev(e),Q||eu(!1),eC(!0),setTimeout(()=>eC(!1),2500)}catch(e){eN(e instanceof Error?e.message:"Failed to save")}}))},[te,S,Q,C,em]),ti=(0,n.useCallback)(async e=>{await C(e),ev(e)},[C]);(0,n.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&"s"===e.key&&(e.preventDefault(),ec&&to()),(e.metaKey||e.ctrlKey)&&"f"===e.key&&!ec&&(e.preventDefault(),eF(!0)),"e"!==e.key||ec||X||document.activeElement?.tagName!=="BODY"||ts(),"Escape"===e.key&&ec&&!Q&&tn()};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[ec,to,ts,tn]);let[tl,td]=(0,n.useState)(!1),[tc,tu]=(0,n.useState)([]),tm=(0,n.useRef)(t),tx=(0,n.useRef)(!1),tp=(0,n.useRef)(null),tf=(0,n.useRef)(null);return(0,n.useEffect)(()=>{if(!ec&&tx.current&&t!==tm.current&&""!==tm.current){tx.current=!1;let e=(0,el.m)(tm.current,t),r=[],s=1;for(let t of e)"insert"===t.type?(r.push(s),s++):"equal"===t.type&&s++;r.length>0&&(tu(r),tp.current&&clearTimeout(tp.current),tp.current=setTimeout(()=>tu([]),6e3),setTimeout(()=>{let e=document.querySelector("[data-highlight-line]");e&&e.scrollIntoView({block:"center",behavior:"smooth"})},100))}tm.current=t},[t,ec]),(0,n.useEffect)(()=>{let e=null,t=()=>{ec||(e&&clearTimeout(e),e=setTimeout(()=>{tx.current=!0,q.refresh(),td(!0),tf.current&&clearTimeout(tf.current),tf.current=setTimeout(()=>td(!1),3e3)},300))};return window.addEventListener("mindos:files-changed",t),()=>{window.removeEventListener("mindos:files-changed",t),e&&clearTimeout(e)}},[ec,q]),(0,s.jsxs)("div",{className:"flex flex-col min-h-screen",children:[(0,s.jsx)("div",{className:"sticky top-[52px] md:top-0 z-20 border-b border-border px-4 md:px-6 h-[46px] flex items-center",style:{background:"var(--background)"},children:(0,s.jsxs)("div",{className:"w-full min-w-0 flex items-center justify-between gap-3 h-full",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1 flex items-center gap-1.5",children:[(0,s.jsx)("button",{onClick:()=>q.back(),className:"md:hidden p-1 -ml-1 rounded text-muted-foreground hover:text-foreground transition-colors shrink-0","aria-label":"Go back",children:(0,s.jsx)(o.A,{size:16})}),(0,s.jsx)(W.A,{filePath:e})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 md:gap-2 shrink-0",children:[tl&&!ec&&(0,s.jsxs)("span",{className:"text-xs flex items-center gap-1.5 text-[var(--amber)] animate-in fade-in-0 duration-200",children:[(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--amber)]"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"updated"})]}),Q&&ec&&"saving"===ez&&(0,s.jsxs)("span",{className:"text-xs flex items-center gap-1.5 text-muted-foreground animate-in fade-in-0 duration-200",children:[(0,s.jsx)(i.A,{size:12,className:"animate-spin"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"saving..."})]}),Q&&ec&&"saved"===ez&&(0,s.jsxs)("span",{className:"text-xs flex items-center gap-1.5 animate-in fade-in-0 duration-200",style:{color:"var(--success)"},children:[(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--success)"}}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"saved"})]}),ek&&!Q&&(0,s.jsxs)("span",{className:"text-xs flex items-center gap-1.5",style:{color:"var(--success)"},children:[(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full",style:{background:"var(--success)"}}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"saved"})]}),ew&&(0,s.jsx)("span",{className:"text-xs text-error hidden sm:inline",children:ew}),e8&&!ec&&!S&&!e9&&!X&&(0,s.jsxs)("button",{onClick:e4,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-colors",style:{background:e2?"var(--amber)22":"var(--muted)",color:e2?"var(--amber)":"var(--muted-foreground)"},title:e2?`Switch to ${e8?.name}`:"View raw",children:[e2?(0,s.jsx)(l.A,{size:13}):(0,s.jsx)(d.A,{size:13}),(0,s.jsx)("span",{className:"hidden sm:inline",children:e2?e8.name:"Raw"})]}),Q&&!S&&(0,s.jsx)("div",{className:"flex items-center gap-0.5 p-0.5 bg-muted rounded-md",children:[{id:"wysiwyg",icon:(0,s.jsx)(c.A,{size:11}),label:"Edit"},{id:"source",icon:(0,s.jsx)(u.A,{size:11}),label:"Source"},{id:"preview",icon:(0,s.jsx)(m.A,{size:11}),label:"View"}].map(e=>(0,s.jsxs)("button",{onClick:()=>{var t;if(eL(t=e.id),localStorage.setItem("md-view-mode",t),"preview"===e.id){let e=(0,ef.a)(em);ev(e),e!==eg&&C(e).catch(()=>{}),eu(!1)}else ec||(eh(eg),eu(!0))},className:`flex items-center gap-1 px-2 py-1 rounded text-[11px] font-medium transition-colors ${eR===e.id?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"}`,children:[e.icon,(0,s.jsx)("span",{className:"hidden md:inline",children:e.label})]},e.id))}),!ec&&!tt&&!S&&!X&&!Q&&(0,s.jsxs)("button",{onClick:ts,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-colors",style:{background:"var(--muted)",color:"var(--muted-foreground)"},onMouseEnter:e=>{e.currentTarget.style.color="var(--foreground)",e.currentTarget.style.background="var(--accent)"},onMouseLeave:e=>{e.currentTarget.style.color="var(--muted-foreground)",e.currentTarget.style.background="var(--muted)"},children:[(0,s.jsx)(x.A,{size:13}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Edit"})]}),ec&&!Q&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{onClick:tn,disabled:ej,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-colors disabled:opacity-50",style:{background:"var(--muted)",color:"var(--muted-foreground)"},onMouseEnter:e=>{e.currentTarget.style.background="var(--accent)"},onMouseLeave:e=>{e.currentTarget.style.background="var(--muted)"},children:[(0,s.jsx)(p.A,{size:13}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Cancel"})]}),(0,s.jsxs)("button",{onClick:S&&eG?ta:to,disabled:ej,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium disabled:opacity-50",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:[ej?(0,s.jsx)(i.A,{size:13,className:"animate-spin"}):(0,s.jsx)(f.A,{size:13}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Save"})]})]}),ec&&Q&&S&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{onClick:tn,disabled:ej,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-colors disabled:opacity-50",style:{background:"var(--muted)",color:"var(--muted-foreground)"},onMouseEnter:e=>{e.currentTarget.style.background="var(--accent)"},onMouseLeave:e=>{e.currentTarget.style.background="var(--muted)"},children:[(0,s.jsx)(p.A,{size:13}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Cancel"})]}),(0,s.jsxs)("button",{onClick:eG?ta:to,disabled:ej,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium disabled:opacity-50",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:[ej?(0,s.jsx)(i.A,{size:13,className:"animate-spin"}):(0,s.jsx)(f.A,{size:13}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Save"})]})]}),!S&&(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("button",{type:"button",onClick:()=>P(e),className:"p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:M?R.fileTree.removeFromFavorites:R.fileTree.pinToFavorites,children:(0,s.jsx)(h.A,{size:16,className:M?"fill-[var(--amber)] text-[var(--amber)]":""})}),(0,s.jsx)("button",{ref:eI,type:"button",onClick:()=>eD(e=>!e),className:"p-1.5 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:R.view?.more??"More",children:(0,s.jsx)(g.A,{size:16})}),e$&&(0,s.jsxs)("div",{ref:eO,className:"absolute right-0 top-full mt-1 z-50 min-w-[160px] rounded-lg border border-border bg-card shadow-lg py-1",children:["md"===r&&!ec&&!S&&(0,et.pl)("graph")&&(0,s.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{eD(!1),e6()},children:[K?(0,s.jsx)(v.A,{size:14,className:"shrink-0"}):(0,s.jsx)(b.A,{size:14,className:"shrink-0"}),K?R.view?.switchToDoc??"Document view":R.view?.switchToGraph??"Wiki Graph"]}),(0,s.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:()=>{eD(!1),D(!0)},children:[(0,s.jsx)(j.A,{size:14,className:"shrink-0"})," ",R.fileTree?.export??"Export"]}),(0,s.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:e0,children:[(0,s.jsx)(y.A,{size:14,className:"shrink-0"})," ",R.view?.copyPath??R.fileTree?.copyPath??"Copy Path"]}),(0,s.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",onClick:e1,children:[(0,s.jsx)(c.A,{size:14,className:"shrink-0"})," ",R.view?.rename??"Rename"]}),(0,s.jsx)("div",{className:"my-1 border-t border-border/50"}),(0,s.jsxs)("button",{className:"w-full flex items-center gap-2 px-3 py-2 text-sm text-error hover:bg-error/10 transition-colors text-left",onClick:()=>{eD(!1),eH(!0)},children:[(0,s.jsx)(w.A,{size:14,className:"shrink-0"})," ",R.view?.delete??"Delete"]})]})]})]})]})}),(0,s.jsx)("div",{className:"flex-1 py-6 md:py-8",children:Q&&!tt?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"content-width",style:{display:ec?void 0:"none"},children:[S&&eG&&(0,s.jsxs)("div",{className:"mb-3 rounded-lg border border-border bg-card p-3 flex flex-col gap-2",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-muted-foreground",children:R.view?.saveDirectory??"Directory"}),(0,s.jsx)("div",{className:"mt-1",children:(0,s.jsx)(er.A,{dirPaths:z,value:eq,onChange:eZ,rootLabel:R.home?.rootLevel??"Root"})})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-muted-foreground",children:R.view?.saveFileName??"File name"}),(0,s.jsx)("input",{value:eX,onChange:e=>eQ(e.target.value),onKeyDown:e=>{"Enter"===e.key&&ta()},className:"mt-1 w-full px-2.5 py-1.5 text-sm bg-background border border-border rounded-lg text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring",placeholder:"Untitled.md"})]})]}),(0,s.jsx)(J,{value:em,onChange:eh,viewMode:eR}),"source"!==eR&&(0,s.jsx)(Z,{content:em})]}),(0,s.jsxs)("div",{ref:eM,className:"content-width",style:{display:ec?"none":void 0},children:[eP&&(0,s.jsx)(ee,{containerRef:eM,onClose:()=>eF(!1)}),(0,s.jsx)(N.default,{content:(0,ef.a)(eg),highlightLines:tc,onDismissHighlight:()=>tu([]),emptyPlaceholder:R.view?.emptyNote}),(0,s.jsx)(Z,{content:(0,ef.a)(eg)}),(0,s.jsx)(V,{filePath:e})]})]}):tt&&tr?(0,s.jsxs)("div",{ref:eM,className:"content-width",children:[eP&&(0,s.jsx)(ee,{containerRef:eM,onClose:()=>eF(!1)}),(0,s.jsx)(n.Suspense,{fallback:(0,s.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,s.jsx)(i.A,{size:20,className:"animate-spin text-muted-foreground"})}),children:(0,s.jsx)(tr,{filePath:e,content:eg,extension:r,saveAction:ti})}),(0,s.jsx)(V,{filePath:e})]}):ec?(0,s.jsx)("div",{className:"content-width",children:te?(0,s.jsx)(F,{content:em,filePath:e,appendAction:E,saveAction:async e=>{await C(e),eh(e),ev(e)}}):(0,s.jsx)(B,{value:em,onChange:eh,language:"plain"})}):(0,s.jsxs)("div",{ref:eM,className:"content-width",children:[eP&&(0,s.jsx)(ee,{containerRef:eM,onClose:()=>eF(!1)}),"csv"===r?(0,s.jsx)(F,{content:eg,filePath:e}):"json"===r?(0,s.jsx)(k,{content:eg}):(0,s.jsx)(N.default,{content:eg,highlightLines:tc,onDismissHighlight:()=>tu([]),emptyPlaceholder:R.view?.emptyNote}),(0,s.jsx)(V,{filePath:e})]})}),eW&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/60 backdrop-blur-sm",children:(0,s.jsxs)("div",{className:"bg-card border border-border rounded-lg shadow-lg p-4 w-80",children:[(0,s.jsx)("h3",{className:"text-sm font-medium mb-2",children:"Rename"}),(0,s.jsx)("input",{autoFocus:!0,value:eB,onChange:e=>eY(e.target.value),onKeyDown:e=>{"Enter"===e.key&&e5(),"Escape"===e.key&&eU(!1)},className:"w-full bg-muted border border-border rounded-md px-3 py-1.5 text-sm text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 mt-3",children:[(0,s.jsx)("button",{onClick:()=>eU(!1),className:"px-3 py-1.5 rounded-md text-xs bg-muted text-muted-foreground hover:bg-accent transition-colors",children:R.view?.cancel??"Cancel"}),(0,s.jsx)("button",{onClick:e5,className:"px-3 py-1.5 rounded-md text-xs bg-[var(--amber)] text-[var(--amber-foreground)] transition-colors",children:R.view?.rename??"Rename"})]})]})}),(0,s.jsx)(ei.TM,{open:eV,title:R.view?.delete??"Delete",message:R.view?.deleteConfirm?.(e.split("/").pop()??"")??`Delete "${e.split("/").pop()}"?`,confirmLabel:R.view?.delete??"Delete",cancelLabel:R.view?.cancel??"Cancel",variant:"destructive",onCancel:()=>eH(!1),onConfirm:e3}),(0,s.jsx)(ex,{open:$,onClose:()=>D(!1),filePath:e,isDirectory:!1,fileName:e.split("/").pop()??e})]})}},50728:(e,t,r)=>{Promise.resolve().then(r.bind(r,50037)),Promise.resolve().then(r.bind(r,3109)),Promise.resolve().then(r.bind(r,1012))},61182:(e,t,r)=>{"use strict";r.d(t,{i:()=>n});var s=r(9339);let n=(0,s.createServerReference)("4058c2f951d48293247307ad93987c8790cf36631c",s.callServer,void 0,s.findSourceMapURL,"deleteFileAction")},70620:(e,t,r)=>{"use strict";r.d(t,{A:()=>u});var s=r(95155),n=r(12115),a=r(47650),o=r(21362),i=r(38798),l=r(94514),d=r(66088),c=r(91337);function u({dirPaths:e,value:t,onChange:r,rootLabel:u="Root"}){let[m,x]=(0,n.useState)(!1),[p,f]=(0,n.useState)(t),[h,g]=(0,n.useState)(null),v=(0,n.useRef)(null),b=(0,n.useRef)(null);(0,n.useEffect)(()=>{f(t)},[t]);let j=(0,n.useCallback)(()=>{if(!v.current)return;let e=v.current.getBoundingClientRect(),t=window.innerHeight-e.bottom,r=e.top,s=t<208&&r>t;g({top:s?e.top:e.bottom,left:e.left,width:e.width,flipUp:s})},[]),y=(0,n.useRef)(0),w=(0,n.useCallback)(()=>{y.current||(y.current=requestAnimationFrame(()=>{y.current=0,j()}))},[j]);(0,n.useEffect)(()=>m?(j(),window.addEventListener("scroll",w,!0),window.addEventListener("resize",w),()=>{window.removeEventListener("scroll",w,!0),window.removeEventListener("resize",w),y.current&&(cancelAnimationFrame(y.current),y.current=0)}):void g(null),[m,j,w]);let N=(0,n.useCallback)(()=>x(!1),[]);(0,n.useEffect)(()=>{if(!m)return;let e=e=>{"Escape"===e.key&&(e.preventDefault(),N())},t=e=>{let t=e.target;v.current?.contains(t)||b.current?.contains(t)||N()};return document.addEventListener("keydown",e),document.addEventListener("mousedown",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("mousedown",t)}},[m,N]);let k=(0,n.useMemo)(()=>{let t=p?p+"/":"";return e.filter(e=>{if(!e.startsWith(t))return!1;let r=e.slice(t.length);return r.length>0&&!r.includes("/")}).sort()},[e,p]),C=(0,n.useMemo)(()=>p?p.split("/"):[],[p]),E=e=>{if(e<0)f(""),r("");else{let t=C.slice(0,e+1).join("/");f(t),r(t)}},A=t?t.split("/").map(e=>(0,c.vr)(e)).join(" / "):"/ "+u,S=m&&h&&(0,a.createPortal)((0,s.jsxs)("div",{ref:b,className:"fixed z-50 rounded-lg border border-[var(--amber)] bg-card shadow-lg overflow-hidden flex flex-col",style:{left:h.left,width:h.width,maxHeight:200,...h.flipUp?{bottom:window.innerHeight-h.top+4}:{top:h.top+4}},children:[(0,s.jsxs)("div",{className:"flex items-center gap-0.5 px-3 py-1.5 bg-muted/30 border-b border-border overflow-x-auto text-xs shrink-0",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>E(-1),className:`shrink-0 px-1.5 py-0.5 rounded transition-colors ${""===p?"text-[var(--amber)] font-medium":"text-muted-foreground hover:text-foreground"}`,children:["/ ",u]}),C.map((e,t)=>(0,s.jsxs)("span",{className:"flex items-center gap-0.5 shrink-0",children:[(0,s.jsx)(o.A,{size:10,className:"text-muted-foreground/50"}),(0,s.jsx)("button",{type:"button",onClick:()=>E(t),className:`px-1.5 py-0.5 rounded transition-colors truncate max-w-[100px] ${t===C.length-1?"text-[var(--amber)] font-medium":"text-muted-foreground hover:text-foreground"}`,children:e})]},t))]}),k.length>0?(0,s.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:k.map(t=>{let n=t.split("/").pop()||t,a=e.some(e=>e.startsWith(t+"/"));return(0,s.jsxs)("button",{type:"button",onClick:()=>{f(t),r(t)},className:"w-full flex items-center gap-2 px-3 py-1.5 text-xs text-foreground hover:bg-muted/60 transition-colors",children:[(0,s.jsx)(i.A,{size:12,className:"shrink-0 text-[var(--amber)]"}),(0,s.jsx)("span",{className:"flex-1 text-left truncate",children:n}),a&&(0,s.jsx)(o.A,{size:11,className:"shrink-0 text-muted-foreground/40"})]},t)})}):(0,s.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground/50 text-center",children:"—"}),(0,s.jsx)("button",{type:"button",onClick:N,className:"w-full py-1.5 flex items-center justify-center gap-1 text-xs font-medium text-[var(--amber)] border-t border-border hover:bg-muted/30 transition-colors shrink-0",children:(0,s.jsx)(l.A,{size:12})})]}),document.body);return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("button",{ref:v,type:"button",onClick:()=>x(e=>!e),"aria-haspopup":"true","aria-expanded":m,className:`w-full flex items-center gap-2 px-3 py-2 text-sm rounded-lg border bg-background text-foreground transition-colors text-left focus-visible:ring-1 focus-visible:ring-ring outline-none ${m?"border-[var(--amber)]":"border-border hover:border-[var(--amber)]/40"}`,children:[(0,s.jsx)(i.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),(0,s.jsx)("span",{className:"flex-1 truncate",children:A}),(0,s.jsx)(d.A,{size:14,className:`shrink-0 text-muted-foreground transition-transform duration-150 ${m?"rotate-180":""}`})]}),S]})}},77148:(e,t,r)=>{"use strict";r.d(t,{Un:()=>a});var s=r(12115);let n="mindos-renderer-state-change";function a(e,t,r){let a=`mindos-renderer:${e}:${t}`,o=(0,s.useRef)({key:a,raw:null,parsed:r});return o.current.key!==a&&(o.current={key:a,raw:null,parsed:r}),[(0,s.useSyncExternalStore)(e=>{let t=()=>e();return window.addEventListener("storage",t),window.addEventListener(n,t),()=>{window.removeEventListener("storage",t),window.removeEventListener(n,t)}},()=>{try{let e=localStorage.getItem(a);if(e===o.current.raw)return o.current.parsed;if(null===e)return o.current={key:a,raw:null,parsed:r},r;let t=JSON.parse(e);return o.current={key:a,raw:e,parsed:t},t}catch{return r}},()=>r),(0,s.useCallback)(e=>{try{let t=(()=>{try{let e=localStorage.getItem(a);return null!==e?JSON.parse(e):r}catch{return r}})(),s="function"==typeof e?e(t):e,n=JSON.stringify(s);localStorage.setItem(a,n),o.current={key:a,raw:n,parsed:s}}catch{}window.dispatchEvent(new Event(n))},[a,r])]}},82125:(e,t,r)=>{"use strict";r.d(t,{A:()=>n,C:()=>s});let s=new Set(["INSTRUCTION.md","README.md","CONFIG.json","CHANGELOG.md"]),n=new Set(["TODO.md"])},83399:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>b});var s=r(95155),n=r(14963),a=r(97894),o=r(98076),i=r(56728),l=r(16535),d=r(12115),c=r(94514),u=r(67635),m=r(33210),x=r(7834),p=r(4235);function f({code:e}){let[t,r]=(0,d.useState)(!1),n=(0,d.useCallback)(()=>{(0,x.l)(e).then(e=>{e&&(r(!0),setTimeout(()=>r(!1),2e3),p.oR.copy())})},[e]);return(0,s.jsx)("button",{onClick:n,className:" absolute top-2.5 right-2.5 p-1.5 rounded-md bg-muted hover:bg-accent text-muted-foreground hover:text-foreground transition-colors duration-100 opacity-60 group-hover:opacity-100 ",title:"Copy code",children:t?(0,s.jsx)(c.A,{size:13}):(0,s.jsx)(u.A,{size:13})})}function h(e){let{node:t,inline:r,ordered:s,depth:n,isHeader:a,...o}=e;return o}function g(e){let t=({children:t,...r})=>(0,s.jsx)(e,{...h(r),suppressHydrationWarning:!0,children:t});return t.displayName=e,t}let v={h1:g("h1"),h2:g("h2"),h3:g("h3"),h4:g("h4"),h5:g("h5"),h6:g("h6"),code:({children:e,node:t,...r})=>(0,s.jsx)("code",{...h(r),suppressHydrationWarning:!0,children:e}),pre({children:e,node:t,...r}){let n="";return e&&"object"==typeof e&&"props"in e&&(n=function e(t){return"string"==typeof t?t:Array.isArray(t)?t.map(e).join(""):t&&"object"==typeof t&&"props"in t?e(t.props?.children):""}(e.props?.children)),(0,s.jsxs)("div",{className:"relative group",children:[(0,s.jsx)("pre",{...h(r),suppressHydrationWarning:!0,children:e}),(0,s.jsx)(f,{code:n})]})},li:({children:e,node:t,...r})=>(0,s.jsx)("li",{...h(r),suppressHydrationWarning:!0,children:e}),p:({children:e,node:t,...r})=>(0,s.jsx)("p",{...h(r),suppressHydrationWarning:!0,children:e}),span:({children:e,node:t,...r})=>(0,s.jsx)("span",{...h(r),suppressHydrationWarning:!0,children:e}),a({href:e,children:t,node:r,...n}){let a=e?.startsWith("http");return(0,s.jsx)("a",{href:e,target:a?"_blank":void 0,rel:a?"noopener noreferrer":void 0,...h(n),children:t})},img({src:e,alt:t,node:r,...n}){if(!e)return null;let a="string"==typeof e?function(e){if(/^(https?|file):\/\//.test(e))return e;if(e.startsWith("/")){let t=e.slice(1);return`/api/file/raw?path=${encodeURIComponent(t)}`}return e}(e):e;return(0,s.jsx)("img",{src:a,alt:t??"",...h(n)})}};function b({content:e,highlightLines:t,onDismissHighlight:r,emptyPlaceholder:c}){let u=t&&t.length>0,[x,p]=(0,d.useState)(!1);return((0,d.useEffect)(()=>{p(!0)},[]),!e.trim()&&c)?(0,s.jsx)("div",{className:"py-16 text-center text-sm text-muted-foreground/60",children:c}):(0,s.jsxs)("div",{children:[u&&(0,s.jsxs)("div",{className:"mb-4 flex items-center gap-2 rounded-md border px-3 py-2 text-xs animate-in fade-in-0 duration-300",style:{borderColor:"color-mix(in srgb, var(--amber) 40%, var(--border))",background:"color-mix(in srgb, var(--amber) 8%, var(--card))",color:"var(--amber)"},"data-highlight-line":!0,children:[(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--amber)] animate-pulse shrink-0"}),(0,s.jsxs)("span",{className:"font-display font-medium flex-1",children:[t.length," line",1!==t.length?"s":""," updated by AI"]}),r&&(0,s.jsx)("button",{type:"button",onClick:r,className:"p-0.5 rounded hover:bg-[var(--amber)]/15 transition-colors shrink-0","aria-label":"Dismiss",children:(0,s.jsx)(m.A,{size:12})})]}),(0,s.jsx)("div",{className:"prose max-w-none",children:x?(0,s.jsx)(n.oz,{remarkPlugins:[a.A],rehypePlugins:[l.A,o.A,i.A],components:v,children:e}):null})]})}},97631:(e,t,r)=>{"use strict";function s(e,t){let r=e.split("\n"),s=t.split("\n"),n=r.length,a=s.length,o=Array.from({length:n+1},()=>Array(a+1).fill(0));for(let e=n-1;e>=0;e--)for(let t=a-1;t>=0;t--)o[e][t]=r[e]===s[t]?1+o[e+1][t+1]:Math.max(o[e+1][t],o[e][t+1]);let i=[],l=0,d=0;for(;l<n||d<a;){if(l<n&&d<a&&r[l]===s[d]){i.push({type:"equal",text:r[l]}),l+=1,d+=1;continue}if(d<a&&(l>=n||o[l][d+1]>=o[l+1][d])){i.push({type:"insert",text:s[d]}),d+=1;continue}i.push({type:"delete",text:r[l]}),l+=1}return i}function n(e,t=2){let r=new Set;e.forEach((s,n)=>{if("equal"!==s.type)for(let s=Math.max(0,n-t);s<=Math.min(e.length-1,n+t);s++)r.add(s)});let s=[],a=-1;for(let t=0;t<e.length;t++){if(r.has(t)){-1!==a&&(s.push({type:"gap",count:t-a}),a=-1),s.push(e[t]);continue}-1===a&&(a=t)}return -1!==a&&s.push({type:"gap",count:e.length-a}),s}r.d(t,{S:()=>n,m:()=>s})}},e=>{e.O(0,[755,854,4243,7011,1986,4521,5581,8252,1012,8441,3794,7358],()=>e(e.s=50728)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(()=>{"use strict";var e,a,c,t,d,f,b,r,o,n={},i={};function l(e){var a=i[e];if(void 0!==a)return a.exports;var c=i[e]={exports:{}},t=!0;try{n[e].call(c.exports,c,c.exports,l),t=!1}finally{t&&delete i[e]}return c.exports}l.m=n,e=[],l.O=(a,c,t,d)=>{if(c){d=d||0;for(var f=e.length;f>0&&e[f-1][2]>d;f--)e[f]=e[f-1];e[f]=[c,t,d];return}for(var b=1/0,f=0;f<e.length;f++){for(var[c,t,d]=e[f],r=!0,o=0;o<c.length;o++)(!1&d||b>=d)&&Object.keys(l.O).every(e=>l.O[e](c[o]))?c.splice(o--,1):(r=!1,d<b&&(b=d));if(r){e.splice(f--,1);var n=t();void 0!==n&&(a=n)}}return a},l.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return l.d(a,{a:a}),a},c=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,l.t=function(e,t){if(1&t&&(e=this(e)),8&t||"object"==typeof e&&e&&(4&t&&e.__esModule||16&t&&"function"==typeof e.then))return e;var d=Object.create(null);l.r(d);var f={};a=a||[null,c({}),c([]),c(c)];for(var b=2&t&&e;"object"==typeof b&&!~a.indexOf(b);b=c(b))Object.getOwnPropertyNames(b).forEach(a=>f[a]=()=>e[a]);return f.default=()=>e,l.d(d,f),d},l.d=(e,a)=>{for(var c in a)l.o(a,c)&&!l.o(e,c)&&Object.defineProperty(e,c,{enumerable:!0,get:a[c]})},l.f={},l.e=e=>Promise.all(Object.keys(l.f).reduce((a,c)=>(l.f[c](e,a),a),[])),l.u=e=>9207===e?"static/chunks/9207-456dc6941d557f33.js":9538===e?"static/chunks/9538-97857cd07590f0e2.js":7011===e?"static/chunks/7011-232eda0019652b9c.js":"static/chunks/"+(({3798:"95247769",4949:"d3ac728e",5004:"70e0d97a",6079:"363642f4",8834:"221e729c"})[e]||e)+"."+({129:"10992fc3747f483f",144:"26e4646d1b55baa3",172:"8fc3ee8b83793997",224:"713a722755268471",317:"ada14ce6664bd4c3",329:"55ed8d5fa015c016",380:"b6e50beb37243366",469:"fa07ba7a926c2c4b",497:"600f6381d3edfd73",516:"24ee058b1d4b1fed",576:"3cae31209383ddbd",621:"1640242b67225650",685:"a5babc7f672e9d8f",818:"22482a0c56416c51",862:"9f526e964489e2e5",1066:"a13a6aaff98323f2",1209:"6d037cb2674eafa2",1239:"10a0710c2772ab34",1474:"2138ccdbe73f9d30",1536:"9568e68b536284eb",1633:"38265ee334122b56",1676:"678d42992b0b48a7",1754:"c77abe070d589714",1771:"c91397e633bb762d",1814:"8cd87b72e77565ff",1880:"766cbe40e9a77fe2",1972:"05fcd65168bdf7f4",2023:"00434b298b7bffa1",2056:"2763e6d2988ce16a",2172:"246b954bf2bf8d46",2184:"97b85ad7bee71397",2212:"e0925695fa0bb9ed",2247:"196357b211a3e4d6",2257:"e1386d5f940021d1",2320:"e4567e8da6ab20ef",2473:"5c4f9d722487fbf7",2631:"dc56e83472bde281",2648:"01b7cdcf6325e7fa",2733:"25a24834ba839fe9",2751:"63ec3b1128ec1af1",2774:"69118c596ba3ed5d",2777:"d579424b26dab428",2801:"575be84dfed72142",2844:"e222be5cc5ee75eb",2850:"3b34e32dd7a5b59c",2872:"045858d00bd8307f",2935:"f7071d0608466037",2954:"c58242c796e42af2",2963:"af57a2f19c73e735",2968:"f10ccee9e7e2324d",3190:"c4b4f42dcb6d8063",3291:"47fa60f77991b909",3307:"e638f7fa43f28bac",3399:"05ce214a870b4dcd",3419:"a2c9628083414f64",3439:"0262b49753f30815",3443:"11406e9e17770a13",3563:"b67627bf13f8922e",3649:"261df89db35372f3",3652:"5a359f2d2a891100",3689:"5e8c8725f1d33c73",3736:"988c085fcbc54c37",3798:"3b5caae1c1a76ce1",3805:"973198a384f073fc",3942:"68df267abc66cc10",3961:"64240bc83466625c",3985:"695651f6b5cd768c",4033:"6666700547b20141",4044:"778a905d3a1d2225",4045:"64c9fa8dc7f09fb8",4097:"7f5a996cb7ab16e2",4123:"cf6ee9e6351c940d",4152:"1f8f5a118bc289fd",4155:"8e5625d9a932c273",4326:"9563cb244a5418f5",4346:"167ff44f0453d745",4416:"ea9a9b2b1f19ff02",4463:"ce1456194acf85fc",4582:"c8b767b24a06f0ae",4949:"08414bc10e1be93c",4956:"303d34497df3105b",5004:"6903b8594c742784",5065:"a7afd53515b05a5a",5135:"db90392e58298a66",5172:"d1fa0780851d9c6d",5176:"a93a882926a22505",5460:"6384269ca3add9f0",5576:"608c77362c9377a3",5627:"c4337d7289acb31f",5688:"a3e8d35c8102c248",5741:"1c7d5583b25f39e1",5932:"dcd543bc8a49b14d",5933:"71df2603df84086b",5956:"b445072b35915129",6055:"9dc29a58c0d6856f",6079:"1ab94f095d889c3a",6087:"b147f76eda62c005",6186:"c50deeacdf8e3688",6188:"e708a11fc6578414",6497:"5b3fd899cb0df942",6534:"617b6ec45108c229",6654:"6c01a132d9ee7a29",6826:"7b7d94dd0fd83812",6872:"ee67c7a4e2d25fe7",6891:"ca3d3a246a40d41e",7086:"6d47de2daac99000",7154:"a0695da136fa1600",7473:"9ac9386fbb388ed1",7482:"485c6cc8694747d0",7679:"562a00c226447669",7729:"577b7564eaba6ed2",7750:"a9212463f93bfacc",7753:"63831cfc54a55fbb",7805:"dc96d4322e0daacd",7844:"a9b28679fc0faf47",7938:"47c238c5f3274741",7945:"9e2475af47d416d0",8150:"683861175d79ca91",8198:"42369073fedf8a54",8253:"e91eec3594772783",8375:"e63c5ac2d0f1be51",8515:"acf89c9f22c2b02d",8701:"1b68952b4bdb149c",8774:"87435b7ce70d1a5e",8803:"cdaeffdc3fcd8893",8834:"7d0eb4a0f8bf4115",8895:"ee413eb2fffc9192",8919:"a04d147ef83333e8",8944:"1f4535a85108a37b",9010:"1e25330f1a584ccd",9232:"1b46ffd56b346c83",9238:"e359f3e03101a87a",9300:"118b8c840634383f",9346:"e527d49497f73f81",9368:"e67d929b298dcebc",9555:"4c5b60a08645c10a",9594:"4b009041931a3201",9717:"ed3086a93495395b",9867:"f6d1225725f2d16b",9889:"b87c1eeaf69898b0",9917:"cb191f127550e42c",9920:"0caec44a286b9bad",9939:"7b2d5c0ee11a220b"})[e]+".js",l.miniCssF=e=>"static/css/"+({9781:"b76b86dcaafbd85c",9971:"de58a1506258238b"})[e]+".css",l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),t={},l.l=(e,a,c,d)=>{if(t[e])return void t[e].push(a);if(void 0!==c)for(var f,b,r=document.getElementsByTagName("script"),o=0;o<r.length;o++){var n=r[o];if(n.getAttribute("src")==e||n.getAttribute("data-webpack")=="_N_E:"+c){f=n;break}}f||(b=!0,(f=document.createElement("script")).charset="utf-8",f.timeout=120,l.nc&&f.setAttribute("nonce",l.nc),f.setAttribute("data-webpack","_N_E:"+c),f.src=l.tu(e)),t[e]=[a];var i=(a,c)=>{f.onerror=f.onload=null,clearTimeout(s);var d=t[e];if(delete t[e],f.parentNode&&f.parentNode.removeChild(f),d&&d.forEach(e=>e(c)),a)return a(c)},s=setTimeout(i.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=i.bind(null,f.onerror),f.onload=i.bind(null,f.onload),b&&document.head.appendChild(f)},l.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.tt=()=>(void 0===d&&(d={createScriptURL:e=>e},"u">typeof trustedTypes&&trustedTypes.createPolicy&&(d=trustedTypes.createPolicy("nextjs#bundler",d))),d),l.tu=e=>l.tt().createScriptURL(e),l.p="/_next/",f={8068:0},l.f.miniCss=(e,a)=>{if(f[e])a.push(f[e]);else 0!==f[e]&&({9781:1,9971:1})[e]&&a.push(f[e]=new Promise((a,c)=>{var t,d=l.miniCssF(e),f=l.p+d;if(((e,a)=>{for(var c=document.getElementsByTagName("link"),t=0;t<c.length;t++){var d=c[t],f=d.getAttribute("data-href")||d.getAttribute("href");if("stylesheet"===d.rel&&(f===e||f===a))return d}for(var b=document.getElementsByTagName("style"),t=0;t<b.length;t++){var d=b[t],f=d.getAttribute("data-href");if(f===e||f===a)return d}})(d,f))return a();(t=document.createElement("link")).rel="stylesheet",t.type="text/css",t.onerror=t.onload=d=>{if(t.onerror=t.onload=null,"load"===d.type)a();else{var b=d&&("load"===d.type?"missing":d.type),r=d&&d.target&&d.target.href||f,o=Error("Loading CSS chunk "+e+" failed.\n("+r+")");o.code="CSS_CHUNK_LOAD_FAILED",o.type=b,o.request=r,t.parentNode.removeChild(t),c(o)}},t.href=f,function(e){if("function"==typeof _N_E_STYLE_LOAD){let{href:a,onload:c,onerror:t}=e;_N_E_STYLE_LOAD(0===a.indexOf(window.location.origin)?new URL(a).pathname:a).then(()=>null==c?void 0:c.call(e,{type:"load"}),()=>null==t?void 0:t.call(e,{}))}else document.head.appendChild(e)}(t)}).then(()=>{f[e]=0},a=>{throw delete f[e],a}))},b={8068:0,7513:0,3295:0},l.f.j=(e,a)=>{var c=l.o(b,e)?b[e]:void 0;if(0!==c)if(c)a.push(c[2]);else if(/^(3295|7513|8068|9781|9971)$/.test(e))b[e]=0;else{var t=new Promise((a,t)=>c=b[e]=[a,t]);a.push(c[2]=t);var d=l.p+l.u(e),f=Error();l.l(d,a=>{if(l.o(b,e)&&(0!==(c=b[e])&&(b[e]=void 0),c)){var t=a&&("load"===a.type?"missing":a.type),d=a&&a.target&&a.target.src;f.message="Loading chunk "+e+" failed.\n("+t+": "+d+")",f.name="ChunkLoadError",f.type=t,f.request=d,c[1](f)}},"chunk-"+e,e)}},l.O.j=e=>0===b[e],r=(e,a)=>{var c,t,[d,f,r]=a,o=0;if(d.some(e=>0!==b[e])){for(c in f)l.o(f,c)&&(l.m[c]=f[c]);if(r)var n=r(l)}for(e&&e(a);o<d.length;o++)t=d[o],l.o(b,t)&&b[t]&&b[t][0](),b[t]=0;return l.O(n)},(o=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(r.bind(null,0)),o.push=r.bind(null,o.push.bind(o))})();
|
|
@@ -1,151 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Build a minimal MindOS runtime archive for Desktop Core Hot Update.
|
|
3
|
-
# Output: /tmp/mindos-runtime-{VERSION}.tar.gz (pre-built, ~30-40MB)
|
|
4
|
-
#
|
|
5
|
-
# Directory structure matches what ProcessManager + analyzeMindOsLayout expect:
|
|
6
|
-
# app/.next/standalone/server.js
|
|
7
|
-
# app/.next/standalone/node_modules/
|
|
8
|
-
# app/.next/standalone/.next/server/
|
|
9
|
-
# app/.next/standalone/.next/static/
|
|
10
|
-
# app/.next/standalone/public/
|
|
11
|
-
# app/.next/static/ (isBundledRuntimeIntact checks this)
|
|
12
|
-
# app/public/
|
|
13
|
-
# mcp/dist/index.cjs
|
|
14
|
-
# package.json
|
|
15
|
-
# bin/ templates/ skills/
|
|
16
|
-
set -euo pipefail
|
|
17
|
-
|
|
18
|
-
VERSION=$(node -p "require('./package.json').version")
|
|
19
|
-
WORK="/tmp/mindos-runtime-build-$$"
|
|
20
|
-
ARCHIVE="/tmp/mindos-runtime-${VERSION}.tar.gz"
|
|
21
|
-
rm -rf "$WORK"
|
|
22
|
-
|
|
23
|
-
echo "📦 Building MindOS runtime v${VERSION}..."
|
|
24
|
-
|
|
25
|
-
# ── Web server (standalone Next.js) ──
|
|
26
|
-
echo " Copying standalone..."
|
|
27
|
-
mkdir -p "$WORK/app/.next"
|
|
28
|
-
# Copy the entire standalone tree (server.js + node_modules + .next/server + .next/static + public)
|
|
29
|
-
# IMPORTANT: --no-dereference preserves symlinks as-is instead of following them.
|
|
30
|
-
# Next.js standalone creates node_modules/node_modules -> ../../node_modules symlinks
|
|
31
|
-
# that cause infinite recursion with plain cp -r (blowing up from ~30MB to 2GB+).
|
|
32
|
-
cp -r --no-dereference app/.next/standalone "$WORK/app/.next/standalone"
|
|
33
|
-
# Remove symlinks inside node_modules — they point to paths outside standalone
|
|
34
|
-
# and are not needed at runtime (standalone has all traced deps already).
|
|
35
|
-
find "$WORK/app/.next/standalone/node_modules" -type l -delete 2>/dev/null || true
|
|
36
|
-
# Remove dev artifacts that sneak into standalone
|
|
37
|
-
rm -rf "$WORK/app/.next/standalone/.next/cache" \
|
|
38
|
-
"$WORK/app/.next/standalone/.next/dev" \
|
|
39
|
-
"$WORK/app/.next/standalone/.next/diagnostics" \
|
|
40
|
-
"$WORK/app/.next/standalone/.next/types" \
|
|
41
|
-
"$WORK/app/.next/standalone/__tests__" \
|
|
42
|
-
"$WORK/app/.next/standalone/.next/lock"
|
|
43
|
-
|
|
44
|
-
# Strip dev-only files from node_modules to reduce archive size
|
|
45
|
-
echo " Stripping dev-only files from node_modules..."
|
|
46
|
-
STANDALONE_NM="$WORK/app/.next/standalone/node_modules"
|
|
47
|
-
if [ -d "$STANDALONE_NM" ]; then
|
|
48
|
-
# TypeScript declaration files (only needed for IDE, not runtime)
|
|
49
|
-
find "$STANDALONE_NM" -name '*.d.ts' -delete
|
|
50
|
-
find "$STANDALONE_NM" -name '*.d.cts' -delete
|
|
51
|
-
find "$STANDALONE_NM" -name '*.d.mts' -delete
|
|
52
|
-
find "$STANDALONE_NM" -name '*.d.ts.map' -delete
|
|
53
|
-
# Source maps (debugging only)
|
|
54
|
-
find "$STANDALONE_NM" -name '*.js.map' -delete
|
|
55
|
-
find "$STANDALONE_NM" -name '*.mjs.map' -delete
|
|
56
|
-
find "$STANDALONE_NM" -name '*.cjs.map' -delete
|
|
57
|
-
# TypeScript source files (compiled JS is what runs)
|
|
58
|
-
find "$STANDALONE_NM" -name '*.ts' ! -name '*.d.ts' -path '*/src/*' -delete
|
|
59
|
-
# Markdown docs inside packages
|
|
60
|
-
find "$STANDALONE_NM" -name 'README.md' -delete
|
|
61
|
-
find "$STANDALONE_NM" -name 'CHANGELOG.md' -delete
|
|
62
|
-
find "$STANDALONE_NM" -name 'LICENSE' -delete
|
|
63
|
-
find "$STANDALONE_NM" -name 'LICENSE.md' -delete
|
|
64
|
-
# Empty directories left after deletion
|
|
65
|
-
find "$STANDALONE_NM" -type d -empty -delete 2>/dev/null || true
|
|
66
|
-
# Remove packages not needed at runtime
|
|
67
|
-
rm -rf "$STANDALONE_NM/typescript" # Only needed for type-checking, not runtime
|
|
68
|
-
rm -rf "$STANDALONE_NM/@types" # TypeScript type definitions
|
|
69
|
-
rm -rf "$STANDALONE_NM/caniuse-lite" # Browser compat data, not needed server-side
|
|
70
|
-
fi
|
|
71
|
-
# Copy static assets at top level (isBundledRuntimeIntact checks app/.next/static/)
|
|
72
|
-
cp -r app/.next/static "$WORK/app/.next/static"
|
|
73
|
-
# Copy public assets
|
|
74
|
-
mkdir -p "$WORK/app"
|
|
75
|
-
cp -r app/public "$WORK/app/public"
|
|
76
|
-
# Copy skill definitions (not included in standalone output, needed at runtime)
|
|
77
|
-
if [ -d app/data/skills ]; then
|
|
78
|
-
mkdir -p "$WORK/app/data"
|
|
79
|
-
cp -r app/data/skills "$WORK/app/data/skills"
|
|
80
|
-
fi
|
|
81
|
-
|
|
82
|
-
# ── MCP server ──
|
|
83
|
-
echo " Copying MCP..."
|
|
84
|
-
mkdir -p "$WORK/mcp/dist"
|
|
85
|
-
cp mcp/dist/index.cjs "$WORK/mcp/dist/"
|
|
86
|
-
[ -f mcp/package.json ] && cp mcp/package.json "$WORK/mcp/"
|
|
87
|
-
|
|
88
|
-
# ── Metadata + auxiliary files ──
|
|
89
|
-
echo " Copying metadata..."
|
|
90
|
-
cp package.json "$WORK/"
|
|
91
|
-
[ -d bin ] && cp -r bin "$WORK/"
|
|
92
|
-
[ -d templates ] && cp -r templates "$WORK/"
|
|
93
|
-
[ -d skills ] && cp -r skills "$WORK/"
|
|
94
|
-
|
|
95
|
-
# ── Package (flat, no outer directory) ──
|
|
96
|
-
echo " Creating archive..."
|
|
97
|
-
# Use POSIX format to avoid GNU @LongLink extensions that our Windows JS
|
|
98
|
-
# tar parser must handle. --posix uses pax headers for paths > 100 chars,
|
|
99
|
-
# which the parser also supports, but keeping paths representable in ustar
|
|
100
|
-
# prefix+name (up to 255 chars) is preferred for maximum compatibility.
|
|
101
|
-
tar czf "$ARCHIVE" --posix -C "$WORK" .
|
|
102
|
-
|
|
103
|
-
# ── Self-validation ──
|
|
104
|
-
echo " Validating..."
|
|
105
|
-
VERIFY="/tmp/mindos-runtime-verify-$$"
|
|
106
|
-
rm -rf "$VERIFY" && mkdir -p "$VERIFY"
|
|
107
|
-
tar xzf "$ARCHIVE" -C "$VERIFY"
|
|
108
|
-
|
|
109
|
-
ERRORS=0
|
|
110
|
-
while IFS= read -r f; do
|
|
111
|
-
[ -z "$f" ] && continue
|
|
112
|
-
if [ ! -e "$VERIFY/$f" ]; then
|
|
113
|
-
echo " ❌ MISSING: $f"
|
|
114
|
-
ERRORS=$((ERRORS + 1))
|
|
115
|
-
fi
|
|
116
|
-
done < <(node desktop/scripts/print-runtime-health-paths.mjs)
|
|
117
|
-
|
|
118
|
-
# Verify version in package.json matches
|
|
119
|
-
PKG_VER=$(node -p "require('$VERIFY/package.json').version" 2>/dev/null || echo "")
|
|
120
|
-
if [ "$PKG_VER" != "$VERSION" ]; then
|
|
121
|
-
echo " ❌ Version mismatch: package.json=$PKG_VER, expected=$VERSION"
|
|
122
|
-
ERRORS=$((ERRORS + 1))
|
|
123
|
-
fi
|
|
124
|
-
|
|
125
|
-
rm -rf "$VERIFY" "$WORK"
|
|
126
|
-
|
|
127
|
-
if [ "$ERRORS" -gt 0 ]; then
|
|
128
|
-
echo "❌ Validation failed with $ERRORS error(s)"
|
|
129
|
-
exit 1
|
|
130
|
-
fi
|
|
131
|
-
|
|
132
|
-
# ── Output info ──
|
|
133
|
-
if command -v sha256sum >/dev/null 2>&1; then
|
|
134
|
-
SHA256=$(sha256sum "$ARCHIVE" | cut -d' ' -f1)
|
|
135
|
-
else
|
|
136
|
-
SHA256=$(shasum -a 256 "$ARCHIVE" | cut -d' ' -f1)
|
|
137
|
-
fi
|
|
138
|
-
|
|
139
|
-
if command -v numfmt >/dev/null 2>&1; then
|
|
140
|
-
SIZE_HUMAN=$(stat -c%s "$ARCHIVE" | numfmt --to=iec)
|
|
141
|
-
SIZE_BYTES=$(stat -c%s "$ARCHIVE")
|
|
142
|
-
elif command -v stat >/dev/null 2>&1; then
|
|
143
|
-
SIZE_BYTES=$(stat -f%z "$ARCHIVE" 2>/dev/null || stat -c%s "$ARCHIVE" 2>/dev/null)
|
|
144
|
-
SIZE_HUMAN="${SIZE_BYTES} bytes"
|
|
145
|
-
fi
|
|
146
|
-
|
|
147
|
-
echo ""
|
|
148
|
-
echo "✅ mindos-runtime-${VERSION}.tar.gz"
|
|
149
|
-
echo " Size: ${SIZE_HUMAN} (${SIZE_BYTES} bytes)"
|
|
150
|
-
echo " SHA256: ${SHA256}"
|
|
151
|
-
echo " Path: ${ARCHIVE}"
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Fix nested postcss dependencies inside next/node_modules.
|
|
3
|
-
*
|
|
4
|
-
* Next.js 16 bundles postcss@8.4.31 which depends on nanoid@^3,
|
|
5
|
-
* picocolors, and source-map-js. When the app's top-level nanoid
|
|
6
|
-
* is v5 (major mismatch), npm's hoisting fails to place nanoid@3
|
|
7
|
-
* where postcss can find it.
|
|
8
|
-
*
|
|
9
|
-
* Runs as postinstall — skips silently if postcss is already OK
|
|
10
|
-
* or if next/node_modules/postcss doesn't exist.
|
|
11
|
-
*
|
|
12
|
-
* Optimization: symlink/copy picocolors and source-map-js directly
|
|
13
|
-
* from app's node_modules (compatible versions), then only use npm
|
|
14
|
-
* install for nanoid (which needs v3, incompatible with app's v5).
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
const { existsSync, mkdirSync, cpSync, symlinkSync } = require('fs');
|
|
18
|
-
const { join, resolve } = require('path');
|
|
19
|
-
const { execSync } = require('child_process');
|
|
20
|
-
|
|
21
|
-
const postcssDir = join('node_modules', 'next', 'node_modules', 'postcss');
|
|
22
|
-
const postcssNm = join(postcssDir, 'node_modules');
|
|
23
|
-
const marker = join(postcssNm, 'source-map-js');
|
|
24
|
-
|
|
25
|
-
if (!existsSync(postcssDir)) {
|
|
26
|
-
process.exit(0); // postcss not installed — skip
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
if (existsSync(marker)) {
|
|
30
|
-
process.exit(0); // Already fixed — skip
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// picocolors and source-map-js: app's versions are semver-compatible with
|
|
34
|
-
// postcss's requirements (^1.0.0 and ^1.0.2). Safe to symlink/copy.
|
|
35
|
-
// nanoid: postcss needs ^3.3.6 but app has v5 (ESM-only, CJS-incompatible).
|
|
36
|
-
// Must use npm install for nanoid only.
|
|
37
|
-
|
|
38
|
-
const compatibleDeps = ['picocolors', 'source-map-js'];
|
|
39
|
-
const appNm = 'node_modules';
|
|
40
|
-
|
|
41
|
-
try {
|
|
42
|
-
mkdirSync(postcssNm, { recursive: true });
|
|
43
|
-
|
|
44
|
-
// Fast path: link compatible deps from app's node_modules
|
|
45
|
-
for (const dep of compatibleDeps) {
|
|
46
|
-
const srcPath = resolve(appNm, dep);
|
|
47
|
-
const dstPath = resolve(postcssNm, dep);
|
|
48
|
-
if (existsSync(srcPath) && !existsSync(dstPath)) {
|
|
49
|
-
try {
|
|
50
|
-
// junction works on Windows without admin privileges
|
|
51
|
-
symlinkSync(srcPath, dstPath, 'junction');
|
|
52
|
-
} catch {
|
|
53
|
-
cpSync(srcPath, dstPath, { recursive: true, force: true });
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
// nanoid needs ^3 (app has v5) — must install separately
|
|
59
|
-
if (!existsSync(join(postcssNm, 'nanoid'))) {
|
|
60
|
-
execSync('npm install --no-save --install-strategy=nested', {
|
|
61
|
-
cwd: postcssDir,
|
|
62
|
-
stdio: 'ignore',
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
} catch {
|
|
66
|
-
// If anything fails, fall back to full nested npm install
|
|
67
|
-
try {
|
|
68
|
-
execSync('npm install --no-save --install-strategy=nested', {
|
|
69
|
-
cwd: postcssDir,
|
|
70
|
-
stdio: 'ignore',
|
|
71
|
-
});
|
|
72
|
-
} catch {
|
|
73
|
-
// Best-effort — build will report the real error if deps are still missing
|
|
74
|
-
}
|
|
75
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Scans app/components/renderers/*/manifest.ts and generates
|
|
3
|
-
// app/lib/renderers/index.ts with auto-discovered imports.
|
|
4
|
-
//
|
|
5
|
-
// Run: node scripts/gen-renderer-index.js
|
|
6
|
-
// Hooked into: npm run build (via prebuild)
|
|
7
|
-
|
|
8
|
-
import fs from 'fs';
|
|
9
|
-
import path from 'path';
|
|
10
|
-
import { fileURLToPath } from 'url';
|
|
11
|
-
|
|
12
|
-
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
13
|
-
const renderersDir = path.resolve(__dirname, '../app/components/renderers');
|
|
14
|
-
const outputFile = path.resolve(__dirname, '../app/lib/renderers/index.ts');
|
|
15
|
-
|
|
16
|
-
// Scan for manifest.ts in immediate subdirectories
|
|
17
|
-
const dirs = fs.readdirSync(renderersDir, { withFileTypes: true })
|
|
18
|
-
.filter(d => d.isDirectory())
|
|
19
|
-
.filter(d => fs.existsSync(path.join(renderersDir, d.name, 'manifest.ts')))
|
|
20
|
-
.map(d => d.name)
|
|
21
|
-
.sort();
|
|
22
|
-
|
|
23
|
-
// Opt-in-only renderers (match: () => false) go last for consistent ordering.
|
|
24
|
-
const LAST = new Set(['graph']);
|
|
25
|
-
const sorted = [
|
|
26
|
-
...dirs.filter(d => !LAST.has(d)),
|
|
27
|
-
...dirs.filter(d => LAST.has(d)),
|
|
28
|
-
];
|
|
29
|
-
|
|
30
|
-
if (dirs.length === 0) {
|
|
31
|
-
console.error('No manifest.ts files found in', renderersDir);
|
|
32
|
-
process.exit(1);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// kebab-case → camelCase
|
|
36
|
-
function toCamel(s) {
|
|
37
|
-
return s.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const imports = sorted.map(dir => {
|
|
41
|
-
const varName = toCamel(dir);
|
|
42
|
-
return `import { manifest as ${varName} } from '@/components/renderers/${dir}/manifest';`;
|
|
43
|
-
}).join('\n');
|
|
44
|
-
|
|
45
|
-
const varNames = sorted.map(toCamel);
|
|
46
|
-
|
|
47
|
-
const code = `/**
|
|
48
|
-
* AUTO-GENERATED by scripts/gen-renderer-index.js — do not edit manually.
|
|
49
|
-
* To regenerate: node scripts/gen-renderer-index.js
|
|
50
|
-
*/
|
|
51
|
-
import { registerRenderer } from './registry';
|
|
52
|
-
${imports}
|
|
53
|
-
|
|
54
|
-
const manifests = [
|
|
55
|
-
${varNames.join(', ')},
|
|
56
|
-
];
|
|
57
|
-
|
|
58
|
-
for (const m of manifests) {
|
|
59
|
-
registerRenderer(m);
|
|
60
|
-
}
|
|
61
|
-
`;
|
|
62
|
-
|
|
63
|
-
fs.writeFileSync(outputFile, code, 'utf-8');
|
|
64
|
-
console.log(`Generated ${path.relative(process.cwd(), outputFile)} with ${dirs.length} renderers: ${dirs.join(', ')}`);
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# ─── Guard: block merge from public repo ─────────────────────────────────────
|
|
3
|
-
# Shared logic used by both pre-merge-commit and prepare-commit-msg hooks.
|
|
4
|
-
#
|
|
5
|
-
# Merging public/main into mindos-dev deletes private-only files
|
|
6
|
-
# (.syncinclude, sync-to-mindos.yml, wiki/, etc.) because the public
|
|
7
|
-
# repo doesn't carry them. Use cherry-pick instead:
|
|
8
|
-
#
|
|
9
|
-
# git fetch public
|
|
10
|
-
# git cherry-pick <commit>
|
|
11
|
-
|
|
12
|
-
set -e
|
|
13
|
-
|
|
14
|
-
if [ "$ALLOW_PUBLIC_MERGE" = "1" ]; then
|
|
15
|
-
exit 0
|
|
16
|
-
fi
|
|
17
|
-
|
|
18
|
-
MERGE_HEAD=$(cat .git/MERGE_HEAD 2>/dev/null || true)
|
|
19
|
-
if [ -z "$MERGE_HEAD" ]; then
|
|
20
|
-
exit 0
|
|
21
|
-
fi
|
|
22
|
-
|
|
23
|
-
for remote in $(git remote); do
|
|
24
|
-
REMOTE_URL=$(git remote get-url "$remote" 2>/dev/null || echo "")
|
|
25
|
-
if echo "$REMOTE_URL" | grep -qi "GeminiLight/MindOS\.git\|GeminiLight/mindos\.git"; then
|
|
26
|
-
if git branch -r --contains "$MERGE_HEAD" 2>/dev/null | grep -q "^ ${remote}/"; then
|
|
27
|
-
echo ""
|
|
28
|
-
echo " ❌ BLOCKED: Merging from public repo ($remote) is forbidden."
|
|
29
|
-
echo ""
|
|
30
|
-
echo " Merging public/main deletes private-only files:"
|
|
31
|
-
echo " .syncinclude, sync-to-mindos.yml, wiki/, etc."
|
|
32
|
-
echo ""
|
|
33
|
-
echo " Use cherry-pick instead:"
|
|
34
|
-
echo " git fetch $remote"
|
|
35
|
-
echo " git cherry-pick <commit>"
|
|
36
|
-
echo ""
|
|
37
|
-
echo " To force (dangerous): ALLOW_PUBLIC_MERGE=1 git merge $remote/main"
|
|
38
|
-
echo ""
|
|
39
|
-
exit 1
|
|
40
|
-
fi
|
|
41
|
-
fi
|
|
42
|
-
done
|
package/scripts/hooks/pre-push
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
set -e
|
|
3
|
-
|
|
4
|
-
# ─── Guard: block direct branch push to public repo ──────────────────────────
|
|
5
|
-
# Only tag pushes (git push public v0.6.x) are allowed.
|
|
6
|
-
# Code sync to public happens automatically via CI (sync-to-mindos.yml).
|
|
7
|
-
REMOTE_URL=$(git remote get-url "$1" 2>/dev/null || echo "")
|
|
8
|
-
if echo "$REMOTE_URL" | grep -q "GeminiLight/MindOS\.git\|GeminiLight/mindos\.git"; then
|
|
9
|
-
while read -r local_ref local_sha remote_ref remote_sha; do
|
|
10
|
-
if [[ "$remote_ref" != refs/tags/* ]]; then
|
|
11
|
-
echo ""
|
|
12
|
-
echo " ❌ BLOCKED: Direct branch push to public repo is forbidden."
|
|
13
|
-
echo ""
|
|
14
|
-
echo " Only tag pushes are allowed:"
|
|
15
|
-
echo " git push public v0.6.x"
|
|
16
|
-
echo ""
|
|
17
|
-
echo " Code sync happens automatically via CI on push to origin/main."
|
|
18
|
-
echo ""
|
|
19
|
-
exit 1
|
|
20
|
-
fi
|
|
21
|
-
done
|
|
22
|
-
# Tag push — allow through without running tests
|
|
23
|
-
exit 0
|
|
24
|
-
fi
|
|
25
|
-
|
|
26
|
-
# ─── Tests ────────────────────────────────────────────────────────────────────
|
|
27
|
-
if [ "$SKIP_TESTS" = "1" ]; then
|
|
28
|
-
echo "Skipping pre-push tests (SKIP_TESTS=1)"
|
|
29
|
-
exit 0
|
|
30
|
-
fi
|
|
31
|
-
|
|
32
|
-
echo "Running tests before push..."
|
|
33
|
-
echo "(Tip: use SKIP_TESTS=1 git push to skip)"
|
|
34
|
-
MINDOS_WEB_PORT=19456 MINDOS_MCP_PORT=19781 npm test
|
|
35
|
-
|
|
36
|
-
echo "Running TypeScript type check..."
|
|
37
|
-
cd app && npx tsc --noEmit
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
set -e
|
|
3
|
-
# $2 = "merge" when git is creating a merge commit
|
|
4
|
-
if [ "${2:-}" = "merge" ]; then
|
|
5
|
-
if "$(dirname "$0")/block-public-merge.sh" 2>&1; then
|
|
6
|
-
: # not blocked, continue
|
|
7
|
-
else
|
|
8
|
-
# Block: wipe the commit message file so git aborts
|
|
9
|
-
echo "" > "$1"
|
|
10
|
-
exit 0
|
|
11
|
-
fi
|
|
12
|
-
fi
|