@alexjbarnes/cockpit 0.3.1 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +10 -2
- package/.next/build-manifest.json +4 -4
- package/.next/next-server.js.nft.json +1 -1
- package/.next/prerender-manifest.json +21 -45
- package/.next/react-loadable-manifest.json +279 -267
- package/.next/routes-manifest.json +68 -12
- package/.next/server/app/(app)/agents/[name]/page.js +3 -3
- package/.next/server/app/(app)/agents/[name]/page.js.nft.json +1 -1
- package/.next/server/app/(app)/agents/[name]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/agents/page.js +2 -2
- package/.next/server/app/(app)/agents/page.js.nft.json +1 -1
- package/.next/server/app/(app)/agents/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/claude-md/edit/page.js +2 -2
- package/.next/server/app/(app)/claude-md/edit/page.js.nft.json +1 -1
- package/.next/server/app/(app)/claude-md/edit/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/claude-md/page.js +2 -2
- package/.next/server/app/(app)/claude-md/page.js.nft.json +1 -1
- package/.next/server/app/(app)/claude-md/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/commands/[name]/page.js +3 -3
- package/.next/server/app/(app)/commands/[name]/page.js.nft.json +1 -1
- package/.next/server/app/(app)/commands/[name]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/commands/page.js +2 -2
- package/.next/server/app/(app)/commands/page.js.nft.json +1 -1
- package/.next/server/app/(app)/commands/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/hooks/[event]/page.js +3 -3
- package/.next/server/app/(app)/hooks/[event]/page.js.nft.json +1 -1
- package/.next/server/app/(app)/hooks/[event]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/hooks/page.js +2 -2
- package/.next/server/app/(app)/hooks/page.js.nft.json +1 -1
- package/.next/server/app/(app)/hooks/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/inbox/[id]/page.js +2 -2
- package/.next/server/app/(app)/inbox/[id]/page.js.nft.json +1 -1
- package/.next/server/app/(app)/inbox/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/inbox/page.js +2 -2
- package/.next/server/app/(app)/inbox/page.js.nft.json +1 -1
- package/.next/server/app/(app)/inbox/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/jobs/[id]/edit/page.js +2 -2
- package/.next/server/app/(app)/jobs/[id]/edit/page.js.nft.json +1 -1
- package/.next/server/app/(app)/jobs/[id]/edit/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/jobs/[id]/page.js +2 -2
- package/.next/server/app/(app)/jobs/[id]/page.js.nft.json +1 -1
- package/.next/server/app/(app)/jobs/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/jobs/[id]/runs/[runId]/page.js +2 -2
- package/.next/server/app/(app)/jobs/[id]/runs/[runId]/page.js.nft.json +1 -1
- package/.next/server/app/(app)/jobs/[id]/runs/[runId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/jobs/page.js +2 -2
- package/.next/server/app/(app)/jobs/page.js.nft.json +1 -1
- package/.next/server/app/(app)/jobs/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/mcp-servers/[name]/page.js +2 -2
- package/.next/server/app/(app)/mcp-servers/[name]/page.js.nft.json +1 -1
- package/.next/server/app/(app)/mcp-servers/[name]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/mcp-servers/page.js +2 -2
- package/.next/server/app/(app)/mcp-servers/page.js.nft.json +1 -1
- package/.next/server/app/(app)/mcp-servers/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/page.js +2 -2
- package/.next/server/app/(app)/page.js.nft.json +1 -1
- package/.next/server/app/(app)/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/plugins/page.js +2 -0
- package/.next/server/app/(app)/{files → plugins}/page.js.nft.json +1 -1
- package/.next/server/app/(app)/plugins/page_client-reference-manifest.js +1 -0
- package/.next/server/app/(app)/reviews/[owner]/[repo]/[number]/page.js +4 -4
- package/.next/server/app/(app)/reviews/[owner]/[repo]/[number]/page.js.nft.json +1 -1
- package/.next/server/app/(app)/reviews/[owner]/[repo]/[number]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/reviews/[owner]/[repo]/page.js +2 -2
- package/.next/server/app/(app)/reviews/[owner]/[repo]/page.js.nft.json +1 -1
- package/.next/server/app/(app)/reviews/[owner]/[repo]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/reviews/page.js +2 -2
- package/.next/server/app/(app)/reviews/page.js.nft.json +1 -1
- package/.next/server/app/(app)/reviews/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/sessions/[id]/page.js +2 -2
- package/.next/server/app/(app)/sessions/[id]/page.js.nft.json +1 -1
- package/.next/server/app/(app)/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/settings/appearance/page.js +2 -2
- package/.next/server/app/(app)/settings/appearance/page.js.nft.json +1 -1
- package/.next/server/app/(app)/settings/appearance/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/settings/notifications/page.js +2 -2
- package/.next/server/app/(app)/settings/notifications/page.js.nft.json +1 -1
- package/.next/server/app/(app)/settings/notifications/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/settings/page.js +2 -2
- package/.next/server/app/(app)/settings/page.js.nft.json +1 -1
- package/.next/server/app/(app)/settings/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/settings/providers/[id]/page.js +2 -2
- package/.next/server/app/(app)/settings/providers/[id]/page.js.nft.json +1 -1
- package/.next/server/app/(app)/settings/providers/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/settings/providers/new/page.js +2 -2
- package/.next/server/app/(app)/settings/providers/new/page.js.nft.json +1 -1
- package/.next/server/app/(app)/settings/providers/new/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/settings/providers/page.js +2 -2
- package/.next/server/app/(app)/settings/providers/page.js.nft.json +1 -1
- package/.next/server/app/(app)/settings/providers/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/settings/session/page.js +2 -2
- package/.next/server/app/(app)/settings/session/page.js.nft.json +1 -1
- package/.next/server/app/(app)/settings/session/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/skills/[name]/page.js +3 -3
- package/.next/server/app/(app)/skills/[name]/page.js.nft.json +1 -1
- package/.next/server/app/(app)/skills/[name]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/(app)/skills/page.js +2 -2
- package/.next/server/app/(app)/skills/page.js.nft.json +1 -1
- package/.next/server/app/(app)/skills/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error/page.js +3 -3
- package/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_global-error.html +1 -1
- package/.next/server/app/_global-error.rsc +1 -1
- package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/server/app/_not-found/page.js +2 -2
- package/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/_not-found.html +1 -1
- package/.next/server/app/_not-found.rsc +2 -2
- package/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/agents.html +1 -1
- package/.next/server/app/agents.rsc +4 -4
- package/.next/server/app/agents.segments/!KGFwcCk/agents/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/agents.segments/!KGFwcCk/agents.segment.rsc +1 -1
- package/.next/server/app/agents.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/agents.segments/_full.segment.rsc +4 -4
- package/.next/server/app/agents.segments/_head.segment.rsc +1 -1
- package/.next/server/app/agents.segments/_index.segment.rsc +2 -2
- package/.next/server/app/agents.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/api/agents/[name]/route.js +1 -1
- package/.next/server/app/api/agents/route.js +1 -1
- package/.next/server/app/api/assistant-session/route.js +1 -0
- package/.next/server/app/api/assistant-session/route.js.nft.json +1 -0
- package/.next/server/app/api/assistant-session/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/auth/check/route.js +1 -1
- package/.next/server/app/api/auth/login/route.js +1 -1
- package/.next/server/app/api/auth/setup/route.js +1 -1
- package/.next/server/app/api/auth/ws-token/route.js +1 -1
- package/.next/server/app/api/btw/route.js +2 -2
- package/.next/server/app/api/claude-md/route.js +1 -1
- package/.next/server/app/api/commands/[name]/route.js +1 -1
- package/.next/server/app/api/commands/route.js +1 -1
- package/.next/server/app/api/config/cwd/route.js +1 -0
- package/.next/server/app/api/config/cwd/route.js.nft.json +1 -0
- package/.next/server/app/api/config/cwd/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/defaults/route.js +1 -1
- package/.next/server/app/api/filesystem/browse/route.js +1 -1
- package/.next/server/app/api/filesystem/files/route.js +1 -1
- package/.next/server/app/api/filesystem/mkdir/route.js +1 -1
- package/.next/server/app/api/filesystem/read/route.js +1 -1
- package/.next/server/app/api/git/clone/route.js +1 -1
- package/.next/server/app/api/git/commit/route.js +1 -1
- package/.next/server/app/api/git/diff/route.js +1 -1
- package/.next/server/app/api/git/discard/route.js +1 -1
- package/.next/server/app/api/git/generate-message/route.js +2 -2
- package/.next/server/app/api/git/push/route.js +1 -1
- package/.next/server/app/api/git/status/route.js +1 -1
- package/.next/server/app/api/github/file-content/route.js +1 -1
- package/.next/server/app/api/github/orgs/route.js +1 -1
- package/.next/server/app/api/github/prs/checks/route.js +1 -1
- package/.next/server/app/api/github/prs/diff/route.js +1 -1
- package/.next/server/app/api/github/prs/review/route.js +1 -1
- package/.next/server/app/api/github/prs/route.js +1 -1
- package/.next/server/app/api/github/prs/view/route.js +1 -1
- package/.next/server/app/api/github/repos/route.js +1 -1
- package/.next/server/app/api/github/review-session/route.js +1 -1
- package/.next/server/app/api/github/review-session/route.js.nft.json +1 -1
- package/.next/server/app/api/health/route.js +1 -1
- package/.next/server/app/api/hooks/route.js +1 -1
- package/.next/server/app/api/inbox/[id]/route.js +1 -5
- package/.next/server/app/api/inbox/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/inbox/route.js +1 -5
- package/.next/server/app/api/inbox/route.js.nft.json +1 -1
- package/.next/server/app/api/jobs/[id]/route.js +1 -1
- package/.next/server/app/api/jobs/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/jobs/[id]/runs/[runId]/route.js +1 -1
- package/.next/server/app/api/jobs/[id]/runs/[runId]/transcript/route.js +1 -1
- package/.next/server/app/api/jobs/[id]/runs/[runId]/transcript/route.js.nft.json +1 -1
- package/.next/server/app/api/jobs/[id]/runs/route.js +1 -1
- package/.next/server/app/api/jobs/[id]/stop/route.js +1 -0
- package/.next/server/app/api/jobs/[id]/stop/route.js.nft.json +1 -0
- package/.next/server/app/api/jobs/[id]/stop/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/jobs/[id]/trigger/route.js +1 -1
- package/.next/server/app/api/jobs/[id]/trigger/route.js.nft.json +1 -1
- package/.next/server/app/api/jobs/mcp-discover/route.js +1 -1
- package/.next/server/app/api/jobs/mcp-discover/route.js.nft.json +1 -1
- package/.next/server/app/api/jobs/route.js +1 -1
- package/.next/server/app/api/jobs/route.js.nft.json +1 -1
- package/.next/server/app/api/jobs/status/route.js +1 -1
- package/.next/server/app/api/mcp-servers/[name]/route.js +1 -1
- package/.next/server/app/api/mcp-servers/[name]/test/route.js +1 -1
- package/.next/server/app/api/mcp-servers/[name]/tools/route.js +1 -0
- package/.next/server/app/api/mcp-servers/[name]/tools/route.js.nft.json +1 -0
- package/.next/server/app/api/mcp-servers/[name]/tools/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/mcp-servers/route.js +1 -1
- package/.next/server/app/api/notifications/route.js +1 -1
- package/.next/server/app/api/notifications/test/route.js +3 -3
- package/.next/server/app/api/plugins/[id]/route.js +1 -0
- package/.next/server/app/api/plugins/[id]/route.js.nft.json +1 -0
- package/.next/server/app/api/plugins/[id]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/plugins/install/route.js +1 -0
- package/.next/server/app/api/plugins/install/route.js.nft.json +1 -0
- package/.next/server/app/api/plugins/install/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/plugins/marketplaces/[name]/route.js +1 -0
- package/.next/server/app/api/plugins/marketplaces/[name]/route.js.nft.json +1 -0
- package/.next/server/app/api/plugins/marketplaces/[name]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/plugins/marketplaces/route.js +1 -0
- package/.next/server/app/api/plugins/marketplaces/route.js.nft.json +1 -0
- package/.next/server/app/api/plugins/marketplaces/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/plugins/route.js +1 -0
- package/.next/server/app/api/plugins/route.js.nft.json +1 -0
- package/.next/server/app/api/plugins/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/providers/[id]/route.js +1 -1
- package/.next/server/app/api/providers/route.js +1 -1
- package/.next/server/app/api/reviews/pinned/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/context/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/context/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/mcp/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/mcp/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/search/route.js +1 -1
- package/.next/server/app/api/sessions/[id]/search/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/[id]/tabs/route.js +1 -1
- package/.next/server/app/api/sessions/bulk-delete/route.js +1 -1
- package/.next/server/app/api/sessions/bulk-delete/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/by-ids/route.js +1 -1
- package/.next/server/app/api/sessions/by-ids/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/group/route.js +1 -1
- package/.next/server/app/api/sessions/group/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/pinned/route.js +1 -1
- package/.next/server/app/api/sessions/route.js +1 -1
- package/.next/server/app/api/sessions/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/search/route.js +1 -1
- package/.next/server/app/api/sessions/search/route.js.nft.json +1 -1
- package/.next/server/app/api/sessions/thinking/route.js +1 -1
- package/.next/server/app/api/sessions/thinking/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/[name]/route.js +1 -1
- package/.next/server/app/api/skills/route.js +1 -1
- package/.next/server/app/api/terminal/[id]/route.js +1 -1
- package/.next/server/app/api/terminal/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/terminal/route.js +1 -1
- package/.next/server/app/api/terminal/route.js.nft.json +1 -1
- package/.next/server/app/api/usage/route.js +1 -1
- package/.next/server/app/api/version/changelog/route.js +1 -1
- package/.next/server/app/api/version/cockpit/changelog/route.js +1 -1
- package/.next/server/app/api/version/cockpit/route.js +1 -1
- package/.next/server/app/api/version/route.js +2 -2
- package/.next/server/app/claude-md/edit.html +1 -1
- package/.next/server/app/claude-md/edit.rsc +4 -4
- package/.next/server/app/claude-md/edit.segments/!KGFwcCk/claude-md/edit/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/claude-md/edit.segments/!KGFwcCk/claude-md/edit.segment.rsc +1 -1
- package/.next/server/app/claude-md/edit.segments/!KGFwcCk/claude-md.segment.rsc +1 -1
- package/.next/server/app/claude-md/edit.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/claude-md/edit.segments/_full.segment.rsc +4 -4
- package/.next/server/app/claude-md/edit.segments/_head.segment.rsc +1 -1
- package/.next/server/app/claude-md/edit.segments/_index.segment.rsc +2 -2
- package/.next/server/app/claude-md/edit.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/claude-md.html +1 -1
- package/.next/server/app/claude-md.rsc +4 -4
- package/.next/server/app/claude-md.segments/!KGFwcCk/claude-md/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/claude-md.segments/!KGFwcCk/claude-md.segment.rsc +1 -1
- package/.next/server/app/claude-md.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/claude-md.segments/_full.segment.rsc +4 -4
- package/.next/server/app/claude-md.segments/_head.segment.rsc +1 -1
- package/.next/server/app/claude-md.segments/_index.segment.rsc +2 -2
- package/.next/server/app/claude-md.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/commands.html +1 -1
- package/.next/server/app/commands.rsc +4 -4
- package/.next/server/app/commands.segments/!KGFwcCk/commands/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/commands.segments/!KGFwcCk/commands.segment.rsc +1 -1
- package/.next/server/app/commands.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/commands.segments/_full.segment.rsc +4 -4
- package/.next/server/app/commands.segments/_head.segment.rsc +1 -1
- package/.next/server/app/commands.segments/_index.segment.rsc +2 -2
- package/.next/server/app/commands.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/hooks.html +1 -1
- package/.next/server/app/hooks.rsc +4 -4
- package/.next/server/app/hooks.segments/!KGFwcCk/hooks/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/hooks.segments/!KGFwcCk/hooks.segment.rsc +1 -1
- package/.next/server/app/hooks.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/hooks.segments/_full.segment.rsc +4 -4
- package/.next/server/app/hooks.segments/_head.segment.rsc +1 -1
- package/.next/server/app/hooks.segments/_index.segment.rsc +2 -2
- package/.next/server/app/hooks.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/inbox.html +1 -1
- package/.next/server/app/inbox.rsc +4 -4
- package/.next/server/app/inbox.segments/!KGFwcCk/inbox/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/inbox.segments/!KGFwcCk/inbox.segment.rsc +1 -1
- package/.next/server/app/inbox.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/inbox.segments/_full.segment.rsc +4 -4
- package/.next/server/app/inbox.segments/_head.segment.rsc +1 -1
- package/.next/server/app/inbox.segments/_index.segment.rsc +2 -2
- package/.next/server/app/inbox.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/index.html +1 -1
- package/.next/server/app/index.rsc +4 -4
- package/.next/server/app/index.segments/!KGFwcCk/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/index.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/jobs.html +1 -1
- package/.next/server/app/jobs.rsc +4 -4
- package/.next/server/app/jobs.segments/!KGFwcCk/jobs/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/jobs.segments/!KGFwcCk/jobs.segment.rsc +1 -1
- package/.next/server/app/jobs.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/jobs.segments/_full.segment.rsc +4 -4
- package/.next/server/app/jobs.segments/_head.segment.rsc +1 -1
- package/.next/server/app/jobs.segments/_index.segment.rsc +2 -2
- package/.next/server/app/jobs.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login/page.js +2 -2
- package/.next/server/app/login/page.js.nft.json +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +3 -3
- package/.next/server/app/login.segments/_full.segment.rsc +3 -3
- package/.next/server/app/login.segments/_head.segment.rsc +1 -1
- package/.next/server/app/login.segments/_index.segment.rsc +2 -2
- package/.next/server/app/login.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/login.segments/login.segment.rsc +1 -1
- package/.next/server/app/mcp-servers.html +1 -1
- package/.next/server/app/mcp-servers.rsc +4 -4
- package/.next/server/app/mcp-servers.segments/!KGFwcCk/mcp-servers/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/mcp-servers.segments/!KGFwcCk/mcp-servers.segment.rsc +1 -1
- package/.next/server/app/mcp-servers.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/mcp-servers.segments/_full.segment.rsc +4 -4
- package/.next/server/app/mcp-servers.segments/_head.segment.rsc +1 -1
- package/.next/server/app/mcp-servers.segments/_index.segment.rsc +2 -2
- package/.next/server/app/mcp-servers.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/plugins.html +1 -0
- package/.next/server/app/{changes.meta → plugins.meta} +3 -3
- package/.next/server/app/{changes.rsc → plugins.rsc} +4 -4
- package/.next/server/app/{files.segments/!KGFwcCk/files → plugins.segments/!KGFwcCk/plugins}/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/{changes.segments/!KGFwcCk/changes.segment.rsc → plugins.segments/!KGFwcCk/plugins.segment.rsc} +1 -1
- package/.next/server/app/{changes.segments → plugins.segments}/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/{changes.segments → plugins.segments}/_full.segment.rsc +4 -4
- package/.next/server/app/{changes.segments → plugins.segments}/_head.segment.rsc +1 -1
- package/.next/server/app/{files.segments → plugins.segments}/_index.segment.rsc +2 -2
- package/.next/server/app/{changes.segments → plugins.segments}/_tree.segment.rsc +2 -2
- package/.next/server/app/reviews.html +1 -1
- package/.next/server/app/reviews.rsc +4 -4
- package/.next/server/app/reviews.segments/!KGFwcCk/reviews/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/reviews.segments/!KGFwcCk/reviews.segment.rsc +1 -1
- package/.next/server/app/reviews.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/reviews.segments/_full.segment.rsc +4 -4
- package/.next/server/app/reviews.segments/_head.segment.rsc +1 -1
- package/.next/server/app/reviews.segments/_index.segment.rsc +2 -2
- package/.next/server/app/reviews.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings/appearance.html +1 -1
- package/.next/server/app/settings/appearance.rsc +4 -4
- package/.next/server/app/settings/appearance.segments/!KGFwcCk/settings/appearance/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/settings/appearance.segments/!KGFwcCk/settings/appearance.segment.rsc +1 -1
- package/.next/server/app/settings/appearance.segments/!KGFwcCk/settings.segment.rsc +1 -1
- package/.next/server/app/settings/appearance.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/settings/appearance.segments/_full.segment.rsc +4 -4
- package/.next/server/app/settings/appearance.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings/appearance.segments/_index.segment.rsc +2 -2
- package/.next/server/app/settings/appearance.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings/notifications.html +1 -1
- package/.next/server/app/settings/notifications.rsc +4 -4
- package/.next/server/app/settings/notifications.segments/!KGFwcCk/settings/notifications/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/settings/notifications.segments/!KGFwcCk/settings/notifications.segment.rsc +1 -1
- package/.next/server/app/settings/notifications.segments/!KGFwcCk/settings.segment.rsc +1 -1
- package/.next/server/app/settings/notifications.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/settings/notifications.segments/_full.segment.rsc +4 -4
- package/.next/server/app/settings/notifications.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings/notifications.segments/_index.segment.rsc +2 -2
- package/.next/server/app/settings/notifications.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings/providers/new.html +1 -1
- package/.next/server/app/settings/providers/new.rsc +4 -4
- package/.next/server/app/settings/providers/new.segments/!KGFwcCk/settings/providers/new/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/settings/providers/new.segments/!KGFwcCk/settings/providers/new.segment.rsc +1 -1
- package/.next/server/app/settings/providers/new.segments/!KGFwcCk/settings/providers.segment.rsc +1 -1
- package/.next/server/app/settings/providers/new.segments/!KGFwcCk/settings.segment.rsc +1 -1
- package/.next/server/app/settings/providers/new.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/settings/providers/new.segments/_full.segment.rsc +4 -4
- package/.next/server/app/settings/providers/new.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings/providers/new.segments/_index.segment.rsc +2 -2
- package/.next/server/app/settings/providers/new.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings/providers.html +1 -1
- package/.next/server/app/settings/providers.rsc +4 -4
- package/.next/server/app/settings/providers.segments/!KGFwcCk/settings/providers/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/settings/providers.segments/!KGFwcCk/settings/providers.segment.rsc +1 -1
- package/.next/server/app/settings/providers.segments/!KGFwcCk/settings.segment.rsc +1 -1
- package/.next/server/app/settings/providers.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/settings/providers.segments/_full.segment.rsc +4 -4
- package/.next/server/app/settings/providers.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings/providers.segments/_index.segment.rsc +2 -2
- package/.next/server/app/settings/providers.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings/session.html +1 -1
- package/.next/server/app/settings/session.rsc +4 -4
- package/.next/server/app/settings/session.segments/!KGFwcCk/settings/session/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/settings/session.segments/!KGFwcCk/settings/session.segment.rsc +1 -1
- package/.next/server/app/settings/session.segments/!KGFwcCk/settings.segment.rsc +1 -1
- package/.next/server/app/settings/session.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/settings/session.segments/_full.segment.rsc +4 -4
- package/.next/server/app/settings/session.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings/session.segments/_index.segment.rsc +2 -2
- package/.next/server/app/settings/session.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/settings.html +1 -1
- package/.next/server/app/settings.rsc +4 -4
- package/.next/server/app/settings.segments/!KGFwcCk/settings/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/settings.segments/!KGFwcCk/settings.segment.rsc +1 -1
- package/.next/server/app/settings.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/settings.segments/_full.segment.rsc +4 -4
- package/.next/server/app/settings.segments/_head.segment.rsc +1 -1
- package/.next/server/app/settings.segments/_index.segment.rsc +2 -2
- package/.next/server/app/settings.segments/_tree.segment.rsc +2 -2
- package/.next/server/app/skills.html +1 -1
- package/.next/server/app/skills.rsc +4 -4
- package/.next/server/app/skills.segments/!KGFwcCk/skills/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/skills.segments/!KGFwcCk/skills.segment.rsc +1 -1
- package/.next/server/app/skills.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/skills.segments/_full.segment.rsc +4 -4
- package/.next/server/app/skills.segments/_head.segment.rsc +1 -1
- package/.next/server/app/skills.segments/_index.segment.rsc +2 -2
- package/.next/server/app/skills.segments/_tree.segment.rsc +2 -2
- package/.next/server/app-paths-manifest.json +10 -2
- package/.next/server/chunks/1011.js +1 -1
- package/.next/server/chunks/1327.js +1 -1
- package/.next/server/chunks/1979.js +7 -2
- package/.next/server/chunks/2666.js +1 -0
- package/.next/server/chunks/3136.js +11 -0
- package/.next/server/chunks/319.js +45 -0
- package/.next/server/chunks/3445.js +2 -2
- package/.next/server/chunks/3764.js +1 -1
- package/.next/server/chunks/4053.js +4971 -0
- package/.next/server/chunks/5292.js +201 -0
- package/.next/server/chunks/5318.js +1 -1
- package/.next/server/chunks/5472.js +1 -1
- package/.next/server/chunks/6304.js +1 -1
- package/.next/server/chunks/6705.js +1 -1
- package/.next/server/chunks/7539.js +5 -0
- package/.next/server/chunks/7891.js +1 -0
- package/.next/server/chunks/8578.js +1 -1
- package/.next/server/chunks/8728.js +1 -0
- package/.next/server/middleware-build-manifest.js +1 -1
- package/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/.next/server/pages/404.html +1 -1
- package/.next/server/pages/500.html +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/static/chunks/12644.84908edd1bec8b5a.js +1 -0
- package/.next/static/chunks/1550-9a32fa02f6722fc7.js +25 -0
- package/.next/static/chunks/18977.393a8bc1bef44fc4.js +1 -0
- package/.next/static/chunks/{2503.bb9d3528c3c7ccae.js → 2503.68e12779c4b14adb.js} +1 -1
- package/.next/static/chunks/25781-c77dc5d11fb85d82.js +201 -0
- package/.next/static/chunks/{27455.1bce740b63d7c3cc.js → 27455.8f2189c777c63368.js} +1 -1
- package/.next/static/chunks/33072.3d32bb7b2a85ca9b.js +1 -0
- package/.next/static/chunks/39267.0c93a6bed8e46ac0.js +1 -0
- package/.next/static/chunks/52333.ff3bf0753b68875e.js +1 -0
- package/.next/static/chunks/69940.42e1ca99efc62caf.js +1 -0
- package/.next/static/chunks/70400.ffe0412efe741888.js +1 -0
- package/.next/static/chunks/7113.336a2a8deabe2aa5.js +1 -0
- package/.next/static/chunks/{71642.852436e8f0287b89.js → 71642.e11bcaa30efbf1f2.js} +1 -1
- package/.next/static/chunks/{72839.a5325a99f8c12fed.js → 72839.225c36dd5e767a20.js} +1 -1
- package/.next/static/chunks/{69427.a0b463c808aa54c8.js → 81272.b0027c9bc80050aa.js} +1 -1
- package/.next/static/chunks/85853.421f0c913b3d332b.js +1 -0
- package/.next/static/chunks/86155.3c5c1468fa2f446e.js +1 -0
- package/.next/static/chunks/86339.ba009abde9765665.js +1 -0
- package/.next/static/chunks/86939-51ae17d3d12c0310.js +1 -0
- package/.next/static/chunks/93794-b87eef7d177fe7b3.js +32 -0
- package/.next/static/chunks/989-6074551b2b54a168.js +3 -0
- package/.next/static/chunks/app/(app)/agents/[name]/page-6954a12623e4bdcf.js +8 -0
- package/.next/static/chunks/app/(app)/agents/{page-6fcfd7ab6781814e.js → page-b984c01f39aed22e.js} +1 -1
- package/.next/static/chunks/app/(app)/claude-md/edit/page-575c5ccdc585516c.js +1 -0
- package/.next/static/chunks/app/(app)/claude-md/{page-cd9e2176a12ba241.js → page-aab6df0c14c657f3.js} +1 -1
- package/.next/static/chunks/app/(app)/commands/[name]/page-ea86a4400fd29210.js +6 -0
- package/.next/static/chunks/app/(app)/commands/{page-f126b608b04747ac.js → page-3867a45c1378c6fe.js} +1 -1
- package/.next/static/chunks/app/(app)/hooks/[event]/{page-28038323fd29adfa.js → page-2c41e810c15a1149.js} +2 -2
- package/.next/static/chunks/app/(app)/hooks/{page-f1f39284e53c0344.js → page-49f9dbb78a3f97df.js} +1 -1
- package/.next/static/chunks/app/(app)/inbox/[id]/page-885a258b67e47b00.js +1 -0
- package/.next/static/chunks/app/(app)/inbox/page-592249fc155b9fe4.js +1 -0
- package/.next/static/chunks/app/(app)/jobs/[id]/edit/page-121bf977a839488c.js +1 -0
- package/.next/static/chunks/app/(app)/jobs/[id]/page-ba516fa01db89ea0.js +1 -0
- package/.next/static/chunks/app/(app)/jobs/[id]/runs/[runId]/page-0650e6f678fae5b8.js +1 -0
- package/.next/static/chunks/app/(app)/jobs/page-da3fe23a43277e67.js +1 -0
- package/.next/static/chunks/app/(app)/{layout-ce9e1be301c60fe5.js → layout-3cd80708648e0723.js} +1 -1
- package/.next/static/chunks/app/(app)/mcp-servers/[name]/{page-d6d805a27ec0b0c0.js → page-9290a7940a32d9ac.js} +1 -1
- package/.next/static/chunks/app/(app)/mcp-servers/page-1e828264f81ee08c.js +1 -0
- package/.next/static/chunks/app/(app)/{page-027a5382da30ddb9.js → page-2d171ffc3e1945e1.js} +1 -1
- package/.next/static/chunks/app/(app)/plugins/page-7e70e0b3ead44a99.js +1 -0
- package/.next/static/chunks/app/(app)/reviews/[owner]/[repo]/[number]/page-4396e9d6df189336.js +13 -0
- package/.next/static/chunks/app/(app)/reviews/[owner]/[repo]/{page-c5fd013309ab3eba.js → page-76a072cbfe3d9f0e.js} +1 -1
- package/.next/static/chunks/app/(app)/reviews/{page-47530d93bb9d4a76.js → page-deaa44f0ce253da8.js} +1 -1
- package/.next/static/chunks/app/(app)/sessions/[id]/page-95bcce2e0b9f827a.js +1 -0
- package/.next/static/chunks/app/(app)/settings/appearance/{page-95902da748ac5f1e.js → page-433fcfb9b95fb22e.js} +1 -1
- package/.next/static/chunks/app/(app)/settings/notifications/page-e5309337f125a059.js +1 -0
- package/.next/static/chunks/app/(app)/settings/{page-8ed16a66fdde10cd.js → page-353ef8c508418af1.js} +1 -1
- package/.next/static/chunks/app/(app)/settings/providers/[id]/page-2cacea2e60ba435c.js +1 -0
- package/.next/static/chunks/app/(app)/settings/providers/new/page-d40acef3abfc7c19.js +1 -0
- package/.next/static/chunks/app/(app)/settings/providers/page-098d8f399c663944.js +1 -0
- package/.next/static/chunks/app/(app)/settings/session/page-706118ba33c2b99f.js +1 -0
- package/.next/static/chunks/app/(app)/skills/[name]/page-7dd7c0f316742c01.js +6 -0
- package/.next/static/chunks/app/(app)/skills/{page-c52773eacb27c04e.js → page-48d0bbe201180fc8.js} +1 -1
- package/.next/static/chunks/app/_global-error/page-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/agents/[name]/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/agents/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/assistant-session/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/auth/check/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/auth/login/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/auth/setup/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/auth/ws-token/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/btw/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/claude-md/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/commands/[name]/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/commands/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/config/cwd/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/defaults/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/filesystem/browse/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/filesystem/files/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/filesystem/mkdir/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/filesystem/read/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/git/clone/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/git/commit/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/git/diff/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/git/discard/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/git/generate-message/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/git/push/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/git/status/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/github/file-content/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/github/orgs/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/github/prs/checks/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/github/prs/diff/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/github/prs/review/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/github/prs/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/github/prs/view/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/github/repos/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/github/review-session/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/health/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/hooks/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/inbox/[id]/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/inbox/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/jobs/[id]/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/jobs/[id]/runs/[runId]/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/jobs/[id]/runs/[runId]/transcript/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/jobs/[id]/runs/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/jobs/[id]/stop/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/jobs/[id]/trigger/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/jobs/mcp-discover/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/jobs/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/jobs/status/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/mcp-servers/[name]/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/mcp-servers/[name]/test/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/mcp-servers/[name]/tools/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/mcp-servers/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/notifications/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/notifications/test/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/plugins/[id]/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/plugins/install/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/plugins/marketplaces/[name]/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/plugins/marketplaces/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/plugins/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/providers/[id]/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/providers/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/reviews/pinned/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/context/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/mcp/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/search/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/tabs/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/sessions/bulk-delete/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/sessions/by-ids/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/sessions/group/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/sessions/pinned/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/sessions/search/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/sessions/thinking/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/skills/[name]/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/skills/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/terminal/[id]/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/terminal/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/usage/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/version/changelog/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/version/cockpit/changelog/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/version/cockpit/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/app/api/version/route-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/{framework-6fd9f138158c42e0.js → framework-45a1aae1a0f575fd.js} +1 -1
- package/.next/static/chunks/{main-5dac9bfffcc23702.js → main-eb9ff0b73c75808a.js} +3 -3
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-bf8153dffcb47d46.js +1 -0
- package/.next/static/chunks/webpack-76a545b642140725.js +1 -0
- package/.next/static/css/483101dd9c42fb97.css +1 -0
- package/.next/static/mmHo0MmzQHWjZATtI-VbH/_buildManifest.js +1 -0
- package/README.md +2 -2
- package/dist/server.js +10 -0
- package/dist/src/lib/cli-commands.js +147 -0
- package/dist/src/lib/models.js +8 -0
- package/dist/src/lib/paste-detect.js +161 -0
- package/dist/src/server/assistant-settings.js +35 -0
- package/dist/src/server/claude-bin.js +21 -0
- package/dist/src/server/cli-init-fetch.js +6 -1
- package/dist/src/server/inbox.js +2 -2
- package/dist/src/server/job-scheduler.js +146 -4
- package/dist/src/server/job-storage.js +33 -0
- package/dist/src/server/mcp/cockpit-agent-prompt.js +5 -0
- package/dist/src/server/mcp/cockpit-config-server.js +632 -0
- package/dist/src/server/mcp/run-context.js +23 -0
- package/dist/src/server/notifications.js +51 -10
- package/dist/src/server/plugins.js +103 -0
- package/dist/src/server/providers.js +25 -2
- package/dist/src/server/pty-runtime.js +112 -3
- package/dist/src/server/pty-session.js +7 -4
- package/dist/src/server/session-manager.js +338 -100
- package/dist/src/server/singleton.js +9 -0
- package/dist/src/server/terminal-buffer.js +17 -0
- package/dist/src/server/terminal-manager.js +9 -13
- package/dist/src/server/transcript.js +39 -22
- package/dist/src/server/ws-handler.js +18 -6
- package/next.config.ts +1 -0
- package/package.json +3 -2
- package/.next/server/app/(app)/changes/page.js +0 -2
- package/.next/server/app/(app)/changes/page.js.nft.json +0 -1
- package/.next/server/app/(app)/changes/page_client-reference-manifest.js +0 -1
- package/.next/server/app/(app)/files/page.js +0 -2
- package/.next/server/app/(app)/files/page_client-reference-manifest.js +0 -1
- package/.next/server/app/changes.html +0 -1
- package/.next/server/app/changes.segments/!KGFwcCk/changes/__PAGE__.segment.rsc +0 -9
- package/.next/server/app/changes.segments/_index.segment.rsc +0 -5
- package/.next/server/app/files.html +0 -1
- package/.next/server/app/files.meta +0 -16
- package/.next/server/app/files.rsc +0 -23
- package/.next/server/app/files.segments/!KGFwcCk/files.segment.rsc +0 -5
- package/.next/server/app/files.segments/!KGFwcCk.segment.rsc +0 -7
- package/.next/server/app/files.segments/_full.segment.rsc +0 -23
- package/.next/server/app/files.segments/_head.segment.rsc +0 -6
- package/.next/server/app/files.segments/_tree.segment.rsc +0 -2
- package/.next/server/chunks/3006.js +0 -199
- package/.next/server/chunks/4342.js +0 -1
- package/.next/server/chunks/4352.js +0 -1
- package/.next/server/chunks/4445.js +0 -1
- package/.next/server/chunks/63.js +0 -45
- package/.next/server/chunks/7782.js +0 -6
- package/.next/server/chunks/8148.js +0 -1
- package/.next/server/chunks/9599.js +0 -11
- package/.next/static/I-rxZaJEzhe3ZUTjSqB11/_buildManifest.js +0 -1
- package/.next/static/chunks/18977.a98edaf19c6df2d4.js +0 -1
- package/.next/static/chunks/26126-97874904b42befb8.js +0 -1
- package/.next/static/chunks/31010-6e87f77b97544424.js +0 -1
- package/.next/static/chunks/33072.9c3cd19e8d515dea.js +0 -1
- package/.next/static/chunks/3765-d323c6675307a63e.js +0 -20
- package/.next/static/chunks/39267.ef60669ade47cf4c.js +0 -1
- package/.next/static/chunks/41487-d802643f4a8fad3c.js +0 -199
- package/.next/static/chunks/48273-fb393846bb4333c0.js +0 -6
- package/.next/static/chunks/52333.f98d1cca9a127b34.js +0 -1
- package/.next/static/chunks/6935-f436a624267529fb.js +0 -1
- package/.next/static/chunks/70400.1816c247ad90f9bc.js +0 -1
- package/.next/static/chunks/7113.39704408fef3d26e.js +0 -1
- package/.next/static/chunks/85853.39872899093b140a.js +0 -1
- package/.next/static/chunks/86155.40f687f9aaa13854.js +0 -1
- package/.next/static/chunks/86339.4dbd51a9b9871f65.js +0 -1
- package/.next/static/chunks/86939-dfc6f8eb395caa89.js +0 -1
- package/.next/static/chunks/93794-5f89a674d8cefcff.js +0 -32
- package/.next/static/chunks/989-94bf2b9d242776c3.js +0 -3
- package/.next/static/chunks/app/(app)/agents/[name]/page-8bdd0359043537d4.js +0 -8
- package/.next/static/chunks/app/(app)/changes/page-4549a5bd72d77e3e.js +0 -1
- package/.next/static/chunks/app/(app)/claude-md/edit/page-08e6e120e71979f4.js +0 -1
- package/.next/static/chunks/app/(app)/commands/[name]/page-7cdfdef29ded0aa0.js +0 -6
- package/.next/static/chunks/app/(app)/files/page-f526eb95821e000e.js +0 -1
- package/.next/static/chunks/app/(app)/inbox/[id]/page-bc1ff3a0db0114a4.js +0 -1
- package/.next/static/chunks/app/(app)/inbox/page-82e03870103ce9bd.js +0 -1
- package/.next/static/chunks/app/(app)/jobs/[id]/edit/page-7fb788f772ff2129.js +0 -1
- package/.next/static/chunks/app/(app)/jobs/[id]/page-a5856b9ae967ff59.js +0 -1
- package/.next/static/chunks/app/(app)/jobs/[id]/runs/[runId]/page-b7c513402db11db6.js +0 -1
- package/.next/static/chunks/app/(app)/jobs/page-e9bbd6c116b9699f.js +0 -1
- package/.next/static/chunks/app/(app)/mcp-servers/page-4b7276d43451cd43.js +0 -1
- package/.next/static/chunks/app/(app)/reviews/[owner]/[repo]/[number]/page-9ab2955c455bb5fa.js +0 -13
- package/.next/static/chunks/app/(app)/sessions/[id]/page-94f891e1b54fd05f.js +0 -1
- package/.next/static/chunks/app/(app)/settings/notifications/page-229f1db6beb1d19c.js +0 -1
- package/.next/static/chunks/app/(app)/settings/providers/[id]/page-13654263246617b3.js +0 -1
- package/.next/static/chunks/app/(app)/settings/providers/new/page-e1798e321ccbc6df.js +0 -1
- package/.next/static/chunks/app/(app)/settings/providers/page-0bb4c1db2ee35b3d.js +0 -1
- package/.next/static/chunks/app/(app)/settings/session/page-ab216a8fa37a0f76.js +0 -1
- package/.next/static/chunks/app/(app)/skills/[name]/page-8ab85d5090967ee4.js +0 -6
- package/.next/static/chunks/app/_global-error/page-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/agents/[name]/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/agents/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/auth/check/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/auth/login/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/auth/setup/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/auth/ws-token/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/btw/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/claude-md/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/commands/[name]/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/commands/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/defaults/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/filesystem/browse/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/filesystem/files/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/filesystem/mkdir/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/filesystem/read/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/git/clone/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/git/commit/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/git/diff/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/git/discard/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/git/generate-message/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/git/push/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/git/status/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/github/file-content/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/github/orgs/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/github/prs/checks/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/github/prs/diff/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/github/prs/review/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/github/prs/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/github/prs/view/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/github/repos/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/github/review-session/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/health/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/hooks/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/inbox/[id]/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/inbox/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/jobs/[id]/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/jobs/[id]/runs/[runId]/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/jobs/[id]/runs/[runId]/transcript/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/jobs/[id]/runs/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/jobs/[id]/trigger/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/jobs/mcp-discover/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/jobs/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/jobs/status/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/mcp-servers/[name]/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/mcp-servers/[name]/test/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/mcp-servers/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/notifications/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/notifications/test/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/providers/[id]/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/providers/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/reviews/pinned/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/context/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/mcp/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/search/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/tabs/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/sessions/bulk-delete/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/sessions/by-ids/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/sessions/group/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/sessions/pinned/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/sessions/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/sessions/search/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/sessions/thinking/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/skills/[name]/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/skills/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/terminal/[id]/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/terminal/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/usage/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/version/changelog/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/version/cockpit/changelog/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/version/cockpit/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/app/api/version/route-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-fc747760bd4c8a4b.js +0 -1
- package/.next/static/chunks/webpack-e31bb45fa59caed8.js +0 -1
- package/.next/static/css/3f8af4ae6f812d5c.css +0 -1
- /package/.next/static/{I-rxZaJEzhe3ZUTjSqB11 → mmHo0MmzQHWjZATtI-VbH}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[80227],{10833:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>g});var a=s(95155),n=s(81402),l=s(73321),r=s(12115),o=s(
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[80227],{10833:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>g});var a=s(95155),n=s(81402),l=s(73321),r=s(12115),o=s(1550),i=s(9005),d=s(2125),c=s(89239),m=s(60529);function u({value:e,onChange:t,keyPlaceholder:s="Key",valuePlaceholder:n="Value"}){let l=Object.entries(e);return(0,a.jsxs)("div",{className:"space-y-2",children:[l.map(([r,o],d)=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(m.p,{className:"flex-1 font-mono text-xs h-8",placeholder:s,value:r,onChange:e=>(function(e,s){let a={};for(let[t,n]of l)a[t===e?s:t]=n;t(a)})(r,e.target.value)}),(0,a.jsx)(m.p,{className:"flex-1 font-mono text-xs h-8",placeholder:n,value:o,onChange:s=>{var a;return a=s.target.value,void t({...e,[r]:a})}}),(0,a.jsx)("button",{type:"button",className:"shrink-0 p-1 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors",onClick:()=>{let s;return s={...e},void(delete s[r],t(s))},children:(0,a.jsx)(i.A,{className:"h-3.5 w-3.5"})})]},d)),(0,a.jsxs)(c.$,{type:"button",variant:"outline",size:"sm",onClick:function(){let s="",a=0;for(;s in e;)a++,s=`key${a}`;t({...e,[s]:""})},children:[(0,a.jsx)(d.A,{className:"h-3.5 w-3.5 mr-1"}),"Add"]})]})}function h({value:e,onChange:t,placeholder:s="Value"}){return(0,a.jsxs)("div",{className:"space-y-2",children:[e.map((n,l)=>(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(m.p,{className:"flex-1 font-mono text-xs h-8",placeholder:s,value:n,onChange:s=>{var a;let n;return a=s.target.value,void((n=[...e])[l]=a,t(n))}}),(0,a.jsx)("button",{type:"button",className:"shrink-0 p-1 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors",onClick:()=>{t(e.filter((e,t)=>t!==l))},children:(0,a.jsx)(i.A,{className:"h-3.5 w-3.5"})})]},l)),(0,a.jsxs)(c.$,{type:"button",variant:"outline",size:"sm",onClick:function(){t([...e,""])},children:[(0,a.jsx)(d.A,{className:"h-3.5 w-3.5 mr-1"}),"Add"]})]})}var v=s(45160);let p={type:"stdio",command:"",args:[],env:{},url:"",headers:{}},x=[{value:"stdio",label:"stdio"},{value:"http",label:"http"},{value:"sse",label:"sse (deprecated)"}];function f(e){if("stdio"===e.type){let t={type:"stdio",command:e.command};return e.args.length>0&&(t.args=e.args),Object.keys(e.env).length>0&&(t.env=e.env),t}let t={type:e.type,url:e.url};return Object.keys(e.headers).length>0&&(t.headers=e.headers),t}function j(e){return JSON.stringify(f(e))}function g({params:e}){let{name:t}=(0,r.use)(e),s=(0,l.useSearchParams)(),i=(0,l.useRouter)(),d="new"===t,y=s.get("scope")||"user",b=s.get("cwd")||void 0;(0,o.si)(d?"New MCP Server":"Edit MCP Server",{hideActions:!0});let[N,k]=(0,r.useState)(d?"":decodeURIComponent(t)),[C,w]=(0,r.useState)(p),[S,A]=(0,r.useState)(j(p)),[P,$]=(0,r.useState)(!d),[E,R]=(0,r.useState)(!1),[U,O]=(0,r.useState)(null),_=j(C)!==S;(0,r.useEffect)(()=>{if(d)return;let e=new URLSearchParams({scope:y});b&&e.set("cwd",b),fetch(`/api/mcp-servers/${encodeURIComponent(t)}?${e}`).then(e=>{if(!e.ok)throw Error("Not found");return e.json()}).then(e=>{var t;let s={type:(t=e.config).type||(t.command?"stdio":t.url?"http":"stdio"),command:t.command||"",args:t.args||[],env:t.env||{},url:t.url||"",headers:t.headers||{}};w(s),A(j(s))}).catch(()=>{O("Failed to load server")}).finally(()=>$(!1))},[d,t,y,b]);let z=(0,r.useCallback)(async()=>{let e=N.trim();if(!e)return void O("Name is required");if(!/^[a-zA-Z0-9_-]+$/.test(e))return void O("Name can only contain letters, numbers, hyphens, and underscores");if("stdio"===C.type&&!C.command.trim())return void O("Command is required for stdio transport");if(("http"===C.type||"sse"===C.type)&&!C.url.trim())return void O("URL is required for "+C.type+" transport");R(!0),O(null);try{if(!(await fetch(`/api/mcp-servers/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({scope:y,cwd:b,config:f(C)})})).ok)throw Error("Save failed");if(A(j(C)),O("Saved"),d){let t=new URLSearchParams({scope:y});b&&t.set("cwd",b),i.replace(`/mcp-servers/${encodeURIComponent(e)}?${t}`)}}catch{O("Failed to save")}finally{R(!1)}},[N,C,y,b,d,i]);function L(e){w(t=>({...t,...e}))}return P?(0,a.jsx)("div",{className:"flex-1 min-h-0 p-4",children:(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading..."})}):(0,a.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"flex-1 min-w-0",children:d?(0,a.jsx)(m.p,{placeholder:"server-name",value:N,onChange:e=>k(e.target.value),className:"font-mono"}):(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono font-bold text-lg",children:N}),(0,a.jsx)(v.E,{variant:"secondary",children:"user"===y?"Global":"Project"})]})}),(0,a.jsxs)(c.$,{size:"sm",onClick:z,disabled:E||!d&&!_,children:[(0,a.jsx)(n.A,{className:"h-4 w-4 mr-1"}),E?"Saving...":"Save"]})]}),U&&(0,a.jsx)("p",{className:`text-sm ${"Saved"===U?"text-green-600":"text-destructive"}`,children:U}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Transport"}),(0,a.jsx)("div",{className:"flex gap-1",children:x.map(e=>(0,a.jsx)(c.$,{variant:C.type===e.value?"default":"outline",size:"sm",onClick:()=>L({type:e.value}),children:e.label},e.value))})]}),"stdio"===C.type&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Command"}),(0,a.jsx)(m.p,{placeholder:"node",value:C.command,onChange:e=>L({command:e.target.value}),className:"font-mono"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Arguments"}),(0,a.jsx)(h,{value:C.args,onChange:e=>L({args:e}),placeholder:"argument"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Environment Variables"}),(0,a.jsx)(u,{value:C.env,onChange:e=>L({env:e}),keyPlaceholder:"VARIABLE",valuePlaceholder:"value"})]})]}),("http"===C.type||"sse"===C.type)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"URL"}),(0,a.jsx)(m.p,{placeholder:"https://example.com/mcp",value:C.url,onChange:e=>L({url:e.target.value}),className:"font-mono"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Headers"}),(0,a.jsx)(u,{value:C.headers,onChange:e=>L({headers:e}),keyPlaceholder:"Header-Name",valuePlaceholder:"value"})]})]})]})]})}},81402:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});let a=(0,s(99537).A)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]])},86853:(e,t,s)=>{Promise.resolve().then(s.bind(s,10833))}},e=>{e.O(0,[989,25781,1550,28441,93794,77358],()=>e(e.s=86853)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[67797],{61239:(e,s,t)=>{Promise.resolve().then(t.bind(t,78357))},78357:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>p});var n=t(95155),a=t(2125),l=t(76721),r=t(92571),c=t(31966),i=t(73321),o=t(12115),d=t(1550),m=t(41158),x=t(45160),u=t(89239),h=t(81477),j=t(42763);function p(){(0,d.si)("MCP Servers",{hideActions:!0});let e=(0,i.useSearchParams)(),s=(0,i.useRouter)(),t=e.get("mcp"),a=e.get("scope")||"user",l="u">typeof localStorage&&localStorage.getItem("cockpit-agents-cwd")||void 0,{servers:r,loading:c,getServer:m,deleteServer:x}=function(e){let[s,t]=(0,o.useState)([]),[n,a]=(0,o.useState)(!0),l=(0,o.useCallback)(()=>{a(!0);let s=new URLSearchParams;e&&s.set("cwd",e),fetch(`/api/mcp-servers?${s}`).then(e=>e.json()).then(e=>t(e.servers)).catch(()=>t([])).finally(()=>a(!1))},[e]);(0,o.useEffect)(()=>{l()},[l]);let r=(0,o.useCallback)(async(e,s,t)=>{let n=new URLSearchParams({scope:s});"project"===s&&t&&n.set("cwd",t);try{let s=await fetch(`/api/mcp-servers/${encodeURIComponent(e)}?${n}`);if(!s.ok)return null;return s.json()}catch{return null}},[]),c=(0,o.useCallback)(async(s,t)=>{let n=new URLSearchParams({scope:t});"project"===t&&e&&n.set("cwd",e);try{if((await fetch(`/api/mcp-servers/${encodeURIComponent(s)}?${n}`,{method:"DELETE"})).ok)return l(),!0;return!1}catch{return!1}},[e,l]);return{servers:s,loading:n,refresh:l,getServer:r,deleteServer:c}}(l);return t?(0,n.jsx)(g,{name:t,scope:a,cwd:l,onBack:()=>s.push("/mcp-servers"),getServer:m,onDelete:async(e,s)=>await x(e,s)}):(0,n.jsx)(f,{servers:r,loading:c})}function f({servers:e,loading:s}){let t=(0,i.useRouter)(),[l,r]=(0,o.useState)(!1),[c,d]=(0,o.useState)(!1),x=e.filter(e=>"user"===e.scope),p=e.filter(e=>"project"===e.scope);function g(e,s){r(!1),d(!1);let n=new URLSearchParams({scope:e});"project"===e&&s&&n.set("cwd",s),t.push(`/mcp-servers/new?${n}`)}function v(e,s){t.push(`/mcp-servers?mcp=${encodeURIComponent(e)}&scope=${s}`)}return(0,n.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("div",{}),(0,n.jsxs)(u.$,{size:"sm",onClick:()=>r(!0),children:[(0,n.jsx)(a.A,{className:"h-4 w-4 mr-1"}),"New Server"]})]}),s&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading servers..."}),!s&&0===e.length&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"No MCP servers configured. Add one to get started."}),x.length>0&&(0,n.jsxs)(h.Zp,{children:[(0,n.jsx)(h.aR,{children:(0,n.jsx)(h.ZB,{className:"text-base",children:"Global"})}),(0,n.jsx)(h.Wu,{className:"space-y-1",children:x.map(e=>(0,n.jsx)(N,{name:e.name,type:e.type,detail:e.command||e.url,onClick:()=>v(e.name,"user")},e.name))})]}),p.length>0&&(0,n.jsxs)(h.Zp,{children:[(0,n.jsx)(h.aR,{children:(0,n.jsx)(h.ZB,{className:"text-base",children:"Project"})}),(0,n.jsx)(h.Wu,{className:"space-y-1",children:p.map(e=>(0,n.jsx)(N,{name:e.name,type:e.type,detail:e.command||e.url,onClick:()=>v(e.name,"project")},e.name))})]}),(0,n.jsx)(j.lG,{open:l,onOpenChange:e=>{r(e),e||d(!1)},children:(0,n.jsxs)(j.Cf,{children:[(0,n.jsx)(j.c7,{children:(0,n.jsx)(j.L3,{children:"New MCP Server"})}),c?(0,n.jsx)(m.K,{onSelect:e=>g("project",e),onCancel:()=>d(!1)}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Where should this server be saved?"}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(u.$,{variant:"outline",className:"flex-1",onClick:()=>g("user"),children:"Global"}),(0,n.jsx)(u.$,{variant:"outline",className:"flex-1",onClick:()=>d(!0),children:"Project"})]})]})]})})]})}function N({name:e,type:s,detail:t,onClick:a}){return(0,n.jsxs)("button",{type:"button",onClick:a,className:"flex w-full items-center gap-3 rounded px-2 py-2 hover:bg-muted transition-colors text-left",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"font-mono font-bold text-sm truncate",children:e}),(0,n.jsx)(x.E,{variant:"secondary",className:"text-[10px]",children:s})]}),t&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:t})]}),(0,n.jsx)(l.A,{className:"h-4 w-4 text-muted-foreground shrink-0"})]})}function g({name:e,scope:s,cwd:t,onBack:a,getServer:l,onDelete:c}){let d=decodeURIComponent(e),m=(0,i.useRouter)(),[p,f]=(0,o.useState)(null),[N,w]=(0,o.useState)(!0),[b,y]=(0,o.useState)(!1),[C,k]=(0,o.useState)(null),[S,$]=(0,o.useState)(null),[R,P]=(0,o.useState)(null),[E,U]=(0,o.useState)(!1);async function L(){k("test"),$(null),P(null);try{let e=new URLSearchParams({scope:s});"project"===s&&t&&e.set("cwd",t);let n=await fetch(`/api/mcp-servers/${encodeURIComponent(d)}/test?${e}`,{method:"POST"}),a=await n.json();P(a)}catch{P({success:!1,logs:"Request failed"})}finally{k(null)}}async function A(){U(!1),k("delete"),$(null),await c(d,s)?a():($("Failed to delete server"),k(null))}if((0,o.useEffect)(()=>{l(d,s,t).then(e=>{e?.config?f(e.config):y(!0)}).catch(()=>y(!0)).finally(()=>w(!1))},[d,s,t,l]),N)return(0,n.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,n.jsx)(v,{onClick:a}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading..."})]});if(b||!p)return(0,n.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,n.jsx)(v,{onClick:a}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Server not found."})]});let D=p.type||(p.command?"stdio":p.url?"http":"stdio"),Z=p.env?Object.keys(p.env):[],I=p.headers?Object.keys(p.headers):[];return(0,n.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-6",children:[(0,n.jsx)(v,{onClick:a}),(0,n.jsx)("div",{children:(0,n.jsx)("h1",{className:"font-mono font-bold text-lg",children:d})}),S&&(0,n.jsx)("div",{className:"rounded border border-red-500/30 bg-red-500/5 p-3 text-sm text-red-500",children:S}),(0,n.jsxs)(h.Zp,{children:[(0,n.jsx)(h.aR,{children:(0,n.jsx)(h.ZB,{className:"text-sm",children:"Details"})}),(0,n.jsxs)(h.Wu,{className:"space-y-3 text-sm",children:[(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Scope"}),(0,n.jsx)(x.E,{variant:"secondary",className:"text-[10px]",children:"user"===s?"Global":"Project"})]}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Type"}),(0,n.jsx)("span",{className:"font-mono",children:D})]}),p.command&&(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Command"}),(0,n.jsx)("span",{className:"font-mono text-xs truncate ml-4 max-w-[60%] text-right",title:p.command,children:p.command})]}),p.args&&p.args.length>0&&(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Arguments"}),(0,n.jsx)("span",{className:"font-mono text-xs text-right max-w-[60%] break-words",title:p.args.join(" "),children:p.args.join(", ")})]}),p.url&&(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"URL"}),(0,n.jsx)("span",{className:"font-mono text-xs truncate ml-4 max-w-[60%] text-right",title:p.url,children:p.url})]}),Z.length>0&&(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Environment"}),(0,n.jsx)("span",{className:"text-xs text-right max-w-[60%] break-words",children:Z.map(e=>(0,n.jsxs)("span",{className:"block font-mono",children:[e,"=",p.env[e]]},e))})]}),I.length>0&&(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Headers"}),(0,n.jsx)("span",{className:"text-xs text-right max-w-[60%] break-words",children:I.map(e=>(0,n.jsxs)("span",{className:"block font-mono",children:[e,": ",p.headers[e]]},e))})]})]})]}),(0,n.jsxs)(h.Zp,{children:[(0,n.jsx)(h.aR,{children:(0,n.jsx)(h.ZB,{className:"text-sm",children:"Actions"})}),(0,n.jsxs)(h.Wu,{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("span",{className:"text-sm",children:"Test connection"}),(0,n.jsx)(u.$,{size:"sm",variant:"outline",onClick:L,disabled:null!==C,children:"test"===C?(0,n.jsx)(r.A,{className:"h-4 w-4 animate-spin"}):"Test"})]}),R&&(0,n.jsxs)("div",{className:`rounded border p-2 text-xs ${R.success?"border-green-500/30 bg-green-500/5":"border-red-500/30 bg-red-500/5"}`,children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5 mb-1",children:[(0,n.jsx)("span",{className:`inline-block h-2 w-2 rounded-full ${R.success?"bg-green-500":"bg-red-500"}`}),(0,n.jsx)("span",{className:"font-medium",children:R.success?"Connected":"Failed"})]}),(0,n.jsx)("pre",{className:"whitespace-pre-wrap text-muted-foreground font-mono leading-relaxed",children:R.logs})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("span",{className:"text-sm",children:"Edit configuration"}),(0,n.jsx)(u.$,{size:"sm",variant:"outline",onClick:function(){let e=new URLSearchParams({scope:s});"project"===s&&t&&e.set("cwd",t),m.push(`/mcp-servers/${encodeURIComponent(d)}?${e}`)},disabled:null!==C,children:"Edit"})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("span",{className:"text-sm",children:"Delete server"}),(0,n.jsx)(u.$,{size:"sm",variant:"destructive",onClick:()=>U(!0),disabled:null!==C,children:"delete"===C?(0,n.jsx)(r.A,{className:"h-4 w-4 animate-spin"}):"Delete"})]})]})]}),(0,n.jsx)(j.lG,{open:E,onOpenChange:U,children:(0,n.jsxs)(j.Cf,{children:[(0,n.jsx)(j.c7,{children:(0,n.jsx)(j.L3,{children:"Delete Server"})}),(0,n.jsxs)("p",{className:"text-sm text-muted-foreground mb-4",children:["Delete ",(0,n.jsx)("span",{className:"font-mono font-bold",children:d}),"? This cannot be undone."]}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(u.$,{variant:"outline",onClick:()=>U(!1),children:"Cancel"}),(0,n.jsx)(u.$,{variant:"destructive",onClick:A,children:"Delete"})]})]})})]})}function v({onClick:e}){return(0,n.jsxs)("button",{type:"button",onClick:e,className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[(0,n.jsx)(c.A,{className:"h-4 w-4"}),"Back to MCP Servers"]})}}},e=>{e.O(0,[989,25781,1550,28441,93794,77358],()=>e(e.s=61239)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29415],{14683:(e,t,s)=>{Promise.resolve().then(s.bind(s,49524))},49524:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>M});var n=s(95155),l=s(3765),a=s(76721),r=s(14225),o=s(65738),i=s(2125);let c=(0,s(99537).A)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var d=s(16449),u=s(49804),x=s(73321),h=s(12115),m=s(45160),f=s(89239),p=s(42763),g=s(89323),j=s(64577),w=s(99314),N=s(65377),b=s(92571),v=s(9005),y=s(81477),S=s(16617);function k({preview:e,matchStart:t,matchLength:s}){let l=e.slice(0,t),a=e.slice(t,t+s),r=e.slice(t+s);return(0,n.jsxs)("span",{className:"text-sm text-muted-foreground whitespace-pre-wrap break-words select-text",children:[l,(0,n.jsx)("mark",{className:"bg-yellow-300/30 text-foreground rounded-sm px-0.5",children:a}),r]})}function C({text:e}){let[t,s]=(0,h.useState)(!1),l=(0,h.useCallback)(t=>{t.stopPropagation(),navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),1500)},[e]);return(0,n.jsx)(f.$,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:l,title:"Copy full message",children:t?(0,n.jsx)(j.A,{className:"h-3 w-3"}):(0,n.jsx)(w.A,{className:"h-3 w-3"})})}function $({onClose:e}){let[t,s]=(0,h.useState)(""),[l,a]=(0,h.useState)([]),[o,i]=(0,h.useState)(!1),[c,d]=(0,h.useState)(!1),[u,x]=(0,h.useState)(!1),[p,g]=(0,h.useState)(null),[j,w]=(0,h.useState)(null),A=(0,h.useRef)(null),E=(0,h.useRef)(null);(0,h.useEffect)(()=>{A.current?.focus()},[]);let D=(0,h.useCallback)((e,t,s)=>fetch(`/api/sessions/search?q=${encodeURIComponent(e)}&offset=${t}`,{signal:s}).then(e=>e.json()),[]);(0,h.useEffect)(()=>{if(t.length<2){a([]),x(!1),g(null);return}let e=setTimeout(()=>{E.current?.abort();let e=new AbortController;E.current=e,i(!0),D(t,0,e.signal).then(t=>{e.signal.aborted||(a(t.results||[]),g({total:t.totalFilesSearched||0,truncated:!!t.truncated}),x(!0),i(!1))}).catch(e=>{"AbortError"!==e.name&&(i(!1),x(!0))})},500);return()=>{clearTimeout(e)}},[t,D]);let L=(0,h.useCallback)(()=>{if(c||!p?.truncated)return;d(!0);let e=new AbortController;D(t,l.length,e.signal).then(e=>{a(t=>[...t,...e.results||[]]),g({total:e.totalFilesSearched||0,truncated:!!e.truncated}),d(!1)}).catch(()=>{d(!1)})},[t,l.length,c,p?.truncated,D]);(0,h.useEffect)(()=>()=>{E.current?.abort()},[]);let T=(0,h.useCallback)(t=>{t.target===t.currentTarget&&e()},[e]);return((0,h.useEffect)(()=>{let t=t=>{"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),e())};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e]),j)?(0,n.jsx)(S.Q,{timestamp:j.timestamp,sessionId:j.sessionId,cwd:j.cwd,onClose:()=>w(null)}):(0,n.jsx)("div",{className:"fixed inset-0 z-50 bg-black/50 flex items-center justify-center p-4",onClick:T,children:(0,n.jsxs)(y.Zp,{className:"w-full max-w-2xl flex flex-col",style:{maxHeight:"calc(100dvh - 2rem)"},children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 p-4 border-b",children:[(0,n.jsx)(N.A,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,n.jsx)("input",{ref:A,value:t,onChange:e=>s(e.target.value),placeholder:"Search all session messages...",className:"flex-1 bg-transparent outline-none text-sm"}),o&&(0,n.jsx)(b.A,{className:"h-4 w-4 animate-spin text-muted-foreground shrink-0"}),(0,n.jsx)(f.$,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:e,children:(0,n.jsx)(v.A,{className:"h-4 w-4"})})]}),(0,n.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[u&&0===l.length&&(0,n.jsx)("div",{className:"p-8 text-center text-sm text-muted-foreground",children:"No results"}),l.map((e,t)=>(0,n.jsxs)("button",{onClick:()=>w(e),className:"w-full text-left p-4 border-b last:border-b-0 hover:bg-muted/50 transition-colors cursor-pointer",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,n.jsx)(m.E,{variant:"user"===e.role?"default":"secondary",className:"text-[10px] px-1.5 py-0",children:"user"===e.role?"User":"Assistant"}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:new Date(e.timestamp).toLocaleString()}),(0,n.jsx)("div",{className:"ml-auto flex items-center gap-1",children:(0,n.jsx)(C,{text:e.fullContent})})]}),(0,n.jsxs)("div",{className:"mb-1.5 text-[11px] text-muted-foreground",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)(r.A,{className:"h-3 w-3 shrink-0"}),(0,n.jsx)("span",{className:"truncate",children:e.dirName})]}),(0,n.jsx)("div",{className:"truncate pl-[18px]",children:e.sessionName})]}),(0,n.jsx)(k,{preview:e.preview,matchStart:e.matchStart,matchLength:e.matchLength})]},`${e.messageId}-${t}`))]}),p&&u&&l.length>0&&(0,n.jsxs)("div",{className:"px-4 py-2 border-t text-[11px] text-muted-foreground flex items-center justify-between",children:[(0,n.jsxs)("span",{children:[l.length," result",1!==l.length?"s":""," across ",p.total," session",1!==p.total?"s":""]}),p.truncated&&(0,n.jsx)("button",{onClick:L,disabled:c,className:"text-[11px] text-primary hover:underline disabled:opacity-50",children:c?"Loading...":"Load more"})]})]})})}function A(){let[e,t]=(0,h.useState)(!1);return(0,h.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.shiftKey&&"f"===e.key&&(e.preventDefault(),t(!0))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{onClick:()=>t(!0),className:"w-full flex items-center gap-2 rounded-lg border bg-card px-3 py-2 text-sm text-muted-foreground hover:bg-accent/50 transition-colors",children:[(0,n.jsx)(N.A,{className:"h-4 w-4"}),(0,n.jsx)("span",{children:"Search all session messages..."}),(0,n.jsx)("kbd",{className:"ml-auto hidden sm:inline text-[10px] border rounded px-1.5 py-0.5",children:"Ctrl+Shift+F"})]}),e&&(0,n.jsx)($,{onClose:()=>t(!1)})]})}var E=s(20108);function D({session:e,onClick:t,onDelete:s}){return(0,n.jsxs)("button",{onClick:t,className:"w-full flex items-center gap-3 px-3 py-2 text-left rounded-md hover:bg-accent/50 transition-colors group",children:[(0,n.jsx)("span",{className:"text-sm truncate flex-1",children:e.name}),(0,n.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:["running"===e.status&&(0,n.jsx)(m.E,{variant:"default",className:"text-xs",children:"running"}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return"just now";let s=Math.floor(t/60);if(s<60)return`${s}m ago`;let n=Math.floor(s/60);if(n<24)return`${n}h ago`;let l=Math.floor(n/24);return l<30?`${l}d ago`:new Date(e).toLocaleDateString()}(e.lastActiveAt)}),s&&"running"!==e.status&&(0,n.jsx)("span",{role:"button",onClick:e=>{e.stopPropagation(),s(e)},className:"p-1 rounded hover:bg-destructive/10 opacity-0 group-hover:opacity-100 transition-opacity",title:"Delete session",children:(0,n.jsx)(o.A,{className:"h-3.5 w-3.5 text-muted-foreground hover:text-destructive"})})]})]})}var L=s(70518);let T=null,I="cockpit_fav_dirs";function O({group:e,isFavorite:t,onToggleFavorite:s,onSelectSession:l,onCreateSession:d,onDeleteSession:u,onDeleteAll:x}){let[f,p]=(0,h.useState)(!1),[g,j]=(0,h.useState)(null),[w,N]=(0,h.useState)(!1),b=g||e.sessions,v=b.length<e.totalSessionCount,y=b[0]?.lastActiveAt||0,S=b.filter(e=>"running"===e.status).length,k=async()=>{if(!w){N(!0);try{let t=await fetch(`/api/sessions/group?cwd=${encodeURIComponent(e.cwd)}`);if(t.ok){let e=await t.json();j(e.sessions||[])}}finally{N(!1)}}};return(0,n.jsxs)("div",{className:"rounded-lg border bg-card",children:[(0,n.jsxs)("div",{role:"button",onClick:()=>p(!f),className:"w-full flex items-center gap-2 p-3 text-left hover:bg-accent/50 rounded-lg transition-colors cursor-pointer",children:[(0,n.jsx)(a.A,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform ${f?"rotate-90":""}`}),(0,n.jsx)(r.A,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,n.jsx)("span",{className:"font-medium text-sm truncate flex-1",children:e.dirName}),(0,n.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[S>0&&(0,n.jsxs)("span",{className:"text-xs bg-primary text-primary-foreground px-1.5 py-0.5 rounded",children:[S," running"]}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return"just now";let s=Math.floor(t/60);if(s<60)return`${s}m ago`;let n=Math.floor(s/60);if(n<24)return`${n}h ago`;let l=Math.floor(n/24);return l<30?`${l}d ago`:new Date(e).toLocaleDateString()}(y)}),(0,n.jsxs)(m.E,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:[e.totalSessionCount," session",1!==e.totalSessionCount?"s":""]})]})]}),f&&(0,n.jsxs)("div",{className:"px-3 pb-3 space-y-1",children:[(0,n.jsxs)("div",{className:"flex items-center justify-end gap-1 pb-1",children:[(0,n.jsx)("button",{onClick:()=>x(e),className:"p-1 rounded hover:bg-destructive/10",title:"Delete all sessions in this folder",children:(0,n.jsx)(o.A,{className:"h-3.5 w-3.5 text-muted-foreground hover:text-destructive"})}),(0,n.jsx)("button",{onClick:()=>d(e.cwd),className:"p-1 rounded hover:bg-accent",title:"New session in this folder",children:(0,n.jsx)(i.A,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,n.jsx)("button",{onClick:()=>s(),className:"p-1 rounded hover:bg-accent",children:(0,n.jsx)(c,{className:`h-3.5 w-3.5 ${t?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`})})]}),b.map(e=>(0,n.jsx)(D,{session:e,onClick:()=>l(e),onDelete:()=>u(e)},e.id)),v&&(0,n.jsx)("button",{onClick:k,disabled:w,className:"w-full text-xs text-muted-foreground hover:text-foreground py-2 rounded hover:bg-accent/50 transition-colors disabled:opacity-50",children:w?"Loading...":`Load all ${e.totalSessionCount} sessions`})]})]})}function P(){let e=(0,x.useRouter)(),{connected:t}=(0,g.h)(),[s,l]=(0,h.useState)(T||[]),[a,r]=(0,h.useState)(new Set),[o,c]=(0,h.useState)(!1),[m,j]=(0,h.useState)(!!T),w=(0,h.useRef)(!1),[N,b]=(0,h.useState)(null),[v,y]=(0,h.useState)(!1),[S,k]=(0,h.useState)(null);(0,h.useEffect)(()=>{r(function(){try{let e=localStorage.getItem(I);if(e)return new Set(JSON.parse(e))}catch{}return new Set}())},[]);let C=(0,h.useCallback)(async()=>{let e=await fetch("/api/sessions");if(e.ok){let t=((await e.json()).groups||[]).filter(e=>!e.cwd.endsWith(".cockpit/reviews"));T=t,l(t)}j(!0)},[]);(0,h.useEffect)(()=>{w.current||(w.current=!0,C())},[C]),(0,h.useEffect)(()=>{t&&C()},[t,C]);let $=e=>{r(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),localStorage.setItem(I,JSON.stringify([...s])),s})},D=async(t,s,n)=>{let l=await fetch("/api/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:t,name:s||void 0,runtime:n})});if(l.ok){let s=await l.json();await (0,L.MN)(s.sessionId),e.push(`/sessions/${s.sessionId}?cwd=${encodeURIComponent(t)}`)}},P=t=>{e.push(`/sessions/${t.id}?cwd=${encodeURIComponent(t.cwd)}&historyView=true`)},M=async()=>{if(N){if(y(!0),"single"===N.type){let{session:e}=N;await fetch(`/api/sessions/${e.id}?cwd=${encodeURIComponent(e.cwd)}`,{method:"DELETE"})}else{let{group:e}=N,t=e.sessions;if(e.totalSessionCount>e.sessions.length){let s=await fetch(`/api/sessions/group?cwd=${encodeURIComponent(e.cwd)}`);s.ok&&(t=(await s.json()).sessions||t)}let s=t.filter(e=>"running"!==e.status).map(e=>({id:e.id,cwd:e.cwd}));s.length>0&&await fetch("/api/sessions/bulk-delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessions:s})})}b(null),y(!1),C()}},R=N?.type==="single"?"Delete Session":"Delete All Sessions",F=N?.type==="single"?"Permanently delete this session and its transcript? This cannot be undone.":(()=>{let e=N?.group;if(!e)return"";let t=e.sessions.filter(e=>"running"===e.status).length,s=e.totalSessionCount-t,n=`Permanently delete ${s} session${1!==s?"s":""} in "${e.dirName}"? This cannot be undone.`;return t>0&&(n+=` ${t} running session${1!==t?"s":""} will be skipped.`),n})(),_=s.filter(e=>a.has(e.cwd)),U=s.filter(e=>!a.has(e.cwd));return(0,n.jsxs)("div",{className:"mx-auto max-w-lg p-4 pb-24 space-y-3",children:[(0,n.jsx)("h1",{className:"text-2xl font-bold",children:"Sessions"}),(0,n.jsx)(A,{}),0===s.length&&m&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"No sessions found. Create one to get started."}),_.map(e=>(0,n.jsx)(O,{group:e,isFavorite:!0,onToggleFavorite:()=>$(e.cwd),onSelectSession:P,onCreateSession:e=>k(e),onDeleteSession:e=>b({type:"single",session:e}),onDeleteAll:e=>b({type:"bulk",group:e})},e.cwd)),_.length>0&&U.length>0&&(0,n.jsx)("div",{className:"border-t"}),U.map(e=>(0,n.jsx)(O,{group:e,isFavorite:!1,onToggleFavorite:()=>$(e.cwd),onSelectSession:P,onCreateSession:e=>k(e),onDeleteSession:e=>b({type:"single",session:e}),onDeleteAll:e=>b({type:"bulk",group:e})},e.cwd)),(0,n.jsx)("div",{className:"fixed bottom-6 right-6",children:(0,n.jsxs)(f.$,{size:"lg",className:"rounded-full shadow-lg",onClick:()=>c(!0),children:[(0,n.jsx)(i.A,{className:"h-5 w-5 mr-1"}),"New Session"]})}),(0,n.jsx)(E.t,{open:o,onOpenChange:c,onSubmit:D}),(0,n.jsx)(p.lG,{open:!!S,onOpenChange:e=>{e||k(null)},children:(0,n.jsxs)(p.Cf,{onClose:()=>k(null),children:[(0,n.jsx)(p.c7,{children:(0,n.jsx)(p.L3,{children:"Choose Backend"})}),(0,n.jsxs)("div",{className:"space-y-3 mt-2",children:[(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Pick how claude runs for this session."}),(0,n.jsx)("button",{type:"button",onClick:()=>{k(null),D(S,"","pty")},className:"w-full text-left rounded-lg border border-input bg-card px-4 py-3 transition-colors hover:border-foreground hover:bg-accent",children:(0,n.jsxs)("div",{className:"flex items-center gap-3 mb-1",children:[(0,n.jsx)(d.A,{className:"h-5 w-5 text-foreground"}),(0,n.jsxs)("div",{className:"flex-1",children:[(0,n.jsx)("div",{className:"text-sm font-medium",children:"PTY (interactive)"}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:"Pseudo-terminal"})]})]})}),(0,n.jsx)("button",{type:"button",onClick:()=>{k(null),D(S,"","stream")},className:"w-full text-left rounded-lg border border-input bg-card px-4 py-3 transition-colors hover:border-foreground hover:bg-accent",children:(0,n.jsxs)("div",{className:"flex items-center gap-3 mb-1",children:[(0,n.jsx)(u.A,{className:"h-5 w-5 text-foreground"}),(0,n.jsxs)("div",{className:"flex-1",children:[(0,n.jsx)("div",{className:"text-sm font-medium",children:"Stream (headless)"}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:"Structured output"})]})]})})]})]})}),(0,n.jsx)(p.lG,{open:!!N,onOpenChange:()=>b(null),children:(0,n.jsxs)(p.Cf,{children:[(0,n.jsx)(p.c7,{children:(0,n.jsx)(p.L3,{children:R})}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:F}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(f.$,{variant:"outline",onClick:()=>b(null),disabled:v,children:"Cancel"}),(0,n.jsx)(f.$,{variant:"destructive",onClick:M,disabled:v,children:v?"Deleting...":"Delete"})]})]})})]})}function M(){return(0,l.si)("Cockpit"),(0,n.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:(0,n.jsx)(P,{})})}}},e=>{e.O(0,[989,41487,3765,28441,93794,77358],()=>e(e.s=14683)),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[29415],{14683:(e,t,s)=>{Promise.resolve().then(s.bind(s,49524))},49524:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>M});var n=s(95155),l=s(1550),a=s(76721),r=s(14225),o=s(65738),i=s(2125);let c=(0,s(99537).A)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]);var d=s(16449),u=s(49804),x=s(73321),h=s(12115),m=s(45160),f=s(89239),p=s(42763),g=s(89323),j=s(64577),w=s(99314),N=s(65377),b=s(92571),v=s(9005),y=s(81477),S=s(16617);function k({preview:e,matchStart:t,matchLength:s}){let l=e.slice(0,t),a=e.slice(t,t+s),r=e.slice(t+s);return(0,n.jsxs)("span",{className:"text-sm text-muted-foreground whitespace-pre-wrap break-words select-text",children:[l,(0,n.jsx)("mark",{className:"bg-yellow-300/30 text-foreground rounded-sm px-0.5",children:a}),r]})}function C({text:e}){let[t,s]=(0,h.useState)(!1),l=(0,h.useCallback)(t=>{t.stopPropagation(),navigator.clipboard.writeText(e),s(!0),setTimeout(()=>s(!1),1500)},[e]);return(0,n.jsx)(f.$,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:l,title:"Copy full message",children:t?(0,n.jsx)(j.A,{className:"h-3 w-3"}):(0,n.jsx)(w.A,{className:"h-3 w-3"})})}function $({onClose:e}){let[t,s]=(0,h.useState)(""),[l,a]=(0,h.useState)([]),[o,i]=(0,h.useState)(!1),[c,d]=(0,h.useState)(!1),[u,x]=(0,h.useState)(!1),[p,g]=(0,h.useState)(null),[j,w]=(0,h.useState)(null),A=(0,h.useRef)(null),E=(0,h.useRef)(null);(0,h.useEffect)(()=>{A.current?.focus()},[]);let D=(0,h.useCallback)((e,t,s)=>fetch(`/api/sessions/search?q=${encodeURIComponent(e)}&offset=${t}`,{signal:s}).then(e=>e.json()),[]);(0,h.useEffect)(()=>{if(t.length<2){a([]),x(!1),g(null);return}let e=setTimeout(()=>{E.current?.abort();let e=new AbortController;E.current=e,i(!0),D(t,0,e.signal).then(t=>{e.signal.aborted||(a(t.results||[]),g({total:t.totalFilesSearched||0,truncated:!!t.truncated}),x(!0),i(!1))}).catch(e=>{"AbortError"!==e.name&&(i(!1),x(!0))})},500);return()=>{clearTimeout(e)}},[t,D]);let L=(0,h.useCallback)(()=>{if(c||!p?.truncated)return;d(!0);let e=new AbortController;D(t,l.length,e.signal).then(e=>{a(t=>[...t,...e.results||[]]),g({total:e.totalFilesSearched||0,truncated:!!e.truncated}),d(!1)}).catch(()=>{d(!1)})},[t,l.length,c,p?.truncated,D]);(0,h.useEffect)(()=>()=>{E.current?.abort()},[]);let T=(0,h.useCallback)(t=>{t.target===t.currentTarget&&e()},[e]);return((0,h.useEffect)(()=>{let t=t=>{"Escape"===t.key&&(t.preventDefault(),t.stopPropagation(),e())};return window.addEventListener("keydown",t,!0),()=>window.removeEventListener("keydown",t,!0)},[e]),j)?(0,n.jsx)(S.Q,{timestamp:j.timestamp,sessionId:j.sessionId,cwd:j.cwd,onClose:()=>w(null)}):(0,n.jsx)("div",{className:"fixed inset-0 z-50 bg-black/50 flex items-center justify-center p-4",onClick:T,children:(0,n.jsxs)(y.Zp,{className:"w-full max-w-2xl flex flex-col",style:{maxHeight:"calc(100dvh - 2rem)"},children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 p-4 border-b",children:[(0,n.jsx)(N.A,{className:"h-4 w-4 text-muted-foreground shrink-0"}),(0,n.jsx)("input",{ref:A,value:t,onChange:e=>s(e.target.value),placeholder:"Search all session messages...",className:"flex-1 bg-transparent outline-none text-sm"}),o&&(0,n.jsx)(b.A,{className:"h-4 w-4 animate-spin text-muted-foreground shrink-0"}),(0,n.jsx)(f.$,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:e,children:(0,n.jsx)(v.A,{className:"h-4 w-4"})})]}),(0,n.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[u&&0===l.length&&(0,n.jsx)("div",{className:"p-8 text-center text-sm text-muted-foreground",children:"No results"}),l.map((e,t)=>(0,n.jsxs)("button",{onClick:()=>w(e),className:"w-full text-left p-4 border-b last:border-b-0 hover:bg-muted/50 transition-colors cursor-pointer",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,n.jsx)(m.E,{variant:"user"===e.role?"default":"secondary",className:"text-[10px] px-1.5 py-0",children:"user"===e.role?"User":"Assistant"}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:new Date(e.timestamp).toLocaleString()}),(0,n.jsx)("div",{className:"ml-auto flex items-center gap-1",children:(0,n.jsx)(C,{text:e.fullContent})})]}),(0,n.jsxs)("div",{className:"mb-1.5 text-[11px] text-muted-foreground",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)(r.A,{className:"h-3 w-3 shrink-0"}),(0,n.jsx)("span",{className:"truncate",children:e.dirName})]}),(0,n.jsx)("div",{className:"truncate pl-[18px]",children:e.sessionName})]}),(0,n.jsx)(k,{preview:e.preview,matchStart:e.matchStart,matchLength:e.matchLength})]},`${e.messageId}-${t}`))]}),p&&u&&l.length>0&&(0,n.jsxs)("div",{className:"px-4 py-2 border-t text-[11px] text-muted-foreground flex items-center justify-between",children:[(0,n.jsxs)("span",{children:[l.length," result",1!==l.length?"s":""," across ",p.total," session",1!==p.total?"s":""]}),p.truncated&&(0,n.jsx)("button",{onClick:L,disabled:c,className:"text-[11px] text-primary hover:underline disabled:opacity-50",children:c?"Loading...":"Load more"})]})]})})}function A(){let[e,t]=(0,h.useState)(!1);return(0,h.useEffect)(()=>{let e=e=>{(e.metaKey||e.ctrlKey)&&e.shiftKey&&"f"===e.key&&(e.preventDefault(),t(!0))};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("button",{onClick:()=>t(!0),className:"w-full flex items-center gap-2 rounded-lg border bg-card px-3 py-2 text-sm text-muted-foreground hover:bg-accent/50 transition-colors",children:[(0,n.jsx)(N.A,{className:"h-4 w-4"}),(0,n.jsx)("span",{children:"Search all session messages..."}),(0,n.jsx)("kbd",{className:"ml-auto hidden sm:inline text-[10px] border rounded px-1.5 py-0.5",children:"Ctrl+Shift+F"})]}),e&&(0,n.jsx)($,{onClose:()=>t(!1)})]})}var E=s(20108);function D({session:e,onClick:t,onDelete:s}){return(0,n.jsxs)("button",{onClick:t,className:"w-full flex items-center gap-3 px-3 py-2 text-left rounded-md hover:bg-accent/50 transition-colors group",children:[(0,n.jsx)("span",{className:"text-sm truncate flex-1",children:e.name}),(0,n.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:["running"===e.status&&(0,n.jsx)(m.E,{variant:"default",className:"text-xs",children:"running"}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return"just now";let s=Math.floor(t/60);if(s<60)return`${s}m ago`;let n=Math.floor(s/60);if(n<24)return`${n}h ago`;let l=Math.floor(n/24);return l<30?`${l}d ago`:new Date(e).toLocaleDateString()}(e.lastActiveAt)}),s&&"running"!==e.status&&(0,n.jsx)("span",{role:"button",onClick:e=>{e.stopPropagation(),s(e)},className:"p-1 rounded hover:bg-destructive/10 opacity-0 group-hover:opacity-100 transition-opacity",title:"Delete session",children:(0,n.jsx)(o.A,{className:"h-3.5 w-3.5 text-muted-foreground hover:text-destructive"})})]})]})}var L=s(23965);let T=null,I="cockpit_fav_dirs";function O({group:e,isFavorite:t,onToggleFavorite:s,onSelectSession:l,onCreateSession:d,onDeleteSession:u,onDeleteAll:x}){let[f,p]=(0,h.useState)(!1),[g,j]=(0,h.useState)(null),[w,N]=(0,h.useState)(!1),b=g||e.sessions,v=b.length<e.totalSessionCount,y=b[0]?.lastActiveAt||0,S=b.filter(e=>"running"===e.status).length,k=async()=>{if(!w){N(!0);try{let t=await fetch(`/api/sessions/group?cwd=${encodeURIComponent(e.cwd)}`);if(t.ok){let e=await t.json();j(e.sessions||[])}}finally{N(!1)}}};return(0,n.jsxs)("div",{className:"rounded-lg border bg-card",children:[(0,n.jsxs)("div",{role:"button",onClick:()=>p(!f),className:"w-full flex items-center gap-2 p-3 text-left hover:bg-accent/50 rounded-lg transition-colors cursor-pointer",children:[(0,n.jsx)(a.A,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform ${f?"rotate-90":""}`}),(0,n.jsx)(r.A,{className:"h-4 w-4 shrink-0 text-muted-foreground"}),(0,n.jsx)("span",{className:"font-medium text-sm truncate flex-1",children:e.dirName}),(0,n.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[S>0&&(0,n.jsxs)("span",{className:"text-xs bg-primary text-primary-foreground px-1.5 py-0.5 rounded",children:[S," running"]}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:function(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return"just now";let s=Math.floor(t/60);if(s<60)return`${s}m ago`;let n=Math.floor(s/60);if(n<24)return`${n}h ago`;let l=Math.floor(n/24);return l<30?`${l}d ago`:new Date(e).toLocaleDateString()}(y)}),(0,n.jsxs)(m.E,{variant:"secondary",className:"text-[10px] px-1.5 py-0",children:[e.totalSessionCount," session",1!==e.totalSessionCount?"s":""]})]})]}),f&&(0,n.jsxs)("div",{className:"px-3 pb-3 space-y-1",children:[(0,n.jsxs)("div",{className:"flex items-center justify-end gap-1 pb-1",children:[(0,n.jsx)("button",{onClick:()=>x(e),className:"p-1 rounded hover:bg-destructive/10",title:"Delete all sessions in this folder",children:(0,n.jsx)(o.A,{className:"h-3.5 w-3.5 text-muted-foreground hover:text-destructive"})}),(0,n.jsx)("button",{onClick:()=>d(e.cwd),className:"p-1 rounded hover:bg-accent",title:"New session in this folder",children:(0,n.jsx)(i.A,{className:"h-3.5 w-3.5 text-muted-foreground"})}),(0,n.jsx)("button",{onClick:()=>s(),className:"p-1 rounded hover:bg-accent",children:(0,n.jsx)(c,{className:`h-3.5 w-3.5 ${t?"fill-yellow-400 text-yellow-400":"text-muted-foreground"}`})})]}),b.map(e=>(0,n.jsx)(D,{session:e,onClick:()=>l(e),onDelete:()=>u(e)},e.id)),v&&(0,n.jsx)("button",{onClick:k,disabled:w,className:"w-full text-xs text-muted-foreground hover:text-foreground py-2 rounded hover:bg-accent/50 transition-colors disabled:opacity-50",children:w?"Loading...":`Load all ${e.totalSessionCount} sessions`})]})]})}function P(){let e=(0,x.useRouter)(),{connected:t}=(0,g.h)(),[s,l]=(0,h.useState)(T||[]),[a,r]=(0,h.useState)(new Set),[o,c]=(0,h.useState)(!1),[m,j]=(0,h.useState)(!!T),w=(0,h.useRef)(!1),[N,b]=(0,h.useState)(null),[v,y]=(0,h.useState)(!1),[S,k]=(0,h.useState)(null);(0,h.useEffect)(()=>{r(function(){try{let e=localStorage.getItem(I);if(e)return new Set(JSON.parse(e))}catch{}return new Set}())},[]);let C=(0,h.useCallback)(async()=>{let e=await fetch("/api/sessions");if(e.ok){let t=((await e.json()).groups||[]).filter(e=>!e.cwd.endsWith(".cockpit/reviews"));T=t,l(t)}j(!0)},[]);(0,h.useEffect)(()=>{w.current||(w.current=!0,C())},[C]),(0,h.useEffect)(()=>{t&&C()},[t,C]);let $=e=>{r(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),localStorage.setItem(I,JSON.stringify([...s])),s})},D=async(t,s,n)=>{let l=await fetch("/api/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:t,name:s||void 0,runtime:n})});if(l.ok){let s=await l.json();await (0,L.MN)(s.sessionId),e.push(`/sessions/${s.sessionId}?cwd=${encodeURIComponent(t)}`)}},P=t=>{e.push(`/sessions/${t.id}?cwd=${encodeURIComponent(t.cwd)}&historyView=true`)},M=async()=>{if(N){if(y(!0),"single"===N.type){let{session:e}=N;await fetch(`/api/sessions/${e.id}?cwd=${encodeURIComponent(e.cwd)}`,{method:"DELETE"})}else{let{group:e}=N,t=e.sessions;if(e.totalSessionCount>e.sessions.length){let s=await fetch(`/api/sessions/group?cwd=${encodeURIComponent(e.cwd)}`);s.ok&&(t=(await s.json()).sessions||t)}let s=t.filter(e=>"running"!==e.status).map(e=>({id:e.id,cwd:e.cwd}));s.length>0&&await fetch("/api/sessions/bulk-delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessions:s})})}b(null),y(!1),C()}},R=N?.type==="single"?"Delete Session":"Delete All Sessions",F=N?.type==="single"?"Permanently delete this session and its transcript? This cannot be undone.":(()=>{let e=N?.group;if(!e)return"";let t=e.sessions.filter(e=>"running"===e.status).length,s=e.totalSessionCount-t,n=`Permanently delete ${s} session${1!==s?"s":""} in "${e.dirName}"? This cannot be undone.`;return t>0&&(n+=` ${t} running session${1!==t?"s":""} will be skipped.`),n})(),_=s.filter(e=>a.has(e.cwd)),U=s.filter(e=>!a.has(e.cwd));return(0,n.jsxs)("div",{className:"p-4 pb-24 space-y-3",children:[(0,n.jsx)("h1",{className:"text-2xl font-bold",children:"Sessions"}),(0,n.jsx)(A,{}),0===s.length&&m&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"No sessions found. Create one to get started."}),_.map(e=>(0,n.jsx)(O,{group:e,isFavorite:!0,onToggleFavorite:()=>$(e.cwd),onSelectSession:P,onCreateSession:e=>k(e),onDeleteSession:e=>b({type:"single",session:e}),onDeleteAll:e=>b({type:"bulk",group:e})},e.cwd)),_.length>0&&U.length>0&&(0,n.jsx)("div",{className:"border-t"}),U.map(e=>(0,n.jsx)(O,{group:e,isFavorite:!1,onToggleFavorite:()=>$(e.cwd),onSelectSession:P,onCreateSession:e=>k(e),onDeleteSession:e=>b({type:"single",session:e}),onDeleteAll:e=>b({type:"bulk",group:e})},e.cwd)),(0,n.jsx)("div",{className:"fixed bottom-6 right-6",children:(0,n.jsxs)(f.$,{size:"lg",className:"rounded-full shadow-lg",onClick:()=>c(!0),children:[(0,n.jsx)(i.A,{className:"h-5 w-5 mr-1"}),"New Session"]})}),(0,n.jsx)(E.t,{open:o,onOpenChange:c,onSubmit:D}),(0,n.jsx)(p.lG,{open:!!S,onOpenChange:e=>{e||k(null)},children:(0,n.jsxs)(p.Cf,{onClose:()=>k(null),children:[(0,n.jsx)(p.c7,{children:(0,n.jsx)(p.L3,{children:"Choose Backend"})}),(0,n.jsxs)("div",{className:"space-y-3 mt-2",children:[(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Pick how claude runs for this session."}),(0,n.jsx)("button",{type:"button",onClick:()=>{k(null),D(S,"","pty")},className:"w-full text-left rounded-lg border border-input bg-card px-4 py-3 transition-colors hover:border-foreground hover:bg-accent",children:(0,n.jsxs)("div",{className:"flex items-center gap-3 mb-1",children:[(0,n.jsx)(d.A,{className:"h-5 w-5 text-foreground"}),(0,n.jsxs)("div",{className:"flex-1",children:[(0,n.jsx)("div",{className:"text-sm font-medium",children:"PTY (interactive)"}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:"Pseudo-terminal"})]})]})}),(0,n.jsx)("button",{type:"button",onClick:()=>{k(null),D(S,"","stream")},className:"w-full text-left rounded-lg border border-input bg-card px-4 py-3 transition-colors hover:border-foreground hover:bg-accent",children:(0,n.jsxs)("div",{className:"flex items-center gap-3 mb-1",children:[(0,n.jsx)(u.A,{className:"h-5 w-5 text-foreground"}),(0,n.jsxs)("div",{className:"flex-1",children:[(0,n.jsx)("div",{className:"text-sm font-medium",children:"Stream (headless)"}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:"Structured output"})]})]})})]})]})}),(0,n.jsx)(p.lG,{open:!!N,onOpenChange:()=>b(null),children:(0,n.jsxs)(p.Cf,{children:[(0,n.jsx)(p.c7,{children:(0,n.jsx)(p.L3,{children:R})}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:F}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(f.$,{variant:"outline",onClick:()=>b(null),disabled:v,children:"Cancel"}),(0,n.jsx)(f.$,{variant:"destructive",onClick:M,disabled:v,children:v?"Deleting...":"Delete"})]})]})})]})}function M(){return(0,l.si)("Cockpit",{usageOnly:!0}),(0,n.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:(0,n.jsx)(P,{})})}}},e=>{e.O(0,[989,25781,1550,28441,93794,77358],()=>e(e.s=14683)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[13472],{48792:(e,s,t)=>{Promise.resolve().then(t.bind(t,66747))},66747:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>N});var n=t(95155),a=t(82749),l=t(92571),i=t(31966),r=t(76721),c=t(73321),o=t(12115),d=t(1550),u=t(45160),m=t(89239),x=t(81477),p=t(42763),h=t(60529);async function j(e,s){try{let t=await fetch(e,s);if(t.ok)return{ok:!0};let n=await t.json().catch(()=>({}));return{ok:!1,error:n.error||`Request failed (${t.status})`}}catch{return{ok:!1,error:"Request failed"}}}let f="__add__",g="__all__";function N(){(0,d.si)("Plugins",{hideActions:!0});let e=(0,c.useRouter)(),s=(0,c.useSearchParams)(),t=s.get("detail"),l=s.get("mkt"),{installed:i,available:r,marketplaces:u,loading:p,error:h,refresh:N,install:k,setEnabled:w,uninstall:C,update:I,addMarketplace:U,removeMarketplace:A,updateMarketplace:E}=function(){let[e,s]=(0,o.useState)([]),[t,n]=(0,o.useState)([]),[a,l]=(0,o.useState)([]),[i,r]=(0,o.useState)(!0),[c,d]=(0,o.useState)(null),u=(0,o.useCallback)(()=>{r(!0),d(null),fetch("/api/plugins").then(async e=>{let s=await e.json();if(!e.ok)throw Error(s.error||"Failed to load plugins");return s}).then(e=>{s(e.installed??[]),n(e.available??[]),l(e.marketplaces??[])}).catch(e=>d(e instanceof Error?e.message:"Failed to load plugins")).finally(()=>r(!1))},[]);(0,o.useEffect)(()=>{u()},[u]);let m=(0,o.useCallback)(async(e,s,t)=>{let n=await j(`/api/plugins/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:s?"enable":"disable",scope:t})});return n.ok&&u(),n},[u]),x=(0,o.useCallback)(async(e,s)=>{let t=new URLSearchParams;s&&t.set("scope",s);let n=await j(`/api/plugins/${encodeURIComponent(e)}?${t}`,{method:"DELETE"});return n.ok&&u(),n},[u]),p=(0,o.useCallback)(async e=>{let s=await j(`/api/plugins/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update"})});return s.ok&&u(),s},[u]),h=(0,o.useCallback)(async(e,s="user")=>{let t=await j("/api/plugins/install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({plugin:e,scope:s})});return t.ok&&u(),t},[u]),f=(0,o.useCallback)(async e=>{let s=await j("/api/plugins/marketplaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"add",source:e})});return s.ok&&u(),s},[u]),g=(0,o.useCallback)(async e=>{let s=await j(`/api/plugins/marketplaces/${encodeURIComponent(e)}`,{method:"DELETE"});return s.ok&&u(),s},[u]),N=(0,o.useCallback)(async e=>{let s=e?await j(`/api/plugins/marketplaces/${encodeURIComponent(e)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update"})}):await j("/api/plugins/marketplaces",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"update"})});return s.ok&&u(),s},[u]);return{installed:e,available:t,marketplaces:a,loading:i,error:c,refresh:u,setEnabled:m,uninstall:x,update:p,install:h,addMarketplace:f,removeMarketplace:g,updateMarketplace:N}}(),O=t?i.find(e=>e.id===t)??null:null,T=l?u.find(e=>e.name===l)??null:null,[L,P]=(0,o.useState)("installed"),[_,F]=(0,o.useState)(null),[Z,D]=(0,o.useState)(null),[z,B]=(0,o.useState)(null),W=(0,o.useMemo)(()=>new Set(i.map(e=>e.id)),[i]);async function J(e){F(e),D(null);let s=await k(e,"user");s.ok||D(s.error??"Failed to install plugin"),F(null)}async function M(e){B(f),D(null);let s=await U(e);return s.ok||D(s.error??"Failed to add marketplace"),B(null),s.ok}async function G(e){B(e??g),D(null);let s=await E(e);s.ok||D(s.error??"Failed to update marketplace"),B(null)}return t?(0,n.jsx)(v,{plugin:O,onBack:()=>e.push("/plugins"),onSetEnabled:async(e,s,t)=>{let n=await w(e,s,t);return n.ok&&N(),n},onUninstall:async(e,s)=>await C(e,s),onUpdate:async e=>{let s=await I(e);return s.ok&&N(),s}}):l?(0,n.jsx)($,{marketplace:T,onBack:()=>e.push("/plugins"),onUpdate:async e=>{await E(e),N()},onRemove:async e=>{await A(e),N()}}):(0,n.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center gap-1",children:[(0,n.jsx)(b,{active:"installed"===L,onClick:()=>P("installed"),label:"Installed",count:i.length}),(0,n.jsx)(b,{active:"browse"===L,onClick:()=>P("browse"),label:"Browse",count:r.length}),(0,n.jsx)(b,{active:"marketplaces"===L,onClick:()=>P("marketplaces"),label:"Marketplaces",count:u.length})]}),(0,n.jsx)(m.$,{size:"sm",variant:"ghost",onClick:N,disabled:p,title:"Refresh",children:(0,n.jsx)(a.A,{className:`h-4 w-4 ${p?"animate-spin":""}`})})]}),h&&(0,n.jsx)("div",{className:"rounded border border-red-500/30 bg-red-500/5 p-3 text-sm text-red-500",children:h}),Z&&(0,n.jsx)("div",{className:"rounded border border-red-500/30 bg-red-500/5 p-3 text-sm text-red-500",children:Z}),p&&0===i.length&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading plugins..."}),"installed"===L&&!p&&(0,n.jsx)(x.Zp,{children:(0,n.jsx)(x.Wu,{className:"space-y-1 pt-4",children:0===i.length?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"No plugins installed. Browse a marketplace to add one."}):i.map(e=>(0,n.jsx)(S,{plugin:e},e.id))})}),"browse"===L&&!p&&(0,n.jsx)(y,{available:r,installedIds:W,busyId:_,onInstall:J}),"marketplaces"===L&&!p&&(0,n.jsx)(R,{marketplaces:u,busy:z,onAdd:M,onUpdate:G})]})}function b({active:e,onClick:s,label:t,count:a}){return(0,n.jsxs)("button",{type:"button",onClick:s,className:`rounded-md px-3 py-1.5 text-sm transition-colors ${e?"bg-muted font-medium":"text-muted-foreground hover:text-foreground"}`,children:[t,(0,n.jsx)("span",{className:"ml-1.5 text-xs text-muted-foreground",children:a})]})}function y({available:e,installedIds:s,busyId:t,onInstall:a}){let[i,r]=(0,o.useState)(""),[c,d]=(0,o.useState)(null),j=i.trim().toLowerCase(),f=j?e.filter(e=>e.name.toLowerCase().includes(j)||(e.description?.toLowerCase().includes(j)??!1)):e,g=f.slice(0,100);return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)(h.p,{placeholder:"Search plugins...",value:i,onChange:e=>r(e.target.value)}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"Installs to user scope."}),0===f.length?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"No plugins match your search."}):(0,n.jsx)(x.Zp,{children:(0,n.jsx)(x.Wu,{className:"space-y-1 pt-4",children:g.map(e=>(0,n.jsx)(k,{plugin:e,installed:s.has(e.pluginId),busy:t===e.pluginId,onInstall:()=>a(e.pluginId),onClick:()=>d(e)},e.pluginId))})}),f.length>g.length&&(0,n.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Showing ",g.length," of ",f.length,". Refine your search to narrow the list."]}),(0,n.jsx)(p.lG,{open:!!c,onOpenChange:()=>d(null),children:(0,n.jsx)(p.Cf,{children:c&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(p.c7,{children:(0,n.jsx)(p.L3,{className:"font-mono font-bold",children:c.name})}),(0,n.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["@",c.marketplaceName]}),"number"==typeof c.installCount&&(0,n.jsxs)(u.E,{variant:"secondary",className:"text-[10px]",children:[c.installCount," installs"]})]}),c.description?(0,n.jsx)("p",{className:"text-sm whitespace-pre-wrap",children:c.description}):(0,n.jsx)("p",{className:"text-sm text-muted-foreground italic",children:"No description available."}),(0,n.jsx)("div",{className:"flex justify-end pt-2",children:s.has(c.pluginId)?(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:"Already installed"}):(0,n.jsx)(m.$,{size:"sm",variant:"default",onClick:()=>{a(c.pluginId),d(null)},disabled:t===c.pluginId,children:t===c.pluginId?(0,n.jsx)(l.A,{className:"h-4 w-4 animate-spin"}):"Install"})})]})]})})})]})}function k({plugin:e,installed:s,busy:t,onInstall:a,onClick:i}){let{name:r,marketplace:c}=C(e.pluginId);return(0,n.jsxs)("div",{className:"flex items-center gap-3 rounded px-2 py-2 hover:bg-muted transition-colors",children:[(0,n.jsxs)("button",{type:"button",onClick:i,className:"flex-1 min-w-0 text-left",children:[(0,n.jsx)("span",{className:"block font-mono font-bold text-sm truncate",children:r}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 mt-0.5",children:[c&&(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["@",c]}),"number"==typeof e.installCount&&(0,n.jsxs)(u.E,{variant:"secondary",className:"text-[10px]",children:[e.installCount," installs"]})]}),e.description&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:e.description})]}),(0,n.jsx)("div",{className:"shrink-0",children:s?(0,n.jsx)("span",{className:"px-2 text-xs text-muted-foreground",children:"Installed"}):(0,n.jsx)(m.$,{size:"sm",variant:"outline",onClick:a,disabled:t,children:t?(0,n.jsx)(l.A,{className:"h-3.5 w-3.5 animate-spin"}):"Install"})})]})}function v({plugin:e,onBack:s,onSetEnabled:t,onUninstall:a,onUpdate:i}){let[r,c]=(0,o.useState)(null),[d,h]=(0,o.useState)(null),[j,f]=(0,o.useState)(!1);if(!e)return(0,n.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,n.jsx)(w,{onClick:s}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Plugin not found."})]});let{name:g,marketplace:N}=C(e.id),b=e.mcpServers?Object.keys(e.mcpServers):[];async function y(s){c("toggle"),h(null);let n=await t(e.id,s,e.scope);n.ok||h(n.error??"Failed to update plugin"),c(null)}async function k(){c("update"),h(null);let s=await i(e.id);s.ok||h(s.error??"Failed to update plugin"),c(null)}async function S(){f(!1),c("uninstall"),h(null);let t=await a(e.id,e.scope);t.ok?s():(h(t.error??"Failed to uninstall plugin"),c(null))}return(0,n.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-6",children:[(0,n.jsx)(w,{onClick:s}),(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"font-mono font-bold text-lg",children:g}),N&&(0,n.jsxs)("p",{className:"text-sm text-muted-foreground",children:["@",N]})]}),d&&(0,n.jsx)("div",{className:"rounded border border-red-500/30 bg-red-500/5 p-3 text-sm text-red-500",children:d}),(0,n.jsxs)(x.Zp,{children:[(0,n.jsx)(x.aR,{children:(0,n.jsx)(x.ZB,{className:"text-sm",children:"Details"})}),(0,n.jsxs)(x.Wu,{className:"space-y-3 text-sm",children:[(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Version"}),(0,n.jsx)("span",{className:"font-mono",children:e.version})]}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Scope"}),(0,n.jsx)(u.E,{variant:"secondary",className:"text-[10px]",children:e.scope})]}),(0,n.jsxs)("div",{className:"flex justify-between items-center",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Status"}),(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("span",{className:`inline-block h-2 w-2 rounded-full ${e.enabled?"bg-green-500":"bg-muted-foreground/40"}`}),e.enabled?"Enabled":"Disabled"]})]}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Install path"}),(0,n.jsx)("span",{className:"font-mono text-xs truncate ml-4 max-w-[60%] text-right",title:e.installPath,children:e.installPath})]}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Installed at"}),(0,n.jsx)("span",{children:I(e.installedAt)})]}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Last updated"}),(0,n.jsx)("span",{children:I(e.lastUpdated)})]}),(0,n.jsxs)("div",{className:"flex justify-between",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"MCP servers"}),(0,n.jsx)("span",{className:"text-right max-w-[60%] truncate",title:b.join(", "),children:b.length>0?b.join(", "):"None"})]})]})]}),(0,n.jsxs)(x.Zp,{children:[(0,n.jsx)(x.aR,{children:(0,n.jsx)(x.ZB,{className:"text-sm",children:"Actions"})}),(0,n.jsxs)(x.Wu,{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("span",{className:"text-sm",children:"Update from marketplace source"}),(0,n.jsx)(m.$,{size:"sm",variant:"outline",onClick:k,disabled:null!==r,children:"update"===r?(0,n.jsx)(l.A,{className:"h-4 w-4 animate-spin"}):"Update"})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("span",{className:"text-sm",children:[e.enabled?"Disable":"Enable"," plugin"]}),(0,n.jsx)(m.$,{size:"sm",variant:e.enabled?"outline":"default",onClick:()=>y(!e.enabled),disabled:null!==r,children:"toggle"===r?(0,n.jsx)(l.A,{className:"h-4 w-4 animate-spin"}):e.enabled?"Disable":"Enable"})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("span",{className:"text-sm",children:"Remove from disk"}),(0,n.jsx)(m.$,{size:"sm",variant:"destructive",onClick:()=>f(!0),disabled:null!==r,children:"uninstall"===r?(0,n.jsx)(l.A,{className:"h-4 w-4 animate-spin"}):"Uninstall"})]})]})]}),(0,n.jsx)(p.lG,{open:j,onOpenChange:f,children:(0,n.jsxs)(p.Cf,{children:[(0,n.jsx)(p.c7,{children:(0,n.jsx)(p.L3,{children:"Uninstall Plugin"})}),(0,n.jsxs)("p",{className:"text-sm text-muted-foreground mb-4",children:["Uninstall ",(0,n.jsx)("span",{className:"font-mono font-bold",children:e.id}),"? This removes it from disk."]}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(m.$,{variant:"outline",onClick:()=>f(!1),children:"Cancel"}),(0,n.jsx)(m.$,{variant:"destructive",onClick:S,children:"Uninstall"})]})]})})]})}function w({onClick:e}){return(0,n.jsxs)("button",{type:"button",onClick:e,className:"inline-flex items-center gap-1 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[(0,n.jsx)(i.A,{className:"h-4 w-4"}),"Back to Installed"]})}function C(e){let s=e.lastIndexOf("@");return s>0?{name:e.slice(0,s),marketplace:e.slice(s+1)}:{name:e,marketplace:""}}function S({plugin:e}){let{name:s,marketplace:t}=C(e.id),a=(0,c.useRouter)();return(0,n.jsxs)("button",{type:"button",onClick:()=>a.push(`/plugins?detail=${encodeURIComponent(e.id)}`),className:"flex w-full items-center gap-3 rounded px-2 py-2 hover:bg-muted transition-colors text-left",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("span",{className:"block font-mono font-bold text-sm truncate",children:s}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5 mt-0.5",children:[t&&(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["@",t]}),(0,n.jsxs)(u.E,{variant:"secondary",className:"text-[10px]",children:["v",e.version]}),(0,n.jsx)(u.E,{variant:"secondary",className:"text-[10px]",children:e.scope}),(0,n.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${e.enabled?"bg-green-500":"bg-muted-foreground/40"}`})]})]}),(0,n.jsx)(r.A,{className:"h-4 w-4 text-muted-foreground shrink-0"})]})}function I(e){if(!e)return"Unknown";let s=new Date(e);return Number.isNaN(s.getTime())?"Unknown":s.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function R({marketplaces:e,busy:s,onAdd:t,onUpdate:a}){let[i,r]=(0,o.useState)(""),d=(0,c.useRouter)(),u=null!==s;async function p(){let e=i.trim();!e||await t(e)&&r("")}return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(h.p,{placeholder:"owner/repo, URL, or local path",value:i,onChange:e=>r(e.target.value),onKeyDown:e=>{"Enter"===e.key&&p()}}),(0,n.jsx)(m.$,{onClick:p,disabled:u||!i.trim(),children:s===f?(0,n.jsx)(l.A,{className:"h-4 w-4 animate-spin"}):"Add"})]}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:"Add a GitHub repo, URL, or local path. Adds at user scope."}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("span",{className:"text-sm text-muted-foreground",children:[e.length," configured"]}),(0,n.jsx)(m.$,{size:"sm",variant:"outline",onClick:()=>a(),disabled:u||0===e.length,children:s===g?(0,n.jsx)(l.A,{className:"h-3.5 w-3.5 animate-spin"}):"Update all"})]}),0===e.length?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"No marketplaces configured. Add one above to browse its plugins."}):(0,n.jsx)(x.Zp,{children:(0,n.jsx)(x.Wu,{className:"space-y-1 pt-4",children:e.map(e=>(0,n.jsx)(A,{marketplace:e,disabled:u,onClick:()=>d.push(`/plugins?mkt=${encodeURIComponent(e.name)}`)},e.name))})})]})}function $({marketplace:e,onBack:s,onUpdate:t,onRemove:a}){let[i,r]=(0,o.useState)(null),[c,d]=(0,o.useState)(null),[u,h]=(0,o.useState)(!1);if(!e)return(0,n.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,n.jsx)(w,{onClick:s}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Marketplace not found."})]});async function j(){r("update"),d(null);try{await t(e.name)}catch{d("Failed to update marketplace")}r(null)}async function f(){h(!1),r("remove"),d(null);try{await a(e.name),s()}catch{d("Failed to remove marketplace"),r(null)}}return(0,n.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-6",children:[(0,n.jsx)(w,{onClick:s}),(0,n.jsx)("div",{children:(0,n.jsx)("h1",{className:"font-mono font-bold text-lg",children:e.name})}),c&&(0,n.jsx)("div",{className:"rounded border border-red-500/30 bg-red-500/5 p-3 text-sm text-red-500",children:c}),(0,n.jsxs)(x.Zp,{children:[(0,n.jsx)(x.aR,{children:(0,n.jsx)(x.ZB,{className:"text-sm",children:"Details"})}),(0,n.jsxs)(x.Wu,{className:"space-y-3 text-sm",children:[(0,n.jsx)(U,{label:"Source",value:e.source,mono:!0}),e.repo&&(0,n.jsx)(U,{label:"Repo",value:e.repo,mono:!0}),(0,n.jsx)(U,{label:"Install location",value:e.installLocation,mono:!0})]})]}),(0,n.jsxs)(x.Zp,{children:[(0,n.jsx)(x.aR,{children:(0,n.jsx)(x.ZB,{className:"text-sm",children:"Actions"})}),(0,n.jsxs)(x.Wu,{className:"space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("span",{className:"text-sm",children:"Update from marketplace source"}),(0,n.jsx)(m.$,{size:"sm",variant:"outline",onClick:j,disabled:null!==i,children:"update"===i?(0,n.jsx)(l.A,{className:"h-4 w-4 animate-spin"}):"Update"})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("span",{className:"text-sm",children:"Remove marketplace configuration"}),(0,n.jsx)(m.$,{size:"sm",variant:"destructive",onClick:()=>h(!0),disabled:null!==i,children:"remove"===i?(0,n.jsx)(l.A,{className:"h-4 w-4 animate-spin"}):"Remove"})]})]})]}),(0,n.jsx)(p.lG,{open:u,onOpenChange:h,children:(0,n.jsxs)(p.Cf,{children:[(0,n.jsx)(p.c7,{children:(0,n.jsx)(p.L3,{children:"Remove Marketplace"})}),(0,n.jsxs)("p",{className:"text-sm text-muted-foreground mb-4",children:["Remove ",(0,n.jsx)("span",{className:"font-mono font-bold",children:e.name}),"? This removes the marketplace from your configuration."]}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(m.$,{variant:"outline",onClick:()=>h(!1),children:"Cancel"}),(0,n.jsx)(m.$,{variant:"destructive",onClick:f,children:"Remove"})]})]})})]})}function U({label:e,value:s,mono:t}){return(0,n.jsxs)("div",{className:"flex justify-between gap-2",children:[(0,n.jsx)("span",{className:"text-muted-foreground shrink-0",children:e}),(0,n.jsx)("span",{className:`text-right break-all max-w-[70%] ${t?"font-mono text-xs":""}`,children:s})]})}function A({marketplace:e,disabled:s,onClick:t}){return(0,n.jsxs)("button",{type:"button",onClick:t,disabled:s,className:"flex w-full items-center gap-3 rounded px-2 py-2 hover:bg-muted transition-colors text-left disabled:opacity-50",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("span",{className:"font-mono font-bold text-sm truncate",children:e.name}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground truncate mt-0.5",children:e.source})]}),(0,n.jsx)(r.A,{className:"h-4 w-4 text-muted-foreground shrink-0"})]})}}},e=>{e.O(0,[989,25781,1550,28441,93794,77358],()=>e(e.s=48792)),_N_E=e.O()}]);
|
package/.next/static/chunks/app/(app)/reviews/[owner]/[repo]/[number]/page-4396e9d6df189336.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44468],{11701:(e,t,s)=>{"use strict";s.d(t,{G:()=>a});var n=s(12115);let r="(min-width: 768px)";function a(){let[e,t]=(0,n.useState)(()=>window.matchMedia(r).matches);return(0,n.useEffect)(()=>{let e=window.matchMedia(r),s=e=>t(e.matches);return e.addEventListener("change",s),()=>e.removeEventListener("change",s)},[]),e}},20660:(e,t,s)=>{"use strict";s.d(t,{Q:()=>i});var n=s(26210),r=s(82627),a=s(70569),l=s(33735),o=s(95155);function i({fileDiff:e,options:t,metrics:s,lineAnnotations:c,selectedLines:d,className:h,style:u,prerenderedHTML:p,renderAnnotation:x,renderCustomHeader:m,renderHeaderPrefix:f,renderHeaderMetadata:g,renderGutterUtility:j,disableWorkerPool:b=!1}){let{ref:N,getHoveredLine:v}=(0,l.S)({fileDiff:e,options:t,metrics:s,lineAnnotations:c,selectedLines:d,prerenderedHTML:p,hasGutterRenderUtility:null!=j,hasCustomHeader:null!=m,disableWorkerPool:b});return(0,o.jsx)(n.mZ,{ref:N,className:h,style:u,children:(0,a.$)((0,r.z)({fileDiff:e,renderCustomHeader:m,renderHeaderPrefix:f,renderHeaderMetadata:g,renderAnnotation:x,renderGutterUtility:j,lineAnnotations:c,getHoveredLine:v}),p)})}},43996:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>Q});var n=s(95155),r=s(12115),a=s(69226),l=s(20660),o=s(89811),i=s(797),c=s(44354),d=s(83212),h=s(94088),u=s(12363),p=s(64577),x=s(92571),m=s(1275),f=s(31966),g=s(15480),j=s(99537);let b=(0,j.A)("circle-check-big",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);var N=s(94890);let v=(0,j.A)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]]);var w=s(19707),y=s(58309),k=s(90710),S=s(73321),C=s(1550),$=s(59184),A=s(57594),R=s(23965),E=s(89239),I=s(11701),L=s(22317),P=s(40980);function z(e,t){let s=t.find(t=>t.path===e);return s?0===s.deletions&&s.additions>0?(0,n.jsx)(c.A,{className:"h-3.5 w-3.5 text-green-500 shrink-0"}):0===s.additions&&s.deletions>0?(0,n.jsx)(d.A,{className:"h-3.5 w-3.5 text-red-500 shrink-0"}):(0,n.jsx)(i.A,{className:"h-3.5 w-3.5 text-yellow-500 shrink-0"}):(0,n.jsx)(i.A,{className:"h-3.5 w-3.5 text-yellow-500 shrink-0"})}function M({body:e,open:t,onToggle:s}){let[a,l]=(0,r.useState)(!1),o=e.split("\n"),i=o.length>10,c=!a&&i?o.slice(0,10).join("\n"):e;return(0,n.jsxs)("div",{className:"border-b",children:[(0,n.jsxs)("button",{onClick:s,className:"flex items-center gap-2 w-full px-4 py-2 text-sm text-muted-foreground hover:text-foreground transition-colors",children:[t?(0,n.jsx)(h.A,{className:"h-3.5 w-3.5"}):(0,n.jsx)(u.A,{className:"h-3.5 w-3.5"}),"Description"]}),t&&(0,n.jsxs)("div",{className:"px-4 pb-3",children:[(0,n.jsx)("div",{className:(0,P.cn)("text-sm prose prose-sm dark:prose-invert max-w-none whitespace-pre-wrap",!a&&i&&"line-clamp-[10]"),children:c}),i&&(0,n.jsx)("button",{onClick:()=>l(e=>!e),className:"mt-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:a?"Show less":`Show more (${o.length} lines)`})]})]})}let D=new Set(["png","jpg","jpeg","gif","bmp","ico","webp","avif","woff","woff2","ttf","eot","otf","zip","gz","tar","bz2","7z","rar","pdf","doc","docx","xls","xlsx","ppt","pptx","mp3","mp4","wav","avi","mov","mkv","webm","exe","dll","so","dylib"]);function U({onResize:e}){let t=(0,r.useRef)(!1),s=(0,r.useRef)(0),a=(0,r.useCallback)(n=>{n.preventDefault(),t.current=!0,s.current=n.clientX;let r=n=>{if(!t.current)return;let r=s.current-n.clientX;s.current=n.clientX,e(r)},a=()=>{t.current=!1,document.removeEventListener("mousemove",r),document.removeEventListener("mouseup",a),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",r),document.addEventListener("mouseup",a)},[e]);return(0,n.jsx)("div",{onMouseDown:a,className:"w-1 shrink-0 cursor-col-resize bg-border hover:bg-primary/30 transition-colors"})}let O="cockpit_review_sessions",T="cockpit_review_viewed:";function _(){try{let e=localStorage.getItem(O);if(e)return JSON.parse(e)}catch{}return{}}let F=new Map;function J(e,t,s){return fetch(`/api/github/file-content?repo=${encodeURIComponent(e)}&path=${encodeURIComponent(t)}&ref=${encodeURIComponent(s)}`).then(e=>e.ok?e.json():null).then(e=>e?.content??null).catch(()=>null)}function G({file:e,pr:t,repo:s,settings:i,viewed:c,collapsed:f,onToggleViewed:g,onToggleCollapse:j,sectionRef:b}){var N,v;let w,y=(N=e.patch,/^deleted file mode/m.test(N)),k=(v=e.path,w=v.split(".").pop()?.toLowerCase()??"",D.has(w)),[S,C]=(0,r.useState)(!1),[$,R]=(0,r.useState)(!1),[E,I]=(0,r.useState)(!1),[L,M]=(0,r.useState)(null),U=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(y&&!S||k&&!$)return;let e=U.current;if(!e)return;let t=new IntersectionObserver(([e])=>{e.isIntersecting&&(I(!0),t.disconnect())},{rootMargin:"200px"});return t.observe(e),()=>t.disconnect()},[y,S,k,$]),(0,r.useEffect)(()=>{if(!E||!t)return;let n=!1,r=null;try{let t=(0,a.J2)(e.patch);t.length>0&&t[0].files.length>0&&(r=t[0].files[0])}catch(t){console.warn(`[diff] parsePatchFiles failed for ${e.path}:`,t)}if(!r)return void console.warn(`[diff] no meta for ${e.path}, falling back to PatchDiff`);let l=t.mergeBaseSha||t.baseRefOid||t.baseRefName,o=t.headRefOid||t.headRefName;return Promise.all([J(s,e.path,l),J(s,e.path,o)]).then(([e,t])=>{n||(null!=e&&null!=t&&function(e,t,s){let n=t.split(/\r?\n/).map(e=>e+"\n"),r=s.split(/\r?\n/).map(e=>e+"\n");for(let t of e.hunks){let e=t.deletionStart-1-t.deletionLineIndex,s=t.additionStart-1-t.additionLineIndex;for(let n of(t.deletionLineIndex=t.deletionStart-1,t.additionLineIndex=t.additionStart-1,t.hunkContent))n.deletionLineIndex+=e,n.additionLineIndex+=s}e.deletionLines=n,e.additionLines=r,e.isPartial=!1}(r,e,t),M(r))}).catch(t=>{console.error(`[diff] fetch failed for ${e.path}:`,t),M(r)}),()=>{n=!0}},[E,t,s,e.patch,e.path]);let O={theme:{dark:"pierre-dark",light:"pierre-light"},themeType:!("u"<typeof document)&&document.documentElement.classList.contains("dark")?"dark":"light",overflow:"wrap",diffStyle:i.diffStyle,hunkSeparators:"line-info",expansionLineCount:20,disableFileHeader:!0,unsafeCSS:A.j8};return(0,n.jsx)("div",{ref:e=>{U.current=e,b(e)},className:(0,P.cn)("rounded border overflow-clip",c&&"opacity-60"),children:f?(0,n.jsxs)("button",{onClick:j,className:"flex items-center gap-2 w-full px-4 py-2 text-sm text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",children:[(0,n.jsx)(u.A,{className:"h-3.5 w-3.5 shrink-0"}),c&&(0,n.jsx)(p.A,{className:"h-3 w-3 text-green-500 shrink-0"}),(0,n.jsx)("span",{className:"font-mono text-xs truncate text-left",dir:"rtl",title:e.path,children:(0,n.jsx)("bdo",{dir:"ltr",children:e.path})})]}):y&&!S?(0,n.jsxs)("button",{onClick:()=>C(!0),className:"flex items-center gap-2 w-full px-4 py-2 text-sm text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",children:[(0,n.jsx)(d.A,{className:"h-3.5 w-3.5 text-red-500 shrink-0"}),(0,n.jsx)("span",{className:"font-mono text-xs truncate text-left",dir:"rtl",title:e.path,children:(0,n.jsx)("bdo",{dir:"ltr",children:e.path})}),(0,n.jsx)("span",{className:"text-xs shrink-0",children:"deleted — click to load"})]}):k&&!$?(0,n.jsxs)("button",{onClick:()=>R(!0),className:"flex items-center gap-2 w-full px-4 py-2 text-sm text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors",children:[z(e.path,t?.files||[]),(0,n.jsx)("span",{className:"font-mono text-xs truncate text-left",dir:"rtl",title:e.path,children:(0,n.jsx)("bdo",{dir:"ltr",children:e.path})}),(0,n.jsx)("span",{className:"text-xs shrink-0",children:"binary — click to load"})]}):E?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"sticky top-0 z-10 flex items-center gap-2 px-4 py-1.5 text-sm border-b bg-muted/80 backdrop-blur-sm",children:[z(e.path,t?.files||[]),(0,n.jsx)("span",{className:"font-mono text-xs truncate flex-1 min-w-0 text-left",dir:"rtl",title:e.path,children:(0,n.jsx)("bdo",{dir:"ltr",children:e.path})}),(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),g(),c||f||j()},className:(0,P.cn)("h-4 w-4 shrink-0 rounded border flex items-center justify-center transition-colors",c?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/40 bg-transparent hover:border-muted-foreground/60"),title:"Mark as viewed and collapse",children:c&&(0,n.jsx)(p.A,{className:"h-3 w-3",strokeWidth:3})}),(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),j()},className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",title:"Collapse",children:(0,n.jsx)(h.A,{className:"h-3 w-3"})}),t&&(0,n.jsx)("a",{href:`${t.url}/files#diff-${e.path}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:e=>e.stopPropagation(),children:(0,n.jsx)(m.A,{className:"h-3 w-3"})})]}),(0,n.jsx)(A.sU,{fallback:(0,n.jsx)("pre",{className:"p-4 text-xs text-muted-foreground whitespace-pre-wrap",children:e.patch}),children:L?(0,n.jsx)(l.Q,{fileDiff:L,options:O}):(0,n.jsx)(o.C,{patch:e.patch,options:O})})]}):(0,n.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,n.jsx)(x.A,{className:"h-4 w-4 animate-spin text-muted-foreground"})})})}function q({owner:e,repo:t,number:s}){let a,l=`${e}/${t}`,o=`${l}#${s}`,{settings:i}=(0,L.t)(),{setSidebarSection:c,removeSidebarSection:d}=(0,C.E2)(),h=(0,S.useRouter)(),u=(0,I.G)(),[j,A]=(0,r.useState)(null),[D,J]=(0,r.useState)([]),[Q,W]=(0,r.useState)(!0),[V,B]=(0,r.useState)(null),H=F.get(o)||{chatWidth:400,descriptionOpen:!0},[X,K]=(0,r.useState)(H.chatWidth),[Z,Y]=(0,r.useState)(H.descriptionOpen),[ee,et]=(0,r.useState)(null),[es,en]=(0,r.useState)(()=>(function(e){try{let t=localStorage.getItem(T+e);if(t)return new Set(JSON.parse(t))}catch{}return new Set})(o)),[er,ea]=(0,r.useState)(new Set),[el,eo]=(0,r.useState)(!0),[ei,ec]=(0,r.useState)(null),[ed,eh]=(0,r.useState)(null),[eu,ep]=(0,r.useState)(null),[ex,em]=(0,r.useState)(!0),[ef,eg]=(0,r.useState)([]),[ej,eb]=(0,r.useState)(!1),[eN,ev]=(0,r.useState)(""),[ew,ey]=(0,r.useState)(null),[ek,eS]=(0,r.useState)(!1),eC=(0,r.useRef)(null),e$=(0,r.useRef)(new Map);(0,C.si)(j?`#${s} ${j.title}`:`PR #${s}`),(0,r.useEffect)(()=>{F.set(o,{chatWidth:X,descriptionOpen:Z})},[o,X,Z]),(0,r.useEffect)(()=>{W(!0),B(null);let e=fetch(`/api/github/prs/view?repo=${encodeURIComponent(l)}&number=${s}`).then(e=>e.ok?e.json():e.json().then(e=>Promise.reject(e.error))),t=fetch(`/api/github/prs/diff?repo=${encodeURIComponent(l)}&number=${s}`).then(e=>e.ok?e.json():e.json().then(e=>Promise.reject(e.error)));fetch(`/api/github/prs/checks?repo=${encodeURIComponent(l)}&number=${s}`).then(e=>e.ok?e.json():[]).then(e=>{Array.isArray(e)&&eg(e)}).catch(()=>{}),Promise.all([e,t]).then(([e,t])=>{A(e),J(t.files||[])}).catch(e=>B(String(e))).finally(()=>W(!1))},[l,s]),(0,r.useEffect)(()=>{eh(null),ep(null),em(!0)},[]),(0,r.useEffect)(()=>{if(!j)return;let e=j.title;!async function(){em(!0);let t=_()[o];if(t)try{let e=await fetch(`/api/sessions/${t}`);if(e.ok){eh(t);let s=await e.json();ep(s.session?.cwd||null),(0,R.MJ)(t),em(!1);return}}catch{}try{let t=await fetch("/api/github/review-session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo:l,prNumber:s,prTitle:e})});if(t.ok){var n;let e,s=await t.json();eh(s.sessionId),ep(s.cwd),n=s.sessionId,(e=_())[o]=n,localStorage.setItem(O,JSON.stringify(e)),(0,R.MJ)(s.sessionId)}}catch{}em(!1)}()},[j,o,l,s]),(0,r.useEffect)(()=>{if(!ee)return;let e=e$.current.get(ee);e&&e.scrollIntoView({behavior:"smooth",block:"start"}),et(null)},[ee]);let eA=(0,r.useCallback)(e=>{en(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),localStorage.setItem(T+o,JSON.stringify([...s])),s})},[o]),eR=(0,r.useCallback)(e=>{ea(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),eE=(0,r.useCallback)(e=>{K(t=>Math.max(280,Math.min(Math.floor(.5*window.innerWidth),t+e)))},[]),eI=(0,r.useCallback)(async e=>{if("request-changes"!==e||eN.trim()){ey(e);try{if((await fetch("/api/github/prs/review",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({repo:l,number:s,action:e,body:eN})})).ok){ev("");let e=await fetch(`/api/github/prs/view?repo=${encodeURIComponent(l)}&number=${s}`);e.ok&&A(await e.json())}}catch{}ey(null)}},[l,s,eN]),eL=(0,r.useCallback)(()=>{if(!ed||!j||ek||!eC.current)return;eS(!0);let e=`Repository: ${l}, PR #${s}: ${j.title}
|
|
2
|
+
Author: ${j.author.login}, Branch: ${j.headRefName} -> ${j.baseRefName}
|
|
3
|
+
Files changed: ${j.changedFiles} (+${j.additions} -${j.deletions})`;eC.current(`/review
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
${e}`)},[ed,j,l,s,ek]);if((0,r.useEffect)(()=>0===D.length?void d("pr-files"):(c({id:"pr-files",title:"PR Files",order:20,badge:String(D.length),content:(0,n.jsx)(n.Fragment,{children:D.map(e=>{let t;return(0,n.jsxs)("div",{className:(0,P.cn)("flex items-center gap-2 px-3 py-1.5 text-sm cursor-pointer border-b last:border-b-0 hover:bg-muted/50",es.has(e.path)&&"opacity-50",!el&&ei===e.path&&"bg-muted"),onClick:()=>{el?(er.has(e.path)&&eR(e.path),et(e.path)):ec(e.path)},children:[(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),eA(e.path),es.has(e.path)||er.has(e.path)||eR(e.path)},className:(0,P.cn)("h-4 w-4 shrink-0 rounded border flex items-center justify-center transition-colors",es.has(e.path)?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/40 bg-transparent hover:border-muted-foreground/60"),children:es.has(e.path)&&(0,n.jsx)(p.A,{className:"h-3 w-3",strokeWidth:3})}),z(e.path,j?.files||[]),(0,n.jsx)("span",{className:"font-mono text-xs truncate flex-1 min-w-0 text-left",dir:"rtl",title:e.path,children:(0,n.jsx)("bdo",{dir:"ltr",children:e.path})}),j?.files&&((t=j.files.find(t=>t.path===e.path))?(0,n.jsxs)("span",{className:"text-xs font-mono shrink-0 flex gap-1",children:[t.additions>0&&(0,n.jsxs)("span",{className:"text-green-500",children:["+",t.additions]}),t.deletions>0&&(0,n.jsxs)("span",{className:"text-red-500",children:["-",t.deletions]})]}):null)]},e.path)})})}),()=>d("pr-files")),[D,j,es,er,el,ei,c,d,eA,eR]),Q)return(0,n.jsx)("div",{className:"flex items-center justify-center flex-1",children:(0,n.jsx)(x.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})});if(V)return(0,n.jsx)("div",{className:"flex-1 p-4",children:(0,n.jsx)("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 p-4 text-sm text-destructive",children:V})});if(!j)return null;let eP=u&&!!ed&&!ex,ez=ef.filter(e=>"SUCCESS"===e.conclusion||"NEUTRAL"===e.conclusion||"SKIPPED"===e.conclusion),eM=ef.filter(e=>"FAILURE"===e.conclusion||"CANCELLED"===e.conclusion||"TIMED_OUT"===e.conclusion||"ACTION_REQUIRED"===e.conclusion),eD=ef.filter(e=>"PENDING"===e.state||"QUEUED"===e.state||"IN_PROGRESS"===e.state||"WAITING"===e.state);return(0,n.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,n.jsxs)("div",{className:"shrink-0 border-b px-4 py-2 flex items-center gap-3 text-sm",children:[(0,n.jsx)(E.$,{variant:"ghost",size:"icon",className:"shrink-0 h-7 w-7",onClick:()=>h.push(`/reviews/${e}/${t}`),children:(0,n.jsx)(f.A,{className:"h-4 w-4"})}),(0,n.jsx)("span",{className:"text-muted-foreground",children:j.author.login}),(0,n.jsxs)("div",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[(0,n.jsx)(g.A,{className:"h-3 w-3"}),(0,n.jsx)("span",{children:j.headRefName}),(0,n.jsx)("span",{className:"mx-1",children:"into"}),(0,n.jsx)("span",{children:j.baseRefName})]}),j.isDraft&&(0,n.jsx)("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-muted text-muted-foreground",children:"Draft"}),"APPROVED"===j.reviewDecision&&(0,n.jsx)("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-green-500/15 text-green-500",children:"Approved"}),"CHANGES_REQUESTED"===j.reviewDecision&&(0,n.jsx)("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-red-500/15 text-red-500",children:"Changes requested"}),ef.length>0&&(0,n.jsxs)("div",{className:"relative",children:[(0,n.jsxs)("button",{onClick:()=>eb(e=>!e),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[ez.length>0&&(0,n.jsxs)("span",{className:"flex items-center gap-0.5 text-green-500",children:[(0,n.jsx)(b,{className:"h-3 w-3"}),ez.length]}),eM.length>0&&(0,n.jsxs)("span",{className:"flex items-center gap-0.5 text-red-500",children:[(0,n.jsx)(N.A,{className:"h-3 w-3"}),eM.length]}),eD.length>0&&(0,n.jsxs)("span",{className:"flex items-center gap-0.5 text-yellow-500",children:[(0,n.jsx)(v,{className:"h-3 w-3"}),eD.length]})]}),ej&&(0,n.jsx)("div",{className:"absolute top-full left-0 mt-1 z-50 bg-popover border rounded-md shadow-md py-1 min-w-[250px] max-h-[300px] overflow-y-auto",children:ef.map(e=>(0,n.jsxs)("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 px-3 py-1.5 text-xs hover:bg-muted/50 transition-colors",children:["SUCCESS"===e.conclusion||"NEUTRAL"===e.conclusion||"SKIPPED"===e.conclusion?(0,n.jsx)(b,{className:"h-3 w-3 text-green-500 shrink-0"}):"FAILURE"===e.conclusion||"CANCELLED"===e.conclusion||"TIMED_OUT"===e.conclusion||"ACTION_REQUIRED"===e.conclusion?(0,n.jsx)(N.A,{className:"h-3 w-3 text-red-500 shrink-0"}):(0,n.jsx)(v,{className:"h-3 w-3 text-yellow-500 shrink-0"}),(0,n.jsx)("span",{className:"truncate",children:e.name})]},e.name))})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 ml-auto text-xs text-muted-foreground",children:[D.length>0&&(0,n.jsxs)("div",{className:"flex items-center gap-0.5 rounded-md border p-0.5",children:[(0,n.jsx)("button",{onClick:()=>eo(!0),className:(0,P.cn)("rounded px-1.5 py-0.5 text-xs transition-colors",el?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),title:"Stacked view",children:(0,n.jsx)(w.A,{className:"h-3.5 w-3.5"})}),(0,n.jsx)("button",{onClick:()=>{eo(!1),!ei&&D.length>0&&ec(D[0].path)},className:(0,P.cn)("rounded px-1.5 py-0.5 text-xs transition-colors",el?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),title:"Single file view",children:(0,n.jsx)(y.A,{className:"h-3.5 w-3.5"})})]}),(0,n.jsxs)("span",{className:"text-green-500",children:["+",j.additions]}),(0,n.jsxs)("span",{className:"text-red-500",children:["-",j.deletions]}),(0,n.jsxs)("span",{children:[j.changedFiles," files"]}),(0,n.jsx)("a",{href:j.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 hover:text-foreground transition-colors",children:(0,n.jsx)(m.A,{className:"h-3 w-3"})}),ed&&!ex&&(0,n.jsxs)(E.$,{variant:"outline",size:"sm",className:"h-6 px-2.5 text-xs gap-1.5 border-green-500/50 text-green-500 hover:bg-green-500/10",onClick:eL,disabled:ek,children:[(0,n.jsx)(k.A,{className:"h-3.5 w-3.5"}),ek?"Review Started":"Start Agent Review"]})]})]}),(0,n.jsxs)("div",{className:"flex-1 min-h-0 flex flex-row",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0 overflow-y-auto",children:[j.body&&(0,n.jsx)(M,{body:j.body,open:Z,onToggle:()=>Y(e=>!e)}),j.labels.length>0&&(0,n.jsx)("div",{className:"flex gap-1 px-4 py-2 flex-wrap border-b",children:j.labels.map(e=>(0,n.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full border",style:{borderColor:`#${e.color}`,color:`#${e.color}`},children:e.name},e.name))}),(0,n.jsxs)("div",{className:"border-b px-4 py-3 space-y-2",children:[(0,n.jsx)("textarea",{value:eN,onChange:e=>ev(e.target.value),placeholder:"Leave a review comment...",className:"w-full text-sm rounded border bg-transparent px-3 py-2 min-h-[60px] resize-y focus:outline-none focus:ring-1 focus:ring-ring"}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsxs)(E.$,{variant:"outline",size:"sm",className:"text-xs",disabled:!!ew,onClick:()=>eI("comment"),children:["comment"===ew?(0,n.jsx)(x.A,{className:"h-3 w-3 animate-spin mr-1"}):null,"Comment"]}),(0,n.jsxs)(E.$,{variant:"outline",size:"sm",className:"text-xs text-green-500 border-green-500/30 hover:bg-green-500/10",disabled:!!ew,onClick:()=>eI("approve"),children:["approve"===ew?(0,n.jsx)(x.A,{className:"h-3 w-3 animate-spin mr-1"}):null,"Approve"]}),(0,n.jsxs)(E.$,{variant:"outline",size:"sm",className:"text-xs text-red-500 border-red-500/30 hover:bg-red-500/10",disabled:!!ew||!eN.trim(),onClick:()=>eI("request-changes"),children:["request-changes"===ew?(0,n.jsx)(x.A,{className:"h-3 w-3 animate-spin mr-1"}):null,"Request Changes"]})]})]}),(0,n.jsxs)("div",{className:"p-4 space-y-3",children:[0===D.length&&(0,n.jsx)("div",{className:"text-center py-12 text-sm text-muted-foreground",children:"No changes"}),el?D.map(e=>(0,n.jsx)(G,{file:e,pr:j,repo:l,settings:i,viewed:es.has(e.path),collapsed:er.has(e.path),onToggleViewed:()=>eA(e.path),onToggleCollapse:()=>eR(e.path),sectionRef:t=>{t&&e$.current.set(e.path,t)}},e.path)):ei?(a=D.find(e=>e.path===ei))?(0,n.jsx)(G,{file:a,pr:j,repo:l,settings:i,viewed:es.has(a.path),collapsed:!1,onToggleViewed:()=>eA(a.path),onToggleCollapse:()=>{},sectionRef:()=>{}},a.path):(0,n.jsx)("div",{className:"text-center py-12 text-sm text-muted-foreground",children:"File not found"}):D.length>0&&(0,n.jsx)("div",{className:"text-center py-12 text-sm text-muted-foreground",children:"Select a file from the sidebar"})]})]}),eP&&eu&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(U,{onResize:eE}),(0,n.jsx)("div",{className:"flex flex-col shrink-0 border-l min-h-0",style:{width:X},children:(0,n.jsx)($.I,{sessionId:ed,cwd:eu,initialContext:`Reviewing PR #${s}: ${j.title}
|
|
7
|
+
Repo: ${l}
|
|
8
|
+
Author: ${j.author.login}
|
|
9
|
+
Branch: ${j.headRefName} into ${j.baseRefName}
|
|
10
|
+
Files changed: ${j.changedFiles} (+${j.additions} -${j.deletions})${j.body?`
|
|
11
|
+
|
|
12
|
+
Description:
|
|
13
|
+
${j.body.slice(0,2e3)}`:""}`,onSendMessage:e=>{eC.current=e}})})]})]})]})}function Q({params:e}){let{owner:t,repo:s,number:a}=(0,r.use)(e);return(0,n.jsx)(q,{owner:t,repo:s,number:parseInt(a,10)})}},56206:(e,t,s)=>{Promise.resolve().then(s.bind(s,43996))},58309:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(99537).A)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]])},94088:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(99537).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},94890:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(99537).A)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])}},e=>{e.O(0,[989,25781,1550,28441,93794,77358],()=>e(e.s=56206)),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[50198],{9181:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>N});var r=t(95155),l=t(35397),n=t(99537);let a=(0,n.A)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var c=t(94890);let i=(0,n.A)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);var d=t(31966),o=t(65377),u=t(82749),x=t(92571),m=t(73321),h=t(12115),p=t(
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[50198],{9181:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>N});var r=t(95155),l=t(35397),n=t(99537);let a=(0,n.A)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var c=t(94890);let i=(0,n.A)("circle-dot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);var d=t(31966),o=t(65377),u=t(82749),x=t(92571),m=t(73321),h=t(12115),p=t(1550),f=t(89239),g=t(40980);let j=new Map;function N({params:e}){let{owner:s,repo:t}=(0,h.use)(e),n=`${s}/${t}`;(0,p.si)(n);let v=(0,m.useRouter)(),[y,w]=(0,h.useState)("open"),[k,b]=(0,h.useState)(()=>j.get(`${n}:open`)||[]),[C,E]=(0,h.useState)(""),[$,A]=(0,h.useState)(!j.has(`${n}:open`)),[R,S]=(0,h.useState)(null),D=(0,h.useCallback)((e=!1)=>{let s=`${n}:${y}`;if(!e&&j.has(s)){b(j.get(s)),A(!1);return}A(!0),S(null),fetch(`/api/github/prs?repo=${encodeURIComponent(n)}&state=${y}`).then(e=>e.ok?e.json():e.json().then(e=>Promise.reject(e.error))).then(e=>{j.set(s,e),b(e)}).catch(e=>S(String(e))).finally(()=>A(!1))},[n,y]);(0,h.useEffect)(()=>{D()},[D]);let _=C?k.filter(e=>e.title.toLowerCase().includes(C.toLowerCase())):k;return(0,r.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(f.$,{variant:"ghost",size:"icon",className:"shrink-0 h-8 w-8",onClick:()=>v.push("/reviews"),children:(0,r.jsx)(d.A,{className:"h-4 w-4"})}),(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)(f.$,{variant:"open"===y?"default":"outline",size:"sm",onClick:()=>w("open"),children:"Open"}),(0,r.jsx)(f.$,{variant:"closed"===y?"default":"outline",size:"sm",onClick:()=>w("closed"),children:"Closed"})]}),(0,r.jsxs)("div",{className:"relative flex-1",children:[(0,r.jsx)(o.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,r.jsx)("input",{type:"text",placeholder:"Filter PRs...",value:C,onChange:e=>E(e.target.value),className:"w-full rounded-md border bg-background px-3 py-2 pl-9 text-sm outline-none focus:ring-1 focus:ring-ring"})]}),(0,r.jsx)(f.$,{variant:"ghost",size:"icon",className:"shrink-0 h-8 w-8 text-muted-foreground hover:text-foreground",onClick:()=>D(!0),disabled:$,title:"Refresh",children:(0,r.jsx)(u.A,{className:(0,g.cn)("h-4 w-4",$&&"animate-spin")})})]}),$&&(0,r.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,r.jsx)(x.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),R&&(0,r.jsx)("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 p-4 text-sm text-destructive",children:R}),!$&&!R&&0===_.length&&(0,r.jsx)("div",{className:"text-center py-12 text-sm text-muted-foreground",children:"No pull requests found."}),!$&&_.length>0&&(0,r.jsx)("div",{className:"space-y-1",children:_.map(e=>(0,r.jsxs)("button",{onClick:()=>v.push(`/reviews/${s}/${t}/${e.number}`),className:"w-full text-left rounded-md border px-4 py-3 hover:bg-muted/50 transition-colors",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[function(e){switch(e){case"OPEN":return(0,r.jsx)(l.A,{className:"h-4 w-4 text-green-500 shrink-0"});case"MERGED":return(0,r.jsx)(a,{className:"h-4 w-4 text-purple-500 shrink-0"});case"CLOSED":return(0,r.jsx)(c.A,{className:"h-4 w-4 text-red-500 shrink-0"});default:return(0,r.jsx)(i,{className:"h-4 w-4 text-muted-foreground shrink-0"})}}(e.state),(0,r.jsx)("span",{className:"font-medium text-sm truncate flex-1 min-w-0",children:e.title}),e.isDraft&&(0,r.jsx)("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-muted text-muted-foreground shrink-0",children:"Draft"}),function(e){switch(e){case"APPROVED":return(0,r.jsx)("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-green-500/15 text-green-500",children:"Approved"});case"CHANGES_REQUESTED":return(0,r.jsx)("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-red-500/15 text-red-500",children:"Changes requested"});case"REVIEW_REQUIRED":return(0,r.jsx)("span",{className:"text-[10px] font-medium px-1.5 py-0.5 rounded-full bg-yellow-500/15 text-yellow-500",children:"Review required"});default:return null}}(e.reviewDecision)]}),(0,r.jsxs)("div",{className:"flex items-center gap-3 mt-1.5 text-xs text-muted-foreground flex-wrap",children:[(0,r.jsxs)("span",{children:["#",e.number]}),(0,r.jsx)("span",{children:e.author.login}),(0,r.jsx)("span",{className:"truncate max-w-[200px]",children:e.headRefName}),(0,r.jsxs)("span",{className:"text-green-500 shrink-0",children:["+",e.additions]}),(0,r.jsxs)("span",{className:"text-red-500 shrink-0",children:["-",e.deletions]})]}),e.labels.length>0&&(0,r.jsx)("div",{className:"flex gap-1 mt-1.5 flex-wrap",children:e.labels.map(e=>(0,r.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 rounded-full border",style:{borderColor:`#${e.color}`,color:`#${e.color}`},children:e.name},e.name))})]},e.number))})]})}},37596:(e,s,t)=>{Promise.resolve().then(t.bind(t,9181))},94890:(e,s,t)=>{"use strict";t.d(s,{A:()=>r});let r=(0,t(99537).A)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])}},e=>{e.O(0,[989,25781,1550,28441,93794,77358],()=>e(e.s=37596)),_N_E=e.O()}]);
|
package/.next/static/chunks/app/(app)/reviews/{page-47530d93bb9d4a76.js → page-deaa44f0ce253da8.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[66345],{15411:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>j});var s=r(95155),a=r(92571),n=r(99537);let o=(0,n.A)("building-2",[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]]);var l=r(65377),i=r(82749);let d=(0,n.A)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),c=(0,n.A)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);var u=r(73321),h=r(12115),m=r(
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[66345],{15411:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>j});var s=r(95155),a=r(92571),n=r(99537);let o=(0,n.A)("building-2",[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]]);var l=r(65377),i=r(82749);let d=(0,n.A)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]),c=(0,n.A)("globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);var u=r(73321),h=r(12115),m=r(1550),x=r(89239),f=r(40980);let g="cockpit_review_org",p=null,v=new Map;function j(){(0,m.si)("Reviews");let e=(0,u.useRouter)(),[t,r]=(0,h.useState)(p||[]),[n,j]=(0,h.useState)(!p),[y,N]=(0,h.useState)(null),[b,w]=(0,h.useState)(()=>{if(p){let e=localStorage.getItem(g);if(e&&p.includes(e))return e;if(p.length>0)return p[0]}return null}),[k,C]=(0,h.useState)(()=>b&&v.get(b)||[]),[M,S]=(0,h.useState)(!1),[A,$]=(0,h.useState)(null),[_,L]=(0,h.useState)("");(0,h.useEffect)(()=>{p||fetch("/api/github/orgs").then(e=>e.ok?e.json():e.json().then(e=>Promise.reject(e.error))).then(e=>{p=e,r(e);let t=localStorage.getItem(g);t&&e.includes(t)?w(t):e.length>0&&w(e[0])}).catch(e=>N(String(e))).finally(()=>j(!1))},[]);let E=(0,h.useCallback)(e=>{let t=v.get(e);t?C(t):(S(!0),$(null),fetch(`/api/github/repos?owner=${encodeURIComponent(e)}`).then(e=>e.ok?e.json():e.json().then(e=>Promise.reject(e.error))).then(t=>{v.set(e,t),C(t)}).catch(e=>$(String(e))).finally(()=>S(!1)))},[]),I=(0,h.useCallback)(()=>{b&&(v.delete(b),S(!0),$(null),fetch(`/api/github/repos?owner=${encodeURIComponent(b)}`).then(e=>e.ok?e.json():e.json().then(e=>Promise.reject(e.error))).then(e=>{v.set(b,e),C(e)}).catch(e=>$(String(e))).finally(()=>S(!1)))},[b]);(0,h.useEffect)(()=>{b&&(localStorage.setItem(g,b),E(b))},[b,E]);let P=[...k].sort((e,t)=>e.name.localeCompare(t.name)),R=_?P.filter(e=>e.name.toLowerCase().includes(_.toLowerCase())||e.description?.toLowerCase().includes(_.toLowerCase())):P;return n?(0,s.jsx)("div",{className:"flex items-center justify-center flex-1",children:(0,s.jsx)(a.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):y?(0,s.jsx)("div",{className:"flex-1 p-4",children:(0,s.jsx)("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 p-4 text-sm text-destructive",children:y})}):0===t.length?(0,s.jsx)("div",{className:"flex-1 p-4",children:(0,s.jsxs)("div",{className:"text-center py-12 text-sm text-muted-foreground",children:["No organizations found. Make sure you have run"," ",(0,s.jsx)("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs",children:"gh auth refresh -s read:org"}),"."]})}):(0,s.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,s.jsx)("div",{className:"flex gap-2 flex-wrap",children:t.map(e=>(0,s.jsxs)("button",{onClick:()=>w(e),className:(0,f.cn)("flex items-center gap-1.5 rounded-md border px-3 py-1.5 text-sm transition-colors",b===e?"border-primary bg-primary/10 text-foreground":"border-border text-muted-foreground hover:text-foreground hover:bg-muted/50"),children:[(0,s.jsx)(o,{className:"h-3.5 w-3.5"}),e]},e))}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("div",{className:"relative flex-1",children:[(0,s.jsx)(l.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,s.jsx)("input",{type:"text",placeholder:"Filter repos...",value:_,onChange:e=>L(e.target.value),className:"w-full rounded-md border bg-background px-3 py-2 pl-9 text-sm outline-none focus:ring-1 focus:ring-ring"})]}),(0,s.jsx)(x.$,{variant:"ghost",size:"icon",className:"shrink-0 h-9 w-9 text-muted-foreground hover:text-foreground",onClick:I,disabled:M,title:"Refresh",children:(0,s.jsx)(i.A,{className:(0,f.cn)("h-4 w-4",M&&"animate-spin")})})]}),M&&(0,s.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,s.jsx)(a.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),A&&(0,s.jsx)("div",{className:"rounded-md border border-destructive/50 bg-destructive/10 p-4 text-sm text-destructive",children:A}),!M&&!A&&0===R.length&&(0,s.jsx)("div",{className:"text-center py-12 text-sm text-muted-foreground",children:0===k.length?"No repositories found.":"No matches."}),!M&&R.length>0&&(0,s.jsx)("div",{className:"space-y-1",children:R.map(t=>(0,s.jsxs)("button",{onClick:()=>e.push(`/reviews/${t.nameWithOwner}`),className:"w-full text-left rounded-md border px-4 py-3 hover:bg-muted/50 transition-colors",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[t.isPrivate?(0,s.jsx)(d,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}):(0,s.jsx)(c,{className:"h-3.5 w-3.5 text-muted-foreground shrink-0"}),(0,s.jsx)("span",{className:"font-medium text-sm truncate",children:t.name}),t.primaryLanguage&&(0,s.jsx)("span",{className:"text-xs text-muted-foreground shrink-0",children:t.primaryLanguage.name}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground shrink-0 ml-auto",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return"just now";let r=Math.floor(t/60);if(r<60)return`${r}m ago`;let s=Math.floor(r/60);if(s<24)return`${s}h ago`;let a=Math.floor(s/24);if(a<30)return`${a}d ago`;let n=Math.floor(a/30);return`${n}mo ago`}(t.pushedAt)})]}),t.description&&(0,s.jsx)("p",{className:"text-xs text-muted-foreground mt-1 truncate",children:t.description})]},t.nameWithOwner))})]})}},89147:(e,t,r)=>{Promise.resolve().then(r.bind(r,15411))}},e=>{e.O(0,[989,25781,1550,28441,93794,77358],()=>e(e.s=89147)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[46713],{5214:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return r.workAsyncStorageInstance}});let r=n(17828)},11701:(e,t,n)=>{"use strict";n.d(t,{G:()=>a});var r=n(12115);let l="(min-width: 768px)";function a(){let[e,t]=(0,r.useState)(()=>window.matchMedia(l).matches);return(0,r.useEffect)(()=>{let e=window.matchMedia(l),n=e=>t(e.matches);return e.addEventListener("change",n),()=>e.removeEventListener("change",n)},[]),e}},17828:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return r}});let r=(0,n(64054).createAsyncLocalStorage)()},20660:(e,t,n)=>{"use strict";n.d(t,{Q:()=>c});var r=n(26210),l=n(82627),a=n(70569),s=n(33735),i=n(95155);function c({fileDiff:e,options:t,metrics:n,lineAnnotations:o,selectedLines:d,className:u,style:f,prerenderedHTML:h,renderAnnotation:m,renderCustomHeader:x,renderHeaderPrefix:p,renderHeaderMetadata:b,renderGutterUtility:g,disableWorkerPool:j=!1}){let{ref:y,getHoveredLine:w}=(0,s.S)({fileDiff:e,options:t,metrics:n,lineAnnotations:o,selectedLines:d,prerenderedHTML:h,hasGutterRenderUtility:null!=g,hasCustomHeader:null!=x,disableWorkerPool:j});return(0,i.jsx)(r.mZ,{ref:y,className:u,style:f,children:(0,a.$)((0,l.z)({fileDiff:e,renderCustomHeader:x,renderHeaderPrefix:p,renderHeaderMetadata:b,renderAnnotation:m,renderGutterUtility:g,lineAnnotations:o,getHoveredLine:w}),h)})}},21957:(e,t,n)=>{"use strict";function r({moduleIds:e}){return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return r}}),n(95155),n(47650),n(5214),n(2451),n(53887)},23668:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>eE});var r=n(95155),l=n(73321),a=n(12115),s=n(1550),i=n(23965),c=n(75707),o=n.n(c),d=n(27417),u=n(53972);let f=(0,a.createContext)(null),h={type:"chat",id:"chat"},m={type:"changes",id:"changes"};function x(e){return"terminal::"+e}let p=new Map,b={tabs:[h],activeTabId:"chat",splitTabId:null,rightPaneTabIds:[]};function g({sessionId:e,children:t}){let[n,l]=(0,a.useState)(()=>p.get(e)||b),s=(0,a.useRef)(p.has(e)?e:null),i=(0,a.useRef)(void 0);(0,a.useEffect)(()=>{if(s.current===e)return;if(p.has(e)){l(p.get(e)),s.current=e;return}let t=!1;return fetch(`/api/sessions/${e}/tabs`).then(e=>e.ok?e.json():null).then(n=>{if(!t){if(n?.openTabs?.length){let t=function(e){let t=[h];for(let n of e)"changes"===n.type?t.push(m):"file"===n.type&&n.filePath?t.push({type:"file",id:"file::"+n.filePath,filePath:n.filePath,label:(0,u.uk)(n.filePath)||n.filePath}):"diff"===n.type&&n.filePath?t.push({type:"diff",id:"diff::"+n.filePath,filePath:n.filePath,label:(0,u.uk)(n.filePath)||n.filePath}):"terminal"===n.type&&n.terminalId&&t.push({type:"terminal",id:x(n.terminalId),terminalId:n.terminalId,label:n.label||"Terminal"});return t}(n.openTabs),r=n.activeTabId&&t.some(e=>e.id===n.activeTabId)?n.activeTabId:"chat",a={tabs:t,activeTabId:r,splitTabId:null,rightPaneTabIds:[]};l(a),p.set(e,a)}s.current=e}}).catch(()=>{s.current=e}),()=>{t=!0}},[e]),(0,a.useEffect)(()=>{if(s.current===e)return p.set(e,n),clearTimeout(i.current),i.current=setTimeout(()=>{fetch(`/api/sessions/${e}/tabs`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({openTabs:function(e){let t=[];for(let n of e)"chat"!==n.type&&("changes"===n.type?t.push({type:"changes"}):"terminal"===n.type?t.push({type:"terminal",terminalId:n.terminalId,label:n.label}):t.push({type:n.type,filePath:n.filePath}));return t}(n.tabs),activeTabId:n.activeTabId})}).catch(()=>{})},300),()=>clearTimeout(i.current)},[e,n.tabs,n.activeTabId]);let c=(0,a.useCallback)(e=>{let t="file::"+e;l(n=>{if(n.tabs.find(e=>e.id===t))return{...n,activeTabId:t};let r={type:"file",id:t,filePath:e,label:(0,u.uk)(e)||e};return{...n,tabs:[...n.tabs,r],activeTabId:t}})},[]),o=(0,a.useCallback)(e=>{let t="diff::"+e;l(n=>{if(n.tabs.find(e=>e.id===t))return{...n,activeTabId:t};let r={type:"diff",id:t,filePath:e,label:(0,u.uk)(e)||e};return{...n,tabs:[...n.tabs,r],activeTabId:t}})},[]),j=(0,a.useCallback)(()=>{l(e=>e.tabs.find(e=>"changes"===e.id)?{...e,activeTabId:"changes"}:{...e,tabs:[...e.tabs,m],activeTabId:"changes"})},[]),y=(0,a.useCallback)((e,t)=>{let n=x(e);l(r=>r.tabs.find(e=>e.id===n)?{...r,activeTabId:n}:{...r,tabs:[...r.tabs,{type:"terminal",id:n,terminalId:e,label:t||"Terminal"}],activeTabId:n})},[]),w=(0,a.useCallback)(e=>{"chat"!==e&&l(t=>{let n=t.tabs.find(t=>t.id===e);n?.type==="terminal"&&((0,d.disposeTerminalInstance)(n.terminalId),fetch(`/api/terminal/${n.terminalId}`,{method:"DELETE"}).catch(()=>{}));let r=t.tabs.findIndex(t=>t.id===e);if(r<0)return t;let l=t.tabs.filter(t=>t.id!==e),a=t.activeTabId;if(a===e){let e=l.filter(e=>!t.rightPaneTabIds.includes(e.id)),n=Math.min(r,e.length-1);a=e[Math.max(0,n)]?.id||"chat"}let s=t.rightPaneTabIds.filter(t=>t!==e),i=t.splitTabId===e?s[0]||null:t.splitTabId;return 0===s.length&&(i=null),{tabs:l,activeTabId:a,splitTabId:i,rightPaneTabIds:s}})},[]),v=(0,a.useCallback)(e=>{l(t=>({...t,activeTabId:e}))},[]),k=(0,a.useCallback)(e=>{l(t=>{if(null===e)return{...t,splitTabId:null,rightPaneTabIds:[]};let n=t.rightPaneTabIds.includes(e)?t.rightPaneTabIds:[...t.rightPaneTabIds,e];return{...t,splitTabId:e,rightPaneTabIds:n}})},[]),N=(0,a.useCallback)((e,t)=>{l(n=>{let r=n.tabs.findIndex(t=>t.id===e);if(r<1||r===t)return n;let l=[...n.tabs],[a]=l.splice(r,1),s=Math.max(1,Math.min(l.length,t>r?t-1:t));return l.splice(s,0,a),{...n,tabs:l}})},[]),C=(0,a.useCallback)((e,t)=>{"chat"!==e&&l(n=>{let r=n.rightPaneTabIds.includes(e);if("right"===t&&!r){let t=[...n.rightPaneTabIds,e],r=n.activeTabId;if(r===e){let e=n.tabs.filter(e=>!t.includes(e.id));r=e[0]?.id||"chat"}return{...n,rightPaneTabIds:t,activeTabId:r,splitTabId:n.splitTabId||e}}if("left"===t&&r){let t=n.rightPaneTabIds.filter(t=>t!==e),r=n.splitTabId;return r===e&&(r=t[0]||null),0===t.length&&(r=null),{...n,rightPaneTabIds:t,splitTabId:r,activeTabId:e}}return n})},[]);return(0,r.jsx)(f.Provider,{value:{tabs:n.tabs,activeTabId:n.activeTabId,splitTabId:n.splitTabId,rightPaneTabIds:n.rightPaneTabIds,openFile:c,openDiff:o,openChanges:j,openTerminal:y,closeTab:w,setActiveTab:v,setSplitTab:k,moveTab:N,moveTabToPane:C},children:t})}function j(){return(0,a.useContext)(f)}var y=n(11701),w=n(40980),v=n(69226),k=n(20660),N=n(64577),C=n(44354),S=n(83212),T=n(19257),I=n(797),E=n(12363),P=n(92571),A=n(94088),M=n(1275),F=n(15480),R=n(19707),D=n(58309),O=n(99537);let z=(0,O.A)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]),$=(0,O.A)("sparkles",[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]]);var L=n(9383),_=n(65738),U=n(59184),W=n(57594);function G({onResize:e}){let t=(0,a.useRef)(!1),n=(0,a.useRef)(0),l=(0,a.useCallback)(r=>{r.preventDefault(),t.current=!0,n.current=r.clientX;let l=r=>{if(!t.current)return;let l=n.current-r.clientX;n.current=r.clientX,e(l)},a=()=>{t.current=!1,document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="col-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",l),document.addEventListener("mouseup",a)},[e]);return(0,r.jsx)("div",{onMouseDown:l,className:"w-1 shrink-0 cursor-col-resize bg-border hover:bg-primary/30 transition-colors"})}var B=n(89239),J=n(22317),q=n(89323),V=n(30090);function H({checked:e,onChange:t,onClick:n}){return(0,r.jsx)("button",{type:"button",role:"checkbox","aria-checked":e,onClick:e=>{n?.(e),t()},className:(0,w.cn)("h-4 w-4 shrink-0 rounded border flex items-center justify-center transition-colors",e?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/40 bg-transparent hover:border-muted-foreground/60"),children:e&&(0,r.jsx)(N.A,{className:"h-3 w-3",strokeWidth:3})})}function X(e){switch(e){case"added":case"untracked":return(0,r.jsx)(C.A,{className:"h-3.5 w-3.5 text-green-500 shrink-0"});case"deleted":return(0,r.jsx)(S.A,{className:"h-3.5 w-3.5 text-red-500 shrink-0"});case"renamed":return(0,r.jsx)(T.A,{className:"h-3.5 w-3.5 text-blue-500 shrink-0"});default:return(0,r.jsx)(I.A,{className:"h-3.5 w-3.5 text-yellow-500 shrink-0"})}}function K(){return!("u"<typeof document)&&document.documentElement.classList.contains("dark")}function Y(e,t,n){let r=t.split(/\r?\n/).map(e=>e+"\n"),l=n.split(/\r?\n/).map(e=>e+"\n");for(let t of e.hunks){let e=t.deletionStart-1-t.deletionLineIndex,n=t.additionStart-1-t.additionLineIndex;for(let r of(t.deletionLineIndex=t.deletionStart-1,t.additionLineIndex=t.additionStart-1,t.hunkContent))r.deletionLineIndex+=e,r.additionLineIndex+=n}e.deletionLines=r,e.additionLines=l,e.isPartial=!1}function Q({files:e,selectedFile:t,checkedFiles:n,onFileClick:l,onContextMenu:a,onToggleFile:s,onToggleAll:i}){return 0===e.length?(0,r.jsx)("div",{className:"flex items-center justify-center py-12 text-sm text-muted-foreground",children:"Working tree clean"}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"px-3 py-1.5 border-b flex items-center gap-2",children:[(0,r.jsx)(H,{checked:n.size===e.length,onChange:i}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:"Select all"})]}),e.map(e=>(0,r.jsxs)("div",{className:(0,w.cn)("flex items-center gap-2 px-3 py-1.5 text-sm cursor-pointer border-b last:border-b-0 hover:bg-muted/50",t===e.path&&"bg-muted"),onClick:()=>l(e),onContextMenu:t=>a(t,e),children:[(0,r.jsx)(H,{checked:n.has(e.path),onChange:()=>s(e.path),onClick:e=>e.stopPropagation()}),X(e.status),(0,r.jsx)("span",{className:"font-mono text-xs truncate flex-1 min-w-0 text-left",dir:"rtl",title:e.path,children:(0,r.jsx)("bdo",{dir:"ltr",children:e.path})}),(e.additions>0||e.deletions>0)&&(0,r.jsxs)("span",{className:"text-xs font-mono shrink-0 flex items-center gap-1",children:[e.additions>0&&(0,r.jsxs)("span",{className:"text-green-500",children:["+",e.additions]}),e.deletions>0&&(0,r.jsxs)("span",{className:"text-red-500",children:["-",e.deletions]})]}),(0,r.jsx)("span",{className:(0,w.cn)("text-xs font-mono shrink-0","added"===e.status||"untracked"===e.status?"text-green-500":"deleted"===e.status?"text-red-500":"text-yellow-500"),children:function(e){switch(e){case"added":return"A";case"deleted":return"D";case"renamed":return"R";case"untracked":return"?";default:return"M"}}(e.status)})]},e.path))]})}function Z({files:e,cwd:t,diffStyle:n,scrollToFile:l,onScrolled:s,onViewFile:i,checkedFiles:c,onToggleFile:o,refreshKey:d}){let[u,f]=(0,a.useState)(new Map),h=(0,a.useRef)(new Map),m=(0,a.useRef)(new Set),x=(0,a.useRef)(d),[p,b]=(0,a.useState)(new Set),g=(0,a.useCallback)(e=>{f(t=>{let n=new Map(t);return n.set(e,{diff:t.get(e)?.diff||null,fileDiff:t.get(e)?.fileDiff||null,loading:!0}),n}),fetch(`/api/git/diff?cwd=${encodeURIComponent(t)}&file=${encodeURIComponent(e)}`).then(e=>{if(!e.ok)throw Error("Failed");return e.json()}).then(t=>{let n=null;try{let e=(0,v.J2)(t.diff);e.length>0&&e[0].files.length>0&&(n=e[0].files[0],null!=t.oldContent&&null!=t.newContent&&Y(n,t.oldContent,t.newContent))}catch{}f(r=>{let l=new Map(r);return l.set(e,{diff:t.diff,fileDiff:n,loading:!1}),l})}).catch(()=>{f(t=>{let n=new Map(t);return n.set(e,{diff:null,fileDiff:null,loading:!1}),n})})},[t]);(0,a.useEffect)(()=>{let t=d!==x.current;x.current=d,t&&m.current.clear();let n=new Set(e.map(e=>e.path));for(let t of e.filter(e=>!m.current.has(e.path)))m.current.add(t.path),g(t.path);for(let e of m.current)n.has(e)||m.current.delete(e)},[e,g,d]),(0,a.useEffect)(()=>{if(!l)return;let e=h.current.get(l);e&&e.scrollIntoView({behavior:"smooth",block:"start"}),s()},[l,s]);let j=(0,a.useCallback)(e=>{b(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},[]),y=(0,a.useCallback)(e=>{o(e),c.has(e)||b(t=>new Set(t).add(e))},[o,c]);return 0===e.length?(0,r.jsx)("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"No changes"}):(0,r.jsx)("div",{className:"p-4 space-y-3",children:e.map(e=>{let t=u.get(e.path),l=c.has(e.path),a=p.has(e.path);return(0,r.jsx)("div",{ref:t=>{t&&h.current.set(e.path,t)},className:(0,w.cn)("rounded border overflow-clip",l&&!a&&"opacity-60"),children:a?(0,r.jsxs)("div",{className:"flex items-center gap-2 w-full px-4 py-2 text-sm text-muted-foreground",children:[(0,r.jsx)(H,{checked:l,onChange:()=>{o(e.path),l&&b(t=>{let n=new Set(t);return n.delete(e.path),n})},onClick:e=>e.stopPropagation()}),(0,r.jsxs)("button",{onClick:()=>j(e.path),className:"flex items-center gap-2 flex-1 min-w-0 hover:text-foreground transition-colors",children:[(0,r.jsx)(E.A,{className:"h-3.5 w-3.5 shrink-0"}),(0,r.jsx)("span",{className:"font-mono text-xs truncate text-left",dir:"rtl",title:e.path,children:(0,r.jsx)("bdo",{dir:"ltr",children:e.path})})]})]}):t?.loading&&!t.diff?(0,r.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,r.jsx)(P.A,{className:"h-4 w-4 animate-spin text-muted-foreground"})}):t?.diff?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"sticky top-0 z-10 flex items-center gap-2 px-4 py-1.5 text-sm border-b bg-muted/80 backdrop-blur-sm","data-testid":"sticky-diff-header",children:[X(e.status),(0,r.jsx)("span",{className:"font-mono text-xs truncate flex-1 min-w-0 text-left",dir:"rtl",title:e.path,children:(0,r.jsx)("bdo",{dir:"ltr",children:e.path})}),(0,r.jsx)(H,{checked:l,onChange:()=>y(e.path),onClick:e=>e.stopPropagation()}),(0,r.jsx)("button",{onClick:()=>j(e.path),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",title:"Collapse",children:(0,r.jsx)(A.A,{className:"h-3 w-3"})}),(0,r.jsx)("button",{onClick:()=>i(e.path),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",children:(0,r.jsx)(M.A,{className:"h-3 w-3"})})]}),(0,r.jsx)(W.sU,{fallback:(0,r.jsx)("pre",{className:"p-4 text-xs text-muted-foreground whitespace-pre-wrap",children:t.diff}),children:t.fileDiff?(0,r.jsx)(k.Q,{fileDiff:t.fileDiff,options:{theme:{dark:"pierre-dark",light:"pierre-light"},themeType:K()?"dark":"light",overflow:"wrap",diffStyle:n,disableFileHeader:!0,hunkSeparators:"line-info",expansionLineCount:20,unsafeCSS:W.j8}}):(0,r.jsx)("pre",{className:"p-4 text-xs text-muted-foreground whitespace-pre-wrap",children:t.diff})})]}):(0,r.jsx)("div",{className:"px-4 py-3 text-xs text-muted-foreground",children:"No diff available"})},e.path)})})}let ee=new Map;function et({cwd:e,sessionId:t,embeddedChat:n=!0,manageSidebar:l=!0}){let i,c,o,{settings:d}=(0,J.t)(),{setSidebarSection:u,removeSidebarSection:f,closeSidebar:h,tabActions:m}=(0,s.E2)(),{send:x,subscribe:p}=(0,q.h)(),b=(0,y.G)(),[g,j]=(0,a.useState)(null),[C,S]=(0,a.useState)(!0),[T,I]=(0,a.useState)(null),O=ee.get(e)||{selectedFile:null,commitMsg:"",commitPanelOpen:window.matchMedia("(min-width: 768px)").matches,pushOnCommit:!1,stackedMode:!0,chatRatio:.3},[en,er]=(0,a.useState)(O.selectedFile),[el,ea]=(0,a.useState)(null),[es,ei]=(0,a.useState)(null),[ec,eo]=(0,a.useState)(!1),[ed,eu]=(0,a.useState)(null),[ef,eh]=(0,a.useState)(O.commitMsg),[em,ex]=(0,a.useState)(!1),[ep,eb]=(0,a.useState)(null),{checkedFiles:eg,toggleFile:ej,toggleAll:ey,setCheckedFiles:ew}=(0,V.e)(e),[ev,ek]=(0,a.useState)(O.pushOnCommit),[eN,eC]=(0,a.useState)(O.commitPanelOpen),[eS,eT]=(0,a.useState)(!1),[eI,eE]=(0,a.useState)(!1),[eP,eA]=(0,a.useState)(null),[eM,eF]=(0,a.useState)(O.stackedMode),[eR,eD]=(0,a.useState)(O.chatRatio),[eO,ez]=(0,a.useState)(null),[e$,eL]=(0,a.useState)(0),e_=(0,a.useRef)(null);(0,a.useEffect)(()=>{ee.set(e,{selectedFile:en,commitMsg:ef,commitPanelOpen:eN,pushOnCommit:ev,stackedMode:eM,chatRatio:eR})},[e,en,ef,eN,ev,eM,eR]);let eU=(0,a.useCallback)(t=>{t?.refresh||S(!0),I(null);let n=new URLSearchParams({cwd:e});t?.gitFetch&&n.set("fetch","1"),fetch(`/api/git/status?${n}`).then(e=>{if(!e.ok)throw Error("Failed");return e.json()}).then(e=>{j(e),t?.refresh&&eL(e=>e+1)}).catch(()=>I("Not a git repository")).finally(()=>S(!1))},[e]);(0,a.useEffect)(()=>{eU()},[eU]),(0,a.useEffect)(()=>{x({type:"watch:cwd",cwd:e})},[x,e]);let eW=(0,a.useRef)(null);(0,a.useEffect)(()=>{if(t)return p(e=>{if("session:status"!==e.type||!("sessionId"in e)||e.sessionId!==t)return;let n=eW.current;eW.current=e.status,"running"===n&&"idle"===e.status&&eU({refresh:!0})})},[t,p,eU]),(0,a.useEffect)(()=>p(e=>{"session:fs_changed"===e.type&&eU({refresh:!0})}),[p,eU]);let eG=(0,a.useCallback)(t=>{eo(!0),ea(null),ei(null),fetch(`/api/git/diff?cwd=${encodeURIComponent(e)}&file=${encodeURIComponent(t)}`).then(e=>{if(!e.ok)throw Error("Failed");return e.json()}).then(e=>{ea(e.diff);try{let t=(0,v.J2)(e.diff);if(t.length>0&&t[0].files.length>0){let n=t[0].files[0];null!=e.oldContent&&null!=e.newContent&&Y(n,e.oldContent,e.newContent),ei(n)}}catch{}}).catch(()=>ea(null)).finally(()=>eo(!1))},[e]),eB=(0,a.useRef)(e$);(0,a.useEffect)(()=>{if(!en||eM)return;let t=eB.current!==e$;eB.current=e$,t?fetch(`/api/git/diff?cwd=${encodeURIComponent(e)}&file=${encodeURIComponent(en)}`).then(e=>{if(!e.ok)throw Error("Failed");return e.json()}).then(e=>{ea(e.diff);try{let t=(0,v.J2)(e.diff);if(t.length>0&&t[0].files.length>0){let n=t[0].files[0];null!=e.oldContent&&null!=e.newContent&&Y(n,e.oldContent,e.newContent),ei(n)}}catch{}}).catch(()=>{}):eG(en)},[eM,en,eG,e$,e]),(0,a.useEffect)(()=>{if(!g||0===g.files.length||en||eM)return;let e=g.files[0];er(e.path),eG(e.path)},[g,en,eM,eG]);let eJ=(0,a.useCallback)(e=>{eM?ez(e.path):(er(e.path),eG(e.path),eu(null),h())},[eM,eG,h]),eq=(0,a.useCallback)((e,t)=>{e.preventDefault(),eu({x:e.clientX,y:e.clientY,file:t})},[]),eV=(0,a.useCallback)(async t=>{eu(null);try{if(!(await fetch("/api/git/discard",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e,file:t.path,status:t.status})})).ok)throw Error("Failed");en===t.path&&(er(null),ea(null)),eU()}catch{}},[e,en,eU]),eH=(0,a.useCallback)(async()=>{if(ef.trim()&&0!==eg.size){ex(!0),eb(null);try{let t=await fetch("/api/git/commit",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e,message:ef.trim(),files:Array.from(eg),push:ev})});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to commit")}eb({ok:!0,message:ev?"Committed and pushed":"Committed"}),eh(""),ew(new Set),er(null),ea(null),eU()}catch(e){eb({ok:!1,message:e instanceof Error?e.message:"Failed"})}finally{ex(!1)}}},[e,ef,eg,ev,eU,ew]),eX=(0,a.useCallback)(async()=>{if(0!==eg.size){eT(!0);try{let t=await fetch("/api/git/generate-message",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e,files:Array.from(eg)})}),n=await t.json();if(!t.ok)throw Error(n.error||"Failed");n.message&&eh(n.message)}catch(e){console.error("[generate-message]",e)}finally{eT(!1)}}},[e,eg]),eK=(0,a.useCallback)(async()=>{eE(!0),eA(null);try{let t=await fetch("/api/git/push",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:e})});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to push")}eA({ok:!0,message:"Pushed"}),eU()}catch(e){eA({ok:!1,message:e instanceof Error?e.message:"Failed"})}finally{eE(!1)}},[e,eU]),eY=(0,a.useCallback)(()=>{g&&ey(g.files.map(e=>e.path))},[g,ey]),eQ=(0,a.useCallback)(e=>{let t=window.innerWidth||1;eD(n=>Math.max(.15,Math.min(.5,n+e/t)))},[]),eZ=(0,a.useCallback)(()=>{ez(null)},[]),e0=(0,a.useCallback)(t=>{let n=t.startsWith("/")?t:`${e}/${t}`;m?.openFile(n)},[e,m]);if((0,a.useEffect)(()=>{if(l)return g&&0!==g.files.length?(u({id:"git-changes",title:"Changes",order:20,badge:String(g.files.length),content:(0,r.jsx)(Q,{files:g.files,selectedFile:eM?null:en,checkedFiles:eg,onFileClick:eJ,onContextMenu:eq,onToggleFile:ej,onToggleAll:eY})}),()=>f("git-changes")):void f("git-changes")},[l,g,en,eg,eM,eJ,eq,ej,eY,u,f]),(0,a.useEffect)(()=>{if(!ed)return;let e=e=>{e_.current&&!e_.current.contains(e.target)&&eu(null)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[ed]),C)return(0,r.jsx)("div",{className:"flex items-center justify-center flex-1",children:(0,r.jsx)(P.A,{className:"h-6 w-6 animate-spin text-muted-foreground"})});if(T)return(0,r.jsx)("div",{className:"flex items-center justify-center flex-1",children:(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:T})});if(!g)return null;let e1=n&&b&&!!t;return(0,r.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",children:[(0,r.jsxs)("div",{className:"shrink-0 border-b px-4 py-2 flex items-center gap-3",children:[(0,r.jsx)(F.A,{className:"h-4 w-4 text-muted-foreground"}),(0,r.jsx)("span",{className:"font-mono text-sm font-bold",children:g.branch}),(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:[g.files.length," file",1!==g.files.length?"s":""," changed"]}),(i=g.files.reduce((e,t)=>e+t.additions,0),c=g.files.reduce((e,t)=>e+t.deletions,0),i>0||c>0?(0,r.jsxs)("span",{className:"text-xs font-mono flex items-center gap-1",children:[i>0&&(0,r.jsxs)("span",{className:"text-green-500",children:["+",i]}),c>0&&(0,r.jsxs)("span",{className:"text-red-500",children:["-",c]})]}):null),g.ahead>0&&(0,r.jsxs)("span",{className:"text-xs text-muted-foreground",children:[g.ahead," unpushed"]}),eP&&(0,r.jsxs)("span",{className:(0,w.cn)("text-xs flex items-center gap-1",eP.ok?"text-green-500":"text-red-500"),children:[eP.ok&&(0,r.jsx)(N.A,{className:"h-3 w-3"}),eP.message]}),(0,r.jsx)("div",{className:"flex-1"}),g.files.length>0&&(0,r.jsxs)("div",{className:"flex items-center gap-0.5 rounded-md border p-0.5",children:[(0,r.jsx)("button",{onClick:()=>eF(!0),className:(0,w.cn)("rounded px-1.5 py-0.5 text-xs transition-colors",eM?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground"),title:"Stacked view",children:(0,r.jsx)(R.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)("button",{onClick:()=>eF(!1),className:(0,w.cn)("rounded px-1.5 py-0.5 text-xs transition-colors",eM?"text-muted-foreground hover:text-foreground":"bg-primary text-primary-foreground"),title:"Single file view",children:(0,r.jsx)(D.A,{className:"h-3.5 w-3.5"})})]}),g.ahead>0&&(0,r.jsxs)(B.$,{variant:"outline",size:"sm",onClick:eK,disabled:eI,className:"gap-1.5",children:[eI?(0,r.jsx)(P.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(z,{className:"h-3.5 w-3.5"}),"Push"]}),(0,r.jsx)(B.$,{variant:"ghost",size:"sm",onClick:()=>eU({gitFetch:!0}),children:"Refresh"})]}),(0,r.jsxs)("div",{className:"flex-1 min-h-0 flex flex-row",children:[(0,r.jsxs)("div",{className:"flex-1 min-w-0 flex flex-col",children:[(0,r.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:eM?(0,r.jsx)(Z,{files:g.files,cwd:e,diffStyle:d.diffStyle,scrollToFile:eO,onScrolled:eZ,onViewFile:e0,checkedFiles:eg,onToggleFile:ej,refreshKey:e$}):ec?(0,r.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,r.jsx)(P.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):en&&el?(0,r.jsx)("div",{className:"p-4",children:(0,r.jsxs)("div",{className:"rounded-lg border overflow-hidden",children:[(o=g.files.find(e=>e.path===en))?(0,r.jsxs)("div",{className:"sticky top-0 z-10 flex items-center gap-2 px-4 py-1.5 text-sm border-b bg-muted/80 backdrop-blur-sm",children:[X(o.status),(0,r.jsx)("span",{className:"font-mono text-xs truncate flex-1 min-w-0 text-left",dir:"rtl",title:o.path,children:(0,r.jsx)("bdo",{dir:"ltr",children:o.path})}),(0,r.jsx)(H,{checked:eg.has(o.path),onChange:()=>ej(o.path),onClick:e=>e.stopPropagation()}),(0,r.jsx)("button",{onClick:()=>e0(o.path),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",title:"Open in editor",children:(0,r.jsx)(M.A,{className:"h-3 w-3"})})]}):null,(0,r.jsx)(W.sU,{fallback:(0,r.jsx)("pre",{className:"p-4 text-xs text-muted-foreground whitespace-pre-wrap",children:el}),children:es?(0,r.jsx)(k.Q,{fileDiff:es,options:{theme:{dark:"pierre-dark",light:"pierre-light"},themeType:K()?"dark":"light",overflow:"wrap",diffStyle:d.diffStyle,disableFileHeader:!0,hunkSeparators:"line-info",expansionLineCount:20,unsafeCSS:W.j8}}):(0,r.jsx)("pre",{className:"p-4 text-xs text-muted-foreground whitespace-pre-wrap",children:el})})]})}):(0,r.jsx)("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground text-center px-4",children:g.files.length>0?"Select a file from the sidebar to view changes":"No changes"})}),g.files.length>0&&(0,r.jsxs)("div",{className:"shrink-0 border-t",children:[(0,r.jsxs)("button",{onClick:()=>eC(!eN),className:"w-full px-4 py-2 flex items-center gap-2 text-sm font-medium hover:bg-muted/50",children:[eN?(0,r.jsx)(E.A,{className:"h-3.5 w-3.5"}):(0,r.jsx)(A.A,{className:"h-3.5 w-3.5"}),"Commit (",eg.size," file",1!==eg.size?"s":"",")"]}),eN&&(0,r.jsxs)("div",{className:"px-4 pb-3 space-y-2",children:[(0,r.jsx)("textarea",{value:ef,onChange:e=>eh(e.target.value),placeholder:"Commit message...",className:"w-full rounded border bg-background px-3 py-2 text-sm resize-none focus:outline-none focus:ring-1 focus:ring-ring",rows:3}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsxs)(B.$,{size:"sm",variant:"outline",onClick:eX,disabled:eS||0===eg.size,className:"gap-1.5",children:[eS?(0,r.jsx)(P.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)($,{className:"h-3.5 w-3.5"}),eS?"Generating...":"Generate"]}),(0,r.jsxs)("label",{className:"flex items-center gap-1.5 text-xs text-muted-foreground cursor-pointer",children:[(0,r.jsx)(H,{checked:ev,onChange:()=>ek(!ev)}),"Push after commit"]}),(0,r.jsx)("div",{className:"flex-1"}),ep&&(0,r.jsxs)("span",{className:(0,w.cn)("text-xs flex items-center gap-1",ep.ok?"text-green-500":"text-red-500"),children:[ep.ok&&(0,r.jsx)(N.A,{className:"h-3 w-3"}),ep.message]}),(0,r.jsxs)(B.$,{size:"sm",onClick:eH,disabled:em||!ef.trim()||0===eg.size,className:"gap-1.5",children:[em?(0,r.jsx)(P.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,r.jsx)(L.A,{className:"h-3.5 w-3.5"}),ev?"Commit & Push":"Commit"]})]})]})]})]}),e1&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(G,{onResize:eQ}),(0,r.jsx)("div",{className:"flex flex-col shrink-0 border-l min-h-0",style:{width:`${100*eR}%`},children:(0,r.jsx)(U.I,{sessionId:t,cwd:e})})]})]}),ed&&(0,r.jsx)("div",{ref:e_,className:"fixed z-50 rounded border bg-background shadow-lg py-1 min-w-[140px]",style:{left:ed.x,top:ed.y},children:(0,r.jsxs)("button",{onClick:()=>eV(ed.file),className:"w-full px-3 py-1.5 text-sm text-left hover:bg-muted flex items-center gap-2 text-red-500",children:[(0,r.jsx)(_.A,{className:"h-3.5 w-3.5"}),"Discard changes"]})})]})}function en(e,t,n){let r=t.split(/\r?\n/).map(e=>e+"\n"),l=n.split(/\r?\n/).map(e=>e+"\n");for(let t of e.hunks){let e=t.deletionStart-1-t.deletionLineIndex,n=t.additionStart-1-t.additionLineIndex;for(let r of(t.deletionLineIndex=t.deletionStart-1,t.additionLineIndex=t.additionStart-1,t.hunkContent))r.deletionLineIndex+=e,r.additionLineIndex+=n}e.deletionLines=r,e.additionLines=l,e.isPartial=!1}function er({cwd:e,filePath:t}){let{settings:n}=(0,J.t)(),{tabActions:l}=(0,s.E2)(),{subscribe:i}=(0,q.h)(),[c,o]=(0,a.useState)(!0),[d,u]=(0,a.useState)(null),[f,h]=(0,a.useState)(null),[m,x]=(0,a.useState)("modified"),{checkedFiles:p,toggleFile:b}=(0,V.e)(e),g=p.has(t),j=(0,a.useRef)(void 0),y=(0,a.useCallback)(()=>{o(!0),u(null),h(null),fetch(`/api/git/diff?cwd=${encodeURIComponent(e)}&file=${encodeURIComponent(t)}`).then(e=>{if(!e.ok)throw Error("Failed");return e.json()}).then(e=>{u(e.diff),e.status&&x(e.status);try{let t=(0,v.J2)(e.diff);if(t.length>0&&t[0].files.length>0){let n=t[0].files[0];null!=e.oldContent&&null!=e.newContent&&en(n,e.oldContent,e.newContent),h(n)}}catch{}}).catch(()=>u(null)).finally(()=>o(!1))},[e,t]);(0,a.useEffect)(()=>{y()},[y]);let E=(0,a.useCallback)(()=>{fetch(`/api/git/diff?cwd=${encodeURIComponent(e)}&file=${encodeURIComponent(t)}`).then(e=>{if(!e.ok)throw Error("Failed");return e.json()}).then(e=>{u(e.diff),e.status&&x(e.status);try{let t=(0,v.J2)(e.diff);if(t.length>0&&t[0].files.length>0){let n=t[0].files[0];null!=e.oldContent&&null!=e.newContent&&en(n,e.oldContent,e.newContent),h(n)}}catch{}}).catch(()=>{})},[e,t]);(0,a.useEffect)(()=>i(e=>{"session:fs_changed"===e.type&&(clearTimeout(j.current),j.current=setTimeout(E,300))}),[i,E]);let A=(0,a.useCallback)(()=>{b(t)},[b,t]),F=(0,a.useCallback)(()=>{let n=t.startsWith("/")?t:`${e}/${t}`;l?.openFile(n)},[e,t,l]);return c?(0,r.jsx)("div",{className:"flex items-center justify-center flex-1",children:(0,r.jsx)(P.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):d?(0,r.jsx)("div",{className:"flex flex-col flex-1 min-h-0",children:(0,r.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto",children:(0,r.jsx)("div",{className:"p-4",children:(0,r.jsxs)("div",{className:"rounded-lg border overflow-hidden",children:[(0,r.jsxs)("div",{className:"sticky top-0 z-10 flex items-center gap-2 px-4 py-1.5 text-sm border-b bg-muted/80 backdrop-blur-sm",children:[function(e){switch(e){case"added":case"untracked":return(0,r.jsx)(C.A,{className:"h-3.5 w-3.5 text-green-500 shrink-0"});case"deleted":return(0,r.jsx)(S.A,{className:"h-3.5 w-3.5 text-red-500 shrink-0"});case"renamed":return(0,r.jsx)(T.A,{className:"h-3.5 w-3.5 text-blue-500 shrink-0"});default:return(0,r.jsx)(I.A,{className:"h-3.5 w-3.5 text-yellow-500 shrink-0"})}}(m),(0,r.jsx)("span",{className:"font-mono text-xs truncate flex-1 min-w-0 text-left",dir:"rtl",title:t,children:(0,r.jsx)("bdo",{dir:"ltr",children:t})}),(0,r.jsx)("button",{type:"button",role:"checkbox","aria-checked":g,onClick:A,className:(0,w.cn)("h-4 w-4 shrink-0 rounded border flex items-center justify-center transition-colors",g?"border-primary bg-primary text-primary-foreground":"border-muted-foreground/40 bg-transparent hover:border-muted-foreground/60"),children:g&&(0,r.jsx)(N.A,{className:"h-3 w-3",strokeWidth:3})}),(0,r.jsx)("button",{onClick:F,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",title:"Open in editor",children:(0,r.jsx)(M.A,{className:"h-3 w-3"})})]}),(0,r.jsx)(W.sU,{fallback:(0,r.jsx)("pre",{className:"p-4 text-xs text-muted-foreground whitespace-pre-wrap",children:d}),children:f?(0,r.jsx)(k.Q,{fileDiff:f,options:{theme:{dark:"pierre-dark",light:"pierre-light"},themeType:!("u"<typeof document)&&document.documentElement.classList.contains("dark")?"dark":"light",overflow:"wrap",diffStyle:n.diffStyle,disableFileHeader:!0,hunkSeparators:"line-info",expansionLineCount:20,unsafeCSS:W.j8}}):(0,r.jsx)("pre",{className:"p-4 text-xs text-muted-foreground whitespace-pre-wrap",children:d})})]})})})}):(0,r.jsx)("div",{className:"flex items-center justify-center flex-1 text-sm text-muted-foreground",children:"No diff available"})}var el=n(2125),ea=n(65377),es=n(25182);let ei=(0,O.A)("text-wrap",[["path",{d:"m16 16-3 3 3 3",key:"117b85"}],["path",{d:"M3 12h14.5a1 1 0 0 1 0 7H13",key:"18xa6z"}],["path",{d:"M3 19h6",key:"1ygdsz"}],["path",{d:"M3 5h18",key:"1u36vt"}]]);var ec=n(9005),eo=n(18189),ed=n(8187),eu=n(96301),ef=n(64233),eh=n(42763);let em=new Map,ex=new Map;function ep(e){for(let t of Array.from(e.querySelectorAll("mark.file-search-match"))){let e=t.parentNode;if(e){for(;t.firstChild;)e.insertBefore(t.firstChild,t);e.removeChild(t),e.normalize()}}}function eb(e,t){let n=e.querySelectorAll("mark.file-search-match");n.forEach(e=>{e.style.backgroundColor="rgba(250, 204, 21, 0.35)"});let r=n[t];r&&(r.style.backgroundColor="rgba(234, 88, 12, 0.5)",r.scrollIntoView({block:"center",behavior:"smooth"}))}function eg({cwd:e,initialFile:t,manageSidebar:n=!0}){let{setSidebarSection:l,removeSidebarSection:i,closeSidebar:c,tabActions:o}=(0,s.E2)(),{subscribe:d}=(0,q.h)(),[f,h]=(0,a.useState)(()=>t||em.get(e)||null),[m,x]=(0,a.useState)(null),[p,b]=(0,a.useState)(!1),[g,j]=(0,a.useState)(!1),[y,w]=(0,a.useState)(!1),[v,k]=(0,a.useState)(!1),[N,C]=(0,a.useState)(!1),S=(0,a.useRef)(0),T=(0,a.useRef)(null),I=(0,a.useRef)(null),M=(0,a.useRef)(null),F=(0,a.useRef)(-1),[R,D]=(0,a.useState)(!1),[O,z]=(0,a.useState)(""),[$,L]=(0,a.useState)(0),[_,U]=(0,a.useState)(-1);(0,a.useEffect)(()=>{"1"===localStorage.getItem("cockpit-files-wrap")&&w(!0),"1"===localStorage.getItem("cockpit-files-preview")&&k(!0)},[]);let W=(0,a.useCallback)(()=>{w(e=>{let t=!e;return localStorage.setItem("cockpit-files-wrap",t?"1":"0"),t})},[]),G=(0,a.useCallback)(()=>{k(e=>{let t=!e;return localStorage.setItem("cockpit-files-preview",t?"1":"0"),t})},[]),B=(0,a.useCallback)(()=>{D(!0),requestAnimationFrame(()=>{M.current?.focus(),M.current?.select()})},[]),J=(0,a.useCallback)(()=>{D(!1),z("")},[]),V=(0,a.useCallback)(e=>{if(0===$||!T.current)return;let t=((_+e)%$+$)%$;F.current=t,U(t),eb(T.current,t)},[$,_]),H=(0,a.useCallback)(e=>{"Escape"===e.key?J():"Enter"===e.key&&(e.preventDefault(),V(e.shiftKey?-1:1))},[J,V]);(0,a.useEffect)(()=>{let e;if(!R||!O||!T.current){T.current&&ep(T.current),L(0),F.current=-1,U(-1);return}let t=T.current,n=e=>{let n,r=function(e,t){if(ep(e),!t)return 0;let n=t.toLowerCase(),r=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),l=[];for(;r.nextNode();){let e=r.currentNode.parentNode?.nodeName;"STYLE"!==e&&"SCRIPT"!==e&&l.push(r.currentNode)}let a=0;for(let e of l){let r=e.textContent??"",l=r.toLowerCase(),s=[],i=0;for(;;){let e=l.indexOf(n,i);if(-1===e)break;s.push(e),i=e+1}if(!s.length)continue;let c=document.createDocumentFragment(),o=0;for(let e of s){e>o&&c.appendChild(document.createTextNode(r.slice(o,e)));let n=document.createElement("mark");n.className="file-search-match",n.style.backgroundColor="rgba(250, 204, 21, 0.35)",n.style.color="inherit",n.style.borderRadius="1px",n.textContent=r.slice(e,e+t.length),c.appendChild(n),a++,o=e+t.length}o<r.length&&c.appendChild(document.createTextNode(r.slice(o))),e.parentNode?.replaceChild(c,e)}return a}(t,O);L(r),n=!e&&F.current>=0&&r>0?Math.min(F.current,r-1):r>0?0:-1,F.current=n,U(n),n>=0&&eb(t,n)};e=requestAnimationFrame(()=>n(!0));let r=new MutationObserver(()=>{t.querySelector("mark.file-search-match")||(e=requestAnimationFrame(()=>n(!1)))});return r.observe(t,{childList:!0,subtree:!0}),()=>{cancelAnimationFrame(e),r.disconnect()}},[R,O,m,y,v]);let X=(0,a.useCallback)(t=>{h(t),em.set(e,t),window.innerWidth<768&&c()},[e,c]),K=(0,a.useCallback)(e=>{o?o.openFile(e):X(e),j(!1)},[o,X]);if((0,a.useEffect)(()=>{if(n)return l({id:"file-tree",title:"Files",content:(0,r.jsx)(eu.h,{cwd:e,selectedFile:f,onSelectFile:X}),order:30,actions:(0,r.jsx)("button",{onClick:()=>j(!0),title:"Open file",className:"flex items-center justify-center rounded p-0.5 hover:bg-accent text-muted-foreground",children:(0,r.jsx)(el.A,{className:"h-3.5 w-3.5"})})}),()=>i("file-tree")},[e,f,X,l,i,n]),(0,a.useEffect)(()=>{if(!f)return void x(null);C(!1);let e=ex.get(f);if(e)return void x(e);let t=++S.current;b(!0),fetch(`/api/filesystem/read?path=${encodeURIComponent(f)}`).then(e=>{if(!e.ok)throw Error("Failed to read file");return e.json()}).then(e=>{if(S.current===t){if(ex.size>=50){let e=ex.keys().next().value;void 0!==e&&ex.delete(e)}ex.set(f,e),x(e)}}).catch(()=>{S.current===t&&x(null)}).finally(()=>{S.current===t&&b(!1)})},[f]),(0,a.useEffect)(()=>{if(!f)return;let e=async()=>{let e=ex.get(f);if(e?.mtimeMs)try{let t=await fetch(`/api/filesystem/read?path=${encodeURIComponent(f)}&stat=true`);if(!t.ok)return;if((await t.json()).mtimeMs!==e.mtimeMs){let e=I.current?.scrollTop??0,t=await fetch(`/api/filesystem/read?path=${encodeURIComponent(f)}`);if(!t.ok)return;let n=await t.json();ex.set(f,n),x(n),requestAnimationFrame(()=>{I.current&&(I.current.scrollTop=e)})}}catch{}};return d(t=>{"session:fs_changed"===t.type&&e()})},[f,d]),!f)return(0,r.jsx)("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Select a file to view"});if(p)return(0,r.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,r.jsx)(P.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})});if(!m)return(0,r.jsx)("div",{className:"flex items-center justify-center h-full text-sm text-muted-foreground",children:"Failed to read file"});let Y=function(e,t){if(t.startsWith(e)){let n=t.slice(e.length);return n.startsWith("/")?n.slice(1):n}return t}(e,f),Q=(0,u.uk)(f)||f,Z=Y.slice(0,Y.length-Q.length),ee=(0,eo.WG)(f),et="markdown"===ee||"mdx"===ee,en=et&&v,er=!m.binary&&!m.image;return(0,r.jsxs)("div",{className:"flex flex-col h-full min-h-0",children:[(0,r.jsxs)("div",{className:"shrink-0 flex items-center gap-1 border-b px-4 py-2 font-mono text-xs",children:[Z&&(0,r.jsx)("span",{className:"text-muted-foreground",children:Z}),(0,r.jsx)("span",{className:"font-bold",children:Q}),m.truncated&&(0,r.jsx)("span",{className:"ml-2 text-muted-foreground",children:"(truncated to 100KB)"}),(0,r.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[er&&(0,r.jsx)("button",{type:"button",onClick:R?J:B,"aria-label":"Find in file",title:"Find in file",className:`flex items-center justify-center rounded p-1 hover:bg-accent ${R?"text-foreground":"text-muted-foreground"}`,children:(0,r.jsx)(ea.A,{className:"h-3.5 w-3.5"})}),et&&(0,r.jsx)("button",{type:"button",onClick:G,"aria-label":v?"Show source":"Show preview","aria-pressed":v,title:v?"Show source":"Show preview",className:`flex items-center justify-center rounded p-1 hover:bg-accent ${v?"text-foreground":"text-muted-foreground"}`,children:(0,r.jsx)(es.A,{className:"h-3.5 w-3.5"})}),er&&!en&&(0,r.jsx)("button",{type:"button",onClick:W,"aria-label":y?"Disable line wrap":"Enable line wrap","aria-pressed":y,title:y?"Disable line wrap":"Enable line wrap",className:`flex items-center justify-center rounded p-1 hover:bg-accent ${y?"text-foreground":"text-muted-foreground"}`,children:(0,r.jsx)(ei,{className:"h-3.5 w-3.5"})})]})]}),R&&(0,r.jsxs)("div",{className:"shrink-0 flex items-center gap-1.5 border-b px-4 py-1.5",children:[(0,r.jsx)("input",{ref:M,value:O,onChange:e=>z(e.target.value),onKeyDown:H,placeholder:"Find in file...",className:"flex-1 min-w-0 bg-transparent text-xs outline-none placeholder:text-muted-foreground"}),O&&(0,r.jsx)("span",{className:"text-[10px] text-muted-foreground tabular-nums shrink-0",children:$>0?`${_+1} of ${$}`:"No results"}),(0,r.jsx)("button",{type:"button",onClick:()=>V(-1),disabled:0===$,className:"flex items-center justify-center rounded p-0.5 hover:bg-accent text-muted-foreground disabled:opacity-30",children:(0,r.jsx)(A.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)("button",{type:"button",onClick:()=>V(1),disabled:0===$,className:"flex items-center justify-center rounded p-0.5 hover:bg-accent text-muted-foreground disabled:opacity-30",children:(0,r.jsx)(E.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)("button",{type:"button",onClick:J,className:"flex items-center justify-center rounded p-0.5 hover:bg-accent text-muted-foreground",children:(0,r.jsx)(ec.A,{className:"h-3 w-3"})})]}),(0,r.jsx)("div",{ref:T,className:"flex-1 min-h-0 flex flex-col",children:m.image?(0,r.jsx)("div",{ref:I,className:"flex-1 min-h-0 overflow-auto flex items-center justify-center p-4",children:N?(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:"Could not display image"}):(0,r.jsx)("img",{src:`/api/filesystem/read?path=${encodeURIComponent(f)}&raw=true${m.mtimeMs?`&t=${m.mtimeMs}`:""}`,alt:Q,className:"max-w-full max-h-full object-contain",onError:()=>C(!0)})}):m.binary?(0,r.jsx)("div",{className:"flex items-center justify-center flex-1 text-sm text-muted-foreground",children:"Binary file"}):en?(0,r.jsx)("div",{ref:I,className:"flex-1 min-h-0 overflow-y-auto p-4",children:(0,r.jsx)(ef.Y,{content:m.content})}):(0,r.jsx)("div",{ref:I,className:"flex-1 min-h-0 overflow-auto",children:(0,r.jsx)(eo.NG,{code:m.content,language:ee,dark:!("u"<typeof document)&&document.documentElement.classList.contains("dark"),fullHeight:!0,wrap:y})})}),(0,r.jsx)(eh.lG,{open:g,onOpenChange:j,children:(0,r.jsxs)(eh.Cf,{className:"sm:max-w-lg",children:[(0,r.jsx)(eh.c7,{children:(0,r.jsx)(eh.L3,{children:"Open File"})}),(0,r.jsx)(ed.N,{startPath:e,onSelect:K,onCancel:()=>j(!1)})]})})]})}var ej=n(25494),ey=n(36483);let ew=(0,O.A)("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);var ev=n(16449);let ek=(0,O.A)("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);function eN(e,t,n,r){let l=Array.from(e.querySelectorAll("[data-tab-id]"));if(0===l.length)return 0;let a=r.indexOf(n);for(let e=0;e<l.length;e++){let n=l[e].getBoundingClientRect();if(t<n.left+n.width/2){if(e===a||e===a+1)return null;return e}}let s=l.length;return s===a||s===a+1?null:s}function eC({splitRatio:e}){let t=j(),n=(0,y.G)(),l=(0,a.useRef)(null),[s,i]=(0,a.useState)(null),[c,o]=(0,a.useState)(null),[d,u]=(0,a.useState)(!1),f=(0,a.useRef)(null),h=(0,a.useRef)(null),m=(0,a.useRef)(null);if(!t||t.tabs.length<=1)return null;let{activeTabId:x,splitTabId:p,rightPaneTabIds:b,setActiveTab:g,closeTab:v,setSplitTab:k,moveTab:N,moveTabToPane:C}=t,S=n&&null!==p,T=t.tabs.filter(e=>"chat"!==e.type),I=T.map(e=>e.id),E=()=>{l.current=null,i(null),o(null),u(!1)},P=()=>{l.current=null,i(null),o(null),u(!1)},A=(e,t)=>(0,r.jsx)("div",{className:(0,w.cn)("self-stretch shrink-0 rounded-full transition-all",s===e&&c===(t??null)?"w-0.5 bg-primary mx-0.5":d?"w-1":"w-0")},`ind-${t||"main"}-${e}`),M=(e,t,n,a)=>{let s;return(0,r.jsxs)("button",{"data-tab-id":"chat"!==e.type?e.id:void 0,draggable:a,onDragStart:a?(s=e.id,e=>{l.current=s,u(!0),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",s)}):void 0,onDragEnd:a?E:void 0,onClick:n,className:(0,w.cn)("flex items-center gap-1.5 px-3 py-1.5 md:px-4 md:py-2.5 text-xs md:text-sm font-medium whitespace-nowrap border-b-2 transition-colors group",t?"border-primary text-foreground":"border-transparent text-muted-foreground hover:text-foreground",a&&"cursor-grab active:cursor-grabbing"),children:[function(e){switch(e.type){case"chat":return(0,r.jsx)(ej.A,{className:"h-3 w-3 md:h-3.5 md:w-3.5 shrink-0"});case"file":return(0,r.jsx)(ey.A,{className:"h-3 w-3 md:h-3.5 md:w-3.5 shrink-0"});case"diff":return(0,r.jsx)(ew,{className:"h-3 w-3 md:h-3.5 md:w-3.5 shrink-0"});case"changes":return(0,r.jsx)(F.A,{className:"h-3 w-3 md:h-3.5 md:w-3.5 shrink-0"});case"terminal":return(0,r.jsx)(ev.A,{className:"h-3 w-3 md:h-3.5 md:w-3.5 shrink-0"})}}(e),(0,r.jsx)("span",{className:"truncate max-w-[120px]",children:function(e){switch(e.type){case"chat":return"Chat";case"file":case"diff":case"terminal":return e.label;case"changes":return"Changes"}}(e)}),"chat"!==e.type&&(0,r.jsx)("span",{role:"button",tabIndex:0,onClick:t=>{t.stopPropagation(),v(e.id)},onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.stopPropagation(),v(e.id))},className:"ml-0.5 rounded p-0.5 hover:bg-muted cursor-default",children:(0,r.jsx)(ec.A,{className:"h-2.5 w-2.5 md:h-3 md:w-3"})})]})},R=n&&T.length>0?(0,r.jsx)("button",{onClick:()=>{if(p)k(null);else{let e=t.tabs.find(e=>e.id===x&&"chat"!==e.type)||t.tabs.find(e=>"chat"!==e.type);e&&(k(e.id),"chat"!==x&&g("chat"))}},title:p?"Close split view":"Split view",className:(0,w.cn)("ml-auto shrink-0 flex items-center justify-center px-2 py-1.5 md:px-3 md:py-2.5 text-muted-foreground hover:text-foreground transition-colors",p&&"text-primary"),children:(0,r.jsx)(ek,{className:"h-3.5 w-3.5 md:h-4 md:w-4"})}):null;if(S){let n=e??.5,a=t.tabs.filter(e=>!b.includes(e.id)),d=a.filter(e=>"chat"!==e.type),u=d.map(e=>e.id),f=t.tabs.filter(e=>b.includes(e.id)),j=f.map(e=>e.id),y=e=>{e.preventDefault();let n=l.current;if(!n)return void P();let r=b.includes(n);"left"===c&&r?C(n,"left"):"right"!==c||r?null!==s&&c&&N(n,function(e,t,n){if(0===e.length||t>=e.length){let t=e[e.length-1];return t?n.findIndex(e=>e.id===t.id)+1:n.length}return n.findIndex(n=>n.id===e[t].id)}("left"===c?d:f,s,t.tabs)):C(n,"right"),P()};return(0,r.jsxs)("div",{className:"shrink-0 border-b flex items-center bg-background",children:[(0,r.jsxs)("div",{ref:h,className:"flex items-center overflow-x-auto scrollbar-none min-w-0",style:{width:`${(1-n)*100}%`},onDragOver:e=>{if(l.current){if(e.preventDefault(),e.dataTransfer.dropEffect="move",!h.current){i(0),o("left");return}i(eN(h.current,e.clientX,l.current,u)??0),o("left")}},onDrop:y,children:[M(a[0],x===a[0].id,()=>g(a[0].id),!1),d.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center",children:[A(t,"left"),M(e,e.id===x,()=>g(e.id),!0)]},e.id)),A(d.length,"left")]}),(0,r.jsx)("div",{className:"w-1 shrink-0 bg-border"}),(0,r.jsxs)("div",{ref:m,className:"flex items-center overflow-x-auto scrollbar-none min-w-0",style:{width:`${100*n}%`},onDragOver:e=>{if(l.current){if(e.preventDefault(),e.dataTransfer.dropEffect="move",!m.current){i(0),o("right");return}i(eN(m.current,e.clientX,l.current,j)??0),o("right")}},onDrop:y,children:[f.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center",children:[A(t,"right"),M(e,e.id===p,()=>k(e.id),!0)]},e.id)),A(f.length,"right"),R]})]})}return(0,r.jsxs)("div",{ref:f,className:"shrink-0 border-b flex items-center overflow-x-auto scrollbar-none bg-background",onDragOver:e=>{!l.current||(e.preventDefault(),e.dataTransfer.dropEffect="move",f.current&&(i(eN(f.current,e.clientX,l.current,I)),o(null)))},onDrop:e=>{e.preventDefault(),l.current&&null!==s&&N(l.current,s+1),P()},children:[M(t.tabs[0],"chat"===x,()=>g("chat"),!1),T.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center",children:[A(t),M(e,e.id===x,()=>g(e.id),!0)]},e.id)),A(T.length),R]})}let eS=o()(()=>Promise.resolve().then(n.bind(n,27417)).then(e=>e.TerminalPanel),{loadableGenerated:{webpack:()=>[27417]},ssr:!1});function eT(e){return(0,r.jsx)(g,{sessionId:e.sessionId,children:(0,r.jsx)(eI,{...e})})}function eI({sessionId:e,cwd:t,initialName:n,historyView:l}){let i=j(),{setTabActions:c}=(0,s.E2)(),o=(0,y.G)(),d=(0,a.useRef)(null),[u,f]=(0,a.useState)(.5);(0,a.useEffect)(()=>(c({openFile:i.openFile,openDiff:i.openDiff,openChanges:i.openChanges,openTerminal:i.openTerminal}),()=>c(null)),[i.openFile,i.openDiff,i.openChanges,i.openTerminal,c]);let{activeTabId:h,splitTabId:m,rightPaneTabIds:x,tabs:p}=i,b=o&&null!==m,g=(0,a.useCallback)(e=>{let t=d.current;if(!t)return;let n=t.offsetWidth;0!==n&&f(t=>Math.max(.25,Math.min(.75,t+e/n)))},[]);(0,a.useEffect)(()=>{let e=async e=>{let n=e.metaKey||e.ctrlKey;if(n&&"w"===e.key&&"chat"!==i.activeTabId&&(e.preventDefault(),i.closeTab(i.activeTabId)),n&&"`"===e.key){e.preventDefault();try{let e=await fetch("/api/terminal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:t})});if(e.ok){let{terminalId:t}=await e.json();i.openTerminal(t)}}catch{}}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[i,t]);let v=p.filter(e=>"file"===e.type),k=p.filter(e=>"diff"===e.type),N=p.filter(e=>"terminal"===e.type),C=p.some(e=>"changes"===e.type),S=(0,a.useCallback)(e=>{e.preventDefault(),e.dataTransfer.dropEffect="move"},[]),T=(0,a.useCallback)(e=>{e.preventDefault();let t=e.dataTransfer.getData("text/plain");t&&"chat"!==t&&x.includes(t)&&i.moveTabToPane(t,"left")},[i,x]),I=(0,a.useCallback)(e=>{e.preventDefault();let t=e.dataTransfer.getData("text/plain");t&&"chat"!==t&&(x.includes(t)?i.setSplitTab(t):i.moveTabToPane(t,"right"))},[i,x]);if(b){let a=v.filter(e=>!x.includes(e.id)),s=k.filter(e=>!x.includes(e.id)),i=N.filter(e=>!x.includes(e.id)),c=C&&!x.includes("changes"),o=v.filter(e=>x.includes(e.id)),f=k.filter(e=>x.includes(e.id)),p=N.filter(e=>x.includes(e.id)),j=C&&x.includes("changes");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eC,{splitRatio:b?u:void 0}),(0,r.jsxs)("div",{ref:d,className:"flex-1 min-h-0 flex flex-row",children:[(0,r.jsxs)("div",{className:"flex flex-col min-w-0 min-h-0",style:{width:`${(1-u)*100}%`},onDragOver:S,onDrop:T,children:[(0,r.jsx)(U.I,{sessionId:e,cwd:t,initialName:n,historyView:l,className:(0,w.cn)("chat"!==h&&"hidden")}),a.map(e=>(0,r.jsx)("div",{className:(0,w.cn)("flex flex-col flex-1 min-h-0",h!==e.id&&"hidden"),children:(0,r.jsx)(eg,{cwd:t,initialFile:e.filePath,manageSidebar:!1})},e.id)),s.map(e=>(0,r.jsx)("div",{className:(0,w.cn)("flex flex-col flex-1 min-h-0",h!==e.id&&"hidden"),children:(0,r.jsx)(er,{cwd:t,filePath:e.filePath})},e.id)),c&&(0,r.jsx)("div",{className:(0,w.cn)("flex flex-col flex-1 min-h-0","changes"!==h&&"hidden"),children:(0,r.jsx)(et,{cwd:t,sessionId:e,embeddedChat:!1,manageSidebar:!1})}),i.map(e=>(0,r.jsx)("div",{className:(0,w.cn)("flex flex-col flex-1 min-h-0 min-w-0",h!==e.id&&"hidden"),children:(0,r.jsx)(eS,{terminalId:e.terminalId,cwd:t,active:h===e.id})},e.id))]}),(0,r.jsx)(G,{onResize:g}),(0,r.jsxs)("div",{className:"flex flex-col min-w-0 min-h-0",style:{width:`${100*u}%`},onDragOver:S,onDrop:I,children:[o.map(e=>(0,r.jsx)("div",{className:(0,w.cn)("flex flex-col flex-1 min-h-0",m!==e.id&&"hidden"),children:(0,r.jsx)(eg,{cwd:t,initialFile:e.filePath,manageSidebar:!1})},e.id)),f.map(e=>(0,r.jsx)("div",{className:(0,w.cn)("flex flex-col flex-1 min-h-0",m!==e.id&&"hidden"),children:(0,r.jsx)(er,{cwd:t,filePath:e.filePath})},e.id)),j&&(0,r.jsx)("div",{className:(0,w.cn)("flex flex-col flex-1 min-h-0","changes"!==m&&"hidden"),children:(0,r.jsx)(et,{cwd:t,sessionId:e,embeddedChat:!1,manageSidebar:!1})}),p.map(e=>(0,r.jsx)("div",{className:(0,w.cn)("flex flex-col flex-1 min-h-0 min-w-0",m!==e.id&&"hidden"),children:(0,r.jsx)(eS,{terminalId:e.terminalId,cwd:t,active:m===e.id})},e.id))]})]})]})}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(eC,{splitRatio:b?u:void 0}),(0,r.jsx)(U.I,{sessionId:e,cwd:t,initialName:n,historyView:l,className:(0,w.cn)("chat"!==h&&"hidden")}),v.map(e=>(0,r.jsx)("div",{className:(0,w.cn)("flex flex-col flex-1 min-h-0",h!==e.id&&"hidden"),children:(0,r.jsx)(eg,{cwd:t,initialFile:e.filePath,manageSidebar:!1})},e.id)),k.map(e=>(0,r.jsx)("div",{className:(0,w.cn)("flex flex-col flex-1 min-h-0",h!==e.id&&"hidden"),children:(0,r.jsx)(er,{cwd:t,filePath:e.filePath})},e.id)),C&&(0,r.jsx)("div",{className:(0,w.cn)("flex flex-col flex-1 min-h-0","changes"!==h&&"hidden"),children:(0,r.jsx)(et,{cwd:t,sessionId:e,embeddedChat:!1,manageSidebar:!1})}),N.map(e=>(0,r.jsx)("div",{className:(0,w.cn)("flex flex-col flex-1 min-h-0 min-w-0",h!==e.id&&"hidden"),children:(0,r.jsx)(eS,{terminalId:e.terminalId,cwd:t,active:h===e.id})},e.id))]})}function eE({params:e}){let{id:t}=(0,a.use)(e),n=(0,l.useSearchParams)(),c=n.get("cwd")||"",o=n.get("name")||void 0,d="true"===n.get("historyView");return(0,a.useEffect)(()=>{console.log(`[session-page] mounted ${t.slice(0,8)} at ${performance.now().toFixed(0)}ms`)},[t]),(0,s.mq)(c||void 0),(0,s.tB)(t),(0,a.useEffect)(()=>{(0,i.MN)(t),(0,i.HC)(t)},[t]),(0,r.jsx)(eT,{sessionId:t,cwd:c||"",initialName:o,historyView:d})}},27417:(e,t,n)=>{"use strict";n.r(t),n.d(t,{TerminalPanel:()=>g,disposeTerminalInstance:()=>p});var r=n(95155),l=n(66763),a=n(9005),s=n(99537);let i=(0,s.A)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var c=n(2125);let o=(0,s.A)("palette",[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]]);var d=n(12115),u=n(11701),f=n(22317),h=n(40980);let m={cockpit:{label:"Cockpit",bg:"#111111",fg:"#e8e8e8",cursor:"#e8e8e8",selection:"rgba(255, 255, 255, 0.15)"},dark:{label:"Dark",bg:"#1e1e1e",fg:"#d4d4d4",cursor:"#aeafad",selection:"rgba(86, 156, 214, 0.3)"},dracula:{label:"Dracula",bg:"#282a36",fg:"#f8f8f2",cursor:"#f8f8f2",selection:"rgba(68, 71, 90, 0.5)"},catppuccin:{label:"Catppuccin",bg:"#1e1e2e",fg:"#cdd6f4",cursor:"#f5e0dc",selection:"rgba(88, 91, 112, 0.4)"},tokyoNight:{label:"Tokyo Night",bg:"#1a1b26",fg:"#a9b1d6",cursor:"#c0caf5",selection:"rgba(41, 46, 66, 0.5)"},nord:{label:"Nord",bg:"#2e3440",fg:"#d8dee9",cursor:"#d8dee9",selection:"rgba(67, 76, 94, 0.5)"},gruvbox:{label:"Gruvbox",bg:"#282828",fg:"#ebdbb2",cursor:"#ebdbb2",selection:"rgba(168, 153, 132, 0.3)"},solarized:{label:"Solarized",bg:"#002b36",fg:"#839496",cursor:"#93a1a1",selection:"rgba(38, 139, 210, 0.3)"},monokai:{label:"Monokai",bg:"#272822",fg:"#f8f8f2",cursor:"#f8f8f0",selection:"rgba(73, 72, 62, 0.5)"},oneDark:{label:"One Dark",bg:"#282c34",fg:"#abb2bf",cursor:"#528bff",selection:"rgba(62, 68, 81, 0.5)"}},x=new Map;function p(e){let t=x.get(e);t&&(t.term.dispose(),t.wrapper.remove(),x.delete(e))}let b=[{label:"Esc",data:"\x1b"},{label:"Ctrl",modifier:!0},{label:"Tab",data:" "},{label:"|",data:"|",separator:!0},{label:"←",data:"\x1b[D"},{label:"↑",data:"\x1b[A"},{label:"↓",data:"\x1b[B"},{label:"→",data:"\x1b[C"}];function g({terminalId:e,cwd:t,active:n=!0}){let[l,a]=(0,d.useState)(e),[s,i]=(0,d.useState)(0),[c,o]=(0,d.useState)(!1),u=(0,d.useCallback)(async()=>{o(!0);try{let e=await fetch("/api/terminal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({cwd:t})});if(!e.ok)return;let{terminalId:n}=await e.json();a(n),i(e=>e+1)}finally{o(!1)}},[t]);return(0,r.jsx)(j,{terminalId:l,cwd:t,active:n,onReconnect:u,reconnecting:c},`${l}-${s}`)}function j({terminalId:e,cwd:t,active:s=!0,onReconnect:p,reconnecting:g}){let y=(0,d.useRef)(null),w=(0,d.useRef)(null),v=(0,d.useRef)(null),k=(0,d.useRef)(null),[N,C]=(0,d.useState)(null),[S,T]=(0,d.useState)(!1),I=(0,d.useRef)(!1),E=(0,d.useRef)(s);E.current=s;let P=(0,u.G)(),A=(0,d.useRef)(0),M=(0,d.useRef)(void 0),F=(0,d.useRef)(void 0),R=(0,d.useRef)(!1),[D,O]=(0,d.useState)(!1),z=(0,d.useRef)(0),[$,L]=(0,d.useState)(!1),{settings:_,updateSetting:U}=(0,f.t)();(0,d.useEffect)(()=>{let e=window.visualViewport,t=()=>e?e.height:window.innerHeight;z.current=Math.max(z.current,t());let n=()=>{let e=t();z.current=Math.max(z.current,e),O(e<.75*z.current),E.current&&v.current&&v.current.fit()},r=e??window;return r.addEventListener("resize",n),()=>r.removeEventListener("resize",n)},[]),(0,d.useEffect)(()=>{s&&v.current&&v.current.fit()},[s]),(0,d.useEffect)(()=>{let e=w.current;if(!e)return;let t=m[_.terminalTheme]??m.dark;e.options.theme={background:t.bg,foreground:t.fg,cursor:t.cursor,selectionBackground:t.selection},y.current&&(y.current.parentElement.style.backgroundColor=t.bg)},[_.terminalTheme]),(0,d.useEffect)(()=>{let e=w.current;e&&(e.options.fontSize=_.terminalFontSize,v.current?.fit())},[_.terminalFontSize]),(0,d.useEffect)(()=>{let e=w.current;e&&(e.options.scrollback=_.terminalScrollback)},[_.terminalScrollback]),(0,d.useEffect)(()=>{let t=!1,r=null,l=null,a=[];function s(e){let t=k.current;t?.readyState===WebSocket.OPEN&&t.send(e)}async function i(){k.current&&(k.current.onclose=null,k.current.close(),k.current=null);try{let n=await fetch("/api/auth/ws-token");if(!n.ok||t)return;let{token:l}=await n.json();if(t)return;let a=R.current?"0":"1",s="https:"===window.location.protocol?"wss:":"ws:",c=`${s}//${window.location.host}/ws/terminal?token=${l}&terminalId=${e}&replay=${a}`,o=new WebSocket(c);k.current=o,o.onopen=()=>{A.current=0,C(null),R.current=!0,r&&r.cols>1&&r.rows>1&&o.send(`\x01R${r.cols};${r.rows}`)},o.onmessage=e=>{r?.write(e.data)},o.onclose=n=>{if(k.current=null,t)return;if(1008===n.code){x.delete(e),C("Terminal disconnected");return}let r=Math.min(1e3*2**A.current,1e4);A.current++,M.current=setTimeout(()=>{t||i()},r)},o.onerror=()=>{}}catch{if(t)return;let e=Math.min(1e3*2**A.current,1e4);A.current++,M.current=setTimeout(()=>{t||i()},e)}}function c(){"visible"!==document.visibilityState||t||k.current&&k.current.readyState===WebSocket.OPEN||(clearTimeout(M.current),A.current=0,i())}return async function(){let c=y.current;if(!c||t)return;let o=x.get(e);if(o){r=o.term,l=o.fit,w.current=r,v.current=l,R.current=!0,c.appendChild(o.wrapper);let e=m[_.terminalTheme]??m.dark;r.options.theme={background:e.bg,foreground:e.fg,cursor:e.cursor,selectionBackground:e.selection},r.options.fontSize=_.terminalFontSize,r.options.scrollback=_.terminalScrollback,l.fit()}else{let[{Terminal:a},{FitAddon:s}]=await Promise.all([n.e(23888).then(n.bind(n,8422)),n.e(63606).then(n.bind(n,63606))]);if(t)return;let i=m[_.terminalTheme]??m.dark;w.current=r=new a({cursorBlink:!0,fontSize:_.terminalFontSize,scrollback:_.terminalScrollback,fontFamily:"'Menlo', 'Consolas', 'DejaVu Sans Mono', 'Courier New', 'Symbols Nerd Font Mono', monospace",theme:{background:i.bg,foreground:i.fg,cursor:i.cursor,selectionBackground:i.selection}}),v.current=l=new s,r.loadAddon(l);let o=document.createElement("div");o.style.width="100%",o.style.height="100%",c.appendChild(o),r.open(o),l.fit(),x.set(e,{term:r,fit:l,wrapper:o})}a.push(r.onData(e=>{if(I.current&&1===e.length){let t=e.toUpperCase().charCodeAt(0);if(t>=64&&t<96){s(String.fromCharCode(t-64)),I.current=!1,T(!1);return}}s(e)})),a.push(r.onResize(({cols:e,rows:t})=>{e<2||t<2||E.current&&(clearTimeout(F.current),F.current=setTimeout(()=>{if(!E.current)return;let n=k.current;n?.readyState===WebSocket.OPEN&&n.send(`\x01R${e};${t}`)},150))}));let d=0,u=0;c.addEventListener("touchstart",e=>{d=e.touches[0].clientY,u=0},{passive:!0}),c.addEventListener("touchmove",e=>{let t=d-e.touches[0].clientY;d=e.touches[0].clientY;let n=Math.trunc((u+=t)/8);0!==n&&(u-=8*n,r?.scrollLines(n))},{passive:!0}),i()}(),document.addEventListener("visibilitychange",c),()=>{for(let e of(t=!0,a))e.dispose();clearTimeout(M.current),clearTimeout(F.current),document.removeEventListener("visibilitychange",c),k.current&&(k.current.onclose=null,k.current.close(),k.current=null),w.current=null,v.current=null}},[e]);let W=(0,d.useCallback)(e=>{let t=k.current;t?.readyState===WebSocket.OPEN&&t.send(e)},[]),G=(0,d.useCallback)(e=>{if("modifier"in e&&e.modifier){let e=!I.current;I.current=e,T(e);return}"data"in e&&W(e.data)},[W]);if(N)return(0,r.jsxs)("div",{className:"flex-1 min-h-0 flex flex-col items-center justify-center gap-3 text-sm text-muted-foreground",children:[(0,r.jsx)("span",{children:N}),(0,r.jsx)("button",{type:"button",onClick:p,disabled:g,className:"px-3 py-1.5 text-xs font-medium rounded-md bg-muted hover:bg-muted/80 transition-colors disabled:opacity-50",children:g?"Reconnecting...":"Reconnect"})]});let B=m[_.terminalTheme]??m.dark;return(0,r.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",style:{backgroundColor:B.bg},children:[(0,r.jsxs)("div",{className:"flex-1 min-h-0 relative overflow-hidden",children:[(0,r.jsx)("div",{ref:y,className:"absolute inset-0 px-3 pt-2"}),(0,r.jsx)("button",{type:"button",onClick:()=>L(!0),className:"absolute top-2 right-2 z-10 rounded p-1.5 text-white/70 hover:text-white hover:bg-white/10 transition-colors",children:(0,r.jsx)(l.A,{className:"h-4.5 w-4.5"})})]}),!P&&D&&(0,r.jsxs)("div",{className:"shrink-0 relative z-10 flex items-center gap-1.5 px-2 py-1.5 border-t border-border/50",style:{backgroundColor:B.bg},children:[(0,r.jsx)("div",{role:"button",tabIndex:-1,onPointerDown:e=>{e.preventDefault(),L(!0)},className:"px-2 py-1.5 text-xs font-medium rounded-md transition-colors select-none bg-muted text-muted-foreground active:bg-primary active:text-primary-foreground",children:(0,r.jsx)(l.A,{className:"h-3.5 w-3.5"})}),(0,r.jsx)("div",{className:"w-px h-5 bg-border/50"}),b.map(e=>(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:["separator"in e&&e.separator&&(0,r.jsx)("div",{className:"w-px h-5 bg-border/50"}),(0,r.jsx)("div",{role:"button",tabIndex:-1,onPointerDown:t=>{t.preventDefault(),G(e)},className:(0,h.cn)("px-3 py-1.5 text-xs font-medium rounded-md transition-colors select-none","active:bg-primary active:text-primary-foreground","modifier"in e&&e.modifier&&S?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground"),children:e.label})]},e.label))]}),$&&(0,r.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onMouseDown:e=>{e.target===e.currentTarget&&L(!1)},children:(0,r.jsxs)("div",{className:"w-full max-w-md mx-4 rounded-lg border bg-background shadow-lg overflow-hidden flex flex-col max-h-[85vh]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between px-5 py-3 border-b shrink-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(l.A,{className:"h-4 w-4"}),(0,r.jsx)("h2",{className:"text-sm font-semibold",children:"Terminal settings"})]}),(0,r.jsx)("button",{onClick:()=>L(!1),className:"rounded p-1 text-muted-foreground hover:text-foreground hover:bg-muted",children:(0,r.jsx)(a.A,{className:"h-4 w-4"})})]}),(0,r.jsxs)("div",{className:"p-4 space-y-5 overflow-y-auto",children:[(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("div",{className:"flex items-center gap-2",children:(0,r.jsx)("span",{className:"text-xs font-medium text-foreground",children:"Font size"})}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("button",{onClick:()=>U("terminalFontSize",Math.max(1,_.terminalFontSize-1)),className:"rounded p-1.5 border border-input hover:bg-muted transition-colors",children:(0,r.jsx)(i,{className:"h-3.5 w-3.5"})}),(0,r.jsx)("span",{className:"text-sm font-mono w-8 text-center",children:_.terminalFontSize}),(0,r.jsx)("button",{onClick:()=>U("terminalFontSize",Math.min(32,_.terminalFontSize+1)),className:"rounded p-1.5 border border-input hover:bg-muted transition-colors",children:(0,r.jsx)(c.A,{className:"h-3.5 w-3.5"})})]})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-foreground",children:"Scrollback lines"}),(0,r.jsx)("div",{className:"flex items-center gap-2",children:[500,1e3,5e3,1e4].map(e=>(0,r.jsx)("button",{onClick:()=>U("terminalScrollback",e),className:(0,h.cn)("rounded-md border px-3 py-1.5 text-xs transition-colors",_.terminalScrollback===e?"border-primary bg-primary/10 text-foreground":"border-input hover:bg-muted text-muted-foreground"),children:e>=1e3?`${e/1e3}k`:e},e))})]}),(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(o,{className:"h-3.5 w-3.5 text-muted-foreground"}),(0,r.jsx)("span",{className:"text-xs font-medium text-foreground",children:"Theme"})]}),(0,r.jsx)("div",{className:"grid grid-cols-2 gap-2",children:Object.entries(m).map(([e,t])=>(0,r.jsxs)("button",{onClick:()=>U("terminalTheme",e),className:(0,h.cn)("flex items-center gap-2 rounded-md border px-3 py-2 text-xs transition-colors",_.terminalTheme===e?"border-primary bg-primary/10 text-foreground":"border-input hover:bg-muted text-muted-foreground"),children:[(0,r.jsx)("div",{className:"h-4 w-4 rounded-sm border border-border/50",style:{backgroundColor:t.bg}}),t.label]},e))})]})]})]})})]})}},41112:(e,t,n)=>{"use strict";function r({reason:e,children:t}){return t}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return r}}),n(1980)},58309:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(99537).A)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]])},64054:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={bindSnapshot:function(){return c},createAsyncLocalStorage:function(){return i},createSnapshot:function(){return o}};for(var r in n)Object.defineProperty(t,r,{enumerable:!0,get:n[r]});let l=Object.defineProperty(Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available"),"__NEXT_ERROR_CODE",{value:"E504",enumerable:!1,configurable:!0});class a{disable(){throw l}getStore(){}run(){throw l}exit(){throw l}enterWith(){throw l}static bind(e){return e}}let s="u">typeof globalThis&&globalThis.AsyncLocalStorage;function i(){return s?new s:new a}function c(e){return s?s.bind(e):a.bind(e)}function o(){return s?s.snapshot():function(e,...t){return e(...t)}}},68635:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return c}});let r=n(95155),l=n(12115),a=n(41112);function s(e){return{default:e&&"default"in e?e.default:e}}n(21957);let i={loader:()=>Promise.resolve(s(()=>null)),loading:null,ssr:!0},c=function(e){let t={...i,...e},n=(0,l.lazy)(()=>t.loader().then(s)),c=t.loading;function o(e){let s=c?(0,r.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,i=!t.ssr||!!t.loading,o=i?l.Suspense:l.Fragment,d=t.ssr?(0,r.jsxs)(r.Fragment,{children:[null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(a.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(o,{...i?{fallback:s}:{},children:d})}return o.displayName="LoadableComponent",o}},75707:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return l}});let r=n(73623)._(n(68635));function l(e,t){let n={};"function"==typeof e&&(n.loader=e);let l={...n,...t};return(0,r.default)({...l,modules:l.loadableGenerated?.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},89419:(e,t,n)=>{Promise.resolve().then(n.bind(n,23668))},94088:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});let r=(0,n(99537).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])}},e=>{e.O(0,[989,25781,1550,28441,93794,77358],()=>e(e.s=89419)),_N_E=e.O()}]);
|