commandmate 0.42.2 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/BUILD_ID +1 -1
- package/.next/app-build-manifest.json +176 -176
- package/.next/app-path-routes-manifest.json +34 -34
- package/.next/build-manifest.json +2 -2
- package/.next/prerender-manifest.json +15 -15
- package/.next/required-server-files.json +1 -1
- package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/update/route.js.nft.json +1 -1
- package/.next/server/app/api/agents/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/agents/versions/route.js.nft.json +1 -1
- package/.next/server/app/api/agents/versions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/release-notes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update/route.js +2 -2
- package/.next/server/app/api/app/update/route.js.nft.json +1 -1
- package/.next/server/app/api/app/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/app/update-check/route.js +1 -1
- package/.next/server/app/api/app/update-check/route.js.nft.json +1 -1
- package/.next/server/app/api/app/update-check/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/login/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/logout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/capabilities/route.js +1 -1
- package/.next/server/app/api/capabilities/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/route.js +1 -1
- package/.next/server/app/api/daily-summary/route.js.nft.json +1 -1
- package/.next/server/app/api/daily-summary/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/daily-summary/status/route.js +1 -1
- package/.next/server/app/api/daily-summary/status/route.js.nft.json +1 -1
- package/.next/server/app/api/daily-summary/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/health/route.js.nft.json +1 -1
- package/.next/server/app/api/external-apps/[id]/health/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/external-apps/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/external-apps/route.js.nft.json +1 -1
- package/.next/server/app/api/external-apps/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/browse/route.js.nft.json +1 -1
- package/.next/server/app/api/fs/browse/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/fs/recent-paths/route.js.nft.json +1 -1
- package/.next/server/app/api/fs/recent-paths/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/agent-event/route.js +103 -1
- package/.next/server/app/api/hooks/agent-event/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/agent-event/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/claude-done/route.js +2 -2
- package/.next/server/app/api/hooks/claude-done/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/claude-done/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route.js +1 -1
- package/.next/server/app/api/hooks/permission-request/route.js.nft.json +1 -1
- package/.next/server/app/api/hooks/permission-request/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/metrics/vibe/route.js.nft.json +1 -1
- package/.next/server/app/api/metrics/vibe/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/ollama/models/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/escalation/route.js +1 -1
- package/.next/server/app/api/push/escalation/route.js.nft.json +1 -1
- package/.next/server/app/api/push/escalation/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/subscriptions/route.js.nft.json +1 -1
- package/.next/server/app/api/push/subscriptions/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/push/vapid/route.js +1 -1
- package/.next/server/app/api/push/vapid/route.js.nft.json +1 -1
- package/.next/server/app/api/push/vapid/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/relays/[relayId]/cancel/route.js +1 -1
- package/.next/server/app/api/relays/[relayId]/cancel/route.js.nft.json +1 -1
- package/.next/server/app/api/relays/[relayId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/relays/route.js +1 -1
- package/.next/server/app/api/relays/route.js.nft.json +1 -1
- package/.next/server/app/api/relays/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/remote/pair/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route.js +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/clone/[jobId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/clone/route.js +1 -1
- package/.next/server/app/api/repositories/clone/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/clone/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/excluded/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/excluded/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/restore/route.js +1 -1
- package/.next/server/app/api/repositories/restore/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/restore/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/route.js +1 -1
- package/.next/server/app/api/repositories/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/scan/route.js +1 -1
- package/.next/server/app/api/repositories/scan/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/scan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/sync/route.js +1 -1
- package/.next/server/app/api/repositories/sync/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/sync/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/repositories/validate-path/route.js.nft.json +1 -1
- package/.next/server/app/api/repositories/validate-path/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-agents/route.js +1 -1
- package/.next/server/app/api/settings/default-agents/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/settings/default-surface-mode/route.js.nft.json +1 -1
- package/.next/server/app/api/settings/default-surface-mode/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/sidebar/group-order/route.js.nft.json +1 -1
- package/.next/server/app/api/sidebar/group-order/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/[id]/route.js +1 -1
- package/.next/server/app/api/skills/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/installations/route.js +1 -1
- package/.next/server/app/api/skills/installations/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/installations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/operations/route.js +2 -2
- package/.next/server/app/api/skills/operations/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/operations/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/reindex/route.js +1 -1
- package/.next/server/app/api/skills/reindex/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/reindex/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/skills/route.js +1 -1
- package/.next/server/app/api/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/slash-commands/route.js +1 -1
- package/.next/server/app/api/slash-commands/route.js.nft.json +1 -1
- package/.next/server/app/api/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/cancel/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/tasks/[taskId]/route.js.nft.json +1 -1
- package/.next/server/app/api/tasks/[taskId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/templates/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/templates/route.js.nft.json +1 -1
- package/.next/server/app/api/templates/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/[runId]/route.js.nft.json +1 -1
- package/.next/server/app/api/verification/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/verification/runs/route.js.nft.json +1 -1
- package/.next/server/app/api/verification/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/auto-yes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/capture/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/clear-composer/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-reference/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-reference/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-tool/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/cli-tool/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js +3 -1
- package/.next/server/app/api/worktrees/[id]/cmate/schedules/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/cmate/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/current-output/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/direct-input/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/direct-input/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/direct-input/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/env/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/env/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/[logId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/route.js +3 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/execution-logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/files/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/files/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/create/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/create/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/delete/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branch/delete/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branches/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/branches/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/checkout/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/checkout/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/commit/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/commit/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/diff/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/fetch/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/fetch/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/log/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/log/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/pull/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/pull/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/push/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/reset/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/reset/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/revert/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/revert/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/show/[commitHash]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stage/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/staged/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/staged/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/[index]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/apply/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/apply/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/pop/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/pop/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/push/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/push/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/stash/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/status/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/status/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/unstage/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/unstage/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/git/working-diff/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/git/working-diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/notes/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/notes/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/instances/opencode/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/interrupt/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/kill-session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/[filename]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/[filename]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/logs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/marp-render/route.js +7 -7
- package/.next/server/app/api/worktrees/[id]/marp-render/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/marp-render/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/[memoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/memos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/messages/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/messages/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/diff/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/diff/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/session/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/session/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/session/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/share/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/share/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/opencode/share/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/prompt-response/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/resolve-target/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/resolve-target/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/respond/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/route.js +1 -103
- package/.next/server/app/api/worktrees/[id]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js +3 -1
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/[scheduleId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route.js +3 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/active/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/route.js +3 -1
- package/.next/server/app/api/worktrees/[id]/schedules/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/schedules/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/search/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/search/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/search/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route.js +1 -103
- package/.next/server/app/api/worktrees/[id]/send/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/send/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js +103 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/git-workflow/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/install/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/uninstall-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/[skillId]/update-plan/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/skills/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/slash-commands/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/special-keys/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tasks/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/tasks/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route.js +103 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/terminal/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/history/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/history/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/timers/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/[todoId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/todos/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/tree/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/upload/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/upload/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/config/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/config/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/cancel/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/[runId]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/verify/runs/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/[id]/viewed/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/[id]/viewed/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/apply-default-agents/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/apply-default-agents/route_client-reference-manifest.js +1 -1
- package/.next/server/app/api/worktrees/route.js +1 -1
- package/.next/server/app/api/worktrees/route.js.nft.json +1 -1
- package/.next/server/app/api/worktrees/route_client-reference-manifest.js +1 -1
- package/.next/server/app/login/page_client-reference-manifest.js +1 -1
- package/.next/server/app/manifest.webmanifest/route_client-reference-manifest.js +1 -1
- package/.next/server/app/more/page_client-reference-manifest.js +1 -1
- package/.next/server/app/offline/page_client-reference-manifest.js +1 -1
- package/.next/server/app/page_client-reference-manifest.js +1 -1
- package/.next/server/app/proxy/[...path]/route.js.nft.json +1 -1
- package/.next/server/app/proxy/[...path]/route_client-reference-manifest.js +1 -1
- package/.next/server/app/repositories/page_client-reference-manifest.js +1 -1
- package/.next/server/app/review/page_client-reference-manifest.js +1 -1
- package/.next/server/app/sessions/page.js +1 -1
- package/.next/server/app/sessions/page.js.nft.json +1 -1
- package/.next/server/app/sessions/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/[skillId]/page.js +1 -1
- package/.next/server/app/skills/[skillId]/page.js.nft.json +1 -1
- package/.next/server/app/skills/[skillId]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/installed/page_client-reference-manifest.js +1 -1
- package/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/files/[...path]/page.js +1 -1
- package/.next/server/app/worktrees/[id]/files/[...path]/page.js.nft.json +1 -1
- package/.next/server/app/worktrees/[id]/files/[...path]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/page.js +9 -9
- package/.next/server/app/worktrees/[id]/page.js.nft.json +1 -1
- package/.next/server/app/worktrees/[id]/page_client-reference-manifest.js +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page.js +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page.js.nft.json +1 -1
- package/.next/server/app/worktrees/[id]/terminal/page_client-reference-manifest.js +1 -1
- package/.next/server/app-paths-manifest.json +34 -34
- package/.next/server/chunks/1068.js +1 -1
- package/.next/server/chunks/1210.js +1 -1
- package/.next/server/chunks/1501.js +3 -3
- package/.next/server/chunks/2119.js +1 -1
- package/.next/server/chunks/22.js +1 -1
- package/.next/server/chunks/2283.js +15 -0
- package/.next/server/chunks/2328.js +1 -1
- package/.next/server/chunks/2404.js +4 -3
- package/.next/server/chunks/2445.js +1 -1
- package/.next/server/chunks/252.js +1 -1
- package/.next/server/chunks/2816.js +1 -1
- package/.next/server/chunks/3543.js +1 -1
- package/.next/server/chunks/3730.js +1 -1
- package/.next/server/chunks/3945.js +1 -1
- package/.next/server/chunks/4207.js +3 -3
- package/.next/server/chunks/4802.js +1 -1
- package/.next/server/chunks/488.js +1 -0
- package/.next/server/chunks/5064.js +1 -1
- package/.next/server/chunks/5326.js +1 -1
- package/.next/server/chunks/5456.js +1 -1
- package/.next/server/chunks/5571.js +1 -1
- package/.next/server/chunks/5775.js +1 -1
- package/.next/server/chunks/611.js +1 -1
- package/.next/server/chunks/6130.js +1 -1
- package/.next/server/chunks/6285.js +1 -1
- package/.next/server/chunks/6401.js +1 -1
- package/.next/server/chunks/6474.js +14 -0
- package/.next/server/chunks/650.js +1 -1
- package/.next/server/chunks/6661.js +1 -1
- package/.next/server/chunks/6781.js +1 -1
- package/.next/server/chunks/6793.js +1 -1
- package/.next/server/chunks/6927.js +1 -0
- package/.next/server/chunks/7491.js +3 -0
- package/.next/server/chunks/7506.js +1 -1
- package/.next/server/chunks/7685.js +1 -1
- package/.next/server/chunks/7905.js +1 -1
- package/.next/server/chunks/8543.js +1 -1
- package/.next/server/chunks/8581.js +2 -2
- package/.next/server/chunks/8728.js +2 -2
- package/.next/server/chunks/8782.js +1 -0
- package/.next/server/chunks/8791.js +1 -1
- package/.next/server/chunks/8800.js +4 -3
- package/.next/server/chunks/8918.js +108 -6
- package/.next/server/chunks/9130.js +3 -3
- package/.next/server/chunks/{8052.js → 9353.js} +4 -2
- package/.next/server/chunks/9390.js +3 -0
- package/.next/server/chunks/9627.js +3 -3
- package/.next/server/chunks/967.js +1 -0
- package/.next/server/chunks/9731.js +3 -3
- package/.next/server/chunks/9882.js +3 -3
- package/.next/server/middleware-manifest.json +5 -5
- package/.next/server/pages/500.html +1 -1
- package/.next/server/pages-manifest.json +1 -1
- package/.next/server/server-reference-manifest.json +1 -1
- package/.next/server/src/middleware.js +2 -2
- package/.next/server/src/middleware.js.map +1 -1
- package/.next/static/chunks/2053-85a974ddfe7498fe.js +1 -0
- package/.next/static/chunks/{2407-6b9e12c099fa598c.js → 2407-340774f1a24f2b45.js} +1 -1
- package/.next/static/chunks/5449-6cb80bab2bd06b79.js +1 -0
- package/.next/static/chunks/5521-c358c31f60e5e689.js +1 -0
- package/.next/static/chunks/591-0a45801e83f26f24.js +1 -0
- package/.next/static/chunks/8165-3853772f6ae1299b.js +1 -0
- package/.next/static/chunks/{8566-a6a7c70558927410.js → 8566-aeda747542072ace.js} +1 -1
- package/.next/static/chunks/8811-29eaa24237f48558.js +1 -0
- package/.next/static/chunks/{9619-22adf5367c4b7080.js → 9619-84aced0846cbe3ac.js} +1 -1
- package/.next/static/chunks/app/{layout-5b95e1236dcd9ef6.js → layout-0fc249fb7de75a27.js} +1 -1
- package/.next/static/chunks/app/review/page-ff9efae3f86eb840.js +1 -0
- package/.next/static/chunks/app/sessions/page-55297155e7bf01b9.js +1 -0
- package/.next/static/chunks/app/skills/[skillId]/page-9ee7a381636e60cb.js +1 -0
- package/.next/static/chunks/app/skills/page-182e16168b2fc098.js +1 -0
- package/.next/static/chunks/app/worktrees/[id]/page-d2103e0c25be83c8.js +1 -0
- package/.next/static/css/38070d879efa1371.css +1 -0
- package/.next/trace +13 -13
- package/README.md +58 -620
- package/dist/cli/commands/ask.d.ts.map +1 -1
- package/dist/cli/commands/ask.js +23 -149
- package/dist/cli/commands/capture.d.ts.map +1 -1
- package/dist/cli/commands/capture.js +11 -1
- package/dist/cli/commands/docs.d.ts.map +1 -1
- package/dist/cli/commands/docs.js +5 -0
- package/dist/cli/commands/remote.d.ts +24 -1
- package/dist/cli/commands/remote.d.ts.map +1 -1
- package/dist/cli/commands/remote.js +155 -6
- package/dist/cli/commands/reply.d.ts +40 -0
- package/dist/cli/commands/reply.d.ts.map +1 -0
- package/dist/cli/commands/reply.js +133 -0
- package/dist/cli/commands/respond.d.ts.map +1 -1
- package/dist/cli/commands/respond.js +255 -112
- package/dist/cli/commands/stop.d.ts.map +1 -1
- package/dist/cli/commands/stop.js +53 -1
- package/dist/cli/commands/sync.js +3 -3
- package/dist/cli/commands/wait.d.ts +5 -0
- package/dist/cli/commands/wait.d.ts.map +1 -1
- package/dist/cli/commands/wait.js +10 -1
- package/dist/cli/docs/agent-operations.d.ts +2 -2
- package/dist/cli/docs/agent-operations.d.ts.map +1 -1
- package/dist/cli/docs/agent-operations.js +13 -0
- package/dist/cli/docs/setup-guide.d.ts +14 -0
- package/dist/cli/docs/setup-guide.d.ts.map +1 -0
- package/dist/cli/docs/setup-guide.js +366 -0
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +4 -0
- package/dist/cli/types/api-responses.d.ts +11 -0
- package/dist/cli/types/api-responses.d.ts.map +1 -1
- package/dist/cli/types/index.d.ts +2 -0
- package/dist/cli/types/index.d.ts.map +1 -1
- package/dist/cli/utils/daemon.d.ts +42 -2
- package/dist/cli/utils/daemon.d.ts.map +1 -1
- package/dist/cli/utils/daemon.js +222 -40
- package/dist/cli/utils/docs-reader.d.ts +6 -0
- package/dist/cli/utils/docs-reader.d.ts.map +1 -1
- package/dist/cli/utils/docs-reader.js +14 -13
- package/dist/cli/utils/npm-runner.d.ts +12 -0
- package/dist/cli/utils/npm-runner.d.ts.map +1 -1
- package/dist/cli/utils/npm-runner.js +36 -0
- package/dist/cli/utils/process-inspect.d.ts +55 -0
- package/dist/cli/utils/process-inspect.d.ts.map +1 -0
- package/dist/cli/utils/process-inspect.js +214 -0
- package/dist/cli/utils/remote-pairing.d.ts +68 -0
- package/dist/cli/utils/remote-pairing.d.ts.map +1 -0
- package/dist/cli/utils/remote-pairing.js +117 -0
- package/dist/cli/utils/reply-ledger.d.ts +95 -0
- package/dist/cli/utils/reply-ledger.d.ts.map +1 -0
- package/dist/cli/utils/reply-ledger.js +187 -0
- package/dist/cli/utils/server-identity.d.ts +50 -0
- package/dist/cli/utils/server-identity.d.ts.map +1 -0
- package/dist/cli/utils/server-identity.js +118 -0
- package/dist/cli/utils/server-ready.d.ts +13 -0
- package/dist/cli/utils/server-ready.d.ts.map +1 -1
- package/dist/cli/utils/server-ready.js +16 -0
- package/dist/lib/cli-tools/copilot-executable.d.ts +9 -0
- package/dist/lib/cli-tools/copilot-executable.d.ts.map +1 -1
- package/dist/lib/cli-tools/copilot-executable.js +21 -5
- package/dist/lib/cli-tools/opencode-executable.d.ts +103 -0
- package/dist/lib/cli-tools/opencode-executable.d.ts.map +1 -0
- package/dist/lib/cli-tools/opencode-executable.js +179 -0
- package/dist/lib/cli-tools/types.d.ts +1 -1
- package/dist/lib/cli-tools/types.d.ts.map +1 -1
- package/dist/lib/cli-tools/types.js +5 -1
- package/dist/lib/detection/tools/verified-against.d.ts +15 -0
- package/dist/lib/detection/tools/verified-against.d.ts.map +1 -1
- package/dist/lib/detection/tools/verified-against.js +17 -1
- package/dist/lib/detection/version-probes.d.ts.map +1 -1
- package/dist/lib/detection/version-probes.js +14 -1
- package/dist/lib/security/pairing-code.d.ts +2 -1
- package/dist/lib/security/pairing-code.d.ts.map +1 -1
- package/dist/lib/session/tmux-session-surface.d.ts.map +1 -1
- package/dist/lib/session/tmux-session-surface.js +1 -1
- package/dist/server/locales/en/worktree.json +72 -20
- package/dist/server/locales/ja/worktree.json +72 -20
- package/dist/server/server.js +23 -0
- package/dist/server/src/config/cli-tool-timing-config.js +19 -1
- package/dist/server/src/config/detection-evidence-config.js +3 -0
- package/dist/server/src/config/image-extensions.js +1 -0
- package/dist/server/src/config/schedule-config.js +55 -1
- package/dist/server/src/lib/auto-yes-poller.js +69 -4
- package/dist/server/src/lib/cli-tools/agent-mode-spec.js +54 -2
- package/dist/server/src/lib/cli-tools/base.js +6 -2
- package/dist/server/src/lib/cli-tools/command-code-plan-review.js +175 -0
- package/dist/server/src/lib/cli-tools/command-code.js +81 -2
- package/dist/server/src/lib/cli-tools/composer-spec.js +10 -0
- package/dist/server/src/lib/cli-tools/copilot-executable.js +21 -5
- package/dist/server/src/lib/cli-tools/graceful-exit.js +15 -1
- package/dist/server/src/lib/cli-tools/index.js +3 -1
- package/dist/server/src/lib/cli-tools/install-hints.js +9 -3
- package/dist/server/src/lib/cli-tools/liveness-spec.js +19 -0
- package/dist/server/src/lib/cli-tools/manager.js +2 -0
- package/dist/server/src/lib/cli-tools/opencode-executable.js +179 -0
- package/dist/server/src/lib/cli-tools/opencode-v2.js +369 -0
- package/dist/server/src/lib/cli-tools/opencode.js +29 -5
- package/dist/server/src/lib/cli-tools/types.js +5 -1
- package/dist/server/src/lib/cmate-cli-tool-parser.js +65 -7
- package/dist/server/src/lib/cmate-parser.js +12 -0
- package/dist/server/src/lib/cmate-validator.js +13 -1
- package/dist/server/src/lib/detection/cli-patterns.js +172 -3
- package/dist/server/src/lib/detection/model-info-extractor.js +79 -7
- package/dist/server/src/lib/detection/status-detector.js +10 -1
- package/dist/server/src/lib/detection/tools/codex/cli-patterns.js +2 -1
- package/dist/server/src/lib/detection/tools/codex/detect.js +26 -0
- package/dist/server/src/lib/detection/tools/command-code/plan-review-state.js +75 -0
- package/dist/server/src/lib/detection/tools/opencode-v2/detect.js +253 -0
- package/dist/server/src/lib/detection/tools/opencode-v2/dialog-title.js +48 -0
- package/dist/server/src/lib/detection/tools/registry.js +2 -0
- package/dist/server/src/lib/detection/tools/run-detection.js +9 -0
- package/dist/server/src/lib/detection/tools/verified-against.js +17 -1
- package/dist/server/src/lib/detection/upstream-faults.js +8 -0
- package/dist/server/src/lib/detection/version-probes.js +14 -1
- package/dist/server/src/lib/hooks/agent-session-telemetry.js +36 -1
- package/dist/server/src/lib/hooks/sources/claude/transcript.js +33 -1
- package/dist/server/src/lib/hooks/sources/opencode/log-diagnosis.js +105 -0
- package/dist/server/src/lib/hooks/sources/opencode/source.js +7 -1
- package/dist/server/src/lib/hooks/sources/opencode-v2/client.js +422 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/decision-labels.js +24 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/history.js +421 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/ingest.js +271 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/mappers.js +165 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/payloads.js +351 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/ports.js +230 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/reattach.js +149 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/runtime.js +180 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/secrets.js +182 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/source.js +295 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/subscription.js +455 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/tool-id.js +18 -0
- package/dist/server/src/lib/hooks/sources/opencode-v2/usage.js +214 -0
- package/dist/server/src/lib/hooks/sources/registry.js +2 -0
- package/dist/server/src/lib/hooks/structured-decision-response.js +14 -5
- package/dist/server/src/lib/job-executor.js +2 -1
- package/dist/server/src/lib/polling/auto-yes-dialog-gate.js +15 -1
- package/dist/server/src/lib/polling/structured-history-gate.js +19 -5
- package/dist/server/src/lib/relay/relay-delivery.js +4 -1
- package/dist/server/src/lib/session/agent-event-state.js +24 -0
- package/dist/server/src/lib/session/claude-executor.js +186 -12
- package/dist/server/src/lib/session/claude-session.js +131 -15
- package/dist/server/src/lib/session/current-output-builder.js +27 -3
- package/dist/server/src/lib/session/send-user-message.js +4 -0
- package/dist/server/src/lib/session/session-start-error.js +20 -0
- package/dist/server/src/lib/session/structured-prompt.js +54 -0
- package/dist/server/src/lib/session/tmux-session-surface.js +1 -1
- package/dist/server/src/lib/skills/agent-state-paths.js +39 -0
- package/dist/server/src/lib/skills/compatibility-matrix.js +65 -0
- package/dist/server/src/lib/skills/receipt-owned-paths.js +118 -0
- package/dist/server/src/lib/tmux/tmux.js +73 -2
- package/dist/server/src/lib/verification/env-clean-gate.js +281 -10
- package/dist/server/src/lib/verification/gate-runner.js +29 -2
- package/dist/server/src/lib/verification/scope-gate.js +58 -4
- package/dist/server/src/types/cli-tool-contracts.js +10 -2
- package/dist/types/cli-tool-contracts.d.ts +16 -5
- package/dist/types/cli-tool-contracts.d.ts.map +1 -1
- package/dist/types/cli-tool-contracts.js +10 -2
- package/docs/en/architecture.md +722 -0
- package/docs/en/user-guide/agents-guide.md +306 -0
- package/docs/en/user-guide/cli-setup-guide.md +676 -0
- package/docs/en/user-guide/cmate-schedules-guide.md +388 -0
- package/docs/en/user-guide/commands-guide.md +467 -0
- package/docs/en/user-guide/quick-start.md +231 -0
- package/docs/en/user-guide/webapp-guide.md +1020 -0
- package/docs/en/user-guide/workflow-examples.md +463 -0
- package/package.json +19 -7
- package/release-notes/0.43.0.json +130 -0
- package/release-notes/0.44.0.json +82 -0
- package/scripts/hooks/cmate-agent-event.sh +14 -0
- package/scripts/opencode-v2/launch.sh +226 -0
- package/.next/server/chunks/1990.js +0 -103
- package/.next/server/chunks/3707.js +0 -15
- package/.next/server/chunks/4443.js +0 -3
- package/.next/server/chunks/5164.js +0 -1
- package/.next/server/chunks/5742.js +0 -1
- package/.next/server/chunks/7004.js +0 -1
- package/.next/server/chunks/8673.js +0 -14
- package/.next/static/chunks/2039-117a361f795ddc4b.js +0 -1
- package/.next/static/chunks/2053-611dd27d42721b79.js +0 -1
- package/.next/static/chunks/3778-56f41fc2cecb8c43.js +0 -1
- package/.next/static/chunks/5449-550bd273dccc3ae4.js +0 -1
- package/.next/static/chunks/7705-2a2936551b0cf9a3.js +0 -1
- package/.next/static/chunks/8165-934ee7ff3b4ddfd4.js +0 -1
- package/.next/static/chunks/app/review/page-30616daa1dc595c2.js +0 -1
- package/.next/static/chunks/app/sessions/page-1a8ba152bbcb9efb.js +0 -1
- package/.next/static/chunks/app/skills/[skillId]/page-ab7e432b69fccb3b.js +0 -1
- package/.next/static/chunks/app/skills/page-56b4fa11223e0cbd.js +0 -1
- package/.next/static/chunks/app/worktrees/[id]/page-59f5337e031518c6.js +0 -1
- package/.next/static/css/b3f433d52b8ed5c8.css +0 -1
- /package/.next/static/{MXZXkcFAnpELZnxxHB4iJ → wu7SUiHTirFcrpo5teyZ3}/_buildManifest.js +0 -0
- /package/.next/static/{MXZXkcFAnpELZnxxHB4iJ → wu7SUiHTirFcrpo5teyZ3}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8165],{17683:(e,t,a)=>{a.d(t,{$2:()=>o,B1:()=>h,CO:()=>f,If:()=>u,NP:()=>d,TR:()=>m,wp:()=>l});var n=a(75676);let s="commandmate.worktree.surfaceMode-",r="commandmate.settings.defaultSurfaceMode",l="/api/settings/default-surface-mode",i="view";function o(e,t){return"".concat(s).concat(e,"-split-").concat(t)}function d(e){return"".concat(s).concat(e,"-mobile")}function c(e){try{let t=window.localStorage.getItem(e);return(0,n.jg)(t)?t:null}catch(e){return null}}function u(e,t){try{window.localStorage.setItem(e,t)}catch(e){}}function f(){try{let{location:e,history:t}=window,a=new URLSearchParams(e.search);if(!a.has(i))return;a.delete(i);let n=a.toString(),s="".concat(e.pathname).concat(n?"?".concat(n):"").concat(e.hash);t.replaceState(t.state,"",s)}catch(e){}}function m(e,t){var a;let s=void 0===t?function(){try{var e=window.location.search;if(!e)return null;try{let t=new URLSearchParams(e).get(i);return(0,n.jg)(t)?t:null}catch(e){return null}}catch(e){return null}}():t;return s?(u(e,s),s):(j||(j=!0,y()),null!=(a=c(e))?a:g())}let x=n.wf,p=new Set;function g(){var e;return null!=(e=c(r))?e:x}function h(e){if(!(0,n.jg)(e))return!1;let t=g()!==e;if(x=e,u(r,e),t)for(let e of p)e();return t}let b=null,v=!1,j=!1;async function y(){return v?g():b||("function"!=typeof fetch?g():b=(async()=>{try{let e=await fetch(l);if(e.ok){let t=await e.json();h(null==t?void 0:t.defaultSurfaceMode),v=!0}}catch(e){}finally{b=null}return g()})())}},24373:(e,t,a)=>{a.d(t,{Lv:()=>r});var n=a(12115),s=a(66966);function r(){let e=(0,s.rC)(),t=null==e?void 0:e.worktrees;return(0,n.useMemo)(()=>{let e=t?t.filter(e=>!0===e.isWaitingForResponse):[];return{count:e.length,worktrees:e}},[t])}a(44308)},40823:(e,t,a)=>{a.d(t,{NS:()=>i,V0:()=>o});var n=a(95155),s=a(12115);let r=()=>{},l=(0,s.createContext)({isOpen:!1,open:r,close:r});function i(e){let{children:t}=e,[a,r]=(0,s.useState)(!1),i=(0,s.useCallback)(()=>r(!0),[]),o=(0,s.useCallback)(()=>r(!1),[]),d=(0,s.useMemo)(()=>({isOpen:a,open:i,close:o}),[a,i,o]);return(0,n.jsx)(l.Provider,{value:d,children:t})}function o(){return(0,s.useContext)(l)}},44308:(e,t,a)=>{a.d(t,{$h:()=>u,DR:()=>s,IH:()=>d,Iu:()=>n,Nb:()=>f,SD:()=>r,_d:()=>o,bm:()=>m,ks:()=>i,t7:()=>c,z7:()=>l});let n=7e3,s=["in_review","approval","stalled"],r="in_review",l="filter",i="/review?".concat(l,"=approval");function o(e){return e&&s.includes(e)?e:null}let d=["claude","codex","copilot","antigravity","opencode"],c=1e3,u=5,f=100,m=1e3},58165:(e,t,a)=>{a.d(t,{uN:()=>k,gZ:()=>ea,O3:()=>G});var n=a(95155),s=a(12115),r=a(18955),l=a(5917),i=a(20562),o=a(8803),d=a(65229),c=a(6191),u=a(48407),f=a(54014),m=a(55449);function x(e){return!!e&&"object"==typeof e&&Array.isArray(e.defaultSelectedAgents)&&e.defaultSelectedAgents.length>0&&Array.isArray(e.available)&&e.available.length>0&&"number"==typeof e.minAgents&&"number"==typeof e.maxAgents}function p(){var e;let t=(0,r.c)("common"),[a,p]=(0,s.useState)(null),[g,h]=(0,s.useState)([]),[b,v]=(0,s.useState)(!0),[j,y]=(0,s.useState)("idle"),[N,w]=(0,s.useState)(null),k=(0,s.useCallback)(async()=>{try{let e=await fetch("".concat(m.zk,"?include=installed"));if(!e.ok)throw Error(String(e.status));let t=await e.json();if(!x(t))throw Error("unexpected body");p(t),h(t.defaultSelectedAgents),(0,m.IK)(t.defaultSelectedAgents)}catch(e){w(t("settings.defaultAgents.loadError"))}finally{v(!1)}},[t]);(0,s.useEffect)(()=>{k()},[k]);let C=(0,s.useCallback)(e=>{h(e),y("idle"),w(null)},[]),S=(0,s.useCallback)((e,t)=>{let a=e+t;if(a<0||a>=g.length)return;let n=[...g];[n[e],n[a]]=[n[a],n[e]],C(n)},[g,C]),A=(0,s.useCallback)(async e=>{y("saving"),w(null);try{let n=await fetch(m.zk,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({agents:e})}),s=await n.json().catch(()=>null);if(!n.ok||!x(s)){var a;y("error"),w(null!=(a=null==s?void 0:s.error)?a:t("settings.defaultAgents.saveError"));return}p(e=>({...s,installed:null==e?void 0:e.installed})),h(s.defaultSelectedAgents),(0,m.IK)(s.defaultSelectedAgents),y("saved")}catch(e){y("error"),w(t("settings.defaultAgents.saveError"))}},[t]);if(b)return(0,n.jsx)(u.Zp,{children:(0,n.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,n.jsx)(u.y$,{size:"sm"}),t("loadingPage")]})});if(!a)return(0,n.jsx)(u.Zp,{children:(0,n.jsx)("div",{className:"text-sm text-danger-foreground","data-testid":"default-agents-load-error",children:null!=N?N:t("settings.defaultAgents.loadError")})});let E=null!=(e=a.installed)?e:[],P=a.available.filter(e=>!g.includes(e)),T=g.length<a.minAgents,M=g.length>a.maxAgents,I=!T&&!M&&"saving"!==j,O=e=>E.includes(e)?(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded bg-success-subtle px-1.5 py-0.5 text-xs text-success-foreground","data-testid":"default-agents-installed-".concat(e),children:[(0,n.jsx)(l.A,{className:"h-3 w-3","aria-hidden":"true"}),t("settings.defaultAgents.installed")]}):(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:t("settings.defaultAgents.notInstalled")});return(0,n.jsx)(u.Zp,{children:(0,n.jsxs)("div",{className:"space-y-4","data-testid":"default-agents-settings",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-sm font-medium text-foreground",children:t("settings.defaultAgents.title")}),(0,n.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:t("settings.defaultAgents.description")}),(0,n.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:t("settings.defaultAgents.appliesToNew")})]}),(0,n.jsx)("ul",{className:"space-y-2","data-testid":"default-agents-selected",children:g.map((e,s)=>(0,n.jsxs)("li",{className:"flex items-center gap-2 rounded-md border border-border bg-surface px-3 py-2","data-testid":"default-agents-row-".concat(e),children:[(0,n.jsx)("span",{className:"w-6 text-xs text-muted-foreground",children:s+1}),(0,n.jsx)("span",{className:"text-sm text-foreground",children:(0,f.oo)(e)}),0===s&&(0,n.jsx)("span",{className:"rounded bg-info-subtle px-1.5 py-0.5 text-xs text-info-foreground","data-testid":"default-agents-primary-badge",children:t("settings.defaultAgents.primary")}),(0,n.jsx)("span",{className:"ml-auto",children:O(e)}),(0,n.jsx)("button",{type:"button",className:"rounded p-1 text-muted-foreground hover:bg-muted disabled:opacity-40",onClick:()=>S(s,-1),disabled:0===s,"aria-label":t("settings.defaultAgents.moveUp"),"data-testid":"default-agents-up-".concat(e),children:(0,n.jsx)(i.A,{className:"h-4 w-4","aria-hidden":"true"})}),(0,n.jsx)("button",{type:"button",className:"rounded p-1 text-muted-foreground hover:bg-muted disabled:opacity-40",onClick:()=>S(s,1),disabled:s===g.length-1,"aria-label":t("settings.defaultAgents.moveDown"),"data-testid":"default-agents-down-".concat(e),children:(0,n.jsx)(o.A,{className:"h-4 w-4","aria-hidden":"true"})}),(0,n.jsx)("button",{type:"button",className:"rounded p-1 text-muted-foreground hover:bg-muted disabled:opacity-40",onClick:()=>C(g.filter(t=>t!==e)),disabled:g.length<=a.minAgents,"aria-label":t("settings.defaultAgents.remove"),"data-testid":"default-agents-remove-".concat(e),children:(0,n.jsx)(d.A,{className:"h-4 w-4","aria-hidden":"true"})})]},e))}),P.length>0&&(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"mb-2 text-xs text-muted-foreground",children:t("settings.defaultAgents.addLabel")}),(0,n.jsx)("ul",{className:"space-y-2","data-testid":"default-agents-available",children:P.map(e=>(0,n.jsxs)("li",{className:"flex items-center gap-2 rounded-md border border-border px-3 py-2",children:[(0,n.jsx)("span",{className:"text-sm text-foreground",children:(0,f.oo)(e)}),(0,n.jsx)("span",{className:"ml-auto",children:O(e)}),(0,n.jsx)("button",{type:"button",className:"rounded p-1 text-muted-foreground hover:bg-muted disabled:opacity-40",onClick:()=>C([...g,e]),disabled:g.length>=a.maxAgents,"aria-label":t("settings.defaultAgents.add"),"data-testid":"default-agents-add-".concat(e),children:(0,n.jsx)(c.A,{className:"h-4 w-4","aria-hidden":"true"})})]},e))})]}),(T||M)&&(0,n.jsx)("div",{className:"text-xs text-danger-foreground","data-testid":"default-agents-range-error",children:t("settings.defaultAgents.range",{min:a.minAgents,max:a.maxAgents})}),N&&(0,n.jsx)("div",{className:"text-xs text-danger-foreground","data-testid":"default-agents-error",children:N}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(u.$n,{size:"sm",onClick:()=>void A(g),disabled:!I,"data-testid":"default-agents-save",children:"saving"===j?t("settings.defaultAgents.saving"):t("settings.defaultAgents.save")}),(0,n.jsx)(u.$n,{size:"sm",variant:"ghost",onClick:()=>void A(null),disabled:!a.configured||"saving"===j,"data-testid":"default-agents-reset",children:t("settings.defaultAgents.reset")}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"default-agents-state",children:"saved"===j?t("settings.defaultAgents.saved"):a.configured?t("settings.defaultAgents.configured"):t("settings.defaultAgents.usingBuiltIn")})]}),a.configured&&(0,n.jsx)("div",{className:"text-xs text-muted-foreground","data-testid":"default-agents-builtin",children:t("settings.defaultAgents.builtIn",{agents:a.constantDefault.map(f.oo).join(", ")})})]})})}var g=a(17683),h=a(75676);function b(e){return!!e&&"object"==typeof e&&(0,h.jg)(e.defaultSurfaceMode)&&(0,h.jg)(e.constantDefault)&&Array.isArray(e.available)&&e.available.length>0&&e.available.every(h.jg)}function v(){var e;let t=(0,r.c)("common"),[a,l]=(0,s.useState)(null),[i,o]=(0,s.useState)(!0),[d,c]=(0,s.useState)("idle"),[f,m]=(0,s.useState)(null),x=(0,s.useCallback)(async()=>{try{let e=await fetch(g.wp);if(!e.ok)throw Error(String(e.status));let t=await e.json();if(!b(t))throw Error("unexpected body");l(t),(0,g.B1)(t.defaultSurfaceMode)}catch(e){m({kind:"load"})}finally{o(!1)}},[]);(0,s.useEffect)(()=>{x()},[x]);let p=(0,s.useCallback)(async e=>{c("saving"),m(null),l(t=>t?{...t,defaultSurfaceMode:e}:t);try{let t=await fetch(g.wp,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({mode:e})}),a=await t.json().catch(()=>null);if(!t.ok||!b(a)){c("error"),m({kind:"save",detail:null==a?void 0:a.error}),x();return}l(a),(0,g.B1)(a.defaultSurfaceMode),c("saved")}catch(e){c("error"),m({kind:"save"}),x()}},[x]),h=f?null!=(e=f.detail)?e:t("load"===f.kind?"settings.defaultSurfaceMode.loadError":"settings.defaultSurfaceMode.saveError"):null;return i?(0,n.jsx)(u.Zp,{children:(0,n.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,n.jsx)(u.y$,{size:"sm"}),t("loadingPage")]})}):a?(0,n.jsx)(u.Zp,{children:(0,n.jsxs)("div",{className:"space-y-4","data-testid":"default-surface-mode-settings",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-sm font-medium text-foreground",children:t("settings.defaultSurfaceMode.title")}),(0,n.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:t("settings.defaultSurfaceMode.description")}),(0,n.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:t("settings.defaultSurfaceMode.appliesToNew")})]}),(0,n.jsx)("div",{role:"radiogroup","aria-label":t("settings.defaultSurfaceMode.title"),className:"space-y-2","data-selected":a.defaultSurfaceMode,children:a.available.map(e=>(0,n.jsxs)("label",{className:"flex cursor-pointer items-start gap-2 rounded-md border border-border bg-surface px-3 py-2","data-testid":"default-surface-mode-option-".concat(e),children:[(0,n.jsx)("input",{type:"radio",name:"default-surface-mode",value:e,className:"mt-0.5",checked:a.defaultSurfaceMode===e,disabled:"saving"===d,onChange:()=>void p(e),"data-testid":"default-surface-mode-radio-".concat(e)}),(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{className:"block text-sm text-foreground",children:t("settings.defaultSurfaceMode.mode.".concat(e))}),(0,n.jsx)("span",{className:"block text-xs text-muted-foreground",children:t("settings.defaultSurfaceMode.hint.".concat(e))})]})]},e))}),h&&(0,n.jsx)("div",{className:"text-xs text-danger-foreground","data-testid":"default-surface-mode-error",children:h}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground","data-testid":"default-surface-mode-state",children:"saving"===d?t("settings.defaultSurfaceMode.saving"):"saved"===d?t("settings.defaultSurfaceMode.saved"):a.configured?t("settings.defaultSurfaceMode.configured"):t("settings.defaultSurfaceMode.usingBuiltIn")})]})}):(0,n.jsx)(u.Zp,{children:(0,n.jsx)("div",{className:"text-sm text-danger-foreground","data-testid":"default-surface-mode-load-error",children:null!=h?h:t("settings.defaultSurfaceMode.loadError")})})}var j=a(68695),y=a(52056),N=a(48314);function w(e){let t=e.trim();if(!t)return null;try{let e=JSON.parse(t);if(!e||"object"!=typeof e)return null;let a=e.type;if("plan"!==a&&"output"!==a&&"done"!==a)return null;return e}catch(e){return null}}function k(e){var t,a,l;let{worktreeId:i,instances:o,variant:d="card"}=e,c=(0,r.c)("common"),{versions:m,isLoading:x,loadError:p,run:g,isUpdating:h,update:b}=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],[t,a]=(0,s.useState)(null),[n,r]=(0,s.useState)(!1),[l,i]=(0,s.useState)(e),[o,d]=(0,s.useState)(null),[c,u]=(0,s.useState)(!1),f=(0,s.useRef)(!0);(0,s.useEffect)(()=>(f.current=!0,()=>{f.current=!1}),[]);let m=(0,s.useCallback)(async function(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(e){i(!0);try{let e=await fetch("/api/agents/versions".concat(t?"?refresh=1":""));if(!e.ok)throw Error(String(e.status));let n=await e.json();if(!(n&&"object"==typeof n&&Array.isArray(n.tools)&&Array.isArray(n.updatable)))throw Error("unexpected body");if(!f.current)return;a(n.tools),r(!1)}catch(e){if(!f.current)return;r(!0)}finally{f.current&&i(!1)}}},[e]);(0,s.useEffect)(()=>{m(!1)},[m]);let x=(0,s.useCallback)(async e=>{if(c)return;u(!0),d({tool:e,command:null,output:"",ok:null,previousVersion:null,installed:null,error:null});let t=e=>{f.current&&d(t=>t?{...t,ok:!1,error:e}:t)};try{var a,n;let s=await fetch("/api/agents/update",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:e})});if(!s.ok||!s.body){let e=await s.json().catch(()=>null);t(null!=(a=null==e?void 0:e.error)?a:"Request failed (".concat(s.status,")"));return}let r=s.body.getReader(),l=new TextDecoder,i="",o=e=>{f.current&&d(t=>{var a;return t?"plan"===e.type?{...t,command:e.command}:"output"===e.type?{...t,output:t.output+e.text}:{...t,ok:e.ok,previousVersion:e.previousVersion,installed:e.installed,error:null!=(a=e.error)?a:null}:t})};for(;;){let{done:e,value:t}=await r.read();if(e)break;let a=(i+=l.decode(t,{stream:!0})).split("\n");for(let e of(i=null!=(n=a.pop())?n:"",a)){let t=w(e);t&&o(t)}}let c=w(i);c&&o(c)}catch(e){t(e instanceof Error?e.message:String(e))}finally{f.current&&u(!1),await m(!0)}},[c,m]);return{versions:t,isLoading:l,loadError:n,run:o,isUpdating:c,reload:m,update:x}}(!0),[v,k]=(0,s.useState)(0),C=function(e,t,a){let[n,r]=(0,s.useState)({});return(0,s.useEffect)(()=>{if(!e||!t||0===t.length)return void r({});let a=!1;return(async()=>{try{let t=await fetch("/api/worktrees/".concat(e));if(!t.ok)return;let n=await t.json();if(a)return;let s=n.sessionStatusByInstance,l={};for(let[e,t]of Object.entries(null!=s?s:{}))(null==t?void 0:t.isRunning)&&(l[e]=!0);r(l)}catch(e){}})(),()=>{a=!0}},[e,t,a]),n}(i,o,v),[S,A]=(0,s.useState)({}),[E,P]=(0,s.useState)(null),T=(0,s.useRef)(null);(0,s.useEffect)(()=>{T.current&&(T.current.scrollTop=T.current.scrollHeight)},[null==g?void 0:g.output]);let M=(null==g?void 0:g.ok)===!0;(0,s.useEffect)(()=>{M&&k(e=>e+1)},[M]);let I=(0,s.useCallback)(e=>(null!=o?o:[]).filter(t=>t.cliTool===e&&C[t.id]),[o,C]),O=(0,s.useCallback)(async e=>{if(i){P(null);try{let t=new URLSearchParams({cliTool:e.cliTool,instance:e.id}),a=await fetch("/api/worktrees/".concat(i,"/kill-session?").concat(t.toString()),{method:"POST"});if(!a.ok&&404!==a.status)throw Error(String(a.status));A(t=>({...t,[e.id]:!0})),k(e=>e+1)}catch(e){P(c("agentUpdates.restartError"))}}},[i,c]),R=x&&!m?(0,n.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,n.jsx)(u.y$,{size:"sm"}),c("loadingPage")]}):p&&!m?(0,n.jsx)("div",{className:"text-sm text-danger-foreground","data-testid":"agent-updates-load-error",children:c("agentUpdates.loadError")}):(0,n.jsxs)("div",{className:"space-y-3","data-testid":"agent-updates",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("div",{className:"text-sm font-medium text-foreground",children:c("agentUpdates.title")}),(0,n.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:c("agentUpdates.description")})]}),(0,n.jsx)("ul",{className:"space-y-2","data-testid":"agent-updates-rows",children:(null!=m?m:[]).map(e=>{var t,a;let s=I(e.tool),r=e.updatable&&null!==e.installed;return(0,n.jsxs)("li",{className:"rounded-md border border-border bg-surface px-3 py-2","data-testid":"agent-updates-row-".concat(e.tool),children:[(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)("span",{className:"text-sm text-foreground",children:(a=e.tool,(0,f.oo)(a)||a)}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"agent-updates-installed-".concat(e.tool),children:e.installed?c("agentUpdates.installed",{version:e.installed}):c("agentUpdates.notInstalled")}),e.updateAvailable&&(0,n.jsx)("span",{className:"rounded bg-info-subtle px-1.5 py-0.5 text-xs text-info-foreground","data-testid":"agent-updates-available-".concat(e.tool),children:c("agentUpdates.available",{version:null!=(t=e.latestVersion)?t:""})}),e.dismissedInCodex&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground","data-testid":"agent-updates-dismissed-".concat(e.tool),children:c("agentUpdates.dismissed")}),r&&(0,n.jsxs)(u.$n,{size:"sm",className:"ml-auto",disabled:h,onClick:()=>void b(e.tool),"data-testid":"agent-updates-update-".concat(e.tool),children:[(0,n.jsx)(j.A,{className:"h-4 w-4","aria-hidden":"true"}),h&&(null==g?void 0:g.tool)===e.tool?c("agentUpdates.updating"):c("agentUpdates.update")]})]}),r&&s.length>0&&(0,n.jsxs)("div",{className:"mt-2 flex items-start gap-1 text-xs text-warning-foreground","data-testid":"agent-updates-restart-warning-".concat(e.tool),children:[(0,n.jsx)(y.A,{className:"mt-0.5 h-3 w-3 shrink-0","aria-hidden":"true"}),(0,n.jsx)("span",{children:c("agentUpdates.restartWarning",{sessions:s.map(e=>e.alias).join(", ")})})]}),r&&0===s.length&&void 0===i&&(0,n.jsx)("p",{className:"mt-2 text-xs text-muted-foreground","data-testid":"agent-updates-restart-notice-".concat(e.tool),children:c("agentUpdates.restartNotice")}),M&&(null==g?void 0:g.tool)===e.tool&&s.map(e=>(0,n.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,n.jsxs)(u.$n,{size:"sm",variant:"ghost",disabled:S[e.id],onClick:()=>void O(e),"data-testid":"agent-updates-restart-".concat(e.id),children:[(0,n.jsx)(N.A,{className:"h-4 w-4","aria-hidden":"true"}),c("agentUpdates.restart",{alias:e.alias})]}),S[e.id]&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:c("agentUpdates.restarted")})]},e.id))]},e.tool)})}),g&&(0,n.jsxs)("div",{className:"space-y-2","data-testid":"agent-updates-run",children:[g.command&&(0,n.jsx)("div",{className:"text-xs text-muted-foreground","data-testid":"agent-updates-command",children:c("agentUpdates.running",{command:g.command})}),g.output&&(0,n.jsx)("pre",{ref:T,"data-testid":"agent-updates-output",className:"max-h-48 overflow-auto whitespace-pre-wrap rounded-md bg-terminal-surface p-2 text-xs text-terminal-foreground",children:g.output}),!0===g.ok&&(0,n.jsx)("div",{className:"text-xs text-success-foreground","data-testid":"agent-updates-success",children:c("agentUpdates.succeeded",{from:null!=(t=g.previousVersion)?t:"?",to:null!=(a=g.installed)?a:"?"})}),!1===g.ok&&(0,n.jsx)("div",{className:"text-xs text-danger-foreground","data-testid":"agent-updates-failure",children:c("agentUpdates.failed",{error:null!=(l=g.error)?l:""})})]}),E&&(0,n.jsx)("div",{className:"text-xs text-danger-foreground","data-testid":"agent-updates-restart-error",children:E})]});return"plain"===d?R:(0,n.jsx)(u.Zp,{children:R})}var C=a(52619),S=a.n(C);function A(e){var t;let{appId:a,pollInterval:l=3e4,showResponseTime:i=!1,compact:o=!1}=e,d=(0,r.c)("externalApps"),[c,u]=(0,s.useState)(null),[f,m]=(0,s.useState)(!0),x=(0,s.useCallback)(async()=>{try{let e=await fetch("/api/external-apps/".concat(a,"/health"));if(e.ok){let t=await e.json();u(t)}else u({id:a,healthy:!1,lastChecked:Date.now(),error:"Failed to check health"})}catch(e){u({id:a,healthy:!1,lastChecked:Date.now(),error:"Network error"})}finally{m(!1)}},[a]);if((0,s.useEffect)(()=>{x();let e=setInterval(x,l);return()=>clearInterval(e)},[x,l]),f)return(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-full bg-muted-foreground animate-pulse"}),!o&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:d("status.checking")})]});let p=null!=(t=null==c?void 0:c.healthy)&&t,g=p?"bg-success":"bg-muted-foreground",h=d(p?"status.running":"status.stopped");return o?(0,n.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-full ".concat(g),title:h}):(0,n.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,n.jsx)("span",{className:"inline-block h-2.5 w-2.5 rounded-full ".concat(g)}),(0,n.jsx)("span",{className:"text-xs ".concat(p?"text-success-foreground":"text-muted-foreground"),children:h}),i&&(null==c?void 0:c.responseTime)!==void 0&&(0,n.jsxs)("span",{className:"text-xs text-muted-foreground",children:["(",c.responseTime,"ms)"]})]})}function E(e){var t;let{app:a,onEdit:l,onDelete:i}=e,o=(0,r.c)("externalApps"),d=(0,r.c)("common"),[c,f]=(0,s.useState)(!1),[m,x]=(0,s.useState)(!1),p=async()=>{x(!0);try{await i(a.id)}finally{x(!1),f(!1)}},g="/proxy/".concat(a.pathPrefix,"/");return(0,n.jsxs)(u.Zp,{padding:"md",className:"relative",children:[(0,n.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("h4",{className:"text-base font-semibold text-foreground truncate",children:a.displayName}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground mt-0.5 font-mono truncate",children:a.name})]}),(0,n.jsx)(u.Ex,{variant:{sveltekit:"warning",streamlit:"error",nextjs:"info",other:"gray"}[a.appType]||"gray",children:{sveltekit:"SvelteKit",streamlit:"Streamlit",nextjs:"Next.js",other:"Other"}[t=a.appType]||t})]}),(0,n.jsxs)("div",{className:"space-y-2 mb-4",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("span",{className:"text-sm text-muted-foreground",children:o("card.status")}),(0,n.jsx)(A,{appId:a.id,pollInterval:3e4})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("span",{className:"text-sm text-muted-foreground",children:o("card.port")}),(0,n.jsxs)("span",{className:"text-sm font-mono text-foreground",children:[":",a.targetPort]})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("span",{className:"text-sm text-muted-foreground",children:o("card.path")}),(0,n.jsxs)("span",{className:"text-sm font-mono text-foreground truncate max-w-[150px]",children:["/proxy/",a.pathPrefix,"/"]})]}),a.websocketEnabled&&(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("span",{className:"text-sm text-muted-foreground",children:o("card.websocket")}),(0,n.jsx)(u.Ex,{variant:"info",children:o("card.enabled")})]}),!a.enabled&&(0,n.jsx)("div",{className:"mt-2 py-1 px-2 bg-warning-subtle border border-warning-border rounded text-xs text-warning-foreground",children:o("card.disabledNotice")})]}),c?(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:o("card.deleteConfirm",{name:a.displayName})}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)(u.$n,{variant:"danger",size:"sm",onClick:p,disabled:m,loading:m,children:o("card.delete")}),(0,n.jsx)(u.$n,{variant:"ghost",size:"sm",onClick:()=>f(!1),disabled:m,children:d("cancel")})]})]}):(0,n.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,n.jsx)(u.$n,{variant:"primary",size:"sm",onClick:()=>window.open(g,"_blank"),disabled:!a.enabled,children:o("card.open")}),(0,n.jsx)(u.$n,{variant:"secondary",size:"sm",onClick:()=>l(a),children:o("card.settings")}),(0,n.jsx)(u.$n,{variant:"ghost",size:"sm",onClick:()=>f(!0),className:"text-danger-foreground hover:bg-danger-subtle",children:o("card.delete")})]})]})}var P=a(87531);let T={MIN:1024,MAX:65535},M=/^[a-zA-Z0-9-]+$/,I={sveltekit:"SvelteKit",streamlit:"Streamlit",nextjs:"Next.js",other:"Other"},O=["sveltekit","streamlit","nextjs","other"].map(e=>({value:e,label:I[e]}));function R(e){let{isOpen:t,onClose:a,editApp:l,onSave:i}=e,o=(0,r.c)("externalApps"),d=(0,r.c)("common"),c=!!l,[f,m]=(0,s.useState)(""),[x,p]=(0,s.useState)(""),[g,h]=(0,s.useState)(""),[b,v]=(0,s.useState)(""),[j,y]=(0,s.useState)(""),[N,w]=(0,s.useState)(!1),[k,C]=(0,s.useState)(""),[S,A]=(0,s.useState)(!0),[E,I]=(0,s.useState)({}),[R,U]=(0,s.useState)(!1),[L,z]=(0,s.useState)(null);(0,s.useEffect)(()=>{t&&(l?(m(l.displayName),p(l.name),h(l.pathPrefix),v(l.targetPort),y(l.appType),w(l.websocketEnabled),C(l.description||""),A(l.enabled)):(m(""),p(""),h(""),v(""),y(""),w(!1),C(""),A(!0)),I({}),z(null))},[t,l]);let $=async e=>{e.preventDefault(),z(null);let t=function(e,t){var a,n,s,r;let l={};return((null==(a=e.displayName)?void 0:a.trim())||(l.displayName="Display name is required"),!t&&((null==(n=e.name)?void 0:n.trim())?M.test(e.name)||(l.name="Only alphanumeric characters and hyphens are allowed"):l.name="Identifier name is required",(null==(s=e.pathPrefix)?void 0:s.trim())?M.test(e.pathPrefix)||(l.pathPrefix="Only alphanumeric characters and hyphens are allowed"):l.pathPrefix="Path prefix is required"),e.targetPort)?"number"!=typeof e.targetPort||Number.isInteger(r=e.targetPort)&&r>=T.MIN&&r<=T.MAX||(l.targetPort="Port must be between ".concat(T.MIN," and ").concat(T.MAX)):l.targetPort="Port number is required",t||e.appType||(l.appType="App type is required"),l}({displayName:f,name:x,pathPrefix:g,targetPort:b,appType:j},c);if(Object.keys(t).length>0)return void I(t);I({}),U(!0);try{if(c&&l){let e=await fetch("/api/external-apps/".concat(l.id),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({displayName:f,description:k||void 0,targetPort:b||void 0,websocketEnabled:N,enabled:S})});if(!e.ok){let t=await e.json();throw Error(t.error||o("form.updateFailed"))}}else{let e=await fetch("/api/external-apps",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({displayName:f,name:x,pathPrefix:g,targetPort:b,appType:j,websocketEnabled:N,description:k||void 0})});if(!e.ok){let t=await e.json();throw Error(t.error||o("form.createFailed"))}}i(),a()}catch(e){z(e instanceof Error?e.message:o("form.genericError"))}finally{U(!1)}};return(0,n.jsx)(u.Jh,{isOpen:t,onClose:a,title:c?o("form.editTitle"):o("form.addTitle"),size:"md",children:(0,n.jsxs)("form",{onSubmit:$,className:"space-y-4",children:[(0,n.jsx)("div",{className:"rounded-md bg-warning-subtle p-3 mb-4 border border-warning-border",children:(0,n.jsx)("p",{className:"text-sm text-warning-foreground",children:o("form.securityWarning")})}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{htmlFor:"displayName",className:"block text-sm font-medium text-foreground mb-1",children:[o("form.displayName")," ",(0,n.jsx)("span",{className:"text-danger",children:"*"})]}),(0,n.jsx)(u.pd,{id:"displayName",type:"text",value:f,onChange:e=>m(e.target.value),className:E.displayName?"border-danger":"",placeholder:o("form.displayNamePlaceholder"),disabled:R}),E.displayName&&(0,n.jsx)("p",{className:"mt-1 text-xs text-danger",children:E.displayName})]}),!c&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{htmlFor:"name",className:"block text-sm font-medium text-foreground mb-1",children:[o("form.identifierName")," ",(0,n.jsx)("span",{className:"text-danger",children:"*"})]}),(0,n.jsx)(u.pd,{id:"name",type:"text",value:x,onChange:e=>p(e.target.value),className:"font-mono ".concat(E.name?"border-danger":""),placeholder:o("form.identifierNamePlaceholder"),disabled:R}),(0,n.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:o("form.identifierNameHelp")}),E.name&&(0,n.jsx)("p",{className:"mt-1 text-xs text-danger",children:E.name})]}),!c&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{htmlFor:"pathPrefix",className:"block text-sm font-medium text-foreground mb-1",children:[o("form.pathPrefix")," ",(0,n.jsx)("span",{className:"text-danger",children:"*"})]}),(0,n.jsxs)("div",{className:"flex items-center",children:[(0,n.jsx)("span",{className:"text-sm text-muted-foreground mr-1",children:"/proxy/"}),(0,n.jsx)(u.pd,{id:"pathPrefix",type:"text",value:g,onChange:e=>h(e.target.value),className:"w-auto flex-1 font-mono ".concat(E.pathPrefix?"border-danger":""),placeholder:o("form.pathPrefixPlaceholder"),disabled:R}),(0,n.jsx)("span",{className:"text-sm text-muted-foreground ml-1",children:"/"})]}),(0,n.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:o("form.pathPrefixHelp")}),E.pathPrefix&&(0,n.jsx)("p",{className:"mt-1 text-xs text-danger",children:E.pathPrefix})]}),(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{htmlFor:"targetPort",className:"block text-sm font-medium text-foreground mb-1",children:[o("form.portNumber")," ",(0,n.jsx)("span",{className:"text-danger",children:"*"})]}),(0,n.jsx)(u.pd,{id:"targetPort",type:"number",value:b,onChange:e=>v(e.target.value?parseInt(e.target.value,10):""),className:"font-mono ".concat(E.targetPort?"border-danger":""),placeholder:o("form.portNumberPlaceholder"),min:T.MIN,max:T.MAX,disabled:R}),(0,n.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:o("form.portNumberHelp",{min:T.MIN,max:T.MAX})}),E.targetPort&&(0,n.jsx)("p",{className:"mt-1 text-xs text-danger",children:E.targetPort})]}),!c&&(0,n.jsxs)("div",{children:[(0,n.jsxs)("label",{htmlFor:"appType",className:"block text-sm font-medium text-foreground mb-1",children:[o("form.appType")," ",(0,n.jsx)("span",{className:"text-danger",children:"*"})]}),(0,n.jsxs)("select",{id:"appType",value:j,onChange:e=>y(e.target.value),className:(0,P.cn)((0,u.j1)(),E.appType&&"border-danger"),disabled:R,children:[(0,n.jsx)("option",{value:"",children:o("form.appTypePlaceholder")}),O.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))]}),E.appType&&(0,n.jsx)("p",{className:"mt-1 text-xs text-danger",children:E.appType})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"description",className:"block text-sm font-medium text-foreground mb-1",children:o("form.description")}),(0,n.jsx)(u.k_,{id:"description",value:k,onChange:e=>C(e.target.value),placeholder:o("form.descriptionPlaceholder"),rows:2,disabled:R})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(u.dO,{id:"websocketEnabled",checked:N,onCheckedChange:w,disabled:R}),(0,n.jsx)("label",{htmlFor:"websocketEnabled",className:"text-sm text-foreground",children:o("form.websocketLabel")})]}),c&&(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(u.dO,{id:"enabled",checked:S,onCheckedChange:A,disabled:R}),(0,n.jsx)("label",{htmlFor:"enabled",className:"text-sm text-foreground",children:o("form.enabledLabel")})]}),L&&(0,n.jsx)("div",{className:"p-3 bg-danger-subtle border border-danger-border rounded text-sm text-danger-foreground",children:L}),(0,n.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t border-border",children:[(0,n.jsx)(u.$n,{type:"button",variant:"ghost",onClick:a,disabled:R,children:d("cancel")}),(0,n.jsx)(u.$n,{type:"submit",variant:"primary",loading:R,children:c?o("form.save"):o("form.add")})]})]})})}function U(){let e=(0,r.c)("externalApps"),t=(0,r.c)("common"),[a,l]=(0,s.useState)([]),[i,o]=(0,s.useState)(!0),[d,c]=(0,s.useState)(null),[f,m]=(0,s.useState)(!1),[x,p]=(0,s.useState)(null),g=(0,s.useCallback)(async()=>{try{c(null);let e=await fetch("/api/external-apps");if(!e.ok)throw Error("Failed to fetch external apps");let t=await e.json();l(t.apps||[])}catch(e){c(e instanceof Error?e.message:"An error occurred")}finally{o(!1)}},[]);(0,s.useEffect)(()=>{g();let e=setInterval(g,6e4);return()=>clearInterval(e)},[g]);let h=(0,s.useCallback)(e=>{p(e),m(!0)},[]),b=(0,s.useCallback)(()=>{p(null),m(!0)},[]),v=(0,s.useCallback)(async e=>{try{let t=await fetch("/api/external-apps/".concat(e),{method:"DELETE"});if(!t.ok){let e=await t.json();throw Error(e.error||"Failed to delete app")}g()}catch(e){console.error("Failed to delete app:",e)}},[g]),j=(0,s.useCallback)(()=>{g()},[g]),y=(0,s.useCallback)(()=>{m(!1),p(null)},[]);return(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("div",{className:"flex items-center justify-end",children:(0,n.jsx)(u.$n,{variant:"primary",size:"sm",onClick:b,children:e("manager.addApp")})}),i?(0,n.jsx)(u.Zp,{padding:"lg",children:(0,n.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,n.jsx)(u.y$,{size:"xl",variant:"accent"}),(0,n.jsx)("span",{className:"ml-3 text-muted-foreground",children:e("manager.loading")})]})}):d?(0,n.jsx)(u.Zp,{padding:"lg",children:(0,n.jsxs)("div",{className:"text-center py-8",children:[(0,n.jsx)("p",{className:"text-danger-foreground mb-4",children:e("manager.loadError")}),(0,n.jsx)(u.$n,{variant:"secondary",size:"sm",onClick:g,children:t("retry")})]})}):0===a.length?(0,n.jsx)(u.Zp,{padding:"lg",children:(0,n.jsxs)("div",{className:"text-center py-8",children:[(0,n.jsx)("p",{className:"text-muted-foreground mb-4",children:e("manager.empty")}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:e("manager.emptyHelp")}),(0,n.jsx)(u.$n,{variant:"primary",size:"sm",onClick:b,children:e("manager.addFirst")})]})}):(0,n.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:a.map(e=>(0,n.jsx)(E,{app:e,onEdit:h,onDelete:v},e.id))}),(0,n.jsx)(R,{isOpen:f,onClose:y,editApp:x,onSave:j})]})}var L=a(85998),z=a(94442),$=a(81978);function F(){return"undefined"!=typeof navigator&&"serviceWorker"in navigator&&"PushManager"in window&&"Notification"in window}let D={enabled:!0,thresholdMinutes:10},Z=[5,10,30,60];function H(){let e=(0,r.c)("notifications"),{showToast:t}=(0,z.dj)(),[a,l]=(0,s.useState)(!0),[i,o]=(0,s.useState)(!1),[d,c]=(0,s.useState)(!0),[f,m]=(0,s.useState)(!1),[x,p]=(0,s.useState)(null),[g,h]=(0,s.useState)(null),[b,v]=(0,s.useState)(!1),[j,y]=(0,s.useState)(null),[N,w]=(0,s.useState)({prompt:!0,completion:!1}),[k,C]=(0,s.useState)(!1),[S,A]=(0,s.useState)(null),[E,P]=(0,s.useState)(null),T=null!==j&&!1!==E;(0,s.useEffect)(()=>{let e=!1;return(async()=>{let t=function(){var e,t;let a=F(),n="undefined"!=typeof navigator&&(!!/iPad|iPhone|iPod/.test(navigator.userAgent)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1)&&!(null!=(e=(t=window).matchMedia)&&e.call(t,"(display-mode: standalone)").matches||!0===navigator.standalone);return{supported:a&&!n,iosNeedsInstall:n}}();e||(c(F()),m(t.iosNeedsInstall),"undefined"!=typeof Notification&&"denied"===Notification.permission&&v(!0));try{let t=await fetch("/api/push/vapid"),a=await t.json();e||(p(a.configured),h(a.publicKey))}catch(t){e||p(!1)}if(F())try{let t=await navigator.serviceWorker.getRegistration(),n=t?await t.pushManager.getSubscription():null;if(n&&!e){y(n.endpoint);let t=await fetch("/api/push/subscriptions?endpoint=".concat(encodeURIComponent(n.endpoint))),s=await t.json();if(!e){var a;P(!0===s.subscribed),A(null!=(a=s.delivery)?a:null)}s.subscribed&&s.subscription&&!e&&(w(s.subscription.preferences),C(!0===s.subscription.defaultsNoticePending))}}catch(e){}e||l(!1)})(),()=>{e=!0}},[]);let M=(0,s.useCallback)(async()=>{if(g){o(!0);try{var a,n;let s=await Notification.requestPermission();if("granted"!==s){v("denied"===s),t(e("toast.error"),"error");return}if(!await navigator.serviceWorker.getRegistration())return void t(e("toast.error"),"error");let r=await navigator.serviceWorker.ready,l=await r.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:function(e){let t="=".repeat((4-e.length%4)%4),a=atob((e+t).replace(/-/g,"+").replace(/_/g,"/")),n=new Uint8Array(new ArrayBuffer(a.length));for(let e=0;e<a.length;e++)n[e]=a.charCodeAt(e);return n}(g)}),i=await fetch("/api/push/subscriptions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({subscription:l.toJSON(),deviceLabel:navigator.userAgent.slice(0,120)})});if(!i.ok)throw Error("subscribe request failed");let o=await i.json();y(l.endpoint),P(!0),A(null),(null==(a=o.subscription)?void 0:a.preferences)&&w(o.subscription.preferences),C((null==(n=o.subscription)?void 0:n.defaultsNoticePending)===!0),v(!1),t(e("toast.enabled"),"success")}catch(a){t(e("toast.error"),"error")}finally{o(!1)}}},[g,t,e]),I=(0,s.useCallback)(async()=>{o(!0);try{var a;let n=await navigator.serviceWorker.getRegistration(),s=n?await n.pushManager.getSubscription():null,r=null!=(a=null==s?void 0:s.endpoint)?a:j;s&&await s.unsubscribe(),r&&await fetch("/api/push/subscriptions",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:r})}),y(null),P(null),A(null),t(e("toast.disabled"),"info")}catch(a){t(e("toast.error"),"error")}finally{o(!1)}},[j,t,e]),O=(0,s.useCallback)(async(a,n)=>{if(!j)return;let s={...N,[a]:n};w(s);try{if(!(await fetch("/api/push/subscriptions",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:j,preferences:s})})).ok)throw Error("update failed");t(e("toast.updated"),"success")}catch(a){w(N),t(e("toast.error"),"error")}},[j,N,t,e]),R=(0,s.useCallback)(async a=>{if(!j)return;let n=a?{...N,completion:!1}:N;C(!1),a&&w(n),o(!0);try{if(!(await fetch("/api/push/subscriptions",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({endpoint:j,...a?{preferences:n}:{},acknowledgeDefaultsNotice:!0})})).ok)throw Error("acknowledge failed");t(e(a?"defaultsNotice.adopted":"defaultsNotice.kept"),"success")}catch(a){w(N),C(!0),t(e("toast.error"),"error")}finally{o(!1)}},[j,N,t,e]);return(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)(u.Zp,{children:(0,n.jsx)(q,{})}),(0,n.jsx)(u.Zp,{children:a?(0,n.jsx)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:(0,n.jsx)(u.y$,{size:"sm"})}):d?f?(0,n.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"notifications-ios-guidance",children:e("ios.guidance")}):!1===x?(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:e("notConfigured")}):(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:e("description")}),b&&(0,n.jsx)("p",{className:"text-sm text-danger-foreground","data-testid":"notifications-permission-denied",children:e("permission.denied")}),(()=>{if(null===S)return null;let t="removed"===S.state,a=S.statusCode,s=t?null===a?e("delivery.removedUnknownStatus"):e("delivery.removed",{status:String(a)}):null===a?e("delivery.failingUnknownStatus",{count:S.failureCount}):e("delivery.failing",{count:S.failureCount,status:String(a)});return(0,n.jsxs)("div",{className:t?"space-y-2 rounded-lg border border-danger-border bg-danger-subtle p-3":"space-y-2 rounded-lg border border-warning-border bg-warning-subtle p-3","data-testid":"notifications-delivery-health","data-delivery-state":S.state,children:[(0,n.jsx)("p",{className:t?"text-sm font-semibold text-danger-foreground":"text-sm font-semibold text-warning-foreground",children:e(t?"delivery.headingRemoved":"delivery.headingFailing")}),(0,n.jsx)("p",{className:"text-xs text-foreground",children:s}),403===a&&(0,n.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"notifications-delivery-apns-hint",children:e("delivery.apnsHint")}),(0,n.jsx)("p",{className:"text-xs text-muted-foreground",children:e("delivery.since",{timestamp:new Date(S.firstFailureAt).toLocaleString()})})]})})(),T?(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-foreground",children:e("enabledOnThisDevice")}),k&&(0,n.jsxs)("div",{className:"space-y-3 rounded-lg border border-info-border bg-info-subtle p-3","data-testid":"notifications-defaults-notice",children:[(0,n.jsx)("p",{className:"text-sm font-semibold text-info-foreground",children:e("defaultsNotice.heading")}),(0,n.jsx)("p",{className:"text-xs text-foreground",children:e("defaultsNotice.completionChanged")}),(0,n.jsx)("p",{className:"text-xs text-foreground",children:e("defaultsNotice.failuresAdded")}),(0,n.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,n.jsx)(u.$n,{variant:"primary",onClick:()=>R(!0),disabled:i,"data-testid":"notifications-defaults-notice-adopt",children:e("defaultsNotice.adopt")}),(0,n.jsx)(u.$n,{variant:"secondary",onClick:()=>R(!1),disabled:i,"data-testid":"notifications-defaults-notice-keep",children:e("defaultsNotice.keep")})]})]}),(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e("types.heading")}),(0,n.jsxs)("label",{className:"flex items-center justify-between gap-4",children:[(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{className:"block text-sm font-medium text-foreground",children:e("types.promptWaiting")}),(0,n.jsx)("span",{className:"block text-xs text-muted-foreground",children:e("types.promptWaitingDesc")})]}),(0,n.jsx)(u.dO,{checked:N.prompt,onCheckedChange:e=>O("prompt",e),disabled:i,"aria-label":e("types.promptWaiting"),"data-testid":"notifications-toggle-prompt"})]}),(0,n.jsxs)("label",{className:"flex items-center justify-between gap-4",children:[(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{className:"block text-sm font-medium text-foreground",children:e("types.completion")}),(0,n.jsx)("span",{className:"block text-xs text-muted-foreground",children:e("types.completionDesc")})]}),(0,n.jsx)(u.dO,{checked:N.completion,onCheckedChange:e=>O("completion",e),disabled:i,"aria-label":e("types.completion"),"data-testid":"notifications-toggle-completion"})]})]}),(0,n.jsx)(u.$n,{variant:"secondary",onClick:I,disabled:i,"data-testid":"notifications-unsubscribe",children:e("unsubscribe")})]}):(0,n.jsxs)(u.$n,{variant:"primary",onClick:M,disabled:i||b||!g,"data-testid":"notifications-enable",children:[(0,n.jsx)(L.A,{className:"h-4 w-4"}),i?e("enabling"):e("enable")]})]}):(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:e("unsupported")})}),(0,n.jsx)(u.Zp,{children:(0,n.jsx)(W,{})})]})}function W(){let e=(0,r.c)("notifications"),{showToast:t}=(0,z.dj)(),[a,l]=(0,s.useState)(!0),[i,o]=(0,s.useState)(!1),[d,c]=(0,s.useState)(D),[f,m]=(0,s.useState)([...Z]);(0,s.useEffect)(()=>{let e=!1;return(async()=>{try{let t=await fetch("/api/push/escalation"),a=await t.json();!e&&(a.settings&&c(a.settings),Array.isArray(a.choices)&&a.choices.length>0&&m(a.choices))}catch(e){}finally{e||l(!1)}})(),()=>{e=!0}},[]);let x=(0,s.useCallback)(async a=>{c(a),o(!0);try{if(!(await fetch("/api/push/escalation",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({settings:a})})).ok)throw Error("update failed");t(e("toast.updated"),"success")}catch(a){c(d),t(e("toast.error"),"error")}finally{o(!1)}},[d,t,e]);return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e("escalation.heading")}),(0,n.jsxs)("label",{className:"flex items-center justify-between gap-4",children:[(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{className:"block text-sm font-medium text-foreground",children:e("escalation.toggle")}),(0,n.jsx)("span",{className:"block text-xs text-muted-foreground",children:e("escalation.toggleDesc")})]}),(0,n.jsx)(u.dO,{checked:d.enabled,onCheckedChange:e=>x({...d,enabled:e}),disabled:a||i,"aria-label":e("escalation.toggle"),"data-testid":"notifications-toggle-escalation"})]}),(0,n.jsxs)("label",{className:"flex items-center justify-between gap-4",children:[(0,n.jsx)("span",{className:"text-sm text-foreground",children:e("escalation.threshold")}),(0,n.jsx)("select",{className:"rounded-md border border-border bg-background px-2 py-1 text-sm text-foreground",value:String(d.thresholdMinutes),disabled:a||i||!d.enabled,"aria-label":e("escalation.threshold"),"data-testid":"notifications-escalation-threshold",onChange:e=>x({...d,thresholdMinutes:Number(e.target.value)}),children:f.map(t=>(0,n.jsx)("option",{value:String(t),children:e("escalation.minutes",{count:t})},t))})]})]})}function q(){let e=(0,r.c)("notifications"),{enabled:t,setEnabled:a}=(0,$.qG)(),{enabled:s,setEnabled:l}=(0,$.Ql)();return(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)("div",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:e("inApp.heading")}),(0,n.jsxs)("label",{className:"flex items-center justify-between gap-4",children:[(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{className:"block text-sm font-medium text-foreground",children:e("inApp.waitingToggle")}),(0,n.jsx)("span",{className:"block text-xs text-muted-foreground",children:e("inApp.waitingToggleDesc")})]}),(0,n.jsx)(u.dO,{checked:t,onCheckedChange:a,"aria-label":e("inApp.waitingToggle"),"data-testid":"notifications-toggle-inapp-waiting"})]}),(0,n.jsxs)("label",{className:"flex items-center justify-between gap-4",children:[(0,n.jsxs)("span",{children:[(0,n.jsx)("span",{className:"block text-sm font-medium text-foreground",children:e("inApp.soundToggle")}),(0,n.jsx)("span",{className:"block text-xs text-muted-foreground",children:e("inApp.soundToggleDesc")})]}),(0,n.jsx)(u.dO,{checked:s,onCheckedChange:l,"aria-label":e("inApp.soundToggle"),"data-testid":"notifications-toggle-inapp-sound"})]})]})}function _(e){let{heading:t,children:a}=e;return(0,n.jsxs)("div",{className:"mb-8",children:[(0,n.jsx)("h2",{className:"text-lg font-semibold mb-4 text-foreground",children:t}),a]})}function B(e){let{onNavigate:t}=e,a=(0,r.c)("common"),s=(0,r.c)("skills");return(0,n.jsx)(_,{heading:a("settings.sections.quickLinks"),children:(0,n.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[(0,n.jsx)(S(),{href:"/repositories",className:"block","data-testid":"more-link-repositories",onClick:t,children:(0,n.jsxs)(u.Zp,{hover:!0,className:"transition-colors hover:border-accent-300 dark:hover:border-accent-700",children:[(0,n.jsx)("div",{className:"text-sm font-medium text-foreground",children:"Repositories"}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:"Manage repositories and worktrees"})]})}),(0,n.jsx)(S(),{href:"/skills",className:"block","data-testid":"more-link-skills",onClick:t,children:(0,n.jsxs)(u.Zp,{hover:!0,className:"transition-colors hover:border-accent-300 dark:hover:border-accent-700",children:[(0,n.jsx)("div",{className:"text-sm font-medium text-foreground",children:a("nav.skills")}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:s("page.description")})]})}),(0,n.jsx)(S(),{href:"/skills/installed",className:"block","data-testid":"more-link-skills-installed",onClick:t,children:(0,n.jsxs)(u.Zp,{hover:!0,className:"transition-colors hover:border-accent-300 dark:hover:border-accent-700",children:[(0,n.jsx)("div",{className:"text-sm font-medium text-foreground",children:s("dashboard.title")}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground",children:s("dashboard.description")})]})})]})})}function J(){let e=(0,r.c)("common");return(0,n.jsx)(_,{heading:e("settings.sections.general"),children:(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)(p,{}),(0,n.jsx)(v,{}),(0,n.jsx)(k,{})]})})}function V(){let e=(0,r.c)("common");return(0,n.jsx)(_,{heading:e("settings.sections.notifications"),children:(0,n.jsx)(H,{})})}function K(){let e=(0,r.c)("common");return(0,n.jsx)(_,{heading:e("settings.sections.externalApps"),children:(0,n.jsx)(U,{})})}function X(){let e=(0,r.c)("common");return(0,n.jsx)(_,{heading:e("settings.sections.about"),children:(0,n.jsx)(u.Zp,{children:(0,n.jsx)("div",{className:"text-sm text-muted-foreground",children:"CommandMate - A local control plane for agent CLIs."})})})}function G(){return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(B,{}),(0,n.jsx)(J,{}),(0,n.jsx)(V,{}),(0,n.jsx)(K,{}),(0,n.jsx)(X,{})]})}a(72604),a(95275),a(79832);var Q=a(94465),Y=a(23838),ee=a(40823);let et=[{id:"general",labelKey:"settings.sections.general"},{id:"notifications",labelKey:"settings.sections.notifications"},{id:"externalApps",labelKey:"settings.sections.externalApps"},{id:"about",labelKey:"settings.sections.about"}];function ea(){let e=(0,r.c)("common"),{isOpen:t,close:a}=(0,ee.V0)();return(0,n.jsx)(Q.a,{isOpen:t,onClose:a,title:e("settings.title"),size:"lg",children:(0,n.jsxs)(Y.tU,{defaultValue:"general",orientation:"vertical",variant:"pill",className:"flex gap-6 min-h-[60vh]","data-testid":"settings-dialog",children:[(0,n.jsx)(Y.j7,{"aria-label":e("settings.categoriesLabel"),className:"sticky top-0 w-40 shrink-0 flex-col items-stretch self-start",children:et.map(t=>(0,n.jsx)(Y.Xi,{value:t.id,"data-testid":"settings-dialog-tab-".concat(t.id),className:"justify-start",children:e(t.labelKey)},t.id))}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)(Y.av,{value:"general",className:"mt-0",children:(0,n.jsx)(J,{})}),(0,n.jsx)(Y.av,{value:"notifications",className:"mt-0",children:(0,n.jsx)(V,{})}),(0,n.jsx)(Y.av,{value:"externalApps",className:"mt-0",children:(0,n.jsx)(K,{})}),(0,n.jsxs)(Y.av,{value:"about",className:"mt-0",children:[(0,n.jsx)(B,{onNavigate:a}),(0,n.jsx)(X,{})]})]})]})})}},72604:(e,t,a)=>{a.d(t,{dS:()=>c,rM:()=>u});var n=a(12115),s=a(20063),r=a(18955),l=a(94442),i=a(66966),o=a(60199),d=a(81978);function c(e,t,a){return"".concat(e,"|").concat(null!=t?t:"-","|").concat(null!=a?a:"no-since")}function u(){let e=(0,r.c)("notifications"),{showToast:t}=(0,l.dj)(),{addListener:a}=(0,o.xM)(),{enabled:u}=(0,d.qG)(),f=(0,s.usePathname)(),m=(0,s.useRouter)(),x=(0,i.rC)(),p=(0,n.useRef)({enabled:u,pathname:f,worktrees:null==x?void 0:x.worktrees,showToast:t,t:e,router:m});p.current={enabled:u,pathname:f,worktrees:null==x?void 0:x.worktrees,showToast:t,t:e,router:m};let g=(0,n.useRef)(new Set);return(0,n.useEffect)(()=>a(e=>{var t,a,n,s,r;if("session_status_changed"!==e.type)return;let l=e.worktreeId;if("string"!=typeof l||0===l.length)return;let i=e.isWaitingForResponse;if("boolean"!=typeof i)return;let o=null!=(n=e.instance)?n:null,d=null!=(s=e.waitingSince)?s:null;if(!i){let e="".concat(l,"|").concat(null!=o?o:"-","|");for(let t of g.current)t.startsWith(e)&&g.current.delete(t);return}let u=p.current;if(!u.enabled||function(e){if(!e)return null;let t=/^\/worktrees\/([^/]+)/.exec(e);if(!t)return null;try{return decodeURIComponent(t[1])}catch(e){return t[1]}}(u.pathname)===l)return;let f=c(l,o,d);if(g.current.has(f))return;g.current.size>=500&&g.current.clear(),g.current.add(f);let m=null!=(r=null==(a=u.worktrees)||null==(t=a.find(e=>e.id===l))?void 0:t.name)?r:l;u.showToast(u.t("inApp.waitingToast",{name:m}),"warning",8e3,{onClick:()=>u.router.push("/worktrees/".concat(encodeURIComponent(l)))})}),[a]),null}},75676:(e,t,a)=>{a.d(t,{jg:()=>r,kQ:()=>l,mR:()=>d,mS:()=>o,wf:()=>n});let n="terminal",s=new Set(["terminal","chat"]);function r(e){return"string"==typeof e&&s.has(e)}let l={data:null,messageId:null,visible:!1,answering:!1},i={mode:"split",mobileActivePane:"terminal",leftPaneTab:"history",splitRatio:.5,leftPaneCollapsed:!1,activityBar:{active:"files"},historyPane:{visible:!0,width:25,collapsed:!1}},o={type:null,message:null,retryable:!1,retryCount:0};function d(){return{phase:"idle",prompt:{...l},layout:{...i},error:{...o},messages:[],wsConnected:!1}}},79832:(e,t,a)=>{a.d(t,{o:()=>o});var n=a(12115),s=a(24373);let r=/^\(\d+\+?\)(?:\s+|$)/;function l(e){return e.replace(r,"").trim()}function i(e){return Array.from(e.querySelectorAll('link[rel~="icon"]'))}function o(){return!function(){let{count:e}=(0,s.Lv)(),t=(0,n.useRef)([]),a=(0,n.useRef)(null);(0,n.useEffect)(()=>{if("undefined"==typeof document)return;let t=()=>{let t=function(e,t){let a=l(e);if(!Number.isFinite(t)||t<=0)return a;let n="(".concat(Math.floor(t),")");return a?"".concat(n," ").concat(a):n}(document.title,e);t!==document.title&&(document.title=t)};t();let a=null;return"undefined"!=typeof MutationObserver&&document.head&&(a=new MutationObserver(t)).observe(document.head,{childList:!0,subtree:!0,characterData:!0}),()=>{null==a||a.disconnect();let e=l(document.title);e!==document.title&&(document.title=e)}},[e]),(0,n.useEffect)(()=>{if("undefined"==typeof document||e<=0)return;let n=t.current,s=()=>{let t=a.current,s=function(e){var t,a;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Number.isFinite(e)||e<=0)return null;let s=null!=(t=n.document)?t:"undefined"!=typeof document?document:null;if(!s)return null;let r=null!=(a=n.size)?a:64;try{let t=s.createElement("canvas");t.width=r,t.height=r;let a=t.getContext("2d");if(!a)return null;a.clearRect(0,0,r,r),n.base?a.drawImage(n.base,0,0,r,r):(a.fillStyle="#111827",a.fillRect(0,0,r,r));let l=Math.floor(e)>9,i=.34*r,o=r-i-.03*r;a.beginPath(),a.arc(o,o,i,0,2*Math.PI),a.fillStyle=l?"#ef4444":"#f59e0b",a.fill(),a.lineWidth=.05*r,a.strokeStyle="rgba(0, 0, 0, 0.55)",a.stroke();let d=function(e){if(!Number.isFinite(e)||e<=0)return"";let t=Math.floor(e);return t>9?"".concat(9,"+"):String(t)}(e);return a.fillStyle=l?"#ffffff":"#1c1300",a.font="bold ".concat(Math.round(r*(d.length>1?.38:.48)),"px sans-serif"),a.textAlign="center",a.textBaseline="middle",a.fillText(d,o,o+.02*r),t.toDataURL("image/png")}catch(e){return null}}(e,{base:t&&t.complete&&t.naturalWidth>0?t:null,document});s&&function(e,t,a){let n=i(e);if(0===n.length){let t=e.createElement("link");t.setAttribute("rel","icon"),t.setAttribute("type","image/png"),e.head.appendChild(t),a.push({link:t,originalHref:null,created:!0}),n=[t]}for(let e of n)a.some(t=>t.link===e)||a.push({link:e,originalHref:e.getAttribute("href"),created:!1}),e.setAttribute("href",t)}(document,s,n)};s();let r=a.current;if(!r&&"undefined"!=typeof Image){let e=function(e,t){var a;for(let e of t)if(!e.created&&e.originalHref)return e.originalHref;let n=i(e).find(e=>e.getAttribute("href"));return null!=(a=null==n?void 0:n.getAttribute("href"))?a:null}(document,n);e&&(a.current=r=new Image,r.src=e)}let l=null;return r&&!(r.complete&&r.naturalWidth>0)?(l=()=>s(),r.addEventListener("load",l)):r&&s(),()=>{r&&l&&r.removeEventListener("load",l);for(let e of n){if(e.created){e.link.remove();continue}null===e.originalHref?e.link.removeAttribute("href"):e.link.setAttribute("href",e.originalHref)}n.length=0}},[e]),(0,n.useEffect)(()=>{!function(e,t){let a="undefined"!=typeof navigator?navigator:null;if(!a)return;let n=e=>{e&&"function"==typeof e.catch&&e.catch(()=>{})};try{if(Number.isFinite(e)&&e>0){if("function"!=typeof a.setAppBadge)return!1;return n(a.setAppBadge(Math.floor(e))),!0}if("function"!=typeof a.clearAppBadge)return!1;n(a.clearAppBadge())}catch(e){return!1}}(e)},[e])}(),null}},81978:(e,t,a)=>{a.d(t,{Ql:()=>o,qG:()=>l});var n=a(12115);let s="mcbd-inapp-waiting-toast",r="mcbd:inapp-notification-prefs-changed";function l(){let[e,t]=(0,n.useState)(!0);return(0,n.useEffect)(()=>{let e=()=>t(function(){try{let e=window.localStorage.getItem(s);if(null===e)return!0;return"false"!==e}catch(e){return!0}}());return e(),window.addEventListener(r,e),window.addEventListener("storage",e),()=>{window.removeEventListener(r,e),window.removeEventListener("storage",e)}},[]),{enabled:e,setEnabled:(0,n.useCallback)(e=>{t(e);try{window.localStorage.setItem(s,e?"true":"false")}catch(e){}window.dispatchEvent(new CustomEvent(r))},[])}}let i="mcbd-inapp-waiting-sound";function o(){let[e,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e=()=>t(function(){try{let e=window.localStorage.getItem(i);if(null===e)return!1;return"true"===e}catch(e){return!1}}());return e(),window.addEventListener(r,e),window.addEventListener("storage",e),()=>{window.removeEventListener(r,e),window.removeEventListener("storage",e)}},[]),{enabled:e,setEnabled:(0,n.useCallback)(e=>{t(e);try{window.localStorage.setItem(i,e?"true":"false")}catch(e){}window.dispatchEvent(new CustomEvent(r))},[])}}},94442:(e,t,a)=>{a.d(t,{dj:()=>y,tE:()=>j});var n=a(95155),s=a(12115),r=a(47650),l=a(18955),i=a(42529),o=a(78874),d=a(52056),c=a(23327),u=a(65229),f=a(59854),m=a(9900),x=a(9286);function p(e){let{type:t,iconColor:a}=e,s="h-5 w-5 ".concat(a);switch(t){case"success":return(0,n.jsx)(i.A,{className:s,"data-testid":"toast-icon-success"});case"error":return(0,n.jsx)(o.A,{className:s,"data-testid":"toast-icon-error"});case"warning":return(0,n.jsx)(d.A,{className:s,"data-testid":"toast-icon-warning"});default:return(0,n.jsx)(c.A,{className:s,"data-testid":"toast-icon-info"})}}function g(e){let{id:t,message:a,type:r,onClose:i,duration:o=3e3,onClick:d}=e,c=(0,l.c)("common"),f=(0,s.useRef)(null),g=function(e){switch(e){case"success":return{bgColor:"bg-success-subtle",borderColor:"border-success-border",textColor:"text-success-foreground",iconColor:"text-success-foreground"};case"error":return{bgColor:"bg-danger-subtle",borderColor:"border-danger-border",textColor:"text-danger-foreground",iconColor:"text-danger-foreground"};case"warning":return{bgColor:"bg-warning-subtle",borderColor:"border-warning-border",textColor:"text-warning-foreground",iconColor:"text-warning-foreground"};default:return{bgColor:"bg-info-subtle",borderColor:"border-info-border",textColor:"text-info-foreground",iconColor:"text-info-foreground"}}}(r),[h,b]=(0,s.useState)(!0),{shouldRender:v,isExiting:j}=(0,x.O)(h,m.Ys),y=(0,s.useRef)(i);y.current=i,(0,s.useEffect)(()=>{v||y.current(t)},[v,t]),(0,s.useEffect)(()=>(o>0&&(f.current=setTimeout(()=>{b(!1)},o)),()=>{f.current&&clearTimeout(f.current)}),[o]);let N=(0,s.useCallback)(()=>{f.current&&clearTimeout(f.current),b(!1)},[]);return(0,n.jsxs)("div",{"data-testid":"toast-".concat(t),role:"alert",className:"\n ".concat(g.bgColor,"\n ").concat(g.borderColor,"\n ").concat(g.textColor,"\n border rounded-lg shadow-lg p-4 min-w-[300px] max-w-[400px]\n flex items-start gap-3\n ").concat(j?"animate-out fade-out-0 slide-out-to-right-full duration-200 fill-mode-forwards pointer-events-none":"animate-slide-in","\n "),children:[(0,n.jsx)(p,{type:r,iconColor:g.iconColor}),d?(0,n.jsx)("button",{type:"button","data-testid":"toast-action-button",onClick:()=>{d(),N()},className:"flex-1 text-left text-sm font-medium underline-offset-2 hover:underline focus:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-sm",children:a}):(0,n.jsx)("p",{className:"flex-1 text-sm font-medium",children:a}),(0,n.jsx)("button",{"data-testid":"toast-close-button",onClick:N,"aria-label":c("closeNotification"),className:"\n ".concat(g.textColor,"\n hover:opacity-70\n focus:outline-none focus:ring-2 focus:ring-offset-2\n transition-opacity\n "),children:(0,n.jsx)(u.A,{className:"h-4 w-4"})})]})}function h(e){let{toasts:t,onClose:a}=e,[l,i]=(0,s.useState)(!1);(0,s.useEffect)(()=>{i(!0)},[]);let o=(0,n.jsx)("div",{"data-testid":"toast-container","aria-live":"polite",className:"fixed bottom-4 right-4 flex flex-col gap-2",style:{zIndex:f.M.TOAST},children:t.map(e=>(0,n.jsx)(g,{id:e.id,message:e.message,type:e.type,onClose:a,duration:e.duration,onClick:e.onClick},e.id))});return l?(0,r.createPortal)(o,document.body):null}function b(){let[e,t]=(0,s.useState)([]),a=(0,s.useRef)(0),n=(0,s.useCallback)(function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3,r=arguments.length>3?arguments[3]:void 0,l="toast-".concat(++a.current,"-").concat(Date.now()),i={id:l,message:e,type:n,duration:s,...(null==r?void 0:r.onClick)?{onClick:r.onClick}:{}};return t(e=>[...e,i]),l},[]),r=(0,s.useCallback)(e=>{t(t=>t.filter(t=>t.id!==e))},[]),l=(0,s.useCallback)(()=>{t([])},[]);return(0,s.useMemo)(()=>({toasts:e,showToast:n,removeToast:r,clearToasts:l}),[e,n,r,l])}let v=(0,s.createContext)(null);function j(e){let{children:t}=e,a=b();return(0,n.jsxs)(v.Provider,{value:a,children:[t,(0,n.jsx)(h,{toasts:a.toasts,onClose:a.removeToast})]})}function y(){let e=(0,s.useContext)(v),t=b();return null!=e?e:t}},95275:(e,t,a)=>{a.d(t,{H:()=>f});var n=a(12115),s=a(60199),r=a(81978),l=a(72604);let i=[{frequency:880,offset:0,duration:.12},{frequency:1318.5,offset:.13,duration:.18}],o=null;function d(){if(o)return o;let e=function(){var e,t;let a=window;return null!=(t=null!=(e=a.AudioContext)?e:a.webkitAudioContext)?t:null}();if(!e)return null;try{o=new e}catch(e){return null}return o}function c(e){e&&"function"==typeof e.catch&&e.catch(()=>{})}let u=["pointerdown","touchstart","keydown"];function f(){let{addListener:e}=(0,s.xM)(),{enabled:t}=(0,r.Ql)(),a=(0,n.useRef)({enabled:t});a.current={enabled:t};let o=(0,n.useRef)(new Set);return(0,n.useEffect)(()=>{let e=()=>(function(){let e=d();if(e)try{var t;"suspended"===e.state&&c(null==(t=e.resume)?void 0:t.call(e))}catch(e){}})();for(let t of u)window.addEventListener(t,e,{once:!0,passive:!0});return()=>{for(let t of u)window.removeEventListener(t,e)}},[]),(0,n.useEffect)(()=>e(e=>{var t,n;if("session_status_changed"!==e.type)return;let s=e.worktreeId;if("string"!=typeof s||0===s.length)return;let r=e.isWaitingForResponse;if("boolean"!=typeof r)return;let u=null!=(t=e.instance)?t:null,f=null!=(n=e.waitingSince)?n:null;if(!r){let e="".concat(s,"|").concat(null!=u?u:"-","|");for(let t of o.current)t.startsWith(e)&&o.current.delete(t);return}if(!a.current.enabled)return;let m=(0,l.dS)(s,u,f);o.current.has(m)||(o.current.size>=500&&o.current.clear(),o.current.add(m),function(){let e=d();if(e)try{var t,a;"suspended"===e.state&&c(null==(t=e.resume)?void 0:t.call(e));let n=null!=(a=e.currentTime)?a:0;for(let t of i){let a=e.createOscillator(),s=e.createGain();a.type="sine",a.frequency.value=t.frequency;let r=n+t.offset,l=r+t.duration;s.gain.setValueAtTime(0,r),s.gain.linearRampToValueAtTime(.12,r+.015),s.gain.linearRampToValueAtTime(1e-4,l),a.connect(s),s.connect(e.destination),a.start(r),a.stop(l+.02)}}catch(e){return!1}}())}),[e]),null}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8975],{3199:(e,t,a)=>{"use strict";a.d(t,{Vt:()=>s,aN:()=>l,zK:()=>u,I_:()=>i,JY:()=>o,sd:()=>d,kj:()=>c});let r=/^[a-zA-Z0-9][a-zA-Z0-9\-._/:]*$/,n=/^[a-zA-Z0-9][a-zA-Z0-9\-._]*$/,s=new Set(["copilot","opencode"]),l=new Set(["opencode"]);function i(e){let t=e.trim();if(!t)return{cliToolId:"claude",model:void 0};let{tokens:a,error:r}=function(e){let t=[],a="",r=!1,n=null;for(let s of e){if(n){s===n?n=null:a+=s;continue}if('"'===s||"'"===s){n=s,r=!0;continue}if(/\s/.test(s)){r&&(t.push(a),a="",r=!1);continue}a+=s,r=!0}return n?{tokens:[],error:"CLI Tool column has an unterminated quote"}:(r&&t.push(a),{tokens:t})}(t);if(r)return{cliToolId:t.split(/\s+/)[0],error:r};let n=a[0];return 1===a.length?{cliToolId:n,model:void 0}:s.has(n)?l.has(n)?function(e,t){let a={cliToolId:e},r=new Set,n=(e,a)=>{let r=t[a+1];return void 0===r||r.startsWith("-")?null:r};for(let s=0;s<t.length;s++){let l=t[s];if(r.has(l))return{cliToolId:e,error:"".concat(e,' option "').concat(l,'" is repeated')};switch(l){case"--model":case"-m":{let t=n(l,s);if(null===t)return{cliToolId:e,error:"".concat(e,' option "').concat(l,'" needs a value')};r.add("--model"),r.add("-m"),a.model=t,s++;break}case"--agent":{let t=n(l,s);if(null===t)return{cliToolId:e,error:"".concat(e,' option "').concat(l,'" needs a value')};r.add(l),a.agent=t,s++;break}case"--variant":{let t=n(l,s);if(null===t)return{cliToolId:e,error:"".concat(e,' option "').concat(l,'" needs a value')};r.add(l),a.variant=t,s++;break}case"--title":{let t=n(l,s);if(null===t)return{cliToolId:e,error:"".concat(e,' option "').concat(l,'" needs a value')};r.add(l),a.title=t,s++;break}case"--continue":case"-c":r.add("--continue"),r.add("-c"),a.continueSession=!0;break;default:return{cliToolId:e,error:"".concat(e," only supports: ").concat("opencode [--model <provider/model>] [--agent <name>] [--variant <name>] [--continue] [--title <text>]")}}}return a}(n,a.slice(1)):3===a.length&&"--model"===a[1]?{cliToolId:n,model:a[2]}:{cliToolId:n,error:"".concat(n," only supports: ").concat(n," --model <modelName>")}:{cliToolId:n,error:'CLI Tool "'.concat(n,'" does not support additional options')}}function o(e){return/[\x00-\x1f\x7f]/.test(e)?{valid:!1,reason:"Model name contains control characters"}:""===e.trim()?{valid:!1,reason:"Model name must not be empty"}:r.test(e)?e.length>128?{valid:!1,reason:"Model name exceeds ".concat(128," characters")}:{valid:!0}:{valid:!1,reason:"Model name contains invalid characters"}}function d(e,t){return/[\x00-\x1f\x7f]/.test(e)?{valid:!1,reason:"opencode ".concat(t," contains control characters")}:""===e.trim()?{valid:!1,reason:"opencode ".concat(t," must not be empty")}:n.test(e)?e.length>64?{valid:!1,reason:"opencode ".concat(t," exceeds ").concat(64," characters")}:{valid:!0}:{valid:!1,reason:"opencode ".concat(t," contains invalid characters")}}function c(e){return/[\x00-\x1f\x7f]/.test(e)?{valid:!1,reason:"opencode title contains control characters"}:""===e.trim()?{valid:!1,reason:"opencode title must not be empty"}:e.startsWith("-")?{valid:!1,reason:'opencode title must not start with "-"'}:e.includes("|")?{valid:!1,reason:'opencode title must not contain "|"'}:e.length>200?{valid:!1,reason:"opencode title exceeds ".concat(200," characters")}:{valid:!0}}function u(e){let t=[],a=i(e);if(a.error&&t.push(a.error),a.model){let e=o(a.model);e.valid||t.push(e.reason)}if(a.agent){let e=d(a.agent,"agent");e.valid||t.push(e.reason)}if(a.variant){let e=d(a.variant,"variant");e.valid||t.push(e.reason)}if(a.title){let e=c(a.title);e.valid||t.push(e.reason)}return{result:a,errors:t}}},4138:(e,t,a)=>{"use strict";a.d(t,{q:()=>s});var r=a(12115),n=a(9900);function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n.pX,[t,a]=(0,r.useState)(!1),s=(0,r.useRef)(null);return(0,r.useEffect)(()=>()=>{null!==s.current&&(clearTimeout(s.current),s.current=null)},[]),{copied:t,markCopied:(0,r.useCallback)(()=>{a(!0),null!==s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{s.current=null,a(!1)},e)},[e]),reset:(0,r.useCallback)(()=>{null!==s.current&&(clearTimeout(s.current),s.current=null),a(!1)},[])}}},17442:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>A});var r=a(95155),n=a(12115),s=a(18955),l=a(48407),i=a(52619),o=a.n(i),d=a(20063),c=a(87531),u=a(44308),m=a(55449),p=a(38606),x=a(76471),h=a(54014),f=a(46892);let g={in_review:"status.inReview",approval:"status.approval",stalled:"status.stalled"},v=u.DR,b={in_review:e=>"in_review"===e.status,approval:e=>!0===e.isWaitingForResponse,stalled:e=>!0===e.isStalled};function y(e){let{status:t,label:a,unclassified:n}=e,l=(0,s.c)("common"),i=f.PL[t],o="w-2.5 h-2.5 rounded-full flex-shrink-0";if((0,x.Mq)(t,n))return(0,r.jsx)("span",{className:"".concat(o," ").concat(x.Jd),title:"".concat(a,": ").concat(l(x.rH)),"data-unclassified":"true"});let d="".concat(a,": ").concat(l(i.labelKey));return"spinner"===i.type?(0,r.jsx)("span",{className:"".concat(o," border-2 border-t-transparent animate-spin ").concat(i.className),title:d}):(0,r.jsx)("span",{className:"".concat(o," ").concat(i.className),title:d})}function j(){var e;let t=(0,s.c)("review"),[a,i]=(0,n.useState)([]),[x,f]=(0,n.useState)(!0),j=(0,d.useSearchParams)(),[w,N]=(0,n.useState)(()=>{var e;return null!=(e=(0,u._d)(null==j?void 0:j.get(u.z7)))?e:u.SD}),S=(0,n.useRef)(null),k=null!=(e=null==j?void 0:j.get(u.z7))?e:null;(0,n.useEffect)(()=>{let e=(0,u._d)(k);e&&N(e)},[k]);let C=(0,n.useCallback)(async()=>{try{let t=await fetch("/api/worktrees?include=review");if(t.ok){var e;let a=await t.json();(0,m.IK)(a.defaultSelectedAgents),i(null!=(e=a.worktrees)?e:[])}}catch(e){}finally{f(!1)}},[]);(0,n.useEffect)(()=>(C(),S.current=setInterval(C,u.Iu),()=>{S.current&&clearInterval(S.current)}),[C]);let T=(0,n.useMemo)(()=>a.filter(b[w]),[a,w]),z=(0,n.useMemo)(()=>({in_review:a.filter(b.in_review).length,approval:a.filter(b.approval).length,stalled:a.filter(b.stalled).length}),[a]),P=(0,n.useMemo)(()=>{switch(w){case"in_review":return t("empty.inReview");case"approval":return t("empty.approval");case"stalled":return t("empty.stalled")}},[w,t]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mb-6 inline-flex items-center gap-1 rounded-lg bg-muted p-1",role:"group","aria-label":t("filters.ariaLabel"),"data-testid":"review-filters",children:v.map(e=>{let a=w===e;return(0,r.jsxs)("button",{type:"button","aria-pressed":a,onClick:()=>N(e),"data-testid":"review-filter-".concat(e),className:(0,c.cn)("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-sm font-medium transition-colors","focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",a?"bg-accent-500/15 text-accent-700 dark:text-accent-300":"text-muted-foreground hover:text-foreground"),children:[t(g[e]),(0,r.jsx)("span",{className:(0,c.cn)("text-xs font-semibold tabular-nums",a?"text-accent-700 dark:text-accent-300":"text-muted-foreground"),children:z[e]})]},e)})}),x&&(0,r.jsx)("div",{className:"space-y-2","data-testid":"review-loading",role:"status","aria-label":t("filters.loading"),children:[0,1,2].map(e=>(0,r.jsx)(l.Zp,{padding:"md",children:(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1 space-y-1.5",children:[(0,r.jsx)(l.EA,{className:"h-4 w-40 max-w-full"}),(0,r.jsx)(l.EA,{className:"h-3 w-24 max-w-full"})]}),(0,r.jsx)(l.EA,{className:"ml-4 h-5 w-16 flex-shrink-0"})]})},e))}),!x&&(0,r.jsx)("div",{className:"space-y-2","data-testid":"review-list",children:0===T.length?(0,r.jsx)("div",{className:"text-muted-foreground py-8 text-center","data-testid":"review-empty",children:P}):T.map(e=>{var a;let n=null!=(a=e.selectedAgents)?a:(0,m.sA)();return(0,r.jsx)(o(),{href:"/worktrees/".concat(e.id),className:"block","data-testid":"review-item-".concat(e.id),children:(0,r.jsxs)(l.Zp,{padding:"md",className:"transition-colors ".concat(function(e){switch(e){case"in_review":return"border-info-border hover:border-info-border";case"approval":return"border-warning-border hover:border-warning-border";case"stalled":return"border-danger-border hover:border-danger-border"}}(w)),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:e.name}),(0,r.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:e.repositoryName})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 ml-4 flex-shrink-0",children:[(0,r.jsx)("span",{className:"px-2 py-0.5 text-xs font-medium rounded ".concat(function(e){switch(e){case"in_review":return"bg-info-subtle text-info-foreground";case"approval":return"bg-warning-subtle text-warning-foreground";case"stalled":return"bg-danger-subtle text-danger-foreground"}}(w)),children:t(g[w])}),n.map(t=>{var a;let n=null==(a=e.sessionStatusByCli)?void 0:a[t],s=(0,p.kA)(n);return(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[(0,r.jsx)(y,{status:s,label:(0,h.oo)(t),unclassified:(0,p.px)(n)}),(0,r.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,h.oo)(t)})]},t)})]})]}),e.description&&(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 whitespace-pre-wrap",children:e.description})})]})},e.id)})})]})}function w(e){let t=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(a,"-").concat(r)}function N(e){let{value:t,onChange:a}=e,n=(0,s.c)("review"),i=w(new Date),o=t===i;return(0,r.jsxs)("div",{className:"flex items-center gap-2","data-testid":"report-date-picker",children:[(0,r.jsx)(l.$n,{variant:"secondary",size:"sm",onClick:()=>{let e=new Date(t+"T00:00:00");e.setDate(e.getDate()-1),a(w(e))},"data-testid":"date-prev","aria-label":n("datePicker.previousDay"),children:"<"}),(0,r.jsx)(l.pd,{type:"date",inputSize:"sm",value:t,max:i,onChange:e=>a(e.target.value),className:"w-auto","data-testid":"date-input"}),(0,r.jsx)(l.$n,{variant:"secondary",size:"sm",onClick:()=>{if(o)return;let e=new Date(t+"T00:00:00");e.setDate(e.getDate()+1);let r=w(e);r>i||a(r)},disabled:o,"data-testid":"date-next","aria-label":n("datePicker.nextDay"),children:">"})]})}var S=a(36402),k=a(3199),C=a(4138),T=a(60322);let z=[{value:"none",labelKey:"report.modes.none"},{value:"template",labelKey:"report.modes.template"},{value:"custom",labelKey:"report.modes.custom"}];function P(){let e=(0,s.c)("review"),t=(0,S.SC)(),[a,i]=(0,n.useState)(function(){let e=new Date,t=e.getFullYear(),a=String(e.getMonth()+1).padStart(2,"0"),r=String(e.getDate()).padStart(2,"0");return"".concat(t,"-").concat(a,"-").concat(r)}()),[o,d]=(0,n.useState)("claude"),[c,m]=(0,n.useState)(""),[p,x]=(0,n.useState)(null),[h,f]=(0,n.useState)(0),[g,v]=(0,n.useState)(""),[b,y]=(0,n.useState)(!1),[j,w]=(0,n.useState)(!1),[P,_]=(0,n.useState)(!1),[E,A]=(0,n.useState)(!1),{copied:D,markCopied:K}=(0,C.q)(),[I,R]=(0,n.useState)(null),$=k.Vt.has(o),{mode:M,setMode:L,userInstruction:O,setUserInstruction:Z,isUserInstructionReadOnly:q,templates:J,selectedTemplateId:F,selectTemplate:H,isLoadingTemplates:U}=function(){let[e,t]=(0,n.useState)("none"),[a,r]=(0,n.useState)(""),[s,l]=(0,n.useState)([]),[i,o]=(0,n.useState)(null),[d,c]=(0,n.useState)(!1),u=(0,n.useCallback)(async()=>{c(!0);try{let e=await fetch("/api/templates");if(e.ok){let t=await e.json();l(t.templates||[])}}catch(e){}finally{c(!1)}},[]);(0,n.useEffect)(()=>{u()},[u]);let m=(0,n.useCallback)(e=>{t(e),r(""),o(null)},[]),p=(0,n.useCallback)(t=>{"custom"===e&&r(t)},[e]),x=(0,n.useCallback)(t=>{let a=s.find(e=>e.id===t);a&&"template"===e&&(o(t),r(a.content))},[s,e]);return{mode:e,setMode:m,userInstruction:a,setUserInstruction:p,isUserInstructionReadOnly:"template"===e,templates:s,selectedTemplateId:i,selectTemplate:x,isLoadingTemplates:d,refreshTemplates:u}}(),V=function(e){let[t,a]=(0,n.useState)({generating:!1}),r=(0,n.useRef)(null),s=(0,n.useCallback)(async()=>{try{let e=await fetch("/api/daily-summary/status");if(e.ok){let t=await e.json();a(t)}}catch(e){}},[]);return(0,n.useEffect)(()=>e?(s(),r.current=setInterval(s,5e3),()=>{r.current&&(clearInterval(r.current),r.current=null)}):void a({generating:!1}),[e,s]),t}(!P),W=V.generating&&!P,B=(0,n.useCallback)(async t=>{w(!0),R(null);try{let a=await fetch("/api/daily-summary?date=".concat(t));if(!a.ok){let t=await a.json();R(t.error||e("report.errors.fetch"));return}let r=await a.json();x(r.report),f(r.messageCount),r.report?v(r.report.content):v(""),y(!1)}catch(t){R(e("report.errors.fetch"))}finally{w(!1)}},[e]);(0,n.useEffect)(()=>{B(a)},[a,B]);let[Y,X]=(0,n.useState)(!1);(0,n.useEffect)(()=>{V.generating?X(!0):Y&&(X(!1),B(a))},[V.generating,Y,B,a]);let G=async()=>{if(!p||await t({description:e("report.regenerateConfirm")})){_(!0),R(null);try{let t={date:a,tool:o};$&&c.trim()&&(t.model=c.trim()),"none"!==M&&O.trim()&&(t.userInstruction=O.trim());let r=await fetch("/api/daily-summary",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(429===r.status)return void R(e("report.errors.rateLimited"));if(!r.ok){let t=await r.json();R(t.error||e("report.errors.generate"));return}let n=await r.json();x(n.report),v(n.report.content),y(!1)}catch(t){R(e("report.errors.generate"))}finally{_(!1)}}},Q=async()=>{if(!g.trim())return void R(e("report.errors.emptyContent"));A(!0),R(null);try{let t=await fetch("/api/daily-summary",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({date:a,content:g})});if(!t.ok){let a=await t.json();R(a.error||e("report.errors.save"));return}let r=await t.json();x(r.report),y(!1)}catch(t){R(e("report.errors.save"))}finally{A(!1)}};return(0,r.jsxs)("div",{"data-testid":"report-tab",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-4 mb-6",children:[(0,r.jsx)(N,{value:a,onChange:e=>{i(e)}}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("label",{className:"text-sm text-muted-foreground",children:e("report.toolLabel")}),(0,r.jsx)("select",{value:o,onChange:e=>d(e.target.value),className:"px-3 py-1 text-sm rounded border border-input bg-surface dark:bg-surface-2 text-surface-foreground","data-testid":"tool-selector",children:u.IH.map(e=>(0,r.jsx)("option",{value:e,children:e},e))}),$&&(0,r.jsx)(l.pd,{type:"text",inputSize:"sm",placeholder:"opencode"===o?e("report.modelPlaceholderOpencode"):e("report.modelPlaceholder"),value:c,onChange:e=>m(e.target.value),className:"w-auto","data-testid":"model-input"})]})]}),(0,r.jsxs)("div",{className:"mb-4","data-testid":"generation-mode-selector",children:[(0,r.jsx)("label",{className:"text-sm font-medium text-foreground mb-2 block",children:e("report.generationMode")}),(0,r.jsx)(l.z6,{value:M,onValueChange:e=>L(e),name:"generation-mode",className:"flex flex-row gap-4",children:z.map(t=>(0,r.jsxs)("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[(0,r.jsx)(l.CU,{value:t.value,"data-testid":"mode-radio-".concat(t.value)}),(0,r.jsx)("span",{className:"text-foreground",children:e(t.labelKey)})]},t.value))})]}),"template"===M&&(0,r.jsxs)("div",{className:"mb-4","data-testid":"template-selector",children:[(0,r.jsx)("label",{className:"text-sm font-medium text-foreground mb-2 block",children:e("report.selectTemplate")}),U?(0,r.jsx)(l.EA,{className:"h-9 w-full","data-testid":"report-template-loading",role:"status","aria-label":e("report.loadingTemplates"),"aria-hidden":void 0}):0===J.length?(0,r.jsx)("div",{className:"text-sm text-muted-foreground",children:e("report.noTemplates")}):(0,r.jsxs)("select",{value:F||"",onChange:e=>H(e.target.value),className:"px-3 py-1 text-sm rounded border border-input bg-surface dark:bg-surface-2 text-surface-foreground","data-testid":"template-select",children:[(0,r.jsx)("option",{value:"",children:e("report.templatePlaceholderOption")}),J.map(e=>(0,r.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),"none"!==M&&(0,r.jsx)("div",{className:"mb-4",children:(0,r.jsx)(l.k_,{value:O,onChange:e=>Z(e.target.value),rows:3,maxLength:u.t7,readOnly:q,placeholder:"template"===M?e("report.instructionPlaceholderTemplate"):e("report.instructionPlaceholderCustom"),className:"resize-y ".concat(q?"bg-muted cursor-not-allowed":""),"data-testid":"user-instruction-input"})}),(0,r.jsx)("div",{className:"mb-6",children:(0,r.jsx)(l.$n,{variant:"primary",onClick:G,disabled:P||W||0===h,"data-testid":"generate-button",children:P||W?e("report.generating"):e("report.generate")})}),(0,r.jsx)("div",{className:"mb-4 text-sm text-muted-foreground","data-testid":"message-count",children:j?(0,r.jsx)(l.EA,{className:"h-4 w-48"}):0===h?e("report.noMessages"):e("report.messagesFound",{count:h})}),I&&(0,r.jsx)("div",{className:"mb-4 p-3 bg-danger-subtle text-danger-foreground rounded-lg text-sm","data-testid":"report-error",children:I}),(P||W)&&(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-4 text-sm text-muted-foreground","data-testid":"generating-spinner",children:[(0,r.jsx)(l.y$,{size:"sm",variant:"muted"}),W&&V.tool?V.startedAt?e("report.generatingRemoteWithTime",{tool:V.tool,seconds:Math.round((Date.now()-new Date(V.startedAt).getTime())/1e3)}):e("report.generatingRemote",{tool:V.tool}):e("report.generatingSummary")]}),!j&&p&&(0,r.jsxs)(l.Zp,{"data-testid":"report-content",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,r.jsxs)("div",{className:"text-xs text-muted-foreground",children:[e("report.generatedBy",{tool:p.generatedByTool}),p.model&&" (".concat(p.model,")")]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(l.$n,{variant:"secondary",size:"sm",onClick:async()=>{await (0,T.l)(p.content),K()},"data-testid":"copy-report-button",children:D?e("report.copied"):e("report.copy")}),(0,r.jsx)(l.$n,{variant:"secondary",size:"sm",onClick:()=>{b?Q():y(!0)},disabled:E,"data-testid":"edit-save-button",children:E?e("report.saving"):b?e("report.save"):e("report.edit")})]})]}),b?(0,r.jsx)(l.k_,{value:g,onChange:e=>v(e.target.value),className:"h-64 p-3 font-mono","data-testid":"report-editor"}):(0,r.jsx)("div",{className:"prose dark:prose-invert max-w-none text-sm whitespace-pre-wrap","data-testid":"report-preview",children:p.content})]})]})}function _(){let e=(0,s.c)("review"),t=(0,S.SC)(),[a,i]=(0,n.useState)([]),[o,d]=(0,n.useState)(!1),[c,m]=(0,n.useState)(null),[p,x]=(0,n.useState)(""),[h,f]=(0,n.useState)(""),[g,v]=(0,n.useState)(!1),[b,y]=(0,n.useState)(null),[j,w]=(0,n.useState)(""),[N,k]=(0,n.useState)(""),[C,T]=(0,n.useState)(!1),z=(0,n.useCallback)(async()=>{d(!0),m(null);try{let t=await fetch("/api/templates");if(!t.ok){let a=await t.json();m(a.error||e("template.errors.fetch"));return}let a=await t.json();i(a.templates||[])}catch(t){m(e("template.errors.fetch"))}finally{d(!1)}},[e]);(0,n.useEffect)(()=>{z()},[z]);let P=async()=>{if(!p.trim()||!h.trim())return void m(e("template.errors.nameAndContentRequired"));v(!0),m(null);try{let t=await fetch("/api/templates",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:p.trim(),content:h.trim()})});if(!t.ok){let a=await t.json();m(a.error||e("template.errors.create"));return}x(""),f(""),await z()}catch(t){m(e("template.errors.create"))}finally{v(!1)}},_=async()=>{if(!b||!j.trim()||!N.trim())return void m(e("template.errors.nameAndContentRequired"));T(!0),m(null);try{let t=await fetch("/api/templates/".concat(b),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:j.trim(),content:N.trim()})});if(!t.ok){let a=await t.json();m(a.error||e("template.errors.update"));return}y(null),await z()}catch(t){m(e("template.errors.update"))}finally{T(!1)}},E=async a=>{if(await t({description:e("template.deleteConfirm"),variant:"danger"})){m(null);try{let t=await fetch("/api/templates/".concat(a),{method:"DELETE"});if(!t.ok){let a=await t.json();m(a.error||e("template.errors.delete"));return}await z()}catch(t){m(e("template.errors.delete"))}}},A=()=>{y(null),w(""),k("")};return(0,r.jsxs)("div",{"data-testid":"template-tab",children:[c&&(0,r.jsx)("div",{className:"mb-4 p-3 bg-danger-subtle text-danger-foreground rounded-lg text-sm","data-testid":"template-error",children:c}),(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsx)("h2",{className:"text-lg font-semibold text-foreground mb-3",children:e("template.heading",{count:a.length,max:u.$h})}),o?(0,r.jsx)("div",{className:"space-y-3","data-testid":"template-loading",role:"status","aria-label":e("template.loading"),children:[0,1].map(e=>(0,r.jsx)(l.Zp,{padding:"md",children:(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(l.EA,{className:"h-4 w-32"}),(0,r.jsx)(l.EA,{className:"h-3 w-full"}),(0,r.jsx)(l.EA,{className:"h-3 w-2/3"})]})},e))}):0===a.length?(0,r.jsx)("div",{className:"text-sm text-muted-foreground","data-testid":"template-empty",children:e("template.empty")}):(0,r.jsx)("div",{className:"space-y-3","data-testid":"template-list",children:a.map(t=>(0,r.jsx)(l.Zp,{padding:"sm","data-testid":"template-item-".concat(t.id),children:b===t.id?(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsx)(l.pd,{type:"text",inputSize:"sm",value:j,onChange:e=>w(e.target.value),maxLength:u.Nb,"data-testid":"edit-name-input"}),(0,r.jsx)(l.k_,{value:N,onChange:e=>k(e.target.value),maxLength:u.bm,rows:3,className:"resize-y","data-testid":"edit-content-input"}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{variant:"primary",size:"sm",onClick:_,disabled:C,"data-testid":"edit-save-button",children:C?e("template.saving"):e("template.save")}),(0,r.jsx)(l.$n,{variant:"secondary",size:"sm",onClick:A,"data-testid":"edit-cancel-button",children:e("template.cancel")})]})]}):(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-1",children:[(0,r.jsx)("span",{className:"font-medium text-sm text-foreground","data-testid":"template-name",children:t.name}),(0,r.jsxs)("div",{className:"flex gap-2",children:[(0,r.jsx)(l.$n,{variant:"secondary",size:"sm",onClick:()=>{y(t.id),w(t.name),k(t.content)},"data-testid":"edit-button-".concat(t.id),children:e("template.edit")}),(0,r.jsx)(l.$n,{variant:"danger",size:"sm",onClick:()=>E(t.id),"data-testid":"delete-button-".concat(t.id),children:e("template.delete")})]})]}),(0,r.jsx)("p",{className:"text-xs text-muted-foreground whitespace-pre-wrap","data-testid":"template-content",children:t.content})]})},t.id))})]}),a.length<u.$h&&(0,r.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg shadow-sm","data-testid":"create-form",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-foreground mb-3",children:e("template.newHeading")}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsx)(l.pd,{type:"text",value:p,onChange:e=>x(e.target.value),maxLength:u.Nb,placeholder:e("template.namePlaceholder"),"data-testid":"new-name-input"}),(0,r.jsx)(l.k_,{value:h,onChange:e=>f(e.target.value),maxLength:u.bm,rows:3,placeholder:e("template.contentPlaceholder"),className:"resize-y","data-testid":"new-content-input"}),(0,r.jsx)(l.$n,{variant:"primary",onClick:P,disabled:g||!p.trim()||!h.trim(),"data-testid":"create-button",children:g?e("template.creating"):e("template.create")})]})]})]})}let E=[{value:"review",labelKey:"tabs.review"},{value:"report",labelKey:"tabs.report"},{value:"template",labelKey:"tabs.template"}];function A(){let e=(0,s.c)("review"),[t,a]=(0,n.useState)("review");return(0,r.jsxs)("div",{className:"container-custom py-8 overflow-auto h-full",children:[(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2",children:e("page.title")}),(0,r.jsx)("p",{className:"text-sm text-muted-foreground",children:e("page.description")})]}),(0,r.jsxs)(l.tU,{value:t,onValueChange:e=>a(e),children:[(0,r.jsx)(l.j7,{className:"mb-6 w-full justify-start","data-testid":"page-tabs",children:E.map(t=>(0,r.jsx)(l.Xi,{value:t.value,"data-testid":"page-tab-".concat(t.value),children:e(t.labelKey)},t.value))}),(0,r.jsx)(l.av,{value:"review",children:(0,r.jsx)(n.Suspense,{fallback:null,children:(0,r.jsx)(j,{})})}),(0,r.jsx)(l.av,{value:"report",children:(0,r.jsx)(P,{})}),(0,r.jsx)(l.av,{value:"template",children:(0,r.jsx)(_,{})})]})]})}},20063:(e,t,a)=>{"use strict";var r=a(47260);a.o(r,"useParams")&&a.d(t,{useParams:function(){return r.useParams}}),a.o(r,"usePathname")&&a.d(t,{usePathname:function(){return r.usePathname}}),a.o(r,"useRouter")&&a.d(t,{useRouter:function(){return r.useRouter}}),a.o(r,"useSearchParams")&&a.d(t,{useSearchParams:function(){return r.useSearchParams}})},44308:(e,t,a)=>{"use strict";a.d(t,{$h:()=>u,DR:()=>n,IH:()=>d,Iu:()=>r,Nb:()=>m,SD:()=>s,_d:()=>o,bm:()=>p,ks:()=>i,t7:()=>c,z7:()=>l});let r=7e3,n=["in_review","approval","stalled"],s="in_review",l="filter",i="/review?".concat(l,"=approval");function o(e){return e&&n.includes(e)?e:null}let d=["claude","codex","copilot","antigravity","opencode"],c=1e3,u=5,m=100,p=1e3},46892:(e,t,a)=>{"use strict";a.d(t,{PL:()=>n,sb:()=>s});let r={idle:"bg-muted-foreground",ready:"bg-success",spinner:"border-info",waiting:"bg-warning"},n={idle:{className:r.idle,labelKey:"status.idle",type:"dot"},ready:{className:r.ready,labelKey:"status.ready",type:"dot"},running:{className:r.spinner,labelKey:"status.running",type:"spinner"},waiting:{className:r.waiting,labelKey:"status.waiting",type:"dot"},generating:{className:r.spinner,labelKey:"status.generating",type:"spinner"}},s={idle:"detailStatus.idle",ready:"detailStatus.ready",running:"detailStatus.running",waiting:"detailStatus.waiting"}},60322:(e,t,a)=>{"use strict";a.d(t,{l:()=>n});let r=/\x1b\[[0-9;]*[a-zA-Z]|\x1b\][^\x07]*\x07|\[[0-9;]*m/g;async function n(e){var t;if(!e||0===e.trim().length)return;let a=e.replace(r,"");if(null==(t=navigator.clipboard)?void 0:t.writeText)try{await navigator.clipboard.writeText(a);return}catch(e){}let n=document.createElement("textarea");n.value=a,n.style.position="fixed",n.style.left="-9999px",n.style.top="-9999px",n.style.opacity="0",document.body.appendChild(n),n.focus(),n.select();try{document.execCommand("copy")}finally{document.body.removeChild(n)}}},76471:(e,t,a)=>{"use strict";a.d(t,{Ej:()=>c,Jd:()=>i,Mq:()=>d,rH:()=>o});var r=a(95155),n=a(12115),s=a(18955),l=a(48481);let i="bg-transparent border-2 border-muted-foreground",o="status.unknown";function d(e,t){return!0===t&&"ready"===e}let c=(0,n.memo)(function(e){let{status:t,label:a,waitingKind:n,unclassified:c}=e,u=(0,s.c)("common"),m=d(t,c);return(0,r.jsx)(l.m,{"data-testid":"status-indicator",status:t,label:m?null!=a?a:u(o):a,waitingKind:n,size:"lg",className:m?i:void 0,"data-unclassified":m?"true":void 0})})},80488:(e,t,a)=>{Promise.resolve().then(a.bind(a,17442))}},e=>{e.O(0,[6809,4909,2770,2619,8407,5449,8606,8441,1255,7358],()=>e(e.s=80488)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8898],{9219:(e,t,s)=>{"use strict";s.d(t,{k:()=>l});var n=s(95155),a=s(12115),i=s(48407),r=s(87531);function l(e){let{onRefresh:t,enabled:s=!0,className:l,children:o}=e,{containerRef:c,pullDistance:d,isRefreshing:u,isPulling:m}=function(e){let{onRefresh:t,enabled:s=!0,threshold:n=64,maxPull:i=96,resistance:r=.5}=e,l=(0,a.useRef)(null),[o,c]=(0,a.useState)(0),[d,u]=(0,a.useState)(!1),[m,h]=(0,a.useState)(!1),x=(0,a.useRef)(null),f=(0,a.useRef)(0),g=(0,a.useRef)(!1);g.current=d;let p=(0,a.useCallback)(()=>{x.current=null,f.current=0,c(0),h(!1)},[]),b=(0,a.useCallback)(e=>{if(!s||g.current)return;let t=l.current;t&&!(t.scrollTop>0)&&(x.current=e.touches[0].clientY,f.current=0)},[s]),v=(0,a.useCallback)(e=>{if(null===x.current)return;let t=l.current;if(!t)return;if(t.scrollTop>0)return void p();let s=e.touches[0].clientY-x.current;if(s<=0){0!==f.current&&(f.current=0,c(0),h(!1));return}e.cancelable&&e.preventDefault();let n=Math.min(s*r,i);f.current=n,c(n),h(!0)},[r,i,p]),y=(0,a.useCallback)(async()=>{u(!0),h(!1),c(n);try{await Promise.resolve(t())}finally{u(!1),c(0)}},[t,n]),w=(0,a.useCallback)(()=>{if(null===x.current)return;let e=f.current>=n&&!g.current;x.current=null,f.current=0,e?y():(c(0),h(!1))},[n,y]);return(0,a.useEffect)(()=>{let e=l.current;if(e)return e.addEventListener("touchstart",b,{passive:!0}),e.addEventListener("touchmove",v,{passive:!1}),e.addEventListener("touchend",w,{passive:!0}),e.addEventListener("touchcancel",w,{passive:!0}),()=>{e.removeEventListener("touchstart",b),e.removeEventListener("touchmove",v),e.removeEventListener("touchend",w),e.removeEventListener("touchcancel",w)}},[b,v,w]),{containerRef:l,pullDistance:o,isRefreshing:d,isPulling:m}}({onRefresh:t,enabled:s,threshold:64}),h=u||d>0,x=u?1:Math.min(d/64,1);return(0,n.jsxs)("div",{ref:c,className:(0,r.cn)("relative overflow-auto",l),style:{overscrollBehaviorY:"contain"},"data-testid":"pull-to-refresh",children:[(0,n.jsx)("div",{className:"pointer-events-none absolute inset-x-0 top-0 z-10 flex justify-center",style:{transform:"translateY(".concat(h?Math.max(d-24,8):-32,"px)"),opacity:x,transition:m?"none":"transform 0.2s ease-out, opacity 0.2s ease-out"},"data-testid":"pull-to-refresh-indicator",role:"status","aria-hidden":!u,children:(0,n.jsx)(i.y$,{size:"sm",variant:"accent"})}),(0,n.jsx)("div",{style:{transform:h?"translateY(".concat(d,"px)"):void 0,transition:m?"none":"transform 0.2s ease-out"},children:o})]})}},75676:(e,t,s)=>{"use strict";s.d(t,{jg:()=>i,kQ:()=>r,mR:()=>c,mS:()=>o,wf:()=>n});let n="terminal",a=new Set(["terminal","chat"]);function i(e){return"string"==typeof e&&a.has(e)}let r={data:null,messageId:null,visible:!1,answering:!1},l={mode:"split",mobileActivePane:"terminal",leftPaneTab:"history",splitRatio:.5,leftPaneCollapsed:!1,activityBar:{active:"files"},historyPane:{visible:!0,width:25,collapsed:!1}},o={type:null,message:null,retryable:!1,retryCount:0};function c(){return{phase:"idle",prompt:{...r},layout:{...l},error:{...o},messages:[],wsConnected:!1}}},80003:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});let n=(0,s(71847).A)("list",[["path",{d:"M3 5h.01",key:"18ugdj"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 19h.01",key:"noohij"}],["path",{d:"M8 5h13",key:"1pao27"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 19h13",key:"m83p4d"}]])},87047:(e,t,s)=>{Promise.resolve().then(s.bind(s,89569))},89569:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>ec});var n=s(95155),a=s(12115),i=s(52619),r=s.n(i),l=s(18955),o=s(20562),c=s(8803),d=s(9219),u=s(37586),m=s(22479),h=s(54485),x=s(29260),f=s(83051),g=s(14006),p=s(73333),b=s(2954),v=s(48407),y=s(32771),w=s(308),j=s(80635),k=s(52407);function N(){let{signals:e}=(0,k.Fx)();return(0,a.useMemo)(()=>({offline:(0,k.sV)(e),reachable:(0,k._X)(e)}),[e])}var A=s(66966);let C=Object.freeze({enabled:!1,expiresAt:null});var M=s(81507),S=s(2317),I=s(75676),L=s(63881),P=s(8355),E=s(80344),T=s(38606),R=s(76471),_=s(54014),D=s(55449),z=s(67149),F=s(68394);let U=[{mode:"chat",labelKey:"surfaceMode.showChat",icon:u.A},{mode:"terminal",labelKey:"surfaceMode.showTerminal",icon:m.A}];function K(e){return"flex h-7 w-7 shrink-0 items-center justify-center rounded transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring ".concat(e?"bg-accent-500/15 text-accent-600 dark:text-accent-400":"text-muted-foreground hover:bg-muted hover:text-foreground")}let B=()=>{},O=(0,a.memo)(function(e){return e.connectivity?(0,n.jsx)(Y,{...e,connectivity:e.connectivity}):(0,n.jsx)(H,{...e})});function H(e){let t=N();return(0,n.jsx)(Y,{...e,connectivity:t})}function Y(e){var t,s,i,o,c,d,u;let{worktree:m,enabled:k,connectivity:N,className:O=""}=e,H=(0,l.c)("common"),Y=(0,l.c)("worktree"),V=(0,a.useMemo)(()=>{var e;return m.agentInstances&&m.agentInstances.length>0?m.agentInstances:(0,_.lu)(null!=(e=m.selectedAgents)?e:(0,D.sA)())},[m]),[q,W]=(0,a.useState)(null),J=null!=(s=V.find(e=>e.id===q))?s:V[0],Q=null==J?void 0:J.id,G=null!=(i=null==J?void 0:J.cliTool)?i:"claude",X=null!=Q?Q:G,{surfaceMode:$,setSurfaceMode:Z}=function(e){let{value:t,setValue:s}=(0,S.V)({key:"".concat("commandmate.sessions.tileSurfaceMode-").concat(e),defaultValue:"chat",validate:I.jg,serialize:e=>e,deserialize:e=>e});return{surfaceMode:t,setSurfaceMode:(0,a.useCallback)(e=>s(e),[s])}}(m.id),{visible:ee,toggle:et}=(0,M.TG)(M.jt),es="terminal"===$,en=es&&ee,[ea,ei]=(0,a.useState)(null),[er,el]=(0,a.useState)(null),eo=(0,L.b4)(ea,er,240),{terminal:ec,prompt:ed,refresh:eu,setAutoScroll:em}=(0,y.NK)({worktreeId:m.id,cliToolId:G,instanceId:Q,enabled:k,cadence:z.sD}),{messages:eh,isLoading:ex,refresh:ef}=(0,w.Md)({worktreeId:m.id,cliToolId:G,instanceId:Q,enabled:k&&(!es||ee),cadence:z.WT}),eg=(0,a.useCallback)((e,t)=>E.y.sendMessage(m.id,e,t),[m.id]),{messages:ep,sendOptimistic:eb,retry:ev,discard:ey}=(0,j.v4)({worktreeId:m.id,serverMessages:eh,sendFn:eg,onSent:ef,connectivity:N}),ew=(0,a.useMemo)(()=>(function(e,t){let s=e=>{var s;return void 0!==e.optimisticState&&(null!=(s=e.instanceId)?s:e.cliToolId)!==t};return e.some(s)?e.filter(e=>!s(e)):e})(ep,X),[ep,X]),[ej,ek]=(0,a.useState)(null),eN=(0,a.useCallback)(()=>ek(null),[]),eA=(0,a.useCallback)(e=>{let t=ey(e);t&&ek(t)},[ey]),eC=(0,a.useCallback)(()=>{eu()},[eu]),eM=function(e){var t;let{worktree:s,cliToolId:n,instanceId:i}=e,r=null==(t=(0,A.rC)())?void 0:t.refresh,l=s.id,o=(0,a.useMemo)(()=>(function(e,t){var s;let n=null==(s=e.autoYesByInstance)?void 0:s[t];return n&&!0===n.enabled?{enabled:!0,expiresAt:"number"==typeof n.expiresAt?n.expiresAt:null}:C})(s,i),[s,i]),[c,d]=(0,a.useState)(null),u=(0,a.useRef)(s);u.current=s;let m=null===c||c.instanceId!==i||function(e,t,s){let n=t.enabled===e.value.enabled&&(!t.enabled||t.expiresAt===e.value.expiresAt),a=null!==e.settledRow&&s!==e.settledRow;return n||a}(c,o,s)?null:c;(0,a.useEffect)(()=>{null!==c&&null===m&&d(null)},[c,m]);let h=(0,a.useCallback)(async e=>{let t;try{let s=await fetch("/api/worktrees/".concat(encodeURIComponent(l),"/auto-yes"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:e.enabled,cliToolId:n,instanceId:i,duration:e.duration,stopPattern:e.stopPattern})});if(!s.ok)return;let a=await s.json(),r=!0===a.enabled;t={enabled:r,expiresAt:r&&"number"==typeof a.expiresAt?a.expiresAt:null}}catch(e){return}let s={instanceId:i,value:t,settledRow:null};d(s);try{await (null==r?void 0:r())}catch(e){}d(e=>e===s?{...s,settledRow:u.current}:e)},[l,n,i,r]),x=m?m.value:o;return{enabled:x.enabled,expiresAt:x.expiresAt,toggle:h}}({worktree:m,cliToolId:G,instanceId:X}),eS=(0,a.useMemo)(()=>({isRunning:ec.isRunning,attaching:ec.attaching,sessionStatus:ec.sessionStatus,isThinking:ec.isThinking,isPromptWaiting:ed.visible,promptData:ed.data,isSelectionListActive:ec.isSelectionListActive,isPagerActive:ec.isPagerActive,isDismissablePanelActive:ec.isDismissablePanelActive,isUnclassifiedActive:ec.isUnclassifiedActive}),[ec.isRunning,ec.attaching,ec.sessionStatus,ec.isThinking,ec.isSelectionListActive,ec.isPagerActive,ec.isDismissablePanelActive,ec.isUnclassifiedActive,ed.visible,ed.data]),eI=(0,a.useCallback)(e=>Z(e),[Z]),eL=(0,a.useMemo)(()=>({isLoading:ex,onRetryPending:ev,onDiscardPending:eA,onInsertToMessage:ek}),[ex,ev,eA]),{compactTuiLayoutPadding:eP,preservePaintedPanelRows:eE}=(0,a.useMemo)(()=>(0,F.EK)(G),[G]),eT="opencode"===G||"copilot"===G,eR=(u=m.id,"session-tile-history-".concat(u)),e_=(0,a.useCallback)(e=>{W(e.target.value)},[]),eD=null!=(o=m.branch)?o:m.name,ez=null!=(c=m.repositoryDisplayName)?c:m.repositoryName,eF=Q?null==(t=m.sessionStatusByInstance)?void 0:t[Q]:void 0,eU=(0,T.kA)(eF),eK=(0,R.Mq)(eU,(0,T.px)(eF));return(0,n.jsxs)("section",{className:"flex h-full min-w-0 flex-col overflow-hidden rounded-lg border border-border bg-surface shadow-sm ".concat(O),"data-testid":"session-tile-".concat(m.id),"data-enabled":k?"true":"false","aria-label":H("sessions.tileAriaLabel",{branch:eD}),children:[(0,n.jsxs)("header",{className:"flex shrink-0 items-center gap-2 border-b border-border px-3 py-2",children:[(0,n.jsx)(v.md,{status:eU,size:"sm",label:H(eK?R.rH:"status.".concat(eU)),className:eK?R.Jd:void 0,"data-unclassified":eK?"true":void 0}),(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"truncate text-xs text-muted-foreground",children:ez}),(0,n.jsx)(r(),{href:"/worktrees/".concat(m.id),className:"block truncate text-sm font-medium text-foreground underline-offset-2 hover:text-accent-600 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring dark:hover:text-accent-400","data-testid":"session-tile-branch-".concat(m.id),title:eD,children:eD})]}),V.length>1&&(0,n.jsx)("select",{value:null!=(d=null==J?void 0:J.id)?d:"",onChange:e_,className:"max-w-[9rem] shrink-0 rounded-md border border-border bg-surface px-2 py-1 text-xs text-muted-foreground transition-colors hover:text-foreground focus:outline-none focus:ring-2 focus:ring-ring","data-testid":"session-tile-instance-".concat(m.id),"aria-label":H("sessions.tileInstanceAriaLabel"),children:V.map(e=>(0,n.jsx)("option",{value:e.id,children:(0,_.sw)(e)},e.id))}),es&&(0,n.jsx)("button",{type:"button",onClick:et,"aria-pressed":ee,"aria-expanded":ee,"aria-controls":eR,"aria-label":ee?Y("terminal.hideHistory"):Y("terminal.showHistory"),title:ee?Y("terminal.hideHistory"):Y("terminal.showHistory"),className:K(ee),"data-testid":"session-tile-history-toggle-".concat(m.id),children:(0,n.jsx)(h.A,{size:14,"aria-hidden":"true"})}),(0,n.jsx)("div",{role:"group","aria-label":Y("surfaceMode.groupLabelMobile"),className:"flex shrink-0 items-center gap-0.5 rounded-md border border-border p-0.5","data-testid":"session-tile-surface-mode-".concat(m.id),children:U.map(e=>{let{mode:t,labelKey:s,icon:a}=e,i=$===t,r=Y(s);return(0,n.jsx)("button",{type:"button",onClick:()=>Z(t),"aria-pressed":i,"aria-label":r,title:r,className:K(i),"data-testid":"session-tile-surface-".concat(t,"-").concat(m.id),children:(0,n.jsx)(a,{size:14,"aria-hidden":"true"})},t)})})]}),(0,n.jsx)("div",{ref:ei,className:"min-w-0 flex-1 overflow-hidden ".concat("min-h-[15rem]"),"data-testid":"session-tile-body-".concat(m.id),children:k&&es?(0,n.jsxs)("div",{className:"flex h-full min-h-0 min-w-0 flex-col","data-testid":"session-tile-terminal-stack-".concat(m.id),children:[(0,n.jsx)("div",{className:"relative min-w-0 overflow-hidden ".concat(en?"flex-[3_3_0%] min-h-[8.5rem]":"min-h-0 flex-1"),"data-testid":"session-tile-terminal-".concat(m.id),children:(0,n.jsx)(g.D,{output:ec.output,isActive:ec.isRunning,attaching:ec.attaching,isThinking:ec.isThinking,autoScroll:ec.autoScroll,onScrollChange:em,disableAutoFollow:eT,compactTuiLayoutPadding:eP,preservePaintedPanelRows:eE,wrapMode:F.Wq.wrapMode,density:F.Wq.density})}),en&&(0,n.jsx)("div",{id:eR,className:"min-w-0 overflow-hidden border-t border-border ".concat("flex-[2_2_0%] min-h-[6.5rem]"),"data-testid":"session-tile-history-".concat(m.id),children:(0,n.jsx)(f.bl,{messages:ew,worktreeId:m.id,worktreePath:m.path,cliToolId:G,isLoading:ex,onFilePathClick:B,onInsertToMessage:ek,onRetryPending:ev,onDiscardPending:eA,className:"h-full"})})]}):k?(0,n.jsx)(x.wY,{messages:ew,worktreeId:m.id,worktreePath:m.path,cliToolId:G,instanceId:Q,live:eS,frame:ec.output,onKeysSent:eu,onSurfaceModeChange:eI,compact:!0,history:eL}):(0,n.jsx)("div",{className:"h-full","data-testid":"session-tile-placeholder-".concat(m.id),"aria-hidden":"true"})}),k&&(0,n.jsx)("div",{ref:el,className:"shrink-0 border-t border-border p-2","data-testid":"session-tile-composer-".concat(m.id),children:(0,n.jsx)(p.E,{worktreeId:m.id,cliToolId:G,instanceId:X,isSessionRunning:ec.isRunning,onOptimisticSend:eb,onMessageSent:eC,pendingInsertText:ej,onInsertConsumed:eN,heightScope:P.CM,maxHeight:eo,autoYesSlot:(0,n.jsx)(b.T,{enabled:eM.enabled,expiresAt:eM.expiresAt,onToggle:eM.toggle,lastAutoResponse:null,cliToolName:G,inline:!0})})})]})}let V=(0,a.memo)(function(e){let{worktree:t,connectivity:s}=e,{ref:i,inViewport:r}=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{rootMargin:t,threshold:s}=e,[n,i]=(0,a.useState)(!1),[r,l]=(0,a.useState)(null),o=(0,a.useCallback)(e=>{l(e)},[]);return(0,a.useEffect)(()=>{if("undefined"==typeof IntersectionObserver)return void i(!0);if(!r)return;let e=new IntersectionObserver(e=>{let t=e[e.length-1];t&&i(t.isIntersecting)},{rootMargin:t,threshold:s});return e.observe(r),()=>e.disconnect()},[r,t,s]),{ref:o,inViewport:n}}({rootMargin:"560px"});return(0,n.jsx)("div",{ref:i,className:"min-w-0 ".concat("h-[35rem]"),children:(0,n.jsx)(O,{worktree:t,enabled:r,connectivity:s})})}),q=(0,a.memo)(function(e){let{worktrees:t}=e,s=N();return(0,n.jsx)("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-2","data-testid":"sessions-tile-grid",children:t.map(e=>(0,n.jsx)(V,{worktree:e,connectivity:s},e.id))})});var W=s(80003);let J=(0,s(71847).A)("layout-grid",[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]]),Q=["list","tile"];function G(e){return"string"==typeof e&&Q.includes(e)}let X=[{mode:"list",labelKey:"sessions.viewMode.list",icon:W.A},{mode:"tile",labelKey:"sessions.viewMode.tile",icon:J}],$=(0,a.memo)(function(e){let{value:t,onChange:s}=e,a=(0,l.c)("common");return(0,n.jsx)("div",{className:"flex shrink-0 items-center gap-1 rounded-md border border-input bg-surface p-0.5",role:"group","aria-label":a("sessions.viewMode.groupAriaLabel"),"data-testid":"sessions-view-mode",children:X.map(e=>{let{mode:i,labelKey:r,icon:l}=e,o=t===i;return(0,n.jsx)("button",{type:"button",onClick:()=>s(i),"aria-pressed":o,"aria-label":a(r),title:a(r),"data-testid":"sessions-view-mode-".concat(i),className:"rounded p-1.5 transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring ".concat(o?"bg-accent-100 text-accent-700 dark:bg-accent-900/30 dark:text-accent-400":"text-muted-foreground hover:text-foreground"),children:(0,n.jsx)(l,{size:16,"aria-hidden":"true"})},i)})})});var Z=s(38218),ee=s(50857),et=s(7636),es=s(83012);let en=[{key:"repositoryName",labelKey:"sort.repositoryName"},{key:"status",labelKey:"sort.status"},{key:"lastSent",labelKey:"sort.lastSent"}],ea={lastSent:"desc",updatedAt:"desc"},ei={ready:0,in_progress:1,in_review:2,done:3};function er(e){let{status:t,label:s,unclassified:a}=e,i=(0,l.c)("common"),r=(0,R.Mq)(t,a),o="".concat(s,": ").concat(i(r?R.rH:"status.".concat(t)));return(0,n.jsx)(v.md,{status:t,size:"md",label:o,className:r?R.Jd:void 0,"data-unclassified":r?"true":void 0})}let el={ready:"worktreeStatus.ready",in_progress:"worktreeStatus.inProgress",in_review:"worktreeStatus.inReview",done:"worktreeStatus.done"},eo={done:"bg-success-subtle text-success-foreground",in_review:"bg-info-subtle text-info-foreground",in_progress:"bg-accent-100 dark:bg-accent-900/30 text-accent-700 dark:text-accent-400"};function ec(){let e=(0,l.c)("common"),t=(0,l.c)("worktree"),s=(0,Z.a)(),{worktrees:i,isLoading:u,error:m,refresh:h}=(0,A.Fn)(),x=i.length>0,[f,g]=(0,a.useState)(""),[p,b]=(0,a.useState)("lastSent"),[y,w]=(0,a.useState)("desc"),{viewMode:j,setViewMode:k}=function(){let{value:e,setValue:t}=(0,S.V)({key:"mcbd-sessions-view-mode",defaultValue:"list",validate:G,serialize:e=>e,deserialize:e=>e});return{viewMode:e,setViewMode:(0,a.useCallback)(e=>t(e),[t])}}(),N="tile"===j;(0,a.useEffect)(()=>{(0,D.qD)()},[]);let C=(0,a.useMemo)(()=>{let e=i;if(f){let t=f.toLowerCase();e=e.filter(e=>{var s,n;return e.name.toLowerCase().includes(t)||e.repositoryName.toLowerCase().includes(t)||null!=(n=null==(s=e.repositoryDisplayName)?void 0:s.toLowerCase().includes(t))&&n})}let t=[...e];return t.sort((e,t)=>{var s,n,a,i,r,l,o,c;let d=0;switch(p){case"lastSent":{let s=(0,et.nO)(e.lastUserMessageAt,t.lastUserMessageAt);if(!e.lastUserMessageAt&&!t.lastUserMessageAt)return 0;if(!e.lastUserMessageAt)return 1;if(!t.lastUserMessageAt)return -1;d=s;break}case"repositoryName":{let a=(null!=(s=e.repositoryDisplayName)?s:e.repositoryName).toLowerCase(),i=(null!=(n=t.repositoryDisplayName)?n:t.repositoryName).toLowerCase();0===(d=a.localeCompare(i))&&(d=e.name.toLowerCase().localeCompare(t.name.toLowerCase()));break}case"status":if(0==(d=(null!=(i=ei[null!=(a=e.status)?a:""])?i:4)-(null!=(l=ei[null!=(r=t.status)?r:""])?l:4))){let s=(null!=(o=e.repositoryDisplayName)?o:e.repositoryName).toLowerCase(),n=(null!=(c=t.repositoryDisplayName)?c:t.repositoryName).toLowerCase();d=s.localeCompare(n)}break;default:d=0}return("lastSent"===p?"desc"===y:"asc"===y)?d:-d}),t},[i,f,p,y]),M=(0,a.useCallback)(e=>{g(e.target.value)},[]),I=(0,a.useCallback)(e=>{var t;b(e),w(null!=(t=ea[e])?t:"asc")},[]),L=(0,a.useCallback)(()=>{w(e=>"asc"===e?"desc":"asc")},[]);return(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)(d.k,{onRefresh:h,enabled:s,className:"".concat(N?"w-full px-4 sm:px-6 lg:px-8":"container-custom"," py-8 h-full"),children:[(0,n.jsxs)("div",{className:"mb-6",children:[(0,n.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2",children:e("sessions.title")}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground",children:e("sessions.description")})]}),(0,n.jsxs)("div",{className:"mb-6 flex items-center gap-3",children:[(0,n.jsx)(v.pd,{type:"text",placeholder:e("sessions.filterPlaceholder"),value:f,onChange:M,className:"max-w-md flex-1","data-testid":"sessions-filter","aria-label":e("sessions.filterAriaLabel"),inputMode:"search",enterKeyHint:"search"}),(0,n.jsxs)(v.l6,{value:p,onValueChange:I,children:[(0,n.jsx)(v.bq,{className:"w-40","data-testid":"sessions-sort-select","aria-label":e("sessions.sortByAriaLabel"),children:(0,n.jsx)(v.yv,{})}),(0,n.jsx)(v.gC,{children:en.map(t=>(0,n.jsx)(v.eb,{value:t.key,children:e(t.labelKey)},t.key))})]}),(0,n.jsx)("button",{type:"button",onClick:L,"data-testid":"sessions-sort-direction","aria-label":"asc"===y?e("sessions.sortAscending"):e("sessions.sortDescending"),className:"rounded-md border border-input bg-surface p-2 text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",children:"asc"===y?(0,n.jsx)(o.A,{size:16,"aria-hidden":"true"}):(0,n.jsx)(c.A,{size:16,"aria-hidden":"true"})}),(0,n.jsx)($,{value:j,onChange:k})]}),x?(0,n.jsxs)(n.Fragment,{children:[m&&(0,n.jsx)("div",{className:"mb-4 rounded-md border border-danger-border bg-danger-subtle px-3 py-2 text-sm text-danger-foreground",role:"status","data-testid":"sessions-error-banner",children:e("sessions.refreshError",{message:m.message})}),N?0===C.length?(0,n.jsx)("div",{className:"text-muted-foreground py-8 text-center","data-testid":"sessions-empty",children:e("sessions.noMatching")}):(0,n.jsx)(q,{worktrees:C}):(0,n.jsx)("div",{className:"space-y-2","data-testid":"sessions-list",children:0===C.length?(0,n.jsx)("div",{className:"text-muted-foreground py-8 text-center","data-testid":"sessions-empty",children:e("sessions.noMatching")}):C.map((s,a)=>{var i,l,o,c;let d=null!=(i=s.selectedAgents)?i:(0,D.sA)(),u=s.lastUserMessage?s.lastUserMessage.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x9F]/g,"").replace(/[\u200B-\u200F\u2028-\u202F\uFEFF\u061C]/g,"").replace(/[\r\n\t]/g," ").replace(/\s+/g," ").trim():null,m=s.lastUserMessageAt?(0,es.Fx)(String(s.lastUserMessageAt)):null,h=d.map(e=>{var t;let n=null==(t=s.sessionStatusByCli)?void 0:t[e];return{agent:e,status:(0,T.kA)(n),unclassified:(0,T.px)(n)}}),x=h.filter(e=>(0,ee.Qo)(e.status)||e.unclassified),f=h.length-x.length,g=d.some(e=>{var t;let n=(0,T.kA)(null==(t=s.sessionStatusByCli)?void 0:t[e]);return"running"===n||"generating"===n});return(0,n.jsxs)(r(),{href:"/worktrees/".concat(s.id),style:{animationDelay:function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:40,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10;if(Number.isFinite(e)&&!(e<=0)&&!(e>=s))return"".concat(e*t,"ms")}(a)},className:"block bg-surface rounded-lg p-4 border transition-colors ".concat(g?"border-accent-500/40 shadow-[0_0_16px_-4px_rgb(var(--accent-500)/0.45)] hover:border-accent-400":"border-border shadow-sm hover:border-accent-300 dark:hover:border-accent-700"," ").concat("animate-in fade-in-0 slide-in-from-bottom-2 fill-mode-backwards duration-300"),"data-testid":"session-item-".concat(s.id),children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:null!=(l=s.repositoryDisplayName)?l:s.repositoryName}),(0,n.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:s.name})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2 ml-4 flex-shrink-0","data-testid":"session-agents-".concat(s.id),children:[x.map(e=>{let{agent:t,status:s,unclassified:a}=e;return(0,n.jsxs)("div",{className:"flex items-center gap-1","data-testid":"session-agent-".concat(t),children:[(0,n.jsx)(er,{status:s,label:(0,_.oo)(t),unclassified:a}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:(0,_.oo)(t)})]},t)}),f>0&&(0,n.jsxs)("div",{className:"flex items-center gap-1","data-testid":"session-idle-cluster-".concat(s.id),"aria-label":e("sessions.idleAgents",{count:f}),children:[(0,n.jsx)(v.md,{status:"idle",size:"sm","aria-hidden":!0,title:void 0}),(0,n.jsxs)("span",{className:"text-xs text-muted-foreground tabular-nums",children:["+",f]})]})]})]}),s.description&&(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)("p",{className:"text-xs text-muted-foreground line-clamp-2 whitespace-pre-wrap",children:s.description})}),s.status&&(0,n.jsx)("div",{className:"mt-2",children:(0,n.jsx)("span",{className:"px-2 py-0.5 text-xs font-medium rounded ".concat(null!=(c=eo[null!=(o=s.status)?o:""])?c:"bg-muted text-muted-foreground"),children:function(e,t){if(!e)return"";let s=el[e];return s?t(s):e}(s.status,t)})}),u&&(0,n.jsxs)("div",{className:"mt-2 flex items-center gap-2","data-testid":"session-message-".concat(s.id),children:[(0,n.jsx)("span",{className:"text-xs text-muted-foreground truncate min-w-0 flex-1","data-testid":"session-message-text-".concat(s.id),title:u,children:u}),m&&(0,n.jsx)("span",{className:"text-xs text-muted-foreground flex-shrink-0 whitespace-nowrap tabular-nums","data-testid":"session-time-".concat(s.id),children:m})]})]},s.id)})})]}):(0,n.jsxs)(n.Fragment,{children:[u&&(0,n.jsx)("div",{className:"space-y-2","data-testid":"sessions-loading",role:"status","aria-label":e("sessions.loadingAriaLabel"),children:[0,1,2].map(e=>(0,n.jsxs)("div",{className:"block bg-surface rounded-lg p-4 border border-border shadow-sm",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1 space-y-1.5",children:[(0,n.jsx)(v.EA,{className:"h-4 w-40 max-w-full"}),(0,n.jsx)(v.EA,{className:"h-3 w-56 max-w-full"})]}),(0,n.jsx)(v.EA,{className:"ml-4 h-3 w-16 flex-shrink-0"})]}),(0,n.jsxs)("div",{className:"mt-3 flex items-center gap-2",children:[(0,n.jsx)(v.EA,{className:"h-3 min-w-0 flex-1"}),(0,n.jsx)(v.EA,{className:"h-3 w-10 flex-shrink-0"})]})]},e))}),!u&&m&&(0,n.jsx)("div",{className:"text-danger-foreground","data-testid":"sessions-error",children:e("sessions.loadError",{message:m.message})}),!u&&!m&&(0,n.jsx)("div",{className:"text-muted-foreground py-8 text-center","data-testid":"sessions-empty",children:f?e("sessions.noMatching"):e("sessions.empty")})]})]})})}}},e=>{e.O(0,[6809,4909,2770,2619,8566,6322,3778,8407,2407,344,5449,6966,8606,4768,2039,7705,8441,1255,7358],()=>e(e.s=87047)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9404],{54014:(e,t,s)=>{"use strict";s.d(t,{Ab:()=>a,NL:()=>p,O6:()=>u,XH:()=>l,f_:()=>m,hR:()=>o,lu:()=>g,n6:()=>r,oo:()=>c,pQ:()=>i,sw:()=>x,vz:()=>h});let l=["claude","codex","gemini","vibe-local","opencode","copilot","antigravity","command-code"],a=10,i=50,n=/^[a-zA-Z0-9_-]+$/;function r(e){return"string"==typeof e&&e.length>0&&e.length<=64&&n.test(e)}let d={claude:"Claude",codex:"Codex",gemini:"Gemini","vibe-local":"Vibe Local",opencode:"OpenCode",copilot:"Copilot",antigravity:"Antigravity","command-code":"Command Code"};function o(e){return l.includes(e)}function c(e){var t;return null!=(t=d[e])?t:e}function m(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Assistant";return e&&o(e)?c(e):t}function x(e){let t=e.alias;return"string"==typeof t&&t.trim().length>0?t:c(e.cliTool)}function u(e,t,s){let l=e.find(e=>e.id===t);return l?x(l):c(s)}function g(e){return e.map((e,t)=>({id:e,cliTool:e,alias:c(e),order:t}))}let h=128,p=2097152},68331:(e,t,s)=>{"use strict";s.d(t,{y:()=>r});var l=s(95155);s(12115);var a=s(18955),i=s(37381),n=s(95584);function r(e){let{catalog:t}=e,s=(0,a.c)("skills");return t.stale||t.offline?(0,l.jsx)(i.u,{tone:"warning","data-testid":"skill-catalog-stale",className:"flex-col sm:flex-row",children:(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("p",{className:"font-medium",children:s("catalog.staleHeading")}),(0,l.jsx)("p",{children:s("catalog.staleNotice")}),t.offline&&(0,l.jsx)("p",{children:s("catalog.offlineNotice")}),(0,l.jsx)("p",{children:s((0,n.pk)(t.staleReason))}),(0,l.jsxs)("p",{className:"break-words",children:[s("catalog.fetchedAt",{timestamp:t.fetchedAt})," \xb7"," ",s("catalog.revalidatedAt",{timestamp:t.revalidatedAt})]}),(0,l.jsx)("p",{className:"break-words",children:s("catalog.sourceLabel",{repository:t.source.repository,ref:t.source.ref})})]})}):(0,l.jsxs)("p",{"data-testid":"skill-catalog-fresh",className:"text-xs text-muted-foreground break-words",children:[s("catalog.freshLabel")," \xb7"," ",s("catalog.revalidatedAt",{timestamp:t.revalidatedAt})," \xb7"," ",s("catalog.sourceLabel",{repository:t.source.repository,ref:t.source.ref})]})}},89675:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>C});var l=s(95155),a=s(20063),i=s(12115),n=s(52619),r=s.n(n),d=s(18955),o=s(35626),c=s(48407),m=s(99648),x=s(75333),u=s(68331),g=s(50825),h=s(24027),p=s(95584);function j(e){let{changelog:t}=e,s=(0,d.c)("skills"),a=(0,p.RG)(t).trim();return 0===a.length?(0,l.jsx)("p",{className:"text-sm text-muted-foreground","data-testid":"skill-changelog-empty",children:s("detail.changelogEmpty")}):(0,l.jsxs)("div",{"data-testid":"skill-changelog",children:[(0,l.jsx)("div",{className:"prose prose-sm max-w-none dark:prose-invert break-words",children:(0,l.jsx)(h.G8,{content:a})}),(0,l.jsx)("p",{className:"mt-2 text-xs text-muted-foreground",children:s("detail.mediaStripped")})]})}var f=s(34380),k=s(37381),b=s(80130);let v={status:"loading",catalog:null,skill:null,failure:null};function N(e){let{label:t,children:s,mono:a=!1}=e;return(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("dt",{className:"text-xs font-medium text-muted-foreground",children:t}),(0,l.jsx)("dd",{className:"mt-0.5 text-sm text-foreground ".concat(a?"break-all font-mono text-xs":"break-words"),children:s})]})}function y(e){let{title:t,children:s,testId:a}=e;return(0,l.jsxs)(c.Zp,{"data-testid":a,className:"space-y-3",children:[(0,l.jsx)("h2",{className:"text-base font-semibold text-foreground",children:t}),s]})}function w(e){var t;let{compatibility:s}=e,a=(0,d.c)("skills");return(0,l.jsx)("p",{className:"text-sm text-foreground","data-testid":"skill-compatibility-reason",children:a((0,p.e5)(s.messageKey),{range:s.requiredRange,currentVersion:null!=(t=s.currentVersion)?t:""})})}function V(e){let{version:t}=e,s=(0,d.c)("skills");return(0,l.jsxs)(c.Zp,{"data-testid":"skill-version-".concat(t.version),className:"space-y-3",padding:"sm",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)("span",{className:"font-mono text-sm font-semibold text-foreground",children:t.version}),t.prerelease&&(0,l.jsx)(c.Ex,{variant:"warning",children:s("detail.prerelease")}),(0,l.jsx)(x.Xz,{status:t.compatibility.commandmate.status}),(0,l.jsx)(x.qW,{risk:t.declaredRisk})]}),(0,l.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,l.jsx)(N,{label:s("detail.publishedAt"),children:t.publishedAt}),(0,l.jsx)(N,{label:s("detail.requiredRangeLabel"),children:t.compatibility.commandmate.requiredRange}),(0,l.jsx)(N,{label:s("detail.sourceRepository"),children:t.source.repository}),(0,l.jsx)(N,{label:s("detail.sourceRef"),children:t.source.ref}),(0,l.jsx)(N,{label:s("detail.sourceCommit"),mono:!0,children:t.source.commit}),(0,l.jsx)(N,{label:s("detail.packageAsset"),mono:!0,children:t.artifact.assetName}),(0,l.jsx)(N,{label:s("detail.packageDigest"),mono:!0,children:t.artifact.sha256}),(0,l.jsx)(N,{label:s("detail.packageSize"),children:s("detail.packageBytes",{bytes:t.artifact.size})})]}),(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.compatibility.agents.length>0?t.compatibility.agents.map(e=>(0,l.jsx)(x.uE,{agent:e},e.agent)):(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:s("compatibility.agentsUnknown")})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-xs font-medium text-muted-foreground",children:s("detail.changelogHeading")}),(0,l.jsx)("div",{className:"mt-1",children:(0,l.jsx)(j,{changelog:t.changelog})})]})]})}function A(e){var t,s,a,n,h,j,A,C,R;let{skillId:I}=e,q=(0,d.c)("skills"),[E,_]=(0,i.useState)(v),[z,H]=(0,i.useState)(0);(0,i.useEffect)(()=>{let e=new AbortController;return _(v),(0,b.Db)(I,e.signal).then(t=>{e.signal.aborted||_(t.ok?{status:"loaded",catalog:t.data.catalog,skill:t.data.skill,failure:null}:{status:"error",catalog:null,skill:null,failure:t.failure})}).catch(()=>{}),()=>e.abort()},[I,z]);let L=(0,i.useCallback)(()=>H(e=>e+1),[]),U=(0,l.jsxs)(r(),{href:"/skills",className:"inline-flex items-center gap-1 text-sm text-accent-600 hover:underline dark:text-accent-400","data-testid":"skill-detail-back",children:[(0,l.jsx)(o.A,{size:14,"aria-hidden":"true"}),q("page.backToCatalog")]});if("loading"===E.status)return(0,l.jsxs)("div",{className:"space-y-4","data-testid":"skill-detail-loading",children:[U,(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:q("state.loading")}),(0,l.jsx)(c.EA,{className:"h-40 w-full rounded-lg"})]});if("error"===E.status||!E.skill){let e=(null==(s=E.failure)?void 0:s.status)===404;return(0,l.jsxs)("div",{className:"space-y-4",children:[U,(0,l.jsxs)(c.Zp,{"data-testid":e?"skill-detail-not-found":"skill-detail-error",className:"space-y-3",children:[(0,l.jsx)("h2",{className:"text-base font-semibold text-foreground",children:q(e?"state.notFoundHeading":"state.errorHeading")}),(0,l.jsxs)(k.u,{tone:"danger",children:[(0,l.jsx)("p",{children:q(e?"state.notFoundNotice":"state.errorNotice")}),(0,l.jsx)("p",{className:"mt-1 break-words",children:q("state.errorCode",{code:null!=(n=null==(a=E.failure)?void 0:a.code)?n:""})})]}),!e&&(0,l.jsx)(c.$n,{variant:"secondary",size:"sm",onClick:L,"data-testid":"skill-detail-retry",children:q("state.retry")})]})]})}let Z=E.skill,F=Z.compatibility,O=null!=(h=Z.versions.find(e=>e.version===Z.recommendedVersion))?h:null,S=null!=(j=null==(t=null!=O?O:Z.versions[0])?void 0:t.declaredRisk)?j:null,W=Z.recommendedVersion?F&&"compatible"!==F.status?q("detail.install.blockedIncompatible",{reason:q((0,p.e5)(F.messageKey),{range:F.requiredRange,currentVersion:null!=(A=F.currentVersion)?A:""})}):null:q("detail.install.blockedNoVersion");return(0,l.jsxs)("div",{className:"space-y-4",children:[U,E.catalog&&(0,l.jsx)(u.y,{catalog:E.catalog}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("h1",{className:"text-2xl font-bold text-foreground break-words",children:Z.name}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground break-words",children:Z.summary}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[F&&(0,l.jsx)(x.Xz,{status:F.status}),S&&(0,l.jsx)(x.qW,{risk:S})]})]}),(0,l.jsx)(y,{title:q("detail.install.action"),testId:"skill-install-section",children:(0,l.jsx)(f.B,{skillId:Z.id,version:Z.recommendedVersion,blockedReason:W,agents:null!=(C=null==O?void 0:O.compatibility.agents)?C:[]})}),(0,l.jsxs)(y,{title:q("capabilities.heading"),testId:"skill-capabilities-section",children:[(0,l.jsx)("p",{className:"text-sm text-foreground break-words",children:Z.summary}),(0,l.jsx)(k.u,{tone:"neutral",children:q("capabilities.unavailable")})]}),(0,l.jsxs)(y,{title:q("detail.overview"),testId:"skill-overview-section",children:[(0,l.jsxs)("dl",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2",children:[(0,l.jsx)(N,{label:q("detail.skillId"),mono:!0,children:Z.id}),(0,l.jsx)(N,{label:q("detail.provider"),children:Z.provider.url?(0,l.jsx)("a",{href:Z.provider.url,target:"_blank",rel:"noopener noreferrer",className:"text-accent-600 hover:underline dark:text-accent-400",children:Z.provider.name}):Z.provider.name}),Z.provider.contact&&(0,l.jsx)(N,{label:q("detail.providerContact"),children:Z.provider.contact}),(0,l.jsx)(N,{label:q("detail.license"),children:Z.license}),Z.homepage&&(0,l.jsx)(N,{label:q("detail.homepage"),children:(0,l.jsx)("a",{href:Z.homepage,target:"_blank",rel:"noopener noreferrer",className:"break-all text-accent-600 hover:underline dark:text-accent-400",children:Z.homepage})}),(0,l.jsx)(N,{label:q("detail.latestVersion"),mono:!0,children:Z.latest}),(0,l.jsx)(N,{label:q("detail.recommendedVersion"),mono:!0,children:null!=(R=Z.recommendedVersion)?R:q("detail.recommendedVersionNone")})]}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-recommendation-reason",children:q(p.TE[Z.recommendedReason])}),Z.keywords.length>0&&(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-xs font-medium text-muted-foreground",children:q("detail.keywords")}),(0,l.jsx)("div",{className:"mt-1 flex flex-wrap gap-1.5",children:Z.keywords.map(e=>(0,l.jsx)(c.Ex,{variant:"gray",children:e},e))})]})]}),(0,l.jsxs)(y,{title:q("compatibility.label"),testId:"skill-compatibility-section",children:[F?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsx)(x.Xz,{status:F.status}),(0,l.jsx)("span",{className:"text-sm text-muted-foreground",children:q("compatibility.requiredRange",{range:F.requiredRange})})]}),(0,l.jsx)(w,{compatibility:F}),(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:F.currentVersion?q("compatibility.currentVersion",{version:F.currentVersion}):q("compatibility.currentVersionUnknown")}),"unknown"===F.status&&(0,l.jsx)(k.u,{tone:"warning","data-testid":"skill-compatibility-unknown-notice",children:q("compatibility.unverifiedNotice")})]}):(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:q("compatibility.currentVersionUnknown")}),(0,l.jsxs)("div",{className:"space-y-2",children:[(0,l.jsx)("h3",{className:"text-sm font-medium text-foreground",children:q("compatibility.agentsHeading")}),O&&O.compatibility.agents.length>0?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"flex flex-wrap gap-1.5",children:O.compatibility.agents.map(e=>(0,l.jsx)(x.uE,{agent:e},e.agent))}),(0,l.jsx)("div",{className:"space-y-3",children:O.compatibility.agents.map(e=>(0,l.jsx)(g.m,{agent:e},e.agent))})]}):(0,l.jsx)("p",{className:"text-xs text-muted-foreground",children:q("compatibility.agentsUnknown")}),(0,l.jsx)(k.u,{tone:"neutral",children:q("compatibility.agentsNotice")})]})]}),(0,l.jsxs)(y,{title:q("risk.declaredHeading"),testId:"skill-risk-section",children:[S?(0,l.jsx)(x.qW,{risk:S}):null,(0,l.jsx)(k.u,{tone:"neutral",children:q("risk.declaredNotice")}),"high"===S&&(0,l.jsx)(k.u,{tone:"danger","data-testid":"skill-high-risk-warning",children:q("risk.highWarning")}),(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-sm font-medium text-foreground",children:q("risk.computedHeading")}),(0,l.jsx)("p",{className:"mt-1 text-sm text-muted-foreground","data-testid":"skill-computed-risk-unavailable",children:q("risk.computedUnavailable")})]})]}),(0,l.jsxs)(y,{title:q("permissions.heading"),testId:"skill-permissions-section",children:[(0,l.jsx)(k.u,{tone:"warning","data-testid":"skill-permission-declaration-notice",children:q((0,p.e5)(m.Ms))}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:q("permissions.unavailable")})]}),(0,l.jsx)(y,{title:q("requirements.heading"),testId:"skill-requirements-section",children:(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:q("requirements.unavailable")})}),(0,l.jsx)(y,{title:q("contents.heading"),testId:"skill-contents-section",children:(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:q("contents.unavailable")})}),(0,l.jsxs)("section",{className:"space-y-3","data-testid":"skill-versions-section",children:[(0,l.jsx)("h2",{className:"text-base font-semibold text-foreground",children:q("detail.versionsHeading")}),0===Z.versions.length?(0,l.jsx)(c.Zp,{children:(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:q("detail.versionsEmpty")})}):Z.versions.map(e=>(0,l.jsx)(V,{version:e},e.version))]})]})}function C(){let e=(0,a.useParams)(),t="string"==typeof e.skillId?e.skillId:"";return(0,l.jsx)("div",{className:"container-custom py-8 overflow-auto h-full",children:(0,l.jsx)(A,{skillId:t})})}},99027:(e,t,s)=>{Promise.resolve().then(s.bind(s,89675))}},e=>{e.O(0,[6481,6809,4909,2770,2619,8566,6322,8283,8407,2751,2039,2053,8441,1255,7358],()=>e(e.s=99027)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9501],{16530:(e,t,s)=>{Promise.resolve().then(s.bind(s,99898))},23327:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(71847).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"}]])},52056:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(71847).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"}]])},54014:(e,t,s)=>{"use strict";s.d(t,{Ab:()=>a,NL:()=>g,O6:()=>x,XH:()=>l,f_:()=>u,hR:()=>o,lu:()=>h,n6:()=>n,oo:()=>d,pQ:()=>i,sw:()=>m,vz:()=>p});let l=["claude","codex","gemini","vibe-local","opencode","copilot","antigravity","command-code"],a=10,i=50,r=/^[a-zA-Z0-9_-]+$/;function n(e){return"string"==typeof e&&e.length>0&&e.length<=64&&r.test(e)}let c={claude:"Claude",codex:"Codex",gemini:"Gemini","vibe-local":"Vibe Local",opencode:"OpenCode",copilot:"Copilot",antigravity:"Antigravity","command-code":"Command Code"};function o(e){return l.includes(e)}function d(e){var t;return null!=(t=c[e])?t:e}function u(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Assistant";return e&&o(e)?d(e):t}function m(e){let t=e.alias;return"string"==typeof t&&t.trim().length>0?t:d(e.cliTool)}function x(e,t,s){let l=e.find(e=>e.id===t);return l?m(l):d(s)}function h(e){return e.map((e,t)=>({id:e,cliTool:e,alias:d(e),order:t}))}let p=128,g=2097152},68331:(e,t,s)=>{"use strict";s.d(t,{y:()=>n});var l=s(95155);s(12115);var a=s(18955),i=s(37381),r=s(95584);function n(e){let{catalog:t}=e,s=(0,a.c)("skills");return t.stale||t.offline?(0,l.jsx)(i.u,{tone:"warning","data-testid":"skill-catalog-stale",className:"flex-col sm:flex-row",children:(0,l.jsxs)("div",{className:"space-y-1",children:[(0,l.jsx)("p",{className:"font-medium",children:s("catalog.staleHeading")}),(0,l.jsx)("p",{children:s("catalog.staleNotice")}),t.offline&&(0,l.jsx)("p",{children:s("catalog.offlineNotice")}),(0,l.jsx)("p",{children:s((0,r.pk)(t.staleReason))}),(0,l.jsxs)("p",{className:"break-words",children:[s("catalog.fetchedAt",{timestamp:t.fetchedAt})," \xb7"," ",s("catalog.revalidatedAt",{timestamp:t.revalidatedAt})]}),(0,l.jsx)("p",{className:"break-words",children:s("catalog.sourceLabel",{repository:t.source.repository,ref:t.source.ref})})]})}):(0,l.jsxs)("p",{"data-testid":"skill-catalog-fresh",className:"text-xs text-muted-foreground break-words",children:[s("catalog.freshLabel")," \xb7"," ",s("catalog.revalidatedAt",{timestamp:t.revalidatedAt})," \xb7"," ",s("catalog.sourceLabel",{repository:t.source.repository,ref:t.source.ref})]})}},75333:(e,t,s)=>{"use strict";s.d(t,{Xz:()=>o,qW:()=>d,uE:()=>u});var l=s(95155);s(12115);var a=s(18955),i=s(77801),r=s(48407),n=s(54014),c=s(95584);function o(e){let{status:t,className:s}=e,i=(0,a.c)("skills");return(0,l.jsx)(r.Ex,{variant:c.H$[t],className:s,"data-testid":"skill-compatibility-".concat(t),children:i(c.OV[t])})}function d(e){let{risk:t,className:s}=e,n=(0,a.c)("skills");return(0,l.jsxs)(r.Ex,{variant:c.eK[t],className:s,"data-testid":"skill-declared-risk-".concat(t),children:["high"===t&&(0,l.jsx)(i.A,{size:12,"aria-hidden":"true",className:"mr-1 shrink-0"}),n("risk.declaredLabel",{level:n(c.pP[t])})]})}function u(e){let{agent:t}=e,s=(0,a.c)("skills");return(0,l.jsxs)(r.Ex,{variant:c.Et[t.support],"data-testid":"skill-agent-".concat(t.agent,"-").concat(t.support),children:[(0,n.f_)(t.agent),": ",s((0,c.e5)(t.labelKey))]})}},77801:(e,t,s)=>{"use strict";s.d(t,{A:()=>l});let l=(0,s(71847).A)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]])},99898:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>b});var l=s(95155),a=s(18955),i=s(12115),r=s(48407),n=s(54014),c=s(68331),o=s(52619),d=s.n(o),u=s(75333),m=s(95584);function x(e){var t;let{skill:s}=e,i=(0,a.c)("skills"),c=(0,m.gh)(s),o=(0,m.r0)(s);return(0,l.jsx)(d(),{href:"/skills/".concat(encodeURIComponent(s.id)),className:"block focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring rounded-lg","data-testid":"skill-card-".concat(s.id),children:(0,l.jsx)(r.Zp,{variant:"interactive",className:"h-full",children:(0,l.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,l.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsx)("h3",{className:"truncate text-base font-semibold text-foreground",children:s.name}),(0,l.jsx)("p",{className:"truncate text-xs text-muted-foreground",children:i("card.provider",{provider:s.provider.name})})]}),(0,l.jsx)("span",{className:"shrink-0 text-xs font-medium text-muted-foreground",children:null!=(t=s.recommendedVersion)?t:i("card.noRecommendedVersion")})]}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-3",children:s.summary}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[s.compatibility&&(0,l.jsx)(u.Xz,{status:s.compatibility.status}),c&&(0,l.jsx)(u.qW,{risk:c}),o.map(e=>(0,l.jsx)(r.Ex,{variant:"gray",children:(0,n.f_)(e)},e))]})]})})})}var h=s(37381),p=s(80130);let g="w-full rounded-md border border-input bg-surface px-3 py-2 text-sm text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",f=["compatible","incompatible","unknown"],k=["low","moderate","high"],v={status:"loading",catalog:null,skills:[],failure:null};function j(){let e=(0,a.c)("skills"),[t,s]=(0,i.useState)(v),[o,d]=(0,i.useState)(m.IV),[u,j]=(0,i.useState)(0);(0,i.useEffect)(()=>{let e=new AbortController;return s(v),(0,p.s5)(e.signal).then(t=>{e.signal.aborted||s(t.ok?{status:"loaded",catalog:t.data.catalog,skills:t.data.skills,failure:null}:{status:"error",catalog:null,skills:[],failure:t.failure})}).catch(()=>{}),()=>e.abort()},[u]);let b=(0,i.useCallback)(()=>j(e=>e+1),[]),N=(0,i.useCallback)((e,t)=>d(s=>({...s,[e]:t})),[]),y=(0,i.useMemo)(()=>(0,m.AJ)(t.skills),[t.skills]),w=(0,i.useMemo)(()=>(0,m.$d)(t.skills,o),[t.skills,o]);if("loading"===t.status)return(0,l.jsxs)("div",{"data-testid":"skill-catalog-loading",className:"space-y-3",children:[(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:e("state.loading")}),[0,1,2].map(e=>(0,l.jsx)(r.EA,{className:"h-28 w-full rounded-lg"},e))]});if("error"===t.status){var C,A;return(0,l.jsxs)(r.Zp,{"data-testid":"skill-catalog-error",className:"space-y-3",children:[(0,l.jsx)("h2",{className:"text-base font-semibold text-foreground",children:e("state.errorHeading")}),(0,l.jsxs)(h.u,{tone:"danger",children:[(0,l.jsx)("p",{children:e("state.errorNotice")}),(0,l.jsx)("p",{className:"mt-1 break-words",children:e("state.errorCode",{code:null!=(A=null==(C=t.failure)?void 0:C.code)?A:""})})]}),(0,l.jsx)(r.$n,{variant:"secondary",size:"sm",onClick:b,"data-testid":"skill-catalog-retry",children:e("state.retry")})]})}return(0,l.jsxs)("div",{className:"space-y-4",children:[t.catalog&&(0,l.jsx)(c.y,{catalog:t.catalog}),(0,l.jsxs)("div",{className:"space-y-3",children:[(0,l.jsx)(r.pd,{type:"search",value:o.query,onChange:e=>N("query",e.target.value),"aria-label":e("search.label"),placeholder:e("search.placeholder"),"data-testid":"skill-search-input"}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-3",children:[(0,l.jsxs)("label",{className:"block text-xs font-medium text-muted-foreground",children:[e("filters.compatibility"),(0,l.jsxs)("select",{className:"".concat(g," mt-1"),value:o.compatibility,onChange:e=>N("compatibility",e.target.value),"data-testid":"skill-filter-compatibility",children:[(0,l.jsx)("option",{value:"all",children:e("filters.all")}),f.map(t=>(0,l.jsx)("option",{value:t,children:e(m.OV[t])},t))]})]}),(0,l.jsxs)("label",{className:"block text-xs font-medium text-muted-foreground",children:[e("filters.risk"),(0,l.jsxs)("select",{className:"".concat(g," mt-1"),value:o.risk,onChange:e=>N("risk",e.target.value),"data-testid":"skill-filter-risk",children:[(0,l.jsx)("option",{value:"all",children:e("filters.all")}),k.map(t=>(0,l.jsx)("option",{value:t,children:e(m.pP[t])},t))]})]}),(0,l.jsxs)("label",{className:"block text-xs font-medium text-muted-foreground",children:[e("filters.agent"),(0,l.jsxs)("select",{className:"".concat(g," mt-1"),value:o.agent,onChange:e=>N("agent",e.target.value),"data-testid":"skill-filter-agent",children:[(0,l.jsx)("option",{value:"all",children:e("filters.all")}),y.map(e=>(0,l.jsx)("option",{value:e,children:(0,n.f_)(e)},e))]})]})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,l.jsx)("p",{className:"text-xs text-muted-foreground","data-testid":"skill-result-count",children:e("search.resultCount",{shown:w.length,total:t.skills.length})}),(0,l.jsx)(r.$n,{variant:"ghost",size:"sm",onClick:()=>d(m.IV),"data-testid":"skill-filter-reset",children:e("filters.reset")})]})]}),0===t.skills.length?(0,l.jsx)(r.Zp,{"data-testid":"skill-catalog-empty",children:(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:e("state.empty")})}):0===w.length?(0,l.jsxs)(r.Zp,{"data-testid":"skill-catalog-no-results",children:[(0,l.jsx)("p",{className:"text-sm text-foreground",children:e("state.noResults")}),(0,l.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("state.noResultsHint")})]}):(0,l.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2 xl:grid-cols-3",children:w.map(e=>(0,l.jsx)(x,{skill:e},e.id))})]})}function b(){let e=(0,a.c)("skills");return(0,l.jsxs)("div",{className:"container-custom py-8 overflow-auto h-full",children:[(0,l.jsxs)("div",{className:"mb-6",children:[(0,l.jsx)("h1",{className:"text-2xl font-bold text-foreground mb-2",children:e("page.title")}),(0,l.jsx)("p",{className:"text-sm text-muted-foreground",children:e("page.description")})]}),(0,l.jsx)(j,{})]})}}},e=>{e.O(0,[6809,4909,2770,2619,8407,2751,8441,1255,7358],()=>e(e.s=16530)),_N_E=e.O()}]);
|