@alexjbarnes/cockpit 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-path-routes-manifest.json +16 -3
- package/.next/build-manifest.json +3 -3
- package/.next/prerender-manifest.json +99 -3
- package/.next/react-loadable-manifest.json +18 -2
- package/.next/required-server-files.js +3 -0
- package/.next/required-server-files.json +3 -0
- package/.next/routes-manifest.json +86 -0
- package/.next/server/app/(app)/agents/[name]/page.js +2 -2
- 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)/changes/page.js +2 -2
- package/.next/server/app/(app)/changes/page.js.nft.json +1 -1
- package/.next/server/app/(app)/changes/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 +2 -2
- 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)/files/page.js +2 -2
- package/.next/server/app/(app)/files/page.js.nft.json +1 -1
- package/.next/server/app/(app)/files/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)/reviews/[owner]/[repo]/[number]/page.js +10 -10
- 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 -0
- package/.next/server/app/(app)/settings/appearance/page.js.nft.json +1 -0
- package/.next/server/app/(app)/settings/appearance/page_client-reference-manifest.js +1 -0
- 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 -0
- package/.next/server/app/(app)/settings/providers/[id]/page.js.nft.json +1 -0
- package/.next/server/app/(app)/settings/providers/[id]/page_client-reference-manifest.js +1 -0
- package/.next/server/app/(app)/settings/providers/new/page.js +2 -0
- package/.next/server/app/(app)/settings/providers/new/page.js.nft.json +1 -0
- package/.next/server/app/(app)/settings/providers/new/page_client-reference-manifest.js +1 -0
- package/.next/server/app/(app)/settings/providers/page.js +2 -0
- package/.next/server/app/(app)/settings/providers/page.js.nft.json +1 -0
- package/.next/server/app/(app)/settings/providers/page_client-reference-manifest.js +1 -0
- package/.next/server/app/(app)/settings/session/page.js +2 -0
- package/.next/server/app/(app)/settings/session/page.js.nft.json +1 -0
- package/.next/server/app/(app)/settings/session/page_client-reference-manifest.js +1 -0
- 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_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_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/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/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 +2 -2
- package/.next/server/app/api/inbox/route.js +2 -2
- 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/route.js +1 -1
- 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/route.js +1 -1
- package/.next/server/app/api/notifications/route.js +1 -1
- package/.next/server/app/api/notifications/test/route.js +1 -1
- package/.next/server/app/api/providers/[id]/route.js +1 -0
- package/.next/server/app/api/providers/[id]/route.js.nft.json +1 -0
- package/.next/server/app/api/providers/[id]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/providers/route.js +1 -0
- package/.next/server/app/api/providers/route.js.nft.json +1 -0
- package/.next/server/app/api/providers/route_client-reference-manifest.js +1 -0
- 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]/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]/tabs/route.js +1 -0
- package/.next/server/app/api/sessions/[id]/tabs/route.js.nft.json +1 -0
- package/.next/server/app/api/sessions/[id]/tabs/route_client-reference-manifest.js +1 -0
- 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/thinking/route.js +1 -0
- package/.next/server/app/api/sessions/thinking/route.js.nft.json +1 -0
- package/.next/server/app/api/sessions/thinking/route_client-reference-manifest.js +1 -0
- 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 -0
- package/.next/server/app/api/terminal/[id]/route.js.nft.json +1 -0
- package/.next/server/app/api/terminal/[id]/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/terminal/route.js +1 -0
- package/.next/server/app/api/terminal/route.js.nft.json +1 -0
- package/.next/server/app/api/terminal/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/usage/route.js +1 -1
- package/.next/server/app/api/version/changelog/route.js +1 -0
- package/.next/server/app/api/version/changelog/route.js.nft.json +1 -0
- package/.next/server/app/api/version/changelog/route_client-reference-manifest.js +1 -0
- package/.next/server/app/api/version/cockpit/changelog/route.js +1 -0
- package/.next/server/app/api/version/cockpit/changelog/route.js.nft.json +1 -0
- package/.next/server/app/api/version/cockpit/changelog/route_client-reference-manifest.js +1 -0
- 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/changes.html +1 -1
- package/.next/server/app/changes.rsc +4 -4
- package/.next/server/app/changes.segments/!KGFwcCk/changes/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/changes.segments/!KGFwcCk/changes.segment.rsc +1 -1
- package/.next/server/app/changes.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/changes.segments/_full.segment.rsc +4 -4
- package/.next/server/app/changes.segments/_head.segment.rsc +1 -1
- package/.next/server/app/changes.segments/_index.segment.rsc +2 -2
- package/.next/server/app/changes.segments/_tree.segment.rsc +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/files.html +1 -1
- package/.next/server/app/files.rsc +4 -4
- package/.next/server/app/files.segments/!KGFwcCk/files/__PAGE__.segment.rsc +2 -2
- package/.next/server/app/files.segments/!KGFwcCk/files.segment.rsc +1 -1
- package/.next/server/app/files.segments/!KGFwcCk.segment.rsc +2 -2
- package/.next/server/app/files.segments/_full.segment.rsc +4 -4
- package/.next/server/app/files.segments/_head.segment.rsc +1 -1
- package/.next/server/app/files.segments/_index.segment.rsc +2 -2
- package/.next/server/app/files.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_client-reference-manifest.js +1 -1
- package/.next/server/app/login.html +1 -1
- package/.next/server/app/login.rsc +2 -2
- package/.next/server/app/login.segments/_full.segment.rsc +2 -2
- 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 +1 -1
- 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/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 -0
- package/.next/server/app/settings/appearance.meta +17 -0
- package/.next/server/app/settings/appearance.rsc +23 -0
- package/.next/server/app/settings/appearance.segments/!KGFwcCk/settings/appearance/__PAGE__.segment.rsc +9 -0
- package/.next/server/app/settings/appearance.segments/!KGFwcCk/settings/appearance.segment.rsc +5 -0
- package/.next/server/app/settings/appearance.segments/!KGFwcCk/settings.segment.rsc +5 -0
- package/.next/server/app/settings/appearance.segments/!KGFwcCk.segment.rsc +7 -0
- package/.next/server/app/settings/appearance.segments/_full.segment.rsc +23 -0
- package/.next/server/app/settings/appearance.segments/_head.segment.rsc +6 -0
- package/.next/server/app/settings/appearance.segments/_index.segment.rsc +5 -0
- package/.next/server/app/settings/appearance.segments/_tree.segment.rsc +2 -0
- 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 -0
- package/.next/server/app/settings/providers/new.meta +18 -0
- package/.next/server/app/settings/providers/new.rsc +23 -0
- package/.next/server/app/settings/providers/new.segments/!KGFwcCk/settings/providers/new/__PAGE__.segment.rsc +9 -0
- package/.next/server/app/settings/providers/new.segments/!KGFwcCk/settings/providers/new.segment.rsc +5 -0
- package/.next/server/app/settings/providers/new.segments/!KGFwcCk/settings/providers.segment.rsc +5 -0
- package/.next/server/app/settings/providers/new.segments/!KGFwcCk/settings.segment.rsc +5 -0
- package/.next/server/app/settings/providers/new.segments/!KGFwcCk.segment.rsc +7 -0
- package/.next/server/app/settings/providers/new.segments/_full.segment.rsc +23 -0
- package/.next/server/app/settings/providers/new.segments/_head.segment.rsc +6 -0
- package/.next/server/app/settings/providers/new.segments/_index.segment.rsc +5 -0
- package/.next/server/app/settings/providers/new.segments/_tree.segment.rsc +2 -0
- package/.next/server/app/settings/providers.html +1 -0
- package/.next/server/app/settings/providers.meta +17 -0
- package/.next/server/app/settings/providers.rsc +23 -0
- package/.next/server/app/settings/providers.segments/!KGFwcCk/settings/providers/__PAGE__.segment.rsc +9 -0
- package/.next/server/app/settings/providers.segments/!KGFwcCk/settings/providers.segment.rsc +5 -0
- package/.next/server/app/settings/providers.segments/!KGFwcCk/settings.segment.rsc +5 -0
- package/.next/server/app/settings/providers.segments/!KGFwcCk.segment.rsc +7 -0
- package/.next/server/app/settings/providers.segments/_full.segment.rsc +23 -0
- package/.next/server/app/settings/providers.segments/_head.segment.rsc +6 -0
- package/.next/server/app/settings/providers.segments/_index.segment.rsc +5 -0
- package/.next/server/app/settings/providers.segments/_tree.segment.rsc +2 -0
- package/.next/server/app/settings/session.html +1 -0
- package/.next/server/app/settings/session.meta +17 -0
- package/.next/server/app/settings/session.rsc +23 -0
- package/.next/server/app/settings/session.segments/!KGFwcCk/settings/session/__PAGE__.segment.rsc +9 -0
- package/.next/server/app/settings/session.segments/!KGFwcCk/settings/session.segment.rsc +5 -0
- package/.next/server/app/settings/session.segments/!KGFwcCk/settings.segment.rsc +5 -0
- package/.next/server/app/settings/session.segments/!KGFwcCk.segment.rsc +7 -0
- package/.next/server/app/settings/session.segments/_full.segment.rsc +23 -0
- package/.next/server/app/settings/session.segments/_head.segment.rsc +6 -0
- package/.next/server/app/settings/session.segments/_index.segment.rsc +5 -0
- package/.next/server/app/settings/session.segments/_tree.segment.rsc +2 -0
- 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 +16 -3
- package/.next/server/chunks/1002.js +18 -0
- package/.next/server/chunks/1011.js +1 -0
- package/.next/server/chunks/1659.js +1 -1
- package/.next/server/chunks/1979.js +2 -2
- package/.next/server/chunks/2408.js +1 -1
- package/.next/server/chunks/{7627.js → 3006.js} +3 -3
- package/.next/server/chunks/3434.js +1 -0
- package/.next/server/chunks/{5920.js → 4342.js} +1 -1
- package/.next/server/chunks/4352.js +1 -0
- package/.next/server/chunks/4445.js +1 -1
- package/.next/server/chunks/7782.js +6 -0
- package/.next/server/chunks/8148.js +1 -0
- package/.next/server/chunks/9599.js +11 -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/I-rxZaJEzhe3ZUTjSqB11/_buildManifest.js +1 -0
- package/.next/static/chunks/{35922.5bdf78a760129504.js → 13541.056c34ca7fde6869.js} +1 -1
- package/.next/static/chunks/26126-97874904b42befb8.js +1 -0
- package/.next/static/chunks/31010-6e87f77b97544424.js +1 -0
- package/.next/static/chunks/3765-d323c6675307a63e.js +20 -0
- package/.next/static/chunks/{11242-d240a18d4e59390b.js → 41487-d802643f4a8fad3c.js} +5 -5
- package/.next/static/chunks/48273-fb393846bb4333c0.js +6 -0
- package/.next/static/chunks/63606.a387b0261d6523ab.js +1 -0
- package/.next/static/chunks/6935-f436a624267529fb.js +1 -0
- package/.next/static/chunks/{69427.0f379c6bdea95405.js → 69427.a0b463c808aa54c8.js} +1 -1
- package/.next/static/chunks/86939-dfc6f8eb395caa89.js +1 -0
- package/.next/static/chunks/app/(app)/agents/[name]/page-8bdd0359043537d4.js +8 -0
- package/.next/static/chunks/app/(app)/agents/page-6fcfd7ab6781814e.js +1 -0
- package/.next/static/chunks/app/(app)/changes/page-4549a5bd72d77e3e.js +1 -0
- package/.next/static/chunks/app/(app)/claude-md/edit/page-08e6e120e71979f4.js +1 -0
- package/.next/static/chunks/app/(app)/claude-md/page-cd9e2176a12ba241.js +1 -0
- package/.next/static/chunks/app/(app)/commands/[name]/page-7cdfdef29ded0aa0.js +6 -0
- package/.next/static/chunks/app/(app)/commands/page-f126b608b04747ac.js +1 -0
- package/.next/static/chunks/app/(app)/files/page-f526eb95821e000e.js +1 -0
- package/.next/static/chunks/app/(app)/hooks/[event]/page-28038323fd29adfa.js +6 -0
- package/.next/static/chunks/app/(app)/hooks/page-f1f39284e53c0344.js +1 -0
- package/.next/static/chunks/app/(app)/inbox/[id]/page-bc1ff3a0db0114a4.js +1 -0
- package/.next/static/chunks/app/(app)/inbox/page-82e03870103ce9bd.js +1 -0
- package/.next/static/chunks/app/(app)/jobs/[id]/edit/page-7fb788f772ff2129.js +1 -0
- package/.next/static/chunks/app/(app)/jobs/[id]/page-a5856b9ae967ff59.js +1 -0
- package/.next/static/chunks/app/(app)/jobs/[id]/runs/[runId]/page-b7c513402db11db6.js +1 -0
- package/.next/static/chunks/app/(app)/jobs/page-e9bbd6c116b9699f.js +1 -0
- package/.next/static/chunks/app/(app)/{layout-81c1899969de11e6.js → layout-ce9e1be301c60fe5.js} +1 -1
- package/.next/static/chunks/app/(app)/mcp-servers/[name]/page-d6d805a27ec0b0c0.js +1 -0
- package/.next/static/chunks/app/(app)/mcp-servers/page-4b7276d43451cd43.js +1 -0
- package/.next/static/chunks/app/(app)/page-027a5382da30ddb9.js +1 -0
- package/.next/static/chunks/app/(app)/reviews/[owner]/[repo]/[number]/page-9ab2955c455bb5fa.js +13 -0
- package/.next/static/chunks/app/(app)/reviews/[owner]/[repo]/{page-c7473a899c7c59c3.js → page-c5fd013309ab3eba.js} +1 -1
- package/.next/static/chunks/app/(app)/reviews/{page-0e6e7395a4f62b50.js → page-47530d93bb9d4a76.js} +1 -1
- package/.next/static/chunks/app/(app)/sessions/[id]/page-94f891e1b54fd05f.js +1 -0
- package/.next/static/chunks/app/(app)/settings/appearance/page-95902da748ac5f1e.js +1 -0
- package/.next/static/chunks/app/(app)/settings/notifications/{page-a28db2ebc9fd0de8.js → page-229f1db6beb1d19c.js} +1 -1
- package/.next/static/chunks/app/(app)/settings/page-8ed16a66fdde10cd.js +1 -0
- package/.next/static/chunks/app/(app)/settings/providers/[id]/page-13654263246617b3.js +1 -0
- package/.next/static/chunks/app/(app)/settings/providers/new/page-e1798e321ccbc6df.js +1 -0
- package/.next/static/chunks/app/(app)/settings/providers/page-0bb4c1db2ee35b3d.js +1 -0
- package/.next/static/chunks/app/(app)/settings/session/page-ab216a8fa37a0f76.js +1 -0
- package/.next/static/chunks/app/(app)/skills/[name]/page-8ab85d5090967ee4.js +6 -0
- package/.next/static/chunks/app/(app)/skills/page-c52773eacb27c04e.js +1 -0
- package/.next/static/chunks/app/_global-error/page-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/agents/[name]/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/agents/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/auth/check/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/auth/login/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/auth/setup/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/auth/ws-token/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/btw/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/claude-md/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/commands/[name]/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/commands/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/defaults/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/filesystem/browse/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/filesystem/files/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/filesystem/mkdir/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/filesystem/read/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/git/clone/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/git/commit/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/git/diff/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/git/discard/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/git/generate-message/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/git/push/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/git/status/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/github/file-content/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/github/orgs/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/github/prs/checks/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/github/prs/diff/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/github/prs/review/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/github/prs/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/github/prs/view/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/github/repos/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/github/review-session/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/health/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/hooks/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/inbox/[id]/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/inbox/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/jobs/[id]/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/jobs/[id]/runs/[runId]/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/jobs/[id]/runs/[runId]/transcript/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/jobs/[id]/runs/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/jobs/[id]/trigger/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/jobs/mcp-discover/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/jobs/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/jobs/status/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/mcp-servers/[name]/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/mcp-servers/[name]/test/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/mcp-servers/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/notifications/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/notifications/test/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/providers/[id]/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/providers/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/reviews/pinned/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/context/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/mcp/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/search/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/[id]/tabs/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/bulk-delete/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/by-ids/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/group/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/pinned/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/search/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/sessions/thinking/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/skills/[name]/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/skills/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/terminal/[id]/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/terminal/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/usage/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/version/changelog/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/version/cockpit/changelog/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/version/cockpit/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/app/api/version/route-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/e868780c.f24b6da08e62c7b2.js +18 -0
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-fc747760bd4c8a4b.js +1 -0
- package/.next/static/chunks/webpack-e31bb45fa59caed8.js +1 -0
- package/.next/static/css/3f8af4ae6f812d5c.css +1 -0
- package/README.md +12 -3
- package/bin/cockpit-hook-bridge.mjs +170 -0
- package/dist/server.js +11 -1
- package/dist/src/lib/models.js +48 -7
- package/dist/src/server/auth.js +32 -10
- package/dist/src/server/claude-settings.js +153 -0
- package/dist/src/server/cli-init-fetch.js +86 -0
- package/dist/src/server/cron-utils.js +16 -5
- package/dist/src/server/debug-logger.js +2 -2
- package/dist/src/server/defaults.js +16 -7
- package/dist/src/server/fs-watcher.js +50 -0
- package/dist/src/server/hook-bridge-path.js +34 -0
- package/dist/src/server/hook-event-translator.js +211 -0
- package/dist/src/server/hook-router.js +150 -0
- package/dist/src/server/inbox.js +14 -10
- package/dist/src/server/job-lock.js +103 -0
- package/dist/src/server/job-scheduler.js +23 -8
- package/dist/src/server/job-storage.js +28 -13
- package/dist/src/server/notification-settings.js +13 -9
- package/dist/src/server/paths.js +23 -0
- package/dist/src/server/plans.js +8 -5
- package/dist/src/server/providers.js +128 -0
- package/dist/src/server/pty-runtime.js +324 -0
- package/dist/src/server/pty-session.js +178 -0
- package/dist/src/server/session-manager.js +727 -144
- package/dist/src/server/session-prefs.js +33 -8
- package/dist/src/server/singleton.js +18 -0
- package/dist/src/server/stream-processor.js +61 -48
- package/dist/src/server/terminal-manager.js +153 -0
- package/dist/src/server/todo-watcher.js +178 -0
- package/dist/src/server/transcript-watcher.js +91 -0
- package/dist/src/server/transcript.js +177 -11
- package/dist/src/server/ws-handler.js +235 -61
- package/next.config.ts +1 -0
- package/package.json +10 -3
- package/public/fonts/symbols-nerd-font-mono.woff2 +0 -0
- package/.next/server/chunks/1941.js +0 -9
- package/.next/server/chunks/2444.js +0 -6
- package/.next/static/brzairTqHmHwvfgKpdkYX/_buildManifest.js +0 -1
- package/.next/static/chunks/3765-a4c7a493ec83f918.js +0 -20
- package/.next/static/chunks/75866-76a3987dda1295ae.js +0 -1
- package/.next/static/chunks/93273-87110c1449e1e7fd.js +0 -6
- package/.next/static/chunks/app/(app)/agents/[name]/page-3ec9a3460e8e9006.js +0 -8
- package/.next/static/chunks/app/(app)/agents/page-d6d504e7d7757ea2.js +0 -1
- package/.next/static/chunks/app/(app)/changes/page-a09bf4742aa8b5ce.js +0 -1
- package/.next/static/chunks/app/(app)/claude-md/edit/page-ab42921ba2618dc3.js +0 -1
- package/.next/static/chunks/app/(app)/claude-md/page-c4c8b20aa002a94a.js +0 -1
- package/.next/static/chunks/app/(app)/commands/[name]/page-2124ffed9a4e95a3.js +0 -6
- package/.next/static/chunks/app/(app)/commands/page-d5bf1bddd17e31dd.js +0 -1
- package/.next/static/chunks/app/(app)/files/page-04e4e5bf1ca89945.js +0 -1
- package/.next/static/chunks/app/(app)/hooks/[event]/page-d988623e739973b5.js +0 -6
- package/.next/static/chunks/app/(app)/hooks/page-818242d7db432578.js +0 -1
- package/.next/static/chunks/app/(app)/inbox/[id]/page-c33dc94e309ff117.js +0 -1
- package/.next/static/chunks/app/(app)/inbox/page-ca3e1724b5072734.js +0 -1
- package/.next/static/chunks/app/(app)/jobs/[id]/edit/page-3a1c927d76333bf0.js +0 -1
- package/.next/static/chunks/app/(app)/jobs/[id]/page-8e698e00b90968b0.js +0 -1
- package/.next/static/chunks/app/(app)/jobs/[id]/runs/[runId]/page-f942df0b7c1d280b.js +0 -1
- package/.next/static/chunks/app/(app)/jobs/page-7a88cc6ac34550c2.js +0 -1
- package/.next/static/chunks/app/(app)/mcp-servers/[name]/page-3541bf3ccdef9145.js +0 -1
- package/.next/static/chunks/app/(app)/mcp-servers/page-3927dfd03d921040.js +0 -1
- package/.next/static/chunks/app/(app)/page-594120e0ea1df527.js +0 -1
- package/.next/static/chunks/app/(app)/reviews/[owner]/[repo]/[number]/page-74c23b04f5c3ff88.js +0 -13
- package/.next/static/chunks/app/(app)/sessions/[id]/page-435e9fb4dd34007d.js +0 -1
- package/.next/static/chunks/app/(app)/settings/page-f8ada7997c0d5b03.js +0 -1
- package/.next/static/chunks/app/(app)/skills/[name]/page-5dbe1e7682880145.js +0 -6
- package/.next/static/chunks/app/(app)/skills/page-fd1986ad7e060f4d.js +0 -1
- package/.next/static/chunks/app/_global-error/page-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/agents/[name]/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/agents/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/auth/check/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/auth/login/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/auth/setup/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/auth/ws-token/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/btw/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/claude-md/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/commands/[name]/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/commands/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/defaults/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/filesystem/browse/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/filesystem/files/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/filesystem/mkdir/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/filesystem/read/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/git/clone/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/git/commit/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/git/diff/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/git/discard/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/git/generate-message/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/git/push/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/git/status/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/github/file-content/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/github/orgs/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/github/prs/checks/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/github/prs/diff/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/github/prs/review/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/github/prs/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/github/prs/view/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/github/repos/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/github/review-session/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/health/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/hooks/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/inbox/[id]/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/inbox/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/jobs/[id]/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/jobs/[id]/runs/[runId]/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/jobs/[id]/runs/[runId]/transcript/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/jobs/[id]/runs/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/jobs/[id]/trigger/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/jobs/mcp-discover/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/jobs/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/jobs/status/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/mcp-servers/[name]/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/mcp-servers/[name]/test/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/mcp-servers/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/notifications/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/notifications/test/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/reviews/pinned/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/context/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/mcp/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/sessions/[id]/search/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/sessions/bulk-delete/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/sessions/by-ids/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/sessions/group/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/sessions/pinned/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/sessions/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/sessions/search/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/skills/[name]/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/skills/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/usage/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/version/cockpit/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/app/api/version/route-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/app-error-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/forbidden-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/not-found-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/next/dist/client/components/builtin/unauthorized-65c661eddfc65f5b.js +0 -1
- package/.next/static/chunks/webpack-3461a05957b13f46.js +0 -1
- package/.next/static/css/f04f303b5708dd90.css +0 -1
- /package/.next/static/{brzairTqHmHwvfgKpdkYX → I-rxZaJEzhe3ZUTjSqB11}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[78177],{27557:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>x});var a=r(95155),s=r(64577),n=r(99314),o=r(81402),l=r(73321),c=r(12115),u=r(3765),i=r(98757),d=r(45160),f=r(89239);let m=["SessionStart","UserPromptSubmit","PreToolUse","PermissionRequest","PostToolUse","PostToolUseFailure","Stop","SubagentStart","SubagentStop","PreCompact","PostCompact","SessionEnd"],h=[{value:"global",label:"Global"},{value:"project",label:"Project"},{value:"project-local",label:"Local"}],p=`[
|
|
2
|
+
{
|
|
3
|
+
"type": "command",
|
|
4
|
+
"command": "echo hook fired"
|
|
5
|
+
}
|
|
6
|
+
]`;function x({params:e}){let{event:t}=(0,c.use)(e),r=(0,l.useSearchParams)(),b="new"===t,g=b?"":decodeURIComponent(t),v=r.get("scope")||"global",j=r.get("filePath")||"",S=r.get("cwd")||void 0;(0,u.si)(b?"New Hook":g,{hideActions:!0});let[y,w]=(0,c.useState)(g),[k,N]=(0,c.useState)(v),[C,E]=(0,c.useState)(b?p:""),[P,R]=(0,c.useState)(b?p:""),[_,L]=(0,c.useState)(!b),[$,O]=(0,c.useState)(!1),[U,z]=(0,c.useState)(null),[A,T]=(0,c.useState)(!1),M=C!==P;(0,c.useEffect)(()=>{if(b)return;let e=new URLSearchParams;S&&e.set("cwd",S),fetch(`/api/hooks?${e}`).then(e=>e.json()).then(e=>{let t=e.hooks.find(e=>e.event===g&&e.scope===v);if(t){let e=JSON.stringify(t.hooks,null,2);E(e),R(e)}else z("Hook not found")}).catch(()=>z("Failed to load")).finally(()=>L(!1))},[b,g,v,S]);let F=(0,c.useCallback)(()=>!b&&j?j:"global"===k?"__global__":"project"===k&&S?`${S}/.claude/settings.json`:"project-local"===k&&S?`${S}/.claude/settings.local.json`:"",[b,j,k,S]),J=(0,c.useCallback)(async()=>{let e,t=b?y:g;if(!t)return void z("Select an event");try{if(e=JSON.parse(C),!Array.isArray(e))throw Error("Must be an array")}catch(e){z("Invalid JSON: must be an array of hook objects");return}O(!0),z(null);let r=F(),a=new URLSearchParams;S&&a.set("cwd",S);try{let s=await fetch(`/api/hooks?${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:r,event:t,hooks:e})});if(!s.ok){let e=await s.json().catch(()=>({}));throw Error(e.error||"Save failed")}R(C),z("Saved")}catch(e){z(e instanceof Error?e.message:"Failed to save")}finally{O(!1)}},[C,b,y,g,S,F]);return _?(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:b?(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsxs)("select",{value:y,onChange:e=>w(e.target.value),className:"rounded-md border border-input bg-background px-3 py-1.5 text-sm",children:[(0,a.jsx)("option",{value:"",children:"Select event..."}),m.map(e=>(0,a.jsx)("option",{value:e,children:e},e))]}),(0,a.jsx)("select",{value:k,onChange:e=>N(e.target.value),className:"rounded-md border border-input bg-background px-3 py-1.5 text-sm",children:h.map(e=>(0,a.jsx)("option",{value:e.value,disabled:"global"!==e.value&&!S,children:e.label},e.value))})]}):(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-mono font-bold text-lg",children:g}),(0,a.jsx)(d.E,{variant:"secondary",children:"global"===v?"Global":"project"===v?"Project":"Local"})]})}),(0,a.jsxs)(f.$,{size:"sm",variant:"outline",onClick:()=>{let e=document.createElement("textarea");e.value=C,e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select(),document.execCommand("copy"),document.body.removeChild(e),T(!0),setTimeout(()=>T(!1),1500)},children:[A?(0,a.jsx)(s.A,{className:"h-4 w-4 mr-1"}):(0,a.jsx)(n.A,{className:"h-4 w-4 mr-1"}),A?"Copied":"Copy"]}),(0,a.jsxs)(f.$,{size:"sm",onClick:J,disabled:$||!b&&!M,children:[(0,a.jsx)(o.A,{className:"h-4 w-4 mr-1"}),$?"Saving...":"Save"]})]}),U&&(0,a.jsx)("p",{className:`text-sm ${"Saved"===U?"text-green-600":"text-destructive"}`,children:U}),(0,a.jsx)(i.B,{value:C,onChange:E,language:"json",onSave:J,className:"flex-1"})]})}},58853:(e,t,r)=>{Promise.resolve().then(r.bind(r,27557))},98757:(e,t,r)=>{"use strict";r.d(t,{B:()=>h});var a=r(95155),s=r(13748),n=r(53649),o=r(27071),l=r(74059),c=r(89561),u=r(62465),i=r(12115);let d=c.Lz.theme({"&":{backgroundColor:"transparent"},".cm-gutters":{backgroundColor:"transparent",borderRight:"1px solid hsl(var(--border))"}});function f(){return!("u"<typeof document)&&document.documentElement.classList.contains("dark")}function m(e){switch(e){case"markdown":default:return(0,s.wD)();case"yaml":return(0,n.oQ)()}}function h({value:e,onChange:t,language:r,readOnly:s,className:n,onSave:p}){let x=(0,i.useRef)(null),b=(0,i.useRef)(null),g=(0,i.useRef)(new o.xx),v=(0,i.useRef)(new o.xx),j=(0,i.useRef)(new o.xx),S=(0,i.useRef)(t),y=(0,i.useRef)(p),w=(0,i.useRef)(e);return S.current=t,y.current=p,(0,i.useEffect)(()=>{if(!x.current)return;let e=o.$t.create({doc:w.current,extensions:[u.oQ,c.Lz.lineWrapping,g.current.of(f()?l.bM:d),v.current.of(m(r)),j.current.of(o.$t.readOnly.of(!!s)),c.w4.of([{key:"Mod-s",run:()=>(y.current?.(),!0)}]),c.Lz.updateListener.of(e=>{if(e.docChanged){let t=e.state.doc.toString();w.current=t,S.current(t)}})]}),t=new c.Lz({state:e,parent:x.current});return b.current=t,()=>{t.destroy(),b.current=null}},[]),(0,i.useEffect)(()=>{let t=b.current;t&&e!==w.current&&(w.current=e,t.dispatch({changes:{from:0,to:t.state.doc.length,insert:e}}))},[e]),(0,i.useEffect)(()=>{let e=b.current;if(!e)return;let t=new MutationObserver(()=>{e.dispatch({effects:g.current.reconfigure(f()?l.bM:d)})});return t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}),()=>t.disconnect()},[]),(0,i.useEffect)(()=>{let e=b.current;e&&e.dispatch({effects:v.current.reconfigure(m(r))})},[r]),(0,i.useEffect)(()=>{let e=b.current;e&&e.dispatch({effects:j.current.reconfigure(o.$t.readOnly.of(!!s))})},[s]),(0,a.jsx)("div",{ref:x,className:`overflow-auto rounded-md border bg-background text-sm [&_.cm-editor]:min-h-[200px] [&_.cm-editor.cm-focused]:outline-none ${n||""}`})}}},e=>{e.O(0,[6079,989,41487,6802,3765,28441,93794,77358],()=>e(e.s=58853)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[40992],{64025:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var o=s(95155),n=s(73321),a=s(3765),r=s(45160),l=s(81477),c=s(12115);let i={global:"Global",project:"Project","project-local":"Local"},h=new Set(["UserPromptSubmit","PreToolUse","PermissionRequest","Stop","SubagentStop"]);function d(){(0,a.si)("Hooks",{hideActions:!0});let e="u">typeof localStorage&&localStorage.getItem("cockpit-agents-cwd")||void 0,{hooks:t,loading:s}=function(e){let[t,s]=(0,c.useState)([]),[o,n]=(0,c.useState)([]),[a,r]=(0,c.useState)(!0),l=(0,c.useCallback)(()=>{r(!0);let t=new URLSearchParams;e&&t.set("cwd",e),fetch(`/api/hooks?${t}`).then(e=>e.json()).then(e=>{s(e.hooks),n(e.events)}).catch(()=>s([])).finally(()=>r(!1))},[e]);(0,c.useEffect)(()=>{l()},[l]);let i=(0,c.useCallback)(async(t,s,o)=>{let n=new URLSearchParams;e&&n.set("cwd",e);try{if((await fetch(`/api/hooks?${n}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({filePath:t,event:s,hooks:o})})).ok)return l(),!0;return!1}catch{return!1}},[e,l]);return{hooks:t,events:o,loading:a,refresh:l,saveHooks:i}}(e),d=(0,n.useRouter)(),m={};for(let e of t){let t=e.scope;m[t]||(m[t]=[]),m[t].push(e)}return(0,o.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,o.jsxs)("div",{className:"flex items-center justify-between",children:[(0,o.jsx)("div",{}),(0,o.jsx)("button",{className:"inline-flex items-center rounded-md bg-primary px-3 py-1.5 text-sm font-medium text-primary-foreground hover:bg-primary/90",onClick:function(){let t=new URLSearchParams;e&&t.set("cwd",e),d.push(`/hooks/new?${t}`)},children:"New Hook"})]}),s&&(0,o.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading hooks..."}),!s&&0===t.length&&(0,o.jsx)("p",{className:"text-sm text-muted-foreground",children:"No hooks configured. Hooks let you run commands, HTTP requests, or prompts at key points in the agent lifecycle."}),Object.entries(m).map(([t,s])=>(0,o.jsxs)(l.Zp,{children:[(0,o.jsx)(l.aR,{children:(0,o.jsx)(l.ZB,{className:"text-base",children:i[t]||t})}),(0,o.jsx)(l.Wu,{className:"space-y-1",children:s.map(t=>(0,o.jsx)("button",{type:"button",className:"flex w-full items-center gap-3 rounded px-2 py-2 hover:bg-muted transition-colors text-left",onClick:()=>{var s;let o;return s=t.event,o=new URLSearchParams({scope:t.scope,filePath:t.filePath}),void(e&&o.set("cwd",e),d.push(`/hooks/${encodeURIComponent(s)}?${o}`))},children:(0,o.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("span",{className:"font-mono font-bold text-sm",children:t.event}),h.has(t.event)&&(0,o.jsx)(r.E,{variant:"outline",className:"text-[10px]",children:"can block"})]}),(0,o.jsxs)("p",{className:"text-xs text-muted-foreground mt-0.5",children:[t.hooks.length," hook",1!==t.hooks.length?"s":""," — ",t.hooks.map(e=>e.type).join(", ")]})]})},`${t.event}-${t.scope}`))})]},t))]})}},70532:(e,t,s)=>{Promise.resolve().then(s.bind(s,64025))}},e=>{e.O(0,[989,41487,3765,28441,93794,77358],()=>e(e.s=70532)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[58346],{11012:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(99537).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},14577:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(99537).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},35484:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(99537).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},54722:(e,s,t)=>{Promise.resolve().then(t.bind(t,96218))},75796:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(99537).A)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]])},96218:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>f});var a=t(95155),i=t(35484),n=t(11012),l=t(14577),c=t(92571),r=t(31966),d=t(75796),h=t(65738),x=t(73321),o=t(12115),m=t(3765),u=t(64233),j=t(89239),p=t(42763);function f(){(0,m.si)("Inbox",{hideActions:!0});let{id:e}=(0,x.useParams)(),s=(0,x.useRouter)(),[t,f]=(0,o.useState)(null),[y,k]=(0,o.useState)(!0),[v,N]=(0,o.useState)(!1),g=(0,o.useCallback)(async()=>{let s=await fetch("/api/inbox");if(s.ok){let t=((await s.json()).messages||[]).find(s=>s.id===e);f(t||null),t&&!t.read&&await fetch(`/api/inbox/${t.id}`,{method:"PATCH"})}k(!1)},[e]);(0,o.useEffect)(()=>{g()},[g]);let b=async()=>{await fetch(`/api/inbox/${e}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({read:!1})}),s.push("/inbox")},w=async()=>{await fetch(`/api/inbox/${e}`,{method:"DELETE"}),s.push("/inbox")};return y?(0,a.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,a.jsx)(c.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):t?(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 justify-between",children:[(0,a.jsxs)(j.$,{variant:"ghost",size:"sm",onClick:()=>s.push("/inbox"),children:[(0,a.jsx)(r.A,{className:"h-4 w-4 mr-1"}),"Back"]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsxs)(j.$,{variant:"ghost",size:"sm",onClick:b,children:[(0,a.jsx)(d.A,{className:"h-4 w-4 mr-1"}),"Mark unread"]}),(0,a.jsxs)(j.$,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>N(!0),children:[(0,a.jsx)(h.A,{className:"h-4 w-4 mr-1"}),"Delete"]})]})]}),(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[function(e){switch(e){case"error":return(0,a.jsx)(i.A,{className:"h-5 w-5 text-destructive shrink-0"});case"warning":return(0,a.jsx)(n.A,{className:"h-5 w-5 text-yellow-500 shrink-0"});default:return(0,a.jsx)(l.A,{className:"h-5 w-5 text-blue-500 shrink-0"})}}(t.priority),(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-lg font-semibold",children:t.title}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-1 text-xs text-muted-foreground",children:[t.jobName&&(0,a.jsx)("span",{children:t.jobName}),(0,a.jsx)("span",{children:new Date(t.createdAt).toLocaleString()})]})]})]}),(0,a.jsx)("div",{className:"border-t pt-4",children:(0,a.jsx)(u.Y,{content:t.body,variant:"full"})}),(0,a.jsx)(p.lG,{open:v,onOpenChange:()=>N(!1),children:(0,a.jsxs)(p.Cf,{children:[(0,a.jsx)(p.c7,{children:(0,a.jsx)(p.L3,{children:"Delete Message"})}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Delete this message? This cannot be undone."}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)(j.$,{variant:"outline",onClick:()=>N(!1),children:"Cancel"}),(0,a.jsx)(j.$,{variant:"destructive",onClick:w,children:"Delete"})]})]})})]}):(0,a.jsxs)("div",{className:"flex-1 p-4",children:[(0,a.jsxs)(j.$,{variant:"ghost",size:"sm",onClick:()=>s.push("/inbox"),children:[(0,a.jsx)(r.A,{className:"h-4 w-4 mr-1"}),"Back"]}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mt-8 text-center",children:"Message not found."})]})}}},e=>{e.O(0,[989,41487,3765,28441,93794,77358],()=>e(e.s=54722)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[10576],{11012:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(99537).A)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},14577:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(99537).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},34454:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>j});var a=t(95155),n=t(35484),r=t(11012),i=t(14577);let l=(0,t(99537).A)("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]);var c=t(65738),d=t(92571),o=t(64577),h=t(75796),x=t(73321),m=t(12115),u=t(3765),p=t(89239),f=t(42763);function j(){(0,u.si)("Inbox",{hideActions:!0});let e=(0,x.useRouter)(),[s,t]=(0,m.useState)([]),[j,g]=(0,m.useState)(!0),[y,N]=(0,m.useState)(null),[k,v]=(0,m.useState)(!1),b=(0,m.useCallback)(async()=>{let e=await fetch("/api/inbox");e.ok&&t((await e.json()).messages||[]),g(!1)},[]);(0,m.useEffect)(()=>{b()},[b]);let w=async(e,s)=>{e.stopPropagation();let a=!s.read;await fetch(`/api/inbox/${s.id}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({read:a})}),t(e=>e.map(e=>e.id===s.id?{...e,read:a}:e))},C=async()=>{y&&(await fetch(`/api/inbox/${y}`,{method:"DELETE"}),t(e=>e.filter(e=>e.id!==y)),N(null))},A=async()=>{await fetch("/api/inbox",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"mark_all_read"})}),t(e=>e.map(e=>({...e,read:!0})))},$=async()=>{await fetch("/api/inbox",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"clear"})}),t([]),v(!1)},M=s.filter(e=>!e.read).length;return(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 justify-between",children:[(0,a.jsx)("div",{className:"text-sm text-muted-foreground",children:s.length>0&&(0,a.jsxs)(a.Fragment,{children:[s.length," message",1!==s.length?"s":"",M>0&&` (${M} unread)`]})}),s.length>0&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[M>0&&(0,a.jsxs)(p.$,{variant:"outline",size:"sm",onClick:A,children:[(0,a.jsx)(l,{className:"h-3.5 w-3.5 mr-1"}),"Mark all read"]}),(0,a.jsxs)(p.$,{variant:"outline",size:"sm",onClick:()=>v(!0),children:[(0,a.jsx)(c.A,{className:"h-3.5 w-3.5 mr-1"}),"Clear all"]})]})]}),j&&(0,a.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,a.jsx)(d.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),!j&&0===s.length&&(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,a.jsx)(o.A,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"No messages."}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Messages from scheduled jobs will appear here."})]}),(0,a.jsx)("div",{className:"space-y-2",children:s.map(s=>(0,a.jsx)("div",{className:`rounded-lg border bg-card transition-colors cursor-pointer hover:bg-accent/50 ${!s.read?"border-l-2 border-l-blue-500":""}`,role:"button",onClick:()=>e.push(`/inbox/${s.id}`),children:(0,a.jsxs)("div",{className:"flex items-center gap-3 p-4",children:[function(e){switch(e){case"error":return(0,a.jsx)(n.A,{className:"h-4 w-4 text-destructive shrink-0"});case"warning":return(0,a.jsx)(r.A,{className:"h-4 w-4 text-yellow-500 shrink-0"});default:return(0,a.jsx)(i.A,{className:"h-4 w-4 text-blue-500 shrink-0"})}}(s.priority),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsx)("span",{className:`text-sm truncate ${!s.read?"font-semibold":""}`,children:s.title})}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-0.5 text-xs text-muted-foreground",children:[s.jobName&&(0,a.jsx)("span",{children:s.jobName}),(0,a.jsx)("span",{children:function(e){let s=Math.floor((Date.now()-e)/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;let t=Math.floor(s/60);if(t<24)return`${t}h ago`;let a=Math.floor(t/24);return`${a}d ago`}(s.createdAt)})]})]}),(0,a.jsxs)("div",{className:"flex items-center shrink-0",children:[(0,a.jsx)(p.$,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-foreground",title:s.read?"Mark as unread":"Mark as read",onClick:e=>w(e,s),children:s.read?(0,a.jsx)(h.A,{className:"h-3.5 w-3.5"}):(0,a.jsx)(o.A,{className:"h-3.5 w-3.5"})}),(0,a.jsx)(p.$,{variant:"ghost",size:"icon",className:"h-8 w-8 text-muted-foreground hover:text-destructive",onClick:e=>{var t;return t=s.id,void(e.stopPropagation(),N(t))},children:(0,a.jsx)(c.A,{className:"h-3.5 w-3.5"})})]})]})},s.id))}),(0,a.jsx)(f.lG,{open:!!y,onOpenChange:()=>N(null),children:(0,a.jsxs)(f.Cf,{children:[(0,a.jsx)(f.c7,{children:(0,a.jsx)(f.L3,{children:"Delete Message"})}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Delete this message? This cannot be undone."}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)(p.$,{variant:"outline",onClick:()=>N(null),children:"Cancel"}),(0,a.jsx)(p.$,{variant:"destructive",onClick:C,children:"Delete"})]})]})}),(0,a.jsx)(f.lG,{open:k,onOpenChange:()=>v(!1),children:(0,a.jsxs)(f.Cf,{children:[(0,a.jsx)(f.c7,{children:(0,a.jsx)(f.L3,{children:"Clear All Messages"})}),(0,a.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Delete all inbox messages? This cannot be undone."}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)(p.$,{variant:"outline",onClick:()=>v(!1),children:"Cancel"}),(0,a.jsx)(p.$,{variant:"destructive",onClick:$,children:"Clear All"})]})]})})]})}},35484:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(99537).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},46728:(e,s,t)=>{Promise.resolve().then(t.bind(t,34454))},75796:(e,s,t)=>{"use strict";t.d(s,{A:()=>a});let a=(0,t(99537).A)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]])}},e=>{e.O(0,[989,41487,3765,28441,93794,77358],()=>e(e.s=46728)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[58179],{10895:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>k});var l=t(95155),n=t(9005),a=t(31966),i=t(2125),r=t(73321),o=t(12115),d=t(3765),c=t(41158),m=t(89239),u=t(81477),x=t(60529),h=t(8081),p=t(84949);let f=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],j=["Read","Write","Edit","Bash","Bash git","Bash npm","Bash ls","Grep","Glob","Agent","WebFetch","WebSearch"],y={low:"Low",medium:"Medium",high:"High",xhigh:"XHigh",max:"Max"},v=(0,h.zQ)("sonnet")?.modelId||"",g="w-full rounded-md border bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring";function b({checked:e,onChange:s}){return(0,l.jsx)("button",{type:"button",role:"switch","aria-checked":e,onClick:()=>s(!e),className:`relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors ${e?"bg-primary":"bg-muted"}`,children:(0,l.jsx)("span",{className:`pointer-events-none inline-block h-4 w-4 rounded-full bg-background shadow-lg transition-transform ${e?"translate-x-4":"translate-x-0"}`})})}function N({value:e,onChange:s,onRemove:t,canRemove:a}){let i="simple"===e.type;return(0,l.jsxs)("div",{className:"border rounded-md p-3 space-y-2",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(m.$,{variant:i?"default":"outline",size:"sm",onClick:()=>s({type:"simple",frequency:"daily",time:"09:00"}),children:"Simple"}),(0,l.jsx)(m.$,{variant:i?"outline":"default",size:"sm",onClick:()=>s({type:"cron",expression:"0 9 * * *"}),children:"Cron"})]}),a&&(0,l.jsx)("button",{type:"button",onClick:t,className:"text-muted-foreground hover:text-destructive",children:(0,l.jsx)(n.A,{className:"h-4 w-4"})})]}),i?(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsxs)("select",{value:e.frequency,onChange:t=>s({...e,frequency:t.target.value}),className:g,children:[(0,l.jsx)("option",{value:"hourly",children:"Hourly"}),(0,l.jsx)("option",{value:"daily",children:"Daily"}),(0,l.jsx)("option",{value:"weekly",children:"Weekly"}),(0,l.jsx)("option",{value:"monthly",children:"Monthly"})]}),"hourly"!==e.frequency&&(0,l.jsx)(x.p,{type:"time",value:e.time||"09:00",onChange:t=>s({...e,time:t.target.value})}),"weekly"===e.frequency&&(0,l.jsx)("select",{value:e.dayOfWeek??1,onChange:t=>s({...e,dayOfWeek:Number(t.target.value)}),className:g,children:f.map((e,s)=>(0,l.jsx)("option",{value:s,children:e},e))}),"monthly"===e.frequency&&(0,l.jsx)(x.p,{type:"number",min:1,max:31,value:e.dayOfMonth??1,onChange:t=>s({...e,dayOfMonth:Number(t.target.value)}),placeholder:"Day of month"})]}):(0,l.jsx)(x.p,{value:e.expression,onChange:e=>s({type:"cron",expression:e.target.value}),placeholder:"0 9 * * 1-5",className:"font-mono"}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:(0,p.Bg)(e)})]})}function k(){let e=(0,r.useParams)(),s=(0,r.useSearchParams)(),t=e.id,f="new"===t,k=f?s.get("from"):null,w=f?s.get("cwd"):null,C=(0,r.useRouter)();(0,d.si)(k?"Duplicate Job":f?"New Job":"Edit Job",{hideActions:!0});let[S,$]=(0,o.useState)(""),[M,W]=(0,o.useState)(w||""),[A,z]=(0,o.useState)(""),[E,T]=(0,o.useState)(!0),[D,I]=(0,o.useState)([{type:"simple",frequency:"daily",time:"09:00"}]),[O,B]=(0,o.useState)(v),[R,P]=(0,o.useState)("200k"),[Z,L]=(0,o.useState)("medium"),[q,J]=(0,o.useState)("anthropic"),[F,U]=(0,o.useState)("stream"),[_,H]=(0,o.useState)(30),[K,X]=(0,o.useState)(!1),[G,Q]=(0,o.useState)([]),[V,Y]=(0,o.useState)(""),[ee,es]=(0,o.useState)([]),[et,el]=(0,o.useState)({}),[en,ea]=(0,o.useState)({}),[ei,er]=(0,o.useState)(new Set),[eo,ed]=(0,o.useState)([]),[ec,em]=(0,o.useState)(!1),[eu,ex]=(0,o.useState)(90),[eh,ep]=(0,o.useState)(!1),[ef,ej]=(0,o.useState)([]),[ey,ev]=(0,o.useState)([]),[eg,eb]=(0,o.useState)([]),[eN,ek]=(0,o.useState)(!1),[ew,eC]=(0,o.useState)(!1),[eS,e$]=(0,o.useState)(!f||!!k),eM="anthropic"===q,eW=eg.find(e=>e.id===q),eA=eM&&O?(0,h.bs)(O):null,ez=eA?.alias||null,eE=ez?(0,h.r5)(ez):[],eT=eE.length>1,eD=!eM&&eW?eW.models.find(e=>e.modelId===O):null,eI=(0,o.useMemo)(()=>eM?eA?.contextSizes??["200k"]:eD?.contextSizes??["200k"],[eM,eA,eD]);(0,o.useEffect)(()=>{eI.includes(R)||P(eI[0]??"200k")},[eI,R]);let eO=(()=>{if(!eM&&eD)return eD.effortLevels;let e=O.replace(/\[.*\]$/,"");for(let s of eg){let t=s.models.find(s=>s.modelId===e);if(t&&t.effortLevels.length>0)return t.effortLevels}return eA?(0,h.iz)(eA):[]})(),eB=j.filter(e=>!G.includes(e)),eR=eg.filter(e=>!e.isBuiltin);function eP(e){let s=(0,h.zQ)(e);s&&(J("anthropic"),B(s.modelId),P("200k"),L((0,h.Mi)(s)||""))}function eZ(e){let s=e.trim();s&&!G.includes(s)&&Q([...G,s]),Y("")}let eL=(0,o.useCallback)((e,s)=>{$(s?`${e.name} (copy)`:e.name),W(e.cwd),z(e.prompt),T(e.enabled),I((0,p.KU)(e));let t=e.model||"",l=t.replace(/\[.*\]$/,""),n=l.indexOf(":");if(n>0)J(l.slice(0,n)),B(l.slice(n+1));else{J("anthropic");let e=(0,h.AX)(l);B(e?.modelId||v)}let a=/\[1m\]$/i.test(t);P(e.contextSize??(a?"1m":"200k"));let i=(0,h.AX)(l);L(e.thinkingLevel||(0,h.Mi)(i)||""),H(e.maxDurationMinutes??30),X(e.bypassPermissions??!1),Q(e.allowedTools||[]),es(e.mcpServers||[]),el(e.mcpToolFilters||{}),em(e.skipIfMissed??!1),ex(e.retentionDays??90),ep(e.inboxOutput??!1),ej(e.notifyProviders||[]),U(e.runtime||"stream")},[]),eq=(0,o.useCallback)(async()=>{let e=k||(f?null:t);if(e)try{let s=await fetch(`/api/jobs/${e}`);if(!s.ok)return void C.push("/jobs");let t=await s.json();eL(t.job,!!k)}finally{e$(!1)}},[t,f,k,C,eL]);async function eJ(){eC(!0);let e=O;!eM&&q&&(e=`${q}:${O}`);let s={name:S,cwd:M,prompt:A,enabled:E,schedule:D[0],schedules:D,model:e,contextSize:R,thinkingLevel:Z||void 0,maxDurationMinutes:_,bypassPermissions:K,allowedTools:G,mcpServers:ee,mcpToolFilters:et,skipIfMissed:ec,retentionDays:eu,inboxOutput:eh,notifyProviders:ef,runtime:F};try{let e=f?"/api/jobs":`/api/jobs/${t}`,l=f?"POST":"PUT",n=await fetch(e,{method:l,headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(n.ok){let e=await n.json(),s=f?e.job.id:t;C.push(`/jobs/${s}`)}}finally{eC(!1)}}return((0,o.useEffect)(()=>{eq()},[eq]),(0,o.useEffect)(()=>{let e=M?`?cwd=${encodeURIComponent(M)}`:"";fetch(`/api/jobs/mcp-discover${e}`).then(e=>e.json()).then(e=>ed(e.servers)).catch(()=>ed([]))},[M]),(0,o.useEffect)(()=>{fetch("/api/notifications").then(e=>e.json()).then(e=>ev((e.providers||[]).filter(e=>e.enabled))).catch(()=>ev([]))},[]),(0,o.useEffect)(()=>{fetch("/api/providers").then(e=>e.json()).then(e=>{Array.isArray(e)&&eb(e)}).catch(()=>{})},[]),eS)?(0,l.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4",children:(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading..."})}):(0,l.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4",children:(0,l.jsxs)("div",{className:"max-w-2xl mx-auto space-y-4 pb-8",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)(m.$,{variant:"ghost",size:"icon",onClick:()=>C.push(f?"/jobs":`/jobs/${t}`),children:(0,l.jsx)(a.A,{className:"h-4 w-4"})}),(0,l.jsx)("h2",{className:"font-semibold",children:k?"Duplicate Job":f?"New Job":"Edit Job"})]}),(0,l.jsx)(u.Zp,{children:(0,l.jsxs)(u.Wu,{className:"pt-6 space-y-4",children:[(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)("label",{className:"text-sm font-medium",children:"Name"}),(0,l.jsx)(x.p,{value:S,onChange:e=>$(e.target.value),placeholder:"Weekly dependency update"})]}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)("label",{className:"text-sm font-medium",children:"Prompt"}),(0,l.jsx)("textarea",{value:A,onChange:e=>z(e.target.value),placeholder:"Check for outdated dependencies and create a PR updating them...",className:"w-full min-h-[120px] rounded-md border bg-background px-3 py-2 text-sm font-mono resize-y focus:outline-none focus:ring-2 focus:ring-ring"})]})]})}),(0,l.jsxs)(u.Zp,{children:[(0,l.jsx)(u.aR,{className:"pb-2",children:(0,l.jsx)(u.ZB,{className:"text-sm font-medium",children:"Working Directory"})}),(0,l.jsxs)(u.Wu,{className:"space-y-2",children:[(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(x.p,{value:M,onChange:e=>W(e.target.value),placeholder:"Leave empty for scratchpad",className:"flex-1"}),(0,l.jsx)(m.$,{variant:"outline",size:"sm",onClick:()=>ek(!0),children:"Browse"})]}),!M&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:"Uses ~/.cockpit/jobs as a temporary scratchpad directory"}),eN&&(0,l.jsx)("div",{className:"border rounded-md p-3",children:(0,l.jsx)(c.K,{onSelect:e=>{W(e),ek(!1)},onCancel:()=>ek(!1)})})]})]}),(0,l.jsxs)(u.Zp,{children:[(0,l.jsx)(u.aR,{className:"pb-2",children:(0,l.jsx)(u.ZB,{className:"text-sm font-medium",children:"Schedule"})}),(0,l.jsxs)(u.Wu,{className:"space-y-3",children:[D.map((e,s)=>(0,l.jsx)(N,{value:e,onChange:e=>I(D.map((t,l)=>l===s?e:t)),onRemove:()=>I(D.filter((e,t)=>t!==s)),canRemove:D.length>1},s)),(0,l.jsxs)("button",{type:"button",onClick:()=>I([...D,{type:"simple",frequency:"daily",time:"09:00"}]),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-primary transition-colors",children:[(0,l.jsx)(i.A,{className:"h-3 w-3"}),"Add schedule"]})]})]}),(0,l.jsxs)(u.Zp,{children:[(0,l.jsx)(u.aR,{className:"pb-2",children:(0,l.jsx)(u.ZB,{className:"text-sm font-medium",children:"Model"})}),(0,l.jsxs)(u.Wu,{className:"space-y-1",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-1.5 px-2 py-2 text-sm",children:[(0,l.jsx)("span",{children:"Provider"}),(0,l.jsxs)("select",{value:q,onChange:e=>{if("anthropic"===e.target.value)(0,h.bs)(O)?J("anthropic"):eP("sonnet");else{var s=e.target.value;J(s);let t=eg.find(e=>e.id===s);if(t&&t.models.length>0){let e=t.models[0];B(e.modelId),P("200k"),L(e.defaultEffort||(e.effortLevels.length>0?e.effortLevels[0]:""))}}},className:g,children:[(0,l.jsx)("option",{value:"anthropic",children:"Anthropic"}),eR.map(e=>(0,l.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),eM&&(0,l.jsxs)("div",{className:"flex items-center justify-between px-2 py-2 text-sm",children:[(0,l.jsx)("span",{children:"Model"}),(0,l.jsx)("div",{className:"flex gap-1 flex-wrap justify-end",children:["haiku","sonnet","opus"].map(e=>(0,l.jsx)(m.$,{variant:ez===e?"default":"outline",size:"sm",onClick:()=>eP(e),children:e.charAt(0).toUpperCase()+e.slice(1)},e))})]}),!eM&&eW&&(0,l.jsxs)("div",{className:"flex items-center justify-between px-2 py-2 text-sm",children:[(0,l.jsx)("span",{children:"Model"}),(0,l.jsx)("div",{className:"flex gap-1 flex-wrap justify-end",children:eW.models.map(e=>(0,l.jsx)(m.$,{variant:O===e.modelId?"default":"outline",size:"sm",onClick:()=>{B(e.modelId),P("200k"),L(e.defaultEffort||(e.effortLevels.length>0?e.effortLevels[0]:""))},children:e.displayName},e.modelId))})]}),eM&&eT&&(0,l.jsxs)("div",{className:"flex items-center justify-between px-2 py-2 text-sm",children:[(0,l.jsx)("span",{children:"Version"}),(0,l.jsx)("div",{className:"flex gap-1 flex-wrap justify-end",children:eE.map(e=>(0,l.jsx)(m.$,{variant:eA?.version===e.version?"default":"outline",size:"sm",onClick:()=>(function(e){if(!ez)return;let s=(0,h.r5)(ez).find(s=>s.version===e);if(s){B(s.modelId);let e=(()=>{for(let e of eg){let t=e.models.find(e=>e.modelId===s.modelId);if(t)return t.effortLevels}return[]})(),t=e.length>0?e:(0,h.iz)(s);Z&&!t.includes(Z)&&L((0,h.Mi)(s)||"")}})(e.version),children:e.version},e.version))})]}),eI.length>=2&&(0,l.jsxs)("div",{className:"flex items-center justify-between px-2 py-2 text-sm",children:[(0,l.jsx)("span",{children:"Context"}),(0,l.jsx)("div",{className:"flex gap-1",children:eI.map(e=>(0,l.jsx)(m.$,{variant:R===e?"default":"outline",size:"sm",onClick:()=>P(e),children:h.XR[e].label},e))})]}),eO.length>0&&(0,l.jsxs)("div",{className:"flex items-center justify-between px-2 py-2 text-sm",children:[(0,l.jsx)("span",{children:"Thinking"}),(0,l.jsx)("div",{className:"flex gap-1 flex-wrap justify-end",children:eO.map(e=>(0,l.jsx)(m.$,{variant:Z===e?"default":"outline",size:"sm",onClick:()=>L(e),children:y[e]},e))})]})]})]}),(0,l.jsxs)(u.Zp,{children:[(0,l.jsx)(u.aR,{className:"pb-2",children:(0,l.jsx)(u.ZB,{className:"text-sm font-medium",children:"Permissions"})}),(0,l.jsxs)(u.Wu,{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"text-sm font-medium",children:"Bypass Permissions"}),K&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:"All tool permissions will be auto-approved"})]}),(0,l.jsx)(b,{checked:K,onChange:X})]}),!K&&(0,l.jsxs)("div",{className:"space-y-2 border-t pt-4",children:[(0,l.jsx)("label",{className:"text-sm font-medium",children:"Allowed Tools"}),G.length>0&&(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5",children:G.map(e=>(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs px-2 py-1 rounded-md bg-primary/10 text-primary font-mono",children:[e,(0,l.jsx)("button",{type:"button",onClick:()=>{Q(G.filter(s=>s!==e))},className:"hover:text-destructive",children:(0,l.jsx)(n.A,{className:"h-3 w-3"})})]},e))}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(x.p,{value:V,onChange:e=>Y(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),eZ(V))},placeholder:"Type tool name and press Enter",className:"flex-1 font-mono"}),(0,l.jsx)(m.$,{variant:"outline",size:"sm",onClick:()=>eZ(V),disabled:!V.trim(),children:"Add"})]}),eB.length>0&&(0,l.jsx)("div",{className:"flex flex-wrap gap-1",children:eB.map(e=>(0,l.jsxs)("button",{type:"button",onClick:()=>eZ(e),className:"text-xs px-2 py-0.5 rounded border border-dashed border-muted-foreground/30 text-muted-foreground hover:border-primary hover:text-primary transition-colors",children:["+ ",e]},e))}),0===G.length&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:"No tools permitted. Add tools this job is allowed to use."})]})]})]}),(0,l.jsxs)(u.Zp,{children:[(0,l.jsx)(u.aR,{className:"pb-2",children:(0,l.jsx)(u.ZB,{className:"text-sm font-medium",children:"MCP Servers"})}),(0,l.jsxs)(u.Wu,{className:"space-y-2",children:[0===eo.length&&(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:"No MCP servers found. Configure servers in Settings."}),eo.length>0&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5",children:eo.map(e=>{let s=ee.includes(e);return(0,l.jsx)("button",{type:"button",onClick:()=>{if(s){es(ee.filter(s=>s!==e));let{[e]:s,...t}=et;el(t),er(s=>{let t=new Set(s);return t.delete(e),t})}else es([...ee,e])},className:`inline-flex items-center gap-1 text-xs px-2.5 py-1 rounded-md font-mono transition-colors ${s?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"}`,children:e},e)})}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:0===ee.length?"No servers enabled. Select servers to activate.":`${ee.length} enabled.`}),ee.map(e=>{let s=et[e]||[],t=ei.has(e),a=en[e]||"";return(0,l.jsxs)("div",{className:"border rounded-md p-2 space-y-2",children:[(0,l.jsxs)("button",{type:"button",onClick:()=>er(s=>{let t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t}),className:"w-full flex items-center justify-between text-xs text-muted-foreground hover:text-primary",children:[(0,l.jsx)("span",{className:"font-mono",children:e}),(0,l.jsx)("span",{children:0===s.length?"All tools":`${s.length} tool${1===s.length?"":"s"} filtered`})]}),t&&(0,l.jsxs)("div",{className:"space-y-2 pt-1",children:[s.length>0&&(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5",children:s.map(t=>(0,l.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs px-2 py-1 rounded-md bg-primary/10 text-primary font-mono",children:[t,(0,l.jsx)("button",{type:"button",onClick:()=>{let l=s.filter(e=>e!==t);if(0===l.length){let{[e]:s,...t}=et;el(t)}else el({...et,[e]:l})},className:"hover:text-destructive",children:(0,l.jsx)(n.A,{className:"h-3 w-3"})})]},t))}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(x.p,{value:a,onChange:s=>ea({...en,[e]:s.target.value}),onKeyDown:t=>{if("Enter"===t.key){t.preventDefault();let l=a.trim();l&&!s.includes(l)&&(el({...et,[e]:[...s,l]}),ea({...en,[e]:""}))}},placeholder:"Tool name or server:tool",className:"flex-1 font-mono text-xs"}),(0,l.jsx)(m.$,{variant:"outline",size:"sm",onClick:()=>{let t=a.trim();t&&!s.includes(t)&&(el({...et,[e]:[...s,t]}),ea({...en,[e]:""}))},disabled:!a.trim(),children:"Add"})]}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:"Leave empty to allow all tools. For proxy servers, use server:tool format."})]})]},e)})]})]})]}),(0,l.jsxs)(u.Zp,{children:[(0,l.jsx)(u.aR,{className:"pb-2",children:(0,l.jsx)(u.ZB,{className:"text-sm font-medium",children:"Execution"})}),(0,l.jsxs)(u.Wu,{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("label",{className:"text-sm font-medium",children:"Runtime"}),(0,l.jsxs)("div",{className:"flex gap-1",children:[(0,l.jsx)(m.$,{variant:"stream"===F?"default":"outline",size:"sm",onClick:()=>U("stream"),children:"Stream"}),(0,l.jsx)(m.$,{variant:"pty"===F?"default":"outline",size:"sm",onClick:()=>U("pty"),children:"PTY"})]})]}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)("label",{className:"text-sm font-medium",children:"Max Duration (minutes)"}),(0,l.jsx)(x.p,{type:"number",min:1,value:_,onChange:e=>H(Number(e.target.value))})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("label",{className:"text-sm font-medium",children:"Retry missed runs"}),(0,l.jsx)(b,{checked:!ec,onChange:e=>em(!e)})]}),(0,l.jsxs)("div",{className:"space-y-1.5",children:[(0,l.jsx)("label",{className:"text-sm font-medium",children:"Audit log retention (days)"}),(0,l.jsx)(x.p,{type:"number",min:1,value:eu,onChange:e=>ex(Number(e.target.value))})]}),(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("label",{className:"text-sm font-medium",children:"Enabled"}),(0,l.jsx)(b,{checked:E,onChange:T})]})]})]}),(0,l.jsxs)(u.Zp,{children:[(0,l.jsx)(u.aR,{className:"pb-2",children:(0,l.jsx)(u.ZB,{className:"text-sm font-medium",children:"Output"})}),(0,l.jsxs)(u.Wu,{className:"space-y-4",children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("label",{className:"text-sm font-medium",children:"Send to Inbox"}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5",children:"The agent will format its final output as a structured message delivered to your Cockpit inbox."})]}),(0,l.jsx)(b,{checked:eh,onChange:ep})]}),eh&&ey.length>0&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t",children:[(0,l.jsx)("label",{className:"text-sm font-medium",children:"External notifications"}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 mb-2",children:"Also send to these providers when a message is delivered."}),(0,l.jsx)("div",{className:"space-y-1.5",children:ey.map(e=>(0,l.jsxs)("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[(0,l.jsx)("input",{type:"checkbox",checked:ef.includes(e.id),onChange:s=>ej(t=>s.target.checked?[...t,e.id]:t.filter(s=>s!==e.id)),className:"rounded border-input"}),(0,l.jsx)("span",{children:e.name}),(0,l.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",e.type,")"]})]},e.id))})]})]})]}),(0,l.jsxs)("div",{className:"flex gap-2",children:[(0,l.jsx)(m.$,{onClick:eJ,disabled:ew||!S||!A,children:ew?"Saving...":"Save"}),(0,l.jsx)(m.$,{variant:"outline",onClick:()=>C.push(f?"/jobs":`/jobs/${t}`),children:"Cancel"})]})]})})}},39071:(e,s,t)=>{Promise.resolve().then(t.bind(t,10895))},84949:(e,s,t)=>{"use strict";function l(e,s,t){let l=[];for(let n of e.split(",")){let e=n.match(/^(.+)\/(\d+)$/),a=e?Number.parseInt(e[2],10):1,i=e?e[1]:n;if("*"===i)for(let e=s;e<=t;e+=a)l.push(e);else if(i.includes("-")){let[e,s]=i.split("-"),t=Number.parseInt(e,10),n=Number.parseInt(s,10);for(let e=t;e<=n;e+=a)l.push(e)}else l.push(Number.parseInt(i,10))}return l}function n(e){if("cron"===e.type)return`cron: ${e.expression}`;let s=e.time||"00:00";switch(e.frequency){case"hourly":return`Every hour at :${s.split(":")[1]||"00"}`;case"daily":return`Daily at ${s}`;case"weekly":return`Weekly on ${["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.dayOfWeek??0]} at ${s}`;case"monthly":return`Monthly on day ${e.dayOfMonth??1} at ${s}`}}function a(e){return e.schedules?.length?e.schedules:[e.schedule]}function i(e){return e.map(n).join("; ")}function r(e,s){let t=null;for(let n of e){let e=function(e,s){let t=function(e){let s=e.trim().split(/\s+/);if(5!==s.length)throw Error(`Invalid cron expression: expected 5 fields, got ${s.length}`);return{minute:l(s[0],0,59),hour:l(s[1],0,23),dayOfMonth:l(s[2],1,31),month:l(s[3],1,12),dayOfWeek:l(s[4],0,6),domWild:"*"===s[2],dowWild:"*"===s[4]}}("cron"===e.type?e.expression:function(e){let[s,t]=(e.time||"00:00").split(":").map(Number);switch(e.frequency){case"hourly":return`${t} * * * *`;case"daily":return`${t} ${s} * * *`;case"weekly":return`${t} ${s} * * ${e.dayOfWeek??0}`;case"monthly":return`${t} ${s} ${e.dayOfMonth??1} * *`}}(e)),n=new Date(s.getTime());n.setSeconds(0,0),n.setMinutes(n.getMinutes()+1);for(let e=0;e<525960;e++){if(t.minute.includes(n.getMinutes())&&t.hour.includes(n.getHours())&&t.dayOfMonth.includes(n.getDate())&&t.month.includes(n.getMonth()+1)&&t.dayOfWeek.includes(n.getDay()))return n;n.setMinutes(n.getMinutes()+1)}return new Date(s.getTime()+864e5)}(n,s);(!t||e.getTime()<t.getTime())&&(t=new Date(e.getTime()))}return t??new Date(s.getTime()+864e5)}t.d(s,{Bg:()=>n,JH:()=>i,KU:()=>a,ay:()=>r})}},e=>{e.O(0,[989,41487,3765,28441,93794,77358],()=>e(e.s=39071)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39410],{2330:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>b});var n=t(95155),a=t(94088),r=t(12363),l=t(31966),i=t(18986),c=t(92571),d=t(36619),o=t(65738),u=t(73321),m=t(12115),h=t(3765),x=t(45160),p=t(89239),f=t(81477),j=t(42763),g=t(67032),N=t(8081),y=t(84949);function w({prompt:e}){let[s,t]=(0,m.useState)(!1),l=e.split("\n"),i=l.length>8,c=i&&!s?l.slice(0,8).join("\n"):e;return(0,n.jsxs)(f.Zp,{children:[(0,n.jsx)(f.aR,{className:"pb-2",children:(0,n.jsx)(f.ZB,{className:"text-sm font-medium",children:"Prompt"})}),(0,n.jsxs)(f.Wu,{children:[(0,n.jsx)("pre",{className:"text-sm whitespace-pre-wrap break-all font-mono bg-muted rounded p-3",children:c}),i&&(0,n.jsxs)("button",{onClick:()=>t(!s),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground mt-2 transition-colors",children:[s?(0,n.jsx)(a.A,{className:"h-3 w-3"}):(0,n.jsx)(r.A,{className:"h-3 w-3"}),s?"Show less":`Show all ${l.length} lines`]})]})]})}function b(){let e=(0,u.useParams)().id,s=(0,u.useRouter)(),[t,a]=(0,m.useState)(null),[r,b]=(0,m.useState)(!0),[v,$]=(0,m.useState)(!1),[k,M]=(0,m.useState)(!1);(0,h.si)(t?.name||"Job",{hideActions:!0});let{runs:A,loading:D,loadingMore:C,hasMore:E,refresh:S,loadMore:T}=(0,g.Jm)(e),O=(0,m.useCallback)(async()=>{try{let t=await fetch(`/api/jobs/${e}`);if(!t.ok)return void s.push("/jobs");let n=await t.json();a(n.job)}finally{b(!1)}},[e,s]);async function W(){$(!0),await fetch(`/api/jobs/${e}/trigger`,{method:"POST"}),$(!1),S()}async function z(){(await fetch(`/api/jobs/${e}`,{method:"DELETE"})).ok&&s.push("/jobs")}return((0,m.useEffect)(()=>{O()},[O]),r||!t)?(0,n.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4",children:(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading..."})}):(0,n.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4",children:(0,n.jsxs)("div",{className:"max-w-2xl mx-auto space-y-4 pb-8",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(p.$,{variant:"ghost",size:"icon",onClick:()=>s.push("/jobs"),children:(0,n.jsx)(l.A,{className:"h-4 w-4"})}),(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)("h2",{className:"font-semibold truncate",children:t.name}),t.enabled?(0,n.jsx)(x.E,{variant:"default",children:"Active"}):(0,n.jsx)(x.E,{variant:"secondary",children:"Disabled"})]}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:(0,y.JH)((0,y.KU)(t))})]})]}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsxs)(p.$,{variant:"outline",size:"sm",onClick:()=>s.push(`/jobs/${e}/edit`),children:[(0,n.jsx)(i.A,{className:"h-4 w-4 mr-1"}),"Edit"]}),(0,n.jsxs)(p.$,{variant:"outline",size:"sm",onClick:W,disabled:v,children:[v?(0,n.jsx)(c.A,{className:"h-4 w-4 mr-1 animate-spin"}):(0,n.jsx)(d.A,{className:"h-4 w-4 mr-1"}),"Run Now"]}),(0,n.jsxs)(p.$,{variant:"ghost",size:"sm",className:"text-destructive hover:text-destructive",onClick:()=>M(!0),children:[(0,n.jsx)(o.A,{className:"h-4 w-4 mr-1"}),"Delete"]})]}),(0,n.jsx)(w,{prompt:t.prompt}),(0,n.jsx)(f.Zp,{children:(0,n.jsx)(f.Wu,{className:"pt-4",children:(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-y-2 text-sm",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Model"}),(0,n.jsx)("span",{className:"text-right",children:function(e){let s=e.model||"",t=/\[1m\]$/i.test(s)?" (1M)":"",n=s.replace(/\[.*\]$/,""),a=n.indexOf(":");if(a>0)return`${n.slice(a+1)}${t}`;let r=(0,N.bs)(n);if(!r)return s||"Default";let l=r.alias.charAt(0).toUpperCase()+r.alias.slice(1);return`${l} ${r.version}${t}`}(t)}),t.thinkingLevel&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Thinking"}),(0,n.jsx)("span",{className:"text-right capitalize",children:t.thinkingLevel})]}),(0,n.jsx)("span",{className:"text-muted-foreground",children:"Runtime"}),(0,n.jsx)("span",{className:"text-right uppercase",children:t.runtime||"stream"}),(0,n.jsx)("span",{className:"text-muted-foreground",children:"Max Duration"}),(0,n.jsxs)("span",{className:"text-right",children:[t.maxDurationMinutes??30," min"]}),t.cwd&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Directory"}),(0,n.jsx)("span",{className:"text-right font-mono text-xs truncate",children:t.cwd})]}),(0,n.jsx)("span",{className:"text-muted-foreground",children:"Permissions"}),(0,n.jsx)("span",{className:"text-right",children:t.bypassPermissions?"Bypass all":`${(t.allowedTools||[]).length} tools allowed`}),(t.mcpServers||[]).length>0&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"MCP Servers"}),(0,n.jsx)("span",{className:"text-right text-xs font-mono truncate",children:(t.mcpServers||[]).join(", ")})]})]})})}),(0,n.jsxs)(f.Zp,{children:[(0,n.jsx)(f.aR,{className:"pb-2",children:(0,n.jsx)(f.ZB,{className:"text-sm font-medium",children:"Run History"})}),(0,n.jsxs)(f.Wu,{children:[D&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading runs..."}),!D&&0===A.length&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"No runs yet."}),(0,n.jsx)("div",{className:"space-y-1",children:A.map(t=>(0,n.jsxs)("button",{type:"button",className:"w-full flex items-center gap-3 rounded px-2 py-2 hover:bg-muted transition-colors text-left",onClick:()=>s.push(`/jobs/${e}/runs/${t.id}`),children:[function(e){switch(e){case"success":return(0,n.jsx)(x.E,{className:"bg-green-600 text-white",children:"Success"});case"failure":return(0,n.jsx)(x.E,{variant:"destructive",children:"Failed"});case"timeout":return(0,n.jsx)(x.E,{className:"bg-yellow-600 text-white",children:"Timeout"});case"running":return(0,n.jsx)(x.E,{className:"bg-blue-600 text-white",children:"Running"});default:return(0,n.jsx)(x.E,{variant:"secondary",children:e})}}(t.status),(0,n.jsx)("span",{className:"text-xs text-muted-foreground flex-1",children:new Date(t.startedAt).toLocaleString()}),null!=t.durationMs&&(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:[Math.round(t.durationMs/1e3),"s"]})]},t.id))}),E&&(0,n.jsx)(p.$,{variant:"ghost",size:"sm",className:"w-full mt-2",onClick:T,disabled:C,children:C?"Loading...":"Load more"})]})]}),(0,n.jsx)(j.lG,{open:k,onOpenChange:M,children:(0,n.jsxs)(j.Cf,{children:[(0,n.jsx)(j.c7,{children:(0,n.jsx)(j.L3,{children:"Delete Job"})}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Delete this job and all run history? This cannot be undone."}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(p.$,{variant:"outline",onClick:()=>M(!1),children:"Cancel"}),(0,n.jsx)(p.$,{variant:"destructive",onClick:z,children:"Delete"})]})]})})]})})}},18986:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});let n=(0,t(99537).A)("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},36619:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});let n=(0,t(99537).A)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]])},83250:(e,s,t)=>{Promise.resolve().then(t.bind(t,2330))},84949:(e,s,t)=>{"use strict";function n(e,s,t){let n=[];for(let a of e.split(",")){let e=a.match(/^(.+)\/(\d+)$/),r=e?Number.parseInt(e[2],10):1,l=e?e[1]:a;if("*"===l)for(let e=s;e<=t;e+=r)n.push(e);else if(l.includes("-")){let[e,s]=l.split("-"),t=Number.parseInt(e,10),a=Number.parseInt(s,10);for(let e=t;e<=a;e+=r)n.push(e)}else n.push(Number.parseInt(l,10))}return n}function a(e){if("cron"===e.type)return`cron: ${e.expression}`;let s=e.time||"00:00";switch(e.frequency){case"hourly":return`Every hour at :${s.split(":")[1]||"00"}`;case"daily":return`Daily at ${s}`;case"weekly":return`Weekly on ${["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.dayOfWeek??0]} at ${s}`;case"monthly":return`Monthly on day ${e.dayOfMonth??1} at ${s}`}}function r(e){return e.schedules?.length?e.schedules:[e.schedule]}function l(e){return e.map(a).join("; ")}function i(e,s){let t=null;for(let a of e){let e=function(e,s){let t=function(e){let s=e.trim().split(/\s+/);if(5!==s.length)throw Error(`Invalid cron expression: expected 5 fields, got ${s.length}`);return{minute:n(s[0],0,59),hour:n(s[1],0,23),dayOfMonth:n(s[2],1,31),month:n(s[3],1,12),dayOfWeek:n(s[4],0,6),domWild:"*"===s[2],dowWild:"*"===s[4]}}("cron"===e.type?e.expression:function(e){let[s,t]=(e.time||"00:00").split(":").map(Number);switch(e.frequency){case"hourly":return`${t} * * * *`;case"daily":return`${t} ${s} * * *`;case"weekly":return`${t} ${s} * * ${e.dayOfWeek??0}`;case"monthly":return`${t} ${s} ${e.dayOfMonth??1} * *`}}(e)),a=new Date(s.getTime());a.setSeconds(0,0),a.setMinutes(a.getMinutes()+1);for(let e=0;e<525960;e++){if(t.minute.includes(a.getMinutes())&&t.hour.includes(a.getHours())&&t.dayOfMonth.includes(a.getDate())&&t.month.includes(a.getMonth()+1)&&t.dayOfWeek.includes(a.getDay()))return a;a.setMinutes(a.getMinutes()+1)}return new Date(s.getTime()+864e5)}(a,s);(!t||e.getTime()<t.getTime())&&(t=new Date(e.getTime()))}return t??new Date(s.getTime()+864e5)}t.d(s,{Bg:()=>a,JH:()=>l,KU:()=>r,ay:()=>i})},94088:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});let n=(0,t(99537).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])}},e=>{e.O(0,[989,41487,3765,28441,93794,77358],()=>e(e.s=83250)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[15496],{25494:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});let n=(0,t(99537).A)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]])},46172:(e,s,t)=>{Promise.resolve().then(t.bind(t,60532))},60532:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>b});var n=t(95155),a=t(94088),r=t(12363),i=t(76721),l=t(9005),c=t(92571),d=t(31966),o=t(36483),u=t(25494),x=t(73321),m=t(12115),h=t(3765),p=t(513),j=t(45160),f=t(89239),g=t(81477);function N({prompt:e}){let[s,t]=(0,m.useState)(!1),i=e.split("\n"),l=i.length>8,c=l&&!s?i.slice(0,8).join("\n"):e;return(0,n.jsxs)("div",{className:"mt-2",children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Prompt:"}),(0,n.jsx)("pre",{className:"mt-1 text-xs bg-muted rounded p-2 whitespace-pre-wrap",children:c}),l&&(0,n.jsxs)("button",{onClick:()=>t(!s),className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground mt-1 transition-colors",children:[s?(0,n.jsx)(a.A,{className:"h-3 w-3"}):(0,n.jsx)(r.A,{className:"h-3 w-3"}),s?"Show less":`Show all ${i.length} lines`]})]})}function v({tool:e}){let[s,t]=(0,m.useState)(!1);return(0,n.jsxs)("div",{className:"border rounded-md",children:[(0,n.jsxs)("button",{type:"button",className:"w-full flex items-center gap-2 px-3 py-2 text-left text-sm hover:bg-muted/50 transition-colors",onClick:()=>t(!s),children:[s?(0,n.jsx)(r.A,{className:"h-3 w-3 shrink-0"}):(0,n.jsx)(i.A,{className:"h-3 w-3 shrink-0"}),(0,n.jsx)("span",{className:"font-mono font-medium truncate min-w-0",children:e.name}),void 0!==e.permitted&&(0,n.jsx)(j.E,{variant:e.permitted?"secondary":"destructive",className:"text-[10px]",children:e.permitted?"Allowed":"Denied"}),null!=e.durationMs&&(0,n.jsxs)("span",{className:"text-xs text-muted-foreground ml-auto shrink-0",children:[e.durationMs,"ms"]})]}),s&&(0,n.jsxs)("div",{className:"border-t px-3 py-2 space-y-2",children:[e.input&&(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-xs font-medium text-muted-foreground mb-1",children:"Input"}),(0,n.jsx)("pre",{className:"text-xs bg-muted rounded p-2 overflow-x-auto max-h-48 whitespace-pre-wrap",children:e.input})]}),e.output&&(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-xs font-medium text-muted-foreground mb-1",children:"Output"}),(0,n.jsx)("pre",{className:"text-xs bg-muted rounded p-2 overflow-x-auto max-h-48 whitespace-pre-wrap",children:e.output})]})]})]})}function w({jobId:e,runId:s,onClose:t}){let[a,r]=(0,m.useState)([]),[i,d]=(0,m.useState)(!0),[o,u]=(0,m.useState)(null),x=(0,m.useRef)(new Set);(0,m.useEffect)(()=>{fetch(`/api/jobs/${e}/runs/${s}/transcript`).then(e=>{if(!e.ok)throw Error("Failed to load transcript");return e.json()}).then(e=>{r(e.messages),d(!1)}).catch(e=>{u(e.message),d(!1)})},[e,s]),(0,m.useEffect)(()=>{let e=e=>{"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),t())};return window.addEventListener("keydown",e,!0),()=>window.removeEventListener("keydown",e,!0)},[t]);let h=(0,m.useCallback)(e=>{e.target===e.currentTarget&&t()},[t]);return(0,n.jsx)("div",{className:"fixed inset-0 z-50 bg-black/50 flex items-center justify-center p-4",onClick:h,children:(0,n.jsxs)(g.Zp,{className:"w-full max-w-3xl flex flex-col",style:{maxHeight:"calc(100dvh - 2rem)"},children:[(0,n.jsxs)("div",{className:"flex items-center justify-between px-4 py-2 border-b shrink-0",children:[(0,n.jsx)("span",{className:"text-sm font-medium text-muted-foreground",children:"Run transcript"}),(0,n.jsx)(f.$,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:t,children:(0,n.jsx)(l.A,{className:"h-4 w-4"})})]}),(0,n.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[i&&(0,n.jsx)("div",{className:"flex justify-center py-12",children:(0,n.jsx)(c.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}),o&&(0,n.jsx)("div",{className:"text-center text-sm text-red-500 py-12",children:o}),!i&&0===a.length&&!o&&(0,n.jsx)("div",{className:"text-center text-sm text-muted-foreground py-12",children:"No transcript found for this run."}),!i&&a.map(e=>(0,n.jsx)("div",{children:(0,n.jsx)(p.s,{message:e,expandedToolIds:x})},e.id))]})]})})}function b(){let e=(0,x.useParams)(),s=e.id,t=e.runId,a=(0,x.useRouter)();(0,h.si)("Run Detail",{hideActions:!0});let[r,i]=(0,m.useState)(null),[l,c]=(0,m.useState)(!0),[p,b]=(0,m.useState)(!1),y=(0,m.useCallback)(async()=>{try{let e=await fetch(`/api/jobs/${s}/runs/${t}`);if(!e.ok)return void a.push(`/jobs/${s}`);let n=await e.json();i(n.run)}finally{c(!1)}},[s,t,a]);return((0,m.useEffect)(()=>{y()},[y]),l||!r)?(0,n.jsx)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4",children:(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading..."})}):(0,n.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 space-y-4",children:[(0,n.jsx)("div",{className:"flex items-center gap-2",children:(0,n.jsx)(f.$,{variant:"ghost",size:"icon",onClick:()=>a.push(`/jobs/${s}`),children:(0,n.jsx)(d.A,{className:"h-4 w-4"})})}),(0,n.jsxs)(g.Zp,{children:[(0,n.jsx)(g.aR,{children:(0,n.jsxs)(g.ZB,{className:"text-base flex items-center gap-2",children:["Run Summary",function(e){switch(e){case"success":return(0,n.jsx)(j.E,{className:"bg-green-600 text-white",children:"Success"});case"failure":return(0,n.jsx)(j.E,{variant:"destructive",children:"Failed"});case"timeout":return(0,n.jsx)(j.E,{className:"bg-yellow-600 text-white",children:"Timeout"});case"running":return(0,n.jsx)(j.E,{className:"bg-blue-600 text-white",children:"Running"});default:return(0,n.jsx)(j.E,{variant:"secondary",children:e})}}(r.status)]})}),(0,n.jsxs)(g.Wu,{className:"space-y-2 text-sm",children:[(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Started:"})," ",new Date(r.startedAt).toLocaleString()]}),r.completedAt&&(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Completed:"})," ",new Date(r.completedAt).toLocaleString()]}),null!=r.durationMs&&(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Duration:"})," ",Math.round(r.durationMs/1e3),"s"]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Messages:"})," ",r.messageCount]})]}),r.error&&(0,n.jsx)("div",{className:"mt-2 p-2 rounded bg-destructive/10 text-destructive text-xs",children:r.error}),(0,n.jsx)(N,{prompt:r.prompt}),(0,n.jsxs)("div",{children:[(0,n.jsx)("span",{className:"text-muted-foreground",children:"Working Directory:"})," ",(0,n.jsx)("span",{className:"font-mono text-xs",children:r.cwd})]}),(0,n.jsxs)("div",{className:"pt-2 flex gap-2",children:[(0,n.jsxs)(f.$,{variant:"outline",size:"sm",onClick:()=>b(!0),children:[(0,n.jsx)(o.A,{className:"h-3 w-3 mr-1"}),"View Transcript"]}),(0,n.jsxs)(f.$,{variant:"outline",size:"sm",onClick:()=>a.push(`/sessions/${r.sessionId}?cwd=${encodeURIComponent(r.cwd)}`),children:[(0,n.jsx)(u.A,{className:"h-3 w-3 mr-1"}),"Continue Session"]})]})]})]}),(0,n.jsxs)(g.Zp,{children:[(0,n.jsx)(g.aR,{children:(0,n.jsxs)(g.ZB,{className:"text-base",children:["Tool Usage (",r.toolsUsed.length,")"]})}),(0,n.jsxs)(g.Wu,{children:[0===r.toolsUsed.length&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"No tool invocations recorded."}),(0,n.jsx)("div",{className:"space-y-1",children:r.toolsUsed.map((e,s)=>(0,n.jsx)(v,{tool:e},`${e.name}-${e.timestamp}-${s}`))})]})]}),p&&(0,n.jsx)(w,{jobId:s,runId:t,onClose:()=>b(!1)})]})}},94088:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});let n=(0,t(99537).A)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])}},e=>{e.O(0,[989,41487,3765,28441,93794,77358],()=>e(e.s=46172)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[17288],{35484:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(99537).A)("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])},36619:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(99537).A)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]])},61112:(e,t,s)=>{Promise.resolve().then(s.bind(s,92396))},84949:(e,t,s)=>{"use strict";function n(e,t,s){let n=[];for(let a of e.split(",")){let e=a.match(/^(.+)\/(\d+)$/),r=e?Number.parseInt(e[2],10):1,l=e?e[1]:a;if("*"===l)for(let e=t;e<=s;e+=r)n.push(e);else if(l.includes("-")){let[e,t]=l.split("-"),s=Number.parseInt(e,10),a=Number.parseInt(t,10);for(let e=s;e<=a;e+=r)n.push(e)}else n.push(Number.parseInt(l,10))}return n}function a(e){if("cron"===e.type)return`cron: ${e.expression}`;let t=e.time||"00:00";switch(e.frequency){case"hourly":return`Every hour at :${t.split(":")[1]||"00"}`;case"daily":return`Daily at ${t}`;case"weekly":return`Weekly on ${["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"][e.dayOfWeek??0]} at ${t}`;case"monthly":return`Monthly on day ${e.dayOfMonth??1} at ${t}`}}function r(e){return e.schedules?.length?e.schedules:[e.schedule]}function l(e){return e.map(a).join("; ")}function i(e,t){let s=null;for(let a of e){let e=function(e,t){let s=function(e){let t=e.trim().split(/\s+/);if(5!==t.length)throw Error(`Invalid cron expression: expected 5 fields, got ${t.length}`);return{minute:n(t[0],0,59),hour:n(t[1],0,23),dayOfMonth:n(t[2],1,31),month:n(t[3],1,12),dayOfWeek:n(t[4],0,6),domWild:"*"===t[2],dowWild:"*"===t[4]}}("cron"===e.type?e.expression:function(e){let[t,s]=(e.time||"00:00").split(":").map(Number);switch(e.frequency){case"hourly":return`${s} * * * *`;case"daily":return`${s} ${t} * * *`;case"weekly":return`${s} ${t} * * ${e.dayOfWeek??0}`;case"monthly":return`${s} ${t} ${e.dayOfMonth??1} * *`}}(e)),a=new Date(t.getTime());a.setSeconds(0,0),a.setMinutes(a.getMinutes()+1);for(let e=0;e<525960;e++){if(s.minute.includes(a.getMinutes())&&s.hour.includes(a.getHours())&&s.dayOfMonth.includes(a.getDate())&&s.month.includes(a.getMonth()+1)&&s.dayOfWeek.includes(a.getDay()))return a;a.setMinutes(a.getMinutes()+1)}return new Date(t.getTime()+864e5)}(a,t);(!s||e.getTime()<s.getTime())&&(s=new Date(e.getTime()))}return s??new Date(t.getTime()+864e5)}s.d(t,{Bg:()=>a,JH:()=>l,KU:()=>r,ay:()=>i})},92396:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>C});var n=s(95155),a=s(35484),r=s(64962),l=s(92571),i=s(36619),c=s(99314),o=s(65738),u=s(76721),d=s(14225),h=s(2125),m=s(77618),x=s(73321),f=s(12115),p=s(3765),g=s(45160),j=s(89239),N=s(81477),y=s(42763),b=s(67032),w=s(84949);function v(e){if(!e.lastRunAt)return null;let t=function(e){let t=Math.floor((Date.now()-e)/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let s=Math.floor(t/60);if(s<24)return`${s}h ago`;let n=Math.floor(s/24);return`${n}d ago`}(e.lastRunAt);return"failure"===e.lastRunStatus||"timeout"===e.lastRunStatus?(0,n.jsxs)("span",{className:"flex items-center gap-1 text-destructive",children:[(0,n.jsx)(a.A,{className:"h-3 w-3"}),"Failed ",t]}):"success"===e.lastRunStatus?(0,n.jsxs)("span",{className:"flex items-center gap-1 text-green-500",children:[(0,n.jsx)(r.A,{className:"h-3 w-3"}),"Succeeded ",t]}):"running"===e.lastRunStatus?(0,n.jsxs)("span",{className:"flex items-center gap-1",children:[(0,n.jsx)(l.A,{className:"h-3 w-3 animate-spin"}),"Running"]}):null}function k({job:e,triggeringJobs:t,onTrigger:s,onDuplicate:a,onDelete:r,onClick:u}){return(0,n.jsx)(N.Zp,{className:"cursor-pointer hover:bg-accent/50 transition-colors",onClick:()=>u(e.id),children:(0,n.jsx)(N.Wu,{className:"p-4",children:(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,n.jsx)("span",{className:"font-medium text-sm truncate",children:e.name}),e.enabled?"failure"===e.lastRunStatus||"timeout"===e.lastRunStatus?(0,n.jsx)(g.E,{variant:"destructive",children:"Failed"}):"running"===e.lastRunStatus?(0,n.jsx)(g.E,{variant:"default",children:"Running"}):(0,n.jsx)(g.E,{variant:"default",children:"Active"}):(0,n.jsx)(g.E,{variant:"secondary",children:"Disabled"})]}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:(0,w.JH)((0,w.KU)(e))}),(0,n.jsxs)("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Next: ",function(e){if(!e.enabled)return"Disabled";try{return(0,w.ay)((0,w.KU)(e),new Date).toLocaleString()}catch{return"Unknown"}}(e)]}),v(e)&&(0,n.jsx)("p",{className:"text-xs mt-0.5",children:v(e)})]}),(0,n.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,n.jsx)(j.$,{variant:"ghost",size:"icon",className:"h-8 w-8",title:"Run now",disabled:t.has(e.id),onClick:t=>s(t,e.id),children:t.has(e.id)?(0,n.jsx)(l.A,{className:"h-4 w-4 animate-spin"}):(0,n.jsx)(i.A,{className:"h-4 w-4"})}),(0,n.jsx)(j.$,{variant:"ghost",size:"icon",className:"h-8 w-8",title:"Duplicate",onClick:t=>a(t,e.id),children:(0,n.jsx)(c.A,{className:"h-4 w-4"})}),(0,n.jsx)(j.$,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive hover:text-destructive",title:"Delete",onClick:t=>r(t,e.id),children:(0,n.jsx)(o.A,{className:"h-4 w-4"})})]})]})})})}function $({group:e,triggeringJobs:t,onTrigger:s,onDuplicate:a,onDelete:r,onClickJob:l,onCreateJob:i,defaultExpanded:c}){let[o,m]=(0,f.useState)(c),x=e.jobs.filter(e=>"failure"===e.lastRunStatus||"timeout"===e.lastRunStatus).length;return(0,n.jsxs)("div",{className:"rounded-lg border bg-card",children:[(0,n.jsxs)("div",{role:"button",onClick:()=>m(!o),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)(u.A,{className:`h-4 w-4 shrink-0 text-muted-foreground transition-transform ${o?"rotate-90":""}`}),(0,n.jsx)(d.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:[x>0&&(0,n.jsxs)("span",{className:"text-xs bg-destructive text-destructive-foreground px-1.5 py-0.5 rounded",children:[x," failed"]}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:[e.jobs.length," job",1!==e.jobs.length?"s":""]}),(0,n.jsx)("button",{onClick:t=>{t.stopPropagation(),i(e.cwd)},className:"p-1 rounded hover:bg-accent",title:"New job in this folder",children:(0,n.jsx)(h.A,{className:"h-3.5 w-3.5 text-muted-foreground"})})]})]}),o&&(0,n.jsx)("div",{className:"px-3 pb-3 space-y-2",children:e.jobs.map(e=>(0,n.jsx)(k,{job:e,triggeringJobs:t,onTrigger:s,onDuplicate:a,onDelete:r,onClick:l},e.id))})]})}function C(){(0,p.si)("Scheduled Jobs",{hideActions:!0});let{jobs:e,loading:t,deleteJob:s,triggerJob:a,refresh:r}=(0,b.Os)(),l=(0,x.useRouter)(),[i,c]=(0,f.useState)(null),[o,u]=(0,f.useState)(new Set),d=(0,f.useMemo)(()=>(function(e){let t=new Map;for(let s of e){let e=s.cwd||"",n=t.get(e)||[];n.push(s),t.set(e,n)}let s=[];for(let[e,n]of t)s.push({cwd:e,dirName:function(e){if(!e)return"Scratchpad";let t=e.replace(/\/+$/,"").split("/");return t[t.length-1]||e}(e),jobs:n});return s.sort((e,t)=>e.cwd?t.cwd?e.dirName.localeCompare(t.dirName):1:-1),s})(e),[e]);async function g(){i&&(await s(i),c(null))}async function N(e,t){e.stopPropagation(),u(e=>new Set(e).add(t)),await a(t),u(e=>{let s=new Set(e);return s.delete(t),s}),r()}function w(e,t){e.stopPropagation(),l.push(`/jobs/new/edit?from=${t}`)}function v(e,t){e.stopPropagation(),c(t)}return(0,n.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 pb-24 space-y-4",children:[t&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading jobs..."}),!t&&0===e.length&&(0,n.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[(0,n.jsx)(m.A,{className:"h-12 w-12 text-muted-foreground/50 mb-4"}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"No scheduled jobs yet."}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"Create one to run Claude on a schedule."})]}),(0,n.jsx)("div",{className:"space-y-2",children:1===d.length?d[0].jobs.map(e=>(0,n.jsx)(k,{job:e,triggeringJobs:o,onTrigger:N,onDuplicate:w,onDelete:v,onClick:e=>l.push(`/jobs/${e}`)},e.id)):d.map(e=>(0,n.jsx)($,{group:e,triggeringJobs:o,onTrigger:N,onDuplicate:w,onDelete:v,onClickJob:e=>l.push(`/jobs/${e}`),onCreateJob:e=>l.push(`/jobs/new/edit?cwd=${encodeURIComponent(e)}`),defaultExpanded:d.length<=3},e.cwd))}),(0,n.jsx)("div",{className:"fixed bottom-6 right-6",children:(0,n.jsxs)(j.$,{size:"lg",className:"rounded-full shadow-lg",onClick:()=>l.push("/jobs/new/edit"),children:[(0,n.jsx)(h.A,{className:"h-5 w-5 mr-1"}),"New Job"]})}),(0,n.jsx)(y.lG,{open:!!i,onOpenChange:()=>c(null),children:(0,n.jsxs)(y.Cf,{children:[(0,n.jsx)(y.c7,{children:(0,n.jsx)(y.L3,{children:"Delete Job"})}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Delete this job and all its run history? This cannot be undone."}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(j.$,{variant:"outline",onClick:()=>c(null),children:"Cancel"}),(0,n.jsx)(j.$,{variant:"destructive",onClick:g,children:"Delete"})]})]})})]})}}},e=>{e.O(0,[989,41487,3765,28441,93794,77358],()=>e(e.s=61112)),_N_E=e.O()}]);
|
package/.next/static/chunks/app/(app)/{layout-81c1899969de11e6.js → layout-ce9e1be301c60fe5.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4944],{9276:(e,s,n)=>{"use strict";n.r(s),n.d(s,{default:()=>t});var r=n(95155),u=n(3765);function t({children:e}){return(0,r.jsx)(u.GV,{children:e})}},69154:(e,s,n)=>{Promise.resolve().then(n.bind(n,9276))}},e=>{e.O(0,[989,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4944],{9276:(e,s,n)=>{"use strict";n.r(s),n.d(s,{default:()=>t});var r=n(95155),u=n(3765);function t({children:e}){return(0,r.jsx)(u.GV,{children:e})}},69154:(e,s,n)=>{Promise.resolve().then(n.bind(n,9276))}},e=>{e.O(0,[989,41487,3765,28441,93794,77358],()=>e(e.s=69154)),_N_E=e.O()}]);
|
|
@@ -0,0 +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(3765),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,41487,3765,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],{36619:(e,s,t)=>{"use strict";t.d(s,{A:()=>n});let n=(0,t(99537).A)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]])},61239:(e,s,t)=>{Promise.resolve().then(t.bind(t,78357))},78357:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>j});var n=t(95155),a=t(2125),r=t(92571),c=t(36619),l=t(65738),o=t(73321),i=t(12115),d=t(3765),m=t(41158),u=t(45160),x=t(89239),h=t(81477),p=t(42763);function j(){(0,d.si)("MCP Servers",{hideActions:!0});let e="u">typeof localStorage&&localStorage.getItem("cockpit-agents-cwd")||void 0,{servers:s,loading:t,deleteServer:r}=function(e){let[s,t]=(0,i.useState)([]),[n,a]=(0,i.useState)(!0),r=(0,i.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,i.useEffect)(()=>{r()},[r]);let c=(0,i.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 r(),!0;return!1}catch{return!1}},[e,r]);return{servers:s,loading:n,refresh:r,deleteServer:c}}(e),c=(0,o.useRouter)(),[l,u]=(0,i.useState)(null),[j,g]=(0,i.useState)(!1),[v,N]=(0,i.useState)(!1),b=s.filter(e=>"user"===e.scope),w=s.filter(e=>"project"===e.scope);function C(e,s){g(!1),N(!1);let t=new URLSearchParams({scope:e});"project"===e&&s&&t.set("cwd",s),c.push(`/mcp-servers/new?${t}`)}function y(s,t){let n=new URLSearchParams({scope:t});"project"===t&&e&&n.set("cwd",e),c.push(`/mcp-servers/${encodeURIComponent(s)}?${n}`)}async function k(){l&&(await r(l.name,l.scope),u(null))}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)(x.$,{size:"sm",onClick:()=>g(!0),children:[(0,n.jsx)(a.A,{className:"h-4 w-4 mr-1"}),"New Server"]})]}),t&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"Loading servers..."}),!t&&0===s.length&&(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:"No MCP servers configured. Add one to get started."}),b.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:b.map(e=>(0,n.jsx)(f,{name:e.name,type:e.type,detail:e.command||e.url,scope:"user",onClick:()=>y(e.name,"user"),onDelete:()=>u({name:e.name,scope:"user"})},e.name))})]}),w.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:w.map(s=>(0,n.jsx)(f,{name:s.name,type:s.type,detail:s.command||s.url,scope:"project",cwd:e,onClick:()=>y(s.name,"project"),onDelete:()=>u({name:s.name,scope:"project"})},s.name))})]}),(0,n.jsx)(p.lG,{open:j,onOpenChange:e=>{g(e),e||N(!1)},children:(0,n.jsxs)(p.Cf,{children:[(0,n.jsx)(p.c7,{children:(0,n.jsx)(p.L3,{children:"New MCP Server"})}),v?(0,n.jsx)(m.K,{onSelect:e=>C("project",e),onCancel:()=>N(!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)(x.$,{variant:"outline",className:"flex-1",onClick:()=>C("user"),children:"Global"}),(0,n.jsx)(x.$,{variant:"outline",className:"flex-1",onClick:()=>N(!0),children:"Project"})]})]})]})}),(0,n.jsx)(p.lG,{open:!!l,onOpenChange:()=>u(null),children:(0,n.jsxs)(p.Cf,{children:[(0,n.jsx)(p.c7,{children:(0,n.jsx)(p.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:l?.name}),"? This cannot be undone."]}),(0,n.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,n.jsx)(x.$,{variant:"outline",onClick:()=>u(null),children:"Cancel"}),(0,n.jsx)(x.$,{variant:"destructive",onClick:k,children:"Delete"})]})]})})]})}function f({name:e,type:s,detail:t,scope:a,cwd:o,onClick:d,onDelete:m}){let[x,h]=(0,i.useState)(!1),[p,j]=(0,i.useState)(null);async function g(s){s.stopPropagation(),h(!0),j(null);try{let s=new URLSearchParams({scope:a});"project"===a&&o&&s.set("cwd",o);let t=await fetch(`/api/mcp-servers/${encodeURIComponent(e)}/test?${s}`,{method:"POST"}),n=await t.json();j(n)}catch{j({success:!1,logs:"Request failed"})}finally{h(!1)}}return(0,n.jsxs)("div",{className:"rounded px-2 py-2 hover:bg-muted transition-colors",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsxs)("button",{type:"button",className:"flex-1 text-left min-w-0",onClick:d,children:[(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("span",{className:"font-mono font-bold text-sm",children:e}),(0,n.jsx)(u.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.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,n.jsx)("button",{type:"button",className:"p-1 rounded text-muted-foreground hover:text-primary transition-colors",onClick:g,disabled:x,title:"Test connection",children:x?(0,n.jsx)(r.A,{className:"h-4 w-4 animate-spin"}):(0,n.jsx)(c.A,{className:"h-4 w-4"})}),(0,n.jsx)("button",{type:"button",className:"p-1 rounded hover:bg-destructive/10 text-muted-foreground hover:text-destructive transition-colors",onClick:e=>{e.stopPropagation(),m()},children:(0,n.jsx)(l.A,{className:"h-4 w-4"})})]})]}),p&&(0,n.jsxs)("div",{className:`mt-2 rounded border p-2 text-xs ${p.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 ${p.success?"bg-green-500":"bg-red-500"}`}),(0,n.jsx)("span",{className:"font-medium",children:p.success?"Connected":"Failed"})]}),(0,n.jsx)("pre",{className:"whitespace-pre-wrap text-muted-foreground font-mono leading-relaxed",children:p.logs})]})]})}}},e=>{e.O(0,[989,41487,3765,28441,93794,77358],()=>e(e.s=61239)),_N_E=e.O()}]);
|
|
@@ -0,0 +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()}]);
|
package/.next/static/chunks/app/(app)/reviews/[owner]/[repo]/[number]/page-9ab2955c455bb5fa.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[44468],{38630:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>G});var n=s(95155),r=s(12115),a=s(63690),l=s(20660),o=s(89811),i=s(797),c=s(44354),d=s(83212),h=s(94088),u=s(12363),x=s(64577),p=s(92571),m=s(1275),f=s(31966),g=s(15480),b=s(99537);let j=(0,b.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,b.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);let k=(0,b.A)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);var S=s(73321),C=s(3765),$=s(55181),A=s(57594),R=s(70518),E=s(89239),I=s(11701),P=s(22317),L=s(40980);function D(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 O({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,L.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 U=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 M({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 T="cockpit_review_sessions",z="cockpit_review_viewed:";function _(){try{let e=localStorage.getItem(T);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 q({file:e,pr:t,repo:s,settings:i,viewed:c,collapsed:f,onToggleViewed:g,onToggleCollapse:b,sectionRef:j}){var N,v;let w,y=(N=e.patch,/^deleted file mode/m.test(N)),k=(v=e.path,w=v.split(".").pop()?.toLowerCase()??"",U.has(w)),[S,C]=(0,r.useState)(!1),[$,R]=(0,r.useState)(!1),[E,I]=(0,r.useState)(!1),[P,O]=(0,r.useState)(null),M=(0,r.useRef)(null);(0,r.useEffect)(()=>{if(y&&!S||k&&!$)return;let e=M.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),O(r))}).catch(t=>{console.error(`[diff] fetch failed for ${e.path}:`,t),O(r)}),()=>{n=!0}},[E,t,s,e.patch,e.path]);let T={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=>{M.current=e,j(e)},className:(0,L.cn)("rounded border overflow-clip",c&&"opacity-60"),children:f?(0,n.jsxs)("button",{onClick:b,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)(x.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:[D(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:[D(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||b()},className:(0,L.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)(x.A,{className:"h-3 w-3",strokeWidth:3})}),(0,n.jsx)("button",{onClick:e=>{e.stopPropagation(),b()},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:P?(0,n.jsx)(l.Q,{fileDiff:P,options:T}):(0,n.jsx)(o.C,{patch:e.patch,options:T})})]}):(0,n.jsx)("div",{className:"flex items-center justify-center py-8",children:(0,n.jsx)(p.A,{className:"h-4 w-4 animate-spin text-muted-foreground"})})})}function W({owner:e,repo:t,number:s}){let a,l=`${e}/${t}`,o=`${l}#${s}`,{settings:i}=(0,P.t)(),{setSidebarSection:c,removeSidebarSection:d}=(0,C.E2)(),h=(0,S.useRouter)(),u=(0,I.G)(),[b,A]=(0,r.useState)(null),[U,J]=(0,r.useState)([]),[G,Q]=(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),[Y,Z]=(0,r.useState)(H.descriptionOpen),[ee,et]=(0,r.useState)(null),[es,en]=(0,r.useState)(()=>(function(e){try{let t=localStorage.getItem(z+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,ex]=(0,r.useState)(null),[ep,em]=(0,r.useState)(!0),[ef,eg]=(0,r.useState)([]),[eb,ej]=(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)(b?`#${s} ${b.title}`:`PR #${s}`),(0,r.useEffect)(()=>{F.set(o,{chatWidth:X,descriptionOpen:Y})},[o,X,Y]),(0,r.useEffect)(()=>{Q(!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(()=>Q(!1))},[l,s]),(0,r.useEffect)(()=>{eh(null),ex(null),em(!0)},[]),(0,r.useEffect)(()=>{if(!b)return;let e=b.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();ex(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),ex(s.cwd),n=s.sessionId,(e=_())[o]=n,localStorage.setItem(T,JSON.stringify(e)),(0,R.MJ)(s.sessionId)}}catch{}em(!1)}()},[b,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(z+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]),eP=(0,r.useCallback)(()=>{if(!ed||!b||ek||!eC.current)return;eS(!0);let e=`Repository: ${l}, PR #${s}: ${b.title}
|
|
2
|
+
Author: ${b.author.login}, Branch: ${b.headRefName} -> ${b.baseRefName}
|
|
3
|
+
Files changed: ${b.changedFiles} (+${b.additions} -${b.deletions})`;eC.current(`/review
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
${e}`)},[ed,b,l,s,ek]);if((0,r.useEffect)(()=>0===U.length?void d("pr-files"):(c({id:"pr-files",title:"PR Files",order:20,badge:String(U.length),content:(0,n.jsx)(n.Fragment,{children:U.map(e=>{let t;return(0,n.jsxs)("div",{className:(0,L.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,L.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)(x.A,{className:"h-3 w-3",strokeWidth:3})}),D(e.path,b?.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})}),b?.files&&((t=b.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")),[U,b,es,er,el,ei,c,d,eA,eR]),G)return(0,n.jsx)("div",{className:"flex items-center justify-center flex-1",children:(0,n.jsx)(p.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(!b)return null;let eL=u&&!!ed&&!ep,eD=ef.filter(e=>"SUCCESS"===e.conclusion||"NEUTRAL"===e.conclusion||"SKIPPED"===e.conclusion),eO=ef.filter(e=>"FAILURE"===e.conclusion||"CANCELLED"===e.conclusion||"TIMED_OUT"===e.conclusion||"ACTION_REQUIRED"===e.conclusion),eU=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:b.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:b.headRefName}),(0,n.jsx)("span",{className:"mx-1",children:"into"}),(0,n.jsx)("span",{children:b.baseRefName})]}),b.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"===b.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"===b.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:()=>ej(e=>!e),className:"flex items-center gap-1.5 text-xs text-muted-foreground hover:text-foreground transition-colors",children:[eD.length>0&&(0,n.jsxs)("span",{className:"flex items-center gap-0.5 text-green-500",children:[(0,n.jsx)(j,{className:"h-3 w-3"}),eD.length]}),eO.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"}),eO.length]}),eU.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"}),eU.length]})]}),eb&&(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)(j,{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:[U.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,L.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&&U.length>0&&ec(U[0].path)},className:(0,L.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:["+",b.additions]}),(0,n.jsxs)("span",{className:"text-red-500",children:["-",b.deletions]}),(0,n.jsxs)("span",{children:[b.changedFiles," files"]}),(0,n.jsx)("a",{href:b.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&&!ep&&(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:eP,disabled:ek,children:[(0,n.jsx)(k,{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:[b.body&&(0,n.jsx)(O,{body:b.body,open:Y,onToggle:()=>Z(e=>!e)}),b.labels.length>0&&(0,n.jsx)("div",{className:"flex gap-1 px-4 py-2 flex-wrap border-b",children:b.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)(p.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)(p.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)(p.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===U.length&&(0,n.jsx)("div",{className:"text-center py-12 text-sm text-muted-foreground",children:"No changes"}),el?U.map(e=>(0,n.jsx)(q,{file:e,pr:b,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=U.find(e=>e.path===ei))?(0,n.jsx)(q,{file:a,pr:b,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"}):U.length>0&&(0,n.jsx)("div",{className:"text-center py-12 text-sm text-muted-foreground",children:"Select a file from the sidebar"})]})]}),eL&&eu&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(M,{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}: ${b.title}
|
|
7
|
+
Repo: ${l}
|
|
8
|
+
Author: ${b.author.login}
|
|
9
|
+
Branch: ${b.headRefName} into ${b.baseRefName}
|
|
10
|
+
Files changed: ${b.changedFiles} (+${b.additions} -${b.deletions})${b.body?`
|
|
11
|
+
|
|
12
|
+
Description:
|
|
13
|
+
${b.body.slice(0,2e3)}`:""}`,onSendMessage:e=>{eC.current=e}})})]})]})]})}function G({params:e}){let{owner:t,repo:s,number:a}=(0,r.use)(e);return(0,n.jsx)(W,{owner:t,repo:s,number:parseInt(a,10)})}},56206:(e,t,s)=>{Promise.resolve().then(s.bind(s,38630))},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,41487,31010,3765,48273,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(3765),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
|
|
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(3765),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,41487,3765,28441,93794,77358],()=>e(e.s=37596)),_N_E=e.O()}]);
|
package/.next/static/chunks/app/(app)/reviews/{page-0e6e7395a4f62b50.js → page-47530d93bb9d4a76.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(3765),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,
|
|
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(3765),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,41487,3765,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)},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)()},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)},27417:(e,t,n)=>{"use strict";n.r(t),n.d(t,{TerminalPanel:()=>g,disposeTerminalInstance:()=>x});var r=n(95155),l=n(66763),a=n(9005),i=n(99537);let s=(0,i.A)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);var c=n(2125);let d=(0,i.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 o=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)"}},b=new Map;function x(e){let t=b.get(e);t&&(t.term.dispose(),t.wrapper.remove(),b.delete(e))}let p=[{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,o.useState)(e),[i,s]=(0,o.useState)(0),[c,d]=(0,o.useState)(!1),u=(0,o.useCallback)(async()=>{d(!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),s(e=>e+1)}finally{d(!1)}},[t]);return(0,r.jsx)(v,{terminalId:l,cwd:t,active:n,onReconnect:u,reconnecting:c},`${l}-${i}`)}function v({terminalId:e,cwd:t,active:i=!0,onReconnect:x,reconnecting:g}){let y=(0,o.useRef)(null),w=(0,o.useRef)(null),j=(0,o.useRef)(null),k=(0,o.useRef)(null),[N,T]=(0,o.useState)(null),[I,C]=(0,o.useState)(!1),S=(0,o.useRef)(!1),P=(0,o.useRef)(i);P.current=i;let E=(0,u.G)(),D=(0,o.useRef)(0),R=(0,o.useRef)(void 0),O=(0,o.useRef)(void 0),M=(0,o.useRef)(!1),[A,L]=(0,o.useState)(!1),$=(0,o.useRef)(0),[_,z]=(0,o.useState)(!1),{settings:F,updateSetting:V}=(0,f.t)();(0,o.useEffect)(()=>{let e=window.visualViewport;if(e){let t=()=>{L(e.height<.75*window.innerHeight),P.current&&j.current&&j.current.fit()};return e.addEventListener("resize",t),()=>e.removeEventListener("resize",t)}$.current=Math.max($.current,window.innerHeight);let t=()=>{$.current=Math.max($.current,window.innerHeight),L(window.innerHeight<.75*$.current),P.current&&j.current&&j.current.fit()};return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]),(0,o.useEffect)(()=>{i&&j.current&&j.current.fit()},[i]),(0,o.useEffect)(()=>{let e=w.current;if(!e)return;let t=m[F.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)},[F.terminalTheme]),(0,o.useEffect)(()=>{let e=w.current;e&&(e.options.fontSize=F.terminalFontSize,j.current?.fit())},[F.terminalFontSize]),(0,o.useEffect)(()=>{let e=w.current;e&&(e.options.scrollback=F.terminalScrollback)},[F.terminalScrollback]),(0,o.useEffect)(()=>{let t=!1,r=null,l=null,a=[];function i(e){let t=k.current;t?.readyState===WebSocket.OPEN&&t.send(e)}async function s(){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=M.current?"0":"1",i="https:"===window.location.protocol?"wss:":"ws:",c=`${i}//${window.location.host}/ws/terminal?token=${l}&terminalId=${e}&replay=${a}`,d=new WebSocket(c);k.current=d,d.onopen=()=>{D.current=0,T(null),M.current=!0,r&&r.cols>1&&r.rows>1&&d.send(`\x01R${r.cols};${r.rows}`)},d.onmessage=e=>{r?.write(e.data)},d.onclose=n=>{if(k.current=null,t)return;if(1008===n.code){b.delete(e),T("Terminal disconnected");return}let r=Math.min(1e3*2**D.current,1e4);D.current++,R.current=setTimeout(()=>{t||s()},r)},d.onerror=()=>{}}catch{if(t)return;let e=Math.min(1e3*2**D.current,1e4);D.current++,R.current=setTimeout(()=>{t||s()},e)}}function c(){"visible"!==document.visibilityState||t||k.current&&k.current.readyState===WebSocket.OPEN||(clearTimeout(R.current),D.current=0,s())}return async function(){let c=y.current;if(!c||t)return;let d=b.get(e);if(d){r=d.term,l=d.fit,w.current=r,j.current=l,M.current=!0,c.appendChild(d.wrapper);let e=m[F.terminalTheme]??m.dark;r.options.theme={background:e.bg,foreground:e.fg,cursor:e.cursor,selectionBackground:e.selection},r.options.fontSize=F.terminalFontSize,r.options.scrollback=F.terminalScrollback,l.fit()}else{let[{Terminal:a},{FitAddon:i}]=await Promise.all([n.e(23888).then(n.bind(n,8422)),n.e(63606).then(n.bind(n,63606))]);if(t)return;let s=m[F.terminalTheme]??m.dark;w.current=r=new a({cursorBlink:!0,fontSize:F.terminalFontSize,scrollback:F.terminalScrollback,fontFamily:"'Menlo', 'Consolas', 'DejaVu Sans Mono', 'Courier New', 'Symbols Nerd Font Mono', monospace",theme:{background:s.bg,foreground:s.fg,cursor:s.cursor,selectionBackground:s.selection}}),j.current=l=new i,r.loadAddon(l);let d=document.createElement("div");d.style.width="100%",d.style.height="100%",c.appendChild(d),r.open(d),l.fit(),b.set(e,{term:r,fit:l,wrapper:d})}a.push(r.onData(e=>{if(S.current&&1===e.length){let t=e.toUpperCase().charCodeAt(0);if(t>=64&&t<96){i(String.fromCharCode(t-64)),S.current=!1,C(!1);return}}i(e)})),a.push(r.onResize(({cols:e,rows:t})=>{e<2||t<2||P.current&&(clearTimeout(O.current),O.current=setTimeout(()=>{if(!P.current)return;let n=k.current;n?.readyState===WebSocket.OPEN&&n.send(`\x01R${e};${t}`)},150))}));let o=0,u=0;c.addEventListener("touchstart",e=>{o=e.touches[0].clientY,u=0},{passive:!0}),c.addEventListener("touchmove",e=>{let t=o-e.touches[0].clientY;o=e.touches[0].clientY;let n=Math.trunc((u+=t)/8);0!==n&&(u-=8*n,r?.scrollLines(n))},{passive:!0}),s()}(),document.addEventListener("visibilitychange",c),()=>{for(let e of(t=!0,a))e.dispose();clearTimeout(R.current),clearTimeout(O.current),document.removeEventListener("visibilitychange",c),k.current&&(k.current.onclose=null,k.current.close(),k.current=null),w.current=null,j.current=null}},[e]);let B=(0,o.useCallback)(e=>{let t=k.current;t?.readyState===WebSocket.OPEN&&t.send(e)},[]),U=(0,o.useCallback)(e=>{if("modifier"in e&&e.modifier){let e=!S.current;S.current=e,C(e);return}"data"in e&&B(e.data)},[B]);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:x,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 W=m[F.terminalTheme]??m.dark;return(0,r.jsxs)("div",{className:"flex flex-col flex-1 min-h-0",style:{backgroundColor:W.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:()=>z(!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"})})]}),!E&&A&&(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:W.bg},children:[(0,r.jsx)("div",{role:"button",tabIndex:-1,onPointerDown:e=>{e.preventDefault(),z(!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"}),p.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(),U(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&&I?"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&&z(!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:()=>z(!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:()=>V("terminalFontSize",Math.max(1,F.terminalFontSize-1)),className:"rounded p-1.5 border border-input hover:bg-muted transition-colors",children:(0,r.jsx)(s,{className:"h-3.5 w-3.5"})}),(0,r.jsx)("span",{className:"text-sm font-mono w-8 text-center",children:F.terminalFontSize}),(0,r.jsx)("button",{onClick:()=>V("terminalFontSize",Math.min(32,F.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:()=>V("terminalScrollback",e),className:(0,h.cn)("rounded-md border px-3 py-1.5 text-xs transition-colors",F.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)(d,{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:()=>V("terminalTheme",e),className:(0,h.cn)("flex items-center gap-2 rounded-md border px-3 py-2 text-xs transition-colors",F.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)},57735:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>ee});var r=n(95155),l=n(73321),a=n(12115),i=n(3765),s=n(70518),c=n(75707),d=n.n(c),o=n(27417),u=n(53972);let f=(0,a.createContext)(null),h={type:"chat",id:"chat"},m={type:"changes",id:"changes"};function b(e){return"terminal::"+e}let x=new Map,p={tabs:[h],activeTabId:"chat",splitTabId:null,rightPaneTabIds:[]};function g({sessionId:e,children:t}){let[n,l]=(0,a.useState)(()=>x.get(e)||p),i=(0,a.useRef)(x.has(e)?e:null),s=(0,a.useRef)(void 0);(0,a.useEffect)(()=>{if(i.current===e)return;if(x.has(e)){l(x.get(e)),i.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:b(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),x.set(e,a)}i.current=e}}).catch(()=>{i.current=e}),()=>{t=!0}},[e]),(0,a.useEffect)(()=>{if(i.current===e)return x.set(e,n),clearTimeout(s.current),s.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(s.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}})},[]),d=(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}})},[]),v=(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=b(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,o.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 i=t.rightPaneTabIds.filter(t=>t!==e),s=t.splitTabId===e?i[0]||null:t.splitTabId;return 0===i.length&&(s=null),{tabs:l,activeTabId:a,splitTabId:s,rightPaneTabIds:i}})},[]),j=(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),i=Math.max(1,Math.min(l.length,t>r?t-1:t));return l.splice(i,0,a),{...n,tabs:l}})},[]),T=(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:d,openChanges:v,openTerminal:y,closeTab:w,setActiveTab:j,setSplitTab:k,moveTab:N,moveTabToPane:T},children:t})}function v(){return(0,a.useContext)(f)}var y=n(11701),w=n(40980),j=n(6935),k=n(55181),N=n(63690),T=n(20660),I=n(44354),C=n(83212),S=n(19257),P=n(797),E=n(92571),D=n(64577),R=n(1275),O=n(57594),M=n(22317),A=n(89323),L=n(30090);function $(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 _({cwd:e,filePath:t}){let{settings:n}=(0,M.t)(),i=(0,l.useRouter)(),{subscribe:s}=(0,A.h)(),[c,d]=(0,a.useState)(!0),[o,u]=(0,a.useState)(null),[f,h]=(0,a.useState)(null),[m,b]=(0,a.useState)("modified"),{checkedFiles:x,toggleFile:p}=(0,L.e)(e),g=x.has(t),v=(0,a.useRef)(void 0),y=(0,a.useCallback)(()=>{d(!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&&b(e.status);try{let t=(0,N.J2)(e.diff);if(t.length>0&&t[0].files.length>0){let n=t[0].files[0];null!=e.oldContent&&null!=e.newContent&&$(n,e.oldContent,e.newContent),h(n)}}catch{}}).catch(()=>u(null)).finally(()=>d(!1))},[e,t]);(0,a.useEffect)(()=>{y()},[y]);let j=(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&&b(e.status);try{let t=(0,N.J2)(e.diff);if(t.length>0&&t[0].files.length>0){let n=t[0].files[0];null!=e.oldContent&&null!=e.newContent&&$(n,e.oldContent,e.newContent),h(n)}}catch{}}).catch(()=>{})},[e,t]);(0,a.useEffect)(()=>s(e=>{"session:fs_changed"===e.type&&(clearTimeout(v.current),v.current=setTimeout(j,300))}),[s,j]);let k=(0,a.useCallback)(()=>{p(t)},[p,t]),z=(0,a.useCallback)(()=>{let n=t.startsWith("/")?t:`${e}/${t}`;i.push(`/files?cwd=${encodeURIComponent(e)}&file=${encodeURIComponent(n)}`)},[e,t,i]);return c?(0,r.jsx)("div",{className:"flex items-center justify-center flex-1",children:(0,r.jsx)(E.A,{className:"h-5 w-5 animate-spin text-muted-foreground"})}):o?(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)(I.A,{className:"h-3.5 w-3.5 text-green-500 shrink-0"});case"deleted":return(0,r.jsx)(C.A,{className:"h-3.5 w-3.5 text-red-500 shrink-0"});case"renamed":return(0,r.jsx)(S.A,{className:"h-3.5 w-3.5 text-blue-500 shrink-0"});default:return(0,r.jsx)(P.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:k,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)(D.A,{className:"h-3 w-3",strokeWidth:3})}),(0,r.jsx)("button",{onClick:z,className:"flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors",title:"Open in editor",children:(0,r.jsx)(R.A,{className:"h-3 w-3"})})]}),(0,r.jsx)(O.sU,{fallback:(0,r.jsx)("pre",{className:"p-4 text-xs text-muted-foreground whitespace-pre-wrap",children:o}),children:f?(0,r.jsx)(T.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:O.j8}}):(0,r.jsx)("pre",{className:"p-4 text-xs text-muted-foreground whitespace-pre-wrap",children:o})})]})})})}):(0,r.jsx)("div",{className:"flex items-center justify-center flex-1 text-sm text-muted-foreground",children:"No diff available"})}var z=n(26126),F=n(43493),V=n(25494),B=n(36483),U=n(99537);let W=(0,U.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 G=n(15480),H=n(16449),J=n(9005);let X=(0,U.A)("columns-2",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M12 3v18",key:"108xh3"}]]);function q(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 i=l.length;return i===a||i===a+1?null:i}function K({splitRatio:e}){let t=v(),n=(0,y.G)(),l=(0,a.useRef)(null),[i,s]=(0,a.useState)(null),[c,d]=(0,a.useState)(null),[o,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:b,splitTabId:x,rightPaneTabIds:p,setActiveTab:g,closeTab:j,setSplitTab:k,moveTab:N,moveTabToPane:T}=t,I=n&&null!==x,C=t.tabs.filter(e=>"chat"!==e.type),S=C.map(e=>e.id),P=()=>{l.current=null,s(null),d(null),u(!1)},E=()=>{l.current=null,s(null),d(null),u(!1)},D=(e,t)=>(0,r.jsx)("div",{className:(0,w.cn)("self-stretch shrink-0 rounded-full transition-all",i===e&&c===(t??null)?"w-0.5 bg-primary mx-0.5":o?"w-1":"w-0")},`ind-${t||"main"}-${e}`),R=(e,t,n,a)=>{let i;return(0,r.jsxs)("button",{"data-tab-id":"chat"!==e.type?e.id:void 0,draggable:a,onDragStart:a?(i=e.id,e=>{l.current=i,u(!0),e.dataTransfer.effectAllowed="move",e.dataTransfer.setData("text/plain",i)}):void 0,onDragEnd:a?P: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)(V.A,{className:"h-3 w-3 md:h-3.5 md:w-3.5 shrink-0"});case"file":return(0,r.jsx)(B.A,{className:"h-3 w-3 md:h-3.5 md:w-3.5 shrink-0"});case"diff":return(0,r.jsx)(W,{className:"h-3 w-3 md:h-3.5 md:w-3.5 shrink-0"});case"changes":return(0,r.jsx)(G.A,{className:"h-3 w-3 md:h-3.5 md:w-3.5 shrink-0"});case"terminal":return(0,r.jsx)(H.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(),j(e.id)},onKeyDown:t=>{("Enter"===t.key||" "===t.key)&&(t.stopPropagation(),j(e.id))},className:"ml-0.5 rounded p-0.5 hover:bg-muted cursor-default",children:(0,r.jsx)(J.A,{className:"h-2.5 w-2.5 md:h-3 md:w-3"})})]})},O=n&&C.length>0?(0,r.jsx)("button",{onClick:()=>{if(x)k(null);else{let e=t.tabs.find(e=>e.id===b&&"chat"!==e.type)||t.tabs.find(e=>"chat"!==e.type);e&&(k(e.id),"chat"!==b&&g("chat"))}},title:x?"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",x&&"text-primary"),children:(0,r.jsx)(X,{className:"h-3.5 w-3.5 md:h-4 md:w-4"})}):null;if(I){let n=e??.5,a=t.tabs.filter(e=>!p.includes(e.id)),o=a.filter(e=>"chat"!==e.type),u=o.map(e=>e.id),f=t.tabs.filter(e=>p.includes(e.id)),v=f.map(e=>e.id),y=e=>{e.preventDefault();let n=l.current;if(!n)return void E();let r=p.includes(n);"left"===c&&r?T(n,"left"):"right"!==c||r?null!==i&&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?o:f,i,t.tabs)):T(n,"right"),E()};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){s(0),d("left");return}s(q(h.current,e.clientX,l.current,u)??0),d("left")}},onDrop:y,children:[R(a[0],b===a[0].id,()=>g(a[0].id),!1),o.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center",children:[D(t,"left"),R(e,e.id===b,()=>g(e.id),!0)]},e.id)),D(o.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){s(0),d("right");return}s(q(m.current,e.clientX,l.current,v)??0),d("right")}},onDrop:y,children:[f.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center",children:[D(t,"right"),R(e,e.id===x,()=>k(e.id),!0)]},e.id)),D(f.length,"right"),O]})]})}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&&(s(q(f.current,e.clientX,l.current,S)),d(null)))},onDrop:e=>{e.preventDefault(),l.current&&null!==i&&N(l.current,i+1),E()},children:[R(t.tabs[0],"chat"===b,()=>g("chat"),!1),C.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center",children:[D(t),R(e,e.id===b,()=>g(e.id),!0)]},e.id)),D(C.length),O]})}let Y=d()(()=>Promise.resolve().then(n.bind(n,27417)).then(e=>e.TerminalPanel),{loadableGenerated:{webpack:()=>[27417]},ssr:!1});function Q(e){return(0,r.jsx)(g,{sessionId:e.sessionId,children:(0,r.jsx)(Z,{...e})})}function Z({sessionId:e,cwd:t,initialName:n,historyView:l}){let s=v(),{setTabActions:c}=(0,i.E2)(),d=(0,y.G)(),o=(0,a.useRef)(null),[u,f]=(0,a.useState)(.5);(0,a.useEffect)(()=>(c({openFile:s.openFile,openDiff:s.openDiff,openChanges:s.openChanges,openTerminal:s.openTerminal}),()=>c(null)),[s.openFile,s.openDiff,s.openChanges,s.openTerminal,c]);let{activeTabId:h,splitTabId:m,rightPaneTabIds:b,tabs:x}=s,p=d&&null!==m,g=(0,a.useCallback)(e=>{let t=o.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"!==s.activeTabId&&(e.preventDefault(),s.closeTab(s.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();s.openTerminal(t)}}catch{}}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[s,t]);let N=x.filter(e=>"file"===e.type),T=x.filter(e=>"diff"===e.type),I=x.filter(e=>"terminal"===e.type),C=x.some(e=>"changes"===e.type),S=(0,a.useCallback)(e=>{e.preventDefault(),e.dataTransfer.dropEffect="move"},[]),P=(0,a.useCallback)(e=>{e.preventDefault();let t=e.dataTransfer.getData("text/plain");t&&"chat"!==t&&b.includes(t)&&s.moveTabToPane(t,"left")},[s,b]),E=(0,a.useCallback)(e=>{e.preventDefault();let t=e.dataTransfer.getData("text/plain");t&&"chat"!==t&&(b.includes(t)?s.setSplitTab(t):s.moveTabToPane(t,"right"))},[s,b]);if(p){let a=N.filter(e=>!b.includes(e.id)),i=T.filter(e=>!b.includes(e.id)),s=I.filter(e=>!b.includes(e.id)),c=C&&!b.includes("changes"),d=N.filter(e=>b.includes(e.id)),f=T.filter(e=>b.includes(e.id)),x=I.filter(e=>b.includes(e.id)),v=C&&b.includes("changes");return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(K,{splitRatio:p?u:void 0}),(0,r.jsxs)("div",{ref:o,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:P,children:[(0,r.jsx)(k.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)(z.L,{cwd:t,initialFile:e.filePath,manageSidebar:!1})},e.id)),i.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)(_,{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)(j.V,{cwd:t,sessionId:e,embeddedChat:!1,manageSidebar:!1})}),s.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)(Y,{terminalId:e.terminalId,cwd:t,active:h===e.id})},e.id))]}),(0,r.jsx)(F.X,{onResize:g}),(0,r.jsxs)("div",{className:"flex flex-col min-w-0 min-h-0",style:{width:`${100*u}%`},onDragOver:S,onDrop:E,children:[d.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)(z.L,{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)(_,{cwd:t,filePath:e.filePath})},e.id)),v&&(0,r.jsx)("div",{className:(0,w.cn)("flex flex-col flex-1 min-h-0","changes"!==m&&"hidden"),children:(0,r.jsx)(j.V,{cwd:t,sessionId:e,embeddedChat:!1,manageSidebar:!1})}),x.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)(Y,{terminalId:e.terminalId,cwd:t,active:m===e.id})},e.id))]})]})]})}return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(K,{splitRatio:p?u:void 0}),(0,r.jsx)(k.I,{sessionId:e,cwd:t,initialName:n,historyView:l,className:(0,w.cn)("chat"!==h&&"hidden")}),N.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)(z.L,{cwd:t,initialFile:e.filePath,manageSidebar:!1})},e.id)),T.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)(_,{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)(j.V,{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)(Y,{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")||"",d=n.get("name")||void 0,o="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,i.mq)(c||void 0),(0,i.tB)(t),(0,a.useEffect)(()=>{(0,s.MN)(t),(0,s.HC)(t)},[t]),(0,r.jsx)(Q,{sessionId:t,cwd:c||"",initialName:d,historyView:o})}},64054:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={bindSnapshot:function(){return c},createAsyncLocalStorage:function(){return s},createSnapshot:function(){return d}};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 i="u">typeof globalThis&&globalThis.AsyncLocalStorage;function s(){return i?new i:new a}function c(e){return i?i.bind(e):a.bind(e)}function d(){return i?i.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 i(e){return{default:e&&"default"in e?e.default:e}}n(21957);let s={loader:()=>Promise.resolve(i(()=>null)),loading:null,ssr:!0},c=function(e){let t={...s,...e},n=(0,l.lazy)(()=>t.loader().then(i)),c=t.loading;function d(e){let i=c?(0,r.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,s=!t.ssr||!!t.loading,d=s?l.Suspense:l.Fragment,o=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)(d,{...s?{fallback:i}:{},children:o})}return d.displayName="LoadableComponent",d}},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,57735))}},e=>{e.O(0,[989,41487,31010,3765,48273,6935,26126,28441,93794,77358],()=>e(e.s=89419)),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[17976],{14577:(e,s,l)=>{"use strict";l.d(s,{A:()=>a});let a=(0,l(99537).A)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]])},15968:(e,s,l)=>{"use strict";l.r(s),l.d(s,{default:()=>v});var a=l(95155),n=l(14577),t=l(31966),d=l(73321),i=l(12115),o=l(3765),r=l(89239),c=l(22317);let u=[{value:"split",label:"Side-by-side"},{value:"unified",label:"Inline"}],p=[{value:"light",label:"Light"},{value:"dark",label:"Dark"},{value:"system",label:"System"}];function x({enabled:e,onToggle:s}){return(0,a.jsx)("button",{onClick:s,className:"shrink-0",children:(0,a.jsx)("span",{className:`inline-flex h-7 w-12 items-center rounded-full transition-colors ${e?"bg-green-500":"bg-muted-foreground/30"}`,children:(0,a.jsx)("span",{className:`inline-block h-5 w-5 rounded-full bg-white shadow transition-transform ${e?"translate-x-6":"translate-x-1"}`})})})}function h({text:e}){let[s,l]=(0,i.useState)(!1),t=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(!s)return;let e=e=>{t.current&&!t.current.contains(e.target)&&l(!1)};return document.addEventListener("mousedown",e),document.addEventListener("touchstart",e),()=>{document.removeEventListener("mousedown",e),document.removeEventListener("touchstart",e)}},[s]),(0,a.jsxs)("div",{ref:t,className:"relative inline-flex",children:[(0,a.jsx)("button",{type:"button",onClick:()=>l(!s),className:"p-0.5 rounded hover:bg-accent",children:(0,a.jsx)(n.A,{className:"h-3.5 w-3.5 text-muted-foreground"})}),s&&(0,a.jsx)("div",{className:"absolute left-1/2 -translate-x-1/2 top-full mt-1.5 z-50 w-56 rounded-md border bg-popover px-3 py-2 text-xs text-popover-foreground shadow-md",children:e})]})}function m({label:e,hint:s,children:l}){return(0,a.jsxs)("div",{className:"flex items-start justify-between py-2.5 text-sm",children:[(0,a.jsxs)("span",{className:"py-1 flex items-center gap-1.5",children:[e,s&&(0,a.jsx)(h,{text:s})]}),l]})}function b({options:e,value:s,onChange:l}){return(0,a.jsx)("div",{className:"flex flex-wrap gap-1 justify-end",children:e.map(e=>(0,a.jsx)(r.$,{variant:s===e.value?"default":"outline",size:"sm",onClick:()=>l(e.value),children:e.label},e.value))})}function v(){(0,o.si)("Appearance",{hideActions:!0});let e=(0,d.useRouter)(),{settings:s,updateSetting:l}=(0,c.t)(),[n,h]=(0,i.useState)("system");(0,i.useEffect)(()=>{h(localStorage.getItem("cockpit-theme")||"system")},[]);let v=(0,i.useCallback)(e=>{h(e),localStorage.setItem("cockpit-theme",e),"dark"===("system"===e?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e)?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},[]);return(0,a.jsxs)("div",{className:"flex-1 min-h-0 overflow-y-auto p-4 sm:p-6",children:[(0,a.jsxs)(r.$,{variant:"ghost",size:"sm",className:"mb-4",onClick:()=>e.push("/settings"),children:[(0,a.jsx)(t.A,{className:"h-4 w-4 mr-1"}),"Settings"]}),(0,a.jsxs)("div",{className:"max-w-lg space-y-1",children:[(0,a.jsx)(m,{label:"Theme",children:(0,a.jsx)(b,{options:p,value:n,onChange:v})}),(0,a.jsx)(m,{label:"Diff style",children:(0,a.jsx)(b,{options:u,value:s.diffStyle,onChange:e=>l("diffStyle",e)})}),(0,a.jsx)(m,{label:"Thinking blocks",children:(0,a.jsx)(b,{options:[{value:"collapsed",label:"Collapsed"},{value:"expanded",label:"Expanded"}],value:s.thinkingExpanded?"expanded":"collapsed",onChange:e=>l("thinkingExpanded","expanded"===e)})}),(0,a.jsx)(m,{label:"Read results",children:(0,a.jsx)(b,{options:[{value:"collapsed",label:"Collapsed"},{value:"expanded",label:"Expanded"}],value:s.readExpanded?"expanded":"collapsed",onChange:e=>l("readExpanded","expanded"===e)})}),(0,a.jsx)(m,{label:"Edit results",children:(0,a.jsx)(b,{options:[{value:"collapsed",label:"Collapsed"},{value:"expanded",label:"Expanded"}],value:s.editExpanded?"expanded":"collapsed",onChange:e=>l("editExpanded","expanded"===e)})}),(0,a.jsx)(m,{label:"Tool calls",children:(0,a.jsx)(b,{options:[{value:"collapsed",label:"Collapsed"},{value:"expanded",label:"Expanded"}],value:s.toolCallsExpanded?"expanded":"collapsed",onChange:e=>l("toolCallsExpanded","expanded"===e)})}),(0,a.jsx)(m,{label:"Stitch messages across clears",hint:"Load messages from previous CLI sessions within the same Cockpit session, showing conversation history across /clear boundaries",children:(0,a.jsx)(x,{enabled:s.messageStitching,onToggle:()=>l("messageStitching",!s.messageStitching)})}),(0,a.jsx)(m,{label:"Dismiss keyboard on send",children:(0,a.jsx)(x,{enabled:s.dismissKeyboardOnSend,onToggle:()=>l("dismissKeyboardOnSend",!s.dismissKeyboardOnSend)})}),(0,a.jsx)(m,{label:"Reviews",hint:"Show the Reviews section in the sidebar for tracking PR reviews",children:(0,a.jsx)(x,{enabled:s.reviewsEnabled,onToggle:()=>l("reviewsEnabled",!s.reviewsEnabled)})})]})]})}},26670:(e,s,l)=>{Promise.resolve().then(l.bind(l,15968))}},e=>{e.O(0,[989,41487,3765,28441,93794,77358],()=>e(e.s=26670)),_N_E=e.O()}]);
|