@shepai/cli 1.155.0 → 1.156.0-pr485.030e6b4
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/README.md +276 -161
- package/apis/json-schema/Language.yaml +13 -0
- package/apis/json-schema/UserProfile.yaml +3 -0
- package/dist/packages/core/src/application/use-cases/agents/approve-agent-run.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/agents/approve-agent-run.use-case.js +5 -0
- package/dist/packages/core/src/application/use-cases/agents/reject-agent-run.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/agents/reject-agent-run.use-case.js +7 -0
- package/dist/packages/core/src/application/use-cases/features/check-and-unblock-features.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/check-and-unblock-features.use-case.js +11 -1
- package/dist/packages/core/src/application/use-cases/features/resume-feature.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/resume-feature.use-case.js +3 -0
- package/dist/packages/core/src/application/use-cases/features/start-feature.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/start-feature.use-case.js +5 -0
- package/dist/packages/core/src/domain/generated/output.d.ts +14 -0
- package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
- package/dist/packages/core/src/domain/generated/output.js +11 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.js +4 -2
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/049-add-language-preference.d.ts +14 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/049-add-language-preference.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/049-add-language-preference.js +19 -0
- package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.js +3 -2
- package/dist/src/presentation/cli/commands/_serve.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/_serve.command.js +5 -3
- package/dist/src/presentation/cli/commands/agent/approve.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/agent/approve.command.js +9 -4
- package/dist/src/presentation/cli/commands/agent/delete.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/agent/delete.command.js +9 -5
- package/dist/src/presentation/cli/commands/agent/index.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/agent/index.js +3 -1
- package/dist/src/presentation/cli/commands/agent/logs.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/agent/logs.command.js +7 -5
- package/dist/src/presentation/cli/commands/agent/ls.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/agent/ls.command.js +12 -10
- package/dist/src/presentation/cli/commands/agent/reject.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/agent/reject.command.js +10 -5
- package/dist/src/presentation/cli/commands/agent/resolve-run.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/agent/resolve-run.js +7 -2
- package/dist/src/presentation/cli/commands/agent/show.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/agent/show.command.js +8 -6
- package/dist/src/presentation/cli/commands/agent/stop.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/agent/stop.command.js +9 -4
- package/dist/src/presentation/cli/commands/daemon/start-daemon.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/daemon/start-daemon.js +10 -8
- package/dist/src/presentation/cli/commands/daemon/stop-daemon.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/daemon/stop-daemon.js +5 -3
- package/dist/src/presentation/cli/commands/feat/adopt.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/adopt.command.js +14 -12
- package/dist/src/presentation/cli/commands/feat/approve.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/approve.command.js +8 -6
- package/dist/src/presentation/cli/commands/feat/archive.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/archive.command.js +10 -8
- package/dist/src/presentation/cli/commands/feat/del.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/del.command.js +17 -15
- package/dist/src/presentation/cli/commands/feat/index.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/index.js +2 -1
- package/dist/src/presentation/cli/commands/feat/logs.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/logs.command.js +8 -6
- package/dist/src/presentation/cli/commands/feat/ls.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/ls.command.js +14 -12
- package/dist/src/presentation/cli/commands/feat/new.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/new.command.js +43 -37
- package/dist/src/presentation/cli/commands/feat/reject.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/reject.command.js +11 -9
- package/dist/src/presentation/cli/commands/feat/resolve-waiting-feature.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/resolve-waiting-feature.js +12 -5
- package/dist/src/presentation/cli/commands/feat/resume.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/resume.command.js +8 -6
- package/dist/src/presentation/cli/commands/feat/review.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/review.command.js +17 -15
- package/dist/src/presentation/cli/commands/feat/show.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/show.command.js +89 -45
- package/dist/src/presentation/cli/commands/feat/start.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/start.command.js +12 -10
- package/dist/src/presentation/cli/commands/feat/unarchive.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/unarchive.command.js +8 -6
- package/dist/src/presentation/cli/commands/ide-open.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/ide-open.command.js +10 -5
- package/dist/src/presentation/cli/commands/install.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/install.command.js +29 -21
- package/dist/src/presentation/cli/commands/log-viewer.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/log-viewer.js +6 -3
- package/dist/src/presentation/cli/commands/repo/add.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/repo/add.command.js +12 -10
- package/dist/src/presentation/cli/commands/repo/index.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/repo/index.js +3 -1
- package/dist/src/presentation/cli/commands/repo/ls.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/repo/ls.command.js +11 -9
- package/dist/src/presentation/cli/commands/repo/resolve-repository.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/repo/resolve-repository.js +7 -2
- package/dist/src/presentation/cli/commands/repo/show.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/repo/show.command.js +21 -10
- package/dist/src/presentation/cli/commands/restart.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/restart.command.js +6 -4
- package/dist/src/presentation/cli/commands/run.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/run.command.js +21 -17
- package/dist/src/presentation/cli/commands/session/index.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/session/index.js +3 -1
- package/dist/src/presentation/cli/commands/session/ls.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/session/ls.command.js +11 -9
- package/dist/src/presentation/cli/commands/session/show.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/session/show.command.js +26 -18
- package/dist/src/presentation/cli/commands/settings/agent.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/settings/agent.command.js +12 -8
- package/dist/src/presentation/cli/commands/settings/ide.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/settings/ide.command.js +13 -7
- package/dist/src/presentation/cli/commands/settings/index.d.ts +1 -0
- package/dist/src/presentation/cli/commands/settings/index.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/settings/index.js +7 -3
- package/dist/src/presentation/cli/commands/settings/init.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/settings/init.command.js +8 -7
- package/dist/src/presentation/cli/commands/settings/language.command.d.ts +14 -0
- package/dist/src/presentation/cli/commands/settings/language.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/settings/language.command.js +79 -0
- package/dist/src/presentation/cli/commands/settings/model.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/settings/model.command.js +7 -6
- package/dist/src/presentation/cli/commands/settings/show.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/settings/show.command.js +4 -3
- package/dist/src/presentation/cli/commands/settings/workflow.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/settings/workflow.command.js +20 -18
- package/dist/src/presentation/cli/commands/start.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/start.command.js +5 -3
- package/dist/src/presentation/cli/commands/status.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/status.command.js +32 -24
- package/dist/src/presentation/cli/commands/stop.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/stop.command.js +4 -2
- package/dist/src/presentation/cli/commands/tools.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/tools.command.js +8 -4
- package/dist/src/presentation/cli/commands/ui.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/ui.command.js +12 -10
- package/dist/src/presentation/cli/commands/upgrade.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/upgrade.command.js +18 -13
- package/dist/src/presentation/cli/commands/version.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/version.command.js +5 -3
- package/dist/src/presentation/cli/i18n.d.ts +41 -0
- package/dist/src/presentation/cli/i18n.d.ts.map +1 -0
- package/dist/src/presentation/cli/i18n.js +100 -0
- package/dist/src/presentation/cli/index.js +13 -1
- package/dist/src/presentation/cli/ui/install-messages.d.ts.map +1 -1
- package/dist/src/presentation/cli/ui/install-messages.js +16 -6
- package/dist/src/presentation/tui/i18n.d.ts +24 -0
- package/dist/src/presentation/tui/i18n.d.ts.map +1 -0
- package/dist/src/presentation/tui/i18n.js +48 -0
- package/dist/src/presentation/tui/prompts/agent-select.prompt.d.ts +13 -31
- package/dist/src/presentation/tui/prompts/agent-select.prompt.d.ts.map +1 -1
- package/dist/src/presentation/tui/prompts/agent-select.prompt.js +17 -15
- package/dist/src/presentation/tui/prompts/auth-method.prompt.d.ts +7 -11
- package/dist/src/presentation/tui/prompts/auth-method.prompt.d.ts.map +1 -1
- package/dist/src/presentation/tui/prompts/auth-method.prompt.js +7 -5
- package/dist/src/presentation/tui/prompts/ide-select.prompt.d.ts.map +1 -1
- package/dist/src/presentation/tui/prompts/ide-select.prompt.js +2 -1
- package/dist/src/presentation/tui/prompts/prd-review-summary.prompt.d.ts.map +1 -1
- package/dist/src/presentation/tui/prompts/prd-review-summary.prompt.js +8 -6
- package/dist/src/presentation/tui/wizards/agent-config.wizard.d.ts.map +1 -1
- package/dist/src/presentation/tui/wizards/agent-config.wizard.js +2 -1
- package/dist/src/presentation/tui/wizards/github-import.wizard.d.ts.map +1 -1
- package/dist/src/presentation/tui/wizards/github-import.wizard.js +15 -11
- package/dist/src/presentation/tui/wizards/merge-review.wizard.d.ts.map +1 -1
- package/dist/src/presentation/tui/wizards/merge-review.wizard.js +10 -8
- package/dist/src/presentation/tui/wizards/onboarding/onboarding.wizard.d.ts.map +1 -1
- package/dist/src/presentation/tui/wizards/onboarding/onboarding.wizard.js +10 -7
- package/dist/src/presentation/tui/wizards/onboarding/steps/workflow-defaults.step.d.ts +0 -41
- package/dist/src/presentation/tui/wizards/onboarding/steps/workflow-defaults.step.d.ts.map +1 -1
- package/dist/src/presentation/tui/wizards/onboarding/steps/workflow-defaults.step.js +15 -15
- package/dist/src/presentation/tui/wizards/plan-review.wizard.d.ts.map +1 -1
- package/dist/src/presentation/tui/wizards/plan-review.wizard.js +10 -8
- package/dist/src/presentation/tui/wizards/prd-review.wizard.d.ts.map +1 -1
- package/dist/src/presentation/tui/wizards/prd-review.wizard.js +3 -2
- package/dist/src/presentation/web/app/(dashboard)/get-graph-data.d.ts.map +1 -1
- package/dist/src/presentation/web/app/(dashboard)/get-graph-data.js +4 -2
- package/dist/src/presentation/web/app/actions/create-feature.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/create-feature.js +3 -0
- package/dist/src/presentation/web/app/layout.d.ts.map +1 -1
- package/dist/src/presentation/web/app/layout.js +5 -2
- package/dist/src/presentation/web/components/assistant-ui/thread.d.ts.map +1 -1
- package/dist/src/presentation/web/components/assistant-ui/thread.js +13 -10
- package/dist/src/presentation/web/components/common/add-repository-button/add-repository-button.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/add-repository-button/add-repository-button.js +3 -1
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.js +1 -1
- package/dist/src/presentation/web/components/common/base-drawer/base-drawer.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/base-drawer/base-drawer.js +5 -2
- package/dist/src/presentation/web/components/common/ci-status-badge/ci-status-badge.js +3 -3
- package/dist/src/presentation/web/components/common/control-center-drawer/adopt-branch-drawer.js +4 -4
- package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js +7 -1
- package/dist/src/presentation/web/components/common/control-center-drawer/repository-drawer-client.js +1 -1
- package/dist/src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog.js +3 -1
- package/dist/src/presentation/web/components/common/deployment-status-badge/deployment-status-badge.js +2 -2
- package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/drawer-action-bar/drawer-action-bar.js +6 -2
- package/dist/src/presentation/web/components/common/empty-state/empty-state.stories.js +2 -2
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.js +34 -22
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/activity-tab.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/activity-tab.js +11 -7
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/branch-sync-status.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/branch-sync-status.js +3 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.js +4 -2
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/log-tab.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/log-tab.js +5 -3
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.js +9 -5
- package/dist/src/presentation/web/components/common/feature-list-item/feature-list-item.js +1 -1
- package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts +2 -2
- package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.js +22 -22
- package/dist/src/presentation/web/components/common/feature-node/feature-node.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-node/feature-node.js +49 -36
- package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-node/feature-sessions-dropdown.js +7 -3
- package/dist/src/presentation/web/components/common/feature-status-badges/feature-status-badges.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-status-badges/feature-status-badges.js +4 -2
- package/dist/src/presentation/web/components/common/feature-status-config.d.ts +2 -1
- package/dist/src/presentation/web/components/common/feature-status-config.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-status-config.js +6 -6
- package/dist/src/presentation/web/components/common/feature-status-group/feature-status-group.js +1 -1
- package/dist/src/presentation/web/components/common/floating-action-button/floating-action-button.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/floating-action-button/floating-action-button.js +4 -2
- package/dist/src/presentation/web/components/common/github-import-dialog/github-repo-browser.js +1 -1
- package/dist/src/presentation/web/components/common/merge-review/diff-view.js +2 -2
- package/dist/src/presentation/web/components/common/merge-review/merge-review.js +2 -2
- package/dist/src/presentation/web/components/common/prd-questionnaire/prd-questionnaire.js +3 -3
- package/dist/src/presentation/web/components/common/reject-feedback-dialog/reject-feedback-dialog.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/reject-feedback-dialog/reject-feedback-dialog.js +6 -4
- package/dist/src/presentation/web/components/common/repository-node/repository-node.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/repository-node/repository-node.js +18 -11
- package/dist/src/presentation/web/components/common/server-log-viewer/server-log-viewer.js +1 -1
- package/dist/src/presentation/web/components/common/task-progress-view/task-progress-view.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/task-progress-view/task-progress-view.js +7 -4
- package/dist/src/presentation/web/components/common/tech-decisions-review/tech-decisions-review.js +2 -2
- package/dist/src/presentation/web/components/common/version-badge/version-badge.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/version-badge/version-badge.js +3 -1
- package/dist/src/presentation/web/components/features/chat/ChatComposer.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/chat/ChatComposer.js +3 -1
- package/dist/src/presentation/web/components/features/chat/ChatMessageBubble.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/chat/ChatMessageBubble.js +7 -5
- package/dist/src/presentation/web/components/features/chat/ChatMessageList.js +1 -1
- package/dist/src/presentation/web/components/features/chat/ChatSheet.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/chat/ChatSheet.js +5 -3
- package/dist/src/presentation/web/components/features/chat/ChatTab.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/chat/ChatTab.js +5 -3
- package/dist/src/presentation/web/components/features/control-center/control-center-empty-state.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/control-center/control-center-empty-state.js +15 -11
- package/dist/src/presentation/web/components/features/control-center/control-center-inner.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/control-center/control-center-inner.js +14 -6
- package/dist/src/presentation/web/components/features/control-center/use-control-center-state.js +2 -2
- package/dist/src/presentation/web/components/features/control-center/welcome-agent-setup.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/control-center/welcome-agent-setup.js +8 -6
- package/dist/src/presentation/web/components/features/features-canvas/canvas-toolbar.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/features-canvas/canvas-toolbar.js +3 -1
- package/dist/src/presentation/web/components/features/features-canvas/features-canvas.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/features-canvas/features-canvas.js +4 -2
- package/dist/src/presentation/web/components/features/settings/AgentModelPicker/index.js +2 -2
- package/dist/src/presentation/web/components/features/settings/ModelPicker/index.js +2 -2
- package/dist/src/presentation/web/components/features/settings/agent-settings-section.js +1 -1
- package/dist/src/presentation/web/components/features/settings/language-settings-section.d.ts +5 -0
- package/dist/src/presentation/web/components/features/settings/language-settings-section.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/settings/language-settings-section.js +54 -0
- package/dist/src/presentation/web/components/features/settings/language-settings-section.stories.d.ts +18 -0
- package/dist/src/presentation/web/components/features/settings/language-settings-section.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/settings/language-settings-section.stories.js +36 -0
- package/dist/src/presentation/web/components/features/settings/settings-page-client.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/settings-page-client.js +89 -77
- package/dist/src/presentation/web/components/features/settings/timeout-slider.js +1 -1
- package/dist/src/presentation/web/components/features/skills/category-filter.js +1 -1
- package/dist/src/presentation/web/components/features/skills/skills-page-client.js +1 -1
- package/dist/src/presentation/web/components/features/tools/tool-card.js +1 -1
- package/dist/src/presentation/web/components/features/tools/tool-detail-drawer.js +2 -2
- package/dist/src/presentation/web/components/layouts/app-shell/app-shell.d.ts.map +1 -1
- package/dist/src/presentation/web/components/layouts/app-shell/app-shell.js +5 -1
- package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.d.ts.map +1 -1
- package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.js +13 -7
- package/dist/src/presentation/web/components/providers/i18n-provider.d.ts +17 -0
- package/dist/src/presentation/web/components/providers/i18n-provider.d.ts.map +1 -0
- package/dist/src/presentation/web/components/providers/i18n-provider.js +36 -0
- package/dist/src/presentation/web/components/ui/alert-dialog.js +1 -1
- package/dist/src/presentation/web/components/ui/alert.js +1 -1
- package/dist/src/presentation/web/components/ui/checkbox-group.js +1 -1
- package/dist/src/presentation/web/components/ui/command.js +1 -1
- package/dist/src/presentation/web/components/ui/dialog.d.ts.map +1 -1
- package/dist/src/presentation/web/components/ui/dialog.js +2 -2
- package/dist/src/presentation/web/components/ui/dialog.stories.js +1 -1
- package/dist/src/presentation/web/components/ui/drawer.d.ts.map +1 -1
- package/dist/src/presentation/web/components/ui/drawer.js +2 -8
- package/dist/src/presentation/web/components/ui/dropdown-menu.js +6 -6
- package/dist/src/presentation/web/components/ui/scroll-area.js +1 -1
- package/dist/src/presentation/web/components/ui/select.js +1 -1
- package/dist/src/presentation/web/components/ui/sheet.js +3 -3
- package/dist/src/presentation/web/components/ui/sidebar.d.ts.map +1 -1
- package/dist/src/presentation/web/components/ui/sidebar.js +15 -15
- package/dist/src/presentation/web/components/ui/switch.js +1 -1
- package/dist/src/presentation/web/hooks/use-graph-state.d.ts.map +1 -1
- package/dist/src/presentation/web/hooks/use-graph-state.js +7 -4
- package/dist/src/presentation/web/hooks/use-sound-action.stories.js +1 -1
- package/dist/src/presentation/web/lib/i18n.d.ts +15 -0
- package/dist/src/presentation/web/lib/i18n.d.ts.map +1 -0
- package/dist/src/presentation/web/lib/i18n.js +64 -0
- package/dist/src/presentation/web/lib/language.d.ts +23 -0
- package/dist/src/presentation/web/lib/language.d.ts.map +1 -0
- package/dist/src/presentation/web/lib/language.js +37 -0
- package/dist/src/presentation/web/lib/layout-with-dagre.d.ts +2 -0
- package/dist/src/presentation/web/lib/layout-with-dagre.d.ts.map +1 -1
- package/dist/src/presentation/web/lib/layout-with-dagre.js +4 -0
- package/dist/src/presentation/web/lib/rtl-fonts.d.ts +19 -0
- package/dist/src/presentation/web/lib/rtl-fonts.d.ts.map +1 -0
- package/dist/src/presentation/web/lib/rtl-fonts.js +51 -0
- package/dist/translations/ar/cli.json +613 -0
- package/dist/translations/ar/common.json +55 -0
- package/dist/translations/ar/tui.json +130 -0
- package/dist/translations/ar/web.json +594 -0
- package/dist/translations/de/cli.json +613 -0
- package/dist/translations/de/common.json +55 -0
- package/dist/translations/de/tui.json +109 -0
- package/dist/translations/de/web.json +580 -0
- package/dist/translations/en/cli.json +613 -0
- package/dist/translations/en/common.json +55 -0
- package/dist/translations/en/tui.json +130 -0
- package/dist/translations/en/web.json +594 -0
- package/dist/translations/es/cli.json +613 -0
- package/dist/translations/es/common.json +55 -0
- package/dist/translations/es/tui.json +130 -0
- package/dist/translations/es/web.json +594 -0
- package/dist/translations/fr/cli.json +613 -0
- package/dist/translations/fr/common.json +55 -0
- package/dist/translations/fr/tui.json +130 -0
- package/dist/translations/fr/web.json +594 -0
- package/dist/translations/he/cli.json +613 -0
- package/dist/translations/he/common.json +55 -0
- package/dist/translations/he/tui.json +130 -0
- package/dist/translations/he/web.json +594 -0
- package/dist/translations/pt/cli.json +613 -0
- package/dist/translations/pt/common.json +55 -0
- package/dist/translations/pt/tui.json +130 -0
- package/dist/translations/pt/web.json +594 -0
- package/dist/translations/ru/cli.json +613 -0
- package/dist/translations/ru/common.json +55 -0
- package/dist/translations/ru/tui.json +130 -0
- package/dist/translations/ru/web.json +594 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +4 -2
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +7 -7
- package/web/.next/required-server-files.json +7 -7
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/@drawer/chat/page.js +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/chat/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/chat/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +29 -29
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +4 -4
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +4 -4
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/chat/page.js +3 -3
- package/web/.next/server/app/(dashboard)/chat/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/chat/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +29 -29
- package/web/.next/server/app/(dashboard)/create/page.js +3 -3
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +4 -4
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +4 -4
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/page.js +3 -3
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js +3 -3
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +3 -3
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +5 -5
- package/web/.next/server/app/_not-found/page.js +2 -2
- package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
- package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
- package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
- package/web/.next/server/app/api/interactive/chat/[featureId]/messages/route.js.nft.json +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/settings/page.js +2 -2
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +10 -10
- package/web/.next/server/app/skills/page.js +3 -4
- package/web/.next/server/app/skills/page.js.nft.json +1 -1
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +10 -10
- package/web/.next/server/app/tools/page.js +3 -4
- package/web/.next/server/app/tools/page.js.nft.json +1 -1
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +5 -5
- package/web/.next/server/app/version/page.js +2 -2
- package/web/.next/server/app/version/page.js.nft.json +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js +1 -1
- package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__b4102cc7._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__b4102cc7._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__beda892a._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__beda892a._.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +3 -3
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__209c9597._.js +4 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__88f7e8e6._.js.map → [root-of-the-server]__209c9597._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__27301e38._.js +4 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__17ed7ed1._.js.map → [root-of-the-server]__27301e38._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__56b70465._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__56b70465._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6fecf886._.js +4 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__42bf1807._.js.map → [root-of-the-server]__6fecf886._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8b0aac03._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8d27866c._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8d27866c._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9f3504c7._.js +4 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__f80bfc75._.js.map → [root-of-the-server]__9f3504c7._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__bd6ed91a._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__bd6ed91a._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c30f1f82._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c30f1f82._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__dffa13c5._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__dffa13c5._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e91ffd5e._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e91ffd5e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f8dd4422._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f8dd4422._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_05c23ad9._.js +1 -1
- package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0dc06d07._.js +3 -0
- package/web/.next/server/chunks/ssr/_0dc06d07._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
- package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_2b858df5._.js +3 -0
- package/web/.next/server/chunks/ssr/{_2c7d0c36._.js.map → _2b858df5._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_3a0b989f._.js +2 -2
- package/web/.next/server/chunks/ssr/_3a0b989f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_67104d9e._.js → _3bcda5d7._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_67104d9e._.js.map → _3bcda5d7._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_71e47f04._.js → _4e19e8d2._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_71e47f04._.js.map → _4e19e8d2._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_5119a3df._.js +3 -0
- package/web/.next/server/chunks/ssr/_5119a3df._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_56b9d60f._.js +1 -1
- package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_5f69c13f._.js +1 -1
- package/web/.next/server/chunks/ssr/_5f69c13f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_6645de45._.js +4 -0
- package/web/.next/server/chunks/ssr/_6645de45._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_7c5b97c6._.js +1 -1
- package/web/.next/server/chunks/ssr/_7c5b97c6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_82c57f10._.js +1 -1
- package/web/.next/server/chunks/ssr/_82c57f10._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_8b57edb8._.js +1 -1
- package/web/.next/server/chunks/ssr/_8b57edb8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_8d733ce4._.js +1 -1
- package/web/.next/server/chunks/ssr/_8d733ce4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_9495d50b._.js +1 -1
- package/web/.next/server/chunks/ssr/_9495d50b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_a0e3f7e4._.js +1 -1
- package/web/.next/server/chunks/ssr/_a0e3f7e4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_ac4a3873._.js +1 -1
- package/web/.next/server/chunks/ssr/_ac4a3873._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_507a8382._.js → _b9ba2473._.js} +2 -2
- package/web/.next/server/chunks/ssr/_b9ba2473._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_bcaea66b._.js +3 -0
- package/web/.next/server/chunks/ssr/_bcaea66b._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_bcfa8457._.js +9 -0
- package/web/.next/server/chunks/ssr/_bcfa8457._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_ca0aa7f0._.js +1 -1
- package/web/.next/server/chunks/ssr/_ca0aa7f0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_cb5a021e._.js +1 -1
- package/web/.next/server/chunks/ssr/_cb5a021e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_cfbd1d7e._.js +1 -1
- package/web/.next/server/chunks/ssr/_cfbd1d7e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_d86175ae._.js +1 -1
- package/web/.next/server/chunks/ssr/_d86175ae._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_d8bedf13._.js +1 -1
- package/web/.next/server/chunks/ssr/_d8bedf13._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_d90b0a06._.js +3 -0
- package/web/.next/server/chunks/ssr/_d90b0a06._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_fa7efce3._.js +2 -2
- package/web/.next/server/chunks/ssr/_fa7efce3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_8ec2c790._.js +1 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_8ec2c790._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_tools_tools-page-client_tsx_3d0aa70c._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_tools_tools-page-client_tsx_3d0aa70c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_db9fa0c2._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_db9fa0c2._.js.map +1 -1
- package/web/.next/server/chunks/ssr/translations_23dd5e7e._.js +3 -0
- package/web/.next/server/chunks/ssr/translations_23dd5e7e._.js.map +1 -0
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +45 -45
- package/web/.next/static/chunks/{b4cde06eff374c59.js → 0a79dfbb8486b66e.js} +2 -2
- package/web/.next/static/chunks/{f50d8e1825fae0fe.js → 0c87b59a0fdd22dd.js} +1 -1
- package/web/.next/static/chunks/11e4b9d959a6efa7.js +2 -0
- package/web/.next/static/chunks/{f6085a3750b6d8f4.js → 16d35285b664c30c.js} +1 -1
- package/web/.next/static/chunks/2273b81cd7c7d2af.css +1 -0
- package/web/.next/static/chunks/{60bc4daf6904d5a0.js → 24d701de138b762d.js} +1 -1
- package/web/.next/static/chunks/2c5bf14361cf6728.js +1 -0
- package/web/.next/static/chunks/{688971d5bad5dc7c.js → 3deefc76ea55047c.js} +1 -1
- package/web/.next/static/chunks/42e6a21f1d63dc5c.js +1 -0
- package/web/.next/static/chunks/{11091b676d1b3bd4.js → 47477ed4c5871747.js} +1 -1
- package/web/.next/static/chunks/4864ff06a738d58b.js +1 -0
- package/web/.next/static/chunks/{22c459f1877b1e4f.js → 74db65fa7bfb80bd.js} +1 -1
- package/web/.next/static/chunks/9061f08ab7e537a8.js +1 -0
- package/web/.next/static/chunks/919509a19de3205b.js +7 -0
- package/web/.next/static/chunks/{b3109b268c02449c.js → 9aa752f55e6cfcc9.js} +1 -1
- package/web/.next/static/chunks/a72f1d456f0afa8a.js +5 -0
- package/web/.next/static/chunks/ad5b1373e5ba0789.js +1 -0
- package/web/.next/static/chunks/b447e13b2ac5bb65.js +1 -0
- package/web/.next/static/chunks/d2cbeefbc8967b16.js +1 -0
- package/web/.next/static/chunks/d5366257d6b9f855.js +1 -0
- package/web/.next/static/chunks/{5ae60a052ab5f437.js → d6e702c209c413ce.js} +2 -2
- package/web/.next/static/chunks/{97c18bb438f775cf.js → e63d0d79a334fa97.js} +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0b150ddf._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0b150ddf._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__17ed7ed1._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__28d0d265._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__28d0d265._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__42bf1807._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__88f7e8e6._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f80bfc75._.js +0 -4
- package/web/.next/server/chunks/ssr/_2c7d0c36._.js +0 -3
- package/web/.next/server/chunks/ssr/_4b432739._.js +0 -3
- package/web/.next/server/chunks/ssr/_4b432739._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_507a8382._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_8219712a._.js +0 -3
- package/web/.next/server/chunks/ssr/_8219712a._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_d4b20e29._.js +0 -3
- package/web/.next/server/chunks/ssr/_d4b20e29._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_dd0d2cda._.js +0 -4
- package/web/.next/server/chunks/ssr/_dd0d2cda._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_e9a73a63._.js +0 -9
- package/web/.next/server/chunks/ssr/_e9a73a63._.js.map +0 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_324a47da._.js +0 -3
- package/web/.next/server/chunks/ssr/src_presentation_web_324a47da._.js.map +0 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_cdc632e3.js +0 -3
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_cdc632e3.js.map +0 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_39ca0924.js +0 -3
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_39ca0924.js.map +0 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_357e3eb0._.js +0 -3
- package/web/.next/server/chunks/ssr/src_presentation_web_components_357e3eb0._.js.map +0 -1
- package/web/.next/static/chunks/08fe461cb16fced0.js +0 -1
- package/web/.next/static/chunks/1a1dc6a09c911b70.js +0 -1
- package/web/.next/static/chunks/21c8953d720bddcc.js +0 -7
- package/web/.next/static/chunks/450bfeed79bb1648.js +0 -1
- package/web/.next/static/chunks/4b2c4a5c35ebb70d.js +0 -1
- package/web/.next/static/chunks/711a2468a2ea3c85.js +0 -1
- package/web/.next/static/chunks/8590bd2e69b24b9e.css +0 -1
- package/web/.next/static/chunks/8ba1c07ef18b15a9.js +0 -1
- package/web/.next/static/chunks/cd54b758f58061d0.js +0 -1
- package/web/.next/static/chunks/d1fa9a48542437bd.js +0 -2
- package/web/.next/static/chunks/de8a83cc1a08a5f1.js +0 -5
- /package/web/.next/static/{gvtDuAeM3WKFc9kJihv1y → _3mdwhLrxBePUb5DWqy3q}/_buildManifest.js +0 -0
- /package/web/.next/static/{gvtDuAeM3WKFc9kJihv1y → _3mdwhLrxBePUb5DWqy3q}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{gvtDuAeM3WKFc9kJihv1y → _3mdwhLrxBePUb5DWqy3q}/_ssgManifest.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
module.exports=[64885,a=>{"use strict";var b=a.i(10973),c=a.i(96960),d=a.i(69845),e=a.i(52313),f=a.i(88064),g=a.i(16605),h=a.i(50490),i=a.i(5698),j=a.i(98410),k=a.i(72016),l=a.i(50488),m=a.i(71238),n=a.i(33511),o=a.i(1585),p=a.i(25674);let q=(0,p.createServerReference)("60df406c22a3227638ff7db58816a314f1d2146c5f",p.callServer,void 0,p.findSourceMapURL,"approveFeature");var r=a.i(48190),s=a.i(47925);let t=(0,p.createServerReference)("70920ee87019d1787a9a74c23dafc016993bcd6660",p.callServer,void 0,p.findSourceMapURL,"rejectFeature"),u=(0,p.createServerReference)("4024147c56de6e44960f12e27adb2fece4e3add5c3",p.callServer,void 0,p.findSourceMapURL,"getFeatureArtifact"),v=(0,p.createServerReference)("40fba7b2d31716bc42e3141aabdd8514e9cf0237bc",p.callServer,void 0,p.findSourceMapURL,"getResearchArtifact"),w=(0,p.createServerReference)("403b94d240bc2ae3c10403234048bdb19a3bb31e31",p.callServer,void 0,p.findSourceMapURL,"getMergeReviewData");var x=a.i(21333),y=a.i(19884),z=a.i(96213),A=a.i(18662),B=a.i(84871);a.i(78454);var C=a.i(24255);a.i(49235);var D=a.i(85080),E=a.i(18948),F=a.i(82934);a.i(77569);var G=a.i(65310);a.i(69029);var H=a.i(5623),I=a.i(63698),J=a.i(3195),K=a.i(71716),L=a.i(82697),M=a.i(75192);function N({actions:a,repositoryPath:d,worktreePath:e,showSpecs:g}){let[h,i]=(0,c.useState)(!1),m=a.ideLoading||a.shellLoading||a.folderLoading||a.specsLoading,n=a.ideError??a.shellError??a.folderError??a.specsError;return(0,b.jsxs)(M.DropdownMenu,{modal:!1,children:[(0,b.jsx)(M.DropdownMenuTrigger,{asChild:!0,children:(0,b.jsxs)(E.Button,{variant:"outline",size:"sm",className:"gap-1.5",disabled:m,children:[m?(0,b.jsx)(f.Loader2,{className:"size-4 animate-spin"}):n?(0,b.jsx)(L.CircleAlert,{className:"text-destructive size-4"}):(0,b.jsx)(J.FolderOpen,{className:"size-4"}),"Open",(0,b.jsx)(K.ChevronDown,{className:"size-3 opacity-60"})]})}),(0,b.jsxs)(M.DropdownMenuContent,{align:"start",className:"w-48",children:[(0,b.jsx)(M.DropdownMenuLabel,{children:"Open in"}),(0,b.jsxs)(M.DropdownMenuItem,{onClick:a.openInIde,disabled:a.ideLoading,className:"gap-2",children:[a.ideLoading?(0,b.jsx)(f.Loader2,{className:"size-4 animate-spin"}):a.ideError?(0,b.jsx)(L.CircleAlert,{className:"text-destructive size-4"}):(0,b.jsx)(l.Code2,{className:"size-4"}),"IDE"]}),(0,b.jsxs)(M.DropdownMenuItem,{onClick:a.openInShell,disabled:a.shellLoading,className:"gap-2",children:[a.shellLoading?(0,b.jsx)(f.Loader2,{className:"size-4 animate-spin"}):a.shellError?(0,b.jsx)(L.CircleAlert,{className:"text-destructive size-4"}):(0,b.jsx)(I.Terminal,{className:"size-4"}),"Terminal"]}),(0,b.jsxs)(M.DropdownMenuItem,{onClick:a.openFolder,disabled:a.folderLoading,className:"gap-2",children:[a.folderLoading?(0,b.jsx)(f.Loader2,{className:"size-4 animate-spin"}):a.folderError?(0,b.jsx)(L.CircleAlert,{className:"text-destructive size-4"}):(0,b.jsx)(J.FolderOpen,{className:"size-4"}),"Folder"]}),(0,b.jsxs)(M.DropdownMenuItem,{onClick:a.openSpecsFolder,disabled:a.specsLoading||!g,className:"gap-2",children:[a.specsLoading?(0,b.jsx)(f.Loader2,{className:"size-4 animate-spin"}):a.specsError?(0,b.jsx)(L.CircleAlert,{className:"text-destructive size-4"}):(0,b.jsx)(J.FolderOpen,{className:"size-4"}),"Specs Folder"]}),(0,b.jsx)(M.DropdownMenuSeparator,{}),(0,b.jsxs)(M.DropdownMenuItem,{onClick:()=>{navigator.clipboard.writeText(e??d),i(!0),setTimeout(()=>i(!1),2e3)},className:"gap-2",children:[h?(0,b.jsx)(k.Check,{className:"size-4 text-green-600"}):(0,b.jsx)(j.Copy,{className:"size-4"}),h?"Copied!":"Copy path"]})]})]})}var O=a.i(72980),P=a.i(41305),Q=a.i(13126);let R=(0,p.createServerReference)("404448339598bf79010d8c21ede924cbf8727a9729",p.callServer,void 0,p.findSourceMapURL,"getFeaturePhaseTimings"),S=(0,p.createServerReference)("409b0ca256f8caeb599e4c9159391e77f762bac18c",p.callServer,void 0,p.findSourceMapURL,"getFeaturePlan");var T=a.i(94132),U=a.i(3410),V=a.i(85536),W=a.i(58339),X=a.i(45242),Y=a.i(25700);let Z=(0,Y.default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var $=a.i(91498),_=a.i(79620);a.i(307);var aa=a.i(30931),ab=a.i(39116);let ac=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]);function ad({onReject:a,onApprove:d,approveLabel:e,approveVariant:f="default",revisionPlaceholder:g,isProcessing:h=!1,isRejecting:i=!1,children:j,chatInput:l,onChatInputChange:m}){let n="warning"===f,o=n?$.AlertTriangle:k.Check,p=n?"bg-orange-500/85":"bg-blue-500/85",[q,r]=(0,c.useState)(""),s=l??q,t=m??r,u=(0,y.useSoundAction)("approve"),v=h||i,[w,x]=(0,c.useState)([]),[z,A]=(0,c.useState)(!1),[B,C]=(0,c.useState)(null),[D,G]=(0,c.useState)(!1),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)(!1),L=s.trim().length>0,M=L?D||H&&J:!D,N=(0,c.useRef)(0),O=(0,c.useRef)(crypto.randomUUID()),P=(0,c.useRef)(null);(0,c.useEffect)(()=>{function a(a){("Control"===a.key||"Meta"===a.key)&&I(!0),"Shift"===a.key&&K(!0)}function b(a){("Control"===a.key||"Meta"===a.key)&&I(!1),"Shift"===a.key&&K(!1)}function c(){I(!1),K(!1)}return window.addEventListener("keydown",a),window.addEventListener("keyup",b),window.addEventListener("blur",c),()=>{window.removeEventListener("keydown",a),window.removeEventListener("keyup",b),window.removeEventListener("blur",c)}},[]);let Q=(0,c.useCallback)(async a=>{for(let b of(C(null),a)){if(b.size>0xa00000)return void C(`"${b.name}" exceeds 10 MB limit`);let a=function(a){let b=a.lastIndexOf(".");return b>=0?a.slice(b).toLowerCase():""}(b.name);if(a&&!ac.has(a))return void C(`File type "${a}" is not allowed`)}for(let b of a){let a=crypto.randomUUID();x(c=>[...c,{id:a,name:b.name,size:b.size,mimeType:b.type||"application/octet-stream",path:"",loading:!0}]);try{let c=new FormData;c.append("file",b),c.append("sessionId",O.current);let d=await fetch("/api/attachments/upload",{method:"POST",body:c});if(!d.ok){let b=await d.json().catch(()=>({error:"Upload failed"}));x(b=>b.filter(b=>b.id!==a)),C(b.error??"Upload failed");return}let e=await d.json();x(b=>b.some(b=>b.id!==a&&b.path===e.path)?b.filter(b=>b.id!==a):b.map(b=>b.id===a?{...e,id:a,loading:!1}:b))}catch{x(b=>b.filter(b=>b.id!==a)),C("Upload failed")}}},[]),R=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),N.current+=1,1===N.current&&A(!0)},[]),S=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),N.current-=1,0===N.current&&A(!1)},[]),U=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation()},[]),W=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),N.current=0,A(!1);let b=Array.from(a.dataTransfer.files);b.length>0&&Q(b)},[Q]),Y=(0,c.useCallback)(a=>{let b=a.clipboardData?.items;if(!b)return;let c=[];for(let a of Array.from(b))if("file"===a.kind){let b=a.getAsFile();b&&c.push(b)}c.length>0&&(a.preventDefault(),Q(c))},[Q]),ad=(0,c.useCallback)(async()=>{try{let a=await (0,ab.pickFiles)();a&&x(b=>{let c=new Set(b.map(a=>a.path)),d=a.filter(a=>!c.has(a.path)).map(a=>({id:crypto.randomUUID(),name:a.name,size:a.size,mimeType:"application/octet-stream",path:a.path}));return d.length>0?[...b,...d]:b})}catch{}},[]),ae=(0,c.useCallback)(a=>{x(b=>b.filter(b=>b.id!==a))},[]),af=(0,c.useCallback)((a,b)=>{x(c=>c.map(c=>c.id===a?{...c,notes:b}:c))},[]),ag=(0,c.useCallback)(()=>{t(""),x([]),C(null)},[t]),ah=(0,c.useCallback)(a=>{(a.ctrlKey||a.metaKey)&&"Enter"===a.key&&(a.preventDefault(),P.current?.requestSubmit())},[]),ai="u">typeof navigator&&/Mac/i.test(navigator.userAgent)?"⌘":"Ctrl";return(0,b.jsxs)("div",{className:"border-border shrink-0 border-t",children:[j,a?(0,b.jsx)(F.TooltipProvider,{delayDuration:400,children:(0,b.jsx)("form",{ref:P,onSubmit:function(b){b.preventDefault();let c=s.trim();if(M)u.play(),d(),ag();else{if(!c||!a)return;a(c,w.filter(a=>!a.loading)),ag()}},className:"p-3",children:(0,b.jsx)("div",{role:"region","aria-label":"File drop zone","data-drag-over":z?"true":"false",onDragEnter:R,onDragLeave:S,onDragOver:U,onDrop:W,className:(0,V.cn)("rounded-md border-2 border-transparent transition-colors",z&&"border-primary/50 bg-primary/5"),children:(0,b.jsxs)("div",{className:"border-input focus-within:ring-ring/50 focus-within:border-ring flex flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]",children:[(0,b.jsx)(_.Textarea,{placeholder:g??"Ask AI to revise...","aria-label":g??"Ask AI to revise...",disabled:v,value:s,onChange:a=>t(a.target.value),onKeyDown:ah,onPaste:Y,rows:1,className:"max-h-[35dvh] min-h-9 flex-1 resize-none overflow-y-auto rounded-none border-0 py-2 shadow-none focus-visible:ring-0","data-testid":"drawer-chat-input"}),w.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:w.map(a=>(0,b.jsx)(aa.AttachmentChip,{name:a.name,size:a.size,mimeType:a.mimeType,path:a.path,onRemove:()=>ae(a.id),disabled:v,loading:a.loading,notes:a.notes,onNotesChange:b=>af(a.id,b)},a.id))}),B?(0,b.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:B}):null,(0,b.jsxs)("div",{className:"border-input flex items-center gap-2 border-t px-3 py-1.5",children:[(0,b.jsxs)("span",{className:"text-muted-foreground flex-1 truncate text-[11px]",children:[(0,b.jsxs)("kbd",{className:"bg-muted rounded px-1 py-0.5 font-mono text-[10px]",children:[ai,"+Enter"]})," ",L?"reject":"approve"]}),(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:ad,disabled:v,"aria-label":"Attach files",className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,b.jsx)(X.PaperclipIcon,{className:"h-4 w-4"})})}),(0,b.jsx)(F.TooltipContent,{side:"top",children:"Attach files"})]}),(0,b.jsx)("div",{onMouseLeave:()=>G(!1),children:(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("button",{type:"submit",disabled:v,"data-testid":"drawer-action-submit",className:(0,V.cn)("relative flex h-9 min-w-[12rem] cursor-pointer items-center overflow-hidden rounded-md border pr-10 pl-4 text-sm font-medium whitespace-nowrap transition-colors","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",M?`${n?"border-orange-400/60":"border-blue-400/60"} text-white`:L&&H&&!J?"border-primary bg-muted ring-primary/30 shadow-sm ring-1":"border-border bg-muted/50 hover:bg-muted shadow-sm"),children:[(0,b.jsx)("div",{className:(0,V.cn)("pointer-events-none absolute inset-0 transition-transform duration-300 ease-in-out",p),style:{transform:M?"translateX(0)":"translateX(100%)"}}),(0,b.jsxs)("span",{className:(0,V.cn)("absolute inset-0 z-10 flex items-center justify-center gap-2 pr-8 transition-opacity duration-300",M?"opacity-0":"opacity-100"),children:[(0,b.jsx)(Z,{className:"h-4 w-4 shrink-0"}),"Reject"]}),(0,b.jsxs)("span",{className:(0,V.cn)("absolute inset-0 z-10 flex items-center justify-center gap-2 text-white transition-opacity duration-300",M?"opacity-100":"opacity-0"),children:[(0,b.jsx)(o,{className:"h-4 w-4 shrink-0"}),e]}),(0,b.jsx)("span",{className:(0,V.cn)(`border-input/60 absolute inset-y-0 right-0 z-20 flex w-8 cursor-pointer items-center justify-center rounded-r-[5px] border-l ${p} transition-opacity duration-300`,!L&&!D&&"pointer-events-none opacity-0"),onMouseEnter:()=>G(!0),children:(0,b.jsx)(T.ChevronLeft,{className:"h-4 w-4 text-white"})})]})}),n?null:(0,b.jsx)(F.TooltipContent,{side:"top",children:M?e:"Send revision feedback"})]})})]})]})})})}):(0,b.jsx)("div",{className:"flex items-center gap-2 px-4 pb-4",children:(0,b.jsx)(E.Button,{type:"button",className:"flex-1",disabled:v,onClick:()=>{u.play(),d()},children:e})})]})}function ae({data:a,selections:d,onSelect:e,onApprove:f,onReject:g,isProcessing:h=!1,isRejecting:i=!1,showHeader:j=!1,chatInput:k,onChatInputChange:l}){let{question:m,context:n,questions:o,finalAction:p}=a,[q,r]=(0,c.useState)(0),s=(0,y.useSoundAction)("select"),t=(0,y.useSoundAction)("navigate"),u=o.length,v=q===u-1,w=o[q],x=(0,c.useMemo)(()=>Object.keys(d).length,[d]),z=(0,c.useCallback)((a,b)=>{s.play(),e(a,b),v||setTimeout(()=>r(a=>a+1),250)},[e,v,s]);return 0===u?null:(0,b.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,b.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[j?(0,b.jsxs)("div",{className:"border-border flex items-start gap-3 border-b pb-3",children:[(0,b.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full bg-amber-500"}),(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("h3",{className:"text-foreground mb-1.5 text-sm font-bold",children:m}),(0,b.jsx)("p",{className:"text-muted-foreground text-xs leading-relaxed",children:n})]})]}):null,(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsxs)("label",{className:"text-foreground min-w-0 flex-1 text-sm font-semibold",children:[q+1,". ",w.question]}),(0,b.jsx)("div",{className:"mt-1.5 flex shrink-0 gap-1",children:o.map((a,c)=>(0,b.jsx)("button",{type:"button","aria-label":`Go to question ${c+1}`,className:(0,V.cn)("h-1.5 rounded-full transition-all duration-200",c===q?"bg-primary w-4":"w-1.5",c!==q&&d[a.id]?"bg-primary/50":"",c===q||d[a.id]?"":"bg-muted-foreground/25"),onClick:()=>{t.play(),r(c)}},a.id))})]}),(0,b.jsx)("div",{className:"space-y-2",children:w.options.map((a,c)=>{let e=d[w.id]===a.id,f=String.fromCharCode(65+c);return(0,b.jsx)("button",{type:"button",className:(0,V.cn)("border-border w-full overflow-hidden rounded-md border px-3 py-3 text-left text-xs transition-all","hover:border-primary/70 hover:bg-primary/5 group",e&&"border-primary bg-primary/5",a.isNew&&"animate-option-highlight"),disabled:h,onClick:()=>z(w.id,a.id),children:(0,b.jsxs)("div",{className:"flex items-start gap-2",children:[(0,b.jsxs)("span",{className:"text-muted-foreground mt-0.5 font-mono text-xs",children:[f,"."]}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("div",{className:"text-foreground mb-0.5 text-xs font-semibold wrap-break-word",children:a.label}),(0,b.jsx)("div",{className:"text-muted-foreground text-xs leading-snug",children:a.rationale})]}),a.recommended||a.isNew?(0,b.jsx)("div",{className:"shrink-0 pt-0.5",children:a.recommended?(0,b.jsx)(W.Badge,{className:"px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):(0,b.jsx)(W.Badge,{className:"border-transparent bg-emerald-600 px-1.5 py-0 text-[10px] whitespace-nowrap text-white hover:bg-emerald-600/80",children:"New"})}):null]})},a.id)})})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,b.jsxs)(E.Button,{type:"button",variant:"ghost",size:"sm",disabled:0===q||h,onClick:()=>{t.play(),r(a=>a-1)},children:[(0,b.jsx)(T.ChevronLeft,{className:"mr-1 h-4 w-4"}),"Previous"]}),v?null:(0,b.jsxs)(E.Button,{type:"button",variant:"ghost",size:"sm",disabled:h,onClick:()=>{t.play(),r(a=>a+1)},children:[d[w.id]?"Next":"Skip",(0,b.jsx)(U.ChevronRight,{className:"ml-1 h-4 w-4"})]})]})]}),(0,b.jsx)(ad,{onReject:g,onApprove:()=>f(p.id),approveLabel:p.label,revisionPlaceholder:"Ask AI to refine requirements...",isProcessing:h,isRejecting:i,chatInput:k,onChatInputChange:l,children:(0,b.jsx)("div",{className:(0,V.cn)("bg-muted h-1.5 overflow-hidden",x>0&&x<u||h?"opacity-100":"opacity-0","transition-opacity duration-200"),"data-testid":"progress-bar-container",children:h?(0,b.jsx)("div",{className:"bg-primary animate-indeterminate-progress h-full w-1/3"}):(0,b.jsx)("div",{className:"bg-primary h-full transition-all duration-300",style:{width:`${u>0?x/u*100:0}%`},"data-testid":"progress-bar"})})})]})}var af=a.i(77610);let ag=(0,Y.default)("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),ah=(0,Y.default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),ai={p:({children:a})=>(0,b.jsx)("p",{className:"text-muted-foreground mb-2 text-xs leading-relaxed last:mb-0",children:a}),strong:({children:a})=>(0,b.jsx)("strong",{className:"text-foreground font-semibold",children:a}),em:({children:a})=>(0,b.jsx)("em",{className:"italic",children:a}),code:({children:a,className:c})=>c?(0,b.jsx)("code",{className:`${c} text-[11px]`,children:a}):(0,b.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:a}),pre:({children:a})=>(0,b.jsx)("pre",{className:"bg-muted my-2 overflow-x-auto rounded-lg border p-3",children:a}),ul:({children:a})=>(0,b.jsx)("ul",{className:"text-muted-foreground mb-2 list-disc space-y-1 pl-4 text-xs",children:a}),ol:({children:a})=>(0,b.jsx)("ol",{className:"text-muted-foreground mb-2 list-decimal space-y-1 pl-4 text-xs",children:a}),li:({children:a})=>(0,b.jsx)("li",{className:"leading-relaxed",children:a}),a:({children:a,href:c})=>(0,b.jsx)("a",{href:c,className:"text-primary underline underline-offset-2",target:"_blank",rel:"noopener noreferrer",children:a})};function aj({decision:a,index:d}){let[e,f]=(0,c.useState)(!1),g=(0,y.useSoundAction)("expand"),h=(0,y.useSoundAction)("collapse");return(0,b.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,b.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,b.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:d+1}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:a.title}),(0,b.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:a.chosen})]})]}),"decisionName"in a&&a.decisionName?(0,b.jsx)(W.Badge,{variant:"secondary",className:"bg-primary/10 text-primary shrink-0",children:a.decisionName}):null]}),a.rationale?(0,b.jsx)(af.default,{components:ai,children:a.rationale}):null]}),a.rejected.length>0?(0,b.jsxs)("div",{className:"border-border border-t",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>{e?h.play():g.play(),f(a=>!a)},className:"text-muted-foreground hover:bg-muted/50 flex w-full items-center gap-1.5 px-4 py-3 text-xs font-medium transition-colors",children:[(0,b.jsx)(U.ChevronRight,{className:`h-3.5 w-3.5 transition-transform ${e?"rotate-90":""}`}),(0,b.jsx)(ah,{className:"h-3.5 w-3.5"}),"Other Options Considered (",a.rejected.length,")"]}),e?(0,b.jsx)("div",{className:"space-y-1.5 px-4 pb-3",children:a.rejected.map(a=>(0,b.jsx)("div",{className:"bg-primary/5 rounded-md px-3 py-2",children:(0,b.jsx)("span",{className:"text-foreground text-xs",children:a})},a))}):null]}):null]})}function ak({data:a}){let{summary:c,decisions:d}=a;return 0===d.length?null:(0,b.jsxs)("div",{className:"space-y-4 p-4",children:[(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("h2",{className:"text-foreground text-sm font-bold",children:"Technical Implementation Plan Review"}),c?(0,b.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:c}):null]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,b.jsx)(ag,{className:"text-primary h-4 w-4"}),(0,b.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Technical Decisions"})]}),d.map((a,c)=>(0,b.jsx)(aj,{decision:a,index:c},a.title))]})}var al=a.i(69428);function am({item:a,index:c}){return(0,b.jsx)("div",{className:"border-border rounded-lg border",children:(0,b.jsx)("div",{className:"space-y-2 px-4 py-3",children:(0,b.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,b.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:c+1}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:a.question}),(0,b.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,b.jsx)("p",{className:"text-muted-foreground min-w-0 truncate text-xs",children:a.selectedOption}),a.wasRecommended?(0,b.jsx)(W.Badge,{className:"shrink-0 px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):null]})]})]})})})}function an({data:a}){let{questions:c}=a;return 0===c.length?null:(0,b.jsxs)("div",{className:"space-y-4 p-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(al.ClipboardList,{className:"text-primary h-4 w-4"}),(0,b.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Product Decisions"})]}),c.map((a,c)=>(0,b.jsx)(am,{item:a,index:c},a.question))]})}let ao=(0,Y.default)("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);var ap=a.i(92548),aq=a.i(53170);let ar=(0,Y.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),as=(0,Y.default)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);var at=a.i(62147);let au=(0,Y.default)("monitor-play",[["path",{d:"M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z",key:"vbtd3f"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);var av=a.i(9955),aw=a.i(67075),ax=a.i(58428),ax=ax,ay=a.i(46847);function az({status:a}){switch(a){case ay.CiStatus.Success:return(0,b.jsxs)(W.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,b.jsx)(aw.CheckCircle2,{className:"mr-1 h-3.5 w-3.5"}),"Passing"]});case ay.CiStatus.Pending:return(0,b.jsxs)(W.Badge,{className:"border-transparent bg-yellow-50 text-yellow-700 hover:bg-yellow-50",children:[(0,b.jsx)(f.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin"}),"Pending"]});case ay.CiStatus.Failure:return(0,b.jsxs)(W.Badge,{className:"border-transparent bg-red-50 text-red-700 hover:bg-red-50",children:[(0,b.jsx)(ax.default,{className:"mr-1 h-3.5 w-3.5"}),"Failing"]})}}let aA=(0,Y.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]),aB=(0,Y.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]),aC=(0,Y.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]),aD={added:{icon:aA,label:"A",className:"text-green-600"},modified:{icon:aC,label:"M",className:"text-amber-600"},deleted:{icon:aB,label:"D",className:"text-red-600"},renamed:{icon:aC,label:"R",className:"text-blue-600"}};function aE({status:a}){let c=aD[a],d=c.icon;return(0,b.jsx)(d,{className:(0,V.cn)("h-3.5 w-3.5 shrink-0",c.className)})}function aF({hunk:a}){return(0,b.jsxs)("div",{className:"border-border border-t first:border-t-0",children:[(0,b.jsx)("div",{className:"bg-muted/50 text-muted-foreground px-3 py-1 font-mono text-[10px]",children:a.header}),(0,b.jsx)("div",{className:"font-mono text-[11px] leading-[18px]",children:a.lines.map(a=>(0,b.jsxs)("div",{className:(0,V.cn)("flex","added"===a.type&&"bg-green-50 dark:bg-green-950/30","removed"===a.type&&"bg-red-50 dark:bg-red-950/30"),children:[(0,b.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-right text-[10px] select-none",children:a.oldNumber??""}),(0,b.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-right text-[10px] select-none",children:a.newNumber??""}),(0,b.jsx)("span",{className:(0,V.cn)("w-4 shrink-0 text-center select-none","added"===a.type&&"text-green-700 dark:text-green-400","removed"===a.type&&"text-red-700 dark:text-red-400"),children:"added"===a.type?"+":"removed"===a.type?"-":" "}),(0,b.jsx)("span",{className:"min-w-0 flex-1 pr-2 break-all whitespace-pre-wrap",children:a.content})]},`${a.type}-${a.oldNumber??""}-${a.newNumber??""}`))})]})}function aG({file:a}){let[d,e]=(0,c.useState)(!1),f=a.path.split("/").pop()??a.path,g=a.path.includes("/")?a.path.slice(0,a.path.lastIndexOf("/")):"";return(0,b.jsxs)("div",{className:"border-border border-b last:border-b-0",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>e(!d),className:"hover:bg-muted/50 flex w-full items-center gap-2 px-3 py-2 text-left",children:[(0,b.jsx)(U.ChevronRight,{className:(0,V.cn)("text-muted-foreground h-3 w-3 shrink-0 transition-transform duration-150",d&&"rotate-90")}),(0,b.jsx)(aE,{status:a.status}),(0,b.jsx)("span",{className:"text-foreground min-w-0 flex-1 truncate text-xs",children:g?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[g,"/"]}),f]}):f}),a.oldPath?(0,b.jsxs)("span",{className:"text-muted-foreground truncate text-[10px]",children:["← ",a.oldPath.split("/").pop()]}):null,(0,b.jsxs)("span",{className:"shrink-0 text-[10px]",children:[a.additions>0?(0,b.jsxs)("span",{className:"text-green-600",children:["+",a.additions]}):null,a.additions>0&&a.deletions>0?" ":null,a.deletions>0?(0,b.jsxs)("span",{className:"text-red-600",children:["-",a.deletions]}):null]})]}),d&&a.hunks.length>0?(0,b.jsx)("div",{className:"border-border overflow-x-auto border-t",children:a.hunks.map(a=>(0,b.jsx)(aF,{hunk:a},a.header))}):null]})}function aH({fileDiffs:a}){return 0===a.length?null:(0,b.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,b.jsx)("div",{className:"px-4 py-3",children:(0,b.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,b.jsx)(at.FileText,{className:"text-muted-foreground h-4 w-4"}),(0,b.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changed Files"}),(0,b.jsxs)("span",{className:"text-muted-foreground text-[10px]",children:["(",a.length,")"]})]})}),(0,b.jsx)("div",{className:"border-border border-t",children:a.map(a=>(0,b.jsx)(aG,{file:a},`${a.status}-${a.path}`))})]})}let aI={Screenshot:as,Video:au,TestOutput:at.FileText,TerminalRecording:I.Terminal},aJ=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp"]),aK=new Set([".mp4",".webm",".mov"]);function aL({evidence:a}){var d,e;let f,[g,h]=(0,c.useState)(!0),i=aI[a.type]??as,j=(f=(d=a.relativePath).lastIndexOf("."))>=0?d.slice(f).toLowerCase():"",k=(e=a.relativePath,`/api/evidence?path=${encodeURIComponent(e)}`),l="Screenshot"===a.type||aJ.has(j),m="Video"===a.type||aK.has(j),n="TestOutput"===a.type||"TerminalRecording"===a.type;return(0,b.jsxs)("li",{className:"border-border rounded-md border",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>h(!g),className:"flex w-full cursor-pointer items-center gap-2.5 px-3 py-2.5 text-left",children:[g?(0,b.jsx)(K.ChevronDown,{className:"text-muted-foreground h-3 w-3 shrink-0"}):(0,b.jsx)(U.ChevronRight,{className:"text-muted-foreground h-3 w-3 shrink-0"}),(0,b.jsx)(i,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("span",{className:"text-foreground text-xs font-medium",children:a.description}),a.taskRef?(0,b.jsxs)("span",{className:"text-muted-foreground ml-1.5 text-[10px]",children:["(",a.taskRef,")"]}):null]}),(0,b.jsx)("a",{href:k,download:!0,onClick:a=>a.stopPropagation(),className:"text-muted-foreground hover:text-foreground shrink-0 rounded p-1 transition-colors","aria-label":"Download",children:(0,b.jsx)(av.Download,{className:"h-3 w-3"})})]}),g&&k?(0,b.jsx)("div",{className:"border-border border-t px-3 py-2.5",children:l?(0,b.jsx)("img",{src:k,alt:a.description,className:"max-h-80 w-full rounded-md border object-contain",loading:"lazy"}):m?(0,b.jsx)("video",{src:k,controls:!0,className:"max-h-80 w-full rounded-md border",preload:"metadata",children:(0,b.jsx)("track",{kind:"captions"})}):n?(0,b.jsx)(aM,{url:k}):(0,b.jsx)("p",{className:"text-muted-foreground truncate font-mono text-[10px]",children:a.relativePath})}):null,null]})}function aM({url:a}){let[d,e]=(0,c.useState)(null),[f,g]=(0,c.useState)(!1);return f?d?(0,b.jsx)("pre",{className:"bg-muted/50 max-h-60 overflow-auto rounded-md p-3 font-mono text-[11px] leading-relaxed",children:d}):(0,b.jsx)("p",{className:"text-muted-foreground text-[10px]",children:"Unable to load preview"}):(fetch(a).then(a=>a.ok?a.text():Promise.reject(Error("Failed"))).then(a=>{let b=a.split("\n");e(b.length>100?`${b.slice(0,100).join("\n")}
|
|
2
|
-
...`:a)}).catch(()=>e(null)).finally(()=>g(!0)),(0,b.jsx)("div",{className:"bg-muted/50 h-16 animate-pulse rounded-md"}))}function aN({evidence:a}){return(0,b.jsx)("div",{className:"border-border rounded-lg border",children:(0,b.jsxs)("div",{className:"px-4 py-3",children:[(0,b.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,b.jsx)(as,{className:"text-muted-foreground h-4 w-4"}),(0,b.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Evidence"}),(0,b.jsx)(W.Badge,{variant:"secondary",className:"text-[10px]",children:a.length})]}),(0,b.jsx)("ul",{className:"space-y-2",children:a.map(a=>(0,b.jsx)(aL,{evidence:a},`${a.type}-${a.relativePath}`))})]})})}function aO({data:a,readOnly:c=!1,onApprove:d,onReject:e,isProcessing:f=!1,isRejecting:g=!1,chatInput:h,onChatInputChange:i}){let{pr:j,diffSummary:k,fileDiffs:l,branch:n,warning:o,evidence:p,hideCiStatus:q}=a,r=j?.mergeable===!1,s=r&&e?()=>e("Resolve merge conflicts",[]):d;return(0,b.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,b.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-emerald-500"}),(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("h2",{className:"text-foreground text-sm font-bold",children:c?"Merge History":"Merge Review"}),(0,b.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:c?"This feature was merged. Review the pull request details and evidence below.":j?"Review the pull request details and approve to merge.":"Review the changes and approve to merge."})]})]}),n?(0,b.jsx)("div",{className:"border-border rounded-lg border",children:(0,b.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,b.jsx)(aq.GitBranch,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,b.jsx)(W.Badge,{variant:"secondary",className:"font-mono text-[11px]",children:n.source}),(0,b.jsx)(ar,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,b.jsx)(W.Badge,{variant:"outline",className:"font-mono text-[11px]",children:n.target})]})}):null,j?(0,b.jsx)("div",{className:"border-border rounded-lg border",children:(0,b.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("a",{href:j.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",j.number,(0,b.jsx)(m.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,b.jsx)(W.Badge,{variant:"outline",className:"text-xs",children:j.status})]}),!1===j.mergeable?(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Merge Status"}),(0,b.jsxs)(W.Badge,{className:"border-transparent bg-orange-50 text-orange-700 hover:bg-orange-50",children:[(0,b.jsx)($.AlertTriangle,{className:"mr-1 h-3.5 w-3.5"}),"Conflicts"]})]}):null,j.ciStatus&&!0!==q?(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,b.jsx)(az,{status:j.ciStatus})]}):null,j.commitHash?(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)(ap.GitCommitHorizontal,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,b.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:j.commitHash.slice(0,7)})]})]}):null]})}):null,k?(0,b.jsx)("div",{className:"border-border rounded-lg border",children:(0,b.jsxs)("div",{className:"px-4 py-3",children:[(0,b.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,b.jsx)(ao,{className:"text-muted-foreground h-4 w-4"}),(0,b.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changes"})]}),(0,b.jsxs)("div",{className:"grid grid-cols-4 gap-3",children:[(0,b.jsxs)("div",{className:"text-center",children:[(0,b.jsx)("div",{className:"text-foreground text-sm font-bold",children:k.filesChanged}),(0,b.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"files"})]}),(0,b.jsxs)("div",{className:"text-center",children:[(0,b.jsxs)("div",{className:"text-sm font-bold text-green-600",children:["+",k.additions]}),(0,b.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"additions"})]}),(0,b.jsxs)("div",{className:"text-center",children:[(0,b.jsxs)("div",{className:"text-sm font-bold text-red-600",children:["-",k.deletions]}),(0,b.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"deletions"})]}),(0,b.jsxs)("div",{className:"text-center",children:[(0,b.jsx)("div",{className:"text-foreground text-sm font-bold",children:k.commitCount}),(0,b.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"commits"})]})]})]})}):o?(0,b.jsx)("div",{className:"border-border rounded-lg border",children:(0,b.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,b.jsx)($.AlertTriangle,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:o})]})}):null,p&&p.length>0?(0,b.jsx)(aN,{evidence:p}):null,l&&l.length>0?(0,b.jsx)(aH,{fileDiffs:l}):null]}),!c&&(0,b.jsx)(ad,{onReject:e,onApprove:s,approveLabel:r?"Resolve Conflicts":"Approve Merge",approveVariant:r?"warning":"default",revisionPlaceholder:"Ask AI to revise before merging...",isProcessing:f,isRejecting:g,chatInput:h,onChatInputChange:i})]})}let aP=(0,Y.default)("file-search",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]]);var aQ=a.i(18615);let aR=(0,Y.default)("shield-check",[["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:"m9 12 2 2 4-4",key:"dzmm74"}]]);var aS=a.i(2807),aT=a.i(3942),aU=a.i(45670),aV=a.i(26633),aW=a.i(73998);let aX=(0,Y.default)("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]),aY=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function aZ(a){let b=a.lastIndexOf(".");return b>=0&&aY.has(a.slice(b).toLowerCase())}function a$(a){let b=a.lastIndexOf(".")>=0?a.slice(a.lastIndexOf(".")):"",c=aZ(a)?`image/${b.slice(1).replace("jpg","jpeg")}`:"",d=new URLSearchParams({path:a,...c&&{mimeType:c}});return`/api/attachments/preview?${d.toString()}`}let a_=/(?:^|\s)@(\/[^\s]+)/g;function a0({text:a,attachmentPaths:c}){let d=function(a){let b=[],c=0;for(let d of a.matchAll(a_)){let e=d.index,f=e+(d[0].length-d[0].trimStart().length);f>c&&b.push({type:"text",value:a.slice(c,f)}),b.push({type:"attachment",path:d[1]}),c=e+d[0].length}return c<a.length&&b.push({type:"text",value:a.slice(c)}),b}(a),e=d.some(a=>"attachment"===a.type),f=c?.filter(Boolean)??[];return e||0!==f.length?(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[d.map(a=>{if("text"===a.type){let c=a.value.trim();return c?(0,b.jsx)("span",{className:"text-sm leading-relaxed",children:c},`text-${c.slice(0,40)}`):null}return(0,b.jsx)(a1,{path:a.path},`att-${a.path}`)}),f.map(a=>(0,b.jsx)(a1,{path:a},`extra-${a}`))]}):(0,b.jsx)("span",{className:"text-sm leading-relaxed",children:a})}function a1({path:a}){let d=a.split("/").pop()??a,[e,f]=(0,c.useState)(!1);return aZ(a)?e?(0,b.jsxs)("div",{"data-testid":"inline-attachment-image-error",className:"text-muted-foreground flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:[(0,b.jsx)(aX,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"truncate",children:d})]}):(0,b.jsxs)(aU.Dialog,{children:[(0,b.jsx)(aU.DialogTrigger,{asChild:!0,children:(0,b.jsx)("img",{src:a$(a),alt:d,"data-testid":"inline-attachment-image",onError:()=>f(!0),className:"max-h-48 max-w-full cursor-pointer rounded-md border object-contain transition-opacity hover:opacity-80"})}),(0,b.jsxs)(aU.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,b.jsx)(aV.VisuallyHidden.Root,{children:(0,b.jsxs)(aU.DialogTitle,{children:["Preview: ",d]})}),(0,b.jsx)("div",{className:"relative bg-black/90",children:(0,b.jsx)("img",{src:a$(a),alt:d,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,b.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,b.jsx)("div",{className:"flex min-w-0 flex-1 flex-col",children:(0,b.jsx)("span",{className:"truncate text-sm font-medium",children:d})}),(0,b.jsx)("a",{href:a$(a),download:d,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${d}`,children:(0,b.jsx)(aW.DownloadIcon,{className:"h-4 w-4"})})]})]})]}):(0,b.jsx)("a",{href:a$(a),download:d,"data-testid":"inline-attachment-file",className:"text-primary text-sm underline underline-offset-2",children:d})}let a2=(0,a.i(42261).cva)("inline-block shrink-0",{variants:{size:{sm:"size-5",md:"size-8",lg:"size-12"}},defaultVariants:{size:"md"}}),a3=[{r:9,spline:"0.12 0 0.04 1",opacity:1},{r:8.2,spline:"0.16 0 0.08 1",opacity:.95},{r:7.4,spline:"0.20 0 0.12 1",opacity:.9},{r:6.6,spline:"0.25 0 0.16 1",opacity:.84},{r:5.8,spline:"0.30 0 0.20 1",opacity:.76},{r:5,spline:"0.36 0 0.25 1",opacity:.67},{r:4.2,spline:"0.42 0 0.31 1",opacity:.56},{r:3.4,spline:"0.48 0 0.37 1",opacity:.44},{r:2.6,spline:"0.55 0 0.44 1",opacity:.32},{r:1.8,spline:"0.62 0 0.52 1",opacity:.2},{r:1,spline:"0.70 0 0.60 1",opacity:.1}];function a4({className:a,size:c="md",duration:d=5,...e}){return(0,b.jsxs)("svg",{"data-slot":"comet-spinner",role:"status","aria-label":"Loading",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:(0,V.cn)(a2({size:c}),a),...e,children:[(0,b.jsx)("defs",{children:(0,b.jsxs)("filter",{id:"comet-gooey",x:"-100%",y:"-100%",width:"300%",height:"300%",colorInterpolationFilters:"sRGB",children:[(0,b.jsx)("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"2.5"}),(0,b.jsx)("feColorMatrix",{mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 50 -30",result:"goo"})]})}),(0,b.jsxs)("g",{filter:"url(#comet-gooey)",children:[(0,b.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 50 50",to:"360 50 50",dur:`${d}s`,repeatCount:"indefinite"}),a3.map(a=>(0,b.jsxs)("g",{children:[(0,b.jsx)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"spline",values:"0 50 50;360 50 50",keyTimes:"0;1",keySplines:a.spline,dur:"1s",repeatCount:"indefinite"}),(0,b.jsx)("circle",{cx:"50",cy:"18",r:a.r,fill:"currentColor",opacity:a.opacity})]},a.r)),(0,b.jsxs)("circle",{cx:"50",cy:"50",r:"4",fill:"currentColor",opacity:"0.15",children:[(0,b.jsx)("animate",{attributeName:"r",values:"3;5;3",dur:"2s",repeatCount:"indefinite"}),(0,b.jsx)("animate",{attributeName:"opacity",values:"0.1;0.25;0.1",dur:"2s",repeatCount:"indefinite"})]})]})]})}a.i(54250);var a5=a.i(27039),a6=a.i(17606),a7=a.i(83852);function a8(a){if(0===a)return"0s";let b=Math.floor(a/1e3);if(0===b)return"<1s";let c=Math.floor(b/3600),d=Math.floor(b%3600/60),e=b%60;return c>0?`${c}h ${d}m`:d>0?`${d}m ${e}s`:`${e}s`}let a9=(0,Y.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var ba=a.i(28002);function bb({syncStatus:a,syncLoading:c,syncError:d,onRefreshSync:e,onRebaseOnMain:f,rebaseLoading:g,rebaseError:h}){let i=null!=a&&a.behind>0,j=a?.behind===0,k=a?.baseBranch??"main";return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(Q.Separator,{}),(0,b.jsxs)("div",{"data-testid":"branch-sync-status",className:"flex flex-col gap-3 p-4",children:[(0,b.jsx)("div",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"BRANCH SYNC"}),(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("div",{className:"flex items-center gap-2",children:c&&!a?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(a4,{size:"sm",className:"shrink-0"}),(0,b.jsx)("span",{className:"text-muted-foreground text-sm",children:"Checking..."})]}):d?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)($.AlertTriangle,{className:"h-4 w-4 shrink-0 text-red-500"}),(0,b.jsx)("span",{className:"text-sm text-red-600",children:d})]}):g?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(a4,{size:"sm",className:"shrink-0"}),(0,b.jsxs)("span",{className:"text-sm",children:["Rebasing on"," ",(0,b.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:k}),"..."]})]}):i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)($.AlertTriangle,{className:"h-4 w-4 shrink-0 text-orange-500"}),(0,b.jsxs)("span",{className:"text-sm",children:[a.behind," commit",1===a.behind?"":"s"," behind"," ",(0,b.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:k}),a.ahead>0?(0,b.jsxs)("span",{className:"text-muted-foreground ml-1",children:["· ",a.ahead," ahead"]}):null]})]}):j?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(aw.CheckCircle2,{className:"h-4 w-4 shrink-0 text-green-500"}),(0,b.jsxs)("span",{className:"text-sm",children:["Up to date with"," ",(0,b.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:k}),a.ahead>0?(0,b.jsxs)("span",{className:"text-muted-foreground ml-1",children:["· ",a.ahead," ahead"]}):null]})]}):null}),(a||d)&&!g?(0,b.jsx)("button",{"data-testid":"sync-refresh-button",onClick:e,disabled:c,className:"text-muted-foreground hover:text-foreground inline-flex items-center rounded p-1 transition-colors disabled:opacity-50","aria-label":"Refresh sync status",children:(0,b.jsx)(ba.RefreshCw,{className:`h-3.5 w-3.5 ${c?"animate-spin":""}`})}):null]}),i&&!g?(0,b.jsx)(H.ActionButton,{label:"Rebase on Main",onClick:f,loading:!1,error:!!h,icon:a9,variant:"outline",size:"sm"}):null,h?(0,b.jsx)("p",{className:"text-destructive text-xs",children:h}):null]})]})}function bc({data:a,syncStatus:c,syncLoading:d,syncError:e,onRefreshSync:f,onRebaseOnMain:g,rebaseLoading:h,rebaseError:j}){let k="maintain"===a.lifecycle;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{"data-testid":"feature-drawer-status",className:"flex flex-col gap-3 p-4",children:[(0,b.jsx)("div",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:a5.lifecycleDisplayLabels[a.lifecycle]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(bd,{data:a}),"error"===a.state&&a.onRetry?(0,b.jsxs)("button",{"data-testid":"feature-drawer-retry-button",onClick:()=>a.onRetry(a.featureId),className:"flex shrink-0 cursor-pointer items-center gap-1.5 rounded-full bg-red-50 px-3 py-1.5 text-sm font-medium text-red-700 transition-colors hover:bg-red-100",children:[(0,b.jsx)(aQ.RotateCcw,{className:"h-3.5 w-3.5"}),"Retry"]}):null,("running"===a.state||"action-required"===a.state)&&a.onStop?(0,b.jsxs)("button",{"data-testid":"feature-drawer-stop-button",onClick:()=>a.onStop(a.featureId),className:"flex shrink-0 cursor-pointer items-center gap-1.5 rounded-full bg-red-50 px-3 py-1.5 text-sm font-medium text-red-700 transition-colors hover:bg-red-100",children:[(0,b.jsx)(i.Square,{className:"h-3.5 w-3.5"}),"Stop"]}):null]}),!k&&a.progress>0?(0,b.jsxs)("div",{"data-testid":"feature-drawer-progress",className:"flex flex-col gap-1",children:[(0,b.jsxs)("div",{className:"text-muted-foreground flex items-center justify-between text-xs",children:[(0,b.jsx)("span",{children:"Progress"}),(0,b.jsxs)("span",{children:[a.progress,"%"]})]}),(0,b.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,b.jsx)("div",{className:(0,V.cn)("h-full rounded-full transition-all",a5.featureNodeStateConfig[a.state].progressClass),style:{width:`${a.progress}%`}})})]}):null,k&&a.pr?(0,b.jsx)(bg,{pr:a.pr,hideCiStatus:a.hideCiStatus}):null]}),(0,b.jsx)(be,{data:a}),!k&&a.pr?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(Q.Separator,{}),(0,b.jsx)("div",{className:"p-4",children:(0,b.jsx)(bg,{pr:a.pr,hideCiStatus:a.hideCiStatus})})]}):null,(0,b.jsx)(bh,{data:a}),g&&a.branch&&f?(0,b.jsx)(bb,{syncStatus:c??null,syncLoading:d??!1,syncError:e??null,onRefreshSync:f,onRebaseOnMain:g,rebaseLoading:h??!1,rebaseError:j??null}):null,(0,b.jsx)(bk,{data:a})]})}function bd({data:a}){let c=a5.featureNodeStateConfig[a.state],d=c.icon;return(0,b.jsxs)("div",{className:(0,V.cn)("flex items-center gap-2 rounded-full px-3 py-1.5 text-sm font-medium",c.badgeBgClass,c.badgeClass),children:["running"===a.state?(0,b.jsx)(a4,{size:"sm",className:"shrink-0"}):(0,b.jsx)(d,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{children:c.label})]})}function be({data:a}){var c;let d,e,f,g,h,i=!!a.summary&&!(a.userQuery&&a.summary?.trim()===a.userQuery.trim());return a.branch||a.oneLiner||i||a.userQuery||a.createdAt?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(Q.Separator,{}),(0,b.jsxs)("div",{"data-testid":"feature-drawer-info",className:"flex flex-col gap-3 p-4",children:[a.branch?(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Branch"}),(0,b.jsxs)("span",{className:"flex items-center gap-1.5 text-sm",children:[(0,b.jsx)(aq.GitBranch,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,b.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:a.branch}),a.baseBranch?(0,b.jsxs)("span",{className:"text-muted-foreground text-xs",children:["from ",a.baseBranch]}):null]})]}):null,a.oneLiner?(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"One-Liner"}),(0,b.jsx)("span",{className:"text-sm leading-relaxed",children:a.oneLiner})]}):null,a.userQuery?(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"User Query"}),(0,b.jsx)(a0,{text:a.userQuery})]}):null,i?(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Summary"}),(0,b.jsx)("span",{className:"text-sm leading-relaxed",children:a.summary})]}):null,a.createdAt?(0,b.jsx)(bl,{label:"Created",value:(c=a.createdAt,d=Date.now(),(h=Math.floor((g=Math.floor((f=Math.floor(Math.floor((d-(e="string"==typeof c?new Date(c).getTime():c))/1e3)/60))/60))/24))>30?new Date(e).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):h>0?`${h} day${1===h?"":"s"} ago`:g>0?`${g} hour${1===g?"":"s"} ago`:f>0?`${f} minute${1===f?"":"s"} ago`:"just now")}):null]})]}):null}let bf={[ay.PrStatus.Open]:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",[ay.PrStatus.Merged]:"border-transparent bg-purple-50 text-purple-700 hover:bg-purple-50",[ay.PrStatus.Closed]:"border-transparent bg-red-50 text-red-700 hover:bg-red-50"};function bg({pr:a,hideCiStatus:c}){return(0,b.jsx)("div",{"data-testid":"feature-drawer-pr",children:(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",a.number,(0,b.jsx)(m.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,b.jsx)(W.Badge,{className:bf[a.status],children:a.status})]}),a.ciStatus&&!0!==c?(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,b.jsx)(az,{status:a.ciStatus})]}):null,!1===a.mergeable?(0,b.jsxs)("div",{"data-testid":"pr-merge-conflict",className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Merge Status"}),(0,b.jsxs)(W.Badge,{className:"border-transparent bg-orange-50 text-orange-700 hover:bg-orange-50",children:[(0,b.jsx)($.AlertTriangle,{className:"mr-1 h-3.5 w-3.5"}),"Conflicts"]})]}):null,a.commitHash?(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)(ap.GitCommitHorizontal,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,b.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:a.commitHash.slice(0,7)})]})]}):null]})})}function bh({data:a}){let d=function(a){let[b,d]=(0,c.useState)(null),e=(0,c.useRef)(null);return(0,c.useEffect)(()=>a?(d(a8(Math.max(0,Date.now()-a))),e.current=setInterval(()=>{d(a8(Math.max(0,Date.now()-a)))},1e3),()=>{e.current&&(clearInterval(e.current),e.current=null)}):void d(null),[a]),b}("running"===a.state||"action-required"===a.state?a.startedAt:void 0);return a.fastMode??a.agentType??a.runtime??d??a.blockedBy??a.errorMessage?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(Q.Separator,{}),(0,b.jsxs)("div",{"data-testid":"feature-drawer-details",className:"flex flex-col gap-3 p-4",children:[a.fastMode?(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Mode"}),(0,b.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)(aT.Zap,{className:"h-4 w-4 shrink-0 text-amber-500"}),"Fast Mode"]})]}):null,a.agentType?(0,b.jsx)(bi,{agentType:a.agentType}):null,a.runtime?(0,b.jsx)(bl,{label:"Runtime",value:a.runtime}):null,!a.runtime&&d?(0,b.jsx)(bl,{label:"Running for",value:d}):null,a.blockedBy?(0,b.jsx)(bl,{label:"Blocked by",value:a.blockedBy}):null,a.errorMessage?(0,b.jsx)(bl,{label:"Error",value:a.errorMessage}):null]})]}):null}function bi({agentType:a}){let c=(0,a6.getAgentTypeIcon)(a),d=a6.agentTypeLabels[a]??a;return(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Agent"}),(0,b.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)(c,{className:"h-4 w-4 shrink-0"}),d]})]})}function bj({enabled:a,label:c}){return(0,b.jsxs)("span",{className:(0,V.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",a?"bg-emerald-50 text-emerald-700":"bg-muted text-muted-foreground"),children:[a?(0,b.jsx)(k.Check,{className:"h-3 w-3"}):(0,b.jsx)(aS.X,{className:"h-3 w-3"}),c]})}function bk({data:a}){return null!=a.approvalGates||null!=a.push||null!=a.openPr||null!=a.ciWatchEnabled||null!=a.enableEvidence||null!=a.forkAndPr||null!=a.commitSpecs||a.modelId?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(Q.Separator,{}),(0,b.jsxs)("div",{"data-testid":"feature-drawer-settings",className:"flex flex-col gap-3 p-4",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"SETTINGS"}),a.modelId?(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Model"}),(0,b.jsx)("span",{className:"text-sm",children:(0,a7.getModelMeta)(a.modelId).displayName||a.modelId})]}):null,a.approvalGates?(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",children:[(0,b.jsx)(aR,{className:"h-3 w-3"}),"Auto-Approve"]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,b.jsx)(bj,{enabled:a.approvalGates.allowPrd,label:"PRD"}),(0,b.jsx)(bj,{enabled:a.approvalGates.allowPlan,label:"Plan"}),(0,b.jsx)(bj,{enabled:a.approvalGates.allowMerge,label:"Merge"})]})]}):null,null!=a.enableEvidence?(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",children:[(0,b.jsx)(aP,{className:"h-3 w-3"}),"Evidence"]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,b.jsx)(bj,{enabled:a.enableEvidence,label:"Collect"}),null!=a.commitEvidence?(0,b.jsx)(bj,{enabled:a.commitEvidence,label:"Add to PR"}):null]})]}):null,null!=a.push||null!=a.openPr||null!=a.ciWatchEnabled||null!=a.commitSpecs||null!=a.forkAndPr?(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",children:[(0,b.jsx)(aq.GitBranch,{className:"h-3 w-3"}),"Git"]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[null!=a.push?(0,b.jsx)(bj,{enabled:a.push,label:"Push"}):null,null!=a.openPr?(0,b.jsx)(bj,{enabled:a.openPr,label:"PR"}):null,null!=a.ciWatchEnabled?(0,b.jsx)(bj,{enabled:a.ciWatchEnabled,label:"Watch"}):null,null!=a.commitSpecs?(0,b.jsx)(bj,{enabled:a.commitSpecs,label:"Commit Specs"}):null,null!=a.forkAndPr?(0,b.jsx)(bj,{enabled:a.forkAndPr,label:"Fork & PR"}):null]})]}):null]})]}):null}function bl({label:a,value:c}){return(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:a}),(0,b.jsx)("span",{className:"text-sm",children:c})]})}var bm=a.i(46168);let bn=(0,Y.default)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);var ax=ax,bo=a.i(93866),bp=a.i(12882),bq=a.i(7421);let br=(0,Y.default)("arrow-down-to-line",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]),bs=(0,Y.default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);function bt(a,b){if(null!=a.durationMs&&a.durationMs>0)return a.durationMs;if(!a.completedAt&&a.startedAt){let c=new Date(a.startedAt).getTime();if(!Number.isNaN(c))return Math.max(0,b-c)}return 0}function bu(a){return a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}K`:String(a)}function bv(a){let b=a instanceof Date?a:new Date(String(a));return Number.isNaN(b.getTime())?"":b.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function bw(a){return a>=1?`$${a.toFixed(2)}`:a>=.01?`$${a.toFixed(3)}`:`$${a.toFixed(4)}`}let bx={analyze:"Analyzing",requirements:"Requirements",research:"Researching",plan:"Planning",implement:"Implementing",rebase:"Rebasing","fast-implement":"Fast Implement",evidence:"Evidence",validate:"Validating",repair:"Repairing",merge:"Merging"},by={"run:started":{label:"started",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:h.Play},"run:resumed":{label:"resumed",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:aQ.RotateCcw},"run:completed":{label:"completed",colorClass:"text-emerald-600",bgClass:"bg-emerald-50 dark:bg-emerald-950/30",icon:aw.CheckCircle2},"run:failed":{label:"failed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:ax.default},"run:stopped":{label:"stopped",colorClass:"text-amber-600",bgClass:"bg-amber-50 dark:bg-amber-950/30",icon:i.Square},"run:crashed":{label:"crashed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:ax.default},"run:rejected":{label:"rejected",colorClass:"text-orange-600",bgClass:"bg-orange-50 dark:bg-orange-950/30",icon:bo.Ban}};function bz(a){return a.startsWith("run:")}function bA({timings:a,loading:d,error:e,rejectionFeedback:g}){let h=function(a){let[b,d]=(0,c.useState)(Date.now),e=(0,c.useRef)(null);return(0,c.useEffect)(()=>(a&&a.some(a=>!a.phase.startsWith("run:")&&!a.completedAt&&a.startedAt)&&(e.current=setInterval(()=>d(Date.now()),1e3)),()=>{e.current&&(clearInterval(e.current),e.current=null)}),[a]),b}(a);if(d)return(0,b.jsx)("div",{"data-testid":"activity-tab-loading",className:"flex items-center justify-center p-8",children:(0,b.jsx)(f.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})});if(e)return(0,b.jsxs)("div",{className:"flex items-center gap-2 p-4 text-base text-red-600",children:[(0,b.jsx)(O.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{children:e})]});if(!a||0===a.length)return(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,b.jsx)(bm.Clock,{className:"text-muted-foreground h-8 w-8"}),(0,b.jsx)("p",{className:"text-muted-foreground text-base",children:"No activity recorded yet"})]});let i=a.filter(a=>!bz(a.phase)),j=Math.max(...i.map(a=>bt(a,h)),...i.map(a=>a.approvalWaitMs??0),0),k=function(a,b){if(!a.length)return[];let c=a.filter(a=>"run:rejected"===a.phase).length,d=b?.length??0,e=a;if(d>c){e=[...a];let f=a[a.length-1].agentRunId;for(let a=c;a<d;a++){let d=b[a];a>c&&e.push({agentRunId:f,phase:"run:resumed",startedAt:d.timestamp??`synthetic-resumed-${a}`}),e.push({agentRunId:f,phase:"run:rejected",startedAt:d.timestamp??`synthetic-${a}`})}}let f=[],g=[],h=0;for(let a of e)if(g.push(a),"run:rejected"===a.phase){let a=b?.[h];f.push({number:f.length+1,timings:g,rejectionMessage:a?.message,rejectionAttachments:a?.attachments}),g=[],h++}return g.length>0&&f.push({number:f.length+1,timings:g}),f}(a,g),l=k.length>1,m=i.reduce((a,b)=>a+bt(b,h),0),n=i.reduce((a,b)=>a+(b.approvalWaitMs??0),0),o=i.reduce((a,b)=>a+(b.inputTokens??0),0),p=i.reduce((a,b)=>a+(b.outputTokens??0),0),q=i.reduce((a,b)=>a+(b.costUsd??0),0);return(0,b.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,b.jsx)("div",{"data-testid":"activity-timings",className:"flex flex-col gap-3",children:k.map(a=>(0,b.jsx)(bB,{iteration:a,showHeader:l,maxDurationMs:j,now:h},a.number))}),m>0?(0,b.jsx)(bF,{totalExecMs:m,totalWaitMs:n,totalInputTokens:o,totalOutputTokens:p,totalCostUsd:q}):null]})}function bB({iteration:a,showHeader:c,maxDurationMs:d,now:e}){let f=function(a){let b=[...a.timings].reverse().find(a=>bz(a.phase));if(!b)return null;switch(b.phase){case"run:rejected":return{label:"Rejected",colorClass:"text-orange-600",dotClass:"bg-orange-500"};case"run:completed":return{label:"Completed",colorClass:"text-emerald-600",dotClass:"bg-emerald-500"};case"run:failed":return{label:"Failed",colorClass:"text-red-600",dotClass:"bg-red-500"};case"run:crashed":return{label:"Crashed",colorClass:"text-red-600",dotClass:"bg-red-500"};case"run:stopped":return{label:"Stopped",colorClass:"text-amber-600",dotClass:"bg-amber-500"};default:return null}}(a);return(0,b.jsxs)("div",{"data-testid":`iteration-${a.number}`,className:"border-border/50 bg-card/50 flex flex-col overflow-hidden rounded-lg border",children:[c?(0,b.jsxs)("div",{className:"bg-muted/30 border-border/50 flex items-center justify-between border-b px-3 py-1.5",children:[(0,b.jsxs)("span",{className:"text-muted-foreground text-sm font-semibold tracking-wide",children:["Iteration ",a.number]}),f?(0,b.jsxs)("span",{className:`flex items-center gap-1 text-xs font-medium ${f.colorClass}`,children:[(0,b.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${f.dotClass}`}),f.label]}):null]}):null,(0,b.jsxs)("div",{className:"relative flex flex-col",children:[(0,b.jsx)("div",{className:"bg-border/60 absolute top-4 bottom-4 left-[21.5px] w-px"}),a.timings.map((c,f)=>{if(bz(c.phase)){let d,e="run:rejected"===c.phase,g="run:failed"===c.phase||"run:crashed"===c.phase||"run:stopped"===c.phase;if(e)d=a.rejectionMessage;else if(g){let b=[...a.timings].reverse().find(a=>!bz(a.phase)&&a.errorMessage);d=b?.errorMessage??c.errorMessage}return(0,b.jsx)(bC,{timing:c,message:d,attachments:e?a.rejectionAttachments:void 0,isFirst:0===f,isLast:f===a.timings.length-1},`${c.agentRunId}-${c.phase}-${c.startedAt}`)}return(0,b.jsx)(bD,{timing:c,maxDurationMs:d,now:e},`${c.agentRunId}-${c.phase}-${c.startedAt}`)})]})]})}function bC({timing:a,message:c,attachments:d,isFirst:e,isLast:f}){let g,h=by[a.phase];if(!h)return null;let i=d&&d.length>0,j=h.icon;return(0,b.jsxs)("div",{className:`relative flex flex-col gap-1 px-3 ${e?"pt-2":"pt-1"} ${f?"pb-2":"pb-1"}`,children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:`relative z-10 flex h-5 w-5 shrink-0 items-center justify-center rounded-full ${h.bgClass}`,children:(0,b.jsx)(j,{className:`h-3 w-3 ${h.colorClass}`})}),(0,b.jsx)("span",{className:`text-sm font-medium ${h.colorClass}`,children:h.label}),a.startedAt&&!("string"==typeof a.startedAt&&a.startedAt.startsWith("synthetic"))?(0,b.jsx)("span",{className:"text-muted-foreground/60 ml-auto text-xs tabular-nums",children:bv(String(a.startedAt))}):null]}),c?(g="run:failed"===a.phase||"run:crashed"===a.phase||"run:stopped"===a.phase,(0,b.jsxs)("div",{className:`ml-[26px] flex items-start gap-1.5 rounded-md px-2 py-1.5 ${g?"bg-red-50/50 dark:bg-red-950/20":"bg-orange-50/50 dark:bg-orange-950/20"}`,children:[g?(0,b.jsx)(O.AlertCircle,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-red-400"}):(0,b.jsx)(bp.MessageSquare,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-orange-400"}),(0,b.jsxs)("span",{"data-testid":g?"error-message-text":"rejection-feedback-text",className:"text-muted-foreground text-xs leading-relaxed italic",children:["— ",c]})]})):null,i?(0,b.jsx)("div",{"data-testid":"rejection-feedback-attachments",className:"ml-[26px]",children:(0,b.jsx)(a0,{text:"",attachmentPaths:d})}):null]})}function bD({timing:a,maxDurationMs:d,now:e}){let f=a.phase.includes(":")?a.phase.split(":")[0]:a.phase,g=a.phase.includes(":")?a.phase.split(":")[1]:null,h=null!==g,i=g?.startsWith("phase-")??!1,l=bx[f]??f,m=i?`Phase ${g.replace("phase-","")}`:null!==g?`${l} #${g}`:l,n=bt(a,e),o=!a.completedAt&&!!a.startedAt,p=o?15:2,q=d>0?Math.max(p,n/d*100):p,r=a.completedAt?i?"bg-emerald-400":h?"bg-amber-500":"bg-emerald-500":"bg-blue-500",s=null!=a.inputTokens||null!=a.outputTokens?(a.inputTokens??0)+(a.outputTokens??0):null,[t,u]=(0,c.useState)(!1),v=(0,c.useCallback)(()=>{a.prompt&&navigator.clipboard.writeText(a.prompt).then(()=>{u(!0),setTimeout(()=>u(!1),1500)})},[a.prompt]);return(0,b.jsxs)("div",{className:`group/phase relative flex flex-col gap-0.5 px-3 py-1.5 ${h?"ml-4":""}`,children:[(0,b.jsxs)("div",{"data-testid":`timing-bar-${a.phase}`,className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:"relative z-10 flex h-5 w-5 shrink-0 items-center justify-center",children:(0,b.jsx)("div",{className:`rounded-full ${o?"h-3 w-3 animate-pulse":"h-2.5 w-2.5"} ${o?"bg-blue-500":a.completedAt?"bg-emerald-500":"bg-muted-foreground/30"}`})}),(0,b.jsx)("span",{className:`w-28 shrink-0 truncate text-sm font-medium ${h?"text-muted-foreground":"text-foreground/80"}`,children:m}),a.prompt?(0,b.jsx)("button",{type:"button",onClick:v,className:"text-muted-foreground/50 hover:text-foreground/70 -ml-1 shrink-0 opacity-0 transition-opacity group-hover/phase:opacity-100",title:"Copy prompt to clipboard",children:t?(0,b.jsx)(k.Check,{className:"h-3.5 w-3.5 text-emerald-500"}):(0,b.jsx)(j.Copy,{className:"h-3.5 w-3.5"})}):null,(0,b.jsx)("div",{className:`bg-muted relative min-w-0 flex-1 overflow-hidden rounded-full ${h?"h-1.5":"h-2"}`,children:o?(0,b.jsx)("div",{className:"absolute inset-0 rounded-full bg-blue-500/30",style:{backgroundImage:"linear-gradient(90deg, transparent 0%, rgb(59 130 246) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s ease-in-out infinite"}}):(0,b.jsx)("div",{className:`h-full rounded-full transition-all duration-300 ${r}`,style:{width:`${Math.min(q,100)}%`}})}),(0,b.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-right text-sm font-medium tabular-nums",children:a8(n)})]}),(0,b.jsxs)("div",{className:"ml-[28px] flex items-center gap-3 text-xs",children:[a.startedAt?(0,b.jsx)("span",{className:"text-muted-foreground/60 tabular-nums",children:bv(a.startedAt)}):null,null!=s&&s>0?(0,b.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5",children:[(0,b.jsx)(aT.Zap,{className:"h-3 w-3 opacity-50"}),bu(s)]}):null,null!=a.costUsd&&a.costUsd>0?(0,b.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5",children:[(0,b.jsx)(bn,{className:"h-3 w-3 opacity-50"}),bw(a.costUsd)]}):null]}),null!=a.approvalWaitMs&&a.approvalWaitMs>0?(0,b.jsx)(bE,{timing:a,maxDurationMs:d}):null]})}function bE({timing:a,maxDurationMs:c}){let d=a.approvalWaitMs??0,e=c>0?Math.max(2,d/c*100):2;return(0,b.jsxs)("div",{"data-testid":`approval-wait-${a.phase}`,className:"ml-[26px] flex items-center gap-2 rounded-md bg-amber-50/50 px-1.5 py-1 dark:bg-amber-950/20",children:[(0,b.jsx)(bq.Timer,{className:"h-3.5 w-3.5 shrink-0 text-amber-500"}),(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 text-xs",children:"approval"}),(0,b.jsx)("div",{className:"bg-muted h-1.5 min-w-0 flex-1 overflow-hidden rounded-full",children:(0,b.jsx)("div",{className:"h-full rounded-full bg-amber-500",style:{width:`${Math.min(e,100)}%`}})}),(0,b.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-right text-xs tabular-nums",children:a8(d)})]})}function bF({totalExecMs:a,totalWaitMs:c,totalInputTokens:d,totalOutputTokens:e,totalCostUsd:f}){let g=d+e;return(0,b.jsxs)("div",{"data-testid":"activity-summary",className:"border-border bg-card/30 flex flex-col gap-2 rounded-lg border p-3",children:[(0,b.jsx)("div",{className:"text-muted-foreground mb-1 text-xs font-semibold tracking-wider uppercase",children:"Summary"}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:[(0,b.jsx)(bG,{icon:bm.Clock,label:"Execution",value:a8(a)}),(0,b.jsx)(bG,{icon:bq.Timer,label:"Wait",value:c>0?a8(c):"n/a"}),(0,b.jsx)(bG,{icon:bm.Clock,label:"Wall-clock",value:c>0?a8(a+c):a8(a)}),(0,b.jsx)(bG,{icon:bn,label:"Cost",value:f>0?bw(f):"n/a"}),(0,b.jsxs)("div",{className:"col-span-2 flex flex-col gap-0.5",children:[(0,b.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[(0,b.jsx)(aT.Zap,{className:"h-3 w-3 opacity-40"}),"Tokens"]}),g>0?(0,b.jsxs)("span",{className:"flex items-center gap-2.5 text-sm tabular-nums",children:[(0,b.jsx)("span",{children:bu(g)}),(0,b.jsxs)("span",{className:"text-muted-foreground flex items-center gap-3 text-xs",title:"Input tokens / Output tokens",children:[(0,b.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,b.jsx)(br,{className:"h-3 w-3 text-blue-500 opacity-60"}),bu(d)]}),(0,b.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,b.jsx)(bs,{className:"h-3 w-3 text-emerald-500 opacity-60"}),bu(e)]})]})]}):(0,b.jsx)("span",{className:"text-muted-foreground/40 text-sm italic tabular-nums",children:"n/a"})]})]})]})}function bG({icon:a,label:c,value:d,className:e=""}){let f="n/a"===d;return(0,b.jsxs)("div",{className:`flex flex-col gap-0.5 ${e}`,children:[(0,b.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[(0,b.jsx)(a,{className:"h-3 w-3 opacity-40"}),c]}),(0,b.jsx)("span",{className:`text-sm tabular-nums ${f?"text-muted-foreground/40 italic":""}`,children:d})]})}var bH=a.i(45449),bI=a.i(44447);let bJ=(0,Y.default)("coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]),bK=(0,Y.default)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),bL=(0,Y.default)("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]),bM=/^\[(\d{4}-\d{2}-\d{2}T[\d:.]+Z?)\]\s+(?:\[([^\]]+)\]\s+)?(?:\[([^\]|]+)(?:\|([^\]]+))?\]\s+)?(.*)$/,bN=/^\[(tool-result|tool|text|delta|result|tokens|cmd|file|turn|thread|error|event|raw|WORKER)\]\s*(.*)/;function bO(a){let b=a.match(bM);if(!b)return{timestamp:null,phase:null,agent:null,model:null,tag:"raw",message:a,raw:a};let[,c,d,e,f,g]=b,h=null,i=null,j=null,k=g??"";if(null!=e&&null!=d)if(d.includes("|")){let[a,b]=d.split("|");i=a,j=b??null,k=`[${e}] ${g??""}`}else h=d,i=e,j=f??null;else if(null!=d)if(d.includes("|")){let[a,b]=d.split("|");i=a,j=b??null}else h=d;let l=k.match(bN),m="info";return l&&(m=l[1].toLowerCase(),k=l[2]),{timestamp:c??null,phase:h,agent:i,model:j,tag:m,message:k.trim(),raw:a}}function bP({content:a}){let d=(0,c.useMemo)(()=>a?a.split("\n").filter(a=>a.trim().length>0).map(bO):[],[a]);return 0===d.length?null:(0,b.jsx)("div",{className:"flex flex-col",children:d.map((a,c)=>(0,b.jsx)(bQ,{line:a},c))})}function bQ({line:a}){switch(a.tag){case"tool":return(0,b.jsx)(bT,{line:a});case"tool-result":return(0,b.jsx)(bZ,{line:a});case"text":case"delta":return(0,b.jsx)(bV,{line:a});case"result":return(0,b.jsx)(bW,{line:a});case"tokens":case"turn":return(0,b.jsx)(bX,{line:a});case"cmd":return(0,b.jsx)(b$,{line:a});case"file":return(0,b.jsx)(b_,{line:a});case"thread":case"event":case"info":return(0,b.jsx)(b1,{line:a});case"error":return(0,b.jsx)(b0,{line:a});case"worker":return(0,b.jsx)(bY,{line:a});default:return(0,b.jsx)(b2,{line:a})}}function bR({value:a}){if(!a)return null;let c=a.replace(/^.*T/,"").replace("Z",""),d=c.split(":"),e=d.length>=3?`${d[1]}:${d[2].split(".")[0]}`:c;return(0,b.jsx)("span",{className:"text-muted-foreground/60 w-11 shrink-0 font-mono text-[10px]",children:e})}function bS({phase:a}){return a?(0,b.jsx)("span",{className:"bg-muted text-muted-foreground w-20 shrink-0 truncate rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",title:a,children:a}):(0,b.jsx)("span",{className:"w-20 shrink-0"})}function bT({line:a}){var c;let d,{toolName:e,args:f}=-1===(d=(c=a.message).indexOf(" "))?{toolName:c,args:""}:{toolName:c.slice(0,d),args:c.slice(d+1)},g=function(a,b){try{let c=JSON.parse(b);if("Read"===a&&c.file_path||"Write"===a&&c.file_path||"Edit"===a&&c.file_path)return c.file_path;if("Glob"===a&&c.pattern||"Grep"===a&&c.pattern)return c.pattern;if("Bash"===a&&c.command)return c.command;if("Task"===a&&c.description)return c.description}catch{if(b.length>0)return b}return null}(e,f);return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 border-b border-transparent px-3 py-1.5 transition-colors",children:[(0,b.jsx)(bR,{value:a.timestamp}),(0,b.jsx)(bS,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(bU,{toolName:e}),(0,b.jsx)("span",{className:"text-xs font-semibold text-violet-600 dark:text-violet-400",children:e}),g?(0,b.jsx)("span",{className:"text-muted-foreground min-w-0 font-mono text-xs break-all",children:g}):null]})]})}function bU({toolName:a}){let c=a.toLowerCase();return"bash"===c?(0,b.jsx)(I.Terminal,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"read"===c||"glob"===c||"grep"===c?(0,b.jsx)(at.FileText,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"write"===c||"edit"===c?(0,b.jsx)(bL,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):(0,b.jsx)(I.Terminal,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"})}function bV({line:a}){return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,b.jsx)(bR,{value:a.timestamp}),(0,b.jsx)(bS,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(bp.MessageSquare,{className:"mt-0.5 h-3 w-3 shrink-0 text-blue-500"}),(0,b.jsx)("span",{className:"text-foreground/80 min-w-0 text-xs leading-relaxed",children:a.message})]})]})}function bW({line:a}){var c;let d,e,{chars:f}=(d=(c=a.message).match(/^(\d+)\s+chars/),e=c.match(/session=(\S+)/),{chars:d?parseInt(d[1],10):0,sessionId:e?e[1]:null});return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,b.jsx)(bR,{value:a.timestamp}),(0,b.jsx)(bS,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(aw.CheckCircle2,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-500"}),(0,b.jsxs)("span",{className:"text-xs font-medium text-emerald-600 dark:text-emerald-400",children:["Result: ",f.toLocaleString()," chars"]})]})]})}function bX({line:a}){let c,{inputTokens:d,outputTokens:e}=(c=a.message.match(/^(\d+)\s+in\s*\/\s*(\d+)\s+out/))?{inputTokens:parseInt(c[1],10),outputTokens:parseInt(c[2],10)}:{inputTokens:0,outputTokens:0};return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,b.jsx)(bR,{value:a.timestamp}),(0,b.jsx)(bS,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(bJ,{className:"mt-0.5 h-3 w-3 shrink-0 text-amber-500"}),(0,b.jsxs)("span",{className:"text-muted-foreground text-xs",children:[(0,b.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:d.toLocaleString()})," in / ",(0,b.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:e.toLocaleString()})," out"]})]})]})}function bY({line:a}){return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 bg-zinc-50 px-3 py-1.5 transition-colors dark:bg-zinc-900/50",children:[(0,b.jsx)(bR,{value:a.timestamp}),(0,b.jsx)(bS,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(bK,{className:"mt-0.5 h-3 w-3 shrink-0 text-zinc-500"}),(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium break-all",children:a.message})]})]})}function bZ({line:a}){return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1 transition-colors",children:[(0,b.jsx)(bR,{value:a.timestamp}),(0,b.jsx)(bS,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(ar,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-400"}),(0,b.jsx)("span",{className:"text-muted-foreground min-w-0 font-mono text-[11px] break-all",children:a.message})]})]})}function b$({line:a}){return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,b.jsx)(bR,{value:a.timestamp}),(0,b.jsx)(bS,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(h.Play,{className:"mt-0.5 h-3 w-3 shrink-0 text-cyan-500"}),(0,b.jsx)("span",{className:"min-w-0 font-mono text-xs break-all text-cyan-700 dark:text-cyan-400",children:a.message})]})]})}function b_({line:a}){return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,b.jsx)(bR,{value:a.timestamp}),(0,b.jsx)(bS,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(bL,{className:"mt-0.5 h-3 w-3 shrink-0 text-orange-500"}),(0,b.jsx)("span",{className:"min-w-0 text-xs break-all text-orange-700 dark:text-orange-400",children:a.message})]})]})}function b0({line:a}){return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 bg-red-50 px-3 py-1.5 transition-colors dark:bg-red-950/30",children:[(0,b.jsx)(bR,{value:a.timestamp}),(0,b.jsx)(bS,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(O.AlertCircle,{className:"mt-0.5 h-3 w-3 shrink-0 text-red-500"}),(0,b.jsx)("span",{className:"min-w-0 text-xs font-medium break-all text-red-700 dark:text-red-400",children:a.message})]})]})}function b1({line:a}){return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,b.jsx)(bR,{value:a.timestamp}),(0,b.jsx)(bS,{phase:a.phase}),(0,b.jsx)("span",{className:"text-muted-foreground min-w-0 text-xs break-all",children:a.message})]})}function b2({line:a}){return(0,b.jsx)("div",{className:"px-3 py-0.5",children:(0,b.jsx)("span",{className:"text-muted-foreground/70 font-mono text-[11px] break-all whitespace-pre-wrap",children:a.raw})})}function b3({content:a,isConnected:d,error:e}){let f=(0,c.useRef)(null),[g,h]=(0,c.useState)(!0),[i,j]=(0,c.useState)("structured"),k=(0,c.useCallback)(()=>{let a=f.current;a&&h(a.scrollHeight-a.scrollTop-a.clientHeight<40)},[]),l=(0,c.useCallback)(()=>{let a=f.current;a&&(a.scrollTop=a.scrollHeight,h(!0))},[]);return((0,c.useEffect)(()=>{g&&f.current&&(f.current.scrollTop=f.current.scrollHeight)},[a,g]),e)?(0,b.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,b.jsx)(O.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{children:e})]}):a?(0,b.jsxs)("div",{className:"flex h-full flex-col","data-testid":"log-tab",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 border-b px-3 py-1.5",children:[(0,b.jsx)("span",{className:`h-2 w-2 rounded-full ${d?"bg-emerald-500":"bg-zinc-400"}`}),(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:d?"Live":"Disconnected"}),(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,b.jsx)("button",{type:"button",onClick:()=>j("structured"),className:`rounded p-1 transition-colors ${"structured"===i?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,title:"Structured view",children:(0,b.jsx)(at.FileText,{className:"h-3.5 w-3.5"})}),(0,b.jsx)("button",{type:"button",onClick:()=>j("raw"),className:`rounded p-1 transition-colors ${"raw"===i?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,title:"Raw view",children:(0,b.jsx)(bI.Code,{className:"h-3.5 w-3.5"})}),g?null:(0,b.jsxs)("button",{type:"button",onClick:l,className:"text-muted-foreground hover:text-foreground ml-1 flex items-center gap-1 text-xs",children:[(0,b.jsx)(bH.ArrowDown,{className:"h-3 w-3"}),"Jump to bottom"]})]})]}),(0,b.jsx)("div",{ref:f,onScroll:k,className:`flex-1 overflow-y-auto ${"raw"===i?"bg-zinc-950 p-3 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap text-zinc-300":"bg-background"}`,children:"structured"===i?(0,b.jsx)(bP,{content:a}):a})]}):(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,b.jsx)(I.Terminal,{className:"text-muted-foreground h-8 w-8"}),(0,b.jsx)("p",{className:"text-muted-foreground text-sm",children:"No log output yet"}),d?(0,b.jsx)("p",{className:"text-muted-foreground text-xs",children:"Waiting for log data..."}):null]})}let b4=(0,Y.default)("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]);var b5=a.i(4019),b6=a.i(83886);let b7=(0,Y.default)("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]),b8={Todo:{icon:b5.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Todo"},"Work in Progress":{icon:f.Loader2,colorClass:"text-blue-600",borderClass:"border-blue-200",spinning:!0,label:"In Progress"},Done:{icon:k.Check,colorClass:"text-emerald-600",borderClass:"border-emerald-200",label:"Done"},Review:{icon:b6.Eye,colorClass:"text-amber-600",borderClass:"border-amber-200",label:"Review"}},b9={icon:b5.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Unknown"};function ca({tasks:a}){return 0===a.length?(0,b.jsx)("div",{className:"flex flex-col items-center justify-center gap-2 py-4",children:(0,b.jsx)("p",{className:"text-muted-foreground text-sm",children:"No tasks defined yet"})}):(0,b.jsxs)("div",{"data-testid":"task-progress-view",className:"flex flex-col gap-3",children:[(0,b.jsx)(cb,{tasks:a}),(0,b.jsx)("div",{"data-testid":"task-progress-list",className:"flex flex-col gap-2",children:a.map((a,c)=>(0,b.jsx)(cd,{task:a,index:c},a.title||`task-${c}`))})]})}function cb({tasks:a}){let d=(0,c.useMemo)(()=>{let b=a.filter(a=>"Done"===a.state).length,c=a.filter(a=>"Work in Progress"===a.state).length,d=a.filter(a=>"Review"===a.state).length,e=a.filter(a=>"Done"!==a.state&&"Work in Progress"!==a.state&&"Review"!==a.state).length,f=a.length,g=f>0?Math.round(b/f*100):0;return{done:b,wip:c,review:d,todo:e,total:f,percent:g}},[a]);return(0,b.jsxs)("div",{"data-testid":"task-progress-summary",className:"flex flex-col gap-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Task Progress"}),(0,b.jsxs)("span",{className:"text-muted-foreground text-xs",children:[d.done," of ",d.total," done"]})]}),(0,b.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,b.jsx)("div",{"data-testid":"task-progress-bar",className:"h-full rounded-full bg-emerald-500 transition-all",style:{width:`${d.percent}%`}})}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.done>0?(0,b.jsx)(cc,{icon:k.Check,label:"Done",count:d.done,className:"text-emerald-600"}):null,d.wip>0?(0,b.jsx)(cc,{icon:f.Loader2,label:"In Progress",count:d.wip,className:"text-blue-600"}):null,d.review>0?(0,b.jsx)(cc,{icon:b6.Eye,label:"Review",count:d.review,className:"text-amber-600"}):null,d.todo>0?(0,b.jsx)(cc,{icon:b5.Circle,label:"Todo",count:d.todo,className:"text-muted-foreground"}):null]})]})}function cc({icon:a,label:c,count:d,className:e}){return(0,b.jsxs)("span",{className:(0,V.cn)("flex items-center gap-1 text-xs",e),children:[(0,b.jsx)(a,{className:"h-3 w-3"}),d," ",c]})}function cd({task:a,index:d}){let[e,f]=(0,c.useState)(!1),g=b8[a.state]??b9,h=g.icon,i=a.actionItems.length>0,j=(0,c.useCallback)(()=>{i&&f(a=>!a)},[i]);return(0,b.jsxs)("div",{"data-testid":`task-card-${d}`,className:(0,V.cn)("rounded-lg border",g.borderClass),children:[(0,b.jsxs)("button",{type:"button",onClick:j,disabled:!i,className:(0,V.cn)("flex w-full items-start gap-2 px-3 py-2.5 text-left",i&&"hover:bg-muted/50 cursor-pointer transition-colors"),children:[(0,b.jsx)(h,{className:(0,V.cn)("mt-0.5 h-4 w-4 shrink-0",g.colorClass,g.spinning&&"animate-spin")}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,b.jsx)("span",{className:(0,V.cn)("text-sm font-medium",g.colorClass),children:a.title}),a.description?(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:a.description}):null]}),i?(0,b.jsx)(U.ChevronRight,{className:(0,V.cn)("text-muted-foreground mt-0.5 h-4 w-4 shrink-0 transition-transform",e&&"rotate-90")}):null]}),e&&i?(0,b.jsx)("div",{className:"border-t px-3 py-2.5",children:(0,b.jsx)("div",{className:"flex flex-col gap-2",children:a.actionItems.map((a,c)=>(0,b.jsx)(ce,{item:a},a.name||`ai-${c}`))})}):null]})}function ce({item:a}){let c=a.acceptanceCriteria.length,d=a.acceptanceCriteria.filter(a=>a.verified).length,e=c>0&&d===c;return(0,b.jsxs)("div",{"data-testid":"action-item",className:"flex flex-col gap-1.5",children:[(0,b.jsxs)("div",{className:"flex items-start gap-2",children:[e?(0,b.jsx)(aw.CheckCircle2,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-emerald-600"}):(0,b.jsx)(b7,{className:"text-muted-foreground mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-xs font-medium",children:a.name}),a.description?(0,b.jsx)("span",{className:"text-muted-foreground text-[11px]",children:a.description}):null]}),c>0?(0,b.jsxs)("span",{className:"text-muted-foreground ml-auto shrink-0 text-[11px]",children:[d,"/",c]}):null]}),c>0?(0,b.jsx)("div",{className:"ml-5.5 flex flex-col gap-1",children:a.acceptanceCriteria.map((a,c)=>(0,b.jsx)(cf,{criterion:a},a.description||`ac-${c}`))}):null]})}function cf({criterion:a}){return(0,b.jsxs)("div",{"data-testid":"acceptance-criterion",className:"flex items-start gap-1.5",children:[a.verified?(0,b.jsx)(k.Check,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-600"}):(0,b.jsx)(b5.Circle,{className:"text-muted-foreground mt-0.5 h-3 w-3 shrink-0"}),(0,b.jsx)("span",{className:(0,V.cn)("text-[11px]",a.verified?"text-muted-foreground line-through":"text-foreground"),children:a.description})]})}let cg={Requirements:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",ClarificationRequired:"border-transparent bg-amber-50 text-amber-700 hover:bg-amber-50",Ready:"border-transparent bg-green-50 text-green-700 hover:bg-green-50"};function ch({plan:a,loading:c,error:d}){return c?(0,b.jsx)("div",{"data-testid":"plan-tab-loading",className:"flex items-center justify-center p-8",children:(0,b.jsx)(f.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):d?(0,b.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,b.jsx)(O.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{children:d})]}):a?(0,b.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Plan State"}),(0,b.jsx)(W.Badge,{className:cg[a.state]??"border-transparent bg-gray-50 text-gray-700",children:a.state})]}),a.overview?(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Overview"}),(0,b.jsx)("p",{className:"text-sm leading-relaxed",children:a.overview})]}):null,(0,b.jsx)(ca,{tasks:a.tasks})]}):(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,b.jsx)(b4,{className:"text-muted-foreground h-8 w-8"}),(0,b.jsx)("p",{className:"text-muted-foreground text-sm",children:"No plan created yet"})]})}var ci=a.i(61544);function cj(){return{data:null,loading:!1,error:null}}let ck=[{key:"overview",label:"Overview"},{key:"activity",label:"Activity"},{key:"log",label:"Log"},{key:"plan",label:"Plan"},{key:"prd-review",label:"PRD Review"},{key:"tech-decisions",label:"Tech Decisions"},{key:"product-decisions",label:"Product"},{key:"merge-review",label:"Merge Review"},{key:"chat",label:"Chat"}],cl={activity:async function(a){let b=await R(a);if("error"in b)throw Error(b.error);return{timings:b.timings,rejectionFeedback:b.rejectionFeedback}},plan:async function(a){let b=await S(a);if("error"in b)throw Error(b.error);return b.plan}};function cm({featureName:a,headerContent:e,featureNode:g,featureId:h,initialTab:i,urlTab:j,prdData:k,prdSelections:l,onPrdSelect:m,onPrdApprove:n,onPrdReject:o,isPrdLoading:p,techData:q,onTechApprove:r,onTechReject:s,isTechLoading:t,productData:u,mergeData:v,onMergeApprove:w,onMergeReject:x,isMergeLoading:y,syncStatus:z,syncLoading:A,syncError:B,onRefreshSync:C,onRebaseOnMain:D,rebaseLoading:E,rebaseError:F,isRejecting:G,chatInput:H,onChatInputChange:I,sseEvents:J,interactiveAgentEnabled:K=!0}){let L=(0,d.usePathname)(),M=(0,c.useMemo)(()=>(function(a,b=!0){let c=["overview","activity"];return a.hasAgentRun&&c.push("log"),a.hasPlan&&c.push("plan"),"requirements"===a.lifecycle&&"action-required"===a.state&&c.push("prd-review"),"implementation"===a.lifecycle&&"action-required"===a.state&&c.push("tech-decisions","product-decisions"),"review"===a.lifecycle&&("action-required"===a.state||"error"===a.state)&&c.push("merge-review"),"maintain"===a.lifecycle&&a.pr&&c.push("merge-review"),b&&c.push("chat"),c})(g,K),[g,K]),N=(0,c.useMemo)(()=>ck.filter(a=>M.includes(a.key)).map(a=>"merge-review"===a.key&&"maintain"===g.lifecycle?{...a,label:"Merge History"}:a),[M,g.lifecycle]),R=(0,c.useMemo)(()=>{let a=L.match(/^(\/feature\/[^/]+)/);return a?a[1]:L},[L]),S=(0,c.useMemo)(()=>j&&M.includes(j)?j:i&&M.includes(i)?i:"overview",[]),[T,U]=(0,c.useState)(S),V=function(a){let[b,d]=(0,c.useState)(""),[e,f]=(0,c.useState)(!1),[g,h]=(0,c.useState)(null),i=(0,c.useRef)(null),j=(0,c.useCallback)(()=>{i.current&&(i.current.close(),i.current=null),f(!1)},[]);return(0,c.useEffect)(()=>{if(!a){d(""),f(!1),h(null);return}d(""),h(null);let b=new EventSource(`/api/feature-logs?featureId=${a}`);return i.current=b,b.onopen=()=>{f(!0)},b.addEventListener("initial",a=>{d(JSON.parse(a.data).content)}),b.addEventListener("log",a=>{let b=JSON.parse(a.data);d(a=>a+b.content)}),b.addEventListener("error",a=>{try{let b=JSON.parse(a.data);h(b.error)}catch{h(a.data?String(a.data):"Log stream unavailable")}}),b.onerror=()=>{f(!1)},()=>{b.close(),i.current=null}},[a,j]),{content:b,isConnected:e,error:g}}("log"===T?h:null),{tabs:W,fetchTab:X,refreshTab:Y}=function(a,b){let d=Object.keys(b),[e,f]=(0,c.useState)(()=>{let a={};for(let b of d)a[b]=cj();return a}),g=(0,c.useRef)(b);g.current=b;let h=(0,c.useRef)(a);h.current=a;let i=(0,c.useRef)(!0);(0,c.useEffect)(()=>(i.current=!0,()=>{i.current=!1}),[]);let j=(0,c.useRef)(a);(0,c.useEffect)(()=>{j.current!==a&&(j.current=a,f(a=>{let b={};for(let c of Object.keys(a))b[c]=cj();return b}))},[a]);let k=(0,c.useCallback)(async a=>{let b=g.current[a],c=h.current;if(b){i.current&&f(b=>b[a]?.data!==null?b:{...b,[a]:{...b[a],loading:!0,error:null}});try{let d=await b(c);i.current&&f(b=>({...b,[a]:{data:d,loading:!1,error:null}}))}catch(b){i.current&&f(c=>{let d=b instanceof Error?b.message:"Failed to fetch tab data",e=c[a]?.data??null;return{...c,[a]:{data:e,loading:!1,error:e?null:d}}})}}},[]),l=(0,c.useCallback)(async a=>{let b=e[a];b&&null!==b.data||b&&b.loading||await k(a)},[e,k]);return{tabs:e,fetchTab:l,refreshTab:(0,c.useCallback)(async a=>{await k(a)},[k])}}(h,cl),Z=(0,c.useRef)(!1);(0,c.useEffect)(()=>{if(!Z.current)return;Z.current=!1;let a="overview"===T?R:`${R}/${T}`;a!==L&&window.history.pushState(null,"",a)},[T,R,L]);let $=(0,c.useRef)(L);(0,c.useEffect)(()=>{if($.current===L||($.current=L,Z.current))return;let a=L.split("/"),b=a.length>=4?a[3]:void 0,c=b&&M.includes(b)?b:"overview";c!==T&&(U(c),("activity"===c||"plan"===c)&&X(c))},[L]);let _=(0,c.useRef)(!1);(0,c.useEffect)(()=>{if(!_.current&&(_.current=!0,!j&&"overview"!==S)){let a=`${R}/${S}`;a!==L&&window.history.replaceState(null,"",a)}},[]);let aa=(0,c.useRef)(!1);(0,c.useEffect)(()=>{aa.current||(aa.current=!0,("activity"===T||"plan"===T)&&X(T))},[T,X]);let ab=(0,c.useRef)(h);(0,c.useEffect)(()=>{ab.current!==h&&(ab.current=h,U("overview"))},[h]);let ac=(0,c.useRef)(i);(0,c.useEffect)(()=>{if(ac.current!==i&&i&&M.includes(i)){ac.current=i,U(i),("activity"===i||"plan"===i)&&X(i);let a="overview"===i?R:`${R}/${i}`;a!==window.location.pathname&&window.history.replaceState(null,"",a)}},[i,M,R,X]),(0,c.useEffect)(()=>{M.includes(T)||(U("overview"),window.location.pathname!==R&&window.history.replaceState(null,"",R))},[M,T,R]);let ad=(0,c.useRef)(T);ad.current=T;let af=(0,c.useRef)(0);(0,c.useEffect)(()=>{if(!J||0===J.length||(af.current>J.length&&(af.current=0),J.length<=af.current))return;let a=J.slice(af.current);if(af.current=J.length,!a.some(a=>a.featureId===h))return;Y("activity");let b=ad.current;"plan"===b&&Y(b)},[J,h,Y]);let ag="running"===g.state||"creating"===g.state;(0,c.useEffect)(()=>{if(!ag)return;let a=setInterval(()=>{Y("activity")},5e3);return()=>clearInterval(a)},[ag,Y]);let ah=(0,c.useCallback)(a=>{Z.current=!0,U(a),("activity"===a||"plan"===a)&&X(a)},[X]);return(0,b.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:(0,b.jsxs)(P.Tabs,{value:T,onValueChange:ah,className:"flex min-h-0 flex-1 flex-col",children:[(0,b.jsxs)("div",{className:"shrink-0 px-4 pt-4 pb-3","data-testid":"feature-drawer-header",children:[(0,b.jsxs)("div",{className:"flex items-baseline gap-4 pr-6",children:[a?(0,b.jsx)("h2",{className:"text-foreground min-w-0 shrink truncate text-base font-semibold tracking-tight",children:a}):null,(0,b.jsx)(P.TabsList,{className:"h-auto shrink-0 gap-0.5 rounded-none border-0 bg-transparent p-0",children:N.map(a=>(0,b.jsx)(P.TabsTrigger,{value:a.key,className:"text-muted-foreground hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-primary h-auto rounded-none border-b-2 border-transparent bg-transparent px-2 py-0.5 text-[12px] font-medium shadow-none transition-colors data-[state=active]:bg-transparent data-[state=active]:shadow-none",children:a.label},a.key))})]}),e]}),(0,b.jsx)(Q.Separator,{}),(0,b.jsx)(P.TabsContent,{value:"overview",className:"mt-0 flex-1 overflow-y-auto",children:(0,b.jsx)(bc,{data:g,syncStatus:z,syncLoading:A,syncError:B,onRefreshSync:C,onRebaseOnMain:D,rebaseLoading:E,rebaseError:F})}),(0,b.jsx)(P.TabsContent,{value:"activity",className:"mt-0 flex-1 overflow-y-auto",children:(0,b.jsx)(bA,{timings:W.activity.data?.timings??null,loading:W.activity.loading,error:W.activity.error,rejectionFeedback:W.activity.data?.rejectionFeedback})}),(0,b.jsx)(P.TabsContent,{value:"log",className:"mt-0 flex-1 overflow-hidden",children:(0,b.jsx)(b3,{content:V.content,isConnected:V.isConnected,error:V.error})}),(0,b.jsx)(P.TabsContent,{value:"plan",className:"mt-0 flex-1 overflow-y-auto",children:(0,b.jsx)(ch,{plan:W.plan.data,loading:W.plan.loading,error:W.plan.error})}),M.includes("prd-review")?(0,b.jsx)(P.TabsContent,{value:"prd-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:k?(0,b.jsx)(ae,{data:k,selections:l??{},onSelect:m??(()=>void 0),onApprove:n??(()=>void 0),onReject:o,isProcessing:p,isRejecting:G,chatInput:H,onChatInputChange:I}):(0,b.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,b.jsx)(f.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,M.includes("tech-decisions")?(0,b.jsx)(P.TabsContent,{value:"tech-decisions",className:"mt-0 flex min-h-0 flex-1 flex-col",children:q?(0,b.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,b.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,b.jsx)(ak,{data:q})}),(0,b.jsx)(cn,{onApprove:r??(()=>void 0),onReject:s,isProcessing:t,isRejecting:G,chatInput:H,onChatInputChange:I})]}):(0,b.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,b.jsx)(f.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,M.includes("product-decisions")?(0,b.jsx)(P.TabsContent,{value:"product-decisions",className:"mt-0 flex-1 overflow-y-auto",children:null===u?(0,b.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,b.jsx)(f.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):u?(0,b.jsx)(an,{data:u}):(0,b.jsx)("p",{className:"text-muted-foreground p-4 text-center text-sm",children:"No product decisions available."})}):null,M.includes("merge-review")?(0,b.jsx)(P.TabsContent,{value:"merge-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:v?(0,b.jsx)(aO,{data:v,readOnly:"maintain"===g.lifecycle,onApprove:w??(()=>void 0),onReject:x,isProcessing:y,isRejecting:G,chatInput:H,onChatInputChange:I}):(0,b.jsx)("div",{className:"flex items-center justify-center p-8",children:y?(0,b.jsx)(f.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"}):(0,b.jsxs)("div",{className:"text-muted-foreground flex flex-col items-center gap-2 text-sm",children:[(0,b.jsx)(O.AlertCircle,{className:"h-6 w-6"}),(0,b.jsx)("span",{children:"Merge review data unavailable"})]})})}):null,M.includes("chat")?(0,b.jsx)(P.TabsContent,{value:"chat",className:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,b.jsx)(ci.ChatTab,{featureId:h,worktreePath:g.worktreePath})}):null]})})}function cn({onApprove:a,onReject:c,isProcessing:d,isRejecting:e,chatInput:f,onChatInputChange:g}){return(0,b.jsx)(ad,{onReject:c,onApprove:a,approveLabel:"Approve Plan",revisionPlaceholder:"Ask AI to revise the plan...",isProcessing:d,isRejecting:e,chatInput:f,onChatInputChange:g})}var co=a.i(390),cp=a.i(72572),cq=a.i(62720);let cr=(0,p.createServerReference)("40ae4ba52c7d7be0e79e0c2d655a3640adad2ea4be",p.callServer,void 0,p.findSourceMapURL,"rebaseFeature");var cs=a.i(74146);function ct(a){return"requirements"===a.lifecycle&&"action-required"===a.state?"prd-review":"implementation"===a.lifecycle&&"action-required"===a.state?"tech-decisions":"review"===a.lifecycle&&("action-required"===a.state||"error"===a.state)?"merge-review":"overview"}function cu(a,b,d,f,g,h){let[i,j]=(0,c.useState)(!1),k=(0,c.useRef)(d),l=(0,c.useRef)(f);return k.current=d,l.current=f,(0,c.useEffect)(()=>{if(l.current(),!a)return;let c=!1;return j(!0),b(a).then(a=>{c||k.current(a)}).catch(()=>{!c&&g&&e.toast.error(g)}).finally(()=>{c||j(!1)}),()=>{c=!0}},[a,b,g,h]),i}let cv=(0,p.createServerReference)("40a354fc327149d4f23fa483050dc9c4a9f699f700",p.callServer,void 0,p.findSourceMapURL,"getFeatureDrawerData"),cw=(0,p.createServerReference)("40b1550f01450592d4367beec4f99c5a30fa63ae50",p.callServer,void 0,p.findSourceMapURL,"getBranchSyncStatus"),cx=new Map;function cy({view:a,urlTab:p,interactiveAgentEnabled:I=!0}){var J;let K,L,M,O,P,Q=(0,x.useFeatureFlags)(),R=(0,d.useRouter)(),S=(0,y.useSoundAction)("reject"),[T,U]=(0,c.useState)(a);(0,c.useEffect)(()=>{U(a)},[a]);let V="feature"===T.type?T.node:null,{events:W}=(0,B.useAgentEventsContext)(),X=(0,c.useRef)(0);(0,c.useEffect)(()=>{if(X.current>W.length&&(X.current=0),!V||W.length<=X.current)return;let a=W.slice(X.current);for(let b of(X.current=W.length,(0,cs.resolveSseEventUpdates)(a)))b.featureId===V.featureId&&"deleting"!==V.state&&(void 0!==b.state||void 0!==b.lifecycle)&&U(a=>{if("feature"!==a.type)return a;let c={...a.node,...void 0!==b.state&&{state:b.state},...void 0!==b.lifecycle&&{lifecycle:b.lifecycle}};return{...a,node:c,initialTab:ct(c)}})},[W,V]);let Y=(0,d.usePathname)().startsWith("/feature/");J=V?.featureId??null,K=(0,c.useRef)(Y),L=(0,c.useRef)(!1),M=(0,c.useCallback)(async()=>{if(J&&!L.current){L.current=!0;try{let a=await cv(J);if(!a)return;U(b=>(function(a,b){if("feature"!==a.type)return a;let c={...a.node,...b},d=c.state!==a.node.state||c.lifecycle!==a.node.lifecycle;return{...a,node:c,initialTab:d?ct(c):a.initialTab}})(b,a))}catch{}finally{L.current=!1}}},[J,U]),O=(0,c.useRef)(!1),(0,c.useEffect)(()=>{!Y||K.current&&O.current||(O.current=!0,M()),K.current=Y},[Y,M]),(0,c.useEffect)(()=>{if(!Y||!J)return;let a=setInterval(()=>{M()},15e3);return()=>clearInterval(a)},[Y,J,M]);let Z=(0,c.useCallback)(()=>{R.push("/")},[R]),[$,_]=(0,c.useState)(""),[aa,ab]=(0,c.useState)(null),[ac,ad]=(0,c.useState)({}),[ae,af]=(0,c.useState)({}),[ag,ah]=(0,c.useState)(null),[ai,aj]=(0,c.useState)(void 0),[ak,al]=(0,c.useState)(null),[am,an]=(0,c.useState)(!1),[ao,ap]=(0,c.useState)(!1),[aq,ar]=(0,c.useState)(!1),as=`${V?.featureId}:${V?.state}`,at=(0,c.useRef)(as);(0,c.useEffect)(()=>{as!==at.current&&(at.current=as,ar(!1))},[as]);let[au,av]=(0,c.useState)(!1),aw=(0,c.useRef)(!1),ax="feature"===T.type?T.initialTab:void 0;(0,c.useEffect)(()=>{_("")},[ax]);let ay=(0,c.useRef)(0),az=(0,c.useRef)(V?.state),aA=(0,c.useRef)(V?.lifecycle);(V?.state!==az.current||V?.lifecycle!==aA.current)&&(az.current=V?.state,aA.current=V?.lifecycle,ay.current+=1);let aB=ay.current,aC=cu(V?.lifecycle==="requirements"&&V?.state==="action-required"?V.featureId:null,u,a=>{if(a.error)return void e.toast.error(a.error);if(a.questionnaire){ab(a.questionnaire);let b={};for(let c of a.questionnaire.questions){let a=c.options.find(a=>a.recommended);a&&(b[c.id]=a.id)}ad(b),af(b)}},()=>{ad({}),af({}),ab(null)},"Failed to load questionnaire",aB),aD=V?.lifecycle==="implementation"&&V?.state==="action-required"?V.featureId:null,aE=cu(aD,v,a=>{a.error?e.toast.error(a.error):a.techDecisions&&ah(a.techDecisions)},()=>ah(null),"Failed to load tech decisions",aB),aF=cu(aD,u,a=>{a.productDecisions&&aj(a.productDecisions)},()=>aj(void 0),void 0,aB),aG=cu(V?.lifecycle==="review"&&(V?.state==="action-required"||V?.state==="error")||V?.lifecycle==="maintain"&&V?.pr?V.featureId:null,w,a=>{"error"in a?e.toast.error(a.error):al(a)},()=>al(null),"Failed to load merge review data",aB),aH=$.trim().length>0,aI=V?.lifecycle==="requirements"&&V?.state==="action-required"&&Object.keys(ae).some(a=>ae[a]!==ac[a]),aJ=(0,c.useCallback)(()=>{_(""),ad({...ae})},[ae]),{attemptClose:aK}=(0,z.useGuardedDrawerClose)({open:Y,isDirty:aH||aI,onClose:Z,onReset:aJ}),aL=(0,c.useCallback)(async(a,b,c=[],d)=>{if(V?.featureId){aw.current=!0,av(!0);try{let f=c.map(a=>a.path).filter(Boolean),g=c.filter(a=>a.notes?.trim()),h=g.length>0?`${a}
|
|
1
|
+
module.exports=[64885,a=>{"use strict";var b=a.i(10973),c=a.i(96960);a.i(90370);var d=a.i(24640),e=a.i(69845),f=a.i(52313),g=a.i(88064),h=a.i(16605),i=a.i(50490),j=a.i(5698),k=a.i(98410),l=a.i(72016),m=a.i(50488),n=a.i(71238),o=a.i(33511),p=a.i(1585),q=a.i(25674);let r=(0,q.createServerReference)("60d632aaebd8a43ac6c895d3b392e42aa68d93a365",q.callServer,void 0,q.findSourceMapURL,"approveFeature");var s=a.i(56702),t=a.i(42908);let u=(0,q.createServerReference)("70fdb675e47e73bb0a13f454ee690b87674aeb4aee",q.callServer,void 0,q.findSourceMapURL,"rejectFeature"),v=(0,q.createServerReference)("40575a69049168e5c10ba9dab86e155ac26e0c1692",q.callServer,void 0,q.findSourceMapURL,"getFeatureArtifact"),w=(0,q.createServerReference)("40678a016106b85e03878a56cabf03db2569d874bb",q.callServer,void 0,q.findSourceMapURL,"getResearchArtifact"),x=(0,q.createServerReference)("40e8068b492ef1a11316d6c0376abdb0a44be6edb0",q.callServer,void 0,q.findSourceMapURL,"getMergeReviewData");var y=a.i(21333),z=a.i(19884),A=a.i(96213),B=a.i(18662),C=a.i(84871);a.i(78454);var D=a.i(24255);a.i(49235);var E=a.i(85080),F=a.i(18948),G=a.i(82934);a.i(77569);var H=a.i(65310);a.i(69029);var I=a.i(5623),J=a.i(63698),K=a.i(3195),L=a.i(71716),M=a.i(82697),N=a.i(75192);function O({actions:a,repositoryPath:d,worktreePath:e,showSpecs:f}){let[h,i]=(0,c.useState)(!1),j=a.ideLoading||a.shellLoading||a.folderLoading||a.specsLoading,n=a.ideError??a.shellError??a.folderError??a.specsError;return(0,b.jsxs)(N.DropdownMenu,{modal:!1,children:[(0,b.jsx)(N.DropdownMenuTrigger,{asChild:!0,children:(0,b.jsxs)(F.Button,{variant:"outline",size:"sm",className:"gap-1.5",disabled:j,children:[j?(0,b.jsx)(g.Loader2,{className:"size-4 animate-spin"}):n?(0,b.jsx)(M.CircleAlert,{className:"text-destructive size-4"}):(0,b.jsx)(K.FolderOpen,{className:"size-4"}),"Open",(0,b.jsx)(L.ChevronDown,{className:"size-3 opacity-60"})]})}),(0,b.jsxs)(N.DropdownMenuContent,{align:"start",className:"w-48",children:[(0,b.jsx)(N.DropdownMenuLabel,{children:"Open in"}),(0,b.jsxs)(N.DropdownMenuItem,{onClick:a.openInIde,disabled:a.ideLoading,className:"gap-2",children:[a.ideLoading?(0,b.jsx)(g.Loader2,{className:"size-4 animate-spin"}):a.ideError?(0,b.jsx)(M.CircleAlert,{className:"text-destructive size-4"}):(0,b.jsx)(m.Code2,{className:"size-4"}),"IDE"]}),(0,b.jsxs)(N.DropdownMenuItem,{onClick:a.openInShell,disabled:a.shellLoading,className:"gap-2",children:[a.shellLoading?(0,b.jsx)(g.Loader2,{className:"size-4 animate-spin"}):a.shellError?(0,b.jsx)(M.CircleAlert,{className:"text-destructive size-4"}):(0,b.jsx)(J.Terminal,{className:"size-4"}),"Terminal"]}),(0,b.jsxs)(N.DropdownMenuItem,{onClick:a.openFolder,disabled:a.folderLoading,className:"gap-2",children:[a.folderLoading?(0,b.jsx)(g.Loader2,{className:"size-4 animate-spin"}):a.folderError?(0,b.jsx)(M.CircleAlert,{className:"text-destructive size-4"}):(0,b.jsx)(K.FolderOpen,{className:"size-4"}),"Folder"]}),(0,b.jsxs)(N.DropdownMenuItem,{onClick:a.openSpecsFolder,disabled:a.specsLoading||!f,className:"gap-2",children:[a.specsLoading?(0,b.jsx)(g.Loader2,{className:"size-4 animate-spin"}):a.specsError?(0,b.jsx)(M.CircleAlert,{className:"text-destructive size-4"}):(0,b.jsx)(K.FolderOpen,{className:"size-4"}),"Specs Folder"]}),(0,b.jsx)(N.DropdownMenuSeparator,{}),(0,b.jsxs)(N.DropdownMenuItem,{onClick:()=>{navigator.clipboard.writeText(e??d),i(!0),setTimeout(()=>i(!1),2e3)},className:"gap-2",children:[h?(0,b.jsx)(l.Check,{className:"size-4 text-green-600"}):(0,b.jsx)(k.Copy,{className:"size-4"}),h?"Copied!":"Copy path"]})]})]})}var P=a.i(72980),Q=a.i(41305),R=a.i(13126);let S=(0,q.createServerReference)("403069ea90b0976fc6b45596730c9705a1abbed677",q.callServer,void 0,q.findSourceMapURL,"getFeaturePhaseTimings"),T=(0,q.createServerReference)("401e6a144a28a23b9d5d57fcb0e78fb7c67cc558f9",q.callServer,void 0,q.findSourceMapURL,"getFeaturePlan");var U=a.i(94132),V=a.i(3410),W=a.i(85536),X=a.i(58339),Y=a.i(45242),Z=a.i(25700);let $=(0,Z.default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);var _=a.i(91498),aa=a.i(79620);a.i(307);var ab=a.i(30931),ac=a.i(39116);let ad=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp",".ico",".pdf",".doc",".docx",".xls",".xlsx",".ppt",".pptx",".txt",".md",".csv",".json",".yaml",".yml",".xml",".ts",".tsx",".js",".jsx",".py",".rb",".go",".rs",".java",".c",".cpp",".h",".hpp",".cs",".swift",".kt",".html",".css",".scss",".less",".sh",".bash",".zsh",".fish",".toml",".ini",".cfg",".conf",".env",".zip",".tar",".gz",".log"]);function ae({onReject:a,onApprove:e,approveLabel:f,approveVariant:g="default",revisionPlaceholder:h,isProcessing:i=!1,isRejecting:j=!1,children:k,chatInput:m,onChatInputChange:n}){let{t:o}=(0,d.useTranslation)("web"),p="warning"===g,q=p?_.AlertTriangle:l.Check,r=p?"bg-orange-500/85":"bg-blue-500/85",[s,t]=(0,c.useState)(""),u=m??s,v=n??t,w=(0,z.useSoundAction)("approve"),x=i||j,[y,A]=(0,c.useState)([]),[B,C]=(0,c.useState)(!1),[D,E]=(0,c.useState)(null),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)(!1),[L,M]=(0,c.useState)(!1),N=u.trim().length>0,O=N?H||J&&L:!H,P=(0,c.useRef)(0),Q=(0,c.useRef)(crypto.randomUUID()),R=(0,c.useRef)(null);(0,c.useEffect)(()=>{function a(a){("Control"===a.key||"Meta"===a.key)&&K(!0),"Shift"===a.key&&M(!0)}function b(a){("Control"===a.key||"Meta"===a.key)&&K(!1),"Shift"===a.key&&M(!1)}function c(){K(!1),M(!1)}return window.addEventListener("keydown",a),window.addEventListener("keyup",b),window.addEventListener("blur",c),()=>{window.removeEventListener("keydown",a),window.removeEventListener("keyup",b),window.removeEventListener("blur",c)}},[]);let S=(0,c.useCallback)(async a=>{for(let b of(E(null),a)){if(b.size>0xa00000)return void E(`"${b.name}" exceeds 10 MB limit`);let a=function(a){let b=a.lastIndexOf(".");return b>=0?a.slice(b).toLowerCase():""}(b.name);if(a&&!ad.has(a))return void E(`File type "${a}" is not allowed`)}for(let b of a){let a=crypto.randomUUID();A(c=>[...c,{id:a,name:b.name,size:b.size,mimeType:b.type||"application/octet-stream",path:"",loading:!0}]);try{let c=new FormData;c.append("file",b),c.append("sessionId",Q.current);let d=await fetch("/api/attachments/upload",{method:"POST",body:c});if(!d.ok){let b=await d.json().catch(()=>({error:"Upload failed"}));A(b=>b.filter(b=>b.id!==a)),E(b.error??"Upload failed");return}let e=await d.json();A(b=>b.some(b=>b.id!==a&&b.path===e.path)?b.filter(b=>b.id!==a):b.map(b=>b.id===a?{...e,id:a,loading:!1}:b))}catch{A(b=>b.filter(b=>b.id!==a)),E("Upload failed")}}},[]),T=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),P.current+=1,1===P.current&&C(!0)},[]),V=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),P.current-=1,0===P.current&&C(!1)},[]),X=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation()},[]),Z=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),P.current=0,C(!1);let b=Array.from(a.dataTransfer.files);b.length>0&&S(b)},[S]),ae=(0,c.useCallback)(a=>{let b=a.clipboardData?.items;if(!b)return;let c=[];for(let a of Array.from(b))if("file"===a.kind){let b=a.getAsFile();b&&c.push(b)}c.length>0&&(a.preventDefault(),S(c))},[S]),af=(0,c.useCallback)(async()=>{try{let a=await (0,ac.pickFiles)();a&&A(b=>{let c=new Set(b.map(a=>a.path)),d=a.filter(a=>!c.has(a.path)).map(a=>({id:crypto.randomUUID(),name:a.name,size:a.size,mimeType:"application/octet-stream",path:a.path}));return d.length>0?[...b,...d]:b})}catch{}},[]),ag=(0,c.useCallback)(a=>{A(b=>b.filter(b=>b.id!==a))},[]),ah=(0,c.useCallback)((a,b)=>{A(c=>c.map(c=>c.id===a?{...c,notes:b}:c))},[]),ai=(0,c.useCallback)(()=>{v(""),A([]),E(null)},[v]),aj=(0,c.useCallback)(a=>{(a.ctrlKey||a.metaKey)&&"Enter"===a.key&&(a.preventDefault(),R.current?.requestSubmit())},[]),ak="u">typeof navigator&&/Mac/i.test(navigator.userAgent)?"⌘":"Ctrl";return(0,b.jsxs)("div",{className:"border-border shrink-0 border-t",children:[k,a?(0,b.jsx)(G.TooltipProvider,{delayDuration:400,children:(0,b.jsx)("form",{ref:R,onSubmit:function(b){b.preventDefault();let c=u.trim();if(O)w.play(),e(),ai();else{if(!c||!a)return;a(c,y.filter(a=>!a.loading)),ai()}},className:"p-3",children:(0,b.jsx)("div",{role:"region","aria-label":o("createDrawer.fileDropZone"),"data-drag-over":B?"true":"false",onDragEnter:T,onDragLeave:V,onDragOver:X,onDrop:Z,className:(0,W.cn)("rounded-md border-2 border-transparent transition-colors",B&&"border-primary/50 bg-primary/5"),children:(0,b.jsxs)("div",{className:"border-input focus-within:ring-ring/50 focus-within:border-ring flex flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow] focus-within:ring-[3px]",children:[(0,b.jsx)(aa.Textarea,{placeholder:h??"Ask AI to revise...","aria-label":h??"Ask AI to revise...",disabled:x,value:u,onChange:a=>v(a.target.value),onKeyDown:aj,onPaste:ae,rows:1,className:"max-h-[35dvh] min-h-9 flex-1 resize-none overflow-y-auto rounded-none border-0 py-2 shadow-none focus-visible:ring-0","data-testid":"drawer-chat-input"}),y.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:y.map(a=>(0,b.jsx)(ab.AttachmentChip,{name:a.name,size:a.size,mimeType:a.mimeType,path:a.path,onRemove:()=>ag(a.id),disabled:x,loading:a.loading,notes:a.notes,onNotesChange:b=>ah(a.id,b)},a.id))}),D?(0,b.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:D}):null,(0,b.jsxs)("div",{className:"border-input flex items-center gap-2 border-t px-3 py-1.5",children:[(0,b.jsxs)("span",{className:"text-muted-foreground flex-1 truncate text-[11px]",children:[(0,b.jsxs)("kbd",{className:"bg-muted rounded px-1 py-0.5 font-mono text-[10px]",children:[ak,"+Enter"]})," ",N?"reject":"approve"]}),(0,b.jsxs)(G.Tooltip,{children:[(0,b.jsx)(G.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:af,disabled:x,"aria-label":o("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,b.jsx)(Y.PaperclipIcon,{className:"h-4 w-4"})})}),(0,b.jsx)(G.TooltipContent,{side:"top",children:o("chat.attachFiles")})]}),(0,b.jsx)("div",{onMouseLeave:()=>I(!1),children:(0,b.jsxs)(G.Tooltip,{children:[(0,b.jsx)(G.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("button",{type:"submit",disabled:x,"data-testid":"drawer-action-submit",className:(0,W.cn)("relative flex h-9 min-w-[12rem] cursor-pointer items-center overflow-hidden rounded-md border ps-4 pe-10 text-sm font-medium whitespace-nowrap transition-colors","disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",O?`${p?"border-orange-400/60":"border-blue-400/60"} text-white`:N&&J&&!L?"border-primary bg-muted ring-primary/30 shadow-sm ring-1":"border-border bg-muted/50 hover:bg-muted shadow-sm"),children:[(0,b.jsx)("div",{className:(0,W.cn)("pointer-events-none absolute inset-0 transition-transform duration-300 ease-in-out",r),style:{transform:O?"translateX(0)":"translateX(100%)"}}),(0,b.jsxs)("span",{className:(0,W.cn)("absolute inset-0 z-10 flex items-center justify-center gap-2 pe-8 transition-opacity duration-300",O?"opacity-0":"opacity-100"),children:[(0,b.jsx)($,{className:"h-4 w-4 shrink-0"}),"Reject"]}),(0,b.jsxs)("span",{className:(0,W.cn)("absolute inset-0 z-10 flex items-center justify-center gap-2 text-white transition-opacity duration-300",O?"opacity-100":"opacity-0"),children:[(0,b.jsx)(q,{className:"h-4 w-4 shrink-0"}),f]}),(0,b.jsx)("span",{className:(0,W.cn)(`border-input/60 absolute inset-y-0 right-0 z-20 flex w-8 cursor-pointer items-center justify-center rounded-e-[5px] border-s ${r} transition-opacity duration-300`,!N&&!H&&"pointer-events-none opacity-0"),onMouseEnter:()=>I(!0),children:(0,b.jsx)(U.ChevronLeft,{className:"h-4 w-4 text-white"})})]})}),p?null:(0,b.jsx)(G.TooltipContent,{side:"top",children:O?f:o("drawerActionBar.sendRevisionFeedback")})]})})]})]})})})}):(0,b.jsx)("div",{className:"flex items-center gap-2 px-4 pb-4",children:(0,b.jsx)(F.Button,{type:"button",className:"flex-1",disabled:x,onClick:()=>{w.play(),e()},children:f})})]})}function af({data:a,selections:d,onSelect:e,onApprove:f,onReject:g,isProcessing:h=!1,isRejecting:i=!1,showHeader:j=!1,chatInput:k,onChatInputChange:l}){let{question:m,context:n,questions:o,finalAction:p}=a,[q,r]=(0,c.useState)(0),s=(0,z.useSoundAction)("select"),t=(0,z.useSoundAction)("navigate"),u=o.length,v=q===u-1,w=o[q],x=(0,c.useMemo)(()=>Object.keys(d).length,[d]),y=(0,c.useCallback)((a,b)=>{s.play(),e(a,b),v||setTimeout(()=>r(a=>a+1),250)},[e,v,s]);return 0===u?null:(0,b.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,b.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[j?(0,b.jsxs)("div",{className:"border-border flex items-start gap-3 border-b pb-3",children:[(0,b.jsx)("div",{className:"mt-1.5 h-2 w-2 shrink-0 rounded-full bg-amber-500"}),(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("h3",{className:"text-foreground mb-1.5 text-sm font-bold",children:m}),(0,b.jsx)("p",{className:"text-muted-foreground text-xs leading-relaxed",children:n})]})]}):null,(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsxs)("label",{className:"text-foreground min-w-0 flex-1 text-sm font-semibold",children:[q+1,". ",w.question]}),(0,b.jsx)("div",{className:"mt-1.5 flex shrink-0 gap-1",children:o.map((a,c)=>(0,b.jsx)("button",{type:"button","aria-label":`Go to question ${c+1}`,className:(0,W.cn)("h-1.5 rounded-full transition-all duration-200",c===q?"bg-primary w-4":"w-1.5",c!==q&&d[a.id]?"bg-primary/50":"",c===q||d[a.id]?"":"bg-muted-foreground/25"),onClick:()=>{t.play(),r(c)}},a.id))})]}),(0,b.jsx)("div",{className:"space-y-2",children:w.options.map((a,c)=>{let e=d[w.id]===a.id,f=String.fromCharCode(65+c);return(0,b.jsx)("button",{type:"button",className:(0,W.cn)("border-border w-full overflow-hidden rounded-md border px-3 py-3 text-start text-xs transition-all","hover:border-primary/70 hover:bg-primary/5 group",e&&"border-primary bg-primary/5",a.isNew&&"animate-option-highlight"),disabled:h,onClick:()=>y(w.id,a.id),children:(0,b.jsxs)("div",{className:"flex items-start gap-2",children:[(0,b.jsxs)("span",{className:"text-muted-foreground mt-0.5 font-mono text-xs",children:[f,"."]}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("div",{className:"text-foreground mb-0.5 text-xs font-semibold wrap-break-word",children:a.label}),(0,b.jsx)("div",{className:"text-muted-foreground text-xs leading-snug",children:a.rationale})]}),a.recommended||a.isNew?(0,b.jsx)("div",{className:"shrink-0 pt-0.5",children:a.recommended?(0,b.jsx)(X.Badge,{className:"px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):(0,b.jsx)(X.Badge,{className:"border-transparent bg-emerald-600 px-1.5 py-0 text-[10px] whitespace-nowrap text-white hover:bg-emerald-600/80",children:"New"})}):null]})},a.id)})})]}),(0,b.jsxs)("div",{className:"flex items-center justify-between pt-2",children:[(0,b.jsxs)(F.Button,{type:"button",variant:"ghost",size:"sm",disabled:0===q||h,onClick:()=>{t.play(),r(a=>a-1)},children:[(0,b.jsx)(U.ChevronLeft,{className:"me-1 h-4 w-4"}),"Previous"]}),v?null:(0,b.jsxs)(F.Button,{type:"button",variant:"ghost",size:"sm",disabled:h,onClick:()=>{t.play(),r(a=>a+1)},children:[d[w.id]?"Next":"Skip",(0,b.jsx)(V.ChevronRight,{className:"ms-1 h-4 w-4"})]})]})]}),(0,b.jsx)(ae,{onReject:g,onApprove:()=>f(p.id),approveLabel:p.label,revisionPlaceholder:"Ask AI to refine requirements...",isProcessing:h,isRejecting:i,chatInput:k,onChatInputChange:l,children:(0,b.jsx)("div",{className:(0,W.cn)("bg-muted h-1.5 overflow-hidden",x>0&&x<u||h?"opacity-100":"opacity-0","transition-opacity duration-200"),"data-testid":"progress-bar-container",children:h?(0,b.jsx)("div",{className:"bg-primary animate-indeterminate-progress h-full w-1/3"}):(0,b.jsx)("div",{className:"bg-primary h-full transition-all duration-300",style:{width:`${u>0?x/u*100:0}%`},"data-testid":"progress-bar"})})})]})}var ag=a.i(77610);let ah=(0,Z.default)("git-compare-arrows",[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"M12 18H7a2 2 0 0 1-2-2V9",key:"16sdep"}],["path",{d:"m9 15 3 3-3 3",key:"1m3kbl"}]]),ai=(0,Z.default)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]]),aj={p:({children:a})=>(0,b.jsx)("p",{className:"text-muted-foreground mb-2 text-xs leading-relaxed last:mb-0",children:a}),strong:({children:a})=>(0,b.jsx)("strong",{className:"text-foreground font-semibold",children:a}),em:({children:a})=>(0,b.jsx)("em",{className:"italic",children:a}),code:({children:a,className:c})=>c?(0,b.jsx)("code",{className:`${c} text-[11px]`,children:a}):(0,b.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:a}),pre:({children:a})=>(0,b.jsx)("pre",{className:"bg-muted my-2 overflow-x-auto rounded-lg border p-3",children:a}),ul:({children:a})=>(0,b.jsx)("ul",{className:"text-muted-foreground mb-2 list-disc space-y-1 ps-4 text-xs",children:a}),ol:({children:a})=>(0,b.jsx)("ol",{className:"text-muted-foreground mb-2 list-decimal space-y-1 ps-4 text-xs",children:a}),li:({children:a})=>(0,b.jsx)("li",{className:"leading-relaxed",children:a}),a:({children:a,href:c})=>(0,b.jsx)("a",{href:c,className:"text-primary underline underline-offset-2",target:"_blank",rel:"noopener noreferrer",children:a})};function ak({decision:a,index:d}){let[e,f]=(0,c.useState)(!1),g=(0,z.useSoundAction)("expand"),h=(0,z.useSoundAction)("collapse");return(0,b.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,b.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,b.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:d+1}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:a.title}),(0,b.jsx)("p",{className:"text-muted-foreground mt-0.5 text-xs",children:a.chosen})]})]}),"decisionName"in a&&a.decisionName?(0,b.jsx)(X.Badge,{variant:"secondary",className:"bg-primary/10 text-primary shrink-0",children:a.decisionName}):null]}),a.rationale?(0,b.jsx)(ag.default,{components:aj,children:a.rationale}):null]}),a.rejected.length>0?(0,b.jsxs)("div",{className:"border-border border-t",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>{e?h.play():g.play(),f(a=>!a)},className:"text-muted-foreground hover:bg-muted/50 flex w-full items-center gap-1.5 px-4 py-3 text-xs font-medium transition-colors",children:[(0,b.jsx)(V.ChevronRight,{className:`h-3.5 w-3.5 transition-transform ${e?"rotate-90":""}`}),(0,b.jsx)(ai,{className:"h-3.5 w-3.5"}),"Other Options Considered (",a.rejected.length,")"]}),e?(0,b.jsx)("div",{className:"space-y-1.5 px-4 pb-3",children:a.rejected.map(a=>(0,b.jsx)("div",{className:"bg-primary/5 rounded-md px-3 py-2",children:(0,b.jsx)("span",{className:"text-foreground text-xs",children:a})},a))}):null]}):null]})}function al({data:a}){let{summary:c,decisions:d}=a;return 0===d.length?null:(0,b.jsxs)("div",{className:"space-y-4 p-4",children:[(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("h2",{className:"text-foreground text-sm font-bold",children:"Technical Implementation Plan Review"}),c?(0,b.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:c}):null]})]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 pt-1",children:[(0,b.jsx)(ah,{className:"text-primary h-4 w-4"}),(0,b.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Technical Decisions"})]}),d.map((a,c)=>(0,b.jsx)(ak,{decision:a,index:c},a.title))]})}var am=a.i(69428);function an({item:a,index:c}){return(0,b.jsx)("div",{className:"border-border rounded-lg border",children:(0,b.jsx)("div",{className:"space-y-2 px-4 py-3",children:(0,b.jsxs)("div",{className:"flex items-start gap-2.5",children:[(0,b.jsx)("span",{className:"bg-primary text-primary-foreground flex h-6 w-6 shrink-0 items-center justify-center rounded-full text-xs font-bold",children:c+1}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("h3",{className:"text-foreground text-sm leading-tight font-semibold",children:a.question}),(0,b.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(0,b.jsx)("p",{className:"text-muted-foreground min-w-0 truncate text-xs",children:a.selectedOption}),a.wasRecommended?(0,b.jsx)(X.Badge,{className:"shrink-0 px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):null]})]})]})})})}function ao({data:a}){let{questions:c}=a;return 0===c.length?null:(0,b.jsxs)("div",{className:"space-y-4 p-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(am.ClipboardList,{className:"text-primary h-4 w-4"}),(0,b.jsx)("h3",{className:"text-foreground text-sm font-bold",children:"Product Decisions"})]}),c.map((a,c)=>(0,b.jsx)(an,{item:a,index:c},a.question))]})}let ap=(0,Z.default)("file-diff",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M9 10h6",key:"9gxzsh"}],["path",{d:"M12 13V7",key:"h0r20n"}],["path",{d:"M9 17h6",key:"r8uit2"}]]);var aq=a.i(92548),ar=a.i(53170);let as=(0,Z.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),at=(0,Z.default)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);var au=a.i(62147);let av=(0,Z.default)("monitor-play",[["path",{d:"M15.033 9.44a.647.647 0 0 1 0 1.12l-4.065 2.352a.645.645 0 0 1-.968-.56V7.648a.645.645 0 0 1 .967-.56z",key:"vbtd3f"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);var aw=a.i(9955),ax=a.i(67075),ay=a.i(58428),ay=ay,az=a.i(46847);function aA({status:a}){switch(a){case az.CiStatus.Success:return(0,b.jsxs)(X.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,b.jsx)(ax.CheckCircle2,{className:"me-1 h-3.5 w-3.5"}),"Passing"]});case az.CiStatus.Pending:return(0,b.jsxs)(X.Badge,{className:"border-transparent bg-yellow-50 text-yellow-700 hover:bg-yellow-50",children:[(0,b.jsx)(g.Loader2,{className:"me-1 h-3.5 w-3.5 animate-spin"}),"Pending"]});case az.CiStatus.Failure:return(0,b.jsxs)(X.Badge,{className:"border-transparent bg-red-50 text-red-700 hover:bg-red-50",children:[(0,b.jsx)(ay.default,{className:"me-1 h-3.5 w-3.5"}),"Failing"]})}}let aB=(0,Z.default)("file-plus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}],["path",{d:"M12 18v-6",key:"17g6i2"}]]),aC=(0,Z.default)("file-minus",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M9 15h6",key:"cctwl0"}]]),aD=(0,Z.default)("file-pen",[["path",{d:"M12.659 22H18a2 2 0 0 0 2-2V8a2.4 2.4 0 0 0-.706-1.706l-3.588-3.588A2.4 2.4 0 0 0 14 2H6a2 2 0 0 0-2 2v9.34",key:"o6klzx"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10.378 12.622a1 1 0 0 1 3 3.003L8.36 20.637a2 2 0 0 1-.854.506l-2.867.837a.5.5 0 0 1-.62-.62l.836-2.869a2 2 0 0 1 .506-.853z",key:"zhnas1"}]]),aE={added:{icon:aB,label:"A",className:"text-green-600"},modified:{icon:aD,label:"M",className:"text-amber-600"},deleted:{icon:aC,label:"D",className:"text-red-600"},renamed:{icon:aD,label:"R",className:"text-blue-600"}};function aF({status:a}){let c=aE[a],d=c.icon;return(0,b.jsx)(d,{className:(0,W.cn)("h-3.5 w-3.5 shrink-0",c.className)})}function aG({hunk:a}){return(0,b.jsxs)("div",{className:"border-border border-t first:border-t-0",children:[(0,b.jsx)("div",{className:"bg-muted/50 text-muted-foreground px-3 py-1 font-mono text-[10px]",children:a.header}),(0,b.jsx)("div",{className:"font-mono text-[11px] leading-[18px]",children:a.lines.map(a=>(0,b.jsxs)("div",{className:(0,W.cn)("flex","added"===a.type&&"bg-green-50 dark:bg-green-950/30","removed"===a.type&&"bg-red-50 dark:bg-red-950/30"),children:[(0,b.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-end text-[10px] select-none",children:a.oldNumber??""}),(0,b.jsx)("span",{className:"text-muted-foreground w-10 shrink-0 px-1 text-end text-[10px] select-none",children:a.newNumber??""}),(0,b.jsx)("span",{className:(0,W.cn)("w-4 shrink-0 text-center select-none","added"===a.type&&"text-green-700 dark:text-green-400","removed"===a.type&&"text-red-700 dark:text-red-400"),children:"added"===a.type?"+":"removed"===a.type?"-":" "}),(0,b.jsx)("span",{className:"min-w-0 flex-1 pe-2 break-all whitespace-pre-wrap",children:a.content})]},`${a.type}-${a.oldNumber??""}-${a.newNumber??""}`))})]})}function aH({file:a}){let[d,e]=(0,c.useState)(!1),f=a.path.split("/").pop()??a.path,g=a.path.includes("/")?a.path.slice(0,a.path.lastIndexOf("/")):"";return(0,b.jsxs)("div",{className:"border-border border-b last:border-b-0",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>e(!d),className:"hover:bg-muted/50 flex w-full items-center gap-2 px-3 py-2 text-start",children:[(0,b.jsx)(V.ChevronRight,{className:(0,W.cn)("text-muted-foreground h-3 w-3 shrink-0 transition-transform duration-150",d&&"rotate-90")}),(0,b.jsx)(aF,{status:a.status}),(0,b.jsx)("span",{className:"text-foreground min-w-0 flex-1 truncate text-xs",children:g?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[g,"/"]}),f]}):f}),a.oldPath?(0,b.jsxs)("span",{className:"text-muted-foreground truncate text-[10px]",children:["← ",a.oldPath.split("/").pop()]}):null,(0,b.jsxs)("span",{className:"shrink-0 text-[10px]",children:[a.additions>0?(0,b.jsxs)("span",{className:"text-green-600",children:["+",a.additions]}):null,a.additions>0&&a.deletions>0?" ":null,a.deletions>0?(0,b.jsxs)("span",{className:"text-red-600",children:["-",a.deletions]}):null]})]}),d&&a.hunks.length>0?(0,b.jsx)("div",{className:"border-border overflow-x-auto border-t",children:a.hunks.map(a=>(0,b.jsx)(aG,{hunk:a},a.header))}):null]})}function aI({fileDiffs:a}){return 0===a.length?null:(0,b.jsxs)("div",{className:"border-border rounded-lg border",children:[(0,b.jsx)("div",{className:"px-4 py-3",children:(0,b.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,b.jsx)(au.FileText,{className:"text-muted-foreground h-4 w-4"}),(0,b.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changed Files"}),(0,b.jsxs)("span",{className:"text-muted-foreground text-[10px]",children:["(",a.length,")"]})]})}),(0,b.jsx)("div",{className:"border-border border-t",children:a.map(a=>(0,b.jsx)(aH,{file:a},`${a.status}-${a.path}`))})]})}let aJ={Screenshot:at,Video:av,TestOutput:au.FileText,TerminalRecording:J.Terminal},aK=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp"]),aL=new Set([".mp4",".webm",".mov"]);function aM({evidence:a}){var d,e;let f,[g,h]=(0,c.useState)(!0),i=aJ[a.type]??at,j=(f=(d=a.relativePath).lastIndexOf("."))>=0?d.slice(f).toLowerCase():"",k=(e=a.relativePath,`/api/evidence?path=${encodeURIComponent(e)}`),l="Screenshot"===a.type||aK.has(j),m="Video"===a.type||aL.has(j),n="TestOutput"===a.type||"TerminalRecording"===a.type;return(0,b.jsxs)("li",{className:"border-border rounded-md border",children:[(0,b.jsxs)("button",{type:"button",onClick:()=>h(!g),className:"flex w-full cursor-pointer items-center gap-2.5 px-3 py-2.5 text-start",children:[g?(0,b.jsx)(L.ChevronDown,{className:"text-muted-foreground h-3 w-3 shrink-0"}):(0,b.jsx)(V.ChevronRight,{className:"text-muted-foreground h-3 w-3 shrink-0"}),(0,b.jsx)(i,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("span",{className:"text-foreground text-xs font-medium",children:a.description}),a.taskRef?(0,b.jsxs)("span",{className:"text-muted-foreground ms-1.5 text-[10px]",children:["(",a.taskRef,")"]}):null]}),(0,b.jsx)("a",{href:k,download:!0,onClick:a=>a.stopPropagation(),className:"text-muted-foreground hover:text-foreground shrink-0 rounded p-1 transition-colors","aria-label":"Download",children:(0,b.jsx)(aw.Download,{className:"h-3 w-3"})})]}),g&&k?(0,b.jsx)("div",{className:"border-border border-t px-3 py-2.5",children:l?(0,b.jsx)("img",{src:k,alt:a.description,className:"max-h-80 w-full rounded-md border object-contain",loading:"lazy"}):m?(0,b.jsx)("video",{src:k,controls:!0,className:"max-h-80 w-full rounded-md border",preload:"metadata",children:(0,b.jsx)("track",{kind:"captions"})}):n?(0,b.jsx)(aN,{url:k}):(0,b.jsx)("p",{className:"text-muted-foreground truncate font-mono text-[10px]",children:a.relativePath})}):null,null]})}function aN({url:a}){let[d,e]=(0,c.useState)(null),[f,g]=(0,c.useState)(!1);return f?d?(0,b.jsx)("pre",{className:"bg-muted/50 max-h-60 overflow-auto rounded-md p-3 font-mono text-[11px] leading-relaxed",children:d}):(0,b.jsx)("p",{className:"text-muted-foreground text-[10px]",children:"Unable to load preview"}):(fetch(a).then(a=>a.ok?a.text():Promise.reject(Error("Failed"))).then(a=>{let b=a.split("\n");e(b.length>100?`${b.slice(0,100).join("\n")}
|
|
2
|
+
...`:a)}).catch(()=>e(null)).finally(()=>g(!0)),(0,b.jsx)("div",{className:"bg-muted/50 h-16 animate-pulse rounded-md"}))}function aO({evidence:a}){return(0,b.jsx)("div",{className:"border-border rounded-lg border",children:(0,b.jsxs)("div",{className:"px-4 py-3",children:[(0,b.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,b.jsx)(at,{className:"text-muted-foreground h-4 w-4"}),(0,b.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Evidence"}),(0,b.jsx)(X.Badge,{variant:"secondary",className:"text-[10px]",children:a.length})]}),(0,b.jsx)("ul",{className:"space-y-2",children:a.map(a=>(0,b.jsx)(aM,{evidence:a},`${a.type}-${a.relativePath}`))})]})})}function aP({data:a,readOnly:c=!1,onApprove:d,onReject:e,isProcessing:f=!1,isRejecting:g=!1,chatInput:h,onChatInputChange:i}){let{pr:j,diffSummary:k,fileDiffs:l,branch:m,warning:o,evidence:p,hideCiStatus:q}=a,r=j?.mergeable===!1,s=r&&e?()=>e("Resolve merge conflicts",[]):d;return(0,b.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,b.jsxs)("div",{className:"flex-1 space-y-4 overflow-y-auto p-4",children:[(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("div",{className:"mt-1.5 h-2.5 w-2.5 shrink-0 rounded-full bg-emerald-500"}),(0,b.jsxs)("div",{className:"flex-1",children:[(0,b.jsx)("h2",{className:"text-foreground text-sm font-bold",children:c?"Merge History":"Merge Review"}),(0,b.jsx)("p",{className:"text-muted-foreground mt-1 text-xs leading-relaxed",children:c?"This feature was merged. Review the pull request details and evidence below.":j?"Review the pull request details and approve to merge.":"Review the changes and approve to merge."})]})]}),m?(0,b.jsx)("div",{className:"border-border rounded-lg border",children:(0,b.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,b.jsx)(ar.GitBranch,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,b.jsx)(X.Badge,{variant:"secondary",className:"font-mono text-[11px]",children:m.source}),(0,b.jsx)(as,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,b.jsx)(X.Badge,{variant:"outline",className:"font-mono text-[11px]",children:m.target})]})}):null,j?(0,b.jsx)("div",{className:"border-border rounded-lg border",children:(0,b.jsxs)("div",{className:"space-y-3 px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("a",{href:j.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",j.number,(0,b.jsx)(n.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,b.jsx)(X.Badge,{variant:"outline",className:"text-xs",children:j.status})]}),!1===j.mergeable?(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Merge Status"}),(0,b.jsxs)(X.Badge,{className:"border-transparent bg-orange-50 text-orange-700 hover:bg-orange-50",children:[(0,b.jsx)(_.AlertTriangle,{className:"me-1 h-3.5 w-3.5"}),"Conflicts"]})]}):null,j.ciStatus&&!0!==q?(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,b.jsx)(aA,{status:j.ciStatus})]}):null,j.commitHash?(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)(aq.GitCommitHorizontal,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,b.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:j.commitHash.slice(0,7)})]})]}):null]})}):null,k?(0,b.jsx)("div",{className:"border-border rounded-lg border",children:(0,b.jsxs)("div",{className:"px-4 py-3",children:[(0,b.jsxs)("div",{className:"mb-3 flex items-center gap-2",children:[(0,b.jsx)(ap,{className:"text-muted-foreground h-4 w-4"}),(0,b.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Changes"})]}),(0,b.jsxs)("div",{className:"grid grid-cols-4 gap-3",children:[(0,b.jsxs)("div",{className:"text-center",children:[(0,b.jsx)("div",{className:"text-foreground text-sm font-bold",children:k.filesChanged}),(0,b.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"files"})]}),(0,b.jsxs)("div",{className:"text-center",children:[(0,b.jsxs)("div",{className:"text-sm font-bold text-green-600",children:["+",k.additions]}),(0,b.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"additions"})]}),(0,b.jsxs)("div",{className:"text-center",children:[(0,b.jsxs)("div",{className:"text-sm font-bold text-red-600",children:["-",k.deletions]}),(0,b.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"deletions"})]}),(0,b.jsxs)("div",{className:"text-center",children:[(0,b.jsx)("div",{className:"text-foreground text-sm font-bold",children:k.commitCount}),(0,b.jsx)("div",{className:"text-muted-foreground text-[10px]",children:"commits"})]})]})]})}):o?(0,b.jsx)("div",{className:"border-border rounded-lg border",children:(0,b.jsxs)("div",{className:"flex items-center gap-2 px-4 py-3",children:[(0,b.jsx)(_.AlertTriangle,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:o})]})}):null,p&&p.length>0?(0,b.jsx)(aO,{evidence:p}):null,l&&l.length>0?(0,b.jsx)(aI,{fileDiffs:l}):null]}),!c&&(0,b.jsx)(ae,{onReject:e,onApprove:s,approveLabel:r?"Resolve Conflicts":"Approve Merge",approveVariant:r?"warning":"default",revisionPlaceholder:"Ask AI to revise before merging...",isProcessing:f,isRejecting:g,chatInput:h,onChatInputChange:i})]})}let aQ=(0,Z.default)("file-search",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]]);var aR=a.i(18615);let aS=(0,Z.default)("shield-check",[["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:"m9 12 2 2 4-4",key:"dzmm74"}]]);var aT=a.i(2807),aU=a.i(3942),aV=a.i(45670),aW=a.i(26633),aX=a.i(73998);let aY=(0,Z.default)("image-off",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]),aZ=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function a$(a){let b=a.lastIndexOf(".");return b>=0&&aZ.has(a.slice(b).toLowerCase())}function a_(a){let b=a.lastIndexOf(".")>=0?a.slice(a.lastIndexOf(".")):"",c=a$(a)?`image/${b.slice(1).replace("jpg","jpeg")}`:"",d=new URLSearchParams({path:a,...c&&{mimeType:c}});return`/api/attachments/preview?${d.toString()}`}let a0=/(?:^|\s)@(\/[^\s]+)/g;function a1({text:a,attachmentPaths:c}){let d=function(a){let b=[],c=0;for(let d of a.matchAll(a0)){let e=d.index,f=e+(d[0].length-d[0].trimStart().length);f>c&&b.push({type:"text",value:a.slice(c,f)}),b.push({type:"attachment",path:d[1]}),c=e+d[0].length}return c<a.length&&b.push({type:"text",value:a.slice(c)}),b}(a),e=d.some(a=>"attachment"===a.type),f=c?.filter(Boolean)??[];return e||0!==f.length?(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[d.map(a=>{if("text"===a.type){let c=a.value.trim();return c?(0,b.jsx)("span",{className:"text-sm leading-relaxed",children:c},`text-${c.slice(0,40)}`):null}return(0,b.jsx)(a2,{path:a.path},`att-${a.path}`)}),f.map(a=>(0,b.jsx)(a2,{path:a},`extra-${a}`))]}):(0,b.jsx)("span",{className:"text-sm leading-relaxed",children:a})}function a2({path:a}){let d=a.split("/").pop()??a,[e,f]=(0,c.useState)(!1);return a$(a)?e?(0,b.jsxs)("div",{"data-testid":"inline-attachment-image-error",className:"text-muted-foreground flex items-center gap-2 rounded-md border px-3 py-2 text-sm",children:[(0,b.jsx)(aY,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"truncate",children:d})]}):(0,b.jsxs)(aV.Dialog,{children:[(0,b.jsx)(aV.DialogTrigger,{asChild:!0,children:(0,b.jsx)("img",{src:a_(a),alt:d,"data-testid":"inline-attachment-image",onError:()=>f(!0),className:"max-h-48 max-w-full cursor-pointer rounded-md border object-contain transition-opacity hover:opacity-80"})}),(0,b.jsxs)(aV.DialogContent,{className:"max-w-3xl gap-0 overflow-hidden border-0 p-0 [&>button:last-child]:!cursor-pointer [&>button:last-child]:!rounded-full [&>button:last-child]:!bg-black/70 [&>button:last-child]:!p-1.5 [&>button:last-child]:!text-white [&>button:last-child]:!opacity-100 [&>button:last-child]:!shadow-lg [&>button:last-child]:!backdrop-blur-md [&>button:last-child]:hover:!bg-black/90",children:[(0,b.jsx)(aW.VisuallyHidden.Root,{children:(0,b.jsxs)(aV.DialogTitle,{children:["Preview: ",d]})}),(0,b.jsx)("div",{className:"relative bg-black/90",children:(0,b.jsx)("img",{src:a_(a),alt:d,className:"h-auto max-h-[70vh] w-full object-contain"})}),(0,b.jsxs)("div",{className:"bg-background flex items-center gap-3 px-4 py-3",children:[(0,b.jsx)("div",{className:"flex min-w-0 flex-1 flex-col",children:(0,b.jsx)("span",{className:"truncate text-sm font-medium",children:d})}),(0,b.jsx)("a",{href:a_(a),download:d,className:"text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors","aria-label":`Download ${d}`,children:(0,b.jsx)(aX.DownloadIcon,{className:"h-4 w-4"})})]})]})]}):(0,b.jsx)("a",{href:a_(a),download:d,"data-testid":"inline-attachment-file",className:"text-primary text-sm underline underline-offset-2",children:d})}let a3=(0,a.i(42261).cva)("inline-block shrink-0",{variants:{size:{sm:"size-5",md:"size-8",lg:"size-12"}},defaultVariants:{size:"md"}}),a4=[{r:9,spline:"0.12 0 0.04 1",opacity:1},{r:8.2,spline:"0.16 0 0.08 1",opacity:.95},{r:7.4,spline:"0.20 0 0.12 1",opacity:.9},{r:6.6,spline:"0.25 0 0.16 1",opacity:.84},{r:5.8,spline:"0.30 0 0.20 1",opacity:.76},{r:5,spline:"0.36 0 0.25 1",opacity:.67},{r:4.2,spline:"0.42 0 0.31 1",opacity:.56},{r:3.4,spline:"0.48 0 0.37 1",opacity:.44},{r:2.6,spline:"0.55 0 0.44 1",opacity:.32},{r:1.8,spline:"0.62 0 0.52 1",opacity:.2},{r:1,spline:"0.70 0 0.60 1",opacity:.1}];function a5({className:a,size:c="md",duration:d=5,...e}){return(0,b.jsxs)("svg",{"data-slot":"comet-spinner",role:"status","aria-label":"Loading",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100",className:(0,W.cn)(a3({size:c}),a),...e,children:[(0,b.jsx)("defs",{children:(0,b.jsxs)("filter",{id:"comet-gooey",x:"-100%",y:"-100%",width:"300%",height:"300%",colorInterpolationFilters:"sRGB",children:[(0,b.jsx)("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"2.5"}),(0,b.jsx)("feColorMatrix",{mode:"matrix",values:"1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 50 -30",result:"goo"})]})}),(0,b.jsxs)("g",{filter:"url(#comet-gooey)",children:[(0,b.jsx)("animateTransform",{attributeName:"transform",type:"rotate",from:"0 50 50",to:"360 50 50",dur:`${d}s`,repeatCount:"indefinite"}),a4.map(a=>(0,b.jsxs)("g",{children:[(0,b.jsx)("animateTransform",{attributeName:"transform",type:"rotate",calcMode:"spline",values:"0 50 50;360 50 50",keyTimes:"0;1",keySplines:a.spline,dur:"1s",repeatCount:"indefinite"}),(0,b.jsx)("circle",{cx:"50",cy:"18",r:a.r,fill:"currentColor",opacity:a.opacity})]},a.r)),(0,b.jsxs)("circle",{cx:"50",cy:"50",r:"4",fill:"currentColor",opacity:"0.15",children:[(0,b.jsx)("animate",{attributeName:"r",values:"3;5;3",dur:"2s",repeatCount:"indefinite"}),(0,b.jsx)("animate",{attributeName:"opacity",values:"0.1;0.25;0.1",dur:"2s",repeatCount:"indefinite"})]})]})]})}a.i(54250);var a6=a.i(27039),a7=a.i(17606),a8=a.i(83852);function a9(a){if(0===a)return"0s";let b=Math.floor(a/1e3);if(0===b)return"<1s";let c=Math.floor(b/3600),d=Math.floor(b%3600/60),e=b%60;return c>0?`${c}h ${d}m`:d>0?`${d}m ${e}s`:`${e}s`}let ba=(0,Z.default)("git-merge",[["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["circle",{cx:"6",cy:"6",r:"3",key:"1lh9wr"}],["path",{d:"M6 21V9a9 9 0 0 0 9 9",key:"7kw0sc"}]]);var bb=a.i(28002);function bc({syncStatus:a,syncLoading:c,syncError:e,onRefreshSync:f,onRebaseOnMain:g,rebaseLoading:h,rebaseError:i}){let{t:j}=(0,d.useTranslation)("web"),k=null!=a&&a.behind>0,l=a?.behind===0,m=a?.baseBranch??"main";return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(R.Separator,{}),(0,b.jsxs)("div",{"data-testid":"branch-sync-status",className:"flex flex-col gap-3 p-4",children:[(0,b.jsx)("div",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"BRANCH SYNC"}),(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("div",{className:"flex items-center gap-2",children:c&&!a?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(a5,{size:"sm",className:"shrink-0"}),(0,b.jsx)("span",{className:"text-muted-foreground text-sm",children:"Checking..."})]}):e?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(_.AlertTriangle,{className:"h-4 w-4 shrink-0 text-red-500"}),(0,b.jsx)("span",{className:"text-sm text-red-600",children:e})]}):h?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(a5,{size:"sm",className:"shrink-0"}),(0,b.jsxs)("span",{className:"text-sm",children:["Rebasing on"," ",(0,b.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:m}),"..."]})]}):k?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(_.AlertTriangle,{className:"h-4 w-4 shrink-0 text-orange-500"}),(0,b.jsxs)("span",{className:"text-sm",children:[a.behind," commit",1===a.behind?"":"s"," behind"," ",(0,b.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:m}),a.ahead>0?(0,b.jsxs)("span",{className:"text-muted-foreground ms-1",children:["· ",a.ahead," ahead"]}):null]})]}):l?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(ax.CheckCircle2,{className:"h-4 w-4 shrink-0 text-green-500"}),(0,b.jsxs)("span",{className:"text-sm",children:["Up to date with"," ",(0,b.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:m}),a.ahead>0?(0,b.jsxs)("span",{className:"text-muted-foreground ms-1",children:["· ",a.ahead," ahead"]}):null]})]}):null}),(a||e)&&!h?(0,b.jsx)("button",{"data-testid":"sync-refresh-button",onClick:f,disabled:c,className:"text-muted-foreground hover:text-foreground inline-flex items-center rounded p-1 transition-colors disabled:opacity-50","aria-label":j("branchSyncStatus.refreshSyncStatus"),children:(0,b.jsx)(bb.RefreshCw,{className:`h-3.5 w-3.5 ${c?"animate-spin":""}`})}):null]}),k&&!h?(0,b.jsx)(I.ActionButton,{label:j("branchSyncStatus.rebaseOnMain"),onClick:g,loading:!1,error:!!i,icon:ba,variant:"outline",size:"sm"}):null,i?(0,b.jsx)("p",{className:"text-destructive text-xs",children:i}):null]})]})}function bd({data:a,syncStatus:c,syncLoading:d,syncError:e,onRefreshSync:f,onRebaseOnMain:g,rebaseLoading:h,rebaseError:i}){let k="maintain"===a.lifecycle;return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{"data-testid":"feature-drawer-status",className:"flex flex-col gap-3 p-4",children:[(0,b.jsx)("div",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:a6.lifecycleDisplayLabels[a.lifecycle]}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(be,{data:a}),"error"===a.state&&a.onRetry?(0,b.jsxs)("button",{"data-testid":"feature-drawer-retry-button",onClick:()=>a.onRetry(a.featureId),className:"flex shrink-0 cursor-pointer items-center gap-1.5 rounded-full bg-red-50 px-3 py-1.5 text-sm font-medium text-red-700 transition-colors hover:bg-red-100",children:[(0,b.jsx)(aR.RotateCcw,{className:"h-3.5 w-3.5"}),"Retry"]}):null,("running"===a.state||"action-required"===a.state)&&a.onStop?(0,b.jsxs)("button",{"data-testid":"feature-drawer-stop-button",onClick:()=>a.onStop(a.featureId),className:"flex shrink-0 cursor-pointer items-center gap-1.5 rounded-full bg-red-50 px-3 py-1.5 text-sm font-medium text-red-700 transition-colors hover:bg-red-100",children:[(0,b.jsx)(j.Square,{className:"h-3.5 w-3.5"}),"Stop"]}):null]}),!k&&a.progress>0?(0,b.jsxs)("div",{"data-testid":"feature-drawer-progress",className:"flex flex-col gap-1",children:[(0,b.jsxs)("div",{className:"text-muted-foreground flex items-center justify-between text-xs",children:[(0,b.jsx)("span",{children:"Progress"}),(0,b.jsxs)("span",{children:[a.progress,"%"]})]}),(0,b.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,b.jsx)("div",{className:(0,W.cn)("h-full rounded-full transition-all",a6.featureNodeStateConfig[a.state].progressClass),style:{width:`${a.progress}%`}})})]}):null,k&&a.pr?(0,b.jsx)(bh,{pr:a.pr,hideCiStatus:a.hideCiStatus}):null]}),(0,b.jsx)(bf,{data:a}),!k&&a.pr?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(R.Separator,{}),(0,b.jsx)("div",{className:"p-4",children:(0,b.jsx)(bh,{pr:a.pr,hideCiStatus:a.hideCiStatus})})]}):null,(0,b.jsx)(bi,{data:a}),g&&a.branch&&f?(0,b.jsx)(bc,{syncStatus:c??null,syncLoading:d??!1,syncError:e??null,onRefreshSync:f,onRebaseOnMain:g,rebaseLoading:h??!1,rebaseError:i??null}):null,(0,b.jsx)(bl,{data:a})]})}function be({data:a}){let c=a6.featureNodeStateConfig[a.state],d=c.icon;return(0,b.jsxs)("div",{className:(0,W.cn)("flex items-center gap-2 rounded-full px-3 py-1.5 text-sm font-medium",c.badgeBgClass,c.badgeClass),children:["running"===a.state?(0,b.jsx)(a5,{size:"sm",className:"shrink-0"}):(0,b.jsx)(d,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{children:c.label})]})}function bf({data:a}){var c;let e,f,g,h,i,{t:j}=(0,d.useTranslation)("web"),k=!!a.summary&&!(a.userQuery&&a.summary?.trim()===a.userQuery.trim());return a.branch||a.oneLiner||k||a.userQuery||a.createdAt?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(R.Separator,{}),(0,b.jsxs)("div",{"data-testid":"feature-drawer-info",className:"flex flex-col gap-3 p-4",children:[a.branch?(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Branch"}),(0,b.jsxs)("span",{className:"flex items-center gap-1.5 text-sm",children:[(0,b.jsx)(ar.GitBranch,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,b.jsx)("code",{className:"bg-muted rounded px-1 py-0.5 font-mono text-xs",children:a.branch}),a.baseBranch?(0,b.jsxs)("span",{className:"text-muted-foreground text-xs",children:["from ",a.baseBranch]}):null]})]}):null,a.oneLiner?(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"One-Liner"}),(0,b.jsx)("span",{className:"text-sm leading-relaxed",children:a.oneLiner})]}):null,a.userQuery?(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"User Query"}),(0,b.jsx)(a1,{text:a.userQuery})]}):null,k?(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Summary"}),(0,b.jsx)("span",{className:"text-sm leading-relaxed",children:a.summary})]}):null,a.createdAt?(0,b.jsx)(bm,{label:j("overviewTab.created"),value:(c=a.createdAt,e=Date.now(),(i=Math.floor((h=Math.floor((g=Math.floor(Math.floor((e-(f="string"==typeof c?new Date(c).getTime():c))/1e3)/60))/60))/24))>30?new Date(f).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):i>0?`${i} day${1===i?"":"s"} ago`:h>0?`${h} hour${1===h?"":"s"} ago`:g>0?`${g} minute${1===g?"":"s"} ago`:"just now")}):null]})]}):null}let bg={[az.PrStatus.Open]:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",[az.PrStatus.Merged]:"border-transparent bg-purple-50 text-purple-700 hover:bg-purple-50",[az.PrStatus.Closed]:"border-transparent bg-red-50 text-red-700 hover:bg-red-50"};function bh({pr:a,hideCiStatus:c}){return(0,b.jsx)("div",{"data-testid":"feature-drawer-pr",children:(0,b.jsxs)("div",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary flex items-center gap-1.5 text-sm font-semibold underline underline-offset-2",children:["PR #",a.number,(0,b.jsx)(n.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,b.jsx)(X.Badge,{className:bg[a.status],children:a.status})]}),a.ciStatus&&!0!==c?(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"CI Status"}),(0,b.jsx)(aA,{status:a.ciStatus})]}):null,!1===a.mergeable?(0,b.jsxs)("div",{"data-testid":"pr-merge-conflict",className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Merge Status"}),(0,b.jsxs)(X.Badge,{className:"border-transparent bg-orange-50 text-orange-700 hover:bg-orange-50",children:[(0,b.jsx)(_.AlertTriangle,{className:"me-1 h-3.5 w-3.5"}),"Conflicts"]})]}):null,a.commitHash?(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Commit"}),(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)(aq.GitCommitHorizontal,{className:"text-muted-foreground h-3.5 w-3.5"}),(0,b.jsx)("code",{className:"bg-muted text-foreground rounded-md px-1.5 py-0.5 font-mono text-[11px]",children:a.commitHash.slice(0,7)})]})]}):null]})})}function bi({data:a}){let{t:e}=(0,d.useTranslation)("web"),f=function(a){let[b,d]=(0,c.useState)(null),e=(0,c.useRef)(null);return(0,c.useEffect)(()=>a?(d(a9(Math.max(0,Date.now()-a))),e.current=setInterval(()=>{d(a9(Math.max(0,Date.now()-a)))},1e3),()=>{e.current&&(clearInterval(e.current),e.current=null)}):void d(null),[a]),b}("running"===a.state||"action-required"===a.state?a.startedAt:void 0);return a.fastMode??a.agentType??a.runtime??f??a.blockedBy??a.errorMessage?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(R.Separator,{}),(0,b.jsxs)("div",{"data-testid":"feature-drawer-details",className:"flex flex-col gap-3 p-4",children:[a.fastMode?(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Mode"}),(0,b.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)(aU.Zap,{className:"h-4 w-4 shrink-0 text-amber-500"}),"Fast Mode"]})]}):null,a.agentType?(0,b.jsx)(bj,{agentType:a.agentType}):null,a.runtime?(0,b.jsx)(bm,{label:e("overviewTab.runtime"),value:a.runtime}):null,!a.runtime&&f?(0,b.jsx)(bm,{label:e("overviewTab.runningFor"),value:f}):null,a.blockedBy?(0,b.jsx)(bm,{label:e("overviewTab.blockedBy"),value:a.blockedBy}):null,a.errorMessage?(0,b.jsx)(bm,{label:e("overviewTab.error"),value:a.errorMessage}):null]})]}):null}function bj({agentType:a}){let c=(0,a7.getAgentTypeIcon)(a),d=a7.agentTypeLabels[a]??a;return(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Agent"}),(0,b.jsxs)("span",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)(c,{className:"h-4 w-4 shrink-0"}),d]})]})}function bk({enabled:a,label:c}){return(0,b.jsxs)("span",{className:(0,W.cn)("inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-xs font-medium",a?"bg-emerald-50 text-emerald-700":"bg-muted text-muted-foreground"),children:[a?(0,b.jsx)(l.Check,{className:"h-3 w-3"}):(0,b.jsx)(aT.X,{className:"h-3 w-3"}),c]})}function bl({data:a}){let{t:c}=(0,d.useTranslation)("web");return null!=a.approvalGates||null!=a.push||null!=a.openPr||null!=a.ciWatchEnabled||null!=a.enableEvidence||null!=a.forkAndPr||null!=a.commitSpecs||a.modelId?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(R.Separator,{}),(0,b.jsxs)("div",{"data-testid":"feature-drawer-settings",className:"flex flex-col gap-3 p-4",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"SETTINGS"}),a.modelId?(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Model"}),(0,b.jsx)("span",{className:"text-sm",children:(0,a8.getModelMeta)(a.modelId).displayName||a.modelId})]}):null,a.approvalGates?(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",children:[(0,b.jsx)(aS,{className:"h-3 w-3"}),"Auto-Approve"]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,b.jsx)(bk,{enabled:a.approvalGates.allowPrd,label:c("overviewTab.prd")}),(0,b.jsx)(bk,{enabled:a.approvalGates.allowPlan,label:c("overviewTab.plan")}),(0,b.jsx)(bk,{enabled:a.approvalGates.allowMerge,label:c("overviewTab.merge")})]})]}):null,null!=a.enableEvidence?(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",children:[(0,b.jsx)(aQ,{className:"h-3 w-3"}),"Evidence"]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[(0,b.jsx)(bk,{enabled:a.enableEvidence,label:c("overviewTab.collect")}),null!=a.commitEvidence?(0,b.jsx)(bk,{enabled:a.commitEvidence,label:c("overviewTab.addToPr")}):null]})]}):null,null!=a.push||null!=a.openPr||null!=a.ciWatchEnabled||null!=a.commitSpecs||null!=a.forkAndPr?(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs font-medium",children:[(0,b.jsx)(ar.GitBranch,{className:"h-3 w-3"}),"Git"]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-1.5",children:[null!=a.push?(0,b.jsx)(bk,{enabled:a.push,label:c("overviewTab.push")}):null,null!=a.openPr?(0,b.jsx)(bk,{enabled:a.openPr,label:c("overviewTab.pr")}):null,null!=a.ciWatchEnabled?(0,b.jsx)(bk,{enabled:a.ciWatchEnabled,label:c("overviewTab.watch")}):null,null!=a.commitSpecs?(0,b.jsx)(bk,{enabled:a.commitSpecs,label:c("overviewTab.commitSpecs")}):null,null!=a.forkAndPr?(0,b.jsx)(bk,{enabled:a.forkAndPr,label:c("overviewTab.forkAndPr")}):null]})]}):null]})]}):null}function bm({label:a,value:c}){return(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:a}),(0,b.jsx)("span",{className:"text-sm",children:c})]})}var bn=a.i(46168);let bo=(0,Z.default)("dollar-sign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);var ay=ay,bp=a.i(93866),bq=a.i(12882),br=a.i(7421);let bs=(0,Z.default)("arrow-down-to-line",[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]]),bt=(0,Z.default)("arrow-up-from-line",[["path",{d:"m18 9-6-6-6 6",key:"kcunyi"}],["path",{d:"M12 3v14",key:"7cf3v8"}],["path",{d:"M5 21h14",key:"11awu3"}]]);function bu(a,b){if(null!=a.durationMs&&a.durationMs>0)return a.durationMs;if(!a.completedAt&&a.startedAt){let c=new Date(a.startedAt).getTime();if(!Number.isNaN(c))return Math.max(0,b-c)}return 0}function bv(a){return a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}K`:String(a)}function bw(a){let b=a instanceof Date?a:new Date(String(a));return Number.isNaN(b.getTime())?"":b.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function bx(a){return a>=1?`$${a.toFixed(2)}`:a>=.01?`$${a.toFixed(3)}`:`$${a.toFixed(4)}`}let by={analyze:"Analyzing",requirements:"Requirements",research:"Researching",plan:"Planning",implement:"Implementing",rebase:"Rebasing","fast-implement":"Fast Implement",evidence:"Evidence",validate:"Validating",repair:"Repairing",merge:"Merging"},bz={"run:started":{label:"started",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:i.Play},"run:resumed":{label:"resumed",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:aR.RotateCcw},"run:completed":{label:"completed",colorClass:"text-emerald-600",bgClass:"bg-emerald-50 dark:bg-emerald-950/30",icon:ax.CheckCircle2},"run:failed":{label:"failed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:ay.default},"run:stopped":{label:"stopped",colorClass:"text-amber-600",bgClass:"bg-amber-50 dark:bg-amber-950/30",icon:j.Square},"run:crashed":{label:"crashed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:ay.default},"run:rejected":{label:"rejected",colorClass:"text-orange-600",bgClass:"bg-orange-50 dark:bg-orange-950/30",icon:bp.Ban}};function bA(a){return a.startsWith("run:")}function bB({timings:a,loading:e,error:f,rejectionFeedback:h}){let{t:i}=(0,d.useTranslation)("web"),j=function(a){let[b,d]=(0,c.useState)(Date.now),e=(0,c.useRef)(null);return(0,c.useEffect)(()=>(a&&a.some(a=>!a.phase.startsWith("run:")&&!a.completedAt&&a.startedAt)&&(e.current=setInterval(()=>d(Date.now()),1e3)),()=>{e.current&&(clearInterval(e.current),e.current=null)}),[a]),b}(a);if(e)return(0,b.jsx)("div",{"data-testid":"activity-tab-loading",className:"flex items-center justify-center p-8",children:(0,b.jsx)(g.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})});if(f)return(0,b.jsxs)("div",{className:"flex items-center gap-2 p-4 text-base text-red-600",children:[(0,b.jsx)(P.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{children:f})]});if(!a||0===a.length)return(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,b.jsx)(bn.Clock,{className:"text-muted-foreground h-8 w-8"}),(0,b.jsx)("p",{className:"text-muted-foreground text-base",children:i("activityTab.noActivityRecorded")})]});let k=a.filter(a=>!bA(a.phase)),l=Math.max(...k.map(a=>bu(a,j)),...k.map(a=>a.approvalWaitMs??0),0),m=function(a,b){if(!a.length)return[];let c=a.filter(a=>"run:rejected"===a.phase).length,d=b?.length??0,e=a;if(d>c){e=[...a];let f=a[a.length-1].agentRunId;for(let a=c;a<d;a++){let d=b[a];a>c&&e.push({agentRunId:f,phase:"run:resumed",startedAt:d.timestamp??`synthetic-resumed-${a}`}),e.push({agentRunId:f,phase:"run:rejected",startedAt:d.timestamp??`synthetic-${a}`})}}let f=[],g=[],h=0;for(let a of e)if(g.push(a),"run:rejected"===a.phase){let a=b?.[h];f.push({number:f.length+1,timings:g,rejectionMessage:a?.message,rejectionAttachments:a?.attachments}),g=[],h++}return g.length>0&&f.push({number:f.length+1,timings:g}),f}(a,h),n=m.length>1,o=k.reduce((a,b)=>a+bu(b,j),0),p=k.reduce((a,b)=>a+(b.approvalWaitMs??0),0),q=k.reduce((a,b)=>a+(b.inputTokens??0),0),r=k.reduce((a,b)=>a+(b.outputTokens??0),0),s=k.reduce((a,b)=>a+(b.costUsd??0),0);return(0,b.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,b.jsx)("div",{"data-testid":"activity-timings",className:"flex flex-col gap-3",children:m.map(a=>(0,b.jsx)(bC,{iteration:a,showHeader:n,maxDurationMs:l,now:j},a.number))}),o>0?(0,b.jsx)(bG,{totalExecMs:o,totalWaitMs:p,totalInputTokens:q,totalOutputTokens:r,totalCostUsd:s}):null]})}function bC({iteration:a,showHeader:c,maxDurationMs:d,now:e}){let f=function(a){let b=[...a.timings].reverse().find(a=>bA(a.phase));if(!b)return null;switch(b.phase){case"run:rejected":return{label:"Rejected",colorClass:"text-orange-600",dotClass:"bg-orange-500"};case"run:completed":return{label:"Completed",colorClass:"text-emerald-600",dotClass:"bg-emerald-500"};case"run:failed":return{label:"Failed",colorClass:"text-red-600",dotClass:"bg-red-500"};case"run:crashed":return{label:"Crashed",colorClass:"text-red-600",dotClass:"bg-red-500"};case"run:stopped":return{label:"Stopped",colorClass:"text-amber-600",dotClass:"bg-amber-500"};default:return null}}(a);return(0,b.jsxs)("div",{"data-testid":`iteration-${a.number}`,className:"border-border/50 bg-card/50 flex flex-col overflow-hidden rounded-lg border",children:[c?(0,b.jsxs)("div",{className:"bg-muted/30 border-border/50 flex items-center justify-between border-b px-3 py-1.5",children:[(0,b.jsxs)("span",{className:"text-muted-foreground text-sm font-semibold tracking-wide",children:["Iteration ",a.number]}),f?(0,b.jsxs)("span",{className:`flex items-center gap-1 text-xs font-medium ${f.colorClass}`,children:[(0,b.jsx)("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${f.dotClass}`}),f.label]}):null]}):null,(0,b.jsxs)("div",{className:"relative flex flex-col",children:[(0,b.jsx)("div",{className:"bg-border/60 absolute top-4 bottom-4 left-[21.5px] w-px"}),a.timings.map((c,f)=>{if(bA(c.phase)){let d,e="run:rejected"===c.phase,g="run:failed"===c.phase||"run:crashed"===c.phase||"run:stopped"===c.phase;if(e)d=a.rejectionMessage;else if(g){let b=[...a.timings].reverse().find(a=>!bA(a.phase)&&a.errorMessage);d=b?.errorMessage??c.errorMessage}return(0,b.jsx)(bD,{timing:c,message:d,attachments:e?a.rejectionAttachments:void 0,isFirst:0===f,isLast:f===a.timings.length-1},`${c.agentRunId}-${c.phase}-${c.startedAt}`)}return(0,b.jsx)(bE,{timing:c,maxDurationMs:d,now:e},`${c.agentRunId}-${c.phase}-${c.startedAt}`)})]})]})}function bD({timing:a,message:c,attachments:d,isFirst:e,isLast:f}){let g,h=bz[a.phase];if(!h)return null;let i=d&&d.length>0,j=h.icon;return(0,b.jsxs)("div",{className:`relative flex flex-col gap-1 px-3 ${e?"pt-2":"pt-1"} ${f?"pb-2":"pb-1"}`,children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:`relative z-10 flex h-5 w-5 shrink-0 items-center justify-center rounded-full ${h.bgClass}`,children:(0,b.jsx)(j,{className:`h-3 w-3 ${h.colorClass}`})}),(0,b.jsx)("span",{className:`text-sm font-medium ${h.colorClass}`,children:h.label}),a.startedAt&&!("string"==typeof a.startedAt&&a.startedAt.startsWith("synthetic"))?(0,b.jsx)("span",{className:"text-muted-foreground/60 ml-auto text-xs tabular-nums",children:bw(String(a.startedAt))}):null]}),c?(g="run:failed"===a.phase||"run:crashed"===a.phase||"run:stopped"===a.phase,(0,b.jsxs)("div",{className:`ml-[26px] flex items-start gap-1.5 rounded-md px-2 py-1.5 ${g?"bg-red-50/50 dark:bg-red-950/20":"bg-orange-50/50 dark:bg-orange-950/20"}`,children:[g?(0,b.jsx)(P.AlertCircle,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-red-400"}):(0,b.jsx)(bq.MessageSquare,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-orange-400"}),(0,b.jsxs)("span",{"data-testid":g?"error-message-text":"rejection-feedback-text",className:"text-muted-foreground text-xs leading-relaxed italic",children:["— ",c]})]})):null,i?(0,b.jsx)("div",{"data-testid":"rejection-feedback-attachments",className:"ml-[26px]",children:(0,b.jsx)(a1,{text:"",attachmentPaths:d})}):null]})}function bE({timing:a,maxDurationMs:e,now:f}){let{t:g}=(0,d.useTranslation)("web"),h=a.phase.includes(":")?a.phase.split(":")[0]:a.phase,i=a.phase.includes(":")?a.phase.split(":")[1]:null,j=null!==i,m=i?.startsWith("phase-")??!1,n=by[h]??h,o=m?`Phase ${i.replace("phase-","")}`:null!==i?`${n} #${i}`:n,p=bu(a,f),q=!a.completedAt&&!!a.startedAt,r=q?15:2,s=e>0?Math.max(r,p/e*100):r,t=a.completedAt?m?"bg-emerald-400":j?"bg-amber-500":"bg-emerald-500":"bg-blue-500",u=null!=a.inputTokens||null!=a.outputTokens?(a.inputTokens??0)+(a.outputTokens??0):null,[v,w]=(0,c.useState)(!1),x=(0,c.useCallback)(()=>{a.prompt&&navigator.clipboard.writeText(a.prompt).then(()=>{w(!0),setTimeout(()=>w(!1),1500)})},[a.prompt]);return(0,b.jsxs)("div",{className:`group/phase relative flex flex-col gap-0.5 px-3 py-1.5 ${j?"ms-4":""}`,children:[(0,b.jsxs)("div",{"data-testid":`timing-bar-${a.phase}`,className:"flex items-center gap-2",children:[(0,b.jsx)("div",{className:"relative z-10 flex h-5 w-5 shrink-0 items-center justify-center",children:(0,b.jsx)("div",{className:`rounded-full ${q?"h-3 w-3 animate-pulse":"h-2.5 w-2.5"} ${q?"bg-blue-500":a.completedAt?"bg-emerald-500":"bg-muted-foreground/30"}`})}),(0,b.jsx)("span",{className:`w-28 shrink-0 truncate text-sm font-medium ${j?"text-muted-foreground":"text-foreground/80"}`,children:o}),a.prompt?(0,b.jsx)("button",{type:"button",onClick:x,className:"text-muted-foreground/50 hover:text-foreground/70 -ms-1 shrink-0 opacity-0 transition-opacity group-hover/phase:opacity-100",title:g("activityTab.copyPromptToClipboard"),children:v?(0,b.jsx)(l.Check,{className:"h-3.5 w-3.5 text-emerald-500"}):(0,b.jsx)(k.Copy,{className:"h-3.5 w-3.5"})}):null,(0,b.jsx)("div",{className:`bg-muted relative min-w-0 flex-1 overflow-hidden rounded-full ${j?"h-1.5":"h-2"}`,children:q?(0,b.jsx)("div",{className:"absolute inset-0 rounded-full bg-blue-500/30",style:{backgroundImage:"linear-gradient(90deg, transparent 0%, rgb(59 130 246) 50%, transparent 100%)",backgroundSize:"200% 100%",animation:"shimmer 1.5s ease-in-out infinite"}}):(0,b.jsx)("div",{className:`h-full rounded-full transition-all duration-300 ${t}`,style:{width:`${Math.min(s,100)}%`}})}),(0,b.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-end text-sm font-medium tabular-nums",children:a9(p)})]}),(0,b.jsxs)("div",{className:"ml-[28px] flex items-center gap-3 text-xs",children:[a.startedAt?(0,b.jsx)("span",{className:"text-muted-foreground/60 tabular-nums",children:bw(a.startedAt)}):null,null!=u&&u>0?(0,b.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5",children:[(0,b.jsx)(aU.Zap,{className:"h-3 w-3 opacity-50"}),bv(u)]}):null,null!=a.costUsd&&a.costUsd>0?(0,b.jsxs)("span",{className:"text-muted-foreground/70 inline-flex items-center gap-0.5",children:[(0,b.jsx)(bo,{className:"h-3 w-3 opacity-50"}),bx(a.costUsd)]}):null]}),null!=a.approvalWaitMs&&a.approvalWaitMs>0?(0,b.jsx)(bF,{timing:a,maxDurationMs:e}):null]})}function bF({timing:a,maxDurationMs:c}){let d=a.approvalWaitMs??0,e=c>0?Math.max(2,d/c*100):2;return(0,b.jsxs)("div",{"data-testid":`approval-wait-${a.phase}`,className:"ml-[26px] flex items-center gap-2 rounded-md bg-amber-50/50 px-1.5 py-1 dark:bg-amber-950/20",children:[(0,b.jsx)(br.Timer,{className:"h-3.5 w-3.5 shrink-0 text-amber-500"}),(0,b.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 text-xs",children:"approval"}),(0,b.jsx)("div",{className:"bg-muted h-1.5 min-w-0 flex-1 overflow-hidden rounded-full",children:(0,b.jsx)("div",{className:"h-full rounded-full bg-amber-500",style:{width:`${Math.min(e,100)}%`}})}),(0,b.jsx)("span",{className:"text-muted-foreground w-14 shrink-0 text-end text-xs tabular-nums",children:a9(d)})]})}function bG({totalExecMs:a,totalWaitMs:c,totalInputTokens:e,totalOutputTokens:f,totalCostUsd:g}){let{t:h}=(0,d.useTranslation)("web"),i=e+f;return(0,b.jsxs)("div",{"data-testid":"activity-summary",className:"border-border bg-card/30 flex flex-col gap-2 rounded-lg border p-3",children:[(0,b.jsx)("div",{className:"text-muted-foreground mb-1 text-xs font-semibold tracking-wider uppercase",children:"Summary"}),(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-3",children:[(0,b.jsx)(bH,{icon:bn.Clock,label:h("activityTab.execution"),value:a9(a)}),(0,b.jsx)(bH,{icon:br.Timer,label:h("activityTab.wait"),value:c>0?a9(c):"n/a"}),(0,b.jsx)(bH,{icon:bn.Clock,label:"Wall-clock",value:c>0?a9(a+c):a9(a)}),(0,b.jsx)(bH,{icon:bo,label:h("activityTab.cost"),value:g>0?bx(g):"n/a"}),(0,b.jsxs)("div",{className:"col-span-2 flex flex-col gap-0.5",children:[(0,b.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[(0,b.jsx)(aU.Zap,{className:"h-3 w-3 opacity-40"}),"Tokens"]}),i>0?(0,b.jsxs)("span",{className:"flex items-center gap-2.5 text-sm tabular-nums",children:[(0,b.jsx)("span",{children:bv(i)}),(0,b.jsxs)("span",{className:"text-muted-foreground flex items-center gap-3 text-xs",title:"Input tokens / Output tokens",children:[(0,b.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,b.jsx)(bs,{className:"h-3 w-3 text-blue-500 opacity-60"}),bv(e)]}),(0,b.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,b.jsx)(bt,{className:"h-3 w-3 text-emerald-500 opacity-60"}),bv(f)]})]})]}):(0,b.jsx)("span",{className:"text-muted-foreground/40 text-sm italic tabular-nums",children:"n/a"})]})]})]})}function bH({icon:a,label:c,value:d,className:e=""}){let f="n/a"===d;return(0,b.jsxs)("div",{className:`flex flex-col gap-0.5 ${e}`,children:[(0,b.jsxs)("span",{className:"text-muted-foreground flex items-center gap-1 text-xs",children:[(0,b.jsx)(a,{className:"h-3 w-3 opacity-40"}),c]}),(0,b.jsx)("span",{className:`text-sm tabular-nums ${f?"text-muted-foreground/40 italic":""}`,children:d})]})}var bI=a.i(45449),bJ=a.i(44447);let bK=(0,Z.default)("coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]),bL=(0,Z.default)("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]),bM=(0,Z.default)("file-code",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}]]),bN=/^\[(\d{4}-\d{2}-\d{2}T[\d:.]+Z?)\]\s+(?:\[([^\]]+)\]\s+)?(?:\[([^\]|]+)(?:\|([^\]]+))?\]\s+)?(.*)$/,bO=/^\[(tool-result|tool|text|delta|result|tokens|cmd|file|turn|thread|error|event|raw|WORKER)\]\s*(.*)/;function bP(a){let b=a.match(bN);if(!b)return{timestamp:null,phase:null,agent:null,model:null,tag:"raw",message:a,raw:a};let[,c,d,e,f,g]=b,h=null,i=null,j=null,k=g??"";if(null!=e&&null!=d)if(d.includes("|")){let[a,b]=d.split("|");i=a,j=b??null,k=`[${e}] ${g??""}`}else h=d,i=e,j=f??null;else if(null!=d)if(d.includes("|")){let[a,b]=d.split("|");i=a,j=b??null}else h=d;let l=k.match(bO),m="info";return l&&(m=l[1].toLowerCase(),k=l[2]),{timestamp:c??null,phase:h,agent:i,model:j,tag:m,message:k.trim(),raw:a}}function bQ({content:a}){let d=(0,c.useMemo)(()=>a?a.split("\n").filter(a=>a.trim().length>0).map(bP):[],[a]);return 0===d.length?null:(0,b.jsx)("div",{className:"flex flex-col",children:d.map((a,c)=>(0,b.jsx)(bR,{line:a},c))})}function bR({line:a}){switch(a.tag){case"tool":return(0,b.jsx)(bU,{line:a});case"tool-result":return(0,b.jsx)(b$,{line:a});case"text":case"delta":return(0,b.jsx)(bW,{line:a});case"result":return(0,b.jsx)(bX,{line:a});case"tokens":case"turn":return(0,b.jsx)(bY,{line:a});case"cmd":return(0,b.jsx)(b_,{line:a});case"file":return(0,b.jsx)(b0,{line:a});case"thread":case"event":case"info":return(0,b.jsx)(b2,{line:a});case"error":return(0,b.jsx)(b1,{line:a});case"worker":return(0,b.jsx)(bZ,{line:a});default:return(0,b.jsx)(b3,{line:a})}}function bS({value:a}){if(!a)return null;let c=a.replace(/^.*T/,"").replace("Z",""),d=c.split(":"),e=d.length>=3?`${d[1]}:${d[2].split(".")[0]}`:c;return(0,b.jsx)("span",{className:"text-muted-foreground/60 w-11 shrink-0 font-mono text-[10px]",children:e})}function bT({phase:a}){return a?(0,b.jsx)("span",{className:"bg-muted text-muted-foreground w-20 shrink-0 truncate rounded px-1.5 py-0.5 font-mono text-[10px] font-medium",title:a,children:a}):(0,b.jsx)("span",{className:"w-20 shrink-0"})}function bU({line:a}){var c;let d,{toolName:e,args:f}=-1===(d=(c=a.message).indexOf(" "))?{toolName:c,args:""}:{toolName:c.slice(0,d),args:c.slice(d+1)},g=function(a,b){try{let c=JSON.parse(b);if("Read"===a&&c.file_path||"Write"===a&&c.file_path||"Edit"===a&&c.file_path)return c.file_path;if("Glob"===a&&c.pattern||"Grep"===a&&c.pattern)return c.pattern;if("Bash"===a&&c.command)return c.command;if("Task"===a&&c.description)return c.description}catch{if(b.length>0)return b}return null}(e,f);return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 border-b border-transparent px-3 py-1.5 transition-colors",children:[(0,b.jsx)(bS,{value:a.timestamp}),(0,b.jsx)(bT,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(bV,{toolName:e}),(0,b.jsx)("span",{className:"text-xs font-semibold text-violet-600 dark:text-violet-400",children:e}),g?(0,b.jsx)("span",{className:"text-muted-foreground min-w-0 font-mono text-xs break-all",children:g}):null]})]})}function bV({toolName:a}){let c=a.toLowerCase();return"bash"===c?(0,b.jsx)(J.Terminal,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"read"===c||"glob"===c||"grep"===c?(0,b.jsx)(au.FileText,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"write"===c||"edit"===c?(0,b.jsx)(bM,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):(0,b.jsx)(J.Terminal,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"})}function bW({line:a}){return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,b.jsx)(bS,{value:a.timestamp}),(0,b.jsx)(bT,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(bq.MessageSquare,{className:"mt-0.5 h-3 w-3 shrink-0 text-blue-500"}),(0,b.jsx)("span",{className:"text-foreground/80 min-w-0 text-xs leading-relaxed",children:a.message})]})]})}function bX({line:a}){var c;let d,e,{chars:f}=(d=(c=a.message).match(/^(\d+)\s+chars/),e=c.match(/session=(\S+)/),{chars:d?parseInt(d[1],10):0,sessionId:e?e[1]:null});return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,b.jsx)(bS,{value:a.timestamp}),(0,b.jsx)(bT,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(ax.CheckCircle2,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-500"}),(0,b.jsxs)("span",{className:"text-xs font-medium text-emerald-600 dark:text-emerald-400",children:["Result: ",f.toLocaleString()," chars"]})]})]})}function bY({line:a}){let c,{inputTokens:d,outputTokens:e}=(c=a.message.match(/^(\d+)\s+in\s*\/\s*(\d+)\s+out/))?{inputTokens:parseInt(c[1],10),outputTokens:parseInt(c[2],10)}:{inputTokens:0,outputTokens:0};return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,b.jsx)(bS,{value:a.timestamp}),(0,b.jsx)(bT,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(bK,{className:"mt-0.5 h-3 w-3 shrink-0 text-amber-500"}),(0,b.jsxs)("span",{className:"text-muted-foreground text-xs",children:[(0,b.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:d.toLocaleString()})," in / ",(0,b.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:e.toLocaleString()})," out"]})]})]})}function bZ({line:a}){return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 bg-zinc-50 px-3 py-1.5 transition-colors dark:bg-zinc-900/50",children:[(0,b.jsx)(bS,{value:a.timestamp}),(0,b.jsx)(bT,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(bL,{className:"mt-0.5 h-3 w-3 shrink-0 text-zinc-500"}),(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium break-all",children:a.message})]})]})}function b$({line:a}){return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1 transition-colors",children:[(0,b.jsx)(bS,{value:a.timestamp}),(0,b.jsx)(bT,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(as,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-400"}),(0,b.jsx)("span",{className:"text-muted-foreground min-w-0 font-mono text-[11px] break-all",children:a.message})]})]})}function b_({line:a}){return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,b.jsx)(bS,{value:a.timestamp}),(0,b.jsx)(bT,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(i.Play,{className:"mt-0.5 h-3 w-3 shrink-0 text-cyan-500"}),(0,b.jsx)("span",{className:"min-w-0 font-mono text-xs break-all text-cyan-700 dark:text-cyan-400",children:a.message})]})]})}function b0({line:a}){return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,b.jsx)(bS,{value:a.timestamp}),(0,b.jsx)(bT,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(bM,{className:"mt-0.5 h-3 w-3 shrink-0 text-orange-500"}),(0,b.jsx)("span",{className:"min-w-0 text-xs break-all text-orange-700 dark:text-orange-400",children:a.message})]})]})}function b1({line:a}){return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 bg-red-50 px-3 py-1.5 transition-colors dark:bg-red-950/30",children:[(0,b.jsx)(bS,{value:a.timestamp}),(0,b.jsx)(bT,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(P.AlertCircle,{className:"mt-0.5 h-3 w-3 shrink-0 text-red-500"}),(0,b.jsx)("span",{className:"min-w-0 text-xs font-medium break-all text-red-700 dark:text-red-400",children:a.message})]})]})}function b2({line:a}){return(0,b.jsxs)("div",{className:"hover:bg-muted/50 flex items-start gap-2 px-3 py-1.5 transition-colors",children:[(0,b.jsx)(bS,{value:a.timestamp}),(0,b.jsx)(bT,{phase:a.phase}),(0,b.jsx)("span",{className:"text-muted-foreground min-w-0 text-xs break-all",children:a.message})]})}function b3({line:a}){return(0,b.jsx)("div",{className:"px-3 py-0.5",children:(0,b.jsx)("span",{className:"text-muted-foreground/70 font-mono text-[11px] break-all whitespace-pre-wrap",children:a.raw})})}function b4({content:a,isConnected:e,error:f}){let{t:g}=(0,d.useTranslation)("web"),h=(0,c.useRef)(null),[i,j]=(0,c.useState)(!0),[k,l]=(0,c.useState)("structured"),m=(0,c.useCallback)(()=>{let a=h.current;a&&j(a.scrollHeight-a.scrollTop-a.clientHeight<40)},[]),n=(0,c.useCallback)(()=>{let a=h.current;a&&(a.scrollTop=a.scrollHeight,j(!0))},[]);return((0,c.useEffect)(()=>{i&&h.current&&(h.current.scrollTop=h.current.scrollHeight)},[a,i]),f)?(0,b.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,b.jsx)(P.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{children:f})]}):a?(0,b.jsxs)("div",{className:"flex h-full flex-col","data-testid":"log-tab",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2 border-b px-3 py-1.5",children:[(0,b.jsx)("span",{className:`h-2 w-2 rounded-full ${e?"bg-emerald-500":"bg-zinc-400"}`}),(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:e?"Live":"Disconnected"}),(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-1",children:[(0,b.jsx)("button",{type:"button",onClick:()=>l("structured"),className:`rounded p-1 transition-colors ${"structured"===k?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,title:g("logTab.structuredView"),children:(0,b.jsx)(au.FileText,{className:"h-3.5 w-3.5"})}),(0,b.jsx)("button",{type:"button",onClick:()=>l("raw"),className:`rounded p-1 transition-colors ${"raw"===k?"bg-muted text-foreground":"text-muted-foreground hover:text-foreground"}`,title:g("logTab.rawView"),children:(0,b.jsx)(bJ.Code,{className:"h-3.5 w-3.5"})}),i?null:(0,b.jsxs)("button",{type:"button",onClick:n,className:"text-muted-foreground hover:text-foreground ms-1 flex items-center gap-1 text-xs",children:[(0,b.jsx)(bI.ArrowDown,{className:"h-3 w-3"}),"Jump to bottom"]})]})]}),(0,b.jsx)("div",{ref:h,onScroll:m,className:`flex-1 overflow-y-auto ${"raw"===k?"bg-zinc-950 p-3 font-mono text-xs leading-relaxed break-all whitespace-pre-wrap text-zinc-300":"bg-background"}`,children:"structured"===k?(0,b.jsx)(bQ,{content:a}):a})]}):(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,b.jsx)(J.Terminal,{className:"text-muted-foreground h-8 w-8"}),(0,b.jsx)("p",{className:"text-muted-foreground text-sm",children:g("logTab.noLogOutput")}),e?(0,b.jsx)("p",{className:"text-muted-foreground text-xs",children:"Waiting for log data..."}):null]})}let b5=(0,Z.default)("list-todo",[["path",{d:"M13 5h8",key:"a7qcls"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 19h8",key:"c3s6r1"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["rect",{x:"3",y:"4",width:"6",height:"6",rx:"1",key:"cif1o7"}]]);var b6=a.i(4019),b7=a.i(83886);let b8=(0,Z.default)("circle-dashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]]),b9={Todo:{icon:b6.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Todo"},"Work in Progress":{icon:g.Loader2,colorClass:"text-blue-600",borderClass:"border-blue-200",spinning:!0,label:"In Progress"},Done:{icon:l.Check,colorClass:"text-emerald-600",borderClass:"border-emerald-200",label:"Done"},Review:{icon:b7.Eye,colorClass:"text-amber-600",borderClass:"border-amber-200",label:"Review"}},ca={icon:b6.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Unknown"};function cb({tasks:a}){let{t:c}=(0,d.useTranslation)("web");return 0===a.length?(0,b.jsx)("div",{className:"flex flex-col items-center justify-center gap-2 py-4",children:(0,b.jsx)("p",{className:"text-muted-foreground text-sm",children:c("taskProgress.noTasksDefined")})}):(0,b.jsxs)("div",{"data-testid":"task-progress-view",className:"flex flex-col gap-3",children:[(0,b.jsx)(cc,{tasks:a}),(0,b.jsx)("div",{"data-testid":"task-progress-list",className:"flex flex-col gap-2",children:a.map((a,c)=>(0,b.jsx)(ce,{task:a,index:c},a.title||`task-${c}`))})]})}function cc({tasks:a}){let{t:e}=(0,d.useTranslation)("web"),f=(0,c.useMemo)(()=>{let b=a.filter(a=>"Done"===a.state).length,c=a.filter(a=>"Work in Progress"===a.state).length,d=a.filter(a=>"Review"===a.state).length,e=a.filter(a=>"Done"!==a.state&&"Work in Progress"!==a.state&&"Review"!==a.state).length,f=a.length,g=f>0?Math.round(b/f*100):0;return{done:b,wip:c,review:d,todo:e,total:f,percent:g}},[a]);return(0,b.jsxs)("div",{"data-testid":"task-progress-summary",className:"flex flex-col gap-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Task Progress"}),(0,b.jsxs)("span",{className:"text-muted-foreground text-xs",children:[f.done," of ",f.total," done"]})]}),(0,b.jsx)("div",{className:"bg-muted h-2 w-full overflow-hidden rounded-full",children:(0,b.jsx)("div",{"data-testid":"task-progress-bar",className:"h-full rounded-full bg-emerald-500 transition-all",style:{width:`${f.percent}%`}})}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-3",children:[f.done>0?(0,b.jsx)(cd,{icon:l.Check,label:e("taskProgress.done"),count:f.done,className:"text-emerald-600"}):null,f.wip>0?(0,b.jsx)(cd,{icon:g.Loader2,label:e("taskProgress.inProgress"),count:f.wip,className:"text-blue-600"}):null,f.review>0?(0,b.jsx)(cd,{icon:b7.Eye,label:e("taskProgress.review"),count:f.review,className:"text-amber-600"}):null,f.todo>0?(0,b.jsx)(cd,{icon:b6.Circle,label:e("taskProgress.todo"),count:f.todo,className:"text-muted-foreground"}):null]})]})}function cd({icon:a,label:c,count:d,className:e}){return(0,b.jsxs)("span",{className:(0,W.cn)("flex items-center gap-1 text-xs",e),children:[(0,b.jsx)(a,{className:"h-3 w-3"}),d," ",c]})}function ce({task:a,index:d}){let[e,f]=(0,c.useState)(!1),g=b9[a.state]??ca,h=g.icon,i=a.actionItems.length>0,j=(0,c.useCallback)(()=>{i&&f(a=>!a)},[i]);return(0,b.jsxs)("div",{"data-testid":`task-card-${d}`,className:(0,W.cn)("rounded-lg border",g.borderClass),children:[(0,b.jsxs)("button",{type:"button",onClick:j,disabled:!i,className:(0,W.cn)("flex w-full items-start gap-2 px-3 py-2.5 text-start",i&&"hover:bg-muted/50 cursor-pointer transition-colors"),children:[(0,b.jsx)(h,{className:(0,W.cn)("mt-0.5 h-4 w-4 shrink-0",g.colorClass,g.spinning&&"animate-spin")}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-0.5",children:[(0,b.jsx)("span",{className:(0,W.cn)("text-sm font-medium",g.colorClass),children:a.title}),a.description?(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:a.description}):null]}),i?(0,b.jsx)(V.ChevronRight,{className:(0,W.cn)("text-muted-foreground mt-0.5 h-4 w-4 shrink-0 transition-transform",e&&"rotate-90")}):null]}),e&&i?(0,b.jsx)("div",{className:"border-t px-3 py-2.5",children:(0,b.jsx)("div",{className:"flex flex-col gap-2",children:a.actionItems.map((a,c)=>(0,b.jsx)(cf,{item:a},a.name||`ai-${c}`))})}):null]})}function cf({item:a}){let c=a.acceptanceCriteria.length,d=a.acceptanceCriteria.filter(a=>a.verified).length,e=c>0&&d===c;return(0,b.jsxs)("div",{"data-testid":"action-item",className:"flex flex-col gap-1.5",children:[(0,b.jsxs)("div",{className:"flex items-start gap-2",children:[e?(0,b.jsx)(ax.CheckCircle2,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-emerald-600"}):(0,b.jsx)(b8,{className:"text-muted-foreground mt-0.5 h-3.5 w-3.5 shrink-0"}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-xs font-medium",children:a.name}),a.description?(0,b.jsx)("span",{className:"text-muted-foreground text-[11px]",children:a.description}):null]}),c>0?(0,b.jsxs)("span",{className:"text-muted-foreground ml-auto shrink-0 text-[11px]",children:[d,"/",c]}):null]}),c>0?(0,b.jsx)("div",{className:"ms-5.5 flex flex-col gap-1",children:a.acceptanceCriteria.map((a,c)=>(0,b.jsx)(cg,{criterion:a},a.description||`ac-${c}`))}):null]})}function cg({criterion:a}){return(0,b.jsxs)("div",{"data-testid":"acceptance-criterion",className:"flex items-start gap-1.5",children:[a.verified?(0,b.jsx)(l.Check,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-600"}):(0,b.jsx)(b6.Circle,{className:"text-muted-foreground mt-0.5 h-3 w-3 shrink-0"}),(0,b.jsx)("span",{className:(0,W.cn)("text-[11px]",a.verified?"text-muted-foreground line-through":"text-foreground"),children:a.description})]})}let ch={Requirements:"border-transparent bg-blue-50 text-blue-700 hover:bg-blue-50",ClarificationRequired:"border-transparent bg-amber-50 text-amber-700 hover:bg-amber-50",Ready:"border-transparent bg-green-50 text-green-700 hover:bg-green-50"};function ci({plan:a,loading:c,error:d}){return c?(0,b.jsx)("div",{"data-testid":"plan-tab-loading",className:"flex items-center justify-center p-8",children:(0,b.jsx)(g.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):d?(0,b.jsxs)("div",{className:"flex items-center gap-2 p-4 text-sm text-red-600",children:[(0,b.jsx)(P.AlertCircle,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{children:d})]}):a?(0,b.jsxs)("div",{className:"flex flex-col gap-4 p-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Plan State"}),(0,b.jsx)(X.Badge,{className:ch[a.state]??"border-transparent bg-gray-50 text-gray-700",children:a.state})]}),a.overview?(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsx)("span",{className:"text-muted-foreground text-xs font-medium",children:"Overview"}),(0,b.jsx)("p",{className:"text-sm leading-relaxed",children:a.overview})]}):null,(0,b.jsx)(cb,{tasks:a.tasks})]}):(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,b.jsx)(b5,{className:"text-muted-foreground h-8 w-8"}),(0,b.jsx)("p",{className:"text-muted-foreground text-sm",children:"No plan created yet"})]})}var cj=a.i(61544);function ck(){return{data:null,loading:!1,error:null}}let cl=[{key:"overview",label:"Overview"},{key:"activity",label:"Activity"},{key:"log",label:"Log"},{key:"plan",label:"Plan"},{key:"prd-review",label:"PRD Review"},{key:"tech-decisions",label:"Tech Decisions"},{key:"product-decisions",label:"Product"},{key:"merge-review",label:"Merge Review"},{key:"chat",label:"Chat"}],cm={activity:async function(a){let b=await S(a);if("error"in b)throw Error(b.error);return{timings:b.timings,rejectionFeedback:b.rejectionFeedback}},plan:async function(a){let b=await T(a);if("error"in b)throw Error(b.error);return b.plan}};function cn({featureName:a,headerContent:d,featureNode:f,featureId:h,initialTab:i,urlTab:j,prdData:k,prdSelections:l,onPrdSelect:m,onPrdApprove:n,onPrdReject:o,isPrdLoading:p,techData:q,onTechApprove:r,onTechReject:s,isTechLoading:t,productData:u,mergeData:v,onMergeApprove:w,onMergeReject:x,isMergeLoading:y,syncStatus:z,syncLoading:A,syncError:B,onRefreshSync:C,onRebaseOnMain:D,rebaseLoading:E,rebaseError:F,isRejecting:G,chatInput:H,onChatInputChange:I,sseEvents:J,interactiveAgentEnabled:K=!0}){let L=(0,e.usePathname)(),M=(0,c.useMemo)(()=>(function(a,b=!0){let c=["overview","activity"];return a.hasAgentRun&&c.push("log"),a.hasPlan&&c.push("plan"),"requirements"===a.lifecycle&&"action-required"===a.state&&c.push("prd-review"),"implementation"===a.lifecycle&&"action-required"===a.state&&c.push("tech-decisions","product-decisions"),"review"===a.lifecycle&&("action-required"===a.state||"error"===a.state)&&c.push("merge-review"),"maintain"===a.lifecycle&&a.pr&&c.push("merge-review"),b&&c.push("chat"),c})(f,K),[f,K]),N=(0,c.useMemo)(()=>cl.filter(a=>M.includes(a.key)).map(a=>"merge-review"===a.key&&"maintain"===f.lifecycle?{...a,label:"Merge History"}:a),[M,f.lifecycle]),O=(0,c.useMemo)(()=>{let a=L.match(/^(\/feature\/[^/]+)/);return a?a[1]:L},[L]),S=(0,c.useMemo)(()=>j&&M.includes(j)?j:i&&M.includes(i)?i:"overview",[]),[T,U]=(0,c.useState)(S),V=function(a){let[b,d]=(0,c.useState)(""),[e,f]=(0,c.useState)(!1),[g,h]=(0,c.useState)(null),i=(0,c.useRef)(null),j=(0,c.useCallback)(()=>{i.current&&(i.current.close(),i.current=null),f(!1)},[]);return(0,c.useEffect)(()=>{if(!a){d(""),f(!1),h(null);return}d(""),h(null);let b=new EventSource(`/api/feature-logs?featureId=${a}`);return i.current=b,b.onopen=()=>{f(!0)},b.addEventListener("initial",a=>{d(JSON.parse(a.data).content)}),b.addEventListener("log",a=>{let b=JSON.parse(a.data);d(a=>a+b.content)}),b.addEventListener("error",a=>{try{let b=JSON.parse(a.data);h(b.error)}catch{h(a.data?String(a.data):"Log stream unavailable")}}),b.onerror=()=>{f(!1)},()=>{b.close(),i.current=null}},[a,j]),{content:b,isConnected:e,error:g}}("log"===T?h:null),{tabs:W,fetchTab:X,refreshTab:Y}=function(a,b){let d=Object.keys(b),[e,f]=(0,c.useState)(()=>{let a={};for(let b of d)a[b]=ck();return a}),g=(0,c.useRef)(b);g.current=b;let h=(0,c.useRef)(a);h.current=a;let i=(0,c.useRef)(!0);(0,c.useEffect)(()=>(i.current=!0,()=>{i.current=!1}),[]);let j=(0,c.useRef)(a);(0,c.useEffect)(()=>{j.current!==a&&(j.current=a,f(a=>{let b={};for(let c of Object.keys(a))b[c]=ck();return b}))},[a]);let k=(0,c.useCallback)(async a=>{let b=g.current[a],c=h.current;if(b){i.current&&f(b=>b[a]?.data!==null?b:{...b,[a]:{...b[a],loading:!0,error:null}});try{let d=await b(c);i.current&&f(b=>({...b,[a]:{data:d,loading:!1,error:null}}))}catch(b){i.current&&f(c=>{let d=b instanceof Error?b.message:"Failed to fetch tab data",e=c[a]?.data??null;return{...c,[a]:{data:e,loading:!1,error:e?null:d}}})}}},[]),l=(0,c.useCallback)(async a=>{let b=e[a];b&&null!==b.data||b&&b.loading||await k(a)},[e,k]);return{tabs:e,fetchTab:l,refreshTab:(0,c.useCallback)(async a=>{await k(a)},[k])}}(h,cm),Z=(0,c.useRef)(!1);(0,c.useEffect)(()=>{if(!Z.current)return;Z.current=!1;let a="overview"===T?O:`${O}/${T}`;a!==L&&window.history.pushState(null,"",a)},[T,O,L]);let $=(0,c.useRef)(L);(0,c.useEffect)(()=>{if($.current===L||($.current=L,Z.current))return;let a=L.split("/"),b=a.length>=4?a[3]:void 0,c=b&&M.includes(b)?b:"overview";c!==T&&(U(c),("activity"===c||"plan"===c)&&X(c))},[L]);let _=(0,c.useRef)(!1);(0,c.useEffect)(()=>{if(!_.current&&(_.current=!0,!j&&"overview"!==S)){let a=`${O}/${S}`;a!==L&&window.history.replaceState(null,"",a)}},[]);let aa=(0,c.useRef)(!1);(0,c.useEffect)(()=>{aa.current||(aa.current=!0,("activity"===T||"plan"===T)&&X(T))},[T,X]);let ab=(0,c.useRef)(h);(0,c.useEffect)(()=>{ab.current!==h&&(ab.current=h,U("overview"))},[h]);let ac=(0,c.useRef)(i);(0,c.useEffect)(()=>{if(ac.current!==i&&i&&M.includes(i)){ac.current=i,U(i),("activity"===i||"plan"===i)&&X(i);let a="overview"===i?O:`${O}/${i}`;a!==window.location.pathname&&window.history.replaceState(null,"",a)}},[i,M,O,X]),(0,c.useEffect)(()=>{M.includes(T)||(U("overview"),window.location.pathname!==O&&window.history.replaceState(null,"",O))},[M,T,O]);let ad=(0,c.useRef)(T);ad.current=T;let ae=(0,c.useRef)(0);(0,c.useEffect)(()=>{if(!J||0===J.length||(ae.current>J.length&&(ae.current=0),J.length<=ae.current))return;let a=J.slice(ae.current);if(ae.current=J.length,!a.some(a=>a.featureId===h))return;Y("activity");let b=ad.current;"plan"===b&&Y(b)},[J,h,Y]);let ag="running"===f.state||"creating"===f.state;(0,c.useEffect)(()=>{if(!ag)return;let a=setInterval(()=>{Y("activity")},5e3);return()=>clearInterval(a)},[ag,Y]);let ah=(0,c.useCallback)(a=>{Z.current=!0,U(a),("activity"===a||"plan"===a)&&X(a)},[X]);return(0,b.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:(0,b.jsxs)(Q.Tabs,{value:T,onValueChange:ah,className:"flex min-h-0 flex-1 flex-col",children:[(0,b.jsxs)("div",{className:"shrink-0 px-4 pt-4 pb-3","data-testid":"feature-drawer-header",children:[(0,b.jsxs)("div",{className:"flex items-baseline gap-4 pe-6",children:[a?(0,b.jsx)("h2",{className:"text-foreground min-w-0 shrink truncate text-base font-semibold tracking-tight",children:a}):null,(0,b.jsx)(Q.TabsList,{className:"h-auto shrink-0 gap-0.5 rounded-none border-0 bg-transparent p-0",children:N.map(a=>(0,b.jsx)(Q.TabsTrigger,{value:a.key,className:"text-muted-foreground hover:text-foreground data-[state=active]:text-foreground data-[state=active]:border-primary h-auto rounded-none border-b-2 border-transparent bg-transparent px-2 py-0.5 text-[12px] font-medium shadow-none transition-colors data-[state=active]:bg-transparent data-[state=active]:shadow-none",children:a.label},a.key))})]}),d]}),(0,b.jsx)(R.Separator,{}),(0,b.jsx)(Q.TabsContent,{value:"overview",className:"mt-0 flex-1 overflow-y-auto",children:(0,b.jsx)(bd,{data:f,syncStatus:z,syncLoading:A,syncError:B,onRefreshSync:C,onRebaseOnMain:D,rebaseLoading:E,rebaseError:F})}),(0,b.jsx)(Q.TabsContent,{value:"activity",className:"mt-0 flex-1 overflow-y-auto",children:(0,b.jsx)(bB,{timings:W.activity.data?.timings??null,loading:W.activity.loading,error:W.activity.error,rejectionFeedback:W.activity.data?.rejectionFeedback})}),(0,b.jsx)(Q.TabsContent,{value:"log",className:"mt-0 flex-1 overflow-hidden",children:(0,b.jsx)(b4,{content:V.content,isConnected:V.isConnected,error:V.error})}),(0,b.jsx)(Q.TabsContent,{value:"plan",className:"mt-0 flex-1 overflow-y-auto",children:(0,b.jsx)(ci,{plan:W.plan.data,loading:W.plan.loading,error:W.plan.error})}),M.includes("prd-review")?(0,b.jsx)(Q.TabsContent,{value:"prd-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:k?(0,b.jsx)(af,{data:k,selections:l??{},onSelect:m??(()=>void 0),onApprove:n??(()=>void 0),onReject:o,isProcessing:p,isRejecting:G,chatInput:H,onChatInputChange:I}):(0,b.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,b.jsx)(g.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,M.includes("tech-decisions")?(0,b.jsx)(Q.TabsContent,{value:"tech-decisions",className:"mt-0 flex min-h-0 flex-1 flex-col",children:q?(0,b.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col",children:[(0,b.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,b.jsx)(al,{data:q})}),(0,b.jsx)(co,{onApprove:r??(()=>void 0),onReject:s,isProcessing:t,isRejecting:G,chatInput:H,onChatInputChange:I})]}):(0,b.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,b.jsx)(g.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,M.includes("product-decisions")?(0,b.jsx)(Q.TabsContent,{value:"product-decisions",className:"mt-0 flex-1 overflow-y-auto",children:null===u?(0,b.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,b.jsx)(g.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):u?(0,b.jsx)(ao,{data:u}):(0,b.jsx)("p",{className:"text-muted-foreground p-4 text-center text-sm",children:"No product decisions available."})}):null,M.includes("merge-review")?(0,b.jsx)(Q.TabsContent,{value:"merge-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:v?(0,b.jsx)(aP,{data:v,readOnly:"maintain"===f.lifecycle,onApprove:w??(()=>void 0),onReject:x,isProcessing:y,isRejecting:G,chatInput:H,onChatInputChange:I}):(0,b.jsx)("div",{className:"flex items-center justify-center p-8",children:y?(0,b.jsx)(g.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"}):(0,b.jsxs)("div",{className:"text-muted-foreground flex flex-col items-center gap-2 text-sm",children:[(0,b.jsx)(P.AlertCircle,{className:"h-6 w-6"}),(0,b.jsx)("span",{children:"Merge review data unavailable"})]})})}):null,M.includes("chat")?(0,b.jsx)(Q.TabsContent,{value:"chat",className:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,b.jsx)(cj.ChatTab,{featureId:h,worktreePath:f.worktreePath})}):null]})})}function co({onApprove:a,onReject:c,isProcessing:e,isRejecting:f,chatInput:g,onChatInputChange:h}){let{t:i}=(0,d.useTranslation)("web");return(0,b.jsx)(ae,{onReject:c,onApprove:a,approveLabel:i("featureDrawer.approvePlan"),revisionPlaceholder:"Ask AI to revise the plan...",isProcessing:e,isRejecting:f,chatInput:g,onChatInputChange:h})}var cp=a.i(59265),cq=a.i(21697),cr=a.i(60895);let cs=(0,q.createServerReference)("40583931ecf061f192aba583fcd174b9143eea1784",q.callServer,void 0,q.findSourceMapURL,"rebaseFeature");var ct=a.i(74146);function cu(a){return"requirements"===a.lifecycle&&"action-required"===a.state?"prd-review":"implementation"===a.lifecycle&&"action-required"===a.state?"tech-decisions":"review"===a.lifecycle&&("action-required"===a.state||"error"===a.state)?"merge-review":"overview"}function cv(a,b,d,e,g,h){let[i,j]=(0,c.useState)(!1),k=(0,c.useRef)(d),l=(0,c.useRef)(e);return k.current=d,l.current=e,(0,c.useEffect)(()=>{if(l.current(),!a)return;let c=!1;return j(!0),b(a).then(a=>{c||k.current(a)}).catch(()=>{!c&&g&&f.toast.error(g)}).finally(()=>{c||j(!1)}),()=>{c=!0}},[a,b,g,h]),i}let cw=(0,q.createServerReference)("40c476dd4b96751d09e29aa3168aaa102d0cdbfff9",q.callServer,void 0,q.findSourceMapURL,"getFeatureDrawerData"),cx=(0,q.createServerReference)("40f6004f7e1071d4a4e0f90be2e704f6a666a9f427",q.callServer,void 0,q.findSourceMapURL,"getBranchSyncStatus"),cy=new Map;function cz({view:a,urlTab:q,interactiveAgentEnabled:J=!0}){var K;let L,M,N,P,Q,R=(0,y.useFeatureFlags)(),{t:S}=(0,d.useTranslation)("web"),T=(0,e.useRouter)(),U=(0,z.useSoundAction)("reject"),[V,W]=(0,c.useState)(a);(0,c.useEffect)(()=>{W(a)},[a]);let X="feature"===V.type?V.node:null,{events:Y}=(0,C.useAgentEventsContext)(),Z=(0,c.useRef)(0);(0,c.useEffect)(()=>{if(Z.current>Y.length&&(Z.current=0),!X||Y.length<=Z.current)return;let a=Y.slice(Z.current);for(let b of(Z.current=Y.length,(0,ct.resolveSseEventUpdates)(a)))b.featureId===X.featureId&&"deleting"!==X.state&&(void 0!==b.state||void 0!==b.lifecycle)&&W(a=>{if("feature"!==a.type)return a;let c={...a.node,...void 0!==b.state&&{state:b.state},...void 0!==b.lifecycle&&{lifecycle:b.lifecycle}};return{...a,node:c,initialTab:cu(c)}})},[Y,X]);let $=(0,e.usePathname)().startsWith("/feature/");K=X?.featureId??null,L=(0,c.useRef)($),M=(0,c.useRef)(!1),N=(0,c.useCallback)(async()=>{if(K&&!M.current){M.current=!0;try{let a=await cw(K);if(!a)return;W(b=>(function(a,b){if("feature"!==a.type)return a;let c={...a.node,...b},d=c.state!==a.node.state||c.lifecycle!==a.node.lifecycle;return{...a,node:c,initialTab:d?cu(c):a.initialTab}})(b,a))}catch{}finally{M.current=!1}}},[K,W]),P=(0,c.useRef)(!1),(0,c.useEffect)(()=>{!$||L.current&&P.current||(P.current=!0,N()),L.current=$},[$,N]),(0,c.useEffect)(()=>{if(!$||!K)return;let a=setInterval(()=>{N()},15e3);return()=>clearInterval(a)},[$,K,N]);let _=(0,c.useCallback)(()=>{T.push("/")},[T]),[aa,ab]=(0,c.useState)(""),[ac,ad]=(0,c.useState)(null),[ae,af]=(0,c.useState)({}),[ag,ah]=(0,c.useState)({}),[ai,aj]=(0,c.useState)(null),[ak,al]=(0,c.useState)(void 0),[am,an]=(0,c.useState)(null),[ao,ap]=(0,c.useState)(!1),[aq,ar]=(0,c.useState)(!1),[as,at]=(0,c.useState)(!1),au=`${X?.featureId}:${X?.state}`,av=(0,c.useRef)(au);(0,c.useEffect)(()=>{au!==av.current&&(av.current=au,at(!1))},[au]);let[aw,ax]=(0,c.useState)(!1),ay=(0,c.useRef)(!1),az="feature"===V.type?V.initialTab:void 0;(0,c.useEffect)(()=>{ab("")},[az]);let aA=(0,c.useRef)(0),aB=(0,c.useRef)(X?.state),aC=(0,c.useRef)(X?.lifecycle);(X?.state!==aB.current||X?.lifecycle!==aC.current)&&(aB.current=X?.state,aC.current=X?.lifecycle,aA.current+=1);let aD=aA.current,aE=cv(X?.lifecycle==="requirements"&&X?.state==="action-required"?X.featureId:null,v,a=>{if(a.error)return void f.toast.error(a.error);if(a.questionnaire){ad(a.questionnaire);let b={};for(let c of a.questionnaire.questions){let a=c.options.find(a=>a.recommended);a&&(b[c.id]=a.id)}af(b),ah(b)}},()=>{af({}),ah({}),ad(null)},"Failed to load questionnaire",aD),aF=X?.lifecycle==="implementation"&&X?.state==="action-required"?X.featureId:null,aG=cv(aF,w,a=>{a.error?f.toast.error(a.error):a.techDecisions&&aj(a.techDecisions)},()=>aj(null),"Failed to load tech decisions",aD),aH=cv(aF,v,a=>{a.productDecisions&&al(a.productDecisions)},()=>al(void 0),void 0,aD),aI=cv(X?.lifecycle==="review"&&(X?.state==="action-required"||X?.state==="error")||X?.lifecycle==="maintain"&&X?.pr?X.featureId:null,x,a=>{"error"in a?f.toast.error(a.error):an(a)},()=>an(null),"Failed to load merge review data",aD),aJ=aa.trim().length>0,aK=X?.lifecycle==="requirements"&&X?.state==="action-required"&&Object.keys(ag).some(a=>ag[a]!==ae[a]),aL=(0,c.useCallback)(()=>{ab(""),af({...ag})},[ag]),{attemptClose:aM}=(0,A.useGuardedDrawerClose)({open:$,isDirty:aJ||aK,onClose:_,onReset:aL}),aN=(0,c.useCallback)(async(a,b,c=[],d)=>{if(X?.featureId){ay.current=!0,ax(!0);try{let e=c.map(a=>a.path).filter(Boolean),g=c.filter(a=>a.notes?.trim()),h=g.length>0?`${a}
|
|
3
3
|
|
|
4
4
|
Image notes:
|
|
5
|
-
${g.map(a=>`- @${a.path}: ${a.notes.trim()}`).join("\n")}`:a,i=await t(V.featureId,h,f);if(!i.rejected)return void e.toast.error(i.error??`Failed to reject ${b.toLowerCase()}`);S.play(),_(""),e.toast.success(`${b} rejected — agent re-iterating (iteration ${i.iteration})`),i.iterationWarning&&e.toast.warning(`Iteration ${i.iteration} — consider approving or adjusting feedback to avoid excessive iterations`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:V.featureId}})),Z(),d?.()}finally{aw.current=!1,av(!1)}}},[V,Z,S]),aM=(0,c.useCallback)((a,b)=>aL(a,"Requirements",b,()=>ad({})),[aL]),aN=(0,c.useCallback)((a,b)=>aL(a,"Plan",b),[aL]),aO=(0,c.useCallback)((a,b)=>aL(a,"Merge",b),[aL]),aP=(0,c.useCallback)(async a=>{if(!V?.featureId)return;let b=await q(V.featureId);b.approved?(_(""),e.toast.success(`${a} approved — agent resuming`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:V.featureId}})),Z()):e.toast.error(b.error??`Failed to approve ${a.toLowerCase()}`)},[V,Z]),aQ=(0,c.useCallback)(async a=>{let b;if("feature"!==T.type||!V)return;if(aa){let a=[];for(let[b,c]of Object.entries(ac)){let d=aa.questions.find(a=>a.id===b),e=d?.options.find(a=>a.id===c);d&&e&&a.push({questionId:d.question,selectedOption:e.label})}b={approved:!0,changedSelections:a}}let c=await q(V.featureId,b);c.approved?(_(""),e.toast.success("Requirements approved — agent resuming"),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:V.featureId}})),ad({}),Z()):e.toast.error(c.error??"Failed to approve requirements")},[T,V,aa,ac,Z]),aR=(0,c.useCallback)(()=>aP("Plan"),[aP]),aS=(0,c.useCallback)(()=>aP("Merge"),[aP]),aT=(0,c.useCallback)(async(a,b,c,d)=>{an(!0),ap(!1),window.dispatchEvent(new CustomEvent("shep:feature-delete-requested",{detail:{featureId:a,cleanup:b,cascadeDelete:c,closePr:d}})),R.push("/")},[R]),aU=(0,c.useCallback)(a=>{ar(!0),window.dispatchEvent(new CustomEvent("shep:feature-archive-requested",{detail:{featureId:a}})),R.push("/")},[R]),aV=(0,c.useCallback)(a=>{ar(!0),window.dispatchEvent(new CustomEvent("shep:feature-unarchive-requested",{detail:{featureId:a}})),R.push("/")},[R]),aW=(0,c.useCallback)(async a=>{let b=await (0,r.resumeFeature)(a);b.error?e.toast.error(b.error):(e.toast.success("Feature resumed — agent restarting"),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:a}})),U(a=>"feature"!==a.type?a:{...a,node:{...a.node,state:"running"}}))},[]),aX=(0,c.useCallback)(async a=>{let b=await (0,s.startFeature)(a);b.error?e.toast.error(b.error):(e.toast.success("Feature started"),U(a=>"feature"!==a.type?a:{...a,node:{...a.node,state:"running"}}))},[]),aY=V?.repositoryPath&&V?.branch?{featureId:V.featureId,repositoryPath:V.repositoryPath,branch:V.branch,worktreePath:V.worktreePath,specPath:V.specPath}:null,aZ=function(a){let[b,d]=(0,c.useState)(!1),[e,f]=(0,c.useState)(!1),[g,h]=(0,c.useState)(!1),[i,j]=(0,c.useState)(!1),[k,l]=(0,c.useState)(!1),[m,n]=(0,c.useState)(null),[o,p]=(0,c.useState)(null),[q,r]=(0,c.useState)(null),[s,t]=(0,c.useState)(null),[u,v]=(0,c.useState)(null),w=(0,c.useRef)(null),x=(0,c.useRef)(null),y=(0,c.useRef)(null),z=(0,c.useRef)(null),A=(0,c.useRef)(null);(0,c.useEffect)(()=>{let a=[w,x,y,z,A];return()=>{for(let b of a)b.current&&clearTimeout(b.current)}},[]);let B=(0,c.useCallback)(async(b,c,d,e,f)=>{if(a&&!f){e.current&&clearTimeout(e.current),c(!0),d(null);try{let c=await b({repositoryPath:a.repositoryPath,branch:a.branch});if(!c.success){let a=c.error??"An unexpected error occurred";d(a),e.current=setTimeout(()=>d(null),5e3)}}catch(a){d(a instanceof Error?a.message:"An unexpected error occurred"),e.current=setTimeout(()=>d(null),5e3)}finally{c(!1)}}},[a]);return{openInIde:(0,c.useCallback)(()=>B(co.openIde,d,n,w,b),[B,b]),openInShell:(0,c.useCallback)(()=>B(cp.openShell,f,p,x,e),[B,e]),openFolder:(0,c.useCallback)(async()=>{if(a&&!g){y.current&&clearTimeout(y.current),h(!0),r(null);try{let b=a.worktreePath??a.repositoryPath,c=await (0,cq.openFolder)(b);if(!c.success){let a=c.error??"An unexpected error occurred";r(a),y.current=setTimeout(()=>r(null),5e3)}}catch(a){r(a instanceof Error?a.message:"An unexpected error occurred"),y.current=setTimeout(()=>r(null),5e3)}finally{h(!1)}}},[a,g]),openSpecsFolder:(0,c.useCallback)(async()=>{if(a?.specPath&&!i){z.current&&clearTimeout(z.current),j(!0),t(null);try{let b=await (0,cq.openFolder)(a.specPath);if(!b.success){let a=b.error??"An unexpected error occurred";t(a),z.current=setTimeout(()=>t(null),5e3)}}catch(a){t(a instanceof Error?a.message:"An unexpected error occurred"),z.current=setTimeout(()=>t(null),5e3)}finally{j(!1)}}},[a,i]),rebaseOnMain:(0,c.useCallback)(async()=>{if(a?.featureId&&!k){A.current&&clearTimeout(A.current),l(!0),v(null);try{let b=await cr(a.featureId);if(!b.success){let a=b.error??"An unexpected error occurred";v(a),A.current=setTimeout(()=>v(null),5e3)}}catch(a){v(a instanceof Error?a.message:"An unexpected error occurred"),A.current=setTimeout(()=>v(null),5e3)}finally{l(!1)}}},[a,k]),ideLoading:b,shellLoading:e,folderLoading:g,specsLoading:i,rebaseLoading:k,ideError:m,shellError:o,folderError:q,specsError:s,rebaseError:u}}(aY),a$=Q.gitRebaseSync&&V?.branch&&V?.remoteUrl?V.featureId:null,{data:a_,loading:a0,error:a1,refresh:a2}=function(a){let[b,d]=(0,c.useState)(()=>{if(!a)return null;let b=cx.get(a);return b?b.data:null}),[e,f]=(0,c.useState)(!1),[g,h]=(0,c.useState)(null),i=(0,c.useRef)(a);i.current=a;let j=(0,c.useCallback)(async a=>{f(!0),h(null);try{let b=await cw(a);if(i.current!==a)return;if(b.success&&b.data){let c=b.data;cx.set(a,{data:c,timestamp:Date.now()}),d(c)}else h(b.error??"Failed to check sync status")}catch{if(i.current!==a)return;h("Failed to check sync status")}finally{i.current===a&&f(!1)}},[]);return(0,c.useEffect)(()=>{if(!a){d(null),h(null);return}let b=cx.get(a);b&&(d(b.data),Date.now()-b.timestamp<3e4)||j(a)},[a,j]),{data:b,loading:e,error:g,refresh:(0,c.useCallback)(()=>{a&&j(a)},[a,j])}}(a$),a3=(0,c.useRef)(aZ.rebaseLoading);(0,c.useEffect)(()=>{!a3.current||aZ.rebaseLoading||aZ.rebaseError||a2(),a3.current=aZ.rebaseLoading},[aZ.rebaseLoading,aZ.rebaseError,a2]);let a4=V?.repositoryPath&&V.branch?{targetId:V.featureId,targetType:"feature",repositoryPath:V.repositoryPath,branch:V.branch}:null,a5=(0,A.useDeployAction)(a4),a6="Booting"===a5.status||"Ready"===a5.status,[a7,a8]=(0,c.useState)(!1),a9=(0,c.useCallback)(()=>{V?.featureId&&(navigator.clipboard.writeText(V.featureId),a8(!0),setTimeout(()=>a8(!1),2e3))},[V?.featureId]);if(V){let a=V.featureId.slice(0,8),c=V.repositoryName??V.repositoryPath.split("/").filter(Boolean).at(-1)??"";P=(0,b.jsxs)(b.Fragment,{children:[c?(0,b.jsxs)("div",{className:"flex items-center gap-1.5 pt-0.5",children:[(0,b.jsx)(l.Code2,{className:"text-muted-foreground size-3.5 shrink-0"}),V.remoteUrl?(0,b.jsxs)("a",{href:V.remoteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors","data-testid":"feature-drawer-repo-link",children:[c,(0,b.jsx)(m.ExternalLink,{className:"size-3"})]}):(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:c})]}):null,aY?(0,b.jsxs)("div",{className:"flex items-center gap-2 pt-1","data-testid":"feature-drawer-actions",children:[V?.state!=="done"?(0,b.jsx)(N,{actions:aZ,repositoryPath:aY.repositoryPath,worktreePath:aY.worktreePath,showSpecs:!!aY.specPath}):null,V?.state!=="done"&&Q.envDeploy&&a4?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(F.TooltipProvider,{children:(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("span",{children:(0,b.jsx)(H.ActionButton,{label:a6?"Stop Dev Server":"Start Dev Server",onClick:a6?a5.stop:a5.deploy,loading:a5.deployLoading||a5.stopLoading,error:!!a5.deployError,icon:a6?i.Square:h.Play,iconOnly:!0,variant:"outline",size:"icon-sm"})})}),(0,b.jsx)(F.TooltipContent,{children:a6?"Stop Dev Server":"Start Dev Server"})]})}),a6?(0,b.jsx)(D.DeploymentStatusBadge,{status:a5.status,url:a5.url,targetId:a4?.targetId}):null]}):null,(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-1.5",children:[(0,b.jsx)("code",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 font-mono text-xs",children:a}),(0,b.jsx)("button",{type:"button",onClick:a9,className:"text-muted-foreground hover:text-foreground inline-flex items-center rounded p-0.5 transition-colors","aria-label":"Copy feature ID","data-testid":"feature-drawer-copy-id",children:a7?(0,b.jsx)(k.Check,{className:"size-3.5 text-green-600"}):(0,b.jsx)(j.Copy,{className:"size-3.5"})})]}),V.featureId?(0,b.jsxs)(b.Fragment,{children:["archived"===V.state?(0,b.jsx)(F.TooltipProvider,{children:(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(E.Button,{variant:"ghost",size:"icon-sm","aria-label":"Unarchive feature",disabled:aq,className:"text-muted-foreground hover:text-primary","data-testid":"feature-drawer-unarchive",onClick:()=>aV(V.featureId),children:aq?(0,b.jsx)(f.Loader2,{className:"size-4 animate-spin"}):(0,b.jsx)(o.ArchiveRestore,{className:"size-4"})})}),(0,b.jsx)(F.TooltipContent,{children:"Unarchive feature"})]})}):"deleting"!==V.state?(0,b.jsx)(F.TooltipProvider,{children:(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(E.Button,{variant:"ghost",size:"icon-sm","aria-label":"Archive feature",disabled:aq,className:"text-muted-foreground hover:text-foreground","data-testid":"feature-drawer-archive",onClick:()=>aU(V.featureId),children:aq?(0,b.jsx)(f.Loader2,{className:"size-4 animate-spin"}):(0,b.jsx)(n.Archive,{className:"size-4"})})}),(0,b.jsx)(F.TooltipContent,{children:"Archive feature"})]})}):null,(0,b.jsx)(E.Button,{variant:"ghost",size:"icon-sm","aria-label":"Delete feature",disabled:am,className:"text-muted-foreground hover:text-destructive","data-testid":"feature-drawer-delete",onClick:()=>ap(!0),children:am?(0,b.jsx)(f.Loader2,{className:"size-4 animate-spin"}):(0,b.jsx)(g.Trash2,{className:"size-4"})}),(0,b.jsx)(G.DeleteFeatureDialog,{open:ao,onOpenChange:ap,onConfirm:(a,b,c)=>aT(V.featureId,a,b,c),isDeleting:am,featureName:V.name,featureId:V.featureId,hasChildren:V.hasChildren,hasOpenPr:!!V.pr&&"Open"===V.pr.status})]}):null]}):null]})}let ba=null;if("feature"===T.type&&V){let a={...V,..."error"===V.state&&{onRetry:aW},..."pending"===V.state&&{onStart:aX}};ba=(0,b.jsx)(cm,{featureName:V.name,headerContent:P,featureNode:a,featureId:V.featureId,initialTab:T.initialTab,urlTab:p,sseEvents:W,prdData:aa,prdSelections:ac,onPrdSelect:(a,b)=>ad(c=>({...c,[a]:b})),onPrdApprove:aQ,onPrdReject:aM,isPrdLoading:aC,techData:ag,onTechApprove:aR,onTechReject:aN,isTechLoading:aE,productData:aF?null:ai,mergeData:ak,onMergeApprove:aS,onMergeReject:aO,isMergeLoading:aG,syncStatus:a$?a_:void 0,syncLoading:a0,syncError:a1,onRefreshSync:a$?a2:void 0,onRebaseOnMain:a$?aZ.rebaseOnMain:void 0,rebaseLoading:aZ.rebaseLoading,rebaseError:aZ.rebaseError,isRejecting:au,chatInput:$,onChatInputChange:_,interactiveAgentEnabled:I})}return(0,b.jsx)(C.BaseDrawer,{open:Y,onClose:aK,size:"lg",modal:!1,"data-testid":"feature"===T.type?"feature-drawer":"repository-drawer",children:ba})}a.s(["FeatureDrawerClient",()=>cy],64885)}];
|
|
5
|
+
${g.map(a=>`- @${a.path}: ${a.notes.trim()}`).join("\n")}`:a,i=await u(X.featureId,h,e);if(!i.rejected)return void f.toast.error(i.error??`Failed to reject ${b.toLowerCase()}`);U.play(),ab(""),f.toast.success(`${b} rejected — agent re-iterating (iteration ${i.iteration})`),i.iterationWarning&&f.toast.warning(`Iteration ${i.iteration} — consider approving or adjusting feedback to avoid excessive iterations`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:X.featureId}})),_(),d?.()}finally{ay.current=!1,ax(!1)}}},[X,_,U]),aO=(0,c.useCallback)((a,b)=>aN(a,"Requirements",b,()=>af({})),[aN]),aP=(0,c.useCallback)((a,b)=>aN(a,"Plan",b),[aN]),aQ=(0,c.useCallback)((a,b)=>aN(a,"Merge",b),[aN]),aR=(0,c.useCallback)(async a=>{if(!X?.featureId)return;let b=await r(X.featureId);b.approved?(ab(""),f.toast.success(`${a} approved — agent resuming`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:X.featureId}})),_()):f.toast.error(b.error??`Failed to approve ${a.toLowerCase()}`)},[X,_]),aS=(0,c.useCallback)(async a=>{let b;if("feature"!==V.type||!X)return;if(ac){let a=[];for(let[b,c]of Object.entries(ae)){let d=ac.questions.find(a=>a.id===b),e=d?.options.find(a=>a.id===c);d&&e&&a.push({questionId:d.question,selectedOption:e.label})}b={approved:!0,changedSelections:a}}let c=await r(X.featureId,b);c.approved?(ab(""),f.toast.success("Requirements approved — agent resuming"),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:X.featureId}})),af({}),_()):f.toast.error(c.error??"Failed to approve requirements")},[V,X,ac,ae,_]),aT=(0,c.useCallback)(()=>aR("Plan"),[aR]),aU=(0,c.useCallback)(()=>aR("Merge"),[aR]),aV=(0,c.useCallback)(async(a,b,c,d)=>{ap(!0),ar(!1),window.dispatchEvent(new CustomEvent("shep:feature-delete-requested",{detail:{featureId:a,cleanup:b,cascadeDelete:c,closePr:d}})),T.push("/")},[T]),aW=(0,c.useCallback)(a=>{at(!0),window.dispatchEvent(new CustomEvent("shep:feature-archive-requested",{detail:{featureId:a}})),T.push("/")},[T]),aX=(0,c.useCallback)(a=>{at(!0),window.dispatchEvent(new CustomEvent("shep:feature-unarchive-requested",{detail:{featureId:a}})),T.push("/")},[T]),aY=(0,c.useCallback)(async a=>{let b=await (0,s.resumeFeature)(a);b.error?f.toast.error(b.error):(f.toast.success("Feature resumed — agent restarting"),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:a}})),W(a=>"feature"!==a.type?a:{...a,node:{...a.node,state:"running"}}))},[]),aZ=(0,c.useCallback)(async a=>{let b=await (0,t.startFeature)(a);b.error?f.toast.error(b.error):(f.toast.success("Feature started"),W(a=>"feature"!==a.type?a:{...a,node:{...a.node,state:"running"}}))},[]),a$=X?.repositoryPath&&X?.branch?{featureId:X.featureId,repositoryPath:X.repositoryPath,branch:X.branch,worktreePath:X.worktreePath,specPath:X.specPath}:null,a_=function(a){let[b,d]=(0,c.useState)(!1),[e,f]=(0,c.useState)(!1),[g,h]=(0,c.useState)(!1),[i,j]=(0,c.useState)(!1),[k,l]=(0,c.useState)(!1),[m,n]=(0,c.useState)(null),[o,p]=(0,c.useState)(null),[q,r]=(0,c.useState)(null),[s,t]=(0,c.useState)(null),[u,v]=(0,c.useState)(null),w=(0,c.useRef)(null),x=(0,c.useRef)(null),y=(0,c.useRef)(null),z=(0,c.useRef)(null),A=(0,c.useRef)(null);(0,c.useEffect)(()=>{let a=[w,x,y,z,A];return()=>{for(let b of a)b.current&&clearTimeout(b.current)}},[]);let B=(0,c.useCallback)(async(b,c,d,e,f)=>{if(a&&!f){e.current&&clearTimeout(e.current),c(!0),d(null);try{let c=await b({repositoryPath:a.repositoryPath,branch:a.branch});if(!c.success){let a=c.error??"An unexpected error occurred";d(a),e.current=setTimeout(()=>d(null),5e3)}}catch(a){d(a instanceof Error?a.message:"An unexpected error occurred"),e.current=setTimeout(()=>d(null),5e3)}finally{c(!1)}}},[a]);return{openInIde:(0,c.useCallback)(()=>B(cp.openIde,d,n,w,b),[B,b]),openInShell:(0,c.useCallback)(()=>B(cq.openShell,f,p,x,e),[B,e]),openFolder:(0,c.useCallback)(async()=>{if(a&&!g){y.current&&clearTimeout(y.current),h(!0),r(null);try{let b=a.worktreePath??a.repositoryPath,c=await (0,cr.openFolder)(b);if(!c.success){let a=c.error??"An unexpected error occurred";r(a),y.current=setTimeout(()=>r(null),5e3)}}catch(a){r(a instanceof Error?a.message:"An unexpected error occurred"),y.current=setTimeout(()=>r(null),5e3)}finally{h(!1)}}},[a,g]),openSpecsFolder:(0,c.useCallback)(async()=>{if(a?.specPath&&!i){z.current&&clearTimeout(z.current),j(!0),t(null);try{let b=await (0,cr.openFolder)(a.specPath);if(!b.success){let a=b.error??"An unexpected error occurred";t(a),z.current=setTimeout(()=>t(null),5e3)}}catch(a){t(a instanceof Error?a.message:"An unexpected error occurred"),z.current=setTimeout(()=>t(null),5e3)}finally{j(!1)}}},[a,i]),rebaseOnMain:(0,c.useCallback)(async()=>{if(a?.featureId&&!k){A.current&&clearTimeout(A.current),l(!0),v(null);try{let b=await cs(a.featureId);if(!b.success){let a=b.error??"An unexpected error occurred";v(a),A.current=setTimeout(()=>v(null),5e3)}}catch(a){v(a instanceof Error?a.message:"An unexpected error occurred"),A.current=setTimeout(()=>v(null),5e3)}finally{l(!1)}}},[a,k]),ideLoading:b,shellLoading:e,folderLoading:g,specsLoading:i,rebaseLoading:k,ideError:m,shellError:o,folderError:q,specsError:s,rebaseError:u}}(a$),a0=R.gitRebaseSync&&X?.branch&&X?.remoteUrl?X.featureId:null,{data:a1,loading:a2,error:a3,refresh:a4}=function(a){let[b,d]=(0,c.useState)(()=>{if(!a)return null;let b=cy.get(a);return b?b.data:null}),[e,f]=(0,c.useState)(!1),[g,h]=(0,c.useState)(null),i=(0,c.useRef)(a);i.current=a;let j=(0,c.useCallback)(async a=>{f(!0),h(null);try{let b=await cx(a);if(i.current!==a)return;if(b.success&&b.data){let c=b.data;cy.set(a,{data:c,timestamp:Date.now()}),d(c)}else h(b.error??"Failed to check sync status")}catch{if(i.current!==a)return;h("Failed to check sync status")}finally{i.current===a&&f(!1)}},[]);return(0,c.useEffect)(()=>{if(!a){d(null),h(null);return}let b=cy.get(a);b&&(d(b.data),Date.now()-b.timestamp<3e4)||j(a)},[a,j]),{data:b,loading:e,error:g,refresh:(0,c.useCallback)(()=>{a&&j(a)},[a,j])}}(a0),a5=(0,c.useRef)(a_.rebaseLoading);(0,c.useEffect)(()=>{!a5.current||a_.rebaseLoading||a_.rebaseError||a4(),a5.current=a_.rebaseLoading},[a_.rebaseLoading,a_.rebaseError,a4]);let a6=X?.repositoryPath&&X.branch?{targetId:X.featureId,targetType:"feature",repositoryPath:X.repositoryPath,branch:X.branch}:null,a7=(0,B.useDeployAction)(a6),a8="Booting"===a7.status||"Ready"===a7.status,[a9,ba]=(0,c.useState)(!1),bb=(0,c.useCallback)(()=>{X?.featureId&&(navigator.clipboard.writeText(X.featureId),ba(!0),setTimeout(()=>ba(!1),2e3))},[X?.featureId]);if(X){let a=X.featureId.slice(0,8),c=X.repositoryName??X.repositoryPath.split("/").filter(Boolean).at(-1)??"";Q=(0,b.jsxs)(b.Fragment,{children:[c?(0,b.jsxs)("div",{className:"flex items-center gap-1.5 pt-0.5",children:[(0,b.jsx)(m.Code2,{className:"text-muted-foreground size-3.5 shrink-0"}),X.remoteUrl?(0,b.jsxs)("a",{href:X.remoteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors","data-testid":"feature-drawer-repo-link",children:[c,(0,b.jsx)(n.ExternalLink,{className:"size-3"})]}):(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:c})]}):null,a$?(0,b.jsxs)("div",{className:"flex items-center gap-2 pt-1","data-testid":"feature-drawer-actions",children:[X?.state!=="done"?(0,b.jsx)(O,{actions:a_,repositoryPath:a$.repositoryPath,worktreePath:a$.worktreePath,showSpecs:!!a$.specPath}):null,X?.state!=="done"&&R.envDeploy&&a6?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(G.TooltipProvider,{children:(0,b.jsxs)(G.Tooltip,{children:[(0,b.jsx)(G.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("span",{children:(0,b.jsx)(I.ActionButton,{label:S(a8?"featureDrawer.stopDevServer":"featureDrawer.startDevServer"),onClick:a8?a7.stop:a7.deploy,loading:a7.deployLoading||a7.stopLoading,error:!!a7.deployError,icon:a8?j.Square:i.Play,iconOnly:!0,variant:"outline",size:"icon-sm"})})}),(0,b.jsx)(G.TooltipContent,{children:S(a8?"featureDrawer.stopDevServer":"featureDrawer.startDevServer")})]})}),a8?(0,b.jsx)(E.DeploymentStatusBadge,{status:a7.status,url:a7.url,targetId:a6?.targetId}):null]}):null,(0,b.jsxs)("div",{className:"ml-auto flex items-center gap-1.5",children:[(0,b.jsx)("code",{className:"bg-muted text-muted-foreground rounded px-1.5 py-0.5 font-mono text-xs",children:a}),(0,b.jsx)("button",{type:"button",onClick:bb,className:"text-muted-foreground hover:text-foreground inline-flex items-center rounded p-0.5 transition-colors","aria-label":S("featureDrawer.copyFeatureId"),"data-testid":"feature-drawer-copy-id",children:a9?(0,b.jsx)(l.Check,{className:"size-3.5 text-green-600"}):(0,b.jsx)(k.Copy,{className:"size-3.5"})})]}),X.featureId?(0,b.jsxs)(b.Fragment,{children:["archived"===X.state?(0,b.jsx)(G.TooltipProvider,{children:(0,b.jsxs)(G.Tooltip,{children:[(0,b.jsx)(G.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(F.Button,{variant:"ghost",size:"icon-sm","aria-label":S("featureDrawer.unarchiveFeature"),disabled:as,className:"text-muted-foreground hover:text-primary","data-testid":"feature-drawer-unarchive",onClick:()=>aX(X.featureId),children:as?(0,b.jsx)(g.Loader2,{className:"size-4 animate-spin"}):(0,b.jsx)(p.ArchiveRestore,{className:"size-4"})})}),(0,b.jsx)(G.TooltipContent,{children:S("featureDrawer.unarchiveFeature")})]})}):"deleting"!==X.state?(0,b.jsx)(G.TooltipProvider,{children:(0,b.jsxs)(G.Tooltip,{children:[(0,b.jsx)(G.TooltipTrigger,{asChild:!0,children:(0,b.jsx)(F.Button,{variant:"ghost",size:"icon-sm","aria-label":S("featureDrawer.archiveFeature"),disabled:as,className:"text-muted-foreground hover:text-foreground","data-testid":"feature-drawer-archive",onClick:()=>aW(X.featureId),children:as?(0,b.jsx)(g.Loader2,{className:"size-4 animate-spin"}):(0,b.jsx)(o.Archive,{className:"size-4"})})}),(0,b.jsx)(G.TooltipContent,{children:S("featureDrawer.archiveFeature")})]})}):null,(0,b.jsx)(F.Button,{variant:"ghost",size:"icon-sm","aria-label":S("featureDrawer.deleteFeature"),disabled:ao,className:"text-muted-foreground hover:text-destructive","data-testid":"feature-drawer-delete",onClick:()=>ar(!0),children:ao?(0,b.jsx)(g.Loader2,{className:"size-4 animate-spin"}):(0,b.jsx)(h.Trash2,{className:"size-4"})}),(0,b.jsx)(H.DeleteFeatureDialog,{open:aq,onOpenChange:ar,onConfirm:(a,b,c)=>aV(X.featureId,a,b,c),isDeleting:ao,featureName:X.name,featureId:X.featureId,hasChildren:X.hasChildren,hasOpenPr:!!X.pr&&"Open"===X.pr.status})]}):null]}):null]})}let bc=null;if("feature"===V.type&&X){let a={...X,..."error"===X.state&&{onRetry:aY},..."pending"===X.state&&{onStart:aZ}};bc=(0,b.jsx)(cn,{featureName:X.name,headerContent:Q,featureNode:a,featureId:X.featureId,initialTab:V.initialTab,urlTab:q,sseEvents:Y,prdData:ac,prdSelections:ae,onPrdSelect:(a,b)=>af(c=>({...c,[a]:b})),onPrdApprove:aS,onPrdReject:aO,isPrdLoading:aE,techData:ai,onTechApprove:aT,onTechReject:aP,isTechLoading:aG,productData:aH?null:ak,mergeData:am,onMergeApprove:aU,onMergeReject:aQ,isMergeLoading:aI,syncStatus:a0?a1:void 0,syncLoading:a2,syncError:a3,onRefreshSync:a0?a4:void 0,onRebaseOnMain:a0?a_.rebaseOnMain:void 0,rebaseLoading:a_.rebaseLoading,rebaseError:a_.rebaseError,isRejecting:aw,chatInput:aa,onChatInputChange:ab,interactiveAgentEnabled:J})}return(0,b.jsx)(D.BaseDrawer,{open:$,onClose:aM,size:"lg",modal:!1,"data-testid":"feature"===V.type?"feature-drawer":"repository-drawer",children:bc})}a.s(["FeatureDrawerClient",()=>cz],64885)}];
|
|
6
6
|
|
|
7
7
|
//# sourceMappingURL=744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map
|