@geminilight/mindos 0.6.73 → 0.6.75
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 +30 -30
- 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 +5 -5
- package/_standalone/.next/required-server-files.json +14 -1
- 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.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/agents/copy-skill/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/agents/custom/detect/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/agents/custom/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/ask/route.js +1 -1
- package/_standalone/.next/server/app/api/ask/route.js.nft.json +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.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/backlinks/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/bootstrap/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/bootstrap/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/changes/route.js.nft.json +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.js.nft.json +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.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/embedding/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/export/route.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/file/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/files/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/files/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/git/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/git/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/graph/route.js.nft.json +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.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.js +1 -7
- package/_standalone/.next/server/app/api/im/status/route.js.nft.json +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.js.nft.json +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.js +1 -7
- package/_standalone/.next/server/app/api/im/webhook/feishu/route.js.nft.json +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.js +1 -7
- package/_standalone/.next/server/app/api/im/webhook-status/route.js.nft.json +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.js.nft.json +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.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/inbox/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/init/route.js.nft.json +1 -1
- package/_standalone/.next/server/app/api/init/route_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/api/lint/route.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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.js.nft.json +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 +2 -2
- 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 +3 -3
- package/_standalone/.next/server/app/trash/page.js.nft.json +1 -1
- package/_standalone/.next/server/app/trash/page_client-reference-manifest.js +1 -1
- package/_standalone/.next/server/app/view/[...path]/page.js +3 -3
- 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 +30 -30
- package/_standalone/.next/server/chunks/1076.js +1 -1
- package/_standalone/.next/server/chunks/{2449.js → 2424.js} +2 -2
- package/_standalone/.next/server/chunks/2792.js +1 -0
- package/_standalone/.next/server/chunks/2885.js +7 -0
- package/_standalone/.next/server/chunks/3800.js +1 -1
- package/_standalone/.next/server/chunks/5299.js +1 -1
- package/_standalone/.next/server/chunks/5464.js +1 -1
- package/_standalone/.next/server/chunks/6022.js +28 -28
- package/_standalone/.next/server/chunks/6539.js +1 -1
- package/_standalone/.next/server/chunks/8388.js +2 -2
- 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/{5331.c89084fd7f67887d.js → 4342.ccc18d7a45f204a4.js} +5 -5
- package/_standalone/.next/static/chunks/{4094.09364c01df411380.js → 4496.f77a677ac2034e48.js} +1 -1
- package/_standalone/.next/static/chunks/{5358-15618fc9b20018ee.js → 5358-15ceeb8c1cd9889d.js} +6 -6
- package/_standalone/.next/static/chunks/{6902-edc5c487c696bd0b.js → 6902-53a31f849968ddf8.js} +1 -1
- package/_standalone/.next/static/chunks/9207-456dc6941d557f33.js +1 -0
- package/_standalone/.next/static/chunks/app/{layout-fcbde5bee626d21a.js → layout-09f08f52e3cbfc47.js} +66 -66
- package/_standalone/.next/static/chunks/app/setup/{page-e40f3c5704c3c857.js → page-64d7fa097ef3f367.js} +1 -1
- package/_standalone/.next/static/chunks/app/trash/page-8e0ea3ba71702757.js +1 -0
- package/_standalone/.next/static/chunks/app/view/[...path]/page-04f43178679a8bfb.js +12 -0
- package/_standalone/.next/static/chunks/{webpack-dc486b68118d1328.js → webpack-ec9c6076012b75f3.js} +1 -1
- package/_standalone/.next/trace +72 -72
- package/_standalone/__tests__/agent/provider-presets.test.ts +32 -0
- package/_standalone/__tests__/api/im-config-feishu-conversation.test.ts +39 -0
- package/_standalone/__tests__/api/im-webhook-feishu.test.ts +21 -12
- package/_standalone/__tests__/api/pi-subagents.test.ts +81 -0
- package/_standalone/__tests__/ask/file-chip-variants.test.tsx +18 -0
- package/_standalone/__tests__/ask/message-list-agent-attribution.test.tsx +2 -0
- package/_standalone/__tests__/im/feishu-dispatcher.test.ts +151 -0
- package/_standalone/__tests__/im/feishu-webhook.test.ts +85 -57
- package/_standalone/__tests__/im/feishu-ws-client.test.ts +91 -0
- package/_standalone/__tests__/settings/custom-provider-form.test.ts +30 -0
- package/_standalone/components/ask/FileChip.tsx +1 -1
- package/_standalone/components/ask/MessageList.tsx +2 -2
- package/_standalone/components/settings/CustomProviderFields.tsx +1 -1
- package/_standalone/components/settings/CustomProvidersCard.tsx +3 -0
- package/_standalone/components/settings/useCustomProviderForm.ts +78 -24
- package/_standalone/components/shared/ProviderSelect.tsx +6 -5
- package/_standalone/next.config.ts +28 -4
- package/_standalone/package-lock.json +20 -2
- package/_standalone/package.json +3 -1
- package/_standalone/scripts/feishu-long-connection.ts +32 -0
- package/_standalone/server.js +1 -1
- package/_standalone/tsconfig.tsbuildinfo +1 -1
- package/app/__tests__/agent/provider-presets.test.ts +32 -0
- package/app/__tests__/api/im-config-feishu-conversation.test.ts +39 -0
- package/app/__tests__/api/im-webhook-feishu.test.ts +21 -12
- package/app/__tests__/api/pi-subagents.test.ts +81 -0
- package/app/__tests__/ask/file-chip-variants.test.tsx +18 -0
- package/app/__tests__/ask/message-list-agent-attribution.test.tsx +2 -0
- package/app/__tests__/im/feishu-dispatcher.test.ts +151 -0
- package/app/__tests__/im/feishu-webhook.test.ts +85 -57
- package/app/__tests__/im/feishu-ws-client.test.ts +91 -0
- package/app/__tests__/settings/custom-provider-form.test.ts +30 -0
- package/app/app/api/ask/route.ts +2 -0
- package/app/app/api/im/config/route.ts +2 -0
- package/app/app/api/im/webhook/feishu/route.ts +4 -2
- package/app/components/ask/FileChip.tsx +1 -1
- package/app/components/ask/MessageList.tsx +2 -2
- package/app/components/settings/CustomProviderFields.tsx +1 -1
- package/app/components/settings/CustomProvidersCard.tsx +3 -0
- package/app/components/settings/useCustomProviderForm.ts +78 -24
- package/app/components/shared/ProviderSelect.tsx +6 -5
- package/app/lib/agent/providers.ts +44 -6
- package/app/lib/im/feishu-dispatcher.ts +111 -0
- package/app/lib/im/feishu-ws-client.ts +72 -0
- package/app/lib/im/types.ts +14 -0
- package/app/lib/im/webhook/feishu.ts +44 -55
- package/app/next.config.ts +28 -4
- package/app/package.json +3 -1
- package/app/scripts/feishu-long-connection.ts +32 -0
- package/bin/cli.js +3 -1
- package/bin/commands/feishu-ws.js +39 -0
- package/package.json +1 -1
- package/scripts/build-runtime-archive.sh +36 -2
- package/_standalone/.next/static/chunks/9207-3b19c55a3c974a09.js +0 -1
- package/_standalone/.next/static/chunks/app/trash/page-e623ff0ab35de002.js +0 -1
- package/_standalone/.next/static/chunks/app/view/[...path]/page-49c4eff6ffdb5168.js +0 -12
- /package/_standalone/.next/static/{Dn8EHqUedSzanCfrM8WWS → dZDCx13MSM8QVQk2QNRs8}/_buildManifest.js +0 -0
- /package/_standalone/.next/static/{Dn8EHqUedSzanCfrM8WWS → dZDCx13MSM8QVQk2QNRs8}/_ssgManifest.js +0 -0
|
@@ -32,12 +32,7 @@ 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"})]})}},
|
|
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:`
|
|
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"})]})}},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:`
|
|
41
36
|
|
|
42
37
|
**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:`
|
|
43
38
|
inline-flex items-center gap-1 rounded-full px-2.5 py-0.5
|
|
@@ -49,12 +44,17 @@ Be specific and actionable. Format in Markdown.`}(a,b,g)}],currentFile:c};h&&(i.
|
|
|
49
44
|
relative flex items-center ${f?"justify-start px-3 w-full":"justify-center w-10"} h-10 rounded-md transition-colors
|
|
50
45
|
${e?"text-[var(--amber)] bg-[var(--amber-dim)]":"text-muted-foreground hover:text-foreground hover:bg-muted"}
|
|
51
46
|
focus-visible:ring-2 focus-visible:ring-ring
|
|
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:`
|
|
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))]})]})}},8314:(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)("70d16cd0049bb99354c82d868bb46d43eb4475ae06",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:`
|
|
48
|
+
@keyframes dotBounce {
|
|
49
|
+
0%, 60%, 100% { opacity: 0.25; transform: translateY(0); }
|
|
50
|
+
30% { opacity: 1; transform: translateY(-2px); }
|
|
51
|
+
}
|
|
52
|
+
`})]})}},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")},25621:(a,b,c)=>{"use strict";c.d(b,{f:()=>e});var d=c(99829);let e=(0,d.createServerReference)("60bbcbc4f7bca33ff0fa3311ee13b6502b104fddc1",d.callServer,void 0,d.findSourceMapURL,"renameFileAction")},26026:(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(64650),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
53
|
hidden md:flex fixed top-0 h-screen z-30
|
|
54
54
|
flex-col bg-card border-r border-border
|
|
55
55
|
transition-[transform,left,width] duration-200 ease-out
|
|
56
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:`
|
|
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"})})]})}},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-[var(--amber)]"}},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)}},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:`
|
|
58
58
|
inline-flex items-center gap-1 rounded-full px-2.5 py-0.5
|
|
59
59
|
text-2xs font-medium transition-colors select-none
|
|
60
60
|
border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring
|
|
@@ -62,7 +62,7 @@ Be specific and actionable. Format in Markdown.`}(a,b,g)}],currentFile:c};h&&(i.
|
|
|
62
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"}
|
|
63
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}]
|
|
64
64
|
|
|
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).
|
|
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)}})},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).
|
|
66
66
|
|
|
67
67
|
The following files were recently modified:
|
|
68
68
|
${d}
|
|
@@ -136,23 +136,7 @@ MCP_TRANSPORT = "stdio"`;return{snippet:b,displaySnippet:b,path:a.globalPath}}if
|
|
|
136
136
|
flex-col bg-background border-l border-border/40 shadow-[-4px_0_16px_rgba(0,0,0,0.04)]
|
|
137
137
|
${y?"":"transition-[width,transform] duration-200 ease-out"}
|
|
138
138
|
${a?"translate-x-0":"translate-x-full pointer-events-none"}
|
|
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:`
|
|
140
|
-
fixed bottom-14 right-4 z-40 pointer-events-none
|
|
141
|
-
transition-all duration-200
|
|
142
|
-
${"visible"===c?"opacity-100 translate-y-0":"opacity-0 translate-y-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)}
|
|
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:`
|
|
145
|
-
inline-flex items-center gap-1 rounded-full px-2.5 py-0.5
|
|
146
|
-
text-2xs font-medium transition-colors
|
|
147
|
-
border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring
|
|
148
|
-
${x?"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"}
|
|
149
|
-
`,title:n.acpChangeAgent,"aria-expanded":o,"aria-haspopup":"listbox",children:[x?(0,d.jsx)(g.A,{size:11,className:"shrink-0 text-muted-foreground"}):(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--success)] shrink-0"}),(0,d.jsx)("span",{className:"truncate max-w-[120px]",children:y}),a?(0,d.jsx)("span",{role:"button",tabIndex:0,onClick:w,onKeyDown:a=>{("Enter"===a.key||" "===a.key)&&(a.preventDefault(),w(a))},className:"p-0.5 -mr-1 rounded-full text-muted-foreground hover:text-foreground transition-colors","aria-label":`Remove ${a.name}`,children:(0,d.jsx)(i.A,{size:9})}):(0,d.jsx)(j.A,{size:10,className:"shrink-0 text-muted-foreground"})]}),"u">typeof document&&z&&(0,f.createPortal)(z,document.body)]})}},74356:(a,b,c)=>{"use strict";c.d(b,{A:()=>ac});var d=c(48249),e=c(67484),f=c(42742),g=c(15273),h=c(95801),i=c(80600),j=c(19226),k=c(6079),l=c(40560),m=c(145),n=c(801),o=c(10316),p=c(11732),q=c(90473),r=c(8455),s=c(75157),t=c(96348),u=c(92023),v=c(36815),w=c(69593),x=c(39868),y=c(7309),z=c(35654),A=c(12625),B=c(50567),C=c(93017),D=c(59347),E=c(62688),F=c(11035),G=c(96286),H=c(13576),I=c(83654),J=c(44218),K=c(19794),L=c(31675),M=c(49681),N=c(2797);let O=new Set(["delete_file","move_file","rename_file","write_file"]),P=new Set(["write_file","create_file","update_section","insert_after_heading","edit_lines","append_to_file"]),Q={search:o.A,list_files:y.A,read_file:z.A,write_file:A.A,create_file:B.A,append_to_file:i.A,insert_after_heading:C.A,update_section:A.A,delete_file:D.A,rename_file:i.A,move_file:E.A,get_backlinks:F.A,get_history:G.A,get_file_at_version:G.A,get_recent:H.A,append_csv:I.A},R="--- changes ---";function S({part:a}){let b=P.has(a.toolName),c="done"===a.state,[f,g]=(0,e.useState)(null),h=f??(b&&c),i=Q[a.toolName]??m.A,j=O.has(a.toolName),k=(0,e.useMemo)(()=>(function(a){if(!a)return{header:"",stats:"",diffLines:[]};let b=a.indexOf(R);if(-1===b)return{header:a,stats:"",diffLines:[]};let c=a.slice(0,b).trim(),d=a.slice(b+R.length).trim(),e=c.match(/\((\+\d+\s*−\d+)\)/);return{header:c,stats:e?e[1]:"",diffLines:d.split("\n").map(a=>a.startsWith("+ ")?{prefix:"+",text:a.slice(2)}:a.startsWith("- ")?{prefix:"-",text:a.slice(2)}:a.startsWith(" ")?{prefix:" ",text:a.slice(2)}:{prefix:" ",text:a})}})(a.output),[a.output]),n=(0,e.useMemo)(()=>a.input&&"object"==typeof a.input?a.input.path??"":"",[a.input]),o=n?`${n.split("/").pop()??n}${k.stats?` (${k.stats})`:""}`:function(a){if(!a||"object"!=typeof a)return String(a??"");let b=[];for(let c of Object.values(a))"string"==typeof c?b.push(c.length>60?`${c.slice(0,60)}…`:c):Array.isArray(c)?b.push(`[${c.length} items]`):null!=c&&b.push(String(c));return b.join(", ")}(a.input);return(0,d.jsxs)("div",{className:`my-1.5 rounded-lg border text-xs font-mono ${j?"border-[var(--amber)]/30 bg-background/60":"border-border/40 bg-background/50"}`,children:[(0,d.jsxs)("button",{type:"button",onClick:()=>g(a=>null===a?!h:!a),"aria-expanded":h,className:"w-full flex items-center gap-1.5 px-2.5 py-2 text-left hover:bg-muted/30 transition-colors rounded-lg",children:[h?(0,d.jsx)(J.A,{size:12,className:"shrink-0 text-muted-foreground"}):(0,d.jsx)(K.A,{size:12,className:"shrink-0 text-muted-foreground"}),j&&(0,d.jsx)(L.A,{size:11,className:"shrink-0 text-[var(--amber)]"}),(0,d.jsx)(i,{size:12,className:`shrink-0 ${j?"text-[var(--amber)]":"text-muted-foreground"}`}),(0,d.jsx)("span",{className:`font-medium ${j?"text-[var(--amber)]":"text-foreground"}`,children:a.toolName}),(0,d.jsx)("span",{className:"text-muted-foreground truncate flex-1",children:o}),(0,d.jsx)("span",{className:"shrink-0 ml-auto",children:"pending"===a.state||"running"===a.state?(0,d.jsx)(l.A,{size:12,className:"animate-spin text-[var(--amber)]"}):"done"===a.state?(0,d.jsx)(M.A,{size:12,className:"text-success"}):(0,d.jsx)(N.A,{size:12,className:"text-error"})})]}),h&&(0,d.jsx)("div",{className:"border-t border-border/30",children:b&&c&&k.diffLines.length>0?(0,d.jsx)("div",{className:"max-h-64 overflow-y-auto",children:k.diffLines.map((a,b)=>(0,d.jsxs)("div",{className:`px-2 py-px flex items-start gap-1.5 ${"+"===a.prefix?"bg-success/8":"-"===a.prefix?"bg-error/8":""}`,children:[(0,d.jsx)("span",{className:`select-none w-3 shrink-0 text-right ${"+"===a.prefix?"text-success":"-"===a.prefix?"text-error":"text-muted-foreground/50"}`,children:a.prefix}),(0,d.jsx)("span",{className:`whitespace-pre-wrap break-all flex-1 ${"+"===a.prefix?"text-success":"-"===a.prefix?"text-error":"text-muted-foreground"}`,children:a.text||"\xa0"})]},b))}):(0,d.jsxs)("div",{className:"px-2.5 pb-2.5 pt-1.5 space-y-1.5",children:["running"===a.state&&(0,d.jsxs)("div",{className:"text-muted-foreground/60 text-2xs flex items-center gap-1.5",children:[(0,d.jsx)(l.A,{size:10,className:"animate-spin"})," Running..."]}),(0,d.jsxs)("div",{className:"text-muted-foreground leading-relaxed",children:[(0,d.jsx)("span",{className:"font-semibold text-foreground/70",children:"Input: "}),(0,d.jsx)("span",{className:"break-all whitespace-pre-wrap",children:JSON.stringify(a.input,null,2)})]}),void 0!==a.output&&""!==a.output&&(0,d.jsxs)("div",{className:"text-muted-foreground leading-relaxed",children:[(0,d.jsx)("span",{className:"font-semibold text-foreground/70",children:"Output: "}),(0,d.jsx)("span",{className:"break-all whitespace-pre-wrap",children:a.output.length>500?a.output.slice(0,500)+"…":a.output})]})]})})]})}var T=c(46218),U=c(47223);function V({text:a,isStreaming:b}){let[c,f]=(0,e.useState)(!1),{t:g}=(0,U.Y)();return a||b?(0,d.jsxs)("div",{className:"my-1.5 rounded-lg border border-border/30 bg-muted/15 text-xs",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>f(a=>!a),"aria-expanded":c,className:"w-full flex items-center gap-1.5 px-2.5 py-2 text-left hover:bg-muted/30 transition-colors rounded-lg",children:[c?(0,d.jsx)(J.A,{size:12,className:"shrink-0 text-muted-foreground"}):(0,d.jsx)(K.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,d.jsx)(T.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,d.jsxs)("span",{className:"text-muted-foreground font-medium",children:[g.ask.thinkingLabel,b&&!c&&(0,d.jsx)("span",{className:"ml-1 animate-pulse",children:"..."})]}),!c&&a&&(0,d.jsxs)("span",{className:"text-muted-foreground/50 truncate flex-1 ml-1",children:[a.slice(0,80),a.length>80?"...":""]})]}),c&&(0,d.jsx)("div",{className:"px-2.5 pb-2.5 pt-1 border-t border-border/20",children:(0,d.jsxs)("div",{className:"text-muted-foreground whitespace-pre-wrap leading-relaxed",children:[a,b&&(0,d.jsx)("span",{className:"inline-block w-1 h-3 bg-muted-foreground/40 ml-0.5 align-middle animate-pulse rounded-full"})]})})]}):null}var W=c(59867);let X=/^Use the skill ([^:]+):\s*/;function Y({text:a,label:b}){let[c,h]=(0,e.useState)(!1),i=(0,e.useCallback)(()=>{(0,x.l)(a).then(a=>{a&&(h(!0),setTimeout(()=>h(!1),2e3))})},[a]);return(0,d.jsx)("button",{type:"button",onClick:i,className:"p-1 rounded-md bg-card border border-border/60 shadow-sm text-muted-foreground hover:text-foreground transition-colors",title:b??"Copy",children:c?(0,d.jsx)(f.A,{size:11,className:"text-success"}):(0,d.jsx)(g.A,{size:11})})}function Z({content:a,skillName:b,images:c,attachedFiles:e,uploadedFileNames:f}){let g=b??a.match(X)?.[1],k=a.match(X),l=k?a.slice(k[0].length):a,m=new Set(f??[]),n=e?.filter(a=>!m.has(a.split("/").pop()??a)),o=n&&n.length>0||f&&f.length>0;return(0,d.jsxs)(d.Fragment,{children:[c&&c.length>0&&(0,d.jsx)("div",{className:`flex flex-wrap gap-1.5${a?" mb-2":""}`,children:c.map((a,b)=>a.data?(0,d.jsx)("img",{src:`data:${a.mimeType};base64,${a.data}`,alt:`Image ${b+1}`,className:"max-h-48 max-w-full rounded-md object-contain"},b):(0,d.jsx)("div",{className:"h-12 px-3 rounded-md bg-muted flex items-center gap-1.5 text-xs text-muted-foreground",children:(0,d.jsxs)("span",{children:["[Image ",b+1,"]"]})},b))}),g&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-[11px] font-medium bg-white/20 text-white/90 mr-1 align-middle",children:[(0,d.jsx)(h.A,{size:10,className:"shrink-0"}),g]}),g?l:a,o&&(0,d.jsxs)("div",{className:"mt-2 pt-1.5 border-t border-white/15 flex flex-wrap gap-1 whitespace-normal",role:"list","aria-label":"Attached files",children:[n?.map(a=>(0,d.jsxs)("span",{role:"listitem",className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] bg-white/10 text-white/80 min-w-0",title:a,children:[(0,d.jsx)(i.A,{size:9,className:"shrink-0 opacity-70"}),(0,d.jsx)("span",{className:"truncate max-w-[120px]",children:a.split("/").pop()})]},a)),f?.map(a=>(0,d.jsxs)("span",{role:"listitem",className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] bg-white/10 text-white/80 min-w-0",title:a,children:[(0,d.jsx)(j.A,{size:9,className:"shrink-0 opacity-70"}),(0,d.jsx)("span",{className:"truncate max-w-[120px]",children:a})]},a))]})]})}function $({agentName:a}){return a?(0,d.jsxs)("div",{className:"mb-2 inline-flex items-center gap-1 rounded-full border border-[var(--amber)]/15 bg-[var(--amber)]/8 px-2 py-0.5 text-[10px] font-medium tracking-wide text-[var(--amber)]",children:[(0,d.jsx)(k.A,{size:10,className:"shrink-0"}),(0,d.jsx)("span",{children:a})]}):null}function _({content:a,isStreaming:b}){let c=(0,w.Oo)(a);return c||b?(0,d.jsxs)("div",{className:"prose prose-sm prose-panel dark:prose-invert max-w-none text-foreground prose-p:my-2 prose-p:leading-relaxed prose-headings:font-semibold prose-headings:my-3 prose-h1:text-base prose-h2:text-[15px] prose-h3:text-sm prose-ul:my-1.5 prose-li:my-0.5 prose-ol:my-1.5 prose-code:text-[0.8em] prose-code:bg-muted/80 prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded-md prose-code:before:content-none prose-code:after:content-none prose-code:font-mono prose-pre:bg-muted/60 prose-pre:text-foreground prose-pre:text-xs prose-pre:rounded-lg prose-blockquote:border-l-[var(--amber)] prose-blockquote:text-muted-foreground prose-blockquote:not-italic prose-a:text-[var(--amber)] prose-a:no-underline hover:prose-a:underline prose-strong:text-foreground prose-strong:font-semibold prose-table:text-xs prose-th:py-1.5 prose-td:py-1 ",children:[(0,d.jsx)(u.oz,{remarkPlugins:[v.A],children:c}),b&&(0,d.jsx)("span",{className:"inline-block w-1.5 h-3.5 bg-[var(--amber)] ml-0.5 align-middle animate-pulse rounded-full"})]}):null}function aa({message:a,isStreaming:b}){let c=a.parts;if(!c||0===c.length)return a.content?(0,d.jsx)(_,{content:a.content,isStreaming:b}):null;let e=c[c.length-1],f=b&&"tool-call"===e.type&&("running"===e.state||"pending"===e.state);return(0,d.jsxs)("div",{children:[c.map((a,e)=>{if("reasoning"===a.type){let f=b&&e===c.length-1;return(0,d.jsx)(V,{text:a.text,isStreaming:f},`reasoning-${e}`)}if("text"===a.type){let f=b&&e===c.length-1;return a.text?(0,d.jsx)(_,{content:a.text,isStreaming:f},e):null}return"tool-call"===a.type?(0,d.jsx)(S,{part:a},a.toolCallId):null}),f&&(0,d.jsxs)("div",{className:"flex items-center gap-2 py-1.5 mt-1.5",children:[(0,d.jsx)(l.A,{size:12,className:"animate-spin text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground animate-pulse",children:"Executing tool…"})]})]})}function ab({parts:a}){if(!a)return null;let b=a.filter(a=>"tool-call"===a.type);if(0===b.length)return null;let c=b[b.length-1],e="tool-call"===c.type?c.toolName:"";return(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mt-2 pt-1.5 border-t border-border/15 text-xs text-muted-foreground/60",children:[(0,d.jsx)(m.A,{size:10}),(0,d.jsxs)("span",{className:"font-medium",children:["Step ",b.length,e?` — ${e}`:""]})]})}let ac=(0,e.memo)(function({messages:a,isLoading:b,loadingPhase:c,emptyPrompt:f,emptyHint:g,suggestions:h,onSuggestionClick:i,labels:j}){let m=(0,e.useRef)(null),u=(0,e.useRef)(null),[v,x]=(0,e.useState)(!1),y=(0,e.useCallback)(()=>{let a=u.current;a&&a.scrollTo({top:a.scrollHeight,behavior:"smooth"})},[]);return(0,d.jsxs)("div",{ref:u,role:"log","aria-live":"polite",className:"relative flex-1 overflow-y-auto overflow-x-hidden px-4 py-5 space-y-5 min-h-0",children:[0===a.length&&(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center flex-1 min-h-[260px] px-6 pt-10 pb-4",children:[(0,d.jsxs)("div",{className:"relative w-12 h-12 rounded-2xl bg-[var(--amber)]/10 flex items-center justify-center mb-6",children:[(0,d.jsx)("div",{className:"absolute inset-0 rounded-2xl bg-[var(--amber)]/5 scale-[1.4]"}),(0,d.jsx)(k.A,{size:22,className:"text-[var(--amber)] relative z-10"})]}),(0,d.jsx)("p",{className:"text-center text-[15px] font-semibold text-foreground tracking-tight mb-2",children:f}),g&&(0,d.jsx)("p",{className:"text-center text-xs text-muted-foreground/80 mb-10 tracking-wide",children:g}),(0,d.jsx)("div",{className:"flex flex-col gap-2.5 max-w-[280px] w-full",children:h.map((a,b)=>{let c=[n.A,o.A,p.A,q.A],e=c[b%c.length];return(0,d.jsxs)("button",{type:"button",onClick:()=>i(a.prompt),className:"group/sug flex items-center gap-3 text-left text-[13px] px-3.5 py-3 rounded-xl border border-border/40 bg-transparent text-muted-foreground hover:text-foreground hover:border-[var(--amber)]/30 hover:bg-[var(--amber)]/5 transition-all leading-snug","aria-label":a.prompt,children:[(0,d.jsx)("span",{className:"shrink-0 w-8 h-8 rounded-lg bg-muted/60 flex items-center justify-center group-hover/sug:bg-[var(--amber)]/10 transition-colors",children:(0,d.jsx)(e,{size:15,className:"text-muted-foreground/70 group-hover/sug:text-[var(--amber)] transition-colors"})}),(0,d.jsx)("span",{className:"flex-1",children:a.label})]},b)})})]}),a.map((e,f)=>(0,d.jsxs)("div",{className:`flex gap-3 animate-[fadeSlideUp_0.22s_ease_both] ${"user"===e.role?"justify-end":"justify-start"}`,children:["assistant"===e.role&&(0,d.jsx)("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center shrink-0 mt-0.5 bg-[var(--amber)]/8",children:(0,d.jsx)(k.A,{size:13,className:"text-[var(--amber)]"})}),"user"===e.role?(0,d.jsx)("div",{className:"max-w-[85%] px-3.5 py-2.5 rounded-2xl rounded-br-lg text-sm leading-relaxed whitespace-pre-wrap bg-[var(--amber)] text-[var(--amber-foreground)] shadow-sm shadow-[var(--amber)]/10",children:(0,d.jsx)(Z,{content:e.content,skillName:e.skillName,images:e.images,attachedFiles:e.attachedFiles,uploadedFileNames:e.uploadedFileNames})}):e.content.startsWith("__error__")?(0,d.jsxs)("div",{className:"max-w-[85%] px-3.5 py-3 rounded-2xl rounded-bl-md border border-error/30 bg-error/10 text-sm shadow-sm",children:[(0,d.jsx)($,{agentName:e.agentName}),(0,d.jsxs)("div",{className:"flex items-start gap-2.5 text-error",children:[(0,d.jsx)(r.A,{size:15,className:"shrink-0 mt-0.5"}),(0,d.jsx)("span",{className:"leading-relaxed font-medium",children:e.content.slice(9)})]})]}):(0,d.jsxs)("div",{className:"group relative max-w-[85%] px-3.5 py-2.5 rounded-2xl rounded-bl-lg bg-card border border-border/30 shadow-sm text-foreground text-sm",children:[(0,d.jsx)($,{agentName:e.agentName}),e.parts&&e.parts.length>0||(0,w.Oo)(e.content)?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(aa,{message:e,isStreaming:b&&f===a.length-1}),b&&f===a.length-1&&(0,d.jsx)(ab,{parts:e.parts}),!(b&&f===a.length-1)&&(0,w.Oo)(e.content)&&(0,d.jsxs)("div",{className:"absolute -bottom-1 right-1 z-10 flex items-center gap-1 opacity-100 md:opacity-0 md:group-hover:opacity-100 transition-opacity",children:[(0,d.jsx)(W.x,{text:e.content}),(0,d.jsx)(Y,{text:(0,w.Oo)(e.content),label:j.copyMessage})]})]}):b&&f===a.length-1?(0,d.jsxs)("div",{className:"flex items-center gap-2.5 py-1",children:["reconnecting"===c?(0,d.jsx)(s.A,{size:14,className:"text-[var(--amber)] animate-pulse"}):(0,d.jsx)(l.A,{size:14,className:"animate-spin text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,d.jsxs)("span",{className:"inline-flex items-center gap-1",children:["reconnecting"===c?j.reconnecting??"Reconnecting...":"connecting"===c?j.connecting:"thinking"===c?j.thinking:j.generating,(0,d.jsxs)("span",{className:"inline-flex gap-0.5",children:[(0,d.jsx)("span",{className:"w-1 h-1 rounded-full bg-[var(--amber)] animate-bounce [animation-delay:0ms]"}),(0,d.jsx)("span",{className:"w-1 h-1 rounded-full bg-[var(--amber)] animate-bounce [animation-delay:150ms]"}),(0,d.jsx)("span",{className:"w-1 h-1 rounded-full bg-[var(--amber)] animate-bounce [animation-delay:300ms]"})]})]})})]}):null]})]},f)),(0,d.jsx)("div",{ref:m}),v&&a.length>0&&(0,d.jsx)("button",{type:"button",onClick:y,className:"sticky bottom-2 left-1/2 -translate-x-1/2 z-10 p-2 rounded-full border border-border/60 bg-card shadow-md text-muted-foreground hover:text-foreground hover:bg-muted transition-all hover:shadow-lg",title:"Scroll to bottom",children:(0,d.jsx)(t.A,{size:14})})]})})},74434:(a,b,c)=>{"use strict";c.d(b,{A:()=>K});var d=c(48249),e=c(67484),f=c(19099),g=c(69924),h=c(40560),i=c(41023),j=c(95581),k=c(18329),l=c(32621),m=c(47223),n=c(4140),o=c(4919),p=c(13799),q=c(95801),r=c(22341),s=c(78890);function t({copy:a,connectedCount:b,mcpEnabled:c=!0,channelsActive:e=!1,onChannelsClick:g}){let h=(0,f.usePathname)(),j=(0,f.useSearchParams)().get("tab"),k="/agents"===h,l=!e;return(0,d.jsxs)("div",{className:"py-2",children:[(0,d.jsx)(s.G,{icon:(0,d.jsx)(o.A,{size:14,className:l&&k&&(null===j||"overview"===j)?"text-[var(--amber)]":"text-muted-foreground"}),title:a.navOverview,badge:(0,d.jsx)("span",{className:"text-2xs tabular-nums text-muted-foreground/60 px-1.5 py-0.5 rounded bg-muted/40 font-medium",children:b}),href:"/agents",active:l&&k&&(null===j||"overview"===j)}),c&&(0,d.jsx)(s.G,{icon:(0,d.jsx)(p.A,{size:14,className:l&&k&&"mcp"===j?"text-[var(--amber)]":"text-muted-foreground"}),title:a.navMcp,href:"/agents?tab=mcp",active:l&&k&&"mcp"===j}),(0,d.jsx)(s.G,{icon:(0,d.jsx)(q.A,{size:14,className:l&&k&&"skills"===j?"text-[var(--amber)]":"text-muted-foreground"}),title:a.navSkills,href:"/agents?tab=skills",active:l&&k&&"skills"===j}),(0,d.jsx)(s.G,{icon:(0,d.jsx)(r.A,{size:14,className:e?"text-[var(--amber)]":"text-muted-foreground"}),title:a.navChannels,onClick:g,active:e}),(0,d.jsx)(s.G,{icon:(0,d.jsx)(i.A,{size:14,className:l&&k&&"a2a"===j?"text-[var(--amber)]":"text-muted-foreground"}),title:a.navNetwork,href:"/agents?tab=a2a",active:l&&k&&"a2a"===j})]})}var u=c(44218),v=c(19794),w=c(2116),x=c.n(w),y=c(42742),z=c(82594),A=c(57056);function B({agent:a,agentStatus:b,selected:c=!1,detailHref:e,onInstallAgent:f,copy:g,isA2aReady:h=!1,a2aTooltip:j}){return(0,d.jsxs)("div",{className:`
|
|
150
|
-
group flex items-center gap-0 rounded-xl border transition-all duration-150
|
|
151
|
-
${c?"border-border ring-2 ring-ring/50 bg-[var(--amber-dim)]/45":"border-border/70 bg-card/50 hover:border-border hover:bg-muted/25"}
|
|
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:`
|
|
153
|
-
relative flex items-center gap-2.5 px-3 py-2 text-left rounded-sm transition-colors
|
|
154
|
-
${h?"bg-[var(--amber-dim)]/40 pl-3.5":"hover:bg-muted/50"}
|
|
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 覆盖:
|
|
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)})]})}},64650:(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)("60ff38a1e7c12956af51587d6735b6270c886b0189",v.callServer,void 0,v.findSourceMapURL,"createFileAction"),x=(0,v.createServerReference)("6018b06c5f4acddbcd531440029db8625b9dc42c01",v.callServer,void 0,v.findSourceMapURL,"renameSpaceAction");var y=c(25621);let z=(0,v.createServerReference)("4080ae086bd630df5a48b1901fbd1db818337e2873",v.callServer,void 0,v.findSourceMapURL,"deleteSpaceAction"),A=(0,v.createServerReference)("40fafcaccf5c19868cf011332ee71efd81a90b7f23",v.callServer,void 0,v.findSourceMapURL,"deleteFolderAction");var B=c(77361),C=c(98120),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)("401565f7e4f3b54b4aa2e09cb7b67becb3fd2db35a",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
140
|
1. 「${b}/README.md」— 写入空间用途、结构概览、使用指南
|
|
157
141
|
2. 「${b}/INSTRUCTION.md」— 写入 AI Agent 在此空间中的行为规则和操作约定
|
|
158
142
|
|
|
@@ -169,7 +153,23 @@ Keep content concise and actionable. Write files directly using tools.`;window.d
|
|
|
169
153
|
w-full flex items-center gap-1.5 px-2 py-1 rounded text-left
|
|
170
154
|
text-sm transition-colors duration-100 cursor-default pr-16
|
|
171
155
|
${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:`
|
|
156
|
+
`,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))})}},65141:(a,b,c)=>{"use strict";c.d(b,{b:()=>g});var d=c(67484),e=c(26026),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:`
|
|
157
|
+
fixed bottom-14 right-4 z-40 pointer-events-none
|
|
158
|
+
transition-all duration-200
|
|
159
|
+
${"visible"===c?"opacity-100 translate-y-0":"opacity-0 translate-y-2"}
|
|
160
|
+
`,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
|
+
`),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
|
+
inline-flex items-center gap-1 rounded-full px-2.5 py-0.5
|
|
163
|
+
text-2xs font-medium transition-colors
|
|
164
|
+
border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring
|
|
165
|
+
${x?"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"}
|
|
166
|
+
`,title:n.acpChangeAgent,"aria-expanded":o,"aria-haspopup":"listbox",children:[x?(0,d.jsx)(g.A,{size:11,className:"shrink-0 text-muted-foreground"}):(0,d.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--success)] shrink-0"}),(0,d.jsx)("span",{className:"truncate max-w-[120px]",children:y}),a?(0,d.jsx)("span",{role:"button",tabIndex:0,onClick:w,onKeyDown:a=>{("Enter"===a.key||" "===a.key)&&(a.preventDefault(),w(a))},className:"p-0.5 -mr-1 rounded-full text-muted-foreground hover:text-foreground transition-colors","aria-label":`Remove ${a.name}`,children:(0,d.jsx)(i.A,{size:9})}):(0,d.jsx)(j.A,{size:10,className:"shrink-0 text-muted-foreground"})]}),"u">typeof document&&z&&(0,f.createPortal)(z,document.body)]})}},74356:(a,b,c)=>{"use strict";c.d(b,{A:()=>ad});var d=c(48249),e=c(67484),f=c(42742),g=c(15273),h=c(95801),i=c(80600),j=c(19226),k=c(65255),l=c(40560),m=c(145),n=c(6079),o=c(801),p=c(10316),q=c(11732),r=c(90473),s=c(8455),t=c(75157),u=c(96348),v=c(92023),w=c(36815),x=c(69593),y=c(39868),z=c(7309),A=c(35654),B=c(12625),C=c(50567),D=c(93017),E=c(59347),F=c(62688),G=c(11035),H=c(96286),I=c(13576),J=c(83654),K=c(44218),L=c(19794),M=c(31675),N=c(49681),O=c(2797);let P=new Set(["delete_file","move_file","rename_file","write_file"]),Q=new Set(["write_file","create_file","update_section","insert_after_heading","edit_lines","append_to_file"]),R={search:p.A,list_files:z.A,read_file:A.A,write_file:B.A,create_file:C.A,append_to_file:i.A,insert_after_heading:D.A,update_section:B.A,delete_file:E.A,rename_file:i.A,move_file:F.A,get_backlinks:G.A,get_history:H.A,get_file_at_version:H.A,get_recent:I.A,append_csv:J.A},S="--- changes ---";function T({part:a}){let b=Q.has(a.toolName),c="done"===a.state,[f,g]=(0,e.useState)(null),h=f??(b&&c),i=R[a.toolName]??m.A,j=P.has(a.toolName),k=(0,e.useMemo)(()=>(function(a){if(!a)return{header:"",stats:"",diffLines:[]};let b=a.indexOf(S);if(-1===b)return{header:a,stats:"",diffLines:[]};let c=a.slice(0,b).trim(),d=a.slice(b+S.length).trim(),e=c.match(/\((\+\d+\s*−\d+)\)/);return{header:c,stats:e?e[1]:"",diffLines:d.split("\n").map(a=>a.startsWith("+ ")?{prefix:"+",text:a.slice(2)}:a.startsWith("- ")?{prefix:"-",text:a.slice(2)}:a.startsWith(" ")?{prefix:" ",text:a.slice(2)}:{prefix:" ",text:a})}})(a.output),[a.output]),n=(0,e.useMemo)(()=>a.input&&"object"==typeof a.input?a.input.path??"":"",[a.input]),o=n?`${n.split("/").pop()??n}${k.stats?` (${k.stats})`:""}`:function(a){if(!a||"object"!=typeof a)return String(a??"");let b=[];for(let c of Object.values(a))"string"==typeof c?b.push(c.length>60?`${c.slice(0,60)}…`:c):Array.isArray(c)?b.push(`[${c.length} items]`):null!=c&&b.push(String(c));return b.join(", ")}(a.input);return(0,d.jsxs)("div",{className:`my-1.5 rounded-lg border text-xs font-mono ${j?"border-[var(--amber)]/30 bg-background/60":"border-border/40 bg-background/50"}`,children:[(0,d.jsxs)("button",{type:"button",onClick:()=>g(a=>null===a?!h:!a),"aria-expanded":h,className:"w-full flex items-center gap-1.5 px-2.5 py-2 text-left hover:bg-muted/30 transition-colors rounded-lg",children:[h?(0,d.jsx)(K.A,{size:12,className:"shrink-0 text-muted-foreground"}):(0,d.jsx)(L.A,{size:12,className:"shrink-0 text-muted-foreground"}),j&&(0,d.jsx)(M.A,{size:11,className:"shrink-0 text-[var(--amber)]"}),(0,d.jsx)(i,{size:12,className:`shrink-0 ${j?"text-[var(--amber)]":"text-muted-foreground"}`}),(0,d.jsx)("span",{className:`font-medium ${j?"text-[var(--amber)]":"text-foreground"}`,children:a.toolName}),(0,d.jsx)("span",{className:"text-muted-foreground truncate flex-1",children:o}),(0,d.jsx)("span",{className:"shrink-0 ml-auto",children:"pending"===a.state||"running"===a.state?(0,d.jsx)(l.A,{size:12,className:"animate-spin text-[var(--amber)]"}):"done"===a.state?(0,d.jsx)(N.A,{size:12,className:"text-success"}):(0,d.jsx)(O.A,{size:12,className:"text-error"})})]}),h&&(0,d.jsx)("div",{className:"border-t border-border/30",children:b&&c&&k.diffLines.length>0?(0,d.jsx)("div",{className:"max-h-64 overflow-y-auto",children:k.diffLines.map((a,b)=>(0,d.jsxs)("div",{className:`px-2 py-px flex items-start gap-1.5 ${"+"===a.prefix?"bg-success/8":"-"===a.prefix?"bg-error/8":""}`,children:[(0,d.jsx)("span",{className:`select-none w-3 shrink-0 text-right ${"+"===a.prefix?"text-success":"-"===a.prefix?"text-error":"text-muted-foreground/50"}`,children:a.prefix}),(0,d.jsx)("span",{className:`whitespace-pre-wrap break-all flex-1 ${"+"===a.prefix?"text-success":"-"===a.prefix?"text-error":"text-muted-foreground"}`,children:a.text||"\xa0"})]},b))}):(0,d.jsxs)("div",{className:"px-2.5 pb-2.5 pt-1.5 space-y-1.5",children:["running"===a.state&&(0,d.jsxs)("div",{className:"text-muted-foreground/60 text-2xs flex items-center gap-1.5",children:[(0,d.jsx)(l.A,{size:10,className:"animate-spin"})," Running..."]}),(0,d.jsxs)("div",{className:"text-muted-foreground leading-relaxed",children:[(0,d.jsx)("span",{className:"font-semibold text-foreground/70",children:"Input: "}),(0,d.jsx)("span",{className:"break-all whitespace-pre-wrap",children:JSON.stringify(a.input,null,2)})]}),void 0!==a.output&&""!==a.output&&(0,d.jsxs)("div",{className:"text-muted-foreground leading-relaxed",children:[(0,d.jsx)("span",{className:"font-semibold text-foreground/70",children:"Output: "}),(0,d.jsx)("span",{className:"break-all whitespace-pre-wrap",children:a.output.length>500?a.output.slice(0,500)+"…":a.output})]})]})})]})}var U=c(46218),V=c(47223);function W({text:a,isStreaming:b}){let[c,f]=(0,e.useState)(!1),{t:g}=(0,V.Y)();return a||b?(0,d.jsxs)("div",{className:"my-1.5 rounded-lg border border-border/30 bg-muted/15 text-xs",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>f(a=>!a),"aria-expanded":c,className:"w-full flex items-center gap-1.5 px-2.5 py-2 text-left hover:bg-muted/30 transition-colors rounded-lg",children:[c?(0,d.jsx)(K.A,{size:12,className:"shrink-0 text-muted-foreground"}):(0,d.jsx)(L.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,d.jsx)(U.A,{size:12,className:"shrink-0 text-muted-foreground"}),(0,d.jsxs)("span",{className:"text-muted-foreground font-medium",children:[g.ask.thinkingLabel,b&&!c&&(0,d.jsx)("span",{className:"ml-1 animate-pulse",children:"..."})]}),!c&&a&&(0,d.jsxs)("span",{className:"text-muted-foreground/50 truncate flex-1 ml-1",children:[a.slice(0,80),a.length>80?"...":""]})]}),c&&(0,d.jsx)("div",{className:"px-2.5 pb-2.5 pt-1 border-t border-border/20",children:(0,d.jsxs)("div",{className:"text-muted-foreground whitespace-pre-wrap leading-relaxed",children:[a,b&&(0,d.jsx)("span",{className:"inline-block w-1 h-3 bg-muted-foreground/40 ml-0.5 align-middle animate-pulse rounded-full"})]})})]}):null}var X=c(59867);let Y=/^Use the skill ([^:]+):\s*/;function Z({text:a,label:b}){let[c,h]=(0,e.useState)(!1),i=(0,e.useCallback)(()=>{(0,y.l)(a).then(a=>{a&&(h(!0),setTimeout(()=>h(!1),2e3))})},[a]);return(0,d.jsx)("button",{type:"button",onClick:i,className:"p-1 rounded-md bg-card border border-border/60 shadow-sm text-muted-foreground hover:text-foreground transition-colors",title:b??"Copy",children:c?(0,d.jsx)(f.A,{size:11,className:"text-success"}):(0,d.jsx)(g.A,{size:11})})}function $({content:a,skillName:b,images:c,attachedFiles:e,uploadedFileNames:f}){let g=b??a.match(Y)?.[1],k=a.match(Y),l=k?a.slice(k[0].length):a,m=new Set(f??[]),n=e?.filter(a=>!m.has(a.split("/").pop()??a)),o=n&&n.length>0||f&&f.length>0;return(0,d.jsxs)(d.Fragment,{children:[c&&c.length>0&&(0,d.jsx)("div",{className:`flex flex-wrap gap-1.5${a?" mb-2":""}`,children:c.map((a,b)=>a.data?(0,d.jsx)("img",{src:`data:${a.mimeType};base64,${a.data}`,alt:`Image ${b+1}`,className:"max-h-48 max-w-full rounded-md object-contain"},b):(0,d.jsx)("div",{className:"h-12 px-3 rounded-md bg-muted flex items-center gap-1.5 text-xs text-muted-foreground",children:(0,d.jsxs)("span",{children:["[Image ",b+1,"]"]})},b))}),g&&(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded-full text-[11px] font-medium bg-white/20 text-white/90 mr-1 align-middle",children:[(0,d.jsx)(h.A,{size:10,className:"shrink-0"}),g]}),g?l:a,o&&(0,d.jsxs)("div",{className:"mt-2 pt-1.5 border-t border-white/15 flex flex-wrap gap-1 whitespace-normal",role:"list","aria-label":"Attached files",children:[n?.map(a=>(0,d.jsxs)("span",{role:"listitem",className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] bg-white/10 text-white/80 min-w-0",title:a,children:[(0,d.jsx)(i.A,{size:9,className:"shrink-0 opacity-70"}),(0,d.jsx)("span",{className:"truncate max-w-[120px]",children:a.split("/").pop()})]},a)),f?.map(a=>(0,d.jsxs)("span",{role:"listitem",className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] bg-white/10 text-white/80 min-w-0",title:a,children:[(0,d.jsx)(j.A,{size:9,className:"shrink-0 opacity-70"}),(0,d.jsx)("span",{className:"truncate max-w-[120px]",children:a})]},a))]})]})}function _({agentName:a}){return a?(0,d.jsxs)("div",{className:"mb-2 inline-flex items-center gap-1 rounded-full border border-[var(--amber)]/15 bg-[var(--amber)]/8 px-2 py-0.5 text-[10px] font-medium tracking-wide text-[var(--amber)]",children:[(0,d.jsx)(k.A,{size:10,className:"shrink-0"}),(0,d.jsx)("span",{children:a})]}):null}function aa({content:a,isStreaming:b}){let c=(0,x.Oo)(a);return c||b?(0,d.jsxs)("div",{className:"prose prose-sm prose-panel dark:prose-invert max-w-none text-foreground prose-p:my-2 prose-p:leading-relaxed prose-headings:font-semibold prose-headings:my-3 prose-h1:text-base prose-h2:text-[15px] prose-h3:text-sm prose-ul:my-1.5 prose-li:my-0.5 prose-ol:my-1.5 prose-code:text-[0.8em] prose-code:bg-muted/80 prose-code:px-1.5 prose-code:py-0.5 prose-code:rounded-md prose-code:before:content-none prose-code:after:content-none prose-code:font-mono prose-pre:bg-muted/60 prose-pre:text-foreground prose-pre:text-xs prose-pre:rounded-lg prose-blockquote:border-l-[var(--amber)] prose-blockquote:text-muted-foreground prose-blockquote:not-italic prose-a:text-[var(--amber)] prose-a:no-underline hover:prose-a:underline prose-strong:text-foreground prose-strong:font-semibold prose-table:text-xs prose-th:py-1.5 prose-td:py-1 ",children:[(0,d.jsx)(v.oz,{remarkPlugins:[w.A],children:c}),b&&(0,d.jsx)("span",{className:"inline-block w-1.5 h-3.5 bg-[var(--amber)] ml-0.5 align-middle animate-pulse rounded-full"})]}):null}function ab({message:a,isStreaming:b}){let c=a.parts;if(!c||0===c.length)return a.content?(0,d.jsx)(aa,{content:a.content,isStreaming:b}):null;let e=c[c.length-1],f=b&&"tool-call"===e.type&&("running"===e.state||"pending"===e.state);return(0,d.jsxs)("div",{children:[c.map((a,e)=>{if("reasoning"===a.type){let f=b&&e===c.length-1;return(0,d.jsx)(W,{text:a.text,isStreaming:f},`reasoning-${e}`)}if("text"===a.type){let f=b&&e===c.length-1;return a.text?(0,d.jsx)(aa,{content:a.text,isStreaming:f},e):null}return"tool-call"===a.type?(0,d.jsx)(T,{part:a},a.toolCallId):null}),f&&(0,d.jsxs)("div",{className:"flex items-center gap-2 py-1.5 mt-1.5",children:[(0,d.jsx)(l.A,{size:12,className:"animate-spin text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground animate-pulse",children:"Executing tool…"})]})]})}function ac({parts:a}){if(!a)return null;let b=a.filter(a=>"tool-call"===a.type);if(0===b.length)return null;let c=b[b.length-1],e="tool-call"===c.type?c.toolName:"";return(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mt-2 pt-1.5 border-t border-border/15 text-xs text-muted-foreground/60",children:[(0,d.jsx)(m.A,{size:10}),(0,d.jsxs)("span",{className:"font-medium",children:["Step ",b.length,e?` — ${e}`:""]})]})}let ad=(0,e.memo)(function({messages:a,isLoading:b,loadingPhase:c,emptyPrompt:f,emptyHint:g,suggestions:h,onSuggestionClick:i,labels:j}){let k=(0,e.useRef)(null),m=(0,e.useRef)(null),[v,w]=(0,e.useState)(!1),y=(0,e.useCallback)(()=>{let a=m.current;a&&a.scrollTo({top:a.scrollHeight,behavior:"smooth"})},[]);return(0,d.jsxs)("div",{ref:m,role:"log","aria-live":"polite",className:"relative flex-1 overflow-y-auto overflow-x-hidden px-4 py-5 space-y-5 min-h-0",children:[0===a.length&&(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center flex-1 min-h-[260px] px-6 pt-10 pb-4",children:[(0,d.jsxs)("div",{className:"relative w-12 h-12 rounded-2xl bg-[var(--amber)]/10 flex items-center justify-center mb-6",children:[(0,d.jsx)("div",{className:"absolute inset-0 rounded-2xl bg-[var(--amber)]/5 scale-[1.4]"}),(0,d.jsx)(n.A,{size:22,className:"text-[var(--amber)] relative z-10"})]}),(0,d.jsx)("p",{className:"text-center text-[15px] font-semibold text-foreground tracking-tight mb-2",children:f}),g&&(0,d.jsx)("p",{className:"text-center text-xs text-muted-foreground/80 mb-10 tracking-wide",children:g}),(0,d.jsx)("div",{className:"flex flex-col gap-2.5 max-w-[280px] w-full",children:h.map((a,b)=>{let c=[o.A,p.A,q.A,r.A],e=c[b%c.length];return(0,d.jsxs)("button",{type:"button",onClick:()=>i(a.prompt),className:"group/sug flex items-center gap-3 text-left text-[13px] px-3.5 py-3 rounded-xl border border-border/40 bg-transparent text-muted-foreground hover:text-foreground hover:border-[var(--amber)]/30 hover:bg-[var(--amber)]/5 transition-all leading-snug","aria-label":a.prompt,children:[(0,d.jsx)("span",{className:"shrink-0 w-8 h-8 rounded-lg bg-muted/60 flex items-center justify-center group-hover/sug:bg-[var(--amber)]/10 transition-colors",children:(0,d.jsx)(e,{size:15,className:"text-muted-foreground/70 group-hover/sug:text-[var(--amber)] transition-colors"})}),(0,d.jsx)("span",{className:"flex-1",children:a.label})]},b)})})]}),a.map((e,f)=>(0,d.jsxs)("div",{className:`flex gap-3 animate-[fadeSlideUp_0.22s_ease_both] ${"user"===e.role?"justify-end":"justify-start"}`,children:["assistant"===e.role&&(0,d.jsx)("div",{className:"w-7 h-7 rounded-lg flex items-center justify-center shrink-0 mt-0.5 bg-[var(--amber)]/8",children:(0,d.jsx)(n.A,{size:13,className:"text-[var(--amber)]"})}),"user"===e.role?(0,d.jsx)("div",{className:"max-w-[85%] px-3.5 py-2.5 rounded-2xl rounded-br-lg text-sm leading-relaxed whitespace-pre-wrap bg-[var(--amber)] text-[var(--amber-foreground)] shadow-sm shadow-[var(--amber)]/10",children:(0,d.jsx)($,{content:e.content,skillName:e.skillName,images:e.images,attachedFiles:e.attachedFiles,uploadedFileNames:e.uploadedFileNames})}):e.content.startsWith("__error__")?(0,d.jsxs)("div",{className:"max-w-[85%] px-3.5 py-3 rounded-2xl rounded-bl-md border border-error/30 bg-error/10 text-sm shadow-sm",children:[(0,d.jsx)(_,{agentName:e.agentName}),(0,d.jsxs)("div",{className:"flex items-start gap-2.5 text-error",children:[(0,d.jsx)(s.A,{size:15,className:"shrink-0 mt-0.5"}),(0,d.jsx)("span",{className:"leading-relaxed font-medium",children:e.content.slice(9)})]})]}):(0,d.jsxs)("div",{className:"group relative max-w-[85%] px-3.5 py-2.5 rounded-2xl rounded-bl-lg bg-card border border-border/30 shadow-sm text-foreground text-sm",children:[(0,d.jsx)(_,{agentName:e.agentName}),e.parts&&e.parts.length>0||(0,x.Oo)(e.content)?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(ab,{message:e,isStreaming:b&&f===a.length-1}),b&&f===a.length-1&&(0,d.jsx)(ac,{parts:e.parts}),!(b&&f===a.length-1)&&(0,x.Oo)(e.content)&&(0,d.jsxs)("div",{className:"absolute -bottom-1 right-1 z-10 flex items-center gap-1 opacity-100 md:opacity-0 md:group-hover:opacity-100 transition-opacity",children:[(0,d.jsx)(X.x,{text:e.content}),(0,d.jsx)(Z,{text:(0,x.Oo)(e.content),label:j.copyMessage})]})]}):b&&f===a.length-1?(0,d.jsxs)("div",{className:"flex items-center gap-2.5 py-1",children:["reconnecting"===c?(0,d.jsx)(t.A,{size:14,className:"text-[var(--amber)] animate-pulse"}):(0,d.jsx)(l.A,{size:14,className:"animate-spin text-[var(--amber)]"}),(0,d.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,d.jsxs)("span",{className:"inline-flex items-center gap-1",children:["reconnecting"===c?j.reconnecting??"Reconnecting...":"connecting"===c?j.connecting:"thinking"===c?j.thinking:j.generating,(0,d.jsxs)("span",{className:"inline-flex gap-0.5",children:[(0,d.jsx)("span",{className:"w-1 h-1 rounded-full bg-[var(--amber)] animate-bounce [animation-delay:0ms]"}),(0,d.jsx)("span",{className:"w-1 h-1 rounded-full bg-[var(--amber)] animate-bounce [animation-delay:150ms]"}),(0,d.jsx)("span",{className:"w-1 h-1 rounded-full bg-[var(--amber)] animate-bounce [animation-delay:300ms]"})]})]})})]}):null]})]},f)),(0,d.jsx)("div",{ref:k}),v&&a.length>0&&(0,d.jsx)("button",{type:"button",onClick:y,className:"sticky bottom-2 left-1/2 -translate-x-1/2 z-10 p-2 rounded-full border border-border/60 bg-card shadow-md text-muted-foreground hover:text-foreground hover:bg-muted transition-all hover:shadow-lg",title:"Scroll to bottom",children:(0,d.jsx)(u.A,{size:14})})]})})},74434:(a,b,c)=>{"use strict";c.d(b,{A:()=>K});var d=c(48249),e=c(67484),f=c(19099),g=c(69924),h=c(40560),i=c(41023),j=c(95581),k=c(18329),l=c(32621),m=c(47223),n=c(4140),o=c(4919),p=c(13799),q=c(95801),r=c(22341),s=c(78890);function t({copy:a,connectedCount:b,mcpEnabled:c=!0,channelsActive:e=!1,onChannelsClick:g}){let h=(0,f.usePathname)(),j=(0,f.useSearchParams)().get("tab"),k="/agents"===h,l=!e;return(0,d.jsxs)("div",{className:"py-2",children:[(0,d.jsx)(s.G,{icon:(0,d.jsx)(o.A,{size:14,className:l&&k&&(null===j||"overview"===j)?"text-[var(--amber)]":"text-muted-foreground"}),title:a.navOverview,badge:(0,d.jsx)("span",{className:"text-2xs tabular-nums text-muted-foreground/60 px-1.5 py-0.5 rounded bg-muted/40 font-medium",children:b}),href:"/agents",active:l&&k&&(null===j||"overview"===j)}),c&&(0,d.jsx)(s.G,{icon:(0,d.jsx)(p.A,{size:14,className:l&&k&&"mcp"===j?"text-[var(--amber)]":"text-muted-foreground"}),title:a.navMcp,href:"/agents?tab=mcp",active:l&&k&&"mcp"===j}),(0,d.jsx)(s.G,{icon:(0,d.jsx)(q.A,{size:14,className:l&&k&&"skills"===j?"text-[var(--amber)]":"text-muted-foreground"}),title:a.navSkills,href:"/agents?tab=skills",active:l&&k&&"skills"===j}),(0,d.jsx)(s.G,{icon:(0,d.jsx)(r.A,{size:14,className:e?"text-[var(--amber)]":"text-muted-foreground"}),title:a.navChannels,onClick:g,active:e}),(0,d.jsx)(s.G,{icon:(0,d.jsx)(i.A,{size:14,className:l&&k&&"a2a"===j?"text-[var(--amber)]":"text-muted-foreground"}),title:a.navNetwork,href:"/agents?tab=a2a",active:l&&k&&"a2a"===j})]})}var u=c(44218),v=c(19794),w=c(2116),x=c.n(w),y=c(42742),z=c(82594),A=c(57056);function B({agent:a,agentStatus:b,selected:c=!1,detailHref:e,onInstallAgent:f,copy:g,isA2aReady:h=!1,a2aTooltip:j}){return(0,d.jsxs)("div",{className:`
|
|
167
|
+
group flex items-center gap-0 rounded-xl border transition-all duration-150
|
|
168
|
+
${c?"border-border ring-2 ring-ring/50 bg-[var(--amber-dim)]/45":"border-border/70 bg-card/50 hover:border-border hover:bg-muted/25"}
|
|
169
|
+
`,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
|
+
relative flex items-center gap-2.5 px-3 py-2 text-left rounded-sm transition-colors
|
|
171
|
+
${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})]})}},77361:(a,b,c)=>{"use strict";c.d(b,{Y:()=>e});var d=c(99829);let e=(0,d.createServerReference)("40ba352a8d8394805301f760d14bad6e3f9fa9d5cd",d.callServer,void 0,d.findSourceMapURL,"undoDeleteAction")},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))},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(26026),q=c(64650),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(8314),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`};
|
|
@@ -185,7 +185,7 @@ Keep content concise and actionable. Write files directly using tools.`;window.d
|
|
|
185
185
|
hidden md:flex fixed top-0 h-screen z-[31] flex-col bg-card border-l border-border shadow-sm
|
|
186
186
|
transition-transform duration-200 ease-out
|
|
187
187
|
${a?"translate-x-0":"translate-x-full pointer-events-none"}
|
|
188
|
-
`,style:{width:`${j}px`,right:`${i}px`},role:"complementary","aria-label":q.agentDetailPanelAria,"aria-hidden":!a||!v,children:[v&&(0,d.jsx)("div",{className:"flex flex-col flex-1 min-h-0 overflow-y-auto",children:(0,d.jsx)(t,{agent:v.agent,agentStatus:v.status,mcpStatus:n,onBack:c,onInstallAgent:o,copy:A,headerVariant:"dock"})}),(0,d.jsx)("div",{className:"absolute top-0 -left-[3px] w-[6px] h-full cursor-col-resize z-40 group hidden md:block",onMouseDown:z,children:(0,d.jsx)("div",{className:"absolute left-[2px] top-0 w-[2px] h-full opacity-0 group-hover:opacity-100 bg-[var(--amber)]/50 transition-opacity"})})]})}},98610:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Ot:()=>k,T_:()=>l,Ux:()=>j,bf:()=>h,jt:()=>m,rl:()=>g});var e=c(14270),f=a([e]);e=(f.then?(await f)():f)[0];let l={anthropic:{id:"anthropic",name:"Anthropic",nameZh:"Anthropic",shortLabel:"Anthropic",defaultModel:"claude-sonnet-4-6",supportsBaseUrl:!0,supportsThinking:!0,supportsListModels:!0,signupUrl:"https://console.anthropic.com/settings/keys",category:"primary"},openai:{id:"openai",name:"OpenAI",nameZh:"OpenAI",shortLabel:"OpenAI",defaultModel:"gpt-5.4",supportsBaseUrl:!0,supportsThinking:!0,supportsListModels:!0,signupUrl:"https://platform.openai.com/api-keys",category:"primary"},google:{id:"google",name:"Google Gemini",nameZh:"Google Gemini",shortLabel:"Gemini",defaultModel:"gemini-2.5-flash",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,signupUrl:"https://aistudio.google.com/apikey",category:"primary"},groq:{id:"groq",name:"Groq",nameZh:"Groq",shortLabel:"Groq",defaultModel:"llama-3.3-70b-versatile",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://console.groq.com/keys",category:"more"},xai:{id:"xai",name:"xAI (Grok)",nameZh:"xAI (Grok)",shortLabel:"xAI",defaultModel:"grok-3",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},openrouter:{id:"openrouter",name:"OpenRouter",nameZh:"OpenRouter",shortLabel:"OpenRouter",defaultModel:"anthropic/claude-sonnet-4",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},mistral:{id:"mistral",name:"Mistral",nameZh:"Mistral",shortLabel:"Mistral",defaultModel:"mistral-large-latest",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},deepseek:{id:"deepseek",name:"DeepSeek",nameZh:"DeepSeek",shortLabel:"DeepSeek",defaultModel:"deepseek-chat",piProviderOverride:"openai",fixedBaseUrl:"https://api.deepseek.com/v1",supportsBaseUrl:!0,supportsThinking:!0,supportsListModels:!0,signupUrl:"https://platform.deepseek.com/api_keys",category:"more"},zai:{id:"zai",name:"ZhipuAI (GLM)",nameZh:"智谱 AI (GLM 国际版)",shortLabel:"智谱GLM",defaultModel:"glm-4-plus",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},"zai-cn":{id:"zai-cn",name:"ZhipuAI (GLM China)",nameZh:"智谱 AI (GLM 国内版)",shortLabel:"智谱GLM-CN",description:"China region version",descriptionZh:"中国区版本",defaultModel:"glm-4-plus",piProviderOverride:"zai",fixedBaseUrl:"https://open.bigmodel.cn/api/coding/paas/v4",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,signupUrl:"https://open.bigmodel.cn/",category:"more"},"kimi-coding":{id:"kimi-coding",name:"Kimi Coding",nameZh:"Kimi Coding (月之暗面)",shortLabel:"Kimi Coding",defaultModel:"kimi-k2-thinking",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},cerebras:{id:"cerebras",name:"Cerebras",nameZh:"Cerebras",shortLabel:"Cerebras",defaultModel:"llama-4-scout-17b-16e",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},minimax:{id:"minimax",name:"MiniMax",nameZh:"MiniMax (国际版)",shortLabel:"MiniMax",defaultModel:"MiniMax-M2.5",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},"minimax-cn":{id:"minimax-cn",name:"MiniMax (China)",nameZh:"MiniMax (国内版)",shortLabel:"MiniMax-CN",description:"China region version",descriptionZh:"中国区版本",defaultModel:"MiniMax-M2.5",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},huggingface:{id:"huggingface",name:"Hugging Face",nameZh:"Hugging Face",shortLabel:"HuggingFace",defaultModel:"Qwen/Qwen3-235B-A22B-Thinking-2507",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},ollama:{id:"ollama",name:"Ollama",nameZh:"Ollama (本地)",shortLabel:"Ollama",description:"Local server (requires setup)",descriptionZh:"本地服务器 (需要本地部署)",defaultModel:"llama3.2",piProviderOverride:"openai",fixedBaseUrl:"http://localhost:11434/v1",apiKeyFallback:"ollama",supportsBaseUrl:!0,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://ollama.com/download",category:"more"}},m=Object.keys(l);function g(a){return a in l}function h(){let a=[],b=[];for(let c of m)"primary"===l[c].category?a.push(c):b.push(c);return b.sort((a,b)=>l[a].name.localeCompare(l[b].name)),{primary:a,more:b}}function i(a){return l[a].piProviderOverride??a}let n={deepseek:"DEEPSEEK_API_KEY"};function j(a){return n[a]?n[a]:o[i(a)]}function k(a){let b=l[a];if(b.fixedBaseUrl)return b.fixedBaseUrl;try{let b=(0,e.getModels)(i(a));return b[0]?.baseUrl??""}catch{return""}}let o={anthropic:"ANTHROPIC_API_KEY",openai:"OPENAI_API_KEY","azure-openai-responses":"AZURE_OPENAI_API_KEY",google:"GEMINI_API_KEY",groq:"GROQ_API_KEY",cerebras:"CEREBRAS_API_KEY",xai:"XAI_API_KEY",openrouter:"OPENROUTER_API_KEY",zai:"ZAI_API_KEY","zai-cn":"ZAI_API_KEY",mistral:"MISTRAL_API_KEY",minimax:"MINIMAX_API_KEY","minimax-cn":"MINIMAX_API_KEY",huggingface:"HF_TOKEN","kimi-coding":"KIMI_API_KEY"};d()}catch(a){d(a)}})},99101:(a,b,c)=>{"use strict";c.d(b,{B1:()=>h,X8:()=>j,dV:()=>i,oR:()=>l});let d=[],e=[],f=0;function g(){for(let a of e)a()}function h(a){return e=[...e,a],()=>{e=e.filter(b=>b!==a)}}function i(){return d}function j(a){d=d.filter(b=>b.id!==a),g()}function k(a){let b=`toast-${++f}`,c={id:b,message:a.message,type:a.type??"info",duration:a.duration??2e3,action:a.action};d=[...d,c].slice(-3),g(),c.duration>0&&setTimeout(()=>j(b),c.duration)}function l(a,b){k({message:a,...b})}l.success=(a,b)=>k({message:a,type:"success",duration:b}),l.undo=(a,b,c)=>k({message:a,type:"info",duration:c?.duration??5e3,action:{label:c?.label??"Undo",onClick:b}}),l.error=(a,b)=>k({message:a,type:"error",duration:b}),l.copy=(a="Copied")=>k({message:a,type:"success",duration:1500})},99713:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,15098,23)),Promise.resolve().then(c.t.bind(c,47644,23)),Promise.resolve().then(c.t.bind(c,33859,23)),Promise.resolve().then(c.t.bind(c,98099,23)),Promise.resolve().then(c.t.bind(c,16237,23)),Promise.resolve().then(c.t.bind(c,98562,23)),Promise.resolve().then(c.t.bind(c,36675,23))},99791:(a,b,c)=>{"use strict";c.d(b,{A:()=>q});var d=c(48249),e=c(67484),f=c(19099),g=c(10316),h=c(46674),i=c(83654),j=c(80600),k=c(19794),l=c(33191),m=c(95054),n=c(47223),o=c(4140),p=c(95657);function q({active:a,onNavigate:b,maximized:c,onMaximize:q}){let[r,s]=(0,e.useState)(""),[t,u]=(0,e.useState)([]),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(0),[z,A]=(0,e.useState)(null),B=(0,e.useRef)(null),C=(0,f.useRouter)(),D=(0,e.useRef)(null),{t:E}=(0,n.Y)(),F=(0,e.useCallback)(a=>{if(D.current&&clearTimeout(D.current),!a.trim()){u([]),w(!1);return}w(!0),D.current=setTimeout(async()=>{try{let b=await (0,m.n)(`/api/search?q=${encodeURIComponent(a)}`);u(Array.isArray(b)?b:[]),y(0)}catch{u([])}finally{w(!1)}},300)},[]),G=(0,e.useCallback)(a=>{let b=a.target.value;s(b),F(b)},[F]),H=(0,e.useCallback)(a=>{C.push(`/view/${(0,l.O0)(a.path)}`),b?.()},[C,b]),I=(0,e.useCallback)(a=>{"ArrowDown"===a.key?(a.preventDefault(),y(a=>Math.min(a+1,t.length-1))):"ArrowUp"===a.key?(a.preventDefault(),y(a=>Math.max(a-1,0))):"Enter"===a.key&&t[x]&&H(t[x])},[t,x,H]),J=(0,e.useCallback)((a,b)=>{a.dataTransfer.effectAllowed="copy",a.dataTransfer.setData("text/mindos-path",b.path),a.dataTransfer.setData("text/mindos-type","file");let c=new Image;a.dataTransfer.setDragImage(c,0,0)},[]),K=(0,e.useCallback)(()=>{A(null)},[]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o.A,{title:"Search",maximized:c,onMaximize:q}),(0,d.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border shrink-0 overflow-hidden",children:[(0,d.jsx)(g.A,{size:16,className:"text-muted-foreground shrink-0 flex-none"}),(0,d.jsx)("input",{ref:B,type:"text",value:r,onChange:G,onKeyDown:I,placeholder:E.search.placeholder,"aria-label":E.search.placeholder,className:"flex-1 min-w-0 bg-transparent text-foreground text-base font-medium placeholder:text-muted-foreground/60 outline-none"}),v&&(0,d.jsx)("div",{className:"w-4 h-4 border-2 border-muted-foreground/30 border-t-foreground rounded-full animate-spin shrink-0 flex-none"}),!v&&r&&(0,d.jsx)("button",{onClick:()=>{s(""),u([]),B.current?.focus()},className:"shrink-0 flex-none p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":E.search.clear,children:(0,d.jsx)(h.A,{size:16})})]}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0",role:"listbox","aria-label":"Search results",children:[0===t.length&&!r&&!v&&(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center px-4 py-12 text-center",children:[(0,d.jsx)("div",{className:"flex items-center justify-center w-12 h-12 rounded-lg bg-muted mb-4",children:(0,d.jsx)(g.A,{size:20,className:"text-muted-foreground/60"})}),(0,d.jsx)("h3",{className:"text-sm font-medium text-foreground mb-1",children:E.search.emptyTitle}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground/70",children:E.search.emptyHint})]}),0===t.length&&r&&!v&&(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center px-4 py-12 text-center",children:[(0,d.jsx)("div",{className:"flex items-center justify-center w-12 h-12 rounded-lg bg-muted mb-4",children:(0,d.jsx)(g.A,{size:20,className:"text-muted-foreground/60"})}),(0,d.jsx)("h3",{className:"text-sm font-medium text-foreground mb-1",children:E.search.noResults}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground/70",children:E.search.noResultsHint})]}),v&&0===t.length&&(0,d.jsx)("div",{className:"space-y-2 p-3",children:[1,2,3].map(a=>(0,d.jsxs)("div",{className:"px-3 py-2.5 space-y-2 animate-pulse",children:[(0,d.jsx)("div",{className:"h-4 bg-muted rounded-md w-3/4"}),(0,d.jsx)("div",{className:"h-3 bg-muted rounded-md w-1/2"}),(0,d.jsx)("div",{className:"h-3 bg-muted rounded-md w-2/3"})]},a))}),t.length>0&&(0,d.jsx)(p.aY,{totalCount:t.length,overscan:100,itemContent:a=>{let b,c=t[a],e=c.path.endsWith(".csv")?".csv":".md",{name:f,breadcrumb:g}={name:(b=c.path.split("/").filter(Boolean))[b.length-1],breadcrumb:b.slice(0,-1)},h=a===x,l=a===z;return(0,d.jsxs)("button",{role:"option","aria-selected":h,draggable:!0,onDragStart:a=>J(a,c),onDragEnd:K,onDragEnter:()=>A(a),onDragLeave:()=>A(null),onClick:()=>H(c),onMouseEnter:()=>y(a),className:`
|
|
188
|
+
`,style:{width:`${j}px`,right:`${i}px`},role:"complementary","aria-label":q.agentDetailPanelAria,"aria-hidden":!a||!v,children:[v&&(0,d.jsx)("div",{className:"flex flex-col flex-1 min-h-0 overflow-y-auto",children:(0,d.jsx)(t,{agent:v.agent,agentStatus:v.status,mcpStatus:n,onBack:c,onInstallAgent:o,copy:A,headerVariant:"dock"})}),(0,d.jsx)("div",{className:"absolute top-0 -left-[3px] w-[6px] h-full cursor-col-resize z-40 group hidden md:block",onMouseDown:z,children:(0,d.jsx)("div",{className:"absolute left-[2px] top-0 w-[2px] h-full opacity-0 group-hover:opacity-100 bg-[var(--amber)]/50 transition-opacity"})})]})}},98120:(a,b,c)=>{"use strict";c.d(b,{i:()=>e});var d=c(99829);let e=(0,d.createServerReference)("40b3d98d55f3502ddf0bc8dc9c24e3ed5e0ee47dc7",d.callServer,void 0,d.findSourceMapURL,"deleteFileAction")},98610:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{Ot:()=>k,T_:()=>l,Ux:()=>j,bf:()=>h,jt:()=>m,rl:()=>g});var e=c(14270),f=a([e]);e=(f.then?(await f)():f)[0];let l={anthropic:{id:"anthropic",name:"Anthropic",nameZh:"Anthropic",shortLabel:"Anthropic",defaultModel:"claude-sonnet-4-6",supportsBaseUrl:!0,supportsThinking:!0,supportsListModels:!0,signupUrl:"https://console.anthropic.com/settings/keys",category:"primary"},openai:{id:"openai",name:"OpenAI",nameZh:"OpenAI",shortLabel:"OpenAI",defaultModel:"gpt-5.4",supportsBaseUrl:!0,supportsThinking:!0,supportsListModels:!0,signupUrl:"https://platform.openai.com/api-keys",category:"primary"},google:{id:"google",name:"Google Gemini",nameZh:"Google Gemini",shortLabel:"Gemini",defaultModel:"gemini-2.5-flash",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,signupUrl:"https://aistudio.google.com/apikey",category:"primary"},groq:{id:"groq",name:"Groq",nameZh:"Groq",shortLabel:"Groq",defaultModel:"llama-3.3-70b-versatile",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://console.groq.com/keys",category:"more"},xai:{id:"xai",name:"xAI (Grok)",nameZh:"xAI (Grok)",shortLabel:"xAI",defaultModel:"grok-3",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},openrouter:{id:"openrouter",name:"OpenRouter",nameZh:"OpenRouter",shortLabel:"OpenRouter",defaultModel:"anthropic/claude-sonnet-4",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},mistral:{id:"mistral",name:"Mistral",nameZh:"Mistral",shortLabel:"Mistral",defaultModel:"mistral-large-latest",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},deepseek:{id:"deepseek",name:"DeepSeek",nameZh:"DeepSeek",shortLabel:"DeepSeek",defaultModel:"deepseek-chat",piProviderOverride:"openai",fixedBaseUrl:"https://api.deepseek.com/v1",supportsBaseUrl:!0,supportsThinking:!0,supportsListModels:!0,signupUrl:"https://platform.deepseek.com/api_keys",category:"more"},zai:{id:"zai",name:"ZhipuAI (GLM)",nameZh:"智谱 AI (GLM 国际版)",shortLabel:"智谱GLM",defaultModel:"glm-4-plus",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},"zai-cn":{id:"zai-cn",name:"ZhipuAI (GLM China)",nameZh:"智谱 AI (GLM 国内版)",shortLabel:"智谱GLM-CN",description:"China region version",descriptionZh:"中国区版本",defaultModel:"glm-4-plus",piProviderOverride:"zai",fixedBaseUrl:"https://open.bigmodel.cn/api/coding/paas/v4",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,signupUrl:"https://open.bigmodel.cn/",category:"more"},"kimi-coding":{id:"kimi-coding",name:"Kimi Coding",nameZh:"Kimi Coding (月之暗面)",shortLabel:"Kimi Coding",defaultModel:"kimi-k2-thinking",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},cerebras:{id:"cerebras",name:"Cerebras",nameZh:"Cerebras",shortLabel:"Cerebras",defaultModel:"llama-4-scout-17b-16e",supportsBaseUrl:!1,supportsThinking:!1,supportsListModels:!0,category:"more"},minimax:{id:"minimax",name:"MiniMax",nameZh:"MiniMax (国际版)",shortLabel:"MiniMax",defaultModel:"MiniMax-M2.5",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},"minimax-cn":{id:"minimax-cn",name:"MiniMax (China)",nameZh:"MiniMax (国内版)",shortLabel:"MiniMax-CN",description:"China region version",descriptionZh:"中国区版本",defaultModel:"MiniMax-M2.5",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},huggingface:{id:"huggingface",name:"Hugging Face",nameZh:"Hugging Face",shortLabel:"HuggingFace",defaultModel:"Qwen/Qwen3-235B-A22B-Thinking-2507",supportsBaseUrl:!1,supportsThinking:!0,supportsListModels:!1,category:"more"},ollama:{id:"ollama",name:"Ollama",nameZh:"Ollama (本地)",shortLabel:"Ollama",description:"Local server (requires setup)",descriptionZh:"本地服务器 (需要本地部署)",defaultModel:"llama3.2",piProviderOverride:"openai",fixedBaseUrl:"http://localhost:11434/v1",apiKeyFallback:"ollama",supportsBaseUrl:!0,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://ollama.com/download",category:"local"},"lm-studio":{id:"lm-studio",name:"LM Studio",nameZh:"LM Studio (本地)",shortLabel:"LM Studio",description:"Local OpenAI-compatible server",descriptionZh:"本地 OpenAI 兼容服务",defaultModel:"local-model",piProviderOverride:"openai",fixedBaseUrl:"http://localhost:1234/v1",apiKeyFallback:"lm-studio",supportsBaseUrl:!0,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://lmstudio.ai/",category:"local"},vllm:{id:"vllm",name:"vLLM",nameZh:"vLLM (本地)",shortLabel:"vLLM",description:"Local OpenAI-compatible server",descriptionZh:"本地 OpenAI 兼容服务",defaultModel:"local-model",piProviderOverride:"openai",fixedBaseUrl:"http://localhost:8000/v1",apiKeyFallback:"vllm",supportsBaseUrl:!0,supportsThinking:!1,supportsListModels:!0,signupUrl:"https://docs.vllm.ai/",category:"local"}},m=Object.keys(l);function g(a){return a in l}function h(){let a=[],b=[],c=[];for(let d of m){let e=l[d].category;"primary"===e?a.push(d):"local"===e?b.push(d):c.push(d)}return b.sort((a,b)=>l[a].name.localeCompare(l[b].name)),c.sort((a,b)=>l[a].name.localeCompare(l[b].name)),{primary:a,local:b,more:c}}function i(a){return l[a].piProviderOverride??a}let n={deepseek:"DEEPSEEK_API_KEY"};function j(a){return n[a]?n[a]:o[i(a)]}function k(a){let b=l[a];if(b.fixedBaseUrl)return b.fixedBaseUrl;try{let b=(0,e.getModels)(i(a));return b[0]?.baseUrl??""}catch{return""}}let o={anthropic:"ANTHROPIC_API_KEY",openai:"OPENAI_API_KEY","azure-openai-responses":"AZURE_OPENAI_API_KEY",google:"GEMINI_API_KEY",groq:"GROQ_API_KEY",cerebras:"CEREBRAS_API_KEY",xai:"XAI_API_KEY",openrouter:"OPENROUTER_API_KEY",zai:"ZAI_API_KEY","zai-cn":"ZAI_API_KEY",mistral:"MISTRAL_API_KEY",minimax:"MINIMAX_API_KEY","minimax-cn":"MINIMAX_API_KEY",huggingface:"HF_TOKEN","kimi-coding":"KIMI_API_KEY"};d()}catch(a){d(a)}})},99101:(a,b,c)=>{"use strict";c.d(b,{B1:()=>h,X8:()=>j,dV:()=>i,oR:()=>l});let d=[],e=[],f=0;function g(){for(let a of e)a()}function h(a){return e=[...e,a],()=>{e=e.filter(b=>b!==a)}}function i(){return d}function j(a){d=d.filter(b=>b.id!==a),g()}function k(a){let b=`toast-${++f}`,c={id:b,message:a.message,type:a.type??"info",duration:a.duration??2e3,action:a.action};d=[...d,c].slice(-3),g(),c.duration>0&&setTimeout(()=>j(b),c.duration)}function l(a,b){k({message:a,...b})}l.success=(a,b)=>k({message:a,type:"success",duration:b}),l.undo=(a,b,c)=>k({message:a,type:"info",duration:c?.duration??5e3,action:{label:c?.label??"Undo",onClick:b}}),l.error=(a,b)=>k({message:a,type:"error",duration:b}),l.copy=(a="Copied")=>k({message:a,type:"success",duration:1500})},99713:(a,b,c)=>{Promise.resolve().then(c.t.bind(c,15098,23)),Promise.resolve().then(c.t.bind(c,47644,23)),Promise.resolve().then(c.t.bind(c,33859,23)),Promise.resolve().then(c.t.bind(c,98099,23)),Promise.resolve().then(c.t.bind(c,16237,23)),Promise.resolve().then(c.t.bind(c,98562,23)),Promise.resolve().then(c.t.bind(c,36675,23))},99791:(a,b,c)=>{"use strict";c.d(b,{A:()=>q});var d=c(48249),e=c(67484),f=c(19099),g=c(10316),h=c(46674),i=c(83654),j=c(80600),k=c(19794),l=c(33191),m=c(95054),n=c(47223),o=c(4140),p=c(95657);function q({active:a,onNavigate:b,maximized:c,onMaximize:q}){let[r,s]=(0,e.useState)(""),[t,u]=(0,e.useState)([]),[v,w]=(0,e.useState)(!1),[x,y]=(0,e.useState)(0),[z,A]=(0,e.useState)(null),B=(0,e.useRef)(null),C=(0,f.useRouter)(),D=(0,e.useRef)(null),{t:E}=(0,n.Y)(),F=(0,e.useCallback)(a=>{if(D.current&&clearTimeout(D.current),!a.trim()){u([]),w(!1);return}w(!0),D.current=setTimeout(async()=>{try{let b=await (0,m.n)(`/api/search?q=${encodeURIComponent(a)}`);u(Array.isArray(b)?b:[]),y(0)}catch{u([])}finally{w(!1)}},300)},[]),G=(0,e.useCallback)(a=>{let b=a.target.value;s(b),F(b)},[F]),H=(0,e.useCallback)(a=>{C.push(`/view/${(0,l.O0)(a.path)}`),b?.()},[C,b]),I=(0,e.useCallback)(a=>{"ArrowDown"===a.key?(a.preventDefault(),y(a=>Math.min(a+1,t.length-1))):"ArrowUp"===a.key?(a.preventDefault(),y(a=>Math.max(a-1,0))):"Enter"===a.key&&t[x]&&H(t[x])},[t,x,H]),J=(0,e.useCallback)((a,b)=>{a.dataTransfer.effectAllowed="copy",a.dataTransfer.setData("text/mindos-path",b.path),a.dataTransfer.setData("text/mindos-type","file");let c=new Image;a.dataTransfer.setDragImage(c,0,0)},[]),K=(0,e.useCallback)(()=>{A(null)},[]);return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(o.A,{title:"Search",maximized:c,onMaximize:q}),(0,d.jsxs)("div",{className:"flex items-center gap-3 px-4 py-3 border-b border-border shrink-0 overflow-hidden",children:[(0,d.jsx)(g.A,{size:16,className:"text-muted-foreground shrink-0 flex-none"}),(0,d.jsx)("input",{ref:B,type:"text",value:r,onChange:G,onKeyDown:I,placeholder:E.search.placeholder,"aria-label":E.search.placeholder,className:"flex-1 min-w-0 bg-transparent text-foreground text-base font-medium placeholder:text-muted-foreground/60 outline-none"}),v&&(0,d.jsx)("div",{className:"w-4 h-4 border-2 border-muted-foreground/30 border-t-foreground rounded-full animate-spin shrink-0 flex-none"}),!v&&r&&(0,d.jsx)("button",{onClick:()=>{s(""),u([]),B.current?.focus()},className:"shrink-0 flex-none p-1 text-muted-foreground hover:text-foreground transition-colors","aria-label":E.search.clear,children:(0,d.jsx)(h.A,{size:16})})]}),(0,d.jsxs)("div",{className:"flex-1 overflow-y-auto min-h-0",role:"listbox","aria-label":"Search results",children:[0===t.length&&!r&&!v&&(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center px-4 py-12 text-center",children:[(0,d.jsx)("div",{className:"flex items-center justify-center w-12 h-12 rounded-lg bg-muted mb-4",children:(0,d.jsx)(g.A,{size:20,className:"text-muted-foreground/60"})}),(0,d.jsx)("h3",{className:"text-sm font-medium text-foreground mb-1",children:E.search.emptyTitle}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground/70",children:E.search.emptyHint})]}),0===t.length&&r&&!v&&(0,d.jsxs)("div",{className:"flex flex-col items-center justify-center px-4 py-12 text-center",children:[(0,d.jsx)("div",{className:"flex items-center justify-center w-12 h-12 rounded-lg bg-muted mb-4",children:(0,d.jsx)(g.A,{size:20,className:"text-muted-foreground/60"})}),(0,d.jsx)("h3",{className:"text-sm font-medium text-foreground mb-1",children:E.search.noResults}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground/70",children:E.search.noResultsHint})]}),v&&0===t.length&&(0,d.jsx)("div",{className:"space-y-2 p-3",children:[1,2,3].map(a=>(0,d.jsxs)("div",{className:"px-3 py-2.5 space-y-2 animate-pulse",children:[(0,d.jsx)("div",{className:"h-4 bg-muted rounded-md w-3/4"}),(0,d.jsx)("div",{className:"h-3 bg-muted rounded-md w-1/2"}),(0,d.jsx)("div",{className:"h-3 bg-muted rounded-md w-2/3"})]},a))}),t.length>0&&(0,d.jsx)(p.aY,{totalCount:t.length,overscan:100,itemContent:a=>{let b,c=t[a],e=c.path.endsWith(".csv")?".csv":".md",{name:f,breadcrumb:g}={name:(b=c.path.split("/").filter(Boolean))[b.length-1],breadcrumb:b.slice(0,-1)},h=a===x,l=a===z;return(0,d.jsxs)("button",{role:"option","aria-selected":h,draggable:!0,onDragStart:a=>J(a,c),onDragEnd:K,onDragEnter:()=>A(a),onDragLeave:()=>A(null),onClick:()=>H(c),onMouseEnter:()=>y(a),className:`
|
|
189
189
|
w-full px-3 py-2.5 flex items-start gap-3 text-left transition-colors duration-100
|
|
190
190
|
border-b border-border/50
|
|
191
191
|
${h?"bg-[var(--amber-dim)] border-l-2 border-[var(--amber)]":"border-l-2 border-transparent"}
|