@shepai/cli 1.84.0 → 1.85.0-pr167.6a51d2e
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/Attachment.yaml +31 -0
- package/apis/json-schema/Feature.yaml +5 -0
- package/dist/packages/core/src/application/ports/output/services/worktree-service.interface.d.ts +2 -1
- package/dist/packages/core/src/application/ports/output/services/worktree-service.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/cleanup-feature-worktree.use-case.d.ts +22 -0
- package/dist/packages/core/src/application/use-cases/features/cleanup-feature-worktree.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/features/cleanup-feature-worktree.use-case.js +76 -0
- 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 +35 -3
- package/dist/packages/core/src/application/use-cases/features/create/types.d.ts +7 -1
- 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 +7 -2
- 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 +29 -15
- package/dist/packages/core/src/domain/generated/output.d.ts +33 -0
- package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.js +8 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/feature.mapper.d.ts +1 -0
- 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 +4 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations.js +16 -0
- 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 +3 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.d.ts +2 -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 +3 -0
- package/dist/packages/core/src/infrastructure/services/attachment-storage.service.d.ts +31 -0
- package/dist/packages/core/src/infrastructure/services/attachment-storage.service.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/attachment-storage.service.js +136 -0
- package/dist/packages/core/src/infrastructure/services/git/worktree.service.d.ts +1 -1
- package/dist/packages/core/src/infrastructure/services/git/worktree.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/git/worktree.service.js +6 -2
- package/dist/src/presentation/cli/commands/feat/del.command.d.ts +3 -1
- package/dist/src/presentation/cli/commands/feat/del.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/del.command.js +19 -2
- 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 -1
- package/dist/src/presentation/web/app/actions/compose-user-input.d.ts +7 -0
- package/dist/src/presentation/web/app/actions/compose-user-input.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/compose-user-input.js +7 -0
- package/dist/src/presentation/web/app/actions/create-feature.d.ts +1 -0
- package/dist/src/presentation/web/app/actions/create-feature.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/create-feature.js +3 -9
- package/dist/src/presentation/web/app/actions/delete-feature.d.ts +1 -1
- package/dist/src/presentation/web/app/actions/delete-feature.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/delete-feature.js +4 -2
- package/dist/src/presentation/web/app/api/attachments/preview/route.d.ts +4 -0
- package/dist/src/presentation/web/app/api/attachments/preview/route.d.ts.map +1 -0
- package/dist/src/presentation/web/app/api/attachments/preview/route.js +47 -0
- package/dist/src/presentation/web/app/api/attachments/upload/route.d.ts +3 -0
- package/dist/src/presentation/web/app/api/attachments/upload/route.d.ts.map +1 -0
- package/dist/src/presentation/web/app/api/attachments/upload/route.js +100 -0
- package/dist/src/presentation/web/components/common/attachment-card/attachment-card.d.ts +16 -0
- package/dist/src/presentation/web/components/common/attachment-card/attachment-card.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/attachment-card/attachment-card.js +53 -0
- package/dist/src/presentation/web/components/common/attachment-card/attachment-card.stories.d.ts +12 -0
- package/dist/src/presentation/web/components/common/attachment-card/attachment-card.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/attachment-card/attachment-card.stories.js +55 -0
- package/dist/src/presentation/web/components/common/attachment-card/index.d.ts +3 -0
- package/dist/src/presentation/web/components/common/attachment-card/index.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/attachment-card/index.js +1 -0
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.d.ts +11 -0
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.js +34 -0
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.stories.d.ts +10 -0
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.stories.js +44 -0
- package/dist/src/presentation/web/components/common/attachment-chip/index.d.ts +3 -0
- package/dist/src/presentation/web/components/common/attachment-chip/index.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/attachment-chip/index.js +1 -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 +5 -4
- package/dist/src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog-config.d.ts +9 -0
- package/dist/src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog-config.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog-config.js +1 -0
- package/dist/src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog.d.ts +3 -0
- package/dist/src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog.js +16 -0
- package/dist/src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog.stories.d.ts +8 -0
- package/dist/src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog.stories.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog.stories.js +25 -0
- package/dist/src/presentation/web/components/common/delete-feature-dialog/index.d.ts +3 -0
- package/dist/src/presentation/web/components/common/delete-feature-dialog/index.d.ts.map +1 -0
- package/dist/src/presentation/web/components/common/delete-feature-dialog/index.js +1 -0
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts +11 -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 +199 -60
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.stories.d.ts +6 -0
- 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 +18 -0
- package/dist/src/presentation/web/components/features/control-center/use-control-center-state.d.ts +1 -1
- package/dist/src/presentation/web/components/features/control-center/use-control-center-state.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/control-center/use-control-center-state.js +2 -2
- package/dist/src/presentation/web/components/ui/dialog.js +1 -1
- package/dist/src/presentation/web/next.config.d.ts.map +1 -1
- package/dist/src/presentation/web/next.config.js +6 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/app-path-routes-manifest.json +2 -0
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +4 -1
- package/web/.next/required-server-files.json +4 -1
- package/web/.next/routes-manifest.json +12 -0
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +18 -18
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js +2 -2
- 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]/page/server-reference-manifest.json +21 -21
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +2 -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]/page/server-reference-manifest.json +14 -14
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +2 -2
- 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)/create/page/server-reference-manifest.json +18 -18
- package/web/.next/server/app/(dashboard)/create/page.js +2 -2
- 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]/page/server-reference-manifest.json +21 -21
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +2 -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/server-reference-manifest.json +14 -14
- package/web/.next/server/app/(dashboard)/page.js +2 -2
- 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]/page/server-reference-manifest.json +14 -14
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +2 -2
- 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.js +2 -2
- package/web/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/_not-found/page.js +2 -2
- package/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/api/attachments/preview/route/app-paths-manifest.json +3 -0
- package/web/.next/server/app/api/attachments/preview/route/build-manifest.json +11 -0
- package/web/.next/server/app/api/attachments/preview/route/server-reference-manifest.json +4 -0
- package/web/.next/server/app/api/attachments/preview/route.js +7 -0
- package/web/.next/server/app/api/attachments/preview/route.js.map +5 -0
- package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -0
- package/web/.next/server/app/api/attachments/preview/route_client-reference-manifest.js +2 -0
- package/web/.next/server/app/api/attachments/upload/route/app-paths-manifest.json +3 -0
- package/web/.next/server/app/api/attachments/upload/route/build-manifest.json +11 -0
- package/web/.next/server/app/api/attachments/upload/route/server-reference-manifest.json +4 -0
- package/web/.next/server/app/api/attachments/upload/route.js +7 -0
- package/web/.next/server/app/api/attachments/upload/route.js.map +5 -0
- package/web/.next/server/app/api/attachments/upload/route.js.nft.json +1 -0
- package/web/.next/server/app/api/attachments/upload/route_client-reference-manifest.js +2 -0
- package/web/.next/server/app/api/feature-logs/route.js +1 -1
- package/web/.next/server/app/api/feature-logs/route.js.nft.json +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +5 -5
- package/web/.next/server/app/settings/page.js +2 -2
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +6 -6
- package/web/.next/server/app/skills/page.js +2 -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/server-reference-manifest.json +6 -6
- package/web/.next/server/app/tools/page.js +2 -2
- package/web/.next/server/app/tools/page.js.nft.json +1 -1
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +1 -1
- package/web/.next/server/app/version/page.js +2 -2
- package/web/.next/server/app/version/page.js.nft.json +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app-paths-manifest.json +2 -0
- package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_4d623b8e.js.map +1 -1
- package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_attachments_preview_route_actions_0f48c3e9.js +3 -0
- package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_attachments_preview_route_actions_0f48c3e9.js.map +1 -0
- package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_attachments_upload_route_actions_48fe4a8f.js +3 -0
- package/web/.next/server/chunks/744ca_web__next-internal_server_app_api_attachments_upload_route_actions_48fe4a8f.js.map +1 -0
- package/web/.next/server/chunks/[root-of-the-server]__0b10355c._.js +3 -0
- package/web/.next/server/chunks/[root-of-the-server]__0b10355c._.js.map +1 -0
- package/web/.next/server/chunks/{[root-of-the-server]__91d44424._.js → [root-of-the-server]__52c318d1._.js} +2 -2
- package/web/.next/server/chunks/[root-of-the-server]__b2f9a412._.js +3 -0
- package/web/.next/server/chunks/[root-of-the-server]__b2f9a412._.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/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_da7eef33.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_da7eef33.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_0a9251aa.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_0a9251aa.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__11033878._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__17143953._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__17143953._.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]__4be9a9bb._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4be9a9bb._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__5d87af2e._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7134fb85._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7134fb85._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__3534949f._.js → [root-of-the-server]__8d9536c4._.js} +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9de266fa._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9de266fa._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b14946f5._.js +10 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__c3694f82._.js.map → [root-of-the-server]__b14946f5._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b3a4cef4._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b3a4cef4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b65f78cf._.js +3 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__55f60c9d._.js.map → [root-of-the-server]__b65f78cf._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f0d8d054._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f0d8d054._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__ad2b2a3c._.js → [root-of-the-server]__f1a05100._.js} +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f8210f45._.js +3 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__01a37f7a._.js.map → [root-of-the-server]__f8210f45._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fdc75809._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_1bb131c4._.js +1 -1
- package/web/.next/server/chunks/ssr/_1bb131c4._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_1e3cf73b._.js +1 -1
- package/web/.next/server/chunks/ssr/_1e3cf73b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_34fbed18._.js +1 -1
- package/web/.next/server/chunks/ssr/_34fbed18._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_63868199._.js +1 -1
- package/web/.next/server/chunks/ssr/_63868199._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_6e08ce21._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_8dacd1e7._.js +1 -1
- package/web/.next/server/chunks/ssr/_8dacd1e7._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_9ac70f88._.js +5 -0
- package/web/.next/server/chunks/ssr/_9ac70f88._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_a68d7e1c._.js +1 -1
- package/web/.next/server/chunks/ssr/_a68d7e1c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_3e88ce9d._.js → _cf366ac8._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_3e88ce9d._.js.map → _cf366ac8._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_d2d64567._.js +3 -0
- package/web/.next/server/chunks/ssr/_d2d64567._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_d42594dd._.js +3 -0
- package/web/.next/server/chunks/ssr/_d42594dd._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{_3785d5be._.js → _f942df4a._.js} +2 -2
- package/web/.next/server/chunks/ssr/_f942df4a._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_fa0c43f6._.js +3 -0
- package/web/.next/server/chunks/ssr/_fa0c43f6._.js.map +1 -0
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_07f6911c._.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules__pnpm_07f6911c._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_021a05f2.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_021a05f2.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_c4348b8a._.js +2 -3
- package/web/.next/server/chunks/ssr/src_presentation_web_c4348b8a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_tools_tools-page-client_tsx_3d0aa70c._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_tools_tools-page-client_tsx_3d0aa70c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_e4510d10._.js +2 -3
- package/web/.next/server/chunks/ssr/src_presentation_web_e4510d10._.js.map +1 -1
- 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 +28 -28
- package/web/.next/static/chunks/16fe11f10a119519.js +1 -0
- package/web/.next/static/chunks/2a8d259fc0cdff2d.js +1 -0
- package/web/.next/static/chunks/30c827a88342741e.js +1 -0
- package/web/.next/static/chunks/3e8563e1c30fa11d.js +1 -0
- package/web/.next/static/chunks/40b9e74b44955a46.js +1 -0
- package/web/.next/static/chunks/50f89c3112f6dd23.css +2 -0
- package/web/.next/static/chunks/52b56677c842e45f.js +3 -0
- package/web/.next/static/chunks/5c4f9fea532f70b7.js +1 -0
- package/web/.next/static/chunks/{d00436ccde44862f.js → 63626066e7086cbd.js} +1 -1
- package/web/.next/static/chunks/6973367e995e5687.js +1 -0
- package/web/.next/static/chunks/7948d121144c9676.js +1 -0
- package/web/.next/static/chunks/{4de791d92c72ae58.js → 90c7780bce73ecd2.js} +1 -1
- package/web/.next/static/chunks/{0fb7745c30469b39.js → b31f2c82654437a6.js} +1 -1
- package/web/.next/static/chunks/{48060fe38d7b8432.js → dde79813a9022aeb.js} +3 -3
- package/web/.next/static/chunks/f56c201e14d8ddf6.js +1 -0
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_c7cfe351._.js +0 -3
- package/web/.next/server/chunks/ssr/7f428_lucide-react_dist_esm_icons_c7cfe351._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__01a37f7a._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__55f60c9d._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ae824a5b._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ae824a5b._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c3694f82._.js +0 -10
- package/web/.next/server/chunks/ssr/_0387eb83._.js +0 -3
- package/web/.next/server/chunks/ssr/_0387eb83._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_3785d5be._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_67dd9041._.js +0 -3
- package/web/.next/server/chunks/ssr/_67dd9041._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_c3a8bcb1._.js +0 -3
- package/web/.next/server/chunks/ssr/_c3a8bcb1._.js.map +0 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_04f4e45f._.js +0 -5
- package/web/.next/server/chunks/ssr/node_modules__pnpm_04f4e45f._.js.map +0 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_c931457d._.js +0 -3
- package/web/.next/server/chunks/ssr/node_modules__pnpm_c931457d._.js.map +0 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_d80c1060._.js +0 -3
- package/web/.next/server/chunks/ssr/node_modules__pnpm_d80c1060._.js.map +0 -1
- package/web/.next/static/chunks/2a24ac257fc1c10b.js +0 -1
- package/web/.next/static/chunks/6b4620c8b57a0683.js +0 -1
- package/web/.next/static/chunks/6d0190cd8484320c.js +0 -1
- package/web/.next/static/chunks/6f0622cb06faf358.js +0 -1
- package/web/.next/static/chunks/7e92542991a14568.js +0 -1
- package/web/.next/static/chunks/a1c2ecb710b44081.js +0 -1
- package/web/.next/static/chunks/a56b3854d2169db0.js +0 -1
- package/web/.next/static/chunks/ae01d2be1d0bad47.css +0 -2
- package/web/.next/static/chunks/de2515446676e0ae.js +0 -1
- package/web/.next/static/chunks/df0b93fbb9b512e6.js +0 -1
- package/web/.next/static/chunks/e405f0502431ea60.js +0 -3
- /package/web/.next/server/chunks/{[root-of-the-server]__91d44424._.js.map → [root-of-the-server]__52c318d1._.js.map} +0 -0
- /package/web/.next/server/chunks/ssr/{[root-of-the-server]__3534949f._.js.map → [root-of-the-server]__8d9536c4._.js.map} +0 -0
- /package/web/.next/server/chunks/ssr/{[root-of-the-server]__ad2b2a3c._.js.map → [root-of-the-server]__f1a05100._.js.map} +0 -0
- /package/web/.next/static/{7IllAyl6ItP_HYk-RfUYQ → kHnKnlUMoFHN49jX7Vp6o}/_buildManifest.js +0 -0
- /package/web/.next/static/{7IllAyl6ItP_HYk-RfUYQ → kHnKnlUMoFHN49jX7Vp6o}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{7IllAyl6ItP_HYk-RfUYQ → kHnKnlUMoFHN49jX7Vp6o}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
import { readFile, stat } from 'fs/promises';
|
|
3
|
+
import { extname, resolve } from 'path';
|
|
4
|
+
import { getShepHomeDir } from '../../../../../../../packages/core/src/infrastructure/services/filesystem/shep-directory.service.js';
|
|
5
|
+
const MIME_MAP = {
|
|
6
|
+
'.png': 'image/png',
|
|
7
|
+
'.jpg': 'image/jpeg',
|
|
8
|
+
'.jpeg': 'image/jpeg',
|
|
9
|
+
'.gif': 'image/gif',
|
|
10
|
+
'.webp': 'image/webp',
|
|
11
|
+
'.svg': 'image/svg+xml',
|
|
12
|
+
'.bmp': 'image/bmp',
|
|
13
|
+
'.ico': 'image/x-icon',
|
|
14
|
+
'.pdf': 'application/pdf',
|
|
15
|
+
'.txt': 'text/plain',
|
|
16
|
+
'.md': 'text/markdown',
|
|
17
|
+
'.json': 'application/json',
|
|
18
|
+
'.yaml': 'text/yaml',
|
|
19
|
+
'.yml': 'text/yaml',
|
|
20
|
+
};
|
|
21
|
+
export async function GET(request) {
|
|
22
|
+
const path = request.nextUrl.searchParams.get('path');
|
|
23
|
+
const mimeTypeHint = request.nextUrl.searchParams.get('mimeType');
|
|
24
|
+
if (!path) {
|
|
25
|
+
return NextResponse.json({ error: 'Missing path parameter' }, { status: 400 });
|
|
26
|
+
}
|
|
27
|
+
// Security: only allow paths within SHEP_HOME/attachments
|
|
28
|
+
const attachmentsRoot = resolve(getShepHomeDir(), 'attachments');
|
|
29
|
+
if (!resolve(path).startsWith(attachmentsRoot)) {
|
|
30
|
+
return NextResponse.json({ error: 'Access denied' }, { status: 403 });
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
await stat(path);
|
|
34
|
+
const buffer = await readFile(path);
|
|
35
|
+
const ext = extname(path).toLowerCase();
|
|
36
|
+
const contentType = MIME_MAP[ext] ?? mimeTypeHint ?? 'application/octet-stream';
|
|
37
|
+
return new NextResponse(buffer, {
|
|
38
|
+
headers: {
|
|
39
|
+
'Content-Type': contentType,
|
|
40
|
+
'Cache-Control': 'private, max-age=3600',
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
catch {
|
|
45
|
+
return NextResponse.json({ error: 'File not found' }, { status: 404 });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../../../../../src/presentation/web/app/api/attachments/upload/route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAqE3C,wBAAsB,IAAI,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,CAkDlE"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { NextResponse } from 'next/server';
|
|
2
|
+
import { resolve } from '../../../../lib/server-container.js';
|
|
3
|
+
const MAX_FILE_SIZE = 10 * 1024 * 1024; // 10 MB
|
|
4
|
+
const ALLOWED_EXTENSIONS = new Set([
|
|
5
|
+
'.png',
|
|
6
|
+
'.jpg',
|
|
7
|
+
'.jpeg',
|
|
8
|
+
'.gif',
|
|
9
|
+
'.webp',
|
|
10
|
+
'.svg',
|
|
11
|
+
'.bmp',
|
|
12
|
+
'.ico',
|
|
13
|
+
'.pdf',
|
|
14
|
+
'.doc',
|
|
15
|
+
'.docx',
|
|
16
|
+
'.xls',
|
|
17
|
+
'.xlsx',
|
|
18
|
+
'.ppt',
|
|
19
|
+
'.pptx',
|
|
20
|
+
'.txt',
|
|
21
|
+
'.md',
|
|
22
|
+
'.csv',
|
|
23
|
+
'.json',
|
|
24
|
+
'.yaml',
|
|
25
|
+
'.yml',
|
|
26
|
+
'.xml',
|
|
27
|
+
'.ts',
|
|
28
|
+
'.tsx',
|
|
29
|
+
'.js',
|
|
30
|
+
'.jsx',
|
|
31
|
+
'.py',
|
|
32
|
+
'.rb',
|
|
33
|
+
'.go',
|
|
34
|
+
'.rs',
|
|
35
|
+
'.java',
|
|
36
|
+
'.c',
|
|
37
|
+
'.cpp',
|
|
38
|
+
'.h',
|
|
39
|
+
'.hpp',
|
|
40
|
+
'.cs',
|
|
41
|
+
'.swift',
|
|
42
|
+
'.kt',
|
|
43
|
+
'.html',
|
|
44
|
+
'.css',
|
|
45
|
+
'.scss',
|
|
46
|
+
'.less',
|
|
47
|
+
'.sh',
|
|
48
|
+
'.bash',
|
|
49
|
+
'.zsh',
|
|
50
|
+
'.fish',
|
|
51
|
+
'.toml',
|
|
52
|
+
'.ini',
|
|
53
|
+
'.cfg',
|
|
54
|
+
'.conf',
|
|
55
|
+
'.env',
|
|
56
|
+
'.zip',
|
|
57
|
+
'.tar',
|
|
58
|
+
'.gz',
|
|
59
|
+
'.log',
|
|
60
|
+
]);
|
|
61
|
+
function getExtension(filename) {
|
|
62
|
+
const dot = filename.lastIndexOf('.');
|
|
63
|
+
return dot >= 0 ? filename.slice(dot).toLowerCase() : '';
|
|
64
|
+
}
|
|
65
|
+
export async function POST(request) {
|
|
66
|
+
try {
|
|
67
|
+
const formData = await request.formData();
|
|
68
|
+
const file = formData.get('file');
|
|
69
|
+
const sessionId = formData.get('sessionId');
|
|
70
|
+
if (!file || !sessionId) {
|
|
71
|
+
return NextResponse.json({ error: 'Missing required fields: file, sessionId' }, { status: 400 });
|
|
72
|
+
}
|
|
73
|
+
// Validate file size
|
|
74
|
+
if (file.size > MAX_FILE_SIZE) {
|
|
75
|
+
return NextResponse.json({
|
|
76
|
+
error: `File "${file.name}" exceeds 10 MB limit (${(file.size / 1024 / 1024).toFixed(1)} MB)`,
|
|
77
|
+
}, { status: 413 });
|
|
78
|
+
}
|
|
79
|
+
// Validate extension
|
|
80
|
+
const ext = getExtension(file.name);
|
|
81
|
+
if (ext && !ALLOWED_EXTENSIONS.has(ext)) {
|
|
82
|
+
return NextResponse.json({ error: `File type "${ext}" is not allowed` }, { status: 400 });
|
|
83
|
+
}
|
|
84
|
+
const buffer = Buffer.from(await file.arrayBuffer());
|
|
85
|
+
const service = resolve('AttachmentStorageService');
|
|
86
|
+
const attachment = service.store(buffer, file.name, file.type ?? 'application/octet-stream', sessionId);
|
|
87
|
+
return NextResponse.json({
|
|
88
|
+
id: attachment.id,
|
|
89
|
+
name: attachment.name,
|
|
90
|
+
size: Number(attachment.size),
|
|
91
|
+
mimeType: attachment.mimeType,
|
|
92
|
+
path: attachment.path,
|
|
93
|
+
createdAt: attachment.createdAt,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
const message = error instanceof Error ? error.message : 'Upload failed';
|
|
98
|
+
return NextResponse.json({ error: message }, { status: 500 });
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LucideIcon } from 'lucide-react';
|
|
2
|
+
export interface AttachmentCardProps {
|
|
3
|
+
name: string;
|
|
4
|
+
size: number;
|
|
5
|
+
mimeType: string;
|
|
6
|
+
onRemove: () => void;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
/** Optional secondary text shown below the filename (e.g. file path). */
|
|
10
|
+
subtitle?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function AttachmentCard({ name, size, mimeType: _mimeType, onRemove, loading, disabled, subtitle, }: AttachmentCardProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function getFileIcon(ext: string): LucideIcon;
|
|
14
|
+
export declare function getFileIconColor(ext: string): string;
|
|
15
|
+
export declare function formatFileSize(bytes: number): string;
|
|
16
|
+
//# sourceMappingURL=attachment-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-card.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/attachment-card/attachment-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK/C,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,IAAI,EACJ,QAAQ,EAAE,SAAS,EACnB,QAAQ,EACR,OAAe,EACf,QAAgB,EAChB,QAAQ,GACT,EAAE,mBAAmB,2CAqCrB;AAsBD,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAKnD;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKpD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKpD"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { FileIcon, FileTextIcon, ImageIcon, CodeIcon, Trash2Icon, Loader2Icon } from 'lucide-react';
|
|
3
|
+
import { cn } from '../../../lib/utils.js';
|
|
4
|
+
import { Button } from '../../ui/button.js';
|
|
5
|
+
export function AttachmentCard({ name, size, mimeType: _mimeType, onRemove, loading = false, disabled = false, subtitle, }) {
|
|
6
|
+
const ext = getExtension(name);
|
|
7
|
+
const Icon = getFileIcon(ext);
|
|
8
|
+
const iconColorClass = getFileIconColor(ext);
|
|
9
|
+
return (_jsxs("div", { className: "flex items-center gap-3 rounded-md border p-2", children: [_jsx("div", { className: cn('flex h-8 w-8 shrink-0 items-center justify-center rounded', iconColorClass), children: _jsx(Icon, { className: "h-4 w-4" }) }), _jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("span", { className: "truncate text-sm font-medium", children: name }), subtitle ? (_jsx("span", { className: "text-muted-foreground truncate text-xs", children: subtitle })) : null, _jsx("span", { className: "text-muted-foreground text-xs", children: loading ? 'Uploading...' : formatFileSize(size) })] }), loading ? (_jsx(Loader2Icon, { className: "text-muted-foreground h-4 w-4 animate-spin" })) : (_jsx(Button, { type: "button", variant: "ghost", size: "icon-xs", onClick: onRemove, disabled: disabled, "aria-label": `Remove ${name}`, children: _jsx(Trash2Icon, { className: "h-3 w-3" }) }))] }));
|
|
10
|
+
}
|
|
11
|
+
function getExtension(filename) {
|
|
12
|
+
const dot = filename.lastIndexOf('.');
|
|
13
|
+
return dot >= 0 ? filename.slice(dot).toLowerCase() : '';
|
|
14
|
+
}
|
|
15
|
+
const IMAGE_EXTS = new Set(['.png', '.jpg', '.jpeg', '.gif', '.svg', '.webp', '.ico', '.bmp']);
|
|
16
|
+
const CODE_EXTS = new Set([
|
|
17
|
+
'.ts',
|
|
18
|
+
'.tsx',
|
|
19
|
+
'.js',
|
|
20
|
+
'.jsx',
|
|
21
|
+
'.json',
|
|
22
|
+
'.yaml',
|
|
23
|
+
'.yml',
|
|
24
|
+
'.xml',
|
|
25
|
+
'.html',
|
|
26
|
+
'.css',
|
|
27
|
+
'.md',
|
|
28
|
+
]);
|
|
29
|
+
export function getFileIcon(ext) {
|
|
30
|
+
if (IMAGE_EXTS.has(ext))
|
|
31
|
+
return ImageIcon;
|
|
32
|
+
if (ext === '.pdf')
|
|
33
|
+
return FileTextIcon;
|
|
34
|
+
if (CODE_EXTS.has(ext))
|
|
35
|
+
return CodeIcon;
|
|
36
|
+
return FileIcon;
|
|
37
|
+
}
|
|
38
|
+
export function getFileIconColor(ext) {
|
|
39
|
+
if (ext === '.pdf')
|
|
40
|
+
return 'bg-red-50 text-red-600';
|
|
41
|
+
if (IMAGE_EXTS.has(ext))
|
|
42
|
+
return 'bg-blue-50 text-blue-600';
|
|
43
|
+
if (CODE_EXTS.has(ext))
|
|
44
|
+
return 'bg-emerald-50 text-emerald-600';
|
|
45
|
+
return 'bg-gray-50 text-gray-600';
|
|
46
|
+
}
|
|
47
|
+
export function formatFileSize(bytes) {
|
|
48
|
+
if (bytes === 0)
|
|
49
|
+
return '0 B';
|
|
50
|
+
const units = ['B', 'KB', 'MB', 'GB'];
|
|
51
|
+
const i = Math.floor(Math.log(bytes) / Math.log(1024));
|
|
52
|
+
return `${(bytes / Math.pow(1024, i)).toFixed(i === 0 ? 0 : 1)} ${units[i]}`;
|
|
53
|
+
}
|
package/dist/src/presentation/web/components/common/attachment-card/attachment-card.stories.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { AttachmentCard } from './attachment-card.js';
|
|
3
|
+
declare const meta: Meta<typeof AttachmentCard>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof AttachmentCard>;
|
|
6
|
+
export declare const ImageFile: Story;
|
|
7
|
+
export declare const PdfFile: Story;
|
|
8
|
+
export declare const CodeFile: Story;
|
|
9
|
+
export declare const UnknownFile: Story;
|
|
10
|
+
export declare const Loading: Story;
|
|
11
|
+
export declare const Disabled: Story;
|
|
12
|
+
//# sourceMappingURL=attachment-card.stories.d.ts.map
|
package/dist/src/presentation/web/components/common/attachment-card/attachment-card.stories.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-card.stories.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/attachment-card/attachment-card.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAOrC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,cAAc,CAAC,CAAC;AAE7C,eAAO,MAAM,SAAS,EAAE,KAMvB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAMrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAMtB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,KAMzB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAOrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAOtB,CAAC"}
|
package/dist/src/presentation/web/components/common/attachment-card/attachment-card.stories.js
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { fn } from '@storybook/test';
|
|
2
|
+
import { AttachmentCard } from './attachment-card.js';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Common/AttachmentCard',
|
|
5
|
+
component: AttachmentCard,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
args: {
|
|
8
|
+
onRemove: fn(),
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
export const ImageFile = {
|
|
13
|
+
args: {
|
|
14
|
+
name: 'screenshot.png',
|
|
15
|
+
size: 150000,
|
|
16
|
+
mimeType: 'image/png',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export const PdfFile = {
|
|
20
|
+
args: {
|
|
21
|
+
name: 'requirements.pdf',
|
|
22
|
+
size: 42000,
|
|
23
|
+
mimeType: 'application/pdf',
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
export const CodeFile = {
|
|
27
|
+
args: {
|
|
28
|
+
name: 'index.ts',
|
|
29
|
+
size: 1024,
|
|
30
|
+
mimeType: 'text/typescript',
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
export const UnknownFile = {
|
|
34
|
+
args: {
|
|
35
|
+
name: 'data.bin',
|
|
36
|
+
size: 8192,
|
|
37
|
+
mimeType: 'application/octet-stream',
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export const Loading = {
|
|
41
|
+
args: {
|
|
42
|
+
name: 'uploading-image.png',
|
|
43
|
+
size: 0,
|
|
44
|
+
mimeType: 'image/png',
|
|
45
|
+
loading: true,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
export const Disabled = {
|
|
49
|
+
args: {
|
|
50
|
+
name: 'screenshot.png',
|
|
51
|
+
size: 150000,
|
|
52
|
+
mimeType: 'image/png',
|
|
53
|
+
disabled: true,
|
|
54
|
+
},
|
|
55
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/attachment-card/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AttachmentCard } from './attachment-card.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface AttachmentChipProps {
|
|
2
|
+
name: string;
|
|
3
|
+
size: number;
|
|
4
|
+
mimeType: string;
|
|
5
|
+
path: string;
|
|
6
|
+
onRemove: () => void;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function AttachmentChip({ name, size, mimeType, path, onRemove, loading, disabled, }: AttachmentChipProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=attachment-chip.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-chip.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/attachment-chip/attachment-chip.tsx"],"names":[],"mappings":"AAaA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAmBD,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,IAAI,EACJ,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,OAAe,EACf,QAAgB,GACjB,EAAE,mBAAmB,2CA2FrB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* eslint-disable @next/next/no-img-element -- Local file preview requires raw <img>, not next/image */
|
|
2
|
+
'use client';
|
|
3
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { X, Loader2Icon, DownloadIcon } from 'lucide-react';
|
|
5
|
+
import { cn } from '../../../lib/utils.js';
|
|
6
|
+
import { Dialog, DialogTrigger, DialogContent, DialogTitle } from '../../ui/dialog.js';
|
|
7
|
+
import { VisuallyHidden } from 'radix-ui';
|
|
8
|
+
import { formatFileSize, getFileIcon, getFileIconColor, } from '../../common/attachment-card/attachment-card.js';
|
|
9
|
+
const IMAGE_EXTS = new Set(['.png', '.jpg', '.jpeg', '.gif', '.svg', '.webp', '.ico', '.bmp']);
|
|
10
|
+
function isImage(name) {
|
|
11
|
+
const dot = name.lastIndexOf('.');
|
|
12
|
+
return dot >= 0 && IMAGE_EXTS.has(name.slice(dot).toLowerCase());
|
|
13
|
+
}
|
|
14
|
+
function previewUrl(path, mimeType) {
|
|
15
|
+
const params = new URLSearchParams({ path, mimeType });
|
|
16
|
+
return `/api/attachments/preview?${params.toString()}`;
|
|
17
|
+
}
|
|
18
|
+
function getExtension(filename) {
|
|
19
|
+
const dot = filename.lastIndexOf('.');
|
|
20
|
+
return dot >= 0 ? filename.slice(dot).toLowerCase() : '';
|
|
21
|
+
}
|
|
22
|
+
export function AttachmentChip({ name, size, mimeType, path, onRemove, loading = false, disabled = false, }) {
|
|
23
|
+
const ext = getExtension(name);
|
|
24
|
+
const Icon = getFileIcon(ext);
|
|
25
|
+
const iconColorClass = getFileIconColor(ext);
|
|
26
|
+
const imageFile = isImage(name);
|
|
27
|
+
if (loading) {
|
|
28
|
+
return (_jsx("div", { className: "flex h-12 w-12 items-center justify-center rounded-md border", children: _jsx(Loader2Icon, { className: "text-muted-foreground h-5 w-5 animate-spin" }) }));
|
|
29
|
+
}
|
|
30
|
+
if (imageFile) {
|
|
31
|
+
return (_jsxs(Dialog, { children: [_jsxs("div", { className: "group relative", children: [_jsx(DialogTrigger, { asChild: true, children: _jsx("img", { src: previewUrl(path, mimeType), alt: name, title: name, className: "h-12 w-12 cursor-pointer rounded-md border object-cover transition-opacity hover:opacity-80" }) }), !disabled && (_jsx("button", { type: "button", onClick: onRemove, className: "absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex", "aria-label": `Remove ${name}`, children: _jsx(X, { className: "h-3 w-3" }) }))] }), _jsxs(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: [_jsx(VisuallyHidden.Root, { children: _jsxs(DialogTitle, { children: ["Preview: ", name] }) }), _jsx("div", { className: "relative bg-black/90", children: _jsx("img", { src: previewUrl(path, mimeType), alt: name, className: "h-auto max-h-[70vh] w-full object-contain" }) }), _jsxs("div", { className: "bg-background flex items-center gap-3 px-4 py-3", children: [_jsxs("div", { className: "flex min-w-0 flex-1 flex-col", children: [_jsx("span", { className: "truncate text-sm font-medium", children: name }), _jsx("span", { className: "text-muted-foreground text-xs", children: formatFileSize(size) })] }), _jsx("a", { href: previewUrl(path, mimeType), download: name, className: "text-muted-foreground hover:text-foreground shrink-0 cursor-pointer rounded p-1.5 transition-colors", "aria-label": `Download ${name}`, children: _jsx(DownloadIcon, { className: "h-4 w-4" }) })] })] })] }));
|
|
32
|
+
}
|
|
33
|
+
return (_jsxs("div", { className: "group relative flex items-center gap-2 rounded-full border py-1 pr-3 pl-2", children: [_jsx("div", { className: cn('flex h-6 w-6 shrink-0 items-center justify-center rounded-full', iconColorClass), children: _jsx(Icon, { className: "h-3 w-3" }) }), _jsx("span", { className: "max-w-[120px] truncate text-sm", children: name }), _jsx("span", { className: "text-muted-foreground text-xs", children: formatFileSize(size) }), !disabled && (_jsx("button", { type: "button", onClick: onRemove, className: "absolute -top-1.5 -right-1.5 hidden h-5 w-5 cursor-pointer items-center justify-center rounded-full bg-black/70 text-white group-hover:flex", "aria-label": `Remove ${name}`, children: _jsx(X, { className: "h-3 w-3" }) }))] }));
|
|
34
|
+
}
|
package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.stories.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { AttachmentChip } from './attachment-chip.js';
|
|
3
|
+
declare const meta: Meta<typeof AttachmentChip>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof AttachmentChip>;
|
|
6
|
+
export declare const ImageFile: Story;
|
|
7
|
+
export declare const PdfFile: Story;
|
|
8
|
+
export declare const CodeFile: Story;
|
|
9
|
+
export declare const Loading: Story;
|
|
10
|
+
//# sourceMappingURL=attachment-chip.stories.d.ts.map
|
package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.stories.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachment-chip.stories.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/attachment-chip/attachment-chip.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAOrC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,cAAc,CAAC,CAAC;AAE7C,eAAO,MAAM,SAAS,EAAE,KAOvB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAOrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAOtB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC"}
|
package/dist/src/presentation/web/components/common/attachment-chip/attachment-chip.stories.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { fn } from '@storybook/test';
|
|
2
|
+
import { AttachmentChip } from './attachment-chip.js';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Common/AttachmentChip',
|
|
5
|
+
component: AttachmentChip,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
args: {
|
|
8
|
+
onRemove: fn(),
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
export const ImageFile = {
|
|
13
|
+
args: {
|
|
14
|
+
name: 'screenshot.png',
|
|
15
|
+
size: 150000,
|
|
16
|
+
mimeType: 'image/png',
|
|
17
|
+
path: '/tmp/test/screenshot.png',
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export const PdfFile = {
|
|
21
|
+
args: {
|
|
22
|
+
name: 'requirements.pdf',
|
|
23
|
+
size: 42000,
|
|
24
|
+
mimeType: 'application/pdf',
|
|
25
|
+
path: '/tmp/test/requirements.pdf',
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
export const CodeFile = {
|
|
29
|
+
args: {
|
|
30
|
+
name: 'index.ts',
|
|
31
|
+
size: 1024,
|
|
32
|
+
mimeType: 'text/typescript',
|
|
33
|
+
path: '/tmp/test/index.ts',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
export const Loading = {
|
|
37
|
+
args: {
|
|
38
|
+
name: 'uploading-image.png',
|
|
39
|
+
size: 0,
|
|
40
|
+
mimeType: 'image/png',
|
|
41
|
+
path: '',
|
|
42
|
+
loading: true,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/attachment-chip/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { AttachmentChip } from './attachment-chip.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-drawer-client.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/control-center-drawer/feature-drawer-client.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"feature-drawer-client.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/control-center-drawer/feature-drawer-client.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,wBAAwB,2CA6hBlF"}
|
package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js
CHANGED
|
@@ -20,7 +20,7 @@ import { DeploymentStatusBadge } from '../../common/deployment-status-badge/inde
|
|
|
20
20
|
import { DrawerTitle, DrawerDescription } from '../../ui/drawer.js';
|
|
21
21
|
import { Button } from '../../ui/button.js';
|
|
22
22
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../ui/tooltip.js';
|
|
23
|
-
import {
|
|
23
|
+
import { DeleteFeatureDialog } from '../../common/delete-feature-dialog/index.js';
|
|
24
24
|
import { ActionButton } from '../../common/action-button/index.js';
|
|
25
25
|
import { OpenActionMenu } from '../../common/open-action-menu/index.js';
|
|
26
26
|
import { FeatureDrawerTabs } from '../../common/feature-drawer-tabs/index.js';
|
|
@@ -111,6 +111,7 @@ export function FeatureDrawerClient({ view: initialView }) {
|
|
|
111
111
|
const [mergeData, setMergeData] = useState(null);
|
|
112
112
|
// ── Delete state ───────────────────────────────────────────────────────
|
|
113
113
|
const [isDeleting, setIsDeleting] = useState(false);
|
|
114
|
+
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
|
114
115
|
// ── Shared reject state ────────────────────────────────────────────────
|
|
115
116
|
const [isRejecting, setIsRejecting] = useState(false);
|
|
116
117
|
const isRejectingRef = useRef(false);
|
|
@@ -261,10 +262,10 @@ export function FeatureDrawerClient({ view: initialView }) {
|
|
|
261
262
|
}, [view, featureNode, prdData, prdSelections, onClose]);
|
|
262
263
|
const handleTechApprove = useCallback(() => handleSimpleApprove('Plan'), [handleSimpleApprove]);
|
|
263
264
|
const handleMergeApprove = useCallback(() => handleSimpleApprove('Merge'), [handleSimpleApprove]);
|
|
264
|
-
const handleDelete = useCallback(async (featureId) => {
|
|
265
|
+
const handleDelete = useCallback(async (featureId, cleanup) => {
|
|
265
266
|
setIsDeleting(true);
|
|
266
267
|
try {
|
|
267
|
-
const result = await deleteFeature(featureId);
|
|
268
|
+
const result = await deleteFeature(featureId, cleanup);
|
|
268
269
|
if (result.error) {
|
|
269
270
|
toast.error(result.error);
|
|
270
271
|
return;
|
|
@@ -317,7 +318,7 @@ export function FeatureDrawerClient({ view: initialView }) {
|
|
|
317
318
|
const repoName = featureNode.repositoryName ??
|
|
318
319
|
featureNode.repositoryPath.split('/').filter(Boolean).at(-1) ??
|
|
319
320
|
'';
|
|
320
|
-
header = (_jsxs(_Fragment, { children: [_jsxs("div", { "data-testid": "feature-drawer-header", children: [_jsx(DrawerTitle, { children: featureNode.name }), repoName ? (_jsxs("div", { className: "flex items-center gap-1.5 pt-0.5", children: [_jsx(Code2, { className: "text-muted-foreground size-3.5 shrink-0" }), featureNode.remoteUrl ? (_jsxs("a", { href: featureNode.remoteUrl, target: "_blank", rel: "noopener noreferrer", className: "text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors", "data-testid": "feature-drawer-repo-link", children: [repoName, _jsx(ExternalLink, { className: "size-3" })] })) : (_jsx("span", { className: "text-muted-foreground text-xs", children: repoName }))] })) : null, _jsx(DrawerDescription, { className: "sr-only", children: featureNode.name })] }), featureActionsInput ? (_jsxs("div", { className: "flex items-center gap-2 pt-2", "data-testid": "feature-drawer-actions", children: [_jsx(OpenActionMenu, { actions: featureActions, repositoryPath: featureActionsInput.repositoryPath, showSpecs: !!featureActionsInput.specPath }), featureFlags.envDeploy && featureDeployTarget ? (_jsxs(_Fragment, { children: [_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("span", { children: _jsx(ActionButton, { label: isFeatureDeployActive ? 'Stop Dev Server' : 'Start Dev Server', onClick: isFeatureDeployActive ? deployAction.stop : deployAction.deploy, loading: deployAction.deployLoading || deployAction.stopLoading, error: !!deployAction.deployError, icon: isFeatureDeployActive ? Square : Play, iconOnly: true, variant: "outline", size: "icon-sm" }) }) }), _jsx(TooltipContent, { children: isFeatureDeployActive ? 'Stop Dev Server' : 'Start Dev Server' })] }) }), isFeatureDeployActive ? (_jsx(DeploymentStatusBadge, { status: deployAction.status, url: deployAction.url, targetId: featureDeployTarget?.targetId })) : null] })) : null, _jsxs("div", { className: "ml-auto flex items-center gap-1.5", children: [_jsx("code", { className: "bg-muted text-muted-foreground rounded px-1.5 py-0.5 font-mono text-xs", children: shortId }), _jsx("button", { type: "button", onClick: handleCopyId, className: "text-muted-foreground hover:text-foreground inline-flex items-center rounded p-0.5 transition-colors", "aria-label": "Copy feature ID", "data-testid": "feature-drawer-copy-id", children: idCopied ? (_jsx(Check, { className: "size-3.5 text-green-600" })) : (_jsx(Copy, { className: "size-3.5" })) })] }), featureNode.featureId ? (_jsxs(
|
|
321
|
+
header = (_jsxs(_Fragment, { children: [_jsxs("div", { "data-testid": "feature-drawer-header", children: [_jsx(DrawerTitle, { children: featureNode.name }), repoName ? (_jsxs("div", { className: "flex items-center gap-1.5 pt-0.5", children: [_jsx(Code2, { className: "text-muted-foreground size-3.5 shrink-0" }), featureNode.remoteUrl ? (_jsxs("a", { href: featureNode.remoteUrl, target: "_blank", rel: "noopener noreferrer", className: "text-muted-foreground hover:text-foreground inline-flex items-center gap-1 text-xs transition-colors", "data-testid": "feature-drawer-repo-link", children: [repoName, _jsx(ExternalLink, { className: "size-3" })] })) : (_jsx("span", { className: "text-muted-foreground text-xs", children: repoName }))] })) : null, _jsx(DrawerDescription, { className: "sr-only", children: featureNode.name })] }), featureActionsInput ? (_jsxs("div", { className: "flex items-center gap-2 pt-2", "data-testid": "feature-drawer-actions", children: [_jsx(OpenActionMenu, { actions: featureActions, repositoryPath: featureActionsInput.repositoryPath, showSpecs: !!featureActionsInput.specPath }), featureFlags.envDeploy && featureDeployTarget ? (_jsxs(_Fragment, { children: [_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx("span", { children: _jsx(ActionButton, { label: isFeatureDeployActive ? 'Stop Dev Server' : 'Start Dev Server', onClick: isFeatureDeployActive ? deployAction.stop : deployAction.deploy, loading: deployAction.deployLoading || deployAction.stopLoading, error: !!deployAction.deployError, icon: isFeatureDeployActive ? Square : Play, iconOnly: true, variant: "outline", size: "icon-sm" }) }) }), _jsx(TooltipContent, { children: isFeatureDeployActive ? 'Stop Dev Server' : 'Start Dev Server' })] }) }), isFeatureDeployActive ? (_jsx(DeploymentStatusBadge, { status: deployAction.status, url: deployAction.url, targetId: featureDeployTarget?.targetId })) : null] })) : null, _jsxs("div", { className: "ml-auto flex items-center gap-1.5", children: [_jsx("code", { className: "bg-muted text-muted-foreground rounded px-1.5 py-0.5 font-mono text-xs", children: shortId }), _jsx("button", { type: "button", onClick: handleCopyId, className: "text-muted-foreground hover:text-foreground inline-flex items-center rounded p-0.5 transition-colors", "aria-label": "Copy feature ID", "data-testid": "feature-drawer-copy-id", children: idCopied ? (_jsx(Check, { className: "size-3.5 text-green-600" })) : (_jsx(Copy, { className: "size-3.5" })) })] }), featureNode.featureId ? (_jsxs(_Fragment, { children: [_jsx(Button, { variant: "ghost", size: "icon-sm", "aria-label": "Delete feature", disabled: isDeleting, className: "text-muted-foreground hover:text-destructive", "data-testid": "feature-drawer-delete", onClick: () => setDeleteDialogOpen(true), children: isDeleting ? (_jsx(Loader2, { className: "size-4 animate-spin" })) : (_jsx(Trash2, { className: "size-4" })) }), _jsx(DeleteFeatureDialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, onConfirm: (cleanup) => handleDelete(featureNode.featureId, cleanup), isDeleting: isDeleting, featureName: featureNode.name, featureId: featureNode.featureId })] })) : null] })) : null] }));
|
|
321
322
|
}
|
|
322
323
|
// ── Body ──────────────────────────────────────────────────────────────
|
|
323
324
|
let body = null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface DeleteFeatureDialogProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onOpenChange: (open: boolean) => void;
|
|
4
|
+
onConfirm: (cleanup: boolean) => void;
|
|
5
|
+
isDeleting: boolean;
|
|
6
|
+
featureName: string;
|
|
7
|
+
featureId: string;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=delete-feature-dialog-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-feature-dialog-config.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog-config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,SAAS,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,UAAU,EAAE,OAAO,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { DeleteFeatureDialogProps } from './delete-feature-dialog-config.js';
|
|
2
|
+
export declare function DeleteFeatureDialog({ open, onOpenChange, onConfirm, isDeleting, featureName, featureId, }: DeleteFeatureDialogProps): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
//# sourceMappingURL=delete-feature-dialog.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-feature-dialog.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAE/E,wBAAgB,mBAAmB,CAAC,EAClC,IAAI,EACJ,YAAY,EACZ,SAAS,EACT,UAAU,EACV,WAAW,EACX,SAAS,GACV,EAAE,wBAAwB,2CAqD1B"}
|
package/dist/src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from 'react';
|
|
4
|
+
import { Loader2 } from 'lucide-react';
|
|
5
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from '../../ui/alert-dialog.js';
|
|
6
|
+
import { Checkbox } from '../../ui/checkbox.js';
|
|
7
|
+
import { Label } from '../../ui/label.js';
|
|
8
|
+
export function DeleteFeatureDialog({ open, onOpenChange, onConfirm, isDeleting, featureName, featureId, }) {
|
|
9
|
+
const [cleanup, setCleanup] = useState(true);
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (open) {
|
|
12
|
+
setCleanup(true);
|
|
13
|
+
}
|
|
14
|
+
}, [open]);
|
|
15
|
+
return (_jsx(AlertDialog, { open: open, onOpenChange: onOpenChange, children: _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Delete feature?" }), _jsxs(AlertDialogDescription, { children: ["This will permanently delete ", _jsx("strong", { children: featureName }), " (", featureId, "). This action cannot be undone."] })] }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Checkbox, { id: "cleanup-checkbox", checked: cleanup, onCheckedChange: (checked) => setCleanup(checked === true), disabled: isDeleting, "aria-label": "Clean up worktree and branches" }), _jsx(Label, { htmlFor: "cleanup-checkbox", className: "cursor-pointer text-sm", children: "Clean up worktree and branches" })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { disabled: isDeleting, onClick: () => onOpenChange(false), children: "Cancel" }), _jsx(AlertDialogAction, { variant: "destructive", disabled: isDeleting, onClick: () => onConfirm(cleanup), children: isDeleting ? (_jsxs(_Fragment, { children: [_jsx(Loader2, { className: "mr-2 h-4 w-4 animate-spin" }), "Deleting\u2026"] })) : ('Delete') })] })] }) }));
|
|
16
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { DeleteFeatureDialog } from './delete-feature-dialog.js';
|
|
3
|
+
declare const meta: Meta<typeof DeleteFeatureDialog>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DeleteFeatureDialog>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Deleting: Story;
|
|
8
|
+
//# sourceMappingURL=delete-feature-dialog.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-feature-dialog.stories.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/delete-feature-dialog/delete-feature-dialog.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAE9D,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,mBAAmB,CAe1C,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAElD,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,KAItB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { fn } from '@storybook/test';
|
|
2
|
+
import { DeleteFeatureDialog } from './delete-feature-dialog.js';
|
|
3
|
+
const meta = {
|
|
4
|
+
title: 'Composed/DeleteFeatureDialog',
|
|
5
|
+
component: DeleteFeatureDialog,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: 'centered',
|
|
9
|
+
},
|
|
10
|
+
args: {
|
|
11
|
+
open: true,
|
|
12
|
+
onOpenChange: fn().mockName('onOpenChange'),
|
|
13
|
+
onConfirm: fn().mockName('onConfirm'),
|
|
14
|
+
isDeleting: false,
|
|
15
|
+
featureName: 'User Authentication',
|
|
16
|
+
featureId: 'feat-abc-123',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export default meta;
|
|
20
|
+
export const Default = {};
|
|
21
|
+
export const Deleting = {
|
|
22
|
+
args: {
|
|
23
|
+
isDeleting: true,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/delete-feature-dialog/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,YAAY,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DeleteFeatureDialog } from './delete-feature-dialog.js';
|