@geminilight/mindos 0.6.71 → 0.6.73
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 +27 -27
- 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_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-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/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/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/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/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/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-paths-manifest.json +27 -27
- package/_standalone/.next/server/chunks/{3311.js → 2449.js} +2 -2
- package/_standalone/.next/server/chunks/5299.js +1 -1
- package/_standalone/.next/server/chunks/6022.js +34 -34
- 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/{7143.879daa87569c5b02.js → 4094.09364c01df411380.js} +1 -1
- package/_standalone/.next/static/chunks/{5795.d9099a1afecd6047.js → 5331.c89084fd7f67887d.js} +2 -2
- package/_standalone/.next/static/chunks/app/{layout-a344709b8447be75.js → layout-fcbde5bee626d21a.js} +63 -63
- package/_standalone/.next/static/chunks/app/trash/page-e623ff0ab35de002.js +1 -0
- package/_standalone/.next/static/chunks/app/view/[...path]/page-49c4eff6ffdb5168.js +12 -0
- package/_standalone/.next/static/chunks/{webpack-2f2787d3469d3df1.js → webpack-dc486b68118d1328.js} +1 -1
- package/_standalone/.next/trace +72 -72
- package/_standalone/package-lock.json +2 -2
- package/_standalone/package.json +1 -1
- package/app/package.json +1 -1
- package/package.json +1 -1
- package/_standalone/.next/static/chunks/app/trash/page-0907fdd06a4467de.js +0 -1
- package/_standalone/.next/static/chunks/app/view/[...path]/page-f53ce199b4a4bbb5.js +0 -12
- package/browser-extension/README.md +0 -160
- package/browser-extension/build.mjs +0 -63
- package/browser-extension/extension/background/service-worker.js +0 -1
- package/browser-extension/extension/content/extractor.js +0 -2
- package/browser-extension/extension/icons/icon-128.png +0 -0
- package/browser-extension/extension/icons/icon-128.svg +0 -4
- package/browser-extension/extension/icons/icon-16.png +0 -0
- package/browser-extension/extension/icons/icon-16.svg +0 -4
- package/browser-extension/extension/icons/icon-32.png +0 -0
- package/browser-extension/extension/icons/icon-32.svg +0 -4
- package/browser-extension/extension/icons/icon-48.png +0 -0
- package/browser-extension/extension/icons/icon-48.svg +0 -4
- package/browser-extension/extension/manifest.json +0 -47
- package/browser-extension/extension/popup/popup.css +0 -510
- package/browser-extension/extension/popup/popup.html +0 -128
- package/browser-extension/extension/popup/popup.js +0 -73
- package/browser-extension/package-lock.json +0 -617
- package/browser-extension/package.json +0 -21
- package/browser-extension/scripts/gen-icons.sh +0 -38
- package/browser-extension/src/background/service-worker.ts +0 -27
- package/browser-extension/src/content/extractor.ts +0 -44
- package/browser-extension/src/icons/icon-128.png +0 -0
- package/browser-extension/src/icons/icon-128.svg +0 -4
- package/browser-extension/src/icons/icon-16.png +0 -0
- package/browser-extension/src/icons/icon-16.svg +0 -4
- package/browser-extension/src/icons/icon-32.png +0 -0
- package/browser-extension/src/icons/icon-32.svg +0 -4
- package/browser-extension/src/icons/icon-48.png +0 -0
- package/browser-extension/src/icons/icon-48.svg +0 -4
- package/browser-extension/src/lib/api.ts +0 -146
- package/browser-extension/src/lib/markdown.ts +0 -68
- package/browser-extension/src/lib/storage.ts +0 -37
- package/browser-extension/src/lib/types.ts +0 -42
- package/browser-extension/src/manifest.json +0 -47
- package/browser-extension/src/popup/popup.css +0 -510
- package/browser-extension/src/popup/popup.html +0 -128
- package/browser-extension/src/popup/popup.ts +0 -416
- package/browser-extension/tsconfig.json +0 -16
- package/tests/e2e/README.md +0 -25
- package/tests/e2e/navigation.spec.ts +0 -14
- package/tests/e2e/playwright.config.ts +0 -14
- package/tests/integration/README.md +0 -25
- package/tests/integration/mcp-contract.test.ts +0 -57
- package/tests/integration/mcp-transport.test.ts +0 -361
- package/tests/integration/package-lock.json +0 -1463
- package/tests/integration/package.json +0 -8
- package/tests/integration/vitest.config.ts +0 -11
- package/tests/security-hardening.test.ts +0 -456
- package/tests/unit/build-integrity.test.ts +0 -137
- package/tests/unit/cli-build.test.ts +0 -180
- package/tests/unit/cli-config.test.ts +0 -257
- package/tests/unit/cli-mcp-install-toml.test.ts +0 -586
- package/tests/unit/cli-mcp-install.test.ts +0 -123
- package/tests/unit/cli-mcp-stdio-default.test.ts +0 -180
- package/tests/unit/cli-modules-load.test.ts +0 -64
- package/tests/unit/cli-port.test.ts +0 -87
- package/tests/unit/cli-skill-auto-copy.test.ts +0 -260
- package/tests/unit/cli-smoke.test.ts +0 -88
- package/tests/unit/cli-uninstall.test.ts +0 -218
- package/tests/unit/cli-update-root.test.ts +0 -89
- package/tests/unit/cli-user-flow-sim.test.ts +0 -506
- package/tests/unit/cli-wait-hint.test.ts +0 -86
- package/tests/unit/custom-agents.test.ts +0 -478
- package/tests/unit/dep-safety.test.ts +0 -126
- package/tests/unit/detect-system-lang.test.ts +0 -122
- package/tests/unit/mcp-build.test.ts +0 -162
- package/tests/unit/setup-needs-restart.test.ts +0 -139
- package/tests/unit/stop-restart.test.ts +0 -393
- package/tests/unit/vitest.config.ts +0 -8
- /package/_standalone/.next/static/{w5bqzZbd2_vdoPRB0JQ_I → Dn8EHqUedSzanCfrM8WWS}/_buildManifest.js +0 -0
- /package/_standalone/.next/static/{w5bqzZbd2_vdoPRB0JQ_I → Dn8EHqUedSzanCfrM8WWS}/_ssgManifest.js +0 -0
|
@@ -32,7 +32,12 @@ Be specific and actionable. Format in Markdown.`}(a,b,g)}],currentFile:c};h&&(i.
|
|
|
32
32
|
hover:shadow-lg hover:shadow-[var(--amber)]/20
|
|
33
33
|
active:scale-95 cursor-pointer overflow-hidden
|
|
34
34
|
${b||"/"===h||""===h?"opacity-0 pointer-events-none translate-y-2":"opacity-100 translate-y-0"}
|
|
35
|
-
`,style:{background:"var(--amber)"},title:i,"aria-label":i,children:[(0,d.jsx)(e.A,{size:16,className:"relative z-10 shrink-0"}),(0,d.jsx)("span",{className:" relative z-10 max-w-0 group-hover:max-w-[120px] opacity-0 group-hover:opacity-100 transition-all duration-200 ease-out whitespace-nowrap overflow-hidden ",children:c.ask?.fabLabel??"Ask MindOS"})]})}},
|
|
35
|
+
`,style:{background:"var(--amber)"},title:i,"aria-label":i,children:[(0,d.jsx)(e.A,{size:16,className:"relative z-10 shrink-0"}),(0,d.jsx)("span",{className:" relative z-10 max-w-0 group-hover:max-w-[120px] opacity-0 group-hover:opacity-100 transition-all duration-200 ease-out whitespace-nowrap overflow-hidden ",children:c.ask?.fabLabel??"Ask MindOS"})]})}},2995:(a,b,c)=>{"use strict";c.d(b,{A:()=>o});var d=c(48249),e=c(67484),f=c(97621),g=c(42742),h=c(6079),i=c(46674),j=c(19099),k=c(47223),l=c(33191),m=c(99829);let n=(0,m.createServerReference)("701aebaca34a9de557a4f74bb0d53a1c70e680bec7",m.callServer,void 0,m.findSourceMapURL,"revertSpaceInitAction");function o(){let[a,b]=(0,e.useState)(null),[c,m]=(0,e.useState)(!1),[o,q]=(0,e.useTransition)(),r=(0,j.useRouter)(),{t:s}=(0,k.Y)(),t=(0,e.useCallback)(()=>{m(!1),setTimeout(()=>b(null),200)},[]);(0,e.useCallback)(a=>{let c=a.detail;"working"===c.state?(b(c),requestAnimationFrame(()=>m(!0))):"done"===c.state?(b(a=>a?{...a,state:"done"}:null),r.refresh()):t()},[r,t]);let u=(0,e.useCallback)(()=>{a&&(t(),r.push(`/view/${(0,l.O0)(a.spacePath+"/")}`))},[a,t,r]),v=(0,e.useCallback)(()=>{a&&q(async()=>{await n(a.spacePath,a.spaceName,a.description),b(a=>a?{...a,state:"reverted"}:null),r.refresh(),window.dispatchEvent(new Event("mindos:files-changed")),setTimeout(t,2e3)})},[a,r,t]),w=(0,e.useCallback)(()=>{t()},[t]);if(!a)return null;let x=s.home,{state:y}=a,z="done"===y,A="reverted"===y;return(0,d.jsx)("div",{className:`fixed bottom-6 left-1/2 z-50 -translate-x-1/2 transition-all duration-200 ease-out ${c?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-3 scale-[0.96] pointer-events-none"}`,children:(0,d.jsxs)("div",{className:"flex items-center gap-2.5 rounded-full border bg-card/95 backdrop-blur py-2 shadow-lg",style:{borderColor:"color-mix(in srgb, var(--amber) 40%, var(--border))",boxShadow:"0 8px 24px color-mix(in srgb, var(--amber) 12%, rgba(0,0,0,.2))",paddingLeft:"0.75rem",paddingRight:z?"0.5rem":"1rem"},children:[(0,d.jsx)("span",{className:`inline-flex h-6 w-6 items-center justify-center rounded-full shrink-0 ${A?"text-muted-foreground bg-muted":"text-[var(--amber)] bg-[var(--amber-subtle)]"} ${"working"===y?"animate-pulse":""}`,children:A?(0,d.jsx)(f.A,{size:12}):z?(0,d.jsx)(g.A,{size:13,strokeWidth:2.5}):(0,d.jsx)(h.A,{size:13})}),(0,d.jsx)("span",{className:"text-xs text-foreground whitespace-nowrap select-none font-medium",children:A?x.aiInitReverted(a.spaceName):z?x.aiInitReady(a.spaceName):(0,d.jsxs)(d.Fragment,{children:[x.aiInitGenerating(a.spaceName),(0,d.jsx)(p,{})]})}),z&&(0,d.jsxs)("div",{className:"flex items-center gap-1 ml-1",children:[(0,d.jsx)("button",{type:"button",onClick:u,className:"px-2.5 py-1 rounded-full text-2xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-opacity focus-visible:ring-2 focus-visible:ring-ring",children:x.aiInitReview}),(0,d.jsx)("button",{type:"button",onClick:v,disabled:o,className:"px-2.5 py-1 rounded-full text-2xs font-medium bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",children:x.aiInitDiscard}),(0,d.jsx)("button",{type:"button",onClick:w,"aria-label":"Accept",className:"ml-0.5 inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors focus-visible:ring-2 focus-visible:ring-ring",children:(0,d.jsx)(i.A,{size:12})})]})]})})}function p(){return(0,d.jsxs)("span",{className:"inline-flex gap-[2px] items-end h-[1em] ml-px",children:[(0,d.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_0ms_infinite]"}),(0,d.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_200ms_infinite]"}),(0,d.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_400ms_infinite]"}),(0,d.jsx)("style",{children:`
|
|
36
|
+
@keyframes dotBounce {
|
|
37
|
+
0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
|
|
38
|
+
30% { opacity: 1; transform: translateY(-2px); }
|
|
39
|
+
}
|
|
40
|
+
`})]})}},4140:(a,b,c)=>{"use strict";c.d(b,{A:()=>g});var d=c(48249),e=c(45231),f=c(13481);function g({title:a,children:b,maximized:c,onMaximize:g}){return(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 h-[46px] border-b border-border shrink-0",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:a}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[b,g&&(0,d.jsx)("button",{onClick:g,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors","aria-label":c?"Restore panel":"Maximize panel",children:c?(0,d.jsx)(e.A,{size:13}):(0,d.jsx)(f.A,{size:13})})]})]})}},4246:(a,b,c)=>{"use strict";var d=c(29974);let e=new Set(["mp3","wav","m4a","ogg","flac","aac"]),f=new Set(["png","jpg","jpeg","gif","webp","svg","bmp","ico"]),g=new Set(["mp4","webm","mov","mkv"]);for(let a of[{id:"agent-inspector",name:"Agent Inspector",description:"Visualizes agent tool-call logs as a filterable timeline. Auto-activates on .mindos/agent-audit-log.json and supports legacy .agent-log.json.",author:"MindOS",icon:"\uD83D\uDD0D",tags:["agent","inspector","log","mcp","tools"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:".mindos/agent-audit-log.json",match:({filePath:a})=>/(^|\/)\.mindos\/agent-audit-log\.json$/i.test(a)||/\.agent-log\.json$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,66535)).then(a=>({default:a.AgentInspectorRenderer}))},{id:"audio",name:"Audio Player",description:"Plays audio files with native browser controls.",author:"MindOS",icon:"\uD83C\uDFB5",tags:["audio","music","voice","mp3","wav"],builtin:!0,core:!0,appBuiltinFeature:!0,match:({extension:a})=>e.has(a),load:()=>Promise.resolve().then(c.bind(c,30488)).then(a=>({default:a.AudioRenderer}))},{id:"backlinks",name:"Backlinks Explorer",description:"Shows all files that link to the current page via wikilinks or markdown links, with highlighted snippet context.",author:"MindOS",icon:"\uD83D\uDD17",tags:["backlinks","wiki","links","references"],builtin:!0,entryPath:"BACKLINKS.md",match:({filePath:a})=>/\bBACKLINKS\b.*\.md$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,78340)).then(a=>({default:a.BacklinksRenderer}))},{id:"change-log",name:"Content Changes",description:"Renders the .mindos/change-log.json file as a searchable timeline of content edits.",author:"MindOS",icon:"\uD83D\uDCCB",tags:["changelog","history","changes"],builtin:!0,core:!0,appBuiltinFeature:!0,match:({filePath:a})=>/\.mindos\/change-log\.json$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,41829)).then(a=>({default:a.ChangeLogRenderer}))},{id:"config-panel",name:"Config Panel",description:"Renders CONFIG.json as an editable control panel based on uiSchema/keySpecs. Changes are written back to the JSON file directly.",author:"MindOS",icon:"\uD83E\uDDE9",tags:["config","json","settings","schema"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:"CONFIG.json",match:({filePath:a,extension:b})=>"json"===b&&/(^|\/)CONFIG\.json$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,72362)).then(a=>({default:a.ConfigRenderer}))},{id:"csv",name:"CSV Views",description:"Renders any CSV file as Table, Gallery, or Board. Each view is independently configurable — choose which columns map to title, description, tag, and group.",author:"MindOS",icon:"\uD83D\uDCCA",tags:["csv","table","gallery","board","data"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:"Resources/Products.csv",match:({extension:a,filePath:b})=>"csv"===a&&!/\bTODO\b/i.test(b),load:()=>Promise.resolve().then(c.bind(c,46427)).then(a=>({default:a.CsvRenderer}))},{id:"image",name:"Image Viewer",description:"Renders image files with zoom, fit-to-view, and transparency support.",author:"MindOS",icon:"\uD83D\uDDBC",tags:["image","photo","viewer","png","jpg","svg"],builtin:!0,core:!0,appBuiltinFeature:!0,match:({extension:a})=>f.has(a),load:()=>Promise.resolve().then(c.bind(c,47336)).then(a=>({default:a.ImageRenderer}))},{id:"pdf",name:"PDF Viewer",description:"Renders PDF files using the browser built-in PDF viewer.",author:"MindOS",icon:"\uD83D\uDCC4",tags:["pdf","document","viewer"],builtin:!0,core:!0,appBuiltinFeature:!0,match:({extension:a})=>"pdf"===a,load:()=>Promise.resolve().then(c.bind(c,21416)).then(a=>({default:a.PdfRenderer}))},{id:"summary",name:"AI Briefing",description:"Streams an AI-generated daily briefing summarizing your most recently modified files — key changes, recurring themes, and suggested next actions.",author:"MindOS",icon:"✨",tags:["ai","summary","briefing","daily"],builtin:!0,entryPath:"DAILY.md",match:({filePath:a})=>/\b(SUMMARY|summary|Summary|BRIEFING|briefing|Briefing|DAILY|daily|Daily)\b.*\.md$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,51488)).then(a=>({default:a.SummaryRenderer}))},{id:"timeline",name:"Timeline",description:"Renders changelog and journal files as a vertical timeline. Any markdown with ## date headings (e.g. ## 2025-01-15) becomes a card in the feed.",author:"MindOS",icon:"\uD83D\uDCC5",tags:["timeline","changelog","journal","history"],builtin:!0,entryPath:"CHANGELOG.md",match:({filePath:a})=>/\b(CHANGELOG|changelog|TIMELINE|timeline|journal|Journal|diary|Diary)\b.*\.md$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,6732)).then(a=>({default:a.TimelineRenderer}))},{id:"todo",name:"TODO Board",description:"Renders TODO.md/TODO.csv as an interactive kanban board grouped by section. Check items off directly — changes are written back to the source file.",author:"MindOS",icon:"✅",tags:["productivity","tasks","markdown"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:"TODO.md",match:({filePath:a})=>/\bTODO\b.*\.(md|csv)$/i.test(a),load:()=>Promise.resolve().then(c.bind(c,54195)).then(a=>({default:a.TodoRenderer}))},{id:"video",name:"Video Player",description:"Plays video files with native browser controls.",author:"MindOS",icon:"\uD83C\uDFAC",tags:["video","movie","recording","mp4","webm"],builtin:!0,core:!0,appBuiltinFeature:!0,match:({extension:a})=>g.has(a),load:()=>Promise.resolve().then(c.bind(c,63956)).then(a=>({default:a.VideoRenderer}))},{id:"workflow-yaml",name:"Workflow Runner",description:"Execute step-by-step YAML workflows with Skills & Agent support.",author:"MindOS",icon:"⚡",tags:["workflow","automation","steps","ai","yaml"],builtin:!0,core:!0,appBuiltinFeature:!0,entryPath:".mindos/workflows/",match:({extension:a,filePath:b})=>("yaml"===a||"yml"===a)&&/\.flow\.(yaml|yml)$/i.test(b),load:()=>Promise.resolve().then(c.bind(c,2820)).then(a=>({default:a.WorkflowYamlRenderer}))},{id:"graph",name:"Wiki Graph",description:"Force-directed graph of wikilink references across all markdown files. Supports Global and Local (2-hop) scope filters.",author:"MindOS",icon:"\uD83D\uDD78️",tags:["graph","wiki","links","visualization"],builtin:!0,match:()=>!1,load:()=>Promise.resolve().then(c.bind(c,80992)).then(a=>({default:a.GraphRenderer}))}])(0,d.TS)(a)},4299:(a,b,c)=>{"use strict";c.d(b,{m:()=>e});let d=new Set(["write_file","create_file","batch_create_files","update_section","insert_after_heading","delete_file","rename_file","create_space"]);async function e(a,b,c){let e=a.getReader(),f=new TextDecoder,g="",h=[],i=new Map,j=null,k=null,l=Date.now();function m(){let a=h.map(a=>"text"===a.type?{type:"text",text:a.text}:"reasoning"===a.type?{type:"reasoning",text:a.text}:{...a});return{role:"assistant",content:a.filter(a=>"text"===a.type).map(a=>a.text).join(""),parts:a,timestamp:l}}try{for(;!c?.aborted;){let{done:a,value:c}=await e.read();if(a)break;let l=(g+=f.decode(c,{stream:!0})).split("\n");g=l.pop()??"";let n=!1;for(let a of l){let b,c=a.trim(),e=null;if(c.startsWith("data:")&&(e=c.slice(5).trim()),e){try{b=JSON.parse(e)}catch{continue}switch(b.type){case"text_delta":{let a=function(a){if(j===a){let a=h[h.length-1];if(a&&"text"===a.type)return a}let b={type:"text",text:""};return h.push(b),j=a,b}("text");a.text+=b.delta??"",n=!0;break}case"thinking_delta":k||(k={type:"reasoning",text:""},h.push(k),j=null),k.text+=b.delta??"",n=!0;break;case"tool_start":{let a=b.toolCallId,c=b.toolName,d=function(a,b){let c=i.get(a);return c||(c={type:"tool-call",toolCallId:a,toolName:b??"unknown",input:void 0,state:"pending"},i.set(a,c),h.push(c),j=null),c}(a,c);d.input=b.args,d.state="running",n=!0;break}case"tool_end":{let a=b.toolCallId,c=i.get(a);c&&(c.output=b.output??"",c.state=b.isError?"error":"done",n=!0,b.isError||d.has(c.toolName));break}case"error":{let a=b.message;h.push({type:"text",text:`
|
|
36
41
|
|
|
37
42
|
**Stream Error:** ${a}`}),j=null,n=!0}}}}n&&b(m())}}finally{e.releaseLock()}let n=!1;for(let a of i.values())("running"===a.state||"pending"===a.state)&&(a.state="error",a.output=a.output??"Stream ended before tool completed",n=!0);return n&&b(m()),m()}},4452:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A:()=>u,C:()=>s});var e=c(48249),f=c(67484),g=c(74429),h=c(69924),i=c(10316),j=c(40560),k=c(42742),l=c(19794),m=c(66336),n=c(44218),o=c(47223),p=c(98610),q=c(92876),r=a([p,q]);[p,q]=r.then?(await r)():r;let v="mindos-provider-model";function s(){return{provider:null,model:null}}function t(a,b){try{a||b?localStorage.setItem(v,JSON.stringify({provider:a,model:b})):localStorage.removeItem(v),localStorage.removeItem("mindos-provider-override")}catch{}}function u({providerValue:a,onProviderChange:b,modelValue:c,onModelChange:d,disabled:r=!1}){let s,{t:u,locale:v}=(0,o.Y)(),[w,x]=(0,f.useState)(!1),y=(0,f.useRef)(null),z=(0,f.useRef)(null),A=(0,f.useRef)(null),B=(0,f.useRef)(null),C=(0,f.useRef)(null),[D,E]=(0,f.useState)(null),F=(0,f.useRef)(null),G=(0,f.useRef)(null),[H,I]=(0,f.useState)(null),[J,K]=(0,f.useState)({}),[L,M]=(0,f.useState)(null),[N,O]=(0,f.useState)(!1),[P,Q]=(0,f.useState)(""),[R,S]=(0,f.useState)(""),[T,U]=(0,f.useState)(-1),V=(0,f.useRef)(0),W=(0,f.useRef)({}),X=(0,f.useRef)(void 0),Y=(0,f.useRef)(void 0),Z=(0,f.useCallback)(()=>{X.current&&(clearTimeout(X.current),X.current=void 0)},[]),$=(0,f.useCallback)(()=>{Z(),X.current=setTimeout(()=>{I(null),S("")},300)},[Z]),_=D?.ai?.activeProvider||"",aa=(0,f.useMemo)(()=>D?(D.ai?.providers??[]).map(a=>a.id):[],[D]),ab=(0,f.useRef)(b);ab.current=b;let ac=(0,f.useRef)(d);ac.current=d,(0,f.useRef)(!1);let ad=a??_,ae=(0,q.lh)(D?.ai?.providers??[],String(ad)),af=ae?p.T_[ae.protocol]:null,ag=ae?.model||af?.defaultModel||"",ah=c||ag,ai=ae?.name||(af?"zh"===v?af.nameZh:af.name:String(ad)),[aj,ak]=(0,f.useState)({}),al=(0,f.useRef)(void 0),am=(0,f.useCallback)(()=>{if(!y.current)return;let a=y.current.getBoundingClientRect(),b=a.top>window.innerHeight-a.bottom&&a.top>280;ak({position:"fixed",left:Math.min(a.left,window.innerWidth-270),...b?{bottom:window.innerHeight-a.top+6}:{top:a.bottom+6},zIndex:50})},[]);(0,f.useCallback)(()=>{al.current&&clearTimeout(al.current),al.current=setTimeout(()=>{am()},0)},[am]);let an=(0,f.useCallback)(async(a,b=!1)=>{if(!b&&W.current[a]){M(W.current[a]),O(!1);return}b&&delete W.current[a],O(!0),Q(""),M(null);let c=++V.current;try{let b=await fetch("/api/settings/list-models",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:a})});if(c!==V.current)return;let d=await b.json();if(c!==V.current)return;d.ok&&Array.isArray(d.models)?(W.current[a]=d.models,M(d.models)):Q(d.error||"Failed")}catch{c===V.current&&Q("Network error")}finally{c===V.current&&O(!1)}},[]),ao=(0,f.useCallback)(a=>{let b=(0,q.lh)(D?.ai?.providers??[],a);if(!b)return!1;let c=p.T_[b.protocol];return c?.supportsListModels??!1},[D]),ap=(0,f.useCallback)(()=>{let a=F.current,b=G.current;if(!a||!b)return;let c=a.getBoundingClientRect(),d=b.getBoundingClientRect(),e=c.right+4,f=d.top;window.innerHeight-f<320&&(f=Math.max(8,d.bottom-320));let g=e+220>window.innerWidth-8?c.left-220-4:e;K({position:"fixed",left:g,top:f,zIndex:51})},[]),aq=(0,f.useCallback)(a=>{Z(),Y.current&&clearTimeout(Y.current),Y.current=setTimeout(()=>{if(!ao(a)){I(null),S("");return}I(a),S(""),U(-1),Q(""),M(W.current[a]??null),W.current[a]||an(a),requestAnimationFrame(()=>{ap(),setTimeout(()=>B.current?.focus(),50)})},80)},[Z,an,ap,ao]),ar=(0,f.useCallback)(()=>{Z(),Y.current&&(clearTimeout(Y.current),Y.current=void 0),I(null),S("")},[Z]),as=(0,f.useCallback)(a=>{ab.current(a),ac.current(null),t(a,null),x(!1),I(null),S("")},[]),at=(0,f.useCallback)((a,b)=>{ab.current(a),ac.current(b),t(a,b),x(!1),I(null),S("")},[]),au=(0,f.useMemo)(()=>{if(!L)return[];if(!R.trim())return L;let a=R.toLowerCase();return L.filter(b=>b.toLowerCase().includes(a))},[L,R]),av=(0,f.useCallback)(a=>{au.length&&("ArrowDown"===a.key?(a.preventDefault(),U(a=>(a+1)%au.length)):"ArrowUp"===a.key?(a.preventDefault(),U(a=>(a-1+au.length)%au.length)):"Enter"===a.key&&T>=0&&T<au.length&&H?(a.preventDefault(),at(H,au[T])):"Escape"===a.key&&(a.preventDefault(),I(null),S("")))},[au,T,H,at]);if(!D||0===aa.length)return null;let aw=(ah||"").length>20?(ah||"").slice(0,18)+"…":ah,ax=(s=ae?.name||"")&&s.length>12?s.slice(0,10)+"…":s||af?.shortLabel||ai,ay=`${ai} \xb7 ${ah}`,az=!!(c&&c!==ag),aA=w?(0,e.jsx)("div",{ref:z,style:aj,children:(0,e.jsx)("div",{ref:F,role:"listbox","aria-label":u.ask?.providerCapsule??"Provider",className:"w-[260px] rounded-lg border border-border bg-card shadow-lg py-1 animate-in fade-in-0 zoom-in-95 duration-100",style:{maxHeight:"70vh",overflowY:"auto"},children:aa.map(b=>{let d=(0,q.lh)(D?.ai?.providers??[],b);if(!d)return null;let f=p.T_[d.protocol],g=d.name||("zh"===v?f?.nameZh:f?.name)||b,h=c&&a===b?c:d.model||f?.defaultModel||"",i=a===b||!a&&_===b,j=H===b,m=ao(b);return(0,e.jsx)("div",{ref:j?G:void 0,onMouseEnter:()=>m?aq(b):ar(),onMouseLeave:$,children:(0,e.jsxs)("div",{className:`flex w-full items-center text-xs transition-colors ${j?"bg-accent/60":"hover:bg-muted/60"}`,children:[(0,e.jsxs)("button",{type:"button",role:"option","aria-selected":i,onClick:()=>as(b),className:"flex flex-1 items-center gap-2 px-3 py-1.5 min-w-0 text-left",children:[(0,e.jsx)("span",{className:`shrink-0 text-xs ${i?"font-medium text-foreground":"text-foreground/80"}`,children:g}),h&&(0,e.jsx)("span",{className:"min-w-0 truncate rounded bg-muted/70 px-1.5 py-px text-[10px] font-mono leading-tight text-muted-foreground",children:h}),i&&(0,e.jsx)(k.A,{size:11,className:"shrink-0 ml-auto text-[var(--amber)]"})]}),m&&(0,e.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),H===b?ar():aq(b)},className:`shrink-0 px-1.5 py-1.5 mr-1 rounded transition-colors ${j?"text-foreground":"text-muted-foreground/40 hover:text-muted-foreground"}`,title:u.ask?.selectModel??"Select model",children:(0,e.jsx)(l.A,{size:11})})]})},b)})})}):null;return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("button",{ref:y,type:"button",onClick:()=>{!r&&(x(a=>!a),w&&(I(null),S("")))},disabled:r,className:`
|
|
38
43
|
inline-flex items-center gap-1 rounded-full px-2.5 py-0.5
|
|
@@ -44,7 +49,12 @@ Be specific and actionable. Format in Markdown.`}(a,b,g)}],currentFile:c};h&&(i.
|
|
|
44
49
|
relative flex items-center ${f?"justify-start px-3 w-full":"justify-center w-10"} h-10 rounded-md transition-colors
|
|
45
50
|
${e?"text-[var(--amber)] bg-[var(--amber-dim)]":"text-muted-foreground hover:text-foreground hover:bg-muted"}
|
|
46
51
|
focus-visible:ring-2 focus-visible:ring-ring
|
|
47
|
-
`,children:[e&&(0,d.jsx)("span",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-[2px] h-[18px] rounded-r-full bg-[var(--amber)]"}),(0,d.jsx)("span",{className:"shrink-0 flex items-center justify-center w-[18px]",children:a}),i,f&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"ml-2.5 text-sm whitespace-nowrap",children:b}),c&&(0,d.jsx)("span",{className:"ml-auto text-2xs text-muted-foreground/60 font-mono shrink-0",children:c})]})]})}function w({activePanel:a,onPanelChange:b,onEchoClick:c,onAgentsClick:w,onDiscoverClick:x,onWorkflowsClick:y,onSpacesClick:z,syncStatus:A,expanded:B,onExpandedChange:C,onSettingsClick:D,onSyncClick:E}){let F=(0,e.useRef)(0),G=(0,e.useRef)(null),{t:H}=(0,q.Y)(),I=(0,f.usePathname)(),J=(0,f.useRouter)(),K="/"===I,[L,M]=(0,e.useState)(!1),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(!1),R=(0,e.useCallback)(a=>{let b=Date.now();b-F.current<300||(F.current=b,a())},[]),S=(0,e.useCallback)(c=>{R(()=>b(a===c?null:c))},[a,b,R]),T=(0,r.Bq)(A,!1),U=B?u:t,V="off"!==T&&"synced"!==T?(0,d.jsx)("span",{className:`absolute ${B?"left-[26px] top-1.5":"top-1.5 right-1.5"} w-2 h-2 rounded-full ${r.BG[T]} ${"error"===T||"conflicts"===T?"animate-pulse":""}`}):void 0;return(0,d.jsxs)("aside",{className:"group hidden md:flex fixed top-0 left-0 h-screen z-[31] flex-col bg-background border-r border-border transition-[width] duration-200 ease-out",style:{width:`${U}px`},role:"toolbar","aria-label":"Navigation","aria-orientation":"vertical",children:[(0,d.jsxs)("div",{className:"flex flex-col h-full w-full overflow-hidden",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>{K?b("files"===a?null:"files"):(b("files"),J.push("/"))},className:`flex items-center ${B?"px-3 gap-2":"justify-center"} w-full h-[46px] shrink-0 transition-opacity cursor-pointer ${K?"opacity-100":"opacity-50 hover:opacity-80"}`,"aria-label":"MindOS Home",children:[(0,d.jsx)(s.A,{id:"rail",className:"w-7 h-3.5 shrink-0"}),B&&(0,d.jsx)("span",{className:"text-sm text-foreground font-brand whitespace-nowrap",children:"MindOS"})]}),(0,d.jsx)("div",{className:`${B?"mx-3":"mx-2"} border-t border-border`}),(0,d.jsxs)("div",{className:`flex flex-col ${B?"px-1.5":"items-center"} gap-1 py-2`,children:[(0,d.jsx)(v,{icon:(0,d.jsx)(g.A,{size:18}),label:H.sidebar.files,active:!K&&"files"===a,expanded:B,onClick:()=>z?R(z):S("files"),walkthroughId:"files-panel"}),N&&(0,d.jsx)(v,{icon:(0,d.jsx)(h.A,{size:18}),label:H.sidebar.echo,active:"echo"===a,expanded:B,onClick:()=>c?R(c):S("echo"),walkthroughId:"echo-panel"}),(0,d.jsx)(v,{icon:(0,d.jsx)(i.A,{size:18}),label:H.sidebar.searchTitle,shortcut:"⌘K",active:"search"===a,expanded:B,onClick:()=>S("search")}),(0,d.jsx)(v,{icon:(0,d.jsx)(j.A,{size:18}),label:H.sidebar.agents,active:"agents"===a,expanded:B,onClick:()=>w?R(w):S("agents"),walkthroughId:"agents-panel"}),P&&(0,d.jsx)(v,{icon:(0,d.jsx)(k.A,{size:18}),label:H.sidebar.workflows??"Flows",active:"workflows"===a,expanded:B,onClick:()=>y?R(y):S("workflows")})]}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsx)("div",{className:`${B?"mx-3":"mx-2"} border-t border-border`}),(0,d.jsx)("div",{className:`flex flex-col ${B?"px-1.5":"items-center"} gap-1 py-2`,children:(0,d.jsx)(v,{icon:(0,d.jsx)(l.A,{size:18}),label:H.sidebar.discover,active:"discover"===a,expanded:B,onClick:()=>x?R(x):S("discover")})}),(0,d.jsx)("div",{className:`${B?"mx-3":"mx-2"} border-t border-border`}),(0,d.jsxs)("div",{className:`flex flex-col ${B?"px-1.5":"items-center"} gap-1 py-2`,children:[(0,d.jsx)(v,{icon:(0,d.jsx)(m.A,{size:18}),label:H.sidebar.settingsTitle,shortcut:"⌘,",expanded:B,onClick:()=>R(D),badge:L?(0,d.jsx)("span",{className:`absolute ${B?"left-[26px] top-1.5":"top-1.5 right-1.5"} w-2 h-2 rounded-full bg-error`}):void 0}),A?.enabled&&A?.remote&&"(not configured)"!==A.remote&&(0,d.jsx)(v,{icon:(0,d.jsx)(n.A,{size:18}),label:H.sidebar.syncLabel,expanded:B,buttonRef:G,badge:V,onClick:()=>R(()=>{let a=G.current?.getBoundingClientRect();a&&E(a)})})]})]}),(0,d.jsx)("button",{onClick:()=>C(!B),className:" absolute right-0 top-1/2 -translate-y-1/2 translate-x-1/2 z-[32] w-5 h-5 rounded-full bg-card border border-border shadow-sm flex items-center justify-center opacity-0 group-hover:opacity-100 hover:!opacity-100 transition-opacity duration-200 text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring ","aria-label":B?"Collapse sidebar":"Expand sidebar",title:B?"Collapse":"Expand",children:B?(0,d.jsx)(o.A,{size:10}):(0,d.jsx)(p.A,{size:10})})]})}},4949:(a,b,c)=>{"use strict";c.d(b,{A:()=>x});var d=c(48249),e=c(67484),f=c(19099),g=c(97621),h=c(50567),i=c(22772),j=c(86588),k=c(40560),l=c(42742),m=c(6079),n=c(8455),o=c(45231),p=c(46674),q=c(47086),r=c(13481),s=c(44218),t=c(47223),u=c(33191),v=c(39624);function w(a,b){let c=a.fileImport;if(!b)return c.organizeProcessing;switch(b.stage){case"connecting":return c.organizeConnecting;case"analyzing":return c.organizeAnalyzing;case"reading":return c.organizeReading(b.detail);case"thinking":return c.organizeThinking;case"writing":return c.organizeWriting(b.detail);default:return c.organizeProcessing}}function x({aiOrganize:a,onDismiss:b,onCancel:c,onHistoryUpdate:x}){let{t:y}=(0,t.Y)(),z=(0,f.useRouter)(),A=y.fileImport,B="organizing"===a.phase,{elapsed:C,displayHint:D}=function(a,b){let[c,d]=(0,e.useState)(0),[f,g]=(0,e.useState)(!1);return(0,e.useRef)(Date.now()),{elapsed:c,displayHint:f?{stage:"thinking"}:b}}(0,a.stageHint),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(!1),K=(0,e.useRef)(null),L=(0,e.useRef)(null),M="done"===a.phase,N="error"===a.phase,O=B||M||N,P=a.changes.filter(a=>a.ok&&!a.undone).length,Q=(0,e.useCallback)(()=>{K.current&&clearTimeout(K.current),(M||N)&&(K.current=setTimeout(()=>{b()},18e4))},[M,N,b]),R=(0,e.useCallback)(()=>{Q()},[Q]),S=(0,e.useCallback)(async b=>{R(),J(!0);let c=await a.undoOne(b);J(!1),c&&(window.dispatchEvent(new Event("mindos:files-changed")),setTimeout(()=>{if(L.current){let c=a.changes.map(a=>({action:a.action,path:a.path,ok:a.ok,undone:a.path===b||a.undone})),d=c.every(a=>!a.ok||a.undone);(0,v.W8)(L.current,{files:c,status:d?"undone":"partial"}),x?.()}},0))},[a,R,x]),T=(0,e.useCallback)(async()=>{R(),J(!0);let b=await a.undoAll();J(!1),b>0&&(window.dispatchEvent(new Event("mindos:files-changed")),L.current&&((0,v.W8)(L.current,{files:a.changes.map(a=>({action:a.action,path:a.path,ok:a.ok,undone:!!a.ok||a.undone})),status:"undone"}),x?.()))},[a,R,x]),U=(0,e.useCallback)(a=>{R(),z.push(`/view/${(0,u.O0)(a)}`)},[z,R]),V=(0,e.useCallback)(()=>{b()},[b]);if(!O)return null;function W(b,c){let e=b.undone,f=a.canUndo(b.path),k=b.path.split("/").pop()??b.path;return(0,d.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-md text-sm transition-colors ${e?"bg-muted/30 opacity-50":"bg-muted/50"}`,children:[e?(0,d.jsx)(g.A,{size:14,className:"text-muted-foreground shrink-0"}):"create"===b.action?(0,d.jsx)(h.A,{size:14,className:"text-success shrink-0"}):(0,d.jsx)(i.A,{size:14,className:"text-[var(--amber)] shrink-0"}),(0,d.jsx)("span",{className:`truncate flex-1 ${e?"line-through text-muted-foreground":"text-foreground"}`,children:k}),e?(0,d.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:A.organizeUndone}):(0,d.jsx)("span",{className:`text-xs shrink-0 ${b.ok?"text-muted-foreground":"text-error"}`,children:b.ok?"create"===b.action?A.organizeCreated:A.organizeUpdated:A.organizeFailed}),f&&(0,d.jsx)("button",{type:"button",onClick:()=>S(b.path),disabled:I,className:"text-2xs text-muted-foreground/60 hover:text-foreground transition-colors shrink-0 px-1 disabled:opacity-40",title:A.organizeUndoOne,children:(0,d.jsx)(g.A,{size:12})}),b.ok&&!b.undone&&(0,d.jsx)("button",{type:"button",onClick:()=>U(b.path),className:"text-2xs text-muted-foreground/60 hover:text-[var(--amber)] transition-colors shrink-0 px-1",title:A.organizeViewFile,children:(0,d.jsx)(j.A,{size:12})})]},`${b.path}-${c}`)}function X(){return(0,d.jsxs)("div",{className:"flex items-center justify-end gap-3 px-4 py-3 border-t border-border",children:[M&&a.hasAnyUndoable&&(0,d.jsxs)("button",{onClick:T,disabled:I,className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1.5 disabled:opacity-50",children:[I?(0,d.jsx)(k.A,{size:12,className:"animate-spin"}):(0,d.jsx)(g.A,{size:12}),A.organizeUndoAll]}),(0,d.jsxs)("button",{onClick:V,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-all",children:[(0,d.jsx)(l.A,{size:12}),A.organizeDone]})]})}return G?(0,d.jsx)("div",{className:"fixed inset-0 z-50 overlay-backdrop flex items-center justify-center p-4",onClick:a=>{a.target===a.currentTarget&&H(!1)},children:(0,d.jsxs)("div",{className:"w-full max-w-xl max-h-[80vh] flex flex-col bg-card rounded-xl shadow-xl border border-border animate-in fade-in-0 zoom-in-95 duration-200",onClick:R,role:"dialog","aria-modal":"true","aria-label":A.organizeDetailTitle,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-5 pt-5 pb-3 shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[B?(0,d.jsxs)("div",{className:"relative shrink-0",children:[(0,d.jsx)(m.A,{size:16,className:"text-[var(--amber)]"}),(0,d.jsx)(k.A,{size:10,className:"absolute -bottom-0.5 -right-0.5 text-[var(--amber)] animate-spin"})]}):M?(0,d.jsx)(l.A,{size:16,className:"text-success"}):(0,d.jsx)(n.A,{size:16,className:"text-error"}),(0,d.jsx)("h2",{className:"text-base font-semibold text-foreground",children:A.organizeDetailTitle}),B&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 tabular-nums",children:A.organizeElapsed(C)})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>H(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:A.organizeMinimizeModal,children:(0,d.jsx)(o.A,{size:14})}),(0,d.jsx)("button",{type:"button",onClick:V,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(p.A,{size:14})})]})]}),(0,d.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto px-5 pb-2 space-y-4",children:[B&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-lg bg-[var(--amber-subtle)] border border-[var(--amber-dim)]",children:[(0,d.jsx)(k.A,{size:14,className:"text-[var(--amber)] animate-spin shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-foreground",children:w(y,D)})]}),a.sourceFileNames.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:A.organizeSourceFiles}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.sourceFileNames.map((a,b)=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-md bg-muted/60 text-xs text-foreground",children:[(0,d.jsx)(q.A,{size:11,className:"text-muted-foreground shrink-0"}),a]},b))})]}),(a.summary||B)&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:A.organizeSummaryLabel}),(0,d.jsx)("div",{className:"px-3 py-2.5 rounded-lg bg-muted/30 border border-border text-sm text-foreground leading-relaxed whitespace-pre-wrap",children:a.summary||A.organizeNoSummary})]}),a.changes.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:A.organizeChangesLabel(a.changes.length)}),(0,d.jsx)("div",{className:"space-y-0.5",children:a.changes.map((a,b)=>W(a,b))})]}),N&&(0,d.jsx)("div",{className:"px-3 py-2.5 rounded-lg bg-error/5 border border-error/20 text-xs text-error",children:a.error})]}),(M||N)&&X()]})}):E&&(M||N)?(0,d.jsxs)("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 w-[420px] max-w-[calc(100vw-2rem)] bg-card border border-border rounded-xl shadow-xl animate-in fade-in-0 slide-in-from-bottom-2 duration-200",onClick:R,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[M?(0,d.jsx)(l.A,{size:14,className:"text-success"}):(0,d.jsx)(n.A,{size:14,className:"text-error"}),(0,d.jsx)("span",{className:"text-xs font-medium text-foreground",children:M?A.organizeReviewTitle:A.organizeErrorTitle})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>{F(!1),H(!0)},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:A.organizeDetailTitle,children:(0,d.jsx)(r.A,{size:13})}),(0,d.jsx)("button",{type:"button",onClick:()=>F(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(s.A,{size:14})})]})]}),M&&(0,d.jsx)("div",{className:"max-h-[240px] overflow-y-auto p-2 space-y-0.5",children:a.changes.map((a,b)=>W(a,b))}),N&&(0,d.jsx)("div",{className:"p-4 text-center",children:(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:a.error})}),X()]}):(0,d.jsx)("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-3 bg-card border border-border rounded-xl shadow-lg px-4 py-3 max-w-md animate-in fade-in-0 slide-in-from-bottom-2 duration-200",onClick:R,children:M?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(l.A,{size:16,className:"text-success shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate",children:A.organizeReviewDesc(P)}),a.changes.length>0&&(0,d.jsxs)("button",{type:"button",onClick:()=>{F(!0),R()},className:"flex items-center gap-1 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:[(0,d.jsx)(s.A,{size:12,className:"rotate-180"}),A.organizeExpand]}),(0,d.jsxs)("button",{type:"button",onClick:V,className:"flex items-center gap-1 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:[(0,d.jsx)(l.A,{size:12}),A.organizeDone]})]}):N?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.A,{size:16,className:"text-error shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate",children:A.organizeError}),(0,d.jsx)("button",{type:"button",onClick:()=>{F(!0),R()},className:"text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:A.organizeExpand}),(0,d.jsx)("button",{type:"button",onClick:V,className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",children:(0,d.jsx)(p.A,{size:14})})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"relative shrink-0",children:[(0,d.jsx)(m.A,{size:16,className:"text-[var(--amber)]"}),(0,d.jsx)(k.A,{size:10,className:"absolute -bottom-0.5 -right-0.5 text-[var(--amber)] animate-spin"})]}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate",children:w(y,D)}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 tabular-nums shrink-0",children:A.organizeElapsed(C)}),(0,d.jsx)("button",{type:"button",onClick:()=>{H(!0),R()},className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",title:A.organizeDetailTitle,children:(0,d.jsx)(r.A,{size:13})}),(0,d.jsx)("button",{type:"button",onClick:V,className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",children:(0,d.jsx)(p.A,{size:14})})]})})}},5200:(a,b,c)=>{"use strict";c.d(b,{default:()=>g});var d=c(67484),e=c(47223),f=c(52610);function g({ssrLocale:a}){let b=(0,d.useRef)(!1);return b.current||(b.current=!0,e.D.getState().locale!==a&&e.D.setState({locale:a,t:f.D[a]})),null}},5315:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/ShellLayout.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ShellLayout.tsx","default")},6597:(a,b,c)=>{"use strict";c.d(b,{A:()=>j});var d=c(48249),e=c(67484),f=c(7309),g=c(83654),h=c(80600),i=c(93096);function j({results:a,selectedIndex:b,query:c,onSelect:j}){let k=(0,e.useRef)(null),l=(0,e.useRef)(null),[m,n]=(0,e.useState)(280);return 0===a.length?null:(0,d.jsxs)("div",{ref:l,className:"border border-border rounded-lg bg-card shadow-lg overflow-hidden",children:[(0,d.jsxs)("div",{className:"px-3 py-1.5 border-b border-border flex items-center gap-1.5",children:[(0,d.jsx)(f.A,{size:11,className:"text-muted-foreground/50"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-muted-foreground/70 uppercase tracking-wider",children:"Files"}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 ml-auto",children:a.length})]}),(0,d.jsx)("div",{ref:k,className:"overflow-y-auto",style:{maxHeight:m},children:a.map((a,e)=>{let f=a.split("/").pop()??a,k=a.split("/").slice(0,-1).join("/"),l=f.endsWith(".csv");return(0,d.jsxs)("button",{type:"button",onMouseDown:b=>{b.preventDefault(),j(a)},className:`w-full flex items-center gap-2 px-3 py-2 text-sm text-left transition-colors ${e===b?"bg-accent text-foreground":"text-muted-foreground hover:bg-muted"}`,children:[l?(0,d.jsx)(g.A,{size:13,className:"text-success shrink-0"}):(0,d.jsx)(h.A,{size:13,className:"text-muted-foreground shrink-0"}),(0,d.jsx)("span",{className:"truncate font-medium flex-1",title:f,children:(0,d.jsx)(i.A,{text:f,query:c})}),k&&(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 truncate max-w-[140px] shrink-0",title:k,children:(0,d.jsx)(i.A,{text:k,query:c})})]},a)})}),(0,d.jsxs)("div",{className:"px-3 py-1.5 border-t border-border flex gap-3 text-2xs text-muted-foreground/40 shrink-0",children:[(0,d.jsx)("span",{children:"↑↓ navigate"}),(0,d.jsx)("span",{children:"↵ select"}),(0,d.jsx)("span",{children:"ESC dismiss"})]})]})}},6732:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TimelineRenderer:()=>i});var d=c(48249),e=c(67484);let f=/(\d{4}[-/]\d{1,2}(?:[-/]\d{1,2})?|[A-Za-z]+ \d{4}|\d{4}年\d{1,2}月(?:\d{1,2}日)?)/;function g(a){return a.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`(.+?)`/g,'<code class="font-display" style="font-size:0.85em;padding:1px 5px;border-radius:4px;background:var(--muted)">$1</code>').replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,(a,b,c)=>`<span style="color:var(--amber);cursor:pointer" title="${b}">${c??b}</span>`).replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" style="color:var(--amber)">$1</a>')}let h=[{bg:"rgba(200,135,58,0.12)",text:"var(--amber)"},{bg:"rgba(122,173,128,0.12)",text:"var(--success)"},{bg:"rgba(138,180,216,0.12)",text:"var(--tool-read)"},{bg:"rgba(200,160,216,0.12)",text:"var(--tool-search)"}];function i({content:a}){let b=(0,e.useMemo)(()=>(function(a){let b=a.split("\n"),c=[],d=null,e=[],g=()=>{let a,b;if(!d)return;let f=e.join("\n").trim();d.body=f,d.tags=(a=[],(b=f.match(/#([\w\u4e00-\u9fff]+)/g))&&a.push(...b.map(a=>a.slice(1))),[...new Set(a)]),c.push(d),d=null,e=[]};for(let a of b)if(!/^# /.test(a)){if(/^## /.test(a)){g();let b=a.slice(3).trim();d={heading:b,date:function(a){let b=f.exec(a);if(!b)return null;let c=new Date(b[1].replace(/[/年月]/g,"-").replace("日",""));return isNaN(c.getTime())?null:c}(b),body:"",tags:[]};continue}d&&e.push(a)}return g(),c})(a),[a]);return 0===b.length?(0,d.jsxs)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:13},children:["No timeline entries found. Add ",(0,d.jsx)("code",{style:{background:"var(--muted)",padding:"1px 6px",borderRadius:4},children:"## 2025-01-15"})," headings to create entries."]}):(0,d.jsxs)("div",{style:{maxWidth:720,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsx)("div",{style:{marginBottom:"1.5rem",display:"flex",alignItems:"center",gap:8},children:(0,d.jsxs)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:[b.length," ",1===b.length?"entry":"entries"]})}),(0,d.jsxs)("div",{style:{position:"relative",paddingLeft:28},children:[(0,d.jsx)("div",{style:{position:"absolute",left:6,top:8,bottom:8,width:1,background:"var(--border)"}}),b.map((a,b)=>(0,d.jsxs)("div",{style:{position:"relative",marginBottom:"1.5rem"},children:[(0,d.jsx)("div",{style:{position:"absolute",left:-22,top:10,width:9,height:9,borderRadius:"50%",background:a.date?"var(--amber)":"var(--border)",outline:a.date?"2px solid var(--amber-dim)":"none",zIndex:1}}),(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,padding:"14px 18px",transition:"border-color .15s"},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,flexWrap:"wrap",marginBottom:8},children:[(0,d.jsx)("span",{style:{fontWeight:600,fontSize:"0.9rem",color:"var(--foreground)"},children:a.heading}),a.date&&(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.7rem",color:"var(--muted-foreground)",opacity:.7,flexShrink:0},children:a.date.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})})]}),a.body&&(0,d.jsx)("div",{dangerouslySetInnerHTML:{__html:function(a){let b=a.split("\n"),c=[],d=!1,e=()=>{d&&(c.push("</ul>"),d=!1)};for(let a of b){let b=a.trimEnd();if(!b){e(),c.push("<br/>");continue}if(/^### /.test(b)){e(),c.push(`<h3 style="font-size:0.8rem;font-weight:600;color:var(--muted-foreground);text-transform:uppercase;letter-spacing:.06em;margin:.9em 0 .3em">${g(b.slice(4))}</h3>`);continue}if(/^- /.test(b)||/^\* /.test(b)){d||(c.push('<ul style="margin:.3em 0;padding-left:1.2em;list-style:disc">'),d=!0),c.push(`<li style="margin:.15em 0;font-size:.82rem;color:var(--foreground)">${g(b.slice(2))}</li>`);continue}if(/^\d+\. /.test(b)){d||(c.push('<ol style="margin:.3em 0;padding-left:1.2em">'),d=!0),c.push(`<li style="margin:.15em 0;font-size:.82rem;color:var(--foreground)">${g(b.replace(/^\d+\. /,""))}</li>`);continue}e(),c.push(`<p style="margin:.25em 0;font-size:.82rem;line-height:1.6;color:var(--foreground)">${g(b)}</p>`)}return e(),c.join("")}(a.body)}}),a.tags.length>0&&(0,d.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:5,marginTop:10},children:a.tags.map(a=>{let b=function(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)&65535;return h[b%h.length]}(a);return(0,d.jsxs)("span",{className:"font-display",style:{fontSize:"0.68rem",padding:"1px 8px",borderRadius:999,background:b.bg,color:b.text},children:["#",a]},a)})})]})]},b))]})]})}},9311:(a,b,c)=>{"use strict";c.d(b,{BG:()=>l,jc:()=>q,Ay:()=>p,Bq:()=>k,ky:()=>o,bj:()=>n,dW:()=>m});var d=c(48249),e=c(67484),f=c(49681),g=c(2797),h=c(69924),i=c(95054),j=c(47223);function k(a,b){return b?"syncing":a&&a.enabled?a.lastError?"error":a.conflicts&&a.conflicts.length>0?"conflicts":parseInt(a.unpushed||"0",10)>0?"unpushed":"synced":"off"}c(81285);let l={synced:"bg-success",unpushed:"bg-yellow-500",conflicts:"bg-error",error:"bg-error",off:"bg-muted-foreground/40",syncing:"bg-blue-500"};function m(){let[a,b]=(0,e.useState)(null),[c,d]=(0,e.useState)(!1);return(0,e.useRef)(void 0),{status:a,loaded:c,fetchStatus:(0,e.useCallback)(async()=>{try{let a=await (0,i.n)("/api/sync");b(a)}catch{b(null)}finally{d(!0)}},[])}}function n(a){let[b,c]=(0,e.useState)(!1),[d,f]=(0,e.useState)(null),g=(0,e.useCallback)(async()=>{if(!b){c(!0),f(null);try{await (0,i.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"now"})}),await a(),f("success")}catch{await a(),f("error")}finally{c(!1),setTimeout(()=>f(null),2500)}}},[b,a]);return{syncing:b,syncResult:d,syncNow:g}}function o(a,b,c){switch(a){case"syncing":{let a=c?.syncing??"Syncing...";return{label:a,tooltip:a}}case"synced":{let a=`${c?.synced??"Synced"} \xb7 ${function(a,b){if(!a)return(void 0)??"never";let c=Date.now()-new Date(a).getTime();if(c<6e4)return(void 0)??"just now";let d=Math.floor(c/6e4);if(c<36e5)return(void 0)??`${d}m ago`;let e=Math.floor(c/36e5);if(c<864e5)return(void 0)??`${e}h ago`;let f=Math.floor(c/864e5);return(void 0)??`${f}d ago`}(b?.lastSync)}`;return{label:a,tooltip:a}}case"unpushed":{let a=parseInt(b?.unpushed||"0",10);return{label:`${a} ${c?.unpushed??"awaiting push"}`,tooltip:c?.unpushedHint??`${a} commit(s) not yet pushed to remote`}}case"conflicts":{let a=b?.conflicts?.length||0;return{label:`${a} ${c?.conflicts??"conflicts"}`,tooltip:c?.conflictsHint??`${a} file(s) have merge conflicts — resolve in Settings > Sync`}}case"error":return{label:c?.syncError??"Sync error",tooltip:b?.lastError||(c?.syncError??"Sync error")};default:{let a=c?.syncOff??"Sync off";return{label:a,tooltip:a}}}}function p({collapsed:a,onOpenSyncSettings:b}){let{status:c,loaded:i,fetchStatus:p}=m(),{syncing:q,syncResult:r,syncNow:s}=n(p),[t,u]=(0,e.useState)(null);(0,e.useRef)("off");let[v,w]=(0,e.useState)(()=>!1),{t:x}=(0,j.Y)();if(!function(a){let[,b]=(0,e.useState)(0)}(0),!i||a)return null;let y=k(c,q);if("off"===y){if(v)return null;let a=x.sidebar?.sync;return(0,d.jsxs)("div",{className:"hidden md:flex items-center justify-between px-4 py-1.5 border-t border-border text-xs text-muted-foreground shrink-0 animate-in fade-in duration-300",children:[(0,d.jsxs)("button",{onClick:b,className:"flex items-center gap-2 min-w-0 hover:text-foreground transition-colors truncate",title:a?.enableHint??"Set up cross-device sync",children:[(0,d.jsx)("span",{className:"w-2 h-2 rounded-full shrink-0 bg-muted-foreground/40"}),(0,d.jsxs)("span",{className:"truncate",children:[a?.enableSync??"Enable sync"," →"]})]}),(0,d.jsx)("button",{onClick:a=>{a.stopPropagation();try{localStorage.setItem("sync-hint-dismissed","1")}catch(a){console.warn("[SyncStatusBar] localStorage write dismissed:",a)}w(!0)},className:"p-1 rounded hover:bg-muted hover:text-foreground transition-colors shrink-0 ml-2 text-muted-foreground/50 hover:text-muted-foreground",title:"Dismiss",children:(0,d.jsx)("span",{className:"text-2xs",children:"✕"})})]})}let z=x.sidebar?.sync,{label:A,tooltip:B}=o(y,c,z);return(0,d.jsxs)("div",{className:"hidden md:flex items-center justify-between px-4 py-1.5 border-t border-border text-xs text-muted-foreground shrink-0 animate-in fade-in duration-300",children:[(0,d.jsxs)("button",{onClick:b,className:"flex items-center gap-2 min-w-0 hover:text-foreground transition-colors truncate",title:B,children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full shrink-0 ${l[y]} ${"syncing"===y||"conflicts"===y?"animate-pulse":""}`}),(0,d.jsx)("span",{className:"truncate",children:t||A})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[("success"===r||t)&&(0,d.jsx)(f.A,{size:12,className:"text-success animate-in fade-in duration-200"}),"error"===r&&(0,d.jsx)(g.A,{size:12,className:"text-error animate-in fade-in duration-200"}),(0,d.jsx)("button",{onClick:a=>{a.stopPropagation(),s()},disabled:q,className:"p-1 rounded hover:bg-muted hover:text-foreground transition-colors disabled:opacity-40",title:z?.syncNow??"Sync now",children:(0,d.jsx)(h.A,{size:12,className:q?"animate-spin":""})})]})]})}function q({status:a,syncing:b}){let c=k(a,b??!1);return"off"===c||"synced"===c?null:(0,d.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${l[c]} ${"conflicts"===c||"error"===c?"animate-pulse":""}`})}},10072:(a,b,c)=>{"use strict";c.d(b,{AI:()=>e,RS:()=>d});let d=["imprint","growth","self"],e={imprint:"/echo/imprint",growth:"/echo/growth",self:"/echo/self"}},10500:(a,b,c)=>{"use strict";function d(){return null}c.d(b,{default:()=>d}),c(67484)},10927:(a,b,c)=>{"use strict";function d(a,b=!0){}c.d(b,{r:()=>d}),c(67484)},12978:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/app/register-sw.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/app/register-sw.tsx","default")},13859:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$:()=>i});var e=c(67484),f=c(61112),g=c(92464),h=a([f]);function i(){let[a,b]=(0,e.useState)(!1),[c,d]=(0,e.useState)(f.eX),[h,i]=(0,e.useState)("panel"),[j,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(!1);(0,e.useRef)(!1).current=n;let[p,q]=(0,e.useState)("user"),[r,s]=(0,e.useState)(null),t=(0,e.useRef)(f.eX);(0,g.KT)();let u=(0,e.useCallback)(()=>{"popup"===h?k(a=>(a||(m(""),q("user"),s(null)),!a)):b(a=>(a||(m(""),q("user"),s(null)),!a))},[h]),v=(0,e.useCallback)(()=>{b(!1),n&&(d(t.current),o(!1))},[n]),w=(0,e.useCallback)(()=>{o(a=>(a?d(t.current):t.current=c,!a))},[c]),x=(0,e.useCallback)(()=>k(!1),[]),y=(0,e.useCallback)(a=>d(a),[]),z=(0,e.useCallback)(a=>{try{localStorage.setItem("right-ask-panel-width",String(a))}catch{}},[]),A=(0,e.useCallback)(()=>{i(a=>{let c="panel"===a?"popup":"panel";try{localStorage.setItem("ask-mode",c),window.dispatchEvent(new StorageEvent("storage",{key:"ask-mode",newValue:c}))}catch{}return"popup"===c?(b(!1),k(!0)):(k(!1),b(!0)),c})},[]);return{askPanelOpen:a,askPanelWidth:c,askMaximized:n,askMode:h,desktopAskPopupOpen:j,askInitialMessage:l,askOpenSource:p,askAcpAgent:r,toggleAskPanel:u,closeAskPanel:v,closeDesktopAskPopup:x,handleAskWidthChange:y,handleAskWidthCommit:z,handleAskModeSwitch:A,toggleAskMaximized:w}}f=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},14986:(a,b,c)=>{"use strict";c.r(b),c.d(b,{VideoRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call VideoRenderer() from the server but VideoRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/video/VideoRenderer.tsx","VideoRenderer")},15330:(a,b,c)=>{"use strict";c.d(b,{Q:()=>e});var d=c(67484);function e(){let[a,b]=(0,d.useState)([]),[c,e]=(0,d.useState)(null),[f,g]=(0,d.useState)([]),[h,i]=(0,d.useState)(0);(0,d.useCallback)(()=>{fetch("/api/files").then(a=>a.ok?a.json():[]).then(a=>Array.isArray(a)?a:[]).catch(()=>[]).then(b)},[]);let j=(0,d.useCallback)((b,c)=>{let d=c??b.length,f=b.slice(0,d),h=f.lastIndexOf("@");if(-1===h||h>0&&" "!==f[h-1]&&"\n"!==f[h-1])return void e(null);let j=f.slice(h+1);if(j.includes(" ")||j.includes("\n")){e(null),g([]),i(0);return}let k=j.toLowerCase();if(!k){e(j),g(a.slice(0,30)),i(0);return}let l=a.map(a=>{let b=(a.split("/").pop()??a).toLowerCase(),c=a.toLowerCase(),d=0;return b.startsWith(k)?d=100:b.includes(k)?d=50:c.includes(k)&&(d=10),{path:a,score:d}}).filter(a=>a.score>0).sort((a,b)=>b.score-a.score).slice(0,30);if(0===l.length){e(null),g([]),i(0);return}e(j),g(l.map(a=>a.path)),i(0)},[a]),k=(0,d.useCallback)(a=>{0!==f.length&&("down"===a?i(a=>Math.min(a+1,f.length-1)):i(a=>Math.max(a-1,0)))},[f.length]);return{mentionQuery:c,mentionResults:f,mentionIndex:h,updateMentionFromInput:j,navigateMention:k,resetMention:(0,d.useCallback)(()=>{e(null),g([]),i(0)},[])}}},17009:(a,b,c)=>{"use strict";c.d(b,{z:()=>f});var d=c(67484);let e="mindos:acp-detection";function f(){let a=(0,d.useRef)(function(){try{let a=sessionStorage.getItem(e);if(!a)return null;let b=JSON.parse(a);if("number"!=typeof b.ts||Date.now()-b.ts>18e5)return null;return b}catch{return null}}()),[b,c]=(0,d.useState)(a.current?.installed??[]),[f,g]=(0,d.useState)(a.current?.notInstalled??[]),[h,i]=(0,d.useState)(!a.current),[j,k]=(0,d.useState)(null),[l,m]=(0,d.useState)(0);(0,d.useRef)(!1);let n=(0,d.useRef)(!1);return{installedAgents:b,notInstalledAgents:f,loading:h,error:j,refresh:(0,d.useCallback)(()=>{try{sessionStorage.removeItem(e)}catch{}a.current=null,n.current=!0,m(a=>a+1)},[])}}},18329:(a,b,c)=>{"use strict";c.d(b,{av:()=>k,kr:()=>i,oc:()=>j,u_:()=>l,zd:()=>h});var d=c(31417),e=c(95054);let f=null;async function g(a){f?.abort();let b=new AbortController;f=b;try{let[c,d,f]=await Promise.all([(0,e.n)("/api/mcp/status",{signal:b.signal}),(0,e.n)("/api/mcp/agents",{signal:b.signal}),(0,e.n)("/api/skills",{signal:b.signal})]);b.signal.aborted||a({status:c,agents:d.agents,skills:f.skills})}catch(a){if(a instanceof DOMException&&"AbortError"===a.name)return}finally{b.signal.aborted||a({loading:!1})}}let h=(0,d.v)((a,b)=>({status:null,agents:[],skills:[],loading:!0,refresh:()=>g(a),toggleSkill:async(c,d)=>{a({skills:b().skills.map(a=>a.name===c?{...a,enabled:d}:a)});try{return await (0,e.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"toggle",name:c,enabled:d})}),!0}catch{return a({skills:b().skills.map(a=>a.name===c?{...a,enabled:!d}:a)}),!1}},installAgent:async(c,d)=>{let f=b().agents.find(a=>a.key===c);if(!f)return!1;try{let b=await (0,e.n)("/api/mcp/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:[{key:c,scope:d?.scope??(f.hasProjectScope?"project":"global"),transport:d?.transport??f.preferredTransport}],transport:"auto"})}),h=b.results?.[0],i=h?.ok===!0||h?.status==="ok";return i&&await g(a),i}catch{return!1}},_init:()=>{let b;g(a);let c=()=>{clearTimeout(b),b=setTimeout(()=>g(a),500)};window.addEventListener("mindos:skills-changed",c);let d=setInterval(()=>{"visible"===document.visibilityState&&g(a)},3e4);return()=>{f?.abort(),clearTimeout(b),clearInterval(d),window.removeEventListener("mindos:skills-changed",c)}}}));function i(){return h()}let j=()=>h(a=>a.agents),k=()=>h(a=>a.status),l=()=>h(a=>a.installAgent)},18776:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TodoRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call TodoRenderer() from the server but TodoRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/todo/TodoRenderer.tsx","TodoRenderer")},20892:(a,b,c)=>{"use strict";c.d(b,{A:()=>e});var d=c(48249);function e({id:a,className:b="w-8 h-4"}){return(0,d.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 40",fill:"none",className:`${b} text-[var(--amber)]`,"aria-hidden":"true",children:[(0,d.jsxs)("defs",{children:[(0,d.jsxs)("linearGradient",{id:`grad-human-${a}`,x1:"35",y1:"20",x2:"5",y2:"20",gradientUnits:"userSpaceOnUse",children:[(0,d.jsx)("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.8"}),(0,d.jsx)("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0.3"})]}),(0,d.jsxs)("linearGradient",{id:`grad-agent-${a}`,x1:"35",y1:"20",x2:"75",y2:"20",gradientUnits:"userSpaceOnUse",children:[(0,d.jsx)("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.8"}),(0,d.jsx)("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"1"})]})]}),(0,d.jsx)("path",{d:"M35,20 C25,35 8,35 8,20 C8,5 25,5 35,20",stroke:`url(#grad-human-${a})`,strokeWidth:"3",strokeDasharray:"2 4",strokeLinecap:"round"}),(0,d.jsx)("path",{d:"M35,20 C45,2 75,2 75,20 C75,38 45,38 35,20",stroke:`url(#grad-agent-${a})`,strokeWidth:"4.5",strokeLinecap:"round"}),(0,d.jsx)("path",{d:"M35,17.5 Q35,20 37.5,20 Q35,20 35,22.5 Q35,20 32.5,20 Q35,20 35,17.5 Z",fill:"#FEF3C7"})]})}},21245:(a,b,c)=>{"use strict";c.d(b,{g:()=>d});let d=[{anchor:"files-panel",position:"right"},{anchor:"ask-button",position:"bottom"},{anchor:"agents-panel",position:"right"}]},21416:(a,b,c)=>{"use strict";c.r(b),c.d(b,{PdfRenderer:()=>f});var d=c(48249),e=c(67484);function f({filePath:a}){let b=`/api/file/raw?path=${encodeURIComponent(a)}`,[c,f]=(0,e.useState)(!0),[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(0),k=(0,e.useCallback)(()=>{h(!1),f(!0),j(a=>a+1)},[]);return(0,d.jsxs)("div",{className:"w-full h-full min-h-[80vh] flex flex-col relative",children:[c&&!g&&(0,d.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-[var(--bg-secondary)] rounded-lg z-10",children:(0,d.jsx)("span",{className:"text-sm text-[var(--text-tertiary)] animate-pulse",children:"Loading PDF..."})}),g&&(0,d.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-[var(--bg-secondary)] rounded-lg z-10 gap-2",children:[(0,d.jsx)("span",{className:"text-sm text-[var(--text-secondary)]",children:"Failed to load PDF"}),(0,d.jsx)("button",{onClick:k,className:"text-xs px-3 py-1.5 rounded-md bg-[var(--bg-tertiary)] hover:bg-[var(--bg-hover)] transition-colors",children:"Retry"})]}),(0,d.jsx)("iframe",{src:b,className:"w-full flex-1 min-h-[80vh] border-0 rounded-lg bg-[var(--bg-secondary)]",title:a.split("/").pop()??"PDF",onLoad:()=>f(!1),onError:()=>{f(!1),h(!0)},style:{display:g?"none":"block"}},i)]})}},23017:(a,b,c)=>{"use strict";c.d(b,{A:()=>h});var d=c(48249),e=c(67484),f=c(46674),g=c(47223);function h(){let[a,b]=(0,e.useState)(!1),{t:c}=(0,g.Y)(),h=c.shortcutPanel,i="u">typeof navigator&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl",j=(0,e.useMemo)(()=>[{keys:`${i} K`,label:h.toggleSearch,section:h.navigation},{keys:`${i} /`,label:h.toggleAskAI,section:h.navigation},{keys:`${i} ,`,label:h.openSettings,section:h.navigation},{keys:`${i} ?`,label:h.keyboardShortcuts,section:h.navigation},{keys:"Esc",label:h.closePanel,section:h.panelsSection},{keys:`${i} S`,label:h.saveFile,section:h.editor},{keys:`${i} Z`,label:h.undo,section:h.editor},{keys:`${i} Shift Z`,label:h.redo,section:h.editor}],[i,h]);if(!a)return null;let k=[...new Set(j.map(a=>a.section))];return(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center modal-backdrop",onClick:a=>a.target===a.currentTarget&&b(!1),children:(0,d.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":h.title,className:"w-full max-w-md mx-4 bg-card border border-border rounded-xl shadow-2xl overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-border",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:h.title}),(0,d.jsx)("button",{onClick:()=>b(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(f.A,{size:15})})]}),(0,d.jsx)("div",{className:"px-5 py-4 space-y-4 max-h-[60vh] overflow-y-auto",children:k.map(a=>(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:a}),(0,d.jsx)("div",{className:"space-y-1",children:j.filter(b=>b.section===a).map(a=>(0,d.jsxs)("div",{className:"flex items-center justify-between py-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-foreground",children:a.label}),(0,d.jsx)("div",{className:"flex items-center gap-1",children:a.keys.split(" ").map((a,b)=>(0,d.jsx)("kbd",{className:"px-1.5 py-0.5 text-2xs rounded border border-border bg-muted text-muted-foreground font-mono min-w-[24px] text-center",children:a},b))})]},a.keys))})]},a))}),(0,d.jsx)("div",{className:"px-5 py-2.5 border-t border-border",children:(0,d.jsxs)("p",{className:"text-2xs text-muted-foreground/60",children:["Press ",(0,d.jsx)("kbd",{className:"px-1 py-0.5 text-2xs rounded border border-border bg-muted font-mono",children:i}),(0,d.jsx)("kbd",{className:"px-1 py-0.5 text-2xs rounded border border-border bg-muted font-mono ml-0.5",children:"?"})," ",h.toggleHint]})})]})})}},24387:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/ErrorBoundary.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ErrorBoundary.tsx","default")},27608:(a,b,c)=>{"use strict";c.d(b,{A:()=>j});var d=c(48249),e=c(67484),f=c(74429),g=c(42742),h=c(44218);function i(a){return"options"in a}function j({value:a,onChange:b,options:c,className:j="",size:k="md",placeholder:l}){let[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(-1),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=(0,e.useRef)(null),u=(0,e.useMemo)(()=>(function(a){let b=[];for(let c of a)i(c)?b.push(...c.options):b.push(c);return b})(c),[c]),v=(0,e.useMemo)(()=>u.find(b=>b.value===a)??null,[u,a]),w=(0,e.useCallback)(()=>{n(!1),p(-1)},[]),x=(0,e.useCallback)(a=>{b(a),w()},[b,w]);(0,e.useCallback)(()=>{if(!s.current)return;let a=s.current.getBoundingClientRect(),b="sm"===k?200:260,c=window.innerHeight-a.bottom,d=a.top;r({top:c<b+8&&d>c?a.top:a.bottom,left:a.left,width:a.width,flipUp:c<b+8&&d>c})},[k]);let y="sm"===k,z=y?`inline-flex items-center gap-1 appearance-none rounded-md border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors text-2xs px-1.5 py-0.5 pr-5 ${j}`:`w-full flex items-center gap-2 appearance-none rounded-lg border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors text-sm px-3 py-2 pr-8 ${j}`,A=y?"w-full flex items-center gap-1.5 px-2 py-1 text-2xs text-left transition-colors cursor-pointer":"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left transition-colors cursor-pointer",B=-1;function C(b){let c=++B,e=b.value===a,f=c===o;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":e,"data-idx":c,onClick:()=>x(b.value),onMouseEnter:()=>p(c),className:`${A} ${f?"bg-muted text-foreground":"text-foreground"}`,children:[b.icon,(0,d.jsx)("span",{className:"flex-1 truncate",children:b.label}),b.suffix,e&&(0,d.jsx)(g.A,{size:y?10:12,className:"shrink-0 text-[var(--amber)]"})]},b.value)}let D=m&&q&&(0,f.createPortal)((0,d.jsx)("div",{ref:t,className:y?"fixed z-50 overflow-y-auto rounded-md border border-border bg-card shadow-lg py-0.5":"fixed z-50 overflow-y-auto rounded-lg border border-border bg-card shadow-lg py-1",role:"listbox",style:{left:q.left,minWidth:q.width,maxHeight:y?200:260,...q.flipUp?{bottom:window.innerHeight-q.top+4}:{top:q.top+4}},children:c.map((a,b)=>i(a)?(0,d.jsxs)("div",{children:[b>0&&(0,d.jsx)("div",{className:"my-0.5 border-t border-border/50"}),(0,d.jsx)("div",{className:`py-1 text-2xs font-medium text-muted-foreground uppercase tracking-wider ${y?"px-2":"px-3"}`,children:a.label}),a.options.map(C)]},a.label):C(a))}),document.body);return(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsxs)("button",{ref:s,type:"button",onClick:()=>n(a=>!a),"aria-haspopup":"listbox","aria-expanded":m,className:z,children:[v?.icon,(0,d.jsx)("span",{className:"flex-1 truncate text-left",children:v?.label??l??"—"}),v?.suffix,(0,d.jsx)(h.A,{size:y?12:14,className:`${y?"absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none":"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"} transition-transform duration-150 ${m?"rotate-180":""}`})]}),D]})}},29406:(a,b,c)=>{"use strict";c.r(b),c.d(b,{PdfRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call PdfRenderer() from the server but PdfRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/pdf/PdfRenderer.tsx","PdfRenderer")},29713:(a,b,c)=>{"use strict";c.d(b,{Z:()=>m});var d=c(67484);let e="mindos-pinned-files",f="mindos:pins-changed";function g(){return j}let h=[];function i(){return h}let j=[];function k(a){let b=b=>{b.key===e&&(j=[],a())},c=()=>{j=[],a()};return window.addEventListener("storage",b),window.addEventListener(f,c),()=>{window.removeEventListener("storage",b),window.removeEventListener(f,c)}}function l(a){j=a;try{localStorage.setItem(e,JSON.stringify(a))}catch{}window.dispatchEvent(new Event(f))}function m(){let a=(0,d.useSyncExternalStore)(k,g,i),b=(0,d.useCallback)(b=>a.includes(b),[a]),c=(0,d.useCallback)(a=>{let b=[],c=b.indexOf(a);c>=0?b.splice(c,1):b.unshift(a),l(b)},[]);return{pinnedFiles:a,isPinned:b,togglePin:c,reorderPins:(0,d.useCallback)(a=>{l(a)},[]),removePin:(0,d.useCallback)(a=>{l([].filter(b=>b!==a))},[])}}},29820:(a,b,c)=>{"use strict";c.d(b,{A:()=>C});var d=c(48249),e=c(67484),f=c(19099),g=c(98631),h=c(84248),i=c(69924),j=c(98971),k=c(90473),l=c(2188),m=c(10316),n=c(16651),o=c(17512),p=c(70366),q=c(95801),r=c(41861),s=c(44218),t=c(4140),u=c(78890),v=c(47223),w=c(86367),x=c(92464),y=c(29974),z=c(81285);function A({icon:a,title:b,prompt:c,tryLabel:e}){return(0,d.jsxs)("div",{className:"group flex items-center gap-2.5 px-4 py-1.5 hover:bg-muted/50 transition-colors rounded-sm mx-1",children:[(0,d.jsx)("span",{className:"text-muted-foreground shrink-0",children:a}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate flex-1",title:b,children:b}),(0,d.jsx)("button",{onClick:()=>(0,x.NH)(c,"user"),className:"opacity-0 group-hover:opacity-100 text-2xs px-2 py-0.5 rounded text-[var(--amber-text)] bg-[var(--amber-dim)] hover:opacity-80 transition-all duration-150 shrink-0",children:e})]})}let B={c1:(0,d.jsx)(g.A,{size:12}),c2:(0,d.jsx)(h.A,{size:12}),c3:(0,d.jsx)(i.A,{size:12}),c4:(0,d.jsx)(j.A,{size:12}),c5:(0,d.jsx)(k.A,{size:12}),c6:(0,d.jsx)(l.A,{size:12}),c7:(0,d.jsx)(m.A,{size:12}),c8:(0,d.jsx)(n.A,{size:12}),c9:(0,d.jsx)(o.A,{size:12})};function C({active:a,maximized:b,onMaximize:c}){let{t:g}=(0,v.Y)(),h=g.panels.discover,i=g.explore,j=g.panels.plugins,l=(0,f.useRouter)(),[m,n]=(0,e.useState)(!1),[o,x]=(0,e.useState)(!1),[,C]=(0,e.useState)(0),[D,E]=(0,e.useState)(new Set);(0,e.useRef)(!1);let F=(0,e.useCallback)((a,b)=>{(0,y.$7)(a,b),C(a=>a+1),window.dispatchEvent(new Event("renderer-state-changed"))},[]),G=(0,e.useCallback)(a=>{l.push(`/view/${a.split("/").map(encodeURIComponent).join("/")}`)},[l]),H=m?(0,y.MZ)():[],I=m?H.filter(a=>(0,y.pl)(a.id)).length:0;return(0,d.jsxs)("div",{className:`flex flex-col h-full ${a?"":"hidden"}`,children:[(0,d.jsx)(t.A,{title:h.title,maximized:b,onMaximize:c}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0",children:[(0,d.jsxs)("div",{className:"py-2",children:[(0,d.jsx)(u.G,{icon:(0,d.jsx)(k.A,{size:14,className:"text-[var(--amber)]"}),title:h.useCases,badge:(0,d.jsx)("span",{className:"text-2xs tabular-nums text-muted-foreground",children:w.LD.length}),href:"/explore"}),(0,d.jsx)(u.G,{icon:(0,d.jsx)(p.A,{size:14,className:"text-muted-foreground"}),title:h.pluginMarket,badge:(0,d.jsx)(u.M,{label:h.comingSoon})}),(0,d.jsx)(u.G,{icon:(0,d.jsx)(q.A,{size:14,className:"text-muted-foreground"}),title:h.skillMarket,badge:(0,d.jsx)(u.M,{label:h.comingSoon})}),(0,d.jsx)(u.G,{icon:(0,d.jsx)(r.A,{size:14,className:"text-muted-foreground"}),title:h.spaceTemplates,badge:(0,d.jsx)(u.M,{label:h.comingSoon})})]}),(0,d.jsx)("div",{className:"mx-4 border-t border-border"}),(0,d.jsxs)("div",{className:"py-2",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>x(a=>!a),className:"w-full flex items-center gap-1.5 px-4 py-1.5 text-left",children:[(0,d.jsx)(s.A,{size:11,className:`text-muted-foreground transition-transform duration-150 ${o?"":"-rotate-90"}`}),(0,d.jsx)(p.A,{size:13,className:"text-muted-foreground shrink-0"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-muted-foreground uppercase tracking-wider flex-1",children:j.title}),(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground tabular-nums",children:[I,"/",H.length]})]}),(0,d.jsx)("div",{className:`grid transition-[grid-template-rows] duration-200 ease-out ${o?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:(0,d.jsx)("div",{className:"overflow-hidden",...!o&&{inert:!0},children:H.map(a=>{let b=(0,y.pl)(a.id),c=!!a.entryPath&&D.has(a.entryPath),e=b&&a.entryPath&&c;return(0,d.jsxs)("div",{className:`flex items-center gap-2 px-4 py-1.5 mx-1 rounded-sm transition-colors ${e?"cursor-pointer hover:bg-muted/50":""} ${!b?"opacity-50":""}`,onClick:e?()=>G(a.entryPath):void 0,role:e?"link":void 0,tabIndex:e?0:void 0,onKeyDown:e?b=>{("Enter"===b.key||" "===b.key)&&(b.preventDefault(),G(a.entryPath))}:void 0,children:[(0,d.jsx)("span",{className:"text-sm shrink-0",suppressHydrationWarning:!0,children:a.icon}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate flex-1",title:a.name,children:a.name}),a.core?(0,d.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:j.core}):(0,d.jsx)("div",{onClick:a=>a.stopPropagation(),children:(0,d.jsx)(z.lM,{checked:b,onChange:b=>F(a.id,b),size:"sm"})})]},a.id)})})})]}),(0,d.jsx)("div",{className:"mx-4 border-t border-border"}),(0,d.jsxs)("div",{className:"py-2",children:[(0,d.jsx)("div",{className:"px-4 py-1.5",children:(0,d.jsx)("span",{className:"text-2xs font-medium text-muted-foreground uppercase tracking-wider",children:h.useCases})}),w.LD.map(a=>{var b;let c=(b=a.id,({c1:i.c1,c2:i.c2,c3:i.c3,c4:i.c4,c5:i.c5,c6:i.c6,c7:i.c7,c8:i.c8,c9:i.c9})[b]);return c?(0,d.jsx)(A,{icon:B[a.id]||(0,d.jsx)(k.A,{size:12}),title:c.title,prompt:c.prompt,tryLabel:h.tryIt},a.id):null})]})]})]})}},29974:(a,b,c)=>{"use strict";c.d(b,{$7:()=>g,MZ:()=>k,TS:()=>i,UG:()=>f,YB:()=>j,pl:()=>h});let d=[],e=new Set;function f(){}function g(a,b){let c=d.find(b=>b.id===a);c?.core||(b?e.delete(a):e.add(a))}function h(a){let b=d.find(b=>b.id===a);return!!b?.core||!e.has(a)}function i(a){d.find(b=>b.id===a.id)||d.push(a)}function j(a,b,c){if(c){let a=d.find(a=>a.id===c);return a&&h(a.id)?a:void 0}return d.find(c=>h(c.id)&&c.match({filePath:a,extension:b}))}function k(){return d.filter(a=>!a.appBuiltinFeature)}},30488:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AudioRenderer:()=>f});var d=c(48249),e=c(67484);function f({filePath:a}){let b=`/api/file/raw?path=${encodeURIComponent(a)}`,c=a.split("/").pop()??"audio",f=c.split(".").pop()?.toLowerCase()??"",[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(0),[k,l]=(0,e.useState)(null),m=(0,e.useCallback)(()=>{h(!1),j(a=>a+1)},[]);return(0,d.jsxs)("div",{className:"w-full flex flex-col items-center gap-6 py-12 px-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 text-xs text-[var(--text-secondary)]",children:[(0,d.jsx)("span",{className:"text-4xl opacity-40",children:"\uD83C\uDFB5"}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:c}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"uppercase opacity-60",children:f}),null!==k&&(0,d.jsx)("span",{children:k<1024?`${k} B`:k<1048576?`${(k/1024).toFixed(1)} KB`:`${(k/1048576).toFixed(1)} MB`})]})]})]}),g?(0,d.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm text-[var(--text-secondary)]",children:"Failed to load audio"}),(0,d.jsx)("button",{onClick:m,className:"text-xs px-3 py-1.5 rounded-md bg-[var(--bg-tertiary)] hover:bg-[var(--bg-hover)] transition-colors",children:"Retry"})]}):(0,d.jsx)("audio",{controls:!0,preload:"metadata",className:"w-full max-w-lg",onError:()=>h(!0),children:(0,d.jsx)("source",{src:b})},i)]})}},31168:(a,b,c)=>{"use strict";c.d(b,{TooltipProvider:()=>f});var d=c(48249),e=c(50530);function f({delay:a=0,...b}){return(0,d.jsx)(e.B,{"data-slot":"tooltip-provider",delay:a,...b})}},31442:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/lib/stores/LocaleStoreInit.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/lib/stores/LocaleStoreInit.tsx","default")},32056:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{default:()=>y,metadata:()=>z,viewport:()=>A});var e=c(5735),f=c(82204),g=c.n(f),h=c(10890),i=c.n(h),j=c(1256),k=c.n(j),l=c(57353),m=c.n(l);c(82704);var n=c(50953),o=c(5315),p=c(68533),q=c(31442),r=c(24387),s=c(32248),t=c(12978),u=c(90598),v=c(39219),w=c(65573);c(95351);var x=a([n]);n=(x.then?(await x)():x)[0];let z={title:"MindOS",description:"Personal knowledge base",icons:{icon:"/logo-square.svg",apple:"/icons/icon-192.png"},manifest:"/manifest.json",other:{"mobile-web-app-capable":"yes","apple-mobile-web-app-capable":"yes","apple-mobile-web-app-status-bar-style":"black-translucent"}},A={width:"device-width",initialScale:1,viewportFit:"cover"};async function y({children:a}){let b=[];try{b=(0,n.xY)()}catch(a){console.error("[RootLayout] Failed to load file tree:",a)}let c=await (0,w.UL)(),d=c.get("locale")?.value,f="en";return"zh"===d?f="zh":"en"!==d&&(f=((await (0,w.b3)()).get("Accept-Language")||"").includes("zh")?"zh":"en"),(0,e.jsxs)("html",{lang:f,suppressHydrationWarning:!0,children:[(0,e.jsxs)("head",{children:[(0,e.jsx)("meta",{name:"theme-color",content:"#c8873a"}),(0,e.jsx)("script",{dangerouslySetInnerHTML:{__html:"(function(){if(typeof Node!=='undefined'){var o=Node.prototype.removeChild;Node.prototype.removeChild=function(c){if(c.parentNode!==this){try{return o.call(c.parentNode,c)}catch(e){return c}}return o.call(this,c)};var i=Node.prototype.insertBefore;Node.prototype.insertBefore=function(n,r){if(r&&r.parentNode!==this){try{return i.call(r.parentNode,n,r)}catch(e){return i.call(this,n,null)}}return i.call(this,n,r)}}})();"}}),(0,e.jsx)("script",{dangerouslySetInnerHTML:{__html:"(function(){try{if(/electron/i.test(navigator.userAgent)&&/macintosh/i.test(navigator.userAgent)){document.documentElement.setAttribute('data-electron-mac','')}}catch(e){}})();"}}),(0,e.jsx)("script",{dangerouslySetInnerHTML:{__html:"(function(){try{var s=localStorage.getItem('theme');var dark=s&&s!=='system'?s==='dark':window.matchMedia('(prefers-color-scheme: dark)').matches;document.documentElement.classList.toggle('dark',dark);var cw=localStorage.getItem('content-width');if(cw)document.documentElement.style.setProperty('--content-width-override',cw);var pf=localStorage.getItem('prose-font');if(pf==='geist'){pf='inter';localStorage.setItem('prose-font','inter')}var fm={lora:'\"Lora\", Georgia, serif','ibm-plex-sans':'\"IBM Plex Sans\", sans-serif',inter:'var(--font-inter), sans-serif','ibm-plex-mono':'\"IBM Plex Mono\", monospace'};if(pf&&fm[pf])document.documentElement.style.setProperty('--prose-font-override',fm[pf]);var loc=localStorage.getItem('locale')||'system';var rl=loc==='system'?(navigator.language.startsWith('zh')?'zh':'en'):loc;window.__mindos_locale__=rl;document.documentElement.lang=rl==='zh'?'zh':'en';document.cookie='locale='+rl+';path=/;max-age=31536000;SameSite=Lax'}catch(e){}})();"}})]}),(0,e.jsxs)("body",{className:`${g().variable} ${i().variable} ${k().variable} ${m().variable} antialiased bg-background text-foreground`,suppressHydrationWarning:!0,children:[(0,e.jsx)(q.default,{ssrLocale:f}),(0,e.jsx)(p.TooltipProvider,{delay:300,children:(0,e.jsx)(r.default,{children:(0,e.jsx)(o.default,{fileTree:b,children:a})})}),(0,e.jsx)(s.default,{}),(0,e.jsx)(t.default,{}),(0,e.jsx)(u.default,{}),(0,e.jsx)(v.default,{})]})]})}d()}catch(a){d(a)}})},32248:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/ui/Toaster.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/Toaster.tsx","default")},32621:(a,b,c)=>{"use strict";c.d(b,{V:()=>e});var d=c(67484);function e(){let[a,b]=(0,d.useState)([]),[c,e]=(0,d.useState)(!1),[f,g]=(0,d.useState)(null),h=(0,d.useCallback)(async a=>{e(!0),g(null);try{let c=await fetch("/api/a2a/discover",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:a})}),d=await c.json();if(d.agent)return b(a=>a.some(a=>a.id===d.agent.id)?a.map(a=>a.id===d.agent.id?d.agent:a):[...a,d.agent]),d.agent;return g(d.error||"Discovery failed"),null}catch(a){return g(a.message),null}finally{e(!1)}},[]);return{agents:a,discovering:c,error:f,discover:h,remove:(0,d.useCallback)(a=>{b(b=>b.filter(b=>b.id!==a))},[]),refresh:(0,d.useCallback)(()=>{b([]),g(null)},[])}}},33046:(a,b,c)=>{Promise.resolve().then(c.bind(c,12978)),Promise.resolve().then(c.bind(c,24387)),Promise.resolve().then(c.bind(c,66913)),Promise.resolve().then(c.bind(c,59238)),Promise.resolve().then(c.bind(c,66874)),Promise.resolve().then(c.bind(c,43951)),Promise.resolve().then(c.bind(c,63112)),Promise.resolve().then(c.bind(c,60442)),Promise.resolve().then(c.bind(c,37718)),Promise.resolve().then(c.bind(c,92206)),Promise.resolve().then(c.bind(c,29406)),Promise.resolve().then(c.bind(c,45862)),Promise.resolve().then(c.bind(c,1394)),Promise.resolve().then(c.bind(c,18776)),Promise.resolve().then(c.bind(c,14986)),Promise.resolve().then(c.bind(c,83539)),Promise.resolve().then(c.bind(c,5315)),Promise.resolve().then(c.bind(c,32248)),Promise.resolve().then(c.bind(c,68533)),Promise.resolve().then(c.bind(c,90598)),Promise.resolve().then(c.bind(c,39219)),Promise.resolve().then(c.bind(c,31442))},33191:(a,b,c)=>{"use strict";c.d(b,{IX:()=>i,KW:()=>h,O0:()=>g,cn:()=>f,vr:()=>j});var d=c(99314),e=c(96862);function f(...a){return(0,e.QP)((0,d.$)(a))}function g(a){return a.split("/").map(encodeURIComponent).join("/")}function h(a,b){let c=Date.now()-a,d=Math.floor(c/6e4),e=Math.floor(c/36e5),f=Math.floor(c/864e5);return d<1?b.justNow:d<60?b.minutesAgo(d):e<24?b.hoursAgo(e):f<7?b.daysAgo(f):new Date(a).toLocaleDateString()}function i(a){let b=a.match(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}]+/u);return b?.[0]??""}function j(a){return a.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||a}},33627:(a,b,c)=>{Promise.resolve().then(c.bind(c,85034))},33827:(a,b,c)=>{"use strict";c.d(b,{A:()=>u});var d=c(48249),e=c(67484),f=c(74429),g=c(80600),h=c(19226),i=c(33407),j=c(95801),k=c(65255),l=c(65032),m=c(83654),n=c(40560),o=c(8455),p=c(31675),q=c(49681),r=c(46674);let s={kb:{icon:g.A,cls:"text-muted-foreground"},upload:{icon:h.A,cls:"text-muted-foreground"},image:{icon:i.A,cls:"text-muted-foreground"},skill:{icon:j.A,cls:"text-[var(--amber)]"},agent:{icon:k.A,cls:"text-muted-foreground"}},t={kb:"border-border bg-muted text-foreground",upload:"border-border bg-muted text-foreground",image:"border-border bg-muted text-foreground",skill:"border-[var(--amber)]/25 bg-[var(--amber)]/10 text-foreground",agent:"border-[var(--amber)]/25 bg-[var(--amber)]/10 text-foreground"};function u({path:a,onRemove:b,variant:c="kb",imageData:g,imageMime:h,status:i,error:j,truncatedInfo:k}){let[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!1),A=(0,e.useRef)(null),[B,C]=(0,e.useState)(null),[D,E]=(0,e.useState)(null),F="kb"===c&&a.endsWith("/"),G=F?a.slice(0,-1):a,H=G.split("/").pop()??G,I="kb"===c&&!F&&H.endsWith(".csv"),{icon:J,cls:K}=F?{icon:l.A,cls:"text-yellow-400"}:I?{icon:m.A,cls:"text-success"}:s[c],L=!!k,M=null,N="";"loading"===i?(M=n.A,N="text-muted-foreground animate-spin"):"error"===i?(M=o.A,N="text-destructive"):L?(M=p.A,N="text-[var(--amber)]"):"success"===i&&(M=q.A,N="text-emerald-500");let O="error"===i?"border-destructive/30 bg-destructive/5 text-foreground":L?"border-[var(--amber)]/30 bg-[var(--amber)]/5 text-foreground":t[c],P=null;if("error"===i&&j)P=j;else if(L){let a=k.totalChars>0?Math.round(k.includedChars/k.totalChars*100):0;P=`Document truncated — only ${a}% included (${Math.round(k.includedChars/1e3)}K / ${Math.round(k.totalChars/1e3)}K chars, ${k.totalPages} pages total)`}let Q=u&&B&&g&&h?(0,d.jsx)("div",{className:"fixed z-50 p-1 rounded-lg border border-border bg-card shadow-lg pointer-events-none",style:{left:B.left,bottom:window.innerHeight-B.top},children:(0,d.jsx)("img",{src:`data:${h};base64,${g}`,alt:H,className:"max-h-48 max-w-64 rounded object-contain"})}):null,R=w&&D&&P?(0,d.jsx)("div",{className:`fixed z-50 px-2.5 py-1.5 rounded-lg border bg-card text-xs shadow-lg pointer-events-none max-w-[280px] ${"error"===i?"border-destructive/20 text-destructive":"border-[var(--amber)]/20 text-[var(--amber-text)]"}`,style:{left:D.left,bottom:window.innerHeight-D.top},children:P}):null;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{ref:A,className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs border max-w-[220px] ${O}`,onMouseEnter:()=>{g&&v(!0),P&&x(!0)},onMouseLeave:()=>{v(!1),x(!1)},children:[(0,d.jsx)(J,{size:11,className:`${K} shrink-0`}),(0,d.jsx)("span",{className:"truncate",title:F?G:a,children:H}),M&&(0,d.jsx)(M,{size:10,className:`${N} shrink-0`}),(0,d.jsx)("button",{type:"button",onClick:b,"aria-label":`Remove ${H}`,className:"p-0.5 -mr-1 rounded hover:text-foreground transition-colors shrink-0 text-muted-foreground",children:(0,d.jsx)(r.A,{size:10})})]}),y&&Q&&(0,f.createPortal)(Q,document.body),y&&R&&(0,f.createPortal)(R,document.body)]})}},34545:(a,b,c)=>{"use strict";c.d(b,{P:()=>d,u:()=>e});let d=[{id:"telegram",name:"Telegram",icon:"\uD83D\uDCF1",guide:"1. Open Telegram → search @BotFather\n2. Send /newbot → follow prompts\n3. Copy the token below",purpose:"Receive MindOS notifications and quick updates in Telegram.",purposeZh:"通过 Telegram 接收 MindOS 的通知和快速更新。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"e.g. chat ID like 123456789 or -1001234567890",recipientExampleZh:"例如 123456789 或 -1001234567890 这样的 chat ID",fields:[{key:"bot_token",label:"Bot Token",placeholder:"123456789:AABBccDD-EeFfGgHh...",hint:"Format: number:alphanumeric"}]},{id:"feishu",name:"Feishu",icon:"\uD83D\uDC26",guide:"1. open.feishu.cn → Create App\n2. Credentials page → copy App ID & Secret\n3. Enable Bot capability + add permissions",guideUrl:"https://open.feishu.cn/",editHint:"Need to update credentials? Edit and save below — MindOS will reconnect automatically.",purpose:"Receive MindOS results in Feishu, or let users message the bot directly when conversations are enabled.",purposeZh:"通过飞书接收 MindOS 的结果;开启对话后,也可以让用户直接在飞书里给机器人发消息。",useCases:["Agent completion alerts","Error notifications","Test messages","Direct bot conversations in Feishu"],useCasesZh:["Agent 完成提醒","错误通知","测试消息","在飞书里直接与机器人对话"],recipientExample:"e.g. ou_xxx, oc_xxx, or a work email",recipientExampleZh:"例如 ou_xxx、oc_xxx,或企业邮箱",fields:[{key:"app_id",label:"App ID",placeholder:"CLI_XXXXXXXXXXXXXXXXX",hint:"From Credentials page on open.feishu.cn"},{key:"app_secret",label:"App Secret",placeholder:"XXXXXXXXXXXXXXXXXXXXXXXX",hint:"Keep this secret — do not share"}]},{id:"discord",name:"Discord",icon:"\uD83D\uDCAC",guide:"1. discord.com/developers → New Application\n2. Bot tab → Reset Token → copy\n3. Enable Message Content Intent",purpose:"Send MindOS updates into Discord channels and DMs.",purposeZh:"把 MindOS 的更新发送到 Discord 频道或私信。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"e.g. Discord channel or user ID",recipientExampleZh:"例如 Discord 频道 ID 或用户 ID",fields:[{key:"bot_token",label:"Bot Token",placeholder:"MTIxNzM..."}]},{id:"slack",name:"Slack",icon:"\uD83D\uDCBC",guide:"1. api.slack.com/apps → Create New App\n2. OAuth & Permissions → add chat:write scope\n3. Install to Workspace → copy Bot Token",purpose:"Route MindOS notifications into Slack channels and direct messages.",purposeZh:"把 MindOS 的通知发送到 Slack 频道或私信。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"e.g. Slack channel or user ID like C123... or U123...",recipientExampleZh:"例如 Slack 频道 ID 或用户 ID(如 C123... / U123...)",fields:[{key:"bot_token",label:"Bot Token",placeholder:"xoxb-xxxx-xxxx-xxxx",hint:"Starts with xoxb-"}]},{id:"wecom",name:"WeCom",icon:"\uD83C\uDFE2",guide:"1. Group chat → Add Robot → Custom\n2. Copy Webhook URL\n3. Extract the key parameter from URL",purpose:"Deliver MindOS notifications into WeCom group chats.",purposeZh:"把 MindOS 通知投递到企业微信群聊。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use your configured robot or WeCom target",recipientExampleZh:"使用你配置好的机器人或企业微信目标",fields:[{key:"webhook_key",label:"Webhook Key",placeholder:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",hint:"The key= value from webhook URL"}]},{id:"dingtalk",name:"DingTalk",icon:"\uD83D\uDD14",guide:"1. Group → Settings → Smart Assistant → Add Robot\n2. Select Custom (Webhook)\n3. Copy the full Webhook URL",purpose:"Push MindOS notifications into DingTalk groups.",purposeZh:"把 MindOS 通知发送到钉钉群。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use your configured DingTalk robot target",recipientExampleZh:"使用你配置好的钉钉机器人目标",fields:[{key:"webhook_url",label:"Webhook URL",placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",hint:"Full URL including access_token"}]},{id:"wechat",name:"WeChat",icon:"\uD83D\uDC9A",guide:"1. Visit ilinkai.weixin.qq.com\n2. Register & create a bot application\n3. QR login in the console → copy Bot Token from dashboard",purpose:"Send MindOS updates to WeChat via your configured bot.",purposeZh:"通过你配置好的机器人把 MindOS 更新发送到微信。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use the WeChat user or chat ID supported by your bot",recipientExampleZh:"使用你的机器人支持的微信用户或群聊 ID",fields:[{key:"bot_token",label:"Bot Token",placeholder:"wx_xxxxxxxxxxxxxxxx",hint:"From iLink Bot console after QR login"}]},{id:"qq",name:"QQ",icon:"\uD83D\uDC27",guide:"1. q.qq.com → Create Bot\n2. Development tab → copy App ID & Secret\n3. Add group/C2C intents as needed",purpose:"Deliver MindOS notifications through QQ bot channels.",purposeZh:"通过 QQ 机器人频道接收 MindOS 通知。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use the QQ openid or group_openid for your target",recipientExampleZh:"使用目标 QQ 的 openid 或 group_openid",fields:[{key:"app_id",label:"App ID",placeholder:"102xxxxxx"},{key:"app_secret",label:"App Secret",placeholder:"xxxxxxxxxxxxxxxxxxxxxxxx"}]}];function e(a){return d.find(b=>b.id===a)}},35559:(a,b,c)=>{"use strict";c.d(b,{f:()=>e});var d=c(99829);let e=(0,d.createServerReference)("60891e40262d55e4dc1a94c4bd6740297a48bad529",d.callServer,void 0,d.findSourceMapURL,"renameFileAction")},36161:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,60440,23)),Promise.resolve().then(c.t.bind(c,84342,23)),Promise.resolve().then(c.t.bind(c,82265,23)),Promise.resolve().then(c.t.bind(c,35421,23)),Promise.resolve().then(c.t.bind(c,61335,23)),Promise.resolve().then(c.t.bind(c,70664,23)),Promise.resolve().then(c.bind(c,74661))},36312:(a,b,c)=>{"use strict";c.d(b,{TS:()=>e,ow:()=>f});let d=[];function e(a){d.find(b=>b.id===a.id)||d.push(a)}function f(){return d}},36869:(a,b,c)=>{"use strict";c.d(b,{i:()=>e});var d=c(99829);let e=(0,d.createServerReference)("4023ae6b23cd15256a580477447f13bb16709020d3",d.callServer,void 0,d.findSourceMapURL,"deleteFileAction")},37718:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GraphRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call GraphRenderer() from the server but GraphRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/graph/GraphRenderer.tsx","GraphRenderer")},38957:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>n,bA:()=>l});var d=c(48249),e=c(67484),f=c(74429),g=c(22341),h=c(6079),i=c(42742),j=c(44218),k=c(47223);function l(){return"agent"}let m=["agent","chat"];function n({mode:a,onChange:b,disabled:c}){let{t:l}=(0,k.Y)(),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(null),r=(0,e.useRef)(null),s=(0,e.useRef)(null);(0,e.useCallback)(()=>{if(!r.current)return;let a=r.current.getBoundingClientRect(),b=a.top,c=b>window.innerHeight-a.bottom&&b>120?"up":"down";q({left:a.left,top:"up"===c?a.top-6:a.bottom+6,direction:c})},[]);let t=(0,e.useCallback)(a=>{b(a);try{localStorage.setItem("mindos-ask-mode",a)}catch{}o(!1)},[b]),u="chat"===a,v=(a,b)=>"chat"===a?(0,d.jsx)(g.A,{size:b,className:"shrink-0"}):(0,d.jsx)(h.A,{size:b,className:"shrink-0"}),w=a=>"chat"===a?l.ask.modeChat:l.ask.modeAgent,x=a=>"chat"===a?l.ask.modeChatHint:l.ask.modeAgentHint,y=n&&p?(0,d.jsx)("div",{ref:s,role:"listbox","aria-label":"Select mode",className:"fixed z-50 min-w-[200px] max-w-[260px] rounded-lg border border-border bg-card shadow-lg py-1 animate-in fade-in-0 zoom-in-95 duration-100",style:{left:p.left,..."up"===p.direction?{bottom:window.innerHeight-p.top}:{top:p.top}},children:m.map(b=>{let c=a===b;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":c,onClick:()=>t(b),className:"flex w-full items-center gap-2.5 px-3 py-2 text-xs text-left transition-colors hover:bg-muted",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:v(b,13)}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"font-medium",children:w(b)}),(0,d.jsx)("div",{className:"text-2xs text-muted-foreground mt-0.5",children:x(b)})]}),c&&(0,d.jsx)(i.A,{size:12,className:"shrink-0 text-[var(--amber)]"})]},b)})}):null;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{ref:r,type:"button",onClick:()=>{c||o(a=>!a)},disabled:c,className:`
|
|
52
|
+
`,children:[e&&(0,d.jsx)("span",{className:"absolute left-0 top-1/2 -translate-y-1/2 w-[2px] h-[18px] rounded-r-full bg-[var(--amber)]"}),(0,d.jsx)("span",{className:"shrink-0 flex items-center justify-center w-[18px]",children:a}),i,f&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"ml-2.5 text-sm whitespace-nowrap",children:b}),c&&(0,d.jsx)("span",{className:"ml-auto text-2xs text-muted-foreground/60 font-mono shrink-0",children:c})]})]})}function w({activePanel:a,onPanelChange:b,onEchoClick:c,onAgentsClick:w,onDiscoverClick:x,onWorkflowsClick:y,onSpacesClick:z,syncStatus:A,expanded:B,onExpandedChange:C,onSettingsClick:D,onSyncClick:E}){let F=(0,e.useRef)(0),G=(0,e.useRef)(null),{t:H}=(0,q.Y)(),I=(0,f.usePathname)(),J=(0,f.useRouter)(),K="/"===I,[L,M]=(0,e.useState)(!1),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(!1),R=(0,e.useCallback)(a=>{let b=Date.now();b-F.current<300||(F.current=b,a())},[]),S=(0,e.useCallback)(c=>{R(()=>b(a===c?null:c))},[a,b,R]),T=(0,r.Bq)(A,!1),U=B?u:t,V="off"!==T&&"synced"!==T?(0,d.jsx)("span",{className:`absolute ${B?"left-[26px] top-1.5":"top-1.5 right-1.5"} w-2 h-2 rounded-full ${r.BG[T]} ${"error"===T||"conflicts"===T?"animate-pulse":""}`}):void 0;return(0,d.jsxs)("aside",{className:"group hidden md:flex fixed top-0 left-0 h-screen z-[31] flex-col bg-background border-r border-border transition-[width] duration-200 ease-out",style:{width:`${U}px`},role:"toolbar","aria-label":"Navigation","aria-orientation":"vertical",children:[(0,d.jsxs)("div",{className:"flex flex-col h-full w-full overflow-hidden",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>{K?b("files"===a?null:"files"):(b("files"),J.push("/"))},className:`flex items-center ${B?"px-3 gap-2":"justify-center"} w-full h-[46px] shrink-0 transition-opacity cursor-pointer ${K?"opacity-100":"opacity-50 hover:opacity-80"}`,"aria-label":"MindOS Home",children:[(0,d.jsx)(s.A,{id:"rail",className:"w-7 h-3.5 shrink-0"}),B&&(0,d.jsx)("span",{className:"text-sm text-foreground font-brand whitespace-nowrap",children:"MindOS"})]}),(0,d.jsx)("div",{className:`${B?"mx-3":"mx-2"} border-t border-border`}),(0,d.jsxs)("div",{className:`flex flex-col ${B?"px-1.5":"items-center"} gap-1 py-2`,children:[(0,d.jsx)(v,{icon:(0,d.jsx)(g.A,{size:18}),label:H.sidebar.files,active:!K&&"files"===a,expanded:B,onClick:()=>z?R(z):S("files"),walkthroughId:"files-panel"}),N&&(0,d.jsx)(v,{icon:(0,d.jsx)(h.A,{size:18}),label:H.sidebar.echo,active:"echo"===a,expanded:B,onClick:()=>c?R(c):S("echo"),walkthroughId:"echo-panel"}),(0,d.jsx)(v,{icon:(0,d.jsx)(i.A,{size:18}),label:H.sidebar.searchTitle,shortcut:"⌘K",active:"search"===a,expanded:B,onClick:()=>S("search")}),(0,d.jsx)(v,{icon:(0,d.jsx)(j.A,{size:18}),label:H.sidebar.agents,active:"agents"===a,expanded:B,onClick:()=>w?R(w):S("agents"),walkthroughId:"agents-panel"}),P&&(0,d.jsx)(v,{icon:(0,d.jsx)(k.A,{size:18}),label:H.sidebar.workflows??"Flows",active:"workflows"===a,expanded:B,onClick:()=>y?R(y):S("workflows")})]}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsx)("div",{className:`${B?"mx-3":"mx-2"} border-t border-border`}),(0,d.jsx)("div",{className:`flex flex-col ${B?"px-1.5":"items-center"} gap-1 py-2`,children:(0,d.jsx)(v,{icon:(0,d.jsx)(l.A,{size:18}),label:H.sidebar.discover,active:"discover"===a,expanded:B,onClick:()=>x?R(x):S("discover")})}),(0,d.jsx)("div",{className:`${B?"mx-3":"mx-2"} border-t border-border`}),(0,d.jsxs)("div",{className:`flex flex-col ${B?"px-1.5":"items-center"} gap-1 py-2`,children:[(0,d.jsx)(v,{icon:(0,d.jsx)(m.A,{size:18}),label:H.sidebar.settingsTitle,shortcut:"⌘,",expanded:B,onClick:()=>R(D),badge:L?(0,d.jsx)("span",{className:`absolute ${B?"left-[26px] top-1.5":"top-1.5 right-1.5"} w-2 h-2 rounded-full bg-error`}):void 0}),A?.enabled&&A?.remote&&"(not configured)"!==A.remote&&(0,d.jsx)(v,{icon:(0,d.jsx)(n.A,{size:18}),label:H.sidebar.syncLabel,expanded:B,buttonRef:G,badge:V,onClick:()=>R(()=>{let a=G.current?.getBoundingClientRect();a&&E(a)})})]})]}),(0,d.jsx)("button",{onClick:()=>C(!B),className:" absolute right-0 top-1/2 -translate-y-1/2 translate-x-1/2 z-[32] w-5 h-5 rounded-full bg-card border border-border shadow-sm flex items-center justify-center opacity-0 group-hover:opacity-100 hover:!opacity-100 transition-opacity duration-200 text-muted-foreground hover:text-foreground hover:bg-muted focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-ring ","aria-label":B?"Collapse sidebar":"Expand sidebar",title:B?"Collapse":"Expand",children:B?(0,d.jsx)(o.A,{size:10}):(0,d.jsx)(p.A,{size:10})})]})}},4949:(a,b,c)=>{"use strict";c.d(b,{A:()=>x});var d=c(48249),e=c(67484),f=c(19099),g=c(97621),h=c(50567),i=c(22772),j=c(86588),k=c(40560),l=c(42742),m=c(6079),n=c(8455),o=c(45231),p=c(46674),q=c(47086),r=c(13481),s=c(44218),t=c(47223),u=c(33191),v=c(39624);function w(a,b){let c=a.fileImport;if(!b)return c.organizeProcessing;switch(b.stage){case"connecting":return c.organizeConnecting;case"analyzing":return c.organizeAnalyzing;case"reading":return c.organizeReading(b.detail);case"thinking":return c.organizeThinking;case"writing":return c.organizeWriting(b.detail);default:return c.organizeProcessing}}function x({aiOrganize:a,onDismiss:b,onCancel:c,onHistoryUpdate:x}){let{t:y}=(0,t.Y)(),z=(0,f.useRouter)(),A=y.fileImport,B="organizing"===a.phase,{elapsed:C,displayHint:D}=function(a,b){let[c,d]=(0,e.useState)(0),[f,g]=(0,e.useState)(!1);return(0,e.useRef)(Date.now()),{elapsed:c,displayHint:f?{stage:"thinking"}:b}}(0,a.stageHint),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(!1),K=(0,e.useRef)(null),L=(0,e.useRef)(null),M="done"===a.phase,N="error"===a.phase,O=B||M||N,P=a.changes.filter(a=>a.ok&&!a.undone).length,Q=(0,e.useCallback)(()=>{K.current&&clearTimeout(K.current),(M||N)&&(K.current=setTimeout(()=>{b()},18e4))},[M,N,b]),R=(0,e.useCallback)(()=>{Q()},[Q]),S=(0,e.useCallback)(async b=>{R(),J(!0);let c=await a.undoOne(b);J(!1),c&&(window.dispatchEvent(new Event("mindos:files-changed")),setTimeout(()=>{if(L.current){let c=a.changes.map(a=>({action:a.action,path:a.path,ok:a.ok,undone:a.path===b||a.undone})),d=c.every(a=>!a.ok||a.undone);(0,v.W8)(L.current,{files:c,status:d?"undone":"partial"}),x?.()}},0))},[a,R,x]),T=(0,e.useCallback)(async()=>{R(),J(!0);let b=await a.undoAll();J(!1),b>0&&(window.dispatchEvent(new Event("mindos:files-changed")),L.current&&((0,v.W8)(L.current,{files:a.changes.map(a=>({action:a.action,path:a.path,ok:a.ok,undone:!!a.ok||a.undone})),status:"undone"}),x?.()))},[a,R,x]),U=(0,e.useCallback)(a=>{R(),z.push(`/view/${(0,u.O0)(a)}`)},[z,R]),V=(0,e.useCallback)(()=>{b()},[b]);if(!O)return null;function W(b,c){let e=b.undone,f=a.canUndo(b.path),k=b.path.split("/").pop()??b.path;return(0,d.jsxs)("div",{className:`flex items-center gap-2 px-3 py-2 rounded-md text-sm transition-colors ${e?"bg-muted/30 opacity-50":"bg-muted/50"}`,children:[e?(0,d.jsx)(g.A,{size:14,className:"text-muted-foreground shrink-0"}):"create"===b.action?(0,d.jsx)(h.A,{size:14,className:"text-success shrink-0"}):(0,d.jsx)(i.A,{size:14,className:"text-[var(--amber)] shrink-0"}),(0,d.jsx)("span",{className:`truncate flex-1 ${e?"line-through text-muted-foreground":"text-foreground"}`,children:k}),e?(0,d.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:A.organizeUndone}):(0,d.jsx)("span",{className:`text-xs shrink-0 ${b.ok?"text-muted-foreground":"text-error"}`,children:b.ok?"create"===b.action?A.organizeCreated:A.organizeUpdated:A.organizeFailed}),f&&(0,d.jsx)("button",{type:"button",onClick:()=>S(b.path),disabled:I,className:"text-2xs text-muted-foreground/60 hover:text-foreground transition-colors shrink-0 px-1 disabled:opacity-40",title:A.organizeUndoOne,children:(0,d.jsx)(g.A,{size:12})}),b.ok&&!b.undone&&(0,d.jsx)("button",{type:"button",onClick:()=>U(b.path),className:"text-2xs text-muted-foreground/60 hover:text-[var(--amber)] transition-colors shrink-0 px-1",title:A.organizeViewFile,children:(0,d.jsx)(j.A,{size:12})})]},`${b.path}-${c}`)}function X(){return(0,d.jsxs)("div",{className:"flex items-center justify-end gap-3 px-4 py-3 border-t border-border",children:[M&&a.hasAnyUndoable&&(0,d.jsxs)("button",{onClick:T,disabled:I,className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors px-2 py-1.5 disabled:opacity-50",children:[I?(0,d.jsx)(k.A,{size:12,className:"animate-spin"}):(0,d.jsx)(g.A,{size:12}),A.organizeUndoAll]}),(0,d.jsxs)("button",{onClick:V,className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-all",children:[(0,d.jsx)(l.A,{size:12}),A.organizeDone]})]})}return G?(0,d.jsx)("div",{className:"fixed inset-0 z-50 overlay-backdrop flex items-center justify-center p-4",onClick:a=>{a.target===a.currentTarget&&H(!1)},children:(0,d.jsxs)("div",{className:"w-full max-w-xl max-h-[80vh] flex flex-col bg-card rounded-xl shadow-xl border border-border animate-in fade-in-0 zoom-in-95 duration-200",onClick:R,role:"dialog","aria-modal":"true","aria-label":A.organizeDetailTitle,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-5 pt-5 pb-3 shrink-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[B?(0,d.jsxs)("div",{className:"relative shrink-0",children:[(0,d.jsx)(m.A,{size:16,className:"text-[var(--amber)]"}),(0,d.jsx)(k.A,{size:10,className:"absolute -bottom-0.5 -right-0.5 text-[var(--amber)] animate-spin"})]}):M?(0,d.jsx)(l.A,{size:16,className:"text-success"}):(0,d.jsx)(n.A,{size:16,className:"text-error"}),(0,d.jsx)("h2",{className:"text-base font-semibold text-foreground",children:A.organizeDetailTitle}),B&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 tabular-nums",children:A.organizeElapsed(C)})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>H(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:A.organizeMinimizeModal,children:(0,d.jsx)(o.A,{size:14})}),(0,d.jsx)("button",{type:"button",onClick:V,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(p.A,{size:14})})]})]}),(0,d.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto px-5 pb-2 space-y-4",children:[B&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2.5 rounded-lg bg-[var(--amber-subtle)] border border-[var(--amber-dim)]",children:[(0,d.jsx)(k.A,{size:14,className:"text-[var(--amber)] animate-spin shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-foreground",children:w(y,D)})]}),a.sourceFileNames.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:A.organizeSourceFiles}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.sourceFileNames.map((a,b)=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-md bg-muted/60 text-xs text-foreground",children:[(0,d.jsx)(q.A,{size:11,className:"text-muted-foreground shrink-0"}),a]},b))})]}),(a.summary||B)&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:A.organizeSummaryLabel}),(0,d.jsx)("div",{className:"px-3 py-2.5 rounded-lg bg-muted/30 border border-border text-sm text-foreground leading-relaxed whitespace-pre-wrap",children:a.summary||A.organizeNoSummary})]}),a.changes.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-xs font-medium text-muted-foreground mb-1.5",children:A.organizeChangesLabel(a.changes.length)}),(0,d.jsx)("div",{className:"space-y-0.5",children:a.changes.map((a,b)=>W(a,b))})]}),N&&(0,d.jsx)("div",{className:"px-3 py-2.5 rounded-lg bg-error/5 border border-error/20 text-xs text-error",children:a.error})]}),(M||N)&&X()]})}):E&&(M||N)?(0,d.jsxs)("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 w-[420px] max-w-[calc(100vw-2rem)] bg-card border border-border rounded-xl shadow-xl animate-in fade-in-0 slide-in-from-bottom-2 duration-200",onClick:R,children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[M?(0,d.jsx)(l.A,{size:14,className:"text-success"}):(0,d.jsx)(n.A,{size:14,className:"text-error"}),(0,d.jsx)("span",{className:"text-xs font-medium text-foreground",children:M?A.organizeReviewTitle:A.organizeErrorTitle})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{type:"button",onClick:()=>{F(!1),H(!0)},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:A.organizeDetailTitle,children:(0,d.jsx)(r.A,{size:13})}),(0,d.jsx)("button",{type:"button",onClick:()=>F(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(s.A,{size:14})})]})]}),M&&(0,d.jsx)("div",{className:"max-h-[240px] overflow-y-auto p-2 space-y-0.5",children:a.changes.map((a,b)=>W(a,b))}),N&&(0,d.jsx)("div",{className:"p-4 text-center",children:(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:a.error})}),X()]}):(0,d.jsx)("div",{className:"fixed bottom-4 left-1/2 -translate-x-1/2 z-50 flex items-center gap-3 bg-card border border-border rounded-xl shadow-lg px-4 py-3 max-w-md animate-in fade-in-0 slide-in-from-bottom-2 duration-200",onClick:R,children:M?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(l.A,{size:16,className:"text-success shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate",children:A.organizeReviewDesc(P)}),a.changes.length>0&&(0,d.jsxs)("button",{type:"button",onClick:()=>{F(!0),R()},className:"flex items-center gap-1 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:[(0,d.jsx)(s.A,{size:12,className:"rotate-180"}),A.organizeExpand]}),(0,d.jsxs)("button",{type:"button",onClick:V,className:"flex items-center gap-1 text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:[(0,d.jsx)(l.A,{size:12}),A.organizeDone]})]}):N?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(n.A,{size:16,className:"text-error shrink-0"}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate",children:A.organizeError}),(0,d.jsx)("button",{type:"button",onClick:()=>{F(!0),R()},className:"text-xs font-medium text-[var(--amber)] hover:opacity-80 transition-colors shrink-0",children:A.organizeExpand}),(0,d.jsx)("button",{type:"button",onClick:V,className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",children:(0,d.jsx)(p.A,{size:14})})]}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"relative shrink-0",children:[(0,d.jsx)(m.A,{size:16,className:"text-[var(--amber)]"}),(0,d.jsx)(k.A,{size:10,className:"absolute -bottom-0.5 -right-0.5 text-[var(--amber)] animate-spin"})]}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate",children:w(y,D)}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 tabular-nums shrink-0",children:A.organizeElapsed(C)}),(0,d.jsx)("button",{type:"button",onClick:()=>{H(!0),R()},className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",title:A.organizeDetailTitle,children:(0,d.jsx)(r.A,{size:13})}),(0,d.jsx)("button",{type:"button",onClick:V,className:"text-muted-foreground/50 hover:text-muted-foreground transition-colors shrink-0",children:(0,d.jsx)(p.A,{size:14})})]})})}},5200:(a,b,c)=>{"use strict";c.d(b,{default:()=>g});var d=c(67484),e=c(47223),f=c(52610);function g({ssrLocale:a}){let b=(0,d.useRef)(!1);return b.current||(b.current=!0,e.D.getState().locale!==a&&e.D.setState({locale:a,t:f.D[a]})),null}},5315:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/ShellLayout.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ShellLayout.tsx","default")},6597:(a,b,c)=>{"use strict";c.d(b,{A:()=>j});var d=c(48249),e=c(67484),f=c(7309),g=c(83654),h=c(80600),i=c(93096);function j({results:a,selectedIndex:b,query:c,onSelect:j}){let k=(0,e.useRef)(null),l=(0,e.useRef)(null),[m,n]=(0,e.useState)(280);return 0===a.length?null:(0,d.jsxs)("div",{ref:l,className:"border border-border rounded-lg bg-card shadow-lg overflow-hidden",children:[(0,d.jsxs)("div",{className:"px-3 py-1.5 border-b border-border flex items-center gap-1.5",children:[(0,d.jsx)(f.A,{size:11,className:"text-muted-foreground/50"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-muted-foreground/70 uppercase tracking-wider",children:"Files"}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 ml-auto",children:a.length})]}),(0,d.jsx)("div",{ref:k,className:"overflow-y-auto",style:{maxHeight:m},children:a.map((a,e)=>{let f=a.split("/").pop()??a,k=a.split("/").slice(0,-1).join("/"),l=f.endsWith(".csv");return(0,d.jsxs)("button",{type:"button",onMouseDown:b=>{b.preventDefault(),j(a)},className:`w-full flex items-center gap-2 px-3 py-2 text-sm text-left transition-colors ${e===b?"bg-accent text-foreground":"text-muted-foreground hover:bg-muted"}`,children:[l?(0,d.jsx)(g.A,{size:13,className:"text-success shrink-0"}):(0,d.jsx)(h.A,{size:13,className:"text-muted-foreground shrink-0"}),(0,d.jsx)("span",{className:"truncate font-medium flex-1",title:f,children:(0,d.jsx)(i.A,{text:f,query:c})}),k&&(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 truncate max-w-[140px] shrink-0",title:k,children:(0,d.jsx)(i.A,{text:k,query:c})})]},a)})}),(0,d.jsxs)("div",{className:"px-3 py-1.5 border-t border-border flex gap-3 text-2xs text-muted-foreground/40 shrink-0",children:[(0,d.jsx)("span",{children:"↑↓ navigate"}),(0,d.jsx)("span",{children:"↵ select"}),(0,d.jsx)("span",{children:"ESC dismiss"})]})]})}},6732:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TimelineRenderer:()=>i});var d=c(48249),e=c(67484);let f=/(\d{4}[-/]\d{1,2}(?:[-/]\d{1,2})?|[A-Za-z]+ \d{4}|\d{4}年\d{1,2}月(?:\d{1,2}日)?)/;function g(a){return a.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`(.+?)`/g,'<code class="font-display" style="font-size:0.85em;padding:1px 5px;border-radius:4px;background:var(--muted)">$1</code>').replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,(a,b,c)=>`<span style="color:var(--amber);cursor:pointer" title="${b}">${c??b}</span>`).replace(/\[([^\]]+)\]\(([^)]+)\)/g,'<a href="$2" style="color:var(--amber)">$1</a>')}let h=[{bg:"rgba(200,135,58,0.12)",text:"var(--amber)"},{bg:"rgba(122,173,128,0.12)",text:"var(--success)"},{bg:"rgba(138,180,216,0.12)",text:"var(--tool-read)"},{bg:"rgba(200,160,216,0.12)",text:"var(--tool-search)"}];function i({content:a}){let b=(0,e.useMemo)(()=>(function(a){let b=a.split("\n"),c=[],d=null,e=[],g=()=>{let a,b;if(!d)return;let f=e.join("\n").trim();d.body=f,d.tags=(a=[],(b=f.match(/#([\w\u4e00-\u9fff]+)/g))&&a.push(...b.map(a=>a.slice(1))),[...new Set(a)]),c.push(d),d=null,e=[]};for(let a of b)if(!/^# /.test(a)){if(/^## /.test(a)){g();let b=a.slice(3).trim();d={heading:b,date:function(a){let b=f.exec(a);if(!b)return null;let c=new Date(b[1].replace(/[/年月]/g,"-").replace("日",""));return isNaN(c.getTime())?null:c}(b),body:"",tags:[]};continue}d&&e.push(a)}return g(),c})(a),[a]);return 0===b.length?(0,d.jsxs)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:13},children:["No timeline entries found. Add ",(0,d.jsx)("code",{style:{background:"var(--muted)",padding:"1px 6px",borderRadius:4},children:"## 2025-01-15"})," headings to create entries."]}):(0,d.jsxs)("div",{style:{maxWidth:720,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsx)("div",{style:{marginBottom:"1.5rem",display:"flex",alignItems:"center",gap:8},children:(0,d.jsxs)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:[b.length," ",1===b.length?"entry":"entries"]})}),(0,d.jsxs)("div",{style:{position:"relative",paddingLeft:28},children:[(0,d.jsx)("div",{style:{position:"absolute",left:6,top:8,bottom:8,width:1,background:"var(--border)"}}),b.map((a,b)=>(0,d.jsxs)("div",{style:{position:"relative",marginBottom:"1.5rem"},children:[(0,d.jsx)("div",{style:{position:"absolute",left:-22,top:10,width:9,height:9,borderRadius:"50%",background:a.date?"var(--amber)":"var(--border)",outline:a.date?"2px solid var(--amber-dim)":"none",zIndex:1}}),(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,padding:"14px 18px",transition:"border-color .15s"},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"baseline",justifyContent:"space-between",gap:12,flexWrap:"wrap",marginBottom:8},children:[(0,d.jsx)("span",{style:{fontWeight:600,fontSize:"0.9rem",color:"var(--foreground)"},children:a.heading}),a.date&&(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.7rem",color:"var(--muted-foreground)",opacity:.7,flexShrink:0},children:a.date.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})})]}),a.body&&(0,d.jsx)("div",{dangerouslySetInnerHTML:{__html:function(a){let b=a.split("\n"),c=[],d=!1,e=()=>{d&&(c.push("</ul>"),d=!1)};for(let a of b){let b=a.trimEnd();if(!b){e(),c.push("<br/>");continue}if(/^### /.test(b)){e(),c.push(`<h3 style="font-size:0.8rem;font-weight:600;color:var(--muted-foreground);text-transform:uppercase;letter-spacing:.06em;margin:.9em 0 .3em">${g(b.slice(4))}</h3>`);continue}if(/^- /.test(b)||/^\* /.test(b)){d||(c.push('<ul style="margin:.3em 0;padding-left:1.2em;list-style:disc">'),d=!0),c.push(`<li style="margin:.15em 0;font-size:.82rem;color:var(--foreground)">${g(b.slice(2))}</li>`);continue}if(/^\d+\. /.test(b)){d||(c.push('<ol style="margin:.3em 0;padding-left:1.2em">'),d=!0),c.push(`<li style="margin:.15em 0;font-size:.82rem;color:var(--foreground)">${g(b.replace(/^\d+\. /,""))}</li>`);continue}e(),c.push(`<p style="margin:.25em 0;font-size:.82rem;line-height:1.6;color:var(--foreground)">${g(b)}</p>`)}return e(),c.join("")}(a.body)}}),a.tags.length>0&&(0,d.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:5,marginTop:10},children:a.tags.map(a=>{let b=function(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)&65535;return h[b%h.length]}(a);return(0,d.jsxs)("span",{className:"font-display",style:{fontSize:"0.68rem",padding:"1px 8px",borderRadius:999,background:b.bg,color:b.text},children:["#",a]},a)})})]})]},b))]})]})}},7140:(a,b,c)=>{"use strict";c.d(b,{Y:()=>e});var d=c(99829);let e=(0,d.createServerReference)("400a0980a13528af448c3be2b2dd16b1b5c9246d7f",d.callServer,void 0,d.findSourceMapURL,"undoDeleteAction")},7974:(a,b,c)=>{"use strict";c.d(b,{f:()=>e});var d=c(99829);let e=(0,d.createServerReference)("609756b5490f196ddab99396fa6785c780400b0f8b",d.callServer,void 0,d.findSourceMapURL,"renameFileAction")},9311:(a,b,c)=>{"use strict";c.d(b,{BG:()=>l,jc:()=>q,Ay:()=>p,Bq:()=>k,ky:()=>o,bj:()=>n,dW:()=>m});var d=c(48249),e=c(67484),f=c(49681),g=c(2797),h=c(69924),i=c(95054),j=c(47223);function k(a,b){return b?"syncing":a&&a.enabled?a.lastError?"error":a.conflicts&&a.conflicts.length>0?"conflicts":parseInt(a.unpushed||"0",10)>0?"unpushed":"synced":"off"}c(81285);let l={synced:"bg-success",unpushed:"bg-yellow-500",conflicts:"bg-error",error:"bg-error",off:"bg-muted-foreground/40",syncing:"bg-blue-500"};function m(){let[a,b]=(0,e.useState)(null),[c,d]=(0,e.useState)(!1);return(0,e.useRef)(void 0),{status:a,loaded:c,fetchStatus:(0,e.useCallback)(async()=>{try{let a=await (0,i.n)("/api/sync");b(a)}catch{b(null)}finally{d(!0)}},[])}}function n(a){let[b,c]=(0,e.useState)(!1),[d,f]=(0,e.useState)(null),g=(0,e.useCallback)(async()=>{if(!b){c(!0),f(null);try{await (0,i.n)("/api/sync",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"now"})}),await a(),f("success")}catch{await a(),f("error")}finally{c(!1),setTimeout(()=>f(null),2500)}}},[b,a]);return{syncing:b,syncResult:d,syncNow:g}}function o(a,b,c){switch(a){case"syncing":{let a=c?.syncing??"Syncing...";return{label:a,tooltip:a}}case"synced":{let a=`${c?.synced??"Synced"} \xb7 ${function(a,b){if(!a)return(void 0)??"never";let c=Date.now()-new Date(a).getTime();if(c<6e4)return(void 0)??"just now";let d=Math.floor(c/6e4);if(c<36e5)return(void 0)??`${d}m ago`;let e=Math.floor(c/36e5);if(c<864e5)return(void 0)??`${e}h ago`;let f=Math.floor(c/864e5);return(void 0)??`${f}d ago`}(b?.lastSync)}`;return{label:a,tooltip:a}}case"unpushed":{let a=parseInt(b?.unpushed||"0",10);return{label:`${a} ${c?.unpushed??"awaiting push"}`,tooltip:c?.unpushedHint??`${a} commit(s) not yet pushed to remote`}}case"conflicts":{let a=b?.conflicts?.length||0;return{label:`${a} ${c?.conflicts??"conflicts"}`,tooltip:c?.conflictsHint??`${a} file(s) have merge conflicts — resolve in Settings > Sync`}}case"error":return{label:c?.syncError??"Sync error",tooltip:b?.lastError||(c?.syncError??"Sync error")};default:{let a=c?.syncOff??"Sync off";return{label:a,tooltip:a}}}}function p({collapsed:a,onOpenSyncSettings:b}){let{status:c,loaded:i,fetchStatus:p}=m(),{syncing:q,syncResult:r,syncNow:s}=n(p),[t,u]=(0,e.useState)(null);(0,e.useRef)("off");let[v,w]=(0,e.useState)(()=>!1),{t:x}=(0,j.Y)();if(!function(a){let[,b]=(0,e.useState)(0)}(0),!i||a)return null;let y=k(c,q);if("off"===y){if(v)return null;let a=x.sidebar?.sync;return(0,d.jsxs)("div",{className:"hidden md:flex items-center justify-between px-4 py-1.5 border-t border-border text-xs text-muted-foreground shrink-0 animate-in fade-in duration-300",children:[(0,d.jsxs)("button",{onClick:b,className:"flex items-center gap-2 min-w-0 hover:text-foreground transition-colors truncate",title:a?.enableHint??"Set up cross-device sync",children:[(0,d.jsx)("span",{className:"w-2 h-2 rounded-full shrink-0 bg-muted-foreground/40"}),(0,d.jsxs)("span",{className:"truncate",children:[a?.enableSync??"Enable sync"," →"]})]}),(0,d.jsx)("button",{onClick:a=>{a.stopPropagation();try{localStorage.setItem("sync-hint-dismissed","1")}catch(a){console.warn("[SyncStatusBar] localStorage write dismissed:",a)}w(!0)},className:"p-1 rounded hover:bg-muted hover:text-foreground transition-colors shrink-0 ml-2 text-muted-foreground/50 hover:text-muted-foreground",title:"Dismiss",children:(0,d.jsx)("span",{className:"text-2xs",children:"✕"})})]})}let z=x.sidebar?.sync,{label:A,tooltip:B}=o(y,c,z);return(0,d.jsxs)("div",{className:"hidden md:flex items-center justify-between px-4 py-1.5 border-t border-border text-xs text-muted-foreground shrink-0 animate-in fade-in duration-300",children:[(0,d.jsxs)("button",{onClick:b,className:"flex items-center gap-2 min-w-0 hover:text-foreground transition-colors truncate",title:B,children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full shrink-0 ${l[y]} ${"syncing"===y||"conflicts"===y?"animate-pulse":""}`}),(0,d.jsx)("span",{className:"truncate",children:t||A})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0 ml-2",children:[("success"===r||t)&&(0,d.jsx)(f.A,{size:12,className:"text-success animate-in fade-in duration-200"}),"error"===r&&(0,d.jsx)(g.A,{size:12,className:"text-error animate-in fade-in duration-200"}),(0,d.jsx)("button",{onClick:a=>{a.stopPropagation(),s()},disabled:q,className:"p-1 rounded hover:bg-muted hover:text-foreground transition-colors disabled:opacity-40",title:z?.syncNow??"Sync now",children:(0,d.jsx)(h.A,{size:12,className:q?"animate-spin":""})})]})]})}function q({status:a,syncing:b}){let c=k(a,b??!1);return"off"===c||"synced"===c?null:(0,d.jsx)("span",{className:`w-1.5 h-1.5 rounded-full ${l[c]} ${"conflicts"===c||"error"===c?"animate-pulse":""}`})}},10072:(a,b,c)=>{"use strict";c.d(b,{AI:()=>e,RS:()=>d});let d=["imprint","growth","self"],e={imprint:"/echo/imprint",growth:"/echo/growth",self:"/echo/self"}},10500:(a,b,c)=>{"use strict";function d(){return null}c.d(b,{default:()=>d}),c(67484)},10927:(a,b,c)=>{"use strict";function d(a,b=!0){}c.d(b,{r:()=>d}),c(67484)},12978:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/app/register-sw.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/app/register-sw.tsx","default")},13859:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{$:()=>i});var e=c(67484),f=c(61112),g=c(92464),h=a([f]);function i(){let[a,b]=(0,e.useState)(!1),[c,d]=(0,e.useState)(f.eX),[h,i]=(0,e.useState)("panel"),[j,k]=(0,e.useState)(!1),[l,m]=(0,e.useState)(""),[n,o]=(0,e.useState)(!1);(0,e.useRef)(!1).current=n;let[p,q]=(0,e.useState)("user"),[r,s]=(0,e.useState)(null),t=(0,e.useRef)(f.eX);(0,g.KT)();let u=(0,e.useCallback)(()=>{"popup"===h?k(a=>(a||(m(""),q("user"),s(null)),!a)):b(a=>(a||(m(""),q("user"),s(null)),!a))},[h]),v=(0,e.useCallback)(()=>{b(!1),n&&(d(t.current),o(!1))},[n]),w=(0,e.useCallback)(()=>{o(a=>(a?d(t.current):t.current=c,!a))},[c]),x=(0,e.useCallback)(()=>k(!1),[]),y=(0,e.useCallback)(a=>d(a),[]),z=(0,e.useCallback)(a=>{try{localStorage.setItem("right-ask-panel-width",String(a))}catch{}},[]),A=(0,e.useCallback)(()=>{i(a=>{let c="panel"===a?"popup":"panel";try{localStorage.setItem("ask-mode",c),window.dispatchEvent(new StorageEvent("storage",{key:"ask-mode",newValue:c}))}catch{}return"popup"===c?(b(!1),k(!0)):(k(!1),b(!0)),c})},[]);return{askPanelOpen:a,askPanelWidth:c,askMaximized:n,askMode:h,desktopAskPopupOpen:j,askInitialMessage:l,askOpenSource:p,askAcpAgent:r,toggleAskPanel:u,closeAskPanel:v,closeDesktopAskPopup:x,handleAskWidthChange:y,handleAskWidthCommit:z,handleAskModeSwitch:A,toggleAskMaximized:w}}f=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},14986:(a,b,c)=>{"use strict";c.r(b),c.d(b,{VideoRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call VideoRenderer() from the server but VideoRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/video/VideoRenderer.tsx","VideoRenderer")},15330:(a,b,c)=>{"use strict";c.d(b,{Q:()=>e});var d=c(67484);function e(){let[a,b]=(0,d.useState)([]),[c,e]=(0,d.useState)(null),[f,g]=(0,d.useState)([]),[h,i]=(0,d.useState)(0);(0,d.useCallback)(()=>{fetch("/api/files").then(a=>a.ok?a.json():[]).then(a=>Array.isArray(a)?a:[]).catch(()=>[]).then(b)},[]);let j=(0,d.useCallback)((b,c)=>{let d=c??b.length,f=b.slice(0,d),h=f.lastIndexOf("@");if(-1===h||h>0&&" "!==f[h-1]&&"\n"!==f[h-1])return void e(null);let j=f.slice(h+1);if(j.includes(" ")||j.includes("\n")){e(null),g([]),i(0);return}let k=j.toLowerCase();if(!k){e(j),g(a.slice(0,30)),i(0);return}let l=a.map(a=>{let b=(a.split("/").pop()??a).toLowerCase(),c=a.toLowerCase(),d=0;return b.startsWith(k)?d=100:b.includes(k)?d=50:c.includes(k)&&(d=10),{path:a,score:d}}).filter(a=>a.score>0).sort((a,b)=>b.score-a.score).slice(0,30);if(0===l.length){e(null),g([]),i(0);return}e(j),g(l.map(a=>a.path)),i(0)},[a]),k=(0,d.useCallback)(a=>{0!==f.length&&("down"===a?i(a=>Math.min(a+1,f.length-1)):i(a=>Math.max(a-1,0)))},[f.length]);return{mentionQuery:c,mentionResults:f,mentionIndex:h,updateMentionFromInput:j,navigateMention:k,resetMention:(0,d.useCallback)(()=>{e(null),g([]),i(0)},[])}}},17009:(a,b,c)=>{"use strict";c.d(b,{z:()=>f});var d=c(67484);let e="mindos:acp-detection";function f(){let a=(0,d.useRef)(function(){try{let a=sessionStorage.getItem(e);if(!a)return null;let b=JSON.parse(a);if("number"!=typeof b.ts||Date.now()-b.ts>18e5)return null;return b}catch{return null}}()),[b,c]=(0,d.useState)(a.current?.installed??[]),[f,g]=(0,d.useState)(a.current?.notInstalled??[]),[h,i]=(0,d.useState)(!a.current),[j,k]=(0,d.useState)(null),[l,m]=(0,d.useState)(0);(0,d.useRef)(!1);let n=(0,d.useRef)(!1);return{installedAgents:b,notInstalledAgents:f,loading:h,error:j,refresh:(0,d.useCallback)(()=>{try{sessionStorage.removeItem(e)}catch{}a.current=null,n.current=!0,m(a=>a+1)},[])}}},18329:(a,b,c)=>{"use strict";c.d(b,{av:()=>k,kr:()=>i,oc:()=>j,u_:()=>l,zd:()=>h});var d=c(31417),e=c(95054);let f=null;async function g(a){f?.abort();let b=new AbortController;f=b;try{let[c,d,f]=await Promise.all([(0,e.n)("/api/mcp/status",{signal:b.signal}),(0,e.n)("/api/mcp/agents",{signal:b.signal}),(0,e.n)("/api/skills",{signal:b.signal})]);b.signal.aborted||a({status:c,agents:d.agents,skills:f.skills})}catch(a){if(a instanceof DOMException&&"AbortError"===a.name)return}finally{b.signal.aborted||a({loading:!1})}}let h=(0,d.v)((a,b)=>({status:null,agents:[],skills:[],loading:!0,refresh:()=>g(a),toggleSkill:async(c,d)=>{a({skills:b().skills.map(a=>a.name===c?{...a,enabled:d}:a)});try{return await (0,e.n)("/api/skills",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"toggle",name:c,enabled:d})}),!0}catch{return a({skills:b().skills.map(a=>a.name===c?{...a,enabled:!d}:a)}),!1}},installAgent:async(c,d)=>{let f=b().agents.find(a=>a.key===c);if(!f)return!1;try{let b=await (0,e.n)("/api/mcp/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:[{key:c,scope:d?.scope??(f.hasProjectScope?"project":"global"),transport:d?.transport??f.preferredTransport}],transport:"auto"})}),h=b.results?.[0],i=h?.ok===!0||h?.status==="ok";return i&&await g(a),i}catch{return!1}},_init:()=>{let b;g(a);let c=()=>{clearTimeout(b),b=setTimeout(()=>g(a),500)};window.addEventListener("mindos:skills-changed",c);let d=setInterval(()=>{"visible"===document.visibilityState&&g(a)},3e4);return()=>{f?.abort(),clearTimeout(b),clearInterval(d),window.removeEventListener("mindos:skills-changed",c)}}}));function i(){return h()}let j=()=>h(a=>a.agents),k=()=>h(a=>a.status),l=()=>h(a=>a.installAgent)},18776:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TodoRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call TodoRenderer() from the server but TodoRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/todo/TodoRenderer.tsx","TodoRenderer")},20892:(a,b,c)=>{"use strict";c.d(b,{A:()=>e});var d=c(48249);function e({id:a,className:b="w-8 h-4"}){return(0,d.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 40",fill:"none",className:`${b} text-[var(--amber)]`,"aria-hidden":"true",children:[(0,d.jsxs)("defs",{children:[(0,d.jsxs)("linearGradient",{id:`grad-human-${a}`,x1:"35",y1:"20",x2:"5",y2:"20",gradientUnits:"userSpaceOnUse",children:[(0,d.jsx)("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.8"}),(0,d.jsx)("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"0.3"})]}),(0,d.jsxs)("linearGradient",{id:`grad-agent-${a}`,x1:"35",y1:"20",x2:"75",y2:"20",gradientUnits:"userSpaceOnUse",children:[(0,d.jsx)("stop",{offset:"0%",stopColor:"currentColor",stopOpacity:"0.8"}),(0,d.jsx)("stop",{offset:"100%",stopColor:"currentColor",stopOpacity:"1"})]})]}),(0,d.jsx)("path",{d:"M35,20 C25,35 8,35 8,20 C8,5 25,5 35,20",stroke:`url(#grad-human-${a})`,strokeWidth:"3",strokeDasharray:"2 4",strokeLinecap:"round"}),(0,d.jsx)("path",{d:"M35,20 C45,2 75,2 75,20 C75,38 45,38 35,20",stroke:`url(#grad-agent-${a})`,strokeWidth:"4.5",strokeLinecap:"round"}),(0,d.jsx)("path",{d:"M35,17.5 Q35,20 37.5,20 Q35,20 35,22.5 Q35,20 32.5,20 Q35,20 35,17.5 Z",fill:"#FEF3C7"})]})}},21245:(a,b,c)=>{"use strict";c.d(b,{g:()=>d});let d=[{anchor:"files-panel",position:"right"},{anchor:"ask-button",position:"bottom"},{anchor:"agents-panel",position:"right"}]},21416:(a,b,c)=>{"use strict";c.r(b),c.d(b,{PdfRenderer:()=>f});var d=c(48249),e=c(67484);function f({filePath:a}){let b=`/api/file/raw?path=${encodeURIComponent(a)}`,[c,f]=(0,e.useState)(!0),[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(0),k=(0,e.useCallback)(()=>{h(!1),f(!0),j(a=>a+1)},[]);return(0,d.jsxs)("div",{className:"w-full h-full min-h-[80vh] flex flex-col relative",children:[c&&!g&&(0,d.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-[var(--bg-secondary)] rounded-lg z-10",children:(0,d.jsx)("span",{className:"text-sm text-[var(--text-tertiary)] animate-pulse",children:"Loading PDF..."})}),g&&(0,d.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center bg-[var(--bg-secondary)] rounded-lg z-10 gap-2",children:[(0,d.jsx)("span",{className:"text-sm text-[var(--text-secondary)]",children:"Failed to load PDF"}),(0,d.jsx)("button",{onClick:k,className:"text-xs px-3 py-1.5 rounded-md bg-[var(--bg-tertiary)] hover:bg-[var(--bg-hover)] transition-colors",children:"Retry"})]}),(0,d.jsx)("iframe",{src:b,className:"w-full flex-1 min-h-[80vh] border-0 rounded-lg bg-[var(--bg-secondary)]",title:a.split("/").pop()??"PDF",onLoad:()=>f(!1),onError:()=>{f(!1),h(!0)},style:{display:g?"none":"block"}},i)]})}},23017:(a,b,c)=>{"use strict";c.d(b,{A:()=>h});var d=c(48249),e=c(67484),f=c(46674),g=c(47223);function h(){let[a,b]=(0,e.useState)(!1),{t:c}=(0,g.Y)(),h=c.shortcutPanel,i="u">typeof navigator&&/Mac|iPhone|iPad/.test(navigator.userAgent)?"⌘":"Ctrl",j=(0,e.useMemo)(()=>[{keys:`${i} K`,label:h.toggleSearch,section:h.navigation},{keys:`${i} /`,label:h.toggleAskAI,section:h.navigation},{keys:`${i} ,`,label:h.openSettings,section:h.navigation},{keys:`${i} ?`,label:h.keyboardShortcuts,section:h.navigation},{keys:"Esc",label:h.closePanel,section:h.panelsSection},{keys:`${i} S`,label:h.saveFile,section:h.editor},{keys:`${i} Z`,label:h.undo,section:h.editor},{keys:`${i} Shift Z`,label:h.redo,section:h.editor}],[i,h]);if(!a)return null;let k=[...new Set(j.map(a=>a.section))];return(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center modal-backdrop",onClick:a=>a.target===a.currentTarget&&b(!1),children:(0,d.jsxs)("div",{role:"dialog","aria-modal":"true","aria-label":h.title,className:"w-full max-w-md mx-4 bg-card border border-border rounded-xl shadow-2xl overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-5 py-3.5 border-b border-border",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:h.title}),(0,d.jsx)("button",{onClick:()=>b(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,d.jsx)(f.A,{size:15})})]}),(0,d.jsx)("div",{className:"px-5 py-4 space-y-4 max-h-[60vh] overflow-y-auto",children:k.map(a=>(0,d.jsxs)("div",{children:[(0,d.jsx)("h3",{className:"text-[11px] font-medium text-muted-foreground uppercase tracking-wider mb-2",children:a}),(0,d.jsx)("div",{className:"space-y-1",children:j.filter(b=>b.section===a).map(a=>(0,d.jsxs)("div",{className:"flex items-center justify-between py-1.5",children:[(0,d.jsx)("span",{className:"text-xs text-foreground",children:a.label}),(0,d.jsx)("div",{className:"flex items-center gap-1",children:a.keys.split(" ").map((a,b)=>(0,d.jsx)("kbd",{className:"px-1.5 py-0.5 text-2xs rounded border border-border bg-muted text-muted-foreground font-mono min-w-[24px] text-center",children:a},b))})]},a.keys))})]},a))}),(0,d.jsx)("div",{className:"px-5 py-2.5 border-t border-border",children:(0,d.jsxs)("p",{className:"text-2xs text-muted-foreground/60",children:["Press ",(0,d.jsx)("kbd",{className:"px-1 py-0.5 text-2xs rounded border border-border bg-muted font-mono",children:i}),(0,d.jsx)("kbd",{className:"px-1 py-0.5 text-2xs rounded border border-border bg-muted font-mono ml-0.5",children:"?"})," ",h.toggleHint]})})]})})}},24387:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/ErrorBoundary.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ErrorBoundary.tsx","default")},27608:(a,b,c)=>{"use strict";c.d(b,{A:()=>j});var d=c(48249),e=c(67484),f=c(74429),g=c(42742),h=c(44218);function i(a){return"options"in a}function j({value:a,onChange:b,options:c,className:j="",size:k="md",placeholder:l}){let[m,n]=(0,e.useState)(!1),[o,p]=(0,e.useState)(-1),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=(0,e.useRef)(null),u=(0,e.useMemo)(()=>(function(a){let b=[];for(let c of a)i(c)?b.push(...c.options):b.push(c);return b})(c),[c]),v=(0,e.useMemo)(()=>u.find(b=>b.value===a)??null,[u,a]),w=(0,e.useCallback)(()=>{n(!1),p(-1)},[]),x=(0,e.useCallback)(a=>{b(a),w()},[b,w]);(0,e.useCallback)(()=>{if(!s.current)return;let a=s.current.getBoundingClientRect(),b="sm"===k?200:260,c=window.innerHeight-a.bottom,d=a.top;r({top:c<b+8&&d>c?a.top:a.bottom,left:a.left,width:a.width,flipUp:c<b+8&&d>c})},[k]);let y="sm"===k,z=y?`inline-flex items-center gap-1 appearance-none rounded-md border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors text-2xs px-1.5 py-0.5 pr-5 ${j}`:`w-full flex items-center gap-2 appearance-none rounded-lg border border-border bg-background text-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring transition-colors text-sm px-3 py-2 pr-8 ${j}`,A=y?"w-full flex items-center gap-1.5 px-2 py-1 text-2xs text-left transition-colors cursor-pointer":"w-full flex items-center gap-2 px-3 py-1.5 text-sm text-left transition-colors cursor-pointer",B=-1;function C(b){let c=++B,e=b.value===a,f=c===o;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":e,"data-idx":c,onClick:()=>x(b.value),onMouseEnter:()=>p(c),className:`${A} ${f?"bg-muted text-foreground":"text-foreground"}`,children:[b.icon,(0,d.jsx)("span",{className:"flex-1 truncate",children:b.label}),b.suffix,e&&(0,d.jsx)(g.A,{size:y?10:12,className:"shrink-0 text-[var(--amber)]"})]},b.value)}let D=m&&q&&(0,f.createPortal)((0,d.jsx)("div",{ref:t,className:y?"fixed z-50 overflow-y-auto rounded-md border border-border bg-card shadow-lg py-0.5":"fixed z-50 overflow-y-auto rounded-lg border border-border bg-card shadow-lg py-1",role:"listbox",style:{left:q.left,minWidth:q.width,maxHeight:y?200:260,...q.flipUp?{bottom:window.innerHeight-q.top+4}:{top:q.top+4}},children:c.map((a,b)=>i(a)?(0,d.jsxs)("div",{children:[b>0&&(0,d.jsx)("div",{className:"my-0.5 border-t border-border/50"}),(0,d.jsx)("div",{className:`py-1 text-2xs font-medium text-muted-foreground uppercase tracking-wider ${y?"px-2":"px-3"}`,children:a.label}),a.options.map(C)]},a.label):C(a))}),document.body);return(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsxs)("button",{ref:s,type:"button",onClick:()=>n(a=>!a),"aria-haspopup":"listbox","aria-expanded":m,className:z,children:[v?.icon,(0,d.jsx)("span",{className:"flex-1 truncate text-left",children:v?.label??l??"—"}),v?.suffix,(0,d.jsx)(h.A,{size:y?12:14,className:`${y?"absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none":"absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground pointer-events-none"} transition-transform duration-150 ${m?"rotate-180":""}`})]}),D]})}},29406:(a,b,c)=>{"use strict";c.r(b),c.d(b,{PdfRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call PdfRenderer() from the server but PdfRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/pdf/PdfRenderer.tsx","PdfRenderer")},29713:(a,b,c)=>{"use strict";c.d(b,{Z:()=>m});var d=c(67484);let e="mindos-pinned-files",f="mindos:pins-changed";function g(){return j}let h=[];function i(){return h}let j=[];function k(a){let b=b=>{b.key===e&&(j=[],a())},c=()=>{j=[],a()};return window.addEventListener("storage",b),window.addEventListener(f,c),()=>{window.removeEventListener("storage",b),window.removeEventListener(f,c)}}function l(a){j=a;try{localStorage.setItem(e,JSON.stringify(a))}catch{}window.dispatchEvent(new Event(f))}function m(){let a=(0,d.useSyncExternalStore)(k,g,i),b=(0,d.useCallback)(b=>a.includes(b),[a]),c=(0,d.useCallback)(a=>{let b=[],c=b.indexOf(a);c>=0?b.splice(c,1):b.unshift(a),l(b)},[]);return{pinnedFiles:a,isPinned:b,togglePin:c,reorderPins:(0,d.useCallback)(a=>{l(a)},[]),removePin:(0,d.useCallback)(a=>{l([].filter(b=>b!==a))},[])}}},29820:(a,b,c)=>{"use strict";c.d(b,{A:()=>C});var d=c(48249),e=c(67484),f=c(19099),g=c(98631),h=c(84248),i=c(69924),j=c(98971),k=c(90473),l=c(2188),m=c(10316),n=c(16651),o=c(17512),p=c(70366),q=c(95801),r=c(41861),s=c(44218),t=c(4140),u=c(78890),v=c(47223),w=c(86367),x=c(92464),y=c(29974),z=c(81285);function A({icon:a,title:b,prompt:c,tryLabel:e}){return(0,d.jsxs)("div",{className:"group flex items-center gap-2.5 px-4 py-1.5 hover:bg-muted/50 transition-colors rounded-sm mx-1",children:[(0,d.jsx)("span",{className:"text-muted-foreground shrink-0",children:a}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate flex-1",title:b,children:b}),(0,d.jsx)("button",{onClick:()=>(0,x.NH)(c,"user"),className:"opacity-0 group-hover:opacity-100 text-2xs px-2 py-0.5 rounded text-[var(--amber-text)] bg-[var(--amber-dim)] hover:opacity-80 transition-all duration-150 shrink-0",children:e})]})}let B={c1:(0,d.jsx)(g.A,{size:12}),c2:(0,d.jsx)(h.A,{size:12}),c3:(0,d.jsx)(i.A,{size:12}),c4:(0,d.jsx)(j.A,{size:12}),c5:(0,d.jsx)(k.A,{size:12}),c6:(0,d.jsx)(l.A,{size:12}),c7:(0,d.jsx)(m.A,{size:12}),c8:(0,d.jsx)(n.A,{size:12}),c9:(0,d.jsx)(o.A,{size:12})};function C({active:a,maximized:b,onMaximize:c}){let{t:g}=(0,v.Y)(),h=g.panels.discover,i=g.explore,j=g.panels.plugins,l=(0,f.useRouter)(),[m,n]=(0,e.useState)(!1),[o,x]=(0,e.useState)(!1),[,C]=(0,e.useState)(0),[D,E]=(0,e.useState)(new Set);(0,e.useRef)(!1);let F=(0,e.useCallback)((a,b)=>{(0,y.$7)(a,b),C(a=>a+1),window.dispatchEvent(new Event("renderer-state-changed"))},[]),G=(0,e.useCallback)(a=>{l.push(`/view/${a.split("/").map(encodeURIComponent).join("/")}`)},[l]),H=m?(0,y.MZ)():[],I=m?H.filter(a=>(0,y.pl)(a.id)).length:0;return(0,d.jsxs)("div",{className:`flex flex-col h-full ${a?"":"hidden"}`,children:[(0,d.jsx)(t.A,{title:h.title,maximized:b,onMaximize:c}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0",children:[(0,d.jsxs)("div",{className:"py-2",children:[(0,d.jsx)(u.G,{icon:(0,d.jsx)(k.A,{size:14,className:"text-[var(--amber)]"}),title:h.useCases,badge:(0,d.jsx)("span",{className:"text-2xs tabular-nums text-muted-foreground",children:w.LD.length}),href:"/explore"}),(0,d.jsx)(u.G,{icon:(0,d.jsx)(p.A,{size:14,className:"text-muted-foreground"}),title:h.pluginMarket,badge:(0,d.jsx)(u.M,{label:h.comingSoon})}),(0,d.jsx)(u.G,{icon:(0,d.jsx)(q.A,{size:14,className:"text-muted-foreground"}),title:h.skillMarket,badge:(0,d.jsx)(u.M,{label:h.comingSoon})}),(0,d.jsx)(u.G,{icon:(0,d.jsx)(r.A,{size:14,className:"text-muted-foreground"}),title:h.spaceTemplates,badge:(0,d.jsx)(u.M,{label:h.comingSoon})})]}),(0,d.jsx)("div",{className:"mx-4 border-t border-border"}),(0,d.jsxs)("div",{className:"py-2",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>x(a=>!a),className:"w-full flex items-center gap-1.5 px-4 py-1.5 text-left",children:[(0,d.jsx)(s.A,{size:11,className:`text-muted-foreground transition-transform duration-150 ${o?"":"-rotate-90"}`}),(0,d.jsx)(p.A,{size:13,className:"text-muted-foreground shrink-0"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-muted-foreground uppercase tracking-wider flex-1",children:j.title}),(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground tabular-nums",children:[I,"/",H.length]})]}),(0,d.jsx)("div",{className:`grid transition-[grid-template-rows] duration-200 ease-out ${o?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:(0,d.jsx)("div",{className:"overflow-hidden",...!o&&{inert:!0},children:H.map(a=>{let b=(0,y.pl)(a.id),c=!!a.entryPath&&D.has(a.entryPath),e=b&&a.entryPath&&c;return(0,d.jsxs)("div",{className:`flex items-center gap-2 px-4 py-1.5 mx-1 rounded-sm transition-colors ${e?"cursor-pointer hover:bg-muted/50":""} ${!b?"opacity-50":""}`,onClick:e?()=>G(a.entryPath):void 0,role:e?"link":void 0,tabIndex:e?0:void 0,onKeyDown:e?b=>{("Enter"===b.key||" "===b.key)&&(b.preventDefault(),G(a.entryPath))}:void 0,children:[(0,d.jsx)("span",{className:"text-sm shrink-0",suppressHydrationWarning:!0,children:a.icon}),(0,d.jsx)("span",{className:"text-xs text-foreground truncate flex-1",title:a.name,children:a.name}),a.core?(0,d.jsx)("span",{className:"text-2xs px-1.5 py-0.5 rounded bg-muted text-muted-foreground shrink-0",children:j.core}):(0,d.jsx)("div",{onClick:a=>a.stopPropagation(),children:(0,d.jsx)(z.lM,{checked:b,onChange:b=>F(a.id,b),size:"sm"})})]},a.id)})})})]}),(0,d.jsx)("div",{className:"mx-4 border-t border-border"}),(0,d.jsxs)("div",{className:"py-2",children:[(0,d.jsx)("div",{className:"px-4 py-1.5",children:(0,d.jsx)("span",{className:"text-2xs font-medium text-muted-foreground uppercase tracking-wider",children:h.useCases})}),w.LD.map(a=>{var b;let c=(b=a.id,({c1:i.c1,c2:i.c2,c3:i.c3,c4:i.c4,c5:i.c5,c6:i.c6,c7:i.c7,c8:i.c8,c9:i.c9})[b]);return c?(0,d.jsx)(A,{icon:B[a.id]||(0,d.jsx)(k.A,{size:12}),title:c.title,prompt:c.prompt,tryLabel:h.tryIt},a.id):null})]})]})]})}},29974:(a,b,c)=>{"use strict";c.d(b,{$7:()=>g,MZ:()=>k,TS:()=>i,UG:()=>f,YB:()=>j,pl:()=>h});let d=[],e=new Set;function f(){}function g(a,b){let c=d.find(b=>b.id===a);c?.core||(b?e.delete(a):e.add(a))}function h(a){let b=d.find(b=>b.id===a);return!!b?.core||!e.has(a)}function i(a){d.find(b=>b.id===a.id)||d.push(a)}function j(a,b,c){if(c){let a=d.find(a=>a.id===c);return a&&h(a.id)?a:void 0}return d.find(c=>h(c.id)&&c.match({filePath:a,extension:b}))}function k(){return d.filter(a=>!a.appBuiltinFeature)}},30488:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AudioRenderer:()=>f});var d=c(48249),e=c(67484);function f({filePath:a}){let b=`/api/file/raw?path=${encodeURIComponent(a)}`,c=a.split("/").pop()??"audio",f=c.split(".").pop()?.toLowerCase()??"",[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(0),[k,l]=(0,e.useState)(null),m=(0,e.useCallback)(()=>{h(!1),j(a=>a+1)},[]);return(0,d.jsxs)("div",{className:"w-full flex flex-col items-center gap-6 py-12 px-4",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 text-xs text-[var(--text-secondary)]",children:[(0,d.jsx)("span",{className:"text-4xl opacity-40",children:"\uD83C\uDFB5"}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-[var(--text-primary)]",children:c}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:"uppercase opacity-60",children:f}),null!==k&&(0,d.jsx)("span",{children:k<1024?`${k} B`:k<1048576?`${(k/1024).toFixed(1)} KB`:`${(k/1048576).toFixed(1)} MB`})]})]})]}),g?(0,d.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm text-[var(--text-secondary)]",children:"Failed to load audio"}),(0,d.jsx)("button",{onClick:m,className:"text-xs px-3 py-1.5 rounded-md bg-[var(--bg-tertiary)] hover:bg-[var(--bg-hover)] transition-colors",children:"Retry"})]}):(0,d.jsx)("audio",{controls:!0,preload:"metadata",className:"w-full max-w-lg",onError:()=>h(!0),children:(0,d.jsx)("source",{src:b})},i)]})}},31168:(a,b,c)=>{"use strict";c.d(b,{TooltipProvider:()=>f});var d=c(48249),e=c(50530);function f({delay:a=0,...b}){return(0,d.jsx)(e.B,{"data-slot":"tooltip-provider",delay:a,...b})}},31442:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/lib/stores/LocaleStoreInit.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/lib/stores/LocaleStoreInit.tsx","default")},32056:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.r(b),c.d(b,{default:()=>y,metadata:()=>z,viewport:()=>A});var e=c(5735),f=c(82204),g=c.n(f),h=c(10890),i=c.n(h),j=c(1256),k=c.n(j),l=c(57353),m=c.n(l);c(82704);var n=c(50953),o=c(5315),p=c(68533),q=c(31442),r=c(24387),s=c(32248),t=c(12978),u=c(90598),v=c(39219),w=c(65573);c(95351);var x=a([n]);n=(x.then?(await x)():x)[0];let z={title:"MindOS",description:"Personal knowledge base",icons:{icon:"/logo-square.svg",apple:"/icons/icon-192.png"},manifest:"/manifest.json",other:{"mobile-web-app-capable":"yes","apple-mobile-web-app-capable":"yes","apple-mobile-web-app-status-bar-style":"black-translucent"}},A={width:"device-width",initialScale:1,viewportFit:"cover"};async function y({children:a}){let b=[];try{b=(0,n.xY)()}catch(a){console.error("[RootLayout] Failed to load file tree:",a)}let c=await (0,w.UL)(),d=c.get("locale")?.value,f="en";return"zh"===d?f="zh":"en"!==d&&(f=((await (0,w.b3)()).get("Accept-Language")||"").includes("zh")?"zh":"en"),(0,e.jsxs)("html",{lang:f,suppressHydrationWarning:!0,children:[(0,e.jsxs)("head",{children:[(0,e.jsx)("meta",{name:"theme-color",content:"#c8873a"}),(0,e.jsx)("script",{dangerouslySetInnerHTML:{__html:"(function(){if(typeof Node!=='undefined'){var o=Node.prototype.removeChild;Node.prototype.removeChild=function(c){if(c.parentNode!==this){try{return o.call(c.parentNode,c)}catch(e){return c}}return o.call(this,c)};var i=Node.prototype.insertBefore;Node.prototype.insertBefore=function(n,r){if(r&&r.parentNode!==this){try{return i.call(r.parentNode,n,r)}catch(e){return i.call(this,n,null)}}return i.call(this,n,r)}}})();"}}),(0,e.jsx)("script",{dangerouslySetInnerHTML:{__html:"(function(){try{if(/electron/i.test(navigator.userAgent)&&/macintosh/i.test(navigator.userAgent)){document.documentElement.setAttribute('data-electron-mac','')}}catch(e){}})();"}}),(0,e.jsx)("script",{dangerouslySetInnerHTML:{__html:"(function(){try{var s=localStorage.getItem('theme');var dark=s&&s!=='system'?s==='dark':window.matchMedia('(prefers-color-scheme: dark)').matches;document.documentElement.classList.toggle('dark',dark);var cw=localStorage.getItem('content-width');if(cw)document.documentElement.style.setProperty('--content-width-override',cw);var pf=localStorage.getItem('prose-font');if(pf==='geist'){pf='inter';localStorage.setItem('prose-font','inter')}var fm={lora:'\"Lora\", Georgia, serif','ibm-plex-sans':'\"IBM Plex Sans\", sans-serif',inter:'var(--font-inter), sans-serif','ibm-plex-mono':'\"IBM Plex Mono\", monospace'};if(pf&&fm[pf])document.documentElement.style.setProperty('--prose-font-override',fm[pf]);var loc=localStorage.getItem('locale')||'system';var rl=loc==='system'?(navigator.language.startsWith('zh')?'zh':'en'):loc;window.__mindos_locale__=rl;document.documentElement.lang=rl==='zh'?'zh':'en';document.cookie='locale='+rl+';path=/;max-age=31536000;SameSite=Lax'}catch(e){}})();"}})]}),(0,e.jsxs)("body",{className:`${g().variable} ${i().variable} ${k().variable} ${m().variable} antialiased bg-background text-foreground`,suppressHydrationWarning:!0,children:[(0,e.jsx)(q.default,{ssrLocale:f}),(0,e.jsx)(p.TooltipProvider,{delay:300,children:(0,e.jsx)(r.default,{children:(0,e.jsx)(o.default,{fileTree:b,children:a})})}),(0,e.jsx)(s.default,{}),(0,e.jsx)(t.default,{}),(0,e.jsx)(u.default,{}),(0,e.jsx)(v.default,{})]})]})}d()}catch(a){d(a)}})},32248:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/ui/Toaster.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/Toaster.tsx","default")},32621:(a,b,c)=>{"use strict";c.d(b,{V:()=>e});var d=c(67484);function e(){let[a,b]=(0,d.useState)([]),[c,e]=(0,d.useState)(!1),[f,g]=(0,d.useState)(null),h=(0,d.useCallback)(async a=>{e(!0),g(null);try{let c=await fetch("/api/a2a/discover",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:a})}),d=await c.json();if(d.agent)return b(a=>a.some(a=>a.id===d.agent.id)?a.map(a=>a.id===d.agent.id?d.agent:a):[...a,d.agent]),d.agent;return g(d.error||"Discovery failed"),null}catch(a){return g(a.message),null}finally{e(!1)}},[]);return{agents:a,discovering:c,error:f,discover:h,remove:(0,d.useCallback)(a=>{b(b=>b.filter(b=>b.id!==a))},[]),refresh:(0,d.useCallback)(()=>{b([]),g(null)},[])}}},33046:(a,b,c)=>{Promise.resolve().then(c.bind(c,12978)),Promise.resolve().then(c.bind(c,24387)),Promise.resolve().then(c.bind(c,66913)),Promise.resolve().then(c.bind(c,59238)),Promise.resolve().then(c.bind(c,66874)),Promise.resolve().then(c.bind(c,43951)),Promise.resolve().then(c.bind(c,63112)),Promise.resolve().then(c.bind(c,60442)),Promise.resolve().then(c.bind(c,37718)),Promise.resolve().then(c.bind(c,92206)),Promise.resolve().then(c.bind(c,29406)),Promise.resolve().then(c.bind(c,45862)),Promise.resolve().then(c.bind(c,1394)),Promise.resolve().then(c.bind(c,18776)),Promise.resolve().then(c.bind(c,14986)),Promise.resolve().then(c.bind(c,83539)),Promise.resolve().then(c.bind(c,5315)),Promise.resolve().then(c.bind(c,32248)),Promise.resolve().then(c.bind(c,68533)),Promise.resolve().then(c.bind(c,90598)),Promise.resolve().then(c.bind(c,39219)),Promise.resolve().then(c.bind(c,31442))},33191:(a,b,c)=>{"use strict";c.d(b,{IX:()=>i,KW:()=>h,O0:()=>g,cn:()=>f,vr:()=>j});var d=c(99314),e=c(96862);function f(...a){return(0,e.QP)((0,d.$)(a))}function g(a){return a.split("/").map(encodeURIComponent).join("/")}function h(a,b){let c=Date.now()-a,d=Math.floor(c/6e4),e=Math.floor(c/36e5),f=Math.floor(c/864e5);return d<1?b.justNow:d<60?b.minutesAgo(d):e<24?b.hoursAgo(e):f<7?b.daysAgo(f):new Date(a).toLocaleDateString()}function i(a){let b=a.match(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}]+/u);return b?.[0]??""}function j(a){return a.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||a}},33627:(a,b,c)=>{Promise.resolve().then(c.bind(c,85034))},33827:(a,b,c)=>{"use strict";c.d(b,{A:()=>u});var d=c(48249),e=c(67484),f=c(74429),g=c(80600),h=c(19226),i=c(33407),j=c(95801),k=c(65255),l=c(65032),m=c(83654),n=c(40560),o=c(8455),p=c(31675),q=c(49681),r=c(46674);let s={kb:{icon:g.A,cls:"text-muted-foreground"},upload:{icon:h.A,cls:"text-muted-foreground"},image:{icon:i.A,cls:"text-muted-foreground"},skill:{icon:j.A,cls:"text-[var(--amber)]"},agent:{icon:k.A,cls:"text-muted-foreground"}},t={kb:"border-border bg-muted text-foreground",upload:"border-border bg-muted text-foreground",image:"border-border bg-muted text-foreground",skill:"border-[var(--amber)]/25 bg-[var(--amber)]/10 text-foreground",agent:"border-[var(--amber)]/25 bg-[var(--amber)]/10 text-foreground"};function u({path:a,onRemove:b,variant:c="kb",imageData:g,imageMime:h,status:i,error:j,truncatedInfo:k}){let[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!1),A=(0,e.useRef)(null),[B,C]=(0,e.useState)(null),[D,E]=(0,e.useState)(null),F="kb"===c&&a.endsWith("/"),G=F?a.slice(0,-1):a,H=G.split("/").pop()??G,I="kb"===c&&!F&&H.endsWith(".csv"),{icon:J,cls:K}=F?{icon:l.A,cls:"text-yellow-400"}:I?{icon:m.A,cls:"text-success"}:s[c],L=!!k,M=null,N="";"loading"===i?(M=n.A,N="text-muted-foreground animate-spin"):"error"===i?(M=o.A,N="text-destructive"):L?(M=p.A,N="text-[var(--amber)]"):"success"===i&&(M=q.A,N="text-emerald-500");let O="error"===i?"border-destructive/30 bg-destructive/5 text-foreground":L?"border-[var(--amber)]/30 bg-[var(--amber)]/5 text-foreground":t[c],P=null;if("error"===i&&j)P=j;else if(L){let a=k.totalChars>0?Math.round(k.includedChars/k.totalChars*100):0;P=`Document truncated — only ${a}% included (${Math.round(k.includedChars/1e3)}K / ${Math.round(k.totalChars/1e3)}K chars, ${k.totalPages} pages total)`}let Q=u&&B&&g&&h?(0,d.jsx)("div",{className:"fixed z-50 p-1 rounded-lg border border-border bg-card shadow-lg pointer-events-none",style:{left:B.left,bottom:window.innerHeight-B.top},children:(0,d.jsx)("img",{src:`data:${h};base64,${g}`,alt:H,className:"max-h-48 max-w-64 rounded object-contain"})}):null,R=w&&D&&P?(0,d.jsx)("div",{className:`fixed z-50 px-2.5 py-1.5 rounded-lg border bg-card text-xs shadow-lg pointer-events-none max-w-[280px] ${"error"===i?"border-destructive/20 text-destructive":"border-[var(--amber)]/20 text-[var(--amber-text)]"}`,style:{left:D.left,bottom:window.innerHeight-D.top},children:P}):null;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("span",{ref:A,className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs border max-w-[220px] ${O}`,onMouseEnter:()=>{g&&v(!0),P&&x(!0)},onMouseLeave:()=>{v(!1),x(!1)},children:[(0,d.jsx)(J,{size:11,className:`${K} shrink-0`}),(0,d.jsx)("span",{className:"truncate",title:F?G:a,children:H}),M&&(0,d.jsx)(M,{size:10,className:`${N} shrink-0`}),(0,d.jsx)("button",{type:"button",onClick:b,"aria-label":`Remove ${H}`,className:"p-0.5 -mr-1 rounded hover:text-foreground transition-colors shrink-0 text-muted-foreground",children:(0,d.jsx)(r.A,{size:10})})]}),y&&Q&&(0,f.createPortal)(Q,document.body),y&&R&&(0,f.createPortal)(R,document.body)]})}},34139:(a,b,c)=>{"use strict";c.d(b,{SQ:()=>D,Ld:()=>B,iP:()=>A,Ay:()=>E});var d=c(48249),e=c(67484),f=c(19099),g=c(24520),h=c(80600),i=c(86718),j=c(7817),k=c(84699),l=c(12417),m=c(24703),n=c(28330),o=c(96286),p=c(59347),q=c(41479),r=c(61075),s=c(88209),t=c(9311),u=c(4140),v=c(2548),w=c(47223),x=c(99829);x.callServer,x.findSourceMapURL;var y=c(1108);let z=()=>{},A=y.qQ,B=y.Dp.MIN,C=y.Dp.MAX_RATIO,D=y.Dp.MAX_ABS;function E({activePanel:a,fileTree:b,onNavigate:c,onOpenSyncSettings:x,railWidth:y=48,panelWidth:E,onWidthChange:F,onWidthCommit:G,maximized:H=!1,onMaximize:I,onImport:J,children:K}){let L=a?A[a]:280,M=H?void 0:E??L,{t:N}=(0,w.Y)(),O=(0,f.useRouter)(),P=(0,f.usePathname)(),Q="/view/Inbox"===P||"/view/Inbox/"===P,[R,S]=(0,e.useState)(null),T=(0,e.useMemo)(()=>(function a(b,c=0){let d=c;for(let e of b)"directory"===e.type&&(d=Math.max(d,a(e.children??[],c+1)));return d})(b),[b]),[U,V]=(0,e.useState)(!1),W=(0,e.useRef)(null),X=(0,e.useRef)(null),[Y,Z]=(0,e.useState)(!1),$=(0,e.useRef)(null),_=(0,e.useRef)(null),aa=(0,s.gL)(),[ab,ac]=(0,e.useState)(0),[ad,ae]=(0,e.useState)(0),[af,ag]=(0,e.useState)(!1),ah=(0,e.useCallback)(()=>{if(!af){ag(!0);try{localStorage.setItem("mindos-tree-dblclick-hint","1")}catch{}}},[af]),ai=(0,v._)({width:E??L,minWidth:B,maxWidth:D,maxWidthRatio:C,direction:"right",disabled:H,onResize:F??z,onResizeEnd:G??z});return(0,d.jsxs)("aside",{className:`
|
|
53
|
+
hidden md:flex fixed top-0 h-screen z-30
|
|
54
|
+
flex-col bg-card border-r border-border
|
|
55
|
+
transition-[transform,left,width] duration-200 ease-out
|
|
56
|
+
${null!==a?"translate-x-0":"-translate-x-full pointer-events-none"}
|
|
57
|
+
`,style:{width:H?`calc(100vw - ${y}px)`:`${M}px`,left:`${y}px`},role:"region","aria-label":a?`${a} panel`:void 0,children:[(0,d.jsxs)("div",{className:`flex flex-col h-full ${"files"===a?"":"hidden"}`,children:[(0,d.jsx)(u.A,{title:N.sidebar.files,children:(0,d.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("button",{ref:W,type:"button",onClick:()=>{Z(!1),V(a=>!a)},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.new,title:N.sidebar.new,children:(0,d.jsx)(g.A,{size:13})}),U&&(0,d.jsxs)("div",{ref:X,className:"absolute top-full right-0 mt-1 min-w-[152px] bg-card border border-border rounded-lg shadow-lg py-1 z-50",children:[(0,d.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:()=>{V(!1),O.push("/view/Untitled.md")},children:[(0,d.jsx)(h.A,{size:14,className:"shrink-0"}),N.sidebar.newFile]}),(0,d.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:()=>{V(!1),window.dispatchEvent(new Event("mindos:create-space"))},children:[(0,d.jsx)(i.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),N.sidebar.newSpace]})]})]}),(0,d.jsx)("button",{type:"button",onClick:()=>J?.(),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.importFile,title:N.sidebar.importFile,children:(0,d.jsx)(j.A,{size:13})}),(0,d.jsx)("div",{className:"w-px h-3.5 bg-border mx-0.5"}),(0,d.jsx)("button",{onClick:()=>S(a=>Math.max(-1,(a??T)-1)),onDoubleClick:()=>{S(-1),ah()},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.collapseLevel,title:af?N.sidebar.collapseLevel:N.sidebar.collapseLevelHint??N.sidebar.collapseLevel,children:(0,d.jsx)(k.A,{size:13})}),(0,d.jsx)("button",{onClick:()=>S(a=>{let b=(a??0)+1;return b>T?null:b}),onDoubleClick:()=>{S(null),ah()},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.expandLevel,title:af?N.sidebar.expandLevel:N.sidebar.expandLevelHint??N.sidebar.expandLevel,children:(0,d.jsx)(l.A,{size:13})}),(0,d.jsx)("div",{className:"w-px h-3.5 bg-border mx-0.5"}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("button",{ref:$,type:"button",onClick:()=>{V(!1),Z(a=>!a)},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.more,title:N.sidebar.more,children:(0,d.jsx)(m.A,{size:13})}),Y&&(0,d.jsxs)("div",{ref:_,className:"absolute top-full right-0 mt-1 min-w-[172px] bg-card border border-border rounded-lg shadow-lg py-1 z-50",children:[(0,d.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:()=>{Z(!1),O.push("/view/Inbox/")},children:[(0,d.jsx)(n.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),(0,d.jsx)("span",{className:"flex-1",children:N.sidebar.capture}),ad>0&&(0,d.jsx)("span",{className:"text-2xs font-medium tabular-nums px-1.5 py-px rounded-full bg-[var(--amber)]/10 text-[var(--amber)]/70",children:ad})]}),(0,d.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:()=>{Z(!1),O.push("/view/.mindos/change-log.json")},children:[(0,d.jsx)(o.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),(0,d.jsx)("span",{className:"flex-1",children:N.changes.title})]}),(0,d.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:()=>{Z(!1),O.push("/trash")},children:[(0,d.jsx)(p.A,{size:14,className:"shrink-0"}),(0,d.jsx)("span",{className:"flex-1",children:N.trash.title}),ab>0&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:ab})]}),(0,d.jsx)("div",{className:"my-1 border-t border-border/50"}),(0,d.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:()=>{(0,s.Fo)(!aa)},children:[aa?(0,d.jsx)(q.A,{size:14,className:"shrink-0"}):(0,d.jsx)(r.A,{size:14,className:"shrink-0"}),(0,d.jsx)("span",{className:"flex-1",children:N.sidebar.showHiddenFiles}),aa&&(0,d.jsx)("span",{className:"text-[var(--amber)] text-xs",children:"✓"})]})]})]})]})}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0 px-2 py-2",onDragEnter:a=>{a.dataTransfer.types.includes("Files")&&a.stopPropagation()},onDragOver:a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),a.stopPropagation())},onDrop:a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),a.stopPropagation())},children:(0,d.jsx)(s.Ay,{nodes:b,onNavigate:c,maxOpenDepth:R,onImport:J})}),(0,d.jsxs)("button",{type:"button",onClick:()=>O.push("/view/Inbox/"),className:`flex items-center gap-2 mx-2 px-2 py-1.5 text-sm rounded-lg transition-all duration-150 group shrink-0 ${Q?"bg-[var(--amber-dim)] text-[var(--amber)]":"hover:bg-muted text-muted-foreground hover:text-foreground"}`,children:[(0,d.jsx)("div",{className:`flex items-center justify-center w-5 h-5 rounded-md shrink-0 transition-colors ${Q?"bg-[var(--amber)]/15":"bg-transparent"}`,children:(0,d.jsx)(n.A,{size:13,className:`shrink-0 transition-colors ${Q?"text-[var(--amber)]":"text-[var(--amber)]/60 group-hover:text-[var(--amber)]"}`})}),(0,d.jsx)("span",{className:`flex-1 text-left text-xs transition-colors ${Q?"font-medium text-[var(--amber)]":"text-muted-foreground group-hover:text-foreground"}`,children:N.sidebar.capture}),ad>0&&(0,d.jsx)("span",{className:`text-2xs font-medium tabular-nums px-1.5 py-px rounded-full transition-colors ${Q?"bg-[var(--amber)]/15 text-[var(--amber)]":"bg-[var(--amber)]/10 text-[var(--amber)]/70"}`,children:ad})]}),(0,d.jsx)(t.Ay,{collapsed:!1,onOpenSyncSettings:x})]}),K,!H&&F&&(0,d.jsx)("div",{className:"absolute top-0 -right-[3px] w-[6px] h-full cursor-col-resize z-40 group hidden md:block",onMouseDown:ai,children:(0,d.jsx)("div",{className:"absolute right-[2px] top-0 w-[2px] h-full opacity-0 group-hover:opacity-100 bg-[var(--amber)]/60 transition-opacity"})})]})}},34545:(a,b,c)=>{"use strict";c.d(b,{P:()=>d,u:()=>e});let d=[{id:"telegram",name:"Telegram",icon:"\uD83D\uDCF1",guide:"1. Open Telegram → search @BotFather\n2. Send /newbot → follow prompts\n3. Copy the token below",purpose:"Receive MindOS notifications and quick updates in Telegram.",purposeZh:"通过 Telegram 接收 MindOS 的通知和快速更新。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"e.g. chat ID like 123456789 or -1001234567890",recipientExampleZh:"例如 123456789 或 -1001234567890 这样的 chat ID",fields:[{key:"bot_token",label:"Bot Token",placeholder:"123456789:AABBccDD-EeFfGgHh...",hint:"Format: number:alphanumeric"}]},{id:"feishu",name:"Feishu",icon:"\uD83D\uDC26",guide:"1. open.feishu.cn → Create App\n2. Credentials page → copy App ID & Secret\n3. Enable Bot capability + add permissions",guideUrl:"https://open.feishu.cn/",editHint:"Need to update credentials? Edit and save below — MindOS will reconnect automatically.",purpose:"Receive MindOS results in Feishu, or let users message the bot directly when conversations are enabled.",purposeZh:"通过飞书接收 MindOS 的结果;开启对话后,也可以让用户直接在飞书里给机器人发消息。",useCases:["Agent completion alerts","Error notifications","Test messages","Direct bot conversations in Feishu"],useCasesZh:["Agent 完成提醒","错误通知","测试消息","在飞书里直接与机器人对话"],recipientExample:"e.g. ou_xxx, oc_xxx, or a work email",recipientExampleZh:"例如 ou_xxx、oc_xxx,或企业邮箱",fields:[{key:"app_id",label:"App ID",placeholder:"CLI_XXXXXXXXXXXXXXXXX",hint:"From Credentials page on open.feishu.cn"},{key:"app_secret",label:"App Secret",placeholder:"XXXXXXXXXXXXXXXXXXXXXXXX",hint:"Keep this secret — do not share"}]},{id:"discord",name:"Discord",icon:"\uD83D\uDCAC",guide:"1. discord.com/developers → New Application\n2. Bot tab → Reset Token → copy\n3. Enable Message Content Intent",purpose:"Send MindOS updates into Discord channels and DMs.",purposeZh:"把 MindOS 的更新发送到 Discord 频道或私信。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"e.g. Discord channel or user ID",recipientExampleZh:"例如 Discord 频道 ID 或用户 ID",fields:[{key:"bot_token",label:"Bot Token",placeholder:"MTIxNzM..."}]},{id:"slack",name:"Slack",icon:"\uD83D\uDCBC",guide:"1. api.slack.com/apps → Create New App\n2. OAuth & Permissions → add chat:write scope\n3. Install to Workspace → copy Bot Token",purpose:"Route MindOS notifications into Slack channels and direct messages.",purposeZh:"把 MindOS 的通知发送到 Slack 频道或私信。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"e.g. Slack channel or user ID like C123... or U123...",recipientExampleZh:"例如 Slack 频道 ID 或用户 ID(如 C123... / U123...)",fields:[{key:"bot_token",label:"Bot Token",placeholder:"xoxb-xxxx-xxxx-xxxx",hint:"Starts with xoxb-"}]},{id:"wecom",name:"WeCom",icon:"\uD83C\uDFE2",guide:"1. Group chat → Add Robot → Custom\n2. Copy Webhook URL\n3. Extract the key parameter from URL",purpose:"Deliver MindOS notifications into WeCom group chats.",purposeZh:"把 MindOS 通知投递到企业微信群聊。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use your configured robot or WeCom target",recipientExampleZh:"使用你配置好的机器人或企业微信目标",fields:[{key:"webhook_key",label:"Webhook Key",placeholder:"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",hint:"The key= value from webhook URL"}]},{id:"dingtalk",name:"DingTalk",icon:"\uD83D\uDD14",guide:"1. Group → Settings → Smart Assistant → Add Robot\n2. Select Custom (Webhook)\n3. Copy the full Webhook URL",purpose:"Push MindOS notifications into DingTalk groups.",purposeZh:"把 MindOS 通知发送到钉钉群。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use your configured DingTalk robot target",recipientExampleZh:"使用你配置好的钉钉机器人目标",fields:[{key:"webhook_url",label:"Webhook URL",placeholder:"https://oapi.dingtalk.com/robot/send?access_token=...",hint:"Full URL including access_token"}]},{id:"wechat",name:"WeChat",icon:"\uD83D\uDC9A",guide:"1. Visit ilinkai.weixin.qq.com\n2. Register & create a bot application\n3. QR login in the console → copy Bot Token from dashboard",purpose:"Send MindOS updates to WeChat via your configured bot.",purposeZh:"通过你配置好的机器人把 MindOS 更新发送到微信。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use the WeChat user or chat ID supported by your bot",recipientExampleZh:"使用你的机器人支持的微信用户或群聊 ID",fields:[{key:"bot_token",label:"Bot Token",placeholder:"wx_xxxxxxxxxxxxxxxx",hint:"From iLink Bot console after QR login"}]},{id:"qq",name:"QQ",icon:"\uD83D\uDC27",guide:"1. q.qq.com → Create Bot\n2. Development tab → copy App ID & Secret\n3. Add group/C2C intents as needed",purpose:"Deliver MindOS notifications through QQ bot channels.",purposeZh:"通过 QQ 机器人频道接收 MindOS 通知。",useCases:["Agent completion alerts","Error notifications","Test messages"],useCasesZh:["Agent 完成提醒","错误通知","测试消息"],recipientExample:"Use the QQ openid or group_openid for your target",recipientExampleZh:"使用目标 QQ 的 openid 或 group_openid",fields:[{key:"app_id",label:"App ID",placeholder:"102xxxxxx"},{key:"app_secret",label:"App Secret",placeholder:"xxxxxxxxxxxxxxxxxxxxxxxx"}]}];function e(a){return d.find(b=>b.id===a)}},36161:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,60440,23)),Promise.resolve().then(c.t.bind(c,84342,23)),Promise.resolve().then(c.t.bind(c,82265,23)),Promise.resolve().then(c.t.bind(c,35421,23)),Promise.resolve().then(c.t.bind(c,61335,23)),Promise.resolve().then(c.t.bind(c,70664,23)),Promise.resolve().then(c.bind(c,74661))},36312:(a,b,c)=>{"use strict";c.d(b,{TS:()=>e,ow:()=>f});let d=[];function e(a){d.find(b=>b.id===a.id)||d.push(a)}function f(){return d}},37718:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GraphRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call GraphRenderer() from the server but GraphRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/graph/GraphRenderer.tsx","GraphRenderer")},38957:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>n,bA:()=>l});var d=c(48249),e=c(67484),f=c(74429),g=c(22341),h=c(6079),i=c(42742),j=c(44218),k=c(47223);function l(){return"agent"}let m=["agent","chat"];function n({mode:a,onChange:b,disabled:c}){let{t:l}=(0,k.Y)(),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(null),r=(0,e.useRef)(null),s=(0,e.useRef)(null);(0,e.useCallback)(()=>{if(!r.current)return;let a=r.current.getBoundingClientRect(),b=a.top,c=b>window.innerHeight-a.bottom&&b>120?"up":"down";q({left:a.left,top:"up"===c?a.top-6:a.bottom+6,direction:c})},[]);let t=(0,e.useCallback)(a=>{b(a);try{localStorage.setItem("mindos-ask-mode",a)}catch{}o(!1)},[b]),u="chat"===a,v=(a,b)=>"chat"===a?(0,d.jsx)(g.A,{size:b,className:"shrink-0"}):(0,d.jsx)(h.A,{size:b,className:"shrink-0"}),w=a=>"chat"===a?l.ask.modeChat:l.ask.modeAgent,x=a=>"chat"===a?l.ask.modeChatHint:l.ask.modeAgentHint,y=n&&p?(0,d.jsx)("div",{ref:s,role:"listbox","aria-label":"Select mode",className:"fixed z-50 min-w-[200px] max-w-[260px] rounded-lg border border-border bg-card shadow-lg py-1 animate-in fade-in-0 zoom-in-95 duration-100",style:{left:p.left,..."up"===p.direction?{bottom:window.innerHeight-p.top}:{top:p.top}},children:m.map(b=>{let c=a===b;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":c,onClick:()=>t(b),className:"flex w-full items-center gap-2.5 px-3 py-2 text-xs text-left transition-colors hover:bg-muted",children:[(0,d.jsx)("span",{className:"text-muted-foreground",children:v(b,13)}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("div",{className:"font-medium",children:w(b)}),(0,d.jsx)("div",{className:"text-2xs text-muted-foreground mt-0.5",children:x(b)})]}),c&&(0,d.jsx)(i.A,{size:12,className:"shrink-0 text-[var(--amber)]"})]},b)})}):null;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{ref:r,type:"button",onClick:()=>{c||o(a=>!a)},disabled:c,className:`
|
|
48
58
|
inline-flex items-center gap-1 rounded-full px-2.5 py-0.5
|
|
49
59
|
text-2xs font-medium transition-colors select-none
|
|
50
60
|
border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring
|
|
@@ -52,12 +62,7 @@ Be specific and actionable. Format in Markdown.`}(a,b,g)}],currentFile:c};h&&(i.
|
|
|
52
62
|
${u?"bg-muted/50 border-border/50 text-muted-foreground hover:bg-muted hover:text-foreground":"bg-[var(--amber)]/10 border-[var(--amber)]/25 text-foreground hover:bg-[var(--amber)]/15"}
|
|
53
63
|
`,title:x(a),"aria-expanded":n,"aria-haspopup":"listbox",children:[v(a,11),(0,d.jsx)("span",{className:"truncate max-w-[80px]",children:w(a)}),(0,d.jsx)(j.A,{size:10,className:"shrink-0 text-muted-foreground"})]}),"u">typeof document&&y&&(0,f.createPortal)(y,document.body)]})}},39219:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/components/UpdateToast.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/UpdateToast.tsx","default")},39624:(a,b,c)=>{"use strict";function d(){return[]}function e(a){}function f(a){let b=[];b.unshift(a);let c=b.slice(0,50);return e(c),c}function g(a,b){let c=[],d=c.findIndex(b=>b.id===a);return d>=0&&(c[d]={...c[d],...b},e(c)),c}function h(){}c.d(b,{D4:()=>f,FB:()=>d,W8:()=>g,g4:()=>h,jQ:()=>j});let i=0;function j(){return`org-${Date.now()}-${++i}`}},39868:(a,b,c)=>{"use strict";async function d(a){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(a),!0}catch{}try{let b=document.createElement("textarea");b.value=a,b.style.position="fixed",b.style.opacity="0",document.body.appendChild(b),b.select();let c=document.execCommand("copy");return document.body.removeChild(b),c}catch{return!1}}c.d(b,{l:()=>d})},41297:(a,b,c)=>{"use strict";c.d(b,{l:()=>h});var d=c(67484);let e=new Set([".txt",".md",".markdown",".csv",".json",".yaml",".yml",".xml",".html",".htm",".pdf"]);function f(a){let b=a.lastIndexOf(".");return b>=0?a.slice(b).toLowerCase():""}async function g(a){let b=a.name;try{let c=await a.arrayBuffer(),d=function(a){let b="";for(let c=0;c<a.length;c+=32768)b+=String.fromCharCode(...a.subarray(c,c+32768));return btoa(b)}(new Uint8Array(c)),e=await fetch("/api/extract-pdf",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:b,dataBase64:d})}),f={};try{f=await e.json()}catch{throw Error("Failed to parse extraction response")}if(!e.ok)throw Error(f.error||`PDF extraction failed (${e.status})`);if("error"===f.extracted)return{name:b,content:`[PDF: ${b}] Failed to extract text from this PDF.`,status:"error",error:f.extractionError||"PDF extraction failed (unable to parse PDF)"};let g="success"===f.extracted&&f.text||"";if(!g)return{name:b,content:`[PDF: ${b}] Could not extract readable text (possibly scanned/image PDF).`,status:"error",error:"No extractable text found — PDF may be scanned, image-only, or have no text content"};let h={name:b,content:`[PDF TEXT EXTRACTED: ${b}]
|
|
54
64
|
|
|
55
|
-
${g}`,status:"success"};return f.truncated&&f.totalChars&&(h.truncatedInfo={totalChars:f.totalChars,includedChars:g.length,totalPages:f.pagesParsed??0}),h}catch(a){return{name:b,content:`[PDF: ${b}] Failed to extract text from this PDF.`,status:"error",error:a instanceof Error?a.message:"Unknown error"}}}function h(a){let[b,c]=(0,d.useState)([]),[h,i]=(0,d.useState)(""),j=(0,d.useRef)(null),k=(0,d.useRef)(a);k.current=a;let l=(0,d.useCallback)(async a=>{if(!a||0===a.length)return;let b=Array.from(a).slice(0,8),d=[],h=[];for(let a of b){let b=f(a.name);e.has(b)?d.push(a):h.push(a.name)}if(h.length>0){let a=k.current?.unsupportedType??"Unsupported file type";i(`${a}: ${h.join(", ")}`)}else i("");let j=[],l=[];for(let a of d)".pdf"===f(a.name)?(l.push({name:a.name,content:"",status:"loading"}),j.push(a)):l.push({name:a.name,content:await a.text(),status:"success"});if(c(a=>{let b=[...a];for(let a of l)b.some(b=>b.name===a.name)||b.push(a);return b}),j.length>0){let a=await Promise.all(j.map(g));c(b=>b.map(b=>"loading"!==b.status?b:a.find(a=>a.name===b.name)??b))}},[]),m=(0,d.useCallback)(a=>{c(b=>b.filter((b,c)=>c!==a))},[]);return{localAttachments:b,uploadError:h,uploadInputRef:j,pickFiles:l,removeAttachment:m,clearAttachments:(0,d.useCallback)(()=>{c([]),i("")},[]),injectFiles:(0,d.useCallback)(a=>{c(b=>{let c=[...b];for(let b of a)c.some(a=>a.name===b.name)||c.push(b);return c})},[])}}},41739:(a,b,c)=>{"use strict";c.d(b,{A:()=>x});var d=c(48249),e=c(67484),f=c(74429),g=c(93017),h=c(42742),i=c(3129),j=c(12625),k=c(59347),l=c(96286),m=c(6079),n=c(44218),o=c(35389),p=c(45231),q=c(13481),r=c(92343),s=c(50514),t=c(46674),u=c(59867),v=c(47223),w=c(54461);let x=(0,e.memo)(function({isPanel:a,showHistory:b,onToggleHistory:c,onReset:x,isLoading:y,maximized:z,onMaximize:A,askMode:B,onModeSwitch:C,onClose:D,onDockToPanel:E,hideTitle:F,sessions:G,activeSessionId:H,onLoadSession:I,onDeleteSession:J,onRenameSession:K,onTogglePinSession:L,messages:M}){let{t:N}=(0,v.Y)(),O=G&&G.length>=2,P=G?.find(a=>a.id===H),Q=P?(0,w.d)(P):null,[R,S]=(0,e.useState)(!1),T=(0,e.useRef)(null),U=(0,e.useRef)(null),[V,W]=(0,e.useState)(null),[X,Y]=(0,e.useState)(""),Z=(0,e.useRef)(null),$=(0,e.useCallback)(a=>{I?.(a),S(!1)},[I]),_=(0,e.useCallback)((a,b)=>{W(a),Y("(empty session)"===b?"":b)},[]),aa=(0,e.useCallback)(()=>{V&&K&&X.trim()&&K(V,X.trim()),W(null)},[V,X,K]),[ab,ac]=(0,e.useState)(null),ad=R&&ab&&G?(0,f.createPortal)((0,d.jsx)("div",{ref:U,className:"fixed z-50 rounded-xl border border-border/50 bg-card shadow-lg py-1 animate-in fade-in-0 slide-in-from-top-1 duration-100 max-h-[60vh] overflow-y-auto",style:{top:ab.top,left:ab.left,minWidth:Math.max(ab.width,280),maxWidth:340},role:"listbox",children:G.map(a=>{let b=a.id===H,c=(0,w.d)(a),e="(empty session)"===c?N.hints?.newChat??"New chat":c;return V===a.id?(0,d.jsx)("div",{className:"flex items-center gap-1 px-2 py-1.5",children:(0,d.jsx)("input",{ref:Z,type:"text",value:X,onChange:a=>Y(a.target.value),onKeyDown:a=>{"Enter"===a.key&&aa(),"Escape"===a.key&&W(null)},onBlur:aa,className:"flex-1 min-w-0 px-2 py-1 text-xs rounded-md border border-border bg-background text-foreground outline-none focus-visible:border-[var(--amber)]/50",placeholder:"Session name..."})},a.id):(0,d.jsxs)("div",{className:"group/item flex items-center",children:[(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":b,onClick:()=>$(a.id),className:`flex-1 min-w-0 flex items-center gap-2 px-3 py-2.5 text-xs text-left transition-colors ${b?"text-foreground font-medium":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[a.pinned&&(0,d.jsx)(g.A,{size:10,className:"shrink-0 text-[var(--amber)]/60 -rotate-45"}),b&&!a.pinned&&(0,d.jsx)(h.A,{size:11,className:"shrink-0 text-[var(--amber)]"}),(0,d.jsx)("span",{className:"truncate",children:e})]}),(0,d.jsxs)("div",{className:"shrink-0 flex items-center gap-0.5 mr-1 opacity-0 group-hover/item:opacity-100 transition-opacity",children:[L&&(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),L(a.id)},className:`p-1.5 rounded-md transition-colors ${a.pinned?"text-[var(--amber)] hover:text-muted-foreground hover:bg-muted/60":"text-muted-foreground/40 hover:text-[var(--amber)] hover:bg-[var(--amber)]/5"}`,"aria-label":a.pinned?"Unpin":"Pin",children:a.pinned?(0,d.jsx)(i.A,{size:10}):(0,d.jsx)(g.A,{size:10})}),K&&(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),_(a.id,c)},className:"p-1.5 rounded-md text-muted-foreground/40 hover:text-foreground hover:bg-muted/60","aria-label":`Rename: ${e}`,children:(0,d.jsx)(j.A,{size:10})}),G.length>1&&J&&(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),J(a.id)},className:"p-1.5 rounded-md text-muted-foreground/40 hover:text-error hover:bg-error/5","aria-label":`Delete: ${e}`,children:(0,d.jsx)(k.A,{size:10})})]})]},a.id)})}),document.body):null;return(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 shrink-0",children:[!a&&(0,d.jsx)("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 w-8 h-1 rounded-full bg-muted-foreground/20 md:hidden"}),!F&&(0,d.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,d.jsx)("div",{className:"w-6 h-6 rounded-lg bg-[var(--amber)]/10 flex items-center justify-center shrink-0",children:b?(0,d.jsx)(l.A,{size:13,className:"text-[var(--amber)]"}):(0,d.jsx)(m.A,{size:13,className:"text-[var(--amber)]"})}),b?(0,d.jsx)("span",{className:"text-sm font-medium text-[var(--amber)]",children:N.ask?.sessionHistory??"Session History"}):O&&Q?(0,d.jsxs)("button",{ref:T,type:"button",onClick:()=>{G&&G.length>=2?S(a=>!a):c()},className:"flex items-center gap-1 min-w-0 text-sm font-medium text-[var(--amber)] hover:text-[var(--amber)]/80 transition-colors","aria-expanded":R,"aria-haspopup":"listbox",children:[(0,d.jsx)("span",{className:"truncate max-w-[180px]",children:"(empty session)"===Q?N.hints?.newChat??"New chat":Q}),(0,d.jsx)(n.A,{size:12,className:`shrink-0 text-muted-foreground transition-transform duration-150 ${R?"rotate-180":""}`})]}):Q?(0,d.jsx)("span",{className:"text-sm font-medium text-muted-foreground/60 truncate max-w-[180px]",children:"(empty session)"===Q?N.hints?.newChat??"New chat":Q}):(0,d.jsx)("span",{className:"text-sm font-medium text-muted-foreground/40",children:N.hints?.newChat??"New chat"})]}),F&&(0,d.jsx)("div",{}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),c()},"aria-pressed":b,className:`p-2 rounded-lg transition-colors ${b?"bg-[var(--amber)]/10 text-[var(--amber)]":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:N.hints.sessionHistory,children:(0,d.jsx)(l.A,{size:14})}),M&&M.length>0&&(0,d.jsx)(u.A,{messages:M,disabled:y}),(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),x()},disabled:y,className:"p-2 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors disabled:opacity-40",title:N.hints.newSession,children:(0,d.jsx)(o.A,{size:14})}),A&&(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),A()},className:"p-2 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:z?N.hints.restorePanel:N.hints.maximizePanel,children:z?(0,d.jsx)(p.A,{size:14}):(0,d.jsx)(q.A,{size:14})}),E&&(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),E()},className:"p-2 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:N.hints.dockToSide??"Dock to side panel",children:(0,d.jsx)(r.A,{size:14})}),C&&(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),C()},className:"p-2 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:"popup"===B?N.hints.dockToSide:N.hints.openAsPopup,children:"popup"===B?(0,d.jsx)(r.A,{size:14}):(0,d.jsx)(s.A,{size:14})}),D&&(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),D()},className:"p-2 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:N.hints.closePanel,"aria-label":"Close",children:(0,d.jsx)(t.A,{size:14})})]}),"u">typeof document&&ad]})})},41829:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ChangeLogRenderer:()=>D});var d=c(48249),e=c(67484),f=c(2116),g=c.n(f),h=c(82318),i=c(94703),j=c(11732),k=c(12625),l=c(15273),m=c(71465),n=c(95801),o=c(80600),p=c(65255),q=c(98631),r=c(66336),s=c(96286),t=c(56692),u=c(69924),v=c(10316),w=c(44218),x=c(19794),y=c(95054),z=c(47223),A=c(27608),B=c(91199);function C(){return(0,d.jsx)("div",{className:"rounded-lg border border-border bg-card overflow-hidden animate-pulse",children:(0,d.jsx)("div",{className:"px-4 py-3 space-y-2",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)("div",{className:"w-4 h-4 bg-muted rounded mt-1"}),(0,d.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,d.jsx)("div",{className:"h-5 bg-muted rounded w-2/3"}),(0,d.jsx)("div",{className:"h-3 bg-muted rounded w-full"})]})]})})})}function D(a){let{t:b}=(0,z.Y)(),[c,f]=(0,e.useState)("all"),[D,E]=(0,e.useState)(""),[F,G]=(0,e.useState)([]),[H,I]=(0,e.useState)({unreadCount:0,totalCount:0}),[J,K]=(0,e.useState)({}),[L,M]=(0,e.useState)(!0),[N,O]=(0,e.useState)(null),[P,Q]=(0,e.useState)(!1),R=(0,e.useCallback)(async()=>{M(!0),O(null);try{let a=new URLSearchParams({op:"list",limit:"120"});"all"!==c&&a.set("source",c),D.trim()&&a.set("q",D.trim());let[b,d]=await Promise.all([(0,y.n)(`/api/changes?${a.toString()}`),(0,y.n)("/api/changes?op=summary")]);G(b.events),I(d)}catch(a){O(a instanceof Error?a.message:String(a))}finally{M(!1)}},[c,D]),S=(0,e.useCallback)(async()=>{await (0,y.n)("/api/changes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"mark_seen"})}),await R()},[R]),T=(0,e.useMemo)(()=>[{value:"all",label:b.changes.filters.all},{value:"agent",label:b.changes.filters.agent},{value:"user",label:b.changes.filters.user},{value:"system",label:b.changes.filters.system}],[b]),U=(0,e.useCallback)(a=>"agent"===a?b.changes.filters.agent:"user"===a?b.changes.filters.user:b.changes.filters.system,[b]),V=(0,e.useCallback)(a=>b.changes.operations?.[a]??a,[b]);return(0,d.jsxs)("div",{style:{padding:"1.5rem 0"},children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4 mb-6",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("div",{className:"w-10 h-10 rounded-lg bg-[var(--amber)]/8 flex items-center justify-center shrink-0",children:(0,d.jsx)(s.A,{size:20,className:"text-[var(--amber)]"})}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("h1",{className:"text-xl font-semibold text-foreground tracking-tight",children:b.changes.title}),(0,d.jsx)("p",{className:"mt-1 text-sm text-muted-foreground leading-relaxed",children:b.changes.subtitle})]})]}),(0,d.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,d.jsx)("span",{className:"px-2.5 py-1 rounded-full bg-muted/60 text-muted-foreground text-xs font-medium",children:b.changes.eventsCount(F.length)}),H.unreadCount>0&&(0,d.jsx)("span",{className:"px-2.5 py-1 rounded-full bg-[var(--amber)]/10 text-[var(--amber)] text-xs font-medium border border-[var(--amber)]/20",children:b.changes.unreadCount(H.unreadCount)})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[(0,d.jsx)("button",{type:"button",onClick:()=>Q(a=>!a),className:`inline-flex items-center gap-1.5 px-3 py-2 rounded-lg text-xs font-medium transition-all duration-150 focus-visible:ring-2 focus-visible:ring-ring ${P?"bg-[var(--amber)]/10 text-[var(--amber)]":"bg-muted/50 text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:b.changes.filters.source,children:(0,d.jsx)(t.A,{size:14})}),(0,d.jsx)("button",{type:"button",onClick:()=>void R(),className:"inline-flex items-center gap-1.5 px-3 py-2 rounded-lg text-xs font-medium bg-muted/50 text-muted-foreground hover:text-foreground hover:bg-muted transition-all duration-150 focus-visible:ring-2 focus-visible:ring-ring",title:b.changes.refresh,children:(0,d.jsx)(u.A,{size:14})}),H.unreadCount>0&&(0,d.jsxs)("button",{type:"button",onClick:()=>void S(),className:"inline-flex items-center gap-1.5 px-3 py-2 rounded-lg text-xs font-medium bg-muted/50 text-muted-foreground hover:text-foreground hover:bg-muted transition-all duration-150 focus-visible:ring-2 focus-visible:ring-ring",title:b.changes.markAllRead,children:[(0,d.jsx)("span",{className:"hidden sm:inline",children:b.changes.markAllRead}),(0,d.jsx)("span",{className:"inline sm:hidden",children:"✓"})]})]})]}),(0,d.jsx)("div",{className:`grid transition-[grid-template-rows] duration-200 ease-out ${P?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:(0,d.jsx)("div",{className:"overflow-hidden",children:(0,d.jsx)("div",{className:"rounded-lg border border-border/60 bg-card/60 p-4 mb-4",children:(0,d.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground block mb-1.5",children:b.changes.filters.source}),(0,d.jsx)(A.A,{value:c,onChange:a=>f(a),options:T})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground block mb-1.5",children:b.changes.filters.keyword}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)(v.A,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground/50"}),(0,d.jsx)("input",{value:D,onChange:a=>E(a.target.value),placeholder:b.changes.filters.keywordPlaceholder,className:"w-full pl-9 pr-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground placeholder:text-muted-foreground/40 outline-none focus-visible:ring-1 focus-visible:ring-ring hover:border-border/80 transition-all"})]})]})]})})})}),L&&(0,d.jsxs)("div",{className:"space-y-2.5",children:[(0,d.jsx)(C,{}),(0,d.jsx)(C,{}),(0,d.jsx)(C,{})]}),!L&&N&&(0,d.jsxs)("div",{className:"rounded-lg border border-error/20 bg-error/5 p-4 text-sm text-error",children:[N,(0,d.jsx)("button",{onClick:()=>void R(),className:"ml-2 underline hover:no-underline font-medium",children:b.changes.refresh})]}),!L&&!N&&0===F.length&&(0,d.jsx)("div",{className:"rounded-lg border border-border/60 bg-card/60 p-8 md:p-12",children:(0,d.jsxs)("div",{className:"flex flex-col items-center text-center",children:[(0,d.jsx)("div",{className:"mb-4 p-4 bg-muted/50 rounded-lg",children:(0,d.jsx)(o.A,{size:28,className:"text-muted-foreground/60"})}),(0,d.jsx)("h3",{className:"text-base font-semibold text-foreground mb-1",children:b.changes.empty}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground max-w-sm",children:b.changes.emptyHint})]})}),!L&&!N&&F.length>0&&(0,d.jsx)("div",{className:"space-y-2",children:F.map(a=>{var c,e,f,s;let t,u,v=!!J[a.id],y=(0,B.m)(a.before??"",a.after??""),z=(0,B.S)(y),A=y.filter(a=>"insert"===a.type).length,C=y.filter(a=>"delete"===a.type).length;return(0,d.jsxs)("div",{className:"group rounded-lg border border-border/60 bg-card/70 overflow-hidden transition-all duration-150 hover:border-border hover:bg-card hover:shadow-sm",children:[(0,d.jsx)("button",{type:"button",onClick:()=>K(b=>({...b,[a.id]:!b[a.id]})),className:"w-full px-4 py-3 text-left focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring hover:bg-muted/20 transition-all",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsxs)("div",{className:"pt-0.5 text-muted-foreground/60 shrink-0 relative",children:[v&&(0,d.jsx)("div",{className:"absolute -left-4 top-0 bottom-0 w-[2px] rounded-r-full bg-[var(--amber)]"}),v?(0,d.jsx)(w.A,{size:15}):(0,d.jsx)(x.A,{size:15})]}),(0,d.jsx)("div",{className:"w-7 h-7 rounded-md bg-muted/50 flex items-center justify-center shrink-0 text-muted-foreground group-hover:bg-muted transition-all",children:"create_file"===(c=a.op)||"create_space"===c?(0,d.jsx)(h.A,{size:14}):"delete_file"===c?(0,d.jsx)(i.A,{size:14}):"update_lines"===c||"update_section"===c?(0,d.jsx)(j.A,{size:14}):"insert_lines"===c||"insert_after_heading"===c?(0,d.jsx)(k.A,{size:14}):"append_to_file"===c||"append_csv"===c?(0,d.jsx)(l.A,{size:14}):"rename_file"===c||"rename_space"===c||"move_file"===c?(0,d.jsx)(m.A,{size:14}):"import_file"===c?(0,d.jsx)(n.A,{size:14}):(0,d.jsx)(o.A,{size:14})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:function(a,b){let c=b.changes.summaries;if("Updated file content"===a)return c.updatedFileContent;if("Appended content to file"===a)return c.appendedContent;if("Moved to trash"===a)return c.movedToTrash;if("Created file"===a)return c.createdFile;if("Created space"===a)return c.createdSpace;if("Imported file into knowledge base"===a)return c.importedFile;let d=a.match(/^Inserted (\d+) line\(s\)$/);if(d)return c.insertedLines(Number(d[1]));let e=a.match(/^Updated lines (\d+)-(\d+)$/);if(e)return c.updatedLines(Number(e[1]),Number(e[2]));let f=a.match(/^Inserted content after heading "(.+)"$/);if(f)return c.insertedAfterHeading(f[1]);let g=a.match(/^Updated section "(.+)"$/);if(g)return c.updatedSection(g[1]);let h=a.match(/^Renamed file to (.+)$/);if(h)return c.renamedFile(h[1]);let i=a.match(/^Moved file to (.+)$/);if(i)return c.movedFile(i[1]);let j=a.match(/^Renamed space to (.+)$/);if(j)return c.renamedSpace(j[1]);let k=a.match(/^Appended CSV row \((\d+) cells?\)$/);return k?c.appendedCsvRow(Number(k[1])):a.startsWith("Imported legacy agent diff")?c.importedLegacyDiff:a}(a.summary,b)}),(A>0||C>0)&&(0,d.jsxs)("span",{className:"text-xs font-mono text-muted-foreground/70",children:[A>0&&(0,d.jsxs)("span",{className:"text-success font-semibold",children:["+",A]}),A>0&&C>0&&(0,d.jsx)("span",{className:"mx-0.5",children:"\xb7"}),C>0&&(0,d.jsxs)("span",{className:"text-error font-semibold",children:["-",C]})]})]}),(0,d.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[(0,d.jsx)("span",{className:"rounded-md px-2 py-0.5 bg-[var(--amber-dim)] text-[var(--amber)] text-xs font-medium truncate inline-block max-w-[200px]",title:a.path,children:a.path}),(0,d.jsxs)("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium ${"agent"===(e=a.source)?"bg-[var(--info)]/10 text-[var(--info)] border border-[var(--info)]/20":"user"===e?"bg-[var(--success)]/10 text-[var(--success)] border border-[var(--success)]/20":"bg-muted text-muted-foreground border border-border"} transition-colors`,children:["agent"===(f=a.source)?(0,d.jsx)(p.A,{size:13}):"user"===f?(0,d.jsx)(q.A,{size:13}):(0,d.jsx)(r.A,{size:13}),U(a.source)]}),(0,d.jsx)("span",{className:`text-xs font-medium ${(s=a.op).startsWith("create")||"import_file"===s?"text-success":s.startsWith("delete")?"text-error":s.startsWith("rename")||s.startsWith("move")?"text-muted-foreground":""}`,children:V(a.op)}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 ml-auto shrink-0",children:function(a,b){let c=Math.floor((Date.now()-new Date(a).getTime())/6e4);if(c<1)return b.changes.relativeTime.justNow;if(c<60)return b.changes.relativeTime.minutesAgo(c);let d=Math.floor(c/60);return d<24?b.changes.relativeTime.hoursAgo(d):b.changes.relativeTime.daysAgo(Math.floor(d/24))}(a.ts,b)})]})]}),(0,d.jsx)(g(),{href:`/view/${a.path.split("/").map(encodeURIComponent).join("/")}`,className:"inline-flex items-center px-2.5 py-1 rounded-md text-xs font-medium bg-[var(--amber)]/10 text-[var(--amber)] hover:bg-[var(--amber)] hover:text-[var(--amber-foreground)] focus-visible:ring-2 focus-visible:ring-ring transition-all duration-150 shrink-0",onClick:a=>a.stopPropagation(),title:b.changes.open,children:b.changes.open})]})}),v&&(t=1,u=1,(0,d.jsx)("div",{className:"border-t border-border/50 bg-background/60 max-h-80 overflow-y-auto",children:z.map((c,e)=>{if("gap"===c.type)return t+=c.count,u+=c.count,(0,d.jsx)("div",{className:"px-4 py-2 text-xs text-muted-foreground/50 border-y border-border/30 bg-muted/10 text-center font-medium",children:b.changes.unchangedLines(c.count)},`${a.id}-gap-${e}`);let f="insert"===c.type?"+":"delete"===c.type?"-":" ",g="insert"!==c.type?t:"",h="delete"!==c.type?u:"";return"insert"!==c.type&&t++,"delete"!==c.type&&u++,(0,d.jsxs)("div",{className:`flex items-start text-xs font-mono leading-6 px-4 ${"insert"===c.type?"bg-success/5 hover:bg-success/8":"delete"===c.type?"bg-error/5 hover:bg-error/8":"hover:bg-muted/20"} transition-colors`,children:[(0,d.jsx)("span",{className:"w-8 shrink-0 text-right pr-2 select-none text-muted-foreground/40",children:g}),(0,d.jsx)("span",{className:"w-8 shrink-0 text-right pr-2 select-none text-muted-foreground/40",children:h}),(0,d.jsx)("span",{className:`w-3 shrink-0 text-center select-none font-bold ${"insert"===c.type?"text-success":"delete"===c.type?"text-error":"text-muted-foreground/20"}`,children:f}),(0,d.jsx)("span",{className:`flex-1 whitespace-pre-wrap break-all overflow-hidden ${"insert"===c.type?"text-success":"delete"===c.type?"text-error":"text-muted-foreground"}`,children:c.text||"\xa0"})]},`${a.id}-${e}`)})}))]},a.id)})})]})}},42529:(a,b,c)=>{"use strict";c.d(b,{A:()=>p});var d=c(48249),e=c(67484),f=c(10316),g=c(46674),h=c(35389),i=c(22341),j=c(59347),k=c(93017),l=c(3129),m=c(12625),n=c(54461),o=c(47223);function p({sessions:a,activeSessionId:b,onLoad:c,onDelete:k,onRename:l,onTogglePin:m,onClearAll:p,onClose:r,onNewChat:s}){let{t}=(0,o.Y)(),u=t.ask,[v,w]=(0,e.useState)(""),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(""),[B,C]=(0,e.useState)(!1),D=(0,e.useRef)(void 0),E=(0,e.useRef)(null),F=(0,e.useRef)(null),G=(0,e.useMemo)(()=>{if(!v.trim())return a;let b=v.toLowerCase();return a.filter(a=>!!(0,n.d)(a).toLowerCase().includes(b)||a.messages.some(a=>a.content.toLowerCase().includes(b)))},[a,v]),H=(0,e.useMemo)(()=>{let a=[],b=[],c=[],d=[],e=[];for(let f of G){if(f.pinned){a.push(f);continue}let g=function(a){let b=new Date,c=new Date(b.getFullYear(),b.getMonth(),b.getDate()).getTime(),d=c-864e5*b.getDay();return a>=c?"today":a>=c-864e5?"yesterday":a>=d?"week":"older"}(f.updatedAt);"today"===g?b.push(f):"yesterday"===g?c.push(f):"week"===g?d.push(f):e.push(f)}return{pinned:a,today:b,yesterday:c,week:d,older:e}},[G]),I=a.filter(a=>a.pinned).length,J=a.filter(a=>a.messages.length>0).length,K=(0,e.useCallback)(a=>{c(a),r()},[c,r]),L=(0,e.useCallback)(()=>{s(),r()},[s,r]),M=(0,e.useCallback)(a=>{y(a.id),A((0,n.d)(a))},[]),N=(0,e.useCallback)(()=>{x&&z.trim()&&l(x,z.trim()),y(null)},[x,z,l]),O=(0,e.useCallback)(()=>{if(!B){C(!0),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>C(!1),3e3);return}D.current&&clearTimeout(D.current),p(),C(!1)},[B,p]),P=(a,c)=>0===c.length?null:(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-2xs font-medium text-muted-foreground/50 uppercase tracking-wider px-1 py-2",children:a}),(0,d.jsx)("div",{className:"flex flex-col gap-1",children:c.map(a=>(0,d.jsx)(q,{session:a,isActive:a.id===b,editing:x===a.id,editValue:z,onEditValueChange:A,inputRef:F,onLoad:()=>K(a.id),onStartRename:()=>M(a),onCommitRename:N,onCancelRename:()=>y(null),onDelete:()=>k(a.id),onTogglePin:()=>m(a.id),ask:u},a.id))})]},a),Q=G.length>0;return(0,d.jsxs)("div",{className:"flex flex-col flex-1 min-h-0 animate-in fade-in-0 duration-150",children:[(0,d.jsx)("div",{className:"px-4 pt-3 pb-2 shrink-0",children:(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)(f.A,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/50"}),(0,d.jsx)("input",{ref:E,type:"text",value:v,onChange:a=>w(a.target.value),placeholder:u?.historySearch??"Search conversations...",className:"w-full pl-8 pr-8 py-2 text-xs rounded-lg border border-border bg-background text-foreground placeholder:text-muted-foreground/40 outline-none focus-visible:border-[var(--amber)]/40 transition-colors"}),v&&(0,d.jsx)("button",{type:"button",onClick:()=>w(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-0.5 rounded text-muted-foreground/40 hover:text-foreground",children:(0,d.jsx)(g.A,{size:12})})]})}),(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 pb-2 shrink-0",children:[(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground/60",children:[u?.historyStats?.(J)??`${J} conversations`,I>0&&(0,d.jsxs)(d.Fragment,{children:[" \xb7 ",I," ",u?.historyPinned??"pinned"]})]}),(0,d.jsxs)("button",{type:"button",onClick:L,className:"flex items-center gap-1 text-2xs text-[var(--amber)] hover:text-[var(--amber)]/80 transition-colors",children:[(0,d.jsx)(h.A,{size:11}),(0,d.jsx)("span",{children:t.hints?.newChat??"New chat"})]})]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0 px-3 pb-3",children:Q?(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[P(u?.historyPinned??"Pinned",H.pinned),P(u?.historyToday??"Today",H.today),P(u?.historyYesterday??"Yesterday",H.yesterday),P(u?.historyThisWeek??"This week",H.week),P(u?.historyOlder??"Older",H.older)]}):(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,d.jsx)(i.A,{size:32,className:"text-muted-foreground/20 mb-3"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground/60",children:v?"No matching conversations":u?.historyEmpty??"No conversations yet"}),!v&&(0,d.jsx)("p",{className:"text-2xs text-muted-foreground/40 mt-1",children:u?.historyEmptyHint??"Start a new chat to begin"})]})}),J>0&&(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 border-t border-border/40 shrink-0",children:[(0,d.jsx)("button",{type:"button",onClick:O,className:`text-2xs px-2 py-0.5 rounded-md transition-colors ${B?"bg-error/10 text-error font-medium":"text-muted-foreground/50 hover:text-error hover:bg-muted"}`,children:(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(j.A,{size:10}),B?u?.confirmClear??"Confirm clear?":u?.clearAll??"Clear all"]})}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 tabular-nums",children:u?.historyCapacity?.(J)??`${J} of 30`})]})]})}function q({session:a,isActive:b,editing:c,editValue:e,onEditValueChange:f,inputRef:g,onLoad:h,onStartRename:o,onCommitRename:p,onCancelRename:q,onDelete:r,onTogglePin:s,ask:t}){let u=(0,n.d)(a),v=function(a){let b=a.messages.find(a=>"user"===a.role);if(!b)return"";let c=b.content.replace(/\s+/g," ").trim();return c.length>60?`${c.slice(0,60)}...`:c}(a),w=a.messages.length;return(0,d.jsxs)("div",{className:`group relative rounded-lg transition-colors cursor-pointer ${b?"bg-[var(--amber)]/8 border border-[var(--amber)]/15":"hover:bg-muted/60 border border-transparent"}`,onClick:h,children:[b&&(0,d.jsx)("span",{className:"absolute left-0 top-3 bottom-3 w-[2px] rounded-r-full bg-[var(--amber)]"}),(0,d.jsxs)("div",{className:"px-3 py-2.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-0.5",children:[a.pinned&&(0,d.jsx)(k.A,{size:10,className:"shrink-0 text-[var(--amber)]/60 -rotate-45"}),c?(0,d.jsx)("input",{ref:g,type:"text",value:e,onChange:a=>f(a.target.value),onBlur:p,onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),p()),"Escape"===a.key&&(a.preventDefault(),q())},onClick:a=>a.stopPropagation(),className:"flex-1 min-w-0 bg-transparent border-b border-[var(--amber)] outline-none text-xs font-medium text-foreground"}):(0,d.jsx)("span",{className:"flex-1 min-w-0 text-xs font-medium text-foreground truncate",children:u}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 shrink-0 tabular-nums",children:function(a){let b=Math.floor((Date.now()-a.getTime())/6e4);if(b<1)return"just now";if(b<60)return`${b}m ago`;let c=Math.floor(b/60);if(c<24)return`${c}h ago`;let d=Math.floor(c/24);return d<7?`${d}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric"})}(new Date(a.updatedAt))})]}),!c&&v&&(0,d.jsx)("p",{className:"text-2xs text-muted-foreground/50 truncate mt-0.5 pl-0.5",children:v}),!c&&(0,d.jsxs)("div",{className:"flex items-center justify-between mt-1.5",children:[(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground/40 flex items-center gap-1",children:[(0,d.jsx)(i.A,{size:9}),t?.historyMsgs?.(w)??`${w} msgs`]}),(0,d.jsxs)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",onClick:a=>a.stopPropagation(),children:[(0,d.jsx)("button",{type:"button",onClick:s,className:`p-1 rounded-md transition-colors ${a.pinned?"text-[var(--amber)] hover:text-muted-foreground":"text-muted-foreground/40 hover:text-[var(--amber)]"}`,title:a.pinned?"Unpin":"Pin",children:a.pinned?(0,d.jsx)(l.A,{size:11}):(0,d.jsx)(k.A,{size:11})}),(0,d.jsx)("button",{type:"button",onClick:o,className:"p-1 rounded-md text-muted-foreground/40 hover:text-foreground hover:bg-muted/60 transition-colors",title:t?.renameSession??"Rename",children:(0,d.jsx)(m.A,{size:11})}),(0,d.jsx)("button",{type:"button",onClick:r,className:"p-1 rounded-md text-muted-foreground/40 hover:text-error hover:bg-error/5 transition-colors",title:"Delete",children:(0,d.jsx)(j.A,{size:11})})]})]})]})]})}},43248:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(48249);function e({error:a,reset:b}){return(0,d.jsx)("html",{lang:"en",children:(0,d.jsx)("body",{style:{margin:0,fontFamily:"'IBM Plex Sans', system-ui, sans-serif",background:"#131210",color:"#e8e4dc"},children:(0,d.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"100vh",gap:"16px",padding:"24px",textAlign:"center"},children:[(0,d.jsx)("h2",{style:{fontSize:"18px",fontWeight:600,margin:0},children:"Something went wrong"}),(0,d.jsx)("p",{style:{fontSize:"14px",color:"#8a8275",maxWidth:"400px",margin:0},children:a.message||"An unexpected error occurred. Please try again."}),(0,d.jsxs)("div",{style:{display:"flex",gap:"12px",marginTop:"8px"},children:[(0,d.jsx)("button",{onClick:b,style:{padding:"8px 16px",borderRadius:"6px",fontSize:"14px",fontWeight:500,background:"#1c1a17",color:"#e8e4dc",border:"1px solid rgba(232,228,220,0.08)",cursor:"pointer"},children:"Try again"}),(0,d.jsx)("a",{href:"/setup",style:{padding:"8px 16px",borderRadius:"6px",fontSize:"14px",fontWeight:500,background:"#c8873a",color:"#fff",textDecoration:"none",cursor:"pointer"},children:"Go to Setup"})]})]})})})}},43638:(a,b,c)=>{"use strict";c.d(b,{A:()=>o});var d=c(48249),e=c(67484),f=c(97621),g=c(42742),h=c(6079),i=c(46674),j=c(19099),k=c(47223),l=c(33191),m=c(99829);let n=(0,m.createServerReference)("703203c8cb8e8fa5b4091d07d9334f84930c516094",m.callServer,void 0,m.findSourceMapURL,"revertSpaceInitAction");function o(){let[a,b]=(0,e.useState)(null),[c,m]=(0,e.useState)(!1),[o,q]=(0,e.useTransition)(),r=(0,j.useRouter)(),{t:s}=(0,k.Y)(),t=(0,e.useCallback)(()=>{m(!1),setTimeout(()=>b(null),200)},[]);(0,e.useCallback)(a=>{let c=a.detail;"working"===c.state?(b(c),requestAnimationFrame(()=>m(!0))):"done"===c.state?(b(a=>a?{...a,state:"done"}:null),r.refresh()):t()},[r,t]);let u=(0,e.useCallback)(()=>{a&&(t(),r.push(`/view/${(0,l.O0)(a.spacePath+"/")}`))},[a,t,r]),v=(0,e.useCallback)(()=>{a&&q(async()=>{await n(a.spacePath,a.spaceName,a.description),b(a=>a?{...a,state:"reverted"}:null),r.refresh(),window.dispatchEvent(new Event("mindos:files-changed")),setTimeout(t,2e3)})},[a,r,t]),w=(0,e.useCallback)(()=>{t()},[t]);if(!a)return null;let x=s.home,{state:y}=a,z="done"===y,A="reverted"===y;return(0,d.jsx)("div",{className:`fixed bottom-6 left-1/2 z-50 -translate-x-1/2 transition-all duration-200 ease-out ${c?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-3 scale-[0.96] pointer-events-none"}`,children:(0,d.jsxs)("div",{className:"flex items-center gap-2.5 rounded-full border bg-card/95 backdrop-blur py-2 shadow-lg",style:{borderColor:"color-mix(in srgb, var(--amber) 40%, var(--border))",boxShadow:"0 8px 24px color-mix(in srgb, var(--amber) 12%, rgba(0,0,0,.2))",paddingLeft:"0.75rem",paddingRight:z?"0.5rem":"1rem"},children:[(0,d.jsx)("span",{className:`inline-flex h-6 w-6 items-center justify-center rounded-full shrink-0 ${A?"text-muted-foreground bg-muted":"text-[var(--amber)] bg-[var(--amber-subtle)]"} ${"working"===y?"animate-pulse":""}`,children:A?(0,d.jsx)(f.A,{size:12}):z?(0,d.jsx)(g.A,{size:13,strokeWidth:2.5}):(0,d.jsx)(h.A,{size:13})}),(0,d.jsx)("span",{className:"text-xs text-foreground whitespace-nowrap select-none font-medium",children:A?x.aiInitReverted(a.spaceName):z?x.aiInitReady(a.spaceName):(0,d.jsxs)(d.Fragment,{children:[x.aiInitGenerating(a.spaceName),(0,d.jsx)(p,{})]})}),z&&(0,d.jsxs)("div",{className:"flex items-center gap-1 ml-1",children:[(0,d.jsx)("button",{type:"button",onClick:u,className:"px-2.5 py-1 rounded-full text-2xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] hover:opacity-90 transition-opacity focus-visible:ring-2 focus-visible:ring-ring",children:x.aiInitReview}),(0,d.jsx)("button",{type:"button",onClick:v,disabled:o,className:"px-2.5 py-1 rounded-full text-2xs font-medium bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50",children:x.aiInitDiscard}),(0,d.jsx)("button",{type:"button",onClick:w,"aria-label":"Accept",className:"ml-0.5 inline-flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors focus-visible:ring-2 focus-visible:ring-ring",children:(0,d.jsx)(i.A,{size:12})})]})]})})}function p(){return(0,d.jsxs)("span",{className:"inline-flex gap-[2px] items-end h-[1em] ml-px",children:[(0,d.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_0ms_infinite]"}),(0,d.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_200ms_infinite]"}),(0,d.jsx)("span",{className:"w-[3px] h-[3px] rounded-full bg-muted-foreground animate-[dotBounce_1.2s_400ms_infinite]"}),(0,d.jsx)("style",{children:`
|
|
56
|
-
@keyframes dotBounce {
|
|
57
|
-
0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
|
|
58
|
-
30% { opacity: 1; transform: translateY(-2px); }
|
|
59
|
-
}
|
|
60
|
-
`})]})}},43951:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ChangeLogRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ChangeLogRenderer() from the server but ChangeLogRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/change-log/ChangeLogRenderer.tsx","ChangeLogRenderer")},45108:(a,b,c)=>{"use strict";c.d(b,{u:()=>h});var d=c(67484);let e=new Set(["image/png","image/jpeg","image/gif","image/webp"]);async function f(a){let b=a.type;if(a.size<=5242880){let c=new Uint8Array(await a.arrayBuffer()),d="";for(let a=0;a<c.length;a+=32768)d+=String.fromCharCode(...c.subarray(a,a+32768));return{data:btoa(d),mimeType:b}}return new Promise((b,c)=>{let d=new Image,e=URL.createObjectURL(a);d.onload=()=>{let{width:a,height:f}=d;if(a>1920||f>1920){let b=Math.min(1920/a,1920/f);a=Math.round(a*b),f=Math.round(f*b)}let g=document.createElement("canvas");g.width=a,g.height=f;let h=g.getContext("2d");if(!h){URL.revokeObjectURL(e),c(Error("Canvas not supported"));return}h.drawImage(d,0,0,a,f);let i=g.toDataURL("image/jpeg",.85).split(",")[1];URL.revokeObjectURL(e),b({data:i,mimeType:"image/jpeg"})},d.onerror=()=>{URL.revokeObjectURL(e),c(Error("Failed to load image"))},d.src=e})}function g(a){let b=[];for(let c of Array.from(a))if("file"===c.kind&&e.has(c.type)){let a=c.getAsFile();a&&b.push(a)}return b}function h(){let[a,b]=(0,d.useState)([]),[c,h]=(0,d.useState)(""),i=(0,d.useCallback)(async a=>{h("");let c=a.slice(0,4),d=[];for(let a of c){var g;if(g=a.type,!e.has(g)){h(`Unsupported image type: ${a.type}`);continue}try{let{data:b,mimeType:c}=await f(a);d.push({type:"image",data:b,mimeType:c,fileName:a.name||void 0})}catch{h(`Failed to process image: ${a.name}`)}}b(a=>{let b=[...a,...d];return b.length>4?(h("Maximum 4 images allowed"),b.slice(0,4)):b})},[]),j=(0,d.useCallback)(async a=>{let b=a.clipboardData?.items;if(!b)return!1;let c=g(b);return 0!==c.length&&(await i(c),!0)},[i]),k=(0,d.useCallback)(async a=>{let b=a.dataTransfer?.items;if(!b)return;let c=g(b);c.length>0&&(a.preventDefault(),await i(c))},[i]),l=(0,d.useCallback)(async a=>{if(!a)return;let b=Array.from(a).filter(a=>{var b;return b=a.type,e.has(b)});await i(b)},[i]);return{images:a,imageError:c,addImages:i,handlePaste:j,handleDrop:k,handleFileSelect:l,removeImage:(0,d.useCallback)(a=>{b(b=>b.filter((b,c)=>c!==a))},[]),clearImages:(0,d.useCallback)(()=>{b([]),h("")},[])}}},45862:(a,b,c)=>{"use strict";c.r(b),c.d(b,{SummaryRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call SummaryRenderer() from the server but SummaryRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/summary/SummaryRenderer.tsx","SummaryRenderer")},46427:(a,b,c)=>{"use strict";c.r(b),c.d(b,{CsvRenderer:()=>D});var d=c(48249),e=c(67484),f=c.n(e),g=c(93053),h=c(75155),i=c(22242),j=c(91282),k=c(65732),l=c.n(k);function m(a,b){return l().unparse([a,...b])}let n=[{bg:"rgba(200,135,58,0.12)",text:"var(--amber)"},{bg:"rgba(122,173,128,0.12)",text:"var(--success)"},{bg:"rgba(138,180,216,0.12)",text:"#8ab4d8"},{bg:"rgba(200,160,216,0.12)",text:"#c8a0d8"},{bg:"rgba(200,96,96,0.12)",text:"#c86060"},{bg:"rgba(150,150,150,0.12)",text:"var(--muted-foreground)"}];function o(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)&65535;return n[b%n.length]}var p=c(82884),q=c(72419),r=c(44218),s=c(59347),t=c(24520);function u({value:a,onCommit:b}){let[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)(a),i=(0,e.useRef)(null);function j(){f(!1),g!==a?b(g):h(a)}return c?(0,d.jsx)("input",{ref:i,value:g,onChange:a=>h(a.target.value),onBlur:j,onKeyDown:b=>{"Enter"===b.key&&j(),"Escape"===b.key&&(h(a),f(!1))},className:"w-full bg-transparent outline-none text-sm",onClick:a=>a.stopPropagation(),style:{color:"var(--foreground)",borderBottom:"1px solid var(--amber)",minWidth:60}}):(0,d.jsx)("div",{className:"truncate text-sm cursor-text",style:{color:"var(--foreground)",minWidth:60},onClick:()=>f(!0),title:a,children:a||(0,d.jsx)("span",{style:{color:"var(--muted-foreground)",opacity:.3},children:"—"})})}function v({headers:a,visibleIndices:b,onAdd:c,onCancel:f}){let[g,h]=(0,e.useState)(()=>Array(a.length).fill(""));return(0,d.jsxs)("tr",{style:{background:"color-mix(in srgb, var(--amber) 6%, transparent)",borderTop:"1px solid var(--amber)"},children:[b.map((b,e)=>(0,d.jsx)("td",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:(0,d.jsx)("input",{autoFocus:0===e,value:g[b],onChange:a=>{var c;return c=a.target.value,void h(a=>{let d=[...a];return d[b]=c,d})},onKeyDown:a=>{"Enter"===a.key&&c(g),"Escape"===a.key&&f()},placeholder:a[b],className:"w-full bg-transparent outline-none text-sm placeholder:opacity-30",style:{color:"var(--foreground)",borderBottom:"1px solid var(--border)"}})},b)),(0,d.jsx)("td",{className:"px-2 py-2",style:{borderBottom:"1px solid var(--border)"}})]})}function w({headers:a,rows:b,cfg:c,saveAction:g}){let[h,i]=(0,e.useState)(b),[j,k]=(0,e.useState)(!1),l=(0,e.useMemo)(()=>a.map((a,b)=>b).filter(b=>!c.hiddenFields.includes(a[b])),[a,c.hiddenFields]),n=a.indexOf(c.sortField),o=(0,e.useMemo)(()=>{let a=[...h];return n>=0&&a.sort((a,b)=>{let d=a[n]??"",e=b[n]??"",f=parseFloat(d),g=parseFloat(e),h=isNaN(f)||isNaN(g)?d.localeCompare(e):f-g;return"asc"===c.sortDir?h:-h}),a},[h,n,c.sortDir]),p=a.indexOf(c.groupField),w=(0,e.useMemo)(()=>{if(p<0)return[{key:null,rows:o.map(a=>({row:a,orig:a}))}];let a=new Map;for(let b of o){let c=b[p]||"(empty)";a.has(c)||a.set(c,[]),a.get(c).push(b)}return[...a.entries()].map(([a,b])=>({key:a,rows:b.map(a=>({row:a,orig:a}))}))},[o,p]);async function x(b,c,d){let e=h.map(a=>a===b?a.map((a,b)=>b===c?d:a):a);i(e),await g(m(a,e))}async function y(b){let c=h.filter(a=>a!==b);i(c),await g(m(a,c))}async function z(b){let c=[...h,b];i(c),k(!1),await g(m(a,c))}let A={borderBottom:"1px solid var(--border)",fontSize:"0.72rem",letterSpacing:"0.05em",textTransform:"uppercase",color:"var(--muted-foreground)",fontWeight:600},B=0;return(0,d.jsxs)("div",{className:"rounded-xl overflow-hidden border",style:{borderColor:"var(--border)"},children:[(0,d.jsx)("div",{className:"overflow-x-auto",children:(0,d.jsxs)("table",{className:"min-w-full text-sm border-collapse",children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{style:{background:"var(--muted)"},children:[l.map(b=>(0,d.jsx)("th",{className:"px-4 py-2.5 text-left whitespace-nowrap",style:A,children:(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[a[b],c.sortField===a[b]&&("asc"===c.sortDir?(0,d.jsx)(q.A,{size:10,style:{color:"var(--amber)"}}):(0,d.jsx)(r.A,{size:10,style:{color:"var(--amber)"}}))]})},b)),(0,d.jsx)("th",{className:"w-8",style:{...A,background:"var(--muted)"}})]})}),(0,d.jsxs)("tbody",{children:[w.map((a,b)=>(0,d.jsxs)(f().Fragment,{children:[null!==a.key&&(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:l.length+1,className:"px-4 py-1.5",style:{background:"var(--accent)",borderBottom:"1px solid var(--border)",borderTop:"1px solid var(--border)"},children:(0,d.jsxs)("span",{className:"text-xs font-semibold font-display",style:{color:"var(--muted-foreground)"},children:[a.key," \xb7 ",a.rows.length]})})},`grp-${a.key}`),a.rows.map(({row:a,orig:b})=>{let c=B++;return(0,d.jsxs)("tr",{className:"group transition-colors",style:{background:c%2==0?"var(--background)":"var(--card)"},onMouseEnter:a=>a.currentTarget.style.background="var(--muted)",onMouseLeave:a=>a.currentTarget.style.background=c%2==0?"var(--background)":"var(--card)",children:[l.map(c=>(0,d.jsx)("td",{className:"px-4 py-2 max-w-xs",style:{borderBottom:"1px solid var(--border)"},children:(0,d.jsx)(u,{value:a[c]??"",onCommit:a=>x(b,c,a)})},c)),(0,d.jsx)("td",{className:"px-2 py-2",style:{borderBottom:"1px solid var(--border)"},children:(0,d.jsx)("button",{onClick:()=>y(b),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/10",style:{color:"var(--muted-foreground)"},children:(0,d.jsx)(s.A,{size:12})})})]},c)})]},a.key??`section-${b}`)),j&&(0,d.jsx)(v,{headers:a,visibleIndices:l,onAdd:z,onCancel:()=>k(!1)})]})]})}),(0,d.jsxs)("div",{className:"px-4 py-2 flex items-center justify-between",style:{background:"var(--muted)",borderTop:"1px solid var(--border)"},children:[(0,d.jsxs)("span",{className:"text-xs font-display",style:{color:"var(--muted-foreground)"},children:[h.length," rows \xb7 ",a.length," cols"]}),j?(0,d.jsx)("button",{onClick:()=>k(!1),className:"text-xs px-2.5 py-1 rounded-md",style:{color:"var(--muted-foreground)"},children:"Cancel"}):(0,d.jsxs)("button",{onClick:()=>k(!0),className:"flex items-center gap-1 text-xs px-2.5 py-1 rounded-md",style:{color:"var(--amber)",background:"var(--amber-dim)"},children:[(0,d.jsx)(t.A,{size:12})," Add row"]})]})]})}function x({headers:a,rows:b,cfg:c}){let e=a.indexOf(c.titleField),f=a.indexOf(c.descField),g=a.indexOf(c.tagField);return(0,d.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:b.map((b,c)=>{let h=e>=0?b[e]:b[0]??"",i=f>=0?b[f]:"",j=g>=0?b[g]:"",k=j?o(j):null;return(0,d.jsxs)("div",{className:"rounded-xl border p-4 flex flex-col gap-2 hover:bg-muted/50 transition-colors",style:{borderColor:"var(--border)",background:"var(--card)"},children:[j&&k&&(0,d.jsx)("span",{className:"self-start text-xs px-2 py-0.5 rounded-full font-medium",style:{background:k.bg,color:k.text},children:j}),(0,d.jsx)("p",{className:"text-sm font-semibold leading-snug",style:{color:"var(--foreground)"},children:h}),i&&(0,d.jsx)("p",{className:"text-xs leading-relaxed line-clamp-3",style:{color:"var(--muted-foreground)"},children:i}),(0,d.jsx)("div",{className:"mt-1 flex flex-col gap-0.5",children:a.map((a,c)=>{if(c===e||c===f||c===g)return null;let h=b[c];return h?(0,d.jsxs)("div",{className:"flex items-baseline gap-1.5 text-xs",children:[(0,d.jsx)("span",{className:"font-display",style:{color:"var(--muted-foreground)",opacity:.6,fontSize:"0.68rem"},children:a}),(0,d.jsx)("span",{className:"truncate",style:{color:"var(--muted-foreground)"},children:h})]},c):null})})]},c)})})}function y({headers:a,rows:b,cfg:c,saveAction:f}){let[g,h]=(0,e.useState)(b),[i,j]=(0,e.useState)(null),[k,l]=(0,e.useState)(""),[n,p]=(0,e.useState)(!1),q=a.indexOf(c.groupField),r=a.indexOf(c.titleField),s=a.indexOf(c.descField),{groups:u,groupKeys:v}=(0,e.useMemo)(()=>{let a=new Map;return g.forEach((b,c)=>{let d=(q>=0?b[q]:"")||"(empty)";a.has(d)||a.set(d,[]),a.get(d).push({row:b,origIdx:c})}),{groups:a,groupKeys:[...a.keys()]}},[g,q]);async function w(b,c){let d=g.map((a,d)=>{if(d!==b)return a;let e=[...a];return q>=0&&(e[q]=c),e});h(d),await f(m(a,d))}function x({group:b}){let c=u.get(b)??[],e=o(b),f=i===b;return(0,d.jsxs)("div",{className:"flex-shrink-0 w-64 flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[(0,d.jsx)("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{background:e.text}}),(0,d.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wider truncate font-display",style:{color:e.text},children:b}),(0,d.jsx)("span",{className:"text-xs ml-auto shrink-0",style:{color:"var(--muted-foreground)",opacity:.5},children:c.length})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl p-1.5 min-h-[80px] transition-colors",style:{background:f?"var(--amber-dim)":"var(--muted)",border:`1px solid ${f?"var(--amber)":"transparent"}`},onDragOver:a=>{a.preventDefault(),j(b)},onDragLeave:a=>{a.currentTarget.contains(a.relatedTarget)||j(null)},onDrop:a=>{j(null);let c=parseInt(a.dataTransfer.getData("origIdx"));isNaN(c)||w(c,b)},children:[c.map(({row:b,origIdx:c})=>{let e=r>=0?b[r]:b[0]??"",f=s>=0?b[s]:"";return(0,d.jsxs)("div",{draggable:!0,onDragStart:a=>{a.dataTransfer.setData("origIdx",String(c)),j(null)},onDragEnd:()=>j(null),className:"rounded-lg border p-3 flex flex-col gap-1.5 cursor-grab active:cursor-grabbing hover:bg-muted/50 transition-colors",style:{borderColor:"var(--border)",background:"var(--card)"},children:[(0,d.jsx)("p",{className:"text-sm font-medium leading-snug",style:{color:"var(--foreground)"},children:e}),f&&(0,d.jsx)("p",{className:"text-xs leading-relaxed line-clamp-2",style:{color:"var(--muted-foreground)"},children:f}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1 mt-0.5",children:a.map((a,c)=>{if(c===q||c===r||c===s)return null;let e=b[c];return e?(0,d.jsxs)("span",{className:"text-2xs px-1.5 py-0.5 rounded font-display",style:{background:"var(--muted)",color:"var(--muted-foreground)"},children:[a,": ",e]},c):null})})]},c)}),0===c.length&&(0,d.jsx)("div",{className:"flex items-center justify-center h-12",children:(0,d.jsx)("span",{className:"text-xs",style:{color:"var(--muted-foreground)",opacity:.4},children:"Drop here"})})]})]})}return(0,d.jsxs)("div",{className:"flex gap-3 overflow-x-auto pb-3 items-start",children:[v.map(a=>(0,d.jsx)(x,{group:a},a)),(0,d.jsx)("div",{className:"flex-shrink-0 w-64",children:n?(0,d.jsxs)("div",{className:"rounded-xl border p-3 flex flex-col gap-2",style:{borderColor:"var(--border)",background:"var(--card)"},children:[(0,d.jsx)("input",{autoFocus:!0,value:k,onChange:a=>l(a.target.value),onKeyDown:a=>{"Enter"===a.key&&k.trim()&&(l(""),p(!1)),"Escape"===a.key&&(l(""),p(!1))},placeholder:"Column name…",className:"text-xs bg-transparent outline-none w-full font-display",style:{color:"var(--foreground)",borderBottom:"1px solid var(--amber)"}}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{onClick:()=>{l(""),p(!1)},className:"text-xs px-2 py-1 rounded font-display",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:"Create"}),(0,d.jsx)("button",{onClick:()=>{l(""),p(!1)},className:"text-xs px-2 py-1 rounded font-display",style:{color:"var(--muted-foreground)"},children:"Cancel"})]})]}):(0,d.jsxs)("button",{onClick:()=>p(!0),className:"flex items-center gap-1.5 text-xs px-3 py-2 rounded-xl border border-dashed w-full transition-colors hover:bg-muted font-display",style:{borderColor:"var(--border)",color:"var(--muted-foreground)"},children:[(0,d.jsx)(t.A,{size:12})," Add column"]})})]})}var z=c(46674),A=c(27608);function B({headers:a,cfg:b,view:c,onClose:e,onChange:f}){let g={color:"var(--muted-foreground)",fontSize:"0.72rem"};function h({label:b,value:c,onChange:e}){return(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:"font-display",style:g,children:b}),(0,d.jsx)(A.A,{value:c,onChange:e,size:"sm",options:[{value:"",label:"— none —"},...a.map(a=>({value:a,label:a}))]})]})}return(0,d.jsxs)("div",{className:"absolute right-0 top-10 z-20 w-72 rounded-xl border shadow-xl p-4 flex flex-col gap-3",style:{background:"var(--card)",borderColor:"var(--border)"},children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("span",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:[c," settings"]}),(0,d.jsx)("button",{onClick:e,style:{color:"var(--muted-foreground)"},children:(0,d.jsx)(z.A,{size:13})})]}),"table"===c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"h-px",style:{background:"var(--border)"}}),(0,d.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:"Sort"}),(0,d.jsx)(h,{label:"Sort by",value:b.table.sortField,onChange:a=>f({...b,table:{...b.table,sortField:a}})}),(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{style:g,children:"Direction"}),(0,d.jsx)("div",{className:"flex rounded overflow-hidden border",style:{borderColor:"var(--border)"},children:["asc","desc"].map(a=>(0,d.jsx)("button",{onClick:()=>f({...b,table:{...b.table,sortDir:a}}),className:"px-3 py-1 text-xs transition-colors font-display",style:{fontSize:"0.72rem",background:b.table.sortDir===a?"var(--amber)":"var(--background)",color:b.table.sortDir===a?"var(--amber-foreground)":"var(--muted-foreground)"},children:a},a))})]}),(0,d.jsx)("div",{className:"h-px",style:{background:"var(--border)"}}),(0,d.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:"Group"}),(0,d.jsx)(h,{label:"Group by",value:b.table.groupField,onChange:a=>f({...b,table:{...b.table,groupField:a}})}),(0,d.jsx)("div",{className:"h-px",style:{background:"var(--border)"}}),(0,d.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:"Columns"}),(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:a.map(a=>{let c=b.table.hiddenFields.includes(a);return(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{style:g,children:a}),(0,d.jsx)("button",{onClick:()=>{let d=c?b.table.hiddenFields.filter(b=>b!==a):[...b.table.hiddenFields,a];f({...b,table:{...b.table,hiddenFields:d}})},className:"text-xs px-2 py-0.5 rounded transition-colors font-display",style:{background:c?"var(--muted)":"var(--amber-dim)",color:c?"var(--muted-foreground)":"var(--amber)"},children:c?"Hidden":"Visible"})]},a)})})]}),"gallery"===c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h,{label:"Title",value:b.gallery.titleField,onChange:a=>f({...b,gallery:{...b.gallery,titleField:a}})}),(0,d.jsx)(h,{label:"Description",value:b.gallery.descField,onChange:a=>f({...b,gallery:{...b.gallery,descField:a}})}),(0,d.jsx)(h,{label:"Tag / Badge",value:b.gallery.tagField,onChange:a=>f({...b,gallery:{...b.gallery,tagField:a}})})]}),"board"===c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h,{label:"Group by",value:b.board.groupField,onChange:a=>f({...b,board:{...b.board,groupField:a}})}),(0,d.jsx)(h,{label:"Card title",value:b.board.titleField,onChange:a=>f({...b,board:{...b.board,titleField:a}})}),(0,d.jsx)(h,{label:"Card desc",value:b.board.descField,onChange:a=>f({...b,board:{...b.board,descField:a}})})]})]})}let C=[{id:"table",icon:(0,d.jsx)(g.A,{size:13}),label:"Table"},{id:"gallery",icon:(0,d.jsx)(h.A,{size:13}),label:"Gallery"},{id:"board",icon:(0,d.jsx)(i.A,{size:13}),label:"Board"}];function D({filePath:a,content:b,saveAction:c}){let{headers:f,rows:g}=(0,e.useMemo)(()=>{let a;return{headers:(a=l().parse(b,{skipEmptyLines:!0}).data)[0]??[],rows:a.slice(1)}},[b]),h=(0,e.useMemo)(()=>({activeView:"table",table:{sortField:"",sortDir:"asc",groupField:"",hiddenFields:[]},gallery:{titleField:f[0]??"",descField:f[1]??"",tagField:f[2]??""},board:{groupField:f[f.length-1]??"",titleField:f[0]??"",descField:f[1]??""}}),[f]),[i,k]=(0,p.Un)("csv",a,h),[m,n]=(0,e.useState)(!1),o=(0,e.useCallback)(a=>{k(a)},[k]),q=i.activeView;return(0,d.jsxs)("div",{className:"w-full py-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-4 relative",children:[(0,d.jsx)("div",{className:"flex items-center gap-0.5 p-1 rounded-lg",style:{background:"var(--muted)"},children:C.map(a=>(0,d.jsxs)("button",{onClick:()=>o({...i,activeView:a.id}),className:"flex items-center gap-1.5 px-3 py-1.5 rounded text-xs font-medium transition-colors font-display",style:{background:q===a.id?"var(--card)":"transparent",color:q===a.id?"var(--foreground)":"var(--muted-foreground)",boxShadow:q===a.id?"0 1px 3px rgba(0,0,0,0.1)":"none"},children:[a.icon,a.label]},a.id))}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsxs)("span",{className:"text-xs font-display",style:{color:"var(--muted-foreground)",opacity:.5},children:[g.length," rows"]}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("button",{onClick:()=>n(a=>!a),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs transition-colors",style:{background:m?"var(--accent)":"var(--muted)",color:m?"var(--foreground)":"var(--muted-foreground)"},title:"View settings",children:(0,d.jsx)(j.A,{size:13})}),m&&(0,d.jsx)(B,{headers:f,cfg:i,view:q,onClose:()=>n(!1),onChange:o})]})]}),"table"===q&&(0,d.jsx)(w,{headers:f,rows:g,cfg:i.table,saveAction:c}),"gallery"===q&&(0,d.jsx)(x,{headers:f,rows:g,cfg:i.gallery}),"board"===q&&(0,d.jsx)(y,{headers:f,rows:g,cfg:i.board,saveAction:c})]})}},47223:(a,b,c)=>{"use strict";c.d(b,{D:()=>f,Y:()=>g});var d=c(31417),e=c(52610);let f=(0,d.v)(a=>({locale:"en",t:e.D.en,setLocale:b=>{document.cookie=`locale=${b};path=/;max-age=31536000;SameSite=Lax`,document.documentElement.lang="zh"===b?"zh":"en",window.__mindos_locale__=b,a({locale:b,t:e.D[b]}),window.dispatchEvent(new Event("mindos-locale-change"))},_init:b=>{"en"!==f.getState().locale&&a({locale:"en",t:e.D.en});let c=()=>{a({locale:"en",t:e.D.en})};return window.addEventListener("mindos-locale-change",c),()=>window.removeEventListener("mindos-locale-change",c)}}));function g(){return f()}},47336:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ImageRenderer:()=>g});var d=c(48249),e=c(67484);let f=[.25,.5,.75,1,1.5,2,3,4];function g({filePath:a}){let b=`/api/file/raw?path=${encodeURIComponent(a)}`,c=a.split("/").pop()??"image",g=c.split(".").pop()?.toLowerCase()??"",h=["png","svg","webp","ico","gif"].includes(g),[i,j]=(0,e.useState)(!0),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(0),[o,p]=(0,e.useState)("fit"),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),u=(0,e.useRef)(null),v=(0,e.useRef)(null),w=(0,e.useCallback)(()=>{j(!1);let a=u.current;a&&r({w:a.naturalWidth,h:a.naturalHeight})},[]),x=(0,e.useCallback)(()=>{j(!1),l(!0)},[]),y=(0,e.useCallback)(()=>{l(!1),j(!0),n(a=>a+1)},[]),z=(0,e.useCallback)(()=>{p(a=>{let b="fit"===a?1:a;return f.find(a=>a>b)??b})},[]),A=(0,e.useCallback)(()=>{p(a=>{let b="fit"===a?1:a;return[...f].reverse().find(a=>a<b)??b})},[]),B=(0,e.useCallback)(()=>{p(a=>"fit"===a?1:"fit")},[]),C="fit"===o?"Fit":`${Math.round(100*o)}%`,D="fit"===o?{maxWidth:"100%",maxHeight:"70vh",objectFit:"contain"}:q?{width:q.w*o,height:"auto"}:{maxWidth:"100%",maxHeight:"70vh",objectFit:"contain"};return(0,d.jsxs)("div",{className:"w-full flex flex-col gap-0",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border text-xs text-[var(--text-secondary)]",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[q&&(0,d.jsxs)("span",{children:[q.w," x ",q.h]}),null!==s&&(0,d.jsx)("span",{children:s<1024?`${s} B`:s<1048576?`${(s/1024).toFixed(1)} KB`:`${(s/1048576).toFixed(1)} MB`}),(0,d.jsx)("span",{className:"uppercase opacity-60",children:g})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{onClick:A,disabled:!q,className:"px-2 py-1 rounded hover:bg-[var(--bg-hover)] transition-colors disabled:opacity-30",title:"Zoom out (-)",children:"-"}),(0,d.jsx)("button",{onClick:B,disabled:!q,className:"px-2 py-1 rounded hover:bg-[var(--bg-hover)] transition-colors min-w-[48px] text-center disabled:opacity-30",title:"fit"===o?"Actual size (1)":"Fit to view (0)",children:C}),(0,d.jsx)("button",{onClick:z,disabled:!q,className:"px-2 py-1 rounded hover:bg-[var(--bg-hover)] transition-colors disabled:opacity-30",title:"Zoom in (+)",children:"+"})]})]}),(0,d.jsxs)("div",{ref:v,tabIndex:-1,className:`relative flex-1 min-h-[70vh] overflow-auto flex items-center justify-center outline-none ${h?"bg-checkerboard":"bg-[var(--bg-secondary)]"}`,children:[i&&!k&&(0,d.jsx)("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:(0,d.jsx)("span",{className:"text-sm text-[var(--text-tertiary)] animate-pulse",children:"Loading..."})}),k&&(0,d.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center z-10 gap-2",children:[(0,d.jsx)("span",{className:"text-sm text-[var(--text-secondary)]",children:"Failed to load image"}),(0,d.jsx)("button",{onClick:y,className:"text-xs px-3 py-1.5 rounded-md bg-[var(--bg-tertiary)] hover:bg-[var(--bg-hover)] transition-colors",children:"Retry"})]}),(0,d.jsx)("img",{ref:u,src:b,alt:c,onLoad:w,onError:x,draggable:!1,className:"select-none",style:{display:k?"none":"block",...D}},m)]})]})}},49223:(a,b,c)=>{"use strict";c.d(b,{EI:()=>g,No:()=>e,R3:()=>h,_r:()=>f});let d={id:"mindos",name:"MindOS"};function e(a,b){let c=b??d;return{...a,agentId:c.id,agentName:c.name}}function f({sessionAgent:a,initialAgent:b}){return a??b??null}function g(a){return a.agentId&&a.agentName&&a.agentId!==d.id?{id:a.agentId,name:a.agentName}:null}function h(a,b){return{...a,defaultAcpAgent:b}}},49905:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{default:()=>i});var e=c(48249),f=c(19099),g=c(89119),h=a([g]);function i({fileTree:a,children:b}){let c=(0,f.usePathname)();return"/login"===c?(0,e.jsx)(e.Fragment,{children:b}):(0,e.jsx)(g.A,{fileTree:a,children:b})}g=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},51488:(a,b,c)=>{"use strict";c.r(b),c.d(b,{SummaryRenderer:()=>m});var d=c(48249),e=c(67484),f=c(69924),g=c(6079),h=c(80600),i=c(13576),j=c(33191);function k(a){let b=Date.now()-a,c=Math.floor(b/6e4),d=Math.floor(b/36e5),e=Math.floor(b/864e5);return c<1?"just now":c<60?`${c}m ago`:d<24?`${d}h ago`:`${e}d ago`}function l(a){return a.split("/").pop()?.replace(/\.(md|csv)$/,"")??a}function m({filePath:a}){let[b,c]=(0,e.useState)([]),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(!1),u=(0,e.useRef)(null),v=(0,e.useMemo)(()=>m.replace(/^### (.+)$/gm,'<h3 style="font-size:.8rem;font-weight:600;color:var(--muted-foreground);text-transform:uppercase;letter-spacing:.06em;margin:1em 0 .3em">$1</h3>').replace(/^## (.+)$/gm,'<h2 style="font-size:.9rem;font-weight:700;color:var(--foreground);margin:1.2em 0 .4em">$1</h2>').replace(/^# (.+)$/gm,'<h1 style="font-size:1rem;font-weight:700;color:var(--foreground);margin:1.2em 0 .4em">$1</h1>').replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`(.+?)`/g,'<code class="font-display" style="font-size:.82em;padding:1px 5px;border-radius:4px;background:var(--muted)">$1</code>').replace(/^[-*] (.+)$/gm,'<li style="margin:.2em 0;padding-left:.3em">$1</li>').replace(/(<li[^>]*>.*<\/li>\n?)+/g,a=>`<ul style="margin:.4em 0;padding-left:1.4em;list-style:disc">${a}</ul>`).replace(/\n{2,}/g,'</p><p style="margin:.5em 0;font-size:.85rem;line-height:1.7;color:var(--foreground)">').replace(/^(?!<[hulo])(.+)$/gm,'<p style="margin:.5em 0;font-size:.85rem;line-height:1.7;color:var(--foreground)">$1</p>'),[m]);async function w(){if(0===b.length)return;u.current?.abort();let a=new AbortController;u.current=a,n(""),r(""),p(!0),t(!1);let c=b.map(a=>a.path),d=b.map(a=>`- **${l(a.path)}** (${a.path}, modified ${k(a.mtime)})`).join("\n"),e=`You are summarizing recent changes in a personal knowledge base (MindOS).
|
|
65
|
+
${g}`,status:"success"};return f.truncated&&f.totalChars&&(h.truncatedInfo={totalChars:f.totalChars,includedChars:g.length,totalPages:f.pagesParsed??0}),h}catch(a){return{name:b,content:`[PDF: ${b}] Failed to extract text from this PDF.`,status:"error",error:a instanceof Error?a.message:"Unknown error"}}}function h(a){let[b,c]=(0,d.useState)([]),[h,i]=(0,d.useState)(""),j=(0,d.useRef)(null),k=(0,d.useRef)(a);k.current=a;let l=(0,d.useCallback)(async a=>{if(!a||0===a.length)return;let b=Array.from(a).slice(0,8),d=[],h=[];for(let a of b){let b=f(a.name);e.has(b)?d.push(a):h.push(a.name)}if(h.length>0){let a=k.current?.unsupportedType??"Unsupported file type";i(`${a}: ${h.join(", ")}`)}else i("");let j=[],l=[];for(let a of d)".pdf"===f(a.name)?(l.push({name:a.name,content:"",status:"loading"}),j.push(a)):l.push({name:a.name,content:await a.text(),status:"success"});if(c(a=>{let b=[...a];for(let a of l)b.some(b=>b.name===a.name)||b.push(a);return b}),j.length>0){let a=await Promise.all(j.map(g));c(b=>b.map(b=>"loading"!==b.status?b:a.find(a=>a.name===b.name)??b))}},[]),m=(0,d.useCallback)(a=>{c(b=>b.filter((b,c)=>c!==a))},[]);return{localAttachments:b,uploadError:h,uploadInputRef:j,pickFiles:l,removeAttachment:m,clearAttachments:(0,d.useCallback)(()=>{c([]),i("")},[]),injectFiles:(0,d.useCallback)(a=>{c(b=>{let c=[...b];for(let b of a)c.some(a=>a.name===b.name)||c.push(b);return c})},[])}}},41739:(a,b,c)=>{"use strict";c.d(b,{A:()=>x});var d=c(48249),e=c(67484),f=c(74429),g=c(93017),h=c(42742),i=c(3129),j=c(12625),k=c(59347),l=c(96286),m=c(6079),n=c(44218),o=c(35389),p=c(45231),q=c(13481),r=c(92343),s=c(50514),t=c(46674),u=c(59867),v=c(47223),w=c(54461);let x=(0,e.memo)(function({isPanel:a,showHistory:b,onToggleHistory:c,onReset:x,isLoading:y,maximized:z,onMaximize:A,askMode:B,onModeSwitch:C,onClose:D,onDockToPanel:E,hideTitle:F,sessions:G,activeSessionId:H,onLoadSession:I,onDeleteSession:J,onRenameSession:K,onTogglePinSession:L,messages:M}){let{t:N}=(0,v.Y)(),O=G&&G.length>=2,P=G?.find(a=>a.id===H),Q=P?(0,w.d)(P):null,[R,S]=(0,e.useState)(!1),T=(0,e.useRef)(null),U=(0,e.useRef)(null),[V,W]=(0,e.useState)(null),[X,Y]=(0,e.useState)(""),Z=(0,e.useRef)(null),$=(0,e.useCallback)(a=>{I?.(a),S(!1)},[I]),_=(0,e.useCallback)((a,b)=>{W(a),Y("(empty session)"===b?"":b)},[]),aa=(0,e.useCallback)(()=>{V&&K&&X.trim()&&K(V,X.trim()),W(null)},[V,X,K]),[ab,ac]=(0,e.useState)(null),ad=R&&ab&&G?(0,f.createPortal)((0,d.jsx)("div",{ref:U,className:"fixed z-50 rounded-xl border border-border/50 bg-card shadow-lg py-1 animate-in fade-in-0 slide-in-from-top-1 duration-100 max-h-[60vh] overflow-y-auto",style:{top:ab.top,left:ab.left,minWidth:Math.max(ab.width,280),maxWidth:340},role:"listbox",children:G.map(a=>{let b=a.id===H,c=(0,w.d)(a),e="(empty session)"===c?N.hints?.newChat??"New chat":c;return V===a.id?(0,d.jsx)("div",{className:"flex items-center gap-1 px-2 py-1.5",children:(0,d.jsx)("input",{ref:Z,type:"text",value:X,onChange:a=>Y(a.target.value),onKeyDown:a=>{"Enter"===a.key&&aa(),"Escape"===a.key&&W(null)},onBlur:aa,className:"flex-1 min-w-0 px-2 py-1 text-xs rounded-md border border-border bg-background text-foreground outline-none focus-visible:border-[var(--amber)]/50",placeholder:"Session name..."})},a.id):(0,d.jsxs)("div",{className:"group/item flex items-center",children:[(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":b,onClick:()=>$(a.id),className:`flex-1 min-w-0 flex items-center gap-2 px-3 py-2.5 text-xs text-left transition-colors ${b?"text-foreground font-medium":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[a.pinned&&(0,d.jsx)(g.A,{size:10,className:"shrink-0 text-[var(--amber)]/60 -rotate-45"}),b&&!a.pinned&&(0,d.jsx)(h.A,{size:11,className:"shrink-0 text-[var(--amber)]"}),(0,d.jsx)("span",{className:"truncate",children:e})]}),(0,d.jsxs)("div",{className:"shrink-0 flex items-center gap-0.5 mr-1 opacity-0 group-hover/item:opacity-100 transition-opacity",children:[L&&(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),L(a.id)},className:`p-1.5 rounded-md transition-colors ${a.pinned?"text-[var(--amber)] hover:text-muted-foreground hover:bg-muted/60":"text-muted-foreground/40 hover:text-[var(--amber)] hover:bg-[var(--amber)]/5"}`,"aria-label":a.pinned?"Unpin":"Pin",children:a.pinned?(0,d.jsx)(i.A,{size:10}):(0,d.jsx)(g.A,{size:10})}),K&&(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),_(a.id,c)},className:"p-1.5 rounded-md text-muted-foreground/40 hover:text-foreground hover:bg-muted/60","aria-label":`Rename: ${e}`,children:(0,d.jsx)(j.A,{size:10})}),G.length>1&&J&&(0,d.jsx)("button",{type:"button",onClick:b=>{b.stopPropagation(),J(a.id)},className:"p-1.5 rounded-md text-muted-foreground/40 hover:text-error hover:bg-error/5","aria-label":`Delete: ${e}`,children:(0,d.jsx)(k.A,{size:10})})]})]},a.id)})}),document.body):null;return(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 shrink-0",children:[!a&&(0,d.jsx)("div",{className:"absolute top-2 left-1/2 -translate-x-1/2 w-8 h-1 rounded-full bg-muted-foreground/20 md:hidden"}),!F&&(0,d.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,d.jsx)("div",{className:"w-6 h-6 rounded-lg bg-[var(--amber)]/10 flex items-center justify-center shrink-0",children:b?(0,d.jsx)(l.A,{size:13,className:"text-[var(--amber)]"}):(0,d.jsx)(m.A,{size:13,className:"text-[var(--amber)]"})}),b?(0,d.jsx)("span",{className:"text-sm font-medium text-[var(--amber)]",children:N.ask?.sessionHistory??"Session History"}):O&&Q?(0,d.jsxs)("button",{ref:T,type:"button",onClick:()=>{G&&G.length>=2?S(a=>!a):c()},className:"flex items-center gap-1 min-w-0 text-sm font-medium text-[var(--amber)] hover:text-[var(--amber)]/80 transition-colors","aria-expanded":R,"aria-haspopup":"listbox",children:[(0,d.jsx)("span",{className:"truncate max-w-[180px]",children:"(empty session)"===Q?N.hints?.newChat??"New chat":Q}),(0,d.jsx)(n.A,{size:12,className:`shrink-0 text-muted-foreground transition-transform duration-150 ${R?"rotate-180":""}`})]}):Q?(0,d.jsx)("span",{className:"text-sm font-medium text-muted-foreground/60 truncate max-w-[180px]",children:"(empty session)"===Q?N.hints?.newChat??"New chat":Q}):(0,d.jsx)("span",{className:"text-sm font-medium text-muted-foreground/40",children:N.hints?.newChat??"New chat"})]}),F&&(0,d.jsx)("div",{}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),c()},"aria-pressed":b,className:`p-2 rounded-lg transition-colors ${b?"bg-[var(--amber)]/10 text-[var(--amber)]":"text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:N.hints.sessionHistory,children:(0,d.jsx)(l.A,{size:14})}),M&&M.length>0&&(0,d.jsx)(u.A,{messages:M,disabled:y}),(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),x()},disabled:y,className:"p-2 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors disabled:opacity-40",title:N.hints.newSession,children:(0,d.jsx)(o.A,{size:14})}),A&&(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),A()},className:"p-2 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:z?N.hints.restorePanel:N.hints.maximizePanel,children:z?(0,d.jsx)(p.A,{size:14}):(0,d.jsx)(q.A,{size:14})}),E&&(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),E()},className:"p-2 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:N.hints.dockToSide??"Dock to side panel",children:(0,d.jsx)(r.A,{size:14})}),C&&(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),C()},className:"p-2 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:"popup"===B?N.hints.dockToSide:N.hints.openAsPopup,children:"popup"===B?(0,d.jsx)(r.A,{size:14}):(0,d.jsx)(s.A,{size:14})}),D&&(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation(),D()},className:"p-2 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",title:N.hints.closePanel,"aria-label":"Close",children:(0,d.jsx)(t.A,{size:14})})]}),"u">typeof document&&ad]})})},41829:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ChangeLogRenderer:()=>D});var d=c(48249),e=c(67484),f=c(2116),g=c.n(f),h=c(82318),i=c(94703),j=c(11732),k=c(12625),l=c(15273),m=c(71465),n=c(95801),o=c(80600),p=c(65255),q=c(98631),r=c(66336),s=c(96286),t=c(56692),u=c(69924),v=c(10316),w=c(44218),x=c(19794),y=c(95054),z=c(47223),A=c(27608),B=c(91199);function C(){return(0,d.jsx)("div",{className:"rounded-lg border border-border bg-card overflow-hidden animate-pulse",children:(0,d.jsx)("div",{className:"px-4 py-3 space-y-2",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)("div",{className:"w-4 h-4 bg-muted rounded mt-1"}),(0,d.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,d.jsx)("div",{className:"h-5 bg-muted rounded w-2/3"}),(0,d.jsx)("div",{className:"h-3 bg-muted rounded w-full"})]})]})})})}function D(a){let{t:b}=(0,z.Y)(),[c,f]=(0,e.useState)("all"),[D,E]=(0,e.useState)(""),[F,G]=(0,e.useState)([]),[H,I]=(0,e.useState)({unreadCount:0,totalCount:0}),[J,K]=(0,e.useState)({}),[L,M]=(0,e.useState)(!0),[N,O]=(0,e.useState)(null),[P,Q]=(0,e.useState)(!1),R=(0,e.useCallback)(async()=>{M(!0),O(null);try{let a=new URLSearchParams({op:"list",limit:"120"});"all"!==c&&a.set("source",c),D.trim()&&a.set("q",D.trim());let[b,d]=await Promise.all([(0,y.n)(`/api/changes?${a.toString()}`),(0,y.n)("/api/changes?op=summary")]);G(b.events),I(d)}catch(a){O(a instanceof Error?a.message:String(a))}finally{M(!1)}},[c,D]),S=(0,e.useCallback)(async()=>{await (0,y.n)("/api/changes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"mark_seen"})}),await R()},[R]),T=(0,e.useMemo)(()=>[{value:"all",label:b.changes.filters.all},{value:"agent",label:b.changes.filters.agent},{value:"user",label:b.changes.filters.user},{value:"system",label:b.changes.filters.system}],[b]),U=(0,e.useCallback)(a=>"agent"===a?b.changes.filters.agent:"user"===a?b.changes.filters.user:b.changes.filters.system,[b]),V=(0,e.useCallback)(a=>b.changes.operations?.[a]??a,[b]);return(0,d.jsxs)("div",{style:{padding:"1.5rem 0"},children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-4 mb-6",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("div",{className:"w-10 h-10 rounded-lg bg-[var(--amber)]/8 flex items-center justify-center shrink-0",children:(0,d.jsx)(s.A,{size:20,className:"text-[var(--amber)]"})}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("h1",{className:"text-xl font-semibold text-foreground tracking-tight",children:b.changes.title}),(0,d.jsx)("p",{className:"mt-1 text-sm text-muted-foreground leading-relaxed",children:b.changes.subtitle})]})]}),(0,d.jsxs)("div",{className:"mt-4 flex items-center gap-2",children:[(0,d.jsx)("span",{className:"px-2.5 py-1 rounded-full bg-muted/60 text-muted-foreground text-xs font-medium",children:b.changes.eventsCount(F.length)}),H.unreadCount>0&&(0,d.jsx)("span",{className:"px-2.5 py-1 rounded-full bg-[var(--amber)]/10 text-[var(--amber)] text-xs font-medium border border-[var(--amber)]/20",children:b.changes.unreadCount(H.unreadCount)})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5 shrink-0",children:[(0,d.jsx)("button",{type:"button",onClick:()=>Q(a=>!a),className:`inline-flex items-center gap-1.5 px-3 py-2 rounded-lg text-xs font-medium transition-all duration-150 focus-visible:ring-2 focus-visible:ring-ring ${P?"bg-[var(--amber)]/10 text-[var(--amber)]":"bg-muted/50 text-muted-foreground hover:text-foreground hover:bg-muted"}`,title:b.changes.filters.source,children:(0,d.jsx)(t.A,{size:14})}),(0,d.jsx)("button",{type:"button",onClick:()=>void R(),className:"inline-flex items-center gap-1.5 px-3 py-2 rounded-lg text-xs font-medium bg-muted/50 text-muted-foreground hover:text-foreground hover:bg-muted transition-all duration-150 focus-visible:ring-2 focus-visible:ring-ring",title:b.changes.refresh,children:(0,d.jsx)(u.A,{size:14})}),H.unreadCount>0&&(0,d.jsxs)("button",{type:"button",onClick:()=>void S(),className:"inline-flex items-center gap-1.5 px-3 py-2 rounded-lg text-xs font-medium bg-muted/50 text-muted-foreground hover:text-foreground hover:bg-muted transition-all duration-150 focus-visible:ring-2 focus-visible:ring-ring",title:b.changes.markAllRead,children:[(0,d.jsx)("span",{className:"hidden sm:inline",children:b.changes.markAllRead}),(0,d.jsx)("span",{className:"inline sm:hidden",children:"✓"})]})]})]}),(0,d.jsx)("div",{className:`grid transition-[grid-template-rows] duration-200 ease-out ${P?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:(0,d.jsx)("div",{className:"overflow-hidden",children:(0,d.jsx)("div",{className:"rounded-lg border border-border/60 bg-card/60 p-4 mb-4",children:(0,d.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground block mb-1.5",children:b.changes.filters.source}),(0,d.jsx)(A.A,{value:c,onChange:a=>f(a),options:T})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground block mb-1.5",children:b.changes.filters.keyword}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)(v.A,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground/50"}),(0,d.jsx)("input",{value:D,onChange:a=>E(a.target.value),placeholder:b.changes.filters.keywordPlaceholder,className:"w-full pl-9 pr-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground placeholder:text-muted-foreground/40 outline-none focus-visible:ring-1 focus-visible:ring-ring hover:border-border/80 transition-all"})]})]})]})})})}),L&&(0,d.jsxs)("div",{className:"space-y-2.5",children:[(0,d.jsx)(C,{}),(0,d.jsx)(C,{}),(0,d.jsx)(C,{})]}),!L&&N&&(0,d.jsxs)("div",{className:"rounded-lg border border-error/20 bg-error/5 p-4 text-sm text-error",children:[N,(0,d.jsx)("button",{onClick:()=>void R(),className:"ml-2 underline hover:no-underline font-medium",children:b.changes.refresh})]}),!L&&!N&&0===F.length&&(0,d.jsx)("div",{className:"rounded-lg border border-border/60 bg-card/60 p-8 md:p-12",children:(0,d.jsxs)("div",{className:"flex flex-col items-center text-center",children:[(0,d.jsx)("div",{className:"mb-4 p-4 bg-muted/50 rounded-lg",children:(0,d.jsx)(o.A,{size:28,className:"text-muted-foreground/60"})}),(0,d.jsx)("h3",{className:"text-base font-semibold text-foreground mb-1",children:b.changes.empty}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground max-w-sm",children:b.changes.emptyHint})]})}),!L&&!N&&F.length>0&&(0,d.jsx)("div",{className:"space-y-2",children:F.map(a=>{var c,e,f,s;let t,u,v=!!J[a.id],y=(0,B.m)(a.before??"",a.after??""),z=(0,B.S)(y),A=y.filter(a=>"insert"===a.type).length,C=y.filter(a=>"delete"===a.type).length;return(0,d.jsxs)("div",{className:"group rounded-lg border border-border/60 bg-card/70 overflow-hidden transition-all duration-150 hover:border-border hover:bg-card hover:shadow-sm",children:[(0,d.jsx)("button",{type:"button",onClick:()=>K(b=>({...b,[a.id]:!b[a.id]})),className:"w-full px-4 py-3 text-left focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring hover:bg-muted/20 transition-all",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsxs)("div",{className:"pt-0.5 text-muted-foreground/60 shrink-0 relative",children:[v&&(0,d.jsx)("div",{className:"absolute -left-4 top-0 bottom-0 w-[2px] rounded-r-full bg-[var(--amber)]"}),v?(0,d.jsx)(w.A,{size:15}):(0,d.jsx)(x.A,{size:15})]}),(0,d.jsx)("div",{className:"w-7 h-7 rounded-md bg-muted/50 flex items-center justify-center shrink-0 text-muted-foreground group-hover:bg-muted transition-all",children:"create_file"===(c=a.op)||"create_space"===c?(0,d.jsx)(h.A,{size:14}):"delete_file"===c?(0,d.jsx)(i.A,{size:14}):"update_lines"===c||"update_section"===c?(0,d.jsx)(j.A,{size:14}):"insert_lines"===c||"insert_after_heading"===c?(0,d.jsx)(k.A,{size:14}):"append_to_file"===c||"append_csv"===c?(0,d.jsx)(l.A,{size:14}):"rename_file"===c||"rename_space"===c||"move_file"===c?(0,d.jsx)(m.A,{size:14}):"import_file"===c?(0,d.jsx)(n.A,{size:14}):(0,d.jsx)(o.A,{size:14})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground",children:function(a,b){let c=b.changes.summaries;if("Updated file content"===a)return c.updatedFileContent;if("Appended content to file"===a)return c.appendedContent;if("Moved to trash"===a)return c.movedToTrash;if("Created file"===a)return c.createdFile;if("Created space"===a)return c.createdSpace;if("Imported file into knowledge base"===a)return c.importedFile;let d=a.match(/^Inserted (\d+) line\(s\)$/);if(d)return c.insertedLines(Number(d[1]));let e=a.match(/^Updated lines (\d+)-(\d+)$/);if(e)return c.updatedLines(Number(e[1]),Number(e[2]));let f=a.match(/^Inserted content after heading "(.+)"$/);if(f)return c.insertedAfterHeading(f[1]);let g=a.match(/^Updated section "(.+)"$/);if(g)return c.updatedSection(g[1]);let h=a.match(/^Renamed file to (.+)$/);if(h)return c.renamedFile(h[1]);let i=a.match(/^Moved file to (.+)$/);if(i)return c.movedFile(i[1]);let j=a.match(/^Renamed space to (.+)$/);if(j)return c.renamedSpace(j[1]);let k=a.match(/^Appended CSV row \((\d+) cells?\)$/);return k?c.appendedCsvRow(Number(k[1])):a.startsWith("Imported legacy agent diff")?c.importedLegacyDiff:a}(a.summary,b)}),(A>0||C>0)&&(0,d.jsxs)("span",{className:"text-xs font-mono text-muted-foreground/70",children:[A>0&&(0,d.jsxs)("span",{className:"text-success font-semibold",children:["+",A]}),A>0&&C>0&&(0,d.jsx)("span",{className:"mx-0.5",children:"\xb7"}),C>0&&(0,d.jsxs)("span",{className:"text-error font-semibold",children:["-",C]})]})]}),(0,d.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[(0,d.jsx)("span",{className:"rounded-md px-2 py-0.5 bg-[var(--amber-dim)] text-[var(--amber)] text-xs font-medium truncate inline-block max-w-[200px]",title:a.path,children:a.path}),(0,d.jsxs)("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-md text-xs font-medium ${"agent"===(e=a.source)?"bg-[var(--info)]/10 text-[var(--info)] border border-[var(--info)]/20":"user"===e?"bg-[var(--success)]/10 text-[var(--success)] border border-[var(--success)]/20":"bg-muted text-muted-foreground border border-border"} transition-colors`,children:["agent"===(f=a.source)?(0,d.jsx)(p.A,{size:13}):"user"===f?(0,d.jsx)(q.A,{size:13}):(0,d.jsx)(r.A,{size:13}),U(a.source)]}),(0,d.jsx)("span",{className:`text-xs font-medium ${(s=a.op).startsWith("create")||"import_file"===s?"text-success":s.startsWith("delete")?"text-error":s.startsWith("rename")||s.startsWith("move")?"text-muted-foreground":""}`,children:V(a.op)}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground/60 ml-auto shrink-0",children:function(a,b){let c=Math.floor((Date.now()-new Date(a).getTime())/6e4);if(c<1)return b.changes.relativeTime.justNow;if(c<60)return b.changes.relativeTime.minutesAgo(c);let d=Math.floor(c/60);return d<24?b.changes.relativeTime.hoursAgo(d):b.changes.relativeTime.daysAgo(Math.floor(d/24))}(a.ts,b)})]})]}),(0,d.jsx)(g(),{href:`/view/${a.path.split("/").map(encodeURIComponent).join("/")}`,className:"inline-flex items-center px-2.5 py-1 rounded-md text-xs font-medium bg-[var(--amber)]/10 text-[var(--amber)] hover:bg-[var(--amber)] hover:text-[var(--amber-foreground)] focus-visible:ring-2 focus-visible:ring-ring transition-all duration-150 shrink-0",onClick:a=>a.stopPropagation(),title:b.changes.open,children:b.changes.open})]})}),v&&(t=1,u=1,(0,d.jsx)("div",{className:"border-t border-border/50 bg-background/60 max-h-80 overflow-y-auto",children:z.map((c,e)=>{if("gap"===c.type)return t+=c.count,u+=c.count,(0,d.jsx)("div",{className:"px-4 py-2 text-xs text-muted-foreground/50 border-y border-border/30 bg-muted/10 text-center font-medium",children:b.changes.unchangedLines(c.count)},`${a.id}-gap-${e}`);let f="insert"===c.type?"+":"delete"===c.type?"-":" ",g="insert"!==c.type?t:"",h="delete"!==c.type?u:"";return"insert"!==c.type&&t++,"delete"!==c.type&&u++,(0,d.jsxs)("div",{className:`flex items-start text-xs font-mono leading-6 px-4 ${"insert"===c.type?"bg-success/5 hover:bg-success/8":"delete"===c.type?"bg-error/5 hover:bg-error/8":"hover:bg-muted/20"} transition-colors`,children:[(0,d.jsx)("span",{className:"w-8 shrink-0 text-right pr-2 select-none text-muted-foreground/40",children:g}),(0,d.jsx)("span",{className:"w-8 shrink-0 text-right pr-2 select-none text-muted-foreground/40",children:h}),(0,d.jsx)("span",{className:`w-3 shrink-0 text-center select-none font-bold ${"insert"===c.type?"text-success":"delete"===c.type?"text-error":"text-muted-foreground/20"}`,children:f}),(0,d.jsx)("span",{className:`flex-1 whitespace-pre-wrap break-all overflow-hidden ${"insert"===c.type?"text-success":"delete"===c.type?"text-error":"text-muted-foreground"}`,children:c.text||"\xa0"})]},`${a.id}-${e}`)})}))]},a.id)})})]})}},42529:(a,b,c)=>{"use strict";c.d(b,{A:()=>p});var d=c(48249),e=c(67484),f=c(10316),g=c(46674),h=c(35389),i=c(22341),j=c(59347),k=c(93017),l=c(3129),m=c(12625),n=c(54461),o=c(47223);function p({sessions:a,activeSessionId:b,onLoad:c,onDelete:k,onRename:l,onTogglePin:m,onClearAll:p,onClose:r,onNewChat:s}){let{t}=(0,o.Y)(),u=t.ask,[v,w]=(0,e.useState)(""),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(""),[B,C]=(0,e.useState)(!1),D=(0,e.useRef)(void 0),E=(0,e.useRef)(null),F=(0,e.useRef)(null),G=(0,e.useMemo)(()=>{if(!v.trim())return a;let b=v.toLowerCase();return a.filter(a=>!!(0,n.d)(a).toLowerCase().includes(b)||a.messages.some(a=>a.content.toLowerCase().includes(b)))},[a,v]),H=(0,e.useMemo)(()=>{let a=[],b=[],c=[],d=[],e=[];for(let f of G){if(f.pinned){a.push(f);continue}let g=function(a){let b=new Date,c=new Date(b.getFullYear(),b.getMonth(),b.getDate()).getTime(),d=c-864e5*b.getDay();return a>=c?"today":a>=c-864e5?"yesterday":a>=d?"week":"older"}(f.updatedAt);"today"===g?b.push(f):"yesterday"===g?c.push(f):"week"===g?d.push(f):e.push(f)}return{pinned:a,today:b,yesterday:c,week:d,older:e}},[G]),I=a.filter(a=>a.pinned).length,J=a.filter(a=>a.messages.length>0).length,K=(0,e.useCallback)(a=>{c(a),r()},[c,r]),L=(0,e.useCallback)(()=>{s(),r()},[s,r]),M=(0,e.useCallback)(a=>{y(a.id),A((0,n.d)(a))},[]),N=(0,e.useCallback)(()=>{x&&z.trim()&&l(x,z.trim()),y(null)},[x,z,l]),O=(0,e.useCallback)(()=>{if(!B){C(!0),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>C(!1),3e3);return}D.current&&clearTimeout(D.current),p(),C(!1)},[B,p]),P=(a,c)=>0===c.length?null:(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-2xs font-medium text-muted-foreground/50 uppercase tracking-wider px-1 py-2",children:a}),(0,d.jsx)("div",{className:"flex flex-col gap-1",children:c.map(a=>(0,d.jsx)(q,{session:a,isActive:a.id===b,editing:x===a.id,editValue:z,onEditValueChange:A,inputRef:F,onLoad:()=>K(a.id),onStartRename:()=>M(a),onCommitRename:N,onCancelRename:()=>y(null),onDelete:()=>k(a.id),onTogglePin:()=>m(a.id),ask:u},a.id))})]},a),Q=G.length>0;return(0,d.jsxs)("div",{className:"flex flex-col flex-1 min-h-0 animate-in fade-in-0 duration-150",children:[(0,d.jsx)("div",{className:"px-4 pt-3 pb-2 shrink-0",children:(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)(f.A,{size:13,className:"absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground/50"}),(0,d.jsx)("input",{ref:E,type:"text",value:v,onChange:a=>w(a.target.value),placeholder:u?.historySearch??"Search conversations...",className:"w-full pl-8 pr-8 py-2 text-xs rounded-lg border border-border bg-background text-foreground placeholder:text-muted-foreground/40 outline-none focus-visible:border-[var(--amber)]/40 transition-colors"}),v&&(0,d.jsx)("button",{type:"button",onClick:()=>w(""),className:"absolute right-2 top-1/2 -translate-y-1/2 p-0.5 rounded text-muted-foreground/40 hover:text-foreground",children:(0,d.jsx)(g.A,{size:12})})]})}),(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 pb-2 shrink-0",children:[(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground/60",children:[u?.historyStats?.(J)??`${J} conversations`,I>0&&(0,d.jsxs)(d.Fragment,{children:[" \xb7 ",I," ",u?.historyPinned??"pinned"]})]}),(0,d.jsxs)("button",{type:"button",onClick:L,className:"flex items-center gap-1 text-2xs text-[var(--amber)] hover:text-[var(--amber)]/80 transition-colors",children:[(0,d.jsx)(h.A,{size:11}),(0,d.jsx)("span",{children:t.hints?.newChat??"New chat"})]})]}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0 px-3 pb-3",children:Q?(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[P(u?.historyPinned??"Pinned",H.pinned),P(u?.historyToday??"Today",H.today),P(u?.historyYesterday??"Yesterday",H.yesterday),P(u?.historyThisWeek??"This week",H.week),P(u?.historyOlder??"Older",H.older)]}):(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,d.jsx)(i.A,{size:32,className:"text-muted-foreground/20 mb-3"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground/60",children:v?"No matching conversations":u?.historyEmpty??"No conversations yet"}),!v&&(0,d.jsx)("p",{className:"text-2xs text-muted-foreground/40 mt-1",children:u?.historyEmptyHint??"Start a new chat to begin"})]})}),J>0&&(0,d.jsxs)("div",{className:"flex items-center justify-between px-4 py-2.5 border-t border-border/40 shrink-0",children:[(0,d.jsx)("button",{type:"button",onClick:O,className:`text-2xs px-2 py-0.5 rounded-md transition-colors ${B?"bg-error/10 text-error font-medium":"text-muted-foreground/50 hover:text-error hover:bg-muted"}`,children:(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[(0,d.jsx)(j.A,{size:10}),B?u?.confirmClear??"Confirm clear?":u?.clearAll??"Clear all"]})}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 tabular-nums",children:u?.historyCapacity?.(J)??`${J} of 30`})]})]})}function q({session:a,isActive:b,editing:c,editValue:e,onEditValueChange:f,inputRef:g,onLoad:h,onStartRename:o,onCommitRename:p,onCancelRename:q,onDelete:r,onTogglePin:s,ask:t}){let u=(0,n.d)(a),v=function(a){let b=a.messages.find(a=>"user"===a.role);if(!b)return"";let c=b.content.replace(/\s+/g," ").trim();return c.length>60?`${c.slice(0,60)}...`:c}(a),w=a.messages.length;return(0,d.jsxs)("div",{className:`group relative rounded-lg transition-colors cursor-pointer ${b?"bg-[var(--amber)]/8 border border-[var(--amber)]/15":"hover:bg-muted/60 border border-transparent"}`,onClick:h,children:[b&&(0,d.jsx)("span",{className:"absolute left-0 top-3 bottom-3 w-[2px] rounded-r-full bg-[var(--amber)]"}),(0,d.jsxs)("div",{className:"px-3 py-2.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-0.5",children:[a.pinned&&(0,d.jsx)(k.A,{size:10,className:"shrink-0 text-[var(--amber)]/60 -rotate-45"}),c?(0,d.jsx)("input",{ref:g,type:"text",value:e,onChange:a=>f(a.target.value),onBlur:p,onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),p()),"Escape"===a.key&&(a.preventDefault(),q())},onClick:a=>a.stopPropagation(),className:"flex-1 min-w-0 bg-transparent border-b border-[var(--amber)] outline-none text-xs font-medium text-foreground"}):(0,d.jsx)("span",{className:"flex-1 min-w-0 text-xs font-medium text-foreground truncate",children:u}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 shrink-0 tabular-nums",children:function(a){let b=Math.floor((Date.now()-a.getTime())/6e4);if(b<1)return"just now";if(b<60)return`${b}m ago`;let c=Math.floor(b/60);if(c<24)return`${c}h ago`;let d=Math.floor(c/24);return d<7?`${d}d ago`:a.toLocaleDateString(void 0,{month:"short",day:"numeric"})}(new Date(a.updatedAt))})]}),!c&&v&&(0,d.jsx)("p",{className:"text-2xs text-muted-foreground/50 truncate mt-0.5 pl-0.5",children:v}),!c&&(0,d.jsxs)("div",{className:"flex items-center justify-between mt-1.5",children:[(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground/40 flex items-center gap-1",children:[(0,d.jsx)(i.A,{size:9}),t?.historyMsgs?.(w)??`${w} msgs`]}),(0,d.jsxs)("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",onClick:a=>a.stopPropagation(),children:[(0,d.jsx)("button",{type:"button",onClick:s,className:`p-1 rounded-md transition-colors ${a.pinned?"text-[var(--amber)] hover:text-muted-foreground":"text-muted-foreground/40 hover:text-[var(--amber)]"}`,title:a.pinned?"Unpin":"Pin",children:a.pinned?(0,d.jsx)(l.A,{size:11}):(0,d.jsx)(k.A,{size:11})}),(0,d.jsx)("button",{type:"button",onClick:o,className:"p-1 rounded-md text-muted-foreground/40 hover:text-foreground hover:bg-muted/60 transition-colors",title:t?.renameSession??"Rename",children:(0,d.jsx)(m.A,{size:11})}),(0,d.jsx)("button",{type:"button",onClick:r,className:"p-1 rounded-md text-muted-foreground/40 hover:text-error hover:bg-error/5 transition-colors",title:"Delete",children:(0,d.jsx)(j.A,{size:11})})]})]})]})]})}},43248:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(48249);function e({error:a,reset:b}){return(0,d.jsx)("html",{lang:"en",children:(0,d.jsx)("body",{style:{margin:0,fontFamily:"'IBM Plex Sans', system-ui, sans-serif",background:"#131210",color:"#e8e4dc"},children:(0,d.jsxs)("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"100vh",gap:"16px",padding:"24px",textAlign:"center"},children:[(0,d.jsx)("h2",{style:{fontSize:"18px",fontWeight:600,margin:0},children:"Something went wrong"}),(0,d.jsx)("p",{style:{fontSize:"14px",color:"#8a8275",maxWidth:"400px",margin:0},children:a.message||"An unexpected error occurred. Please try again."}),(0,d.jsxs)("div",{style:{display:"flex",gap:"12px",marginTop:"8px"},children:[(0,d.jsx)("button",{onClick:b,style:{padding:"8px 16px",borderRadius:"6px",fontSize:"14px",fontWeight:500,background:"#1c1a17",color:"#e8e4dc",border:"1px solid rgba(232,228,220,0.08)",cursor:"pointer"},children:"Try again"}),(0,d.jsx)("a",{href:"/setup",style:{padding:"8px 16px",borderRadius:"6px",fontSize:"14px",fontWeight:500,background:"#c8873a",color:"#fff",textDecoration:"none",cursor:"pointer"},children:"Go to Setup"})]})]})})})}},43951:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ChangeLogRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ChangeLogRenderer() from the server but ChangeLogRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/change-log/ChangeLogRenderer.tsx","ChangeLogRenderer")},45108:(a,b,c)=>{"use strict";c.d(b,{u:()=>h});var d=c(67484);let e=new Set(["image/png","image/jpeg","image/gif","image/webp"]);async function f(a){let b=a.type;if(a.size<=5242880){let c=new Uint8Array(await a.arrayBuffer()),d="";for(let a=0;a<c.length;a+=32768)d+=String.fromCharCode(...c.subarray(a,a+32768));return{data:btoa(d),mimeType:b}}return new Promise((b,c)=>{let d=new Image,e=URL.createObjectURL(a);d.onload=()=>{let{width:a,height:f}=d;if(a>1920||f>1920){let b=Math.min(1920/a,1920/f);a=Math.round(a*b),f=Math.round(f*b)}let g=document.createElement("canvas");g.width=a,g.height=f;let h=g.getContext("2d");if(!h){URL.revokeObjectURL(e),c(Error("Canvas not supported"));return}h.drawImage(d,0,0,a,f);let i=g.toDataURL("image/jpeg",.85).split(",")[1];URL.revokeObjectURL(e),b({data:i,mimeType:"image/jpeg"})},d.onerror=()=>{URL.revokeObjectURL(e),c(Error("Failed to load image"))},d.src=e})}function g(a){let b=[];for(let c of Array.from(a))if("file"===c.kind&&e.has(c.type)){let a=c.getAsFile();a&&b.push(a)}return b}function h(){let[a,b]=(0,d.useState)([]),[c,h]=(0,d.useState)(""),i=(0,d.useCallback)(async a=>{h("");let c=a.slice(0,4),d=[];for(let a of c){var g;if(g=a.type,!e.has(g)){h(`Unsupported image type: ${a.type}`);continue}try{let{data:b,mimeType:c}=await f(a);d.push({type:"image",data:b,mimeType:c,fileName:a.name||void 0})}catch{h(`Failed to process image: ${a.name}`)}}b(a=>{let b=[...a,...d];return b.length>4?(h("Maximum 4 images allowed"),b.slice(0,4)):b})},[]),j=(0,d.useCallback)(async a=>{let b=a.clipboardData?.items;if(!b)return!1;let c=g(b);return 0!==c.length&&(await i(c),!0)},[i]),k=(0,d.useCallback)(async a=>{let b=a.dataTransfer?.items;if(!b)return;let c=g(b);c.length>0&&(a.preventDefault(),await i(c))},[i]),l=(0,d.useCallback)(async a=>{if(!a)return;let b=Array.from(a).filter(a=>{var b;return b=a.type,e.has(b)});await i(b)},[i]);return{images:a,imageError:c,addImages:i,handlePaste:j,handleDrop:k,handleFileSelect:l,removeImage:(0,d.useCallback)(a=>{b(b=>b.filter((b,c)=>c!==a))},[]),clearImages:(0,d.useCallback)(()=>{b([]),h("")},[])}}},45862:(a,b,c)=>{"use strict";c.r(b),c.d(b,{SummaryRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call SummaryRenderer() from the server but SummaryRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/summary/SummaryRenderer.tsx","SummaryRenderer")},46427:(a,b,c)=>{"use strict";c.r(b),c.d(b,{CsvRenderer:()=>D});var d=c(48249),e=c(67484),f=c.n(e),g=c(93053),h=c(75155),i=c(22242),j=c(91282),k=c(65732),l=c.n(k);function m(a,b){return l().unparse([a,...b])}let n=[{bg:"rgba(200,135,58,0.12)",text:"var(--amber)"},{bg:"rgba(122,173,128,0.12)",text:"var(--success)"},{bg:"rgba(138,180,216,0.12)",text:"#8ab4d8"},{bg:"rgba(200,160,216,0.12)",text:"#c8a0d8"},{bg:"rgba(200,96,96,0.12)",text:"#c86060"},{bg:"rgba(150,150,150,0.12)",text:"var(--muted-foreground)"}];function o(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)&65535;return n[b%n.length]}var p=c(82884),q=c(72419),r=c(44218),s=c(59347),t=c(24520);function u({value:a,onCommit:b}){let[c,f]=(0,e.useState)(!1),[g,h]=(0,e.useState)(a),i=(0,e.useRef)(null);function j(){f(!1),g!==a?b(g):h(a)}return c?(0,d.jsx)("input",{ref:i,value:g,onChange:a=>h(a.target.value),onBlur:j,onKeyDown:b=>{"Enter"===b.key&&j(),"Escape"===b.key&&(h(a),f(!1))},className:"w-full bg-transparent outline-none text-sm",onClick:a=>a.stopPropagation(),style:{color:"var(--foreground)",borderBottom:"1px solid var(--amber)",minWidth:60}}):(0,d.jsx)("div",{className:"truncate text-sm cursor-text",style:{color:"var(--foreground)",minWidth:60},onClick:()=>f(!0),title:a,children:a||(0,d.jsx)("span",{style:{color:"var(--muted-foreground)",opacity:.3},children:"—"})})}function v({headers:a,visibleIndices:b,onAdd:c,onCancel:f}){let[g,h]=(0,e.useState)(()=>Array(a.length).fill(""));return(0,d.jsxs)("tr",{style:{background:"color-mix(in srgb, var(--amber) 6%, transparent)",borderTop:"1px solid var(--amber)"},children:[b.map((b,e)=>(0,d.jsx)("td",{className:"px-3 py-2",style:{borderBottom:"1px solid var(--border)"},children:(0,d.jsx)("input",{autoFocus:0===e,value:g[b],onChange:a=>{var c;return c=a.target.value,void h(a=>{let d=[...a];return d[b]=c,d})},onKeyDown:a=>{"Enter"===a.key&&c(g),"Escape"===a.key&&f()},placeholder:a[b],className:"w-full bg-transparent outline-none text-sm placeholder:opacity-30",style:{color:"var(--foreground)",borderBottom:"1px solid var(--border)"}})},b)),(0,d.jsx)("td",{className:"px-2 py-2",style:{borderBottom:"1px solid var(--border)"}})]})}function w({headers:a,rows:b,cfg:c,saveAction:g}){let[h,i]=(0,e.useState)(b),[j,k]=(0,e.useState)(!1),l=(0,e.useMemo)(()=>a.map((a,b)=>b).filter(b=>!c.hiddenFields.includes(a[b])),[a,c.hiddenFields]),n=a.indexOf(c.sortField),o=(0,e.useMemo)(()=>{let a=[...h];return n>=0&&a.sort((a,b)=>{let d=a[n]??"",e=b[n]??"",f=parseFloat(d),g=parseFloat(e),h=isNaN(f)||isNaN(g)?d.localeCompare(e):f-g;return"asc"===c.sortDir?h:-h}),a},[h,n,c.sortDir]),p=a.indexOf(c.groupField),w=(0,e.useMemo)(()=>{if(p<0)return[{key:null,rows:o.map(a=>({row:a,orig:a}))}];let a=new Map;for(let b of o){let c=b[p]||"(empty)";a.has(c)||a.set(c,[]),a.get(c).push(b)}return[...a.entries()].map(([a,b])=>({key:a,rows:b.map(a=>({row:a,orig:a}))}))},[o,p]);async function x(b,c,d){let e=h.map(a=>a===b?a.map((a,b)=>b===c?d:a):a);i(e),await g(m(a,e))}async function y(b){let c=h.filter(a=>a!==b);i(c),await g(m(a,c))}async function z(b){let c=[...h,b];i(c),k(!1),await g(m(a,c))}let A={borderBottom:"1px solid var(--border)",fontSize:"0.72rem",letterSpacing:"0.05em",textTransform:"uppercase",color:"var(--muted-foreground)",fontWeight:600},B=0;return(0,d.jsxs)("div",{className:"rounded-xl overflow-hidden border",style:{borderColor:"var(--border)"},children:[(0,d.jsx)("div",{className:"overflow-x-auto",children:(0,d.jsxs)("table",{className:"min-w-full text-sm border-collapse",children:[(0,d.jsx)("thead",{children:(0,d.jsxs)("tr",{style:{background:"var(--muted)"},children:[l.map(b=>(0,d.jsx)("th",{className:"px-4 py-2.5 text-left whitespace-nowrap",style:A,children:(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[a[b],c.sortField===a[b]&&("asc"===c.sortDir?(0,d.jsx)(q.A,{size:10,style:{color:"var(--amber)"}}):(0,d.jsx)(r.A,{size:10,style:{color:"var(--amber)"}}))]})},b)),(0,d.jsx)("th",{className:"w-8",style:{...A,background:"var(--muted)"}})]})}),(0,d.jsxs)("tbody",{children:[w.map((a,b)=>(0,d.jsxs)(f().Fragment,{children:[null!==a.key&&(0,d.jsx)("tr",{children:(0,d.jsx)("td",{colSpan:l.length+1,className:"px-4 py-1.5",style:{background:"var(--accent)",borderBottom:"1px solid var(--border)",borderTop:"1px solid var(--border)"},children:(0,d.jsxs)("span",{className:"text-xs font-semibold font-display",style:{color:"var(--muted-foreground)"},children:[a.key," \xb7 ",a.rows.length]})})},`grp-${a.key}`),a.rows.map(({row:a,orig:b})=>{let c=B++;return(0,d.jsxs)("tr",{className:"group transition-colors",style:{background:c%2==0?"var(--background)":"var(--card)"},onMouseEnter:a=>a.currentTarget.style.background="var(--muted)",onMouseLeave:a=>a.currentTarget.style.background=c%2==0?"var(--background)":"var(--card)",children:[l.map(c=>(0,d.jsx)("td",{className:"px-4 py-2 max-w-xs",style:{borderBottom:"1px solid var(--border)"},children:(0,d.jsx)(u,{value:a[c]??"",onCommit:a=>x(b,c,a)})},c)),(0,d.jsx)("td",{className:"px-2 py-2",style:{borderBottom:"1px solid var(--border)"},children:(0,d.jsx)("button",{onClick:()=>y(b),className:"opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded hover:bg-destructive/10",style:{color:"var(--muted-foreground)"},children:(0,d.jsx)(s.A,{size:12})})})]},c)})]},a.key??`section-${b}`)),j&&(0,d.jsx)(v,{headers:a,visibleIndices:l,onAdd:z,onCancel:()=>k(!1)})]})]})}),(0,d.jsxs)("div",{className:"px-4 py-2 flex items-center justify-between",style:{background:"var(--muted)",borderTop:"1px solid var(--border)"},children:[(0,d.jsxs)("span",{className:"text-xs font-display",style:{color:"var(--muted-foreground)"},children:[h.length," rows \xb7 ",a.length," cols"]}),j?(0,d.jsx)("button",{onClick:()=>k(!1),className:"text-xs px-2.5 py-1 rounded-md",style:{color:"var(--muted-foreground)"},children:"Cancel"}):(0,d.jsxs)("button",{onClick:()=>k(!0),className:"flex items-center gap-1 text-xs px-2.5 py-1 rounded-md",style:{color:"var(--amber)",background:"var(--amber-dim)"},children:[(0,d.jsx)(t.A,{size:12})," Add row"]})]})]})}function x({headers:a,rows:b,cfg:c}){let e=a.indexOf(c.titleField),f=a.indexOf(c.descField),g=a.indexOf(c.tagField);return(0,d.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:b.map((b,c)=>{let h=e>=0?b[e]:b[0]??"",i=f>=0?b[f]:"",j=g>=0?b[g]:"",k=j?o(j):null;return(0,d.jsxs)("div",{className:"rounded-xl border p-4 flex flex-col gap-2 hover:bg-muted/50 transition-colors",style:{borderColor:"var(--border)",background:"var(--card)"},children:[j&&k&&(0,d.jsx)("span",{className:"self-start text-xs px-2 py-0.5 rounded-full font-medium",style:{background:k.bg,color:k.text},children:j}),(0,d.jsx)("p",{className:"text-sm font-semibold leading-snug",style:{color:"var(--foreground)"},children:h}),i&&(0,d.jsx)("p",{className:"text-xs leading-relaxed line-clamp-3",style:{color:"var(--muted-foreground)"},children:i}),(0,d.jsx)("div",{className:"mt-1 flex flex-col gap-0.5",children:a.map((a,c)=>{if(c===e||c===f||c===g)return null;let h=b[c];return h?(0,d.jsxs)("div",{className:"flex items-baseline gap-1.5 text-xs",children:[(0,d.jsx)("span",{className:"font-display",style:{color:"var(--muted-foreground)",opacity:.6,fontSize:"0.68rem"},children:a}),(0,d.jsx)("span",{className:"truncate",style:{color:"var(--muted-foreground)"},children:h})]},c):null})})]},c)})})}function y({headers:a,rows:b,cfg:c,saveAction:f}){let[g,h]=(0,e.useState)(b),[i,j]=(0,e.useState)(null),[k,l]=(0,e.useState)(""),[n,p]=(0,e.useState)(!1),q=a.indexOf(c.groupField),r=a.indexOf(c.titleField),s=a.indexOf(c.descField),{groups:u,groupKeys:v}=(0,e.useMemo)(()=>{let a=new Map;return g.forEach((b,c)=>{let d=(q>=0?b[q]:"")||"(empty)";a.has(d)||a.set(d,[]),a.get(d).push({row:b,origIdx:c})}),{groups:a,groupKeys:[...a.keys()]}},[g,q]);async function w(b,c){let d=g.map((a,d)=>{if(d!==b)return a;let e=[...a];return q>=0&&(e[q]=c),e});h(d),await f(m(a,d))}function x({group:b}){let c=u.get(b)??[],e=o(b),f=i===b;return(0,d.jsxs)("div",{className:"flex-shrink-0 w-64 flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[(0,d.jsx)("span",{className:"w-2.5 h-2.5 rounded-full shrink-0",style:{background:e.text}}),(0,d.jsx)("span",{className:"text-xs font-semibold uppercase tracking-wider truncate font-display",style:{color:e.text},children:b}),(0,d.jsx)("span",{className:"text-xs ml-auto shrink-0",style:{color:"var(--muted-foreground)",opacity:.5},children:c.length})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 rounded-xl p-1.5 min-h-[80px] transition-colors",style:{background:f?"var(--amber-dim)":"var(--muted)",border:`1px solid ${f?"var(--amber)":"transparent"}`},onDragOver:a=>{a.preventDefault(),j(b)},onDragLeave:a=>{a.currentTarget.contains(a.relatedTarget)||j(null)},onDrop:a=>{j(null);let c=parseInt(a.dataTransfer.getData("origIdx"));isNaN(c)||w(c,b)},children:[c.map(({row:b,origIdx:c})=>{let e=r>=0?b[r]:b[0]??"",f=s>=0?b[s]:"";return(0,d.jsxs)("div",{draggable:!0,onDragStart:a=>{a.dataTransfer.setData("origIdx",String(c)),j(null)},onDragEnd:()=>j(null),className:"rounded-lg border p-3 flex flex-col gap-1.5 cursor-grab active:cursor-grabbing hover:bg-muted/50 transition-colors",style:{borderColor:"var(--border)",background:"var(--card)"},children:[(0,d.jsx)("p",{className:"text-sm font-medium leading-snug",style:{color:"var(--foreground)"},children:e}),f&&(0,d.jsx)("p",{className:"text-xs leading-relaxed line-clamp-2",style:{color:"var(--muted-foreground)"},children:f}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1 mt-0.5",children:a.map((a,c)=>{if(c===q||c===r||c===s)return null;let e=b[c];return e?(0,d.jsxs)("span",{className:"text-2xs px-1.5 py-0.5 rounded font-display",style:{background:"var(--muted)",color:"var(--muted-foreground)"},children:[a,": ",e]},c):null})})]},c)}),0===c.length&&(0,d.jsx)("div",{className:"flex items-center justify-center h-12",children:(0,d.jsx)("span",{className:"text-xs",style:{color:"var(--muted-foreground)",opacity:.4},children:"Drop here"})})]})]})}return(0,d.jsxs)("div",{className:"flex gap-3 overflow-x-auto pb-3 items-start",children:[v.map(a=>(0,d.jsx)(x,{group:a},a)),(0,d.jsx)("div",{className:"flex-shrink-0 w-64",children:n?(0,d.jsxs)("div",{className:"rounded-xl border p-3 flex flex-col gap-2",style:{borderColor:"var(--border)",background:"var(--card)"},children:[(0,d.jsx)("input",{autoFocus:!0,value:k,onChange:a=>l(a.target.value),onKeyDown:a=>{"Enter"===a.key&&k.trim()&&(l(""),p(!1)),"Escape"===a.key&&(l(""),p(!1))},placeholder:"Column name…",className:"text-xs bg-transparent outline-none w-full font-display",style:{color:"var(--foreground)",borderBottom:"1px solid var(--amber)"}}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{onClick:()=>{l(""),p(!1)},className:"text-xs px-2 py-1 rounded font-display",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:"Create"}),(0,d.jsx)("button",{onClick:()=>{l(""),p(!1)},className:"text-xs px-2 py-1 rounded font-display",style:{color:"var(--muted-foreground)"},children:"Cancel"})]})]}):(0,d.jsxs)("button",{onClick:()=>p(!0),className:"flex items-center gap-1.5 text-xs px-3 py-2 rounded-xl border border-dashed w-full transition-colors hover:bg-muted font-display",style:{borderColor:"var(--border)",color:"var(--muted-foreground)"},children:[(0,d.jsx)(t.A,{size:12})," Add column"]})})]})}var z=c(46674),A=c(27608);function B({headers:a,cfg:b,view:c,onClose:e,onChange:f}){let g={color:"var(--muted-foreground)",fontSize:"0.72rem"};function h({label:b,value:c,onChange:e}){return(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:"font-display",style:g,children:b}),(0,d.jsx)(A.A,{value:c,onChange:e,size:"sm",options:[{value:"",label:"— none —"},...a.map(a=>({value:a,label:a}))]})]})}return(0,d.jsxs)("div",{className:"absolute right-0 top-10 z-20 w-72 rounded-xl border shadow-xl p-4 flex flex-col gap-3",style:{background:"var(--card)",borderColor:"var(--border)"},children:[(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("span",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:[c," settings"]}),(0,d.jsx)("button",{onClick:e,style:{color:"var(--muted-foreground)"},children:(0,d.jsx)(z.A,{size:13})})]}),"table"===c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"h-px",style:{background:"var(--border)"}}),(0,d.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:"Sort"}),(0,d.jsx)(h,{label:"Sort by",value:b.table.sortField,onChange:a=>f({...b,table:{...b.table,sortField:a}})}),(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{style:g,children:"Direction"}),(0,d.jsx)("div",{className:"flex rounded overflow-hidden border",style:{borderColor:"var(--border)"},children:["asc","desc"].map(a=>(0,d.jsx)("button",{onClick:()=>f({...b,table:{...b.table,sortDir:a}}),className:"px-3 py-1 text-xs transition-colors font-display",style:{fontSize:"0.72rem",background:b.table.sortDir===a?"var(--amber)":"var(--background)",color:b.table.sortDir===a?"var(--amber-foreground)":"var(--muted-foreground)"},children:a},a))})]}),(0,d.jsx)("div",{className:"h-px",style:{background:"var(--border)"}}),(0,d.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:"Group"}),(0,d.jsx)(h,{label:"Group by",value:b.table.groupField,onChange:a=>f({...b,table:{...b.table,groupField:a}})}),(0,d.jsx)("div",{className:"h-px",style:{background:"var(--border)"}}),(0,d.jsx)("p",{className:"text-xs font-semibold uppercase tracking-wider",style:g,children:"Columns"}),(0,d.jsx)("div",{className:"flex flex-col gap-1.5",children:a.map(a=>{let c=b.table.hiddenFields.includes(a);return(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("span",{style:g,children:a}),(0,d.jsx)("button",{onClick:()=>{let d=c?b.table.hiddenFields.filter(b=>b!==a):[...b.table.hiddenFields,a];f({...b,table:{...b.table,hiddenFields:d}})},className:"text-xs px-2 py-0.5 rounded transition-colors font-display",style:{background:c?"var(--muted)":"var(--amber-dim)",color:c?"var(--muted-foreground)":"var(--amber)"},children:c?"Hidden":"Visible"})]},a)})})]}),"gallery"===c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h,{label:"Title",value:b.gallery.titleField,onChange:a=>f({...b,gallery:{...b.gallery,titleField:a}})}),(0,d.jsx)(h,{label:"Description",value:b.gallery.descField,onChange:a=>f({...b,gallery:{...b.gallery,descField:a}})}),(0,d.jsx)(h,{label:"Tag / Badge",value:b.gallery.tagField,onChange:a=>f({...b,gallery:{...b.gallery,tagField:a}})})]}),"board"===c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h,{label:"Group by",value:b.board.groupField,onChange:a=>f({...b,board:{...b.board,groupField:a}})}),(0,d.jsx)(h,{label:"Card title",value:b.board.titleField,onChange:a=>f({...b,board:{...b.board,titleField:a}})}),(0,d.jsx)(h,{label:"Card desc",value:b.board.descField,onChange:a=>f({...b,board:{...b.board,descField:a}})})]})]})}let C=[{id:"table",icon:(0,d.jsx)(g.A,{size:13}),label:"Table"},{id:"gallery",icon:(0,d.jsx)(h.A,{size:13}),label:"Gallery"},{id:"board",icon:(0,d.jsx)(i.A,{size:13}),label:"Board"}];function D({filePath:a,content:b,saveAction:c}){let{headers:f,rows:g}=(0,e.useMemo)(()=>{let a;return{headers:(a=l().parse(b,{skipEmptyLines:!0}).data)[0]??[],rows:a.slice(1)}},[b]),h=(0,e.useMemo)(()=>({activeView:"table",table:{sortField:"",sortDir:"asc",groupField:"",hiddenFields:[]},gallery:{titleField:f[0]??"",descField:f[1]??"",tagField:f[2]??""},board:{groupField:f[f.length-1]??"",titleField:f[0]??"",descField:f[1]??""}}),[f]),[i,k]=(0,p.Un)("csv",a,h),[m,n]=(0,e.useState)(!1),o=(0,e.useCallback)(a=>{k(a)},[k]),q=i.activeView;return(0,d.jsxs)("div",{className:"w-full py-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-4 relative",children:[(0,d.jsx)("div",{className:"flex items-center gap-0.5 p-1 rounded-lg",style:{background:"var(--muted)"},children:C.map(a=>(0,d.jsxs)("button",{onClick:()=>o({...i,activeView:a.id}),className:"flex items-center gap-1.5 px-3 py-1.5 rounded text-xs font-medium transition-colors font-display",style:{background:q===a.id?"var(--card)":"transparent",color:q===a.id?"var(--foreground)":"var(--muted-foreground)",boxShadow:q===a.id?"0 1px 3px rgba(0,0,0,0.1)":"none"},children:[a.icon,a.label]},a.id))}),(0,d.jsx)("div",{className:"flex-1"}),(0,d.jsxs)("span",{className:"text-xs font-display",style:{color:"var(--muted-foreground)",opacity:.5},children:[g.length," rows"]}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("button",{onClick:()=>n(a=>!a),className:"flex items-center gap-1.5 px-2.5 py-1.5 rounded-lg text-xs transition-colors",style:{background:m?"var(--accent)":"var(--muted)",color:m?"var(--foreground)":"var(--muted-foreground)"},title:"View settings",children:(0,d.jsx)(j.A,{size:13})}),m&&(0,d.jsx)(B,{headers:f,cfg:i,view:q,onClose:()=>n(!1),onChange:o})]})]}),"table"===q&&(0,d.jsx)(w,{headers:f,rows:g,cfg:i.table,saveAction:c}),"gallery"===q&&(0,d.jsx)(x,{headers:f,rows:g,cfg:i.gallery}),"board"===q&&(0,d.jsx)(y,{headers:f,rows:g,cfg:i.board,saveAction:c})]})}},47223:(a,b,c)=>{"use strict";c.d(b,{D:()=>f,Y:()=>g});var d=c(31417),e=c(52610);let f=(0,d.v)(a=>({locale:"en",t:e.D.en,setLocale:b=>{document.cookie=`locale=${b};path=/;max-age=31536000;SameSite=Lax`,document.documentElement.lang="zh"===b?"zh":"en",window.__mindos_locale__=b,a({locale:b,t:e.D[b]}),window.dispatchEvent(new Event("mindos-locale-change"))},_init:b=>{"en"!==f.getState().locale&&a({locale:"en",t:e.D.en});let c=()=>{a({locale:"en",t:e.D.en})};return window.addEventListener("mindos-locale-change",c),()=>window.removeEventListener("mindos-locale-change",c)}}));function g(){return f()}},47336:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ImageRenderer:()=>g});var d=c(48249),e=c(67484);let f=[.25,.5,.75,1,1.5,2,3,4];function g({filePath:a}){let b=`/api/file/raw?path=${encodeURIComponent(a)}`,c=a.split("/").pop()??"image",g=c.split(".").pop()?.toLowerCase()??"",h=["png","svg","webp","ico","gif"].includes(g),[i,j]=(0,e.useState)(!0),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(0),[o,p]=(0,e.useState)("fit"),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),u=(0,e.useRef)(null),v=(0,e.useRef)(null),w=(0,e.useCallback)(()=>{j(!1);let a=u.current;a&&r({w:a.naturalWidth,h:a.naturalHeight})},[]),x=(0,e.useCallback)(()=>{j(!1),l(!0)},[]),y=(0,e.useCallback)(()=>{l(!1),j(!0),n(a=>a+1)},[]),z=(0,e.useCallback)(()=>{p(a=>{let b="fit"===a?1:a;return f.find(a=>a>b)??b})},[]),A=(0,e.useCallback)(()=>{p(a=>{let b="fit"===a?1:a;return[...f].reverse().find(a=>a<b)??b})},[]),B=(0,e.useCallback)(()=>{p(a=>"fit"===a?1:"fit")},[]),C="fit"===o?"Fit":`${Math.round(100*o)}%`,D="fit"===o?{maxWidth:"100%",maxHeight:"70vh",objectFit:"contain"}:q?{width:q.w*o,height:"auto"}:{maxWidth:"100%",maxHeight:"70vh",objectFit:"contain"};return(0,d.jsxs)("div",{className:"w-full flex flex-col gap-0",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border text-xs text-[var(--text-secondary)]",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[q&&(0,d.jsxs)("span",{children:[q.w," x ",q.h]}),null!==s&&(0,d.jsx)("span",{children:s<1024?`${s} B`:s<1048576?`${(s/1024).toFixed(1)} KB`:`${(s/1048576).toFixed(1)} MB`}),(0,d.jsx)("span",{className:"uppercase opacity-60",children:g})]}),(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("button",{onClick:A,disabled:!q,className:"px-2 py-1 rounded hover:bg-[var(--bg-hover)] transition-colors disabled:opacity-30",title:"Zoom out (-)",children:"-"}),(0,d.jsx)("button",{onClick:B,disabled:!q,className:"px-2 py-1 rounded hover:bg-[var(--bg-hover)] transition-colors min-w-[48px] text-center disabled:opacity-30",title:"fit"===o?"Actual size (1)":"Fit to view (0)",children:C}),(0,d.jsx)("button",{onClick:z,disabled:!q,className:"px-2 py-1 rounded hover:bg-[var(--bg-hover)] transition-colors disabled:opacity-30",title:"Zoom in (+)",children:"+"})]})]}),(0,d.jsxs)("div",{ref:v,tabIndex:-1,className:`relative flex-1 min-h-[70vh] overflow-auto flex items-center justify-center outline-none ${h?"bg-checkerboard":"bg-[var(--bg-secondary)]"}`,children:[i&&!k&&(0,d.jsx)("div",{className:"absolute inset-0 flex items-center justify-center z-10",children:(0,d.jsx)("span",{className:"text-sm text-[var(--text-tertiary)] animate-pulse",children:"Loading..."})}),k&&(0,d.jsxs)("div",{className:"absolute inset-0 flex flex-col items-center justify-center z-10 gap-2",children:[(0,d.jsx)("span",{className:"text-sm text-[var(--text-secondary)]",children:"Failed to load image"}),(0,d.jsx)("button",{onClick:y,className:"text-xs px-3 py-1.5 rounded-md bg-[var(--bg-tertiary)] hover:bg-[var(--bg-hover)] transition-colors",children:"Retry"})]}),(0,d.jsx)("img",{ref:u,src:b,alt:c,onLoad:w,onError:x,draggable:!1,className:"select-none",style:{display:k?"none":"block",...D}},m)]})]})}},49223:(a,b,c)=>{"use strict";c.d(b,{EI:()=>g,No:()=>e,R3:()=>h,_r:()=>f});let d={id:"mindos",name:"MindOS"};function e(a,b){let c=b??d;return{...a,agentId:c.id,agentName:c.name}}function f({sessionAgent:a,initialAgent:b}){return a??b??null}function g(a){return a.agentId&&a.agentName&&a.agentId!==d.id?{id:a.agentId,name:a.agentName}:null}function h(a,b){return{...a,defaultAcpAgent:b}}},49905:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{default:()=>i});var e=c(48249),f=c(19099),g=c(89119),h=a([g]);function i({fileTree:a,children:b}){let c=(0,f.usePathname)();return"/login"===c?(0,e.jsx)(e.Fragment,{children:b}):(0,e.jsx)(g.A,{fileTree:a,children:b})}g=(h.then?(await h)():h)[0],d()}catch(a){d(a)}})},50121:(a,b,c)=>{"use strict";c.d(b,{i:()=>e});var d=c(99829);let e=(0,d.createServerReference)("409c8f8b7df63a33bb3074b98fd9fb5bdff37b225d",d.callServer,void 0,d.findSourceMapURL,"deleteFileAction")},51488:(a,b,c)=>{"use strict";c.r(b),c.d(b,{SummaryRenderer:()=>m});var d=c(48249),e=c(67484),f=c(69924),g=c(6079),h=c(80600),i=c(13576),j=c(33191);function k(a){let b=Date.now()-a,c=Math.floor(b/6e4),d=Math.floor(b/36e5),e=Math.floor(b/864e5);return c<1?"just now":c<60?`${c}m ago`:d<24?`${d}h ago`:`${e}d ago`}function l(a){return a.split("/").pop()?.replace(/\.(md|csv)$/,"")??a}function m({filePath:a}){let[b,c]=(0,e.useState)([]),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(!1),u=(0,e.useRef)(null),v=(0,e.useMemo)(()=>m.replace(/^### (.+)$/gm,'<h3 style="font-size:.8rem;font-weight:600;color:var(--muted-foreground);text-transform:uppercase;letter-spacing:.06em;margin:1em 0 .3em">$1</h3>').replace(/^## (.+)$/gm,'<h2 style="font-size:.9rem;font-weight:700;color:var(--foreground);margin:1.2em 0 .4em">$1</h2>').replace(/^# (.+)$/gm,'<h1 style="font-size:1rem;font-weight:700;color:var(--foreground);margin:1.2em 0 .4em">$1</h1>').replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/`(.+?)`/g,'<code class="font-display" style="font-size:.82em;padding:1px 5px;border-radius:4px;background:var(--muted)">$1</code>').replace(/^[-*] (.+)$/gm,'<li style="margin:.2em 0;padding-left:.3em">$1</li>').replace(/(<li[^>]*>.*<\/li>\n?)+/g,a=>`<ul style="margin:.4em 0;padding-left:1.4em;list-style:disc">${a}</ul>`).replace(/\n{2,}/g,'</p><p style="margin:.5em 0;font-size:.85rem;line-height:1.7;color:var(--foreground)">').replace(/^(?!<[hulo])(.+)$/gm,'<p style="margin:.5em 0;font-size:.85rem;line-height:1.7;color:var(--foreground)">$1</p>'),[m]);async function w(){if(0===b.length)return;u.current?.abort();let a=new AbortController;u.current=a,n(""),r(""),p(!0),t(!1);let c=b.map(a=>a.path),d=b.map(a=>`- **${l(a.path)}** (${a.path}, modified ${k(a.mtime)})`).join("\n"),e=`You are summarizing recent changes in a personal knowledge base (MindOS).
|
|
61
66
|
|
|
62
67
|
The following files were recently modified:
|
|
63
68
|
${d}
|
|
@@ -113,24 +118,7 @@ ${a.map(a=>`- Inbox/${a}`).join("\n")}`,dropOverlay:"拖放到暂存台快速保
|
|
|
113
118
|
|
|
114
119
|
不要只做文字回复。你必须实际写入知识库。`},arrowTo:"→",remove:"移除",aiRecommended:"推荐",aiRecommendedHint:"根据文件名自动匹配",conflictsFound:a=>`${a} 个文件已存在`,organizeTitle:"AI 整理中",organizeProcessing:"AI 正在分析和整理你的文件...",organizeConnecting:"正在连接 AI...",organizeAnalyzing:"AI 正在分析你的文件...",organizeReading:a=>a?`正在阅读 ${a}...`:"正在阅读文件...",organizeThinking:"AI 正在深度思考...",organizeWriting:a=>a?`正在写入 ${a}...`:"正在写入文件...",organizeElapsed:a=>{let b=Math.floor(a/60);return`${b}:${(a%60).toString().padStart(2,"0")}`},organizeCancel:"取消",organizeMinimize:"继续浏览",organizeExpand:"查看",organizeCreating:a=>`正在创建 ${a}`,organizeUpdating:a=>`正在更新 ${a}`,organizeReviewTitle:"整理完成",organizeErrorTitle:"整理失败",organizeReviewDesc:a=>`AI 整理了 ${a} 处变更`,organizeCreated:"已创建",organizeUpdated:"已更新",organizeFailed:"失败",organizeNoChanges:"AI 分析了你的文件,但没有做任何更改。",organizeToolCallsInfo:a=>`AI 执行了 ${a} 个操作 — 请检查知识库查看更新`,organizeError:"整理失败",organizeRetry:"重试",organizeDone:"完成",organizeUndoAll:"撤销全部",organizeUndoOne:"撤销",organizeUndone:"已撤销",organizeViewFile:"查看文件",organizeUndoSuccess:a=>`已撤销 ${a} 个文件`,organizeDetailTitle:"AI 整理详情",organizeSourceFiles:"源文件",organizeSummaryLabel:"AI 总结",organizeChangesLabel:a=>`变更列表 (${a})`,organizeNoSummary:"AI 正在处理中...",organizeMinimizeModal:"最小化"},importHistory:{title:"导入历史",clearAll:"清空历史",clearConfirm:"清空所有历史记录?此操作不可撤销。",emptyTitle:"暂无导入记录",emptyDesc:"AI 整理的结果会出现在这里",back:"← 返回",sourceLabel:"来源",changesCount:(a,b)=>`${a}/${b} 处变更`,changesSummary:a=>`→ ${a} 处变更`,nFiles:a=>`${a} 个文件`,statusUndone:"已撤销",statusCreated:"已创建",statusUpdated:"已更新",recordCount:a=>`${a} 条记录`,today:"今天",yesterday:"昨天",older:"更早",processedArchive:"已处理的文件归档在 Inbox/.processed/ 中"},dirView:{gridView:"网格视图",listView:"列表视图",emptyFolder:"此目录为空。",fileCount:a=>`${a} 个文件`,newFile:"新建文件",uninitTitle:"空间尚未初始化",uninitDesc:"README.md 和 INSTRUCTION.md 仍是默认模板。配置 AI API 密钥后可自动生成个性化内容,或手动编辑。",uninitEditReadme:"编辑 README",uninitEditInstruction:"编辑 Instruction",uninitSettings:"设置",overviewNoFiles:"暂无文件可分析。",overviewCta:"生成概览",overviewCtaHint:a=>`扫描 ${a} 个文件,生成空间概要`,overviewCtaNoKey:"请先在设置中配置 AI 密钥",overviewOrEdit:"或手动编辑 README.md",overviewGenerating:"正在生成概览…",overviewScanningFiles:a=>`正在扫描 ${a} 个文件`,overviewRegenerate:"用 AI 重新生成概览",overviewRegenerateLabel:"刷新",overviewRegenerateConfirm:"将扫描变更文件并刷新概述,会消耗一定 AI 额度。",overviewRegenerateCancel:"取消",overviewRegenerateStart:"立即刷新",overviewUnchanged:"概述已是最新,没有文件变更。",overviewLastCompiled:a=>`上次刷新:${a}`,overviewIncremental:a=>`已从 ${a} 个变更文件增量更新`,overviewError:"无法生成概览",overviewRetry:"重试"},view:{saveDirectory:"目录",saveFileName:"文件名",delete:"删除",deleteConfirm:a=>`确定删除「${a}」?文件将移至回收站。`,cancel:"取消",rename:"重命名",copyPath:"复制路径",more:"更多",dismiss:"关闭",tocTitle:"本页目录",tocCollapse:"收起",tocExpand:"展开",emptyNote:"此笔记为空。按 E 开始编辑。",switchToDoc:"文档视图",switchToGraph:"知识图谱"},findInPage:{placeholder:"在文档中查找…",matchCount:(a,b)=>`${a} / ${b}`,noResults:"无结果"},panels:{agents:{title:"智能体",connected:"已连接",refresh:"刷新智能体状态",retry:"重试",failedToLoad:"加载智能体失败",mcpServer:"MCP 服务器",stopped:"已停止",sectionConnected:"已连接",sectionDetected:"已检测",sectionNotDetected:"未检测到",noAgents:"未检测到智能体。",autoRefresh:"每 30 秒自动刷新",connect:"连接",installing:"安装中...",install:"安装",installSuccess:"已安装",installFailed:"安装失败",retryInstall:"重试",copyConfig:"复制配置",copied:"已复制!",transportLocal:"本地",transportRemote:"远程",configPath:"配置路径",noAuthWarning:"未设置 Token — 请在高级配置中设置",skillsTitle:"技能",skillsActive:"已启用",builtinSkills:"内置",newSkill:"+ 新建",advancedConfig:"高级配置 →",channels:"频道",navOverview:"总览",navMcp:"MCP",navSkills:"技能",navChannels:"频道",navNetwork:"网络",navSessions:"会话",navActivity:"活动",activitySubtitle:"Agent 操作审计日志。",activity:{loading:"正在加载活动...",empty:"暂无 Agent 操作记录。",emptyHint:"已连接 Agent 的操作将显示在这里。",agentLabel:"Agent"},a2aTabTitle:"远程 Agent",a2aTabEmpty:"无远程 Agent",a2aTabEmptyHint:"发现远程 Agent 以启用跨 Agent 委派。",a2aRemoveAgent:"移除",rosterLabel:"当前环境",notFoundDetail:"本机未检测到该智能体客户端。请安装后刷新列表。",skillsEmptyHint:"请在「MCP 与技能」设置中启用或编辑技能。",backToList:"返回",closeAgentDetail:"关闭",agentDetailPanelAria:"智能体连接配置",agentDetailTransport:"传输方式",agentDetailSnippet:"配置片段",a2aLabel:"A2A",a2aReady:"A2A 就绪",a2aChecking:"检测 A2A 中...",a2aUnavailable:"A2A 不可用",a2aRemote:"远程",a2aDiscover:"发现远程 Agent",a2aDiscoverHint:"通过 URL 连接外部 A2A Agent",a2aDiscoverPlaceholder:"https://agent.example.com",a2aDiscovering:"发现中...",a2aDiscoverSuccess:"Agent 已发现!",a2aDiscoverFailed:"未在此 URL 找到 A2A Agent",a2aDiscoverFailedHint:"该服务器可能不支持 A2A 协议,请检查 URL 后重试。",a2aSkills:"技能",a2aEndpoint:"端点",a2aVersion:"版本",a2aCapabilities:"A2A 能力",a2aStatus:"状态",a2aConnected:"已连接,A2A 就绪",a2aNoRemote:"无远程 Agent",a2aNoRemoteHint:"发现远程 Agent 以启用跨 Agent 委派。",a2aDelegations:"近期委派",a2aDelegationsEmpty:"暂无委派记录",a2aDelegationCompleted:"已完成",a2aDelegationFailed:"失败",a2aDelegationPending:"进行中",acpSectionTitle:"已安装智能体",acpSectionDesc:a=>`已检测到 ${a} 个智能体`,acpNoInstalled:"未检测到编程智能体。安装一个即可在 MindOS 中直接委派任务。",acpAvailableTitle:"注册表中可用",acpAvailableDesc:a=>`还有 ${a} 个智能体可安装`,acpShowAvailable:"展开",acpHideAvailable:"收起",acpCopyCmd:"复制",acpCopied:"已复制",acpTransportNpx:"npx",acpTransportBinary:"二进制",acpTransportUvx:"uvx",acpTransportStdio:"stdio",acpUseAgent:"使用",acpComingSoon:"即将上线 — 当前可通过 MindOS 调用",acpReady:"就绪",acpNotInstalled:"未安装",acpScan:"重新扫描",acpInstallHint:a=>`安装命令: ${a}`,acpInstall:"安装",acpInstalling:"安装中…",acpLoading:"加载 ACP 注册表中…",acpLoadFailed:"加载 ACP 注册表失败。",acpRetry:"重试",acpQuickReview:"代码审查",acpQuickFix:"修复Bug",acpQuickExplain:"解释项目",acpUseWith:a=>`使用 ${a} `,acpDefaultAgent:"MindOS",acpSelectAgent:"选择 Agent",acpChangeAgent:"切换 Agent",acpConfigToggle:"配置",acpConfigCommand:"命令",acpConfigArgs:"参数",acpConfigEnv:"环境变量",acpConfigEnvAdd:"添加环境变量",acpConfigSource:"来源",acpConfigSourceBuiltin:"内置",acpConfigSourceRegistry:"注册表",acpConfigSourceUser:"自定义",acpConfigReset:"重置",acpConfigSave:"保存",acpConfigSaved:"已保存",acpConfigPath:"路径",networkEmptyTitle:"连接智能体生态",networkEmptyDesc:"发现远程 Agent 或浏览 ACP 注册表中的编程智能体。",networkDiscoverBtn:"发现 Agent",networkBrowseBtn:"浏览注册表"},plugins:{title:"插件",active:"已启用",noPlugins:"暂无插件",core:"核心",coreDisabled:"核心插件 — 不可禁用",footer:"插件用于自定义文件渲染方式。核心插件不可禁用。",ready:"就绪 — 点击打开",disabled:"已禁用",noFile:"入口文件不存在",createFile:"创建 {file} 以激活"},echo:{title:"回响",imprintTitle:"印迹",imprintDesc:"每日痕迹与历史",growthTitle:"生长",growthDesc:"你正在推进的方向",selfTitle:"自观",selfDesc:"指向你的笔记与线索"},discover:{title:"探索",useCases:"使用案例",useCasesDesc:"动手体验 MindOS 的典型场景",pluginMarket:"插件市场",pluginMarketDesc:"扩展文件的渲染和编辑方式",skillMarket:"技能市场",skillMarketDesc:"为 AI 智能体添加新能力",spaceTemplates:"空间模板",spaceTemplatesDesc:"预设的空间结构,适用于常见工作流场景",comingSoon:"即将推出",viewAll:"查看所有使用案例",tryIt:"试试"},workflows:{title:"流程",empty:"还没有流程",emptyDesc:"创建第一个流程,用 AI 自动化多步骤任务。",newWorkflow:"新建流程",nSteps:a=>`${a} 个步骤`,parseError:"解析错误",name:"名称",namePlaceholder:"我的流程",template:"模板",templateBlank:"空白",create:"创建",cancel:"取消",creating:"创建中...",exists:"已存在同名流程"},im:{title:"频道",emptyTitle:"尚未配置任何频道",emptyDesc:"连接消息平台,让 MindOS 代您发送消息。",connected:"已连接",notConfigured:"配置",statusConnected:"已连接",tabStatus:"状态",tabConfigure:"配置",testSend:"测试发送",recipientPlaceholder:"接收者 ID",messagePlaceholder:"来自 MindOS 的问候",sendTest:"发送测试",sentOk:"发送成功",saveConfig:"保存",saved:"已保存,正在重新连接...",cancel:"取消",fetchError:"无法加载频道状态。",retry:"重试",disconnect:"断开连接",confirmDisconnect:"确认?",showSecret:"显示",hideSecret:"隐藏",getStarted:"开始配置",statsConnected:"已连接",statsSupported:"支持平台",statsStatus:"状态",statsReady:"就绪",statsNotConfigured:"未配置",platformsTitle:"平台列表",backToChannels:"返回频道",setupGuide:"配置指南",howItWorks:"这个渠道怎么用",currentMode:"当前模式",notificationsOnly:"仅用于通知",twoWayConversation:"双向对话",conversationTitle:"对话设置",conversationEnable:"允许从飞书发起消息",conversationWaiting:"等待飞书验证",conversationReady:"可接收并回复",conversationDisabled:"未开启",conversationNeedsPublicUrl:"需要公网地址",conversationNeedsEncryptKey:"需要 Encrypt Key",conversationHint:"用户可以私聊机器人;群聊里只有 @机器人 时才会触发回复。",conversationConfigHint:"只有在你已经准备好公网地址和 Feishu Encrypt Key 后,才建议开启。",conversationWebhookUrl:"Webhook 地址",conversationCopyUrl:"复制地址",conversationStatus:"Webhook 状态",conversationReachability:"公网可达性",conversationReachabilityHint:"飞书必须能从公网访问这个地址,才能把消息推送到 MindOS。",conversationOpenPlatform:"打开飞书开放平台",conversationPublicBaseUrl:"公网 Base URL",conversationEncryptKey:"Encrypt Key",conversationVerificationToken:"Verification Token",conversationVerificationTokenHint:"用于飞书 webhook challenge 校验。留空会保留已保存的值。",conversationSecretPlaceholder:"留空则保留已保存的值",conversationGroupMentions:"群聊中仅在被 @ 时回复",conversationSaved:"对话设置已保存",conversationSave:"保存对话设置",workInMindosHint:"与 MindOS 交互请回到 Ask。这个渠道当前用于接收结果更新、提醒和示例消息。",thisIsNotChat:"这里是消息投递渠道,不是聊天收件箱。",useCasesTitle:"你会收到什么",statusSummaryTitle:"状态摘要",lastActivity:"最近活动",lastRecipient:"最近接收者",noActivityYet:"还没有发送过消息",noActivityHint:"发送一条示例消息,确认这个渠道已经可用。",recentActivity:"最近活动记录",sendSample:"发送示例通知",sampleHint:"这会通过当前渠道发送一条真实的外发消息。",settingsTitle:"设置",settingsHint:"在这里维护凭证和渠道设置。",showSettings:"展开设置",hideSettings:"收起设置",latestSuccess:"最近成功",latestFailure:"最近失败",noRecentActivity:"暂无最近活动",notAvailable:"暂无",activityTypeTest:"示例消息",activityTypeAgent:"Agent 更新",activityTypeManual:"手动发送",disconnectHint:"移除凭证并断开此平台的连接。",editCredentials:"更新凭证",editCredentialsHint:"如果需要轮换密钥或修复连接,可直接在这里更新并保存。",guideLink:"打开配置指南",recipientHint:"请输入平台对应的接收者 ID。",savedValuesHint:"已保存的值会保持隐藏。若要更新凭证,请重新粘贴完整的新值后再保存。",required:"必填",saving:"保存中..."}},echoPages:{parent:"回响",heroKicker:"",segmentNavAria:"回响模块",snapshotBadge:"本地 \xb7 私密",factsHeading:"所见",snapshotImprintTitle:"从一行开始",snapshotImprintBody:"离手即存,自动保存在本机。",snapshotGrowthTitle:"意图落在这里",snapshotGrowthBody:"写一句此刻最想推进的方向。它只保存在本机,可随时间改写。",snapshotSelfTitle:"即将推出",snapshotSelfBody:"随着知识库增长,与你相关的笔记会自动浮现在这里。",insightTitle:"见解",insightShow:"展开见解",insightHide:"收起见解",insightHint:"基于你在本页写下的内容生成反思。需在设置中启用 AI。",generateInsight:"生成见解",generateInsightNoAi:"请在 设置 → AI 中启用 AI 功能。",insightGenerating:"生成中…",insightErrorPrefix:"生成失败:",insightRetry:"重试",imprintChatLabel:"聊聊这一行",growthChatLabel:"探索这个方向",selfChatLabel:"发现规律",dailyReportTitle:"回响报告",dailyReportGenerated:"生成于",dailyReportGenerate:"生成回响",dailyReportGenerating:"生成中…",dailyReportRetry:"重试",dailyReportContinueAgent:"聊聊这个",reportSnapshotTitle:"动向",reportSnapshotFilesEdited:"编辑文件",reportSnapshotFilesCreated:"新建文件",reportSnapshotSessions:"对话次数",reportSnapshotKbGrowth:"知识库增长",reportThemesTitle:"主题",reportThemeFiles:"个文件",reportAlignmentTitle:"对齐度",reportAlignmentScore:"对齐度",reportAlignmentAligned:"对齐",reportAlignmentPartial:"部分对齐",reportAlignmentMisaligned:"偏离",reportReflectionTitle:"明天思考",dailyLineLabel:"今日一行",dailyLinePlaceholder:"写下一行轻量的文字…",dailySavedNote:"已保存在本机。",savedFlash:"已保存",dailyAskPrefill:a=>`帮我围绕今天写的内容展开:
|
|
115
120
|
|
|
116
|
-
${a.trim()||"(还没有写)"}`,growthIntentLabel:"当前意图",growthIntentPlaceholder:"写下你正在推进的方向…",growthSavedNote:"已保存在本机。",imprintLead:"写一行今天的思绪。可以生成回响报告,或聊聊来深入。",growthLead:"写下你正在推进的方向。随时间回看,观察它如何演变。",selfLead:"随着知识库增长,与你相关的笔记会自动浮现在这里。"},agentsContent:{title:"智能体",subtitle:"连接、技能与状态,一目了然。",workspacePulse:{title:"你的 Agent",connected:"已连接",detected:"已检测",notFound:"未找到",risk:"风险",enabledSkills:"已启用",healthy:"正常",needsAttention:a=>`${a} 个问题`},navOverview:"总览",navMcp:"MCP",navSkills:"技能",navNetwork:"网络",navSessions:"会话",navActivity:"活动",navChannels:"频道",channelsSubtitle:"连接消息平台,让 MindOS 代您发送消息。",activitySubtitle:"Agent 操作审计日志。",activity:{loading:"正在加载活动...",empty:"暂无 Agent 操作记录。",emptyHint:"已连接 Agent 的操作将显示在这里。",agentLabel:"Agent"},a2aTabTitle:"远程 Agent",a2aTabEmptyHint:"发现远程 Agent 以启用跨 Agent 委派。",backToOverview:"返回总览",na:"暂无",status:{connected:"已连接",detected:"已检测",notFound:"未找到"},overview:{connected:"已连接",detected:"已检测",notFound:"未找到",riskQueue:"待处理",noRisk:"一切正常,暂无问题。",usagePulse:"全部 Agent",nextAction:"建议操作",nextActionHint:"优先重连已检测的 Agent,再启用所需技能。",riskLevelError:"异常",riskLevelWarn:"注意",na:"暂无",colAgent:"Agent",colStatus:"状态",colMcp:"MCP",colSkills:"技能",colMode:"模式",colRuntime:"运行时",pulseMcp:"MCP",pulseTools:"工具数",mcpOffline:"离线",toolsUnit:a=>`${a} 个工具`,enabledUnit:a=>`${a} 已启用`,agentCount:a=>`${a} 个 Agent`,runtimeActive:"活跃",riskMcpStopped:"MCP 服务未运行。",riskDetected:a=>`${a} 个已检测 Agent 待配置。`,riskSkillsDisabled:"所有技能已禁用。",recentActivity:"最近活动",viewAll:"查看全部",showLess:"收起",addCustomAgent:"添加自定义 Agent",addCustomAgentTitle:"添加自定义 Agent",editCustomAgentTitle:a=>`编辑 ${a}`,customAgentName:"Agent 名称",customAgentNamePlaceholder:"例如 QCLaw、WorkBuddy",customAgentDir:"配置目录",customAgentDirPlaceholder:"~/.qclaw/",customAgentDirHint:"常见路径:~/.xxx/ 或 ~/Library/Application Support/",customAgentKeyPreview:a=>`标识符:${a}`,customAgentContinue:"继续",customAgentDetecting:"检测中...",customAgentDirFound:"目录已找到",customAgentDirNotFound:"目录尚未创建,安装后将自动检测",customAgentDetectTimeout:"检测超时,使用默认配置",customAgentDetectedTitle:"检测到的配置",customAgentDefaultTitle:"默认配置",customAgentConfigLabel:"MCP 配置",customAgentFormatLabel:"格式",customAgentTransportLabel:"传输协议",customAgentSkillsLabel:"技能",customAgentSkillsFound:a=>`发现 ${a} 个技能`,customAgentSkillsNone:"未检测到",customAgentSkillDir:"技能目录",customAgentSkillDirHint:"此 Agent 安装技能的目录",customAgentSkillDirPlaceholder:"~/.xxx/skills/",customAgentCustomize:"自定义配置",customAgentAdd:"添加 Agent",customAgentAdding:"添加中...",customAgentSave:"保存更改",customAgentSaving:"保存中...",customAgentRetry:"重试",customAgentAdded:a=>`${a} 已添加`,customAgentUpdated:a=>`${a} 已更新`,customAgentRemoved:a=>`${a} 已移除`,customAgentRemoveTitle:a=>`移除「${a}」?`,customAgentRemoveMessage:"这将从 MindOS 中移除该 Agent,不会删除磁盘上的任何文件。",customAgentRemoveConfirm:"移除",customAgentConfigPath:"MCP 配置文件路径",customAgentConfigKey:"配置键名",customAgentFormat:"格式",customAgentTransport:"传输协议",customAgentProjectConfig:"项目配置路径(可选)",customAgentCliBinary:"CLI 命令名(可选)",customAgentCliBinaryPlaceholder:"例如 qclaw",customAgentEdit:"编辑",customAgentRemove:"移除",customAgentCancel:"取消",customAgentNetworkError:"网络错误,请重试。",customAgentFailedSave:"保存失败",customAgentFailedRemove:"移除失败",customAgentKeyConflict:a=>`已存在标识为 "${a}" 的 Agent`,customAgentBuiltinConflict:a=>`与内置 Agent "${a}" 冲突`},mcp:{title:"MCP 连接",refresh:"刷新",connectionGraph:"跨 Agent 服务器连接",tabs:{manage:"管理",topology:"图谱",byAgent:"按 Agent 查看",byServer:"按 MCP 服务器查看"},searchPlaceholder:"搜索 Agent...",installMindos:"安装 MindOS MCP",installed:"已安装",mcpServerLabel:"MCP 服务器",searchServersPlaceholder:"搜索 MCP 服务器...",serverAgentCount:a=>`${a} 个 Agent`,emptyState:"当前筛选条件下没有匹配的 Agent。",resultCount:a=>`${a} 个 Agent`,filteredSummaryTitle:"筛选结果状态摘要",filteredConnected:a=>`已连接:${a}`,filteredDetected:a=>`已检测:${a}`,filteredNotFound:a=>`未找到:${a}`,crossAgentServersTitle:"MCP 服务器",crossAgentServersEmpty:"暂未检测到 MCP 服务器。",crossAgentServerAgents:a=>`使用者:${a}`,configVisibilityTitle:"配置信息",hiddenRootDetected:(a,b)=>`隐藏目录:${a}/${b}`,runtimeSignalDetected:(a,b)=>`运行信号:${a}/${b}`,riskQueueTitle:"待处理",riskMcpStopped:"MCP 服务未运行。",riskDetected:a=>`${a} 个已检测 Agent 待配置。`,riskNotFound:a=>`${a} 个 Agent 未在本机检测到。`,riskSkillsDisabled:"所有技能已禁用。",bulkReconnectFiltered:"全部重连",bulkRunning:"正在批量重连...",bulkSummary:(a,b)=>`重连成功 ${a} 个,失败 ${b} 个。`,transportFilters:{all:"全部传输",stdio:"stdio",http:"http",other:"其他"},filters:{all:"全部",connected:"已连接",detected:"已检测",notFound:"未找到"},table:{agent:"Agent",status:"状态",transport:"传输",actions:"操作"},actions:{copySnippet:"复制配置",copied:"已复制",testConnection:"测试连接",reconnect:"重连"},addAgent:"添加",removeFromServer:"移除",confirmRemoveTitle:"从服务器移除?",confirmRemoveMessage:(a,b)=>`将"${a}"从"${b}"移除?配置文件将自动更新。`,cancel:"取消",noAvailableAgents:"所有 Agent 均已添加。",manualRemoveHint:"已标记移除,请编辑 Agent 配置文件完成操作。",removeSuccess:"已移除,重启 Agent 后生效。",removeFailed:"移除失败,请手动编辑配置文件。",reconnectAllInServer:"全部重连",reconnectAllRunning:"正在重连...",reconnectAllDone:(a,b)=>`完成:${a} 已重连${b>0?`,${b} 失败`:""}。`,serverTransport:a=>`传输:${a}`,mcpDisabledMessage:"MCP 模式未启用。",mcpDisabledHint:"请在设置 → 连接中启用,以使用 MCP 智能体。"},skills:{title:"技能",summaryTitle:"技能状态",summaryEnabled:a=>`已启用:${a}`,summaryDisabled:a=>`已禁用:${a}`,summaryAttention:a=>`需关注:${a}`,crossAgentSkillsTitle:"已安装技能",crossAgentSkillsEmpty:"暂未检测到已安装技能。",crossAgentSkillAgents:a=>`安装于:${a}`,capabilityGroups:"跨 Agent 技能管理",registrySummaryTitle:"技能注册表",registryUniversal:a=>`通用:${a}`,registryAdditional:a=>`附加:${a}`,registryUnsupported:a=>`不支持:${a}`,registryHiddenRoots:(a,b)=>`隐藏目录:${a}/${b}`,tabs:{manage:"管理",matrix:"矩阵",bySkill:"按技能查看",byAgent:"按 Agent 查看"},searchPlaceholder:"搜索技能...",agentSkillMode:"技能模式",agentMcpServers:"MCP 服务器",agentNativeSkills:"原生技能",agentMindosSkills:"MindOS 技能",noAgentsYet:"尚未检测到任何 Agent。",moreSkills:a=>`另有 ${a} 个`,sourceAll:"全部",sourceBuiltin:"内置",sourceUser:"自定义",sourceNative:"原生",summaryNative:a=>`原生:${a}`,statusAll:"全部状态",statusEnabled:"已启用",statusDisabled:"已禁用",statusAttention:"需关注",capabilityAll:"全部能力",bulkEnableFiltered:"全部启用",bulkDisableFiltered:"全部停用",bulkRunning:"正在应用变更...",bulkNoChanges:"当前无需变更。",bulkAllSucceeded:a=>`已更新 ${a} 个技能。`,bulkPartialFailed:(a,b)=>`已更新 ${a} 个,失败 ${b} 个。`,resultCount:a=>`${a} 个技能`,matrixAgentFocusLabel:"Agent 聚焦",matrixAgentFocusAll:"全部 Agent",matrixColumnSkill:"技能",matrixEnabled:"已启用",matrixDisabled:"已禁用",matrixUnsupported:"不支持",matrixNoAgents:"当前无可用于矩阵的 Agent。",noSkillsMatchFilter:"当前筛选条件下无技能。",matrixEmpty:"当前筛选条件下无技能。",addAgentToSkill:"添加",removeAgentFromSkill:"移除",confirmRemoveAgentTitle:"从技能移除?",confirmRemoveAgentMessage:(a,b)=>`将"${a}"从"${b}"移除?需编辑 Agent 配置文件完成操作。`,cancelSkillAction:"取消",noAvailableAgentsForSkill:"所有 Agent 均已拥有此技能。",manualSkillHint:"已标记,请编辑 Agent 配置文件完成操作。",skillDescription:"描述",skillNoDescription:"暂无描述。",skillDeleteAction:"删除",confirmDeleteSkillTitle:"删除技能?",confirmDeleteSkillMessage:a=>`确认永久删除技能"${a}"?此操作不可撤销。`,skillDeleted:"技能已删除。",skillDeleteFailed:"删除技能失败。",copyInstallCmd:"复制安装命令",installCmdCopied:"已复制!",skillAgentCount:a=>`${a} 个 Agent`,quickStatsMcp:a=>`${a} MCP`,quickStatsSkills:a=>`${a} 技能`,showAllNative:a=>`展开全部 ${a} 项`,collapseNative:"收起",emptyGroup:"该分组暂无技能。",groupLabels:{research:"研究",coding:"编码",docs:"文档",ops:"运维",memory:"记忆"},skillPopover:{close:"关闭",source:"来源",sourceBuiltin:"内置",sourceUser:"自定义",sourceNative:"原生",capability:"能力类型",path:"文件路径",enabled:"已启用",disabled:"已禁用",agents:"Agent",noAgents:"暂无 Agent 拥有此技能。",content:"技能内容",loading:"加载中…",loadFailed:"加载技能内容失败。",retry:"重试",copyContent:"复制",copied:"已复制!",noDescription:"暂无描述。",deleteSkill:"删除",confirmDeleteTitle:"删除技能?",confirmDeleteMessage:a=>`确认永久删除技能"${a}"?此操作不可撤销。`,confirmDeleteAction:"删除",cancelAction:"取消",deleted:"技能已删除。",deleteFailed:"删除技能失败。"}},detail:{healthStripTitle:"状态",healthConnected:"已连接",healthInstalled:"MCP 已安装",healthRuntimeSignals:"运行信号",healthConfiguredServers:"已配置服务器",healthInstalledSkills:"原生已安装技能",identity:"身份",connection:"连接",capabilities:"能力画像",skillAssignments:"技能分配",runtimeSignals:"运行与配置信号",recentActivity:"最近活动",spaceReach:"空间触达",agentKey:"Agent 标识",status:"状态",transport:"传输",endpoint:"端点",port:"端口",auth:"认证",authConfigured:"已配置",authMissing:"未配置",projectScope:"项目范围",globalScope:"全局范围",format:"配置格式",skillMode:"技能模式",hiddenRoot:"隐藏目录路径",hiddenRootPresent:"隐藏目录",conversationSignal:"对话",usageSignal:"用量",lastActivityAt:"最近活跃",skillsAll:"全部技能",skillsEnabled:"已启用技能",skillsSourceBuiltin:"内置",skillsSourceUser:"自定义",skillsSearchPlaceholder:"搜索全部已配置技能...",skillsFilterAll:"全部",skillsFilterBuiltin:"内置",skillsFilterUser:"自定义",skillEnable:"启用",skillDisable:"禁用",skillEdit:"编辑",skillSave:"保存",skillCancel:"取消",skillActionLoading:"处理中...",skillReadFailed:"读取技能内容失败。",skillSaveFailed:"保存技能内容失败。",mcpManagement:"MCP 管理",mcpInstalled:"已安装",mcpScope:"当前范围",mcpConfigPath:"配置路径",mcpTargetScope:"目标范围",mcpTargetTransport:"目标传输",mcpScopeProject:"项目",mcpScopeGlobal:"全局",mcpCopySnippet:"复制片段",mcpCopied:"已复制",mcpRefresh:"刷新状态",mcpReconnect:"应用 MCP 配置",mcpApplying:"正在应用 MCP 配置...",mcpApplySuccess:"MCP 配置已应用。",mcpApplyFailed:"应用 MCP 配置失败。",nativeInstalledSkills:"已安装技能",nativeInstalledSkillsCount:a=>`检测到 ${a} 个`,nativeInstalledSkillsEmpty:"暂未检测到已安装技能。",nativeInstalledSkillsMore:a=>`另有 ${a} 个`,configuredMcpServers:"MCP 服务器",configuredMcpServersCount:a=>`检测到 ${a} 个`,configuredMcpServersEmpty:"暂未配置 MCP 服务器。",configuredMcpServersMore:a=>`另有 ${a} 个`,yes:"是",no:"否",noSkills:"暂无启用技能。",noActivity:"暂无活动记录。",noSpaceReach:"暂无空间触达数据。",skillDelete:"删除",skillDeleteConfirm:a=>`确认删除技能"${a}"?此操作不可撤销。`,skillDeleteSuccess:"技能已删除。",skillDeleteFailed:"删除技能失败。",mcpServerAdd:"添加 MCP 服务器",mcpServerRemove:"移除",mcpServerRemoveConfirm:a=>`从该 Agent 移除"${a}"?需编辑配置文件完成操作。`,mcpServerHint:"已标记,请编辑 Agent 配置文件完成操作。",mcpReconnectAll:"全部重连",mcpReconnectAllRunning:"正在重连...",mcpReconnectAllDone:(a,b)=>`已重连 ${a}${b>0?`,失败 ${b}`:""}。`,runtimeDiagTitle:"运行与诊断",runtimePing:"连通测试",runtimePinging:"测试中...",runtimePingOk:a=>`可达 (${a}ms)`,runtimePingFail:"不可达",runtimeUptime:"运行时长",runtimePid:"进程",runtimeMemory:"内存",runtimeVersion:"版本",runtimeStartedAt:"启动于",runtimeNoData:"暂无运行数据。",envPermTitle:"环境与权限",envVars:"环境变量",envVarsCount:a=>`已配置 ${a} 个`,envVarsEmpty:"暂无自定义环境变量。",envScope:"作用域",envReadOnly:"只读访问",envWriteAccess:"写入访问",envFileAccess:"文件访问",envNetworkAccess:"网络访问",envAllowed:"允许",envRestricted:"受限",activityTitle:"活动与用量",activityTotal:"总调用次数",activityLast7d:"近 7 天",activityLastInvocation:"最近调用",activityTokensUsed:"消耗 Tokens",activityAvgLatency:"平均延迟",activityNoData:"暂无活动记录。",knowledgeInteraction:"知识交互",knowledgeNoData:"暂无交互记录。Agent 开始使用你的知识库后,活动将显示在这里。",recentOps:"近期操作",statTotalCalls:"总调用",statFilesTouched:"涉及文件",statReadWrite:"读 / 写",statHealth:"健康度",viewFullLog:"查看完整日志",showLess:"收起"},detailSubtitle:"",detailNotFound:"未找到该 Agent,可能已移除或重命名。",detailNotFoundHint:"该 Agent 可能已断开连接或配置文件已移动。请尝试重启 Agent 或检查 MCP 配置。",detailNotFoundSuggestion:"已连接的 Agent:"},settings:{title:"设置",tabs:{ai:"AI",appearance:"外观",knowledge:"通用",sync:"同步",mcp:"连接",plugins:"插件",shortcuts:"快捷键",monitoring:"监控",agents:"智能体",update:"更新",uninstall:"卸载"},ai:{provider:"模型服务商",model:"模型",apiKey:"API 密钥",baseUrl:"接口地址",baseUrlHint:"可选。用于代理或自定义 API 端点。",keyHint:"本地存储于 ~/.mindos/config.json",keyOptionalHint:"本地服务商可选。存储于 ~/.mindos/config.json",envHint:"标有 env 的字段存在环境变量值。你可以在此覆盖,或一键恢复为环境变量默认值。",envFieldNote:a=>`环境变量 ${a} 已设置。清空此字段将回退到环境变量值。`,resetToEnv:"恢复为环境变量",restoreFromEnv:"从环境变量恢复",keyChange:"更改",keyCancel:"取消",noApiKey:"API 密钥未设置,AI 功能暂不可用,请在此填写。",testKey:"测试",testKeyTesting:"测试中...",testKeyOk:a=>`\u2713 ${a}ms`,testKeyAuthError:"API Key 无效",testKeyModelNotFound:"模型不存在",testKeyEndpointError:"接口地址或协议不匹配",testKeyRateLimited:"请求频率限制,稍后重试",testKeyNetworkError:"网络错误",testKeyNoKey:"未配置 API Key",testKeyUnknown:"测试失败",listModels:"选择模型",noModelsFound:"未找到可用模型",resetProvider:"重置",resetProviderConfirm:"再次点击确认"},customProviders:{title:"Model Providers",subtitle:"添加自定义 API 端点并为其命名",addButton:"+ 添加 Provider",editButton:"编辑",deleteButton:"删除",testButton:"测试",emptyState:"还没有自定义 Provider。添加一个来使用自定义 API 端点或代理。",modal:{titleAdd:"添加 Model Provider",titleEdit:"编辑 Model Provider",fieldName:"名称",fieldNameHint:"例如:公司 GPT-4、本地 LLaMA",fieldProtocol:"协议",fieldProtocolHint:"(大多数本地服务使用 OpenAI 兼容接口)",fieldBaseUrl:"接口地址",fieldBaseUrlHint:"例如:https://api.company.com/v1 或 http://localhost:8080/v1",fieldApiKey:"API 密钥",fieldApiKeyHint:"本地服务可留空",fieldModel:"模型",fieldModelHint:"例如:gpt-4-turbo、llama3.2",buttonCancel:"取消",buttonSave:"保存并测试",buttonSaveOnly:"保存",validating:"测试连接中...",success:"✓ 已连接",error:"连接失败"},deleteConfirm:a=>`删除 "${a}"?此操作不可撤销。`,deleteConfirmButton:"删除"},agent:{title:"Agent 行为",subtitle:"配置 AI 代理的运行方式",maxSteps:"最大步数",maxStepsHint:"每次请求的最大工具调用步数(1-30)",contextStrategy:"上下文策略",contextStrategyHint:"自动:上下文填满时摘要早期消息。关闭:不进行摘要(紧急裁剪仍会生效)。",contextStrategyAuto:"自动(压缩 + 裁剪)",contextStrategyOff:"关闭",thinking:"深度思考",thinkingHint:"显示 Claude 的推理过程(消耗更多 token)",thinkingBudget:"思考预算",thinkingBudgetHint:"推理最大 token 数(1000-50000)",reconnectRetries:"自动重连",reconnectRetriesHint:"连接断开时自动重试次数,重试耗尽后停止(0 = 关闭)"},appearance:{readingTitle:"阅读",readingDesc:"自定义笔记的阅读体验",readingFont:"正文字体",fontSize:"字体大小",fontSizePreview:"人之初性本善。",contentWidth:"内容宽度",preferencesTitle:"偏好",colorTheme:"颜色主题",system:"系统",dark:"深色",light:"浅色",language:"语言",browserNote:"外观设置保存在浏览器本地。",labsTitle:"实验性功能",labsDesc:"仍在开发中的功能,可能会变更或移除。",labsEcho:"回响",labsEchoDesc:"基于笔记的反思性日记。",labsWorkflows:"工作流",labsWorkflowsDesc:"Agent 可视化工作流自动化。",fontPreview:"人之初,性本善;性相近,习相远。"},knowledge:{cardTitle:"知识库",securityTitle:"安全",passwordPlaceholder:"留空可禁用",passwordShow:"显示",passwordHide:"隐藏",tokenNotSet:"— 未设置 —",mcpUrl:"MCP 地址",tokenGenerated:"已生成新令牌。请立即复制 — 之后不会再次完整显示。",monitoringTitle:"系统监控",monitoringFailed:"加载监控数据失败",monitorHeap:"堆内存",monitorRss:"RSS",monitorUptime:"运行时间",monitorNode:"Node",monitorRequests:"请求数",monitorToolCalls:"工具调用",monitorTokens:"Token",monitorFiles:"文件",monitorErrors:"错误",monitorMcpRunning:a=>`运行中 :${a}`,monitorMcpStopped:"已停止",cancel:"取消",mindRoot:"知识库根目录",mindRootHint:"笔记目录的绝对路径,修改后需要重启服务器。",mindRootEnvHint:a=>`MIND_ROOT 环境变量已设置为 "${a}",填写上方路径可覆盖它。`,envNote:"MIND_ROOT 环境变量已设置。填写上方路径后,你的值优先生效。",webPassword:"网页访问密码",webPasswordHint:"设置后访问浏览器 UI 需要登录,留空则关闭密码保护。下次刷新页面后生效。",webPasswordClear:"清除密码",authToken:"MCP / API 访问令牌",authTokenHint:"Agent 和 MCP 客户端使用的 Bearer Token,浏览器访问无需此项。",authTokenNone:"未设置令牌 — API 对所有请求开放。",authTokenCopy:"复制",authTokenCopied:"已复制!",authTokenReset:"重新生成",authTokenClear:"清除令牌",authTokenResetConfirm:"重新生成令牌?所有 MCP 客户端配置都需要更新。",authTokenMcpPort:"MCP 端口",restartWalkthrough:"重新开始引导",showHiddenFiles:"显示隐藏文件",showHiddenFilesHint:"在文件树中显示以 . 开头的文件夹(.agents、.claude、.mindos 等)。",cleanupExamples:"清理示例文件",cleanupExamplesHint:"移除知识库中所有模板示例文件(\uD83E\uDDEA_example_*)。",cleanupExamplesButton:"清理",cleanupExamplesNone:"没有找到示例文件",cleanupExamplesConfirm:a=>`删除 ${a} 个示例文件?此操作不可撤销。`,cleanupExamplesDone:a=>`已移除 ${a} 个示例文件`,cleanupExamplesScanning:"扫描中..."},sync:{emptyTitle:"跨设备同步",emptyDesc:"通过 Git 自动同步知识库到所有设备。",featureAutoCommit:"保存时自动提交",featureAutoPull:"自动拉取远程更新",featureConflict:"冲突检测",featureMultiDevice:"多设备同步",remoteUrl:"Git 远程仓库 URL",invalidUrl:"无效的 Git URL — 请使用 HTTPS (https://...) 或 SSH (git@...) 格式",sshBrief:"一次配置,无需令牌",httpsBrief:"通用性强,建议配令牌",sshHint:"需要本机已配置 SSH 密钥。验证命令:ssh -T git@github.com",accessToken:"访问令牌",optional:"(可选,私有仓库需要)",tokenHint:"GitHub:",tokenLink:"创建令牌(勾选 repo 权限)",branchLabel:"分支",connectButton:"连接并开始同步",connecting:"连接中...",stepConnecting:"正在连接远程仓库...",stepAuthenticating:"正在验证身份...",stepSyncing:"正在同步数据...",stepAlmostDone:"即将完成...",stepDone:"同步配置成功!",gitignoreTitle:"排除文件",gitignorePlaceholder:"# 不同步的文件\n*.tmp\nsecret/",gitignoreSave:"保存",gitignoreSaved:"已保存",conflictExplain:"这些文件在本机和远程都被修改了。请选择保留哪个版本。",keepLocal:"保留本地",keepRemote:"保留远程",keepLocalHint:"保留本机的版本",keepRemoteHint:"替换为远程版本",viewDiff:"点击查看两个版本的差异",localVersion:"本地(本机)",remoteVersion:"远程",emptyFile:"(空)",sectionTitle:"同步",labelProvider:"提供商",labelRemote:"远程",labelBranch:"分支",labelLastSync:"最后同步",labelUnpushed:"未推送",labelAutoSync:"自动同步",unpushedCommits:a=>`${a} 次提交`,syncNow:"立即同步",disableAutoSync:"禁用自动同步",enableAutoSync:"启用自动同步",syncComplete:"同步完成",syncFailed:"同步失败",autoSyncDisabled:"已禁用自动同步",autoSyncEnabled:"已启用自动同步",toggleFailed:"切换同步失败",conflictsTitle:a=>`冲突 (${a})`,conflictHint:"单击文件查看你的版本。悬停并单击",conflictHintSuffix:"查看远程版本。",timeNever:"从未",timeJustNow:"刚刚",timeMinAgo:a=>`${a} 分钟前`,timeHourAgo:a=>`${a} 小时前`,timeDayAgo:a=>`${a} 天前`},plugins:{title:"已安装渲染器",builtinBadge:"内置",coreBadge:"核心",enabled:"已启用",disabled:"已禁用",matchHint:"自动匹配",coreHint:"核心渲染器 — 始终启用",noPlugins:"暂无渲染器。",comingSoon:"插件市场即将上线。"},mcp:{modeCardTitle:"连接模式",modeCardDesc:"选择 Agent 如何连接到 MindOS。",cliLabel:"CLI",cliModeDesc:"Claude Code、Gemini CLI、Codex 等。",mcpLabel:"MCP",mcpModeDesc:"Claude Desktop、Cursor、Windsurf 等。",alwaysOn:"始终开启",mcpRunning:"运行中",mcpStopped:"已停止",mcpEnabledHint:"MCP 模式已启用。若仅使用 CLI Agent,可禁用此项以简化界面。",mcpDisabledHint:"启用 MCP 以连接 Claude Desktop 或 Cursor 等桌面客户端。",serverTitle:"MindOS MCP 服务",status:"状态",running:"运行中",stopped:"已停止",transport:"传输方式",endpoint:"端点",tools:"工具",toolsRegistered:a=>`已注册 ${a} 个`,auth:"认证",authSet:"已设置 Token",authNotSet:"未设置",copyEndpoint:"复制端点",copyConfig:"复制配置",copied:"已复制!",agentsTitle:"Agent 配置",agent:"Agent",scope:"范围",project:"项目",global:"全局",installed:"已安装",notInstalled:"未安装",detected:"已检测",notFound:"未找到",transportStdio:"stdio(推荐)",transportHttp:"http",transportAuto:"自动(推荐)",httpUrl:"MCP URL",httpToken:"认证 Token",installSelected:"安装选中",installing:"安装中...",installSuccess:a=>`已配置 ${a} 个 agent`,installFailed:"安装失败",portLabel:"MCP 端口",portHint:"修改后需重启服务",skillsTitle:"技能",skillsDesc:"教 Agent 如何操作你的知识库。",skillAutoLoaded:"每次请求自动加载",skillSource:"来源",skillBuiltin:"内置",skillUser:"自定义",addSkill:"+ 添加技能",cliInstallHint:"通过命令行安装:",skillPathHint:"技能文件安装路径:",deleteSkill:"删除",editSkill:"编辑",saveSkill:"保存",cancelSkill:"取消",skillName:"名称",skillDesc:"描述",skillContent:"内容",skillNameConflict:"同名技能已存在",skillDeleteConfirm:a=>`确定删除「${a}」?此操作不可撤销。`,skillLanguage:"技能语言",skillLangEn:"English",skillLangZh:"中文",searchSkills:"搜索技能...",customGroup:"自定义",builtinGroup:"内置",noSkillsMatch:a=>`没有匹配「${a}」的技能`,skillTemplate:"模板",skillTemplateGeneral:"通用",skillTemplateToolUse:"工具调用",skillTemplateWorkflow:"工作流",selectDetected:"选择已检测",clearSelection:"清除",quickSetup:"快速配置",configureFor:"配置目标",configPath:"配置路径",transportLocal:"本地",transportRemote:"远程",transportLocalHint:"本地 — 与 MindOS 服务在同一台机器上",transportRemoteHint:"远程 — 从其他设备通过 HTTP 连接",remoteDetectedHint:"使用当前远程 IP。",remoteManualHint:"将 127.0.0.1 替换为服务器的公网或局域网 IP。",remoteSteps:"从其他设备连接:① 在防火墙/安全组中开放端口 {port} ② 将下方配置粘贴到 Agent 中 ③ 公网环境建议使用 SSH 隧道加密传输。",noAuthWarning:"⚠ 未设置认证令牌 — 请先在 设置 → 通用 中配置,再启用远程访问。",showJson:"显示 JSON",hideJson:"隐藏 JSON",connectionTitle:"连接 Agent",connectionHint:"选择 AI Agent 连接 MindOS 的方式。",tokenCardTitle:"认证令牌",tokenCardDesc:"用于 CLI 远程模式和 MCP 连接。",mcpHint:"适用于 Claude Desktop、Cursor 等使用 MCP 工具协议的 Agent。",tokenLabel:"认证令牌",tokenMasked:"点击「显示」查看完整令牌",tokenShow:"显示",tokenHide:"隐藏",tokenCopy:"复制",tokenCopied:"令牌已复制!",tokenNone:"未设置令牌 — MCP 服务对所有请求开放。",tokenNoneAction:"请在 设置 → 通用 → 安全 中生成令牌。",serverUrl:"MCP 服务地址",serverUrlCopy:"复制地址",howToConnect:"如何连接 AI 助手",howToStep1:"打开你的 AI 助手的 MCP 设置(如 Claude Code、Cursor)",howToStep2:"添加一个新的 MCP 服务,填入上方地址",howToStep3:"将认证令牌设为 Bearer Token",howToStep4:"保存并验证连接",cliSkillTitle:"CLI 技能",cliSkillHint:"适用于支持 bash 的 Agent(Claude Code、Gemini CLI、Codex)——更省 token,无需 MCP。",cliSkillDesc:"更省 token,技能内置——安装即可使用。",cliLocalDesc:"MindOS Skill 已内置,安装 CLI 即可直接使用。",cliRemoteDesc:"在其他设备上安装 CLI,远程连接到此 MindOS 服务器。",cliSkillInstall:"安装",cliSkillInstallCmd:"npm install -g @geminilight/mindos",cliSkillRemote:"远程",cliSkillVerify:"验证",cliSkillVerifyCmd:"mindos file list",cliRemoteConfigure:"配置",cliInstallSkill:"安装技能",cliAgents:"Claude Code \xb7 Gemini CLI \xb7 Codex",mcpAgents:"Claude Desktop \xb7 Cursor",mcpDesc:"需要逐个 Agent 配置 MCP,通过以下命令单独安装技能:",mcpLocalDesc:"复制下方配置代码,粘贴到你的 Agent 的 MCP 设置中。",mcpRunningLabel:"MCP 运行中",mcpServerStatus:"MCP 服务",autoInstallAgents:"自动安装到已检测的 Agent",detectedAgentsTitle:"检测到的 Agent",cliInstallDesc:"为你的 Agent 安装 MindOS Skill,让它能操作你的知识库。",mcpInstallDesc:"为本机检测到的 Agent 安装 MCP 配置和 Skill。",tokenCopyFullHint:"复制完整令牌",skillsInstalled:"个技能已安装",recommended:"推荐",localTitle:"本机",localReady:"可直接使用",remoteTitle:"远程访问",remoteSubtitle:"从其他设备连接",restarting:"重启中...",restart:"重启",portsCardTitle:"服务端口",portsCardDesc:"Web UI 和 MCP 服务端口。更改后重启生效。",webPortLabel:"Web UI 端口",webPortHint:"浏览器访问的端口。",mcpPortLabel:"MCP 服务端口",mcpPortHint:"Agent 和桌面客户端连接的端口。",portChecking:"检测中…",portAvailable:"可用",portSelf:"当前端口",portInUse:a=>`端口 ${a} 已被占用`,portSuggest:a=>`使用 ${a}`,portConflict:"Web 和 MCP 端口不能相同。",portUpdating:"保存中…",portWebRestarting:"正在重启服务…",portMcpRestarting:"正在重启 MCP…",portUpdateSuccess:"端口更新成功。",portUpdateFailed:"端口更新失败。",portRestartTimeout:"重启超时,请重试。",portRedirecting:"正在跳转到新地址…",portUpdateBtn:"更新端口",externalToolsTitle:"外部 MCP 工具",externalToolsDesc:"配置外部 MCP 服务器的工具访问模式。"},monitoring:{system:"系统",heapMemory:"堆内存",rss:"RSS",uptime:"运行时间",nodeVersion:"Node",application:"应用",requests:"请求数",toolCalls:"工具调用",avgResponse:"平均响应",tokens:"Token",errors:"错误",knowledgeBase:"知识库",files:"文件数",totalSize:"总大小",rootPath:"根目录",mcpStatus:"状态",mcpRunning:"运行中",mcpStopped:"已停止",mcpPort:"端口",autoRefresh:"每 5 秒自动刷新",fetchError:"加载监控数据失败"},agents:{mcpServer:"MCP 服务器",running:"运行中",stopped:"未运行",restarting:"重启中...",restart:"重启",onPort:a=>`端口 :${a}`,refresh:"刷新",refreshing:"刷新中...",connected:"已连接",connectedCount:a=>`已连接 (${a})`,detectedNotConfigured:"已检测未配置",detectedCount:a=>`已检测未配置 (${a})`,notDetected:"未检测到",notDetectedCount:a=>`未检测到 (${a})`,showAll:"显示全部",hideAll:"收起",connect:"连接",noAgents:"本机未检测到任何 Agent。",fetchError:"加载 Agent 数据失败",autoRefresh:"每 30 秒自动刷新"},save:"保存",saved:"已保存",saveFailed:"保存失败",reconfigure:"重新配置",askDisplayMode:{label:"显示模式",hint:"侧面板固定在右侧;弹窗以浮动对话框形式打开。",panel:"侧面板",popup:"弹窗"},update:{checking:"正在检查更新...",upToDate:"已是最新版本",available:(a,b)=>`有新版本可用:v${a} → v${b}`,updating:"正在更新 MindOS,服务器即将重启...",updatingHint:"预计 1–3 分钟,请勿关闭此页面。",serverRestarting:"服务正在重启,请稍候...",updated:"更新成功!正在刷新...",timeout:"更新可能仍在进行中。",timeoutHint:"服务器可能需要更多时间重新构建,请尝试刷新页面。",refreshButton:"刷新页面",retryButton:"重试更新",error:"检查更新失败,请检查网络连接。",checkButton:"检查更新",updateButton:a=>`更新到 v${a}`,releaseNotes:"查看更新日志",hint:"更新通过 npm 安装,等同于在终端运行",inTerminal:"。",desktopDownloading:"正在下载更新...",desktopReady:"更新已下载,重启后生效。",desktopRestart:"立即重启",desktopHint:"更新通过桌面端自动更新推送。",coreTitle:"MindOS Core",coreUpToDate:"核心已是最新",coreAvailable:a=>`有新版本可用(${a})`,coreDownloading:"下载中...",coreCancel:"取消",coreReady:"已就绪 — 重启服务即可生效",coreRestartServices:"重启服务",coreApplying:"正在应用更新...",coreApplied:"更新成功!正在刷新...",coreError:"核心更新失败。",coreRetry:"重试",coreDesktopTooOld:a=>`v${a} 需要更新版本的 Desktop。`,coreDesktopTooOldHint:"请先更新 MindOS Desktop。",coreHint:"核心更新只需重启服务,无需重启应用。",shellTitle:"MindOS Desktop",updateToast:{titleSingle:(a,b)=>`${a} v${b} 可用`,titleMultiple:"有可用更新",desktopLabel:"桌面版",coreLabel:"运行时",viewDetails:"查看详情",skipVersion:"跳过此版本",skipAll:"全部跳过"}},uninstall:{title:"卸载 MindOS",descCli:"从本机移除 MindOS CLI、后台服务和配置文件。",descDesktop:"从本机移除 MindOS Desktop、后台服务和配置文件。",warning:"选择要清理的内容。你的知识库文件始终是安全的。",stopServices:"停止服务并移除守护进程",stopServicesDesc:"停止所有运行中的 MindOS 进程并移除后台守护进程。",removeConfig:"移除配置",removeConfigDesc:"删除 ~/.mindos/ 目录(配置、日志、PID 文件)。",removeNpm:"卸载 CLI 包",removeNpmDesc:"执行 npm uninstall -g @geminilight/mindos。",removeApp:"将 Desktop 移入废纸篓",removeAppDesc:"将 MindOS.app 移入废纸篓,之后可以恢复。",confirmTitle:"确认卸载",confirmButton:"卸载",cancelButton:"取消",running:"正在卸载...",success:"MindOS 已卸载。",successDesktop:"MindOS 已卸载,应用即将退出。",error:"卸载失败,可在终端手动运行 `mindos uninstall`。",nothingSelected:"请至少选择一项要卸载的内容。",kbSafe:"你的知识库文件始终是安全的——此操作绝不会删除它们。"}},onboarding:{subtitle:"知识库为空,选择一个模板快速开始。",templates:{en:{title:"English",desc:"预置 Profile、Notes、Projects 等英文目录结构。"},zh:{title:"中文",desc:"预置画像、笔记、项目等中文目录结构。"},empty:{title:"空白",desc:"仅包含 README、CONFIG 和 INSTRUCTION 基础文件。"}},importHint:"已有笔记?在设置中将 MIND_ROOT 指向已有目录即可。",syncHint:"需要跨设备同步?完成初始化后在终端运行",syncHintSuffix:"即可。",initError:"初始化失败。请刷新页面或尝试其他模板。",dismiss:"关闭"},setup:{stepTitles:["知识库","AI 配置","Agent 连接","确认"],kbPath:"知识库路径",kbPathHint:"笔记目录的绝对路径。",kbPathDefault:"~/MindOS/mind",kbPathUseDefault:a=>`使用 ${a}`,kbPathHasFiles:a=>`该目录已有 ${a} 个文件。可以跳过模板,或选择合并(已有文件不会被覆盖)。`,kbTemplateSkip:"跳过模板",kbTemplateMerge:"选择模板合并",template:"初始模板",templateSkip:"跳过(目录已有文件)",aiProvider:"AI 服务商",aiProviderHint:"选择你偏好的 AI 服务。",aiSkip:"跳过 — 稍后配置",apiKey:"API 密钥",apiKeyExisting:"已配置密钥。留空即保持不变。",model:"模型",listModels:"选择模型",noModelsFound:"未找到可用模型",baseUrl:"接口地址",baseUrlHint:"可选。用于代理或自定义 API 端点。",webPort:"Web UI 端口",mcpPort:"MCP 服务端口",portHint:"有效范围:1024–65535",portRestartWarning:"完成配置后,服务将以这些端口启动。",portInUse:a=>`端口 ${a} 已被占用。`,portSuggest:a=>`使用 ${a}`,portChecking:"检测中…",portSelf:"当前端口",portConflict:"Web UI 端口和 MCP 端口不能相同。",portVerifyHint:"点击输入框外部验证,或等待自动检测。",authToken:"认证令牌",authTokenHint:"MCP / API 客户端使用的 Bearer Token,自动生成。",authTokenUsage:"用于 MCP 连接和 API 客户端身份验证。配置 Agent 时会自动写入,无需手动填写。",authTokenUsageWhat:"这是什么?",authTokenSeed:"自定义种子(可选)",authTokenSeedHint:"输入口令短语生成确定性 Token。",generateToken:"生成",copyToken:"复制",copiedToken:"已复制!",webPassword:"访问密码",webPasswordHint:"保护你的知识库,防止未授权的浏览器访问。",webPasswordRequired:"密码是必填项,用于保护你的数据。",advancedPorts:"高级设置",tokenSectionTitle:"认证令牌(已自动生成)",tokenSectionHint:"AI Agent 连接你的 MindOS 服务器时使用。",agentToolsTitle:"Agent 连接",connectionModeTitle:"连接模式",connectionModeCliHint:"推荐 \xb7 更省 token",connectionModeMcpHint:"可选 \xb7 消耗更多 token",agentToolsHint:"选择要配置的 AI Agent。此步骤可选。",agentToolsHintCliOnly:"Agent 选择在 MCP 模式启用时生效。CLI 可直接用于所有支持 bash 的 Agent。",agentToolsHintNone:"未选择连接模式。请至少选择一种模式以连接 Agent。",agentTransport:"传输方式",agentScope:"范围",agentToolsLoading:"正在加载 Agent…",agentToolsEmpty:"未检测到受支持的 Agent。",agentNoneSelected:"未选择 Agent。可稍后在设置中配置。",agentSkipLater:"清除选择",agentSelectDetected:"选择已检测到的 Agent",agentNoneDetected:"未在系统中检测到已安装的 Agent。",agentShowMore:a=>`显示另外 ${a} 个 Agent`,agentAdvanced:"高级选项",agentScopeGlobal:"为所有项目安装",agentScopeProject:"仅当前项目",badgeInstalled:"已安装",badgeDetected:"已检测到",badgeNotFound:"未找到",agentNotInstalled:"未安装",agentDetected:"已检测到",agentNotFound:"未找到",agentGetIt:"去安装 →",agentStatusOk:"已配置",agentStatusError:"失败",agentInstalling:"配置中…",agentTransportAuto:"自动(推荐)",agentTransportLabel:"传输方式",agentVerified:"已验证",agentUnverified:"未验证",agentVerifyNote:"stdio agent 需重启后验证",skillWhat:"",skillAutoHint:()=>"",skillLabel:"技能",skillInstalling:"正在安装技能…",skillInstalled:"技能已安装",skillFailed:"技能安装失败",aiSkipTitle:"暂时跳过",aiSkipDesc:"稍后可在 设置 → AI 中添加 API 密钥。",reviewHint:"确认设置无误后,点击完成。",reviewInstallResults:"Agent 配置结果:",phaseSaving:"正在保存配置…",phaseAgents:"正在配置 Agent…",phaseSkill:"正在安装 Skill…",phaseDone:"设置完成!",retryAgent:"重试",agentFailedCount:a=>`${a} 个 Agent 配置失败`,agentCountSummary:a=>`${a} 个 Agent`,agentFailureNote:"Agent 安装失败不影响进入 MindOS — 可稍后在 设置 → 连接 中重试。",portAvailable:"可用",portChanged:"端口已变更 — 请重启服务以使其生效。",restartRequired:"以下变更需要重启服务后生效。",restartNow:"立即重启",restarting:"重启中…",restartDone:"服务正在重启,稍后自动跳转…",restartManual:"手动重启命令:",back:"上一步",next:"下一步",complete:"完成设置",skip:"跳过",completing:"保存中...",completeDone:"设置完成!",completeFailed:"设置失败,请重试。",healthKb:"知识库",healthKbNone:"未配置",healthAi:"AI 服务",healthAiNone:"未配置 — AI 功能不可用",healthAiAction:"可在 设置 → AI 中添加 API 密钥。",healthAgents:"Agent 连接",healthAgentsOk:a=>`已配置 ${a} 个 Agent`,healthAgentsPartial:"正在配置中...",healthAgentsNone:"未配置 Agent",healthAgentsAction:"可稍后在 设置 → 连接 中添加。",healthSkills:"Skills",healthSkillsOk:"Skill 安装成功",healthSkillsError:"Skill 安装失败",healthSkillsSkipped:"已跳过",healthSkillsInstalling:"正在安装 Skill…",healthSkillsAction:"可稍后手动安装 Skill。",healthTokenTitle:"认证令牌",healthTokenCopy:"复制令牌",healthTokenHint:"CLI 远程模式和 MCP 连接时使用。也可在 设置 → 连接 中找到。",healthGoHome:"进入 MindOS",welcomeTitle:"欢迎使用 MindOS!",welcomeDesc:"初始化完成。现在可以直接问 MindOS、浏览知识库,或配置 MCP Agent。",welcomeLinkReconfigure:"重新配置",welcomeLinkAskAI:"MindOS",welcomeLinkMCP:"MCP 设置"},guide:{title:"快速上手",showGuide:"显示新手引导",close:"关闭",skip:"跳过",stepLocked:"请先完成上一步",import:{title:"导入你的文件",cta:"导入",desc:"上传简历、项目文档、笔记——任何你想让 AI Agent 了解的内容。",button:"导入文件"},ai:{title:"AI 帮你沉淀",cta:"试试",desc:"让 MindOS 把对话中的经验沉淀到知识库:",prompt:"帮我把这次对话的关键收获整理成一份可复用的 SOP,存到我的知识库里。",promptEmpty:"帮我设计一个适合我的知识库目录结构"},agent:{title:"连接其他 Agent",cta:"复制提示词",desc:"打开 Cursor、Claude Code 或任意 MCP Agent,粘贴以下提示词,让知识流入 MindOS:",copyPrompt:"把我们刚才讨论的内容总结一下,存到我的 MindOS 知识库里,形成可复用的 SOP。",copy:"复制",copied:"已复制!"},done:{title:"你已准备好使用 MindOS",titleFinal:"你已掌握 MindOS 核心用法",steps:[{hint:"下一步:试试把一篇文章存进来 →",prompt:"帮我把这篇文章的要点整理到 MindOS 里。"},{hint:"下一步:试试把经验沉淀为 SOP →",prompt:"帮我把这次对话的经验沉淀到 MindOS,形成可复用的工作流。"}]}},walkthrough:{step:(a,b)=>`${a} / ${b}`,next:"下一步",back:"上一步",skip:"跳过引导",done:"完成",exploreCta:"探索更多用法 →",steps:[{title:"你的项目记忆",body:"用 Space 管理项目、SOP 和偏好规则。数据存在本地,完全由你掌控。"},{title:"不用重讲背景的 AI",body:"MindOS 会自动读取你的知识库。问它项目相关的事,不需要每次都重复交代背景。"},{title:"多 Agent 共享记忆",body:"通过 MCP 连接 Cursor、Claude Code、Windsurf,它们共享同一份项目记忆。"}]},shortcuts:[{keys:["⌘","K"],description:"搜索"},{keys:["⌘","/"],description:"MindOS"},{keys:["⌘",","],description:"设置"},{keys:["E"],description:"编辑当前文件"},{keys:["⌘","S"],description:"保存"},{keys:["Esc"],description:"取消编辑 / 关闭弹窗"},{keys:["@"],description:"在 AI 对话中添加附件"}],help:{title:"帮助与指南",subtitle:"开始使用 MindOS 所需的一切",whatIs:{title:"什么是 MindOS?",body:"MindOS 是你的本地知识助手。它把项目、决策、SOP 和偏好整理在同一处,让你和已连接的 Agent 都能基于同一份上下文工作。文件保留在本地,知识可以反复复用,也不用每次都从头交代背景。"},quickStart:{title:"快速开始",step1Title:"浏览你的知识库",step1Desc:'点击左侧边栏的"空间"图标来浏览你的文件。每个顶级文件夹是一个"空间"——比如个人档案、笔记或项目。',step2Title:"和 MindOS 对话",step2Desc:"按 ⌘/(或 Ctrl/)打开 MindOS。你可以直接询问知识库相关问题,或用 @ 附加特定文件作为上下文。",step3Title:"连接你的 AI Agent",step3Desc:"前往 设置 → 连接 以连接外部 Agent,如 Claude Code、Cursor 或 Windsurf。连接后,它们可以直接读写你的知识库。"},concepts:{title:"核心概念",spaceTitle:"空间(Space)",spaceDesc:"空间是按你的思维方式组织的知识分区。你怎么想,就怎么分,AI Agent 遵循同样的结构来自动读写和管理。",instructionTitle:"指令(Instruction)",instructionDesc:"一份所有 AI Agent 都遵守的规则文件。你写一次边界,每个连接到知识库的 Agent 都会照做。",skillTitle:"技能(Skill)",skillDesc:"教 Agent 如何操作你的知识库——读取、写入、整理。Agent 不是瞎猜,而是按你安装的 Skill 来执行。"},shortcutsTitle:"快捷键",agentUsage:{title:"在 AI Agent 中使用 MindOS",intro:"通过 MCP 连接 Agent(Claude Code、Cursor、Windsurf 等)后,直接用自然语言对话即可。Agent 能自动读写你的知识库,不需要特殊指令。以下是最常见的使用场景:",scenarios:[{emoji:"\uD83E\uDEAA",title:"注入身份",desc:"让所有 AI Agent 一次认识你——偏好、技术栈、沟通风格。",prompt:'"这是我的简历,读一下,把我的信息整理到 MindOS 里。"'},{emoji:"\uD83D\uDD04",title:"跨 Agent 切换",desc:"在 GPT 里聊想法,到 Claude Code 去执行——上下文零丢失。",prompt:'"帮我把刚才的对话整理到 MindOS。"\n"读一下 MindOS 里的方案,帮我开始写代码。"'},{emoji:"\uD83D\uDCCB",title:"经验→SOP",desc:"把踩坑经验沉淀为可复用的工作流,下次 3 分钟搞定。",prompt:'"帮我把这次对话的经验沉淀到 MindOS,形成可复用的工作流。"'},{emoji:"\uD83D\uDE80",title:"项目冷启动",desc:"几分钟搭建新项目——Profile 和 SOP 自动引导脚手架。",prompt:'"帮我按 MindOS 里的 Startup SOP 启动一个新项目。"'},{emoji:"\uD83D\uDD0D",title:"调研入库",desc:"让 Agent 替你调研竞品或话题,结果结构化存入知识库。",prompt:'"帮我调研 X、Y、Z 这几个产品,结果写入 MindOS 产品库。"'}],copy:"复制 Prompt",hint:'提示:Agent 会自动发现你的知识库结构。在 prompt 中提到"MindOS",它就知道去哪里找。点击左侧"探索"查看更多场景。'},shortcuts:{search:"搜索文件",askAI:"切换 MindOS",settings:"打开设置",shortcutPanel:"快捷键面板",editFile:"编辑当前文件",save:"保存文件",closePanel:"关闭面板 / 退出弹窗",attachFile:"在 MindOS 中附加文件"},faq:{title:"常见问题",items:[{q:"如何切换语言?",a:"前往 设置 → 外观 → 语言。支持中文和英文切换。"},{q:"如何连接 AI Agent?",a:"前往 设置 → 连接。MindOS 会自动检测已安装的 Agent(Claude Code、Cursor 等),一键即可连接。"},{q:"我的数据存储在哪里?",a:"所有数据以纯 Markdown 文件的形式存储在你的本地机器上。MindOS 不会将你的数据上传到任何云服务。数据完全由你掌控。"},{q:"如何跨设备同步?",a:"前往 设置 → 同步。MindOS 使用 Git 进行跨设备同步。输入 Git 远程仓库 URL 和访问令牌即可开始同步。"},{q:"可以使用自己的 AI 服务商吗?",a:"可以!前往 设置 → AI。支持 OpenAI、Anthropic、Google,或任何 OpenAI 兼容的 API(自定义 Base URL)。"},{q:"支持哪些文件格式?",a:"MindOS 最适合 Markdown(.md)文件,但也支持 JSON、CSV 和纯文本。插件可以扩展特殊格式的渲染,如看板或时间线。"},{q:"如何创建新笔记?",a:"点击文件树中任意文件夹旁的 + 图标,或让 AI 帮你创建。笔记就是 Markdown 文件,你也可以直接在文件系统中创建。"}]}},explore:{title:"探索使用场景",subtitle:"发现 MindOS 能帮你做什么 — 选一个场景,立即体验。",tryIt:"试一试",all:"全部",byCapability:"按能力",byScenario:"按场景",categories:{"knowledge-management":"知识管理","memory-sync":"记忆同步","auto-execute":"自动执行","experience-evolution":"经验进化","human-insights":"人类洞察","audit-control":"审计纠错"},scenarios:{"first-day":"初次使用",daily:"日常工作",project:"项目协作",advanced:"高级"},c1:{title:"注入身份",desc:"让所有 AI Agent 一次认识你 — 偏好、技术栈、沟通风格。",prompt:"这是我的简历,读一下,把我的信息整理到 MindOS 里。"},c2:{title:"注入信息",desc:"一句话归档文章、会议纪要或网页到知识库,全局可搜。",prompt:"帮我把这篇文章的要点整理到 MindOS 里。"},c3:{title:"跨 Agent 切换",desc:"在 MindOS 写方案,在 Claude Code 写代码,在 Cursor 优化 — 零重复。",prompt:"帮我按 MindOS 里的 XXX 方案开始写代码。"},c4:{title:"经验→SOP",desc:"把踩坑经验沉淀为可复用的工作流,下次 3 分钟搞定。",prompt:"帮我把这次对话的经验沉淀到 MindOS,形成可复用的工作流。"},c5:{title:"手机记灵感",desc:"随手记下灵感,MindOS 自动归档、拆任务、多 Agent 接力执行。",prompt:"帮我把这个想法整理到 MindOS,拆解成可执行的子任务。"},c6:{title:"项目冷启动",desc:"4 分钟搭建新项目 — Profile 和 SOP 自动引导脚手架。",prompt:"帮我按 MindOS 里的 Startup SOP 启动一个新项目。"},c7:{title:"调研入库",desc:"让 Agent 替你跑腿调研竞品或话题,结果结构化入库。",prompt:"帮我调研 X、Y、Z 这几个产品,结果写入 MindOS 产品库。"},c8:{title:"人脉管理",desc:"记录对话、自动生成跟进待办,每个联系人都有完整上下文。",prompt:"我今天和 XXX 聊了这些内容,帮我更新到 MindOS 并生成跟进待办。"},c9:{title:"审计纠偏",desc:"审查 Agent 记了什么,一处修正,全局生效。",prompt:"帮我检查 MindOS Profile 里的技术栈偏好是否正确,有错误帮我修正。"}}}}},53878:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>ad,Fo:()=>K,gL:()=>L});var d=c(48249),e=c(67484),f=c(19099),g=c(93491),h=c(33191),i=c(83654),j=c(80600),k=c(40560),l=c(44218),m=c(28330),n=c(86718),o=c(7309),p=c(65032),q=c(24703),r=c(16944),s=c(15273),t=c(12625),u=c(59347),v=c(99829);let w=(0,v.createServerReference)("60991aaa6326801a3ac6fcca6a52a8bc4686ca4d03",v.callServer,void 0,v.findSourceMapURL,"createFileAction"),x=(0,v.createServerReference)("603e194a253a6323806f2c61be0a793c75304ecba4",v.callServer,void 0,v.findSourceMapURL,"renameSpaceAction");var y=c(35559);let z=(0,v.createServerReference)("40b2058b679f1adb185eef0dfc2a49b26216b5c209",v.callServer,void 0,v.findSourceMapURL,"deleteSpaceAction"),A=(0,v.createServerReference)("4070dd795986b734bf026bf8e27c8c1f77ee7f03dc",v.callServer,void 0,v.findSourceMapURL,"deleteFolderAction");var B=c(80655),C=c(36869),D=c(99101),E=c(47223),F=c(57056),G=c(29713);let H="show-hidden-files";function I(a){let b=b=>{b.key===H&&a()},c=()=>a();return window.addEventListener("storage",b),window.addEventListener("mindos:hidden-files-changed",c),()=>{window.removeEventListener("storage",b),window.removeEventListener("mindos:hidden-files-changed",c)}}function J(){return!1}function K(a){localStorage.setItem(H,String(a)),window.dispatchEvent(new Event("mindos:hidden-files-changed"))}function L(){return(0,e.useSyncExternalStore)(I,J,()=>!1)}var M=c(24520),N=c(37917),O=c(801);let P=(0,v.createServerReference)("40bba98869abfce30b1914516fed91354ee52c24a0",v.callServer,void 0,v.findSourceMapURL,"convertToSpaceAction");var Q=c(95054);async function R(){try{let a=await (0,Q.n)("/api/settings"),b=a.ai?.provider??"",c=(a.ai?.providers??{})[b];return!!c?.apiKey}catch{return!1}}async function S(a){try{await navigator.clipboard.writeText(a)}catch{}}let T="w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",U="w-full flex items-center gap-2 px-3 py-2 text-sm text-error hover:bg-error/10 transition-colors text-left",V="my-1 border-t border-border/50";function W({x:a,y:b,onClose:c,menuHeight:f,children:g}){let h=(0,e.useRef)(null),i=Math.min(b,window.innerHeight-(f??160)),j=Math.min(a,window.innerWidth-200);return(0,d.jsx)("div",{ref:h,className:"fixed z-50 min-w-[180px] bg-card border border-border rounded-lg shadow-lg py-1",style:{top:i,left:j},children:g})}function X({x:a,y:b,node:c,onClose:e,onRename:g,onNewFile:i,onImport:j,onDelete:k}){let l=(0,f.useRouter)(),{t:m}=(0,E.Y)(),{isPinned:n,togglePin:o}=(0,G.Z)(),p=n(c.path);return(0,d.jsxs)(W,{x:a,y:b,onClose:e,children:[(0,d.jsxs)("button",{className:T,onClick:()=>{i(),e()},children:[(0,d.jsx)(M.A,{size:14,className:"shrink-0"})," ",m.fileTree.newFile]}),(0,d.jsxs)("button",{className:T,onClick:()=>{l.push(`/view/${(0,h.O0)(`${c.path}/INSTRUCTION.md`)}`),e()},children:[(0,d.jsx)(N.A,{size:14,className:"shrink-0"})," ",m.fileTree.viewRules]}),j&&(0,d.jsxs)("button",{className:T,onClick:()=>{j(c.path),e()},children:[(0,d.jsx)(O.A,{size:14,className:"shrink-0"})," ",m.fileTree.importFile]}),(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:T,onClick:()=>{o(c.path),e()},children:[(0,d.jsx)(r.A,{size:14,className:`shrink-0 ${p?"fill-[var(--amber)] text-[var(--amber)]":""}`}),p?m.fileTree.removeFromFavorites:m.fileTree.pinToFavorites]}),(0,d.jsxs)("button",{className:T,onClick:()=>{S(c.path),e()},children:[(0,d.jsx)(s.A,{size:14,className:"shrink-0"})," ",m.fileTree.copyPath]}),(0,d.jsxs)("button",{className:T,onClick:()=>{g(),e()},children:[(0,d.jsx)(t.A,{size:14,className:"shrink-0"})," ",m.fileTree.renameSpace]}),(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:U,onClick:()=>{e(),k()},children:[(0,d.jsx)(u.A,{size:14,className:"shrink-0"}),m.fileTree.deleteSpace]})]})}function Y({x:a,y:b,node:c,onClose:g,onRename:h,onNewFile:i,onDelete:j}){let k=(0,f.useRouter)(),{t:l}=(0,E.Y)(),[m,o]=(0,e.useTransition)(),{isPinned:p,togglePin:q}=(0,G.Z)(),v=p(c.path);return(0,d.jsxs)(W,{x:a,y:b,onClose:g,menuHeight:220,children:[(0,d.jsxs)("button",{className:T,onClick:()=>{i(),g()},children:[(0,d.jsx)(M.A,{size:14,className:"shrink-0"})," ",l.fileTree.newFile]}),(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:T,onClick:()=>{q(c.path),g()},children:[(0,d.jsx)(r.A,{size:14,className:`shrink-0 ${v?"fill-[var(--amber)] text-[var(--amber)]":""}`}),v?l.fileTree.removeFromFavorites:l.fileTree.pinToFavorites]}),(0,d.jsxs)("button",{className:T,disabled:m,onClick:()=>{o(async()=>{if((await P(c.path)).success){k.refresh(),window.dispatchEvent(new Event("mindos:files-changed"));let a=c.name.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||c.name;R().then(b=>{b&&function(a,b,c=""){let d="u">typeof document&&"zh"===document.documentElement.lang?`初始化新建的心智空间「${a}」,路径为「${b}/」。${c?`描述:「${c}」。`:""}两个文件均已存在模板,用 write_file 覆盖:
|
|
117
|
-
1. 「${b}/README.md」— 写入空间用途、结构概览、使用指南
|
|
118
|
-
2. 「${b}/INSTRUCTION.md」— 写入 AI Agent 在此空间中的行为规则和操作约定
|
|
119
|
-
|
|
120
|
-
内容简洁实用,直接使用工具写入。`:`Initialize the new Mind Space "${a}" at "${b}/". ${c?`Description: "${c}". `:""}Both files already exist with templates — use write_file to overwrite:
|
|
121
|
-
1. "${b}/README.md" — write purpose, structure overview, usage guidelines
|
|
122
|
-
2. "${b}/INSTRUCTION.md" — write rules for AI agents operating in this space
|
|
123
|
-
|
|
124
|
-
Keep content concise and actionable. Write files directly using tools.`;window.dispatchEvent(new CustomEvent("mindos:ai-init",{detail:{spaceName:a,spacePath:b,description:c,state:"working"}})),fetch("/api/ask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[{role:"user",content:d}],currentFile:b+"/INSTRUCTION.md"})}).then(async a=>{if(!a.ok||!a.body)throw Error(`HTTP ${a.status}`);let c=a.body.getReader();try{for(;;){let{done:a}=await c.read();if(a)break}}finally{c.releaseLock()}window.dispatchEvent(new CustomEvent("mindos:ai-init",{detail:{spacePath:b,state:"done"}})),window.dispatchEvent(new Event("mindos:files-changed"))}).catch(()=>{window.dispatchEvent(new CustomEvent("mindos:ai-init",{detail:{spacePath:b,state:"error"}}))})}(a,c.path)})}g()})},children:[(0,d.jsx)(n.A,{size:14,className:"shrink-0 text-[var(--amber)]"})," ",l.fileTree.convertToSpace]}),(0,d.jsxs)("button",{className:T,onClick:()=>{S(c.path),g()},children:[(0,d.jsx)(s.A,{size:14,className:"shrink-0"})," ",l.fileTree.copyPath]}),(0,d.jsxs)("button",{className:T,onClick:()=>{h(),g()},children:[(0,d.jsx)(t.A,{size:14,className:"shrink-0"})," ",l.fileTree.rename]}),(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:U,onClick:()=>{g(),j()},children:[(0,d.jsx)(u.A,{size:14,className:"shrink-0"}),l.fileTree.deleteFolder]})]})}var Z=c(63710);function $(){window.dispatchEvent(new Event("mindos:files-changed"))}async function _(a){try{await navigator.clipboard.writeText(a)}catch{}}function aa({dirPath:a,depth:b,onDone:c}){let[g,i]=(0,e.useState)(""),[j,l]=(0,e.useTransition)(),[m,n]=(0,e.useState)(""),o=(0,f.useRouter)(),{t:p}=(0,E.Y)(),q=(0,e.useRef)(null),r=(0,e.useCallback)(()=>{let b=g.trim();b?l(async()=>{let d=await w(a,b);d.success&&d.filePath?(c(),o.push(`/view/${(0,h.O0)(d.filePath)}`),o.refresh(),$()):n(d.error||p.fileTree.failed)}):n(p.fileTree.enterFileName)},[g,a,c,o,p]);return(0,d.jsxs)("div",{ref:q,className:"px-2 pb-1",style:{paddingLeft:`${12*b+20}px`},children:[(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("input",{autoFocus:!0,type:"text",value:g,onChange:a=>{i(a.target.value),n("")},onKeyDown:a=>{"Enter"===a.key&&r(),"Escape"===a.key&&c()},placeholder:"filename.md",className:" flex-1 bg-muted border border-border rounded px-2 py-1 text-xs text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring "}),j?(0,d.jsx)(k.A,{size:13,className:"text-muted-foreground animate-spin shrink-0"}):(0,d.jsx)("button",{onClick:r,className:"text-xs text-[var(--amber)] hover:text-foreground shrink-0 px-1",children:p.fileTree.create})]}),m&&(0,d.jsx)("p",{className:"text-xs text-error mt-0.5 px-1",children:m})]})}function ab({node:a,depth:b,currentPath:c,onNavigate:i,maxOpenDepth:j,onImport:r}){let s=(0,f.useRouter)(),t=c.startsWith(a.path+"/")||c===a.path,u=!!a.isSpace,[v,w]=(0,e.useState)(0===b||t),[C,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(a.name),[L,M]=(0,e.useTransition)(),N=(0,e.useRef)(null),O=(0,e.useRef)(null),[P,Q]=(0,e.useState)(null),{t:R}=(0,E.Y)(),[S,T]=(0,e.useState)(null),[U,V]=(0,e.useTransition)(),{isDragTarget:W,handleRowDragOver:_,handleRowDragEnter:ab,handleRowDragLeave:ac,handleRowDrop:ae}=function(a,b,c,d){let[f,g]=(0,e.useState)(!1),h=(0,e.useRef)(null),i=(0,e.useRef)(null),j=(0,e.useCallback)(()=>{h.current&&(clearTimeout(h.current),h.current=null)},[]),k=(0,e.useCallback)(a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),a.stopPropagation(),a.dataTransfer.dropEffect="copy",i.current&&(clearTimeout(i.current),i.current=null),f||g(!0))},[f]),l=(0,e.useCallback)(a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),a.stopPropagation(),g(!0),j(),b||(h.current=setTimeout(()=>{c(!0),h.current=null},500)))},[b,j,c]);return{isDragTarget:f,handleRowDragOver:k,handleRowDragEnter:l,handleRowDragLeave:(0,e.useCallback)(a=>{a.dataTransfer.types.includes("Files")&&(a.stopPropagation(),i.current=setTimeout(()=>{g(!1),j(),i.current=null},50))},[j]),handleRowDrop:(0,e.useCallback)(b=>{b.preventDefault(),b.stopPropagation(),g(!1),j(),i.current&&(clearTimeout(i.current),i.current=null);let c=b.dataTransfer.files;c.length>0&&(0,Z.Nh)(Array.from(c),a.path,d)},[a.path,d,j])}}(a,v,w,R),af=(0,e.useCallback)(()=>w(a=>!a),[]);(0,e.useRef)(void 0);let ag=(0,e.useCallback)(b=>{b?.preventDefault(),b?.stopPropagation(),O.current&&(clearTimeout(O.current),O.current=null),K(a.name),I(!0),setTimeout(()=>N.current?.select(),0)},[a.name]),ah=(0,e.useCallback)(()=>{let b=J.trim();b&&b!==a.name?M(async()=>{let c=u?x:y.f,d=await c(a.path,b);d.success&&d.newPath?(I(!1),s.push(`/view/${(0,h.O0)(d.newPath)}`),s.refresh(),$()):I(!1)}):I(!1)},[J,a.name,a.path,s,u]),ai=(0,e.useCallback)(()=>{H||(O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{s.push(`/view/${(0,h.O0)(a.path)}`),i?.(),O.current=null},180))},[H,s,a.path,i]);(0,e.useCallback)(a=>{a.stopPropagation(),af()},[af]);let aj=(0,e.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),Q({x:a.clientX,y:a.clientY})},[]),ak=u?function a(b){return"file"===b.type?+!g.C.has(b.name):(b.children??[]).reduce((b,c)=>b+a(c),0)}(a):0;if(H)return(0,d.jsxs)("div",{className:"relative px-2 py-0.5",style:{paddingLeft:`${12*b+8}px`},children:[(0,d.jsx)("input",{ref:N,autoFocus:!0,value:J,onChange:a=>K(a.target.value),onKeyDown:a=>{"Enter"===a.key&&ah(),"Escape"===a.key&&I(!1)},onBlur:ah,className:"w-full bg-muted border border-border rounded px-2 py-0.5 text-xs text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),L&&(0,d.jsx)(k.A,{size:12,className:"absolute right-3 top-1/2 -translate-y-1/2 animate-spin text-muted-foreground"})]});let al=u&&0===b;return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:`relative group/dir flex items-center transition-colors duration-100 ${W?"bg-[var(--amber)]/10 rounded-md":""}`,onContextMenu:aj,onDragEnter:ab,onDragOver:_,onDragLeave:ac,onDrop:ae,children:[(0,d.jsx)("button",{onClick:af,className:"shrink-0 p-1 rounded hover:bg-muted text-muted-foreground transition-colors",style:{marginLeft:`${12*b+4}px`},"aria-label":v?`Collapse ${a.name}`:`Expand ${a.name}`,"aria-expanded":v,children:(0,d.jsx)("span",{className:"block transition-transform duration-150",style:{transform:v?"rotate(0deg)":"rotate(-90deg)"},children:(0,d.jsx)(l.A,{size:10})})}),(0,d.jsxs)("button",{type:"button",onClick:ai,draggable:!0,onDragStart:b=>{b.dataTransfer.setData("text/mindos-path",a.path),b.dataTransfer.setData("text/mindos-type","directory"),b.dataTransfer.effectAllowed="copy"},className:`
|
|
125
|
-
flex-1 flex items-center gap-1.5 px-1 py-1 rounded text-left min-w-0 pr-16
|
|
126
|
-
text-sm transition-colors duration-100
|
|
127
|
-
hover:bg-muted cursor-default
|
|
128
|
-
${t?"text-foreground":"text-muted-foreground hover:text-foreground"}
|
|
129
|
-
`,children:[u?"Inbox"===a.name?(0,d.jsx)(m.A,{size:14,className:"shrink-0 text-[var(--amber)]"}):(0,d.jsx)(n.A,{size:14,className:"shrink-0 text-[var(--amber)]"}):v?(0,d.jsx)(o.A,{size:14,className:"text-yellow-400 shrink-0"}):(0,d.jsx)(p.A,{size:14,className:"text-yellow-400 shrink-0"}),(0,d.jsx)("span",{className:"truncate leading-5",suppressHydrationWarning:!0,children:a.name}),u&&!v&&(0,d.jsx)("span",{className:"ml-auto text-xs text-muted-foreground shrink-0 tabular-nums pr-1",children:ak})]}),(0,d.jsx)("div",{className:"absolute right-1 top-1/2 -translate-y-1/2 hidden group-hover/dir:flex items-center gap-0.5 z-10",children:(0,d.jsx)("button",{type:"button",onClick:a=>{a.preventDefault(),a.stopPropagation();let b=a.currentTarget.getBoundingClientRect();Q({x:b.left,y:b.bottom+4})},className:"p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:"More",children:(0,d.jsx)(q.A,{size:14})})})]}),(0,d.jsx)("div",{className:`grid transition-[grid-template-rows] duration-200 ease-out ${v?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:(0,d.jsxs)("div",{className:`overflow-hidden ${al?"border-l-2 ml-[18px]":""}`,style:al?{borderColor:"color-mix(in srgb, var(--amber) 30%, transparent)"}:void 0,...!v&&{inert:!0},children:[a.children&&(0,d.jsx)(ad,{nodes:a.children,depth:al?1:b+1,onNavigate:i,maxOpenDepth:j,parentIsSpace:u,onImport:r}),C&&(0,d.jsx)(aa,{dirPath:a.path,depth:al?0:b,onDone:()=>G(!1)})]})}),P&&(u?(0,d.jsx)(X,{x:P.x,y:P.y,node:a,onClose:()=>Q(null),onRename:()=>ag(),onNewFile:()=>{w(!0),G(!0)},onImport:r,onDelete:()=>T("space")}):(0,d.jsx)(Y,{x:P.x,y:P.y,node:a,onClose:()=>Q(null),onRename:()=>ag(),onNewFile:()=>{w(!0),G(!0)},onDelete:()=>T("folder")})),(0,d.jsx)(F.TM,{open:null!==S,title:"space"===S?R.fileTree.deleteSpace:R.fileTree.deleteFolder,message:"space"===S?R.fileTree.confirmDeleteSpace(a.name):R.fileTree.confirmDeleteFolder(a.name),confirmLabel:"space"===S?R.fileTree.deleteSpace:R.fileTree.deleteFolder,cancelLabel:R.view?.cancel??"Cancel",variant:"destructive",onCancel:()=>T(null),onConfirm:()=>{T(null),V(async()=>{let b="space"===S?await z(a.path):await A(a.path);if(b.success&&b.trashId){let c=b.trashId,d=a.path.split("/").pop()??a.path;D.oR.undo(`${R.trash?.movedToTrash??"Deleted"} ${d}`,async()=>{let a=await (0,B.Y)(c);a.success?(s.refresh(),$()):D.oR.error(a.error??"Undo failed")},{label:R.trash?.undo??"Undo"}),s.push("/"),s.refresh(),$()}})}})]})}function ac({node:a,depth:b,currentPath:c,onNavigate:l}){let m=(0,f.useRouter)(),n=c===a.path,[o,p]=(0,e.useState)(!1),[v,w]=(0,e.useState)(a.name),[x,z]=(0,e.useTransition)(),[,A]=(0,e.useTransition)(),H=(0,e.useRef)(null),{t:I}=(0,E.Y)(),{isPinned:J,togglePin:K}=(0,G.Z)(),L=J(a.path),M=!a.path.includes("/")&&g.A.has(a.name),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(null),R=(0,e.useCallback)(()=>{o||(m.push(`/view/${(0,h.O0)(a.path)}`),l?.())},[m,a.path,l,o]),S=(0,e.useCallback)(b=>{b.stopPropagation(),w(a.name),p(!0),setTimeout(()=>H.current?.select(),0)},[a.name]),X=(0,e.useCallback)(()=>{let b=v.trim();b&&b!==a.name?z(async()=>{let c=await (0,y.f)(a.path,b);c.success&&c.newPath?(p(!1),m.push(`/view/${(0,h.O0)(c.newPath)}`),m.refresh(),$()):p(!1)}):p(!1)},[v,a.name,a.path,m]),Y=(0,e.useCallback)(a=>{a.stopPropagation(),O(!0)},[]),Z=(0,e.useCallback)(b=>{b.dataTransfer.setData("text/mindos-path",a.path),b.dataTransfer.effectAllowed="copy"},[a.path]),aa=(0,e.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),Q({x:a.clientX,y:a.clientY})},[]);return o?(0,d.jsxs)("div",{className:"relative px-2 py-0.5",style:{paddingLeft:`${12*b+8}px`},children:[(0,d.jsx)("input",{ref:H,autoFocus:!0,value:v,onChange:a=>w(a.target.value),onKeyDown:a=>{"Enter"===a.key&&X(),"Escape"===a.key&&p(!1)},onBlur:X,className:"w-full bg-muted border border-border rounded px-2 py-0.5 text-xs text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),x&&(0,d.jsx)(k.A,{size:12,className:"absolute right-3 top-1/2 -translate-y-1/2 animate-spin text-muted-foreground"})]}):(0,d.jsxs)("div",{className:"relative group/file",children:[(0,d.jsxs)("button",{onClick:R,onContextMenu:aa,draggable:!0,onDragStart:Z,"data-filepath":a.path,className:`
|
|
130
|
-
w-full flex items-center gap-1.5 px-2 py-1 rounded text-left
|
|
131
|
-
text-sm transition-colors duration-100 cursor-default pr-16
|
|
132
|
-
${n?"bg-accent text-foreground":"hover:bg-muted text-muted-foreground hover:text-foreground"}
|
|
133
|
-
`,style:{paddingLeft:`${12*b+8}px`},children:["directory"===a.type?null:".csv"===a.extension?(0,d.jsx)(i.A,{size:14,className:"text-success shrink-0"}):(0,d.jsx)(j.A,{size:14,className:"text-muted-foreground shrink-0"}),(0,d.jsx)("span",{className:"truncate leading-5",suppressHydrationWarning:!0,children:a.name}),L&&(0,d.jsx)(r.A,{size:10,className:"shrink-0 fill-[var(--amber)] text-[var(--amber)] opacity-60"})]}),(0,d.jsx)("div",{className:"absolute right-1 top-1/2 -translate-y-1/2 hidden group-hover/file:flex items-center gap-0.5",children:(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation();let b=a.currentTarget.getBoundingClientRect();Q({x:b.left,y:b.bottom+4})},className:"p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:"More",children:(0,d.jsx)(q.A,{size:14})})}),P&&(0,d.jsxs)(W,{x:P.x,y:P.y,onClose:()=>Q(null),menuHeight:140,children:[(0,d.jsxs)("button",{className:T,onClick:()=>{_(a.path),Q(null)},children:[(0,d.jsx)(s.A,{size:14,className:"shrink-0"})," ",I.fileTree.copyPath]}),(0,d.jsxs)("button",{className:T,onClick:()=>{K(a.path),Q(null)},children:[(0,d.jsx)(r.A,{size:14,className:`shrink-0 ${L?"fill-[var(--amber)] text-[var(--amber)]":""}`}),L?I.fileTree.removeFromFavorites:I.fileTree.pinToFavorites]}),!M&&(0,d.jsxs)("button",{className:T,onClick:a=>{Q(null),S(a)},children:[(0,d.jsx)(t.A,{size:14,className:"shrink-0"})," ",I.fileTree.rename]}),!M&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:U,onClick:a=>{Q(null),Y(a)},children:[(0,d.jsx)(u.A,{size:14,className:"shrink-0"})," ",I.fileTree.delete]})]})]}),(0,d.jsx)(F.TM,{open:N,title:I.fileTree.delete,message:I.fileTree.confirmDelete(a.name),confirmLabel:I.fileTree.delete,cancelLabel:I.view?.cancel??"Cancel",variant:"destructive",onCancel:()=>O(!1),onConfirm:()=>{O(!1),A(async()=>{let b=await (0,C.i)(a.path);if(b.success){if(b.trashId){let c=b.trashId,d=a.path.split("/").pop()??a.path;D.oR.undo(`${I.trash?.movedToTrash??"Deleted"} ${d}`,async()=>{let a=await (0,B.Y)(c);a.success?(m.refresh(),$()):D.oR.error(a.error??"Undo failed")},{label:I.trash?.undo??"Undo"})}m.refresh(),$()}})}})]})}function ad({nodes:a,depth:b=0,onNavigate:c,maxOpenDepth:e,parentIsSpace:h,onImport:i}){var j;let k,l=(k="/view/",(j=(0,f.usePathname)()).startsWith(k)?j.slice(k.length).split("/").map(decodeURIComponent).join("/"):""),m=L(),n=0===b,o=m?a:a.filter(a=>!(n&&a.name.startsWith(".")||"file"===a.type&&g.C.has(a.name)||"directory"===a.type&&a.name.startsWith("."))),p=n?o.filter(a=>"directory"!==a.type||"Inbox"!==a.name):o;return(0,d.jsx)("div",{className:"flex flex-col gap-0.5",children:p.map(a=>"directory"===a.type?(0,d.jsx)(ab,{node:a,depth:b,currentPath:l,onNavigate:c,maxOpenDepth:e,onImport:i},a.path):(0,d.jsx)(ac,{node:a,depth:b,currentPath:l,onNavigate:c},a.path))})}},54195:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TodoRenderer:()=>O});var d=c(48249),e=c(67484),f=c(33740);let g=/^##\s+(.+)/,h=/^#\s+/,i=/^#{3,6}\s+(.+)/,j=/^(\s*)- \[([ xX~])\]\s+(.*)$/,k=/`(P[012])`/,l=/`(\d{4}-\d{2}-\d{2}|\d{2}-\d{2})`/,m=/#([a-zA-Z\u4e00-\u9fff][\w\u4e00-\u9fff-]*)/g;function n(a,b){let c=[...a];return b(c),c.join("\n")}function o(a){let b=function(a){if(!a)return null;let b=new Date;return new Date(/^\d{2}-\d{2}$/.test(a)?`${b.getFullYear()}-${a}`:a)}(a);if(!b||isNaN(b.getTime()))return null;let c=new Date,d=new Date(c.getFullYear(),c.getMonth(),c.getDate()),e=(new Date(b.getFullYear(),b.getMonth(),b.getDate()).getTime()-d.getTime())/864e5;return e<0?"overdue":0===e?"today":e<=3?"soon":"future"}function p(a,b){return a.reduce((a,c)=>a+ +(c.status===b)+p(c.children,b),0)}function q(a){return a.reduce((a,b)=>a+1+q(b.children),0)}function r(a,b){return("all"===b.status||a.status===b.status)&&("all"===b.priority||a.meta.priority===b.priority)&&("all"===b.tag||!!a.meta.tags.includes(b.tag))}let s={P0:{bg:"bg-red-500/10",text:"text-red-500",border:"border-red-500/20"},P1:{bg:"bg-amber-500/10",text:"text-amber-500",border:"border-amber-500/20"},P2:{bg:"bg-blue-500/10",text:"text-blue-500",border:"border-blue-500/20"}},t={overdue:{text:"text-red-500",bg:"bg-red-500/10"},today:{text:"text-amber-500",bg:"bg-amber-500/10"},soon:{text:"text-amber-400",bg:"bg-amber-400/5"},future:{text:"text-muted-foreground",bg:""}},u={TODAY:{dot:"bg-red-400",label:"text-red-400"},"This Week":{dot:"bg-orange-400",label:"text-orange-400"},Workflows:{dot:"bg-amber-400",label:"text-amber-400"},Backlog:{dot:"bg-blue-400",label:"text-blue-400"},Done:{dot:"bg-emerald-400",label:"text-emerald-400"},Maintenance:{dot:"bg-zinc-400",label:"text-zinc-400"}};var v=c(56692),w=c(46674);function x({filters:a,onFilterChange:b,allTags:c,allPriorities:e,counts:f}){let g="all"!==a.priority||"all"!==a.tag||"all"!==a.status;return 0===c.length&&0===e.length?null:(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[(0,d.jsx)(v.A,{size:12,className:"text-muted-foreground shrink-0"}),(0,d.jsxs)("div",{className:"flex items-center rounded-lg border border-border overflow-hidden text-xs",children:[(0,d.jsxs)("button",{onClick:()=>b({...a,status:"all"}),className:`px-2.5 py-1 transition-colors ${"all"===a.status?"bg-muted text-foreground font-medium":"text-muted-foreground hover:bg-muted/50"}`,children:["All ",f.total]}),(0,d.jsxs)("button",{onClick:()=>b({...a,status:"todo"}),className:`px-2.5 py-1 transition-colors border-l border-border ${"todo"===a.status?"bg-muted text-foreground font-medium":"text-muted-foreground hover:bg-muted/50"}`,children:["Todo ",f.todo]}),(0,d.jsxs)("button",{onClick:()=>b({...a,status:"in-progress"}),className:`px-2.5 py-1 transition-colors border-l border-border ${"in-progress"===a.status?"bg-[var(--amber)]/10 text-[var(--amber)] font-medium":"text-muted-foreground hover:bg-muted/50"}`,children:["In Progress ",f.inProgress]}),(0,d.jsxs)("button",{onClick:()=>b({...a,status:"done"}),className:`px-2.5 py-1 transition-colors border-l border-border ${"done"===a.status?"bg-emerald-500/10 text-emerald-500 font-medium":"text-muted-foreground hover:bg-muted/50"}`,children:["Done ",f.done]})]}),e.length>0&&(0,d.jsx)("div",{className:"flex items-center gap-1",children:e.map(c=>{if(!c)return null;let e=s[c],f=a.priority===c;return(0,d.jsx)("button",{onClick:()=>b({...a,priority:f?"all":c}),className:`px-2 py-0.5 rounded text-xs font-mono font-medium border transition-colors ${f?`${e.bg} ${e.text} ${e.border}`:"border-transparent text-muted-foreground hover:bg-muted"}`,children:c},c)})}),c.length>0&&(0,d.jsx)("div",{className:"flex items-center gap-1",children:c.map(c=>{let e=a.tag===c;return(0,d.jsxs)("button",{onClick:()=>b({...a,tag:e?"all":c}),className:`px-2 py-0.5 rounded-full text-xs transition-colors ${e?"bg-[var(--amber)]/15 text-[var(--amber)]":"text-muted-foreground hover:bg-muted"}`,children:["#",c]},c)})}),g&&(0,d.jsxs)("button",{onClick:()=>b({priority:"all",tag:"all",status:"all"}),className:"flex items-center gap-1 px-2 py-0.5 rounded text-xs text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[(0,d.jsx)(w.A,{size:10})," Clear"]})]})}var y=c(75154),z=c(99941),A=c(44643),B=c(24520),C=c(44218),D=c(19794),E=c(59347),F=c(13576);function G({priority:a}){if(!a)return null;let b=s[a];return(0,d.jsx)("span",{className:`inline-flex items-center px-1.5 py-0 rounded text-[10px] font-mono font-semibold leading-4 border shrink-0 ${b.bg} ${b.text} ${b.border}`,children:a})}function H({dateStr:a,status:b}){if(!a||"done"===b)return null;let c=o(a);if(!c)return null;let e=t[c];return(0,d.jsxs)("span",{className:`inline-flex items-center gap-0.5 px-1.5 py-0 rounded text-[10px] leading-4 shrink-0 ${e.text} ${e.bg}`,children:[(0,d.jsx)(y.A,{size:9}),a]})}function I({tag:a}){return(0,d.jsxs)("span",{className:"inline-flex items-center px-1.5 py-0 rounded-full text-[10px] leading-4 text-muted-foreground bg-muted/60 shrink-0",children:["#",a]})}function J({status:a,onClick:b}){return(0,d.jsxs)("button",{onClick:b,className:"shrink-0 transition-colors",title:"Click to cycle status",children:["done"===a&&(0,d.jsx)(z.A,{size:15,style:{color:"var(--amber)"}}),"in-progress"===a&&(0,d.jsx)(f.A,{size:15,className:"text-[var(--amber)] fill-[var(--amber)]/20"}),"todo"===a&&(0,d.jsx)(A.A,{size:15,style:{color:"var(--muted-foreground)"}})]})}function K({text:a,status:b,onRename:c}){let[f,g]=(0,e.useState)(!1),[h,i]=(0,e.useState)(a),j=(0,e.useRef)(null);function k(){let b=h.trim();b&&b!==a?c(b):i(a),g(!1)}return f?(0,d.jsx)("input",{ref:j,value:h,onChange:a=>i(a.target.value),onBlur:k,onKeyDown:b=>{"Enter"===b.key&&k(),"Escape"===b.key&&(i(a),g(!1))},className:"flex-1 bg-transparent border-b text-sm leading-relaxed outline-none min-w-0",style:{borderColor:"var(--amber)",color:"var(--foreground)"},onClick:a=>a.stopPropagation()}):(0,d.jsx)("span",{className:`flex-1 text-sm leading-relaxed cursor-text min-w-0 ${"done"===b?"line-through text-muted-foreground":"text-foreground"}`,onDoubleClick:()=>g(!0),title:"Double-click to edit",children:a})}function L({onAdd:a}){let[b,c]=(0,e.useState)(!1),[f,g]=(0,e.useState)(""),h=(0,e.useRef)(null);function i(){let b=f.trim();b&&a(b),g(""),c(!1)}return b?(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 mt-1",children:[(0,d.jsx)("span",{className:"w-[13px] shrink-0"}),(0,d.jsx)("span",{className:"shrink-0",style:{color:"var(--muted-foreground)"},children:(0,d.jsx)(A.A,{size:15})}),(0,d.jsx)("input",{ref:h,value:f,onChange:a=>g(a.target.value),onBlur:i,onKeyDown:a=>{"Enter"===a.key&&i(),"Escape"===a.key&&(g(""),c(!1))},placeholder:"New item… (supports `P0` `03-28` #tag)",className:"flex-1 bg-transparent border-b text-sm outline-none",style:{borderColor:"var(--amber)",color:"var(--foreground)"}})]}):(0,d.jsxs)("button",{onClick:()=>c(!0),className:"flex items-center gap-1.5 w-full px-3 py-1.5 rounded-lg text-xs transition-colors hover:bg-muted/60 mt-1",style:{color:"var(--muted-foreground)"},children:[(0,d.jsx)(B.A,{size:12}),(0,d.jsx)("span",{children:"Add item"})]})}function M({item:a,depth:b,filters:c,onCycleStatus:f,onRename:g,onDelete:h}){let[i,j]=(0,e.useState)(!0),k=a.children.length>0,l=r(a,c),m=a.children.some(a=>(function a(b,c){return!!r(b,c)||b.children.some(b=>a(b,c))})(a,c));if(("all"!==c.status||"all"!==c.priority||"all"!==c.tag)&&!l&&!m)return null;let n=o(a.meta.dueDate);return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:`group flex items-center gap-2 py-1.5 px-2 rounded-lg transition-colors hover:bg-muted/60 ${"done"===a.status?"opacity-45":""} ${"overdue"===n&&"done"!==a.status?"bg-error/[0.03]":""}`,style:{paddingLeft:`${8+20*b}px`},children:[k?(0,d.jsx)("button",{onClick:()=>j(a=>!a),className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:i?(0,d.jsx)(C.A,{size:13}):(0,d.jsx)(D.A,{size:13})}):(0,d.jsx)("span",{className:"w-[13px] shrink-0"}),(0,d.jsx)(J,{status:a.status,onClick:()=>{var b;return f(a.lineIndex,"todo"===(b=a.status)?"in-progress":"in-progress"===b?"done":"todo")}}),(0,d.jsx)(K,{text:a.text,status:a.status,onRename:b=>g(a.lineIndex,b)}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,d.jsx)(G,{priority:a.meta.priority}),(0,d.jsx)(H,{dateStr:a.meta.dueDate,status:a.status}),a.meta.tags.map(a=>(0,d.jsx)(I,{tag:a},a))]}),(0,d.jsx)("button",{onClick:()=>h(a.lineIndex),className:"shrink-0 opacity-0 group-hover:opacity-100 transition-opacity p-0.5 rounded hover:bg-destructive/10",style:{color:"var(--muted-foreground)"},title:"Delete item",children:(0,d.jsx)(E.A,{size:12})})]}),k&&i&&(0,d.jsx)("div",{children:a.children.map(a=>(0,d.jsx)(M,{item:a,depth:b+1,filters:c,onCycleStatus:f,onRename:g,onDelete:h},a.id))})]})}function N({name:a,meta:b,filters:c,defaultCollapsed:f,onCycleStatus:g,onRename:h,onDelete:i,onAdd:j}){let k,[l,m]=(0,e.useState)(f??!1),n=(k=Object.keys(u).find(b=>a.includes(b)))?u[k]:{dot:"bg-zinc-500",label:"text-zinc-400"},{items:o,lastLineIndex:r}=b,s=p(o,"done"),t=p(o,"in-progress"),v=q(o),w=a.includes("Done");return(0,d.jsxs)("div",{className:"border border-border rounded-xl overflow-hidden bg-card",children:[(0,d.jsxs)("button",{onClick:()=>m(a=>!a),className:"w-full flex items-center justify-between px-4 py-3 hover:bg-muted/40 transition-colors",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full shrink-0 ${n.dot}`}),(0,d.jsx)("span",{className:`text-xs font-semibold uppercase tracking-wider ${n.label} font-display`,children:a}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground tabular-nums",children:[s,"/",v]}),t>0&&(0,d.jsxs)("span",{className:"flex items-center gap-0.5 text-[10px] text-[var(--amber)]",children:[(0,d.jsx)(F.A,{size:9})," ",t]})]}),l?(0,d.jsx)(D.A,{size:14,className:"text-muted-foreground"}):(0,d.jsx)(C.A,{size:14,className:"text-muted-foreground"})]}),(0,d.jsx)("div",{className:"h-0.5 bg-muted mx-4",children:(0,d.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:v?`${s/v*100}%`:"0%",background:w?"var(--success, #22c55e)":"var(--amber)"}})}),!l&&(0,d.jsxs)("div",{className:"px-2 py-2",children:[o.map(a=>(0,d.jsx)(M,{item:a,depth:0,filters:c,onCycleStatus:g,onRename:h,onDelete:i},a.id)),0===o.length&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground px-4 py-2",children:"No items"}),!w&&(0,d.jsx)(L,{onAdd:a=>j(r,a)})]})]})}function O({content:a,saveAction:b}){let[c,o]=(0,e.useState)(a),[r,s]=(0,e.useState)({priority:"all",tag:"all",status:"all"}),{sections:t,lines:u,sectionOrder:v}=(0,e.useMemo)(()=>{let a,b,d,e,f,n,o;return a=c.split("\n"),b="General",d={},e=[],f=[],n=!1,o=!1,a.forEach((a,c)=>{if(!o){if(0===c&&"---"===a.trim()){n=!0;return}if(n){"---"===a.trim()&&(n=!1,o=!0);return}o=!0}if(h.test(a))return;let p=a.match(g);if(p){d[b=p[1].replace(/^[^\w\s\u4e00-\u9fff]+\s*/,"").trim()]||(d[b]={items:[],lastLineIndex:-1,headingLineIndex:c},e.push(b));return}if(i.test(a))return;let q=a.match(j);if(!q)return;let[,r,s,t]=q,u=Math.floor(r.length/2),v="~"===s?"in-progress":"x"===s.toLowerCase()?"done":"todo",{cleanText:w,meta:x}=function(a){let b,c=a,d=null,e=null,f=[],g=c.match(k);g&&(d=g[1],c=c.replace(k,"").trim());let h=c.match(l);h&&(e=h[1],c=c.replace(l,"").trim());let i=RegExp(m.source,"g");for(;null!==(b=i.exec(c));)f.push(b[1]);return f.length>0&&(c=c.replace(/#[a-zA-Z\u4e00-\u9fff][\w\u4e00-\u9fff-]*/g,"").trim()),{cleanText:c=c.replace(/\*\*(.*?)\*\*/g,"$1").trim(),meta:{priority:d,dueDate:e,tags:f}}}(t),y={id:`${c}`,text:w,rawText:t,status:v,indent:u,lineIndex:c,section:b,children:[],meta:x};for(;f.length>0&&f[f.length-1].indent>=u;)f.pop();d[b]||(d[b]={items:[],lastLineIndex:-1,headingLineIndex:-1},e.push(b)),f.length>0?f[f.length-1].children.push(y):d[b].items.push(y),d[b].lastLineIndex=Math.max(d[b].lastLineIndex,c),f.push(y)}),{sections:d,lines:a,sectionOrder:e}},[c]),w=(0,e.useMemo)(()=>Object.values(t).reduce((a,b)=>a+p(b.items,"done"),0),[t]),y=(0,e.useMemo)(()=>Object.values(t).reduce((a,b)=>a+p(b.items,"in-progress"),0),[t]),z=(0,e.useMemo)(()=>Object.values(t).reduce((a,b)=>a+q(b.items),0),[t]),A=z-w-y,B=(0,e.useMemo)(()=>(function(a){let b=new Set;for(let c of Object.values(a))!function a(c){for(let d of c){for(let a of d.meta.tags)b.add(a);a(d.children)}}(c.items);return[...b].sort()})(t),[t]),C=(0,e.useMemo)(()=>(function(a){let b=new Set;for(let c of Object.values(a))!function a(c){for(let d of c)d.meta.priority&&b.add(d.meta.priority),a(d.children)}(c.items);return["P0","P1","P2"].filter(a=>b.has(a))})(t),[t]),D=(0,e.useCallback)(async a=>{o(a),await b(a)},[b]),E=(0,e.useCallback)(async(a,b)=>{await D(n(u,c=>{c[a]=c[a].replace(/- \[[ xX~]\]/,`- [${"done"===b?"x":"in-progress"===b?"~":" "}]`)}))},[u,D]),F=(0,e.useCallback)(async(a,b)=>{await D(n(u,c=>{c[a]=c[a].replace(/(- \[[ xX~]\]\s*)(.*)$/,`$1${b}`)}))},[u,D]),G=(0,e.useCallback)(async a=>{await D(n(u,b=>{b.splice(a,1)}))},[u,D]),H=(0,e.useCallback)(async(a,b)=>{await D(n(u,c=>{let d=a<0?c.length:a+1;c.splice(d,0,`- [ ] ${b}`)}))},[u,D]),I=v.filter(a=>t[a]).map(a=>[a,t[a]]),J=z?Math.round(w/z*100):0;return(0,d.jsxs)("div",{className:"max-w-[900px] mx-auto xl:mr-[220px] px-0 py-2",children:[(0,d.jsx)("div",{className:"mb-5 flex items-center gap-4",children:(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,d.jsxs)("span",{className:"text-lg font-semibold font-display text-foreground tabular-nums",children:[J,"%"]}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground font-display",children:[w,"/",z," completed"]}),y>0&&(0,d.jsxs)("span",{className:"flex items-center gap-1 text-xs text-[var(--amber)]",children:[(0,d.jsx)(f.A,{size:8,className:"fill-[var(--amber)]/30"}),y," in progress"]})]}),(0,d.jsx)("div",{className:"mt-2 w-full max-w-xs h-1.5 bg-muted rounded-full overflow-hidden",children:(0,d.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${J}%`,background:"var(--amber)"}})})]})}),(0,d.jsx)(x,{filters:r,onFilterChange:s,allTags:B,allPriorities:C,counts:{todo:A,inProgress:y,done:w,total:z}}),(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[I.map(([a,b])=>(0,d.jsx)(N,{name:a,meta:b,filters:r,defaultCollapsed:a.includes("Done"),onCycleStatus:E,onRename:F,onDelete:G,onAdd:H},a)),0===I.length&&(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"No TODO items found in this file."})]})]})}},54461:(a,b,c)=>{"use strict";c.d(b,{X:()=>l,d:()=>g});var d=c(67484),e=c(49223);function f(a){let b=Date.now();return{id:`${b}-${Math.random().toString(36).slice(2,8)}`,currentFile:a,createdAt:b,updatedAt:b,messages:[]}}function g(a){if(a.title)return a.title;let b=a.messages.find(a=>"user"===a.role);if(!b)return"(empty session)";let c=b.content.replace(/\s+/g," ").trim();return!c&&b.images&&b.images.length>0?`[${b.images.length} image${b.images.length>1?"s":""}]`:c.length>42?`${c.slice(0,42)}...`:c||"(empty session)"}async function h(){try{let a=await fetch("/api/ask-sessions",{cache:"no-store"});if(!a.ok)return[];let b=await a.json();if(!Array.isArray(b))return[];return b.slice(0,30)}catch{return[]}}async function i(a){try{let b={...a,messages:a.messages.map(a=>a.images&&0!==a.images.length?{...a,images:a.images.map(a=>({...a,data:""}))}:a)};await fetch("/api/ask-sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:b})})}catch{}}async function j(a){try{await fetch("/api/ask-sessions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a})})}catch{}}async function k(a){try{await fetch("/api/ask-sessions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:a})})}catch{}}function l(a){let[b,c]=(0,d.useState)([]),[g,l]=(0,d.useState)([]),[m,n]=(0,d.useState)(null),o=(0,d.useRef)(null),p=(0,d.useCallback)(async()=>{let b=(await h()).sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,30),d=b.filter(a=>0===a.messages.length).map(a=>a.id),e=d.length>0?b.filter(a=>!d.includes(a.id)):b;d.length>0&&k(d);let g=f(a),i=a?e.find(b=>b.currentFile===a):e[0];i?(n(i.id),c(i.messages),l([...e])):(n(g.id),c([]),l([g,...e].slice(0,30)))},[a]),q=(0,d.useCallback)((b,c)=>{if(!c||0===b.length)return;let d=null;l(e=>{let f=Date.now(),g=e.find(a=>a.id===c);d=g?{...g,currentFile:a,updatedAt:f,messages:b}:{id:c,currentFile:a,createdAt:f,updatedAt:f,messages:b};let h=e.filter(a=>a.id!==c);return[d,...h].sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,30)}),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{d&&i(d)},600)},[a]),r=(0,d.useCallback)(()=>{o.current&&(clearTimeout(o.current),o.current=null)},[]),s=(0,d.useCallback)(()=>{l(b=>{let d=b.find(a=>a.id===m);if(d&&0===d.messages.length)return b;let e=f(a);return n(e.id),c([]),[e,...b].sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,30)})},[a,m]),t=(0,d.useCallback)(a=>{let b=g.find(b=>b.id===a);if(!b)return;let d=m?g.find(a=>a.id===m):null;d&&0===d.messages.length&&d.id!==a&&l(a=>a.filter(a=>a.id!==d.id)),n(b.id),c(b.messages)},[g,m]),u=(0,d.useCallback)(b=>{let d=g.find(a=>a.id===b);d&&d.messages.length>0&&j(b);let e=g.filter(a=>a.id!==b);if(l(e),m===b){let b=f(a);n(b.id),c([]),l([b,...e].slice(0,30))}},[m,a,g]),v=(0,d.useCallback)((a,b)=>{let c=b.trim();l(b=>{let d=b.findIndex(b=>b.id===a);if(d<0)return b;let e={...b[d],title:c||void 0},f=[...b];return f[d]=e,i(e),f})},[]),w=(0,d.useCallback)(a=>{l(b=>{let c=b.findIndex(b=>b.id===a);if(c<0)return b;let d={...b[c],pinned:!b[c].pinned},e=[...b];return e[c]=d,d.messages.length>0&&i(d),e})},[]),x=(0,d.useCallback)(b=>{if(!m)return;let c=g.find(a=>a.id===m);if(!c)return;let d=(0,e.R3)({...c,currentFile:c.currentFile??a,updatedAt:Date.now()},b);l(a=>[d,...a.filter(a=>a.id!==m)].sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,30)),o.current&&clearTimeout(o.current),d.messages.length>0&&(o.current=setTimeout(()=>{i(d)},600))},[m,a,g]),y=(0,d.useCallback)(()=>{let b=g.filter(a=>a.messages.length>0).map(a=>a.id);b.length>0&&k(b);let d=f(a);n(d.id),c([]),l([d])},[a,g]);return{messages:b,setMessages:c,sessions:[...g].sort((a,b)=>a.pinned&&!b.pinned?-1:!a.pinned&&b.pinned?1:b.updatedAt-a.updatedAt),activeSession:g.find(a=>a.id===m)??null,activeSessionId:m,initSessions:p,persistSession:q,clearPersistTimer:r,resetSession:s,loadSession:t,deleteSession:u,renameSession:v,togglePinSession:w,setSessionDefaultAcpAgent:x,clearAllSessions:y}}},55038:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/app/global-error.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/app/global-error.tsx","default")},55232:(a,b,c)=>{"use strict";c.d(b,{C:()=>e});var d=c(67484);function e(){let[a,b]=(0,d.useState)([]),[c,e]=(0,d.useState)(null),[f,g]=(0,d.useState)([]),[h,i]=(0,d.useState)(0),j=(0,d.useRef)(!1),k=(0,d.useCallback)(async()=>{b((await fetch("/api/skills").then(a=>a.ok?a.json():{skills:[]}).then(a=>Array.isArray(a?.skills)?a.skills:[]).catch(()=>[])).filter(a=>a.enabled)),j.current=!0},[]),l=(0,d.useCallback)((b,c)=>{let d=b.slice(0,c),f=d.lastIndexOf("/");if(-1===f||f>0&&" "!==d[f-1]&&"\n"!==d[f-1])return void e(null);let h=d.slice(f+1);if(h.includes(" "))return void e(null);if(!j.current){k(),e(null);return}let l=h.toLowerCase(),m=l?a.map(a=>{let b=a.name.toLowerCase(),c=0;return b.startsWith(l)?c=100:b.includes(l)?c=50:a.description.toLowerCase().includes(l)&&(c=10),{s:a,score:c}}).filter(a=>a.score>0).sort((a,b)=>b.score-a.score).slice(0,20).map(a=>({type:"skill",name:a.s.name,description:a.s.description})):a.slice(0,20).map(a=>({type:"skill",name:a.name,description:a.description}));if(0===m.length){e(null),g([]),i(0);return}e(h),g(m),i(0)},[a,k]),m=(0,d.useCallback)(a=>{0!==f.length&&("down"===a?i(a=>Math.min(a+1,f.length-1)):i(a=>Math.max(a-1,0)))},[f.length]);return{slashQuery:c,slashResults:f,slashIndex:h,updateSlashFromInput:l,navigateSlash:m,resetSlash:(0,d.useCallback)(()=>{e(null),g([]),i(0)},[])}}},56606:(a,b,c)=>{Promise.resolve().then(c.bind(c,10500)),Promise.resolve().then(c.bind(c,67809)),Promise.resolve().then(c.bind(c,66535)),Promise.resolve().then(c.bind(c,30488)),Promise.resolve().then(c.bind(c,78340)),Promise.resolve().then(c.bind(c,41829)),Promise.resolve().then(c.bind(c,72362)),Promise.resolve().then(c.bind(c,46427)),Promise.resolve().then(c.bind(c,80992)),Promise.resolve().then(c.bind(c,47336)),Promise.resolve().then(c.bind(c,21416)),Promise.resolve().then(c.bind(c,51488)),Promise.resolve().then(c.bind(c,6732)),Promise.resolve().then(c.bind(c,54195)),Promise.resolve().then(c.bind(c,63956)),Promise.resolve().then(c.bind(c,2820)),Promise.resolve().then(c.bind(c,49905)),Promise.resolve().then(c.bind(c,89386)),Promise.resolve().then(c.bind(c,31168)),Promise.resolve().then(c.bind(c,94416)),Promise.resolve().then(c.bind(c,70137)),Promise.resolve().then(c.bind(c,5200))},57056:(a,b,c)=>{"use strict";c.d(b,{BK:()=>v,DO:()=>l,KF:()=>j,Mv:()=>n,TM:()=>u,ZC:()=>t,lx:()=>s,md:()=>k,pp:()=>o,rA:()=>m});var d=c(48249),e=c(46674),f=c(40560),g=c(24520),h=c(67484),i=c(10927);function j({active:a,label:b,onClick:c}){return(0,d.jsx)("button",{type:"button",onClick:c,"aria-pressed":a,className:`relative px-2.5 min-h-[28px] rounded text-xs cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${a?"bg-[var(--amber-dim)] text-[var(--amber-text)] font-medium shadow-[0_1px_2px_rgba(200,135,58,0.08)]":"text-muted-foreground hover:text-foreground hover:bg-muted/60"}`,children:b})}function k({tone:a,label:b,count:c}){return(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-muted-foreground",children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full ${"ok"===a?"bg-[var(--success)]":"warn"===a?"bg-[var(--amber)]":"bg-muted-foreground/60"}`,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"text-xs",children:b}),(0,d.jsx)("span",{className:`tabular-nums font-medium ${"ok"===a?"text-foreground":"warn"===a?"text-[var(--amber)]":"text-muted-foreground"}`,children:c})]})}function l({value:a,onChange:b,placeholder:c,ariaLabel:f,icon:g}){return(0,d.jsxs)("label",{className:"relative block group/search",children:[(0,d.jsx)(g,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground/60 group-focus-within/search:text-[var(--amber)] pointer-events-none transition-colors duration-150"}),(0,d.jsx)("input",{value:a,onChange:a=>b(a.target.value),placeholder:c,"aria-label":f,className:"w-full h-9 rounded-lg border border-border bg-background pl-9 pr-8 text-sm text-foreground placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--amber)]/30 focus-visible:border-[var(--amber)]/40 transition-all duration-150"}),a.length>0&&(0,d.jsx)("button",{type:"button",onClick:()=>b(""),"aria-label":"Clear search",className:"absolute right-2.5 top-1/2 -translate-y-1/2 p-0.5 rounded-full text-muted-foreground hover:text-foreground hover:bg-muted cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150",children:(0,d.jsx)(e.A,{size:13})})]})}function m({onClick:a,disabled:b,busy:c,label:e,busyLabel:g,variant:h="default"}){return(0,d.jsxs)("button",{type:"button",onClick:a,disabled:b,"aria-busy":c,className:`inline-flex items-center justify-center gap-1.5 text-2xs min-h-[28px] px-2.5 rounded-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-150 ${{default:"border border-border hover:bg-muted",primary:"bg-[var(--amber)] text-[var(--amber-foreground)] hover:bg-[var(--amber)]/90"}[h]}`,children:[c&&(0,d.jsx)(f.A,{size:12,className:"animate-spin","aria-hidden":"true"}),c?g??e:e]})}function n({message:a}){return a?(0,d.jsx)("span",{role:"status","aria-live":"polite",className:"text-2xs text-muted-foreground animate-in fade-in duration-200",children:a}):null}function o({message:a,icon:b,className:c}){return(0,d.jsxs)("div",{className:`rounded-xl border border-border/40 bg-card/30 p-10 text-center ${c??""}`,children:[b&&(0,d.jsx)("div",{className:"w-10 h-10 rounded-full bg-muted/50 flex items-center justify-center mx-auto mb-3 text-muted-foreground/40",children:b}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground/70 leading-relaxed max-w-xs mx-auto",children:a})]})}let p=[["bg-rose-100/70 dark:bg-rose-900/30","border-rose-300/50 dark:border-rose-700/40","text-rose-600/80 dark:text-rose-400/80"],["bg-violet-100/70 dark:bg-violet-900/30","border-violet-300/50 dark:border-violet-700/40","text-violet-600/80 dark:text-violet-400/80"],["bg-emerald-100/70 dark:bg-emerald-900/30","border-emerald-300/50 dark:border-emerald-700/40","text-emerald-600/80 dark:text-emerald-400/80"],["bg-sky-100/70 dark:bg-sky-900/30","border-sky-300/50 dark:border-sky-700/40","text-sky-600/80 dark:text-sky-400/80"],["bg-amber-100/70 dark:bg-amber-900/30","border-amber-300/50 dark:border-amber-700/40","text-amber-700/80 dark:text-amber-400/80"],["bg-teal-100/70 dark:bg-teal-900/30","border-teal-300/50 dark:border-teal-700/40","text-teal-600/80 dark:text-teal-400/80"],["bg-pink-100/70 dark:bg-pink-900/30","border-pink-300/50 dark:border-pink-700/40","text-pink-600/80 dark:text-pink-400/80"],["bg-indigo-100/70 dark:bg-indigo-900/30","border-indigo-300/50 dark:border-indigo-700/40","text-indigo-600/80 dark:text-indigo-400/80"],["bg-lime-100/70 dark:bg-lime-900/30","border-lime-300/50 dark:border-lime-700/40","text-lime-700/80 dark:text-lime-400/80"],["bg-fuchsia-100/70 dark:bg-fuchsia-900/30","border-fuchsia-300/50 dark:border-fuchsia-700/40","text-fuchsia-600/80 dark:text-fuchsia-400/80"],["bg-cyan-100/70 dark:bg-cyan-900/30","border-cyan-300/50 dark:border-cyan-700/40","text-cyan-600/80 dark:text-cyan-400/80"],["bg-orange-100/70 dark:bg-orange-900/30","border-orange-300/50 dark:border-orange-700/40","text-orange-600/80 dark:text-orange-400/80"]];function q(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)|0;return Math.abs(b)}function r(a){let b=a.split(/[\s\-_]+/).filter(Boolean);return b.length>=2?(b[0][0]+b[1][0]).toUpperCase():a.slice(0,2).toUpperCase()}function s({name:a,status:b,size:c="md",onRemove:f,href:g}){let[h,i,j]=p[q(a)%p.length],k="connected"===b?"bg-[var(--success)]":"detected"===b?"bg-[var(--amber)]":"bg-muted-foreground";return(0,d.jsxs)("div",{className:"relative group/avatar",title:a,children:[(0,d.jsx)("div",{className:`${"sm"===c?"w-7 h-7 text-[10px]":"w-9 h-9 text-xs"} ${h} ${i} ${j} border rounded-full flex items-center justify-center font-semibold select-none`,children:r(a)}),b&&(0,d.jsx)("span",{className:`absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 rounded-full border-2 border-card ${k}`,"aria-hidden":"true"}),f&&(0,d.jsx)("button",{type:"button",onClick:a=>{a.preventDefault(),a.stopPropagation(),f()},className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-destructive text-destructive-foreground flex items-center justify-center opacity-0 scale-75 group-hover/avatar:opacity-100 group-hover/avatar:scale-100 transition-all duration-150 cursor-pointer focus-visible:opacity-100 focus-visible:scale-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":`Remove ${a}`,children:(0,d.jsx)(e.A,{size:9})})]})}function t({onClick:a,label:b,size:c="md"}){return(0,d.jsx)("button",{type:"button",onClick:a,title:b,"aria-label":b,className:`${"sm"===c?"w-7 h-7":"w-9 h-9"} rounded-full border-2 border-dashed border-border flex items-center justify-center text-muted-foreground hover:text-foreground hover:border-foreground/30 hover:bg-muted cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,d.jsx)(g.A,{size:14})})}function u({open:a,title:b,message:c,confirmLabel:e,cancelLabel:f,onConfirm:g,onCancel:j,variant:k="destructive"}){let l=(0,h.useRef)(null),m=(0,h.useRef)(null);return((0,i.r)(m,a),a)?(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",children:[(0,d.jsx)("div",{className:"absolute inset-0 overlay-backdrop",onClick:j,"aria-hidden":"true"}),(0,d.jsxs)("div",{ref:m,className:"relative bg-card border border-border rounded-lg shadow-xl p-5 max-w-sm w-full mx-4 animate-in fade-in zoom-in-95 duration-200",children:[(0,d.jsx)("h3",{id:"confirm-dialog-title",className:"text-sm font-medium text-foreground mb-1.5",children:b}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mb-4 leading-relaxed",children:c}),(0,d.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,d.jsx)("button",{ref:l,type:"button",onClick:j,className:"px-3 min-h-[32px] text-sm rounded-md border border-border hover:bg-muted cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150",children:f}),(0,d.jsx)("button",{type:"button",onClick:g,className:`px-3 min-h-[32px] text-sm rounded-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150 ${"destructive"===k?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-[var(--amber)] text-[var(--amber-foreground)] hover:bg-[var(--amber)]/90"}`,children:e})]})]})]}):null}function v({open:a,agents:b,emptyLabel:c,onSelect:e,onClose:f}){let g=(0,h.useRef)(null);return a?(0,d.jsx)("div",{ref:g,className:"absolute right-0 top-full mt-1 z-30 w-56 rounded-lg border border-border bg-card shadow-lg animate-in fade-in slide-in-from-top-1 duration-150",children:0===b.length?(0,d.jsx)("p",{className:"px-3 py-2.5 text-xs text-muted-foreground",children:c}):(0,d.jsx)("div",{className:"py-1 max-h-48 overflow-y-auto",children:b.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>e(a.key),className:"w-full text-left px-3 py-2 text-xs text-foreground hover:bg-muted cursor-pointer flex items-center gap-2 transition-colors duration-100",children:[(()=>{let[b,c,e]=p[q(a.name)%p.length];return(0,d.jsx)("div",{className:`w-6 h-6 rounded-full border ${b} ${c} ${e} flex items-center justify-center text-[9px] font-semibold shrink-0`,children:r(a.name)})})(),a.name]},a.key))})}):null}},59238:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AudioRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call AudioRenderer() from the server but AudioRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/audio/AudioRenderer.tsx","AudioRenderer")},59867:(a,b,c)=>{"use strict";c.d(b,{x:()=>u,A:()=>x});var d=c(48249),e=c(67484),f=c(74429),g=c(801),h=c(6079),i=c(8455),j=c(40560),k=c(42742),l=c(19794),m=c(44218),n=c(47223),o=c(95054),p=c(99101),q=c(90826),r=c(69593);function s(a,b,c=new Date){let d=c.getFullYear(),e=String(c.getMonth()+1).padStart(2,"0"),f=String(c.getDate()).padStart(2,"0"),g=`> Saved session from MindOS Ask \xb7 ${d}-${e}-${f}`;if("full"===b){let b=a.map(a=>{let b=(0,r.Oo)(a.content).trim();if(!b)return null;let c="user"===a.role?"**User**":"**Assistant**";return`### ${c}
|
|
121
|
+
${a.trim()||"(还没有写)"}`,growthIntentLabel:"当前意图",growthIntentPlaceholder:"写下你正在推进的方向…",growthSavedNote:"已保存在本机。",imprintLead:"写一行今天的思绪。可以生成回响报告,或聊聊来深入。",growthLead:"写下你正在推进的方向。随时间回看,观察它如何演变。",selfLead:"随着知识库增长,与你相关的笔记会自动浮现在这里。"},agentsContent:{title:"智能体",subtitle:"连接、技能与状态,一目了然。",workspacePulse:{title:"你的 Agent",connected:"已连接",detected:"已检测",notFound:"未找到",risk:"风险",enabledSkills:"已启用",healthy:"正常",needsAttention:a=>`${a} 个问题`},navOverview:"总览",navMcp:"MCP",navSkills:"技能",navNetwork:"网络",navSessions:"会话",navActivity:"活动",navChannels:"频道",channelsSubtitle:"连接消息平台,让 MindOS 代您发送消息。",activitySubtitle:"Agent 操作审计日志。",activity:{loading:"正在加载活动...",empty:"暂无 Agent 操作记录。",emptyHint:"已连接 Agent 的操作将显示在这里。",agentLabel:"Agent"},a2aTabTitle:"远程 Agent",a2aTabEmptyHint:"发现远程 Agent 以启用跨 Agent 委派。",backToOverview:"返回总览",na:"暂无",status:{connected:"已连接",detected:"已检测",notFound:"未找到"},overview:{connected:"已连接",detected:"已检测",notFound:"未找到",riskQueue:"待处理",noRisk:"一切正常,暂无问题。",usagePulse:"全部 Agent",nextAction:"建议操作",nextActionHint:"优先重连已检测的 Agent,再启用所需技能。",riskLevelError:"异常",riskLevelWarn:"注意",na:"暂无",colAgent:"Agent",colStatus:"状态",colMcp:"MCP",colSkills:"技能",colMode:"模式",colRuntime:"运行时",pulseMcp:"MCP",pulseTools:"工具数",mcpOffline:"离线",toolsUnit:a=>`${a} 个工具`,enabledUnit:a=>`${a} 已启用`,agentCount:a=>`${a} 个 Agent`,runtimeActive:"活跃",riskMcpStopped:"MCP 服务未运行。",riskDetected:a=>`${a} 个已检测 Agent 待配置。`,riskSkillsDisabled:"所有技能已禁用。",recentActivity:"最近活动",viewAll:"查看全部",showLess:"收起",addCustomAgent:"添加自定义 Agent",addCustomAgentTitle:"添加自定义 Agent",editCustomAgentTitle:a=>`编辑 ${a}`,customAgentName:"Agent 名称",customAgentNamePlaceholder:"例如 QCLaw、WorkBuddy",customAgentDir:"配置目录",customAgentDirPlaceholder:"~/.qclaw/",customAgentDirHint:"常见路径:~/.xxx/ 或 ~/Library/Application Support/",customAgentKeyPreview:a=>`标识符:${a}`,customAgentContinue:"继续",customAgentDetecting:"检测中...",customAgentDirFound:"目录已找到",customAgentDirNotFound:"目录尚未创建,安装后将自动检测",customAgentDetectTimeout:"检测超时,使用默认配置",customAgentDetectedTitle:"检测到的配置",customAgentDefaultTitle:"默认配置",customAgentConfigLabel:"MCP 配置",customAgentFormatLabel:"格式",customAgentTransportLabel:"传输协议",customAgentSkillsLabel:"技能",customAgentSkillsFound:a=>`发现 ${a} 个技能`,customAgentSkillsNone:"未检测到",customAgentSkillDir:"技能目录",customAgentSkillDirHint:"此 Agent 安装技能的目录",customAgentSkillDirPlaceholder:"~/.xxx/skills/",customAgentCustomize:"自定义配置",customAgentAdd:"添加 Agent",customAgentAdding:"添加中...",customAgentSave:"保存更改",customAgentSaving:"保存中...",customAgentRetry:"重试",customAgentAdded:a=>`${a} 已添加`,customAgentUpdated:a=>`${a} 已更新`,customAgentRemoved:a=>`${a} 已移除`,customAgentRemoveTitle:a=>`移除「${a}」?`,customAgentRemoveMessage:"这将从 MindOS 中移除该 Agent,不会删除磁盘上的任何文件。",customAgentRemoveConfirm:"移除",customAgentConfigPath:"MCP 配置文件路径",customAgentConfigKey:"配置键名",customAgentFormat:"格式",customAgentTransport:"传输协议",customAgentProjectConfig:"项目配置路径(可选)",customAgentCliBinary:"CLI 命令名(可选)",customAgentCliBinaryPlaceholder:"例如 qclaw",customAgentEdit:"编辑",customAgentRemove:"移除",customAgentCancel:"取消",customAgentNetworkError:"网络错误,请重试。",customAgentFailedSave:"保存失败",customAgentFailedRemove:"移除失败",customAgentKeyConflict:a=>`已存在标识为 "${a}" 的 Agent`,customAgentBuiltinConflict:a=>`与内置 Agent "${a}" 冲突`},mcp:{title:"MCP 连接",refresh:"刷新",connectionGraph:"跨 Agent 服务器连接",tabs:{manage:"管理",topology:"图谱",byAgent:"按 Agent 查看",byServer:"按 MCP 服务器查看"},searchPlaceholder:"搜索 Agent...",installMindos:"安装 MindOS MCP",installed:"已安装",mcpServerLabel:"MCP 服务器",searchServersPlaceholder:"搜索 MCP 服务器...",serverAgentCount:a=>`${a} 个 Agent`,emptyState:"当前筛选条件下没有匹配的 Agent。",resultCount:a=>`${a} 个 Agent`,filteredSummaryTitle:"筛选结果状态摘要",filteredConnected:a=>`已连接:${a}`,filteredDetected:a=>`已检测:${a}`,filteredNotFound:a=>`未找到:${a}`,crossAgentServersTitle:"MCP 服务器",crossAgentServersEmpty:"暂未检测到 MCP 服务器。",crossAgentServerAgents:a=>`使用者:${a}`,configVisibilityTitle:"配置信息",hiddenRootDetected:(a,b)=>`隐藏目录:${a}/${b}`,runtimeSignalDetected:(a,b)=>`运行信号:${a}/${b}`,riskQueueTitle:"待处理",riskMcpStopped:"MCP 服务未运行。",riskDetected:a=>`${a} 个已检测 Agent 待配置。`,riskNotFound:a=>`${a} 个 Agent 未在本机检测到。`,riskSkillsDisabled:"所有技能已禁用。",bulkReconnectFiltered:"全部重连",bulkRunning:"正在批量重连...",bulkSummary:(a,b)=>`重连成功 ${a} 个,失败 ${b} 个。`,transportFilters:{all:"全部传输",stdio:"stdio",http:"http",other:"其他"},filters:{all:"全部",connected:"已连接",detected:"已检测",notFound:"未找到"},table:{agent:"Agent",status:"状态",transport:"传输",actions:"操作"},actions:{copySnippet:"复制配置",copied:"已复制",testConnection:"测试连接",reconnect:"重连"},addAgent:"添加",removeFromServer:"移除",confirmRemoveTitle:"从服务器移除?",confirmRemoveMessage:(a,b)=>`将"${a}"从"${b}"移除?配置文件将自动更新。`,cancel:"取消",noAvailableAgents:"所有 Agent 均已添加。",manualRemoveHint:"已标记移除,请编辑 Agent 配置文件完成操作。",removeSuccess:"已移除,重启 Agent 后生效。",removeFailed:"移除失败,请手动编辑配置文件。",reconnectAllInServer:"全部重连",reconnectAllRunning:"正在重连...",reconnectAllDone:(a,b)=>`完成:${a} 已重连${b>0?`,${b} 失败`:""}。`,serverTransport:a=>`传输:${a}`,mcpDisabledMessage:"MCP 模式未启用。",mcpDisabledHint:"请在设置 → 连接中启用,以使用 MCP 智能体。"},skills:{title:"技能",summaryTitle:"技能状态",summaryEnabled:a=>`已启用:${a}`,summaryDisabled:a=>`已禁用:${a}`,summaryAttention:a=>`需关注:${a}`,crossAgentSkillsTitle:"已安装技能",crossAgentSkillsEmpty:"暂未检测到已安装技能。",crossAgentSkillAgents:a=>`安装于:${a}`,capabilityGroups:"跨 Agent 技能管理",registrySummaryTitle:"技能注册表",registryUniversal:a=>`通用:${a}`,registryAdditional:a=>`附加:${a}`,registryUnsupported:a=>`不支持:${a}`,registryHiddenRoots:(a,b)=>`隐藏目录:${a}/${b}`,tabs:{manage:"管理",matrix:"矩阵",bySkill:"按技能查看",byAgent:"按 Agent 查看"},searchPlaceholder:"搜索技能...",agentSkillMode:"技能模式",agentMcpServers:"MCP 服务器",agentNativeSkills:"原生技能",agentMindosSkills:"MindOS 技能",noAgentsYet:"尚未检测到任何 Agent。",moreSkills:a=>`另有 ${a} 个`,sourceAll:"全部",sourceBuiltin:"内置",sourceUser:"自定义",sourceNative:"原生",summaryNative:a=>`原生:${a}`,statusAll:"全部状态",statusEnabled:"已启用",statusDisabled:"已禁用",statusAttention:"需关注",capabilityAll:"全部能力",bulkEnableFiltered:"全部启用",bulkDisableFiltered:"全部停用",bulkRunning:"正在应用变更...",bulkNoChanges:"当前无需变更。",bulkAllSucceeded:a=>`已更新 ${a} 个技能。`,bulkPartialFailed:(a,b)=>`已更新 ${a} 个,失败 ${b} 个。`,resultCount:a=>`${a} 个技能`,matrixAgentFocusLabel:"Agent 聚焦",matrixAgentFocusAll:"全部 Agent",matrixColumnSkill:"技能",matrixEnabled:"已启用",matrixDisabled:"已禁用",matrixUnsupported:"不支持",matrixNoAgents:"当前无可用于矩阵的 Agent。",noSkillsMatchFilter:"当前筛选条件下无技能。",matrixEmpty:"当前筛选条件下无技能。",addAgentToSkill:"添加",removeAgentFromSkill:"移除",confirmRemoveAgentTitle:"从技能移除?",confirmRemoveAgentMessage:(a,b)=>`将"${a}"从"${b}"移除?需编辑 Agent 配置文件完成操作。`,cancelSkillAction:"取消",noAvailableAgentsForSkill:"所有 Agent 均已拥有此技能。",manualSkillHint:"已标记,请编辑 Agent 配置文件完成操作。",skillDescription:"描述",skillNoDescription:"暂无描述。",skillDeleteAction:"删除",confirmDeleteSkillTitle:"删除技能?",confirmDeleteSkillMessage:a=>`确认永久删除技能"${a}"?此操作不可撤销。`,skillDeleted:"技能已删除。",skillDeleteFailed:"删除技能失败。",copyInstallCmd:"复制安装命令",installCmdCopied:"已复制!",skillAgentCount:a=>`${a} 个 Agent`,quickStatsMcp:a=>`${a} MCP`,quickStatsSkills:a=>`${a} 技能`,showAllNative:a=>`展开全部 ${a} 项`,collapseNative:"收起",emptyGroup:"该分组暂无技能。",groupLabels:{research:"研究",coding:"编码",docs:"文档",ops:"运维",memory:"记忆"},skillPopover:{close:"关闭",source:"来源",sourceBuiltin:"内置",sourceUser:"自定义",sourceNative:"原生",capability:"能力类型",path:"文件路径",enabled:"已启用",disabled:"已禁用",agents:"Agent",noAgents:"暂无 Agent 拥有此技能。",content:"技能内容",loading:"加载中…",loadFailed:"加载技能内容失败。",retry:"重试",copyContent:"复制",copied:"已复制!",noDescription:"暂无描述。",deleteSkill:"删除",confirmDeleteTitle:"删除技能?",confirmDeleteMessage:a=>`确认永久删除技能"${a}"?此操作不可撤销。`,confirmDeleteAction:"删除",cancelAction:"取消",deleted:"技能已删除。",deleteFailed:"删除技能失败。"}},detail:{healthStripTitle:"状态",healthConnected:"已连接",healthInstalled:"MCP 已安装",healthRuntimeSignals:"运行信号",healthConfiguredServers:"已配置服务器",healthInstalledSkills:"原生已安装技能",identity:"身份",connection:"连接",capabilities:"能力画像",skillAssignments:"技能分配",runtimeSignals:"运行与配置信号",recentActivity:"最近活动",spaceReach:"空间触达",agentKey:"Agent 标识",status:"状态",transport:"传输",endpoint:"端点",port:"端口",auth:"认证",authConfigured:"已配置",authMissing:"未配置",projectScope:"项目范围",globalScope:"全局范围",format:"配置格式",skillMode:"技能模式",hiddenRoot:"隐藏目录路径",hiddenRootPresent:"隐藏目录",conversationSignal:"对话",usageSignal:"用量",lastActivityAt:"最近活跃",skillsAll:"全部技能",skillsEnabled:"已启用技能",skillsSourceBuiltin:"内置",skillsSourceUser:"自定义",skillsSearchPlaceholder:"搜索全部已配置技能...",skillsFilterAll:"全部",skillsFilterBuiltin:"内置",skillsFilterUser:"自定义",skillEnable:"启用",skillDisable:"禁用",skillEdit:"编辑",skillSave:"保存",skillCancel:"取消",skillActionLoading:"处理中...",skillReadFailed:"读取技能内容失败。",skillSaveFailed:"保存技能内容失败。",mcpManagement:"MCP 管理",mcpInstalled:"已安装",mcpScope:"当前范围",mcpConfigPath:"配置路径",mcpTargetScope:"目标范围",mcpTargetTransport:"目标传输",mcpScopeProject:"项目",mcpScopeGlobal:"全局",mcpCopySnippet:"复制片段",mcpCopied:"已复制",mcpRefresh:"刷新状态",mcpReconnect:"应用 MCP 配置",mcpApplying:"正在应用 MCP 配置...",mcpApplySuccess:"MCP 配置已应用。",mcpApplyFailed:"应用 MCP 配置失败。",nativeInstalledSkills:"已安装技能",nativeInstalledSkillsCount:a=>`检测到 ${a} 个`,nativeInstalledSkillsEmpty:"暂未检测到已安装技能。",nativeInstalledSkillsMore:a=>`另有 ${a} 个`,configuredMcpServers:"MCP 服务器",configuredMcpServersCount:a=>`检测到 ${a} 个`,configuredMcpServersEmpty:"暂未配置 MCP 服务器。",configuredMcpServersMore:a=>`另有 ${a} 个`,yes:"是",no:"否",noSkills:"暂无启用技能。",noActivity:"暂无活动记录。",noSpaceReach:"暂无空间触达数据。",skillDelete:"删除",skillDeleteConfirm:a=>`确认删除技能"${a}"?此操作不可撤销。`,skillDeleteSuccess:"技能已删除。",skillDeleteFailed:"删除技能失败。",mcpServerAdd:"添加 MCP 服务器",mcpServerRemove:"移除",mcpServerRemoveConfirm:a=>`从该 Agent 移除"${a}"?需编辑配置文件完成操作。`,mcpServerHint:"已标记,请编辑 Agent 配置文件完成操作。",mcpReconnectAll:"全部重连",mcpReconnectAllRunning:"正在重连...",mcpReconnectAllDone:(a,b)=>`已重连 ${a}${b>0?`,失败 ${b}`:""}。`,runtimeDiagTitle:"运行与诊断",runtimePing:"连通测试",runtimePinging:"测试中...",runtimePingOk:a=>`可达 (${a}ms)`,runtimePingFail:"不可达",runtimeUptime:"运行时长",runtimePid:"进程",runtimeMemory:"内存",runtimeVersion:"版本",runtimeStartedAt:"启动于",runtimeNoData:"暂无运行数据。",envPermTitle:"环境与权限",envVars:"环境变量",envVarsCount:a=>`已配置 ${a} 个`,envVarsEmpty:"暂无自定义环境变量。",envScope:"作用域",envReadOnly:"只读访问",envWriteAccess:"写入访问",envFileAccess:"文件访问",envNetworkAccess:"网络访问",envAllowed:"允许",envRestricted:"受限",activityTitle:"活动与用量",activityTotal:"总调用次数",activityLast7d:"近 7 天",activityLastInvocation:"最近调用",activityTokensUsed:"消耗 Tokens",activityAvgLatency:"平均延迟",activityNoData:"暂无活动记录。",knowledgeInteraction:"知识交互",knowledgeNoData:"暂无交互记录。Agent 开始使用你的知识库后,活动将显示在这里。",recentOps:"近期操作",statTotalCalls:"总调用",statFilesTouched:"涉及文件",statReadWrite:"读 / 写",statHealth:"健康度",viewFullLog:"查看完整日志",showLess:"收起"},detailSubtitle:"",detailNotFound:"未找到该 Agent,可能已移除或重命名。",detailNotFoundHint:"该 Agent 可能已断开连接或配置文件已移动。请尝试重启 Agent 或检查 MCP 配置。",detailNotFoundSuggestion:"已连接的 Agent:"},settings:{title:"设置",tabs:{ai:"AI",appearance:"外观",knowledge:"通用",sync:"同步",mcp:"连接",plugins:"插件",shortcuts:"快捷键",monitoring:"监控",agents:"智能体",update:"更新",uninstall:"卸载"},ai:{provider:"模型服务商",model:"模型",apiKey:"API 密钥",baseUrl:"接口地址",baseUrlHint:"可选。用于代理或自定义 API 端点。",keyHint:"本地存储于 ~/.mindos/config.json",keyOptionalHint:"本地服务商可选。存储于 ~/.mindos/config.json",envHint:"标有 env 的字段存在环境变量值。你可以在此覆盖,或一键恢复为环境变量默认值。",envFieldNote:a=>`环境变量 ${a} 已设置。清空此字段将回退到环境变量值。`,resetToEnv:"恢复为环境变量",restoreFromEnv:"从环境变量恢复",keyChange:"更改",keyCancel:"取消",noApiKey:"API 密钥未设置,AI 功能暂不可用,请在此填写。",testKey:"测试",testKeyTesting:"测试中...",testKeyOk:a=>`\u2713 ${a}ms`,testKeyAuthError:"API Key 无效",testKeyModelNotFound:"模型不存在",testKeyEndpointError:"接口地址或协议不匹配",testKeyRateLimited:"请求频率限制,稍后重试",testKeyNetworkError:"网络错误",testKeyNoKey:"未配置 API Key",testKeyUnknown:"测试失败",listModels:"选择模型",noModelsFound:"未找到可用模型",resetProvider:"重置",resetProviderConfirm:"再次点击确认"},customProviders:{title:"Model Providers",subtitle:"添加自定义 API 端点并为其命名",addButton:"+ 添加 Provider",editButton:"编辑",deleteButton:"删除",testButton:"测试",emptyState:"还没有自定义 Provider。添加一个来使用自定义 API 端点或代理。",modal:{titleAdd:"添加 Model Provider",titleEdit:"编辑 Model Provider",fieldName:"名称",fieldNameHint:"例如:公司 GPT-4、本地 LLaMA",fieldProtocol:"协议",fieldProtocolHint:"(大多数本地服务使用 OpenAI 兼容接口)",fieldBaseUrl:"接口地址",fieldBaseUrlHint:"例如:https://api.company.com/v1 或 http://localhost:8080/v1",fieldApiKey:"API 密钥",fieldApiKeyHint:"本地服务可留空",fieldModel:"模型",fieldModelHint:"例如:gpt-4-turbo、llama3.2",buttonCancel:"取消",buttonSave:"保存并测试",buttonSaveOnly:"保存",validating:"测试连接中...",success:"✓ 已连接",error:"连接失败"},deleteConfirm:a=>`删除 "${a}"?此操作不可撤销。`,deleteConfirmButton:"删除"},agent:{title:"Agent 行为",subtitle:"配置 AI 代理的运行方式",maxSteps:"最大步数",maxStepsHint:"每次请求的最大工具调用步数(1-30)",contextStrategy:"上下文策略",contextStrategyHint:"自动:上下文填满时摘要早期消息。关闭:不进行摘要(紧急裁剪仍会生效)。",contextStrategyAuto:"自动(压缩 + 裁剪)",contextStrategyOff:"关闭",thinking:"深度思考",thinkingHint:"显示 Claude 的推理过程(消耗更多 token)",thinkingBudget:"思考预算",thinkingBudgetHint:"推理最大 token 数(1000-50000)",reconnectRetries:"自动重连",reconnectRetriesHint:"连接断开时自动重试次数,重试耗尽后停止(0 = 关闭)"},appearance:{readingTitle:"阅读",readingDesc:"自定义笔记的阅读体验",readingFont:"正文字体",fontSize:"字体大小",fontSizePreview:"人之初性本善。",contentWidth:"内容宽度",preferencesTitle:"偏好",colorTheme:"颜色主题",system:"系统",dark:"深色",light:"浅色",language:"语言",browserNote:"外观设置保存在浏览器本地。",labsTitle:"实验性功能",labsDesc:"仍在开发中的功能,可能会变更或移除。",labsEcho:"回响",labsEchoDesc:"基于笔记的反思性日记。",labsWorkflows:"工作流",labsWorkflowsDesc:"Agent 可视化工作流自动化。",fontPreview:"人之初,性本善;性相近,习相远。"},knowledge:{cardTitle:"知识库",securityTitle:"安全",passwordPlaceholder:"留空可禁用",passwordShow:"显示",passwordHide:"隐藏",tokenNotSet:"— 未设置 —",mcpUrl:"MCP 地址",tokenGenerated:"已生成新令牌。请立即复制 — 之后不会再次完整显示。",monitoringTitle:"系统监控",monitoringFailed:"加载监控数据失败",monitorHeap:"堆内存",monitorRss:"RSS",monitorUptime:"运行时间",monitorNode:"Node",monitorRequests:"请求数",monitorToolCalls:"工具调用",monitorTokens:"Token",monitorFiles:"文件",monitorErrors:"错误",monitorMcpRunning:a=>`运行中 :${a}`,monitorMcpStopped:"已停止",cancel:"取消",mindRoot:"知识库根目录",mindRootHint:"笔记目录的绝对路径,修改后需要重启服务器。",mindRootEnvHint:a=>`MIND_ROOT 环境变量已设置为 "${a}",填写上方路径可覆盖它。`,envNote:"MIND_ROOT 环境变量已设置。填写上方路径后,你的值优先生效。",webPassword:"网页访问密码",webPasswordHint:"设置后访问浏览器 UI 需要登录,留空则关闭密码保护。下次刷新页面后生效。",webPasswordClear:"清除密码",authToken:"MCP / API 访问令牌",authTokenHint:"Agent 和 MCP 客户端使用的 Bearer Token,浏览器访问无需此项。",authTokenNone:"未设置令牌 — API 对所有请求开放。",authTokenCopy:"复制",authTokenCopied:"已复制!",authTokenReset:"重新生成",authTokenClear:"清除令牌",authTokenResetConfirm:"重新生成令牌?所有 MCP 客户端配置都需要更新。",authTokenMcpPort:"MCP 端口",restartWalkthrough:"重新开始引导",showHiddenFiles:"显示隐藏文件",showHiddenFilesHint:"在文件树中显示以 . 开头的文件夹(.agents、.claude、.mindos 等)。",cleanupExamples:"清理示例文件",cleanupExamplesHint:"移除知识库中所有模板示例文件(\uD83E\uDDEA_example_*)。",cleanupExamplesButton:"清理",cleanupExamplesNone:"没有找到示例文件",cleanupExamplesConfirm:a=>`删除 ${a} 个示例文件?此操作不可撤销。`,cleanupExamplesDone:a=>`已移除 ${a} 个示例文件`,cleanupExamplesScanning:"扫描中..."},sync:{emptyTitle:"跨设备同步",emptyDesc:"通过 Git 自动同步知识库到所有设备。",featureAutoCommit:"保存时自动提交",featureAutoPull:"自动拉取远程更新",featureConflict:"冲突检测",featureMultiDevice:"多设备同步",remoteUrl:"Git 远程仓库 URL",invalidUrl:"无效的 Git URL — 请使用 HTTPS (https://...) 或 SSH (git@...) 格式",sshBrief:"一次配置,无需令牌",httpsBrief:"通用性强,建议配令牌",sshHint:"需要本机已配置 SSH 密钥。验证命令:ssh -T git@github.com",accessToken:"访问令牌",optional:"(可选,私有仓库需要)",tokenHint:"GitHub:",tokenLink:"创建令牌(勾选 repo 权限)",branchLabel:"分支",connectButton:"连接并开始同步",connecting:"连接中...",stepConnecting:"正在连接远程仓库...",stepAuthenticating:"正在验证身份...",stepSyncing:"正在同步数据...",stepAlmostDone:"即将完成...",stepDone:"同步配置成功!",gitignoreTitle:"排除文件",gitignorePlaceholder:"# 不同步的文件\n*.tmp\nsecret/",gitignoreSave:"保存",gitignoreSaved:"已保存",conflictExplain:"这些文件在本机和远程都被修改了。请选择保留哪个版本。",keepLocal:"保留本地",keepRemote:"保留远程",keepLocalHint:"保留本机的版本",keepRemoteHint:"替换为远程版本",viewDiff:"点击查看两个版本的差异",localVersion:"本地(本机)",remoteVersion:"远程",emptyFile:"(空)",sectionTitle:"同步",labelProvider:"提供商",labelRemote:"远程",labelBranch:"分支",labelLastSync:"最后同步",labelUnpushed:"未推送",labelAutoSync:"自动同步",unpushedCommits:a=>`${a} 次提交`,syncNow:"立即同步",disableAutoSync:"禁用自动同步",enableAutoSync:"启用自动同步",syncComplete:"同步完成",syncFailed:"同步失败",autoSyncDisabled:"已禁用自动同步",autoSyncEnabled:"已启用自动同步",toggleFailed:"切换同步失败",conflictsTitle:a=>`冲突 (${a})`,conflictHint:"单击文件查看你的版本。悬停并单击",conflictHintSuffix:"查看远程版本。",timeNever:"从未",timeJustNow:"刚刚",timeMinAgo:a=>`${a} 分钟前`,timeHourAgo:a=>`${a} 小时前`,timeDayAgo:a=>`${a} 天前`},plugins:{title:"已安装渲染器",builtinBadge:"内置",coreBadge:"核心",enabled:"已启用",disabled:"已禁用",matchHint:"自动匹配",coreHint:"核心渲染器 — 始终启用",noPlugins:"暂无渲染器。",comingSoon:"插件市场即将上线。"},mcp:{modeCardTitle:"连接模式",modeCardDesc:"选择 Agent 如何连接到 MindOS。",cliLabel:"CLI",cliModeDesc:"Claude Code、Gemini CLI、Codex 等。",mcpLabel:"MCP",mcpModeDesc:"Claude Desktop、Cursor、Windsurf 等。",alwaysOn:"始终开启",mcpRunning:"运行中",mcpStopped:"已停止",mcpEnabledHint:"MCP 模式已启用。若仅使用 CLI Agent,可禁用此项以简化界面。",mcpDisabledHint:"启用 MCP 以连接 Claude Desktop 或 Cursor 等桌面客户端。",serverTitle:"MindOS MCP 服务",status:"状态",running:"运行中",stopped:"已停止",transport:"传输方式",endpoint:"端点",tools:"工具",toolsRegistered:a=>`已注册 ${a} 个`,auth:"认证",authSet:"已设置 Token",authNotSet:"未设置",copyEndpoint:"复制端点",copyConfig:"复制配置",copied:"已复制!",agentsTitle:"Agent 配置",agent:"Agent",scope:"范围",project:"项目",global:"全局",installed:"已安装",notInstalled:"未安装",detected:"已检测",notFound:"未找到",transportStdio:"stdio(推荐)",transportHttp:"http",transportAuto:"自动(推荐)",httpUrl:"MCP URL",httpToken:"认证 Token",installSelected:"安装选中",installing:"安装中...",installSuccess:a=>`已配置 ${a} 个 agent`,installFailed:"安装失败",portLabel:"MCP 端口",portHint:"修改后需重启服务",skillsTitle:"技能",skillsDesc:"教 Agent 如何操作你的知识库。",skillAutoLoaded:"每次请求自动加载",skillSource:"来源",skillBuiltin:"内置",skillUser:"自定义",addSkill:"+ 添加技能",cliInstallHint:"通过命令行安装:",skillPathHint:"技能文件安装路径:",deleteSkill:"删除",editSkill:"编辑",saveSkill:"保存",cancelSkill:"取消",skillName:"名称",skillDesc:"描述",skillContent:"内容",skillNameConflict:"同名技能已存在",skillDeleteConfirm:a=>`确定删除「${a}」?此操作不可撤销。`,skillLanguage:"技能语言",skillLangEn:"English",skillLangZh:"中文",searchSkills:"搜索技能...",customGroup:"自定义",builtinGroup:"内置",noSkillsMatch:a=>`没有匹配「${a}」的技能`,skillTemplate:"模板",skillTemplateGeneral:"通用",skillTemplateToolUse:"工具调用",skillTemplateWorkflow:"工作流",selectDetected:"选择已检测",clearSelection:"清除",quickSetup:"快速配置",configureFor:"配置目标",configPath:"配置路径",transportLocal:"本地",transportRemote:"远程",transportLocalHint:"本地 — 与 MindOS 服务在同一台机器上",transportRemoteHint:"远程 — 从其他设备通过 HTTP 连接",remoteDetectedHint:"使用当前远程 IP。",remoteManualHint:"将 127.0.0.1 替换为服务器的公网或局域网 IP。",remoteSteps:"从其他设备连接:① 在防火墙/安全组中开放端口 {port} ② 将下方配置粘贴到 Agent 中 ③ 公网环境建议使用 SSH 隧道加密传输。",noAuthWarning:"⚠ 未设置认证令牌 — 请先在 设置 → 通用 中配置,再启用远程访问。",showJson:"显示 JSON",hideJson:"隐藏 JSON",connectionTitle:"连接 Agent",connectionHint:"选择 AI Agent 连接 MindOS 的方式。",tokenCardTitle:"认证令牌",tokenCardDesc:"用于 CLI 远程模式和 MCP 连接。",mcpHint:"适用于 Claude Desktop、Cursor 等使用 MCP 工具协议的 Agent。",tokenLabel:"认证令牌",tokenMasked:"点击「显示」查看完整令牌",tokenShow:"显示",tokenHide:"隐藏",tokenCopy:"复制",tokenCopied:"令牌已复制!",tokenNone:"未设置令牌 — MCP 服务对所有请求开放。",tokenNoneAction:"请在 设置 → 通用 → 安全 中生成令牌。",serverUrl:"MCP 服务地址",serverUrlCopy:"复制地址",howToConnect:"如何连接 AI 助手",howToStep1:"打开你的 AI 助手的 MCP 设置(如 Claude Code、Cursor)",howToStep2:"添加一个新的 MCP 服务,填入上方地址",howToStep3:"将认证令牌设为 Bearer Token",howToStep4:"保存并验证连接",cliSkillTitle:"CLI 技能",cliSkillHint:"适用于支持 bash 的 Agent(Claude Code、Gemini CLI、Codex)——更省 token,无需 MCP。",cliSkillDesc:"更省 token,技能内置——安装即可使用。",cliLocalDesc:"MindOS Skill 已内置,安装 CLI 即可直接使用。",cliRemoteDesc:"在其他设备上安装 CLI,远程连接到此 MindOS 服务器。",cliSkillInstall:"安装",cliSkillInstallCmd:"npm install -g @geminilight/mindos",cliSkillRemote:"远程",cliSkillVerify:"验证",cliSkillVerifyCmd:"mindos file list",cliRemoteConfigure:"配置",cliInstallSkill:"安装技能",cliAgents:"Claude Code \xb7 Gemini CLI \xb7 Codex",mcpAgents:"Claude Desktop \xb7 Cursor",mcpDesc:"需要逐个 Agent 配置 MCP,通过以下命令单独安装技能:",mcpLocalDesc:"复制下方配置代码,粘贴到你的 Agent 的 MCP 设置中。",mcpRunningLabel:"MCP 运行中",mcpServerStatus:"MCP 服务",autoInstallAgents:"自动安装到已检测的 Agent",detectedAgentsTitle:"检测到的 Agent",cliInstallDesc:"为你的 Agent 安装 MindOS Skill,让它能操作你的知识库。",mcpInstallDesc:"为本机检测到的 Agent 安装 MCP 配置和 Skill。",tokenCopyFullHint:"复制完整令牌",skillsInstalled:"个技能已安装",recommended:"推荐",localTitle:"本机",localReady:"可直接使用",remoteTitle:"远程访问",remoteSubtitle:"从其他设备连接",restarting:"重启中...",restart:"重启",portsCardTitle:"服务端口",portsCardDesc:"Web UI 和 MCP 服务端口。更改后重启生效。",webPortLabel:"Web UI 端口",webPortHint:"浏览器访问的端口。",mcpPortLabel:"MCP 服务端口",mcpPortHint:"Agent 和桌面客户端连接的端口。",portChecking:"检测中…",portAvailable:"可用",portSelf:"当前端口",portInUse:a=>`端口 ${a} 已被占用`,portSuggest:a=>`使用 ${a}`,portConflict:"Web 和 MCP 端口不能相同。",portUpdating:"保存中…",portWebRestarting:"正在重启服务…",portMcpRestarting:"正在重启 MCP…",portUpdateSuccess:"端口更新成功。",portUpdateFailed:"端口更新失败。",portRestartTimeout:"重启超时,请重试。",portRedirecting:"正在跳转到新地址…",portUpdateBtn:"更新端口",externalToolsTitle:"外部 MCP 工具",externalToolsDesc:"配置外部 MCP 服务器的工具访问模式。"},monitoring:{system:"系统",heapMemory:"堆内存",rss:"RSS",uptime:"运行时间",nodeVersion:"Node",application:"应用",requests:"请求数",toolCalls:"工具调用",avgResponse:"平均响应",tokens:"Token",errors:"错误",knowledgeBase:"知识库",files:"文件数",totalSize:"总大小",rootPath:"根目录",mcpStatus:"状态",mcpRunning:"运行中",mcpStopped:"已停止",mcpPort:"端口",autoRefresh:"每 5 秒自动刷新",fetchError:"加载监控数据失败"},agents:{mcpServer:"MCP 服务器",running:"运行中",stopped:"未运行",restarting:"重启中...",restart:"重启",onPort:a=>`端口 :${a}`,refresh:"刷新",refreshing:"刷新中...",connected:"已连接",connectedCount:a=>`已连接 (${a})`,detectedNotConfigured:"已检测未配置",detectedCount:a=>`已检测未配置 (${a})`,notDetected:"未检测到",notDetectedCount:a=>`未检测到 (${a})`,showAll:"显示全部",hideAll:"收起",connect:"连接",noAgents:"本机未检测到任何 Agent。",fetchError:"加载 Agent 数据失败",autoRefresh:"每 30 秒自动刷新"},save:"保存",saved:"已保存",saveFailed:"保存失败",reconfigure:"重新配置",askDisplayMode:{label:"显示模式",hint:"侧面板固定在右侧;弹窗以浮动对话框形式打开。",panel:"侧面板",popup:"弹窗"},update:{checking:"正在检查更新...",upToDate:"已是最新版本",available:(a,b)=>`有新版本可用:v${a} → v${b}`,updating:"正在更新 MindOS,服务器即将重启...",updatingHint:"预计 1–3 分钟,请勿关闭此页面。",serverRestarting:"服务正在重启,请稍候...",updated:"更新成功!正在刷新...",timeout:"更新可能仍在进行中。",timeoutHint:"服务器可能需要更多时间重新构建,请尝试刷新页面。",refreshButton:"刷新页面",retryButton:"重试更新",error:"检查更新失败,请检查网络连接。",checkButton:"检查更新",updateButton:a=>`更新到 v${a}`,releaseNotes:"查看更新日志",hint:"更新通过 npm 安装,等同于在终端运行",inTerminal:"。",desktopDownloading:"正在下载更新...",desktopReady:"更新已下载,重启后生效。",desktopRestart:"立即重启",desktopHint:"更新通过桌面端自动更新推送。",coreTitle:"MindOS Core",coreUpToDate:"核心已是最新",coreAvailable:a=>`有新版本可用(${a})`,coreDownloading:"下载中...",coreCancel:"取消",coreReady:"已就绪 — 重启服务即可生效",coreRestartServices:"重启服务",coreApplying:"正在应用更新...",coreApplied:"更新成功!正在刷新...",coreError:"核心更新失败。",coreRetry:"重试",coreDesktopTooOld:a=>`v${a} 需要更新版本的 Desktop。`,coreDesktopTooOldHint:"请先更新 MindOS Desktop。",coreHint:"核心更新只需重启服务,无需重启应用。",shellTitle:"MindOS Desktop",updateToast:{titleSingle:(a,b)=>`${a} v${b} 可用`,titleMultiple:"有可用更新",desktopLabel:"桌面版",coreLabel:"运行时",viewDetails:"查看详情",skipVersion:"跳过此版本",skipAll:"全部跳过"}},uninstall:{title:"卸载 MindOS",descCli:"从本机移除 MindOS CLI、后台服务和配置文件。",descDesktop:"从本机移除 MindOS Desktop、后台服务和配置文件。",warning:"选择要清理的内容。你的知识库文件始终是安全的。",stopServices:"停止服务并移除守护进程",stopServicesDesc:"停止所有运行中的 MindOS 进程并移除后台守护进程。",removeConfig:"移除配置",removeConfigDesc:"删除 ~/.mindos/ 目录(配置、日志、PID 文件)。",removeNpm:"卸载 CLI 包",removeNpmDesc:"执行 npm uninstall -g @geminilight/mindos。",removeApp:"将 Desktop 移入废纸篓",removeAppDesc:"将 MindOS.app 移入废纸篓,之后可以恢复。",confirmTitle:"确认卸载",confirmButton:"卸载",cancelButton:"取消",running:"正在卸载...",success:"MindOS 已卸载。",successDesktop:"MindOS 已卸载,应用即将退出。",error:"卸载失败,可在终端手动运行 `mindos uninstall`。",nothingSelected:"请至少选择一项要卸载的内容。",kbSafe:"你的知识库文件始终是安全的——此操作绝不会删除它们。"}},onboarding:{subtitle:"知识库为空,选择一个模板快速开始。",templates:{en:{title:"English",desc:"预置 Profile、Notes、Projects 等英文目录结构。"},zh:{title:"中文",desc:"预置画像、笔记、项目等中文目录结构。"},empty:{title:"空白",desc:"仅包含 README、CONFIG 和 INSTRUCTION 基础文件。"}},importHint:"已有笔记?在设置中将 MIND_ROOT 指向已有目录即可。",syncHint:"需要跨设备同步?完成初始化后在终端运行",syncHintSuffix:"即可。",initError:"初始化失败。请刷新页面或尝试其他模板。",dismiss:"关闭"},setup:{stepTitles:["知识库","AI 配置","Agent 连接","确认"],kbPath:"知识库路径",kbPathHint:"笔记目录的绝对路径。",kbPathDefault:"~/MindOS/mind",kbPathUseDefault:a=>`使用 ${a}`,kbPathHasFiles:a=>`该目录已有 ${a} 个文件。可以跳过模板,或选择合并(已有文件不会被覆盖)。`,kbTemplateSkip:"跳过模板",kbTemplateMerge:"选择模板合并",template:"初始模板",templateSkip:"跳过(目录已有文件)",aiProvider:"AI 服务商",aiProviderHint:"选择你偏好的 AI 服务。",aiSkip:"跳过 — 稍后配置",apiKey:"API 密钥",apiKeyExisting:"已配置密钥。留空即保持不变。",model:"模型",listModels:"选择模型",noModelsFound:"未找到可用模型",baseUrl:"接口地址",baseUrlHint:"可选。用于代理或自定义 API 端点。",webPort:"Web UI 端口",mcpPort:"MCP 服务端口",portHint:"有效范围:1024–65535",portRestartWarning:"完成配置后,服务将以这些端口启动。",portInUse:a=>`端口 ${a} 已被占用。`,portSuggest:a=>`使用 ${a}`,portChecking:"检测中…",portSelf:"当前端口",portConflict:"Web UI 端口和 MCP 端口不能相同。",portVerifyHint:"点击输入框外部验证,或等待自动检测。",authToken:"认证令牌",authTokenHint:"MCP / API 客户端使用的 Bearer Token,自动生成。",authTokenUsage:"用于 MCP 连接和 API 客户端身份验证。配置 Agent 时会自动写入,无需手动填写。",authTokenUsageWhat:"这是什么?",authTokenSeed:"自定义种子(可选)",authTokenSeedHint:"输入口令短语生成确定性 Token。",generateToken:"生成",copyToken:"复制",copiedToken:"已复制!",webPassword:"访问密码",webPasswordHint:"保护你的知识库,防止未授权的浏览器访问。",webPasswordRequired:"密码是必填项,用于保护你的数据。",advancedPorts:"高级设置",tokenSectionTitle:"认证令牌(已自动生成)",tokenSectionHint:"AI Agent 连接你的 MindOS 服务器时使用。",agentToolsTitle:"Agent 连接",connectionModeTitle:"连接模式",connectionModeCliHint:"推荐 \xb7 更省 token",connectionModeMcpHint:"可选 \xb7 消耗更多 token",agentToolsHint:"选择要配置的 AI Agent。此步骤可选。",agentToolsHintCliOnly:"Agent 选择在 MCP 模式启用时生效。CLI 可直接用于所有支持 bash 的 Agent。",agentToolsHintNone:"未选择连接模式。请至少选择一种模式以连接 Agent。",agentTransport:"传输方式",agentScope:"范围",agentToolsLoading:"正在加载 Agent…",agentToolsEmpty:"未检测到受支持的 Agent。",agentNoneSelected:"未选择 Agent。可稍后在设置中配置。",agentSkipLater:"清除选择",agentSelectDetected:"选择已检测到的 Agent",agentNoneDetected:"未在系统中检测到已安装的 Agent。",agentShowMore:a=>`显示另外 ${a} 个 Agent`,agentAdvanced:"高级选项",agentScopeGlobal:"为所有项目安装",agentScopeProject:"仅当前项目",badgeInstalled:"已安装",badgeDetected:"已检测到",badgeNotFound:"未找到",agentNotInstalled:"未安装",agentDetected:"已检测到",agentNotFound:"未找到",agentGetIt:"去安装 →",agentStatusOk:"已配置",agentStatusError:"失败",agentInstalling:"配置中…",agentTransportAuto:"自动(推荐)",agentTransportLabel:"传输方式",agentVerified:"已验证",agentUnverified:"未验证",agentVerifyNote:"stdio agent 需重启后验证",skillWhat:"",skillAutoHint:()=>"",skillLabel:"技能",skillInstalling:"正在安装技能…",skillInstalled:"技能已安装",skillFailed:"技能安装失败",aiSkipTitle:"暂时跳过",aiSkipDesc:"稍后可在 设置 → AI 中添加 API 密钥。",reviewHint:"确认设置无误后,点击完成。",reviewInstallResults:"Agent 配置结果:",phaseSaving:"正在保存配置…",phaseAgents:"正在配置 Agent…",phaseSkill:"正在安装 Skill…",phaseDone:"设置完成!",retryAgent:"重试",agentFailedCount:a=>`${a} 个 Agent 配置失败`,agentCountSummary:a=>`${a} 个 Agent`,agentFailureNote:"Agent 安装失败不影响进入 MindOS — 可稍后在 设置 → 连接 中重试。",portAvailable:"可用",portChanged:"端口已变更 — 请重启服务以使其生效。",restartRequired:"以下变更需要重启服务后生效。",restartNow:"立即重启",restarting:"重启中…",restartDone:"服务正在重启,稍后自动跳转…",restartManual:"手动重启命令:",back:"上一步",next:"下一步",complete:"完成设置",skip:"跳过",completing:"保存中...",completeDone:"设置完成!",completeFailed:"设置失败,请重试。",healthKb:"知识库",healthKbNone:"未配置",healthAi:"AI 服务",healthAiNone:"未配置 — AI 功能不可用",healthAiAction:"可在 设置 → AI 中添加 API 密钥。",healthAgents:"Agent 连接",healthAgentsOk:a=>`已配置 ${a} 个 Agent`,healthAgentsPartial:"正在配置中...",healthAgentsNone:"未配置 Agent",healthAgentsAction:"可稍后在 设置 → 连接 中添加。",healthSkills:"Skills",healthSkillsOk:"Skill 安装成功",healthSkillsError:"Skill 安装失败",healthSkillsSkipped:"已跳过",healthSkillsInstalling:"正在安装 Skill…",healthSkillsAction:"可稍后手动安装 Skill。",healthTokenTitle:"认证令牌",healthTokenCopy:"复制令牌",healthTokenHint:"CLI 远程模式和 MCP 连接时使用。也可在 设置 → 连接 中找到。",healthGoHome:"进入 MindOS",welcomeTitle:"欢迎使用 MindOS!",welcomeDesc:"初始化完成。现在可以直接问 MindOS、浏览知识库,或配置 MCP Agent。",welcomeLinkReconfigure:"重新配置",welcomeLinkAskAI:"MindOS",welcomeLinkMCP:"MCP 设置"},guide:{title:"快速上手",showGuide:"显示新手引导",close:"关闭",skip:"跳过",stepLocked:"请先完成上一步",import:{title:"导入你的文件",cta:"导入",desc:"上传简历、项目文档、笔记——任何你想让 AI Agent 了解的内容。",button:"导入文件"},ai:{title:"AI 帮你沉淀",cta:"试试",desc:"让 MindOS 把对话中的经验沉淀到知识库:",prompt:"帮我把这次对话的关键收获整理成一份可复用的 SOP,存到我的知识库里。",promptEmpty:"帮我设计一个适合我的知识库目录结构"},agent:{title:"连接其他 Agent",cta:"复制提示词",desc:"打开 Cursor、Claude Code 或任意 MCP Agent,粘贴以下提示词,让知识流入 MindOS:",copyPrompt:"把我们刚才讨论的内容总结一下,存到我的 MindOS 知识库里,形成可复用的 SOP。",copy:"复制",copied:"已复制!"},done:{title:"你已准备好使用 MindOS",titleFinal:"你已掌握 MindOS 核心用法",steps:[{hint:"下一步:试试把一篇文章存进来 →",prompt:"帮我把这篇文章的要点整理到 MindOS 里。"},{hint:"下一步:试试把经验沉淀为 SOP →",prompt:"帮我把这次对话的经验沉淀到 MindOS,形成可复用的工作流。"}]}},walkthrough:{step:(a,b)=>`${a} / ${b}`,next:"下一步",back:"上一步",skip:"跳过引导",done:"完成",exploreCta:"探索更多用法 →",steps:[{title:"你的项目记忆",body:"用 Space 管理项目、SOP 和偏好规则。数据存在本地,完全由你掌控。"},{title:"不用重讲背景的 AI",body:"MindOS 会自动读取你的知识库。问它项目相关的事,不需要每次都重复交代背景。"},{title:"多 Agent 共享记忆",body:"通过 MCP 连接 Cursor、Claude Code、Windsurf,它们共享同一份项目记忆。"}]},shortcuts:[{keys:["⌘","K"],description:"搜索"},{keys:["⌘","/"],description:"MindOS"},{keys:["⌘",","],description:"设置"},{keys:["E"],description:"编辑当前文件"},{keys:["⌘","S"],description:"保存"},{keys:["Esc"],description:"取消编辑 / 关闭弹窗"},{keys:["@"],description:"在 AI 对话中添加附件"}],help:{title:"帮助与指南",subtitle:"开始使用 MindOS 所需的一切",whatIs:{title:"什么是 MindOS?",body:"MindOS 是你的本地知识助手。它把项目、决策、SOP 和偏好整理在同一处,让你和已连接的 Agent 都能基于同一份上下文工作。文件保留在本地,知识可以反复复用,也不用每次都从头交代背景。"},quickStart:{title:"快速开始",step1Title:"浏览你的知识库",step1Desc:'点击左侧边栏的"空间"图标来浏览你的文件。每个顶级文件夹是一个"空间"——比如个人档案、笔记或项目。',step2Title:"和 MindOS 对话",step2Desc:"按 ⌘/(或 Ctrl/)打开 MindOS。你可以直接询问知识库相关问题,或用 @ 附加特定文件作为上下文。",step3Title:"连接你的 AI Agent",step3Desc:"前往 设置 → 连接 以连接外部 Agent,如 Claude Code、Cursor 或 Windsurf。连接后,它们可以直接读写你的知识库。"},concepts:{title:"核心概念",spaceTitle:"空间(Space)",spaceDesc:"空间是按你的思维方式组织的知识分区。你怎么想,就怎么分,AI Agent 遵循同样的结构来自动读写和管理。",instructionTitle:"指令(Instruction)",instructionDesc:"一份所有 AI Agent 都遵守的规则文件。你写一次边界,每个连接到知识库的 Agent 都会照做。",skillTitle:"技能(Skill)",skillDesc:"教 Agent 如何操作你的知识库——读取、写入、整理。Agent 不是瞎猜,而是按你安装的 Skill 来执行。"},shortcutsTitle:"快捷键",agentUsage:{title:"在 AI Agent 中使用 MindOS",intro:"通过 MCP 连接 Agent(Claude Code、Cursor、Windsurf 等)后,直接用自然语言对话即可。Agent 能自动读写你的知识库,不需要特殊指令。以下是最常见的使用场景:",scenarios:[{emoji:"\uD83E\uDEAA",title:"注入身份",desc:"让所有 AI Agent 一次认识你——偏好、技术栈、沟通风格。",prompt:'"这是我的简历,读一下,把我的信息整理到 MindOS 里。"'},{emoji:"\uD83D\uDD04",title:"跨 Agent 切换",desc:"在 GPT 里聊想法,到 Claude Code 去执行——上下文零丢失。",prompt:'"帮我把刚才的对话整理到 MindOS。"\n"读一下 MindOS 里的方案,帮我开始写代码。"'},{emoji:"\uD83D\uDCCB",title:"经验→SOP",desc:"把踩坑经验沉淀为可复用的工作流,下次 3 分钟搞定。",prompt:'"帮我把这次对话的经验沉淀到 MindOS,形成可复用的工作流。"'},{emoji:"\uD83D\uDE80",title:"项目冷启动",desc:"几分钟搭建新项目——Profile 和 SOP 自动引导脚手架。",prompt:'"帮我按 MindOS 里的 Startup SOP 启动一个新项目。"'},{emoji:"\uD83D\uDD0D",title:"调研入库",desc:"让 Agent 替你调研竞品或话题,结果结构化存入知识库。",prompt:'"帮我调研 X、Y、Z 这几个产品,结果写入 MindOS 产品库。"'}],copy:"复制 Prompt",hint:'提示:Agent 会自动发现你的知识库结构。在 prompt 中提到"MindOS",它就知道去哪里找。点击左侧"探索"查看更多场景。'},shortcuts:{search:"搜索文件",askAI:"切换 MindOS",settings:"打开设置",shortcutPanel:"快捷键面板",editFile:"编辑当前文件",save:"保存文件",closePanel:"关闭面板 / 退出弹窗",attachFile:"在 MindOS 中附加文件"},faq:{title:"常见问题",items:[{q:"如何切换语言?",a:"前往 设置 → 外观 → 语言。支持中文和英文切换。"},{q:"如何连接 AI Agent?",a:"前往 设置 → 连接。MindOS 会自动检测已安装的 Agent(Claude Code、Cursor 等),一键即可连接。"},{q:"我的数据存储在哪里?",a:"所有数据以纯 Markdown 文件的形式存储在你的本地机器上。MindOS 不会将你的数据上传到任何云服务。数据完全由你掌控。"},{q:"如何跨设备同步?",a:"前往 设置 → 同步。MindOS 使用 Git 进行跨设备同步。输入 Git 远程仓库 URL 和访问令牌即可开始同步。"},{q:"可以使用自己的 AI 服务商吗?",a:"可以!前往 设置 → AI。支持 OpenAI、Anthropic、Google,或任何 OpenAI 兼容的 API(自定义 Base URL)。"},{q:"支持哪些文件格式?",a:"MindOS 最适合 Markdown(.md)文件,但也支持 JSON、CSV 和纯文本。插件可以扩展特殊格式的渲染,如看板或时间线。"},{q:"如何创建新笔记?",a:"点击文件树中任意文件夹旁的 + 图标,或让 AI 帮你创建。笔记就是 Markdown 文件,你也可以直接在文件系统中创建。"}]}},explore:{title:"探索使用场景",subtitle:"发现 MindOS 能帮你做什么 — 选一个场景,立即体验。",tryIt:"试一试",all:"全部",byCapability:"按能力",byScenario:"按场景",categories:{"knowledge-management":"知识管理","memory-sync":"记忆同步","auto-execute":"自动执行","experience-evolution":"经验进化","human-insights":"人类洞察","audit-control":"审计纠错"},scenarios:{"first-day":"初次使用",daily:"日常工作",project:"项目协作",advanced:"高级"},c1:{title:"注入身份",desc:"让所有 AI Agent 一次认识你 — 偏好、技术栈、沟通风格。",prompt:"这是我的简历,读一下,把我的信息整理到 MindOS 里。"},c2:{title:"注入信息",desc:"一句话归档文章、会议纪要或网页到知识库,全局可搜。",prompt:"帮我把这篇文章的要点整理到 MindOS 里。"},c3:{title:"跨 Agent 切换",desc:"在 MindOS 写方案,在 Claude Code 写代码,在 Cursor 优化 — 零重复。",prompt:"帮我按 MindOS 里的 XXX 方案开始写代码。"},c4:{title:"经验→SOP",desc:"把踩坑经验沉淀为可复用的工作流,下次 3 分钟搞定。",prompt:"帮我把这次对话的经验沉淀到 MindOS,形成可复用的工作流。"},c5:{title:"手机记灵感",desc:"随手记下灵感,MindOS 自动归档、拆任务、多 Agent 接力执行。",prompt:"帮我把这个想法整理到 MindOS,拆解成可执行的子任务。"},c6:{title:"项目冷启动",desc:"4 分钟搭建新项目 — Profile 和 SOP 自动引导脚手架。",prompt:"帮我按 MindOS 里的 Startup SOP 启动一个新项目。"},c7:{title:"调研入库",desc:"让 Agent 替你跑腿调研竞品或话题,结果结构化入库。",prompt:"帮我调研 X、Y、Z 这几个产品,结果写入 MindOS 产品库。"},c8:{title:"人脉管理",desc:"记录对话、自动生成跟进待办,每个联系人都有完整上下文。",prompt:"我今天和 XXX 聊了这些内容,帮我更新到 MindOS 并生成跟进待办。"},c9:{title:"审计纠偏",desc:"审查 Agent 记了什么,一处修正,全局生效。",prompt:"帮我检查 MindOS Profile 里的技术栈偏好是否正确,有错误帮我修正。"}}}}},54195:(a,b,c)=>{"use strict";c.r(b),c.d(b,{TodoRenderer:()=>O});var d=c(48249),e=c(67484),f=c(33740);let g=/^##\s+(.+)/,h=/^#\s+/,i=/^#{3,6}\s+(.+)/,j=/^(\s*)- \[([ xX~])\]\s+(.*)$/,k=/`(P[012])`/,l=/`(\d{4}-\d{2}-\d{2}|\d{2}-\d{2})`/,m=/#([a-zA-Z\u4e00-\u9fff][\w\u4e00-\u9fff-]*)/g;function n(a,b){let c=[...a];return b(c),c.join("\n")}function o(a){let b=function(a){if(!a)return null;let b=new Date;return new Date(/^\d{2}-\d{2}$/.test(a)?`${b.getFullYear()}-${a}`:a)}(a);if(!b||isNaN(b.getTime()))return null;let c=new Date,d=new Date(c.getFullYear(),c.getMonth(),c.getDate()),e=(new Date(b.getFullYear(),b.getMonth(),b.getDate()).getTime()-d.getTime())/864e5;return e<0?"overdue":0===e?"today":e<=3?"soon":"future"}function p(a,b){return a.reduce((a,c)=>a+ +(c.status===b)+p(c.children,b),0)}function q(a){return a.reduce((a,b)=>a+1+q(b.children),0)}function r(a,b){return("all"===b.status||a.status===b.status)&&("all"===b.priority||a.meta.priority===b.priority)&&("all"===b.tag||!!a.meta.tags.includes(b.tag))}let s={P0:{bg:"bg-red-500/10",text:"text-red-500",border:"border-red-500/20"},P1:{bg:"bg-amber-500/10",text:"text-amber-500",border:"border-amber-500/20"},P2:{bg:"bg-blue-500/10",text:"text-blue-500",border:"border-blue-500/20"}},t={overdue:{text:"text-red-500",bg:"bg-red-500/10"},today:{text:"text-amber-500",bg:"bg-amber-500/10"},soon:{text:"text-amber-400",bg:"bg-amber-400/5"},future:{text:"text-muted-foreground",bg:""}},u={TODAY:{dot:"bg-red-400",label:"text-red-400"},"This Week":{dot:"bg-orange-400",label:"text-orange-400"},Workflows:{dot:"bg-amber-400",label:"text-amber-400"},Backlog:{dot:"bg-blue-400",label:"text-blue-400"},Done:{dot:"bg-emerald-400",label:"text-emerald-400"},Maintenance:{dot:"bg-zinc-400",label:"text-zinc-400"}};var v=c(56692),w=c(46674);function x({filters:a,onFilterChange:b,allTags:c,allPriorities:e,counts:f}){let g="all"!==a.priority||"all"!==a.tag||"all"!==a.status;return 0===c.length&&0===e.length?null:(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-4",children:[(0,d.jsx)(v.A,{size:12,className:"text-muted-foreground shrink-0"}),(0,d.jsxs)("div",{className:"flex items-center rounded-lg border border-border overflow-hidden text-xs",children:[(0,d.jsxs)("button",{onClick:()=>b({...a,status:"all"}),className:`px-2.5 py-1 transition-colors ${"all"===a.status?"bg-muted text-foreground font-medium":"text-muted-foreground hover:bg-muted/50"}`,children:["All ",f.total]}),(0,d.jsxs)("button",{onClick:()=>b({...a,status:"todo"}),className:`px-2.5 py-1 transition-colors border-l border-border ${"todo"===a.status?"bg-muted text-foreground font-medium":"text-muted-foreground hover:bg-muted/50"}`,children:["Todo ",f.todo]}),(0,d.jsxs)("button",{onClick:()=>b({...a,status:"in-progress"}),className:`px-2.5 py-1 transition-colors border-l border-border ${"in-progress"===a.status?"bg-[var(--amber)]/10 text-[var(--amber)] font-medium":"text-muted-foreground hover:bg-muted/50"}`,children:["In Progress ",f.inProgress]}),(0,d.jsxs)("button",{onClick:()=>b({...a,status:"done"}),className:`px-2.5 py-1 transition-colors border-l border-border ${"done"===a.status?"bg-emerald-500/10 text-emerald-500 font-medium":"text-muted-foreground hover:bg-muted/50"}`,children:["Done ",f.done]})]}),e.length>0&&(0,d.jsx)("div",{className:"flex items-center gap-1",children:e.map(c=>{if(!c)return null;let e=s[c],f=a.priority===c;return(0,d.jsx)("button",{onClick:()=>b({...a,priority:f?"all":c}),className:`px-2 py-0.5 rounded text-xs font-mono font-medium border transition-colors ${f?`${e.bg} ${e.text} ${e.border}`:"border-transparent text-muted-foreground hover:bg-muted"}`,children:c},c)})}),c.length>0&&(0,d.jsx)("div",{className:"flex items-center gap-1",children:c.map(c=>{let e=a.tag===c;return(0,d.jsxs)("button",{onClick:()=>b({...a,tag:e?"all":c}),className:`px-2 py-0.5 rounded-full text-xs transition-colors ${e?"bg-[var(--amber)]/15 text-[var(--amber)]":"text-muted-foreground hover:bg-muted"}`,children:["#",c]},c)})}),g&&(0,d.jsxs)("button",{onClick:()=>b({priority:"all",tag:"all",status:"all"}),className:"flex items-center gap-1 px-2 py-0.5 rounded text-xs text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:[(0,d.jsx)(w.A,{size:10})," Clear"]})]})}var y=c(75154),z=c(99941),A=c(44643),B=c(24520),C=c(44218),D=c(19794),E=c(59347),F=c(13576);function G({priority:a}){if(!a)return null;let b=s[a];return(0,d.jsx)("span",{className:`inline-flex items-center px-1.5 py-0 rounded text-[10px] font-mono font-semibold leading-4 border shrink-0 ${b.bg} ${b.text} ${b.border}`,children:a})}function H({dateStr:a,status:b}){if(!a||"done"===b)return null;let c=o(a);if(!c)return null;let e=t[c];return(0,d.jsxs)("span",{className:`inline-flex items-center gap-0.5 px-1.5 py-0 rounded text-[10px] leading-4 shrink-0 ${e.text} ${e.bg}`,children:[(0,d.jsx)(y.A,{size:9}),a]})}function I({tag:a}){return(0,d.jsxs)("span",{className:"inline-flex items-center px-1.5 py-0 rounded-full text-[10px] leading-4 text-muted-foreground bg-muted/60 shrink-0",children:["#",a]})}function J({status:a,onClick:b}){return(0,d.jsxs)("button",{onClick:b,className:"shrink-0 transition-colors",title:"Click to cycle status",children:["done"===a&&(0,d.jsx)(z.A,{size:15,style:{color:"var(--amber)"}}),"in-progress"===a&&(0,d.jsx)(f.A,{size:15,className:"text-[var(--amber)] fill-[var(--amber)]/20"}),"todo"===a&&(0,d.jsx)(A.A,{size:15,style:{color:"var(--muted-foreground)"}})]})}function K({text:a,status:b,onRename:c}){let[f,g]=(0,e.useState)(!1),[h,i]=(0,e.useState)(a),j=(0,e.useRef)(null);function k(){let b=h.trim();b&&b!==a?c(b):i(a),g(!1)}return f?(0,d.jsx)("input",{ref:j,value:h,onChange:a=>i(a.target.value),onBlur:k,onKeyDown:b=>{"Enter"===b.key&&k(),"Escape"===b.key&&(i(a),g(!1))},className:"flex-1 bg-transparent border-b text-sm leading-relaxed outline-none min-w-0",style:{borderColor:"var(--amber)",color:"var(--foreground)"},onClick:a=>a.stopPropagation()}):(0,d.jsx)("span",{className:`flex-1 text-sm leading-relaxed cursor-text min-w-0 ${"done"===b?"line-through text-muted-foreground":"text-foreground"}`,onDoubleClick:()=>g(!0),title:"Double-click to edit",children:a})}function L({onAdd:a}){let[b,c]=(0,e.useState)(!1),[f,g]=(0,e.useState)(""),h=(0,e.useRef)(null);function i(){let b=f.trim();b&&a(b),g(""),c(!1)}return b?(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 mt-1",children:[(0,d.jsx)("span",{className:"w-[13px] shrink-0"}),(0,d.jsx)("span",{className:"shrink-0",style:{color:"var(--muted-foreground)"},children:(0,d.jsx)(A.A,{size:15})}),(0,d.jsx)("input",{ref:h,value:f,onChange:a=>g(a.target.value),onBlur:i,onKeyDown:a=>{"Enter"===a.key&&i(),"Escape"===a.key&&(g(""),c(!1))},placeholder:"New item… (supports `P0` `03-28` #tag)",className:"flex-1 bg-transparent border-b text-sm outline-none",style:{borderColor:"var(--amber)",color:"var(--foreground)"}})]}):(0,d.jsxs)("button",{onClick:()=>c(!0),className:"flex items-center gap-1.5 w-full px-3 py-1.5 rounded-lg text-xs transition-colors hover:bg-muted/60 mt-1",style:{color:"var(--muted-foreground)"},children:[(0,d.jsx)(B.A,{size:12}),(0,d.jsx)("span",{children:"Add item"})]})}function M({item:a,depth:b,filters:c,onCycleStatus:f,onRename:g,onDelete:h}){let[i,j]=(0,e.useState)(!0),k=a.children.length>0,l=r(a,c),m=a.children.some(a=>(function a(b,c){return!!r(b,c)||b.children.some(b=>a(b,c))})(a,c));if(("all"!==c.status||"all"!==c.priority||"all"!==c.tag)&&!l&&!m)return null;let n=o(a.meta.dueDate);return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:`group flex items-center gap-2 py-1.5 px-2 rounded-lg transition-colors hover:bg-muted/60 ${"done"===a.status?"opacity-45":""} ${"overdue"===n&&"done"!==a.status?"bg-error/[0.03]":""}`,style:{paddingLeft:`${8+20*b}px`},children:[k?(0,d.jsx)("button",{onClick:()=>j(a=>!a),className:"shrink-0 text-muted-foreground hover:text-foreground transition-colors",children:i?(0,d.jsx)(C.A,{size:13}):(0,d.jsx)(D.A,{size:13})}):(0,d.jsx)("span",{className:"w-[13px] shrink-0"}),(0,d.jsx)(J,{status:a.status,onClick:()=>{var b;return f(a.lineIndex,"todo"===(b=a.status)?"in-progress":"in-progress"===b?"done":"todo")}}),(0,d.jsx)(K,{text:a.text,status:a.status,onRename:b=>g(a.lineIndex,b)}),(0,d.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,d.jsx)(G,{priority:a.meta.priority}),(0,d.jsx)(H,{dateStr:a.meta.dueDate,status:a.status}),a.meta.tags.map(a=>(0,d.jsx)(I,{tag:a},a))]}),(0,d.jsx)("button",{onClick:()=>h(a.lineIndex),className:"shrink-0 opacity-0 group-hover:opacity-100 transition-opacity p-0.5 rounded hover:bg-destructive/10",style:{color:"var(--muted-foreground)"},title:"Delete item",children:(0,d.jsx)(E.A,{size:12})})]}),k&&i&&(0,d.jsx)("div",{children:a.children.map(a=>(0,d.jsx)(M,{item:a,depth:b+1,filters:c,onCycleStatus:f,onRename:g,onDelete:h},a.id))})]})}function N({name:a,meta:b,filters:c,defaultCollapsed:f,onCycleStatus:g,onRename:h,onDelete:i,onAdd:j}){let k,[l,m]=(0,e.useState)(f??!1),n=(k=Object.keys(u).find(b=>a.includes(b)))?u[k]:{dot:"bg-zinc-500",label:"text-zinc-400"},{items:o,lastLineIndex:r}=b,s=p(o,"done"),t=p(o,"in-progress"),v=q(o),w=a.includes("Done");return(0,d.jsxs)("div",{className:"border border-border rounded-xl overflow-hidden bg-card",children:[(0,d.jsxs)("button",{onClick:()=>m(a=>!a),className:"w-full flex items-center justify-between px-4 py-3 hover:bg-muted/40 transition-colors",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full shrink-0 ${n.dot}`}),(0,d.jsx)("span",{className:`text-xs font-semibold uppercase tracking-wider ${n.label} font-display`,children:a}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground tabular-nums",children:[s,"/",v]}),t>0&&(0,d.jsxs)("span",{className:"flex items-center gap-0.5 text-[10px] text-[var(--amber)]",children:[(0,d.jsx)(F.A,{size:9})," ",t]})]}),l?(0,d.jsx)(D.A,{size:14,className:"text-muted-foreground"}):(0,d.jsx)(C.A,{size:14,className:"text-muted-foreground"})]}),(0,d.jsx)("div",{className:"h-0.5 bg-muted mx-4",children:(0,d.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:v?`${s/v*100}%`:"0%",background:w?"var(--success, #22c55e)":"var(--amber)"}})}),!l&&(0,d.jsxs)("div",{className:"px-2 py-2",children:[o.map(a=>(0,d.jsx)(M,{item:a,depth:0,filters:c,onCycleStatus:g,onRename:h,onDelete:i},a.id)),0===o.length&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground px-4 py-2",children:"No items"}),!w&&(0,d.jsx)(L,{onAdd:a=>j(r,a)})]})]})}function O({content:a,saveAction:b}){let[c,o]=(0,e.useState)(a),[r,s]=(0,e.useState)({priority:"all",tag:"all",status:"all"}),{sections:t,lines:u,sectionOrder:v}=(0,e.useMemo)(()=>{let a,b,d,e,f,n,o;return a=c.split("\n"),b="General",d={},e=[],f=[],n=!1,o=!1,a.forEach((a,c)=>{if(!o){if(0===c&&"---"===a.trim()){n=!0;return}if(n){"---"===a.trim()&&(n=!1,o=!0);return}o=!0}if(h.test(a))return;let p=a.match(g);if(p){d[b=p[1].replace(/^[^\w\s\u4e00-\u9fff]+\s*/,"").trim()]||(d[b]={items:[],lastLineIndex:-1,headingLineIndex:c},e.push(b));return}if(i.test(a))return;let q=a.match(j);if(!q)return;let[,r,s,t]=q,u=Math.floor(r.length/2),v="~"===s?"in-progress":"x"===s.toLowerCase()?"done":"todo",{cleanText:w,meta:x}=function(a){let b,c=a,d=null,e=null,f=[],g=c.match(k);g&&(d=g[1],c=c.replace(k,"").trim());let h=c.match(l);h&&(e=h[1],c=c.replace(l,"").trim());let i=RegExp(m.source,"g");for(;null!==(b=i.exec(c));)f.push(b[1]);return f.length>0&&(c=c.replace(/#[a-zA-Z\u4e00-\u9fff][\w\u4e00-\u9fff-]*/g,"").trim()),{cleanText:c=c.replace(/\*\*(.*?)\*\*/g,"$1").trim(),meta:{priority:d,dueDate:e,tags:f}}}(t),y={id:`${c}`,text:w,rawText:t,status:v,indent:u,lineIndex:c,section:b,children:[],meta:x};for(;f.length>0&&f[f.length-1].indent>=u;)f.pop();d[b]||(d[b]={items:[],lastLineIndex:-1,headingLineIndex:-1},e.push(b)),f.length>0?f[f.length-1].children.push(y):d[b].items.push(y),d[b].lastLineIndex=Math.max(d[b].lastLineIndex,c),f.push(y)}),{sections:d,lines:a,sectionOrder:e}},[c]),w=(0,e.useMemo)(()=>Object.values(t).reduce((a,b)=>a+p(b.items,"done"),0),[t]),y=(0,e.useMemo)(()=>Object.values(t).reduce((a,b)=>a+p(b.items,"in-progress"),0),[t]),z=(0,e.useMemo)(()=>Object.values(t).reduce((a,b)=>a+q(b.items),0),[t]),A=z-w-y,B=(0,e.useMemo)(()=>(function(a){let b=new Set;for(let c of Object.values(a))!function a(c){for(let d of c){for(let a of d.meta.tags)b.add(a);a(d.children)}}(c.items);return[...b].sort()})(t),[t]),C=(0,e.useMemo)(()=>(function(a){let b=new Set;for(let c of Object.values(a))!function a(c){for(let d of c)d.meta.priority&&b.add(d.meta.priority),a(d.children)}(c.items);return["P0","P1","P2"].filter(a=>b.has(a))})(t),[t]),D=(0,e.useCallback)(async a=>{o(a),await b(a)},[b]),E=(0,e.useCallback)(async(a,b)=>{await D(n(u,c=>{c[a]=c[a].replace(/- \[[ xX~]\]/,`- [${"done"===b?"x":"in-progress"===b?"~":" "}]`)}))},[u,D]),F=(0,e.useCallback)(async(a,b)=>{await D(n(u,c=>{c[a]=c[a].replace(/(- \[[ xX~]\]\s*)(.*)$/,`$1${b}`)}))},[u,D]),G=(0,e.useCallback)(async a=>{await D(n(u,b=>{b.splice(a,1)}))},[u,D]),H=(0,e.useCallback)(async(a,b)=>{await D(n(u,c=>{let d=a<0?c.length:a+1;c.splice(d,0,`- [ ] ${b}`)}))},[u,D]),I=v.filter(a=>t[a]).map(a=>[a,t[a]]),J=z?Math.round(w/z*100):0;return(0,d.jsxs)("div",{className:"max-w-[900px] mx-auto xl:mr-[220px] px-0 py-2",children:[(0,d.jsx)("div",{className:"mb-5 flex items-center gap-4",children:(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsxs)("div",{className:"flex items-baseline gap-2",children:[(0,d.jsxs)("span",{className:"text-lg font-semibold font-display text-foreground tabular-nums",children:[J,"%"]}),(0,d.jsxs)("span",{className:"text-xs text-muted-foreground font-display",children:[w,"/",z," completed"]}),y>0&&(0,d.jsxs)("span",{className:"flex items-center gap-1 text-xs text-[var(--amber)]",children:[(0,d.jsx)(f.A,{size:8,className:"fill-[var(--amber)]/30"}),y," in progress"]})]}),(0,d.jsx)("div",{className:"mt-2 w-full max-w-xs h-1.5 bg-muted rounded-full overflow-hidden",children:(0,d.jsx)("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${J}%`,background:"var(--amber)"}})})]})}),(0,d.jsx)(x,{filters:r,onFilterChange:s,allTags:B,allPriorities:C,counts:{todo:A,inProgress:y,done:w,total:z}}),(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[I.map(([a,b])=>(0,d.jsx)(N,{name:a,meta:b,filters:r,defaultCollapsed:a.includes("Done"),onCycleStatus:E,onRename:F,onDelete:G,onAdd:H},a)),0===I.length&&(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"No TODO items found in this file."})]})]})}},54461:(a,b,c)=>{"use strict";c.d(b,{X:()=>l,d:()=>g});var d=c(67484),e=c(49223);function f(a){let b=Date.now();return{id:`${b}-${Math.random().toString(36).slice(2,8)}`,currentFile:a,createdAt:b,updatedAt:b,messages:[]}}function g(a){if(a.title)return a.title;let b=a.messages.find(a=>"user"===a.role);if(!b)return"(empty session)";let c=b.content.replace(/\s+/g," ").trim();return!c&&b.images&&b.images.length>0?`[${b.images.length} image${b.images.length>1?"s":""}]`:c.length>42?`${c.slice(0,42)}...`:c||"(empty session)"}async function h(){try{let a=await fetch("/api/ask-sessions",{cache:"no-store"});if(!a.ok)return[];let b=await a.json();if(!Array.isArray(b))return[];return b.slice(0,30)}catch{return[]}}async function i(a){try{let b={...a,messages:a.messages.map(a=>a.images&&0!==a.images.length?{...a,images:a.images.map(a=>({...a,data:""}))}:a)};await fetch("/api/ask-sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({session:b})})}catch{}}async function j(a){try{await fetch("/api/ask-sessions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:a})})}catch{}}async function k(a){try{await fetch("/api/ask-sessions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({ids:a})})}catch{}}function l(a){let[b,c]=(0,d.useState)([]),[g,l]=(0,d.useState)([]),[m,n]=(0,d.useState)(null),o=(0,d.useRef)(null),p=(0,d.useCallback)(async()=>{let b=(await h()).sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,30),d=b.filter(a=>0===a.messages.length).map(a=>a.id),e=d.length>0?b.filter(a=>!d.includes(a.id)):b;d.length>0&&k(d);let g=f(a),i=a?e.find(b=>b.currentFile===a):e[0];i?(n(i.id),c(i.messages),l([...e])):(n(g.id),c([]),l([g,...e].slice(0,30)))},[a]),q=(0,d.useCallback)((b,c)=>{if(!c||0===b.length)return;let d=null;l(e=>{let f=Date.now(),g=e.find(a=>a.id===c);d=g?{...g,currentFile:a,updatedAt:f,messages:b}:{id:c,currentFile:a,createdAt:f,updatedAt:f,messages:b};let h=e.filter(a=>a.id!==c);return[d,...h].sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,30)}),o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{d&&i(d)},600)},[a]),r=(0,d.useCallback)(()=>{o.current&&(clearTimeout(o.current),o.current=null)},[]),s=(0,d.useCallback)(()=>{l(b=>{let d=b.find(a=>a.id===m);if(d&&0===d.messages.length)return b;let e=f(a);return n(e.id),c([]),[e,...b].sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,30)})},[a,m]),t=(0,d.useCallback)(a=>{let b=g.find(b=>b.id===a);if(!b)return;let d=m?g.find(a=>a.id===m):null;d&&0===d.messages.length&&d.id!==a&&l(a=>a.filter(a=>a.id!==d.id)),n(b.id),c(b.messages)},[g,m]),u=(0,d.useCallback)(b=>{let d=g.find(a=>a.id===b);d&&d.messages.length>0&&j(b);let e=g.filter(a=>a.id!==b);if(l(e),m===b){let b=f(a);n(b.id),c([]),l([b,...e].slice(0,30))}},[m,a,g]),v=(0,d.useCallback)((a,b)=>{let c=b.trim();l(b=>{let d=b.findIndex(b=>b.id===a);if(d<0)return b;let e={...b[d],title:c||void 0},f=[...b];return f[d]=e,i(e),f})},[]),w=(0,d.useCallback)(a=>{l(b=>{let c=b.findIndex(b=>b.id===a);if(c<0)return b;let d={...b[c],pinned:!b[c].pinned},e=[...b];return e[c]=d,d.messages.length>0&&i(d),e})},[]),x=(0,d.useCallback)(b=>{if(!m)return;let c=g.find(a=>a.id===m);if(!c)return;let d=(0,e.R3)({...c,currentFile:c.currentFile??a,updatedAt:Date.now()},b);l(a=>[d,...a.filter(a=>a.id!==m)].sort((a,b)=>b.updatedAt-a.updatedAt).slice(0,30)),o.current&&clearTimeout(o.current),d.messages.length>0&&(o.current=setTimeout(()=>{i(d)},600))},[m,a,g]),y=(0,d.useCallback)(()=>{let b=g.filter(a=>a.messages.length>0).map(a=>a.id);b.length>0&&k(b);let d=f(a);n(d.id),c([]),l([d])},[a,g]);return{messages:b,setMessages:c,sessions:[...g].sort((a,b)=>a.pinned&&!b.pinned?-1:!a.pinned&&b.pinned?1:b.updatedAt-a.updatedAt),activeSession:g.find(a=>a.id===m)??null,activeSessionId:m,initSessions:p,persistSession:q,clearPersistTimer:r,resetSession:s,loadSession:t,deleteSession:u,renameSession:v,togglePinSession:w,setSessionDefaultAcpAgent:x,clearAllSessions:y}}},55038:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/app/global-error.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/app/global-error.tsx","default")},55232:(a,b,c)=>{"use strict";c.d(b,{C:()=>e});var d=c(67484);function e(){let[a,b]=(0,d.useState)([]),[c,e]=(0,d.useState)(null),[f,g]=(0,d.useState)([]),[h,i]=(0,d.useState)(0),j=(0,d.useRef)(!1),k=(0,d.useCallback)(async()=>{b((await fetch("/api/skills").then(a=>a.ok?a.json():{skills:[]}).then(a=>Array.isArray(a?.skills)?a.skills:[]).catch(()=>[])).filter(a=>a.enabled)),j.current=!0},[]),l=(0,d.useCallback)((b,c)=>{let d=b.slice(0,c),f=d.lastIndexOf("/");if(-1===f||f>0&&" "!==d[f-1]&&"\n"!==d[f-1])return void e(null);let h=d.slice(f+1);if(h.includes(" "))return void e(null);if(!j.current){k(),e(null);return}let l=h.toLowerCase(),m=l?a.map(a=>{let b=a.name.toLowerCase(),c=0;return b.startsWith(l)?c=100:b.includes(l)?c=50:a.description.toLowerCase().includes(l)&&(c=10),{s:a,score:c}}).filter(a=>a.score>0).sort((a,b)=>b.score-a.score).slice(0,20).map(a=>({type:"skill",name:a.s.name,description:a.s.description})):a.slice(0,20).map(a=>({type:"skill",name:a.name,description:a.description}));if(0===m.length){e(null),g([]),i(0);return}e(h),g(m),i(0)},[a,k]),m=(0,d.useCallback)(a=>{0!==f.length&&("down"===a?i(a=>Math.min(a+1,f.length-1)):i(a=>Math.max(a-1,0)))},[f.length]);return{slashQuery:c,slashResults:f,slashIndex:h,updateSlashFromInput:l,navigateSlash:m,resetSlash:(0,d.useCallback)(()=>{e(null),g([]),i(0)},[])}}},56606:(a,b,c)=>{Promise.resolve().then(c.bind(c,10500)),Promise.resolve().then(c.bind(c,67809)),Promise.resolve().then(c.bind(c,66535)),Promise.resolve().then(c.bind(c,30488)),Promise.resolve().then(c.bind(c,78340)),Promise.resolve().then(c.bind(c,41829)),Promise.resolve().then(c.bind(c,72362)),Promise.resolve().then(c.bind(c,46427)),Promise.resolve().then(c.bind(c,80992)),Promise.resolve().then(c.bind(c,47336)),Promise.resolve().then(c.bind(c,21416)),Promise.resolve().then(c.bind(c,51488)),Promise.resolve().then(c.bind(c,6732)),Promise.resolve().then(c.bind(c,54195)),Promise.resolve().then(c.bind(c,63956)),Promise.resolve().then(c.bind(c,2820)),Promise.resolve().then(c.bind(c,49905)),Promise.resolve().then(c.bind(c,89386)),Promise.resolve().then(c.bind(c,31168)),Promise.resolve().then(c.bind(c,94416)),Promise.resolve().then(c.bind(c,70137)),Promise.resolve().then(c.bind(c,5200))},57056:(a,b,c)=>{"use strict";c.d(b,{BK:()=>v,DO:()=>l,KF:()=>j,Mv:()=>n,TM:()=>u,ZC:()=>t,lx:()=>s,md:()=>k,pp:()=>o,rA:()=>m});var d=c(48249),e=c(46674),f=c(40560),g=c(24520),h=c(67484),i=c(10927);function j({active:a,label:b,onClick:c}){return(0,d.jsx)("button",{type:"button",onClick:c,"aria-pressed":a,className:`relative px-2.5 min-h-[28px] rounded text-xs cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${a?"bg-[var(--amber-dim)] text-[var(--amber-text)] font-medium shadow-[0_1px_2px_rgba(200,135,58,0.08)]":"text-muted-foreground hover:text-foreground hover:bg-muted/60"}`,children:b})}function k({tone:a,label:b,count:c}){return(0,d.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-muted-foreground",children:[(0,d.jsx)("span",{className:`w-2 h-2 rounded-full ${"ok"===a?"bg-[var(--success)]":"warn"===a?"bg-[var(--amber)]":"bg-muted-foreground/60"}`,"aria-hidden":"true"}),(0,d.jsx)("span",{className:"text-xs",children:b}),(0,d.jsx)("span",{className:`tabular-nums font-medium ${"ok"===a?"text-foreground":"warn"===a?"text-[var(--amber)]":"text-muted-foreground"}`,children:c})]})}function l({value:a,onChange:b,placeholder:c,ariaLabel:f,icon:g}){return(0,d.jsxs)("label",{className:"relative block group/search",children:[(0,d.jsx)(g,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-muted-foreground/60 group-focus-within/search:text-[var(--amber)] pointer-events-none transition-colors duration-150"}),(0,d.jsx)("input",{value:a,onChange:a=>b(a.target.value),placeholder:c,"aria-label":f,className:"w-full h-9 rounded-lg border border-border bg-background pl-9 pr-8 text-sm text-foreground placeholder:text-muted-foreground/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--amber)]/30 focus-visible:border-[var(--amber)]/40 transition-all duration-150"}),a.length>0&&(0,d.jsx)("button",{type:"button",onClick:()=>b(""),"aria-label":"Clear search",className:"absolute right-2.5 top-1/2 -translate-y-1/2 p-0.5 rounded-full text-muted-foreground hover:text-foreground hover:bg-muted cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150",children:(0,d.jsx)(e.A,{size:13})})]})}function m({onClick:a,disabled:b,busy:c,label:e,busyLabel:g,variant:h="default"}){return(0,d.jsxs)("button",{type:"button",onClick:a,disabled:b,"aria-busy":c,className:`inline-flex items-center justify-center gap-1.5 text-2xs min-h-[28px] px-2.5 rounded-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed transition-colors duration-150 ${{default:"border border-border hover:bg-muted",primary:"bg-[var(--amber)] text-[var(--amber-foreground)] hover:bg-[var(--amber)]/90"}[h]}`,children:[c&&(0,d.jsx)(f.A,{size:12,className:"animate-spin","aria-hidden":"true"}),c?g??e:e]})}function n({message:a}){return a?(0,d.jsx)("span",{role:"status","aria-live":"polite",className:"text-2xs text-muted-foreground animate-in fade-in duration-200",children:a}):null}function o({message:a,icon:b,className:c}){return(0,d.jsxs)("div",{className:`rounded-xl border border-border/40 bg-card/30 p-10 text-center ${c??""}`,children:[b&&(0,d.jsx)("div",{className:"w-10 h-10 rounded-full bg-muted/50 flex items-center justify-center mx-auto mb-3 text-muted-foreground/40",children:b}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground/70 leading-relaxed max-w-xs mx-auto",children:a})]})}let p=[["bg-rose-100/70 dark:bg-rose-900/30","border-rose-300/50 dark:border-rose-700/40","text-rose-600/80 dark:text-rose-400/80"],["bg-violet-100/70 dark:bg-violet-900/30","border-violet-300/50 dark:border-violet-700/40","text-violet-600/80 dark:text-violet-400/80"],["bg-emerald-100/70 dark:bg-emerald-900/30","border-emerald-300/50 dark:border-emerald-700/40","text-emerald-600/80 dark:text-emerald-400/80"],["bg-sky-100/70 dark:bg-sky-900/30","border-sky-300/50 dark:border-sky-700/40","text-sky-600/80 dark:text-sky-400/80"],["bg-amber-100/70 dark:bg-amber-900/30","border-amber-300/50 dark:border-amber-700/40","text-amber-700/80 dark:text-amber-400/80"],["bg-teal-100/70 dark:bg-teal-900/30","border-teal-300/50 dark:border-teal-700/40","text-teal-600/80 dark:text-teal-400/80"],["bg-pink-100/70 dark:bg-pink-900/30","border-pink-300/50 dark:border-pink-700/40","text-pink-600/80 dark:text-pink-400/80"],["bg-indigo-100/70 dark:bg-indigo-900/30","border-indigo-300/50 dark:border-indigo-700/40","text-indigo-600/80 dark:text-indigo-400/80"],["bg-lime-100/70 dark:bg-lime-900/30","border-lime-300/50 dark:border-lime-700/40","text-lime-700/80 dark:text-lime-400/80"],["bg-fuchsia-100/70 dark:bg-fuchsia-900/30","border-fuchsia-300/50 dark:border-fuchsia-700/40","text-fuchsia-600/80 dark:text-fuchsia-400/80"],["bg-cyan-100/70 dark:bg-cyan-900/30","border-cyan-300/50 dark:border-cyan-700/40","text-cyan-600/80 dark:text-cyan-400/80"],["bg-orange-100/70 dark:bg-orange-900/30","border-orange-300/50 dark:border-orange-700/40","text-orange-600/80 dark:text-orange-400/80"]];function q(a){let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)|0;return Math.abs(b)}function r(a){let b=a.split(/[\s\-_]+/).filter(Boolean);return b.length>=2?(b[0][0]+b[1][0]).toUpperCase():a.slice(0,2).toUpperCase()}function s({name:a,status:b,size:c="md",onRemove:f,href:g}){let[h,i,j]=p[q(a)%p.length],k="connected"===b?"bg-[var(--success)]":"detected"===b?"bg-[var(--amber)]":"bg-muted-foreground";return(0,d.jsxs)("div",{className:"relative group/avatar",title:a,children:[(0,d.jsx)("div",{className:`${"sm"===c?"w-7 h-7 text-[10px]":"w-9 h-9 text-xs"} ${h} ${i} ${j} border rounded-full flex items-center justify-center font-semibold select-none`,children:r(a)}),b&&(0,d.jsx)("span",{className:`absolute -bottom-0.5 -right-0.5 w-2.5 h-2.5 rounded-full border-2 border-card ${k}`,"aria-hidden":"true"}),f&&(0,d.jsx)("button",{type:"button",onClick:a=>{a.preventDefault(),a.stopPropagation(),f()},className:"absolute -top-1 -right-1 w-4 h-4 rounded-full bg-destructive text-destructive-foreground flex items-center justify-center opacity-0 scale-75 group-hover/avatar:opacity-100 group-hover/avatar:scale-100 transition-all duration-150 cursor-pointer focus-visible:opacity-100 focus-visible:scale-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":`Remove ${a}`,children:(0,d.jsx)(e.A,{size:9})})]})}function t({onClick:a,label:b,size:c="md"}){return(0,d.jsx)("button",{type:"button",onClick:a,title:b,"aria-label":b,className:`${"sm"===c?"w-7 h-7":"w-9 h-9"} rounded-full border-2 border-dashed border-border flex items-center justify-center text-muted-foreground hover:text-foreground hover:border-foreground/30 hover:bg-muted cursor-pointer transition-all duration-150 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:(0,d.jsx)(g.A,{size:14})})}function u({open:a,title:b,message:c,confirmLabel:e,cancelLabel:f,onConfirm:g,onCancel:j,variant:k="destructive"}){let l=(0,h.useRef)(null),m=(0,h.useRef)(null);return((0,i.r)(m,a),a)?(0,d.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center",role:"alertdialog","aria-modal":"true","aria-labelledby":"confirm-dialog-title",children:[(0,d.jsx)("div",{className:"absolute inset-0 overlay-backdrop",onClick:j,"aria-hidden":"true"}),(0,d.jsxs)("div",{ref:m,className:"relative bg-card border border-border rounded-lg shadow-xl p-5 max-w-sm w-full mx-4 animate-in fade-in zoom-in-95 duration-200",children:[(0,d.jsx)("h3",{id:"confirm-dialog-title",className:"text-sm font-medium text-foreground mb-1.5",children:b}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mb-4 leading-relaxed",children:c}),(0,d.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,d.jsx)("button",{ref:l,type:"button",onClick:j,className:"px-3 min-h-[32px] text-sm rounded-md border border-border hover:bg-muted cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150",children:f}),(0,d.jsx)("button",{type:"button",onClick:g,className:`px-3 min-h-[32px] text-sm rounded-md cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring transition-colors duration-150 ${"destructive"===k?"bg-destructive text-destructive-foreground hover:bg-destructive/90":"bg-[var(--amber)] text-[var(--amber-foreground)] hover:bg-[var(--amber)]/90"}`,children:e})]})]})]}):null}function v({open:a,agents:b,emptyLabel:c,onSelect:e,onClose:f}){let g=(0,h.useRef)(null);return a?(0,d.jsx)("div",{ref:g,className:"absolute right-0 top-full mt-1 z-30 w-56 rounded-lg border border-border bg-card shadow-lg animate-in fade-in slide-in-from-top-1 duration-150",children:0===b.length?(0,d.jsx)("p",{className:"px-3 py-2.5 text-xs text-muted-foreground",children:c}):(0,d.jsx)("div",{className:"py-1 max-h-48 overflow-y-auto",children:b.map(a=>(0,d.jsxs)("button",{type:"button",onClick:()=>e(a.key),className:"w-full text-left px-3 py-2 text-xs text-foreground hover:bg-muted cursor-pointer flex items-center gap-2 transition-colors duration-100",children:[(()=>{let[b,c,e]=p[q(a.name)%p.length];return(0,d.jsx)("div",{className:`w-6 h-6 rounded-full border ${b} ${c} ${e} flex items-center justify-center text-[9px] font-semibold shrink-0`,children:r(a.name)})})(),a.name]},a.key))})}):null}},59238:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AudioRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call AudioRenderer() from the server but AudioRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/audio/AudioRenderer.tsx","AudioRenderer")},59867:(a,b,c)=>{"use strict";c.d(b,{x:()=>u,A:()=>x});var d=c(48249),e=c(67484),f=c(74429),g=c(801),h=c(6079),i=c(8455),j=c(40560),k=c(42742),l=c(19794),m=c(44218),n=c(47223),o=c(95054),p=c(99101),q=c(90826),r=c(69593);function s(a,b,c=new Date){let d=c.getFullYear(),e=String(c.getMonth()+1).padStart(2,"0"),f=String(c.getDate()).padStart(2,"0"),g=`> Saved session from MindOS Ask \xb7 ${d}-${e}-${f}`;if("full"===b){let b=a.map(a=>{let b=(0,r.Oo)(a.content).trim();if(!b)return null;let c="user"===a.role?"**User**":"**Assistant**";return`### ${c}
|
|
134
122
|
|
|
135
123
|
${b}`}).filter(Boolean);return`${g}
|
|
136
124
|
|
|
@@ -148,16 +136,11 @@ MCP_TRANSPORT = "stdio"`;return{snippet:b,displaySnippet:b,path:a.globalPath}}if
|
|
|
148
136
|
flex-col bg-background border-l border-border/40 shadow-[-4px_0_16px_rgba(0,0,0,0.04)]
|
|
149
137
|
${y?"":"transition-[width,transform] duration-200 ease-out"}
|
|
150
138
|
${a?"translate-x-0":"translate-x-full pointer-events-none"}
|
|
151
|
-
`,style:{width:E,minWidth:`${o}px`},role:"complementary","aria-label":"MindOS panel",children:[(0,e.jsx)(i.default,{fallback:(0,e.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-3 px-6 text-center",children:[(0,e.jsx)(g.A,{size:20,className:"text-muted-foreground"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"MindOS encountered an error."}),(0,e.jsx)("button",{onClick:()=>window.location.reload(),className:"text-xs px-3 py-1.5 rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:"Reload page"})]}),children:(0,e.jsx)("div",{className:"flex min-h-0 w-full flex-1 flex-col overflow-hidden",children:(0,e.jsx)(h.A,{visible:a,variant:"panel",currentFile:a?c:void 0,initialMessage:d,initialAcpAgent:k,onFirstMessage:l,onClose:b,askMode:r,onModeSwitch:s,maximized:t,onMaximize:u})})}),(0,e.jsx)("div",{className:"absolute top-0 -left-[3px] w-[6px] h-full cursor-col-resize z-40 group hidden md:block",onMouseDown:D,children:(0,e.jsx)("div",{className:"absolute left-[2px] top-0 w-[1px] h-full opacity-0 group-hover:opacity-100 bg-[var(--amber)]/50 transition-opacity duration-150"})})]})}d()}catch(a){d(a)}})},63112:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ConfigRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ConfigRenderer() from the server but ConfigRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/config/ConfigRenderer.tsx","ConfigRenderer")},63710:(a,b,c)=>{"use strict";c.d(b,{Aw:()=>i,Nh:()=>k,QL:()=>f,TM:()=>g,h0:()=>h,lL:()=>j});var d=c(99101);function e(a){let b=new Uint8Array(a),c=[];for(let a=0;a<b.length;a+=8192)c.push(String.fromCharCode(...b.subarray(a,a+8192)));return btoa(c.join(""))}async function f(a,b){let c=[],f=0;for(let b of a){if(b.size>0xa00000){f++;continue}try{if(b.name.toLowerCase().endsWith(".pdf")){let a=await b.arrayBuffer();c.push({name:b.name,content:e(a),encoding:"base64"})}else{let a=await b.text();c.push({name:b.name,content:a})}}catch{}}if(0===c.length)return void(f>0?d.oR.error(b.inbox.tooLarge(f),4e3):a.length>0&&d.oR.error(b.inbox.saveFailed,4e3));try{var g;let a=await fetch("/api/inbox",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:c})});if(!a.ok){let c=await a.json().catch(()=>({}));console.error("[QuickDrop] Save failed:",c.error),d.oR.error(b.inbox.saveFailed,4e3);return}let e=await a.json(),h=e.saved?.length??0,i=e.skipped?.length??0;g=f,h>0&&g>0&&0===i?d.oR.success(b.inbox.savedWithOversized(h,g),4e3):h>0&&i+g>0?d.oR.success(b.inbox.savedWithSkipped(h,i+g),4e3):h>0?d.oR.success(b.inbox.savedToast(h),3e3):(g>0&&d.oR.error(b.inbox.tooLarge(g),4e3),i>0&&d.oR.error(b.inbox.savedWithSkipped(0,i),4e3),0===g&&0===i&&d.oR.error(b.inbox.saveFailed,4e3)),window.dispatchEvent(new Event("mindos:files-changed")),window.dispatchEvent(new Event("mindos:inbox-updated"))}catch(a){console.error("[QuickDrop] Network error:",a),d.oR.error(b.inbox.saveFailed,4e3)}}async function g(a,b){try{let c=await fetch("/api/inbox/clip",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:a})}),e=await c.json();if(!c.ok){let a=e.error||b.inbox.clipFailed;return d.oR.error(a,4e3),{ok:!1}}return d.oR.success(b.inbox.clipSuccess(e.title||a),3e3),window.dispatchEvent(new Event("mindos:files-changed")),window.dispatchEvent(new Event("mindos:inbox-updated")),{ok:!0,title:e.title}}catch(a){return console.error("[ClipURL] Network error:",a),d.oR.error(b.inbox.clipFailed,4e3),{ok:!1}}}function h(a){let b=a.trim();if(!b.startsWith("http://")&&!b.startsWith("https://"))return!1;try{return new URL(b),!0}catch{return!1}}function i(a){if(a.dataTransfer?.files&&a.dataTransfer.files.length>0)return null;let b=a.dataTransfer?.getData("text/uri-list");if(b){let a=b.split(/[\r\n]+/).find(a=>!a.startsWith("#")&&a.trim().length>0);if(a&&h(a))return a.trim()}let c=a.dataTransfer?.getData("text/plain");return c&&h(c)?c.trim():null}function j(a){let b=a.dataTransfer?.types??[];return!b.includes("Files")&&(b.includes("text/uri-list")||b.includes("text/plain"))}async function k(a,b,c){let f=[],g=0,h=new Set(["pdf","png","jpg","jpeg","gif","webp","bmp","ico","mp3","wav","m4a","ogg","flac","aac","mp4","webm","mov","mkv"]);for(let b of a){if(b.size>0xa00000){g++;continue}try{let a=(b.name.split(".").pop()??"").toLowerCase();if(h.has(a)){let a=await b.arrayBuffer();f.push({name:b.name,content:e(a),encoding:"base64"})}else{let a=await b.text();f.push({name:b.name,content:a})}}catch{}}if(0===f.length)return void(g>0?d.oR.error(c.inbox.tooLarge(g),4e3):a.length>0&&d.oR.error(c.inbox.saveFailed,4e3));let i=b.split("/").pop()||b;try{let a=await fetch("/api/file/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:f,targetSpace:b,organize:!1,conflict:"rename"})});if(!a.ok){let b=await a.json().catch(()=>({}));console.error("[TreeDrop] Save failed:",b.error),d.oR.error(c.inbox.saveFailed,4e3);return}let e=await a.json(),h=e.created?.length??0,j=e.skipped?.length??0;h>0&&j+g>0?d.oR.success(c.inbox.savedWithSkipped(h,j+g),4e3):h>0?d.oR.success(c.inbox.savedToDir(h,i),3e3):(g>0&&d.oR.error(c.inbox.tooLarge(g),4e3),j>0&&d.oR.error(c.inbox.savedWithSkipped(0,j),4e3)),window.dispatchEvent(new Event("mindos:files-changed"))}catch(a){console.error("[TreeDrop] Network error:",a),d.oR.error(c.inbox.saveFailed,4e3)}}},63956:(a,b,c)=>{"use strict";c.r(b),c.d(b,{VideoRenderer:()=>f});var d=c(48249),e=c(67484);function f({filePath:a}){let b=`/api/file/raw?path=${encodeURIComponent(a)}`,c=a.split("/").pop()??"video",f=c.split(".").pop()?.toLowerCase()??"",[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(0),[k,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(null),o=(0,e.useRef)(null),p=(0,e.useCallback)(()=>{let a=o.current;a&&n({w:a.videoWidth,h:a.videoHeight})},[]),q=(0,e.useCallback)(()=>{h(!1),j(a=>a+1)},[]);return(0,d.jsxs)("div",{className:"w-full flex flex-col gap-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2 border-b border-border text-xs text-[var(--text-secondary)]",children:[m&&(0,d.jsxs)("span",{children:[m.w," x ",m.h]}),null!==k&&(0,d.jsx)("span",{children:k<1024?`${k} B`:k<1048576?`${(k/1024).toFixed(1)} KB`:`${(k/1048576).toFixed(1)} MB`}),(0,d.jsx)("span",{className:"uppercase opacity-60",children:f})]}),(0,d.jsx)("div",{className:"flex-1 min-h-[50vh] flex items-center justify-center bg-black rounded-b-lg overflow-hidden",children:g?(0,d.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm text-neutral-400",children:"Failed to load video"}),(0,d.jsx)("button",{onClick:q,className:"text-xs px-3 py-1.5 rounded-md bg-neutral-800 hover:bg-neutral-700 text-neutral-200 transition-colors",children:"Retry"})]}):(0,d.jsx)("video",{ref:o,controls:!0,preload:"metadata",className:"max-w-full max-h-[70vh]",onLoadedMetadata:p,onError:()=>h(!0),children:(0,d.jsx)("source",{src:b})},i)})]})}},65141:(a,b,c)=>{"use strict";c.d(b,{b:()=>g});var d=c(67484),e=c(71110),f=c(4615);function g(){let[a,b]=(0,d.useState)("files"),[c,g]=(0,d.useState)(null),[h,i]=(0,d.useState)(!1),[j,k]=(0,d.useState)(!1),l=(0,d.useCallback)(a=>g(a),[]),m=(0,d.useCallback)(a=>{try{localStorage.setItem("left-panel-width",String(a))}catch{}},[]),n=(0,d.useCallback)(()=>i(a=>!a),[]),o=(0,d.useCallback)(a=>{k(a);try{localStorage.setItem("rail-expanded",String(a))}catch{}},[]),p=j?f.we:f.SG,q=c??(a?e.iP[a]:280);return{activePanel:a,setActivePanel:b,panelWidth:c,panelMaximized:h,railExpanded:j,railWidth:p,panelOpen:null!==a,effectivePanelWidth:q,handlePanelWidthChange:l,handlePanelWidthCommit:m,handlePanelMaximize:n,handleExpandedChange:o}}},65965:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A:()=>H});var e=c(48249),f=c(67484),g=c(74429),h=c(24520),i=c(80600),j=c(33407),k=c(46674),l=c(51161),m=c(74118),n=c(47223),o=c(38957),p=c(54461),q=c(41297),r=c(45108),s=c(15330),t=c(55232),u=c(74356),v=c(6597),w=c(82110),x=c(42529),y=c(41739),z=c(33827),A=c(74190),B=c(4452),C=c(93574),D=c(49223),E=c(33191),F=c(17009),G=a([B]);function H({visible:a,currentFile:b,initialMessage:c,initialAcpAgent:d,onFirstMessage:G,variant:H,onClose:I,maximized:J,onMaximize:K,askMode:L,onModeSwitch:M,onDockToPanel:N}){let O="panel"===H,P="home"===H,Q=(0,f.useRef)(null),R=(0,f.useRef)(null),{t:S}=(0,n.Y)(),[T,U]=(0,f.useState)(!1),[V,W]=(0,f.useState)(""),X=(0,f.useRef)("");X.current=V;let[Y,Z]=(0,f.useState)([]),$=(0,f.useRef)(Y);$.current=Y;let[_,aa]=(0,f.useState)(!1),[ab,ac]=(0,f.useState)(!1),[ad,ae]=(0,f.useState)(!1),af=(0,f.useRef)(null),ag=(0,f.useRef)(null),[ah,ai]=(0,f.useState)(null),[aj,ak]=(0,f.useState)(null),al=(0,f.useRef)(aj);al.current=aj;let[am,an]=(0,f.useState)(null),ao=(0,f.useRef)(am),ap=(0,f.useRef)(null);ao.current=am;let[aq,ar]=(0,f.useState)("agent"),[as,at]=(0,f.useState)(null),[au,av]=(0,f.useState)(null),aw=(0,p.X)(b),ax=(0,f.useRef)(aw);ax.current=aw;let ay=(0,f.useMemo)(()=>({unsupportedType:S.fileImport?.unsupported}),[S]),az=(0,q.l)(ay),aA=(0,f.useRef)(az);aA.current=az;let aB=(0,r.u)(),aC=(0,s.Q)(),aD=(0,t.C)(),aE=(0,F.z)(),aF=(0,f.useRef)(aB);aF.current=aB;let aG=(0,f.useRef)(aC);aG.current=aC;let aH=(0,f.useRef)(aD);aH.current=aD;let aI=(0,f.useCallback)(()=>{W(""),ak(null),Z(b?[b]:[]),aA.current.clearAttachments()},[b]),aJ=(0,f.useCallback)(a=>{W(a.content),a.images&&a.images.length>0&&aF.current.clearImages(),a.attachedFiles&&Z(a.attachedFiles),a.skillName&&aH.current.resetSlash(),an((0,D.EI)(a)),setTimeout(()=>Q.current?.focus(),50)},[]),aK=(0,f.useRef)({inputValueRef:X,mentionRef:aG,slashRef:aH,imageUploadRef:aF,sessionRef:ax,uploadRef:aA,selectedSkillRef:al,selectedAcpAgentRef:ao,attachedFilesRef:$}),aL=(0,C.t)({currentFile:b,chatMode:aq,providerOverride:as,modelOverride:au,onFirstMessage:G,refs:aK.current,errorLabels:{noResponse:S.ask.errorNoResponse,stopped:S.ask.stopped},resetInputState:aI,onRestoreInput:aJ}),{isLoading:aM,loadingPhase:aN,reconnectAttempt:aO,reconnectMaxRef:aP}=aL,aQ=aL.submit,aR=aL.stop,aS=(0,f.useCallback)(a=>{an(a),aw.setSessionDefaultAcpAgent(a)},[aw]),aT=az.localAttachments.some(a=>"loading"===a.status),aU=az.uploadError||aB.imageError||(aT?S.ask.uploadsProcessing??"Wait for uploaded files to finish processing before sending.":"");(0,f.useRef)(!1),(0,f.useRef)(b),(0,f.useRef)(aw.clearPersistTimer).current=aw.clearPersistTimer;let aV=(0,f.useRef)(null),aW=(0,f.useRef)(null),aX=(0,f.useRef)(null),aY=(0,f.useCallback)((a,b)=>{W(a);let c=b??a.length;aW.current&&clearTimeout(aW.current),aX.current&&clearTimeout(aX.current),aW.current=setTimeout(()=>aG.current.updateMentionFromInput(a,c),80),aX.current=setTimeout(()=>aH.current.updateSlashFromInput(a,c),80)},[]),aZ=(0,f.useCallback)(a=>{let b=Q.current,c=X.current,d=b?.selectionStart??c.length,e=c.slice(0,d).lastIndexOf("@"),f=c.slice(0,e)+c.slice(d);W(f),aG.current.resetMention(),$.current.includes(a)||Z(b=>[...b,a]),setTimeout(()=>{Q.current?.focus(),Q.current?.setSelectionRange(e,e)},0)},[]),a$=(0,f.useCallback)(a=>{let b=Q.current,c=X.current,d=b?.selectionStart??c.length,e=c.slice(0,d).lastIndexOf("/"),f=c.slice(0,e)+c.slice(d);W(f),ak(a),aH.current.resetSlash(),setTimeout(()=>{Q.current?.focus(),Q.current?.setSelectionRange(e,e)},0)},[]),a_=(0,f.useRef)(aZ);a_.current=aZ;let a0=(0,f.useRef)(a$);a0.current=a$;let a1=(0,f.useCallback)(a=>{let b=aG.current,c=aH.current;if(null!==b.mentionQuery){if("Escape"===a.key){a.preventDefault(),b.resetMention();return}if("ArrowDown"===a.key)a.preventDefault(),b.navigateMention("down");else if("ArrowUp"===a.key)a.preventDefault(),b.navigateMention("up");else if("Enter"===a.key||"Tab"===a.key){if("Enter"===a.key&&(a.shiftKey||a.nativeEvent.isComposing))return;b.mentionResults.length>0&&(a.preventDefault(),a_.current(b.mentionResults[b.mentionIndex]))}return}if(null!==c.slashQuery){if("Escape"===a.key){a.preventDefault(),c.resetSlash();return}if("ArrowDown"===a.key)a.preventDefault(),c.navigateSlash("down");else if("ArrowUp"===a.key)a.preventDefault(),c.navigateSlash("up");else if("Enter"===a.key||"Tab"===a.key){if("Enter"===a.key&&(a.shiftKey||a.nativeEvent.isComposing))return;c.slashResults.length>0&&(a.preventDefault(),a0.current(c.slashResults[c.slashIndex]))}return}"Enter"===a.key&&!a.shiftKey&&!a.nativeEvent.isComposing&&!aL.isLoadingRef.current&&(X.current.trim()||aF.current.images.length>0)&&(a.preventDefault(),a.currentTarget.form?.requestSubmit())},[]),a2=(0,f.useCallback)(()=>{aL.isLoadingRef.current||(ax.current.resetSession(),W(""),Z(b?[b]:[]),aA.current.clearAttachments(),aF.current.clearImages(),aG.current.resetMention(),aH.current.resetSlash(),ak(null),an(null),ap.current=null,aa(!1),aL.firstMessageFired.current=!1,setTimeout(()=>Q.current?.focus(),0))},[b]),a3=(0,f.useCallback)(a=>{(a.dataTransfer.types.includes("text/mindos-path")||a.dataTransfer.types.includes("Files"))&&(a.preventDefault(),a.stopPropagation(),a.dataTransfer.dropEffect="copy",ac(!0))},[]),a4=(0,f.useCallback)(()=>ac(!1),[]),a5=(0,f.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),ac(!1);let b=a.dataTransfer.getData("text/mindos-path");if(b){let c=a.dataTransfer.getData("text/mindos-type"),d="directory"===c?b.replace(/\/?$/,"/"):b;$.current.includes(d)||Z(a=>[...a,d]);return}let c=a.dataTransfer.files;if(c.length>0){let b=Array.from(c).some(a=>a.type.startsWith("image/")),d=Array.from(c).filter(a=>!a.type.startsWith("image/"));(async()=>{try{if(b&&await aF.current.handleDrop(a),d.length>0){let a=new DataTransfer;d.forEach(b=>a.items.add(b)),await aA.current.pickFiles(a.files)}}catch(a){console.warn("[AskContent] Drop file processing failed:",a)}})()}},[]),a6=(0,f.useCallback)(a=>{let b=a.clipboardData?.items;!b||Array.from(b).some(a=>"file"===a.kind&&a.type.startsWith("image/"))&&(a.preventDefault(),aF.current.handlePaste(a))},[]),a7=(0,f.useCallback)(a=>{if(aL.isLoadingRef.current)return;let c=aw.sessions.find(b=>b.id===a)??null;ax.current.loadSession(a),aa(!1),W(""),Z(b?[b]:[]),aA.current.clearAttachments(),aF.current.clearImages(),aG.current.resetMention(),aH.current.resetSlash(),ak(null),an(c?.defaultAcpAgent??null),setTimeout(()=>Q.current?.focus(),0)},[b,aw.sessions]),a8=(0,f.useCallback)(()=>aa(a=>!a),[]),a9=(0,f.useMemo)(()=>({connecting:S.ask.connecting,thinking:S.ask.thinking,generating:S.ask.generating,reconnecting:aO>0?S.ask.reconnecting(aO,aP.current):void 0,copyMessage:S.ask.copyMessage}),[S,aO]),ba=(0,f.useCallback)(a=>{at(a),av(null)},[]);return(0,e.jsxs)("div",{className:"flex min-h-0 w-full flex-col h-full",children:[(0,e.jsx)(y.A,{isPanel:O||P,showHistory:_,onToggleHistory:a8,onReset:a2,isLoading:aM,maximized:J,onMaximize:K,askMode:P?void 0:L,onModeSwitch:P?void 0:M,onClose:P?void 0:I,onDockToPanel:J?N:void 0,sessions:aw.sessions,activeSessionId:aw.activeSessionId,onLoadSession:a7,onDeleteSession:aw.deleteSession,onRenameSession:aw.renameSession,onTogglePinSession:aw.togglePinSession,messages:aw.messages}),_&&(0,e.jsx)(x.A,{sessions:aw.sessions,activeSessionId:aw.activeSessionId,onLoad:a7,onDelete:aw.deleteSession,onRename:aw.renameSession,onTogglePin:aw.togglePinSession,onClearAll:aw.clearAllSessions,onClose:()=>aa(!1),onNewChat:a2}),!_&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex-1 min-h-0 flex flex-col",children:[!P&&(0,e.jsx)(u.A,{messages:aw.messages,isLoading:aM,loadingPhase:aN,emptyPrompt:S.ask.emptyPrompt,emptyHint:S.ask.emptyHint,suggestions:S.ask.suggestions,onSuggestionClick:W,labels:a9}),P&&(aw.messages.length>0||J)&&(0,e.jsx)(u.A,{messages:aw.messages,isLoading:aM,loadingPhase:aN,emptyPrompt:S.ask.emptyPrompt,emptyHint:S.ask.emptyHint,suggestions:J&&0===aw.messages.length?S.ask.suggestions:[],onSuggestionClick:W,labels:a9})]}),null!==aC.mentionQuery&&aC.mentionResults.length>0&&(0,e.jsx)("div",{className:"shrink-0 px-3 pb-1",children:(0,e.jsx)(v.A,{results:aC.mentionResults,selectedIndex:aC.mentionIndex,query:aC.mentionQuery??void 0,onSelect:aZ})}),null!==aD.slashQuery&&aD.slashResults.length>0&&(0,e.jsx)("div",{className:"shrink-0 px-3 pb-1",children:(0,e.jsx)(w.A,{results:aD.slashResults,selectedIndex:aD.slashIndex,query:aD.slashQuery??void 0,onSelect:a$})}),(0,e.jsx)("div",{className:(0,E.cn)("shrink-0",P?"px-2 pb-2 pt-0.5":"px-3 pb-2.5 pt-1"),children:(0,e.jsxs)("div",{className:(0,E.cn)("rounded-xl bg-muted/40 transition-all focus-within:bg-muted/60",ab&&"ring-2 ring-[var(--amber)] bg-[var(--amber-dim)]"),onDragOver:a3,onDragLeave:a4,onDrop:a5,children:[(Y.length>0||az.localAttachments.length>0||aB.images.length>0||aj||am||az.uploadError||aB.imageError)&&(0,e.jsxs)("div",{className:(0,E.cn)("px-3 pt-2.5 pb-1",O?"max-h-24 overflow-y-auto":"max-h-28 overflow-y-auto"),children:[(0,e.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[Y.map(a=>(0,e.jsx)(z.A,{path:a,variant:"kb",onRemove:()=>Z(b=>b.filter(b=>b!==a))},a)),az.localAttachments.map((a,b)=>(0,e.jsx)(z.A,{path:a.name,variant:"upload",status:a.status,error:a.error,truncatedInfo:a.truncatedInfo,onRemove:()=>az.removeAttachment(b)},`up-${a.name}-${b}`)),aB.images.map((a,b)=>(0,e.jsx)(z.A,{path:a.fileName||`Image ${b+1}`,variant:"image",imageData:a.data,imageMime:a.mimeType,onRemove:()=>aB.removeImage(b)},`img-${b}`)),aj&&(0,e.jsx)(z.A,{path:aj.name,variant:"skill",onRemove:()=>{ak(null),Q.current?.focus()}}),am&&(0,e.jsx)(z.A,{path:"object"==typeof am&&"name"in am?am.name:"Remote Agent",variant:"agent",onRemove:()=>{aS(null),Q.current?.focus()}})]}),aU&&(0,e.jsx)("div",{className:"mt-1 text-xs text-error",children:aU})]}),(0,e.jsxs)("form",{ref:aV,onSubmit:aQ,className:(0,E.cn)("flex items-end gap-1.5",P?"px-2 py-1.5":"px-3 py-2"),children:[(0,e.jsx)("div",{className:"relative shrink-0",children:(0,e.jsx)("button",{ref:af,type:"button",onClick:()=>ae(a=>!a),className:"p-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors",title:S.hints.attachFile,children:(0,e.jsx)(h.A,{size:15})})}),T&&ad&&ah&&(0,g.createPortal)((0,e.jsxs)("div",{ref:ag,className:"fixed py-1 rounded-xl border border-border/60 bg-card shadow-lg z-50 min-w-[150px] animate-in fade-in-0 slide-in-from-bottom-2 duration-150",style:{top:`${ah.top}px`,left:`${ah.left}px`,transform:"translateY(-100%)"},onClick:a=>a.stopPropagation(),children:[(0,e.jsxs)("button",{type:"button",className:"flex w-full items-center gap-2.5 px-3 py-2 text-xs hover:bg-muted transition-colors text-left rounded-lg",onClick:()=>{az.uploadInputRef.current?.click(),ae(!1)},children:[(0,e.jsx)(i.A,{size:12,className:"shrink-0 text-muted-foreground"}),S.ask.attachFileLabel]}),(0,e.jsxs)("button",{type:"button",className:"flex w-full items-center gap-2.5 px-3 py-2 text-xs hover:bg-muted transition-colors text-left rounded-lg",onClick:()=>{R.current?.click(),ae(!1)},children:[(0,e.jsx)(j.A,{size:12,className:"shrink-0 text-muted-foreground"}),S.ask.attachImageLabel]})]}),document.body),(0,e.jsx)("input",{ref:az.uploadInputRef,type:"file",className:"hidden",multiple:!0,accept:".txt,.md,.markdown,.csv,.json,.yaml,.yml,.xml,.html,.htm,.pdf,text/plain,text/markdown,text/csv,application/json,application/pdf",onChange:async a=>{let b=a.currentTarget;await az.pickFiles(b.files),b.value=""}}),(0,e.jsx)("input",{ref:R,type:"file",className:"hidden",multiple:!0,accept:"image/png,image/jpeg,image/gif,image/webp",onChange:async a=>{let b=a.currentTarget;await aB.handleFileSelect(b.files),b.value=""}}),(0,e.jsx)("textarea",{ref:a=>{Q.current=a},value:V,onChange:a=>aY(a.target.value,a.target.selectionStart??void 0),onKeyDown:a1,onPaste:a6,placeholder:S.ask.placeholder,rows:1,className:(0,E.cn)("min-w-0 flex-1 resize-none overflow-y-hidden bg-transparent py-2 leading-relaxed text-foreground placeholder:text-muted-foreground/50 outline-none focus-visible:ring-0",P?"text-xs":"text-sm")}),aM?(0,e.jsx)("button",{type:"button",onClick:aR,className:"p-2 rounded-xl transition-colors shrink-0 text-foreground bg-muted hover:bg-muted/80",title:"reconnecting"===aN?S.ask.cancelReconnect:S.ask.stopTitle,children:"reconnecting"===aN?(0,e.jsx)(k.A,{size:15}):(0,e.jsx)(l.A,{size:15})}):(0,e.jsx)("button",{type:"submit",title:aT?S.ask.uploadsProcessing??"Wait for uploaded files to finish processing before sending.":S.ask.send,disabled:aT||!V.trim()&&0===aB.images.length,className:"p-2 rounded-xl disabled:opacity-20 disabled:scale-95 disabled:cursor-not-allowed transition-all duration-150 shrink-0 bg-[var(--amber)] text-[var(--amber-foreground)] shadow-sm shadow-[var(--amber)]/15 hover:shadow-md hover:shadow-[var(--amber)]/20 active:scale-95",children:(0,e.jsx)(m.A,{size:14})})]}),(0,e.jsxs)("div",{className:(0,E.cn)("flex items-center justify-between border-t border-border/10",O?"px-2 pb-1.5 pt-1 gap-1":"px-3 pb-2 pt-1.5"),children:[(0,e.jsxs)("div",{className:(0,E.cn)("flex items-center flex-wrap",O?"gap-1":"gap-2"),children:[(0,e.jsx)(o.Ay,{mode:aq,onChange:ar,disabled:aM}),T&&aE.installedAgents.length>0&&(0,e.jsx)(A.A,{selectedAgent:am,onSelect:aS,installedAgents:aE.installedAgents,loading:aE.loading}),T&&(0,e.jsx)(B.A,{providerValue:as,onProviderChange:ba,modelValue:au,onModelChange:av,disabled:aM})]}),!O&&!P&&(0,e.jsxs)("span",{className:"hidden md:inline text-2xs text-muted-foreground/40 select-none shrink-0",children:[(0,e.jsx)("kbd",{className:"font-mono",children:"Enter"})," ",S.ask.send," \xb7 ",(0,e.jsx)("kbd",{className:"font-mono",children:"Shift+Enter"})," ",S.ask.newlineHint]})]})]})})]})]})}B=(G.then?(await G)():G)[0],new WeakMap,d()}catch(a){d(a)}})},66535:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AgentInspectorRenderer:()=>v});var d=c(48249),e=c(67484),f=c(19099),g=c(13576),h=c(22772),i=c(50567),j=c(59347),k=c(10316),l=c(76592),m=c(49681),n=c(8455),o=c(44218);function p(a){return/read|list|get|search/.test(a)?/search/.test(a)?"search":"read":/create/.test(a)?"create":/delete/.test(a)?"delete":/write|update|insert|append/.test(a)?"write":"other"}let q={read:{bg:"rgba(138,180,216,0.10)",text:"var(--tool-read)",border:"rgba(138,180,216,0.25)"},write:{bg:"rgba(200,135,58,0.10)",text:"var(--amber)",border:"rgba(200,135,58,0.25)"},create:{bg:"rgba(122,173,128,0.10)",text:"var(--success)",border:"rgba(122,173,128,0.25)"},delete:{bg:"rgba(200,80,80,0.10)",text:"var(--error)",border:"rgba(200,80,80,0.25)"},search:{bg:"rgba(200,160,216,0.10)",text:"var(--tool-search)",border:"rgba(200,160,216,0.25)"},other:{bg:"var(--muted)",text:"var(--muted-foreground)",border:"var(--border)"}};function r({kind:a,size:b=13}){return"read"===a?(0,d.jsx)(g.A,{size:b}):"write"===a?(0,d.jsx)(h.A,{size:b}):"create"===a?(0,d.jsx)(i.A,{size:b}):"delete"===a?(0,d.jsx)(j.A,{size:b}):"search"===a?(0,d.jsx)(k.A,{size:b}):(0,d.jsx)(l.A,{size:b})}function s(a){try{return new Date(a).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return a}}function t({op:a}){var b,c;let g,h,i,j,k=(0,f.useRouter)(),[l,t]=(0,e.useState)(!1),u=p(a.tool),v=q[u],w="string"==typeof(b=a.params).path?b.path:null,x=a.tool.replace("mindos_","");return(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,overflow:"hidden",marginBottom:8},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 14px",cursor:"pointer",userSelect:"none"},onClick:()=>t(a=>!a),children:[(0,d.jsxs)("span",{className:"font-display",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:999,fontSize:"0.68rem",fontWeight:600,background:v.bg,color:v.text,border:`1px solid ${v.border}`,flexShrink:0},children:[(0,d.jsx)(r,{kind:u,size:10}),u]}),(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.78rem",color:"var(--foreground)",fontWeight:600,flexShrink:0},children:x}),w&&(0,d.jsx)("span",{style:{fontSize:"0.72rem",color:"var(--amber)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"pointer"},onClick:a=>{a.stopPropagation(),k.push("/view/"+w.split("/").map(encodeURIComponent).join("/"))},title:w,className:"font-display",children:w}),(0,d.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[a.agentName&&(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.62rem",fontWeight:500,padding:"1px 6px",borderRadius:999,background:"var(--muted)",color:"var(--muted-foreground)",whiteSpace:"nowrap",maxWidth:120,overflow:"hidden",textOverflow:"ellipsis"},title:a.agentName,children:a.agentName.length>30?a.agentName.slice(0,30)+"...":a.agentName}),"ok"===a.result?(0,d.jsx)(m.A,{size:13,style:{color:"var(--success)"}}):(0,d.jsx)(n.A,{size:13,style:{color:"var(--error)"}}),(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.6},title:s(a.ts),children:(c=a.ts,h=Math.floor((g=Date.now()-new Date(c).getTime())/6e4),i=Math.floor(g/36e5),j=Math.floor(g/864e5),h<1?"just now":h<60?`${h}m ago`:i<24?`${i}h ago`:`${j}d ago`)}),(0,d.jsx)(o.A,{size:12,style:{color:"var(--muted-foreground)",transform:l?"rotate(180deg)":"none",transition:"transform .15s"}})]})]}),l&&(0,d.jsxs)("div",{style:{borderTop:"1px solid var(--border)",padding:"10px 14px",background:"var(--background)"},children:[(0,d.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:8*!!a.message},children:Object.entries(a.params).map(([a,b])=>(0,d.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"flex-start"},children:[(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.7,flexShrink:0,minWidth:80},children:a}),(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.72rem",color:"var(--foreground)",wordBreak:"break-all",lineHeight:1.5},children:function(a,b=120){let c="string"==typeof a?a:JSON.stringify(a);return c.length>b?c.slice(0,b)+"…":c}(b)})]},a))}),a.message&&(0,d.jsx)("div",{className:"font-display",style:{marginTop:6,padding:"5px 9px",borderRadius:5,fontSize:"0.72rem",background:"error"===a.result?"rgba(200,80,80,0.08)":"rgba(122,173,128,0.08)",color:"error"===a.result?"var(--error)":"var(--success)",border:`1px solid ${"error"===a.result?"rgba(200,80,80,0.2)":"rgba(122,173,128,0.2)"}`},children:a.message}),a.agentName&&(0,d.jsxs)("div",{className:"font-display",style:{marginTop:6,fontSize:"0.68rem",color:"var(--muted-foreground)"},children:["Agent: ",(0,d.jsx)("span",{style:{color:"var(--foreground)",fontWeight:500},children:a.agentName})]}),(0,d.jsx)("div",{className:"font-display",style:{marginTop:6,fontSize:"0.65rem",color:"var(--muted-foreground)",opacity:.5},children:s(a.ts)})]})]})}let u=["all","write","create","delete","read","search"];function v({content:a}){let[b,c]=(0,e.useState)("all"),f=(0,e.useMemo)(()=>(function(a){try{let b=JSON.parse(a);if(Array.isArray(b.events))return b.events.filter(a=>!!a?.tool&&!!a?.ts).sort((a,b)=>new Date(b.ts).getTime()-new Date(a.ts).getTime())}catch{}return(function(a){let b=[];for(let c of a.split("\n")){let a=c.trim();if(!(!a||a.startsWith("#")||a.startsWith("//")))try{let c=JSON.parse(a);c.tool&&c.ts&&b.push(c)}catch{}}return b})(a).sort((a,b)=>new Date(b.ts).getTime()-new Date(a.ts).getTime())})(a),[a]),g=(0,e.useMemo)(()=>"all"===b?f:f.filter(a=>p(a.tool)===b),[f,b]),h=(0,e.useMemo)(()=>{let a={all:f.length};for(let b of f){let c=p(b.tool);a[c]=(a[c]??0)+1}return a},[f]);return 0===f.length?(0,d.jsxs)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:12},children:[(0,d.jsx)(l.A,{size:28,style:{margin:"0 auto 10px",opacity:.3}}),(0,d.jsx)("p",{children:"No agent operations logged yet."}),(0,d.jsxs)("p",{style:{marginTop:6,opacity:.6,fontSize:11},children:["Agent writes appear here from ",(0,d.jsx)("code",{style:{background:"var(--muted)",padding:"1px 5px",borderRadius:4},children:".mindos/agent-audit-log.json"}),"."]})]}):(0,d.jsxs)("div",{style:{maxWidth:760,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:"1.2rem",flexWrap:"wrap"},children:u.map(a=>{let e=h[a]??0;if("all"!==a&&!e)return null;let f="all"!==a?q[a]:void 0,g=b===a;return(0,d.jsxs)("button",{onClick:()=>c(a),className:"font-display",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:999,fontSize:"0.7rem",cursor:"pointer",border:"none",background:g?f?.bg??"var(--accent)":"var(--muted)",color:g?f?.text??"var(--foreground)":"var(--muted-foreground)",outline:g?`1px solid ${f?.border??"var(--border)"}`:"none",transition:"all .1s"},children:["all"!==a&&(0,d.jsx)(r,{kind:a,size:10}),a," ",(0,d.jsxs)("span",{style:{opacity:.6},children:["(",e,")"]})]},a)})}),(0,d.jsx)("div",{children:g.map((a,b)=>(0,d.jsx)(t,{op:a},b))})]})}},66874:(a,b,c)=>{"use strict";c.r(b),c.d(b,{BacklinksRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call BacklinksRenderer() from the server but BacklinksRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/backlinks/BacklinksRenderer.tsx","BacklinksRenderer")},66913:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AgentInspectorRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call AgentInspectorRenderer() from the server but AgentInspectorRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/agent-inspector/AgentInspectorRenderer.tsx","AgentInspectorRenderer")},67809:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(67484);class f extends e.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,b){console.error("[ErrorBoundary]",a,b.componentStack)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,d.jsx)("div",{className:"flex items-center justify-center min-h-[50vh] px-4",children:(0,d.jsxs)("div",{className:"text-center max-w-md",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-foreground mb-2",children:"Something went wrong"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:this.state.error?.message||"An unexpected error occurred."}),(0,d.jsx)("button",{onClick:()=>this.setState({hasError:!1,error:void 0}),className:"px-4 py-2 text-sm rounded-lg border border-border hover:bg-muted transition-colors",children:"Try again"})]})}):this.props.children}}},68533:(a,b,c)=>{"use strict";c.d(b,{TooltipProvider:()=>e});var d=c(77943);(0,d.registerClientReference)(function(){throw Error("Attempted to call Tooltip() from the server but Tooltip is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/tooltip.tsx","Tooltip"),(0,d.registerClientReference)(function(){throw Error("Attempted to call TooltipTrigger() from the server but TooltipTrigger is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/tooltip.tsx","TooltipTrigger"),(0,d.registerClientReference)(function(){throw Error("Attempted to call TooltipContent() from the server but TooltipContent is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/tooltip.tsx","TooltipContent");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call TooltipProvider() from the server but TooltipProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/tooltip.tsx","TooltipProvider")},69593:(a,b,c)=>{"use strict";c.d(b,{Oo:()=>e,dB:()=>k});var d=c(67484);function e(a){let b=a.replace(/<(thinking|reasoning|scratchpad)>[\s\S]*?<\/\1>/gi,"");return(b=b.replace(/<(?:thinking|reasoning|scratchpad)>[\s\S]*$/gi,"")).trim()}let f=new Set(["create_file","write_file","batch_create_files","append_to_file","insert_after_heading","update_section","edit_lines","delete_file","rename_file","move_file","append_csv"]),g=new Set(["read_file","read_lines","search","list_files"]);function h(a,b){return b&&"object"==typeof b?"string"==typeof b.path?b.path:"string"==typeof b.from_path?b.from_path:"batch_create_files"===a&&Array.isArray(b.files)?b.files.map(a=>a.path??"").filter(Boolean).join(", "):"":""}async function i(a){try{let b=await fetch(`/api/file?path=${encodeURIComponent(a)}&op=read_file`);if(!b.ok)return"";return(await b.json()).content??""}catch{return""}}async function j(a,b,c,d){let j=a.getReader(),k=new TextDecoder,l="",m=[],n=new Map,o="",p=0,q=new Set;try{for(;!d?.aborted;){let{done:a,value:d}=await j.read();if(a)break;let u=(l+=k.decode(d,{stream:!0})).split("\n");for(let a of(l=u.pop()??"",u)){let d,j=a.trim();if(!j.startsWith("data:"))continue;let k=j.slice(5).trim();if(!k)continue;try{d=JSON.parse(k)}catch{continue}let l=d.type;switch(l){case"tool_start":{var r,s,t;let a=d.toolName,e=d.toolCallId,j=d.args;p++;let k=(r=l,s=a,t=j,"text_delta"===r?{stage:"analyzing"}:"tool_start"===r&&s?f.has(s)?{stage:"writing",detail:h(s,t)||void 0}:g.has(s)?{stage:"reading",detail:t&&"object"==typeof t&&"path"in t&&"string"==typeof t.path?t.path:void 0}:{stage:"analyzing"}:null);if(k&&b({stageHint:k}),f.has(a)){let d=h(a,j),f="update";"create_file"===a||"batch_create_files"===a?f="create":("delete_file"===a||"rename_file"===a||"move_file"===a)&&(f="unknown"),"update"===f&&d&&!q.has(d)&&(q.add(d),i(d).then(a=>{a&&c(d,a)})),n.set(e,{name:a,path:d,action:f}),b({currentTool:{name:a,path:d}})}break}case"tool_end":{let a=d.toolCallId,c=!!d.isError,e=n.get(a);if(e){if("batch_create_files"===e.name)for(let b of e.path.split(", ").filter(Boolean))m.push({action:e.action,path:b,toolCallId:a,ok:!c});else m.push({action:e.action,path:e.path,toolCallId:a,ok:!c});n.delete(a),b({changes:[...m],currentTool:null})}break}case"text_delta":o+=d.delta??"",b({stageHint:{stage:"analyzing"},summary:e(o)});break;case"error":throw Error(d.message||"AI organize failed")}}}}finally{j.releaseLock()}return{changes:m,summary:e(o),toolCallCount:p}}function k(){let[a,b]=(0,d.useState)("idle"),[c,e]=(0,d.useState)([]),[f,g]=(0,d.useState)(null),[h,i]=(0,d.useState)(null),[k,l]=(0,d.useState)(""),[m,n]=(0,d.useState)(null),[o,p]=(0,d.useState)(0),q=(0,d.useRef)(null),r=(0,d.useRef)(0),s=(0,d.useRef)(new Map),[t,u]=(0,d.useState)([]),[v,w]=(0,d.useState)("upload"),x=(0,d.useRef)(0),[y,z]=(0,d.useState)(0),A=(0,d.useCallback)(async(a,c,d="upload")=>{b("organizing"),e([]),g(null),i({stage:"connecting"}),l(""),n(null),p(0),u(a.map(a=>a.name)),w(d),x.current=Date.now(),z(0),s.current=new Map,r.current=Date.now();let f=new AbortController;q.current=f;let h=a.map(a=>({name:a.name,content:a.content.length>2e4?a.content.slice(0,2e4)+"\n\n[...truncated to first ~20000 chars]":a.content}));try{let a=await fetch("/api/ask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[{role:"user",content:c}],uploadedFiles:h,maxSteps:15,mode:"organize"}),signal:f.signal});if(!a.ok){let b=`Request failed (${a.status})`;try{let c=await a.json();"string"==typeof c?.error?b=c.error:"object"==typeof c?.error&&c.error?.message?b=c.error.message:c?.message&&(b=c.message)}catch{}throw Error(b)}if(!a.body)throw Error("No response body");let d=await j(a.body,a=>{r.current=Date.now(),a.changes&&e(a.changes),void 0!==a.currentTool&&g(a.currentTool),a.stageHint&&i(a.stageHint),void 0!==a.summary&&l(a.summary)},(a,b)=>{s.current.set(a,b)},f.signal);e(d.changes),l(d.summary),p(d.toolCallCount),g(null),z(Date.now()-x.current),b("done")}catch(a){"AbortError"===a.name?b("idle"):(n(a.message),b("error"))}finally{q.current=null}},[]),B=(0,d.useCallback)(()=>{q.current?.abort()},[]),C=(0,d.useCallback)(async a=>{let b=c.find(b=>b.path===a&&b.ok&&!b.undone);if(!b)return!1;try{if("create"===b.action){if(!(await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"delete_file",path:b.path})})).ok)return!1}else{if("update"!==b.action)return!1;let c=s.current.get(a);if(!c||!(await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"write_file",path:b.path,content:c})})).ok)return!1}return e(b=>b.map(b=>b.path===a&&b.ok&&!b.undone?{...b,undone:!0}:b)),!0}catch{return!1}},[c]),D=(0,d.useCallback)(async()=>{let a=c.filter(a=>a.ok&&!a.undone&&("create"===a.action||"update"===a.action&&s.current.has(a.path))),b=0;for(let c of a)try{if("create"===c.action)(await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"delete_file",path:c.path})})).ok&&b++;else if("update"===c.action){let a=s.current.get(c.path);a&&(await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"write_file",path:c.path,content:a})})).ok&&b++}}catch{}return b>0&&e(a=>a.map(a=>!a.ok||a.undone?a:"create"===a.action||"update"===a.action&&s.current.has(a.path)?{...a,undone:!0}:a)),b},[c]),E=(0,d.useCallback)(a=>{let b=c.find(b=>b.path===a&&b.ok&&!b.undone);return!!b&&("create"===b.action||"update"===b.action&&s.current.has(a))},[c]),F=c.some(a=>a.ok&&!a.undone&&("create"===a.action||"update"===a.action&&s.current.has(a.path))),G=(0,d.useCallback)(()=>{b("idle"),e([]),g(null),i(null),l(""),n(null),p(0),u([]),w("upload"),z(0),x.current=0,s.current=new Map,r.current=0},[]);return{phase:a,changes:c,currentTool:f,stageHint:h,summary:k,error:m,toolCallCount:o,sourceFileNames:t,source:v,durationMs:y,snapshots:s,start:A,abort:B,undoOne:C,undoAll:D,canUndo:E,hasAnyUndoable:F,reset:G}}},70137:(a,b,c)=>{"use strict";c.d(b,{default:()=>h});var d=c(48249),e=c(67484),f=c(46674),g=c(47223);function h(){let{t:a}=(0,g.Y)(),b=a.settings.update.updateToast,[c,h]=(0,e.useState)("hidden"),[i,j]=(0,e.useState)({});(0,e.useRef)(null);let[k,l]=(0,e.useState)(!1),m=(0,e.useRef)(new Set);(0,e.useRef)({});let n=(0,e.useCallback)(()=>{m.current.forEach(clearTimeout),m.current.clear()},[]),o=(0,e.useCallback)((a,b)=>{let c=setTimeout(()=>{m.current.delete(c),h(a)},b);m.current.add(c)},[]),p=(0,e.useCallback)(()=>{n(),window.dispatchEvent(new CustomEvent("mindos:open-settings",{detail:{tab:"update"}})),h("dismissing"),o("hidden",200)},[n,o]),q=(0,e.useCallback)(()=>{n(),i.desktop&&localStorage.setItem("mindos_update_skip_desktop",i.desktop.version),i.core&&localStorage.setItem("mindos_update_skip_core",i.core.version),h("dismissing"),o("hidden",200)},[i,n,o]);if(!k||"hidden"===c)return null;let r=!!(i.desktop&&i.core),s=r?b.titleMultiple:i.desktop?b.titleSingle(b.desktopLabel,i.desktop.version):i.core?b.titleSingle(b.coreLabel,i.core.version):"",t=r?`${b.desktopLabel} v${i.desktop.version} \u00B7 ${b.coreLabel} v${i.core.version}`:"";return(0,d.jsx)("div",{role:"status","aria-live":"polite",className:`
|
|
139
|
+
`,style:{width:E,minWidth:`${o}px`},role:"complementary","aria-label":"MindOS panel",children:[(0,e.jsx)(i.default,{fallback:(0,e.jsxs)("div",{className:"flex flex-col items-center justify-center h-full gap-3 px-6 text-center",children:[(0,e.jsx)(g.A,{size:20,className:"text-muted-foreground"}),(0,e.jsx)("p",{className:"text-sm text-muted-foreground",children:"MindOS encountered an error."}),(0,e.jsx)("button",{onClick:()=>window.location.reload(),className:"text-xs px-3 py-1.5 rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",children:"Reload page"})]}),children:(0,e.jsx)("div",{className:"flex min-h-0 w-full flex-1 flex-col overflow-hidden",children:(0,e.jsx)(h.A,{visible:a,variant:"panel",currentFile:a?c:void 0,initialMessage:d,initialAcpAgent:k,onFirstMessage:l,onClose:b,askMode:r,onModeSwitch:s,maximized:t,onMaximize:u})})}),(0,e.jsx)("div",{className:"absolute top-0 -left-[3px] w-[6px] h-full cursor-col-resize z-40 group hidden md:block",onMouseDown:D,children:(0,e.jsx)("div",{className:"absolute left-[2px] top-0 w-[1px] h-full opacity-0 group-hover:opacity-100 bg-[var(--amber)]/50 transition-opacity duration-150"})})]})}d()}catch(a){d(a)}})},63112:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ConfigRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call ConfigRenderer() from the server but ConfigRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/config/ConfigRenderer.tsx","ConfigRenderer")},63710:(a,b,c)=>{"use strict";c.d(b,{Aw:()=>i,Nh:()=>k,QL:()=>f,TM:()=>g,h0:()=>h,lL:()=>j});var d=c(99101);function e(a){let b=new Uint8Array(a),c=[];for(let a=0;a<b.length;a+=8192)c.push(String.fromCharCode(...b.subarray(a,a+8192)));return btoa(c.join(""))}async function f(a,b){let c=[],f=0;for(let b of a){if(b.size>0xa00000){f++;continue}try{if(b.name.toLowerCase().endsWith(".pdf")){let a=await b.arrayBuffer();c.push({name:b.name,content:e(a),encoding:"base64"})}else{let a=await b.text();c.push({name:b.name,content:a})}}catch{}}if(0===c.length)return void(f>0?d.oR.error(b.inbox.tooLarge(f),4e3):a.length>0&&d.oR.error(b.inbox.saveFailed,4e3));try{var g;let a=await fetch("/api/inbox",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:c})});if(!a.ok){let c=await a.json().catch(()=>({}));console.error("[QuickDrop] Save failed:",c.error),d.oR.error(b.inbox.saveFailed,4e3);return}let e=await a.json(),h=e.saved?.length??0,i=e.skipped?.length??0;g=f,h>0&&g>0&&0===i?d.oR.success(b.inbox.savedWithOversized(h,g),4e3):h>0&&i+g>0?d.oR.success(b.inbox.savedWithSkipped(h,i+g),4e3):h>0?d.oR.success(b.inbox.savedToast(h),3e3):(g>0&&d.oR.error(b.inbox.tooLarge(g),4e3),i>0&&d.oR.error(b.inbox.savedWithSkipped(0,i),4e3),0===g&&0===i&&d.oR.error(b.inbox.saveFailed,4e3)),window.dispatchEvent(new Event("mindos:files-changed")),window.dispatchEvent(new Event("mindos:inbox-updated"))}catch(a){console.error("[QuickDrop] Network error:",a),d.oR.error(b.inbox.saveFailed,4e3)}}async function g(a,b){try{let c=await fetch("/api/inbox/clip",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:a})}),e=await c.json();if(!c.ok){let a=e.error||b.inbox.clipFailed;return d.oR.error(a,4e3),{ok:!1}}return d.oR.success(b.inbox.clipSuccess(e.title||a),3e3),window.dispatchEvent(new Event("mindos:files-changed")),window.dispatchEvent(new Event("mindos:inbox-updated")),{ok:!0,title:e.title}}catch(a){return console.error("[ClipURL] Network error:",a),d.oR.error(b.inbox.clipFailed,4e3),{ok:!1}}}function h(a){let b=a.trim();if(!b.startsWith("http://")&&!b.startsWith("https://"))return!1;try{return new URL(b),!0}catch{return!1}}function i(a){if(a.dataTransfer?.files&&a.dataTransfer.files.length>0)return null;let b=a.dataTransfer?.getData("text/uri-list");if(b){let a=b.split(/[\r\n]+/).find(a=>!a.startsWith("#")&&a.trim().length>0);if(a&&h(a))return a.trim()}let c=a.dataTransfer?.getData("text/plain");return c&&h(c)?c.trim():null}function j(a){let b=a.dataTransfer?.types??[];return!b.includes("Files")&&(b.includes("text/uri-list")||b.includes("text/plain"))}async function k(a,b,c){let f=[],g=0,h=new Set(["pdf","png","jpg","jpeg","gif","webp","bmp","ico","mp3","wav","m4a","ogg","flac","aac","mp4","webm","mov","mkv"]);for(let b of a){if(b.size>0xa00000){g++;continue}try{let a=(b.name.split(".").pop()??"").toLowerCase();if(h.has(a)){let a=await b.arrayBuffer();f.push({name:b.name,content:e(a),encoding:"base64"})}else{let a=await b.text();f.push({name:b.name,content:a})}}catch{}}if(0===f.length)return void(g>0?d.oR.error(c.inbox.tooLarge(g),4e3):a.length>0&&d.oR.error(c.inbox.saveFailed,4e3));let i=b.split("/").pop()||b;try{let a=await fetch("/api/file/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({files:f,targetSpace:b,organize:!1,conflict:"rename"})});if(!a.ok){let b=await a.json().catch(()=>({}));console.error("[TreeDrop] Save failed:",b.error),d.oR.error(c.inbox.saveFailed,4e3);return}let e=await a.json(),h=e.created?.length??0,j=e.skipped?.length??0;h>0&&j+g>0?d.oR.success(c.inbox.savedWithSkipped(h,j+g),4e3):h>0?d.oR.success(c.inbox.savedToDir(h,i),3e3):(g>0&&d.oR.error(c.inbox.tooLarge(g),4e3),j>0&&d.oR.error(c.inbox.savedWithSkipped(0,j),4e3)),window.dispatchEvent(new Event("mindos:files-changed"))}catch(a){console.error("[TreeDrop] Network error:",a),d.oR.error(c.inbox.saveFailed,4e3)}}},63956:(a,b,c)=>{"use strict";c.r(b),c.d(b,{VideoRenderer:()=>f});var d=c(48249),e=c(67484);function f({filePath:a}){let b=`/api/file/raw?path=${encodeURIComponent(a)}`,c=a.split("/").pop()??"video",f=c.split(".").pop()?.toLowerCase()??"",[g,h]=(0,e.useState)(!1),[i,j]=(0,e.useState)(0),[k,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(null),o=(0,e.useRef)(null),p=(0,e.useCallback)(()=>{let a=o.current;a&&n({w:a.videoWidth,h:a.videoHeight})},[]),q=(0,e.useCallback)(()=>{h(!1),j(a=>a+1)},[]);return(0,d.jsxs)("div",{className:"w-full flex flex-col gap-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2 border-b border-border text-xs text-[var(--text-secondary)]",children:[m&&(0,d.jsxs)("span",{children:[m.w," x ",m.h]}),null!==k&&(0,d.jsx)("span",{children:k<1024?`${k} B`:k<1048576?`${(k/1024).toFixed(1)} KB`:`${(k/1048576).toFixed(1)} MB`}),(0,d.jsx)("span",{className:"uppercase opacity-60",children:f})]}),(0,d.jsx)("div",{className:"flex-1 min-h-[50vh] flex items-center justify-center bg-black rounded-b-lg overflow-hidden",children:g?(0,d.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,d.jsx)("span",{className:"text-sm text-neutral-400",children:"Failed to load video"}),(0,d.jsx)("button",{onClick:q,className:"text-xs px-3 py-1.5 rounded-md bg-neutral-800 hover:bg-neutral-700 text-neutral-200 transition-colors",children:"Retry"})]}):(0,d.jsx)("video",{ref:o,controls:!0,preload:"metadata",className:"max-w-full max-h-[70vh]",onLoadedMetadata:p,onError:()=>h(!0),children:(0,d.jsx)("source",{src:b})},i)})]})}},65141:(a,b,c)=>{"use strict";c.d(b,{b:()=>g});var d=c(67484),e=c(34139),f=c(4615);function g(){let[a,b]=(0,d.useState)("files"),[c,g]=(0,d.useState)(null),[h,i]=(0,d.useState)(!1),[j,k]=(0,d.useState)(!1),l=(0,d.useCallback)(a=>g(a),[]),m=(0,d.useCallback)(a=>{try{localStorage.setItem("left-panel-width",String(a))}catch{}},[]),n=(0,d.useCallback)(()=>i(a=>!a),[]),o=(0,d.useCallback)(a=>{k(a);try{localStorage.setItem("rail-expanded",String(a))}catch{}},[]),p=j?f.we:f.SG,q=c??(a?e.iP[a]:280);return{activePanel:a,setActivePanel:b,panelWidth:c,panelMaximized:h,railExpanded:j,railWidth:p,panelOpen:null!==a,effectivePanelWidth:q,handlePanelWidthChange:l,handlePanelWidthCommit:m,handlePanelMaximize:n,handleExpandedChange:o}}},65965:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A:()=>H});var e=c(48249),f=c(67484),g=c(74429),h=c(24520),i=c(80600),j=c(33407),k=c(46674),l=c(51161),m=c(74118),n=c(47223),o=c(38957),p=c(54461),q=c(41297),r=c(45108),s=c(15330),t=c(55232),u=c(74356),v=c(6597),w=c(82110),x=c(42529),y=c(41739),z=c(33827),A=c(74190),B=c(4452),C=c(93574),D=c(49223),E=c(33191),F=c(17009),G=a([B]);function H({visible:a,currentFile:b,initialMessage:c,initialAcpAgent:d,onFirstMessage:G,variant:H,onClose:I,maximized:J,onMaximize:K,askMode:L,onModeSwitch:M,onDockToPanel:N}){let O="panel"===H,P="home"===H,Q=(0,f.useRef)(null),R=(0,f.useRef)(null),{t:S}=(0,n.Y)(),[T,U]=(0,f.useState)(!1),[V,W]=(0,f.useState)(""),X=(0,f.useRef)("");X.current=V;let[Y,Z]=(0,f.useState)([]),$=(0,f.useRef)(Y);$.current=Y;let[_,aa]=(0,f.useState)(!1),[ab,ac]=(0,f.useState)(!1),[ad,ae]=(0,f.useState)(!1),af=(0,f.useRef)(null),ag=(0,f.useRef)(null),[ah,ai]=(0,f.useState)(null),[aj,ak]=(0,f.useState)(null),al=(0,f.useRef)(aj);al.current=aj;let[am,an]=(0,f.useState)(null),ao=(0,f.useRef)(am),ap=(0,f.useRef)(null);ao.current=am;let[aq,ar]=(0,f.useState)("agent"),[as,at]=(0,f.useState)(null),[au,av]=(0,f.useState)(null),aw=(0,p.X)(b),ax=(0,f.useRef)(aw);ax.current=aw;let ay=(0,f.useMemo)(()=>({unsupportedType:S.fileImport?.unsupported}),[S]),az=(0,q.l)(ay),aA=(0,f.useRef)(az);aA.current=az;let aB=(0,r.u)(),aC=(0,s.Q)(),aD=(0,t.C)(),aE=(0,F.z)(),aF=(0,f.useRef)(aB);aF.current=aB;let aG=(0,f.useRef)(aC);aG.current=aC;let aH=(0,f.useRef)(aD);aH.current=aD;let aI=(0,f.useCallback)(()=>{W(""),ak(null),Z(b?[b]:[]),aA.current.clearAttachments()},[b]),aJ=(0,f.useCallback)(a=>{W(a.content),a.images&&a.images.length>0&&aF.current.clearImages(),a.attachedFiles&&Z(a.attachedFiles),a.skillName&&aH.current.resetSlash(),an((0,D.EI)(a)),setTimeout(()=>Q.current?.focus(),50)},[]),aK=(0,f.useRef)({inputValueRef:X,mentionRef:aG,slashRef:aH,imageUploadRef:aF,sessionRef:ax,uploadRef:aA,selectedSkillRef:al,selectedAcpAgentRef:ao,attachedFilesRef:$}),aL=(0,C.t)({currentFile:b,chatMode:aq,providerOverride:as,modelOverride:au,onFirstMessage:G,refs:aK.current,errorLabels:{noResponse:S.ask.errorNoResponse,stopped:S.ask.stopped},resetInputState:aI,onRestoreInput:aJ}),{isLoading:aM,loadingPhase:aN,reconnectAttempt:aO,reconnectMaxRef:aP}=aL,aQ=aL.submit,aR=aL.stop,aS=(0,f.useCallback)(a=>{an(a),aw.setSessionDefaultAcpAgent(a)},[aw]),aT=az.localAttachments.some(a=>"loading"===a.status),aU=az.uploadError||aB.imageError||(aT?S.ask.uploadsProcessing??"Wait for uploaded files to finish processing before sending.":"");(0,f.useRef)(!1),(0,f.useRef)(b),(0,f.useRef)(aw.clearPersistTimer).current=aw.clearPersistTimer;let aV=(0,f.useRef)(null),aW=(0,f.useRef)(null),aX=(0,f.useRef)(null),aY=(0,f.useCallback)((a,b)=>{W(a);let c=b??a.length;aW.current&&clearTimeout(aW.current),aX.current&&clearTimeout(aX.current),aW.current=setTimeout(()=>aG.current.updateMentionFromInput(a,c),80),aX.current=setTimeout(()=>aH.current.updateSlashFromInput(a,c),80)},[]),aZ=(0,f.useCallback)(a=>{let b=Q.current,c=X.current,d=b?.selectionStart??c.length,e=c.slice(0,d).lastIndexOf("@"),f=c.slice(0,e)+c.slice(d);W(f),aG.current.resetMention(),$.current.includes(a)||Z(b=>[...b,a]),setTimeout(()=>{Q.current?.focus(),Q.current?.setSelectionRange(e,e)},0)},[]),a$=(0,f.useCallback)(a=>{let b=Q.current,c=X.current,d=b?.selectionStart??c.length,e=c.slice(0,d).lastIndexOf("/"),f=c.slice(0,e)+c.slice(d);W(f),ak(a),aH.current.resetSlash(),setTimeout(()=>{Q.current?.focus(),Q.current?.setSelectionRange(e,e)},0)},[]),a_=(0,f.useRef)(aZ);a_.current=aZ;let a0=(0,f.useRef)(a$);a0.current=a$;let a1=(0,f.useCallback)(a=>{let b=aG.current,c=aH.current;if(null!==b.mentionQuery){if("Escape"===a.key){a.preventDefault(),b.resetMention();return}if("ArrowDown"===a.key)a.preventDefault(),b.navigateMention("down");else if("ArrowUp"===a.key)a.preventDefault(),b.navigateMention("up");else if("Enter"===a.key||"Tab"===a.key){if("Enter"===a.key&&(a.shiftKey||a.nativeEvent.isComposing))return;b.mentionResults.length>0&&(a.preventDefault(),a_.current(b.mentionResults[b.mentionIndex]))}return}if(null!==c.slashQuery){if("Escape"===a.key){a.preventDefault(),c.resetSlash();return}if("ArrowDown"===a.key)a.preventDefault(),c.navigateSlash("down");else if("ArrowUp"===a.key)a.preventDefault(),c.navigateSlash("up");else if("Enter"===a.key||"Tab"===a.key){if("Enter"===a.key&&(a.shiftKey||a.nativeEvent.isComposing))return;c.slashResults.length>0&&(a.preventDefault(),a0.current(c.slashResults[c.slashIndex]))}return}"Enter"===a.key&&!a.shiftKey&&!a.nativeEvent.isComposing&&!aL.isLoadingRef.current&&(X.current.trim()||aF.current.images.length>0)&&(a.preventDefault(),a.currentTarget.form?.requestSubmit())},[]),a2=(0,f.useCallback)(()=>{aL.isLoadingRef.current||(ax.current.resetSession(),W(""),Z(b?[b]:[]),aA.current.clearAttachments(),aF.current.clearImages(),aG.current.resetMention(),aH.current.resetSlash(),ak(null),an(null),ap.current=null,aa(!1),aL.firstMessageFired.current=!1,setTimeout(()=>Q.current?.focus(),0))},[b]),a3=(0,f.useCallback)(a=>{(a.dataTransfer.types.includes("text/mindos-path")||a.dataTransfer.types.includes("Files"))&&(a.preventDefault(),a.stopPropagation(),a.dataTransfer.dropEffect="copy",ac(!0))},[]),a4=(0,f.useCallback)(()=>ac(!1),[]),a5=(0,f.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),ac(!1);let b=a.dataTransfer.getData("text/mindos-path");if(b){let c=a.dataTransfer.getData("text/mindos-type"),d="directory"===c?b.replace(/\/?$/,"/"):b;$.current.includes(d)||Z(a=>[...a,d]);return}let c=a.dataTransfer.files;if(c.length>0){let b=Array.from(c).some(a=>a.type.startsWith("image/")),d=Array.from(c).filter(a=>!a.type.startsWith("image/"));(async()=>{try{if(b&&await aF.current.handleDrop(a),d.length>0){let a=new DataTransfer;d.forEach(b=>a.items.add(b)),await aA.current.pickFiles(a.files)}}catch(a){console.warn("[AskContent] Drop file processing failed:",a)}})()}},[]),a6=(0,f.useCallback)(a=>{let b=a.clipboardData?.items;!b||Array.from(b).some(a=>"file"===a.kind&&a.type.startsWith("image/"))&&(a.preventDefault(),aF.current.handlePaste(a))},[]),a7=(0,f.useCallback)(a=>{if(aL.isLoadingRef.current)return;let c=aw.sessions.find(b=>b.id===a)??null;ax.current.loadSession(a),aa(!1),W(""),Z(b?[b]:[]),aA.current.clearAttachments(),aF.current.clearImages(),aG.current.resetMention(),aH.current.resetSlash(),ak(null),an(c?.defaultAcpAgent??null),setTimeout(()=>Q.current?.focus(),0)},[b,aw.sessions]),a8=(0,f.useCallback)(()=>aa(a=>!a),[]),a9=(0,f.useMemo)(()=>({connecting:S.ask.connecting,thinking:S.ask.thinking,generating:S.ask.generating,reconnecting:aO>0?S.ask.reconnecting(aO,aP.current):void 0,copyMessage:S.ask.copyMessage}),[S,aO]),ba=(0,f.useCallback)(a=>{at(a),av(null)},[]);return(0,e.jsxs)("div",{className:"flex min-h-0 w-full flex-col h-full",children:[(0,e.jsx)(y.A,{isPanel:O||P,showHistory:_,onToggleHistory:a8,onReset:a2,isLoading:aM,maximized:J,onMaximize:K,askMode:P?void 0:L,onModeSwitch:P?void 0:M,onClose:P?void 0:I,onDockToPanel:J?N:void 0,sessions:aw.sessions,activeSessionId:aw.activeSessionId,onLoadSession:a7,onDeleteSession:aw.deleteSession,onRenameSession:aw.renameSession,onTogglePinSession:aw.togglePinSession,messages:aw.messages}),_&&(0,e.jsx)(x.A,{sessions:aw.sessions,activeSessionId:aw.activeSessionId,onLoad:a7,onDelete:aw.deleteSession,onRename:aw.renameSession,onTogglePin:aw.togglePinSession,onClearAll:aw.clearAllSessions,onClose:()=>aa(!1),onNewChat:a2}),!_&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex-1 min-h-0 flex flex-col",children:[!P&&(0,e.jsx)(u.A,{messages:aw.messages,isLoading:aM,loadingPhase:aN,emptyPrompt:S.ask.emptyPrompt,emptyHint:S.ask.emptyHint,suggestions:S.ask.suggestions,onSuggestionClick:W,labels:a9}),P&&(aw.messages.length>0||J)&&(0,e.jsx)(u.A,{messages:aw.messages,isLoading:aM,loadingPhase:aN,emptyPrompt:S.ask.emptyPrompt,emptyHint:S.ask.emptyHint,suggestions:J&&0===aw.messages.length?S.ask.suggestions:[],onSuggestionClick:W,labels:a9})]}),null!==aC.mentionQuery&&aC.mentionResults.length>0&&(0,e.jsx)("div",{className:"shrink-0 px-3 pb-1",children:(0,e.jsx)(v.A,{results:aC.mentionResults,selectedIndex:aC.mentionIndex,query:aC.mentionQuery??void 0,onSelect:aZ})}),null!==aD.slashQuery&&aD.slashResults.length>0&&(0,e.jsx)("div",{className:"shrink-0 px-3 pb-1",children:(0,e.jsx)(w.A,{results:aD.slashResults,selectedIndex:aD.slashIndex,query:aD.slashQuery??void 0,onSelect:a$})}),(0,e.jsx)("div",{className:(0,E.cn)("shrink-0",P?"px-2 pb-2 pt-0.5":"px-3 pb-2.5 pt-1"),children:(0,e.jsxs)("div",{className:(0,E.cn)("rounded-xl bg-muted/40 transition-all focus-within:bg-muted/60",ab&&"ring-2 ring-[var(--amber)] bg-[var(--amber-dim)]"),onDragOver:a3,onDragLeave:a4,onDrop:a5,children:[(Y.length>0||az.localAttachments.length>0||aB.images.length>0||aj||am||az.uploadError||aB.imageError)&&(0,e.jsxs)("div",{className:(0,E.cn)("px-3 pt-2.5 pb-1",O?"max-h-24 overflow-y-auto":"max-h-28 overflow-y-auto"),children:[(0,e.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[Y.map(a=>(0,e.jsx)(z.A,{path:a,variant:"kb",onRemove:()=>Z(b=>b.filter(b=>b!==a))},a)),az.localAttachments.map((a,b)=>(0,e.jsx)(z.A,{path:a.name,variant:"upload",status:a.status,error:a.error,truncatedInfo:a.truncatedInfo,onRemove:()=>az.removeAttachment(b)},`up-${a.name}-${b}`)),aB.images.map((a,b)=>(0,e.jsx)(z.A,{path:a.fileName||`Image ${b+1}`,variant:"image",imageData:a.data,imageMime:a.mimeType,onRemove:()=>aB.removeImage(b)},`img-${b}`)),aj&&(0,e.jsx)(z.A,{path:aj.name,variant:"skill",onRemove:()=>{ak(null),Q.current?.focus()}}),am&&(0,e.jsx)(z.A,{path:"object"==typeof am&&"name"in am?am.name:"Remote Agent",variant:"agent",onRemove:()=>{aS(null),Q.current?.focus()}})]}),aU&&(0,e.jsx)("div",{className:"mt-1 text-xs text-error",children:aU})]}),(0,e.jsxs)("form",{ref:aV,onSubmit:aQ,className:(0,E.cn)("flex items-end gap-1.5",P?"px-2 py-1.5":"px-3 py-2"),children:[(0,e.jsx)("div",{className:"relative shrink-0",children:(0,e.jsx)("button",{ref:af,type:"button",onClick:()=>ae(a=>!a),className:"p-2 rounded-lg text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors",title:S.hints.attachFile,children:(0,e.jsx)(h.A,{size:15})})}),T&&ad&&ah&&(0,g.createPortal)((0,e.jsxs)("div",{ref:ag,className:"fixed py-1 rounded-xl border border-border/60 bg-card shadow-lg z-50 min-w-[150px] animate-in fade-in-0 slide-in-from-bottom-2 duration-150",style:{top:`${ah.top}px`,left:`${ah.left}px`,transform:"translateY(-100%)"},onClick:a=>a.stopPropagation(),children:[(0,e.jsxs)("button",{type:"button",className:"flex w-full items-center gap-2.5 px-3 py-2 text-xs hover:bg-muted transition-colors text-left rounded-lg",onClick:()=>{az.uploadInputRef.current?.click(),ae(!1)},children:[(0,e.jsx)(i.A,{size:12,className:"shrink-0 text-muted-foreground"}),S.ask.attachFileLabel]}),(0,e.jsxs)("button",{type:"button",className:"flex w-full items-center gap-2.5 px-3 py-2 text-xs hover:bg-muted transition-colors text-left rounded-lg",onClick:()=>{R.current?.click(),ae(!1)},children:[(0,e.jsx)(j.A,{size:12,className:"shrink-0 text-muted-foreground"}),S.ask.attachImageLabel]})]}),document.body),(0,e.jsx)("input",{ref:az.uploadInputRef,type:"file",className:"hidden",multiple:!0,accept:".txt,.md,.markdown,.csv,.json,.yaml,.yml,.xml,.html,.htm,.pdf,text/plain,text/markdown,text/csv,application/json,application/pdf",onChange:async a=>{let b=a.currentTarget;await az.pickFiles(b.files),b.value=""}}),(0,e.jsx)("input",{ref:R,type:"file",className:"hidden",multiple:!0,accept:"image/png,image/jpeg,image/gif,image/webp",onChange:async a=>{let b=a.currentTarget;await aB.handleFileSelect(b.files),b.value=""}}),(0,e.jsx)("textarea",{ref:a=>{Q.current=a},value:V,onChange:a=>aY(a.target.value,a.target.selectionStart??void 0),onKeyDown:a1,onPaste:a6,placeholder:S.ask.placeholder,rows:1,className:(0,E.cn)("min-w-0 flex-1 resize-none overflow-y-hidden bg-transparent py-2 leading-relaxed text-foreground placeholder:text-muted-foreground/50 outline-none focus-visible:ring-0",P?"text-xs":"text-sm")}),aM?(0,e.jsx)("button",{type:"button",onClick:aR,className:"p-2 rounded-xl transition-colors shrink-0 text-foreground bg-muted hover:bg-muted/80",title:"reconnecting"===aN?S.ask.cancelReconnect:S.ask.stopTitle,children:"reconnecting"===aN?(0,e.jsx)(k.A,{size:15}):(0,e.jsx)(l.A,{size:15})}):(0,e.jsx)("button",{type:"submit",title:aT?S.ask.uploadsProcessing??"Wait for uploaded files to finish processing before sending.":S.ask.send,disabled:aT||!V.trim()&&0===aB.images.length,className:"p-2 rounded-xl disabled:opacity-20 disabled:scale-95 disabled:cursor-not-allowed transition-all duration-150 shrink-0 bg-[var(--amber)] text-[var(--amber-foreground)] shadow-sm shadow-[var(--amber)]/15 hover:shadow-md hover:shadow-[var(--amber)]/20 active:scale-95",children:(0,e.jsx)(m.A,{size:14})})]}),(0,e.jsxs)("div",{className:(0,E.cn)("flex items-center justify-between border-t border-border/10",O?"px-2 pb-1.5 pt-1 gap-1":"px-3 pb-2 pt-1.5"),children:[(0,e.jsxs)("div",{className:(0,E.cn)("flex items-center flex-wrap",O?"gap-1":"gap-2"),children:[(0,e.jsx)(o.Ay,{mode:aq,onChange:ar,disabled:aM}),T&&aE.installedAgents.length>0&&(0,e.jsx)(A.A,{selectedAgent:am,onSelect:aS,installedAgents:aE.installedAgents,loading:aE.loading}),T&&(0,e.jsx)(B.A,{providerValue:as,onProviderChange:ba,modelValue:au,onModelChange:av,disabled:aM})]}),!O&&!P&&(0,e.jsxs)("span",{className:"hidden md:inline text-2xs text-muted-foreground/40 select-none shrink-0",children:[(0,e.jsx)("kbd",{className:"font-mono",children:"Enter"})," ",S.ask.send," \xb7 ",(0,e.jsx)("kbd",{className:"font-mono",children:"Shift+Enter"})," ",S.ask.newlineHint]})]})]})})]})]})}B=(G.then?(await G)():G)[0],new WeakMap,d()}catch(a){d(a)}})},66535:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AgentInspectorRenderer:()=>v});var d=c(48249),e=c(67484),f=c(19099),g=c(13576),h=c(22772),i=c(50567),j=c(59347),k=c(10316),l=c(76592),m=c(49681),n=c(8455),o=c(44218);function p(a){return/read|list|get|search/.test(a)?/search/.test(a)?"search":"read":/create/.test(a)?"create":/delete/.test(a)?"delete":/write|update|insert|append/.test(a)?"write":"other"}let q={read:{bg:"rgba(138,180,216,0.10)",text:"var(--tool-read)",border:"rgba(138,180,216,0.25)"},write:{bg:"rgba(200,135,58,0.10)",text:"var(--amber)",border:"rgba(200,135,58,0.25)"},create:{bg:"rgba(122,173,128,0.10)",text:"var(--success)",border:"rgba(122,173,128,0.25)"},delete:{bg:"rgba(200,80,80,0.10)",text:"var(--error)",border:"rgba(200,80,80,0.25)"},search:{bg:"rgba(200,160,216,0.10)",text:"var(--tool-search)",border:"rgba(200,160,216,0.25)"},other:{bg:"var(--muted)",text:"var(--muted-foreground)",border:"var(--border)"}};function r({kind:a,size:b=13}){return"read"===a?(0,d.jsx)(g.A,{size:b}):"write"===a?(0,d.jsx)(h.A,{size:b}):"create"===a?(0,d.jsx)(i.A,{size:b}):"delete"===a?(0,d.jsx)(j.A,{size:b}):"search"===a?(0,d.jsx)(k.A,{size:b}):(0,d.jsx)(l.A,{size:b})}function s(a){try{return new Date(a).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"})}catch{return a}}function t({op:a}){var b,c;let g,h,i,j,k=(0,f.useRouter)(),[l,t]=(0,e.useState)(!1),u=p(a.tool),v=q[u],w="string"==typeof(b=a.params).path?b.path:null,x=a.tool.replace("mindos_","");return(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,overflow:"hidden",marginBottom:8},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:10,padding:"10px 14px",cursor:"pointer",userSelect:"none"},onClick:()=>t(a=>!a),children:[(0,d.jsxs)("span",{className:"font-display",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"2px 8px",borderRadius:999,fontSize:"0.68rem",fontWeight:600,background:v.bg,color:v.text,border:`1px solid ${v.border}`,flexShrink:0},children:[(0,d.jsx)(r,{kind:u,size:10}),u]}),(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.78rem",color:"var(--foreground)",fontWeight:600,flexShrink:0},children:x}),w&&(0,d.jsx)("span",{style:{fontSize:"0.72rem",color:"var(--amber)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",cursor:"pointer"},onClick:a=>{a.stopPropagation(),k.push("/view/"+w.split("/").map(encodeURIComponent).join("/"))},title:w,className:"font-display",children:w}),(0,d.jsxs)("div",{style:{marginLeft:"auto",display:"flex",alignItems:"center",gap:8,flexShrink:0},children:[a.agentName&&(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.62rem",fontWeight:500,padding:"1px 6px",borderRadius:999,background:"var(--muted)",color:"var(--muted-foreground)",whiteSpace:"nowrap",maxWidth:120,overflow:"hidden",textOverflow:"ellipsis"},title:a.agentName,children:a.agentName.length>30?a.agentName.slice(0,30)+"...":a.agentName}),"ok"===a.result?(0,d.jsx)(m.A,{size:13,style:{color:"var(--success)"}}):(0,d.jsx)(n.A,{size:13,style:{color:"var(--error)"}}),(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.6},title:s(a.ts),children:(c=a.ts,h=Math.floor((g=Date.now()-new Date(c).getTime())/6e4),i=Math.floor(g/36e5),j=Math.floor(g/864e5),h<1?"just now":h<60?`${h}m ago`:i<24?`${i}h ago`:`${j}d ago`)}),(0,d.jsx)(o.A,{size:12,style:{color:"var(--muted-foreground)",transform:l?"rotate(180deg)":"none",transition:"transform .15s"}})]})]}),l&&(0,d.jsxs)("div",{style:{borderTop:"1px solid var(--border)",padding:"10px 14px",background:"var(--background)"},children:[(0,d.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:4,marginBottom:8*!!a.message},children:Object.entries(a.params).map(([a,b])=>(0,d.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"flex-start"},children:[(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.7,flexShrink:0,minWidth:80},children:a}),(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.72rem",color:"var(--foreground)",wordBreak:"break-all",lineHeight:1.5},children:function(a,b=120){let c="string"==typeof a?a:JSON.stringify(a);return c.length>b?c.slice(0,b)+"…":c}(b)})]},a))}),a.message&&(0,d.jsx)("div",{className:"font-display",style:{marginTop:6,padding:"5px 9px",borderRadius:5,fontSize:"0.72rem",background:"error"===a.result?"rgba(200,80,80,0.08)":"rgba(122,173,128,0.08)",color:"error"===a.result?"var(--error)":"var(--success)",border:`1px solid ${"error"===a.result?"rgba(200,80,80,0.2)":"rgba(122,173,128,0.2)"}`},children:a.message}),a.agentName&&(0,d.jsxs)("div",{className:"font-display",style:{marginTop:6,fontSize:"0.68rem",color:"var(--muted-foreground)"},children:["Agent: ",(0,d.jsx)("span",{style:{color:"var(--foreground)",fontWeight:500},children:a.agentName})]}),(0,d.jsx)("div",{className:"font-display",style:{marginTop:6,fontSize:"0.65rem",color:"var(--muted-foreground)",opacity:.5},children:s(a.ts)})]})]})}let u=["all","write","create","delete","read","search"];function v({content:a}){let[b,c]=(0,e.useState)("all"),f=(0,e.useMemo)(()=>(function(a){try{let b=JSON.parse(a);if(Array.isArray(b.events))return b.events.filter(a=>!!a?.tool&&!!a?.ts).sort((a,b)=>new Date(b.ts).getTime()-new Date(a.ts).getTime())}catch{}return(function(a){let b=[];for(let c of a.split("\n")){let a=c.trim();if(!(!a||a.startsWith("#")||a.startsWith("//")))try{let c=JSON.parse(a);c.tool&&c.ts&&b.push(c)}catch{}}return b})(a).sort((a,b)=>new Date(b.ts).getTime()-new Date(a.ts).getTime())})(a),[a]),g=(0,e.useMemo)(()=>"all"===b?f:f.filter(a=>p(a.tool)===b),[f,b]),h=(0,e.useMemo)(()=>{let a={all:f.length};for(let b of f){let c=p(b.tool);a[c]=(a[c]??0)+1}return a},[f]);return 0===f.length?(0,d.jsxs)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:12},children:[(0,d.jsx)(l.A,{size:28,style:{margin:"0 auto 10px",opacity:.3}}),(0,d.jsx)("p",{children:"No agent operations logged yet."}),(0,d.jsxs)("p",{style:{marginTop:6,opacity:.6,fontSize:11},children:["Agent writes appear here from ",(0,d.jsx)("code",{style:{background:"var(--muted)",padding:"1px 5px",borderRadius:4},children:".mindos/agent-audit-log.json"}),"."]})]}):(0,d.jsxs)("div",{style:{maxWidth:760,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsx)("div",{style:{display:"flex",alignItems:"center",gap:6,marginBottom:"1.2rem",flexWrap:"wrap"},children:u.map(a=>{let e=h[a]??0;if("all"!==a&&!e)return null;let f="all"!==a?q[a]:void 0,g=b===a;return(0,d.jsxs)("button",{onClick:()=>c(a),className:"font-display",style:{display:"inline-flex",alignItems:"center",gap:4,padding:"3px 10px",borderRadius:999,fontSize:"0.7rem",cursor:"pointer",border:"none",background:g?f?.bg??"var(--accent)":"var(--muted)",color:g?f?.text??"var(--foreground)":"var(--muted-foreground)",outline:g?`1px solid ${f?.border??"var(--border)"}`:"none",transition:"all .1s"},children:["all"!==a&&(0,d.jsx)(r,{kind:a,size:10}),a," ",(0,d.jsxs)("span",{style:{opacity:.6},children:["(",e,")"]})]},a)})}),(0,d.jsx)("div",{children:g.map((a,b)=>(0,d.jsx)(t,{op:a},b))})]})}},66874:(a,b,c)=>{"use strict";c.r(b),c.d(b,{BacklinksRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call BacklinksRenderer() from the server but BacklinksRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/backlinks/BacklinksRenderer.tsx","BacklinksRenderer")},66913:(a,b,c)=>{"use strict";c.r(b),c.d(b,{AgentInspectorRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call AgentInspectorRenderer() from the server but AgentInspectorRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/agent-inspector/AgentInspectorRenderer.tsx","AgentInspectorRenderer")},67809:(a,b,c)=>{"use strict";c.d(b,{default:()=>f});var d=c(48249),e=c(67484);class f extends e.Component{constructor(a){super(a),this.state={hasError:!1}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}componentDidCatch(a,b){console.error("[ErrorBoundary]",a,b.componentStack)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:(0,d.jsx)("div",{className:"flex items-center justify-center min-h-[50vh] px-4",children:(0,d.jsxs)("div",{className:"text-center max-w-md",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold text-foreground mb-2",children:"Something went wrong"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:this.state.error?.message||"An unexpected error occurred."}),(0,d.jsx)("button",{onClick:()=>this.setState({hasError:!1,error:void 0}),className:"px-4 py-2 text-sm rounded-lg border border-border hover:bg-muted transition-colors",children:"Try again"})]})}):this.props.children}}},68533:(a,b,c)=>{"use strict";c.d(b,{TooltipProvider:()=>e});var d=c(77943);(0,d.registerClientReference)(function(){throw Error("Attempted to call Tooltip() from the server but Tooltip is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/tooltip.tsx","Tooltip"),(0,d.registerClientReference)(function(){throw Error("Attempted to call TooltipTrigger() from the server but TooltipTrigger is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/tooltip.tsx","TooltipTrigger"),(0,d.registerClientReference)(function(){throw Error("Attempted to call TooltipContent() from the server but TooltipContent is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/tooltip.tsx","TooltipContent");let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call TooltipProvider() from the server but TooltipProvider is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/ui/tooltip.tsx","TooltipProvider")},69593:(a,b,c)=>{"use strict";c.d(b,{Oo:()=>e,dB:()=>k});var d=c(67484);function e(a){let b=a.replace(/<(thinking|reasoning|scratchpad)>[\s\S]*?<\/\1>/gi,"");return(b=b.replace(/<(?:thinking|reasoning|scratchpad)>[\s\S]*$/gi,"")).trim()}let f=new Set(["create_file","write_file","batch_create_files","append_to_file","insert_after_heading","update_section","edit_lines","delete_file","rename_file","move_file","append_csv"]),g=new Set(["read_file","read_lines","search","list_files"]);function h(a,b){return b&&"object"==typeof b?"string"==typeof b.path?b.path:"string"==typeof b.from_path?b.from_path:"batch_create_files"===a&&Array.isArray(b.files)?b.files.map(a=>a.path??"").filter(Boolean).join(", "):"":""}async function i(a){try{let b=await fetch(`/api/file?path=${encodeURIComponent(a)}&op=read_file`);if(!b.ok)return"";return(await b.json()).content??""}catch{return""}}async function j(a,b,c,d){let j=a.getReader(),k=new TextDecoder,l="",m=[],n=new Map,o="",p=0,q=new Set;try{for(;!d?.aborted;){let{done:a,value:d}=await j.read();if(a)break;let u=(l+=k.decode(d,{stream:!0})).split("\n");for(let a of(l=u.pop()??"",u)){let d,j=a.trim();if(!j.startsWith("data:"))continue;let k=j.slice(5).trim();if(!k)continue;try{d=JSON.parse(k)}catch{continue}let l=d.type;switch(l){case"tool_start":{var r,s,t;let a=d.toolName,e=d.toolCallId,j=d.args;p++;let k=(r=l,s=a,t=j,"text_delta"===r?{stage:"analyzing"}:"tool_start"===r&&s?f.has(s)?{stage:"writing",detail:h(s,t)||void 0}:g.has(s)?{stage:"reading",detail:t&&"object"==typeof t&&"path"in t&&"string"==typeof t.path?t.path:void 0}:{stage:"analyzing"}:null);if(k&&b({stageHint:k}),f.has(a)){let d=h(a,j),f="update";"create_file"===a||"batch_create_files"===a?f="create":("delete_file"===a||"rename_file"===a||"move_file"===a)&&(f="unknown"),"update"===f&&d&&!q.has(d)&&(q.add(d),i(d).then(a=>{a&&c(d,a)})),n.set(e,{name:a,path:d,action:f}),b({currentTool:{name:a,path:d}})}break}case"tool_end":{let a=d.toolCallId,c=!!d.isError,e=n.get(a);if(e){if("batch_create_files"===e.name)for(let b of e.path.split(", ").filter(Boolean))m.push({action:e.action,path:b,toolCallId:a,ok:!c});else m.push({action:e.action,path:e.path,toolCallId:a,ok:!c});n.delete(a),b({changes:[...m],currentTool:null})}break}case"text_delta":o+=d.delta??"",b({stageHint:{stage:"analyzing"},summary:e(o)});break;case"error":throw Error(d.message||"AI organize failed")}}}}finally{j.releaseLock()}return{changes:m,summary:e(o),toolCallCount:p}}function k(){let[a,b]=(0,d.useState)("idle"),[c,e]=(0,d.useState)([]),[f,g]=(0,d.useState)(null),[h,i]=(0,d.useState)(null),[k,l]=(0,d.useState)(""),[m,n]=(0,d.useState)(null),[o,p]=(0,d.useState)(0),q=(0,d.useRef)(null),r=(0,d.useRef)(0),s=(0,d.useRef)(new Map),[t,u]=(0,d.useState)([]),[v,w]=(0,d.useState)("upload"),x=(0,d.useRef)(0),[y,z]=(0,d.useState)(0),A=(0,d.useCallback)(async(a,c,d="upload")=>{b("organizing"),e([]),g(null),i({stage:"connecting"}),l(""),n(null),p(0),u(a.map(a=>a.name)),w(d),x.current=Date.now(),z(0),s.current=new Map,r.current=Date.now();let f=new AbortController;q.current=f;let h=a.map(a=>({name:a.name,content:a.content.length>2e4?a.content.slice(0,2e4)+"\n\n[...truncated to first ~20000 chars]":a.content}));try{let a=await fetch("/api/ask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[{role:"user",content:c}],uploadedFiles:h,maxSteps:15,mode:"organize"}),signal:f.signal});if(!a.ok){let b=`Request failed (${a.status})`;try{let c=await a.json();"string"==typeof c?.error?b=c.error:"object"==typeof c?.error&&c.error?.message?b=c.error.message:c?.message&&(b=c.message)}catch{}throw Error(b)}if(!a.body)throw Error("No response body");let d=await j(a.body,a=>{r.current=Date.now(),a.changes&&e(a.changes),void 0!==a.currentTool&&g(a.currentTool),a.stageHint&&i(a.stageHint),void 0!==a.summary&&l(a.summary)},(a,b)=>{s.current.set(a,b)},f.signal);e(d.changes),l(d.summary),p(d.toolCallCount),g(null),z(Date.now()-x.current),b("done")}catch(a){"AbortError"===a.name?b("idle"):(n(a.message),b("error"))}finally{q.current=null}},[]),B=(0,d.useCallback)(()=>{q.current?.abort()},[]),C=(0,d.useCallback)(async a=>{let b=c.find(b=>b.path===a&&b.ok&&!b.undone);if(!b)return!1;try{if("create"===b.action){if(!(await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"delete_file",path:b.path})})).ok)return!1}else{if("update"!==b.action)return!1;let c=s.current.get(a);if(!c||!(await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"write_file",path:b.path,content:c})})).ok)return!1}return e(b=>b.map(b=>b.path===a&&b.ok&&!b.undone?{...b,undone:!0}:b)),!0}catch{return!1}},[c]),D=(0,d.useCallback)(async()=>{let a=c.filter(a=>a.ok&&!a.undone&&("create"===a.action||"update"===a.action&&s.current.has(a.path))),b=0;for(let c of a)try{if("create"===c.action)(await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"delete_file",path:c.path})})).ok&&b++;else if("update"===c.action){let a=s.current.get(c.path);a&&(await fetch("/api/file",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"write_file",path:c.path,content:a})})).ok&&b++}}catch{}return b>0&&e(a=>a.map(a=>!a.ok||a.undone?a:"create"===a.action||"update"===a.action&&s.current.has(a.path)?{...a,undone:!0}:a)),b},[c]),E=(0,d.useCallback)(a=>{let b=c.find(b=>b.path===a&&b.ok&&!b.undone);return!!b&&("create"===b.action||"update"===b.action&&s.current.has(a))},[c]),F=c.some(a=>a.ok&&!a.undone&&("create"===a.action||"update"===a.action&&s.current.has(a.path))),G=(0,d.useCallback)(()=>{b("idle"),e([]),g(null),i(null),l(""),n(null),p(0),u([]),w("upload"),z(0),x.current=0,s.current=new Map,r.current=0},[]);return{phase:a,changes:c,currentTool:f,stageHint:h,summary:k,error:m,toolCallCount:o,sourceFileNames:t,source:v,durationMs:y,snapshots:s,start:A,abort:B,undoOne:C,undoAll:D,canUndo:E,hasAnyUndoable:F,reset:G}}},70137:(a,b,c)=>{"use strict";c.d(b,{default:()=>h});var d=c(48249),e=c(67484),f=c(46674),g=c(47223);function h(){let{t:a}=(0,g.Y)(),b=a.settings.update.updateToast,[c,h]=(0,e.useState)("hidden"),[i,j]=(0,e.useState)({});(0,e.useRef)(null);let[k,l]=(0,e.useState)(!1),m=(0,e.useRef)(new Set);(0,e.useRef)({});let n=(0,e.useCallback)(()=>{m.current.forEach(clearTimeout),m.current.clear()},[]),o=(0,e.useCallback)((a,b)=>{let c=setTimeout(()=>{m.current.delete(c),h(a)},b);m.current.add(c)},[]),p=(0,e.useCallback)(()=>{n(),window.dispatchEvent(new CustomEvent("mindos:open-settings",{detail:{tab:"update"}})),h("dismissing"),o("hidden",200)},[n,o]),q=(0,e.useCallback)(()=>{n(),i.desktop&&localStorage.setItem("mindos_update_skip_desktop",i.desktop.version),i.core&&localStorage.setItem("mindos_update_skip_core",i.core.version),h("dismissing"),o("hidden",200)},[i,n,o]);if(!k||"hidden"===c)return null;let r=!!(i.desktop&&i.core),s=r?b.titleMultiple:i.desktop?b.titleSingle(b.desktopLabel,i.desktop.version):i.core?b.titleSingle(b.coreLabel,i.core.version):"",t=r?`${b.desktopLabel} v${i.desktop.version} \u00B7 ${b.coreLabel} v${i.core.version}`:"";return(0,d.jsx)("div",{role:"status","aria-live":"polite",className:`
|
|
152
140
|
fixed bottom-14 right-4 z-40 pointer-events-none
|
|
153
141
|
transition-all duration-200
|
|
154
142
|
${"visible"===c?"opacity-100 translate-y-0":"opacity-0 translate-y-2"}
|
|
155
|
-
`,children:(0,d.jsxs)("div",{className:"pointer-events-auto flex flex-col gap-2.5 bg-card border border-border rounded-xl shadow-lg px-4 py-3 w-[290px]",children:[(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)("span",{className:"mt-[5px] w-2 h-2 rounded-full bg-[var(--amber)] shrink-0"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium text-foreground leading-snug",children:s}),t&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:t})]}),(0,d.jsx)("button",{type:"button",onClick:q,className:"shrink-0 p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","aria-label":"Dismiss",children:(0,d.jsx)(f.A,{size:13})})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:p,className:"flex-1 px-3 py-1.5 text-xs font-medium rounded-lg text-[var(--amber-foreground)] bg-[var(--amber)] hover:opacity-90 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:b.viewDetails}),(0,d.jsx)("button",{type:"button",onClick:q,className:"flex-1 px-3 py-1.5 text-xs rounded-lg text-muted-foreground border border-border hover:text-foreground hover:bg-muted transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:r?b.skipAll:b.skipVersion})]})]})})}},70567:(a,b,c)=>{Promise.resolve().then(c.bind(c,55038))},
|
|
156
|
-
hidden md:flex fixed top-0 h-screen z-30
|
|
157
|
-
flex-col bg-card border-r border-border
|
|
158
|
-
transition-[transform,left,width] duration-200 ease-out
|
|
159
|
-
${null!==a?"translate-x-0":"-translate-x-full pointer-events-none"}
|
|
160
|
-
`,style:{width:H?`calc(100vw - ${y}px)`:`${M}px`,left:`${y}px`},role:"region","aria-label":a?`${a} panel`:void 0,children:[(0,d.jsxs)("div",{className:`flex flex-col h-full ${"files"===a?"":"hidden"}`,children:[(0,d.jsx)(u.A,{title:N.sidebar.files,children:(0,d.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("button",{ref:W,type:"button",onClick:()=>{Z(!1),V(a=>!a)},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.new,title:N.sidebar.new,children:(0,d.jsx)(g.A,{size:13})}),U&&(0,d.jsxs)("div",{ref:X,className:"absolute top-full right-0 mt-1 min-w-[152px] bg-card border border-border rounded-lg shadow-lg py-1 z-50",children:[(0,d.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:()=>{V(!1),O.push("/view/Untitled.md")},children:[(0,d.jsx)(h.A,{size:14,className:"shrink-0"}),N.sidebar.newFile]}),(0,d.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:()=>{V(!1),window.dispatchEvent(new Event("mindos:create-space"))},children:[(0,d.jsx)(i.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),N.sidebar.newSpace]})]})]}),(0,d.jsx)("button",{type:"button",onClick:()=>J?.(),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.importFile,title:N.sidebar.importFile,children:(0,d.jsx)(j.A,{size:13})}),(0,d.jsx)("div",{className:"w-px h-3.5 bg-border mx-0.5"}),(0,d.jsx)("button",{onClick:()=>S(a=>Math.max(-1,(a??T)-1)),onDoubleClick:()=>{S(-1),ah()},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.collapseLevel,title:af?N.sidebar.collapseLevel:N.sidebar.collapseLevelHint??N.sidebar.collapseLevel,children:(0,d.jsx)(k.A,{size:13})}),(0,d.jsx)("button",{onClick:()=>S(a=>{let b=(a??0)+1;return b>T?null:b}),onDoubleClick:()=>{S(null),ah()},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.expandLevel,title:af?N.sidebar.expandLevel:N.sidebar.expandLevelHint??N.sidebar.expandLevel,children:(0,d.jsx)(l.A,{size:13})}),(0,d.jsx)("div",{className:"w-px h-3.5 bg-border mx-0.5"}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("button",{ref:$,type:"button",onClick:()=>{V(!1),Z(a=>!a)},className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":N.sidebar.more,title:N.sidebar.more,children:(0,d.jsx)(m.A,{size:13})}),Y&&(0,d.jsxs)("div",{ref:_,className:"absolute top-full right-0 mt-1 min-w-[172px] bg-card border border-border rounded-lg shadow-lg py-1 z-50",children:[(0,d.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:()=>{Z(!1),O.push("/view/Inbox/")},children:[(0,d.jsx)(n.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),(0,d.jsx)("span",{className:"flex-1",children:N.sidebar.capture}),ad>0&&(0,d.jsx)("span",{className:"text-2xs font-medium tabular-nums px-1.5 py-px rounded-full bg-[var(--amber)]/10 text-[var(--amber)]/70",children:ad})]}),(0,d.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:()=>{Z(!1),O.push("/view/.mindos/change-log.json")},children:[(0,d.jsx)(o.A,{size:14,className:"shrink-0 text-[var(--amber)]"}),(0,d.jsx)("span",{className:"flex-1",children:N.changes.title})]}),(0,d.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:()=>{Z(!1),O.push("/trash")},children:[(0,d.jsx)(p.A,{size:14,className:"shrink-0"}),(0,d.jsx)("span",{className:"flex-1",children:N.trash.title}),ab>0&&(0,d.jsx)("span",{className:"text-xs text-muted-foreground tabular-nums",children:ab})]}),(0,d.jsx)("div",{className:"my-1 border-t border-border/50"}),(0,d.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:()=>{(0,s.Fo)(!aa)},children:[aa?(0,d.jsx)(q.A,{size:14,className:"shrink-0"}):(0,d.jsx)(r.A,{size:14,className:"shrink-0"}),(0,d.jsx)("span",{className:"flex-1",children:N.sidebar.showHiddenFiles}),aa&&(0,d.jsx)("span",{className:"text-[var(--amber)] text-xs",children:"✓"})]})]})]})]})}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0 px-2 py-2",onDragEnter:a=>{a.dataTransfer.types.includes("Files")&&a.stopPropagation()},onDragOver:a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),a.stopPropagation())},onDrop:a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),a.stopPropagation())},children:(0,d.jsx)(s.Ay,{nodes:b,onNavigate:c,maxOpenDepth:R,onImport:J})}),(0,d.jsxs)("button",{type:"button",onClick:()=>O.push("/view/Inbox/"),className:`flex items-center gap-2 mx-2 px-2 py-1.5 text-sm rounded-lg transition-all duration-150 group shrink-0 ${Q?"bg-[var(--amber-dim)] text-[var(--amber)]":"hover:bg-muted text-muted-foreground hover:text-foreground"}`,children:[(0,d.jsx)("div",{className:`flex items-center justify-center w-5 h-5 rounded-md shrink-0 transition-colors ${Q?"bg-[var(--amber)]/15":"bg-transparent"}`,children:(0,d.jsx)(n.A,{size:13,className:`shrink-0 transition-colors ${Q?"text-[var(--amber)]":"text-[var(--amber)]/60 group-hover:text-[var(--amber)]"}`})}),(0,d.jsx)("span",{className:`flex-1 text-left text-xs transition-colors ${Q?"font-medium text-[var(--amber)]":"text-muted-foreground group-hover:text-foreground"}`,children:N.sidebar.capture}),ad>0&&(0,d.jsx)("span",{className:`text-2xs font-medium tabular-nums px-1.5 py-px rounded-full transition-colors ${Q?"bg-[var(--amber)]/15 text-[var(--amber)]":"bg-[var(--amber)]/10 text-[var(--amber)]/70"}`,children:ad})]}),(0,d.jsx)(t.Ay,{collapsed:!1,onOpenSyncSettings:x})]}),K,!H&&F&&(0,d.jsx)("div",{className:"absolute top-0 -right-[3px] w-[6px] h-full cursor-col-resize z-40 group hidden md:block",onMouseDown:ai,children:(0,d.jsx)("div",{className:"absolute right-[2px] top-0 w-[2px] h-full opacity-0 group-hover:opacity-100 bg-[var(--amber)]/60 transition-opacity"})})]})}},72362:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ConfigRenderer:()=>j});var d=c(48249),e=c(67484),f=c(40560),g=c(42742),h=c(46674),i=c(24520);function j({content:a,saveAction:b}){let c=(0,e.useMemo)(()=>{try{return JSON.parse(a)}catch{return null}},[a]),[j,k]=(0,e.useState)(c),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)({}),t=j??{},u=t.uiSchema?.sections??[],v=t.keySpecs??{},w=(0,e.useCallback)(async a=>{m(!0),o(!1),q("");try{await b(`${JSON.stringify(a,null,2)}
|
|
143
|
+
`,children:(0,d.jsxs)("div",{className:"pointer-events-auto flex flex-col gap-2.5 bg-card border border-border rounded-xl shadow-lg px-4 py-3 w-[290px]",children:[(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)("span",{className:"mt-[5px] w-2 h-2 rounded-full bg-[var(--amber)] shrink-0"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium text-foreground leading-snug",children:s}),t&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 truncate",children:t})]}),(0,d.jsx)("button",{type:"button",onClick:q,className:"shrink-0 p-0.5 rounded text-muted-foreground hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","aria-label":"Dismiss",children:(0,d.jsx)(f.A,{size:13})})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)("button",{type:"button",onClick:p,className:"flex-1 px-3 py-1.5 text-xs font-medium rounded-lg text-[var(--amber-foreground)] bg-[var(--amber)] hover:opacity-90 transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:b.viewDetails}),(0,d.jsx)("button",{type:"button",onClick:q,className:"flex-1 px-3 py-1.5 text-xs rounded-lg text-muted-foreground border border-border hover:text-foreground hover:bg-muted transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",children:r?b.skipAll:b.skipVersion})]})]})})}},70567:(a,b,c)=>{Promise.resolve().then(c.bind(c,55038))},72362:(a,b,c)=>{"use strict";c.r(b),c.d(b,{ConfigRenderer:()=>j});var d=c(48249),e=c(67484),f=c(40560),g=c(42742),h=c(46674),i=c(24520);function j({content:a,saveAction:b}){let c=(0,e.useMemo)(()=>{try{return JSON.parse(a)}catch{return null}},[a]),[j,k]=(0,e.useState)(c),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(!1),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)({}),t=j??{},u=t.uiSchema?.sections??[],v=t.keySpecs??{},w=(0,e.useCallback)(async a=>{m(!0),o(!1),q("");try{await b(`${JSON.stringify(a,null,2)}
|
|
161
144
|
`),o(!0),setTimeout(()=>o(!1),1200)}catch(a){q(a instanceof Error?a.message:"Failed to save")}finally{m(!1)}},[b]),x=(0,e.useCallback)(async(a,b)=>{if(!j)return;let c=function(a,b,c){let d=b.split("."),e=structuredClone(a),f=e;for(let a=0;a<d.length-1;a++){let b=d[a],c=f[b];(!c||"object"!=typeof c||Array.isArray(c))&&(f[b]={}),f=f[b]}return f[d[d.length-1]]=c,e}(j,a,b);k(c),await w(c)},[j,w]);return c&&j?(0,d.jsxs)("div",{className:"max-w-3xl mx-auto flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-border bg-card px-4 py-2.5",children:[(0,d.jsx)("div",{className:"text-xs text-muted-foreground",children:"CONFIG Control Panel"}),(0,d.jsxs)("div",{className:"text-xs flex items-center gap-2",children:[l&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-muted-foreground",children:[(0,d.jsx)(f.A,{size:12,className:"animate-spin"}),"Saving"]}),!l&&n&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1",style:{color:"var(--success)"},children:[(0,d.jsx)(g.A,{size:12}),"Saved"]})]})]}),p&&(0,d.jsx)("div",{className:"rounded-lg border border-error/30 bg-error/10 px-3 py-2 text-xs text-error",children:p}),u.map(a=>(0,d.jsxs)("div",{className:"rounded-xl border border-border bg-card p-4",children:[(0,d.jsxs)("div",{className:"mb-3",children:[(0,d.jsx)("h3",{className:"text-sm font-semibold text-foreground",children:a.title}),a.description&&(0,d.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:a.description})]}),(0,d.jsx)("div",{className:"space-y-3",children:a.fields.map(a=>{let b=v[a]??{},c=function(a,b){let c=b.split("."),d=a;for(let a of c){if(!d||"object"!=typeof d||!(a in d))return null;d=d[a]}return d}(j,a),e=b.label||a;return(0,d.jsxs)("div",{className:"rounded-lg border border-border/80 bg-background px-3 py-2.5",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between gap-3 mb-1.5",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"text-sm text-foreground",children:e}),b.description&&(0,d.jsx)("div",{className:"text-xs text-muted-foreground mt-0.5",children:b.description})]}),"switch"===b.control&&"boolean"==typeof c&&(0,d.jsx)("button",{type:"button",onClick:()=>x(a,!c),className:"px-2.5 py-1 rounded-md text-xs font-medium",style:{background:c?"var(--amber)":"var(--muted)",color:c?"var(--amber-foreground)":"var(--muted-foreground)"},children:c?"ON":"OFF"})]}),"text"===b.control&&"string"==typeof c&&(0,d.jsx)("input",{defaultValue:c,onBlur:b=>x(a,b.target.value),className:"w-full px-2 py-1.5 text-sm bg-card border border-border rounded text-foreground"}),"number"===b.control&&"number"==typeof c&&(0,d.jsx)("input",{type:"number",defaultValue:c,min:b.constraints?.min,max:b.constraints?.max,onBlur:d=>{let e=Number(d.target.value),f=b.constraints?.min,g=b.constraints?.max,h=Number.isFinite(e)?e:c;"number"==typeof f&&h<f&&(h=f),"number"==typeof g&&h>g&&(h=g),x(a,h)},className:"w-full px-2 py-1.5 text-sm bg-card border border-border rounded text-foreground"}),"tag-list"===b.control&&Array.isArray(c)&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:c.map((b,e)=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded border border-border text-xs bg-muted text-foreground",children:[String(b),(0,d.jsx)("button",{type:"button",onClick:()=>x(a,c.filter((a,b)=>b!==e)),className:"text-muted-foreground hover:text-foreground",children:(0,d.jsx)(h.A,{size:11})})]},`${String(b)}-${e}`))}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("input",{value:r[a]??"",onChange:b=>s(c=>({...c,[a]:b.target.value})),onKeyDown:b=>{if("Enter"!==b.key)return;b.preventDefault();let d=(r[a]??"").trim();d&&(x(a,[...c,d]),s(b=>({...b,[a]:""})))},className:"flex-1 px-2 py-1.5 text-sm bg-card border border-border rounded text-foreground",placeholder:"Add item"}),(0,d.jsxs)("button",{type:"button",onClick:()=>{let b=(r[a]??"").trim();b&&(x(a,[...c,b]),s(b=>({...b,[a]:""})))},className:"px-2.5 py-1.5 rounded-md text-xs bg-muted text-foreground inline-flex items-center gap-1",children:[(0,d.jsx)(i.A,{size:12})," Add"]})]})]})]},a)})})]},a.id))]}):(0,d.jsx)("div",{className:"rounded-xl border border-border p-4 text-sm text-error",children:"CONFIG.json parse failed. Please check JSON format."})}},73778:(a,b,c)=>{"use strict";c.d(b,{A:()=>m});var d=c(48249),e=c(2116),f=c.n(e),g=c(67484),h=c(19099),i=c(96286),j=c(46674),k=c(95054),l=c(47223);function m(){let[a,b]=(0,g.useState)(0),[c,e]=(0,g.useState)(null),[m,n]=(0,g.useState)(!1);(0,g.useRef)(0);let[o,p]=(0,g.useState)(!1),[q,r]=(0,g.useState)(!1),s=(0,h.usePathname)(),{t}=(0,l.Y)();async function u(){try{await (0,k.n)("/api/changes",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({op:"mark_seen"})})}catch{}finally{b(0),e(0)}}return((0,g.useMemo)(()=>!(a<=0||s?.startsWith("/changes")||s?.startsWith("/changelog"))&&(null===c||!(a<=c))&&!m,[c,s,a,m]),o)?(0,d.jsx)("div",{className:`fixed right-3 top-[60px] md:right-6 md:top-4 z-30 transition-all duration-150 ease-out ${q?"opacity-100 translate-y-0 scale-100":"opacity-0 -translate-y-2 scale-[0.98] pointer-events-none"}`,children:(0,d.jsx)("div",{className:"rounded-2xl border bg-card/95 backdrop-blur px-3 py-2.5 shadow-lg min-w-[260px] max-w-[350px]",style:{borderColor:"color-mix(in srgb, var(--amber) 45%, var(--border))",boxShadow:"0 12px 28px color-mix(in srgb, var(--amber) 14%, rgba(0,0,0,.24))"},children:(0,d.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,d.jsx)("span",{className:"inline-flex h-7 w-7 items-center justify-center rounded-full text-[var(--amber)] bg-[var(--amber-subtle)]",children:(0,d.jsx)(i.A,{size:14})}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"text-xs text-foreground font-medium whitespace-nowrap",children:t.changes.unreadBanner(a)}),(0,d.jsxs)("div",{className:"mt-1 flex items-center gap-1.5",children:[(0,d.jsx)(f(),{href:"/changelog",className:"inline-flex items-center rounded-md px-2.5 py-1 text-xs font-medium bg-[var(--amber)] text-[var(--amber-foreground)] focus-visible:ring-2 focus-visible:ring-ring hover:opacity-90",children:t.changes.reviewNow}),(0,d.jsx)("button",{type:"button",onClick:()=>void u(),className:"inline-flex items-center rounded-md px-2 py-1 text-xs font-medium bg-muted text-muted-foreground hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:t.changes.markAllRead})]})]}),(0,d.jsx)("button",{type:"button",onClick:()=>e(a),"aria-label":t.changes.dismiss,className:"inline-flex h-6 w-6 items-center justify-center rounded-md text-muted-foreground hover:text-foreground hover:bg-muted/60 focus-visible:ring-2 focus-visible:ring-ring",children:(0,d.jsx)(j.A,{size:14})})]})})}):null}},74190:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(48249),e=c(67484),f=c(74429),g=c(65255),h=c(42742),i=c(46674),j=c(44218),k=c(47223);function l({selectedAgent:a,onSelect:b,installedAgents:c,loading:l=!1}){let{t:m}=(0,k.Y)(),n=m.panels.agents,[o,p]=(0,e.useState)(!1),[q,r]=(0,e.useState)(null),s=(0,e.useRef)(null),t=(0,e.useRef)(null),u=(0,e.useCallback)(()=>{b(null),p(!1)},[b]),v=(0,e.useCallback)(a=>{b({id:a.id,name:a.name}),p(!1)},[b]),w=(0,e.useCallback)(a=>{a.stopPropagation(),b(null)},[b]),x=!a,y=a?.name??n.acpDefaultAgent;if(!l&&0===c.length&&!a)return null;let z=o&&q?(0,d.jsxs)("div",{ref:t,role:"listbox","aria-label":n.acpSelectAgent,className:"fixed z-50 min-w-[180px] max-w-[240px] rounded-lg border border-border bg-card shadow-lg py-1 animate-in fade-in-0 zoom-in-95 duration-100",style:{left:q.left,..."up"===q.direction?{bottom:window.innerHeight-q.top}:{top:q.top}},children:[(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":x,onClick:u,className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs text-left transition-colors hover:bg-muted",children:[(0,d.jsx)(g.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,d.jsx)("span",{className:"flex-1 truncate font-medium",children:n.acpDefaultAgent}),x&&(0,d.jsx)(h.A,{size:11,className:"shrink-0 text-[var(--amber)]"})]}),c.length>0&&(0,d.jsx)("div",{className:"mx-2 my-1 border-t border-border/60"}),c.map(b=>{let c=a?.id===b.id;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":c,onClick:()=>v(b),className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs text-left transition-colors hover:bg-muted",children:[(0,d.jsx)("span",{className:"w-2 h-2 rounded-full bg-[var(--success)] shrink-0"}),(0,d.jsx)("span",{className:"flex-1 truncate",children:b.name}),c&&(0,d.jsx)(h.A,{size:11,className:"shrink-0 text-[var(--amber)]"})]},b.id)})]}):null;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("button",{ref:s,type:"button",onClick:()=>p(a=>!a),className:`
|
|
162
145
|
inline-flex items-center gap-1 rounded-full px-2.5 py-0.5
|
|
163
146
|
text-2xs font-medium transition-colors
|
|
@@ -169,7 +152,24 @@ MCP_TRANSPORT = "stdio"`;return{snippet:b,displaySnippet:b,path:a.globalPath}}if
|
|
|
169
152
|
`,children:[(0,d.jsxs)(x(),{href:e,className:"flex flex-1 min-w-0 items-center gap-2.5 text-left rounded-xl pl-2.5 pr-2 py-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,d.jsx)(A.lx,{name:a.name,status:b,size:"sm"}),(0,d.jsx)("span",{className:"text-sm font-medium text-foreground truncate leading-tight",children:a.name}),"connected"===b&&a.transport&&(0,d.jsx)("span",{className:"text-2xs font-mono tabular-nums px-1.5 py-0.5 rounded-md bg-muted/90 text-muted-foreground shrink-0 border border-border/50",children:a.transport}),h&&(0,d.jsx)("span",{title:j,className:"shrink-0 text-muted-foreground/70",children:(0,d.jsx)(i.A,{size:12})}),(0,d.jsx)("span",{className:"flex-1 min-w-[4px]"}),(0,d.jsx)(v.A,{size:15,className:`shrink-0 transition-opacity duration-150 ${c?"text-[var(--amber)] opacity-90":"text-muted-foreground/45 group-hover:text-muted-foreground/80"}`,"aria-hidden":!0})]}),"detected"===b&&(0,d.jsx)("div",{className:"pr-2 py-2 shrink-0",children:(0,d.jsx)(C,{agentKey:a.key,agentName:a.name,onInstallAgent:f,copy:g})})]})}function C({agentKey:a,agentName:b,onInstallAgent:c,copy:f}){let[g,i]=(0,e.useState)(!1),[j,k]=(0,e.useState)("idle"),l=async b=>{if(b.stopPropagation(),g)return;i(!0),k("idle");let d=await c(a);i(!1),k(d?"success":"error")},m="error"===j,n="success"===j,o=g?f.installing:n?f.installSuccess:m?f.retryInstall:f.install;return(0,d.jsxs)("button",{type:"button",onClick:l,disabled:g,className:`flex items-center gap-1 px-2 py-1.5 text-2xs rounded-lg font-medium text-white disabled:opacity-50 transition-colors shrink-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ${m?"bg-error hover:bg-error/90":n?"bg-success hover:bg-success/90":"bg-[var(--amber)] hover:bg-[var(--amber)]/90"}`,"aria-label":`${b} ${o}`,children:[g?(0,d.jsx)(h.A,{size:10,className:"animate-spin"}):null,!g&&n?(0,d.jsx)(y.A,{size:10}):null,!g&&m?(0,d.jsx)(z.A,{size:10}):null,o,(0,d.jsx)("span",{className:"sr-only","aria-live":"polite",children:m?f.installFailed:""})]})}function D({connected:a,detected:b,notFound:c,selectedAgentKey:e,onInstallAgent:f,listCopy:g,showNotDetected:h,setShowNotDetected:i,p:j}){return(0,d.jsxs)("div",{children:[(0,d.jsx)("div",{className:"px-0 py-1.5 mb-1",children:(0,d.jsx)("span",{className:"text-2xs font-semibold text-muted-foreground/70 uppercase tracking-wider",children:j.rosterLabel})}),a.length>0&&(0,d.jsxs)("section",{className:"mb-3",children:[(0,d.jsxs)("h3",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground/80 uppercase tracking-wider mb-2 pl-0.5",children:[(0,d.jsx)("span",{className:"w-1 h-3 rounded-full bg-[var(--success)]/50","aria-hidden":"true"}),j.sectionConnected," ",(0,d.jsxs)("span",{className:"text-muted-foreground/50 tabular-nums",children:["(",a.length,")"]})]}),(0,d.jsx)("div",{className:"space-y-1.5",children:a.map(a=>(0,d.jsx)(B,{agent:a,agentStatus:"connected",selected:e===a.key,detailHref:`/agents/${encodeURIComponent(a.key)}`,onInstallAgent:f,copy:g},a.key))})]}),b.length>0&&(0,d.jsxs)("section",{className:"mb-3",children:[(0,d.jsxs)("h3",{className:"flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground/80 uppercase tracking-wider mb-2 pl-0.5",children:[(0,d.jsx)("span",{className:"w-1 h-3 rounded-full bg-[var(--amber)]/50","aria-hidden":"true"}),j.sectionDetected," ",(0,d.jsxs)("span",{className:"text-muted-foreground/50 tabular-nums",children:["(",b.length,")"]})]}),(0,d.jsx)("div",{className:"space-y-1.5",children:b.map(a=>(0,d.jsx)(B,{agent:a,agentStatus:"detected",selected:e===a.key,detailHref:`/agents/${encodeURIComponent(a.key)}`,onInstallAgent:f,copy:g},a.key))})]}),c.length>0&&(0,d.jsxs)("section",{children:[(0,d.jsxs)("button",{type:"button",onClick:()=>i(!h),className:"flex items-center gap-1 text-[11px] font-medium text-muted-foreground uppercase tracking-wider mb-2 hover:text-foreground transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm pl-0.5",children:[h?(0,d.jsx)(u.A,{size:12}):(0,d.jsx)(v.A,{size:12}),j.sectionNotDetected," (",c.length,")"]}),h&&(0,d.jsx)("div",{className:"space-y-1.5",children:c.map(a=>(0,d.jsx)(B,{agent:a,agentStatus:"notFound",selected:e===a.key,detailHref:`/agents/${encodeURIComponent(a.key)}`,onInstallAgent:f,copy:g},a.key))})]})]})}var E=c(2887),F=c(8455),G=c(49681),H=c(33740),I=c(34545);function J(){let{t:a}=(0,m.Y)(),b=a.panels.im,c=(0,f.useSearchParams)().get("platform"),[i,j]=(0,e.useState)([]),[k,l]=(0,e.useState)(!0),[n,o]=(0,e.useState)(!1),p=(0,e.useCallback)(async()=>{o(!1);try{let a=await fetch("/api/im/status");if(a.ok){let b=await a.json();j(b.platforms??[])}else o(!0)}catch{o(!0)}l(!1)},[]);if(k)return(0,d.jsx)("div",{className:"flex justify-center py-8",children:(0,d.jsx)(h.A,{size:16,className:"animate-spin text-muted-foreground"})});if(n)return(0,d.jsxs)("div",{className:"flex flex-col items-center gap-2 py-8 px-3",children:[(0,d.jsx)(F.A,{size:16,className:"text-muted-foreground"}),(0,d.jsx)("p",{className:"text-2xs text-muted-foreground",children:b.fetchError}),(0,d.jsxs)("button",{type:"button",onClick:()=>{l(!0),p()},className:"inline-flex items-center gap-1 text-2xs text-muted-foreground hover:text-foreground transition-colors",children:[(0,d.jsx)(g.A,{size:11})," ",b.retry]})]});let q=i.filter(a=>a.connected).length;return(0,d.jsxs)("div",{className:"flex flex-col py-1",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 mb-0.5",children:[(0,d.jsx)("span",{className:"text-2xs font-medium text-muted-foreground uppercase tracking-wider",children:b.title}),q>0&&(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground/60",children:[q," ",b.connected]})]}),(0,d.jsx)("div",{className:"flex flex-col",children:I.P.map(({id:a,name:b,icon:e})=>{let f=i.find(b=>b.platform===a),g=f?.connected??!1,h=c===a;return(0,d.jsxs)(x(),{href:`/agents?tab=channels&platform=${a}`,className:`
|
|
170
153
|
relative flex items-center gap-2.5 px-3 py-2 text-left rounded-sm transition-colors
|
|
171
154
|
${h?"bg-[var(--amber-dim)]/40 pl-3.5":"hover:bg-muted/50"}
|
|
172
|
-
`,children:[h&&(0,d.jsx)("span",{className:"pointer-events-none absolute bottom-[22%] left-0 top-[22%] w-0.5 rounded-r-full bg-[var(--amber)]","aria-hidden":!0}),(0,d.jsx)("span",{className:"text-sm",children:e}),(0,d.jsx)("span",{className:"text-sm flex-1 truncate text-foreground",children:b}),g?(0,d.jsx)(G.A,{size:14,className:"text-success shrink-0"}):(0,d.jsx)(H.A,{size:14,className:"text-border shrink-0"})]},a)})})]})}function K({active:a,maximized:b,onMaximize:c,selectedAgentKey:o=null}){let{t:p}=(0,m.Y)(),q=p.panels.agents,r=(0,f.useRouter)(),s=(0,k.kr)(),u=(0,f.usePathname)(),v=(0,f.useSearchParams)(),w="/agents"===u&&"channels"===v.get("tab"),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(!1),F=(0,l.V)(),G=async()=>{y(!0),await s.refresh(),y(!1)},H=s.agents.filter(a=>a.present&&a.installed),I=s.agents.filter(a=>a.present&&!a.installed),K=s.agents.filter(a=>!a.present),L=async a=>{let b=await s.installAgent(a);return b&&await s.refresh(),b},M=u?.startsWith("/agents/")?decodeURIComponent(u.slice(8)):null,N={installing:q.installing,install:q.install,installSuccess:q.installSuccess,installFailed:q.installFailed,retryInstall:q.retryInstall},O={navOverview:q.navOverview,navMcp:q.navMcp,navSkills:q.navSkills,navChannels:q.channels,navNetwork:q.navNetwork,navSessions:q.navSessions,navActivity:q.navActivity},P=(0,d.jsx)(t,{copy:O,connectedCount:H.length,mcpEnabled:s.status?.connectionMode?.mcp??!1,channelsActive:w,onChannelsClick:()=>{r.push("/agents?tab=channels")}});return(0,d.jsxs)("div",{className:`flex flex-col h-full ${a?"":"hidden"}`,children:[(0,d.jsx)(n.A,{title:q.title,maximized:b,onMaximize:c,children:(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[!s.loading&&(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground",children:[H.length," ",q.connected,F.agents.length>0&&(0,d.jsxs)(d.Fragment,{children:[" \xb7 ",q.a2aLabel," ",F.agents.length]})]}),(0,d.jsx)("button",{onClick:G,disabled:x,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":q.refresh,title:q.refresh,type:"button",children:(0,d.jsx)(g.A,{size:12,className:x?"animate-spin":""})})]})}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0",children:s.loading?(0,d.jsx)("div",{className:"flex justify-center py-8",children:(0,d.jsx)(h.A,{size:16,className:"animate-spin text-muted-foreground"})}):0===s.agents.length&&0===s.skills.length?(0,d.jsxs)("div",{className:"flex flex-col gap-2 py-4 px-0",children:[P,(0,d.jsx)("div",{className:"mx-4 border-t border-border"}),(0,d.jsxs)("div",{className:"mx-3 rounded-lg border border-border/40 bg-card/30 px-3 py-5 text-center",children:[(0,d.jsx)("p",{className:"text-xs text-muted-foreground/70 mb-1.5",children:q.noAgents}),(0,d.jsx)("p",{className:"text-2xs text-muted-foreground/40 mb-3",children:q.skillsEmptyHint}),(0,d.jsxs)("button",{onClick:G,type:"button",className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,d.jsx)(g.A,{size:11})," ",q.retry]})]})]}):(0,d.jsxs)("div",{className:"pb-3",children:[P,(0,d.jsx)("div",{className:"mx-4 border-t border-border"}),w?(0,d.jsx)(J,{}):(0,d.jsx)("div",{className:"px-3 py-3 space-y-4",children:(0,d.jsx)(D,{connected:H,detected:I,notFound:K,selectedAgentKey:M??o,listCopy:N,onInstallAgent:L,showNotDetected:z,setShowNotDetected:A,p:{rosterLabel:q.rosterLabel,sectionConnected:q.sectionConnected,sectionDetected:q.sectionDetected,sectionNotDetected:q.sectionNotDetected}})})]})}),(0,d.jsxs)("div",{className:"px-3 py-2 border-t border-border shrink-0 space-y-1",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>C(!0),className:"flex items-center gap-1.5 text-2xs text-muted-foreground hover:text-foreground transition-colors w-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:[(0,d.jsx)(i.A,{size:11}),q.a2aDiscover]}),(0,d.jsxs)("button",{type:"button",onClick:()=>{window.dispatchEvent(new CustomEvent("mindos:open-settings",{detail:{tab:"mcp"}}))},className:"flex items-center gap-1.5 text-2xs text-muted-foreground hover:text-foreground transition-colors w-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:[(0,d.jsx)(j.A,{size:11}),q.advancedConfig]})]}),(0,d.jsx)(E.A,{open:B,onClose:()=>C(!1),onDiscover:F.discover,discovering:F.discovering,error:F.error})]})}},78340:(a,b,c)=>{"use strict";c.r(b),c.d(b,{BacklinksRenderer:()=>l});var d=c(48249),e=c(67484),f=c(19099),g=c(80600),h=c(86588),i=c(33191);function j(a){return a.split("/").pop()?.replace(/\.md$/,"")??a}function k({text:a}){let b=a.split(/(\[\[[^\]]+\]\]|\[[^\]]+\]\([^)]+\))/g);return(0,d.jsx)("span",{children:b.map((a,b)=>/^\[\[/.test(a)||/^\[/.test(a)?(0,d.jsx)("span",{style:{color:"var(--amber)",fontWeight:500},children:a},b):(0,d.jsx)("span",{children:a},b))})}function l({filePath:a}){let b=(0,f.useRouter)(),[c,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(!0);if(m)return(0,d.jsx)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",fontSize:12,color:"var(--muted-foreground)"},children:"Scanning backlinks…"});let o=c??[];return(0,d.jsxs)("div",{style:{maxWidth:720,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsx)("div",{style:{marginBottom:"1.5rem",display:"flex",alignItems:"center",gap:8},children:(0,d.jsx)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:0===o.length?"No backlinks found":`${o.length} file${1===o.length?"":"s"} link here`})}),0===o.length?(0,d.jsxs)("div",{style:{border:"1px dashed var(--border)",borderRadius:10,padding:"2.5rem 1.5rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:13},children:[(0,d.jsx)(g.A,{size:28,style:{margin:"0 auto 10px",opacity:.3}}),(0,d.jsxs)("p",{className:"font-display",style:{fontSize:12},children:["No other files link to ",(0,d.jsx)("strong",{style:{color:"var(--foreground)"},children:j(a)})," yet."]})]}):(0,d.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:o.map(({filePath:a,snippets:c})=>{let e,f=j(a),l=(e=a.split("/")).length>1?e.slice(0,-1).join("/"):"";return(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,overflow:"hidden",cursor:"pointer",transition:"border-color .15s"},onClick:()=>b.push("/view/"+(0,i.O0)(a)),onMouseEnter:a=>a.currentTarget.style.borderColor="rgba(200,135,58,0.4)",onMouseLeave:a=>a.currentTarget.style.borderColor="var(--border)",children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 14px",borderBottom:c.length>0?"1px solid var(--border)":"none",background:"var(--muted)"},children:[(0,d.jsx)(g.A,{size:13,style:{color:"var(--muted-foreground)",flexShrink:0}}),(0,d.jsx)("span",{style:{fontWeight:600,fontSize:"0.85rem",color:"var(--foreground)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f}),l&&(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.6,flexShrink:0},children:l}),(0,d.jsx)(h.A,{size:11,style:{color:"var(--muted-foreground)",opacity:.5,flexShrink:0}})]}),c.map((a,b)=>(0,d.jsx)("div",{style:{padding:"8px 14px",borderBottom:b<c.length-1?"1px solid var(--border)":"none",background:"var(--background)"},children:a.split("\n").map((a,b)=>(0,d.jsx)("div",{className:"font-display",style:{fontSize:"0.72rem",color:"var(--muted-foreground)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:(0,d.jsx)(k,{text:a})},b))},b))]},a)})})]})}c(95054)},78890:(a,b,c)=>{"use strict";c.d(b,{G:()=>i,M:()=>j});var d=c(48249),e=c(2116),f=c.n(e),g=c(19794),h=c(33191);function i({icon:a,title:b,subtitle:c,badge:e,href:i,onClick:j,active:k}){let l=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:a}),(0,d.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,d.jsx)("span",{className:"block text-left text-sm font-medium text-foreground truncate",title:b,children:b}),c?(0,d.jsx)("span",{className:"block text-left text-2xs text-muted-foreground truncate",title:c,children:c}):null]}),e,(0,d.jsx)(g.A,{size:14,className:"shrink-0 text-muted-foreground"})]}),m=!!k,n=(0,h.cn)("relative flex items-center gap-3 py-2.5 transition-[background-color] duration-150 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",m?"bg-[var(--amber-dim)]/40 pl-3.5 pr-4 text-foreground":"px-4",!m&&"cursor-pointer hover:bg-muted/50",m&&"cursor-default"),o=m?(0,d.jsx)("span",{className:"pointer-events-none absolute bottom-[22%] left-0 top-[22%] w-0.5 rounded-r-full bg-[var(--amber)]","aria-hidden":!0}):null;return i?(0,d.jsxs)(f(),{href:i,className:n,"aria-current":k?"page":void 0,children:[o,l]}):(0,d.jsxs)("button",{type:"button",onClick:j,className:(0,h.cn)(n,"w-full"),children:[o,l]})}function j({label:a}){return(0,d.jsx)("span",{className:"text-2xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground shrink-0",children:a})}},80655:(a,b,c)=>{"use strict";c.d(b,{Y:()=>e});var d=c(99829);let e=(0,d.createServerReference)("4015f646533c224b3b9535dd8e8fcd4636ac95acbe",d.callServer,void 0,d.findSourceMapURL,"undoDeleteAction")},80829:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(48249),e=c(67484),f=c(46674),g=c(49681),h=c(2797),i=c(69924),j=c(9311),k=c(81285);function l({open:a,onClose:b,anchorRect:c,railWidth:l,onOpenSyncSettings:m,syncStatus:n,onSyncStatusRefresh:o}){let p=(0,e.useRef)(null);(0,e.useRef)(b).current=b;let{syncing:q,syncResult:r,syncNow:s}=(0,j.bj)(o);if(!a||!c)return null;let t=(0,j.Bq)(n,q),{label:u}=(0,j.ky)(t,n),v=Math.max(8,c.bottom-180);return(0,d.jsxs)("div",{ref:p,className:"fixed z-40 w-[240px] border rounded-lg bg-card shadow-lg border-border animate-in fade-in slide-in-from-left-2 duration-150",style:{top:v,left:l},children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Sync"}),(0,d.jsx)("button",{onClick:b,className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Close",children:(0,d.jsx)(f.A,{size:14})})]}),(0,d.jsxs)("div",{className:"p-3 space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`w-2.5 h-2.5 rounded-full shrink-0 ${j.BG[t]} ${"syncing"===t||"conflicts"===t||"error"===t?"animate-pulse":""}`}),(0,d.jsx)("span",{className:"text-sm text-foreground",children:u}),"success"===r&&(0,d.jsx)(g.A,{size:14,className:"text-success shrink-0"}),"error"===r&&(0,d.jsx)(h.A,{size:14,className:"text-error shrink-0"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:["off"!==t&&(0,d.jsxs)(k.jn,{onClick:s,disabled:q,className:"text-xs px-3 py-1.5 flex items-center gap-1.5",children:[(0,d.jsx)(i.A,{size:12,className:q?"animate-spin":""}),"Sync Now"]}),(0,d.jsx)("button",{onClick:()=>{m(),b()},className:"text-xs text-muted-foreground hover:text-foreground transition-colors rounded px-1 py-0.5 focus-visible:ring-2 focus-visible:ring-ring",children:"Settings →"})]})]})]})}},80992:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GraphRenderer:()=>j});var d=c(48249),e=c(67484),f=c(19099),g=c(96103),h=c(54633);c(71763),c(95054);let i=(0,e.memo)(function({data:a}){let b=(0,f.useRouter)(),{label:c,id:i,isCurrent:j,isOrphan:k,size:l=1}=a,m=(0,e.useCallback)(()=>{let a=i.split("/").map(encodeURIComponent).join("/");b.push("/view/"+a)},[i,b]),n=.8+Math.min(.1*l,1.2);return(0,d.jsxs)("div",{onClick:m,title:i,className:"group font-display",style:{fontSize:10*n,padding:`${4*n}px ${12*n}px`,borderRadius:999,cursor:"pointer",userSelect:"none",whiteSpace:"nowrap",maxWidth:240,overflow:"hidden",textOverflow:"ellipsis",opacity:k?.4:1,background:j?"var(--amber)":"var(--card)",color:j?"var(--amber-foreground)":"var(--foreground)",border:`1.5px solid ${j?"var(--amber)":"var(--border)"}`,boxShadow:j?"0 0 20px var(--amber-dim), 0 0 0 2px var(--amber-dim)":"0 2px 4px rgba(0,0,0,0.1)",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",zIndex:j?10:1},onMouseEnter:a=>{j||(a.currentTarget.style.borderColor="var(--amber)",a.currentTarget.style.background="var(--accent)")},onMouseLeave:a=>{j||(a.currentTarget.style.borderColor="var(--border)",a.currentTarget.style.background="var(--card)")},children:[(0,d.jsx)(g.h7,{type:"target",position:h.yX.Top,style:{opacity:0}}),c,(0,d.jsx)(g.h7,{type:"source",position:h.yX.Bottom,style:{opacity:0}})]})});function j({filePath:a}){let[b,c]=(0,e.useState)(null),[f,h]=(0,e.useState)(!0),[j,k]=(0,e.useState)("local"),[l,m]=(0,e.useState)(!1),n=(0,e.useMemo)(()=>{if(!b)return new Map;let a=new Map;for(let c of b.edges)a.set(c.source,(a.get(c.source)||0)+1),a.set(c.target,(a.get(c.target)||0)+1);return a},[b]),o=(0,e.useMemo)(()=>{if(!b)return null;let a=new Map;for(let c of b.edges)a.has(c.source)||a.set(c.source,new Set),a.has(c.target)||a.set(c.target,new Set),a.get(c.source).add(c.target),a.get(c.target).add(c.source);return a},[b]),{filteredNodes:p,filteredEdges:q}=(0,e.useMemo)(()=>{let c,d;if(!b)return{filteredNodes:[],filteredEdges:[]};if("global"===j)c=b.nodes,d=b.edges;else{let e=new Set,f=[{id:a,depth:0}];for(e.add(a);f.length>0;){let{id:a,depth:b}=f.shift();if(!(b>=2))for(let c of o?.get(a)??new Set)e.has(c)||(e.add(c),f.push({id:c,depth:b+1}))}let g=new Set((c=b.nodes.filter(a=>e.has(a.id))).map(a=>a.id));d=b.edges.filter(a=>g.has(a.source)&&g.has(a.target))}return{filteredNodes:c,filteredEdges:d}},[b,j,a,o]),r=(0,e.useMemo)(()=>{let a=new Set;for(let b of q)a.add(b.source),a.add(b.target);return a},[q]),{rfNodes:s,rfEdges:t}=(0,e.useMemo)(()=>{if(0===p.length)return{rfNodes:[],rfEdges:[]};let b=function(a,b,c){let d=a.length;if(0===d)return{};let e=(void 0)??(d>100?80:150),f=.6*Math.sqrt(108e4/Math.max(d,1)),g={};a.forEach((a,b)=>{let c=2*Math.PI*b/d,e=360*Math.random();g[a]={x:600+Math.cos(c)*e,y:450+Math.sin(c)*e}});let h={};for(let c=0;c<e;c++){let i=120*(1-c/e);for(let b of a)h[b]={x:0,y:0};for(let b=0;b<d;b++)for(let c=b+1;c<d;c++){let d=a[b],e=a[c],i=g[d].x-g[e].x,j=g[d].y-g[e].y,k=Math.sqrt(i*i+j*j||.01),l=f*f/k;h[d].x+=i/k*l,h[d].y+=j/k*l,h[e].x-=i/k*l,h[e].y-=j/k*l}for(let a of b){let b=a.source,c=a.target;if(!g[b]||!g[c])continue;let d=g[b].x-g[c].x,e=g[b].y-g[c].y,i=Math.sqrt(d*d+e*e||.01),j=i*i/f;h[b].x-=d/i*j,h[b].y-=e/i*j,h[c].x+=d/i*j,h[c].y+=e/i*j}for(let b of a){let a=g[b].x-600,c=g[b].y-450,d=Math.sqrt(a*a+c*c)||.01,e=.05*d;h[b].x-=a/d*e,h[b].y-=c/d*e}for(let b of a){let a=h[b],c=Math.sqrt(a.x*a.x+a.y*a.y)||.01;g[b].x+=a.x/c*Math.min(c,i),g[b].y+=a.y/c*Math.min(c,i),g[b].x=Math.max(0,Math.min(1200,g[b].x)),g[b].y=Math.max(0,Math.min(900,g[b].y))}}return g}(p.map(a=>a.id),q);return{rfNodes:p.map(c=>({id:c.id,type:"wiki",position:b[c.id]??{x:0,y:0},data:{label:c.label,id:c.id,isCurrent:c.id===a,isOrphan:!r.has(c.id),size:n.get(c.id)||1}})),rfEdges:q.map((b,c)=>{let d=b.source===a||b.target===a;return{id:`e-${c}`,source:b.source,target:b.target,type:"default",markerEnd:{type:"arrowclosed",color:d?"var(--amber)":"var(--border)"},style:{stroke:d?"var(--amber)":"var(--border)",strokeWidth:d?1.5:1,opacity:d?.8:.4},animated:d}})}},[p,q,a,r,n]),u=(0,e.useMemo)(()=>({wiki:i}),[]);return!l||f?(0,d.jsx)("div",{style:{width:"100%",height:"calc(100vh - 160px)",minHeight:400,borderRadius:12,background:"var(--muted)",border:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,d.jsx)("span",{className:"font-display",style:{color:"var(--muted-foreground)",fontSize:12},children:f?"Building graph…":"Loading…"})}):(0,d.jsxs)("div",{style:{width:"100%",position:"relative",zIndex:0},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:10,flexWrap:"wrap"},children:[(0,d.jsxs)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:[p.length," nodes \xb7 ",q.length," edges"]}),(0,d.jsx)("div",{style:{display:"flex",gap:2,padding:3,borderRadius:8,background:"var(--muted)"},children:[{id:"local",label:"Local"},{id:"global",label:"Global"}].map(a=>(0,d.jsx)("button",{onClick:()=>k(a.id),className:"font-display",style:{padding:"3px 12px",borderRadius:5,fontSize:11,cursor:"pointer",border:"none",outline:"none",background:j===a.id?"var(--card)":"transparent",color:j===a.id?"var(--foreground)":"var(--muted-foreground)",boxShadow:j===a.id?"0 1px 3px rgba(0,0,0,0.1)":"none",transition:"all 0.1s"},children:a.label},a.id))})]}),(0,d.jsx)("div",{style:{width:"100%",height:"calc(100vh - 160px)",minHeight:400},children:(0,d.jsxs)(g.Gc,{nodes:s,edges:t,nodeTypes:u,fitView:!0,fitViewOptions:{padding:.15},proOptions:{hideAttribution:!0},style:{background:"var(--background)",borderRadius:12,border:"1px solid var(--border)"},children:[(0,d.jsx)(g.VS,{color:"var(--border)",gap:24,size:1,variant:g._5.Dots}),(0,d.jsx)(g.H2,{showInteractive:!1}),(0,d.jsx)(g.of,{nodeColor:a=>a.data?.isCurrent?"var(--amber)":"var(--muted-foreground)"})]})})]})}},81285:(a,b,c)=>{"use strict";c.d(b,{D0:()=>k,jn:()=>p,l6:()=>n,lM:()=>o,pd:()=>l,yA:()=>m});var d=c(48249),e=c(67484),f=c.n(e),g=c(41479),h=c(61075),i=c(44218),j=c(42742);function k({label:a,hint:b,hintError:c,children:e}){return(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)("label",{className:"text-sm text-foreground font-medium",children:a}),e,b&&(0,d.jsx)("p",{className:`text-xs ${c?"text-destructive":"text-muted-foreground"}`,children:b})]})}function l({className:a="",...b}){return(0,d.jsx)("input",{...b,className:`w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 ${a}`})}function m({value:a,onChange:b,placeholder:c,disabled:f,className:i="",size:j="md"}){let[k,l]=(0,e.useState)(!1),m="sm"===j;return(0,d.jsxs)("div",{className:`flex items-center border border-border rounded-lg bg-background focus-within:ring-1 focus-within:ring-ring overflow-hidden ${i}`,children:[(0,d.jsx)("input",{type:k?"text":"password",value:a,onChange:a=>b(a.target.value),placeholder:c??"••••••••",disabled:f,className:`flex-1 bg-transparent text-foreground placeholder:text-muted-foreground outline-none disabled:opacity-50 ${m?"px-2.5 py-1.5 text-xs font-mono":"px-3 py-2 text-sm"}`}),!!a&&(0,d.jsx)("button",{type:"button",tabIndex:-1,onMouseDown:a=>a.preventDefault(),onClick:()=>l(a=>!a),disabled:f,className:`shrink-0 text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50 ${m?"p-1.5":"p-2"}`,title:k?"Hide":"Show",children:k?(0,d.jsx)(g.A,{size:m?14:16}):(0,d.jsx)(h.A,{size:m?14:16})})]})}function n({value:a,onChange:b,children:c,className:g="",disabled:h}){let k=(0,e.useId)(),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(-1),p=(0,e.useRef)(null),q=(0,e.useRef)(null),r=(0,e.useMemo)(()=>f().Children.toArray(c).filter(a=>f().isValidElement(a)&&"option"===a.type).map(a=>({value:String(a.props.value??""),label:String(a.props.children??a.props.value??"")})),[c]),s=r.findIndex(b=>b.value===a),t=r[s]?.label??"",u=(0,e.useCallback)(a=>{a>=0&&a<r.length&&(b?.({target:{value:r[a].value}}),m(!1))},[r,b]),v=(0,e.useCallback)(a=>{if(!l){["Enter"," ","ArrowDown","ArrowUp"].includes(a.key)&&(a.preventDefault(),m(!0),o(s>=0?s:0));return}switch(a.key){case"ArrowDown":a.preventDefault(),o(a=>Math.min(a+1,r.length-1));break;case"ArrowUp":a.preventDefault(),o(a=>Math.max(a-1,0));break;case"Enter":case" ":a.preventDefault(),u(n);break;case"Escape":a.preventDefault(),m(!1);break;case"Tab":m(!1)}},[l,r.length,s,n,u]);return(0,d.jsxs)("div",{ref:p,className:`relative ${g}`,children:[(0,d.jsxs)("button",{type:"button",disabled:h,onClick:()=>{m(a=>!a),o(s>=0?s:0)},onKeyDown:v,"aria-haspopup":"listbox","aria-expanded":l,className:"w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground text-left flex items-center justify-between gap-2 outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,d.jsx)("span",{className:`truncate ${t?"":"text-muted-foreground"}`,children:t||"—"}),(0,d.jsx)(i.A,{size:14,className:`shrink-0 text-muted-foreground transition-transform duration-150 ${l?"rotate-180":""}`})]}),l&&(0,d.jsx)("div",{ref:q,role:"listbox","aria-activedescendant":n>=0?`${k}-opt-${n}`:void 0,className:"absolute z-20 w-full mt-1 py-1 border border-border rounded-lg bg-card shadow-lg max-h-60 overflow-auto animate-in fade-in-0 zoom-in-95 duration-100",children:r.map((b,c)=>{let e=b.value===a,f=c===n;return(0,d.jsxs)("button",{id:`${k}-opt-${c}`,role:"option","aria-selected":e,type:"button",onMouseDown:a=>{a.preventDefault(),u(c)},onMouseEnter:()=>o(c),className:`w-full px-3 py-1.5 text-sm text-left flex items-center gap-2 transition-colors ${f?"bg-accent text-accent-foreground":"text-foreground"}`,children:[(0,d.jsx)(j.A,{size:14,className:`shrink-0 ${e?"text-[var(--amber)]":"invisible"}`}),(0,d.jsx)("span",{className:"truncate",children:b.label})]},b.value)})})]})}function o({checked:a,onChange:b,size:c="md",disabled:e,title:f,onClick:g}){let h="sm"===c;return(0,d.jsx)("button",{type:"button",role:"switch","aria-checked":a,disabled:e,title:f,onClick:g??(()=>b?.(!a)),className:`relative inline-flex shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-60 ${h?"h-4 w-7":"h-5 w-9"} ${a?"bg-[var(--amber)]":"bg-muted"}`,children:(0,d.jsx)("span",{className:`pointer-events-none inline-block rounded-full bg-white shadow-sm transition-transform ${h?"h-3 w-3":"h-4 w-4"} ${a?h?"translate-x-3":"translate-x-4":"translate-x-0"}`})})}function p({children:a,disabled:b,onClick:c,type:e="button",className:f="",...g}){return(0,d.jsx)("button",{type:e,onClick:c,disabled:b,className:`px-4 py-2 text-sm font-medium rounded-lg bg-[var(--amber)] text-[var(--amber-foreground)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${f}`,...g,children:a})}},82110:(a,b,c)=>{"use strict";c.d(b,{A:()=>h});var d=c(48249),e=c(67484),f=c(95801),g=c(93096);function h({results:a,selectedIndex:b,query:c,onSelect:h}){let i=(0,e.useRef)(null),j=(0,e.useRef)(null),[k,l]=(0,e.useState)(280);return 0===a.length?null:(0,d.jsxs)("div",{ref:j,className:"border border-border rounded-lg bg-card shadow-lg overflow-hidden",children:[(0,d.jsxs)("div",{className:"px-3 py-1.5 border-b border-border flex items-center gap-1.5",children:[(0,d.jsx)(f.A,{size:11,className:"text-[var(--amber)]/50"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-muted-foreground/70 uppercase tracking-wider",children:"Skills"}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 ml-auto",children:a.length})]}),(0,d.jsx)("div",{ref:i,className:"overflow-y-auto",style:{maxHeight:k},children:a.map((a,e)=>(0,d.jsxs)("button",{type:"button",onMouseDown:b=>{b.preventDefault(),h(a)},className:`w-full flex items-center gap-2.5 px-3 py-2 text-left transition-colors ${e===b?"bg-accent text-foreground":"text-muted-foreground hover:bg-muted"}`,children:[(0,d.jsx)(f.A,{size:13,className:"text-[var(--amber)] shrink-0"}),(0,d.jsxs)("span",{className:"text-sm font-medium shrink-0",children:["/",(0,d.jsx)(g.A,{text:a.name,query:c})]}),a.description&&(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/50 truncate min-w-0 flex-1",title:a.description,children:a.description})]},a.name))}),(0,d.jsxs)("div",{className:"px-3 py-1.5 border-t border-border flex gap-3 text-2xs text-muted-foreground/40 shrink-0",children:[(0,d.jsx)("span",{children:"↑↓ navigate"}),(0,d.jsx)("span",{children:"↵ / Tab select"}),(0,d.jsx)("span",{children:"ESC dismiss"})]})]})}},82626:(a,b,c)=>{"use strict";c.d(b,{A:()=>r});var d=c(48249),e=c(19099),f=c(4815),g=c(46218),h=c(61075),i=c(4140),j=c(78890),k=c(67484),l=c(70971),m=c(8455),n=c(22341);c(95054);var o=c(47223);function p(){let[a,b]=(0,k.useState)(null),[c,e]=(0,k.useState)([]),[f,g]=(0,k.useState)(!0),{t:h}=(0,o.Y)();return f||!a?(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:(0,d.jsx)("div",{className:"h-2 w-20 bg-muted rounded animate-pulse"})}):(0,d.jsxs)("div",{className:"flex flex-col gap-2 px-3 py-3 border-t border-border",children:[(0,d.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,d.jsxs)("div",{className:"flex flex-col items-center p-1.5 rounded bg-muted/40 hover:bg-muted/60 transition-colors cursor-default",children:[(0,d.jsx)("div",{className:"text-sm font-semibold text-foreground",children:a.fileCount}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:"Files"})]}),(0,d.jsxs)("div",{className:"flex flex-col items-center p-1.5 rounded bg-muted/40 hover:bg-muted/60 transition-colors cursor-default",children:[(0,d.jsx)("div",{className:"text-sm font-semibold text-foreground",children:a.unreadChanges}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:"Changes"})]}),(0,d.jsxs)("div",{className:"flex flex-col items-center p-1.5 rounded bg-muted/40 hover:bg-muted/60 transition-colors cursor-default",children:[(0,d.jsx)("div",{className:"text-sm font-semibold text-foreground",children:a.sessionCount}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:"Chats"})]})]}),c.length>0&&(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("div",{className:"text-xs font-medium text-muted-foreground px-0.5",children:"Recent"}),c.map(a=>{let b=function(a){try{let b=new Date(a),c=new Date().getTime()-b.getTime(),d=Math.floor(c/6e4),e=Math.floor(c/36e5),f=Math.floor(c/864e5);if(d<1)return"now";if(d<60)return`${d}m ago`;if(e<24)return`${e}h ago`;if(f<7)return`${f}d ago`;return b.toLocaleDateString("en-US",{month:"short",day:"numeric"})}catch{return"recently"}}(a.ts),c=function(a){switch(a){case"create":return(0,d.jsx)(l.A,{size:12,className:"text-success"});case"write":case"append":return(0,d.jsx)(m.A,{size:12,className:"text-foreground"});case"delete":return(0,d.jsx)(m.A,{size:12,className:"text-destructive"});case"rename":case"move":return(0,d.jsx)(n.A,{size:12,className:"text-muted-foreground"});default:return(0,d.jsx)(m.A,{size:12,className:"text-muted-foreground"})}}(a.op),e=a.path.split("/").pop()||a.path;return(0,d.jsxs)("div",{className:"flex items-start gap-2 p-1.5 rounded hover:bg-muted/40 transition-colors text-xs",children:[(0,d.jsx)("span",{className:"text-muted-foreground shrink-0 mt-0.5",children:c}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"text-foreground truncate font-medium",title:e,children:e}),(0,d.jsx)("p",{className:"text-muted-foreground text-2xs",children:b})]})]},a.id)})]})]})}var q=c(10072);function r({active:a,maximized:b,onMaximize:c}){let{t:k}=(0,o.Y)(),l=k.panels.echo,m=(0,e.usePathname)()??"",n={imprint:{icon:(0,d.jsx)(f.A,{size:14}),title:l.imprintTitle},growth:{icon:(0,d.jsx)(g.A,{size:14}),title:l.growthTitle},self:{icon:(0,d.jsx)(h.A,{size:14}),title:l.selfTitle}};return(0,d.jsxs)("div",{className:`flex flex-col h-full ${a?"":"hidden"}`,children:[(0,d.jsx)(i.A,{title:l.title,maximized:b,onMaximize:c}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0 flex flex-col",children:[(0,d.jsx)("div",{className:"flex flex-col gap-0.5 py-1.5",children:q.RS.map(a=>{let b=n[a],c=q.AI[a],e=m===c||m.startsWith(`${c}/`);return(0,d.jsx)(j.G,{href:c,icon:b.icon,title:b.title,active:e},a)})}),(0,d.jsx)("div",{className:"mt-auto",children:(0,d.jsx)(p,{})})]})]})}},82704:()=>{},82884:(a,b,c)=>{"use strict";c.d(b,{Un:()=>f});var d=c(67484);let e="mindos-renderer-state-change";function f(a,b,c){let f=`mindos-renderer:${a}:${b}`,g=(0,d.useRef)({key:f,raw:null,parsed:c});return g.current.key!==f&&(g.current={key:f,raw:null,parsed:c}),[(0,d.useSyncExternalStore)(a=>{let b=()=>a();return window.addEventListener("storage",b),window.addEventListener(e,b),()=>{window.removeEventListener("storage",b),window.removeEventListener(e,b)}},()=>{try{let a=localStorage.getItem(f);if(a===g.current.raw)return g.current.parsed;if(null===a)return g.current={key:f,raw:null,parsed:c},c;let b=JSON.parse(a);return g.current={key:f,raw:a,parsed:b},b}catch{return c}},()=>c),(0,d.useCallback)(a=>{try{let b=(()=>{try{let a=localStorage.getItem(f);return null!==a?JSON.parse(a):c}catch{return c}})(),d="function"==typeof a?a(b):a,e=JSON.stringify(d);localStorage.setItem(f,e),g.current={key:f,raw:e,parsed:d}}catch{}window.dispatchEvent(new Event(e))},[f,c])]}},83539:(a,b,c)=>{"use strict";c.r(b),c.d(b,{WorkflowYamlRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call WorkflowYamlRenderer() from the server but WorkflowYamlRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/workflow-yaml/WorkflowYamlRenderer.tsx","WorkflowYamlRenderer")},84197:(a,b,c)=>{"use strict";c.d(b,{A:()=>o});var d=c(48249),e=c(67484),f=c(2116),g=c.n(f),h=c(24520),i=c(40560),j=c(95801),k=c(31675),l=c(4140),m=c(47223),n=c(33191);function o({active:a,maximized:b,onMaximize:c}){let{t:f}=(0,m.Y)(),o=f.panels.workflows,[p,q]=(0,e.useState)([]),[r,s]=(0,e.useState)(!0),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(""),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(""),B=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/workflows");if(!a.ok)return;let b=await a.json();q(b.workflows??[])}catch{}finally{s(!1)}},[]),C=async()=>{let a=v.trim();if(a&&!x){y(!0),A("");try{let b=await fetch("/api/workflows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a})}),c=await b.json();if(!b.ok)return void A(409===b.status?o.exists:c.error||"Error");u(!1),w(""),await B(),window.location.href=`/view/${(0,n.O0)(c.path)}`}catch{A("Network error")}finally{y(!1)}}};return(0,d.jsxs)("div",{className:`flex flex-col h-full ${a?"":"hidden"}`,children:[(0,d.jsx)(l.A,{title:o.title,maximized:b,onMaximize:c,children:(0,d.jsx)("button",{onClick:()=>u(a=>!a),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":o.newWorkflow,title:o.newWorkflow,children:(0,d.jsx)(h.A,{size:13})})}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0",children:[t&&(0,d.jsxs)("div",{className:"px-3 py-3 border-b border-border",children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-muted-foreground mb-1.5",children:o.name}),(0,d.jsx)("input",{type:"text",value:v,onChange:a=>{w(a.target.value),A("")},onKeyDown:a=>"Enter"===a.key&&C(),placeholder:o.namePlaceholder,autoFocus:!0,className:"w-full px-2.5 py-1.5 text-sm rounded-md border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),z&&(0,d.jsx)("p",{className:"text-xs text-[var(--error)] mt-1",children:z}),(0,d.jsxs)("div",{className:"flex gap-2 mt-2.5",children:[(0,d.jsx)("button",{onClick:()=>{u(!1),w(""),A("")},className:"flex-1 px-3 py-1.5 text-xs rounded-md border border-border text-muted-foreground hover:bg-muted transition-colors",children:o.cancel}),(0,d.jsx)("button",{onClick:C,disabled:!v.trim()||x,className:"flex-1 px-3 py-1.5 text-xs rounded-md font-medium transition-colors disabled:opacity-50 bg-[var(--amber)] text-[var(--amber-foreground)]",children:x?o.creating:o.create})]})]}),r&&(0,d.jsx)("div",{className:"flex items-center justify-center py-8 text-muted-foreground",children:(0,d.jsx)(i.A,{size:16,className:"animate-spin"})}),!r&&0===p.length&&!t&&(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-10 px-4 text-center",children:[(0,d.jsx)(j.A,{size:24,className:"text-muted-foreground/40 mb-3"}),(0,d.jsx)("p",{className:"text-sm font-medium text-muted-foreground mb-1",children:o.empty}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground/70 mb-4 max-w-[200px]",children:o.emptyDesc}),(0,d.jsxs)("button",{onClick:()=>u(!0),className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md font-medium bg-[var(--amber)] text-[var(--amber-foreground)] transition-colors",children:[(0,d.jsx)(h.A,{size:12}),o.newWorkflow]})]}),!r&&p.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-0.5 py-1.5",children:p.map(a=>(0,d.jsxs)(g(),{href:`/view/${(0,n.O0)(a.path)}`,className:`flex items-start gap-2.5 px-3 py-2 mx-1 rounded-lg transition-colors hover:bg-muted ${a.error?"opacity-70":""}`,children:[(0,d.jsx)(j.A,{size:14,className:"shrink-0 mt-0.5 text-[var(--amber)]"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground block truncate",children:a.title}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[a.error?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-2xs text-[var(--error)]",children:[(0,d.jsx)(k.A,{size:10}),o.parseError]}):(0,d.jsx)("span",{className:"text-2xs text-muted-foreground",children:o.nSteps(a.stepCount)}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/60",suppressHydrationWarning:!0,children:(0,n.KW)(a.mtime,f.home?.relativeTime)})]})]})]},a.path))})]})]})}},84276:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(5735);function e(){return(0,d.jsxs)("div",{className:"content-width px-4 md:px-6 py-10 md:py-14 animate-pulse","aria-busy":"true","aria-label":"Loading",children:[(0,d.jsxs)("div",{className:"mb-10",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,d.jsx)("div",{className:"w-1 h-7 rounded-full bg-muted"}),(0,d.jsx)("div",{className:"h-6 w-28 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"h-4 w-64 bg-muted rounded ml-4 mb-6"}),(0,d.jsxs)("div",{className:"w-full max-w-xl flex flex-col sm:flex-row items-stretch sm:items-center gap-2 ml-4",children:[(0,d.jsx)("div",{className:"flex-1 h-12 rounded-xl bg-muted"}),(0,d.jsx)("div",{className:"h-12 w-16 rounded-xl bg-muted shrink-0"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 mt-4 ml-4",children:[(0,d.jsx)("div",{className:"h-9 w-28 rounded-lg bg-muted"}),(0,d.jsx)("div",{className:"h-9 w-40 rounded-lg bg-muted"})]})]}),(0,d.jsxs)("div",{className:"mb-10",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,d.jsx)("div",{className:"w-4 h-4 rounded bg-muted"}),(0,d.jsx)("div",{className:"h-4 w-16 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:Array.from({length:6}).map((a,b)=>(0,d.jsxs)("div",{className:"flex items-start gap-3 px-3.5 py-3 rounded-xl border border-border",children:[(0,d.jsx)("div",{className:"w-5 h-5 rounded bg-muted shrink-0 mt-0.5"}),(0,d.jsxs)("div",{className:"flex-1 space-y-1.5",children:[(0,d.jsx)("div",{className:"h-4 w-20 bg-muted rounded"}),(0,d.jsx)("div",{className:"h-3 w-full bg-muted rounded"}),(0,d.jsx)("div",{className:"h-3 w-12 bg-muted rounded"})]})]},b))})]}),(0,d.jsxs)("div",{className:"mb-10",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,d.jsx)("div",{className:"w-4 h-4 rounded bg-muted"}),(0,d.jsx)("div",{className:"h-4 w-24 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"flex flex-col gap-3",children:Array.from({length:3}).map((a,b)=>(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[(0,d.jsx)("div",{className:"w-4 h-4 rounded bg-muted"}),(0,d.jsx)("div",{className:"h-3 w-24 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"flex flex-col gap-0.5 ml-2 border-l border-border/40 pl-3",children:Array.from({length:2}).map((a,b)=>(0,d.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,d.jsx)("div",{className:"w-3 h-3 rounded bg-muted shrink-0"}),(0,d.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,d.jsx)("div",{className:"h-4 w-40 bg-muted rounded"}),(0,d.jsx)("div",{className:"h-3 w-24 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"h-3 w-12 bg-muted rounded shrink-0"})]},b))})]},b))})]})]})}},84668:(a,b,c)=>{"use strict";c.d(b,{A:()=>o});var d=c(48249),e=c(67484),f=c(31417),g=c(21245);let h="mindos_walkthrough_done";function i(a,b){if(a>=g.g.length||b)try{localStorage.setItem(h,"1")}catch{}fetch("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:{walkthroughStep:a,walkthroughDismissed:b}})}).catch(a=>{console.warn("[walkthrough-store] persist failed:",a)})}let j=(0,f.v)((a,b)=>{let c=g.g.length;return{status:"idle",currentStep:0,totalSteps:c,start:()=>{a({currentStep:0,status:"active"}),i(0,!1)},next:()=>{let d=b().currentStep+1;d>=c?(a({status:"completed"}),i(c,!1)):(a({currentStep:d}),i(d,!1))},back:()=>{let c=b().currentStep;c>0&&(a({currentStep:c-1}),i(c-1,!1))},skip:()=>{a({status:"dismissed"}),i(b().currentStep,!0)},_init:()=>{let b="1"===new URLSearchParams(window.location.search).get("welcome");if(b){let a=new URL(window.location.href);a.searchParams.delete("welcome"),window.history.replaceState({},"",a.pathname+(a.search||"")),window.dispatchEvent(new Event("mindos:first-visit"))}return window.innerWidth<768||function(){try{return"1"===localStorage.getItem(h)}catch{return!1}}()?()=>{}:(fetch("/api/setup").then(a=>a.json()).then(d=>{let e=d.guideState;if(e){if(e.walkthroughDismissed||"number"==typeof e.walkthroughStep&&e.walkthroughStep>=c){try{localStorage.setItem(h,"1")}catch{}return}e.active&&!e.dismissed&&void 0===e.walkthroughStep?b&&a({status:"active",currentStep:0}):"number"==typeof e.walkthroughStep&&e.walkthroughStep>=0&&e.walkthroughStep<c&&!e.walkthroughDismissed&&a({status:"active",currentStep:e.walkthroughStep})}}).catch(a=>{console.warn("[walkthrough-store] guideState read failed:",a)}),()=>{})}}});var k=c(47223);function l({stepIndex:a,rect:b,position:c}){let f,g,h=j(),{t:i}=(0,k.Y)(),[l,m]=(0,e.useState)({width:1024,height:768});if(!h)return null;let n=i.walkthrough.steps[a];if(!n)return null;"right"===c?(f=b.top+b.height/2,g=b.right+12):(f=b.bottom+12,g=b.left+b.width/2);let o=l.width-320,p=l.height-200;return g=Math.min(g,o),f=Math.max(f=Math.min(f,p),8),(0,d.jsxs)("div",{className:`fixed z-[102] w-[280px] rounded-xl border shadow-lg animate-in fade-in duration-200 ${"right"===c?"slide-in-from-left-2":"slide-in-from-top-2"}`,style:{top:`${f}px`,left:`${g}px`,transform:"right"===c?"translateY(-50%)":"translateX(-50%)",background:"var(--card)",borderColor:"var(--amber)"},children:[(0,d.jsxs)("div",{className:"p-4",children:[(0,d.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,d.jsx)("span",{className:"text-2xs font-mono px-1.5 py-0.5 rounded-full",style:{background:"var(--amber-dim)",color:"var(--amber)"},children:i.walkthrough.step(a+1,h.totalSteps)})}),(0,d.jsx)("h3",{className:"text-sm font-semibold mb-1",style:{color:"var(--foreground)"},children:n.title}),(0,d.jsx)("p",{className:"text-xs leading-relaxed",style:{color:"var(--muted-foreground)"},children:n.body}),(0,d.jsxs)("div",{className:"flex items-center justify-between mt-4 pt-3",style:{borderTop:"1px solid var(--border)"},children:[(0,d.jsx)("button",{onClick:h.skip,className:"text-xs transition-colors hover:opacity-80",style:{color:"var(--muted-foreground)"},children:i.walkthrough.skip}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[a>0&&(0,d.jsx)("button",{onClick:h.back,className:"text-xs px-2.5 py-1 rounded-lg transition-colors hover:bg-muted",style:{color:"var(--muted-foreground)"},children:i.walkthrough.back}),(0,d.jsx)("button",{onClick:h.next,className:"text-xs px-3 py-1.5 rounded-lg font-medium transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:a===h.totalSteps-1?i.walkthrough.done:i.walkthrough.next})]})]})]}),(0,d.jsx)("div",{className:"flex items-center justify-center gap-1.5 pb-3",children:Array.from({length:h.totalSteps},(b,c)=>(0,d.jsx)("div",{className:"w-1.5 h-1.5 rounded-full transition-all duration-200",style:{background:c===a?"var(--amber)":"var(--border)",transform:c===a?"scale(1.3)":void 0}},c))})]})}function m(){let a=j(),[b,c]=(0,e.useState)(null),[f,h]=(0,e.useState)(!1),i=(0,e.useId)(),k=a?g.g[a.currentStep]:null;return((0,e.useCallback)(()=>{if(!k)return;let a=document.querySelector(`[data-walkthrough="${k.anchor}"]`);a?c(a.getBoundingClientRect()):c(null)},[k]),a?.skip,a?.currentStep,a&&k)?f?(0,d.jsx)(n,{}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("svg",{className:"fixed inset-0 z-[100] pointer-events-auto",width:"100%",height:"100%",onClick:c=>{if(b){let d=c.clientX,e=c.clientY;d>=b.left-6&&d<=b.right+6&&e>=b.top-6&&e<=b.bottom+6||a.skip()}else a.skip()},children:[(0,d.jsx)("defs",{children:(0,d.jsxs)("mask",{id:i,children:[(0,d.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),b&&(0,d.jsx)("rect",{x:b.left-6,y:b.top-6,width:b.width+12,height:b.height+12,rx:8,ry:8,fill:"black"})]})}),(0,d.jsx)("rect",{width:"100%",height:"100%",fill:"rgba(0, 0, 0, 0.5)",mask:`url(#${i})`})]}),b&&(0,d.jsx)(l,{stepIndex:a.currentStep,rect:b,position:k.position}),!b&&(0,d.jsx)("div",{className:"fixed inset-0 z-[101] flex items-center justify-center pointer-events-none",children:(0,d.jsx)("button",{onClick:a.skip,className:"pointer-events-auto px-4 py-2 text-sm rounded-lg font-medium transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:a.currentStep===a.totalSteps-1?"✓":"→"})})]}):null}function n(){let a=j(),{t:b}=(0,k.Y)();if(!a)return null;let c=b.walkthrough.steps[a.currentStep];return c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"fixed inset-0 z-[100] bg-black/40 backdrop-blur-sm",onClick:a.skip}),(0,d.jsxs)("div",{className:"fixed bottom-0 left-0 right-0 z-[101] rounded-t-2xl border-t shadow-lg p-5 pb-8 animate-in slide-in-from-bottom duration-300",style:{background:"var(--card)",borderColor:"var(--border)"},children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,d.jsx)("span",{className:"text-2xs font-mono px-1.5 py-0.5 rounded-full",style:{background:"var(--amber-dim)",color:"var(--amber)"},children:b.walkthrough.step(a.currentStep+1,a.totalSteps)}),(0,d.jsx)("div",{className:"flex items-center gap-1 ml-auto",children:Array.from({length:a.totalSteps},(b,c)=>(0,d.jsx)("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:c===a.currentStep?"var(--amber)":"var(--border)"}},c))})]}),(0,d.jsx)("h3",{className:"text-base font-semibold mb-1",style:{color:"var(--foreground)"},children:c.title}),(0,d.jsx)("p",{className:"text-sm leading-relaxed mb-5",style:{color:"var(--muted-foreground)"},children:c.body}),(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("button",{onClick:a.skip,className:"text-sm transition-colors hover:opacity-80",style:{color:"var(--muted-foreground)"},children:b.walkthrough.skip}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[a.currentStep>0&&(0,d.jsx)("button",{onClick:a.back,className:"text-sm px-3 py-2 rounded-lg transition-colors hover:bg-muted",style:{color:"var(--muted-foreground)"},children:b.walkthrough.back}),(0,d.jsx)("button",{onClick:a.next,className:"text-sm px-4 py-2 rounded-lg font-medium transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:a.currentStep===a.totalSteps-1?b.walkthrough.done:b.walkthrough.next})]})]})]})]}):null}function o(){return"active"===j(a=>a.status)?(0,d.jsx)(m,{}):null}},85034:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/app/error.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/app/error.tsx","default")},86364:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(88868);let e=async a=>[{type:"image/svg+xml",sizes:"any",url:(0,d.fillMetadataSegment)(".",await a.params,"icon.svg")+"?3c05474ce4fc06a8"}]},86367:(a,b,c)=>{"use strict";c.d(b,{LD:()=>d,LZ:()=>e,qQ:()=>f});let d=[{id:"c1",icon:"\uD83D\uDC64",category:"memory-sync",scenario:"first-day"},{id:"c2",icon:"\uD83D\uDCE5",category:"knowledge-management",scenario:"daily"},{id:"c3",icon:"\uD83D\uDD04",category:"memory-sync",scenario:"project"},{id:"c4",icon:"\uD83D\uDD01",category:"experience-evolution",scenario:"daily"},{id:"c5",icon:"\uD83D\uDCA1",category:"auto-execute",scenario:"daily"},{id:"c6",icon:"\uD83D\uDE80",category:"auto-execute",scenario:"project"},{id:"c7",icon:"\uD83D\uDD0D",category:"knowledge-management",scenario:"project"},{id:"c8",icon:"\uD83E\uDD1D",category:"human-insights",scenario:"daily"},{id:"c9",icon:"\uD83D\uDEE1️",category:"audit-control",scenario:"advanced"}],e=["knowledge-management","memory-sync","auto-execute","experience-evolution","human-insights","audit-control"],f=["first-day","daily","project","advanced"]},86771:(a,b,c)=>{Promise.resolve().then(c.bind(c,2420))},89119:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A:()=>P});var e=c(48249),f=c(67484),g=c(19099),h=c(2116),i=c.n(h),j=c(9915),k=c(10316),l=c(95581),m=c(46674),n=c(801),o=c(4615),p=c(71110),q=c(53878),r=c(20892),s=c(99791),t=c(74434),u=c(29820),v=c(82626),w=c(84197),x=c(61112),y=c(96716),z=c(2923),A=c(80829),B=c(23017),C=c(73778),D=c(43638),E=c(4949),F=c(9311),G=c(47223),H=c(90314),I=c(2518),J=c(84668);c(4246);var K=c(65141),L=c(13859),M=c(69593);c(99101);var N=c(63710),O=a([x,L]);[x,L]=O.then?(await O)():O;let Q=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./SearchModal"]},ssr:!1}),R=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./AskModal"]},ssr:!1}),S=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./SettingsModal"]},ssr:!1}),T=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./CreateSpaceModal"]},ssr:!1}),U=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./ImportModal"]},ssr:!1});function P({fileTree:a,children:b}){let c=(0,K.b)(),d=(0,L.$)(),[h,H]=(0,f.useState)(!1),[O,P]=(0,f.useState)(void 0),[V,W]=(0,f.useState)(!1),[X,Y]=(0,f.useState)(null),[Z,$]=(0,f.useState)(null),[_,aa]=(0,f.useState)(()=>y.wl),ab=(0,M.dB)(),[ac,ad]=(0,f.useState)(!1),[ae,af]=(0,f.useState)(0),ag=(0,f.useCallback)(()=>{ad(!1),"organizing"!==ab.phase||ab.abort(),ab.reset()},[ab]),ah=(0,f.useCallback)(()=>{af(a=>a+1),window.dispatchEvent(new Event("mindos:organize-history-update"))},[]),[ai,aj]=(0,f.useState)(!1),[ak,al]=(0,f.useState)(void 0),[am,an]=(0,f.useState)(void 0),[ao,ap]=(0,f.useState)(!1),aq=(0,f.useRef)(0),ar=(0,f.useCallback)(a=>{al(a),an(void 0),aj(!0)},[]),as=(0,f.useCallback)(()=>{aj(!1),al(void 0),an(void 0)},[]),[at,au]=(0,f.useState)(!1),[av,aw]=(0,f.useState)(!1),[ax,ay]=(0,f.useState)(!1),{t:az}=(0,G.Y)(),aA=(0,g.useRouter)(),aB=(0,g.usePathname)(),aC=(0,f.useMemo)(()=>(function a(b,c=""){let d=[];for(let e of b)if("directory"===e.type&&!e.name.startsWith(".")){let b=c?`${c}/${e.name}`:e.name;d.push(b),e.children&&d.push(...a(e.children,b))}return d})(a),[a]),{status:aD,fetchStatus:aE}=(0,F.dW)(),aF=aB.startsWith("/view/")?aB.slice(6).split("/").map(decodeURIComponent).join("/"):void 0,aG=(0,f.useCallback)(()=>{d.askMaximized&&d.toggleAskMaximized()},[d.askMaximized,d.toggleAskMaximized]),aH=aB?.startsWith("/agents"),aI=c.activePanel??(aH?"agents":null);(0,f.useRef)([]);let aJ=(0,f.useCallback)(()=>{let a=()=>window.dispatchEvent(new Event("guide-state-updated"));"guide"===d.askOpenSource?fetch("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:{askedAI:!0}})}).then(a).catch(a=>console.warn("Guide state update failed:",a)):"guide-next"===d.askOpenSource&&a()},[d.askOpenSource]),aK=(0,f.useCallback)(a=>{aa(a);try{localStorage.setItem("right-agent-detail-panel-width",String(a))}catch{}},[]),aL=(0,f.useCallback)(()=>$(null),[]),aM=null!==Z&&"agents"===c.activePanel,aN=(0,f.useCallback)(()=>{P("sync"),W(!1),H(!0)},[]),aO=(0,f.useCallback)(()=>{H(!0),P(void 0)},[]),aP=(0,f.useCallback)(()=>{H(!1),P(void 0)},[]),aQ=(0,f.useCallback)(a=>{Y(a),W(a=>!a)},[]),aR=(0,f.useCallback)(a=>{c.handleExpandedChange(a),W(!1)},[c]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(I.A,{}),(0,e.jsx)(J.A,{}),(0,e.jsx)("a",{href:"#main-content",className:"sr-only focus-visible:not-sr-only focus-visible:fixed focus-visible:top-2 focus-visible:left-2 focus-visible:z-[60] focus-visible:px-4 focus-visible:py-2 focus-visible:rounded-lg focus-visible:text-sm focus-visible:font-medium bg-[var(--amber)] text-[var(--amber-foreground)]",children:"Skip to main content"}),(0,e.jsx)(o.Ay,{activePanel:aI,onPanelChange:c.setActivePanel,onEchoClick:()=>{aG();let a="echo"===c.activePanel,b=aB?.startsWith("/echo");a?b?c.setActivePanel(null):aA.push("/echo/about-you"):(c.setActivePanel("echo"),aA.push("/echo/about-you"))},onAgentsClick:()=>{aG();let a="agents"===c.activePanel,b=aB?.startsWith("/agents");a?b?c.setActivePanel(null):aA.push("/agents"):(c.setActivePanel("agents"),aA.push("/agents")),$(null)},onDiscoverClick:()=>{aG();let a="discover"===c.activePanel,b=aB?.startsWith("/explore");a?b?c.setActivePanel(null):aA.push("/explore"):(c.setActivePanel("discover"),aA.push("/explore"))},onSpacesClick:()=>{aG();let a="/"===aB,b="files"===c.activePanel,d="/wiki"===aB||aB?.startsWith("/view/")||aB?.startsWith("/wiki/");a||!b?(c.setActivePanel("files"),aA.push("/wiki")):d?c.setActivePanel(null):aA.push("/wiki")},syncStatus:aD,expanded:c.railExpanded,onExpandedChange:aR,onSettingsClick:aO,onSyncClick:aQ}),(0,e.jsxs)(p.Ay,{activePanel:c.activePanel,fileTree:a,onNavigate:()=>{},onOpenSyncSettings:aN,railWidth:c.railWidth,panelWidth:c.panelWidth??void 0,onWidthChange:c.handlePanelWidthChange,onWidthCommit:c.handlePanelWidthCommit,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize,onImport:ar,children:[(0,e.jsx)("div",{className:`flex flex-col h-full ${"echo"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(v.A,{active:"echo"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize})}),(0,e.jsx)("div",{className:`flex flex-col h-full ${"search"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(s.A,{active:"search"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize})}),(0,e.jsx)("div",{className:`flex flex-col h-full ${"agents"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(t.A,{active:"agents"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize,selectedAgentKey:aM?Z:null})}),(0,e.jsx)("div",{className:`flex flex-col h-full ${"discover"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(u.A,{active:"discover"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize})}),(0,e.jsx)("div",{className:`flex flex-col h-full ${"workflows"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(w.A,{active:"workflows"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize})})]}),(0,e.jsx)(x.Ay,{open:d.askPanelOpen,onClose:d.closeAskPanel,currentFile:aF,initialMessage:d.askInitialMessage,initialAcpAgent:d.askAcpAgent,onFirstMessage:aJ,width:d.askPanelWidth,onWidthChange:d.handleAskWidthChange,onWidthCommit:d.handleAskWidthCommit,askMode:d.askMode,onModeSwitch:d.handleAskModeSwitch,maximized:d.askMaximized,onMaximize:d.toggleAskMaximized,sidebarOffset:c.panelOpen?c.railWidth+c.effectivePanelWidth:c.railWidth}),(0,e.jsx)(y.Ay,{open:aM,agentKey:Z,onClose:aL,rightOffset:d.askPanelOpen?d.askPanelWidth:0,width:_,onWidthChange:aa,onWidthCommit:aK}),(0,e.jsx)(R,{open:d.desktopAskPopupOpen,onClose:d.closeDesktopAskPopup,currentFile:aF,initialMessage:d.askInitialMessage,initialAcpAgent:d.askAcpAgent,onFirstMessage:aJ,askMode:d.askMode,onModeSwitch:d.handleAskModeSwitch}),(0,e.jsx)(z.A,{onToggle:d.toggleAskPanel,askPanelOpen:d.askPanelOpen||d.desktopAskPopupOpen}),(0,e.jsx)(B.A,{}),(0,e.jsx)(S,{open:h,onClose:aP,initialTab:O}),(0,e.jsx)(A.A,{open:V,onClose:()=>W(!1),anchorRect:X,railWidth:c.railWidth,onOpenSyncSettings:aN,syncStatus:aD,onSyncStatusRefresh:aE}),(0,e.jsxs)("header",{className:"md:hidden fixed top-0 left-0 right-0 z-30 bg-card border-b border-border flex items-center justify-between px-3 py-2",style:{paddingTop:"env(safe-area-inset-top, 0px)"},children:[(0,e.jsx)("button",{onClick:()=>au(!0),className:"p-3 -ml-1 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent","aria-label":"Open menu",children:(0,e.jsx)(j.A,{size:20})}),(0,e.jsxs)(i(),{href:"/",className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,e.jsx)(r.A,{id:"mobile"}),(0,e.jsx)("span",{className:"text-foreground text-sm font-brand",children:"MindOS"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,e.jsx)("button",{onClick:aN,className:"p-3 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent flex items-center justify-center","aria-label":"Sync status",children:(0,e.jsx)(F.jc,{status:aD})}),(0,e.jsx)("button",{onClick:()=>aw(!0),className:"p-3 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent","aria-label":az.sidebar.searchTitle,children:(0,e.jsx)(k.A,{size:20})}),(0,e.jsx)("button",{onClick:()=>{H(!0),P(void 0)},className:"p-3 -mr-1 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent","aria-label":az.sidebar.settingsTitle,children:(0,e.jsx)(l.A,{size:20})})]})]}),at&&(0,e.jsx)("div",{className:"md:hidden fixed inset-0 z-40 overlay-backdrop",onClick:()=>au(!1)}),(0,e.jsxs)("aside",{className:`md:hidden fixed top-0 left-0 h-screen w-[85vw] max-w-[320px] z-50 bg-card border-r border-border flex flex-col transition-transform duration-300 ease-in-out ${at?"translate-x-0":"-translate-x-full"}`,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-4 py-4 border-b border-border shrink-0",children:[(0,e.jsxs)(i(),{href:"/",className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,e.jsx)(r.A,{id:"drawer"}),(0,e.jsx)("span",{className:"text-foreground text-sm font-brand",children:"MindOS"})]}),(0,e.jsx)("button",{onClick:()=>au(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,e.jsx)(m.A,{size:16})})]}),(0,e.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0 px-2 py-2",children:(0,e.jsx)(q.Ay,{nodes:a,onNavigate:()=>au(!1),onImport:ar})})]}),(0,e.jsx)(Q,{open:av,onClose:()=>aw(!1)}),(0,e.jsx)(R,{open:ax,onClose:()=>ay(!1),currentFile:aF}),(0,e.jsxs)("main",{id:"main-content",className:"min-h-screen transition-all duration-200 pt-[52px] md:pt-0",onDragEnter:a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),aq.current++,1===aq.current&&ap(!0))},onDragOver:a=>{a.dataTransfer.types.includes("Files")&&a.preventDefault()},onDragLeave:()=>{aq.current=Math.max(0,aq.current-1),0===aq.current&&ap(!1)},onDrop:a=>{a.preventDefault(),aq.current=0,ap(!1),a.dataTransfer.files.length>0&&!ai&&(0,N.QL)(Array.from(a.dataTransfer.files),az)},children:[(0,e.jsxs)("div",{className:"min-h-screen bg-background",style:{overflowX:"clip"},children:[(0,e.jsx)(C.A,{}),b]}),(0,e.jsx)(D.A,{}),(0,e.jsx)(T,{t:az,dirPaths:aC}),ao&&!ai&&(0,e.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm transition-opacity duration-200",children:(0,e.jsxs)("div",{className:"border-2 border-dashed border-[var(--amber)]/50 rounded-xl p-12 flex flex-col items-center gap-3",children:[(0,e.jsx)(n.A,{size:48,className:"text-[var(--amber)]/60"}),(0,e.jsx)("p",{className:"text-sm text-foreground font-medium",children:az.inbox.dropOverlay}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:az.inbox.dropOverlayFormats})]})})]}),(0,e.jsx)(U,{open:ai,onClose:as,defaultSpace:ak,initialFiles:am,aiOrganize:ab,dirPaths:aC}),ac&&(0,e.jsx)(E.A,{aiOrganize:ab,onDismiss:ag,onCancel:()=>{ab.abort(),ab.reset(),ad(!1)},onHistoryUpdate:ah}),(0,e.jsx)("style",{children:`
|
|
155
|
+
`,children:[h&&(0,d.jsx)("span",{className:"pointer-events-none absolute bottom-[22%] left-0 top-[22%] w-0.5 rounded-r-full bg-[var(--amber)]","aria-hidden":!0}),(0,d.jsx)("span",{className:"text-sm",children:e}),(0,d.jsx)("span",{className:"text-sm flex-1 truncate text-foreground",children:b}),g?(0,d.jsx)(G.A,{size:14,className:"text-success shrink-0"}):(0,d.jsx)(H.A,{size:14,className:"text-border shrink-0"})]},a)})})]})}function K({active:a,maximized:b,onMaximize:c,selectedAgentKey:o=null}){let{t:p}=(0,m.Y)(),q=p.panels.agents,r=(0,f.useRouter)(),s=(0,k.kr)(),u=(0,f.usePathname)(),v=(0,f.useSearchParams)(),w="/agents"===u&&"channels"===v.get("tab"),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(!1),F=(0,l.V)(),G=async()=>{y(!0),await s.refresh(),y(!1)},H=s.agents.filter(a=>a.present&&a.installed),I=s.agents.filter(a=>a.present&&!a.installed),K=s.agents.filter(a=>!a.present),L=async a=>{let b=await s.installAgent(a);return b&&await s.refresh(),b},M=u?.startsWith("/agents/")?decodeURIComponent(u.slice(8)):null,N={installing:q.installing,install:q.install,installSuccess:q.installSuccess,installFailed:q.installFailed,retryInstall:q.retryInstall},O={navOverview:q.navOverview,navMcp:q.navMcp,navSkills:q.navSkills,navChannels:q.channels,navNetwork:q.navNetwork,navSessions:q.navSessions,navActivity:q.navActivity},P=(0,d.jsx)(t,{copy:O,connectedCount:H.length,mcpEnabled:s.status?.connectionMode?.mcp??!1,channelsActive:w,onChannelsClick:()=>{r.push("/agents?tab=channels")}});return(0,d.jsxs)("div",{className:`flex flex-col h-full ${a?"":"hidden"}`,children:[(0,d.jsx)(n.A,{title:q.title,maximized:b,onMaximize:c,children:(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[!s.loading&&(0,d.jsxs)("span",{className:"text-2xs text-muted-foreground",children:[H.length," ",q.connected,F.agents.length>0&&(0,d.jsxs)(d.Fragment,{children:[" \xb7 ",q.a2aLabel," ",F.agents.length]})]}),(0,d.jsx)("button",{onClick:G,disabled:x,className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground disabled:opacity-50 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","aria-label":q.refresh,title:q.refresh,type:"button",children:(0,d.jsx)(g.A,{size:12,className:x?"animate-spin":""})})]})}),(0,d.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0",children:s.loading?(0,d.jsx)("div",{className:"flex justify-center py-8",children:(0,d.jsx)(h.A,{size:16,className:"animate-spin text-muted-foreground"})}):0===s.agents.length&&0===s.skills.length?(0,d.jsxs)("div",{className:"flex flex-col gap-2 py-4 px-0",children:[P,(0,d.jsx)("div",{className:"mx-4 border-t border-border"}),(0,d.jsxs)("div",{className:"mx-3 rounded-lg border border-border/40 bg-card/30 px-3 py-5 text-center",children:[(0,d.jsx)("p",{className:"text-xs text-muted-foreground/70 mb-1.5",children:q.noAgents}),(0,d.jsx)("p",{className:"text-2xs text-muted-foreground/40 mb-3",children:q.skillsEmptyHint}),(0,d.jsxs)("button",{onClick:G,type:"button",className:"inline-flex items-center gap-1.5 px-2.5 py-1.5 text-xs rounded-lg border border-border text-muted-foreground hover:text-foreground hover:bg-muted transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:[(0,d.jsx)(g.A,{size:11})," ",q.retry]})]})]}):(0,d.jsxs)("div",{className:"pb-3",children:[P,(0,d.jsx)("div",{className:"mx-4 border-t border-border"}),w?(0,d.jsx)(J,{}):(0,d.jsx)("div",{className:"px-3 py-3 space-y-4",children:(0,d.jsx)(D,{connected:H,detected:I,notFound:K,selectedAgentKey:M??o,listCopy:N,onInstallAgent:L,showNotDetected:z,setShowNotDetected:A,p:{rosterLabel:q.rosterLabel,sectionConnected:q.sectionConnected,sectionDetected:q.sectionDetected,sectionNotDetected:q.sectionNotDetected}})})]})}),(0,d.jsxs)("div",{className:"px-3 py-2 border-t border-border shrink-0 space-y-1",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>C(!0),className:"flex items-center gap-1.5 text-2xs text-muted-foreground hover:text-foreground transition-colors w-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:[(0,d.jsx)(i.A,{size:11}),q.a2aDiscover]}),(0,d.jsxs)("button",{type:"button",onClick:()=>{window.dispatchEvent(new CustomEvent("mindos:open-settings",{detail:{tab:"mcp"}}))},className:"flex items-center gap-1.5 text-2xs text-muted-foreground hover:text-foreground transition-colors w-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:[(0,d.jsx)(j.A,{size:11}),q.advancedConfig]})]}),(0,d.jsx)(E.A,{open:B,onClose:()=>C(!1),onDiscover:F.discover,discovering:F.discovering,error:F.error})]})}},78340:(a,b,c)=>{"use strict";c.r(b),c.d(b,{BacklinksRenderer:()=>l});var d=c(48249),e=c(67484),f=c(19099),g=c(80600),h=c(86588),i=c(33191);function j(a){return a.split("/").pop()?.replace(/\.md$/,"")??a}function k({text:a}){let b=a.split(/(\[\[[^\]]+\]\]|\[[^\]]+\]\([^)]+\))/g);return(0,d.jsx)("span",{children:b.map((a,b)=>/^\[\[/.test(a)||/^\[/.test(a)?(0,d.jsx)("span",{style:{color:"var(--amber)",fontWeight:500},children:a},b):(0,d.jsx)("span",{children:a},b))})}function l({filePath:a}){let b=(0,f.useRouter)(),[c,l]=(0,e.useState)(null),[m,n]=(0,e.useState)(!0);if(m)return(0,d.jsx)("div",{className:"font-display",style:{padding:"3rem 1rem",textAlign:"center",fontSize:12,color:"var(--muted-foreground)"},children:"Scanning backlinks…"});let o=c??[];return(0,d.jsxs)("div",{style:{maxWidth:720,margin:"0 auto",padding:"1.5rem 0"},children:[(0,d.jsx)("div",{style:{marginBottom:"1.5rem",display:"flex",alignItems:"center",gap:8},children:(0,d.jsx)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:0===o.length?"No backlinks found":`${o.length} file${1===o.length?"":"s"} link here`})}),0===o.length?(0,d.jsxs)("div",{style:{border:"1px dashed var(--border)",borderRadius:10,padding:"2.5rem 1.5rem",textAlign:"center",color:"var(--muted-foreground)",fontSize:13},children:[(0,d.jsx)(g.A,{size:28,style:{margin:"0 auto 10px",opacity:.3}}),(0,d.jsxs)("p",{className:"font-display",style:{fontSize:12},children:["No other files link to ",(0,d.jsx)("strong",{style:{color:"var(--foreground)"},children:j(a)})," yet."]})]}):(0,d.jsx)("div",{style:{display:"flex",flexDirection:"column",gap:10},children:o.map(({filePath:a,snippets:c})=>{let e,f=j(a),l=(e=a.split("/")).length>1?e.slice(0,-1).join("/"):"";return(0,d.jsxs)("div",{style:{background:"var(--card)",border:"1px solid var(--border)",borderRadius:10,overflow:"hidden",cursor:"pointer",transition:"border-color .15s"},onClick:()=>b.push("/view/"+(0,i.O0)(a)),onMouseEnter:a=>a.currentTarget.style.borderColor="rgba(200,135,58,0.4)",onMouseLeave:a=>a.currentTarget.style.borderColor="var(--border)",children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8,padding:"10px 14px",borderBottom:c.length>0?"1px solid var(--border)":"none",background:"var(--muted)"},children:[(0,d.jsx)(g.A,{size:13,style:{color:"var(--muted-foreground)",flexShrink:0}}),(0,d.jsx)("span",{style:{fontWeight:600,fontSize:"0.85rem",color:"var(--foreground)",flex:1,minWidth:0,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:f}),l&&(0,d.jsx)("span",{className:"font-display",style:{fontSize:"0.68rem",color:"var(--muted-foreground)",opacity:.6,flexShrink:0},children:l}),(0,d.jsx)(h.A,{size:11,style:{color:"var(--muted-foreground)",opacity:.5,flexShrink:0}})]}),c.map((a,b)=>(0,d.jsx)("div",{style:{padding:"8px 14px",borderBottom:b<c.length-1?"1px solid var(--border)":"none",background:"var(--background)"},children:a.split("\n").map((a,b)=>(0,d.jsx)("div",{className:"font-display",style:{fontSize:"0.72rem",color:"var(--muted-foreground)",lineHeight:1.6,whiteSpace:"pre-wrap",wordBreak:"break-word"},children:(0,d.jsx)(k,{text:a})},b))},b))]},a)})})]})}c(95054)},78890:(a,b,c)=>{"use strict";c.d(b,{G:()=>i,M:()=>j});var d=c(48249),e=c(2116),f=c.n(e),g=c(19794),h=c(33191);function i({icon:a,title:b,subtitle:c,badge:e,href:i,onClick:j,active:k}){let l=(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-muted text-muted-foreground",children:a}),(0,d.jsxs)("span",{className:"flex-1 min-w-0",children:[(0,d.jsx)("span",{className:"block text-left text-sm font-medium text-foreground truncate",title:b,children:b}),c?(0,d.jsx)("span",{className:"block text-left text-2xs text-muted-foreground truncate",title:c,children:c}):null]}),e,(0,d.jsx)(g.A,{size:14,className:"shrink-0 text-muted-foreground"})]}),m=!!k,n=(0,h.cn)("relative flex items-center gap-3 py-2.5 transition-[background-color] duration-150 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",m?"bg-[var(--amber-dim)]/40 pl-3.5 pr-4 text-foreground":"px-4",!m&&"cursor-pointer hover:bg-muted/50",m&&"cursor-default"),o=m?(0,d.jsx)("span",{className:"pointer-events-none absolute bottom-[22%] left-0 top-[22%] w-0.5 rounded-r-full bg-[var(--amber)]","aria-hidden":!0}):null;return i?(0,d.jsxs)(f(),{href:i,className:n,"aria-current":k?"page":void 0,children:[o,l]}):(0,d.jsxs)("button",{type:"button",onClick:j,className:(0,h.cn)(n,"w-full"),children:[o,l]})}function j({label:a}){return(0,d.jsx)("span",{className:"text-2xs px-2 py-0.5 rounded-full bg-muted text-muted-foreground shrink-0",children:a})}},80829:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(48249),e=c(67484),f=c(46674),g=c(49681),h=c(2797),i=c(69924),j=c(9311),k=c(81285);function l({open:a,onClose:b,anchorRect:c,railWidth:l,onOpenSyncSettings:m,syncStatus:n,onSyncStatusRefresh:o}){let p=(0,e.useRef)(null);(0,e.useRef)(b).current=b;let{syncing:q,syncResult:r,syncNow:s}=(0,j.bj)(o);if(!a||!c)return null;let t=(0,j.Bq)(n,q),{label:u}=(0,j.ky)(t,n),v=Math.max(8,c.bottom-180);return(0,d.jsxs)("div",{ref:p,className:"fixed z-40 w-[240px] border rounded-lg bg-card shadow-lg border-border animate-in fade-in slide-in-from-left-2 duration-150",style:{top:v,left:l},children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[(0,d.jsx)("span",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wider",children:"Sync"}),(0,d.jsx)("button",{onClick:b,className:"p-0.5 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-2 focus-visible:ring-ring","aria-label":"Close",children:(0,d.jsx)(f.A,{size:14})})]}),(0,d.jsxs)("div",{className:"p-3 space-y-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("span",{className:`w-2.5 h-2.5 rounded-full shrink-0 ${j.BG[t]} ${"syncing"===t||"conflicts"===t||"error"===t?"animate-pulse":""}`}),(0,d.jsx)("span",{className:"text-sm text-foreground",children:u}),"success"===r&&(0,d.jsx)(g.A,{size:14,className:"text-success shrink-0"}),"error"===r&&(0,d.jsx)(h.A,{size:14,className:"text-error shrink-0"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:["off"!==t&&(0,d.jsxs)(k.jn,{onClick:s,disabled:q,className:"text-xs px-3 py-1.5 flex items-center gap-1.5",children:[(0,d.jsx)(i.A,{size:12,className:q?"animate-spin":""}),"Sync Now"]}),(0,d.jsx)("button",{onClick:()=>{m(),b()},className:"text-xs text-muted-foreground hover:text-foreground transition-colors rounded px-1 py-0.5 focus-visible:ring-2 focus-visible:ring-ring",children:"Settings →"})]})]})]})}},80992:(a,b,c)=>{"use strict";c.r(b),c.d(b,{GraphRenderer:()=>j});var d=c(48249),e=c(67484),f=c(19099),g=c(96103),h=c(54633);c(71763),c(95054);let i=(0,e.memo)(function({data:a}){let b=(0,f.useRouter)(),{label:c,id:i,isCurrent:j,isOrphan:k,size:l=1}=a,m=(0,e.useCallback)(()=>{let a=i.split("/").map(encodeURIComponent).join("/");b.push("/view/"+a)},[i,b]),n=.8+Math.min(.1*l,1.2);return(0,d.jsxs)("div",{onClick:m,title:i,className:"group font-display",style:{fontSize:10*n,padding:`${4*n}px ${12*n}px`,borderRadius:999,cursor:"pointer",userSelect:"none",whiteSpace:"nowrap",maxWidth:240,overflow:"hidden",textOverflow:"ellipsis",opacity:k?.4:1,background:j?"var(--amber)":"var(--card)",color:j?"var(--amber-foreground)":"var(--foreground)",border:`1.5px solid ${j?"var(--amber)":"var(--border)"}`,boxShadow:j?"0 0 20px var(--amber-dim), 0 0 0 2px var(--amber-dim)":"0 2px 4px rgba(0,0,0,0.1)",transition:"all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",zIndex:j?10:1},onMouseEnter:a=>{j||(a.currentTarget.style.borderColor="var(--amber)",a.currentTarget.style.background="var(--accent)")},onMouseLeave:a=>{j||(a.currentTarget.style.borderColor="var(--border)",a.currentTarget.style.background="var(--card)")},children:[(0,d.jsx)(g.h7,{type:"target",position:h.yX.Top,style:{opacity:0}}),c,(0,d.jsx)(g.h7,{type:"source",position:h.yX.Bottom,style:{opacity:0}})]})});function j({filePath:a}){let[b,c]=(0,e.useState)(null),[f,h]=(0,e.useState)(!0),[j,k]=(0,e.useState)("local"),[l,m]=(0,e.useState)(!1),n=(0,e.useMemo)(()=>{if(!b)return new Map;let a=new Map;for(let c of b.edges)a.set(c.source,(a.get(c.source)||0)+1),a.set(c.target,(a.get(c.target)||0)+1);return a},[b]),o=(0,e.useMemo)(()=>{if(!b)return null;let a=new Map;for(let c of b.edges)a.has(c.source)||a.set(c.source,new Set),a.has(c.target)||a.set(c.target,new Set),a.get(c.source).add(c.target),a.get(c.target).add(c.source);return a},[b]),{filteredNodes:p,filteredEdges:q}=(0,e.useMemo)(()=>{let c,d;if(!b)return{filteredNodes:[],filteredEdges:[]};if("global"===j)c=b.nodes,d=b.edges;else{let e=new Set,f=[{id:a,depth:0}];for(e.add(a);f.length>0;){let{id:a,depth:b}=f.shift();if(!(b>=2))for(let c of o?.get(a)??new Set)e.has(c)||(e.add(c),f.push({id:c,depth:b+1}))}let g=new Set((c=b.nodes.filter(a=>e.has(a.id))).map(a=>a.id));d=b.edges.filter(a=>g.has(a.source)&&g.has(a.target))}return{filteredNodes:c,filteredEdges:d}},[b,j,a,o]),r=(0,e.useMemo)(()=>{let a=new Set;for(let b of q)a.add(b.source),a.add(b.target);return a},[q]),{rfNodes:s,rfEdges:t}=(0,e.useMemo)(()=>{if(0===p.length)return{rfNodes:[],rfEdges:[]};let b=function(a,b,c){let d=a.length;if(0===d)return{};let e=(void 0)??(d>100?80:150),f=.6*Math.sqrt(108e4/Math.max(d,1)),g={};a.forEach((a,b)=>{let c=2*Math.PI*b/d,e=360*Math.random();g[a]={x:600+Math.cos(c)*e,y:450+Math.sin(c)*e}});let h={};for(let c=0;c<e;c++){let i=120*(1-c/e);for(let b of a)h[b]={x:0,y:0};for(let b=0;b<d;b++)for(let c=b+1;c<d;c++){let d=a[b],e=a[c],i=g[d].x-g[e].x,j=g[d].y-g[e].y,k=Math.sqrt(i*i+j*j||.01),l=f*f/k;h[d].x+=i/k*l,h[d].y+=j/k*l,h[e].x-=i/k*l,h[e].y-=j/k*l}for(let a of b){let b=a.source,c=a.target;if(!g[b]||!g[c])continue;let d=g[b].x-g[c].x,e=g[b].y-g[c].y,i=Math.sqrt(d*d+e*e||.01),j=i*i/f;h[b].x-=d/i*j,h[b].y-=e/i*j,h[c].x+=d/i*j,h[c].y+=e/i*j}for(let b of a){let a=g[b].x-600,c=g[b].y-450,d=Math.sqrt(a*a+c*c)||.01,e=.05*d;h[b].x-=a/d*e,h[b].y-=c/d*e}for(let b of a){let a=h[b],c=Math.sqrt(a.x*a.x+a.y*a.y)||.01;g[b].x+=a.x/c*Math.min(c,i),g[b].y+=a.y/c*Math.min(c,i),g[b].x=Math.max(0,Math.min(1200,g[b].x)),g[b].y=Math.max(0,Math.min(900,g[b].y))}}return g}(p.map(a=>a.id),q);return{rfNodes:p.map(c=>({id:c.id,type:"wiki",position:b[c.id]??{x:0,y:0},data:{label:c.label,id:c.id,isCurrent:c.id===a,isOrphan:!r.has(c.id),size:n.get(c.id)||1}})),rfEdges:q.map((b,c)=>{let d=b.source===a||b.target===a;return{id:`e-${c}`,source:b.source,target:b.target,type:"default",markerEnd:{type:"arrowclosed",color:d?"var(--amber)":"var(--border)"},style:{stroke:d?"var(--amber)":"var(--border)",strokeWidth:d?1.5:1,opacity:d?.8:.4},animated:d}})}},[p,q,a,r,n]),u=(0,e.useMemo)(()=>({wiki:i}),[]);return!l||f?(0,d.jsx)("div",{style:{width:"100%",height:"calc(100vh - 160px)",minHeight:400,borderRadius:12,background:"var(--muted)",border:"1px solid var(--border)",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,d.jsx)("span",{className:"font-display",style:{color:"var(--muted-foreground)",fontSize:12},children:f?"Building graph…":"Loading…"})}):(0,d.jsxs)("div",{style:{width:"100%",position:"relative",zIndex:0},children:[(0,d.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:12,marginBottom:10,flexWrap:"wrap"},children:[(0,d.jsxs)("span",{className:"font-display",style:{fontSize:11,color:"var(--muted-foreground)"},children:[p.length," nodes \xb7 ",q.length," edges"]}),(0,d.jsx)("div",{style:{display:"flex",gap:2,padding:3,borderRadius:8,background:"var(--muted)"},children:[{id:"local",label:"Local"},{id:"global",label:"Global"}].map(a=>(0,d.jsx)("button",{onClick:()=>k(a.id),className:"font-display",style:{padding:"3px 12px",borderRadius:5,fontSize:11,cursor:"pointer",border:"none",outline:"none",background:j===a.id?"var(--card)":"transparent",color:j===a.id?"var(--foreground)":"var(--muted-foreground)",boxShadow:j===a.id?"0 1px 3px rgba(0,0,0,0.1)":"none",transition:"all 0.1s"},children:a.label},a.id))})]}),(0,d.jsx)("div",{style:{width:"100%",height:"calc(100vh - 160px)",minHeight:400},children:(0,d.jsxs)(g.Gc,{nodes:s,edges:t,nodeTypes:u,fitView:!0,fitViewOptions:{padding:.15},proOptions:{hideAttribution:!0},style:{background:"var(--background)",borderRadius:12,border:"1px solid var(--border)"},children:[(0,d.jsx)(g.VS,{color:"var(--border)",gap:24,size:1,variant:g._5.Dots}),(0,d.jsx)(g.H2,{showInteractive:!1}),(0,d.jsx)(g.of,{nodeColor:a=>a.data?.isCurrent?"var(--amber)":"var(--muted-foreground)"})]})})]})}},81285:(a,b,c)=>{"use strict";c.d(b,{D0:()=>k,jn:()=>p,l6:()=>n,lM:()=>o,pd:()=>l,yA:()=>m});var d=c(48249),e=c(67484),f=c.n(e),g=c(41479),h=c(61075),i=c(44218),j=c(42742);function k({label:a,hint:b,hintError:c,children:e}){return(0,d.jsxs)("div",{className:"space-y-1.5",children:[(0,d.jsx)("label",{className:"text-sm text-foreground font-medium",children:a}),e,b&&(0,d.jsx)("p",{className:`text-xs ${c?"text-destructive":"text-muted-foreground"}`,children:b})]})}function l({className:a="",...b}){return(0,d.jsx)("input",{...b,className:`w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground placeholder:text-muted-foreground outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 ${a}`})}function m({value:a,onChange:b,placeholder:c,disabled:f,className:i="",size:j="md"}){let[k,l]=(0,e.useState)(!1),m="sm"===j;return(0,d.jsxs)("div",{className:`flex items-center border border-border rounded-lg bg-background focus-within:ring-1 focus-within:ring-ring overflow-hidden ${i}`,children:[(0,d.jsx)("input",{type:k?"text":"password",value:a,onChange:a=>b(a.target.value),placeholder:c??"••••••••",disabled:f,className:`flex-1 bg-transparent text-foreground placeholder:text-muted-foreground outline-none disabled:opacity-50 ${m?"px-2.5 py-1.5 text-xs font-mono":"px-3 py-2 text-sm"}`}),!!a&&(0,d.jsx)("button",{type:"button",tabIndex:-1,onMouseDown:a=>a.preventDefault(),onClick:()=>l(a=>!a),disabled:f,className:`shrink-0 text-muted-foreground hover:text-foreground transition-colors disabled:opacity-50 ${m?"p-1.5":"p-2"}`,title:k?"Hide":"Show",children:k?(0,d.jsx)(g.A,{size:m?14:16}):(0,d.jsx)(h.A,{size:m?14:16})})]})}function n({value:a,onChange:b,children:c,className:g="",disabled:h}){let k=(0,e.useId)(),[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(-1),p=(0,e.useRef)(null),q=(0,e.useRef)(null),r=(0,e.useMemo)(()=>f().Children.toArray(c).filter(a=>f().isValidElement(a)&&"option"===a.type).map(a=>({value:String(a.props.value??""),label:String(a.props.children??a.props.value??"")})),[c]),s=r.findIndex(b=>b.value===a),t=r[s]?.label??"",u=(0,e.useCallback)(a=>{a>=0&&a<r.length&&(b?.({target:{value:r[a].value}}),m(!1))},[r,b]),v=(0,e.useCallback)(a=>{if(!l){["Enter"," ","ArrowDown","ArrowUp"].includes(a.key)&&(a.preventDefault(),m(!0),o(s>=0?s:0));return}switch(a.key){case"ArrowDown":a.preventDefault(),o(a=>Math.min(a+1,r.length-1));break;case"ArrowUp":a.preventDefault(),o(a=>Math.max(a-1,0));break;case"Enter":case" ":a.preventDefault(),u(n);break;case"Escape":a.preventDefault(),m(!1);break;case"Tab":m(!1)}},[l,r.length,s,n,u]);return(0,d.jsxs)("div",{ref:p,className:`relative ${g}`,children:[(0,d.jsxs)("button",{type:"button",disabled:h,onClick:()=>{m(a=>!a),o(s>=0?s:0)},onKeyDown:v,"aria-haspopup":"listbox","aria-expanded":l,className:"w-full px-3 py-2 text-sm bg-background border border-border rounded-lg text-foreground text-left flex items-center justify-between gap-2 outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,d.jsx)("span",{className:`truncate ${t?"":"text-muted-foreground"}`,children:t||"—"}),(0,d.jsx)(i.A,{size:14,className:`shrink-0 text-muted-foreground transition-transform duration-150 ${l?"rotate-180":""}`})]}),l&&(0,d.jsx)("div",{ref:q,role:"listbox","aria-activedescendant":n>=0?`${k}-opt-${n}`:void 0,className:"absolute z-20 w-full mt-1 py-1 border border-border rounded-lg bg-card shadow-lg max-h-60 overflow-auto animate-in fade-in-0 zoom-in-95 duration-100",children:r.map((b,c)=>{let e=b.value===a,f=c===n;return(0,d.jsxs)("button",{id:`${k}-opt-${c}`,role:"option","aria-selected":e,type:"button",onMouseDown:a=>{a.preventDefault(),u(c)},onMouseEnter:()=>o(c),className:`w-full px-3 py-1.5 text-sm text-left flex items-center gap-2 transition-colors ${f?"bg-accent text-accent-foreground":"text-foreground"}`,children:[(0,d.jsx)(j.A,{size:14,className:`shrink-0 ${e?"text-[var(--amber)]":"invisible"}`}),(0,d.jsx)("span",{className:"truncate",children:b.label})]},b.value)})})]})}function o({checked:a,onChange:b,size:c="md",disabled:e,title:f,onClick:g}){let h="sm"===c;return(0,d.jsx)("button",{type:"button",role:"switch","aria-checked":a,disabled:e,title:f,onClick:g??(()=>b?.(!a)),className:`relative inline-flex shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-60 ${h?"h-4 w-7":"h-5 w-9"} ${a?"bg-[var(--amber)]":"bg-muted"}`,children:(0,d.jsx)("span",{className:`pointer-events-none inline-block rounded-full bg-white shadow-sm transition-transform ${h?"h-3 w-3":"h-4 w-4"} ${a?h?"translate-x-3":"translate-x-4":"translate-x-0"}`})})}function p({children:a,disabled:b,onClick:c,type:e="button",className:f="",...g}){return(0,d.jsx)("button",{type:e,onClick:c,disabled:b,className:`px-4 py-2 text-sm font-medium rounded-lg bg-[var(--amber)] text-[var(--amber-foreground)] transition-colors disabled:opacity-40 disabled:cursor-not-allowed ${f}`,...g,children:a})}},82110:(a,b,c)=>{"use strict";c.d(b,{A:()=>h});var d=c(48249),e=c(67484),f=c(95801),g=c(93096);function h({results:a,selectedIndex:b,query:c,onSelect:h}){let i=(0,e.useRef)(null),j=(0,e.useRef)(null),[k,l]=(0,e.useState)(280);return 0===a.length?null:(0,d.jsxs)("div",{ref:j,className:"border border-border rounded-lg bg-card shadow-lg overflow-hidden",children:[(0,d.jsxs)("div",{className:"px-3 py-1.5 border-b border-border flex items-center gap-1.5",children:[(0,d.jsx)(f.A,{size:11,className:"text-[var(--amber)]/50"}),(0,d.jsx)("span",{className:"text-2xs font-medium text-muted-foreground/70 uppercase tracking-wider",children:"Skills"}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/40 ml-auto",children:a.length})]}),(0,d.jsx)("div",{ref:i,className:"overflow-y-auto",style:{maxHeight:k},children:a.map((a,e)=>(0,d.jsxs)("button",{type:"button",onMouseDown:b=>{b.preventDefault(),h(a)},className:`w-full flex items-center gap-2.5 px-3 py-2 text-left transition-colors ${e===b?"bg-accent text-foreground":"text-muted-foreground hover:bg-muted"}`,children:[(0,d.jsx)(f.A,{size:13,className:"text-[var(--amber)] shrink-0"}),(0,d.jsxs)("span",{className:"text-sm font-medium shrink-0",children:["/",(0,d.jsx)(g.A,{text:a.name,query:c})]}),a.description&&(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/50 truncate min-w-0 flex-1",title:a.description,children:a.description})]},a.name))}),(0,d.jsxs)("div",{className:"px-3 py-1.5 border-t border-border flex gap-3 text-2xs text-muted-foreground/40 shrink-0",children:[(0,d.jsx)("span",{children:"↑↓ navigate"}),(0,d.jsx)("span",{children:"↵ / Tab select"}),(0,d.jsx)("span",{children:"ESC dismiss"})]})]})}},82626:(a,b,c)=>{"use strict";c.d(b,{A:()=>r});var d=c(48249),e=c(19099),f=c(4815),g=c(46218),h=c(61075),i=c(4140),j=c(78890),k=c(67484),l=c(70971),m=c(8455),n=c(22341);c(95054);var o=c(47223);function p(){let[a,b]=(0,k.useState)(null),[c,e]=(0,k.useState)([]),[f,g]=(0,k.useState)(!0),{t:h}=(0,o.Y)();return f||!a?(0,d.jsx)("div",{className:"px-3 py-2 text-xs text-muted-foreground",children:(0,d.jsx)("div",{className:"h-2 w-20 bg-muted rounded animate-pulse"})}):(0,d.jsxs)("div",{className:"flex flex-col gap-2 px-3 py-3 border-t border-border",children:[(0,d.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[(0,d.jsxs)("div",{className:"flex flex-col items-center p-1.5 rounded bg-muted/40 hover:bg-muted/60 transition-colors cursor-default",children:[(0,d.jsx)("div",{className:"text-sm font-semibold text-foreground",children:a.fileCount}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:"Files"})]}),(0,d.jsxs)("div",{className:"flex flex-col items-center p-1.5 rounded bg-muted/40 hover:bg-muted/60 transition-colors cursor-default",children:[(0,d.jsx)("div",{className:"text-sm font-semibold text-foreground",children:a.unreadChanges}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:"Changes"})]}),(0,d.jsxs)("div",{className:"flex flex-col items-center p-1.5 rounded bg-muted/40 hover:bg-muted/60 transition-colors cursor-default",children:[(0,d.jsx)("div",{className:"text-sm font-semibold text-foreground",children:a.sessionCount}),(0,d.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:"Chats"})]})]}),c.length>0&&(0,d.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,d.jsx)("div",{className:"text-xs font-medium text-muted-foreground px-0.5",children:"Recent"}),c.map(a=>{let b=function(a){try{let b=new Date(a),c=new Date().getTime()-b.getTime(),d=Math.floor(c/6e4),e=Math.floor(c/36e5),f=Math.floor(c/864e5);if(d<1)return"now";if(d<60)return`${d}m ago`;if(e<24)return`${e}h ago`;if(f<7)return`${f}d ago`;return b.toLocaleDateString("en-US",{month:"short",day:"numeric"})}catch{return"recently"}}(a.ts),c=function(a){switch(a){case"create":return(0,d.jsx)(l.A,{size:12,className:"text-success"});case"write":case"append":return(0,d.jsx)(m.A,{size:12,className:"text-foreground"});case"delete":return(0,d.jsx)(m.A,{size:12,className:"text-destructive"});case"rename":case"move":return(0,d.jsx)(n.A,{size:12,className:"text-muted-foreground"});default:return(0,d.jsx)(m.A,{size:12,className:"text-muted-foreground"})}}(a.op),e=a.path.split("/").pop()||a.path;return(0,d.jsxs)("div",{className:"flex items-start gap-2 p-1.5 rounded hover:bg-muted/40 transition-colors text-xs",children:[(0,d.jsx)("span",{className:"text-muted-foreground shrink-0 mt-0.5",children:c}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"text-foreground truncate font-medium",title:e,children:e}),(0,d.jsx)("p",{className:"text-muted-foreground text-2xs",children:b})]})]},a.id)})]})]})}var q=c(10072);function r({active:a,maximized:b,onMaximize:c}){let{t:k}=(0,o.Y)(),l=k.panels.echo,m=(0,e.usePathname)()??"",n={imprint:{icon:(0,d.jsx)(f.A,{size:14}),title:l.imprintTitle},growth:{icon:(0,d.jsx)(g.A,{size:14}),title:l.growthTitle},self:{icon:(0,d.jsx)(h.A,{size:14}),title:l.selfTitle}};return(0,d.jsxs)("div",{className:`flex flex-col h-full ${a?"":"hidden"}`,children:[(0,d.jsx)(i.A,{title:l.title,maximized:b,onMaximize:c}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0 flex flex-col",children:[(0,d.jsx)("div",{className:"flex flex-col gap-0.5 py-1.5",children:q.RS.map(a=>{let b=n[a],c=q.AI[a],e=m===c||m.startsWith(`${c}/`);return(0,d.jsx)(j.G,{href:c,icon:b.icon,title:b.title,active:e},a)})}),(0,d.jsx)("div",{className:"mt-auto",children:(0,d.jsx)(p,{})})]})]})}},82704:()=>{},82884:(a,b,c)=>{"use strict";c.d(b,{Un:()=>f});var d=c(67484);let e="mindos-renderer-state-change";function f(a,b,c){let f=`mindos-renderer:${a}:${b}`,g=(0,d.useRef)({key:f,raw:null,parsed:c});return g.current.key!==f&&(g.current={key:f,raw:null,parsed:c}),[(0,d.useSyncExternalStore)(a=>{let b=()=>a();return window.addEventListener("storage",b),window.addEventListener(e,b),()=>{window.removeEventListener("storage",b),window.removeEventListener(e,b)}},()=>{try{let a=localStorage.getItem(f);if(a===g.current.raw)return g.current.parsed;if(null===a)return g.current={key:f,raw:null,parsed:c},c;let b=JSON.parse(a);return g.current={key:f,raw:a,parsed:b},b}catch{return c}},()=>c),(0,d.useCallback)(a=>{try{let b=(()=>{try{let a=localStorage.getItem(f);return null!==a?JSON.parse(a):c}catch{return c}})(),d="function"==typeof a?a(b):a,e=JSON.stringify(d);localStorage.setItem(f,e),g.current={key:f,raw:e,parsed:d}}catch{}window.dispatchEvent(new Event(e))},[f,c])]}},83539:(a,b,c)=>{"use strict";c.r(b),c.d(b,{WorkflowYamlRenderer:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call WorkflowYamlRenderer() from the server but WorkflowYamlRenderer is on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/components/renderers/workflow-yaml/WorkflowYamlRenderer.tsx","WorkflowYamlRenderer")},84197:(a,b,c)=>{"use strict";c.d(b,{A:()=>o});var d=c(48249),e=c(67484),f=c(2116),g=c.n(f),h=c(24520),i=c(40560),j=c(95801),k=c(31675),l=c(4140),m=c(47223),n=c(33191);function o({active:a,maximized:b,onMaximize:c}){let{t:f}=(0,m.Y)(),o=f.panels.workflows,[p,q]=(0,e.useState)([]),[r,s]=(0,e.useState)(!0),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)(""),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(""),B=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/workflows");if(!a.ok)return;let b=await a.json();q(b.workflows??[])}catch{}finally{s(!1)}},[]),C=async()=>{let a=v.trim();if(a&&!x){y(!0),A("");try{let b=await fetch("/api/workflows",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a})}),c=await b.json();if(!b.ok)return void A(409===b.status?o.exists:c.error||"Error");u(!1),w(""),await B(),window.location.href=`/view/${(0,n.O0)(c.path)}`}catch{A("Network error")}finally{y(!1)}}};return(0,d.jsxs)("div",{className:`flex flex-col h-full ${a?"":"hidden"}`,children:[(0,d.jsx)(l.A,{title:o.title,maximized:b,onMaximize:c,children:(0,d.jsx)("button",{onClick:()=>u(a=>!a),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors focus-visible:ring-1 focus-visible:ring-ring","aria-label":o.newWorkflow,title:o.newWorkflow,children:(0,d.jsx)(h.A,{size:13})})}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0",children:[t&&(0,d.jsxs)("div",{className:"px-3 py-3 border-b border-border",children:[(0,d.jsx)("label",{className:"block text-xs font-medium text-muted-foreground mb-1.5",children:o.name}),(0,d.jsx)("input",{type:"text",value:v,onChange:a=>{w(a.target.value),A("")},onKeyDown:a=>"Enter"===a.key&&C(),placeholder:o.namePlaceholder,autoFocus:!0,className:"w-full px-2.5 py-1.5 text-sm rounded-md border border-border bg-background text-foreground placeholder:text-muted-foreground focus:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),z&&(0,d.jsx)("p",{className:"text-xs text-[var(--error)] mt-1",children:z}),(0,d.jsxs)("div",{className:"flex gap-2 mt-2.5",children:[(0,d.jsx)("button",{onClick:()=>{u(!1),w(""),A("")},className:"flex-1 px-3 py-1.5 text-xs rounded-md border border-border text-muted-foreground hover:bg-muted transition-colors",children:o.cancel}),(0,d.jsx)("button",{onClick:C,disabled:!v.trim()||x,className:"flex-1 px-3 py-1.5 text-xs rounded-md font-medium transition-colors disabled:opacity-50 bg-[var(--amber)] text-[var(--amber-foreground)]",children:x?o.creating:o.create})]})]}),r&&(0,d.jsx)("div",{className:"flex items-center justify-center py-8 text-muted-foreground",children:(0,d.jsx)(i.A,{size:16,className:"animate-spin"})}),!r&&0===p.length&&!t&&(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center py-10 px-4 text-center",children:[(0,d.jsx)(j.A,{size:24,className:"text-muted-foreground/40 mb-3"}),(0,d.jsx)("p",{className:"text-sm font-medium text-muted-foreground mb-1",children:o.empty}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground/70 mb-4 max-w-[200px]",children:o.emptyDesc}),(0,d.jsxs)("button",{onClick:()=>u(!0),className:"inline-flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md font-medium bg-[var(--amber)] text-[var(--amber-foreground)] transition-colors",children:[(0,d.jsx)(h.A,{size:12}),o.newWorkflow]})]}),!r&&p.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-0.5 py-1.5",children:p.map(a=>(0,d.jsxs)(g(),{href:`/view/${(0,n.O0)(a.path)}`,className:`flex items-start gap-2.5 px-3 py-2 mx-1 rounded-lg transition-colors hover:bg-muted ${a.error?"opacity-70":""}`,children:[(0,d.jsx)(j.A,{size:14,className:"shrink-0 mt-0.5 text-[var(--amber)]"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"text-sm font-medium text-foreground block truncate",children:a.title}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[a.error?(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 text-2xs text-[var(--error)]",children:[(0,d.jsx)(k.A,{size:10}),o.parseError]}):(0,d.jsx)("span",{className:"text-2xs text-muted-foreground",children:o.nSteps(a.stepCount)}),(0,d.jsx)("span",{className:"text-2xs text-muted-foreground/60",suppressHydrationWarning:!0,children:(0,n.KW)(a.mtime,f.home?.relativeTime)})]})]})]},a.path))})]})]})}},84276:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(5735);function e(){return(0,d.jsxs)("div",{className:"content-width px-4 md:px-6 py-10 md:py-14 animate-pulse","aria-busy":"true","aria-label":"Loading",children:[(0,d.jsxs)("div",{className:"mb-10",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3 mb-2",children:[(0,d.jsx)("div",{className:"w-1 h-7 rounded-full bg-muted"}),(0,d.jsx)("div",{className:"h-6 w-28 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"h-4 w-64 bg-muted rounded ml-4 mb-6"}),(0,d.jsxs)("div",{className:"w-full max-w-xl flex flex-col sm:flex-row items-stretch sm:items-center gap-2 ml-4",children:[(0,d.jsx)("div",{className:"flex-1 h-12 rounded-xl bg-muted"}),(0,d.jsx)("div",{className:"h-12 w-16 rounded-xl bg-muted shrink-0"})]}),(0,d.jsxs)("div",{className:"flex items-center gap-3 mt-4 ml-4",children:[(0,d.jsx)("div",{className:"h-9 w-28 rounded-lg bg-muted"}),(0,d.jsx)("div",{className:"h-9 w-40 rounded-lg bg-muted"})]})]}),(0,d.jsxs)("div",{className:"mb-10",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,d.jsx)("div",{className:"w-4 h-4 rounded bg-muted"}),(0,d.jsx)("div",{className:"h-4 w-16 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2",children:Array.from({length:6}).map((a,b)=>(0,d.jsxs)("div",{className:"flex items-start gap-3 px-3.5 py-3 rounded-xl border border-border",children:[(0,d.jsx)("div",{className:"w-5 h-5 rounded bg-muted shrink-0 mt-0.5"}),(0,d.jsxs)("div",{className:"flex-1 space-y-1.5",children:[(0,d.jsx)("div",{className:"h-4 w-20 bg-muted rounded"}),(0,d.jsx)("div",{className:"h-3 w-full bg-muted rounded"}),(0,d.jsx)("div",{className:"h-3 w-12 bg-muted rounded"})]})]},b))})]}),(0,d.jsxs)("div",{className:"mb-10",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,d.jsx)("div",{className:"w-4 h-4 rounded bg-muted"}),(0,d.jsx)("div",{className:"h-4 w-24 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"flex flex-col gap-3",children:Array.from({length:3}).map((a,b)=>(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 px-1 py-1.5",children:[(0,d.jsx)("div",{className:"w-4 h-4 rounded bg-muted"}),(0,d.jsx)("div",{className:"h-3 w-24 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"flex flex-col gap-0.5 ml-2 border-l border-border/40 pl-3",children:Array.from({length:2}).map((a,b)=>(0,d.jsxs)("div",{className:"flex items-center gap-3 px-3 py-2",children:[(0,d.jsx)("div",{className:"w-3 h-3 rounded bg-muted shrink-0"}),(0,d.jsxs)("div",{className:"flex-1 space-y-1",children:[(0,d.jsx)("div",{className:"h-4 w-40 bg-muted rounded"}),(0,d.jsx)("div",{className:"h-3 w-24 bg-muted rounded"})]}),(0,d.jsx)("div",{className:"h-3 w-12 bg-muted rounded shrink-0"})]},b))})]},b))})]})]})}},84668:(a,b,c)=>{"use strict";c.d(b,{A:()=>o});var d=c(48249),e=c(67484),f=c(31417),g=c(21245);let h="mindos_walkthrough_done";function i(a,b){if(a>=g.g.length||b)try{localStorage.setItem(h,"1")}catch{}fetch("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:{walkthroughStep:a,walkthroughDismissed:b}})}).catch(a=>{console.warn("[walkthrough-store] persist failed:",a)})}let j=(0,f.v)((a,b)=>{let c=g.g.length;return{status:"idle",currentStep:0,totalSteps:c,start:()=>{a({currentStep:0,status:"active"}),i(0,!1)},next:()=>{let d=b().currentStep+1;d>=c?(a({status:"completed"}),i(c,!1)):(a({currentStep:d}),i(d,!1))},back:()=>{let c=b().currentStep;c>0&&(a({currentStep:c-1}),i(c-1,!1))},skip:()=>{a({status:"dismissed"}),i(b().currentStep,!0)},_init:()=>{let b="1"===new URLSearchParams(window.location.search).get("welcome");if(b){let a=new URL(window.location.href);a.searchParams.delete("welcome"),window.history.replaceState({},"",a.pathname+(a.search||"")),window.dispatchEvent(new Event("mindos:first-visit"))}return window.innerWidth<768||function(){try{return"1"===localStorage.getItem(h)}catch{return!1}}()?()=>{}:(fetch("/api/setup").then(a=>a.json()).then(d=>{let e=d.guideState;if(e){if(e.walkthroughDismissed||"number"==typeof e.walkthroughStep&&e.walkthroughStep>=c){try{localStorage.setItem(h,"1")}catch{}return}e.active&&!e.dismissed&&void 0===e.walkthroughStep?b&&a({status:"active",currentStep:0}):"number"==typeof e.walkthroughStep&&e.walkthroughStep>=0&&e.walkthroughStep<c&&!e.walkthroughDismissed&&a({status:"active",currentStep:e.walkthroughStep})}}).catch(a=>{console.warn("[walkthrough-store] guideState read failed:",a)}),()=>{})}}});var k=c(47223);function l({stepIndex:a,rect:b,position:c}){let f,g,h=j(),{t:i}=(0,k.Y)(),[l,m]=(0,e.useState)({width:1024,height:768});if(!h)return null;let n=i.walkthrough.steps[a];if(!n)return null;"right"===c?(f=b.top+b.height/2,g=b.right+12):(f=b.bottom+12,g=b.left+b.width/2);let o=l.width-320,p=l.height-200;return g=Math.min(g,o),f=Math.max(f=Math.min(f,p),8),(0,d.jsxs)("div",{className:`fixed z-[102] w-[280px] rounded-xl border shadow-lg animate-in fade-in duration-200 ${"right"===c?"slide-in-from-left-2":"slide-in-from-top-2"}`,style:{top:`${f}px`,left:`${g}px`,transform:"right"===c?"translateY(-50%)":"translateX(-50%)",background:"var(--card)",borderColor:"var(--amber)"},children:[(0,d.jsxs)("div",{className:"p-4",children:[(0,d.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,d.jsx)("span",{className:"text-2xs font-mono px-1.5 py-0.5 rounded-full",style:{background:"var(--amber-dim)",color:"var(--amber)"},children:i.walkthrough.step(a+1,h.totalSteps)})}),(0,d.jsx)("h3",{className:"text-sm font-semibold mb-1",style:{color:"var(--foreground)"},children:n.title}),(0,d.jsx)("p",{className:"text-xs leading-relaxed",style:{color:"var(--muted-foreground)"},children:n.body}),(0,d.jsxs)("div",{className:"flex items-center justify-between mt-4 pt-3",style:{borderTop:"1px solid var(--border)"},children:[(0,d.jsx)("button",{onClick:h.skip,className:"text-xs transition-colors hover:opacity-80",style:{color:"var(--muted-foreground)"},children:i.walkthrough.skip}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[a>0&&(0,d.jsx)("button",{onClick:h.back,className:"text-xs px-2.5 py-1 rounded-lg transition-colors hover:bg-muted",style:{color:"var(--muted-foreground)"},children:i.walkthrough.back}),(0,d.jsx)("button",{onClick:h.next,className:"text-xs px-3 py-1.5 rounded-lg font-medium transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:a===h.totalSteps-1?i.walkthrough.done:i.walkthrough.next})]})]})]}),(0,d.jsx)("div",{className:"flex items-center justify-center gap-1.5 pb-3",children:Array.from({length:h.totalSteps},(b,c)=>(0,d.jsx)("div",{className:"w-1.5 h-1.5 rounded-full transition-all duration-200",style:{background:c===a?"var(--amber)":"var(--border)",transform:c===a?"scale(1.3)":void 0}},c))})]})}function m(){let a=j(),[b,c]=(0,e.useState)(null),[f,h]=(0,e.useState)(!1),i=(0,e.useId)(),k=a?g.g[a.currentStep]:null;return((0,e.useCallback)(()=>{if(!k)return;let a=document.querySelector(`[data-walkthrough="${k.anchor}"]`);a?c(a.getBoundingClientRect()):c(null)},[k]),a?.skip,a?.currentStep,a&&k)?f?(0,d.jsx)(n,{}):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("svg",{className:"fixed inset-0 z-[100] pointer-events-auto",width:"100%",height:"100%",onClick:c=>{if(b){let d=c.clientX,e=c.clientY;d>=b.left-6&&d<=b.right+6&&e>=b.top-6&&e<=b.bottom+6||a.skip()}else a.skip()},children:[(0,d.jsx)("defs",{children:(0,d.jsxs)("mask",{id:i,children:[(0,d.jsx)("rect",{width:"100%",height:"100%",fill:"white"}),b&&(0,d.jsx)("rect",{x:b.left-6,y:b.top-6,width:b.width+12,height:b.height+12,rx:8,ry:8,fill:"black"})]})}),(0,d.jsx)("rect",{width:"100%",height:"100%",fill:"rgba(0, 0, 0, 0.5)",mask:`url(#${i})`})]}),b&&(0,d.jsx)(l,{stepIndex:a.currentStep,rect:b,position:k.position}),!b&&(0,d.jsx)("div",{className:"fixed inset-0 z-[101] flex items-center justify-center pointer-events-none",children:(0,d.jsx)("button",{onClick:a.skip,className:"pointer-events-auto px-4 py-2 text-sm rounded-lg font-medium transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:a.currentStep===a.totalSteps-1?"✓":"→"})})]}):null}function n(){let a=j(),{t:b}=(0,k.Y)();if(!a)return null;let c=b.walkthrough.steps[a.currentStep];return c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:"fixed inset-0 z-[100] bg-black/40 backdrop-blur-sm",onClick:a.skip}),(0,d.jsxs)("div",{className:"fixed bottom-0 left-0 right-0 z-[101] rounded-t-2xl border-t shadow-lg p-5 pb-8 animate-in slide-in-from-bottom duration-300",style:{background:"var(--card)",borderColor:"var(--border)"},children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3",children:[(0,d.jsx)("span",{className:"text-2xs font-mono px-1.5 py-0.5 rounded-full",style:{background:"var(--amber-dim)",color:"var(--amber)"},children:b.walkthrough.step(a.currentStep+1,a.totalSteps)}),(0,d.jsx)("div",{className:"flex items-center gap-1 ml-auto",children:Array.from({length:a.totalSteps},(b,c)=>(0,d.jsx)("div",{className:"w-1.5 h-1.5 rounded-full",style:{background:c===a.currentStep?"var(--amber)":"var(--border)"}},c))})]}),(0,d.jsx)("h3",{className:"text-base font-semibold mb-1",style:{color:"var(--foreground)"},children:c.title}),(0,d.jsx)("p",{className:"text-sm leading-relaxed mb-5",style:{color:"var(--muted-foreground)"},children:c.body}),(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsx)("button",{onClick:a.skip,className:"text-sm transition-colors hover:opacity-80",style:{color:"var(--muted-foreground)"},children:b.walkthrough.skip}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[a.currentStep>0&&(0,d.jsx)("button",{onClick:a.back,className:"text-sm px-3 py-2 rounded-lg transition-colors hover:bg-muted",style:{color:"var(--muted-foreground)"},children:b.walkthrough.back}),(0,d.jsx)("button",{onClick:a.next,className:"text-sm px-4 py-2 rounded-lg font-medium transition-all hover:opacity-90",style:{background:"var(--amber)",color:"var(--amber-foreground)"},children:a.currentStep===a.totalSteps-1?b.walkthrough.done:b.walkthrough.next})]})]})]})]}):null}function o(){return"active"===j(a=>a.status)?(0,d.jsx)(m,{}):null}},85034:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/MindOS/MindOS/app/app/error.tsx\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/home/runner/work/MindOS/MindOS/app/app/error.tsx","default")},86364:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>e});var d=c(88868);let e=async a=>[{type:"image/svg+xml",sizes:"any",url:(0,d.fillMetadataSegment)(".",await a.params,"icon.svg")+"?3c05474ce4fc06a8"}]},86367:(a,b,c)=>{"use strict";c.d(b,{LD:()=>d,LZ:()=>e,qQ:()=>f});let d=[{id:"c1",icon:"\uD83D\uDC64",category:"memory-sync",scenario:"first-day"},{id:"c2",icon:"\uD83D\uDCE5",category:"knowledge-management",scenario:"daily"},{id:"c3",icon:"\uD83D\uDD04",category:"memory-sync",scenario:"project"},{id:"c4",icon:"\uD83D\uDD01",category:"experience-evolution",scenario:"daily"},{id:"c5",icon:"\uD83D\uDCA1",category:"auto-execute",scenario:"daily"},{id:"c6",icon:"\uD83D\uDE80",category:"auto-execute",scenario:"project"},{id:"c7",icon:"\uD83D\uDD0D",category:"knowledge-management",scenario:"project"},{id:"c8",icon:"\uD83E\uDD1D",category:"human-insights",scenario:"daily"},{id:"c9",icon:"\uD83D\uDEE1️",category:"audit-control",scenario:"advanced"}],e=["knowledge-management","memory-sync","auto-execute","experience-evolution","human-insights","audit-control"],f=["first-day","daily","project","advanced"]},86771:(a,b,c)=>{Promise.resolve().then(c.bind(c,2420))},88209:(a,b,c)=>{"use strict";c.d(b,{Ay:()=>ad,Fo:()=>K,gL:()=>L});var d=c(48249),e=c(67484),f=c(19099),g=c(93491),h=c(33191),i=c(83654),j=c(80600),k=c(40560),l=c(44218),m=c(28330),n=c(86718),o=c(7309),p=c(65032),q=c(24703),r=c(16944),s=c(15273),t=c(12625),u=c(59347),v=c(99829);let w=(0,v.createServerReference)("609770dbffb6dd5f6482f431838ddd73c66e6fb04a",v.callServer,void 0,v.findSourceMapURL,"createFileAction"),x=(0,v.createServerReference)("602e42f20ce2bc506dfb072dd63f153eb6d0c1e1b0",v.callServer,void 0,v.findSourceMapURL,"renameSpaceAction");var y=c(7974);let z=(0,v.createServerReference)("400b794e1c61c411e93ba28203bb3da99d0082553c",v.callServer,void 0,v.findSourceMapURL,"deleteSpaceAction"),A=(0,v.createServerReference)("4054c7cd458df2480d4292ce3745ae737a77db6414",v.callServer,void 0,v.findSourceMapURL,"deleteFolderAction");var B=c(7140),C=c(50121),D=c(99101),E=c(47223),F=c(57056),G=c(29713);let H="show-hidden-files";function I(a){let b=b=>{b.key===H&&a()},c=()=>a();return window.addEventListener("storage",b),window.addEventListener("mindos:hidden-files-changed",c),()=>{window.removeEventListener("storage",b),window.removeEventListener("mindos:hidden-files-changed",c)}}function J(){return!1}function K(a){localStorage.setItem(H,String(a)),window.dispatchEvent(new Event("mindos:hidden-files-changed"))}function L(){return(0,e.useSyncExternalStore)(I,J,()=>!1)}var M=c(24520),N=c(37917),O=c(801);let P=(0,v.createServerReference)("40a9efee6e91ebb9e069ef43969945bfc5075d8b30",v.callServer,void 0,v.findSourceMapURL,"convertToSpaceAction");var Q=c(95054);async function R(){try{let a=await (0,Q.n)("/api/settings"),b=a.ai?.provider??"",c=(a.ai?.providers??{})[b];return!!c?.apiKey}catch{return!1}}async function S(a){try{await navigator.clipboard.writeText(a)}catch{}}let T="w-full flex items-center gap-2 px-3 py-2 text-sm text-foreground hover:bg-muted transition-colors text-left",U="w-full flex items-center gap-2 px-3 py-2 text-sm text-error hover:bg-error/10 transition-colors text-left",V="my-1 border-t border-border/50";function W({x:a,y:b,onClose:c,menuHeight:f,children:g}){let h=(0,e.useRef)(null),i=Math.min(b,window.innerHeight-(f??160)),j=Math.min(a,window.innerWidth-200);return(0,d.jsx)("div",{ref:h,className:"fixed z-50 min-w-[180px] bg-card border border-border rounded-lg shadow-lg py-1",style:{top:i,left:j},children:g})}function X({x:a,y:b,node:c,onClose:e,onRename:g,onNewFile:i,onImport:j,onDelete:k}){let l=(0,f.useRouter)(),{t:m}=(0,E.Y)(),{isPinned:n,togglePin:o}=(0,G.Z)(),p=n(c.path);return(0,d.jsxs)(W,{x:a,y:b,onClose:e,children:[(0,d.jsxs)("button",{className:T,onClick:()=>{i(),e()},children:[(0,d.jsx)(M.A,{size:14,className:"shrink-0"})," ",m.fileTree.newFile]}),(0,d.jsxs)("button",{className:T,onClick:()=>{l.push(`/view/${(0,h.O0)(`${c.path}/INSTRUCTION.md`)}`),e()},children:[(0,d.jsx)(N.A,{size:14,className:"shrink-0"})," ",m.fileTree.viewRules]}),j&&(0,d.jsxs)("button",{className:T,onClick:()=>{j(c.path),e()},children:[(0,d.jsx)(O.A,{size:14,className:"shrink-0"})," ",m.fileTree.importFile]}),(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:T,onClick:()=>{o(c.path),e()},children:[(0,d.jsx)(r.A,{size:14,className:`shrink-0 ${p?"fill-[var(--amber)] text-[var(--amber)]":""}`}),p?m.fileTree.removeFromFavorites:m.fileTree.pinToFavorites]}),(0,d.jsxs)("button",{className:T,onClick:()=>{S(c.path),e()},children:[(0,d.jsx)(s.A,{size:14,className:"shrink-0"})," ",m.fileTree.copyPath]}),(0,d.jsxs)("button",{className:T,onClick:()=>{g(),e()},children:[(0,d.jsx)(t.A,{size:14,className:"shrink-0"})," ",m.fileTree.renameSpace]}),(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:U,onClick:()=>{e(),k()},children:[(0,d.jsx)(u.A,{size:14,className:"shrink-0"}),m.fileTree.deleteSpace]})]})}function Y({x:a,y:b,node:c,onClose:g,onRename:h,onNewFile:i,onDelete:j}){let k=(0,f.useRouter)(),{t:l}=(0,E.Y)(),[m,o]=(0,e.useTransition)(),{isPinned:p,togglePin:q}=(0,G.Z)(),v=p(c.path);return(0,d.jsxs)(W,{x:a,y:b,onClose:g,menuHeight:220,children:[(0,d.jsxs)("button",{className:T,onClick:()=>{i(),g()},children:[(0,d.jsx)(M.A,{size:14,className:"shrink-0"})," ",l.fileTree.newFile]}),(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:T,onClick:()=>{q(c.path),g()},children:[(0,d.jsx)(r.A,{size:14,className:`shrink-0 ${v?"fill-[var(--amber)] text-[var(--amber)]":""}`}),v?l.fileTree.removeFromFavorites:l.fileTree.pinToFavorites]}),(0,d.jsxs)("button",{className:T,disabled:m,onClick:()=>{o(async()=>{if((await P(c.path)).success){k.refresh(),window.dispatchEvent(new Event("mindos:files-changed"));let a=c.name.replace(/^[\p{Emoji_Presentation}\p{Extended_Pictographic}\s]+/u,"")||c.name;R().then(b=>{b&&function(a,b,c=""){let d="u">typeof document&&"zh"===document.documentElement.lang?`初始化新建的心智空间「${a}」,路径为「${b}/」。${c?`描述:「${c}」。`:""}两个文件均已存在模板,用 write_file 覆盖:
|
|
156
|
+
1. 「${b}/README.md」— 写入空间用途、结构概览、使用指南
|
|
157
|
+
2. 「${b}/INSTRUCTION.md」— 写入 AI Agent 在此空间中的行为规则和操作约定
|
|
158
|
+
|
|
159
|
+
内容简洁实用,直接使用工具写入。`:`Initialize the new Mind Space "${a}" at "${b}/". ${c?`Description: "${c}". `:""}Both files already exist with templates — use write_file to overwrite:
|
|
160
|
+
1. "${b}/README.md" — write purpose, structure overview, usage guidelines
|
|
161
|
+
2. "${b}/INSTRUCTION.md" — write rules for AI agents operating in this space
|
|
162
|
+
|
|
163
|
+
Keep content concise and actionable. Write files directly using tools.`;window.dispatchEvent(new CustomEvent("mindos:ai-init",{detail:{spaceName:a,spacePath:b,description:c,state:"working"}})),fetch("/api/ask",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:[{role:"user",content:d}],currentFile:b+"/INSTRUCTION.md"})}).then(async a=>{if(!a.ok||!a.body)throw Error(`HTTP ${a.status}`);let c=a.body.getReader();try{for(;;){let{done:a}=await c.read();if(a)break}}finally{c.releaseLock()}window.dispatchEvent(new CustomEvent("mindos:ai-init",{detail:{spacePath:b,state:"done"}})),window.dispatchEvent(new Event("mindos:files-changed"))}).catch(()=>{window.dispatchEvent(new CustomEvent("mindos:ai-init",{detail:{spacePath:b,state:"error"}}))})}(a,c.path)})}g()})},children:[(0,d.jsx)(n.A,{size:14,className:"shrink-0 text-[var(--amber)]"})," ",l.fileTree.convertToSpace]}),(0,d.jsxs)("button",{className:T,onClick:()=>{S(c.path),g()},children:[(0,d.jsx)(s.A,{size:14,className:"shrink-0"})," ",l.fileTree.copyPath]}),(0,d.jsxs)("button",{className:T,onClick:()=>{h(),g()},children:[(0,d.jsx)(t.A,{size:14,className:"shrink-0"})," ",l.fileTree.rename]}),(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:U,onClick:()=>{g(),j()},children:[(0,d.jsx)(u.A,{size:14,className:"shrink-0"}),l.fileTree.deleteFolder]})]})}var Z=c(63710);function $(){window.dispatchEvent(new Event("mindos:files-changed"))}async function _(a){try{await navigator.clipboard.writeText(a)}catch{}}function aa({dirPath:a,depth:b,onDone:c}){let[g,i]=(0,e.useState)(""),[j,l]=(0,e.useTransition)(),[m,n]=(0,e.useState)(""),o=(0,f.useRouter)(),{t:p}=(0,E.Y)(),q=(0,e.useRef)(null),r=(0,e.useCallback)(()=>{let b=g.trim();b?l(async()=>{let d=await w(a,b);d.success&&d.filePath?(c(),o.push(`/view/${(0,h.O0)(d.filePath)}`),o.refresh(),$()):n(d.error||p.fileTree.failed)}):n(p.fileTree.enterFileName)},[g,a,c,o,p]);return(0,d.jsxs)("div",{ref:q,className:"px-2 pb-1",style:{paddingLeft:`${12*b+20}px`},children:[(0,d.jsxs)("div",{className:"flex items-center gap-1",children:[(0,d.jsx)("input",{autoFocus:!0,type:"text",value:g,onChange:a=>{i(a.target.value),n("")},onKeyDown:a=>{"Enter"===a.key&&r(),"Escape"===a.key&&c()},placeholder:"filename.md",className:" flex-1 bg-muted border border-border rounded px-2 py-1 text-xs text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring "}),j?(0,d.jsx)(k.A,{size:13,className:"text-muted-foreground animate-spin shrink-0"}):(0,d.jsx)("button",{onClick:r,className:"text-xs text-[var(--amber)] hover:text-foreground shrink-0 px-1",children:p.fileTree.create})]}),m&&(0,d.jsx)("p",{className:"text-xs text-error mt-0.5 px-1",children:m})]})}function ab({node:a,depth:b,currentPath:c,onNavigate:i,maxOpenDepth:j,onImport:r}){let s=(0,f.useRouter)(),t=c.startsWith(a.path+"/")||c===a.path,u=!!a.isSpace,[v,w]=(0,e.useState)(0===b||t),[C,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(a.name),[L,M]=(0,e.useTransition)(),N=(0,e.useRef)(null),O=(0,e.useRef)(null),[P,Q]=(0,e.useState)(null),{t:R}=(0,E.Y)(),[S,T]=(0,e.useState)(null),[U,V]=(0,e.useTransition)(),{isDragTarget:W,handleRowDragOver:_,handleRowDragEnter:ab,handleRowDragLeave:ac,handleRowDrop:ae}=function(a,b,c,d){let[f,g]=(0,e.useState)(!1),h=(0,e.useRef)(null),i=(0,e.useRef)(null),j=(0,e.useCallback)(()=>{h.current&&(clearTimeout(h.current),h.current=null)},[]),k=(0,e.useCallback)(a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),a.stopPropagation(),a.dataTransfer.dropEffect="copy",i.current&&(clearTimeout(i.current),i.current=null),f||g(!0))},[f]),l=(0,e.useCallback)(a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),a.stopPropagation(),g(!0),j(),b||(h.current=setTimeout(()=>{c(!0),h.current=null},500)))},[b,j,c]);return{isDragTarget:f,handleRowDragOver:k,handleRowDragEnter:l,handleRowDragLeave:(0,e.useCallback)(a=>{a.dataTransfer.types.includes("Files")&&(a.stopPropagation(),i.current=setTimeout(()=>{g(!1),j(),i.current=null},50))},[j]),handleRowDrop:(0,e.useCallback)(b=>{b.preventDefault(),b.stopPropagation(),g(!1),j(),i.current&&(clearTimeout(i.current),i.current=null);let c=b.dataTransfer.files;c.length>0&&(0,Z.Nh)(Array.from(c),a.path,d)},[a.path,d,j])}}(a,v,w,R),af=(0,e.useCallback)(()=>w(a=>!a),[]);(0,e.useRef)(void 0);let ag=(0,e.useCallback)(b=>{b?.preventDefault(),b?.stopPropagation(),O.current&&(clearTimeout(O.current),O.current=null),K(a.name),I(!0),setTimeout(()=>N.current?.select(),0)},[a.name]),ah=(0,e.useCallback)(()=>{let b=J.trim();b&&b!==a.name?M(async()=>{let c=u?x:y.f,d=await c(a.path,b);d.success&&d.newPath?(I(!1),s.push(`/view/${(0,h.O0)(d.newPath)}`),s.refresh(),$()):I(!1)}):I(!1)},[J,a.name,a.path,s,u]),ai=(0,e.useCallback)(()=>{H||(O.current&&clearTimeout(O.current),O.current=setTimeout(()=>{s.push(`/view/${(0,h.O0)(a.path)}`),i?.(),O.current=null},180))},[H,s,a.path,i]);(0,e.useCallback)(a=>{a.stopPropagation(),af()},[af]);let aj=(0,e.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),Q({x:a.clientX,y:a.clientY})},[]),ak=u?function a(b){return"file"===b.type?+!g.C.has(b.name):(b.children??[]).reduce((b,c)=>b+a(c),0)}(a):0;if(H)return(0,d.jsxs)("div",{className:"relative px-2 py-0.5",style:{paddingLeft:`${12*b+8}px`},children:[(0,d.jsx)("input",{ref:N,autoFocus:!0,value:J,onChange:a=>K(a.target.value),onKeyDown:a=>{"Enter"===a.key&&ah(),"Escape"===a.key&&I(!1)},onBlur:ah,className:"w-full bg-muted border border-border rounded px-2 py-0.5 text-xs text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),L&&(0,d.jsx)(k.A,{size:12,className:"absolute right-3 top-1/2 -translate-y-1/2 animate-spin text-muted-foreground"})]});let al=u&&0===b;return(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:`relative group/dir flex items-center transition-colors duration-100 ${W?"bg-[var(--amber)]/10 rounded-md":""}`,onContextMenu:aj,onDragEnter:ab,onDragOver:_,onDragLeave:ac,onDrop:ae,children:[(0,d.jsx)("button",{onClick:af,className:"shrink-0 p-1 rounded hover:bg-muted text-muted-foreground transition-colors",style:{marginLeft:`${12*b+4}px`},"aria-label":v?`Collapse ${a.name}`:`Expand ${a.name}`,"aria-expanded":v,children:(0,d.jsx)("span",{className:"block transition-transform duration-150",style:{transform:v?"rotate(0deg)":"rotate(-90deg)"},children:(0,d.jsx)(l.A,{size:10})})}),(0,d.jsxs)("button",{type:"button",onClick:ai,draggable:!0,onDragStart:b=>{b.dataTransfer.setData("text/mindos-path",a.path),b.dataTransfer.setData("text/mindos-type","directory"),b.dataTransfer.effectAllowed="copy"},className:`
|
|
164
|
+
flex-1 flex items-center gap-1.5 px-1 py-1 rounded text-left min-w-0 pr-16
|
|
165
|
+
text-sm transition-colors duration-100
|
|
166
|
+
hover:bg-muted cursor-default
|
|
167
|
+
${t?"text-foreground":"text-muted-foreground hover:text-foreground"}
|
|
168
|
+
`,children:[u?"Inbox"===a.name?(0,d.jsx)(m.A,{size:14,className:"shrink-0 text-[var(--amber)]"}):(0,d.jsx)(n.A,{size:14,className:"shrink-0 text-[var(--amber)]"}):v?(0,d.jsx)(o.A,{size:14,className:"text-yellow-400 shrink-0"}):(0,d.jsx)(p.A,{size:14,className:"text-yellow-400 shrink-0"}),(0,d.jsx)("span",{className:"truncate leading-5",suppressHydrationWarning:!0,children:a.name}),u&&!v&&(0,d.jsx)("span",{className:"ml-auto text-xs text-muted-foreground shrink-0 tabular-nums pr-1",children:ak})]}),(0,d.jsx)("div",{className:"absolute right-1 top-1/2 -translate-y-1/2 hidden group-hover/dir:flex items-center gap-0.5 z-10",children:(0,d.jsx)("button",{type:"button",onClick:a=>{a.preventDefault(),a.stopPropagation();let b=a.currentTarget.getBoundingClientRect();Q({x:b.left,y:b.bottom+4})},className:"p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:"More",children:(0,d.jsx)(q.A,{size:14})})})]}),(0,d.jsx)("div",{className:`grid transition-[grid-template-rows] duration-200 ease-out ${v?"grid-rows-[1fr]":"grid-rows-[0fr]"}`,children:(0,d.jsxs)("div",{className:`overflow-hidden ${al?"border-l-2 ml-[18px]":""}`,style:al?{borderColor:"color-mix(in srgb, var(--amber) 30%, transparent)"}:void 0,...!v&&{inert:!0},children:[a.children&&(0,d.jsx)(ad,{nodes:a.children,depth:al?1:b+1,onNavigate:i,maxOpenDepth:j,parentIsSpace:u,onImport:r}),C&&(0,d.jsx)(aa,{dirPath:a.path,depth:al?0:b,onDone:()=>G(!1)})]})}),P&&(u?(0,d.jsx)(X,{x:P.x,y:P.y,node:a,onClose:()=>Q(null),onRename:()=>ag(),onNewFile:()=>{w(!0),G(!0)},onImport:r,onDelete:()=>T("space")}):(0,d.jsx)(Y,{x:P.x,y:P.y,node:a,onClose:()=>Q(null),onRename:()=>ag(),onNewFile:()=>{w(!0),G(!0)},onDelete:()=>T("folder")})),(0,d.jsx)(F.TM,{open:null!==S,title:"space"===S?R.fileTree.deleteSpace:R.fileTree.deleteFolder,message:"space"===S?R.fileTree.confirmDeleteSpace(a.name):R.fileTree.confirmDeleteFolder(a.name),confirmLabel:"space"===S?R.fileTree.deleteSpace:R.fileTree.deleteFolder,cancelLabel:R.view?.cancel??"Cancel",variant:"destructive",onCancel:()=>T(null),onConfirm:()=>{T(null),V(async()=>{let b="space"===S?await z(a.path):await A(a.path);if(b.success&&b.trashId){let c=b.trashId,d=a.path.split("/").pop()??a.path;D.oR.undo(`${R.trash?.movedToTrash??"Deleted"} ${d}`,async()=>{let a=await (0,B.Y)(c);a.success?(s.refresh(),$()):D.oR.error(a.error??"Undo failed")},{label:R.trash?.undo??"Undo"}),s.push("/"),s.refresh(),$()}})}})]})}function ac({node:a,depth:b,currentPath:c,onNavigate:l}){let m=(0,f.useRouter)(),n=c===a.path,[o,p]=(0,e.useState)(!1),[v,w]=(0,e.useState)(a.name),[x,z]=(0,e.useTransition)(),[,A]=(0,e.useTransition)(),H=(0,e.useRef)(null),{t:I}=(0,E.Y)(),{isPinned:J,togglePin:K}=(0,G.Z)(),L=J(a.path),M=!a.path.includes("/")&&g.A.has(a.name),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(null),R=(0,e.useCallback)(()=>{o||(m.push(`/view/${(0,h.O0)(a.path)}`),l?.())},[m,a.path,l,o]),S=(0,e.useCallback)(b=>{b.stopPropagation(),w(a.name),p(!0),setTimeout(()=>H.current?.select(),0)},[a.name]),X=(0,e.useCallback)(()=>{let b=v.trim();b&&b!==a.name?z(async()=>{let c=await (0,y.f)(a.path,b);c.success&&c.newPath?(p(!1),m.push(`/view/${(0,h.O0)(c.newPath)}`),m.refresh(),$()):p(!1)}):p(!1)},[v,a.name,a.path,m]),Y=(0,e.useCallback)(a=>{a.stopPropagation(),O(!0)},[]),Z=(0,e.useCallback)(b=>{b.dataTransfer.setData("text/mindos-path",a.path),b.dataTransfer.effectAllowed="copy"},[a.path]),aa=(0,e.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),Q({x:a.clientX,y:a.clientY})},[]);return o?(0,d.jsxs)("div",{className:"relative px-2 py-0.5",style:{paddingLeft:`${12*b+8}px`},children:[(0,d.jsx)("input",{ref:H,autoFocus:!0,value:v,onChange:a=>w(a.target.value),onKeyDown:a=>{"Enter"===a.key&&X(),"Escape"===a.key&&p(!1)},onBlur:X,className:"w-full bg-muted border border-border rounded px-2 py-0.5 text-xs text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring"}),x&&(0,d.jsx)(k.A,{size:12,className:"absolute right-3 top-1/2 -translate-y-1/2 animate-spin text-muted-foreground"})]}):(0,d.jsxs)("div",{className:"relative group/file",children:[(0,d.jsxs)("button",{onClick:R,onContextMenu:aa,draggable:!0,onDragStart:Z,"data-filepath":a.path,className:`
|
|
169
|
+
w-full flex items-center gap-1.5 px-2 py-1 rounded text-left
|
|
170
|
+
text-sm transition-colors duration-100 cursor-default pr-16
|
|
171
|
+
${n?"bg-accent text-foreground":"hover:bg-muted text-muted-foreground hover:text-foreground"}
|
|
172
|
+
`,style:{paddingLeft:`${12*b+8}px`},children:["directory"===a.type?null:".csv"===a.extension?(0,d.jsx)(i.A,{size:14,className:"text-success shrink-0"}):(0,d.jsx)(j.A,{size:14,className:"text-muted-foreground shrink-0"}),(0,d.jsx)("span",{className:"truncate leading-5",suppressHydrationWarning:!0,children:a.name}),L&&(0,d.jsx)(r.A,{size:10,className:"shrink-0 fill-[var(--amber)] text-[var(--amber)] opacity-60"})]}),(0,d.jsx)("div",{className:"absolute right-1 top-1/2 -translate-y-1/2 hidden group-hover/file:flex items-center gap-0.5",children:(0,d.jsx)("button",{type:"button",onClick:a=>{a.stopPropagation();let b=a.currentTarget.getBoundingClientRect();Q({x:b.left,y:b.bottom+4})},className:"p-0.5 rounded text-muted-foreground hover:text-foreground hover:bg-muted transition-colors",title:"More",children:(0,d.jsx)(q.A,{size:14})})}),P&&(0,d.jsxs)(W,{x:P.x,y:P.y,onClose:()=>Q(null),menuHeight:140,children:[(0,d.jsxs)("button",{className:T,onClick:()=>{_(a.path),Q(null)},children:[(0,d.jsx)(s.A,{size:14,className:"shrink-0"})," ",I.fileTree.copyPath]}),(0,d.jsxs)("button",{className:T,onClick:()=>{K(a.path),Q(null)},children:[(0,d.jsx)(r.A,{size:14,className:`shrink-0 ${L?"fill-[var(--amber)] text-[var(--amber)]":""}`}),L?I.fileTree.removeFromFavorites:I.fileTree.pinToFavorites]}),!M&&(0,d.jsxs)("button",{className:T,onClick:a=>{Q(null),S(a)},children:[(0,d.jsx)(t.A,{size:14,className:"shrink-0"})," ",I.fileTree.rename]}),!M&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("div",{className:V}),(0,d.jsxs)("button",{className:U,onClick:a=>{Q(null),Y(a)},children:[(0,d.jsx)(u.A,{size:14,className:"shrink-0"})," ",I.fileTree.delete]})]})]}),(0,d.jsx)(F.TM,{open:N,title:I.fileTree.delete,message:I.fileTree.confirmDelete(a.name),confirmLabel:I.fileTree.delete,cancelLabel:I.view?.cancel??"Cancel",variant:"destructive",onCancel:()=>O(!1),onConfirm:()=>{O(!1),A(async()=>{let b=await (0,C.i)(a.path);if(b.success){if(b.trashId){let c=b.trashId,d=a.path.split("/").pop()??a.path;D.oR.undo(`${I.trash?.movedToTrash??"Deleted"} ${d}`,async()=>{let a=await (0,B.Y)(c);a.success?(m.refresh(),$()):D.oR.error(a.error??"Undo failed")},{label:I.trash?.undo??"Undo"})}m.refresh(),$()}})}})]})}function ad({nodes:a,depth:b=0,onNavigate:c,maxOpenDepth:e,parentIsSpace:h,onImport:i}){var j;let k,l=(k="/view/",(j=(0,f.usePathname)()).startsWith(k)?j.slice(k.length).split("/").map(decodeURIComponent).join("/"):""),m=L(),n=0===b,o=m?a:a.filter(a=>!(n&&a.name.startsWith(".")||"file"===a.type&&g.C.has(a.name)||"directory"===a.type&&a.name.startsWith("."))),p=n?o.filter(a=>"directory"!==a.type||"Inbox"!==a.name):o;return(0,d.jsx)("div",{className:"flex flex-col gap-0.5",children:p.map(a=>"directory"===a.type?(0,d.jsx)(ab,{node:a,depth:b,currentPath:l,onNavigate:c,maxOpenDepth:e,onImport:i},a.path):(0,d.jsx)(ac,{node:a,depth:b,currentPath:l,onNavigate:c},a.path))})}},89119:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A:()=>P});var e=c(48249),f=c(67484),g=c(19099),h=c(2116),i=c.n(h),j=c(9915),k=c(10316),l=c(95581),m=c(46674),n=c(801),o=c(4615),p=c(34139),q=c(88209),r=c(20892),s=c(99791),t=c(74434),u=c(29820),v=c(82626),w=c(84197),x=c(61112),y=c(96716),z=c(2923),A=c(80829),B=c(23017),C=c(73778),D=c(2995),E=c(4949),F=c(9311),G=c(47223),H=c(90314),I=c(2518),J=c(84668);c(4246);var K=c(65141),L=c(13859),M=c(69593);c(99101);var N=c(63710),O=a([x,L]);[x,L]=O.then?(await O)():O;let Q=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./SearchModal"]},ssr:!1}),R=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./AskModal"]},ssr:!1}),S=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./SettingsModal"]},ssr:!1}),T=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./CreateSpaceModal"]},ssr:!1}),U=(0,H.default)(async()=>{},{loadableGenerated:{modules:["components/SidebarLayout.tsx -> ./ImportModal"]},ssr:!1});function P({fileTree:a,children:b}){let c=(0,K.b)(),d=(0,L.$)(),[h,H]=(0,f.useState)(!1),[O,P]=(0,f.useState)(void 0),[V,W]=(0,f.useState)(!1),[X,Y]=(0,f.useState)(null),[Z,$]=(0,f.useState)(null),[_,aa]=(0,f.useState)(()=>y.wl),ab=(0,M.dB)(),[ac,ad]=(0,f.useState)(!1),[ae,af]=(0,f.useState)(0),ag=(0,f.useCallback)(()=>{ad(!1),"organizing"!==ab.phase||ab.abort(),ab.reset()},[ab]),ah=(0,f.useCallback)(()=>{af(a=>a+1),window.dispatchEvent(new Event("mindos:organize-history-update"))},[]),[ai,aj]=(0,f.useState)(!1),[ak,al]=(0,f.useState)(void 0),[am,an]=(0,f.useState)(void 0),[ao,ap]=(0,f.useState)(!1),aq=(0,f.useRef)(0),ar=(0,f.useCallback)(a=>{al(a),an(void 0),aj(!0)},[]),as=(0,f.useCallback)(()=>{aj(!1),al(void 0),an(void 0)},[]),[at,au]=(0,f.useState)(!1),[av,aw]=(0,f.useState)(!1),[ax,ay]=(0,f.useState)(!1),{t:az}=(0,G.Y)(),aA=(0,g.useRouter)(),aB=(0,g.usePathname)(),aC=(0,f.useMemo)(()=>(function a(b,c=""){let d=[];for(let e of b)if("directory"===e.type&&!e.name.startsWith(".")){let b=c?`${c}/${e.name}`:e.name;d.push(b),e.children&&d.push(...a(e.children,b))}return d})(a),[a]),{status:aD,fetchStatus:aE}=(0,F.dW)(),aF=aB.startsWith("/view/")?aB.slice(6).split("/").map(decodeURIComponent).join("/"):void 0,aG=(0,f.useCallback)(()=>{d.askMaximized&&d.toggleAskMaximized()},[d.askMaximized,d.toggleAskMaximized]),aH=aB?.startsWith("/agents"),aI=c.activePanel??(aH?"agents":null);(0,f.useRef)([]);let aJ=(0,f.useCallback)(()=>{let a=()=>window.dispatchEvent(new Event("guide-state-updated"));"guide"===d.askOpenSource?fetch("/api/setup",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({guideState:{askedAI:!0}})}).then(a).catch(a=>console.warn("Guide state update failed:",a)):"guide-next"===d.askOpenSource&&a()},[d.askOpenSource]),aK=(0,f.useCallback)(a=>{aa(a);try{localStorage.setItem("right-agent-detail-panel-width",String(a))}catch{}},[]),aL=(0,f.useCallback)(()=>$(null),[]),aM=null!==Z&&"agents"===c.activePanel,aN=(0,f.useCallback)(()=>{P("sync"),W(!1),H(!0)},[]),aO=(0,f.useCallback)(()=>{H(!0),P(void 0)},[]),aP=(0,f.useCallback)(()=>{H(!1),P(void 0)},[]),aQ=(0,f.useCallback)(a=>{Y(a),W(a=>!a)},[]),aR=(0,f.useCallback)(a=>{c.handleExpandedChange(a),W(!1)},[c]);return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(I.A,{}),(0,e.jsx)(J.A,{}),(0,e.jsx)("a",{href:"#main-content",className:"sr-only focus-visible:not-sr-only focus-visible:fixed focus-visible:top-2 focus-visible:left-2 focus-visible:z-[60] focus-visible:px-4 focus-visible:py-2 focus-visible:rounded-lg focus-visible:text-sm focus-visible:font-medium bg-[var(--amber)] text-[var(--amber-foreground)]",children:"Skip to main content"}),(0,e.jsx)(o.Ay,{activePanel:aI,onPanelChange:c.setActivePanel,onEchoClick:()=>{aG();let a="echo"===c.activePanel,b=aB?.startsWith("/echo");a?b?c.setActivePanel(null):aA.push("/echo/about-you"):(c.setActivePanel("echo"),aA.push("/echo/about-you"))},onAgentsClick:()=>{aG();let a="agents"===c.activePanel,b=aB?.startsWith("/agents");a?b?c.setActivePanel(null):aA.push("/agents"):(c.setActivePanel("agents"),aA.push("/agents")),$(null)},onDiscoverClick:()=>{aG();let a="discover"===c.activePanel,b=aB?.startsWith("/explore");a?b?c.setActivePanel(null):aA.push("/explore"):(c.setActivePanel("discover"),aA.push("/explore"))},onSpacesClick:()=>{aG();let a="/"===aB,b="files"===c.activePanel,d="/wiki"===aB||aB?.startsWith("/view/")||aB?.startsWith("/wiki/");a||!b?(c.setActivePanel("files"),aA.push("/wiki")):d?c.setActivePanel(null):aA.push("/wiki")},syncStatus:aD,expanded:c.railExpanded,onExpandedChange:aR,onSettingsClick:aO,onSyncClick:aQ}),(0,e.jsxs)(p.Ay,{activePanel:c.activePanel,fileTree:a,onNavigate:()=>{},onOpenSyncSettings:aN,railWidth:c.railWidth,panelWidth:c.panelWidth??void 0,onWidthChange:c.handlePanelWidthChange,onWidthCommit:c.handlePanelWidthCommit,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize,onImport:ar,children:[(0,e.jsx)("div",{className:`flex flex-col h-full ${"echo"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(v.A,{active:"echo"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize})}),(0,e.jsx)("div",{className:`flex flex-col h-full ${"search"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(s.A,{active:"search"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize})}),(0,e.jsx)("div",{className:`flex flex-col h-full ${"agents"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(t.A,{active:"agents"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize,selectedAgentKey:aM?Z:null})}),(0,e.jsx)("div",{className:`flex flex-col h-full ${"discover"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(u.A,{active:"discover"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize})}),(0,e.jsx)("div",{className:`flex flex-col h-full ${"workflows"===c.activePanel?"":"hidden"}`,children:(0,e.jsx)(w.A,{active:"workflows"===c.activePanel,maximized:c.panelMaximized,onMaximize:c.handlePanelMaximize})})]}),(0,e.jsx)(x.Ay,{open:d.askPanelOpen,onClose:d.closeAskPanel,currentFile:aF,initialMessage:d.askInitialMessage,initialAcpAgent:d.askAcpAgent,onFirstMessage:aJ,width:d.askPanelWidth,onWidthChange:d.handleAskWidthChange,onWidthCommit:d.handleAskWidthCommit,askMode:d.askMode,onModeSwitch:d.handleAskModeSwitch,maximized:d.askMaximized,onMaximize:d.toggleAskMaximized,sidebarOffset:c.panelOpen?c.railWidth+c.effectivePanelWidth:c.railWidth}),(0,e.jsx)(y.Ay,{open:aM,agentKey:Z,onClose:aL,rightOffset:d.askPanelOpen?d.askPanelWidth:0,width:_,onWidthChange:aa,onWidthCommit:aK}),(0,e.jsx)(R,{open:d.desktopAskPopupOpen,onClose:d.closeDesktopAskPopup,currentFile:aF,initialMessage:d.askInitialMessage,initialAcpAgent:d.askAcpAgent,onFirstMessage:aJ,askMode:d.askMode,onModeSwitch:d.handleAskModeSwitch}),(0,e.jsx)(z.A,{onToggle:d.toggleAskPanel,askPanelOpen:d.askPanelOpen||d.desktopAskPopupOpen}),(0,e.jsx)(B.A,{}),(0,e.jsx)(S,{open:h,onClose:aP,initialTab:O}),(0,e.jsx)(A.A,{open:V,onClose:()=>W(!1),anchorRect:X,railWidth:c.railWidth,onOpenSyncSettings:aN,syncStatus:aD,onSyncStatusRefresh:aE}),(0,e.jsxs)("header",{className:"md:hidden fixed top-0 left-0 right-0 z-30 bg-card border-b border-border flex items-center justify-between px-3 py-2",style:{paddingTop:"env(safe-area-inset-top, 0px)"},children:[(0,e.jsx)("button",{onClick:()=>au(!0),className:"p-3 -ml-1 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent","aria-label":"Open menu",children:(0,e.jsx)(j.A,{size:20})}),(0,e.jsxs)(i(),{href:"/",className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,e.jsx)(r.A,{id:"mobile"}),(0,e.jsx)("span",{className:"text-foreground text-sm font-brand",children:"MindOS"})]}),(0,e.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,e.jsx)("button",{onClick:aN,className:"p-3 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent flex items-center justify-center","aria-label":"Sync status",children:(0,e.jsx)(F.jc,{status:aD})}),(0,e.jsx)("button",{onClick:()=>aw(!0),className:"p-3 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent","aria-label":az.sidebar.searchTitle,children:(0,e.jsx)(k.A,{size:20})}),(0,e.jsx)("button",{onClick:()=>{H(!0),P(void 0)},className:"p-3 -mr-1 rounded-lg hover:bg-muted text-muted-foreground hover:text-foreground transition-colors active:bg-accent","aria-label":az.sidebar.settingsTitle,children:(0,e.jsx)(l.A,{size:20})})]})]}),at&&(0,e.jsx)("div",{className:"md:hidden fixed inset-0 z-40 overlay-backdrop",onClick:()=>au(!1)}),(0,e.jsxs)("aside",{className:`md:hidden fixed top-0 left-0 h-screen w-[85vw] max-w-[320px] z-50 bg-card border-r border-border flex flex-col transition-transform duration-300 ease-in-out ${at?"translate-x-0":"-translate-x-full"}`,children:[(0,e.jsxs)("div",{className:"flex items-center justify-between px-4 py-4 border-b border-border shrink-0",children:[(0,e.jsxs)(i(),{href:"/",className:"flex items-center gap-2 hover:opacity-80 transition-opacity",children:[(0,e.jsx)(r.A,{id:"drawer"}),(0,e.jsx)("span",{className:"text-foreground text-sm font-brand",children:"MindOS"})]}),(0,e.jsx)("button",{onClick:()=>au(!1),className:"p-1 rounded hover:bg-muted text-muted-foreground hover:text-foreground transition-colors",children:(0,e.jsx)(m.A,{size:16})})]}),(0,e.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0 px-2 py-2",children:(0,e.jsx)(q.Ay,{nodes:a,onNavigate:()=>au(!1),onImport:ar})})]}),(0,e.jsx)(Q,{open:av,onClose:()=>aw(!1)}),(0,e.jsx)(R,{open:ax,onClose:()=>ay(!1),currentFile:aF}),(0,e.jsxs)("main",{id:"main-content",className:"min-h-screen transition-all duration-200 pt-[52px] md:pt-0",onDragEnter:a=>{a.dataTransfer.types.includes("Files")&&(a.preventDefault(),aq.current++,1===aq.current&&ap(!0))},onDragOver:a=>{a.dataTransfer.types.includes("Files")&&a.preventDefault()},onDragLeave:()=>{aq.current=Math.max(0,aq.current-1),0===aq.current&&ap(!1)},onDrop:a=>{a.preventDefault(),aq.current=0,ap(!1),a.dataTransfer.files.length>0&&!ai&&(0,N.QL)(Array.from(a.dataTransfer.files),az)},children:[(0,e.jsxs)("div",{className:"min-h-screen bg-background",style:{overflowX:"clip"},children:[(0,e.jsx)(C.A,{}),b]}),(0,e.jsx)(D.A,{}),(0,e.jsx)(T,{t:az,dirPaths:aC}),ao&&!ai&&(0,e.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-background/80 backdrop-blur-sm transition-opacity duration-200",children:(0,e.jsxs)("div",{className:"border-2 border-dashed border-[var(--amber)]/50 rounded-xl p-12 flex flex-col items-center gap-3",children:[(0,e.jsx)(n.A,{size:48,className:"text-[var(--amber)]/60"}),(0,e.jsx)("p",{className:"text-sm text-foreground font-medium",children:az.inbox.dropOverlay}),(0,e.jsx)("p",{className:"text-xs text-muted-foreground",children:az.inbox.dropOverlayFormats})]})})]}),(0,e.jsx)(U,{open:ai,onClose:as,defaultSpace:ak,initialFiles:am,aiOrganize:ab,dirPaths:aC}),ac&&(0,e.jsx)(E.A,{aiOrganize:ab,onDismiss:ag,onCancel:()=>{ab.abort(),ab.reset(),ad(!1)},onHistoryUpdate:ah}),(0,e.jsx)("style",{children:`
|
|
173
173
|
@media (min-width: 768px) {
|
|
174
174
|
:root {
|
|
175
175
|
--right-panel-width: ${d.askMaximized?`calc(100vw - ${c.panelOpen?c.railWidth+c.effectivePanelWidth:c.railWidth}px)`:`${d.askPanelOpen?d.askPanelWidth:0}px`};
|