@shepai/cli 1.169.1 → 1.170.0-pr513.cff27cb
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/apis/json-schema/Feature.yaml +27 -5
- package/apis/json-schema/FeatureMode.yaml +8 -0
- package/apis/json-schema/SdlcLifecycle.yaml +1 -0
- package/apis/json-schema/SkillInjectionConfig.yaml +17 -0
- package/apis/json-schema/SkillSource.yaml +21 -0
- package/apis/json-schema/SkillSourceType.yaml +7 -0
- package/apis/json-schema/WorkflowConfig.yaml +13 -5
- package/dist/packages/core/src/application/ports/output/agents/feature-agent-process.interface.d.ts +2 -2
- package/dist/packages/core/src/application/ports/output/agents/feature-agent-process.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts +8 -0
- package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/services/index.d.ts +1 -0
- package/dist/packages/core/src/application/ports/output/services/index.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/services/skill-injector.interface.d.ts +39 -0
- package/dist/packages/core/src/application/ports/output/services/skill-injector.interface.d.ts.map +1 -0
- package/dist/packages/core/src/application/ports/output/services/skill-injector.interface.js +8 -0
- package/dist/packages/core/src/application/ports/output/services/spec-initializer.interface.d.ts +4 -3
- package/dist/packages/core/src/application/ports/output/services/spec-initializer.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/agents/approve-agent-run.use-case.js +2 -2
- package/dist/packages/core/src/application/use-cases/agents/reject-agent-run.use-case.js +2 -2
- package/dist/packages/core/src/application/use-cases/features/adopt-branch.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/adopt-branch.use-case.js +4 -2
- package/dist/packages/core/src/application/use-cases/features/check-and-unblock-features.use-case.js +2 -2
- package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.d.ts +3 -1
- package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.js +40 -10
- package/dist/packages/core/src/application/use-cases/features/create/types.d.ts +5 -2
- package/dist/packages/core/src/application/use-cases/features/create/types.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/delete-feature.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/delete-feature.use-case.js +13 -0
- package/dist/packages/core/src/application/use-cases/features/promote/promote-exploration.use-case.d.ts +40 -0
- package/dist/packages/core/src/application/use-cases/features/promote/promote-exploration.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/features/promote/promote-exploration.use-case.js +125 -0
- package/dist/packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.js +23 -2
- package/dist/packages/core/src/application/use-cases/features/resume-feature.use-case.js +2 -2
- 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 -3
- package/dist/packages/core/src/domain/factories/settings-defaults.factory.d.ts.map +1 -1
- package/dist/packages/core/src/domain/factories/settings-defaults.factory.js +57 -2
- package/dist/packages/core/src/domain/generated/output.d.ts +72 -4
- package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
- package/dist/packages/core/src/domain/generated/output.js +12 -0
- package/dist/packages/core/src/domain/lifecycle-gates.d.ts +21 -6
- package/dist/packages/core/src/domain/lifecycle-gates.d.ts.map +1 -1
- package/dist/packages/core/src/domain/lifecycle-gates.js +25 -6
- package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.js +7 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/feature.mapper.d.ts +5 -1
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/feature.mapper.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/feature.mapper.js +16 -4
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +4 -1
- 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 +34 -2
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/051-replace-fast-with-mode.d.ts +19 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/051-replace-fast-with-mode.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/051-replace-fast-with-mode.js +46 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/052-replace-default-fast-mode-with-default-mode.d.ts +17 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/052-replace-default-fast-mode-with-default-mode.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/052-replace-default-fast-mode-with-default-mode.js +37 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/053-add-exploration-max-iterations.d.ts +12 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/053-add-exploration-max-iterations.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/053-add-exploration-max-iterations.js +17 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/053-add-skill-injection-config.d.ts +15 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/053-add-skill-injection-config.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/053-add-skill-injection-config.js +23 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/054-add-injected-skills-to-features.d.ts +11 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/054-add-injected-skills-to-features.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/054-add-injected-skills-to-features.js +19 -0
- package/dist/packages/core/src/infrastructure/repositories/sqlite-feature.repository.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/repositories/sqlite-feature.repository.js +13 -7
- package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.js +3 -3
- package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.d.ts +21 -0
- package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.js +61 -0
- package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.d.ts +16 -0
- package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.js +47 -4
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/exploration-agent-graph.d.ts +362 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/exploration-agent-graph.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/exploration-agent-graph.js +72 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/fast-feature-agent-graph.d.ts +20 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/fast-feature-agent-graph.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts +68 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-graph.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.d.ts +2 -2
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-process.service.js +3 -3
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts +2 -2
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.js +19 -8
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/lifecycle-context.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/lifecycle-context.js +1 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/apply-feedback.node.d.ts +18 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/apply-feedback.node.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/apply-feedback.node.js +52 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.js +39 -20
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js +1 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/apply-feedback.prompt.d.ts +24 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/apply-feedback.prompt.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/apply-feedback.prompt.js +38 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/prototype-generate.prompt.d.ts +31 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/prototype-generate.prompt.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/prototype-generate.prompt.js +240 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prototype-generate.node.d.ts +21 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prototype-generate.node.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prototype-generate.node.js +134 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/state.d.ts +4 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/state.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/state.js +17 -0
- package/dist/packages/core/src/infrastructure/services/git/git-fork.service.d.ts +5 -0
- package/dist/packages/core/src/infrastructure/services/git/git-fork.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/git/git-fork.service.js +34 -0
- package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts +1 -0
- package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/git/git-pr.service.js +8 -0
- package/dist/packages/core/src/infrastructure/services/skill-injector.service.d.ts +26 -0
- package/dist/packages/core/src/infrastructure/services/skill-injector.service.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/skill-injector.service.js +201 -0
- package/dist/packages/core/src/infrastructure/services/spec/spec-initializer.service.d.ts +1 -1
- package/dist/packages/core/src/infrastructure/services/spec/spec-initializer.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/spec/spec-initializer.service.js +7 -4
- package/dist/src/presentation/cli/commands/feat/feedback.command.d.ts +12 -0
- package/dist/src/presentation/cli/commands/feat/feedback.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/feat/feedback.command.js +64 -0
- package/dist/src/presentation/cli/commands/feat/index.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/index.js +5 -1
- package/dist/src/presentation/cli/commands/feat/new.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/new.command.js +21 -5
- package/dist/src/presentation/cli/commands/feat/promote.command.d.ts +13 -0
- package/dist/src/presentation/cli/commands/feat/promote.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/feat/promote.command.js +41 -0
- package/dist/src/presentation/web/app/actions/add-injected-skill.d.ts +7 -0
- package/dist/src/presentation/web/app/actions/add-injected-skill.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/add-injected-skill.js +34 -0
- package/dist/src/presentation/web/app/actions/create-feature.d.ts +5 -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 +5 -3
- package/dist/src/presentation/web/app/actions/discard-exploration.d.ts +9 -0
- package/dist/src/presentation/web/app/actions/discard-exploration.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/discard-exploration.js +29 -0
- package/dist/src/presentation/web/app/actions/get-workflow-defaults.d.ts +3 -1
- package/dist/src/presentation/web/app/actions/get-workflow-defaults.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/get-workflow-defaults.js +3 -1
- package/dist/src/presentation/web/app/actions/promote-exploration.d.ts +11 -0
- package/dist/src/presentation/web/app/actions/promote-exploration.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/promote-exploration.js +21 -0
- package/dist/src/presentation/web/app/actions/remove-injected-skill.d.ts +6 -0
- package/dist/src/presentation/web/app/actions/remove-injected-skill.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/remove-injected-skill.js +35 -0
- package/dist/src/presentation/web/app/actions/submit-exploration-feedback.d.ts +12 -0
- package/dist/src/presentation/web/app/actions/submit-exploration-feedback.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/submit-exploration-feedback.js +40 -0
- package/dist/src/presentation/web/app/api/agent-events/route.d.ts.map +1 -1
- package/dist/src/presentation/web/app/api/agent-events/route.js +1 -0
- package/dist/src/presentation/web/app/build-feature-node-data.d.ts.map +1 -1
- package/dist/src/presentation/web/app/build-feature-node-data.js +6 -2
- package/dist/src/presentation/web/app/build-graph-nodes.js +4 -2
- package/dist/src/presentation/web/app/skills/page.d.ts.map +1 -1
- package/dist/src/presentation/web/app/skills/page.js +6 -1
- package/dist/src/presentation/web/components/common/control-center-drawer/drawer-view.d.ts +1 -1
- package/dist/src/presentation/web/components/common/control-center-drawer/drawer-view.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/control-center-drawer/drawer-view.js +3 -0
- 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 +65 -1
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts +5 -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 +20 -12
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.js +3 -1
- package/dist/src/presentation/web/components/common/feature-create-drawer/mode-selector.d.ts +8 -0
- package/dist/src/presentation/web/components/common/feature-create-drawer/mode-selector.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/feature-create-drawer/mode-selector.js +33 -0
- package/dist/src/presentation/web/components/common/feature-create-drawer/mode-selector.stories.d.ts +10 -0
- package/dist/src/presentation/web/components/common/feature-create-drawer/mode-selector.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/feature-create-drawer/mode-selector.stories.js +33 -0
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts +6 -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 +16 -4
- 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 +10 -4
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.d.ts +2 -0
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.js +12 -0
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/prototype-tab.d.ts +11 -0
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/prototype-tab.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/prototype-tab.js +34 -0
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/prototype-tab.stories.d.ts +16 -0
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/prototype-tab.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/prototype-tab.stories.js +70 -0
- package/dist/src/presentation/web/components/common/feature-node/derive-feature-state.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-node/derive-feature-state.js +2 -0
- package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts +10 -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 +12 -0
- 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 +7 -2
- 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 +6 -6
- package/dist/src/presentation/web/components/features/settings/workflow-settings-section.stories.js +3 -3
- package/dist/src/presentation/web/components/features/skills/add-skill-dialog.d.ts +10 -0
- package/dist/src/presentation/web/components/features/skills/add-skill-dialog.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/skills/add-skill-dialog.js +56 -0
- package/dist/src/presentation/web/components/features/skills/add-skill-dialog.stories.d.ts +16 -0
- package/dist/src/presentation/web/components/features/skills/add-skill-dialog.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/skills/add-skill-dialog.stories.js +66 -0
- package/dist/src/presentation/web/components/features/skills/auto-injected-skills-section.d.ts +8 -0
- package/dist/src/presentation/web/components/features/skills/auto-injected-skills-section.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/skills/auto-injected-skills-section.js +42 -0
- package/dist/src/presentation/web/components/features/skills/auto-injected-skills-section.stories.d.ts +16 -0
- package/dist/src/presentation/web/components/features/skills/auto-injected-skills-section.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/features/skills/auto-injected-skills-section.stories.js +69 -0
- package/dist/src/presentation/web/components/features/skills/skills-page-client.d.ts +3 -1
- package/dist/src/presentation/web/components/features/skills/skills-page-client.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/skills/skills-page-client.js +5 -3
- package/dist/src/presentation/web/components/features/skills/skills-page-client.stories.d.ts +1 -0
- package/dist/src/presentation/web/components/features/skills/skills-page-client.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/skills/skills-page-client.stories.js +27 -0
- package/dist/src/presentation/web/components/ui/toggle-group.d.ts +10 -0
- package/dist/src/presentation/web/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/toggle-group.js +22 -0
- package/dist/src/presentation/web/components/ui/toggle.d.ts +10 -0
- package/dist/src/presentation/web/components/ui/toggle.d.ts.map +1 -0
- package/dist/src/presentation/web/components/ui/toggle.js +26 -0
- package/dist/translations/ar/cli.json +26 -0
- package/dist/translations/ar/web.json +21 -13
- package/dist/translations/de/cli.json +26 -0
- package/dist/translations/de/web.json +41 -19
- package/dist/translations/en/cli.json +26 -0
- package/dist/translations/en/web.json +10 -2
- package/dist/translations/es/cli.json +26 -0
- package/dist/translations/es/web.json +22 -14
- package/dist/translations/fr/cli.json +26 -0
- package/dist/translations/fr/web.json +22 -14
- package/dist/translations/he/cli.json +26 -0
- package/dist/translations/he/web.json +22 -14
- package/dist/translations/pt/cli.json +26 -0
- package/dist/translations/pt/web.json +22 -14
- package/dist/translations/ru/cli.json +26 -0
- package/dist/translations/ru/web.json +22 -14
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +5 -5
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +3 -3
- package/web/.next/required-server-files.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +29 -29
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +1 -1
- 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/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/chat/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/@drawer/chat/page.js +1 -1
- 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/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +30 -30
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js +1 -1
- 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/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +121 -76
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +3 -2
- 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/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +121 -76
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +3 -2
- 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/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js +1 -1
- 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/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +1 -1
- 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/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/chat/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/chat/page.js +1 -1
- 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/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +30 -30
- package/web/.next/server/app/(dashboard)/create/page.js +1 -1
- 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/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +121 -76
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +3 -2
- 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/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +121 -76
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +3 -2
- 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/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/page.js +1 -1
- 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/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js +1 -1
- 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/build-manifest.json +3 -3
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +1 -1
- 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/page/build-manifest.json +3 -3
- 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/build-manifest.json +3 -3
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/_not-found/page.js +1 -1
- 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/features/page/build-manifest.json +3 -3
- package/web/.next/server/app/features/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/features/page.js +1 -1
- package/web/.next/server/app/features/page.js.nft.json +1 -1
- package/web/.next/server/app/features/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/settings/page/build-manifest.json +3 -3
- package/web/.next/server/app/settings/page/server-reference-manifest.json +9 -9
- package/web/.next/server/app/settings/page.js +3 -3
- 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/build-manifest.json +3 -3
- package/web/.next/server/app/skills/page/server-reference-manifest.json +52 -22
- package/web/.next/server/app/skills/page.js +3 -2
- 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/build-manifest.json +3 -3
- package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
- package/web/.next/server/app/tools/page.js +1 -1
- 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/build-manifest.json +3 -3
- package/web/.next/server/app/version/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/version/page.js +1 -1
- 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/403f9_next_dist_esm_build_templates_app-route_4d623b8e.js +1 -1
- package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_4d623b8e.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]__c78383b1._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__c78383b1._.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/{_0727935d._.js → 403f9_next_8a33ddee._.js} +2 -2
- package/web/.next/server/chunks/ssr/403f9_next_8a33ddee._.js.map +1 -0
- 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]__03c66352._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__03c66352._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__e88da4ee._.js → [root-of-the-server]__1cd4327c._.js} +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1cd4327c._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1f389e5d._.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]__403afc23._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__403afc23._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4ed9b909._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__684a868c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__684a868c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__69dd3217._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__69dd3217._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6c7d3936._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__7ffd3598._.js → [root-of-the-server]__92ffd5ee._.js} +3 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__92ffd5ee._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b020c17d._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b020c17d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b7b96453._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c1262d08._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c16bf5de._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c16bf5de._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__df550e85._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__df550e85._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__df5602bf._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__df5602bf._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e9f4767a._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e9f4767a._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_02e01240._.js +1 -1
- package/web/.next/server/chunks/ssr/_02e01240._.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/{_fe058119._.js → _0fd635d7._.js} +2 -2
- package/web/.next/server/chunks/ssr/_0fd635d7._.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/_18886033._.js +1 -1
- package/web/.next/server/chunks/ssr/_18886033._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_22e00a14._.js +1 -1
- package/web/.next/server/chunks/ssr/_22e00a14._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_30ddea9d._.js +9 -0
- package/web/.next/server/chunks/ssr/_30ddea9d._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{_a8b338ec._.js → _34d897da._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_a8b338ec._.js.map → _34d897da._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_45496654._.js +3 -0
- package/web/.next/server/chunks/ssr/_45496654._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_4cbb7f95._.js +1 -1
- package/web/.next/server/chunks/ssr/_4cbb7f95._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_5119a3df._.js +1 -1
- package/web/.next/server/chunks/ssr/_5119a3df._.js.map +1 -1
- 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/_6e79a2cc._.js +3 -0
- package/web/.next/server/chunks/ssr/_6e79a2cc._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_6f35fb9a._.js +3 -0
- package/web/.next/server/chunks/ssr/_6f35fb9a._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_a5a5901d._.js +1 -1
- package/web/.next/server/chunks/ssr/_a5a5901d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_ad09f271._.js +1 -1
- package/web/.next/server/chunks/ssr/_ad09f271._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_c3f595c6._.js +1 -1
- package/web/.next/server/chunks/ssr/_c3f595c6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_9b964adc._.js → _cac4abe6._.js} +2 -2
- package/web/.next/server/chunks/ssr/_cac4abe6._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_df737cce._.js +3 -0
- package/web/.next/server/chunks/ssr/_df737cce._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_ea9e1556._.js +1 -1
- package/web/.next/server/chunks/ssr/_ea9e1556._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f1ba9be6._.js +2 -2
- package/web/.next/server/chunks/ssr/_f1ba9be6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f33cd07e._.js +2 -2
- package/web/.next/server/chunks/ssr/_f33cd07e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f8b45233._.js +1 -1
- package/web/.next/server/chunks/ssr/_f8b45233._.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/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js +1 -1
- package/web/.next/server/chunks/ssr/f3a1f_components_common_control-center-drawer_repository-drawer-client_tsx_39a00c03._.js.map +1 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_1300ae39._.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules__pnpm_1300ae39._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_approve-feature_ts_9453ce8b._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_approve-feature_ts_9453ce8b._.js.map +1 -0
- 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 +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_895e5bfa._.js.map +1 -1
- 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_skills_8a174cac._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js.map +1 -0
- 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 +1 -1
- package/web/.next/server/chunks/ssr/translations_23dd5e7e._.js.map +1 -1
- package/web/.next/server/middleware-build-manifest.js +3 -3
- 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 +349 -211
- package/web/.next/static/chunks/0769c695d6b663c7.js +1 -0
- package/web/.next/static/chunks/09a25231e5fc1ab8.js +3 -0
- package/web/.next/static/chunks/{d6c39780c2f75ecd.js → 0f30a983f3467cd5.js} +1 -1
- package/web/.next/static/chunks/185e4f36cb6efb24.js +1 -0
- package/web/.next/static/chunks/{d5366257d6b9f855.js → 2a9af061f4fbe7f5.js} +1 -1
- package/web/.next/static/chunks/2ceebcc839ee0d4b.js +1 -0
- package/web/.next/static/chunks/{04c874f52a7cd435.js → 37f9543560c58ea6.js} +1 -1
- package/web/.next/static/chunks/{caf7d7e1b439b29e.js → 4219ddfde68a6d0b.js} +1 -1
- package/web/.next/static/chunks/{562c70303d910295.js → 478adf5d5156f002.js} +1 -1
- package/web/.next/static/chunks/52681a7f14138e48.js +1 -0
- package/web/.next/static/chunks/5743a9c1c63e5261.js +5 -0
- package/web/.next/static/chunks/5cf9745e2ef3837c.js +1 -0
- package/web/.next/static/chunks/5e20f692bbfcfb94.js +7 -0
- package/web/.next/static/chunks/74729cbad964be13.js +1 -0
- package/web/.next/static/chunks/{c5d89c12a73e0461.js → 9a78b4c5dcd28196.js} +2 -2
- package/web/.next/static/chunks/c80e8e3d0cf5baa6.css +1 -0
- package/web/.next/static/chunks/cc5fe8d1d9e1e519.js +5 -0
- package/web/.next/static/chunks/d5bf9c963b5346e1.js +1 -0
- package/web/.next/static/chunks/d60cee2e7318f425.js +1 -0
- package/web/.next/static/chunks/da565c85277c2461.js +1 -0
- package/web/.next/static/chunks/e93ae5725b0babeb.js +1 -0
- package/web/.next/static/chunks/fb89cf91c10b2e8b.js +1 -0
- package/web/.next/static/chunks/{021c9b0effb6d688.js → fc595d95626ac9bb.js} +1 -1
- package/web/.next/static/chunks/{turbopack-57bb0674e2cd1d31.js → turbopack-b38a68b1b1c41a87.js} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__20a36a42._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__20a36a42._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7ffd3598._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e88da4ee._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0727935d._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_0dc06d07._.js +0 -3
- package/web/.next/server/chunks/ssr/_0dc06d07._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_682fc996._.js +0 -9
- package/web/.next/server/chunks/ssr/_682fc996._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_6892e3b9._.js +0 -3
- package/web/.next/server/chunks/ssr/_6892e3b9._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_9b964adc._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_a1068852._.js +0 -3
- package/web/.next/server/chunks/ssr/_a1068852._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_fe058119._.js.map +0 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_12a7ede0._.js +0 -3
- package/web/.next/server/chunks/ssr/node_modules__pnpm_12a7ede0._.js.map +0 -1
- package/web/.next/static/chunks/20f7cc98a013b11c.js +0 -1
- package/web/.next/static/chunks/4cec255f2754e5ec.js +0 -1
- package/web/.next/static/chunks/5b7275374d2696b3.css +0 -1
- package/web/.next/static/chunks/647140fe96a7c88a.js +0 -1
- package/web/.next/static/chunks/6d6f70ff5151b8cb.js +0 -7
- package/web/.next/static/chunks/84792d40edc4b027.js +0 -5
- package/web/.next/static/chunks/8800875bb3d56192.js +0 -3
- package/web/.next/static/chunks/8d581adafe8d1dd0.js +0 -1
- package/web/.next/static/chunks/982aef195c118996.js +0 -1
- package/web/.next/static/chunks/a052c19c18e9eced.js +0 -1
- package/web/.next/static/chunks/a6b5e739d2f89c6b.js +0 -1
- package/web/.next/static/chunks/b0e2fb3d4eb42f3d.js +0 -1
- package/web/.next/static/chunks/c3ef3b892f7794ec.js +0 -1
- package/web/.next/static/chunks/dc134f3f58cdf850.js +0 -5
- package/web/.next/static/chunks/ff9e33615f5c856c.js +0 -1
- /package/web/.next/static/{lFiCv3l4nIAIpZmj6eehh → G895CgnbZl4YvWN_DaRC-}/_buildManifest.js +0 -0
- /package/web/.next/static/{lFiCv3l4nIAIpZmj6eehh → G895CgnbZl4YvWN_DaRC-}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{lFiCv3l4nIAIpZmj6eehh → G895CgnbZl4YvWN_DaRC-}/_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(85536);a.i(90370);var e=a.i(24640),f=a.i(69845),g=a.i(52313),h=a.i(88064),i=a.i(16605),j=a.i(50490),k=a.i(5698),l=a.i(98410),m=a.i(72016),n=a.i(33511),o=a.i(1585),p=a.i(25674);let q=(0,p.createServerReference)("601f8149b6a3cefafdb6a0fdf663945834e45c13b8",p.callServer,void 0,p.findSourceMapURL,"approveFeature");var r=a.i(66988),s=a.i(38603),t=a.i(90604);let u=(0,p.createServerReference)("705373258ab7ae5454cf4d012ed380b8f03e633e13",p.callServer,void 0,p.findSourceMapURL,"rejectFeature"),v=(0,p.createServerReference)("40cfd7a9e9835cdc067f1ef6a9ebabad4dd1474036",p.callServer,void 0,p.findSourceMapURL,"getFeatureArtifact"),w=(0,p.createServerReference)("40c1f2bc40f47326bf6026e4e06aef2f3fcae9d1f2",p.callServer,void 0,p.findSourceMapURL,"getResearchArtifact"),x=(0,p.createServerReference)("400043307add700a310caa62c59d8aa6d5711f1f1d",p.callServer,void 0,p.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(82934);a.i(77569);var G=a.i(65310),H=a.i(50488),I=a.i(63698),J=a.i(3195),K=a.i(62147),L=a.i(82697);let M="text-muted-foreground hover:bg-foreground/8 hover:text-foreground inline-flex size-8 items-center justify-center rounded-[3px] disabled:opacity-40";function N({loading:a,error:c,icon:d}){return a?(0,b.jsx)(h.Loader2,{className:"size-3.5 animate-spin"}):c?(0,b.jsx)(L.CircleAlert,{className:"text-destructive size-3.5"}):(0,b.jsx)(d,{className:"size-4"})}function O({actions:a,repositoryPath:d,worktreePath:e,showSpecs:f}){let[g,h]=(0,c.useState)(!1);return(0,b.jsx)(F.TooltipProvider,{delayDuration:300,children:(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",className:M,onClick:a.openInIde,disabled:a.ideLoading,"aria-label":"Open in IDE",children:(0,b.jsx)(N,{loading:a.ideLoading,error:a.ideError,icon:H.Code2})})}),(0,b.jsx)(F.TooltipContent,{side:"bottom",className:"text-xs",children:"Open in IDE"})]}),(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",className:M,onClick:a.openInShell,disabled:a.shellLoading,"aria-label":"Open terminal",children:(0,b.jsx)(N,{loading:a.shellLoading,error:a.shellError,icon:I.Terminal})})}),(0,b.jsx)(F.TooltipContent,{side:"bottom",className:"text-xs",children:"Open terminal"})]}),(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",className:M,onClick:a.openFolder,disabled:a.folderLoading,"aria-label":"Open folder",children:(0,b.jsx)(N,{loading:a.folderLoading,error:a.folderError,icon:J.FolderOpen})})}),(0,b.jsx)(F.TooltipContent,{side:"bottom",className:"text-xs",children:"Open folder"})]}),f?(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",className:M,onClick:a.openSpecsFolder,disabled:a.specsLoading,"aria-label":"Open specs",children:(0,b.jsx)(N,{loading:a.specsLoading,error:a.specsError,icon:K.FileText})})}),(0,b.jsx)(F.TooltipContent,{side:"bottom",className:"text-xs",children:"Open specs"})]}):null,(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",className:M,onClick:()=>{navigator.clipboard.writeText(e??d),h(!0),setTimeout(()=>h(!1),2e3)},"aria-label":"Copy path",children:g?(0,b.jsx)(m.Check,{className:"size-3.5 text-green-500"}):(0,b.jsx)(l.Copy,{className:"size-4"})})}),(0,b.jsx)(F.TooltipContent,{side:"bottom",className:"text-xs",children:g?"Copied!":"Copy path"})]})]})})}var P=a.i(72980),Q=a.i(56957),R=a.i(44981),S=a.i(25700);let T=(0,S.default)("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),U=(0,S.default)("map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]),V=(0,S.default)("file-check",[["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 15 2 2 4-4",key:"1grp1n"}]]);var W=a.i(65355),X=a.i(21084);let Y=(0,S.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 Z=a.i(12882),$=a.i(18615),_=a.i(3942);let aa=(0,S.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"}]]);var ab=a.i(41305);let ac=(0,p.createServerReference)("408b12f5789c9143769c5c6eaeb9a0b828d63414cf",p.callServer,void 0,p.findSourceMapURL,"getFeaturePhaseTimings"),ad=(0,p.createServerReference)("40df7933f40495cf8b904fe5f04bd66e0e9924848d",p.callServer,void 0,p.findSourceMapURL,"getFeaturePlan");a.i(54250);var ae=a.i(27039);let af=(0,a.i(42261).cva)("inline-block shrink-0",{variants:{size:{sm:"size-5",md:"size-8",lg:"size-12"}},defaultVariants:{size:"md"}}),ag=[{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 ah({className:a,size:c="md",duration:e=5,...f}){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,d.cn)(af({size:c}),a),...f,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:`${e}s`,repeatCount:"indefinite"}),ag.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"})]})]})]})}var ai=a.i(94132),aj=a.i(3410),ak=a.i(18948),al=a.i(58339),am=a.i(45242);let an=(0,S.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 ao=a.i(91498),ap=a.i(79620);a.i(307);var aq=a.i(30931),ar=a.i(39116);let as=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 at({onReject:a,onApprove:f,approveLabel:g,approveVariant:h="default",revisionPlaceholder:i,isProcessing:j=!1,isRejecting:k=!1,children:l,chatInput:n,onChatInputChange:o}){let{t:p}=(0,e.useTranslation)("web"),q="warning"===h,r=q?ao.AlertTriangle:m.Check,s=q?"bg-orange-500/85":"bg-blue-500/85",[t,u]=(0,c.useState)(""),v=n??t,w=o??u,x=(0,z.useSoundAction)("approve"),y=j||k,[A,B]=(0,c.useState)([]),[C,D]=(0,c.useState)(!1),[E,G]=(0,c.useState)(null),[H,I]=(0,c.useState)(!1),[J,K]=(0,c.useState)(!1),[L,M]=(0,c.useState)(!1),N=v.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(G(null),a)){if(b.size>0xa00000)return void G(`"${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&&!as.has(a))return void G(`File type "${a}" is not allowed`)}for(let b of a){let a=crypto.randomUUID();B(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"}));B(b=>b.filter(b=>b.id!==a)),G(b.error??"Upload failed");return}let e=await d.json();B(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{B(b=>b.filter(b=>b.id!==a)),G("Upload failed")}}},[]),T=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),P.current+=1,1===P.current&&D(!0)},[]),U=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),P.current-=1,0===P.current&&D(!1)},[]),V=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation()},[]),W=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),P.current=0,D(!1);let b=Array.from(a.dataTransfer.files);b.length>0&&S(b)},[S]),X=(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]),Y=(0,c.useCallback)(async()=>{try{let a=await (0,ar.pickFiles)();a&&B(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{}},[]),Z=(0,c.useCallback)(a=>{B(b=>b.filter(b=>b.id!==a))},[]),$=(0,c.useCallback)((a,b)=>{B(c=>c.map(c=>c.id===a?{...c,notes:b}:c))},[]),_=(0,c.useCallback)(()=>{w(""),B([]),G(null)},[w]),aa=(0,c.useCallback)(a=>{(a.ctrlKey||a.metaKey)&&"Enter"===a.key&&(a.preventDefault(),R.current?.requestSubmit())},[]),ab="u">typeof navigator&&/Mac/i.test(navigator.userAgent)?"⌘":"Ctrl";return(0,b.jsxs)("div",{className:"border-border shrink-0 border-t",children:[l,a?(0,b.jsx)(F.TooltipProvider,{delayDuration:400,children:(0,b.jsx)("form",{ref:R,onSubmit:function(b){b.preventDefault();let c=v.trim();if(O)x.play(),f(),_();else{if(!c||!a)return;a(c,A.filter(a=>!a.loading)),_()}},className:"p-3",children:(0,b.jsx)("div",{role:"region","aria-label":p("createDrawer.fileDropZone"),"data-drag-over":C?"true":"false",onDragEnter:T,onDragLeave:U,onDragOver:V,onDrop:W,className:(0,d.cn)("rounded-md border-2 border-transparent transition-colors",C&&"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)(ap.Textarea,{placeholder:i??"Ask AI to revise...","aria-label":i??"Ask AI to revise...",disabled:y,value:v,onChange:a=>w(a.target.value),onKeyDown:aa,onPaste:X,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"}),A.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:A.map(a=>(0,b.jsx)(aq.AttachmentChip,{name:a.name,size:a.size,mimeType:a.mimeType,path:a.path,onRemove:()=>Z(a.id),disabled:y,loading:a.loading,notes:a.notes,onNotesChange:b=>$(a.id,b)},a.id))}),E?(0,b.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:E}):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:[ab,"+Enter"]})," ",N?"reject":"approve"]}),(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:Y,disabled:y,"aria-label":p("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,b.jsx)(am.PaperclipIcon,{className:"h-4 w-4"})})}),(0,b.jsx)(F.TooltipContent,{side:"top",children:p("chat.attachFiles")})]}),(0,b.jsx)("div",{onMouseLeave:()=>I(!1),children:(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("button",{type:"submit",disabled:y,"data-testid":"drawer-action-submit",className:(0,d.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?`${q?"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,d.cn)("pointer-events-none absolute inset-0 transition-transform duration-300 ease-in-out",s),style:{transform:O?"translateX(0)":"translateX(100%)"}}),(0,b.jsxs)("span",{className:(0,d.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)(an,{className:"h-4 w-4 shrink-0"}),"Reject"]}),(0,b.jsxs)("span",{className:(0,d.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)(r,{className:"h-4 w-4 shrink-0"}),g]}),(0,b.jsx)("span",{className:(0,d.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 ${s} transition-opacity duration-300`,!N&&!H&&"pointer-events-none opacity-0"),onMouseEnter:()=>I(!0),children:(0,b.jsx)(ai.ChevronLeft,{className:"h-4 w-4 text-white"})})]})}),q?null:(0,b.jsx)(F.TooltipContent,{side:"top",children:O?g:p("drawerActionBar.sendRevisionFeedback")})]})})]})]})})})}):(0,b.jsx)("div",{className:"flex items-center gap-2 px-4 pb-4",children:(0,b.jsx)(ak.Button,{type:"button",className:"flex-1",disabled:y,onClick:()=>{x.play(),f()},children:g})})]})}function au({data:a,selections:e,onSelect:f,onApprove:g,onReject:h,isProcessing:i=!1,isRejecting:j=!1,showHeader:k=!1,chatInput:l,onChatInputChange:m}){let{question:n,context:o,questions:p,finalAction:q}=a,[r,s]=(0,c.useState)(0),t=(0,z.useSoundAction)("select"),u=(0,z.useSoundAction)("navigate"),v=p.length,w=r===v-1,x=p[r],y=(0,c.useMemo)(()=>Object.keys(e).length,[e]),A=(0,c.useCallback)((a,b)=>{t.play(),f(a,b),w||setTimeout(()=>s(a=>a+1),250)},[f,w,t]);return 0===v?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:[k?(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:n}),(0,b.jsx)("p",{className:"text-muted-foreground text-xs leading-relaxed",children:o})]})]}):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:[r+1,". ",x.question]}),(0,b.jsx)("div",{className:"mt-1.5 flex shrink-0 gap-1",children:p.map((a,c)=>(0,b.jsx)("button",{type:"button","aria-label":`Go to question ${c+1}`,className:(0,d.cn)("h-1.5 rounded-full transition-all duration-200",c===r?"bg-primary w-4":"w-1.5",c!==r&&e[a.id]?"bg-primary/50":"",c===r||e[a.id]?"":"bg-muted-foreground/25"),onClick:()=>{u.play(),s(c)}},a.id))})]}),(0,b.jsx)("div",{className:"space-y-2",children:x.options.map((a,c)=>{let f=e[x.id]===a.id,g=String.fromCharCode(65+c);return(0,b.jsx)("button",{type:"button",className:(0,d.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",f&&"border-primary bg-primary/5",a.isNew&&"animate-option-highlight"),disabled:i,onClick:()=>A(x.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:[g,"."]}),(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)(al.Badge,{className:"px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):(0,b.jsx)(al.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)(ak.Button,{type:"button",variant:"ghost",size:"sm",disabled:0===r||i,onClick:()=>{u.play(),s(a=>a-1)},children:[(0,b.jsx)(ai.ChevronLeft,{className:"me-1 h-4 w-4"}),"Previous"]}),w?null:(0,b.jsxs)(ak.Button,{type:"button",variant:"ghost",size:"sm",disabled:i,onClick:()=>{u.play(),s(a=>a+1)},children:[e[x.id]?"Next":"Skip",(0,b.jsx)(aj.ChevronRight,{className:"ms-1 h-4 w-4"})]})]})]}),(0,b.jsx)(at,{onReject:h,onApprove:()=>g(q.id),approveLabel:q.label,revisionPlaceholder:"Ask AI to refine requirements...",isProcessing:i,isRejecting:j,chatInput:l,onChatInputChange:m,children:(0,b.jsx)("div",{className:(0,d.cn)("bg-muted h-1.5 overflow-hidden",y>0&&y<v||i?"opacity-100":"opacity-0","transition-opacity duration-200"),"data-testid":"progress-bar-container",children:i?(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:`${v>0?y/v*100:0}%`},"data-testid":"progress-bar"})})})]})}var av=a.i(77610);let aw=(0,S.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"}]]),ax={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 ay({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)(al.Badge,{variant:"secondary",className:"bg-primary/10 text-primary shrink-0",children:a.decisionName}):null]}),a.rationale?(0,b.jsx)(av.default,{components:ax,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)(aj.ChevronRight,{className:`h-3.5 w-3.5 transition-transform ${e?"rotate-90":""}`}),(0,b.jsx)(aa,{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 az({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)(aw,{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)(ay,{decision:a,index:c},a.title))]})}var aA=a.i(69428);function aB({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)(al.Badge,{className:"shrink-0 px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):null]})]})]})})})}function aC({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)(aA.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)(aB,{item:a,index:c},a.question))]})}var aD=a.i(71238);let aE=(0,S.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 aF=a.i(92548),aG=a.i(53170);let aH=(0,S.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),aI=(0,S.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"}]]),aJ=(0,S.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 aK=a.i(9955),aL=a.i(71716),aM=a.i(67075),aN=a.i(58428),aN=aN,aO=a.i(46847);function aP({status:a}){switch(a){case aO.CiStatus.Success:return(0,b.jsxs)(al.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,b.jsx)(aM.CheckCircle2,{className:"me-1 h-3.5 w-3.5"}),"Passing"]});case aO.CiStatus.Pending:return(0,b.jsxs)(al.Badge,{className:"border-transparent bg-yellow-50 text-yellow-700 hover:bg-yellow-50",children:[(0,b.jsx)(h.Loader2,{className:"me-1 h-3.5 w-3.5 animate-spin"}),"Pending"]});case aO.CiStatus.Failure:return(0,b.jsxs)(al.Badge,{className:"border-transparent bg-red-50 text-red-700 hover:bg-red-50",children:[(0,b.jsx)(aN.default,{className:"me-1 h-3.5 w-3.5"}),"Failing"]})}}var aQ=a.i(38019);let aR=(0,S.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"}]]);var aS=a.i(65298);let aT={added:{icon:aQ.FilePlus,label:"A",className:"text-green-600"},modified:{icon:aS.FileEdit,label:"M",className:"text-amber-600"},deleted:{icon:aR,label:"D",className:"text-red-600"},renamed:{icon:aS.FileEdit,label:"R",className:"text-blue-600"}};function aU({status:a}){let c=aT[a],e=c.icon;return(0,b.jsx)(e,{className:(0,d.cn)("h-3.5 w-3.5 shrink-0",c.className)})}function aV({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,d.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,d.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 aW({file:a}){let[e,f]=(0,c.useState)(!1),g=a.path.split("/").pop()??a.path,h=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:()=>f(!e),className:"hover:bg-muted/50 flex w-full items-center gap-2 px-3 py-2 text-start",children:[(0,b.jsx)(aj.ChevronRight,{className:(0,d.cn)("text-muted-foreground h-3 w-3 shrink-0 transition-transform duration-150",e&&"rotate-90")}),(0,b.jsx)(aU,{status:a.status}),(0,b.jsx)("span",{className:"text-foreground min-w-0 flex-1 truncate text-xs",children:h?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[h,"/"]}),g]}):g}),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]})]}),e&&a.hunks.length>0?(0,b.jsx)("div",{className:"border-border overflow-x-auto border-t",children:a.hunks.map(a=>(0,b.jsx)(aV,{hunk:a},a.header))}):null]})}function aX({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)(K.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)(aW,{file:a},`${a.status}-${a.path}`))})]})}let aY={Screenshot:aI,Video:aJ,TestOutput:K.FileText,TerminalRecording:I.Terminal},aZ=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp"]),a$=new Set([".mp4",".webm",".mov"]);function a_({evidence:a}){var d,e;let f,[g,h]=(0,c.useState)(!0),i=aY[a.type]??aI,j=(f=(d=a.relativePath).lastIndexOf("."))>=0?d.slice(f).toLowerCase():"",k=(e=a.relativePath,`/api/evidence?path=${encodeURIComponent(e)}`),l="Screenshot"===a.type||aZ.has(j),m="Video"===a.type||a$.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)(aL.ChevronDown,{className:"text-muted-foreground h-3 w-3 shrink-0"}):(0,b.jsx)(aj.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)(aK.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)(a0,{url:k}):(0,b.jsx)("p",{className:"text-muted-foreground truncate font-mono text-[10px]",children:a.relativePath})}):null,null]})}function a0({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 a1({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)(aI,{className:"text-muted-foreground h-4 w-4"}),(0,b.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Evidence"}),(0,b.jsx)(al.Badge,{variant:"secondary",className:"text-[10px]",children:a.length})]}),(0,b.jsx)("ul",{className:"space-y-2",children:a.map(a=>(0,b.jsx)(a_,{evidence:a},`${a.type}-${a.relativePath}`))})]})})}function a2({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:n,evidence:o,hideCiStatus:p}=a,q=j?.mergeable===!1,r=q&&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)(aG.GitBranch,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,b.jsx)(al.Badge,{variant:"secondary",className:"font-mono text-[11px]",children:m.source}),(0,b.jsx)(aH,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,b.jsx)(al.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)(aD.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,b.jsx)(al.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)(al.Badge,{className:"border-transparent bg-orange-50 text-orange-700 hover:bg-orange-50",children:[(0,b.jsx)(ao.AlertTriangle,{className:"me-1 h-3.5 w-3.5"}),"Conflicts"]})]}):null,j.ciStatus&&!0!==p?(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)(aP,{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)(aF.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)(aE,{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"})]})]})]})}):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)(ao.AlertTriangle,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:n})]})}):null,o&&o.length>0?(0,b.jsx)(a1,{evidence:o}):null,l&&l.length>0?(0,b.jsx)(aX,{fileDiffs:l}):null]}),!c&&(0,b.jsx)(at,{onReject:e,onApprove:r,approveLabel:q?"Resolve Conflicts":"Approve Merge",approveVariant:q?"warning":"default",revisionPlaceholder:"Ask AI to revise before merging...",isProcessing:f,isRejecting:g,chatInput:h,onChatInputChange:i})]})}var a3=a.i(46168);let a4=(0,S.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"}]]),a5=(0,S.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var a6=a.i(28002),a7=a.i(32703);let a8=(0,S.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 a9=a.i(2807),ba=a.i(45670),bb=a.i(26633),bc=a.i(73998);let bd=(0,S.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"}]]),be=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function bf(a){let b=a.lastIndexOf(".");return b>=0&&be.has(a.slice(b).toLowerCase())}function bg(a){let b=a.lastIndexOf(".")>=0?a.slice(a.lastIndexOf(".")):"",c=bf(a)?`image/${b.slice(1).replace("jpg","jpeg")}`:"",d=new URLSearchParams({path:a,...c&&{mimeType:c}});return`/api/attachments/preview?${d.toString()}`}let bh=/(?:^|\s)@(\/[^\s]+)/g;function bi({text:a,attachmentPaths:c}){let d=function(a){let b=[],c=0;for(let d of a.matchAll(bh)){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)(bj,{path:a.path},`att-${a.path}`)}),f.map(a=>(0,b.jsx)(bj,{path:a},`extra-${a}`))]}):(0,b.jsx)("span",{className:"text-sm leading-relaxed",children:a})}function bj({path:a}){let d=a.split("/").pop()??a,[e,f]=(0,c.useState)(!1);return bf(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)(bd,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"truncate",children:d})]}):(0,b.jsxs)(ba.Dialog,{children:[(0,b.jsx)(ba.DialogTrigger,{asChild:!0,children:(0,b.jsx)("img",{src:bg(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)(ba.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)(bb.VisuallyHidden.Root,{children:(0,b.jsxs)(ba.DialogTitle,{children:["Preview: ",d]})}),(0,b.jsx)("div",{className:"relative bg-black/90",children:(0,b.jsx)("img",{src:bg(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:bg(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)(bc.DownloadIcon,{className:"h-4 w-4"})})]})]})]}):(0,b.jsx)("a",{href:bg(a),download:d,"data-testid":"inline-attachment-file",className:"text-primary text-sm underline underline-offset-2",children:d})}a.i(69029);var bk=a.i(5623),bl=a.i(61781),bm=a.i(17606),bn=a.i(83852);function bo(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 bp=new Set(["pending","action-required","error"]);function bq(a){return a?.agentType?{agentType:a.agentType,modelId:a.modelId??""}:null}function br({icon:a,title:c,children:d}){return(0,b.jsxs)("div",{className:"px-3 pt-4 pb-1",children:[(0,b.jsxs)("div",{className:"text-foreground mb-2 flex items-center gap-1.5 text-sm font-semibold tracking-wider uppercase",children:[(0,b.jsx)(a,{className:"size-4 opacity-50"}),c]}),d]})}function bs({children:a,className:c}){return(0,b.jsx)("div",{className:(0,d.cn)("bg-muted/60 rounded-md border border-transparent p-3",c),children:a})}function bt({label:a,children:c}){return(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-foreground/40 text-[11px] font-medium tracking-wider uppercase",children:a}),(0,b.jsx)("span",{className:"text-sm leading-snug",children:c})]})}function bu({on:a,label:c}){return(0,b.jsxs)("span",{className:(0,d.cn)("inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium",a?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":"bg-foreground/[0.04] text-foreground/25"),children:[a?(0,b.jsx)(m.Check,{className:"size-3"}):(0,b.jsx)(a9.X,{className:"size-3"}),c]})}let bv={[aO.PrStatus.Open]:"text-blue-600 dark:text-blue-400",[aO.PrStatus.Merged]:"text-purple-600 dark:text-purple-400",[aO.PrStatus.Closed]:"text-red-600 dark:text-red-400"};function bw({data:a,pinnedConfig:e,syncStatus:f,syncLoading:g,syncError:h,onRefreshSync:i,onRebaseOnMain:j,rebaseLoading:k,rebaseError:l}){var m;let n,o,p,q,r,s,t="maintain"===a.lifecycle,u=function(a){let[b,d]=(0,c.useState)(null),e=(0,c.useRef)(null);return(0,c.useEffect)(()=>a?(d(bo(Math.max(0,Date.now()-a))),e.current=setInterval(()=>{d(bo(Math.max(0,Date.now()-a)))},1e3),()=>{e.current&&clearInterval(e.current)}):void d(null),[a]),b}("running"===a.state||"action-required"===a.state?a.startedAt:void 0),v=ae.featureNodeStateConfig[a.state],w=!!a.summary&&!(a.userQuery&&a.summary?.trim()===a.userQuery.trim());return(0,b.jsxs)("div",{"data-testid":"feature-drawer-status",className:"pb-4",children:[!t&&a.progress>0?(0,b.jsx)("div",{"data-testid":"feature-drawer-progress",className:"px-3 pb-2",children:(0,b.jsx)("div",{className:"bg-foreground/[0.06] h-1.5 w-full overflow-hidden rounded-full",children:(0,b.jsx)("div",{className:(0,d.cn)("h-full rounded-full transition-all",v.progressClass),style:{width:`${a.progress}%`}})})}):null,a.oneLiner||a.userQuery||w?(0,b.jsx)(br,{icon:a5,title:"Description",children:(0,b.jsxs)(bs,{className:"flex flex-col gap-2",children:[a.oneLiner?(0,b.jsx)(bt,{label:"One-Liner",children:a.oneLiner}):null,a.userQuery?(0,b.jsx)(bt,{label:"Query",children:(0,b.jsx)(bi,{text:a.userQuery})}):null,w?(0,b.jsx)(bt,{label:"Summary",children:(0,b.jsx)("span",{className:"leading-snug",children:a.summary})}):null]})}):null,a.pr?(0,b.jsx)(br,{icon:aF.GitCommitHorizontal,title:"Pull Request",children:(0,b.jsx)(bs,{children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("a",{href:a.pr.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary inline-flex items-center gap-1 text-sm font-semibold hover:underline",children:["#",a.pr.number," ",(0,b.jsx)(aD.ExternalLink,{className:"size-3"})]}),(0,b.jsx)("span",{className:(0,d.cn)("text-xs font-semibold",bv[a.pr.status]),children:a.pr.status}),!1===a.pr.mergeable?(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-orange-600 dark:text-orange-400",children:[(0,b.jsx)(ao.AlertTriangle,{className:"size-3 shrink-0"})," Conflicts"]}):null,a.pr.ciStatus&&!0!==a.hideCiStatus?(0,b.jsx)(aP,{status:a.pr.ciStatus}):null,a.pr.commitHash?(0,b.jsx)("code",{className:"text-foreground/40 ml-auto font-mono text-[11px]",children:a.pr.commitHash.slice(0,7)}):null]})})}):null,(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-2 px-3 pb-1",children:[a.branch?(0,b.jsx)(bs,{children:(0,b.jsxs)(bt,{label:"Branch",children:[(0,b.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,b.jsx)(aG.GitBranch,{className:"text-foreground/30 size-3 shrink-0"}),(0,b.jsx)("code",{className:"font-mono text-[11px]",children:a.branch})]}),a.baseBranch?(0,b.jsxs)("span",{className:"text-foreground/30 block text-[10px]",children:["from ",a.baseBranch]}):null]})}):null,a.agentType||a.modelId?(0,b.jsx)(bs,{children:(0,b.jsx)(bt,{label:"Agent",children:(0,b.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[a.agentType?(n=(0,bm.getAgentTypeIcon)(a.agentType),(0,b.jsx)(n,{className:"size-3.5 shrink-0 opacity-50"})):null,a.agentType?(0,b.jsx)("span",{children:bm.agentTypeLabels[a.agentType]??a.agentType}):null,a.agentType&&a.modelId?(0,b.jsx)("span",{className:"text-foreground/20",children:"/"}):null,a.modelId?(0,b.jsx)("span",{className:"text-foreground/50 text-[12px]",children:(0,bn.getModelMeta)(a.modelId).displayName||a.modelId}):null]})})}):null,a.createdAt?(0,b.jsx)(bs,{children:(0,b.jsx)(bt,{label:"Created",children:(0,b.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,b.jsx)(a3.Clock,{className:"text-foreground/30 size-3 shrink-0"}),(m=a.createdAt,o=Date.now(),(s=Math.floor((r=Math.floor((q=Math.floor((o-(p="string"==typeof m?new Date(m).getTime():m))/6e4))/60))/24))>30?new Date(p).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):s>0?`${s}d ago`:r>0?`${r}h ago`:q>0?`${q}m ago`:"just now")]})})}):null,a.fastMode?(0,b.jsx)(bs,{children:(0,b.jsx)(bt,{label:"Mode",children:(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 text-amber-600 dark:text-amber-400",children:[(0,b.jsx)(_.Zap,{className:"size-3.5"})," Fast"]})})}):null,a.runtime||u?(0,b.jsx)(bs,{children:(0,b.jsx)(bt,{label:a.runtime?"Runtime":"Elapsed",children:(0,b.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,b.jsx)(a3.Clock,{className:"text-foreground/30 size-3 shrink-0"}),a.runtime??u]})})}):null]}),a.blockedBy||a.errorMessage?(0,b.jsx)(br,{icon:ao.AlertTriangle,title:"Issues",children:(0,b.jsxs)(bs,{className:"border-destructive/20 bg-destructive/5",children:[a.blockedBy?(0,b.jsx)(bt,{label:"Blocked By",children:a.blockedBy}):null,a.errorMessage?(0,b.jsx)(bt,{label:"Error",children:(0,b.jsx)("span",{className:"text-destructive",children:a.errorMessage})}):null]})}):null,j&&a.branch&&i?(0,b.jsx)(br,{icon:a6.RefreshCw,title:"Branch Sync",children:(0,b.jsx)(bx,{syncStatus:f??null,syncLoading:g??!1,syncError:h??null,onRefreshSync:i,onRebaseOnMain:j,rebaseLoading:k??!1,rebaseError:l??null})}):null,(0,b.jsx)(bz,{data:a,pinnedConfig:e})]})}function bx({syncStatus:a,syncLoading:c,syncError:f,onRefreshSync:g,onRebaseOnMain:h,rebaseLoading:i,rebaseError:j}){let{t:k}=(0,e.useTranslation)("web"),l=null!=a&&a.behind>0,m=a?.behind===0,n=a?.baseBranch??"main";return(0,b.jsxs)(bs,{children:[(0,b.jsxs)("div",{"data-testid":"branch-sync-status",className:"flex items-center justify-between",children:[(0,b.jsx)("div",{className:"flex items-center gap-1.5 text-[13px]",children:c&&!a?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(ah,{size:"sm"}),(0,b.jsx)("span",{className:"text-foreground/40",children:"Checking..."})]}):f?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(ao.AlertTriangle,{className:"size-3.5 text-red-500"}),(0,b.jsx)("span",{className:"text-destructive text-xs",children:f})]}):i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(ah,{size:"sm"}),(0,b.jsxs)("span",{children:["Rebasing on ",(0,b.jsx)("code",{className:"font-mono text-[11px]",children:n}),"..."]})]}):l?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(ao.AlertTriangle,{className:"size-3.5 text-orange-500"}),(0,b.jsxs)("span",{children:[a.behind," behind ",(0,b.jsx)("code",{className:"font-mono text-[11px]",children:n}),a.ahead>0?(0,b.jsxs)("span",{className:"text-foreground/30 ml-1 text-[11px]",children:["· ",a.ahead," ahead"]}):null]})]}):m?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(aM.CheckCircle2,{className:"size-3.5 text-green-500"}),(0,b.jsxs)("span",{children:["Up to date · ",(0,b.jsx)("code",{className:"font-mono text-[11px]",children:n}),a.ahead>0?(0,b.jsxs)("span",{className:"text-foreground/30 ml-1 text-[11px]",children:["· ",a.ahead," ahead"]}):null]})]}):null}),(a||f)&&!i?(0,b.jsx)("button",{onClick:g,disabled:c,className:"text-foreground/30 hover:text-foreground/60 hover:bg-foreground/5 inline-flex size-6 items-center justify-center rounded-sm disabled:opacity-50","aria-label":k("branchSyncStatus.refreshSyncStatus"),children:(0,b.jsx)(a6.RefreshCw,{className:(0,d.cn)("size-3",c&&"animate-spin")})}):null]}),l&&!i?(0,b.jsx)("div",{className:"pt-2",children:(0,b.jsx)(bk.ActionButton,{label:k("branchSyncStatus.rebaseOnMain"),onClick:h,loading:!1,error:!!j,icon:Y,variant:"outline",size:"sm"})}):null,j?(0,b.jsx)("p",{className:"text-destructive pt-1 text-[11px]",children:j}):null]})}function by({pinnedConfig:a}){let c=(0,bm.getAgentTypeIcon)(a.agentType),d=a.modelId?(0,bn.getModelMeta)(a.modelId).displayName||a.modelId:"No model selected";return(0,b.jsxs)(bs,{"data-testid":"feature-pinned-config-card",className:"flex flex-col gap-3",children:[(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsxs)("div",{className:"text-foreground/40 flex items-center gap-1 text-[10px] font-medium tracking-wider uppercase",children:[(0,b.jsx)(a7.Settings,{className:"size-3"})," Pinned Execution"]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)(c,{className:"size-4 shrink-0 opacity-60"}),(0,b.jsx)("span",{className:"font-medium",children:bm.agentTypeLabels[a.agentType]??a.agentType}),(0,b.jsx)("span",{className:"text-foreground/20",children:"/"}),(0,b.jsx)("span",{className:"text-foreground/60",children:d})]}),(0,b.jsx)("p",{className:"text-muted-foreground text-xs",children:"Change the pinned agent and model before the next start, approval, or retry."})]}),(0,b.jsx)(bl.AgentModelPicker,{initialAgentType:a.agentType,initialModel:a.modelId,agentType:a.agentType,model:a.modelId,onSave:a.onSave,saveError:a.error,saving:a.saving,disabled:a.saving,mode:"settings"})]})}function bz({data:a,pinnedConfig:c}){var d;let e=null!=a.approvalGates||null!=a.push||null!=a.openPr||null!=a.ciWatchEnabled||null!=a.enableEvidence||null!=a.forkAndPr||null!=a.commitSpecs,f=null!=c&&(d=a.state,bp.has(d));return e||f?(0,b.jsx)(br,{icon:a7.Settings,title:"Settings",children:(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[f?(0,b.jsx)(by,{pinnedConfig:c}):null,e?(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[a.approvalGates?(0,b.jsxs)(bs,{children:[(0,b.jsxs)("div",{className:"text-foreground/40 mb-1.5 flex items-center gap-1 text-[10px] font-medium tracking-wider uppercase",children:[(0,b.jsx)(a8,{className:"size-3"})," Approve"]}),(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)(bu,{on:a.approvalGates.allowPrd,label:"PRD"}),(0,b.jsx)(bu,{on:a.approvalGates.allowPlan,label:"Plan"}),(0,b.jsx)(bu,{on:a.approvalGates.allowMerge,label:"Merge"})]})]}):null,null!=a.enableEvidence?(0,b.jsxs)(bs,{children:[(0,b.jsxs)("div",{className:"text-foreground/40 mb-1.5 flex items-center gap-1 text-[10px] font-medium tracking-wider uppercase",children:[(0,b.jsx)(a4,{className:"size-3"})," Evidence"]}),(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)(bu,{on:a.enableEvidence,label:"Collect"}),null!=a.commitEvidence?(0,b.jsx)(bu,{on: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)(bs,{children:[(0,b.jsxs)("div",{className:"text-foreground/40 mb-1.5 flex items-center gap-1 text-[10px] font-medium tracking-wider uppercase",children:[(0,b.jsx)(aG.GitBranch,{className:"size-3"})," Git"]}),(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[null!=a.push?(0,b.jsx)(bu,{on:a.push,label:"Push"}):null,null!=a.openPr?(0,b.jsx)(bu,{on:a.openPr,label:"PR"}):null,null!=a.ciWatchEnabled?(0,b.jsx)(bu,{on:a.ciWatchEnabled,label:"Watch"}):null,null!=a.commitSpecs?(0,b.jsx)(bu,{on:a.commitSpecs,label:"Specs"}):null,null!=a.forkAndPr?(0,b.jsx)(bu,{on:a.forkAndPr,label:"Fork"}):null]})]}):null]}):null]})}):null}let bA=(0,S.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 aN=aN,bB=a.i(93866),bC=a.i(7421);let bD=(0,S.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"}]]),bE=(0,S.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 bF(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 bG(a){return a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}K`:String(a)}function bH(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 bI(a){return a>=1?`$${a.toFixed(2)}`:a>=.01?`$${a.toFixed(3)}`:`$${a.toFixed(4)}`}let bJ={analyze:"Analyzing",requirements:"Requirements",research:"Researching",plan:"Planning",implement:"Implementing",rebase:"Rebasing","fast-implement":"Fast Implement",evidence:"Evidence",validate:"Validating",repair:"Repairing",merge:"Merging"},bK={"run:started":{label:"started",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:j.Play},"run:resumed":{label:"resumed",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:$.RotateCcw},"run:completed":{label:"completed",colorClass:"text-emerald-600",bgClass:"bg-emerald-50 dark:bg-emerald-950/30",icon:aM.CheckCircle2},"run:failed":{label:"failed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:aN.default},"run:stopped":{label:"stopped",colorClass:"text-amber-600",bgClass:"bg-amber-50 dark:bg-amber-950/30",icon:k.Square},"run:crashed":{label:"crashed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:aN.default},"run:rejected":{label:"rejected",colorClass:"text-orange-600",bgClass:"bg-orange-50 dark:bg-orange-950/30",icon:bB.Ban}};function bL(a){return a.startsWith("run:")}function bM({timings:a,loading:d,error:f,rejectionFeedback:g}){let{t:i}=(0,e.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(d)return(0,b.jsx)("div",{"data-testid":"activity-tab-loading",className:"flex items-center justify-center p-8",children:(0,b.jsx)(h.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)(a3.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=>!bL(a.phase)),l=Math.max(...k.map(a=>bF(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,g),n=m.length>1,o=k.reduce((a,b)=>a+bF(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)(bN,{iteration:a,showHeader:n,maxDurationMs:l,now:j},a.number))}),o>0?(0,b.jsx)(bR,{totalExecMs:o,totalWaitMs:p,totalInputTokens:q,totalOutputTokens:r,totalCostUsd:s}):null]})}function bN({iteration:a,showHeader:c,maxDurationMs:d,now:e}){let f=function(a){let b=[...a.timings].reverse().find(a=>bL(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(bL(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=>!bL(a.phase)&&a.errorMessage);d=b?.errorMessage??c.errorMessage}return(0,b.jsx)(bO,{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)(bP,{timing:c,maxDurationMs:d,now:e},`${c.agentRunId}-${c.phase}-${c.startedAt}`)})]})]})}function bO({timing:a,message:c,attachments:d,isFirst:e,isLast:f}){let g,h=bK[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:bH(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)(Z.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)(bi,{text:"",attachmentPaths:d})}):null]})}function bP({timing:a,maxDurationMs:d,now:f}){let{t:g}=(0,e.useTranslation)("web"),h=a.phase.includes(":")?a.phase.split(":")[0]:a.phase,i=a.phase.includes(":")?a.phase.split(":")[1]:null,j=null!==i,k=i?.startsWith("phase-")??!1,n=bJ[h]??h,o=k?`Phase ${i.replace("phase-","")}`:null!==i?`${n} #${i}`:n,p=bF(a,f),q=!a.completedAt&&!!a.startedAt,r=q?15:2,s=d>0?Math.max(r,p/d*100):r,t=a.completedAt?k?"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)(m.Check,{className:"h-3.5 w-3.5 text-emerald-500"}):(0,b.jsx)(l.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:bo(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:bH(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)(_.Zap,{className:"h-3 w-3 opacity-50"}),bG(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)(bA,{className:"h-3 w-3 opacity-50"}),bI(a.costUsd)]}):null]}),null!=a.approvalWaitMs&&a.approvalWaitMs>0?(0,b.jsx)(bQ,{timing:a,maxDurationMs:d}):null]})}function bQ({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)(bC.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:bo(d)})]})}function bR({totalExecMs:a,totalWaitMs:c,totalInputTokens:d,totalOutputTokens:f,totalCostUsd:g}){let{t:h}=(0,e.useTranslation)("web"),i=d+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)(bS,{icon:a3.Clock,label:h("activityTab.execution"),value:bo(a)}),(0,b.jsx)(bS,{icon:bC.Timer,label:h("activityTab.wait"),value:c>0?bo(c):"n/a"}),(0,b.jsx)(bS,{icon:a3.Clock,label:"Wall-clock",value:c>0?bo(a+c):bo(a)}),(0,b.jsx)(bS,{icon:bA,label:h("activityTab.cost"),value:g>0?bI(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)(_.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:bG(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)(bD,{className:"h-3 w-3 text-blue-500 opacity-60"}),bG(d)]}),(0,b.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,b.jsx)(bE,{className:"h-3 w-3 text-emerald-500 opacity-60"}),bG(f)]})]})]}):(0,b.jsx)("span",{className:"text-muted-foreground/40 text-sm italic tabular-nums",children:"n/a"})]})]})]})}function bS({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 bT=a.i(45449),bU=a.i(44447);let bV=(0,S.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"}]]),bW=(0,S.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"}]]),bX=(0,S.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"}]]),bY=/^\[(\d{4}-\d{2}-\d{2}T[\d:.]+Z?)\]\s+(?:\[([^\]]+)\]\s+)?(?:\[([^\]|]+)(?:\|([^\]]+))?\]\s+)?(.*)$/,bZ=/^\[(tool-result|tool|text|delta|result|tokens|cmd|file|turn|thread|error|event|raw|WORKER)\]\s*(.*)/;function b$(a){let b=a.match(bY);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(bZ),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 b_({content:a}){let d=(0,c.useMemo)(()=>a?a.split("\n").filter(a=>a.trim().length>0).map(b$):[],[a]);return 0===d.length?null:(0,b.jsx)("div",{className:"flex flex-col",children:d.map((a,c)=>(0,b.jsx)(b0,{line:a},c))})}function b0({line:a}){switch(a.tag){case"tool":return(0,b.jsx)(b3,{line:a});case"tool-result":return(0,b.jsx)(b9,{line:a});case"text":case"delta":return(0,b.jsx)(b5,{line:a});case"result":return(0,b.jsx)(b6,{line:a});case"tokens":case"turn":return(0,b.jsx)(b7,{line:a});case"cmd":return(0,b.jsx)(ca,{line:a});case"file":return(0,b.jsx)(cb,{line:a});case"thread":case"event":case"info":return(0,b.jsx)(cd,{line:a});case"error":return(0,b.jsx)(cc,{line:a});case"worker":return(0,b.jsx)(b8,{line:a});default:return(0,b.jsx)(ce,{line:a})}}function b1({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 b2({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 b3({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)(b1,{value:a.timestamp}),(0,b.jsx)(b2,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(b4,{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 b4({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)(K.FileText,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"write"===c||"edit"===c?(0,b.jsx)(bX,{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 b5({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)(b1,{value:a.timestamp}),(0,b.jsx)(b2,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(Z.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 b6({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)(b1,{value:a.timestamp}),(0,b.jsx)(b2,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(aM.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 b7({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)(b1,{value:a.timestamp}),(0,b.jsx)(b2,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(bV,{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 b8({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)(b1,{value:a.timestamp}),(0,b.jsx)(b2,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(bW,{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 b9({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)(b1,{value:a.timestamp}),(0,b.jsx)(b2,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(aH,{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 ca({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)(b1,{value:a.timestamp}),(0,b.jsx)(b2,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(j.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 cb({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)(b1,{value:a.timestamp}),(0,b.jsx)(b2,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(bX,{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 cc({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)(b1,{value:a.timestamp}),(0,b.jsx)(b2,{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 cd({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)(b1,{value:a.timestamp}),(0,b.jsx)(b2,{phase:a.phase}),(0,b.jsx)("span",{className:"text-muted-foreground min-w-0 text-xs break-all",children:a.message})]})}function ce({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 cf({content:a,isConnected:d,error:f}){let{t:g}=(0,e.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 ${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:()=>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)(K.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)(bU.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)(bT.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)(b_,{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:g("logTab.noLogOutput")}),d?(0,b.jsx)("p",{className:"text-muted-foreground text-xs",children:"Waiting for log data..."}):null]})}let cg=(0,S.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 ch=a.i(4019),ci=a.i(83886);let cj=(0,S.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"}]]),ck={Todo:{icon:ch.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Todo"},"Work in Progress":{icon:h.Loader2,colorClass:"text-blue-600",borderClass:"border-blue-200",spinning:!0,label:"In Progress"},Done:{icon:m.Check,colorClass:"text-emerald-600",borderClass:"border-emerald-200",label:"Done"},Review:{icon:ci.Eye,colorClass:"text-amber-600",borderClass:"border-amber-200",label:"Review"}},cl={icon:ch.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Unknown"};function cm({tasks:a}){let{t:c}=(0,e.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)(cn,{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)(cp,{task:a,index:c},a.title||`task-${c}`))})]})}function cn({tasks:a}){let{t:d}=(0,e.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)(co,{icon:m.Check,label:d("taskProgress.done"),count:f.done,className:"text-emerald-600"}):null,f.wip>0?(0,b.jsx)(co,{icon:h.Loader2,label:d("taskProgress.inProgress"),count:f.wip,className:"text-blue-600"}):null,f.review>0?(0,b.jsx)(co,{icon:ci.Eye,label:d("taskProgress.review"),count:f.review,className:"text-amber-600"}):null,f.todo>0?(0,b.jsx)(co,{icon:ch.Circle,label:d("taskProgress.todo"),count:f.todo,className:"text-muted-foreground"}):null]})]})}function co({icon:a,label:c,count:e,className:f}){return(0,b.jsxs)("span",{className:(0,d.cn)("flex items-center gap-1 text-xs",f),children:[(0,b.jsx)(a,{className:"h-3 w-3"}),e," ",c]})}function cp({task:a,index:e}){let[f,g]=(0,c.useState)(!1),h=ck[a.state]??cl,i=h.icon,j=a.actionItems.length>0,k=(0,c.useCallback)(()=>{j&&g(a=>!a)},[j]);return(0,b.jsxs)("div",{"data-testid":`task-card-${e}`,className:(0,d.cn)("rounded-lg border",h.borderClass),children:[(0,b.jsxs)("button",{type:"button",onClick:k,disabled:!j,className:(0,d.cn)("flex w-full items-start gap-2 px-3 py-2.5 text-start",j&&"hover:bg-muted/50 cursor-pointer transition-colors"),children:[(0,b.jsx)(i,{className:(0,d.cn)("mt-0.5 h-4 w-4 shrink-0",h.colorClass,h.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,d.cn)("text-sm font-medium",h.colorClass),children:a.title}),a.description?(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:a.description}):null]}),j?(0,b.jsx)(aj.ChevronRight,{className:(0,d.cn)("text-muted-foreground mt-0.5 h-4 w-4 shrink-0 transition-transform",f&&"rotate-90")}):null]}),f&&j?(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)(cq,{item:a},a.name||`ai-${c}`))})}):null]})}function cq({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)(aM.CheckCircle2,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-emerald-600"}):(0,b.jsx)(cj,{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)(cr,{criterion:a},a.description||`ac-${c}`))}):null]})}function cr({criterion:a}){return(0,b.jsxs)("div",{"data-testid":"acceptance-criterion",className:"flex items-start gap-1.5",children:[a.verified?(0,b.jsx)(m.Check,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-600"}):(0,b.jsx)(ch.Circle,{className:"text-muted-foreground mt-0.5 h-3 w-3 shrink-0"}),(0,b.jsx)("span",{className:(0,d.cn)("text-[11px]",a.verified?"text-muted-foreground line-through":"text-foreground"),children:a.description})]})}let cs={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 ct({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)(h.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)(al.Badge,{className:cs[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)(cm,{tasks:a.tasks})]}):(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,b.jsx)(cg,{className:"text-muted-foreground h-8 w-8"}),(0,b.jsx)("p",{className:"text-muted-foreground text-sm",children:"No plan created yet"})]})}var cu=a.i(61544);function cv(){return{data:null,loading:!1,error:null}}let cw=[{key:"overview",label:"Overview",icon:Q.LayoutDashboard},{key:"activity",label:"Activity",icon:R.Activity},{key:"log",label:"Log",icon:T},{key:"plan",label:"Plan",icon:U},{key:"prd-review",label:"PRD Review",icon:V},{key:"tech-decisions",label:"Tech Decisions",icon:W.Cpu},{key:"product-decisions",label:"Product",icon:X.Package},{key:"merge-review",label:"Merge Review",icon:Y},{key:"chat",label:"Chat",icon:Z.MessageSquare}],cx={activity:async function(a){let b=await ac(a);if("error"in b)throw Error(b.error);return{timings:b.timings,rejectionFeedback:b.rejectionFeedback}},plan:async function(a){let b=await ad(a);if("error"in b)throw Error(b.error);return b.plan}};function cy({featureName:a,headerContent:e,featureNode:g,featureId:i,initialTab:l,urlTab:m,prdData:n,prdSelections:o,onPrdSelect:p,onPrdApprove:q,onPrdReject:r,isPrdLoading:s,techData:t,onTechApprove:u,onTechReject:v,isTechLoading:w,productData:x,mergeData:y,onMergeApprove:z,onMergeReject:A,isMergeLoading:B,syncStatus:C,syncLoading:D,syncError:E,onRefreshSync:G,onRebaseOnMain:H,rebaseLoading:I,rebaseError:J,isRejecting:K,chatInput:L,onChatInputChange:M,pinnedConfig:N,continuationActionsDisabled:O=!1,sseEvents:Q,interactiveAgentEnabled:R=!0,onRetry:S,onStop:T,onStart:U}){let V,W=(0,f.usePathname)(),X=(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,R),[g,R]),Y=(0,c.useMemo)(()=>cw.filter(a=>X.includes(a.key)).map(a=>"merge-review"===a.key&&"maintain"===g.lifecycle?{...a,label:"Merge History"}:a),[X,g.lifecycle]),Z=(0,c.useMemo)(()=>{let a=W.match(/^(\/feature\/[^/]+)/);return a?a[1]:W},[W]),ac=(0,c.useMemo)(()=>m&&X.includes(m)?m:l&&X.includes(l)?l:"overview",[]),[ad,af]=(0,c.useState)(ac),ag=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"===ad?i:null),{tabs:ai,fetchTab:aj,refreshTab:ak}=function(a,b){let d=Object.keys(b),[e,f]=(0,c.useState)(()=>{let a={};for(let b of d)a[b]=cv();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]=cv();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])}}(i,cx),al=(0,c.useRef)(!1);(0,c.useEffect)(()=>{if(!al.current)return;al.current=!1;let a="overview"===ad?Z:`${Z}/${ad}`;a!==W&&window.history.pushState(null,"",a)},[ad,Z,W]);let am=(0,c.useRef)(W);(0,c.useEffect)(()=>{if(am.current===W||(am.current=W,al.current))return;let a=W.split("/"),b=a.length>=4?a[3]:void 0,c=b&&X.includes(b)?b:"overview";c!==ad&&(af(c),("activity"===c||"plan"===c)&&aj(c))},[W]);let an=(0,c.useRef)(!1);(0,c.useEffect)(()=>{if(!an.current&&(an.current=!0,!m&&"overview"!==ac)){let a=`${Z}/${ac}`;a!==W&&window.history.replaceState(null,"",a)}},[]);let ao=(0,c.useRef)(!1);(0,c.useEffect)(()=>{ao.current||(ao.current=!0,("activity"===ad||"plan"===ad)&&aj(ad))},[ad,aj]);let ap=(0,c.useRef)(i);(0,c.useEffect)(()=>{ap.current!==i&&(ap.current=i,af("overview"))},[i]);let aq=(0,c.useRef)(l);(0,c.useEffect)(()=>{if(aq.current!==l&&l&&X.includes(l)){aq.current=l,af(l),("activity"===l||"plan"===l)&&aj(l);let a="overview"===l?Z:`${Z}/${l}`;a!==window.location.pathname&&window.history.replaceState(null,"",a)}},[l,X,Z,aj]),(0,c.useEffect)(()=>{X.includes(ad)||(af("overview"),window.location.pathname!==Z&&window.history.replaceState(null,"",Z))},[X,ad,Z]);let ar=(0,c.useRef)(ad);ar.current=ad;let as=(0,c.useRef)(0);(0,c.useEffect)(()=>{if(!Q||0===Q.length||(as.current>Q.length&&(as.current=0),Q.length<=as.current))return;let a=Q.slice(as.current);if(as.current=Q.length,!a.some(a=>a.featureId===i))return;ak("activity");let b=ar.current;"plan"===b&&ak(b)},[Q,i,ak]);let at="running"===g.state||"creating"===g.state;(0,c.useEffect)(()=>{if(!at)return;let a=setInterval(()=>{ak("activity")},5e3);return()=>clearInterval(a)},[at,ak]);let av=(0,c.useCallback)(a=>{al.current=!0,af(a),("activity"===a||"plan"===a)&&aj(a)},[aj]);return(0,b.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:(0,b.jsxs)(ab.Tabs,{value:ad,onValueChange:av,className:"flex min-h-0 flex-1 flex-col",children:[(0,b.jsx)(ab.TabsList,{className:"bg-muted/50 h-auto w-full shrink-0 justify-start gap-0 rounded-none border-b p-0",children:Y.map(a=>{let c=a.icon;return(0,b.jsxs)(ab.TabsTrigger,{value:a.key,className:"text-muted-foreground hover:bg-muted hover:text-foreground data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:border-t-primary [&:not([data-state=active])]:border-r-border relative h-auto rounded-none border-t-2 border-r border-t-transparent border-r-transparent bg-transparent px-3.5 py-2.5 text-[13px] font-normal shadow-none transition-none last:border-r-transparent data-[state=active]:shadow-none",children:[(0,b.jsx)(c,{className:"mr-1.5 size-4"}),a.label]},a.key)})}),(0,b.jsxs)("div",{className:"bg-muted/40 shrink-0 border-b",children:[a?(0,b.jsxs)("div",{className:"flex h-12 items-stretch gap-2 pr-0 pl-4","data-testid":"feature-drawer-header",children:[(0,b.jsx)("div",{className:"flex items-center",children:g.fastMode?(0,b.jsx)(_.Zap,{className:"size-4 shrink-0 text-amber-500"}):(0,b.jsx)(aa,{className:"text-muted-foreground/50 size-4 shrink-0"})}),(0,b.jsx)("h2",{className:"text-foreground flex min-w-0 items-center truncate text-base font-semibold tracking-tight",children:a}),g.repositoryName?(0,b.jsxs)("span",{className:"animate-in fade-in flex shrink-0 items-center gap-1.5 self-center duration-200",children:[(0,b.jsx)("span",{className:"text-muted-foreground/30 text-sm",children:"/"}),g.remoteUrl?(0,b.jsx)("a",{href:g.remoteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground text-sm",children:g.repositoryName}):(0,b.jsx)("span",{className:"text-muted-foreground text-sm",children:g.repositoryName})]}):(0,b.jsxs)("span",{className:"flex items-center gap-1.5 self-center",children:[(0,b.jsx)("span",{className:"text-muted-foreground/30 text-sm",children:"/"}),(0,b.jsx)("span",{className:"bg-muted h-4 w-16 animate-pulse rounded"})]}),(0,b.jsx)(F.TooltipProvider,{delayDuration:300,children:(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"ml-auto flex shrink-0 cursor-default items-center self-stretch text-xs font-medium",children:[(0,b.jsxs)("div",{className:(0,d.cn)("flex items-center gap-1.5 self-stretch px-3",ae.featureNodeStateConfig[g.state].labelClass),children:["running"===g.state?(0,b.jsx)(ah,{size:"sm",className:"shrink-0"}):(V=ae.featureNodeStateConfig[g.state].icon,(0,b.jsx)(V,{className:"size-3.5 shrink-0"})),ae.featureNodeStateConfig[g.state].label]}),"pending"===g.state&&U?(0,b.jsxs)("button",{type:"button",onClick:()=>U(g.featureId),disabled:O,className:"text-muted-foreground flex items-center gap-1 self-stretch px-3 hover:bg-green-500/10 hover:text-green-600 disabled:pointer-events-none disabled:opacity-50 dark:hover:text-green-400","data-testid":"feature-drawer-start-button",children:[(0,b.jsx)(j.Play,{className:"size-3.5"})," Start"]}):"error"===g.state&&S?(0,b.jsxs)("button",{type:"button",onClick:()=>S(g.featureId),disabled:O,className:"text-muted-foreground flex items-center gap-1 self-stretch px-3 hover:bg-red-500/10 hover:text-red-500 disabled:pointer-events-none disabled:opacity-50 dark:hover:text-red-400","data-testid":"feature-drawer-retry-button",children:[(0,b.jsx)($.RotateCcw,{className:"size-3.5"})," Retry"]}):"running"===g.state&&T?(0,b.jsxs)("button",{type:"button",onClick:()=>T(g.featureId),className:"text-muted-foreground flex items-center gap-1 self-stretch px-3 hover:bg-red-500/10 hover:text-red-500 dark:hover:text-red-400","data-testid":"feature-drawer-stop-button",children:[(0,b.jsx)(k.Square,{className:"size-3.5"})," Stop"]}):null]})}),g.errorMessage?(0,b.jsxs)(F.TooltipContent,{side:"bottom",align:"end",sideOffset:4,className:"z-[100] max-w-xs cursor-pointer text-xs leading-relaxed select-text",onClick:()=>{navigator.clipboard.writeText(g.errorMessage)},children:[g.errorMessage,(0,b.jsx)("span",{className:"text-muted-foreground ml-1 text-[10px] italic",children:"(click to copy)"})]}):null]})})]}):null,e]}),(0,b.jsx)(ab.TabsContent,{value:"overview",className:"mt-0 flex-1 overflow-y-auto",children:(0,b.jsx)(bw,{data:g,pinnedConfig:N,syncStatus:C,syncLoading:D,syncError:E,onRefreshSync:G,onRebaseOnMain:H,rebaseLoading:I,rebaseError:J})}),(0,b.jsx)(ab.TabsContent,{value:"activity",className:"mt-0 flex-1 overflow-y-auto",children:(0,b.jsx)(bM,{timings:ai.activity.data?.timings??null,loading:ai.activity.loading,error:ai.activity.error,rejectionFeedback:ai.activity.data?.rejectionFeedback})}),(0,b.jsx)(ab.TabsContent,{value:"log",className:"mt-0 flex-1 overflow-hidden",children:(0,b.jsx)(cf,{content:ag.content,isConnected:ag.isConnected,error:ag.error})}),(0,b.jsx)(ab.TabsContent,{value:"plan",className:"mt-0 flex-1 overflow-y-auto",children:(0,b.jsx)(ct,{plan:ai.plan.data,loading:ai.plan.loading,error:ai.plan.error})}),X.includes("prd-review")?(0,b.jsx)(ab.TabsContent,{value:"prd-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:n?(0,b.jsx)(au,{data:n,selections:o??{},onSelect:p??(()=>void 0),onApprove:q??(()=>void 0),onReject:r,isProcessing:!!(s||O),isRejecting:K,chatInput:L,onChatInputChange:M}):(0,b.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,b.jsx)(h.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,X.includes("tech-decisions")?(0,b.jsx)(ab.TabsContent,{value:"tech-decisions",className:"mt-0 flex min-h-0 flex-1 flex-col",children:t?(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)(az,{data:t})}),(0,b.jsx)(cz,{onApprove:u??(()=>void 0),onReject:v,isProcessing:!!(w||O),isRejecting:K,chatInput:L,onChatInputChange:M})]}):(0,b.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,b.jsx)(h.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,X.includes("product-decisions")?(0,b.jsx)(ab.TabsContent,{value:"product-decisions",className:"mt-0 flex-1 overflow-y-auto",children:null===x?(0,b.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,b.jsx)(h.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):x?(0,b.jsx)(aC,{data:x}):(0,b.jsx)("p",{className:"text-muted-foreground p-4 text-center text-sm",children:"No product decisions available."})}):null,X.includes("merge-review")?(0,b.jsx)(ab.TabsContent,{value:"merge-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:y?(0,b.jsx)(a2,{data:y,readOnly:"maintain"===g.lifecycle,onApprove:z??(()=>void 0),onReject:A,isProcessing:!!(B||O),isRejecting:K,chatInput:L,onChatInputChange:M}):(0,b.jsx)("div",{className:"flex items-center justify-center p-8",children:B?(0,b.jsx)(h.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,X.includes("chat")?(0,b.jsx)(ab.TabsContent,{value:"chat",className:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,b.jsx)(cu.ChatTab,{featureId:i,worktreePath:g.worktreePath})}):null]})})}function cz({onApprove:a,onReject:c,isProcessing:d,isRejecting:f,chatInput:g,onChatInputChange:h}){let{t:i}=(0,e.useTranslation)("web");return(0,b.jsx)(at,{onReject:c,onApprove:a,approveLabel:i("featureDrawer.approvePlan"),revisionPlaceholder:"Ask AI to revise the plan...",isProcessing:d,isRejecting:f,chatInput:g,onChatInputChange:h})}var cA=a.i(31511),cB=a.i(44041),cC=a.i(20104);let cD=(0,p.createServerReference)("4024f9637082272fb41877340eb6607d3fc5c35876",p.callServer,void 0,p.findSourceMapURL,"rebaseFeature");var cE=a.i(74146);function cF(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 cG(a,b,d,e,f,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&&f&&g.toast.error(f)}).finally(()=>{c||j(!1)}),()=>{c=!0}},[a,b,f,h]),i}let cH=(0,p.createServerReference)("40a4cfb781c486394a32c1d994816c0edf86487572",p.callServer,void 0,p.findSourceMapURL,"getFeatureDrawerData"),cI=(0,p.createServerReference)("4046ea64b007ae860c3800c3105495a3b6103b5457",p.callServer,void 0,p.findSourceMapURL,"getBranchSyncStatus"),cJ=new Map,cK=(0,p.createServerReference)("70d37f0b66e42689b068eb85914f9a3de8f5e5bad8",p.callServer,void 0,p.findSourceMapURL,"updateFeaturePinnedConfig");function cL({view:a,urlTab:p,interactiveAgentEnabled:H=!0}){var I,J;let K,L,M,N,P,Q,R=(0,y.useFeatureFlags)(),{t:S}=(0,e.useTranslation)("web"),T=(0,f.useRouter)(),U=(0,z.useSoundAction)("reject"),[V,W]=(0,c.useState)(a),[X,Y]=(0,c.useState)(()=>"feature"===a.type?bq(a.node):null),[Z,$]=(0,c.useState)(()=>"feature"===a.type?bq(a.node):null),[_,aa]=(0,c.useState)(!1),[ab,ac]=(0,c.useState)(null),ad=(0,c.useRef)(null);(0,c.useEffect)(()=>{W(b=>"feature"===b.type&&"feature"===a.type&&b.node.featureId===a.node.featureId?{...a,node:{...b.node,...a.node}}:a)},[a]);let ae="feature"===V.type?V.node:null,af=!!ae&&(I=ae.state,bp.has(I));(0,c.useEffect)(()=>{if("feature"!==V.type||_)return;let a=bq(V.node),b=a?`${V.node.featureId}:${a.agentType}:${a.modelId}`:`${V.node.featureId}:none`,c=ad.current!==b;ad.current=b,Y(a),$(a),c&&ac(null)},[V,_]);let{events:ag}=(0,C.useAgentEventsContext)(),ah=(0,c.useRef)(0);(0,c.useEffect)(()=>{if(ah.current>ag.length&&(ah.current=0),!ae||ag.length<=ah.current)return;let a=ag.slice(ah.current);for(let b of(ah.current=ag.length,(0,cE.resolveSseEventUpdates)(a)))b.featureId===ae.featureId&&"deleting"!==ae.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:cF(c)}})},[ag,ae]);let ai=(0,f.usePathname)().startsWith("/feature/");J=ae?.featureId??null,K=(0,c.useRef)(ai),L=(0,c.useRef)(!1),M=(0,c.useRef)(0),N=(0,c.useCallback)(async()=>{if(!J||L.current)return;L.current=!0;let a=M.current;try{let b=await cH(J);if(!b||a!==M.current)return;W(a=>(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?cF(c):a.initialTab}})(a,b))}catch{}finally{L.current=!1}},[J,W]),P=(0,c.useRef)(!1),(0,c.useEffect)(()=>{!ai||K.current&&P.current||(P.current=!0,M.current+=1,L.current=!1,N()),K.current=ai},[ai,N]),(0,c.useEffect)(()=>{if(!ai||!J)return;let a=setInterval(()=>{N()},15e3);return()=>clearInterval(a)},[ai,J,N]);let aj=(0,c.useCallback)(()=>{T.push("/")},[T]),[ak,al]=(0,c.useState)(""),[am,an]=(0,c.useState)(null),[ao,ap]=(0,c.useState)({}),[aq,ar]=(0,c.useState)({}),[as,at]=(0,c.useState)(null),[au,av]=(0,c.useState)(void 0),[aw,ax]=(0,c.useState)(null),[ay,az]=(0,c.useState)(!1),[aA,aB]=(0,c.useState)(!1),[aC,aD]=(0,c.useState)(!1),aE=`${ae?.featureId}:${ae?.state}`,aF=(0,c.useRef)(aE);(0,c.useEffect)(()=>{aE!==aF.current&&(aF.current=aE,aD(!1))},[aE]);let[aG,aH]=(0,c.useState)(!1),aI=(0,c.useRef)(!1),aJ="feature"===V.type?V.initialTab:void 0;(0,c.useEffect)(()=>{al("")},[aJ]);let aK=(0,c.useRef)(0),aL=(0,c.useRef)(ae?.state),aM=(0,c.useRef)(ae?.lifecycle);(ae?.state!==aL.current||ae?.lifecycle!==aM.current)&&(aL.current=ae?.state,aM.current=ae?.lifecycle,aK.current+=1);let aN=aK.current,aO=cG(ae?.lifecycle==="requirements"&&ae?.state==="action-required"?ae.featureId:null,v,a=>{if(a.error)return void g.toast.error(a.error);if(a.questionnaire){an(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)}ap(b),ar(b)}},()=>{ap({}),ar({}),an(null)},"Failed to load questionnaire",aN),aP=ae?.lifecycle==="implementation"&&ae?.state==="action-required"?ae.featureId:null,aQ=cG(aP,w,a=>{a.error?g.toast.error(a.error):a.techDecisions&&at(a.techDecisions)},()=>at(null),"Failed to load tech decisions",aN),aR=cG(aP,v,a=>{a.productDecisions&&av(a.productDecisions)},()=>av(void 0),void 0,aN),aS=cG(ae?.lifecycle==="review"&&(ae?.state==="action-required"||ae?.state==="error")||ae?.lifecycle==="maintain"&&ae?.pr?ae.featureId:null,x,a=>{"error"in a?g.toast.error(a.error):ax(a)},()=>ax(null),"Failed to load merge review data",aN),aT=ak.trim().length>0,aU=ae?.lifecycle==="requirements"&&ae?.state==="action-required"&&Object.keys(aq).some(a=>aq[a]!==ao[a]),aV=(0,c.useCallback)(()=>{al(""),ap({...aq})},[aq]),{attemptClose:aW}=(0,A.useGuardedDrawerClose)({open:ai,isDirty:aT||aU,onClose:aj,onReset:aV}),aX=(0,c.useCallback)(async(a,b,c=[],d)=>{if(!_&&ae?.featureId){aI.current=!0,aH(!0);try{let e=c.map(a=>a.path).filter(Boolean),f=c.filter(a=>a.notes?.trim()),h=f.length>0?`${a}
|
|
1
|
+
module.exports=[64885,a=>{"use strict";var b=a.i(10973),c=a.i(96960),d=a.i(85536);a.i(90370);var e=a.i(24640),f=a.i(69845),g=a.i(52313),h=a.i(88064),i=a.i(16605),j=a.i(50490),k=a.i(5698),l=a.i(98410),m=a.i(72016),n=a.i(33511),o=a.i(1585),p=a.i(25674);let q=(0,p.createServerReference)("600a5339af3428bb26f987a8d174bf85107bc21560",p.callServer,void 0,p.findSourceMapURL,"approveFeature");var r=a.i(9403),s=a.i(34070),t=a.i(42438);let u=(0,p.createServerReference)("70c78e6ce38eb8191b66bfcfce36e917d7587290a1",p.callServer,void 0,p.findSourceMapURL,"rejectFeature"),v=(0,p.createServerReference)("60eb37f73058c2f7b44b4a148beeb7b3cdc6fc1303",p.callServer,void 0,p.findSourceMapURL,"submitExplorationFeedback"),w=(0,p.createServerReference)("60f29fe2273c7a02c8ec6d4389a51967b64a2ade82",p.callServer,void 0,p.findSourceMapURL,"promoteExploration"),x=(0,p.createServerReference)("4020cae053ead5d72cbb1ab279d8a3144d63ea0d5e",p.callServer,void 0,p.findSourceMapURL,"discardExploration"),y=(0,p.createServerReference)("4009be188d4dbd4a8d95b85125b7cc57be78babfbd",p.callServer,void 0,p.findSourceMapURL,"getFeatureArtifact"),z=(0,p.createServerReference)("402cb4d558958db266b1b817cd1c6dfd2dc70f68ef",p.callServer,void 0,p.findSourceMapURL,"getResearchArtifact"),A=(0,p.createServerReference)("40f6bb62b39b9093a59a31d0b8dc498d4bd2027f18",p.callServer,void 0,p.findSourceMapURL,"getMergeReviewData");var B=a.i(21333),C=a.i(19884),D=a.i(96213),E=a.i(18662),F=a.i(84871);a.i(78454);var G=a.i(24255);a.i(49235);var H=a.i(85080),I=a.i(82934);a.i(77569);var J=a.i(65310),K=a.i(50488),L=a.i(63698),M=a.i(3195),N=a.i(62147),O=a.i(82697);let P="text-muted-foreground hover:bg-foreground/8 hover:text-foreground inline-flex size-8 items-center justify-center rounded-[3px] disabled:opacity-40";function Q({loading:a,error:c,icon:d}){return a?(0,b.jsx)(h.Loader2,{className:"size-3.5 animate-spin"}):c?(0,b.jsx)(O.CircleAlert,{className:"text-destructive size-3.5"}):(0,b.jsx)(d,{className:"size-4"})}function R({actions:a,repositoryPath:d,worktreePath:e,showSpecs:f}){let[g,h]=(0,c.useState)(!1);return(0,b.jsx)(I.TooltipProvider,{delayDuration:300,children:(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsxs)(I.Tooltip,{children:[(0,b.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",className:P,onClick:a.openInIde,disabled:a.ideLoading,"aria-label":"Open in IDE",children:(0,b.jsx)(Q,{loading:a.ideLoading,error:a.ideError,icon:K.Code2})})}),(0,b.jsx)(I.TooltipContent,{side:"bottom",className:"text-xs",children:"Open in IDE"})]}),(0,b.jsxs)(I.Tooltip,{children:[(0,b.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",className:P,onClick:a.openInShell,disabled:a.shellLoading,"aria-label":"Open terminal",children:(0,b.jsx)(Q,{loading:a.shellLoading,error:a.shellError,icon:L.Terminal})})}),(0,b.jsx)(I.TooltipContent,{side:"bottom",className:"text-xs",children:"Open terminal"})]}),(0,b.jsxs)(I.Tooltip,{children:[(0,b.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",className:P,onClick:a.openFolder,disabled:a.folderLoading,"aria-label":"Open folder",children:(0,b.jsx)(Q,{loading:a.folderLoading,error:a.folderError,icon:M.FolderOpen})})}),(0,b.jsx)(I.TooltipContent,{side:"bottom",className:"text-xs",children:"Open folder"})]}),f?(0,b.jsxs)(I.Tooltip,{children:[(0,b.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",className:P,onClick:a.openSpecsFolder,disabled:a.specsLoading,"aria-label":"Open specs",children:(0,b.jsx)(Q,{loading:a.specsLoading,error:a.specsError,icon:N.FileText})})}),(0,b.jsx)(I.TooltipContent,{side:"bottom",className:"text-xs",children:"Open specs"})]}):null,(0,b.jsxs)(I.Tooltip,{children:[(0,b.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",className:P,onClick:()=>{navigator.clipboard.writeText(e??d),h(!0),setTimeout(()=>h(!1),2e3)},"aria-label":"Copy path",children:g?(0,b.jsx)(m.Check,{className:"size-3.5 text-green-500"}):(0,b.jsx)(l.Copy,{className:"size-4"})})}),(0,b.jsx)(I.TooltipContent,{side:"bottom",className:"text-xs",children:g?"Copied!":"Copy path"})]})]})})}var S=a.i(72980),T=a.i(56957),U=a.i(44981),V=a.i(25700);let W=(0,V.default)("scroll-text",[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]]),X=(0,V.default)("map",[["path",{d:"M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z",key:"169xi5"}],["path",{d:"M15 5.764v15",key:"1pn4in"}],["path",{d:"M9 3.236v15",key:"1uimfh"}]]),Y=(0,V.default)("file-check",[["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 15 2 2 4-4",key:"1grp1n"}]]);var Z=a.i(65355),$=a.i(21084);let _=(0,V.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 aa=a.i(12882),ab=a.i(18615),ac=a.i(3942);let ad=(0,V.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"}]]);var ae=a.i(78281),af=a.i(41305);let ag=(0,p.createServerReference)("40fdeec539a2bdddfb849274750586a3b28921bed1",p.callServer,void 0,p.findSourceMapURL,"getFeaturePhaseTimings"),ah=(0,p.createServerReference)("405b1f08a008481b4ff1bf6e75b300b3262a256b35",p.callServer,void 0,p.findSourceMapURL,"getFeaturePlan");a.i(54250);var ai=a.i(27039);let aj=(0,a.i(42261).cva)("inline-block shrink-0",{variants:{size:{sm:"size-5",md:"size-8",lg:"size-12"}},defaultVariants:{size:"md"}}),ak=[{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 al({className:a,size:c="md",duration:e=5,...f}){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,d.cn)(aj({size:c}),a),...f,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:`${e}s`,repeatCount:"indefinite"}),ak.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"})]})]})]})}var am=a.i(94132),an=a.i(3410),ao=a.i(18948),ap=a.i(58339),aq=a.i(45242);let ar=(0,V.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 as=a.i(91498),at=a.i(79620);a.i(307);var au=a.i(30931),av=a.i(39116);let aw=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 ax({onReject:a,onApprove:f,approveLabel:g,approveVariant:h="default",revisionPlaceholder:i,isProcessing:j=!1,isRejecting:k=!1,children:l,chatInput:n,onChatInputChange:o}){let{t:p}=(0,e.useTranslation)("web"),q="warning"===h,r=q?as.AlertTriangle:m.Check,s=q?"bg-orange-500/85":"bg-blue-500/85",[t,u]=(0,c.useState)(""),v=n??t,w=o??u,x=(0,C.useSoundAction)("approve"),y=j||k,[z,A]=(0,c.useState)([]),[B,D]=(0,c.useState)(!1),[E,F]=(0,c.useState)(null),[G,H]=(0,c.useState)(!1),[J,K]=(0,c.useState)(!1),[L,M]=(0,c.useState)(!1),N=v.trim().length>0,O=N?G||J&&L:!G,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(F(null),a)){if(b.size>0xa00000)return void F(`"${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&&!aw.has(a))return void F(`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)),F(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)),F("Upload failed")}}},[]),T=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),P.current+=1,1===P.current&&D(!0)},[]),U=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),P.current-=1,0===P.current&&D(!1)},[]),V=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation()},[]),W=(0,c.useCallback)(a=>{a.preventDefault(),a.stopPropagation(),P.current=0,D(!1);let b=Array.from(a.dataTransfer.files);b.length>0&&S(b)},[S]),X=(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]),Y=(0,c.useCallback)(async()=>{try{let a=await (0,av.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{}},[]),Z=(0,c.useCallback)(a=>{A(b=>b.filter(b=>b.id!==a))},[]),$=(0,c.useCallback)((a,b)=>{A(c=>c.map(c=>c.id===a?{...c,notes:b}:c))},[]),_=(0,c.useCallback)(()=>{w(""),A([]),F(null)},[w]),aa=(0,c.useCallback)(a=>{(a.ctrlKey||a.metaKey)&&"Enter"===a.key&&(a.preventDefault(),R.current?.requestSubmit())},[]),ab="u">typeof navigator&&/Mac/i.test(navigator.userAgent)?"⌘":"Ctrl";return(0,b.jsxs)("div",{className:"border-border shrink-0 border-t",children:[l,a?(0,b.jsx)(I.TooltipProvider,{delayDuration:400,children:(0,b.jsx)("form",{ref:R,onSubmit:function(b){b.preventDefault();let c=v.trim();if(O)x.play(),f(),_();else{if(!c||!a)return;a(c,z.filter(a=>!a.loading)),_()}},className:"p-3",children:(0,b.jsx)("div",{role:"region","aria-label":p("createDrawer.fileDropZone"),"data-drag-over":B?"true":"false",onDragEnter:T,onDragLeave:U,onDragOver:V,onDrop:W,className:(0,d.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)(at.Textarea,{placeholder:i??"Ask AI to revise...","aria-label":i??"Ask AI to revise...",disabled:y,value:v,onChange:a=>w(a.target.value),onKeyDown:aa,onPaste:X,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"}),z.length>0&&(0,b.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:z.map(a=>(0,b.jsx)(au.AttachmentChip,{name:a.name,size:a.size,mimeType:a.mimeType,path:a.path,onRemove:()=>Z(a.id),disabled:y,loading:a.loading,notes:a.notes,onNotesChange:b=>$(a.id,b)},a.id))}),E?(0,b.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:E}):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:[ab,"+Enter"]})," ",N?"reject":"approve"]}),(0,b.jsxs)(I.Tooltip,{children:[(0,b.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:Y,disabled:y,"aria-label":p("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,b.jsx)(aq.PaperclipIcon,{className:"h-4 w-4"})})}),(0,b.jsx)(I.TooltipContent,{side:"top",children:p("chat.attachFiles")})]}),(0,b.jsx)("div",{onMouseLeave:()=>H(!1),children:(0,b.jsxs)(I.Tooltip,{children:[(0,b.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("button",{type:"submit",disabled:y,"data-testid":"drawer-action-submit",className:(0,d.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?`${q?"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,d.cn)("pointer-events-none absolute inset-0 transition-transform duration-300 ease-in-out",s),style:{transform:O?"translateX(0)":"translateX(100%)"}}),(0,b.jsxs)("span",{className:(0,d.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)(ar,{className:"h-4 w-4 shrink-0"}),"Reject"]}),(0,b.jsxs)("span",{className:(0,d.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)(r,{className:"h-4 w-4 shrink-0"}),g]}),(0,b.jsx)("span",{className:(0,d.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 ${s} transition-opacity duration-300`,!N&&!G&&"pointer-events-none opacity-0"),onMouseEnter:()=>H(!0),children:(0,b.jsx)(am.ChevronLeft,{className:"h-4 w-4 text-white"})})]})}),q?null:(0,b.jsx)(I.TooltipContent,{side:"top",children:O?g:p("drawerActionBar.sendRevisionFeedback")})]})})]})]})})})}):(0,b.jsx)("div",{className:"flex items-center gap-2 px-4 pb-4",children:(0,b.jsx)(ao.Button,{type:"button",className:"flex-1",disabled:y,onClick:()=>{x.play(),f()},children:g})})]})}function ay({data:a,selections:e,onSelect:f,onApprove:g,onReject:h,isProcessing:i=!1,isRejecting:j=!1,showHeader:k=!1,chatInput:l,onChatInputChange:m}){let{question:n,context:o,questions:p,finalAction:q}=a,[r,s]=(0,c.useState)(0),t=(0,C.useSoundAction)("select"),u=(0,C.useSoundAction)("navigate"),v=p.length,w=r===v-1,x=p[r],y=(0,c.useMemo)(()=>Object.keys(e).length,[e]),z=(0,c.useCallback)((a,b)=>{t.play(),f(a,b),w||setTimeout(()=>s(a=>a+1),250)},[f,w,t]);return 0===v?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:[k?(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:n}),(0,b.jsx)("p",{className:"text-muted-foreground text-xs leading-relaxed",children:o})]})]}):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:[r+1,". ",x.question]}),(0,b.jsx)("div",{className:"mt-1.5 flex shrink-0 gap-1",children:p.map((a,c)=>(0,b.jsx)("button",{type:"button","aria-label":`Go to question ${c+1}`,className:(0,d.cn)("h-1.5 rounded-full transition-all duration-200",c===r?"bg-primary w-4":"w-1.5",c!==r&&e[a.id]?"bg-primary/50":"",c===r||e[a.id]?"":"bg-muted-foreground/25"),onClick:()=>{u.play(),s(c)}},a.id))})]}),(0,b.jsx)("div",{className:"space-y-2",children:x.options.map((a,c)=>{let f=e[x.id]===a.id,g=String.fromCharCode(65+c);return(0,b.jsx)("button",{type:"button",className:(0,d.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",f&&"border-primary bg-primary/5",a.isNew&&"animate-option-highlight"),disabled:i,onClick:()=>z(x.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:[g,"."]}),(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)(ap.Badge,{className:"px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):(0,b.jsx)(ap.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)(ao.Button,{type:"button",variant:"ghost",size:"sm",disabled:0===r||i,onClick:()=>{u.play(),s(a=>a-1)},children:[(0,b.jsx)(am.ChevronLeft,{className:"me-1 h-4 w-4"}),"Previous"]}),w?null:(0,b.jsxs)(ao.Button,{type:"button",variant:"ghost",size:"sm",disabled:i,onClick:()=>{u.play(),s(a=>a+1)},children:[e[x.id]?"Next":"Skip",(0,b.jsx)(an.ChevronRight,{className:"ms-1 h-4 w-4"})]})]})]}),(0,b.jsx)(ax,{onReject:h,onApprove:()=>g(q.id),approveLabel:q.label,revisionPlaceholder:"Ask AI to refine requirements...",isProcessing:i,isRejecting:j,chatInput:l,onChatInputChange:m,children:(0,b.jsx)("div",{className:(0,d.cn)("bg-muted h-1.5 overflow-hidden",y>0&&y<v||i?"opacity-100":"opacity-0","transition-opacity duration-200"),"data-testid":"progress-bar-container",children:i?(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:`${v>0?y/v*100:0}%`},"data-testid":"progress-bar"})})})]})}var az=a.i(77610);let aA=(0,V.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"}]]),aB={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 aC({decision:a,index:d}){let[e,f]=(0,c.useState)(!1),g=(0,C.useSoundAction)("expand"),h=(0,C.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)(ap.Badge,{variant:"secondary",className:"bg-primary/10 text-primary shrink-0",children:a.decisionName}):null]}),a.rationale?(0,b.jsx)(az.default,{components:aB,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)(an.ChevronRight,{className:`h-3.5 w-3.5 transition-transform ${e?"rotate-90":""}`}),(0,b.jsx)(ad,{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 aD({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)(aA,{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)(aC,{decision:a,index:c},a.title))]})}var aE=a.i(69428);function aF({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)(ap.Badge,{className:"shrink-0 px-1.5 py-0 text-[10px] whitespace-nowrap",children:"AI Recommended"}):null]})]})]})})})}function aG({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)(aE.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)(aF,{item:a,index:c},a.question))]})}var aH=a.i(71238);let aI=(0,V.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 aJ=a.i(92548),aK=a.i(53170);let aL=(0,V.default)("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),aM=(0,V.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"}]]),aN=(0,V.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 aO=a.i(9955),aP=a.i(71716),aQ=a.i(67075),aR=a.i(58428),aR=aR,aS=a.i(46847);function aT({status:a}){switch(a){case aS.CiStatus.Success:return(0,b.jsxs)(ap.Badge,{className:"border-transparent bg-green-50 text-green-700 hover:bg-green-50",children:[(0,b.jsx)(aQ.CheckCircle2,{className:"me-1 h-3.5 w-3.5"}),"Passing"]});case aS.CiStatus.Pending:return(0,b.jsxs)(ap.Badge,{className:"border-transparent bg-yellow-50 text-yellow-700 hover:bg-yellow-50",children:[(0,b.jsx)(h.Loader2,{className:"me-1 h-3.5 w-3.5 animate-spin"}),"Pending"]});case aS.CiStatus.Failure:return(0,b.jsxs)(ap.Badge,{className:"border-transparent bg-red-50 text-red-700 hover:bg-red-50",children:[(0,b.jsx)(aR.default,{className:"me-1 h-3.5 w-3.5"}),"Failing"]})}}var aU=a.i(38019);let aV=(0,V.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"}]]);var aW=a.i(65298);let aX={added:{icon:aU.FilePlus,label:"A",className:"text-green-600"},modified:{icon:aW.FileEdit,label:"M",className:"text-amber-600"},deleted:{icon:aV,label:"D",className:"text-red-600"},renamed:{icon:aW.FileEdit,label:"R",className:"text-blue-600"}};function aY({status:a}){let c=aX[a],e=c.icon;return(0,b.jsx)(e,{className:(0,d.cn)("h-3.5 w-3.5 shrink-0",c.className)})}function aZ({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,d.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,d.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 a$({file:a}){let[e,f]=(0,c.useState)(!1),g=a.path.split("/").pop()??a.path,h=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:()=>f(!e),className:"hover:bg-muted/50 flex w-full items-center gap-2 px-3 py-2 text-start",children:[(0,b.jsx)(an.ChevronRight,{className:(0,d.cn)("text-muted-foreground h-3 w-3 shrink-0 transition-transform duration-150",e&&"rotate-90")}),(0,b.jsx)(aY,{status:a.status}),(0,b.jsx)("span",{className:"text-foreground min-w-0 flex-1 truncate text-xs",children:h?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("span",{className:"text-muted-foreground",children:[h,"/"]}),g]}):g}),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]})]}),e&&a.hunks.length>0?(0,b.jsx)("div",{className:"border-border overflow-x-auto border-t",children:a.hunks.map(a=>(0,b.jsx)(aZ,{hunk:a},a.header))}):null]})}function a_({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)(N.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)(a$,{file:a},`${a.status}-${a.path}`))})]})}let a0={Screenshot:aM,Video:aN,TestOutput:N.FileText,TerminalRecording:L.Terminal},a1=new Set([".png",".jpg",".jpeg",".gif",".webp",".svg",".bmp"]),a2=new Set([".mp4",".webm",".mov"]);function a3({evidence:a}){var d,e;let f,[g,h]=(0,c.useState)(!0),i=a0[a.type]??aM,j=(f=(d=a.relativePath).lastIndexOf("."))>=0?d.slice(f).toLowerCase():"",k=(e=a.relativePath,`/api/evidence?path=${encodeURIComponent(e)}`),l="Screenshot"===a.type||a1.has(j),m="Video"===a.type||a2.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)(aP.ChevronDown,{className:"text-muted-foreground h-3 w-3 shrink-0"}):(0,b.jsx)(an.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)(aO.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)(a4,{url:k}):(0,b.jsx)("p",{className:"text-muted-foreground truncate font-mono text-[10px]",children:a.relativePath})}):null,null]})}function a4({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 a5({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)(aM,{className:"text-muted-foreground h-4 w-4"}),(0,b.jsx)("span",{className:"text-foreground text-xs font-semibold",children:"Evidence"}),(0,b.jsx)(ap.Badge,{variant:"secondary",className:"text-[10px]",children:a.length})]}),(0,b.jsx)("ul",{className:"space-y-2",children:a.map(a=>(0,b.jsx)(a3,{evidence:a},`${a.type}-${a.relativePath}`))})]})})}function a6({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:n,evidence:o,hideCiStatus:p}=a,q=j?.mergeable===!1,r=q&&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)(aK.GitBranch,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,b.jsx)(ap.Badge,{variant:"secondary",className:"font-mono text-[11px]",children:m.source}),(0,b.jsx)(aL,{className:"text-muted-foreground h-3.5 w-3.5 shrink-0"}),(0,b.jsx)(ap.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)(aH.ExternalLink,{className:"h-3.5 w-3.5"})]}),(0,b.jsx)(ap.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)(ap.Badge,{className:"border-transparent bg-orange-50 text-orange-700 hover:bg-orange-50",children:[(0,b.jsx)(as.AlertTriangle,{className:"me-1 h-3.5 w-3.5"}),"Conflicts"]})]}):null,j.ciStatus&&!0!==p?(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)(aT,{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)(aJ.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)(aI,{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"})]})]})]})}):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)(as.AlertTriangle,{className:"text-muted-foreground h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:n})]})}):null,o&&o.length>0?(0,b.jsx)(a5,{evidence:o}):null,l&&l.length>0?(0,b.jsx)(a_,{fileDiffs:l}):null]}),!c&&(0,b.jsx)(ax,{onReject:e,onApprove:r,approveLabel:q?"Resolve Conflicts":"Approve Merge",approveVariant:q?"warning":"default",revisionPlaceholder:"Ask AI to revise before merging...",isProcessing:f,isRejecting:g,chatInput:h,onChatInputChange:i})]})}var a7=a.i(46168);let a8=(0,V.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"}]]),a9=(0,V.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var ba=a.i(67424),bb=a.i(28002),bc=a.i(32703);let bd=(0,V.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 be=a.i(2807),bf=a.i(45670),bg=a.i(26633),bh=a.i(73998);let bi=(0,V.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"}]]),bj=new Set([".png",".jpg",".jpeg",".gif",".svg",".webp",".ico",".bmp"]);function bk(a){let b=a.lastIndexOf(".");return b>=0&&bj.has(a.slice(b).toLowerCase())}function bl(a){let b=a.lastIndexOf(".")>=0?a.slice(a.lastIndexOf(".")):"",c=bk(a)?`image/${b.slice(1).replace("jpg","jpeg")}`:"",d=new URLSearchParams({path:a,...c&&{mimeType:c}});return`/api/attachments/preview?${d.toString()}`}let bm=/(?:^|\s)@(\/[^\s]+)/g;function bn({text:a,attachmentPaths:c}){let d=function(a){let b=[],c=0;for(let d of a.matchAll(bm)){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)(bo,{path:a.path},`att-${a.path}`)}),f.map(a=>(0,b.jsx)(bo,{path:a},`extra-${a}`))]}):(0,b.jsx)("span",{className:"text-sm leading-relaxed",children:a})}function bo({path:a}){let d=a.split("/").pop()??a,[e,f]=(0,c.useState)(!1);return bk(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)(bi,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"truncate",children:d})]}):(0,b.jsxs)(bf.Dialog,{children:[(0,b.jsx)(bf.DialogTrigger,{asChild:!0,children:(0,b.jsx)("img",{src:bl(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)(bf.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)(bg.VisuallyHidden.Root,{children:(0,b.jsxs)(bf.DialogTitle,{children:["Preview: ",d]})}),(0,b.jsx)("div",{className:"relative bg-black/90",children:(0,b.jsx)("img",{src:bl(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:bl(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)(bh.DownloadIcon,{className:"h-4 w-4"})})]})]})]}):(0,b.jsx)("a",{href:bl(a),download:d,"data-testid":"inline-attachment-file",className:"text-primary text-sm underline underline-offset-2",children:d})}a.i(69029);var bp=a.i(5623),bq=a.i(61781),br=a.i(17606),bs=a.i(83852);function bt(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 bu=new Set(["pending","action-required","error"]);function bv(a){return a?.agentType?{agentType:a.agentType,modelId:a.modelId??""}:null}function bw({icon:a,title:c,children:d}){return(0,b.jsxs)("div",{className:"px-3 pt-4 pb-1",children:[(0,b.jsxs)("div",{className:"text-foreground mb-2 flex items-center gap-1.5 text-sm font-semibold tracking-wider uppercase",children:[(0,b.jsx)(a,{className:"size-4 opacity-50"}),c]}),d]})}function bx({children:a,className:c}){return(0,b.jsx)("div",{className:(0,d.cn)("bg-muted/60 rounded-md border border-transparent p-3",c),children:a})}function by({label:a,children:c}){return(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)("span",{className:"text-foreground/40 text-[11px] font-medium tracking-wider uppercase",children:a}),(0,b.jsx)("span",{className:"text-sm leading-snug",children:c})]})}function bz({on:a,label:c}){return(0,b.jsxs)("span",{className:(0,d.cn)("inline-flex items-center gap-1 rounded px-2 py-0.5 text-xs font-medium",a?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400":"bg-foreground/[0.04] text-foreground/25"),children:[a?(0,b.jsx)(m.Check,{className:"size-3"}):(0,b.jsx)(be.X,{className:"size-3"}),c]})}let bA={[aS.PrStatus.Open]:"text-blue-600 dark:text-blue-400",[aS.PrStatus.Merged]:"text-purple-600 dark:text-purple-400",[aS.PrStatus.Closed]:"text-red-600 dark:text-red-400"};function bB({data:a,pinnedConfig:e,syncStatus:f,syncLoading:g,syncError:h,onRefreshSync:i,onRebaseOnMain:j,rebaseLoading:k,rebaseError:l}){var m;let n,o,p,q,r,s,t="maintain"===a.lifecycle,u=function(a){let[b,d]=(0,c.useState)(null),e=(0,c.useRef)(null);return(0,c.useEffect)(()=>a?(d(bt(Math.max(0,Date.now()-a))),e.current=setInterval(()=>{d(bt(Math.max(0,Date.now()-a)))},1e3),()=>{e.current&&clearInterval(e.current)}):void d(null),[a]),b}("running"===a.state||"action-required"===a.state?a.startedAt:void 0),v=ai.featureNodeStateConfig[a.state],w=!!a.summary&&!(a.userQuery&&a.summary?.trim()===a.userQuery.trim());return(0,b.jsxs)("div",{"data-testid":"feature-drawer-status",className:"pb-4",children:[!t&&a.progress>0?(0,b.jsx)("div",{"data-testid":"feature-drawer-progress",className:"px-3 pb-2",children:(0,b.jsx)("div",{className:"bg-foreground/[0.06] h-1.5 w-full overflow-hidden rounded-full",children:(0,b.jsx)("div",{className:(0,d.cn)("h-full rounded-full transition-all",v.progressClass),style:{width:`${a.progress}%`}})})}):null,a.oneLiner||a.userQuery||w?(0,b.jsx)(bw,{icon:a9,title:"Description",children:(0,b.jsxs)(bx,{className:"flex flex-col gap-2",children:[a.oneLiner?(0,b.jsx)(by,{label:"One-Liner",children:a.oneLiner}):null,a.userQuery?(0,b.jsx)(by,{label:"Query",children:(0,b.jsx)(bn,{text:a.userQuery})}):null,w?(0,b.jsx)(by,{label:"Summary",children:(0,b.jsx)("span",{className:"leading-snug",children:a.summary})}):null]})}):null,a.pr?(0,b.jsx)(bw,{icon:aJ.GitCommitHorizontal,title:"Pull Request",children:(0,b.jsx)(bx,{children:(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)("a",{href:a.pr.url,target:"_blank",rel:"noopener noreferrer",className:"text-primary inline-flex items-center gap-1 text-sm font-semibold hover:underline",children:["#",a.pr.number," ",(0,b.jsx)(aH.ExternalLink,{className:"size-3"})]}),(0,b.jsx)("span",{className:(0,d.cn)("text-xs font-semibold",bA[a.pr.status]),children:a.pr.status}),!1===a.pr.mergeable?(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs font-medium text-orange-600 dark:text-orange-400",children:[(0,b.jsx)(as.AlertTriangle,{className:"size-3 shrink-0"})," Conflicts"]}):null,a.pr.ciStatus&&!0!==a.hideCiStatus?(0,b.jsx)(aT,{status:a.pr.ciStatus}):null,a.pr.commitHash?(0,b.jsx)("code",{className:"text-foreground/40 ml-auto font-mono text-[11px]",children:a.pr.commitHash.slice(0,7)}):null]})})}):null,(0,b.jsxs)("div",{className:"grid grid-cols-2 gap-2 px-3 pb-1",children:[a.branch?(0,b.jsx)(bx,{children:(0,b.jsxs)(by,{label:"Branch",children:[(0,b.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,b.jsx)(aK.GitBranch,{className:"text-foreground/30 size-3 shrink-0"}),(0,b.jsx)("code",{className:"font-mono text-[11px]",children:a.branch})]}),a.baseBranch?(0,b.jsxs)("span",{className:"text-foreground/30 block text-[10px]",children:["from ",a.baseBranch]}):null]})}):null,a.agentType||a.modelId?(0,b.jsx)(bx,{children:(0,b.jsx)(by,{label:"Agent",children:(0,b.jsxs)("span",{className:"inline-flex items-center gap-1.5",children:[a.agentType?(n=(0,br.getAgentTypeIcon)(a.agentType),(0,b.jsx)(n,{className:"size-3.5 shrink-0 opacity-50"})):null,a.agentType?(0,b.jsx)("span",{children:br.agentTypeLabels[a.agentType]??a.agentType}):null,a.agentType&&a.modelId?(0,b.jsx)("span",{className:"text-foreground/20",children:"/"}):null,a.modelId?(0,b.jsx)("span",{className:"text-foreground/50 text-[12px]",children:(0,bs.getModelMeta)(a.modelId).displayName||a.modelId}):null]})})}):null,a.createdAt?(0,b.jsx)(bx,{children:(0,b.jsx)(by,{label:"Created",children:(0,b.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,b.jsx)(a7.Clock,{className:"text-foreground/30 size-3 shrink-0"}),(m=a.createdAt,o=Date.now(),(s=Math.floor((r=Math.floor((q=Math.floor((o-(p="string"==typeof m?new Date(m).getTime():m))/6e4))/60))/24))>30?new Date(p).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):s>0?`${s}d ago`:r>0?`${r}h ago`:q>0?`${q}m ago`:"just now")]})})}):null,a.fastMode?(0,b.jsx)(bx,{children:(0,b.jsx)(by,{label:"Mode",children:(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 text-amber-600 dark:text-amber-400",children:[(0,b.jsx)(ac.Zap,{className:"size-3.5"})," Fast"]})})}):null,a.runtime||u?(0,b.jsx)(bx,{children:(0,b.jsx)(by,{label:a.runtime?"Runtime":"Elapsed",children:(0,b.jsxs)("span",{className:"inline-flex items-center gap-1",children:[(0,b.jsx)(a7.Clock,{className:"text-foreground/30 size-3 shrink-0"}),a.runtime??u]})})}):null]}),a.blockedBy||a.errorMessage?(0,b.jsx)(bw,{icon:as.AlertTriangle,title:"Issues",children:(0,b.jsxs)(bx,{className:"border-destructive/20 bg-destructive/5",children:[a.blockedBy?(0,b.jsx)(by,{label:"Blocked By",children:a.blockedBy}):null,a.errorMessage?(0,b.jsx)(by,{label:"Error",children:(0,b.jsx)("span",{className:"text-destructive",children:a.errorMessage})}):null]})}):null,j&&a.branch&&i?(0,b.jsx)(bw,{icon:bb.RefreshCw,title:"Branch Sync",children:(0,b.jsx)(bC,{syncStatus:f??null,syncLoading:g??!1,syncError:h??null,onRefreshSync:i,onRebaseOnMain:j,rebaseLoading:k??!1,rebaseError:l??null})}):null,(0,b.jsx)(bE,{data:a,pinnedConfig:e}),a.injectedSkills?.length?(0,b.jsx)(bF,{skills:a.injectedSkills}):null]})}function bC({syncStatus:a,syncLoading:c,syncError:f,onRefreshSync:g,onRebaseOnMain:h,rebaseLoading:i,rebaseError:j}){let{t:k}=(0,e.useTranslation)("web"),l=null!=a&&a.behind>0,m=a?.behind===0,n=a?.baseBranch??"main";return(0,b.jsxs)(bx,{children:[(0,b.jsxs)("div",{"data-testid":"branch-sync-status",className:"flex items-center justify-between",children:[(0,b.jsx)("div",{className:"flex items-center gap-1.5 text-[13px]",children:c&&!a?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(al,{size:"sm"}),(0,b.jsx)("span",{className:"text-foreground/40",children:"Checking..."})]}):f?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(as.AlertTriangle,{className:"size-3.5 text-red-500"}),(0,b.jsx)("span",{className:"text-destructive text-xs",children:f})]}):i?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(al,{size:"sm"}),(0,b.jsxs)("span",{children:["Rebasing on ",(0,b.jsx)("code",{className:"font-mono text-[11px]",children:n}),"..."]})]}):l?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(as.AlertTriangle,{className:"size-3.5 text-orange-500"}),(0,b.jsxs)("span",{children:[a.behind," behind ",(0,b.jsx)("code",{className:"font-mono text-[11px]",children:n}),a.ahead>0?(0,b.jsxs)("span",{className:"text-foreground/30 ml-1 text-[11px]",children:["· ",a.ahead," ahead"]}):null]})]}):m?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(aQ.CheckCircle2,{className:"size-3.5 text-green-500"}),(0,b.jsxs)("span",{children:["Up to date · ",(0,b.jsx)("code",{className:"font-mono text-[11px]",children:n}),a.ahead>0?(0,b.jsxs)("span",{className:"text-foreground/30 ml-1 text-[11px]",children:["· ",a.ahead," ahead"]}):null]})]}):null}),(a||f)&&!i?(0,b.jsx)("button",{onClick:g,disabled:c,className:"text-foreground/30 hover:text-foreground/60 hover:bg-foreground/5 inline-flex size-6 items-center justify-center rounded-sm disabled:opacity-50","aria-label":k("branchSyncStatus.refreshSyncStatus"),children:(0,b.jsx)(bb.RefreshCw,{className:(0,d.cn)("size-3",c&&"animate-spin")})}):null]}),l&&!i?(0,b.jsx)("div",{className:"pt-2",children:(0,b.jsx)(bp.ActionButton,{label:k("branchSyncStatus.rebaseOnMain"),onClick:h,loading:!1,error:!!j,icon:_,variant:"outline",size:"sm"})}):null,j?(0,b.jsx)("p",{className:"text-destructive pt-1 text-[11px]",children:j}):null]})}function bD({pinnedConfig:a}){let c=(0,br.getAgentTypeIcon)(a.agentType),d=a.modelId?(0,bs.getModelMeta)(a.modelId).displayName||a.modelId:"No model selected";return(0,b.jsxs)(bx,{"data-testid":"feature-pinned-config-card",className:"flex flex-col gap-3",children:[(0,b.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,b.jsxs)("div",{className:"text-foreground/40 flex items-center gap-1 text-[10px] font-medium tracking-wider uppercase",children:[(0,b.jsx)(bc.Settings,{className:"size-3"})," Pinned Execution"]}),(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm",children:[(0,b.jsx)(c,{className:"size-4 shrink-0 opacity-60"}),(0,b.jsx)("span",{className:"font-medium",children:br.agentTypeLabels[a.agentType]??a.agentType}),(0,b.jsx)("span",{className:"text-foreground/20",children:"/"}),(0,b.jsx)("span",{className:"text-foreground/60",children:d})]}),(0,b.jsx)("p",{className:"text-muted-foreground text-xs",children:"Change the pinned agent and model before the next start, approval, or retry."})]}),(0,b.jsx)(bq.AgentModelPicker,{initialAgentType:a.agentType,initialModel:a.modelId,agentType:a.agentType,model:a.modelId,onSave:a.onSave,saveError:a.error,saving:a.saving,disabled:a.saving,mode:"settings"})]})}function bE({data:a,pinnedConfig:c}){var d;let e=null!=a.approvalGates||null!=a.push||null!=a.openPr||null!=a.ciWatchEnabled||null!=a.enableEvidence||null!=a.forkAndPr||null!=a.commitSpecs||null!=a.injectSkills,f=null!=c&&(d=a.state,bu.has(d));return e||f?(0,b.jsx)(bw,{icon:bc.Settings,title:"Settings",children:(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[f?(0,b.jsx)(bD,{pinnedConfig:c}):null,e?(0,b.jsxs)("div",{className:"grid grid-cols-3 gap-2",children:[a.approvalGates?(0,b.jsxs)(bx,{children:[(0,b.jsxs)("div",{className:"text-foreground/40 mb-1.5 flex items-center gap-1 text-[10px] font-medium tracking-wider uppercase",children:[(0,b.jsx)(bd,{className:"size-3"})," Approve"]}),(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)(bz,{on:a.approvalGates.allowPrd,label:"PRD"}),(0,b.jsx)(bz,{on:a.approvalGates.allowPlan,label:"Plan"}),(0,b.jsx)(bz,{on:a.approvalGates.allowMerge,label:"Merge"})]})]}):null,null!=a.enableEvidence?(0,b.jsxs)(bx,{children:[(0,b.jsxs)("div",{className:"text-foreground/40 mb-1.5 flex items-center gap-1 text-[10px] font-medium tracking-wider uppercase",children:[(0,b.jsx)(a8,{className:"size-3"})," Evidence"]}),(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,b.jsx)(bz,{on:a.enableEvidence,label:"Collect"}),null!=a.commitEvidence?(0,b.jsx)(bz,{on:a.commitEvidence,label:"Add to PR"}):null]})]}):null,null!=a.injectSkills?(0,b.jsxs)(bx,{children:[(0,b.jsxs)("div",{className:"text-foreground/40 mb-1.5 flex items-center gap-1 text-[10px] font-medium tracking-wider uppercase",children:[(0,b.jsx)(ba.Puzzle,{className:"size-3"})," Skills"]}),(0,b.jsx)("div",{className:"flex flex-col gap-0.5",children:(0,b.jsx)(bz,{on:a.injectSkills,label:"Inject"})})]}):null,null!=a.push||null!=a.openPr||null!=a.ciWatchEnabled||null!=a.commitSpecs||null!=a.forkAndPr?(0,b.jsxs)(bx,{children:[(0,b.jsxs)("div",{className:"text-foreground/40 mb-1.5 flex items-center gap-1 text-[10px] font-medium tracking-wider uppercase",children:[(0,b.jsx)(aK.GitBranch,{className:"size-3"})," Git"]}),(0,b.jsxs)("div",{className:"flex flex-col gap-0.5",children:[null!=a.push?(0,b.jsx)(bz,{on:a.push,label:"Push"}):null,null!=a.openPr?(0,b.jsx)(bz,{on:a.openPr,label:"PR"}):null,null!=a.ciWatchEnabled?(0,b.jsx)(bz,{on:a.ciWatchEnabled,label:"Watch"}):null,null!=a.commitSpecs?(0,b.jsx)(bz,{on:a.commitSpecs,label:"Specs"}):null,null!=a.forkAndPr?(0,b.jsx)(bz,{on:a.forkAndPr,label:"Fork"}):null]})]}):null]}):null]})}):null}function bF({skills:a}){return(0,b.jsx)(bw,{icon:ba.Puzzle,title:"Feature Skills",children:(0,b.jsx)("div",{className:"flex flex-wrap gap-1.5",children:a.map(a=>(0,b.jsx)(ap.Badge,{variant:"secondary",children:a},a))})})}let bG=(0,V.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 aR=aR,bH=a.i(93866),bI=a.i(7421);let bJ=(0,V.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"}]]),bK=(0,V.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 bL(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 bM(a){return a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}K`:String(a)}function bN(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 bO(a){return a>=1?`$${a.toFixed(2)}`:a>=.01?`$${a.toFixed(3)}`:`$${a.toFixed(4)}`}let bP={analyze:"Analyzing",requirements:"Requirements",research:"Researching",plan:"Planning",implement:"Implementing",rebase:"Rebasing","fast-implement":"Fast Implement",evidence:"Evidence",validate:"Validating",repair:"Repairing",merge:"Merging"},bQ={"run:started":{label:"started",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:j.Play},"run:resumed":{label:"resumed",colorClass:"text-blue-600",bgClass:"bg-blue-50 dark:bg-blue-950/30",icon:ab.RotateCcw},"run:completed":{label:"completed",colorClass:"text-emerald-600",bgClass:"bg-emerald-50 dark:bg-emerald-950/30",icon:aQ.CheckCircle2},"run:failed":{label:"failed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:aR.default},"run:stopped":{label:"stopped",colorClass:"text-amber-600",bgClass:"bg-amber-50 dark:bg-amber-950/30",icon:k.Square},"run:crashed":{label:"crashed",colorClass:"text-red-600",bgClass:"bg-red-50 dark:bg-red-950/30",icon:aR.default},"run:rejected":{label:"rejected",colorClass:"text-orange-600",bgClass:"bg-orange-50 dark:bg-orange-950/30",icon:bH.Ban}};function bR(a){return a.startsWith("run:")}function bS({timings:a,loading:d,error:f,rejectionFeedback:g}){let{t:i}=(0,e.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(d)return(0,b.jsx)("div",{"data-testid":"activity-tab-loading",className:"flex items-center justify-center p-8",children:(0,b.jsx)(h.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)(S.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)(a7.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=>!bR(a.phase)),l=Math.max(...k.map(a=>bL(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,g),n=m.length>1,o=k.reduce((a,b)=>a+bL(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)(bT,{iteration:a,showHeader:n,maxDurationMs:l,now:j},a.number))}),o>0?(0,b.jsx)(bX,{totalExecMs:o,totalWaitMs:p,totalInputTokens:q,totalOutputTokens:r,totalCostUsd:s}):null]})}function bT({iteration:a,showHeader:c,maxDurationMs:d,now:e}){let f=function(a){let b=[...a.timings].reverse().find(a=>bR(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(bR(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=>!bR(a.phase)&&a.errorMessage);d=b?.errorMessage??c.errorMessage}return(0,b.jsx)(bU,{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)(bV,{timing:c,maxDurationMs:d,now:e},`${c.agentRunId}-${c.phase}-${c.startedAt}`)})]})]})}function bU({timing:a,message:c,attachments:d,isFirst:e,isLast:f}){let g,h=bQ[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:bN(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)(S.AlertCircle,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-red-400"}):(0,b.jsx)(aa.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)(bn,{text:"",attachmentPaths:d})}):null]})}function bV({timing:a,maxDurationMs:d,now:f}){let{t:g}=(0,e.useTranslation)("web"),h=a.phase.includes(":")?a.phase.split(":")[0]:a.phase,i=a.phase.includes(":")?a.phase.split(":")[1]:null,j=null!==i,k=i?.startsWith("phase-")??!1,n=bP[h]??h,o=k?`Phase ${i.replace("phase-","")}`:null!==i?`${n} #${i}`:n,p=bL(a,f),q=!a.completedAt&&!!a.startedAt,r=q?15:2,s=d>0?Math.max(r,p/d*100):r,t=a.completedAt?k?"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)(m.Check,{className:"h-3.5 w-3.5 text-emerald-500"}):(0,b.jsx)(l.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:bt(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:bN(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)(ac.Zap,{className:"h-3 w-3 opacity-50"}),bM(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)(bG,{className:"h-3 w-3 opacity-50"}),bO(a.costUsd)]}):null]}),null!=a.approvalWaitMs&&a.approvalWaitMs>0?(0,b.jsx)(bW,{timing:a,maxDurationMs:d}):null]})}function bW({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)(bI.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:bt(d)})]})}function bX({totalExecMs:a,totalWaitMs:c,totalInputTokens:d,totalOutputTokens:f,totalCostUsd:g}){let{t:h}=(0,e.useTranslation)("web"),i=d+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)(bY,{icon:a7.Clock,label:h("activityTab.execution"),value:bt(a)}),(0,b.jsx)(bY,{icon:bI.Timer,label:h("activityTab.wait"),value:c>0?bt(c):"n/a"}),(0,b.jsx)(bY,{icon:a7.Clock,label:"Wall-clock",value:c>0?bt(a+c):bt(a)}),(0,b.jsx)(bY,{icon:bG,label:h("activityTab.cost"),value:g>0?bO(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)(ac.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:bM(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)(bJ,{className:"h-3 w-3 text-blue-500 opacity-60"}),bM(d)]}),(0,b.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,b.jsx)(bK,{className:"h-3 w-3 text-emerald-500 opacity-60"}),bM(f)]})]})]}):(0,b.jsx)("span",{className:"text-muted-foreground/40 text-sm italic tabular-nums",children:"n/a"})]})]})]})}function bY({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 bZ=a.i(45449),b$=a.i(44447);let b_=(0,V.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"}]]),b0=(0,V.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"}]]),b1=(0,V.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"}]]),b2=/^\[(\d{4}-\d{2}-\d{2}T[\d:.]+Z?)\]\s+(?:\[([^\]]+)\]\s+)?(?:\[([^\]|]+)(?:\|([^\]]+))?\]\s+)?(.*)$/,b3=/^\[(tool-result|tool|text|delta|result|tokens|cmd|file|turn|thread|error|event|raw|WORKER)\]\s*(.*)/;function b4(a){let b=a.match(b2);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(b3),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 b5({content:a}){let d=(0,c.useMemo)(()=>a?a.split("\n").filter(a=>a.trim().length>0).map(b4):[],[a]);return 0===d.length?null:(0,b.jsx)("div",{className:"flex flex-col",children:d.map((a,c)=>(0,b.jsx)(b6,{line:a},c))})}function b6({line:a}){switch(a.tag){case"tool":return(0,b.jsx)(b9,{line:a});case"tool-result":return(0,b.jsx)(cf,{line:a});case"text":case"delta":return(0,b.jsx)(cb,{line:a});case"result":return(0,b.jsx)(cc,{line:a});case"tokens":case"turn":return(0,b.jsx)(cd,{line:a});case"cmd":return(0,b.jsx)(cg,{line:a});case"file":return(0,b.jsx)(ch,{line:a});case"thread":case"event":case"info":return(0,b.jsx)(cj,{line:a});case"error":return(0,b.jsx)(ci,{line:a});case"worker":return(0,b.jsx)(ce,{line:a});default:return(0,b.jsx)(ck,{line:a})}}function b7({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 b8({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 b9({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)(b7,{value:a.timestamp}),(0,b.jsx)(b8,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(ca,{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 ca({toolName:a}){let c=a.toLowerCase();return"bash"===c?(0,b.jsx)(L.Terminal,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"read"===c||"glob"===c||"grep"===c?(0,b.jsx)(N.FileText,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):"write"===c||"edit"===c?(0,b.jsx)(b1,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"}):(0,b.jsx)(L.Terminal,{className:"mt-0.5 h-3 w-3 shrink-0 text-violet-500"})}function cb({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)(b7,{value:a.timestamp}),(0,b.jsx)(b8,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(aa.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 cc({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)(b7,{value:a.timestamp}),(0,b.jsx)(b8,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(aQ.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 cd({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)(b7,{value:a.timestamp}),(0,b.jsx)(b8,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(b_,{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 ce({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)(b7,{value:a.timestamp}),(0,b.jsx)(b8,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(b0,{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 cf({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)(b7,{value:a.timestamp}),(0,b.jsx)(b8,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(aL,{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 cg({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)(b7,{value:a.timestamp}),(0,b.jsx)(b8,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(j.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 ch({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)(b7,{value:a.timestamp}),(0,b.jsx)(b8,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(b1,{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 ci({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)(b7,{value:a.timestamp}),(0,b.jsx)(b8,{phase:a.phase}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-1.5",children:[(0,b.jsx)(S.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 cj({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)(b7,{value:a.timestamp}),(0,b.jsx)(b8,{phase:a.phase}),(0,b.jsx)("span",{className:"text-muted-foreground min-w-0 text-xs break-all",children:a.message})]})}function ck({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 cl({content:a,isConnected:d,error:f}){let{t:g}=(0,e.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)(S.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 ${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:()=>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)(N.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)(b$.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)(bZ.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)(b5,{content:a}):a})]}):(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,b.jsx)(L.Terminal,{className:"text-muted-foreground h-8 w-8"}),(0,b.jsx)("p",{className:"text-muted-foreground text-sm",children:g("logTab.noLogOutput")}),d?(0,b.jsx)("p",{className:"text-muted-foreground text-xs",children:"Waiting for log data..."}):null]})}let cm=(0,V.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 cn=a.i(4019),co=a.i(83886);let cp=(0,V.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"}]]),cq={Todo:{icon:cn.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Todo"},"Work in Progress":{icon:h.Loader2,colorClass:"text-blue-600",borderClass:"border-blue-200",spinning:!0,label:"In Progress"},Done:{icon:m.Check,colorClass:"text-emerald-600",borderClass:"border-emerald-200",label:"Done"},Review:{icon:co.Eye,colorClass:"text-amber-600",borderClass:"border-amber-200",label:"Review"}},cr={icon:cn.Circle,colorClass:"text-muted-foreground",borderClass:"border-border",label:"Unknown"};function cs({tasks:a}){let{t:c}=(0,e.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)(ct,{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)(cv,{task:a,index:c},a.title||`task-${c}`))})]})}function ct({tasks:a}){let{t:d}=(0,e.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)(cu,{icon:m.Check,label:d("taskProgress.done"),count:f.done,className:"text-emerald-600"}):null,f.wip>0?(0,b.jsx)(cu,{icon:h.Loader2,label:d("taskProgress.inProgress"),count:f.wip,className:"text-blue-600"}):null,f.review>0?(0,b.jsx)(cu,{icon:co.Eye,label:d("taskProgress.review"),count:f.review,className:"text-amber-600"}):null,f.todo>0?(0,b.jsx)(cu,{icon:cn.Circle,label:d("taskProgress.todo"),count:f.todo,className:"text-muted-foreground"}):null]})]})}function cu({icon:a,label:c,count:e,className:f}){return(0,b.jsxs)("span",{className:(0,d.cn)("flex items-center gap-1 text-xs",f),children:[(0,b.jsx)(a,{className:"h-3 w-3"}),e," ",c]})}function cv({task:a,index:e}){let[f,g]=(0,c.useState)(!1),h=cq[a.state]??cr,i=h.icon,j=a.actionItems.length>0,k=(0,c.useCallback)(()=>{j&&g(a=>!a)},[j]);return(0,b.jsxs)("div",{"data-testid":`task-card-${e}`,className:(0,d.cn)("rounded-lg border",h.borderClass),children:[(0,b.jsxs)("button",{type:"button",onClick:k,disabled:!j,className:(0,d.cn)("flex w-full items-start gap-2 px-3 py-2.5 text-start",j&&"hover:bg-muted/50 cursor-pointer transition-colors"),children:[(0,b.jsx)(i,{className:(0,d.cn)("mt-0.5 h-4 w-4 shrink-0",h.colorClass,h.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,d.cn)("text-sm font-medium",h.colorClass),children:a.title}),a.description?(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:a.description}):null]}),j?(0,b.jsx)(an.ChevronRight,{className:(0,d.cn)("text-muted-foreground mt-0.5 h-4 w-4 shrink-0 transition-transform",f&&"rotate-90")}):null]}),f&&j?(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)(cw,{item:a},a.name||`ai-${c}`))})}):null]})}function cw({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)(aQ.CheckCircle2,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-emerald-600"}):(0,b.jsx)(cp,{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)(cx,{criterion:a},a.description||`ac-${c}`))}):null]})}function cx({criterion:a}){return(0,b.jsxs)("div",{"data-testid":"acceptance-criterion",className:"flex items-start gap-1.5",children:[a.verified?(0,b.jsx)(m.Check,{className:"mt-0.5 h-3 w-3 shrink-0 text-emerald-600"}):(0,b.jsx)(cn.Circle,{className:"text-muted-foreground mt-0.5 h-3 w-3 shrink-0"}),(0,b.jsx)("span",{className:(0,d.cn)("text-[11px]",a.verified?"text-muted-foreground line-through":"text-foreground"),children:a.description})]})}let cy={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 cz({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)(h.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)(S.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)(ap.Badge,{className:cy[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)(cs,{tasks:a.tasks})]}):(0,b.jsxs)("div",{className:"flex flex-col items-center justify-center gap-2 p-8",children:[(0,b.jsx)(cm,{className:"text-muted-foreground h-8 w-8"}),(0,b.jsx)("p",{className:"text-muted-foreground text-sm",children:"No plan created yet"})]})}let cA=(0,V.default)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var cB=a.i(13126),cC=a.i(3703);function cD({data:a,onSubmitFeedback:d,onPromote:e,onDiscard:f,isSubmitting:g=!1}){let[j,k]=(0,c.useState)(""),[l,m]=(0,c.useState)(!1),[n,o]=(0,c.useState)(!1),p=(0,c.useCallback)(async()=>{j.trim()&&d&&(await d(j.trim()),k(""))},[j,d]),q=(0,c.useCallback)(async a=>{o(!1),await e?.(a)},[e]),r=(0,c.useCallback)(async()=>{m(!1),await f?.()},[f]),s="action-required"===a.state&&"exploring"===a.lifecycle,t="running"===a.state&&"exploring"===a.lifecycle;return(0,b.jsxs)("div",{className:"flex flex-col gap-4 p-4","data-testid":"prototype-tab",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(ae.FlaskConical,{className:"h-4 w-4 text-amber-500"}),(0,b.jsx)("span",{className:"text-sm font-medium",children:"Exploration Prototype"}),(a.iterationCount??0)>0&&(0,b.jsxs)(ap.Badge,{variant:"secondary","data-testid":"prototype-iteration-badge",children:["Iteration ",a.iterationCount]}),t?(0,b.jsxs)(ap.Badge,{variant:"outline",className:"text-teal-600 dark:text-teal-400",children:[(0,b.jsx)(h.Loader2,{className:"mr-1 h-3 w-3 animate-spin"}),"Generating..."]}):null,s?(0,b.jsx)(ap.Badge,{variant:"outline",className:"text-amber-600 dark:text-amber-400",children:"Awaiting feedback"}):null]}),(0,b.jsx)(cB.Separator,{}),(0,b.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,b.jsx)("label",{htmlFor:"prototype-feedback",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:"Feedback"}),(0,b.jsx)(at.Textarea,{id:"prototype-feedback",placeholder:s?"Describe what to change in the next iteration...":"Feedback can be submitted when the prototype is ready for review.",value:j,onChange:a=>k(a.target.value),disabled:!s||g,className:"min-h-24 resize-none","data-testid":"prototype-feedback-input"}),(0,b.jsxs)(ao.Button,{onClick:p,disabled:!j.trim()||!s||g,size:"sm",className:"self-end","data-testid":"prototype-submit-feedback",children:[g?(0,b.jsx)(h.Loader2,{className:"mr-1 h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(ar,{className:"mr-1 h-3.5 w-3.5"}),"Send Feedback"]})]}),(0,b.jsx)(cB.Separator,{}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsxs)(ao.Button,{variant:"default",size:"sm",onClick:()=>o(!0),disabled:!s||g,"data-testid":"prototype-promote-button",children:[(0,b.jsx)(cA,{className:"mr-1 h-3.5 w-3.5"}),"Promote to Feature"]}),(0,b.jsxs)(ao.Button,{variant:"outline",size:"sm",onClick:()=>m(!0),disabled:g,className:"text-destructive hover:text-destructive","data-testid":"prototype-discard-button",children:[(0,b.jsx)(i.Trash2,{className:"mr-1 h-3.5 w-3.5"}),"Discard"]})]}),(0,b.jsx)(cC.AlertDialog,{open:n,onOpenChange:o,children:(0,b.jsxs)(cC.AlertDialogContent,{children:[(0,b.jsxs)(cC.AlertDialogHeader,{children:[(0,b.jsx)(cC.AlertDialogTitle,{children:"Promote to Feature"}),(0,b.jsx)(cC.AlertDialogDescription,{children:"Choose the mode for the promoted feature. The prototype code will be preserved as the starting point."})]}),(0,b.jsxs)(cC.AlertDialogFooter,{className:"flex-col gap-2 sm:flex-row",children:[(0,b.jsx)(cC.AlertDialogCancel,{children:"Cancel"}),(0,b.jsx)(cC.AlertDialogAction,{onClick:()=>q(aS.FeatureMode.Fast),"data-testid":"promote-fast",children:"Fast (Direct Implementation)"}),(0,b.jsx)(cC.AlertDialogAction,{onClick:()=>q(aS.FeatureMode.Regular),"data-testid":"promote-regular",children:"Regular (Full SDLC)"})]})]})}),(0,b.jsx)(cC.AlertDialog,{open:l,onOpenChange:m,children:(0,b.jsxs)(cC.AlertDialogContent,{children:[(0,b.jsxs)(cC.AlertDialogHeader,{children:[(0,b.jsx)(cC.AlertDialogTitle,{children:"Discard Exploration?"}),(0,b.jsx)(cC.AlertDialogDescription,{children:"This will delete the exploration feature, its worktree, and all prototype code. This action cannot be undone."})]}),(0,b.jsxs)(cC.AlertDialogFooter,{children:[(0,b.jsx)(cC.AlertDialogCancel,{children:"Cancel"}),(0,b.jsx)(cC.AlertDialogAction,{onClick:r,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90","data-testid":"discard-confirm",children:"Discard"})]})]})})]})}var cE=a.i(61544);function cF(){return{data:null,loading:!1,error:null}}let cG=[{key:"overview",label:"Overview",icon:T.LayoutDashboard},{key:"prototype",label:"Prototype",icon:ae.FlaskConical},{key:"activity",label:"Activity",icon:U.Activity},{key:"log",label:"Log",icon:W},{key:"plan",label:"Plan",icon:X},{key:"prd-review",label:"PRD Review",icon:Y},{key:"tech-decisions",label:"Tech Decisions",icon:Z.Cpu},{key:"product-decisions",label:"Product",icon:$.Package},{key:"merge-review",label:"Merge Review",icon:_},{key:"chat",label:"Chat",icon:aa.MessageSquare}],cH={activity:async function(a){let b=await ag(a);if("error"in b)throw Error(b.error);return{timings:b.timings,rejectionFeedback:b.rejectionFeedback}},plan:async function(a){let b=await ah(a);if("error"in b)throw Error(b.error);return b.plan}};function cI({featureName:a,headerContent:e,featureNode:g,featureId:i,initialTab:l,urlTab:m,prdData:n,prdSelections:o,onPrdSelect:p,onPrdApprove:q,onPrdReject:r,isPrdLoading:s,techData:t,onTechApprove:u,onTechReject:v,isTechLoading:w,productData:x,mergeData:y,onMergeApprove:z,onMergeReject:A,isMergeLoading:B,syncStatus:C,syncLoading:D,syncError:E,onRefreshSync:F,onRebaseOnMain:G,rebaseLoading:H,rebaseError:J,isRejecting:K,chatInput:L,onChatInputChange:M,pinnedConfig:N,continuationActionsDisabled:O=!1,sseEvents:P,onSubmitFeedback:Q,onPromote:R,onDiscardExploration:T,isPrototypeSubmitting:U,interactiveAgentEnabled:V=!0,onRetry:W,onStop:X,onStart:Y}){let Z,$=(0,f.usePathname)(),_=(0,c.useMemo)(()=>(function(a,b=!0){let c=["overview"];return"exploring"===a.lifecycle?(c.push("prototype","activity"),a.hasAgentRun&&c.push("log")):(c.push("activity"),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,V),[g,V]),aa=(0,c.useMemo)(()=>cG.filter(a=>_.includes(a.key)).map(a=>"merge-review"===a.key&&"maintain"===g.lifecycle?{...a,label:"Merge History"}:a),[_,g.lifecycle]),ae=(0,c.useMemo)(()=>{let a=$.match(/^(\/feature\/[^/]+)/);return a?a[1]:$},[$]),ag=(0,c.useMemo)(()=>m&&_.includes(m)?m:l&&_.includes(l)?l:"overview",[]),[ah,aj]=(0,c.useState)(ag),ak=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"===ah?i:null),{tabs:am,fetchTab:an,refreshTab:ao}=function(a,b){let d=Object.keys(b),[e,f]=(0,c.useState)(()=>{let a={};for(let b of d)a[b]=cF();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]=cF();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])}}(i,cH),ap=(0,c.useRef)(!1);(0,c.useEffect)(()=>{if(!ap.current)return;ap.current=!1;let a="overview"===ah?ae:`${ae}/${ah}`;a!==$&&window.history.pushState(null,"",a)},[ah,ae,$]);let aq=(0,c.useRef)($);(0,c.useEffect)(()=>{if(aq.current===$||(aq.current=$,ap.current))return;let a=$.split("/"),b=a.length>=4?a[3]:void 0,c=b&&_.includes(b)?b:"overview";c!==ah&&(aj(c),("activity"===c||"plan"===c)&&an(c))},[$]);let ar=(0,c.useRef)(!1);(0,c.useEffect)(()=>{if(!ar.current&&(ar.current=!0,!m&&"overview"!==ag)){let a=`${ae}/${ag}`;a!==$&&window.history.replaceState(null,"",a)}},[]);let as=(0,c.useRef)(!1);(0,c.useEffect)(()=>{as.current||(as.current=!0,("activity"===ah||"plan"===ah)&&an(ah))},[ah,an]);let at=(0,c.useRef)(i);(0,c.useEffect)(()=>{at.current!==i&&(at.current=i,aj("overview"))},[i]);let au=(0,c.useRef)(l);(0,c.useEffect)(()=>{if(au.current!==l&&l&&_.includes(l)){au.current=l,aj(l),("activity"===l||"plan"===l)&&an(l);let a="overview"===l?ae:`${ae}/${l}`;a!==window.location.pathname&&window.history.replaceState(null,"",a)}},[l,_,ae,an]),(0,c.useEffect)(()=>{_.includes(ah)||(aj("overview"),window.location.pathname!==ae&&window.history.replaceState(null,"",ae))},[_,ah,ae]);let av=(0,c.useRef)(ah);av.current=ah;let aw=(0,c.useRef)(0);(0,c.useEffect)(()=>{if(!P||0===P.length||(aw.current>P.length&&(aw.current=0),P.length<=aw.current))return;let a=P.slice(aw.current);if(aw.current=P.length,!a.some(a=>a.featureId===i))return;ao("activity");let b=av.current;"plan"===b&&ao(b)},[P,i,ao]);let ax="running"===g.state||"creating"===g.state;(0,c.useEffect)(()=>{if(!ax)return;let a=setInterval(()=>{ao("activity")},5e3);return()=>clearInterval(a)},[ax,ao]);let az=(0,c.useCallback)(a=>{ap.current=!0,aj(a),("activity"===a||"plan"===a)&&an(a)},[an]);return(0,b.jsx)("div",{className:"flex min-h-0 flex-1 flex-col",children:(0,b.jsxs)(af.Tabs,{value:ah,onValueChange:az,className:"flex min-h-0 flex-1 flex-col",children:[(0,b.jsx)(af.TabsList,{className:"bg-muted/50 h-auto w-full shrink-0 justify-start gap-0 rounded-none border-b p-0",children:aa.map(a=>{let c=a.icon;return(0,b.jsxs)(af.TabsTrigger,{value:a.key,className:"text-muted-foreground hover:bg-muted hover:text-foreground data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:border-t-primary [&:not([data-state=active])]:border-r-border relative h-auto rounded-none border-t-2 border-r border-t-transparent border-r-transparent bg-transparent px-3.5 py-2.5 text-[13px] font-normal shadow-none transition-none last:border-r-transparent data-[state=active]:shadow-none",children:[(0,b.jsx)(c,{className:"mr-1.5 size-4"}),a.label]},a.key)})}),(0,b.jsxs)("div",{className:"bg-muted/40 shrink-0 border-b",children:[a?(0,b.jsxs)("div",{className:"flex h-12 items-stretch gap-2 pr-0 pl-4","data-testid":"feature-drawer-header",children:[(0,b.jsx)("div",{className:"flex items-center",children:g.fastMode?(0,b.jsx)(ac.Zap,{className:"size-4 shrink-0 text-amber-500"}):(0,b.jsx)(ad,{className:"text-muted-foreground/50 size-4 shrink-0"})}),(0,b.jsx)("h2",{className:"text-foreground flex min-w-0 items-center truncate text-base font-semibold tracking-tight",children:a}),g.repositoryName?(0,b.jsxs)("span",{className:"animate-in fade-in flex shrink-0 items-center gap-1.5 self-center duration-200",children:[(0,b.jsx)("span",{className:"text-muted-foreground/30 text-sm",children:"/"}),g.remoteUrl?(0,b.jsx)("a",{href:g.remoteUrl,target:"_blank",rel:"noopener noreferrer",className:"text-muted-foreground hover:text-foreground text-sm",children:g.repositoryName}):(0,b.jsx)("span",{className:"text-muted-foreground text-sm",children:g.repositoryName})]}):(0,b.jsxs)("span",{className:"flex items-center gap-1.5 self-center",children:[(0,b.jsx)("span",{className:"text-muted-foreground/30 text-sm",children:"/"}),(0,b.jsx)("span",{className:"bg-muted h-4 w-16 animate-pulse rounded"})]}),(0,b.jsx)(I.TooltipProvider,{delayDuration:300,children:(0,b.jsxs)(I.Tooltip,{children:[(0,b.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,b.jsxs)("div",{className:"ml-auto flex shrink-0 cursor-default items-center self-stretch text-xs font-medium",children:[(0,b.jsxs)("div",{className:(0,d.cn)("flex items-center gap-1.5 self-stretch px-3",ai.featureNodeStateConfig[g.state].labelClass),children:["running"===g.state?(0,b.jsx)(al,{size:"sm",className:"shrink-0"}):(Z=ai.featureNodeStateConfig[g.state].icon,(0,b.jsx)(Z,{className:"size-3.5 shrink-0"})),ai.featureNodeStateConfig[g.state].label]}),"pending"===g.state&&Y?(0,b.jsxs)("button",{type:"button",onClick:()=>Y(g.featureId),disabled:O,className:"text-muted-foreground flex items-center gap-1 self-stretch px-3 hover:bg-green-500/10 hover:text-green-600 disabled:pointer-events-none disabled:opacity-50 dark:hover:text-green-400","data-testid":"feature-drawer-start-button",children:[(0,b.jsx)(j.Play,{className:"size-3.5"})," Start"]}):"error"===g.state&&W?(0,b.jsxs)("button",{type:"button",onClick:()=>W(g.featureId),disabled:O,className:"text-muted-foreground flex items-center gap-1 self-stretch px-3 hover:bg-red-500/10 hover:text-red-500 disabled:pointer-events-none disabled:opacity-50 dark:hover:text-red-400","data-testid":"feature-drawer-retry-button",children:[(0,b.jsx)(ab.RotateCcw,{className:"size-3.5"})," Retry"]}):"running"===g.state&&X?(0,b.jsxs)("button",{type:"button",onClick:()=>X(g.featureId),className:"text-muted-foreground flex items-center gap-1 self-stretch px-3 hover:bg-red-500/10 hover:text-red-500 dark:hover:text-red-400","data-testid":"feature-drawer-stop-button",children:[(0,b.jsx)(k.Square,{className:"size-3.5"})," Stop"]}):null]})}),g.errorMessage?(0,b.jsxs)(I.TooltipContent,{side:"bottom",align:"end",sideOffset:4,className:"z-[100] max-w-xs cursor-pointer text-xs leading-relaxed select-text",onClick:()=>{navigator.clipboard.writeText(g.errorMessage)},children:[g.errorMessage,(0,b.jsx)("span",{className:"text-muted-foreground ml-1 text-[10px] italic",children:"(click to copy)"})]}):null]})})]}):null,e]}),(0,b.jsx)(af.TabsContent,{value:"overview",className:"mt-0 flex-1 overflow-y-auto",children:(0,b.jsx)(bB,{data:g,pinnedConfig:N,syncStatus:C,syncLoading:D,syncError:E,onRefreshSync:F,onRebaseOnMain:G,rebaseLoading:H,rebaseError:J})}),_.includes("prototype")?(0,b.jsx)(af.TabsContent,{value:"prototype",className:"mt-0 flex-1 overflow-y-auto",children:(0,b.jsx)(cD,{data:g,onSubmitFeedback:Q,onPromote:R,onDiscard:T,isSubmitting:U})}):null,(0,b.jsx)(af.TabsContent,{value:"activity",className:"mt-0 flex-1 overflow-y-auto",children:(0,b.jsx)(bS,{timings:am.activity.data?.timings??null,loading:am.activity.loading,error:am.activity.error,rejectionFeedback:am.activity.data?.rejectionFeedback})}),(0,b.jsx)(af.TabsContent,{value:"log",className:"mt-0 flex-1 overflow-hidden",children:(0,b.jsx)(cl,{content:ak.content,isConnected:ak.isConnected,error:ak.error})}),(0,b.jsx)(af.TabsContent,{value:"plan",className:"mt-0 flex-1 overflow-y-auto",children:(0,b.jsx)(cz,{plan:am.plan.data,loading:am.plan.loading,error:am.plan.error})}),_.includes("prd-review")?(0,b.jsx)(af.TabsContent,{value:"prd-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:n?(0,b.jsx)(ay,{data:n,selections:o??{},onSelect:p??(()=>void 0),onApprove:q??(()=>void 0),onReject:r,isProcessing:!!(s||O),isRejecting:K,chatInput:L,onChatInputChange:M}):(0,b.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,b.jsx)(h.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,_.includes("tech-decisions")?(0,b.jsx)(af.TabsContent,{value:"tech-decisions",className:"mt-0 flex min-h-0 flex-1 flex-col",children:t?(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)(aD,{data:t})}),(0,b.jsx)(cJ,{onApprove:u??(()=>void 0),onReject:v,isProcessing:!!(w||O),isRejecting:K,chatInput:L,onChatInputChange:M})]}):(0,b.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,b.jsx)(h.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})})}):null,_.includes("product-decisions")?(0,b.jsx)(af.TabsContent,{value:"product-decisions",className:"mt-0 flex-1 overflow-y-auto",children:null===x?(0,b.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,b.jsx)(h.Loader2,{className:"text-muted-foreground h-6 w-6 animate-spin"})}):x?(0,b.jsx)(aG,{data:x}):(0,b.jsx)("p",{className:"text-muted-foreground p-4 text-center text-sm",children:"No product decisions available."})}):null,_.includes("merge-review")?(0,b.jsx)(af.TabsContent,{value:"merge-review",className:"mt-0 flex min-h-0 flex-1 flex-col",children:y?(0,b.jsx)(a6,{data:y,readOnly:"maintain"===g.lifecycle,onApprove:z??(()=>void 0),onReject:A,isProcessing:!!(B||O),isRejecting:K,chatInput:L,onChatInputChange:M}):(0,b.jsx)("div",{className:"flex items-center justify-center p-8",children:B?(0,b.jsx)(h.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)(S.AlertCircle,{className:"h-6 w-6"}),(0,b.jsx)("span",{children:"Merge review data unavailable"})]})})}):null,_.includes("chat")?(0,b.jsx)(af.TabsContent,{value:"chat",className:"mt-0 flex min-h-0 flex-1 flex-col overflow-hidden",children:(0,b.jsx)(cE.ChatTab,{featureId:i,worktreePath:g.worktreePath})}):null]})})}function cJ({onApprove:a,onReject:c,isProcessing:d,isRejecting:f,chatInput:g,onChatInputChange:h}){let{t:i}=(0,e.useTranslation)("web");return(0,b.jsx)(ax,{onReject:c,onApprove:a,approveLabel:i("featureDrawer.approvePlan"),revisionPlaceholder:"Ask AI to revise the plan...",isProcessing:d,isRejecting:f,chatInput:g,onChatInputChange:h})}var cK=a.i(79622),cL=a.i(29711),cM=a.i(63360);let cN=(0,p.createServerReference)("40e387901d7199377937e1111cd720e3707f700ab4",p.callServer,void 0,p.findSourceMapURL,"rebaseFeature");var cO=a.i(74146);function cP(a){return"exploring"===a.lifecycle?"prototype":"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 cQ(a,b,d,e,f,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&&f&&g.toast.error(f)}).finally(()=>{c||j(!1)}),()=>{c=!0}},[a,b,f,h]),i}let cR=(0,p.createServerReference)("40ccbf0003479414de2e1a7a987e8bd098f3f379d9",p.callServer,void 0,p.findSourceMapURL,"getFeatureDrawerData"),cS=(0,p.createServerReference)("4098fd2d7e4966bf343312a50feb88af0db0496dac",p.callServer,void 0,p.findSourceMapURL,"getBranchSyncStatus"),cT=new Map,cU=(0,p.createServerReference)("702ed01ab8898cc35b2635e221d0ce16bac4a9cce7",p.callServer,void 0,p.findSourceMapURL,"updateFeaturePinnedConfig");function cV({view:a,urlTab:p,interactiveAgentEnabled:K=!0}){var L,M;let N,O,P,Q,S,T,U=(0,B.useFeatureFlags)(),{t:V}=(0,e.useTranslation)("web"),W=(0,f.useRouter)(),X=(0,C.useSoundAction)("reject"),[Y,Z]=(0,c.useState)(a),[$,_]=(0,c.useState)(()=>"feature"===a.type?bv(a.node):null),[aa,ab]=(0,c.useState)(()=>"feature"===a.type?bv(a.node):null),[ac,ad]=(0,c.useState)(!1),[ae,af]=(0,c.useState)(null),ag=(0,c.useRef)(null);(0,c.useEffect)(()=>{Z(b=>"feature"===b.type&&"feature"===a.type&&b.node.featureId===a.node.featureId?{...a,node:{...b.node,...a.node}}:a)},[a]);let ah="feature"===Y.type?Y.node:null,ai=!!ah&&(L=ah.state,bu.has(L));(0,c.useEffect)(()=>{if("feature"!==Y.type||ac)return;let a=bv(Y.node),b=a?`${Y.node.featureId}:${a.agentType}:${a.modelId}`:`${Y.node.featureId}:none`,c=ag.current!==b;ag.current=b,_(a),ab(a),c&&af(null)},[Y,ac]);let{events:aj}=(0,F.useAgentEventsContext)(),ak=(0,c.useRef)(0);(0,c.useEffect)(()=>{if(ak.current>aj.length&&(ak.current=0),!ah||aj.length<=ak.current)return;let a=aj.slice(ak.current);for(let b of(ak.current=aj.length,(0,cO.resolveSseEventUpdates)(a)))b.featureId===ah.featureId&&"deleting"!==ah.state&&(void 0!==b.state||void 0!==b.lifecycle)&&Z(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:cP(c)}})},[aj,ah]);let al=(0,f.usePathname)().startsWith("/feature/");M=ah?.featureId??null,N=(0,c.useRef)(al),O=(0,c.useRef)(!1),P=(0,c.useRef)(0),Q=(0,c.useCallback)(async()=>{if(!M||O.current)return;O.current=!0;let a=P.current;try{let b=await cR(M);if(!b||a!==P.current)return;Z(a=>(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?cP(c):a.initialTab}})(a,b))}catch{}finally{O.current=!1}},[M,Z]),S=(0,c.useRef)(!1),(0,c.useEffect)(()=>{!al||N.current&&S.current||(S.current=!0,P.current+=1,O.current=!1,Q()),N.current=al},[al,Q]),(0,c.useEffect)(()=>{if(!al||!M)return;let a=setInterval(()=>{Q()},15e3);return()=>clearInterval(a)},[al,M,Q]);let am=(0,c.useCallback)(()=>{W.push("/")},[W]),[an,ao]=(0,c.useState)(""),[ap,aq]=(0,c.useState)(null),[ar,as]=(0,c.useState)({}),[at,au]=(0,c.useState)({}),[av,aw]=(0,c.useState)(null),[ax,ay]=(0,c.useState)(void 0),[az,aA]=(0,c.useState)(null),[aB,aC]=(0,c.useState)(!1),[aD,aE]=(0,c.useState)(!1),[aF,aG]=(0,c.useState)(!1),aH=`${ah?.featureId}:${ah?.state}`,aI=(0,c.useRef)(aH);(0,c.useEffect)(()=>{aH!==aI.current&&(aI.current=aH,aG(!1))},[aH]);let[aJ,aK]=(0,c.useState)(!1),[aL,aM]=(0,c.useState)(!1),aN=(0,c.useRef)(!1),aO="feature"===Y.type?Y.initialTab:void 0;(0,c.useEffect)(()=>{ao("")},[aO]);let aP=(0,c.useRef)(0),aQ=(0,c.useRef)(ah?.state),aR=(0,c.useRef)(ah?.lifecycle);(ah?.state!==aQ.current||ah?.lifecycle!==aR.current)&&(aQ.current=ah?.state,aR.current=ah?.lifecycle,aP.current+=1);let aS=aP.current,aT=cQ(ah?.lifecycle==="requirements"&&ah?.state==="action-required"?ah.featureId:null,y,a=>{if(a.error)return void g.toast.error(a.error);if(a.questionnaire){aq(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)}as(b),au(b)}},()=>{as({}),au({}),aq(null)},"Failed to load questionnaire",aS),aU=ah?.lifecycle==="implementation"&&ah?.state==="action-required"?ah.featureId:null,aV=cQ(aU,z,a=>{a.error?g.toast.error(a.error):a.techDecisions&&aw(a.techDecisions)},()=>aw(null),"Failed to load tech decisions",aS),aW=cQ(aU,y,a=>{a.productDecisions&&ay(a.productDecisions)},()=>ay(void 0),void 0,aS),aX=cQ(ah?.lifecycle==="review"&&(ah?.state==="action-required"||ah?.state==="error")||ah?.lifecycle==="maintain"&&ah?.pr?ah.featureId:null,A,a=>{"error"in a?g.toast.error(a.error):aA(a)},()=>aA(null),"Failed to load merge review data",aS),aY=an.trim().length>0,aZ=ah?.lifecycle==="requirements"&&ah?.state==="action-required"&&Object.keys(at).some(a=>at[a]!==ar[a]),a$=(0,c.useCallback)(()=>{ao(""),as({...at})},[at]),{attemptClose:a_}=(0,D.useGuardedDrawerClose)({open:al,isDirty:aY||aZ,onClose:am,onReset:a$}),a0=(0,c.useCallback)(async(a,b,c=[],d)=>{if(!ac&&ah?.featureId){aN.current=!0,aM(!0);try{let e=c.map(a=>a.path).filter(Boolean),f=c.filter(a=>a.notes?.trim()),h=f.length>0?`${a}
|
|
3
3
|
|
|
4
4
|
Image notes:
|
|
5
|
-
${f.map(a=>`- @${a.path}: ${a.notes.trim()}`).join("\n")}`:a,i=await u(ae.featureId,h,e);if(!i.rejected)return void g.toast.error(i.error??`Failed to reject ${b.toLowerCase()}`);U.play(),al(""),g.toast.success(`${b} rejected — agent re-iterating (iteration ${i.iteration})`),i.iterationWarning&&g.toast.warning(`Iteration ${i.iteration} — consider approving or adjusting feedback to avoid excessive iterations`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:ae.featureId}})),aj(),d?.()}finally{aI.current=!1,aH(!1)}}},[ae,aj,_,U]),aY=(0,c.useCallback)((a,b)=>aX(a,"Requirements",b,()=>ap({})),[aX]),aZ=(0,c.useCallback)((a,b)=>aX(a,"Plan",b),[aX]),a$=(0,c.useCallback)((a,b)=>aX(a,"Merge",b),[aX]),a_=(0,c.useCallback)(async a=>{if(_||!ae?.featureId)return;let b=await q(ae.featureId);b.approved?(al(""),g.toast.success(`${a} approved — agent resuming`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:ae.featureId}})),aj()):g.toast.error(b.error??`Failed to approve ${a.toLowerCase()}`)},[ae,aj,_]),a0=(0,c.useCallback)(async a=>{let b;if(_||"feature"!==V.type||!ae)return;if(am){let a=[];for(let[b,c]of Object.entries(ao)){let d=am.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(ae.featureId,b);c.approved?(al(""),g.toast.success("Requirements approved — agent resuming"),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:ae.featureId}})),ap({}),aj()):g.toast.error(c.error??"Failed to approve requirements")},[V,ae,_,am,ao,aj]),a1=(0,c.useCallback)(()=>a_("Plan"),[a_]),a2=(0,c.useCallback)(()=>a_("Merge"),[a_]),a3=(0,c.useCallback)(async(a,b,c,d)=>{az(!0),aB(!1),window.dispatchEvent(new CustomEvent("shep:feature-delete-requested",{detail:{featureId:a,cleanup:b,cascadeDelete:c,closePr:d}})),T.push("/")},[T]),a4=(0,c.useCallback)(a=>{aD(!0),window.dispatchEvent(new CustomEvent("shep:feature-archive-requested",{detail:{featureId:a}})),T.push("/")},[T]),a5=(0,c.useCallback)(a=>{aD(!0),window.dispatchEvent(new CustomEvent("shep:feature-unarchive-requested",{detail:{featureId:a}})),T.push("/")},[T]),a6=(0,c.useCallback)(async a=>{if(_)return;let b=await (0,r.resumeFeature)(a);b.error?g.toast.error(b.error):(g.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"}}))},[_]),a7=(0,c.useCallback)(async a=>{let b=await (0,t.stopFeature)(a);b.stopped?(g.toast.success("Agent stopped"),W(a=>"feature"!==a.type?a:{...a,node:{...a.node,state:"error"}})):g.toast.error(b.error??"Failed to stop")},[]),a8=(0,c.useCallback)(async a=>{if(_)return;let b=await (0,s.startFeature)(a);b.error?g.toast.error(b.error):(g.toast.success("Feature started"),W(a=>"feature"!==a.type?a:{...a,node:{...a.node,state:"running"}}))},[_]),a9=(0,c.useCallback)(async(a,b)=>{var c;if(!ae)return{ok:!1,error:"Feature is not loaded"};if(c=ae.state,!bp.has(c))return{ok:!1,error:"Pinned execution can only be changed before start, approval, or retry"};let d=Z??bq(ae),e={agentType:a,modelId:b};Y(e),ac(null),aa(!0);try{let c=await cK(ae.featureId,a,b);if(!c.ok){let a=c.error??"Failed to save pinned config";return Y(d),ac(a),g.toast.error(a),{ok:!1,error:a}}return $(e),W(a=>"feature"!==a.type||a.node.featureId!==ae.featureId?a:{...a,node:{...a.node,agentType:e.agentType,modelId:b}}),{ok:!0}}catch(b){let a=b instanceof Error?b.message:"Failed to save pinned config";return Y(d),ac(a),g.toast.error(a),{ok:!1,error:a}}finally{aa(!1)}},[ae,Z]),ba=ae?.repositoryPath&&ae?.branch?{featureId:ae.featureId,repositoryPath:ae.repositoryPath,branch:ae.branch,worktreePath:ae.worktreePath,specPath:ae.specPath}:null,bb=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(cA.openIde,d,n,w,b),[B,b]),openInShell:(0,c.useCallback)(()=>B(cB.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,cC.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,cC.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 cD(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}}(ba),bc=R.gitRebaseSync&&ae?.branch&&ae?.remoteUrl?ae.featureId:null,{data:bd,loading:be,error:bf,refresh:bg}=function(a){let[b,d]=(0,c.useState)(()=>{if(!a)return null;let b=cJ.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 cI(a);if(i.current!==a)return;if(b.success&&b.data){let c=b.data;cJ.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=cJ.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])}}(bc),bh=(0,c.useRef)(bb.rebaseLoading);(0,c.useEffect)(()=>{!bh.current||bb.rebaseLoading||bb.rebaseError||bg(),bh.current=bb.rebaseLoading},[bb.rebaseLoading,bb.rebaseError,bg]);let bi=ae?.repositoryPath&&ae.branch?{targetId:ae.featureId,targetType:"feature",repositoryPath:ae.repositoryPath,branch:ae.branch}:null,bj=(0,B.useDeployAction)(bi),bk="Booting"===bj.status||"Ready"===bj.status,[bl,bm]=(0,c.useState)(!1),bn=(0,c.useCallback)(()=>{ae?.featureId&&(navigator.clipboard.writeText(ae.featureId),bm(!0),setTimeout(()=>bm(!1),2e3))},[ae?.featureId]);if(ae){let a=ae.featureId.slice(0,8),c="text-muted-foreground hover:bg-foreground/8 hover:text-foreground inline-flex size-8 items-center justify-center rounded-[3px] disabled:opacity-40",e="bg-border/60 mx-1.5 h-5 w-px shrink-0";Q=(0,b.jsx)("div",{"data-testid":"feature-drawer-toolbar",children:(0,b.jsxs)("div",{className:"flex h-10 items-center px-2","data-testid":"feature-drawer-actions",children:[ba&&ae?.state!=="done"?(0,b.jsx)(O,{actions:bb,repositoryPath:ba.repositoryPath,worktreePath:ba.worktreePath,showSpecs:!!ba.specPath}):null,ba&&ae?.state!=="done"&&R.envDeploy&&bi?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:e}),(0,b.jsx)(F.TooltipProvider,{delayDuration:300,children:(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",disabled:bj.deployLoading||bj.stopLoading,onClick:bk?bj.stop:bj.deploy,className:(0,d.cn)("inline-flex size-7 items-center justify-center rounded-[3px] disabled:opacity-40",bk?"text-red-500 hover:bg-red-500/10 hover:text-red-400":"text-green-600 hover:bg-green-500/10 dark:text-green-500"),"aria-label":S(bk?"featureDrawer.stopDevServer":"featureDrawer.startDevServer"),children:bj.deployLoading||bj.stopLoading?(0,b.jsx)(h.Loader2,{className:"size-4 animate-spin"}):bk?(0,b.jsx)(k.Square,{className:"size-4"}):(0,b.jsx)(j.Play,{className:"size-4"})})}),(0,b.jsx)(F.TooltipContent,{side:"bottom",className:"text-xs",children:S(bk?"featureDrawer.stopDevServer":"featureDrawer.startDevServer")})]})}),bk?(0,b.jsx)(E.DeploymentStatusBadge,{status:bj.status,url:bj.url,targetId:bi?.targetId}):null]}):null,(0,b.jsx)("div",{className:"flex-1"}),(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsx)("code",{className:"text-muted-foreground/70 font-mono text-[10px] tracking-wide select-none",children:a}),(0,b.jsx)(F.TooltipProvider,{delayDuration:300,children:(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:bn,className:c,"aria-label":S("featureDrawer.copyFeatureId"),"data-testid":"feature-drawer-copy-id",children:bl?(0,b.jsx)(m.Check,{className:"size-4 text-green-500"}):(0,b.jsx)(l.Copy,{className:"size-4"})})}),(0,b.jsx)(F.TooltipContent,{side:"bottom",className:"text-xs",children:S("featureDrawer.copyFeatureId")})]})}),ae.featureId?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:e}),(0,b.jsxs)(F.TooltipProvider,{delayDuration:300,children:["archived"===ae.state?(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",disabled:aC,className:c,"data-testid":"feature-drawer-unarchive",onClick:()=>a5(ae.featureId),children:aC?(0,b.jsx)(h.Loader2,{className:"size-4 animate-spin"}):(0,b.jsx)(o.ArchiveRestore,{className:"size-3"})})}),(0,b.jsx)(F.TooltipContent,{side:"bottom",className:"text-xs",children:S("featureDrawer.unarchiveFeature")})]}):"deleting"!==ae.state?(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",disabled:aC,className:c,"data-testid":"feature-drawer-archive",onClick:()=>a4(ae.featureId),children:aC?(0,b.jsx)(h.Loader2,{className:"size-4 animate-spin"}):(0,b.jsx)(n.Archive,{className:"size-3"})})}),(0,b.jsx)(F.TooltipContent,{side:"bottom",className:"text-xs",children:S("featureDrawer.archiveFeature")})]}):null,(0,b.jsxs)(F.Tooltip,{children:[(0,b.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",disabled:ay,className:(0,d.cn)(c,"hover:bg-destructive/10 hover:text-destructive"),"data-testid":"feature-drawer-delete",onClick:()=>aB(!0),children:ay?(0,b.jsx)(h.Loader2,{className:"size-4 animate-spin"}):(0,b.jsx)(i.Trash2,{className:"size-3"})})}),(0,b.jsx)(F.TooltipContent,{side:"bottom",className:"text-xs",children:S("featureDrawer.deleteFeature")})]})]}),(0,b.jsx)(G.DeleteFeatureDialog,{open:aA,onOpenChange:aB,onConfirm:(a,b,c)=>a3(ae.featureId,a,b,c),isDeleting:ay,featureName:ae.name,featureId:ae.featureId,hasChildren:ae.hasChildren,hasOpenPr:!!ae.pr&&"Open"===ae.pr.status})]}):null]})]})})}let bo=null;if("feature"===V.type&&ae){let a={...ae,..."error"===ae.state&&{onRetry:a6},..."pending"===ae.state&&{onStart:a8}};bo=(0,b.jsx)(cy,{featureName:ae.name,headerContent:Q,featureNode:a,featureId:ae.featureId,initialTab:V.initialTab,urlTab:p,sseEvents:ag,prdData:am,prdSelections:ao,onPrdSelect:(a,b)=>ap(c=>({...c,[a]:b})),onPrdApprove:a0,onPrdReject:aY,isPrdLoading:aO,techData:as,onTechApprove:a1,onTechReject:aZ,isTechLoading:aQ,productData:aR?null:au,mergeData:aw,onMergeApprove:a2,onMergeReject:a$,isMergeLoading:aS,syncStatus:bc?bd:void 0,syncLoading:be,syncError:bf,onRefreshSync:bc?bg:void 0,onRebaseOnMain:bc?bb.rebaseOnMain:void 0,rebaseLoading:bb.rebaseLoading,rebaseError:bb.rebaseError,isRejecting:aG,chatInput:ak,onChatInputChange:al,pinnedConfig:af&&X?{...X,saving:_,error:ab,onSave:a9}:void 0,continuationActionsDisabled:_,interactiveAgentEnabled:H,onRetry:a6,onStop:a7,onStart:a8})}return(0,b.jsx)(D.BaseDrawer,{open:ai,onClose:aW,size:"lg",modal:!1,"data-testid":"feature"===V.type?"feature-drawer":"repository-drawer",children:bo})}a.s(["FeatureDrawerClient",()=>cL],64885)}];
|
|
5
|
+
${f.map(a=>`- @${a.path}: ${a.notes.trim()}`).join("\n")}`:a,i=await u(ah.featureId,h,e);if(!i.rejected)return void g.toast.error(i.error??`Failed to reject ${b.toLowerCase()}`);X.play(),ao(""),g.toast.success(`${b} rejected — agent re-iterating (iteration ${i.iteration})`),i.iterationWarning&&g.toast.warning(`Iteration ${i.iteration} — consider approving or adjusting feedback to avoid excessive iterations`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:ah.featureId}})),am(),d?.()}finally{aN.current=!1,aM(!1)}}},[ah,am,ac,X]),a1=(0,c.useCallback)((a,b)=>a0(a,"Requirements",b,()=>as({})),[a0]),a2=(0,c.useCallback)((a,b)=>a0(a,"Plan",b),[a0]),a3=(0,c.useCallback)((a,b)=>a0(a,"Merge",b),[a0]),a4=(0,c.useCallback)(async a=>{if(ac||!ah?.featureId)return;let b=await q(ah.featureId);b.approved?(ao(""),g.toast.success(`${a} approved — agent resuming`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:ah.featureId}})),am()):g.toast.error(b.error??`Failed to approve ${a.toLowerCase()}`)},[ah,am,ac]),a5=(0,c.useCallback)(async a=>{let b;if(ac||"feature"!==Y.type||!ah)return;if(ap){let a=[];for(let[b,c]of Object.entries(ar)){let d=ap.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(ah.featureId,b);c.approved?(ao(""),g.toast.success("Requirements approved — agent resuming"),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:ah.featureId}})),as({}),am()):g.toast.error(c.error??"Failed to approve requirements")},[Y,ah,ac,ap,ar,am]),a6=(0,c.useCallback)(()=>a4("Plan"),[a4]),a7=(0,c.useCallback)(()=>a4("Merge"),[a4]),a8=(0,c.useCallback)(async(a,b,c,d)=>{aC(!0),aE(!1),window.dispatchEvent(new CustomEvent("shep:feature-delete-requested",{detail:{featureId:a,cleanup:b,cascadeDelete:c,closePr:d}})),W.push("/")},[W]),a9=(0,c.useCallback)(a=>{aG(!0),window.dispatchEvent(new CustomEvent("shep:feature-archive-requested",{detail:{featureId:a}})),W.push("/")},[W]),ba=(0,c.useCallback)(a=>{aG(!0),window.dispatchEvent(new CustomEvent("shep:feature-unarchive-requested",{detail:{featureId:a}})),W.push("/")},[W]),bb=(0,c.useCallback)(async a=>{if(ac)return;let b=await (0,r.resumeFeature)(a);b.error?g.toast.error(b.error):(g.toast.success("Feature resumed — agent restarting"),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:a}})),Z(a=>"feature"!==a.type?a:{...a,node:{...a.node,state:"running"}}))},[ac]),bc=(0,c.useCallback)(async a=>{let b=await (0,t.stopFeature)(a);b.stopped?(g.toast.success("Agent stopped"),Z(a=>"feature"!==a.type?a:{...a,node:{...a.node,state:"error"}})):g.toast.error(b.error??"Failed to stop")},[]),bd=(0,c.useCallback)(async a=>{if(ac)return;let b=await (0,s.startFeature)(a);b.error?g.toast.error(b.error):(g.toast.success("Feature started"),Z(a=>"feature"!==a.type?a:{...a,node:{...a.node,state:"running"}}))},[ac]),be=(0,c.useCallback)(async(a,b)=>{var c;if(!ah)return{ok:!1,error:"Feature is not loaded"};if(c=ah.state,!bu.has(c))return{ok:!1,error:"Pinned execution can only be changed before start, approval, or retry"};let d=aa??bv(ah),e={agentType:a,modelId:b};_(e),af(null),ad(!0);try{let c=await cU(ah.featureId,a,b);if(!c.ok){let a=c.error??"Failed to save pinned config";return _(d),af(a),g.toast.error(a),{ok:!1,error:a}}return ab(e),Z(a=>"feature"!==a.type||a.node.featureId!==ah.featureId?a:{...a,node:{...a.node,agentType:e.agentType,modelId:b}}),{ok:!0}}catch(b){let a=b instanceof Error?b.message:"Failed to save pinned config";return _(d),af(a),g.toast.error(a),{ok:!1,error:a}}finally{ad(!1)}},[ah,aa]),bf=(0,c.useCallback)(async a=>{if(ah?.featureId){aK(!0);try{let b=await v(ah.featureId,a);if(!b.submitted)return void g.toast.error(b.error??"Failed to submit feedback");g.toast.success(`Feedback sent — generating iteration ${(b.iteration??0)+1}`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:ah.featureId}}))}finally{aK(!1)}}},[ah]),bg=(0,c.useCallback)(async a=>{if(ah?.featureId){aK(!0);try{let b=await w(ah.featureId,a);if(b.error)return void g.toast.error(b.error);g.toast.success(`Exploration promoted to ${"Fast"===a?"fast":"regular"} mode`),window.dispatchEvent(new CustomEvent("shep:feature-approved",{detail:{featureId:ah.featureId}}))}finally{aK(!1)}}},[ah]),bh=(0,c.useCallback)(async()=>{if(ah?.featureId){aK(!0);try{let a=await x(ah.featureId);if(!a.discarded)return void g.toast.error(a.error??"Failed to discard exploration");g.toast.success("Exploration discarded"),window.dispatchEvent(new CustomEvent("shep:feature-delete-requested",{detail:{featureId:ah.featureId,cleanup:!0}})),W.push("/")}finally{aK(!1)}}},[ah,W]),bi=ah?.repositoryPath&&ah?.branch?{featureId:ah.featureId,repositoryPath:ah.repositoryPath,branch:ah.branch,worktreePath:ah.worktreePath,specPath:ah.specPath}:null,bj=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(cK.openIde,d,n,w,b),[B,b]),openInShell:(0,c.useCallback)(()=>B(cL.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,cM.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,cM.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 cN(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}}(bi),bk=U.gitRebaseSync&&ah?.branch&&ah?.remoteUrl?ah.featureId:null,{data:bl,loading:bm,error:bn,refresh:bo}=function(a){let[b,d]=(0,c.useState)(()=>{if(!a)return null;let b=cT.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 cS(a);if(i.current!==a)return;if(b.success&&b.data){let c=b.data;cT.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=cT.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])}}(bk),bp=(0,c.useRef)(bj.rebaseLoading);(0,c.useEffect)(()=>{!bp.current||bj.rebaseLoading||bj.rebaseError||bo(),bp.current=bj.rebaseLoading},[bj.rebaseLoading,bj.rebaseError,bo]);let bq=ah?.repositoryPath&&ah.branch?{targetId:ah.featureId,targetType:"feature",repositoryPath:ah.repositoryPath,branch:ah.branch}:null,br=(0,E.useDeployAction)(bq),bs="Booting"===br.status||"Ready"===br.status,[bt,bw]=(0,c.useState)(!1),bx=(0,c.useCallback)(()=>{ah?.featureId&&(navigator.clipboard.writeText(ah.featureId),bw(!0),setTimeout(()=>bw(!1),2e3))},[ah?.featureId]);if(ah){let a=ah.featureId.slice(0,8),c="text-muted-foreground hover:bg-foreground/8 hover:text-foreground inline-flex size-8 items-center justify-center rounded-[3px] disabled:opacity-40",e="bg-border/60 mx-1.5 h-5 w-px shrink-0";T=(0,b.jsx)("div",{"data-testid":"feature-drawer-toolbar",children:(0,b.jsxs)("div",{className:"flex h-10 items-center px-2","data-testid":"feature-drawer-actions",children:[bi&&ah?.state!=="done"?(0,b.jsx)(R,{actions:bj,repositoryPath:bi.repositoryPath,worktreePath:bi.worktreePath,showSpecs:!!bi.specPath}):null,bi&&ah?.state!=="done"&&U.envDeploy&&bq?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:e}),(0,b.jsx)(I.TooltipProvider,{delayDuration:300,children:(0,b.jsxs)(I.Tooltip,{children:[(0,b.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",disabled:br.deployLoading||br.stopLoading,onClick:bs?br.stop:br.deploy,className:(0,d.cn)("inline-flex size-7 items-center justify-center rounded-[3px] disabled:opacity-40",bs?"text-red-500 hover:bg-red-500/10 hover:text-red-400":"text-green-600 hover:bg-green-500/10 dark:text-green-500"),"aria-label":V(bs?"featureDrawer.stopDevServer":"featureDrawer.startDevServer"),children:br.deployLoading||br.stopLoading?(0,b.jsx)(h.Loader2,{className:"size-4 animate-spin"}):bs?(0,b.jsx)(k.Square,{className:"size-4"}):(0,b.jsx)(j.Play,{className:"size-4"})})}),(0,b.jsx)(I.TooltipContent,{side:"bottom",className:"text-xs",children:V(bs?"featureDrawer.stopDevServer":"featureDrawer.startDevServer")})]})}),bs?(0,b.jsx)(H.DeploymentStatusBadge,{status:br.status,url:br.url,targetId:bq?.targetId}):null]}):null,(0,b.jsx)("div",{className:"flex-1"}),(0,b.jsxs)("div",{className:"flex items-center",children:[(0,b.jsx)("code",{className:"text-muted-foreground/70 font-mono text-[10px] tracking-wide select-none",children:a}),(0,b.jsx)(I.TooltipProvider,{delayDuration:300,children:(0,b.jsxs)(I.Tooltip,{children:[(0,b.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",onClick:bx,className:c,"aria-label":V("featureDrawer.copyFeatureId"),"data-testid":"feature-drawer-copy-id",children:bt?(0,b.jsx)(m.Check,{className:"size-4 text-green-500"}):(0,b.jsx)(l.Copy,{className:"size-4"})})}),(0,b.jsx)(I.TooltipContent,{side:"bottom",className:"text-xs",children:V("featureDrawer.copyFeatureId")})]})}),ah.featureId?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:e}),(0,b.jsxs)(I.TooltipProvider,{delayDuration:300,children:["archived"===ah.state?(0,b.jsxs)(I.Tooltip,{children:[(0,b.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",disabled:aF,className:c,"data-testid":"feature-drawer-unarchive",onClick:()=>ba(ah.featureId),children:aF?(0,b.jsx)(h.Loader2,{className:"size-4 animate-spin"}):(0,b.jsx)(o.ArchiveRestore,{className:"size-3"})})}),(0,b.jsx)(I.TooltipContent,{side:"bottom",className:"text-xs",children:V("featureDrawer.unarchiveFeature")})]}):"deleting"!==ah.state?(0,b.jsxs)(I.Tooltip,{children:[(0,b.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",disabled:aF,className:c,"data-testid":"feature-drawer-archive",onClick:()=>a9(ah.featureId),children:aF?(0,b.jsx)(h.Loader2,{className:"size-4 animate-spin"}):(0,b.jsx)(n.Archive,{className:"size-3"})})}),(0,b.jsx)(I.TooltipContent,{side:"bottom",className:"text-xs",children:V("featureDrawer.archiveFeature")})]}):null,(0,b.jsxs)(I.Tooltip,{children:[(0,b.jsx)(I.TooltipTrigger,{asChild:!0,children:(0,b.jsx)("button",{type:"button",disabled:aB,className:(0,d.cn)(c,"hover:bg-destructive/10 hover:text-destructive"),"data-testid":"feature-drawer-delete",onClick:()=>aE(!0),children:aB?(0,b.jsx)(h.Loader2,{className:"size-4 animate-spin"}):(0,b.jsx)(i.Trash2,{className:"size-3"})})}),(0,b.jsx)(I.TooltipContent,{side:"bottom",className:"text-xs",children:V("featureDrawer.deleteFeature")})]})]}),(0,b.jsx)(J.DeleteFeatureDialog,{open:aD,onOpenChange:aE,onConfirm:(a,b,c)=>a8(ah.featureId,a,b,c),isDeleting:aB,featureName:ah.name,featureId:ah.featureId,hasChildren:ah.hasChildren,hasOpenPr:!!ah.pr&&"Open"===ah.pr.status})]}):null]})]})})}let by=null;if("feature"===Y.type&&ah){let a={...ah,..."error"===ah.state&&{onRetry:bb},..."pending"===ah.state&&{onStart:bd}};by=(0,b.jsx)(cI,{featureName:ah.name,headerContent:T,featureNode:a,featureId:ah.featureId,initialTab:Y.initialTab,urlTab:p,sseEvents:aj,prdData:ap,prdSelections:ar,onPrdSelect:(a,b)=>as(c=>({...c,[a]:b})),onPrdApprove:a5,onPrdReject:a1,isPrdLoading:aT,techData:av,onTechApprove:a6,onTechReject:a2,isTechLoading:aV,productData:aW?null:ax,mergeData:az,onMergeApprove:a7,onMergeReject:a3,isMergeLoading:aX,syncStatus:bk?bl:void 0,syncLoading:bm,syncError:bn,onRefreshSync:bk?bo:void 0,onRebaseOnMain:bk?bj.rebaseOnMain:void 0,rebaseLoading:bj.rebaseLoading,rebaseError:bj.rebaseError,isRejecting:aL,chatInput:an,onChatInputChange:ao,pinnedConfig:ai&&$?{...$,saving:ac,error:ae,onSave:be}:void 0,continuationActionsDisabled:ac,onSubmitFeedback:bf,onPromote:bg,onDiscardExploration:bh,isPrototypeSubmitting:aJ,interactiveAgentEnabled:K,onRetry:bb,onStop:bc,onStart:bd})}return(0,b.jsx)(G.BaseDrawer,{open:al,onClose:a_,size:"lg",modal:!1,"data-testid":"feature"===Y.type?"feature-drawer":"repository-drawer",children:by})}a.s(["FeatureDrawerClient",()=>cV],64885)}];
|
|
6
6
|
|
|
7
7
|
//# sourceMappingURL=744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js.map
|