@shepai/cli 1.169.1-pr509.3238903 → 1.169.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apis/json-schema/Feature.yaml +0 -10
- package/apis/json-schema/WorkflowConfig.yaml +0 -3
- package/dist/packages/core/src/application/ports/output/services/index.d.ts +0 -1
- package/dist/packages/core/src/application/ports/output/services/index.d.ts.map +1 -1
- 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 +0 -1
- package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.d.ts +1 -3
- 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 +3 -22
- package/dist/packages/core/src/application/use-cases/features/create/types.d.ts +0 -2
- package/dist/packages/core/src/application/use-cases/features/create/types.d.ts.map +1 -1
- 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 +1 -55
- package/dist/packages/core/src/domain/generated/output.d.ts +0 -50
- package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
- package/dist/packages/core/src/domain/generated/output.js +0 -5
- package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.js +0 -2
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/feature.mapper.d.ts +0 -2
- 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 +0 -6
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +0 -2
- 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 +0 -27
- 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 +4 -8
- package/dist/src/presentation/cli/commands/feat/new.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/new.command.js +0 -3
- package/dist/src/presentation/web/app/actions/create-feature.d.ts +0 -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 +1 -3
- package/dist/src/presentation/web/app/actions/get-workflow-defaults.d.ts +0 -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 +0 -1
- 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 +0 -2
- package/dist/src/presentation/web/app/skills/page.d.ts.map +1 -1
- package/dist/src/presentation/web/app/skills/page.js +1 -6
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts +0 -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 +2 -6
- 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 +0 -1
- 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 +4 -10
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.d.ts +0 -2
- 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 +0 -12
- package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts +0 -4
- package/dist/src/presentation/web/components/common/feature-node/feature-node-state-config.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/skills/skills-page-client.d.ts +1 -3
- 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 +3 -5
- package/dist/src/presentation/web/components/features/skills/skills-page-client.stories.d.ts +0 -1
- 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 +0 -27
- package/dist/translations/ar/cli.json +0 -2
- package/dist/translations/ar/web.json +11 -15
- package/dist/translations/de/cli.json +0 -2
- package/dist/translations/de/web.json +17 -35
- package/dist/translations/en/cli.json +0 -2
- package/dist/translations/en/web.json +0 -4
- package/dist/translations/es/cli.json +0 -2
- package/dist/translations/es/web.json +12 -16
- package/dist/translations/fr/cli.json +0 -2
- package/dist/translations/fr/web.json +12 -16
- package/dist/translations/he/cli.json +0 -2
- package/dist/translations/he/web.json +12 -16
- package/dist/translations/pt/cli.json +0 -2
- package/dist/translations/pt/web.json +12 -16
- package/dist/translations/ru/cli.json +0 -2
- package/dist/translations/ru/web.json +12 -16
- 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 +38 -38
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +1 -1
- 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 +38 -38
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +1 -1
- 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 +38 -38
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +1 -1
- 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 +38 -38
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +1 -1
- 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 +22 -52
- package/web/.next/server/app/skills/page.js +2 -3
- 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/[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/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]__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]__20a36a42._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__20a36a42._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.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]__7dcd0917._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__92ffd5ee._.js → [root-of-the-server]__7ffd3598._.js} +3 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7ffd3598._.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]__ba7f5873._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__1cd4327c._.js → [root-of-the-server]__e88da4ee._.js} +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e88da4ee._.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/{403f9_next_8a33ddee._.js → _0727935d._.js} +2 -2
- package/web/.next/server/chunks/ssr/_0727935d._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_0dc06d07._.js +3 -0
- package/web/.next/server/chunks/ssr/_0dc06d07._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_16eb4fec._.js +1 -1
- package/web/.next/server/chunks/ssr/_16eb4fec._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_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/_4cbb7f95._.js +1 -1
- package/web/.next/server/chunks/ssr/_4cbb7f95._.js.map +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/_682fc996._.js +9 -0
- package/web/.next/server/chunks/ssr/_682fc996._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_6892e3b9._.js +3 -0
- package/web/.next/server/chunks/ssr/_6892e3b9._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_9b964adc._.js +3 -0
- package/web/.next/server/chunks/ssr/{_10a571b8._.js.map → _9b964adc._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_a1068852._.js +3 -0
- package/web/.next/server/chunks/ssr/_a1068852._.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/{_d55b34d1._.js → _a8b338ec._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_d55b34d1._.js.map → _a8b338ec._.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/_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/{_11cbed18._.js → _fe058119._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_11cbed18._.js.map → _fe058119._.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_12a7ede0._.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules__pnpm_12a7ede0._.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_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_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 +59 -89
- package/web/.next/static/chunks/{f1a5cda6353fe321.js → 021c9b0effb6d688.js} +1 -1
- package/web/.next/static/chunks/{cb638c28c942e3ca.js → 04c874f52a7cd435.js} +1 -1
- package/web/.next/static/chunks/20f7cc98a013b11c.js +1 -0
- package/web/.next/static/chunks/4cec255f2754e5ec.js +1 -0
- package/web/.next/static/chunks/{d52622eb492eadb1.js → 562c70303d910295.js} +1 -1
- package/web/.next/static/chunks/5b7275374d2696b3.css +1 -0
- package/web/.next/static/chunks/647140fe96a7c88a.js +1 -0
- package/web/.next/static/chunks/6d6f70ff5151b8cb.js +7 -0
- package/web/.next/static/chunks/84792d40edc4b027.js +5 -0
- package/web/.next/static/chunks/8800875bb3d56192.js +3 -0
- package/web/.next/static/chunks/8d581adafe8d1dd0.js +1 -0
- package/web/.next/static/chunks/982aef195c118996.js +1 -0
- package/web/.next/static/chunks/{f844d62e4159c965.js → a052c19c18e9eced.js} +1 -1
- package/web/.next/static/chunks/a6b5e739d2f89c6b.js +1 -0
- package/web/.next/static/chunks/b0e2fb3d4eb42f3d.js +1 -0
- package/web/.next/static/chunks/c3ef3b892f7794ec.js +1 -0
- package/web/.next/static/chunks/{783b3ac450c8199b.js → c5d89c12a73e0461.js} +2 -2
- package/web/.next/static/chunks/{9ba70e315d9b5dd6.js → caf7d7e1b439b29e.js} +1 -1
- package/web/.next/static/chunks/{853459c5497533d4.js → d6c39780c2f75ecd.js} +1 -1
- package/web/.next/static/chunks/dc134f3f58cdf850.js +5 -0
- package/web/.next/static/chunks/{205b4659bdfc9b72.js → ff9e33615f5c856c.js} +1 -1
- package/web/.next/static/chunks/{turbopack-b38a68b1b1c41a87.js → turbopack-57bb0674e2cd1d31.js} +1 -1
- package/apis/json-schema/SkillInjectionConfig.yaml +0 -17
- package/apis/json-schema/SkillSource.yaml +0 -21
- package/apis/json-schema/SkillSourceType.yaml +0 -7
- package/dist/packages/core/src/application/ports/output/services/skill-injector.interface.d.ts +0 -39
- package/dist/packages/core/src/application/ports/output/services/skill-injector.interface.d.ts.map +0 -1
- package/dist/packages/core/src/application/ports/output/services/skill-injector.interface.js +0 -8
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/053-add-skill-injection-config.d.ts +0 -15
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/053-add-skill-injection-config.d.ts.map +0 -1
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/053-add-skill-injection-config.js +0 -23
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/054-add-injected-skills-to-features.d.ts +0 -11
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/054-add-injected-skills-to-features.d.ts.map +0 -1
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/054-add-injected-skills-to-features.js +0 -19
- package/dist/packages/core/src/infrastructure/services/skill-injector.service.d.ts +0 -26
- package/dist/packages/core/src/infrastructure/services/skill-injector.service.d.ts.map +0 -1
- package/dist/packages/core/src/infrastructure/services/skill-injector.service.js +0 -201
- package/dist/src/presentation/web/app/actions/add-injected-skill.d.ts +0 -7
- package/dist/src/presentation/web/app/actions/add-injected-skill.d.ts.map +0 -1
- package/dist/src/presentation/web/app/actions/add-injected-skill.js +0 -34
- package/dist/src/presentation/web/app/actions/remove-injected-skill.d.ts +0 -6
- package/dist/src/presentation/web/app/actions/remove-injected-skill.d.ts.map +0 -1
- package/dist/src/presentation/web/app/actions/remove-injected-skill.js +0 -35
- package/dist/src/presentation/web/components/features/skills/add-skill-dialog.d.ts +0 -10
- package/dist/src/presentation/web/components/features/skills/add-skill-dialog.d.ts.map +0 -1
- package/dist/src/presentation/web/components/features/skills/add-skill-dialog.js +0 -56
- package/dist/src/presentation/web/components/features/skills/add-skill-dialog.stories.d.ts +0 -16
- package/dist/src/presentation/web/components/features/skills/add-skill-dialog.stories.d.ts.map +0 -1
- package/dist/src/presentation/web/components/features/skills/add-skill-dialog.stories.js +0 -66
- package/dist/src/presentation/web/components/features/skills/auto-injected-skills-section.d.ts +0 -8
- package/dist/src/presentation/web/components/features/skills/auto-injected-skills-section.d.ts.map +0 -1
- package/dist/src/presentation/web/components/features/skills/auto-injected-skills-section.js +0 -42
- package/dist/src/presentation/web/components/features/skills/auto-injected-skills-section.stories.d.ts +0 -16
- package/dist/src/presentation/web/components/features/skills/auto-injected-skills-section.stories.d.ts.map +0 -1
- package/dist/src/presentation/web/components/features/skills/auto-injected-skills-section.stories.js +0 -69
- package/web/.next/server/chunks/ssr/403f9_next_8a33ddee._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1cd4327c._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__92ffd5ee._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fa525872._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__fa525872._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_10a571b8._.js +0 -3
- package/web/.next/server/chunks/ssr/_45496654._.js +0 -3
- package/web/.next/server/chunks/ssr/_45496654._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_6f35fb9a._.js +0 -3
- package/web/.next/server/chunks/ssr/_6f35fb9a._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_a963dd3c._.js +0 -3
- package/web/.next/server/chunks/ssr/_a963dd3c._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_df737cce._.js +0 -3
- package/web/.next/server/chunks/ssr/_df737cce._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_e3f14907._.js +0 -9
- package/web/.next/server/chunks/ssr/_e3f14907._.js.map +0 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_1300ae39._.js +0 -3
- package/web/.next/server/chunks/ssr/node_modules__pnpm_1300ae39._.js.map +0 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js +0 -3
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js.map +0 -1
- package/web/.next/static/chunks/008a238e3827134a.js +0 -1
- package/web/.next/static/chunks/185e4f36cb6efb24.js +0 -1
- package/web/.next/static/chunks/24ef0e36f68901cd.js +0 -1
- package/web/.next/static/chunks/74729cbad964be13.js +0 -1
- package/web/.next/static/chunks/86b3891618d9e165.js +0 -1
- package/web/.next/static/chunks/8cedbf904e6bca33.js +0 -3
- package/web/.next/static/chunks/a4668ef7bb93c465.js +0 -1
- package/web/.next/static/chunks/b0ed1ec320a0e51a.js +0 -1
- package/web/.next/static/chunks/b14085e99b88e7f7.css +0 -1
- package/web/.next/static/chunks/b65e555419a0c664.js +0 -1
- package/web/.next/static/chunks/c669da1a499f4683.js +0 -7
- package/web/.next/static/chunks/cc5fe8d1d9e1e519.js +0 -5
- package/web/.next/static/chunks/cf1c386f350d1f1b.js +0 -5
- /package/web/.next/static/{w_8Pssf6--RSvCF6kGM86 → lFiCv3l4nIAIpZmj6eehh}/_buildManifest.js +0 -0
- /package/web/.next/static/{w_8Pssf6--RSvCF6kGM86 → lFiCv3l4nIAIpZmj6eehh}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{w_8Pssf6--RSvCF6kGM86 → lFiCv3l4nIAIpZmj6eehh}/_ssgManifest.js +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/settings.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/circle-check.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/circle-x.ts","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-use-previous%401.1.1_%40types%2Breact%4019.2.10_react%4019.2.4/node_modules/%40radix-ui/react-use-previous/src/use-previous.tsx","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/plus.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/ban.ts","../../../../../../../src/presentation/web/components/features/chat/ChatDotIndicator.tsx","../../../../../../../src/presentation/web/hooks/turn-statuses-provider.tsx","../../../../../../../src/presentation/web/hooks/use-turn-statuses.ts","../../../../../../../src/presentation/web/hooks/agent-events-provider.tsx","../../../../../../../src/presentation/web/hooks/use-agent-events.ts","../../../../../../../src/presentation/web/components/ui/badge.tsx","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/puzzle.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/zap.ts","../../../../../../../node_modules/.pnpm/lucide-react%400.563.0_react%4019.2.4/node_modules/lucide-react/src/icons/clock.ts","../../../../../../../src/presentation/web/components/ui/alert-dialog.tsx","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-alert-dialog%401.1.15_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.10__%40type_56f594cfdf18ff10dafbf7587c6528db/node_modules/%40radix-ui/react-alert-dialog/dist/index.mjs","../../../../../../../src/presentation/web/hooks/drawer-close-guard.tsx"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915',\n key: '1i5ecw',\n },\n ],\n ['circle', { cx: '12', cy: '12', r: '3', key: '1v7zrd' }],\n];\n\n/**\n * @component @name Settings\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/settings\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Settings = createLucideIcon('settings', __iconNode);\n\nexport default Settings;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['path', { d: 'm9 12 2 2 4-4', key: 'dzmm74' }],\n];\n\n/**\n * @component @name CircleCheck\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/circle-check\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CircleCheck = createLucideIcon('circle-check', __iconNode);\n\nexport default CircleCheck;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n ['path', { d: 'm15 9-6 6', key: '1uzhvr' }],\n ['path', { d: 'm9 9 6 6', key: 'z0biqf' }],\n];\n\n/**\n * @component @name CircleX\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/circle-x\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CircleX = createLucideIcon('circle-x', __iconNode);\n\nexport default CircleX;\n","import * as React from 'react';\n\nfunction usePrevious<T>(value: T) {\n const ref = React.useRef({ value, previous: value });\n\n // We compare values before making an update to ensure that\n // a change has been made. This ensures the previous value is\n // persisted correctly between renders.\n return React.useMemo(() => {\n if (ref.current.value !== value) {\n ref.current.previous = ref.current.value;\n ref.current.value = value;\n }\n return ref.current.previous;\n }, [value]);\n}\n\nexport { usePrevious };\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M5 12h14', key: '1ays0h' }],\n ['path', { d: 'M12 5v14', key: 's699le' }],\n];\n\n/**\n * @component @name Plus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/plus\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Plus = createLucideIcon('plus', __iconNode);\n\nexport default Plus;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M4.929 4.929 19.07 19.071', key: '196cmz' }],\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n];\n\n/**\n * @component @name Ban\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/ban\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Ban = createLucideIcon('ban', __iconNode);\n\nexport default Ban;\n","'use client';\n\nimport type { TurnStatus } from '@/hooks/use-turn-statuses';\n\ninterface ChatDotIndicatorProps {\n status: TurnStatus;\n className?: string;\n}\n\n/**\n * Dot indicator for chat buttons showing agent activity state:\n * - idle: no dot (hidden)\n * - processing: pulsing blue dot\n * - unread: static green dot\n * - awaiting_input: pulsing amber dot (agent needs user response)\n */\nexport function ChatDotIndicator({ status, className = '' }: ChatDotIndicatorProps) {\n if (status === 'idle') return null;\n\n const dotClass =\n status === 'awaiting_input'\n ? 'h-2.5 w-2.5 animate-pulse bg-amber-500'\n : status === 'processing'\n ? 'h-2.5 w-2.5 animate-pulse bg-blue-500'\n : 'h-2 w-2 bg-green-500';\n\n return (\n <span className={`absolute -top-0.5 -right-0.5 block rounded-full ${dotClass} ${className}`} />\n );\n}\n","'use client';\n\nimport { createContext, useContext, useMemo, type ReactNode } from 'react';\nimport { useAllTurnStatuses, type TurnStatus } from './use-turn-statuses';\n\ninterface TurnStatusesContextValue {\n /** Get turn status for a scope key (featureId / \"repo-<id>\" / \"global\") */\n getStatus: (scopeId: string) => TurnStatus;\n}\n\nconst TurnStatusesContext = createContext<TurnStatusesContextValue>({\n getStatus: () => 'idle',\n});\n\n/**\n * Polls ALL active turn statuses in a single API call (no IDs needed).\n * Children use `useTurnStatus(scopeId)` to read individual statuses.\n */\nexport function TurnStatusesProvider({ children }: { children: ReactNode }) {\n const statuses = useAllTurnStatuses();\n\n const value = useMemo<TurnStatusesContextValue>(\n () => ({\n getStatus: (scopeId: string) => (statuses[scopeId] as TurnStatus) ?? 'idle',\n }),\n [statuses]\n );\n\n return <TurnStatusesContext.Provider value={value}>{children}</TurnStatusesContext.Provider>;\n}\n\n/**\n * Get the turn status for a specific scope ID.\n * Must be used within a TurnStatusesProvider.\n */\nexport function useTurnStatus(scopeId: string): TurnStatus {\n const ctx = useContext(TurnStatusesContext);\n return ctx.getStatus(scopeId);\n}\n","'use client';\n\nimport { useQuery } from '@tanstack/react-query';\n\nexport type TurnStatus = 'idle' | 'processing' | 'unread' | 'awaiting_input';\n\n/**\n * Polls ALL active turn statuses from the backend.\n * No IDs needed — the backend returns every non-idle session status.\n * Returns a map of scopeId → TurnStatus.\n */\nexport function useAllTurnStatuses(): Record<string, TurnStatus> {\n const { data } = useQuery<Record<string, TurnStatus>>({\n queryKey: ['turn-statuses'],\n queryFn: async () => {\n const res = await fetch('/api/interactive/chat/turn-statuses');\n if (!res.ok) return {};\n return res.json();\n },\n refetchInterval: 2_000,\n });\n\n return data ?? {};\n}\n\n/**\n * Marks a feature's chat as read (clears 'unread' → 'idle').\n */\nexport async function markChatRead(featureId: string): Promise<void> {\n await fetch(`/api/interactive/chat/${featureId}/mark-read`, { method: 'POST' });\n}\n","'use client';\n\nimport { createContext, useContext, useMemo, type ReactNode } from 'react';\nimport {\n useAgentEvents,\n type UseAgentEventsOptions,\n type UseAgentEventsResult,\n} from './use-agent-events';\n\nconst AgentEventsContext = createContext<UseAgentEventsResult | null>(null);\n\ninterface AgentEventsProviderProps extends UseAgentEventsOptions {\n children: ReactNode;\n}\n\n/**\n * Single SSE connection for agent events shared across all consumers.\n * Wrap the app once; use `useAgentEventsContext()` to read.\n */\nexport function AgentEventsProvider({ children, runId }: AgentEventsProviderProps) {\n const { events, lastEvent, connectionStatus } = useAgentEvents({ runId });\n\n const value = useMemo<UseAgentEventsResult>(\n () => ({ events, lastEvent, connectionStatus }),\n [events, lastEvent, connectionStatus]\n );\n\n return <AgentEventsContext.Provider value={value}>{children}</AgentEventsContext.Provider>;\n}\n\nexport function useAgentEventsContext(): UseAgentEventsResult {\n const ctx = useContext(AgentEventsContext);\n if (!ctx) {\n throw new Error('useAgentEventsContext must be used within an <AgentEventsProvider>');\n }\n return ctx;\n}\n","'use client';\n\nimport { useCallback, useEffect, useRef, useState } from 'react';\nimport type { NotificationEvent } from '@shepai/core/domain/generated/output';\nimport { createLogger } from '@/lib/logger';\n\nexport type ConnectionStatus = 'connected' | 'connecting' | 'disconnected';\n\nexport interface UseAgentEventsOptions {\n runId?: string;\n}\n\nexport interface UseAgentEventsResult {\n events: NotificationEvent[];\n lastEvent: NotificationEvent | null;\n connectionStatus: ConnectionStatus;\n}\n\nconst log = createLogger('[SSE]');\nconst SW_PATH = '/agent-events-sw.js';\nconst MAX_EVENTS = 500;\nconst PRUNE_KEEP = 250;\n\n/**\n * Hook that receives real-time agent notification events via a Service Worker.\n *\n * The SW maintains a single SSE connection to /api/agent-events and\n * broadcasts events to all open tabs. Falls back to direct EventSource\n * when Service Workers are unavailable.\n */\nexport function useAgentEvents(options?: UseAgentEventsOptions): UseAgentEventsResult {\n const [events, setEvents] = useState<NotificationEvent[]>([]);\n const [lastEvent, setLastEvent] = useState<NotificationEvent | null>(null);\n const [connectionStatus, setConnectionStatus] = useState<ConnectionStatus>('disconnected');\n\n const runId = options?.runId;\n const swRef = useRef<ServiceWorker | null>(null);\n\n const onMessage = useCallback((event: MessageEvent) => {\n const msg = event.data;\n if (!msg || typeof msg !== 'object') return;\n\n if (msg.type === 'notification') {\n const parsed = msg.data as NotificationEvent;\n log.debug('event received:', parsed.eventType, parsed);\n setEvents((prev) => {\n const next = [...prev, parsed];\n return next.length > MAX_EVENTS ? next.slice(-PRUNE_KEEP) : next;\n });\n setLastEvent(parsed);\n } else if (msg.type === 'status') {\n setConnectionStatus(msg.status as ConnectionStatus);\n }\n }, []);\n\n useEffect(() => {\n if (typeof window === 'undefined') return;\n\n // ?sse=direct bypasses the Service Worker for debugging\n const bypassSW =\n typeof location !== 'undefined' && new URLSearchParams(location.search).has('sse');\n\n // Fallback: direct EventSource when SW not supported or bypassed\n if (!navigator.serviceWorker || bypassSW) {\n return connectDirectEventSource(runId, setEvents, setLastEvent, setConnectionStatus);\n }\n\n let cancelled = false;\n const fallbackCleanupRef = { current: undefined as (() => void) | undefined };\n\n function subscribeToWorker(worker: ServiceWorker) {\n if (cancelled) return;\n swRef.current = worker;\n worker.postMessage({ type: 'subscribe', runId });\n setConnectionStatus('connecting');\n }\n\n // Listen for messages from whatever SW controls this page\n navigator.serviceWorker.addEventListener('message', onMessage);\n\n // Re-subscribe when SW controller changes (e.g., after SW update via skipWaiting)\n function handleControllerChange() {\n if (cancelled) return;\n const newController = navigator.serviceWorker.controller;\n if (newController) {\n swRef.current = newController;\n newController.postMessage({ type: 'subscribe', runId });\n setConnectionStatus('connecting');\n }\n }\n navigator.serviceWorker.addEventListener('controllerchange', handleControllerChange);\n\n navigator.serviceWorker\n .register(SW_PATH, { scope: '/' })\n .then((registration) => {\n if (cancelled) return;\n\n // Use the active worker, or wait for it to activate\n const sw = registration.active ?? registration.installing ?? registration.waiting;\n if (!sw) {\n // No worker at all — fall back to direct EventSource\n fallbackCleanupRef.current = connectDirectEventSource(\n runId,\n setEvents,\n setLastEvent,\n setConnectionStatus\n );\n return;\n }\n\n if (sw.state === 'activated') {\n subscribeToWorker(sw);\n } else {\n const onStateChange = () => {\n if (sw.state === 'activated') {\n sw.removeEventListener('statechange', onStateChange);\n subscribeToWorker(sw);\n }\n };\n sw.addEventListener('statechange', onStateChange);\n }\n })\n .catch(() => {\n // SW registration failed — fall back to direct EventSource\n if (!cancelled) {\n fallbackCleanupRef.current = connectDirectEventSource(\n runId,\n setEvents,\n setLastEvent,\n setConnectionStatus\n );\n }\n });\n\n return () => {\n cancelled = true;\n navigator.serviceWorker.removeEventListener('message', onMessage);\n navigator.serviceWorker.removeEventListener('controllerchange', handleControllerChange);\n swRef.current?.postMessage({ type: 'unsubscribe' });\n swRef.current = null;\n fallbackCleanupRef.current?.();\n };\n }, [runId, onMessage]);\n\n return { events, lastEvent, connectionStatus };\n}\n\n// --- EventSource fallback (identical to the previous implementation) ---\n\nconst BASE_BACKOFF_MS = 1000;\nconst MAX_BACKOFF_MS = 30_000;\nconst STABLE_CONNECTION_MS = 5_000;\n\nfunction connectDirectEventSource(\n runId: string | undefined,\n setEvents: React.Dispatch<React.SetStateAction<NotificationEvent[]>>,\n setLastEvent: React.Dispatch<React.SetStateAction<NotificationEvent | null>>,\n setConnectionStatus: React.Dispatch<React.SetStateAction<ConnectionStatus>>\n): () => void {\n // eslint-disable-next-line @typescript-eslint/no-empty-function\n if (typeof EventSource === 'undefined') return () => {};\n\n let es: EventSource | null = null;\n let stopped = false;\n let backoff = BASE_BACKOFF_MS;\n let reconnectTimer: ReturnType<typeof setTimeout> | null = null;\n let stableTimer: ReturnType<typeof setTimeout> | null = null;\n\n function connect() {\n if (stopped) return;\n\n const url = runId\n ? `/api/agent-events?runId=${encodeURIComponent(runId)}`\n : '/api/agent-events';\n\n es = new EventSource(url);\n setConnectionStatus('connecting');\n\n es.onopen = () => {\n setConnectionStatus('connected');\n stableTimer = setTimeout(() => {\n stableTimer = null;\n backoff = BASE_BACKOFF_MS;\n }, STABLE_CONNECTION_MS);\n };\n\n es.onerror = () => {\n es?.close();\n es = null;\n setConnectionStatus('disconnected');\n\n if (stableTimer !== null) {\n clearTimeout(stableTimer);\n stableTimer = null;\n }\n\n const delay = backoff;\n backoff = Math.min(delay * 2, MAX_BACKOFF_MS);\n\n reconnectTimer = setTimeout(() => {\n reconnectTimer = null;\n connect();\n }, delay);\n };\n\n es.addEventListener('notification', ((event: MessageEvent) => {\n const parsed: NotificationEvent = JSON.parse(event.data);\n setEvents((prev) => {\n const next = [...prev, parsed];\n return next.length > MAX_EVENTS ? next.slice(-PRUNE_KEEP) : next;\n });\n setLastEvent(parsed);\n }) as EventListener);\n }\n\n connect();\n\n return () => {\n stopped = true;\n if (reconnectTimer !== null) {\n clearTimeout(reconnectTimer);\n reconnectTimer = null;\n }\n if (stableTimer !== null) {\n clearTimeout(stableTimer);\n stableTimer = null;\n }\n if (es) {\n es.close();\n es = null;\n }\n };\n}\n","import * as React from 'react';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\nconst badgeVariants = cva(\n 'inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-none',\n {\n variants: {\n variant: {\n default: 'border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80',\n secondary:\n 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',\n destructive:\n 'border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80',\n outline: 'text-foreground',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n);\n\nexport interface BadgeProps\n extends React.HTMLAttributes<HTMLDivElement>,\n VariantProps<typeof badgeVariants> {}\n\nfunction Badge({ className, variant, ...props }: BadgeProps) {\n return <div className={cn(badgeVariants({ variant }), className)} {...props} />;\n}\n\nexport { Badge, badgeVariants };\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z',\n key: 'w46dr5',\n },\n ],\n];\n\n/**\n * @component @name Puzzle\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/puzzle\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Puzzle = createLucideIcon('puzzle', __iconNode);\n\nexport default Puzzle;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n [\n 'path',\n {\n d: 'M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z',\n key: '1xq2db',\n },\n ],\n];\n\n/**\n * @component @name Zap\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/zap\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Zap = createLucideIcon('zap', __iconNode);\n\nexport default Zap;\n","import createLucideIcon from '../createLucideIcon';\nimport { IconNode } from '../types';\n\nexport const __iconNode: IconNode = [\n ['path', { d: 'M12 6v6l4 2', key: 'mmk7yg' }],\n ['circle', { cx: '12', cy: '12', r: '10', key: '1mglay' }],\n];\n\n/**\n * @component @name Clock\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview  - https://lucide.dev/icons/clock\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst Clock = createLucideIcon('clock', __iconNode);\n\nexport default Clock;\n","'use client';\n\nimport * as React from 'react';\nimport { AlertDialog as AlertDialogPrimitive } from 'radix-ui';\n\nimport { cn } from '@/lib/utils';\nimport { Button } from '@/components/ui/button';\n\nfunction AlertDialog({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Root>) {\n return <AlertDialogPrimitive.Root data-slot=\"alert-dialog\" {...props} />;\n}\n\nfunction AlertDialogTrigger({\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Trigger>) {\n return <AlertDialogPrimitive.Trigger data-slot=\"alert-dialog-trigger\" {...props} />;\n}\n\nfunction AlertDialogPortal({ ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Portal>) {\n return <AlertDialogPrimitive.Portal data-slot=\"alert-dialog-portal\" {...props} />;\n}\n\nfunction AlertDialogOverlay({\n className,\n onClick,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Overlay>) {\n return (\n <AlertDialogPrimitive.Overlay\n data-slot=\"alert-dialog-overlay\"\n className={cn('fixed inset-0 z-50 bg-black/50', className)}\n onClick={(e) => {\n // Prevent overlay clicks from propagating to document-level handlers\n // (e.g. BaseDrawer outside-click) — only the dialog should dismiss.\n e.stopPropagation();\n onClick?.(e);\n }}\n {...props}\n />\n );\n}\n\nfunction AlertDialogContent({\n className,\n size = 'default',\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Content> & {\n size?: 'default' | 'sm';\n}) {\n return (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n data-slot=\"alert-dialog-content\"\n data-size={size}\n className={cn(\n 'bg-background group/alert-dialog-content fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-lg',\n className\n )}\n {...props}\n />\n </AlertDialogPortal>\n );\n}\n\nfunction AlertDialogHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"alert-dialog-header\"\n className={cn(\n 'grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-6 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-start sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction AlertDialogFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"alert-dialog-footer\"\n className={cn(\n 'flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction AlertDialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {\n return (\n <AlertDialogPrimitive.Title\n data-slot=\"alert-dialog-title\"\n className={cn(\n 'text-lg font-semibold sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction AlertDialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {\n return (\n <AlertDialogPrimitive.Description\n data-slot=\"alert-dialog-description\"\n className={cn('text-muted-foreground text-sm', className)}\n {...props}\n />\n );\n}\n\nfunction AlertDialogMedia({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"alert-dialog-media\"\n className={cn(\n \"bg-muted mb-2 inline-flex size-16 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-8\",\n className\n )}\n {...props}\n />\n );\n}\n\nfunction AlertDialogAction({\n className,\n variant = 'default',\n size = 'default',\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Action> &\n Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>) {\n return (\n <Button variant={variant} size={size} asChild>\n <AlertDialogPrimitive.Action\n data-slot=\"alert-dialog-action\"\n className={cn(className)}\n {...props}\n />\n </Button>\n );\n}\n\nfunction AlertDialogCancel({\n className,\n variant = 'outline',\n size = 'default',\n ...props\n}: React.ComponentProps<typeof AlertDialogPrimitive.Cancel> &\n Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>) {\n return (\n <Button variant={variant} size={size} asChild>\n <AlertDialogPrimitive.Cancel\n data-slot=\"alert-dialog-cancel\"\n className={cn(className)}\n {...props}\n />\n </Button>\n );\n}\n\nexport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogMedia,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger,\n};\n","\"use client\";\n\n// src/alert-dialog.tsx\nimport * as React from \"react\";\nimport { createContextScope } from \"@radix-ui/react-context\";\nimport { useComposedRefs } from \"@radix-ui/react-compose-refs\";\nimport * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport { createDialogScope } from \"@radix-ui/react-dialog\";\nimport { composeEventHandlers } from \"@radix-ui/primitive\";\nimport { createSlottable } from \"@radix-ui/react-slot\";\nimport { jsx, jsxs } from \"react/jsx-runtime\";\nvar ROOT_NAME = \"AlertDialog\";\nvar [createAlertDialogContext, createAlertDialogScope] = createContextScope(ROOT_NAME, [\n createDialogScope\n]);\nvar useDialogScope = createDialogScope();\nvar AlertDialog = (props) => {\n const { __scopeAlertDialog, ...alertDialogProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Root, { ...dialogScope, ...alertDialogProps, modal: true });\n};\nAlertDialog.displayName = ROOT_NAME;\nvar TRIGGER_NAME = \"AlertDialogTrigger\";\nvar AlertDialogTrigger = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...triggerProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Trigger, { ...dialogScope, ...triggerProps, ref: forwardedRef });\n }\n);\nAlertDialogTrigger.displayName = TRIGGER_NAME;\nvar PORTAL_NAME = \"AlertDialogPortal\";\nvar AlertDialogPortal = (props) => {\n const { __scopeAlertDialog, ...portalProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Portal, { ...dialogScope, ...portalProps });\n};\nAlertDialogPortal.displayName = PORTAL_NAME;\nvar OVERLAY_NAME = \"AlertDialogOverlay\";\nvar AlertDialogOverlay = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...overlayProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { ...dialogScope, ...overlayProps, ref: forwardedRef });\n }\n);\nAlertDialogOverlay.displayName = OVERLAY_NAME;\nvar CONTENT_NAME = \"AlertDialogContent\";\nvar [AlertDialogContentProvider, useAlertDialogContentContext] = createAlertDialogContext(CONTENT_NAME);\nvar Slottable = createSlottable(\"AlertDialogContent\");\nvar AlertDialogContent = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, children, ...contentProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const contentRef = React.useRef(null);\n const composedRefs = useComposedRefs(forwardedRef, contentRef);\n const cancelRef = React.useRef(null);\n return /* @__PURE__ */ jsx(\n DialogPrimitive.WarningProvider,\n {\n contentName: CONTENT_NAME,\n titleName: TITLE_NAME,\n docsSlug: \"alert-dialog\",\n children: /* @__PURE__ */ jsx(AlertDialogContentProvider, { scope: __scopeAlertDialog, cancelRef, children: /* @__PURE__ */ jsxs(\n DialogPrimitive.Content,\n {\n role: \"alertdialog\",\n ...dialogScope,\n ...contentProps,\n ref: composedRefs,\n onOpenAutoFocus: composeEventHandlers(contentProps.onOpenAutoFocus, (event) => {\n event.preventDefault();\n cancelRef.current?.focus({ preventScroll: true });\n }),\n onPointerDownOutside: (event) => event.preventDefault(),\n onInteractOutside: (event) => event.preventDefault(),\n children: [\n /* @__PURE__ */ jsx(Slottable, { children }),\n /* @__PURE__ */ jsx(DescriptionWarning, { contentRef })\n ]\n }\n ) })\n }\n );\n }\n);\nAlertDialogContent.displayName = CONTENT_NAME;\nvar TITLE_NAME = \"AlertDialogTitle\";\nvar AlertDialogTitle = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...titleProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Title, { ...dialogScope, ...titleProps, ref: forwardedRef });\n }\n);\nAlertDialogTitle.displayName = TITLE_NAME;\nvar DESCRIPTION_NAME = \"AlertDialogDescription\";\nvar AlertDialogDescription = React.forwardRef((props, forwardedRef) => {\n const { __scopeAlertDialog, ...descriptionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Description, { ...dialogScope, ...descriptionProps, ref: forwardedRef });\n});\nAlertDialogDescription.displayName = DESCRIPTION_NAME;\nvar ACTION_NAME = \"AlertDialogAction\";\nvar AlertDialogAction = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...actionProps } = props;\n const dialogScope = useDialogScope(__scopeAlertDialog);\n return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...dialogScope, ...actionProps, ref: forwardedRef });\n }\n);\nAlertDialogAction.displayName = ACTION_NAME;\nvar CANCEL_NAME = \"AlertDialogCancel\";\nvar AlertDialogCancel = React.forwardRef(\n (props, forwardedRef) => {\n const { __scopeAlertDialog, ...cancelProps } = props;\n const { cancelRef } = useAlertDialogContentContext(CANCEL_NAME, __scopeAlertDialog);\n const dialogScope = useDialogScope(__scopeAlertDialog);\n const ref = useComposedRefs(forwardedRef, cancelRef);\n return /* @__PURE__ */ jsx(DialogPrimitive.Close, { ...dialogScope, ...cancelProps, ref });\n }\n);\nAlertDialogCancel.displayName = CANCEL_NAME;\nvar DescriptionWarning = ({ contentRef }) => {\n const MESSAGE = `\\`${CONTENT_NAME}\\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \\`${CONTENT_NAME}\\` by passing a \\`${DESCRIPTION_NAME}\\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \\`id\\` and passing the same value to the \\`aria-describedby\\` prop in \\`${CONTENT_NAME}\\`. If the description is confusing or duplicative for sighted users, you can use the \\`@radix-ui/react-visually-hidden\\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;\n React.useEffect(() => {\n const hasDescription = document.getElementById(\n contentRef.current?.getAttribute(\"aria-describedby\")\n );\n if (!hasDescription) console.warn(MESSAGE);\n }, [MESSAGE, contentRef]);\n return null;\n};\nvar Root2 = AlertDialog;\nvar Trigger2 = AlertDialogTrigger;\nvar Portal2 = AlertDialogPortal;\nvar Overlay2 = AlertDialogOverlay;\nvar Content2 = AlertDialogContent;\nvar Action = AlertDialogAction;\nvar Cancel = AlertDialogCancel;\nvar Title2 = AlertDialogTitle;\nvar Description2 = AlertDialogDescription;\nexport {\n Action,\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogOverlay,\n AlertDialogPortal,\n AlertDialogTitle,\n AlertDialogTrigger,\n Cancel,\n Content2 as Content,\n Description2 as Description,\n Overlay2 as Overlay,\n Portal2 as Portal,\n Root2 as Root,\n Title2 as Title,\n Trigger2 as Trigger,\n createAlertDialogScope\n};\n//# sourceMappingURL=index.mjs.map\n","'use client';\n\nimport {\n createContext,\n useContext,\n useState,\n useCallback,\n useEffect,\n useRef,\n type ReactNode,\n} from 'react';\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from '@/components/ui/alert-dialog';\n\n/* ---------------------------------------------------------------------------\n * Context\n * ------------------------------------------------------------------------- */\n\ninterface DrawerCloseGuardContextValue {\n /** Register a drawer's dirty state and reset callback. Pass `null` to unregister. */\n setGuard: (guard: { isDirty: boolean; onReset: () => void } | null) => void;\n /** Navigate only if no dirty drawer is registered; otherwise show confirmation. */\n guardedNavigate: (navigate: () => void) => void;\n /** Returns true when any drawer has unsaved changes. Safe to call from effects/intervals. */\n getIsDirty: () => boolean;\n}\n\nconst DrawerCloseGuardContext = createContext<DrawerCloseGuardContextValue | null>(null);\n\n/* ---------------------------------------------------------------------------\n * Provider — renders the shared confirmation dialog\n * ------------------------------------------------------------------------- */\n\nexport function DrawerCloseGuardProvider({ children }: { children: ReactNode }) {\n // Use a ref so guard updates (on every keystroke) don't re-render the provider tree.\n const guardRef = useRef<{ isDirty: boolean; onReset: () => void } | null>(null);\n const pendingNavigateRef = useRef<(() => void) | null>(null);\n const [showConfirmation, setShowConfirmation] = useState(false);\n\n const setGuard = useCallback((guard: { isDirty: boolean; onReset: () => void } | null) => {\n guardRef.current = guard;\n }, []);\n\n const guardedNavigate = useCallback((navigate: () => void) => {\n if (guardRef.current?.isDirty) {\n pendingNavigateRef.current = navigate;\n setShowConfirmation(true);\n return;\n }\n navigate();\n }, []);\n\n const confirmDiscard = useCallback(() => {\n setShowConfirmation(false);\n guardRef.current?.onReset();\n guardRef.current = null;\n pendingNavigateRef.current?.();\n pendingNavigateRef.current = null;\n }, []);\n\n const cancelDiscard = useCallback(() => {\n setShowConfirmation(false);\n pendingNavigateRef.current = null;\n }, []);\n\n const getIsDirty = useCallback(() => guardRef.current?.isDirty ?? false, []);\n\n return (\n <DrawerCloseGuardContext value={{ setGuard, guardedNavigate, getIsDirty }}>\n {children}\n\n <AlertDialog open={showConfirmation}>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Discard unsaved changes?</AlertDialogTitle>\n <AlertDialogDescription>\n You have unsaved changes. Are you sure you want to discard them?\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogAction variant=\"destructive\" onClick={confirmDiscard}>\n Discard\n </AlertDialogAction>\n <AlertDialogCancel onClick={cancelDiscard}>Keep editing</AlertDialogCancel>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </DrawerCloseGuardContext>\n );\n}\n\n/* ---------------------------------------------------------------------------\n * Hook — access the guard from any child component\n * ------------------------------------------------------------------------- */\n\nexport function useDrawerCloseGuard() {\n const ctx = useContext(DrawerCloseGuardContext);\n if (!ctx) throw new Error('useDrawerCloseGuard must be used within DrawerCloseGuardProvider');\n return ctx;\n}\n\n/* ---------------------------------------------------------------------------\n * Convenience hook for drawer components\n *\n * Registers dirty state + reset callback with the guard, and returns an\n * `attemptClose` function that goes through the guard before closing.\n * ------------------------------------------------------------------------- */\n\nexport function useGuardedDrawerClose({\n open,\n isDirty,\n onClose,\n onReset,\n}: {\n open: boolean;\n isDirty: boolean;\n onClose: () => void;\n onReset: () => void;\n}) {\n const { setGuard, guardedNavigate } = useDrawerCloseGuard();\n\n // Keep the guard in sync with dirty state. Because setGuard writes to a ref,\n // this doesn't trigger re-renders in the provider.\n useEffect(() => {\n if (open) {\n setGuard({ isDirty, onReset });\n } else {\n setGuard(null);\n }\n return () => setGuard(null);\n }, [open, isDirty, onReset, setGuard]);\n\n const attemptClose = useCallback(() => {\n guardedNavigate(() => {\n onReset();\n onClose();\n });\n }, [guardedNavigate, onClose, onReset]);\n\n return { attemptClose };\n}\n"],"names":[],"mappings":"uCAyBA,CAAA,CAAA,CAAA,CAAA,AAAM,CAAN,CAAM,CAAA,EAAW,CAAA,CAAA,CAAA,AAAX,CAAA,AAAW,CAAX,AAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,GAAA,EAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAtBE,CAsBU,AArB5C,CAqB4C,AApB1C,CAAA,AAoB0C,CAAA,AApB1C,CAAA,AAoB0C,CApB1C,AAoB0C,CAAA,AApB1C,CAAA,AAoB0C,CAnB1C,AAmB0C,CAlBxC,AAkBwC,CAlBxC,AAkBkD,CAlB/C,AAkB+C,CAlB/C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,C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,WACjB,CAAA,EAAA,EAAA,IAAA,EAAC,EAAA,kBAAkB,CAAA,WACjB,CAAA,EAAA,EAAA,IAAA,EAAC,EAAA,iBAAiB,CAAA,WAChB,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,gBAAgB,CAAA,UAAC,6BAClB,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,sBAAsB,CAAA,UAAC,wEAI1B,CAAA,EAAA,EAAA,IAAA,EAAC,EAAA,iBAAiB,CAAA,WAChB,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,iBAAiB,CAAA,CAAC,QAAQ,cAAc,QAAS,WAAgB,YAGlE,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,iBAAiB,CAAA,CAAC,QAAS,WAAe,2BAMvD,CAMO,SAAS,IACd,IAAM,EAAM,CAAA,EAAA,EAAA,UAAU,AAAV,EAAW,GACvB,GAAI,CAAC,EAAK,MAAM,AAAI,MAAM,oEAC1B,OAAO,CACT,CASO,SAAS,EAAsB,MACpC,CAAI,SACJ,CAAO,SACP,CAAO,SACP,CAAO,CAMR,EACC,GAAM,UAAE,CAAQ,iBAAE,CAAe,CAAE,CAAG,IAoBtC,MAhBA,CAAA,EAAA,EAAA,SAAA,AAAS,EAAC,KACJ,EACF,EAAS,EADD,OACG,UAAS,CAAQ,GAE5B,EAAS,MAEJ,IAAM,EAAS,OACrB,CAAC,EAAM,EAAS,EAAS,EAAS,EAS9B,CAAE,aAPY,CAAA,EAAA,EAAA,WAAA,AAAW,EAAC,KAC/B,EAAgB,KACd,IACA,GACF,EACF,EAAG,CAAC,EAAiB,EAAS,EAAQ,CAEhB,CACxB","ignoreList":[0,2,4,5,12,13,14,16]}
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[48939,a=>{"use strict";var b=a.i(96960),c=a.i(10973),d=b.createContext(void 0),e=a=>{let{dir:b,children:e}=a;return(0,c.jsx)(d.Provider,{value:b,children:e})};function f(a){let c=b.useContext(d);return a||c||"ltr"}a.s(["DirectionProvider",()=>e,"Provider",()=>e,"useDirection",()=>f])},63496,a=>{"use strict";var b=a.i(96960),c=a.i(7420),d=a.i(6175),e=a.i(90986),f=a.i(10973);function g(a){let g=a+"CollectionProvider",[h,i]=(0,c.createContextScope)(g),[j,k]=h(g,{collectionRef:{current:null},itemMap:new Map}),l=a=>{let{scope:c,children:d}=a,e=b.default.useRef(null),g=b.default.useRef(new Map).current;return(0,f.jsx)(j,{scope:c,itemMap:g,collectionRef:e,children:d})};l.displayName=g;let m=a+"CollectionSlot",n=(0,e.createSlot)(m),o=b.default.forwardRef((a,b)=>{let{scope:c,children:e}=a,g=k(m,c),h=(0,d.useComposedRefs)(b,g.collectionRef);return(0,f.jsx)(n,{ref:h,children:e})});o.displayName=m;let p=a+"CollectionItemSlot",q="data-radix-collection-item",r=(0,e.createSlot)(p),s=b.default.forwardRef((a,c)=>{let{scope:e,children:g,...h}=a,i=b.default.useRef(null),j=(0,d.useComposedRefs)(c,i),l=k(p,e);return b.default.useEffect(()=>(l.itemMap.set(i,{ref:i,...h}),()=>void l.itemMap.delete(i))),(0,f.jsx)(r,{...{[q]:""},ref:j,children:g})});return s.displayName=p,[{Provider:l,Slot:o,ItemSlot:s},function(c){let d=k(a+"CollectionConsumer",c);return b.default.useCallback(()=>{let a=d.collectionRef.current;if(!a)return[];let b=Array.from(a.querySelectorAll(`[${q}]`));return Array.from(d.itemMap.values()).sort((a,c)=>b.indexOf(a.ref.current)-b.indexOf(c.ref.current))},[d.collectionRef,d.itemMap])},i]}var h=new WeakMap;function i(a,b){var c,d;let e,f,g;if("at"in Array.prototype)return Array.prototype.at.call(a,b);let h=(c=a,d=b,e=c.length,(g=(f=j(d))>=0?f:e+f)<0||g>=e?-1:g);return -1===h?void 0:a[h]}function j(a){return a!=a||0===a?0:Math.trunc(a)}(class a extends Map{#a;constructor(a){super(a),this.#a=[...super.keys()],h.set(this,!0)}set(a,b){return h.get(this)&&(this.has(a)?this.#a[this.#a.indexOf(a)]=a:this.#a.push(a)),super.set(a,b),this}insert(a,b,c){let d,e=this.has(b),f=this.#a.length,g=j(a),h=g>=0?g:f+g,i=h<0||h>=f?-1:h;if(i===this.size||e&&i===this.size-1||-1===i)return this.set(b,c),this;let k=this.size+ +!e;g<0&&h++;let l=[...this.#a],m=!1;for(let a=h;a<k;a++)if(h===a){let f=l[a];l[a]===b&&(f=l[a+1]),e&&this.delete(b),d=this.get(f),this.set(b,c)}else{m||l[a-1]!==b||(m=!0);let c=l[m?a:a-1],e=d;d=this.get(c),this.delete(c),this.set(c,e)}return this}with(b,c,d){let e=new a(this);return e.insert(b,c,d),e}before(a){let b=this.#a.indexOf(a)-1;if(!(b<0))return this.entryAt(b)}setBefore(a,b,c){let d=this.#a.indexOf(a);return -1===d?this:this.insert(d,b,c)}after(a){let b=this.#a.indexOf(a);if(-1!==(b=-1===b||b===this.size-1?-1:b+1))return this.entryAt(b)}setAfter(a,b,c){let d=this.#a.indexOf(a);return -1===d?this:this.insert(d+1,b,c)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#a=[],super.clear()}delete(a){let b=super.delete(a);return b&&this.#a.splice(this.#a.indexOf(a),1),b}deleteAt(a){let b=this.keyAt(a);return void 0!==b&&this.delete(b)}at(a){let b=i(this.#a,a);if(void 0!==b)return this.get(b)}entryAt(a){let b=i(this.#a,a);if(void 0!==b)return[b,this.get(b)]}indexOf(a){return this.#a.indexOf(a)}keyAt(a){return i(this.#a,a)}from(a,b){let c=this.indexOf(a);if(-1===c)return;let d=c+b;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.at(d)}keyFrom(a,b){let c=this.indexOf(a);if(-1===c)return;let d=c+b;return d<0&&(d=0),d>=this.size&&(d=this.size-1),this.keyAt(d)}find(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return d;c++}}findIndex(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return c;c++}return -1}filter(b,c){let d=[],e=0;for(let a of this)Reflect.apply(b,c,[a,e,this])&&d.push(a),e++;return new a(d)}map(b,c){let d=[],e=0;for(let a of this)d.push([a[0],Reflect.apply(b,c,[a,e,this])]),e++;return new a(d)}reduce(...a){let[b,c]=a,d=0,e=c??this.at(0);for(let c of this)e=0===d&&1===a.length?c:Reflect.apply(b,this,[e,c,d,this]),d++;return e}reduceRight(...a){let[b,c]=a,d=c??this.at(-1);for(let c=this.size-1;c>=0;c--){let e=this.at(c);d=c===this.size-1&&1===a.length?e:Reflect.apply(b,this,[d,e,c,this])}return d}toSorted(b){return new a([...this.entries()].sort(b))}toReversed(){let b=new a;for(let a=this.size-1;a>=0;a--){let c=this.keyAt(a),d=this.get(c);b.set(c,d)}return b}toSpliced(...b){let c=[...this.entries()];return c.splice(...b),new a(c)}slice(b,c){let d=new a,e=this.size-1;if(void 0===b)return d;b<0&&(b+=this.size),void 0!==c&&c>0&&(e=c-1);for(let a=b;a<=e;a++){let b=this.keyAt(a),c=this.get(b);d.set(b,c)}return d}every(a,b){let c=0;for(let d of this){if(!Reflect.apply(a,b,[d,c,this]))return!1;c++}return!0}some(a,b){let c=0;for(let d of this){if(Reflect.apply(a,b,[d,c,this]))return!0;c++}return!1}}),a.s(["createCollection",()=>g])},77127,a=>{"use strict";var b=a.i(96960),c=a.i(59653),d=a.i(63496),e=a.i(6175),f=a.i(7420),g=a.i(5472),h=a.i(66873),i=a.i(79406),j=a.i(17329),k=a.i(48939),l=a.i(10973),m="rovingFocusGroup.onEntryFocus",n={bubbles:!1,cancelable:!0},o="RovingFocusGroup",[p,q,r]=(0,d.createCollection)(o),[s,t]=(0,f.createContextScope)(o,[r]),[u,v]=s(o),w=b.forwardRef((a,b)=>(0,l.jsx)(p.Provider,{scope:a.__scopeRovingFocusGroup,children:(0,l.jsx)(p.Slot,{scope:a.__scopeRovingFocusGroup,children:(0,l.jsx)(x,{...a,ref:b})})}));w.displayName=o;var x=b.forwardRef((a,d)=>{let{__scopeRovingFocusGroup:f,orientation:g,loop:p=!1,dir:r,currentTabStopId:s,defaultCurrentTabStopId:t,onCurrentTabStopIdChange:v,onEntryFocus:w,preventScrollOnEntryFocus:x=!1,...y}=a,z=b.useRef(null),A=(0,e.useComposedRefs)(d,z),C=(0,k.useDirection)(r),[D,E]=(0,j.useControllableState)({prop:s,defaultProp:t??null,onChange:v,caller:o}),[F,G]=b.useState(!1),H=(0,i.useCallbackRef)(w),I=q(f),J=b.useRef(!1),[K,L]=b.useState(0);return b.useEffect(()=>{let a=z.current;if(a)return a.addEventListener(m,H),()=>a.removeEventListener(m,H)},[H]),(0,l.jsx)(u,{scope:f,orientation:g,dir:C,loop:p,currentTabStopId:D,onItemFocus:b.useCallback(a=>E(a),[E]),onItemShiftTab:b.useCallback(()=>G(!0),[]),onFocusableItemAdd:b.useCallback(()=>L(a=>a+1),[]),onFocusableItemRemove:b.useCallback(()=>L(a=>a-1),[]),children:(0,l.jsx)(h.Primitive.div,{tabIndex:F||0===K?-1:0,"data-orientation":g,...y,ref:A,style:{outline:"none",...a.style},onMouseDown:(0,c.composeEventHandlers)(a.onMouseDown,()=>{J.current=!0}),onFocus:(0,c.composeEventHandlers)(a.onFocus,a=>{let b=!J.current;if(a.target===a.currentTarget&&b&&!F){let b=new CustomEvent(m,n);if(a.currentTarget.dispatchEvent(b),!b.defaultPrevented){let a=I().filter(a=>a.focusable);B([a.find(a=>a.active),a.find(a=>a.id===D),...a].filter(Boolean).map(a=>a.ref.current),x)}}J.current=!1}),onBlur:(0,c.composeEventHandlers)(a.onBlur,()=>G(!1))})})}),y="RovingFocusGroupItem",z=b.forwardRef((a,d)=>{let{__scopeRovingFocusGroup:e,focusable:f=!0,active:i=!1,tabStopId:j,children:k,...m}=a,n=(0,g.useId)(),o=j||n,r=v(y,e),s=r.currentTabStopId===o,t=q(e),{onFocusableItemAdd:u,onFocusableItemRemove:w,currentTabStopId:x}=r;return b.useEffect(()=>{if(f)return u(),()=>w()},[f,u,w]),(0,l.jsx)(p.ItemSlot,{scope:e,id:o,focusable:f,active:i,children:(0,l.jsx)(h.Primitive.span,{tabIndex:s?0:-1,"data-orientation":r.orientation,...m,ref:d,onMouseDown:(0,c.composeEventHandlers)(a.onMouseDown,a=>{f?r.onItemFocus(o):a.preventDefault()}),onFocus:(0,c.composeEventHandlers)(a.onFocus,()=>r.onItemFocus(o)),onKeyDown:(0,c.composeEventHandlers)(a.onKeyDown,a=>{if("Tab"===a.key&&a.shiftKey)return void r.onItemShiftTab();if(a.target!==a.currentTarget)return;let b=function(a,b,c){var d;let e=(d=a.key,"rtl"!==c?d:"ArrowLeft"===d?"ArrowRight":"ArrowRight"===d?"ArrowLeft":d);if(!("vertical"===b&&["ArrowLeft","ArrowRight"].includes(e))&&!("horizontal"===b&&["ArrowUp","ArrowDown"].includes(e)))return A[e]}(a,r.orientation,r.dir);if(void 0!==b){if(a.metaKey||a.ctrlKey||a.altKey||a.shiftKey)return;a.preventDefault();let e=t().filter(a=>a.focusable).map(a=>a.ref.current);if("last"===b)e.reverse();else if("prev"===b||"next"===b){var c,d;"prev"===b&&e.reverse();let f=e.indexOf(a.currentTarget);e=r.loop?(c=e,d=f+1,c.map((a,b)=>c[(d+b)%c.length])):e.slice(f+1)}setTimeout(()=>B(e))}}),children:"function"==typeof k?k({isCurrentTabStop:s,hasTabStop:null!=x}):k})})});z.displayName=y;var A={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function B(a,b=!1){let c=document.activeElement;for(let d of a)if(d===c||(d.focus({preventScroll:b}),document.activeElement!==c))return}a.s(["Item",()=>z,"Root",()=>w,"createRovingFocusGroupScope",()=>t])}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=node_modules__pnpm_1300ae39._.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-direction%401.1.1_%40types%2Breact%4019.2.10_react%4019.2.4/node_modules/%40radix-ui/react-direction/src/direction.tsx","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-collection%401.1.7_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.10__%40types%2Br_2988d950cbd44144aec5e6ce60804441/node_modules/%40radix-ui/react-collection/src/collection-legacy.tsx","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-collection%401.1.7_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.10__%40types%2Br_2988d950cbd44144aec5e6ce60804441/node_modules/%40radix-ui/react-collection/src/collection.tsx","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-collection%401.1.7_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.10__%40types%2Br_2988d950cbd44144aec5e6ce60804441/node_modules/%40radix-ui/react-collection/src/ordered-dictionary.ts","../../../../../../../node_modules/.pnpm/%40radix-ui%2Breact-roving-focus%401.1.11_%40types%2Breact-dom%4019.2.3_%40types%2Breact%4019.2.10__%40type_61b1e57265158db0f110fd8c0c27aeba/node_modules/%40radix-ui/react-roving-focus/src/roving-focus-group.tsx"],"sourcesContent":["import * as React from 'react';\n\ntype Direction = 'ltr' | 'rtl';\nconst DirectionContext = React.createContext<Direction | undefined>(undefined);\n\n/* -------------------------------------------------------------------------------------------------\n * Direction\n * -----------------------------------------------------------------------------------------------*/\n\ninterface DirectionProviderProps {\n children?: React.ReactNode;\n dir: Direction;\n}\nconst DirectionProvider: React.FC<DirectionProviderProps> = (props) => {\n const { dir, children } = props;\n return <DirectionContext.Provider value={dir}>{children}</DirectionContext.Provider>;\n};\n\n/* -----------------------------------------------------------------------------------------------*/\n\nfunction useDirection(localDir?: Direction) {\n const globalDir = React.useContext(DirectionContext);\n return localDir || globalDir || 'ltr';\n}\n\nconst Provider = DirectionProvider;\n\nexport {\n useDirection,\n //\n Provider,\n //\n DirectionProvider,\n};\n","import React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createSlot, type Slot } from '@radix-ui/react-slot';\n\ntype SlotProps = React.ComponentPropsWithoutRef<typeof Slot>;\ntype CollectionElement = HTMLElement;\ninterface CollectionProps extends SlotProps {\n scope: any;\n}\n\n// We have resorted to returning slots directly rather than exposing primitives that can then\n// be slotted like `<CollectionItem as={Slot}>\u2026</CollectionItem>`.\n// This is because we encountered issues with generic types that cannot be statically analysed\n// due to creating them dynamically via createCollection.\n\nfunction createCollection<ItemElement extends HTMLElement, ItemData = {}>(name: string) {\n /* -----------------------------------------------------------------------------------------------\n * CollectionProvider\n * ---------------------------------------------------------------------------------------------*/\n\n const PROVIDER_NAME = name + 'CollectionProvider';\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n\n type ContextValue = {\n collectionRef: React.RefObject<CollectionElement | null>;\n itemMap: Map<\n React.RefObject<ItemElement | null>,\n { ref: React.RefObject<ItemElement | null> } & ItemData\n >;\n };\n\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext<ContextValue>(\n PROVIDER_NAME,\n { collectionRef: { current: null }, itemMap: new Map() }\n );\n\n const CollectionProvider: React.FC<{ children?: React.ReactNode; scope: any }> = (props) => {\n const { scope, children } = props;\n const ref = React.useRef<CollectionElement>(null);\n const itemMap = React.useRef<ContextValue['itemMap']>(new Map()).current;\n return (\n <CollectionProviderImpl scope={scope} itemMap={itemMap} collectionRef={ref}>\n {children}\n </CollectionProviderImpl>\n );\n };\n\n CollectionProvider.displayName = PROVIDER_NAME;\n\n /* -----------------------------------------------------------------------------------------------\n * CollectionSlot\n * ---------------------------------------------------------------------------------------------*/\n\n const COLLECTION_SLOT_NAME = name + 'CollectionSlot';\n\n const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);\n const CollectionSlot = React.forwardRef<CollectionElement, CollectionProps>(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);\n return <CollectionSlotImpl ref={composedRefs}>{children}</CollectionSlotImpl>;\n }\n );\n\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n\n /* -----------------------------------------------------------------------------------------------\n * CollectionItem\n * ---------------------------------------------------------------------------------------------*/\n\n const ITEM_SLOT_NAME = name + 'CollectionItemSlot';\n const ITEM_DATA_ATTR = 'data-radix-collection-item';\n\n type CollectionItemSlotProps = ItemData & {\n children: React.ReactNode;\n scope: any;\n };\n\n const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);\n const CollectionItemSlot = React.forwardRef<ItemElement, CollectionItemSlotProps>(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef<ItemElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n\n React.useEffect(() => {\n context.itemMap.set(ref, { ref, ...(itemData as unknown as ItemData) });\n return () => void context.itemMap.delete(ref);\n });\n\n return (\n <CollectionItemSlotImpl {...{ [ITEM_DATA_ATTR]: '' }} ref={composedRefs}>\n {children}\n </CollectionItemSlotImpl>\n );\n }\n );\n\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n\n /* -----------------------------------------------------------------------------------------------\n * useCollection\n * ---------------------------------------------------------------------------------------------*/\n\n function useCollection(scope: any) {\n const context = useCollectionContext(name + 'CollectionConsumer', scope);\n\n const getItems = React.useCallback(() => {\n const collectionNode = context.collectionRef.current;\n if (!collectionNode) return [];\n const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n const items = Array.from(context.itemMap.values());\n const orderedItems = items.sort(\n (a, b) => orderedNodes.indexOf(a.ref.current!) - orderedNodes.indexOf(b.ref.current!)\n );\n return orderedItems;\n }, [context.collectionRef, context.itemMap]);\n\n return getItems;\n }\n\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n useCollection,\n createCollectionScope,\n ] as const;\n}\n\nexport { createCollection };\nexport type { CollectionProps };\n","import React from 'react';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createSlot, type Slot } from '@radix-ui/react-slot';\nimport type { EntryOf } from './ordered-dictionary';\nimport { OrderedDict } from './ordered-dictionary';\n\ntype SlotProps = React.ComponentPropsWithoutRef<typeof Slot>;\ntype CollectionElement = HTMLElement;\ninterface CollectionProps extends SlotProps {\n scope: any;\n}\n\ninterface BaseItemData {\n id?: string;\n}\n\ntype ItemDataWithElement<\n ItemData extends BaseItemData,\n ItemElement extends HTMLElement,\n> = ItemData & {\n element: ItemElement;\n};\n\ntype ItemMap<ItemElement extends HTMLElement, ItemData extends BaseItemData> = OrderedDict<\n ItemElement,\n ItemDataWithElement<ItemData, ItemElement>\n>;\n\nfunction createCollection<\n ItemElement extends HTMLElement,\n ItemData extends BaseItemData = BaseItemData,\n>(name: string) {\n /* -----------------------------------------------------------------------------------------------\n * CollectionProvider\n * ---------------------------------------------------------------------------------------------*/\n\n const PROVIDER_NAME = name + 'CollectionProvider';\n const [createCollectionContext, createCollectionScope] = createContextScope(PROVIDER_NAME);\n\n type ContextValue = {\n collectionElement: CollectionElement | null;\n collectionRef: React.Ref<CollectionElement | null>;\n collectionRefObject: React.RefObject<CollectionElement | null>;\n itemMap: ItemMap<ItemElement, ItemData>;\n setItemMap: React.Dispatch<React.SetStateAction<ItemMap<ItemElement, ItemData>>>;\n };\n\n const [CollectionContextProvider, useCollectionContext] = createCollectionContext<ContextValue>(\n PROVIDER_NAME,\n {\n collectionElement: null,\n collectionRef: { current: null },\n collectionRefObject: { current: null },\n itemMap: new OrderedDict(),\n setItemMap: () => void 0,\n }\n );\n\n type CollectionState = [\n ItemMap: ItemMap<ItemElement, ItemData>,\n SetItemMap: React.Dispatch<React.SetStateAction<ItemMap<ItemElement, ItemData>>>,\n ];\n\n const CollectionProvider: React.FC<{\n children?: React.ReactNode;\n scope: any;\n state?: CollectionState;\n }> = ({ state, ...props }) => {\n return state ? (\n <CollectionProviderImpl {...props} state={state} />\n ) : (\n <CollectionInit {...props} />\n );\n };\n CollectionProvider.displayName = PROVIDER_NAME;\n\n const CollectionInit: React.FC<{\n children?: React.ReactNode;\n scope: any;\n }> = (props) => {\n const state = useInitCollection();\n return <CollectionProviderImpl {...props} state={state} />;\n };\n CollectionInit.displayName = PROVIDER_NAME + 'Init';\n\n const CollectionProviderImpl: React.FC<{\n children?: React.ReactNode;\n scope: any;\n state: CollectionState;\n }> = (props) => {\n const { scope, children, state } = props;\n const ref = React.useRef<CollectionElement>(null);\n const [collectionElement, setCollectionElement] = React.useState<CollectionElement | null>(\n null\n );\n const composeRefs = useComposedRefs(ref, setCollectionElement);\n const [itemMap, setItemMap] = state;\n\n React.useEffect(() => {\n if (!collectionElement) return;\n\n const observer = getChildListObserver(() => {\n // setItemMap((map) => {\n // const copy = new OrderedDict(map).toSorted(([, a], [, b]) =>\n // !a.element || !b.element ? 0 : isElementPreceding(a.element, b.element) ? -1 : 1\n // );\n // // check if the order has changed\n // let index = -1;\n // for (const entry of copy) {\n // index++;\n // const key = map.keyAt(index)!;\n // const [copyKey] = entry;\n // if (key !== copyKey) {\n // // order has changed!\n // return copy;\n // }\n // }\n // return map;\n // });\n });\n observer.observe(collectionElement, {\n childList: true,\n subtree: true,\n });\n return () => {\n observer.disconnect();\n };\n }, [collectionElement]);\n\n return (\n <CollectionContextProvider\n scope={scope}\n itemMap={itemMap}\n setItemMap={setItemMap}\n collectionRef={composeRefs}\n collectionRefObject={ref}\n collectionElement={collectionElement}\n >\n {children}\n </CollectionContextProvider>\n );\n };\n\n CollectionProviderImpl.displayName = PROVIDER_NAME + 'Impl';\n\n /* -----------------------------------------------------------------------------------------------\n * CollectionSlot\n * ---------------------------------------------------------------------------------------------*/\n\n const COLLECTION_SLOT_NAME = name + 'CollectionSlot';\n\n const CollectionSlotImpl = createSlot(COLLECTION_SLOT_NAME);\n const CollectionSlot = React.forwardRef<CollectionElement, CollectionProps>(\n (props, forwardedRef) => {\n const { scope, children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = useComposedRefs(forwardedRef, context.collectionRef);\n return <CollectionSlotImpl ref={composedRefs}>{children}</CollectionSlotImpl>;\n }\n );\n\n CollectionSlot.displayName = COLLECTION_SLOT_NAME;\n\n /* -----------------------------------------------------------------------------------------------\n * CollectionItem\n * ---------------------------------------------------------------------------------------------*/\n\n const ITEM_SLOT_NAME = name + 'CollectionItemSlot';\n const ITEM_DATA_ATTR = 'data-radix-collection-item';\n\n type CollectionItemSlotProps = ItemData & {\n children: React.ReactNode;\n scope: any;\n };\n\n const CollectionItemSlotImpl = createSlot(ITEM_SLOT_NAME);\n const CollectionItemSlot = React.forwardRef<ItemElement, CollectionItemSlotProps>(\n (props, forwardedRef) => {\n const { scope, children, ...itemData } = props;\n const ref = React.useRef<ItemElement>(null);\n const [element, setElement] = React.useState<ItemElement | null>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref, setElement);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n\n const { setItemMap } = context;\n\n const itemDataRef = React.useRef(itemData);\n if (!shallowEqual(itemDataRef.current, itemData)) {\n itemDataRef.current = itemData;\n }\n const memoizedItemData = itemDataRef.current;\n\n React.useEffect(() => {\n const itemData = memoizedItemData;\n setItemMap((map) => {\n if (!element) {\n return map;\n }\n\n if (!map.has(element)) {\n map.set(element, { ...(itemData as unknown as ItemData), element });\n return map.toSorted(sortByDocumentPosition);\n }\n\n return map\n .set(element, { ...(itemData as unknown as ItemData), element })\n .toSorted(sortByDocumentPosition);\n });\n\n return () => {\n setItemMap((map) => {\n if (!element || !map.has(element)) {\n return map;\n }\n map.delete(element);\n return new OrderedDict(map);\n });\n };\n }, [element, memoizedItemData, setItemMap]);\n\n return (\n <CollectionItemSlotImpl {...{ [ITEM_DATA_ATTR]: '' }} ref={composedRefs as any}>\n {children}\n </CollectionItemSlotImpl>\n );\n }\n );\n\n CollectionItemSlot.displayName = ITEM_SLOT_NAME;\n\n /* -----------------------------------------------------------------------------------------------\n * useInitCollection\n * ---------------------------------------------------------------------------------------------*/\n\n function useInitCollection() {\n return React.useState<ItemMap<ItemElement, ItemData>>(new OrderedDict());\n }\n\n /* -----------------------------------------------------------------------------------------------\n * useCollection\n * ---------------------------------------------------------------------------------------------*/\n\n function useCollection(scope: any) {\n const { itemMap } = useCollectionContext(name + 'CollectionConsumer', scope);\n\n return itemMap;\n }\n\n const functions = {\n createCollectionScope,\n useCollection,\n useInitCollection,\n };\n\n return [\n { Provider: CollectionProvider, Slot: CollectionSlot, ItemSlot: CollectionItemSlot },\n functions,\n ] as const;\n}\n\nexport { createCollection };\nexport type { CollectionProps };\n\nfunction shallowEqual(a: any, b: any) {\n if (a === b) return true;\n if (typeof a !== 'object' || typeof b !== 'object') return false;\n if (a == null || b == null) return false;\n const keysA = Object.keys(a);\n const keysB = Object.keys(b);\n if (keysA.length !== keysB.length) return false;\n for (const key of keysA) {\n if (!Object.prototype.hasOwnProperty.call(b, key)) return false;\n if (a[key] !== b[key]) return false;\n }\n return true;\n}\n\nfunction isElementPreceding(a: Element, b: Element) {\n return !!(b.compareDocumentPosition(a) & Node.DOCUMENT_POSITION_PRECEDING);\n}\n\nfunction sortByDocumentPosition<E extends HTMLElement, T extends BaseItemData>(\n a: EntryOf<ItemMap<E, T>>,\n b: EntryOf<ItemMap<E, T>>\n) {\n return !a[1].element || !b[1].element\n ? 0\n : isElementPreceding(a[1].element, b[1].element)\n ? -1\n : 1;\n}\n\nfunction getChildListObserver(callback: () => void) {\n const observer = new MutationObserver((mutationsList) => {\n for (const mutation of mutationsList) {\n if (mutation.type === 'childList') {\n callback();\n return;\n }\n }\n });\n\n return observer;\n}\n","// Not a real member because it shouldn't be accessible, but the super class\n// calls `set` which needs to read the instanciation state, so it can't be a\n// private member.\nconst __instanciated = new WeakMap<OrderedDict<any, any>, boolean>();\nexport class OrderedDict<K, V> extends Map<K, V> {\n #keys: K[];\n\n constructor(iterable?: Iterable<readonly [K, V]> | null | undefined);\n constructor(entries?: readonly (readonly [K, V])[] | null) {\n super(entries);\n this.#keys = [...super.keys()];\n __instanciated.set(this, true);\n }\n\n set(key: K, value: V) {\n if (__instanciated.get(this)) {\n if (this.has(key)) {\n this.#keys[this.#keys.indexOf(key)] = key;\n } else {\n this.#keys.push(key);\n }\n }\n super.set(key, value);\n return this;\n }\n\n insert(index: number, key: K, value: V) {\n const has = this.has(key);\n const length = this.#keys.length;\n const relativeIndex = toSafeInteger(index);\n let actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;\n const safeIndex = actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;\n\n if (safeIndex === this.size || (has && safeIndex === this.size - 1) || safeIndex === -1) {\n this.set(key, value);\n return this;\n }\n\n const size = this.size + (has ? 0 : 1);\n\n // If you insert at, say, -2, without this bit you'd replace the\n // second-to-last item and push the rest up one, which means the new item is\n // 3rd to last. This isn't very intuitive; inserting at -2 is more like\n // saying \"make this item the second to last\".\n if (relativeIndex < 0) {\n actualIndex++;\n }\n\n const keys = [...this.#keys];\n let nextValue: V | undefined;\n let shouldSkip = false;\n for (let i = actualIndex; i < size; i++) {\n if (actualIndex === i) {\n let nextKey = keys[i]!;\n if (keys[i] === key) {\n nextKey = keys[i + 1]!;\n }\n if (has) {\n // delete first to ensure that the item is moved to the end\n this.delete(key);\n }\n nextValue = this.get(nextKey);\n this.set(key, value);\n } else {\n if (!shouldSkip && keys[i - 1] === key) {\n shouldSkip = true;\n }\n const currentKey = keys[shouldSkip ? i : i - 1]!;\n const currentValue = nextValue!;\n nextValue = this.get(currentKey);\n this.delete(currentKey);\n this.set(currentKey, currentValue);\n }\n }\n return this;\n }\n\n with(index: number, key: K, value: V) {\n const copy = new OrderedDict(this);\n copy.insert(index, key, value);\n return copy;\n }\n\n before(key: K) {\n const index = this.#keys.indexOf(key) - 1;\n if (index < 0) {\n return undefined;\n }\n return this.entryAt(index);\n }\n\n /**\n * Sets a new key-value pair at the position before the given key.\n */\n setBefore(key: K, newKey: K, value: V) {\n const index = this.#keys.indexOf(key);\n if (index === -1) {\n return this;\n }\n return this.insert(index, newKey, value);\n }\n\n after(key: K) {\n let index = this.#keys.indexOf(key);\n index = index === -1 || index === this.size - 1 ? -1 : index + 1;\n if (index === -1) {\n return undefined;\n }\n return this.entryAt(index);\n }\n\n /**\n * Sets a new key-value pair at the position after the given key.\n */\n setAfter(key: K, newKey: K, value: V) {\n const index = this.#keys.indexOf(key);\n if (index === -1) {\n return this;\n }\n return this.insert(index + 1, newKey, value);\n }\n\n first() {\n return this.entryAt(0);\n }\n\n last() {\n return this.entryAt(-1);\n }\n\n clear() {\n this.#keys = [];\n return super.clear();\n }\n\n delete(key: K) {\n const deleted = super.delete(key);\n if (deleted) {\n this.#keys.splice(this.#keys.indexOf(key), 1);\n }\n return deleted;\n }\n\n deleteAt(index: number) {\n const key = this.keyAt(index);\n if (key !== undefined) {\n return this.delete(key);\n }\n return false;\n }\n\n at(index: number) {\n const key = at(this.#keys, index);\n if (key !== undefined) {\n return this.get(key);\n }\n }\n\n entryAt(index: number): [K, V] | undefined {\n const key = at(this.#keys, index);\n if (key !== undefined) {\n return [key, this.get(key)!];\n }\n }\n\n indexOf(key: K) {\n return this.#keys.indexOf(key);\n }\n\n keyAt(index: number) {\n return at(this.#keys, index);\n }\n\n from(key: K, offset: number) {\n const index = this.indexOf(key);\n if (index === -1) {\n return undefined;\n }\n let dest = index + offset;\n if (dest < 0) dest = 0;\n if (dest >= this.size) dest = this.size - 1;\n return this.at(dest);\n }\n\n keyFrom(key: K, offset: number) {\n const index = this.indexOf(key);\n if (index === -1) {\n return undefined;\n }\n let dest = index + offset;\n if (dest < 0) dest = 0;\n if (dest >= this.size) dest = this.size - 1;\n return this.keyAt(dest);\n }\n\n find(\n predicate: (entry: [K, V], index: number, dictionary: OrderedDict<K, V>) => boolean,\n thisArg?: any\n ) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return entry;\n }\n index++;\n }\n return undefined;\n }\n\n findIndex(\n predicate: (entry: [K, V], index: number, dictionary: OrderedDict<K, V>) => boolean,\n thisArg?: any\n ) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return index;\n }\n index++;\n }\n return -1;\n }\n\n filter<KK extends K, VV extends V>(\n predicate: (entry: [K, V], index: number, dict: OrderedDict<K, V>) => entry is [KK, VV],\n thisArg?: any\n ): OrderedDict<KK, VV>;\n\n filter(\n predicate: (entry: [K, V], index: number, dictionary: OrderedDict<K, V>) => unknown,\n thisArg?: any\n ): OrderedDict<K, V>;\n\n filter(\n predicate: (entry: [K, V], index: number, dictionary: OrderedDict<K, V>) => unknown,\n thisArg?: any\n ) {\n const entries: Array<[K, V]> = [];\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n entries.push(entry);\n }\n index++;\n }\n return new OrderedDict(entries);\n }\n\n map<U>(\n callbackfn: (entry: [K, V], index: number, dictionary: OrderedDict<K, V>) => U,\n thisArg?: any\n ): OrderedDict<K, U> {\n const entries: [K, U][] = [];\n let index = 0;\n for (const entry of this) {\n entries.push([entry[0], Reflect.apply(callbackfn, thisArg, [entry, index, this])]);\n index++;\n }\n return new OrderedDict(entries);\n }\n\n reduce(\n callbackfn: (\n previousValue: [K, V],\n currentEntry: [K, V],\n currentIndex: number,\n dictionary: OrderedDict<K, V>\n ) => [K, V]\n ): [K, V];\n reduce(\n callbackfn: (\n previousValue: [K, V],\n currentEntry: [K, V],\n currentIndex: number,\n dictionary: OrderedDict<K, V>\n ) => [K, V],\n initialValue: [K, V]\n ): [K, V];\n reduce<U>(\n callbackfn: (\n previousValue: U,\n currentEntry: [K, V],\n currentIndex: number,\n dictionary: OrderedDict<K, V>\n ) => U,\n initialValue: U\n ): U;\n\n reduce<U>(\n ...args: [\n (\n previousValue: U,\n currentEntry: [K, V],\n currentIndex: number,\n dictionary: OrderedDict<K, V>\n ) => U,\n U?,\n ]\n ) {\n const [callbackfn, initialValue] = args;\n let index = 0;\n let accumulator = initialValue ?? this.at(0)!;\n for (const entry of this) {\n if (index === 0 && args.length === 1) {\n accumulator = entry as any;\n } else {\n accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index, this]);\n }\n index++;\n }\n return accumulator;\n }\n\n reduceRight(\n callbackfn: (\n previousValue: [K, V],\n currentEntry: [K, V],\n currentIndex: number,\n dictionary: OrderedDict<K, V>\n ) => [K, V]\n ): [K, V];\n reduceRight(\n callbackfn: (\n previousValue: [K, V],\n currentEntry: [K, V],\n currentIndex: number,\n dictionary: OrderedDict<K, V>\n ) => [K, V],\n initialValue: [K, V]\n ): [K, V];\n reduceRight<U>(\n callbackfn: (\n previousValue: [K, V],\n currentValue: U,\n currentIndex: number,\n dictionary: OrderedDict<K, V>\n ) => U,\n initialValue: U\n ): U;\n\n reduceRight<U>(\n ...args: [\n (\n previousValue: U,\n currentEntry: [K, V],\n currentIndex: number,\n dictionary: OrderedDict<K, V>\n ) => U,\n U?,\n ]\n ) {\n const [callbackfn, initialValue] = args;\n let accumulator = initialValue ?? this.at(-1)!;\n for (let index = this.size - 1; index >= 0; index--) {\n const entry = this.at(index)!;\n if (index === this.size - 1 && args.length === 1) {\n accumulator = entry as any;\n } else {\n accumulator = Reflect.apply(callbackfn, this, [accumulator, entry, index, this]);\n }\n }\n return accumulator;\n }\n\n toSorted(compareFn?: (a: [K, V], b: [K, V]) => number): OrderedDict<K, V> {\n const entries = [...this.entries()].sort(compareFn);\n return new OrderedDict(entries);\n }\n\n toReversed(): OrderedDict<K, V> {\n const reversed = new OrderedDict<K, V>();\n for (let index = this.size - 1; index >= 0; index--) {\n const key = this.keyAt(index)!;\n const element = this.get(key)!;\n reversed.set(key, element);\n }\n return reversed;\n }\n\n toSpliced(start: number, deleteCount?: number): OrderedDict<K, V>;\n toSpliced(start: number, deleteCount: number, ...items: [K, V][]): OrderedDict<K, V>;\n\n toSpliced(...args: [start: number, deleteCount: number, ...items: [K, V][]]) {\n const entries = [...this.entries()];\n entries.splice(...args);\n return new OrderedDict(entries);\n }\n\n slice(start?: number, end?: number) {\n const result = new OrderedDict<K, V>();\n let stop = this.size - 1;\n\n if (start === undefined) {\n return result;\n }\n\n if (start < 0) {\n start = start + this.size;\n }\n\n if (end !== undefined && end > 0) {\n stop = end - 1;\n }\n\n for (let index = start; index <= stop; index++) {\n const key = this.keyAt(index)!;\n const element = this.get(key)!;\n result.set(key, element);\n }\n return result;\n }\n\n every(\n predicate: (entry: [K, V], index: number, dictionary: OrderedDict<K, V>) => unknown,\n thisArg?: any\n ) {\n let index = 0;\n for (const entry of this) {\n if (!Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return false;\n }\n index++;\n }\n return true;\n }\n\n some(\n predicate: (entry: [K, V], index: number, dictionary: OrderedDict<K, V>) => unknown,\n thisArg?: any\n ) {\n let index = 0;\n for (const entry of this) {\n if (Reflect.apply(predicate, thisArg, [entry, index, this])) {\n return true;\n }\n index++;\n }\n return false;\n }\n}\n\nexport type KeyOf<D extends OrderedDict<any, any>> =\n D extends OrderedDict<infer K, any> ? K : never;\nexport type ValueOf<D extends OrderedDict<any, any>> =\n D extends OrderedDict<any, infer V> ? V : never;\nexport type EntryOf<D extends OrderedDict<any, any>> = [KeyOf<D>, ValueOf<D>];\nexport type KeyFrom<E extends EntryOf<any>> = E[0];\nexport type ValueFrom<E extends EntryOf<any>> = E[1];\n\nfunction at<T>(array: ArrayLike<T>, index: number): T | undefined {\n if ('at' in Array.prototype) {\n return Array.prototype.at.call(array, index);\n }\n const actualIndex = toSafeIndex(array, index);\n return actualIndex === -1 ? undefined : array[actualIndex];\n}\n\nfunction toSafeIndex(array: ArrayLike<any>, index: number) {\n const length = array.length;\n const relativeIndex = toSafeInteger(index);\n const actualIndex = relativeIndex >= 0 ? relativeIndex : length + relativeIndex;\n return actualIndex < 0 || actualIndex >= length ? -1 : actualIndex;\n}\n\nfunction toSafeInteger(number: number) {\n // eslint-disable-next-line no-self-compare\n return number !== number || number === 0 ? 0 : Math.trunc(number);\n}\n","import * as React from 'react';\nimport { composeEventHandlers } from '@radix-ui/primitive';\nimport { createCollection } from '@radix-ui/react-collection';\nimport { useComposedRefs } from '@radix-ui/react-compose-refs';\nimport { createContextScope } from '@radix-ui/react-context';\nimport { useId } from '@radix-ui/react-id';\nimport { Primitive } from '@radix-ui/react-primitive';\nimport { useCallbackRef } from '@radix-ui/react-use-callback-ref';\nimport { useControllableState } from '@radix-ui/react-use-controllable-state';\nimport { useDirection } from '@radix-ui/react-direction';\n\nimport type { Scope } from '@radix-ui/react-context';\n\nconst ENTRY_FOCUS = 'rovingFocusGroup.onEntryFocus';\nconst EVENT_OPTIONS = { bubbles: false, cancelable: true };\n\n/* -------------------------------------------------------------------------------------------------\n * RovingFocusGroup\n * -----------------------------------------------------------------------------------------------*/\n\nconst GROUP_NAME = 'RovingFocusGroup';\n\ntype ItemData = { id: string; focusable: boolean; active: boolean };\nconst [Collection, useCollection, createCollectionScope] = createCollection<\n HTMLSpanElement,\n ItemData\n>(GROUP_NAME);\n\ntype ScopedProps<P> = P & { __scopeRovingFocusGroup?: Scope };\nconst [createRovingFocusGroupContext, createRovingFocusGroupScope] = createContextScope(\n GROUP_NAME,\n [createCollectionScope]\n);\n\ntype Orientation = React.AriaAttributes['aria-orientation'];\ntype Direction = 'ltr' | 'rtl';\n\ninterface RovingFocusGroupOptions {\n /**\n * The orientation of the group.\n * Mainly so arrow navigation is done accordingly (left & right vs. up & down)\n */\n orientation?: Orientation;\n /**\n * The direction of navigation between items.\n */\n dir?: Direction;\n /**\n * Whether keyboard navigation should loop around\n * @defaultValue false\n */\n loop?: boolean;\n}\n\ntype RovingContextValue = RovingFocusGroupOptions & {\n currentTabStopId: string | null;\n onItemFocus(tabStopId: string): void;\n onItemShiftTab(): void;\n onFocusableItemAdd(): void;\n onFocusableItemRemove(): void;\n};\n\nconst [RovingFocusProvider, useRovingFocusContext] =\n createRovingFocusGroupContext<RovingContextValue>(GROUP_NAME);\n\ntype RovingFocusGroupElement = RovingFocusGroupImplElement;\ninterface RovingFocusGroupProps extends RovingFocusGroupImplProps {}\n\nconst RovingFocusGroup = React.forwardRef<RovingFocusGroupElement, RovingFocusGroupProps>(\n (props: ScopedProps<RovingFocusGroupProps>, forwardedRef) => {\n return (\n <Collection.Provider scope={props.__scopeRovingFocusGroup}>\n <Collection.Slot scope={props.__scopeRovingFocusGroup}>\n <RovingFocusGroupImpl {...props} ref={forwardedRef} />\n </Collection.Slot>\n </Collection.Provider>\n );\n }\n);\n\nRovingFocusGroup.displayName = GROUP_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\ntype RovingFocusGroupImplElement = React.ComponentRef<typeof Primitive.div>;\ntype PrimitiveDivProps = React.ComponentPropsWithoutRef<typeof Primitive.div>;\ninterface RovingFocusGroupImplProps\n extends Omit<PrimitiveDivProps, 'dir'>,\n RovingFocusGroupOptions {\n currentTabStopId?: string | null;\n defaultCurrentTabStopId?: string;\n onCurrentTabStopIdChange?: (tabStopId: string | null) => void;\n onEntryFocus?: (event: Event) => void;\n preventScrollOnEntryFocus?: boolean;\n}\n\nconst RovingFocusGroupImpl = React.forwardRef<\n RovingFocusGroupImplElement,\n RovingFocusGroupImplProps\n>((props: ScopedProps<RovingFocusGroupImplProps>, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n orientation,\n loop = false,\n dir,\n currentTabStopId: currentTabStopIdProp,\n defaultCurrentTabStopId,\n onCurrentTabStopIdChange,\n onEntryFocus,\n preventScrollOnEntryFocus = false,\n ...groupProps\n } = props;\n const ref = React.useRef<RovingFocusGroupImplElement>(null);\n const composedRefs = useComposedRefs(forwardedRef, ref);\n const direction = useDirection(dir);\n const [currentTabStopId, setCurrentTabStopId] = useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId ?? null,\n onChange: onCurrentTabStopIdChange,\n caller: GROUP_NAME,\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = React.useState(false);\n const handleEntryFocus = useCallbackRef(onEntryFocus);\n const getItems = useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = React.useRef(false);\n const [focusableItemsCount, setFocusableItemsCount] = React.useState(0);\n\n React.useEffect(() => {\n const node = ref.current;\n if (node) {\n node.addEventListener(ENTRY_FOCUS, handleEntryFocus);\n return () => node.removeEventListener(ENTRY_FOCUS, handleEntryFocus);\n }\n }, [handleEntryFocus]);\n\n return (\n <RovingFocusProvider\n scope={__scopeRovingFocusGroup}\n orientation={orientation}\n dir={direction}\n loop={loop}\n currentTabStopId={currentTabStopId}\n onItemFocus={React.useCallback(\n (tabStopId) => setCurrentTabStopId(tabStopId),\n [setCurrentTabStopId]\n )}\n onItemShiftTab={React.useCallback(() => setIsTabbingBackOut(true), [])}\n onFocusableItemAdd={React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount + 1),\n []\n )}\n onFocusableItemRemove={React.useCallback(\n () => setFocusableItemsCount((prevCount) => prevCount - 1),\n []\n )}\n >\n <Primitive.div\n tabIndex={isTabbingBackOut || focusableItemsCount === 0 ? -1 : 0}\n data-orientation={orientation}\n {...groupProps}\n ref={composedRefs}\n style={{ outline: 'none', ...props.style }}\n onMouseDown={composeEventHandlers(props.onMouseDown, () => {\n isClickFocusRef.current = true;\n })}\n onFocus={composeEventHandlers(props.onFocus, (event) => {\n // We normally wouldn't need this check, because we already check\n // that the focus is on the current target and not bubbling to it.\n // We do this because Safari doesn't focus buttons when clicked, and\n // instead, the wrapper will get focused and not through a bubbling event.\n const isKeyboardFocus = !isClickFocusRef.current;\n\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent(ENTRY_FOCUS, EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item) => item.focusable);\n const activeItem = items.find((item) => item.active);\n const currentItem = items.find((item) => item.id === currentTabStopId);\n const candidateItems = [activeItem, currentItem, ...items].filter(\n Boolean\n ) as typeof items;\n const candidateNodes = candidateItems.map((item) => item.ref.current!);\n focusFirst(candidateNodes, preventScrollOnEntryFocus);\n }\n }\n\n isClickFocusRef.current = false;\n })}\n onBlur={composeEventHandlers(props.onBlur, () => setIsTabbingBackOut(false))}\n />\n </RovingFocusProvider>\n );\n});\n\n/* -------------------------------------------------------------------------------------------------\n * RovingFocusGroupItem\n * -----------------------------------------------------------------------------------------------*/\n\nconst ITEM_NAME = 'RovingFocusGroupItem';\n\ntype RovingFocusItemElement = React.ComponentRef<typeof Primitive.span>;\ntype PrimitiveSpanProps = React.ComponentPropsWithoutRef<typeof Primitive.span>;\ninterface RovingFocusItemProps extends Omit<PrimitiveSpanProps, 'children'> {\n tabStopId?: string;\n focusable?: boolean;\n active?: boolean;\n children?:\n | React.ReactNode\n | ((props: { hasTabStop: boolean; isCurrentTabStop: boolean }) => React.ReactNode);\n}\n\nconst RovingFocusGroupItem = React.forwardRef<RovingFocusItemElement, RovingFocusItemProps>(\n (props: ScopedProps<RovingFocusItemProps>, forwardedRef) => {\n const {\n __scopeRovingFocusGroup,\n focusable = true,\n active = false,\n tabStopId,\n children,\n ...itemProps\n } = props;\n const autoId = useId();\n const id = tabStopId || autoId;\n const context = useRovingFocusContext(ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = useCollection(__scopeRovingFocusGroup);\n\n const { onFocusableItemAdd, onFocusableItemRemove, currentTabStopId } = context;\n\n React.useEffect(() => {\n if (focusable) {\n onFocusableItemAdd();\n return () => onFocusableItemRemove();\n }\n }, [focusable, onFocusableItemAdd, onFocusableItemRemove]);\n\n return (\n <Collection.ItemSlot\n scope={__scopeRovingFocusGroup}\n id={id}\n focusable={focusable}\n active={active}\n >\n <Primitive.span\n tabIndex={isCurrentTabStop ? 0 : -1}\n data-orientation={context.orientation}\n {...itemProps}\n ref={forwardedRef}\n onMouseDown={composeEventHandlers(props.onMouseDown, (event) => {\n // We prevent focusing non-focusable items on `mousedown`.\n // Even though the item has tabIndex={-1}, that only means take it out of the tab order.\n if (!focusable) event.preventDefault();\n // Safari doesn't focus a button when clicked so we run our logic on mousedown also\n else context.onItemFocus(id);\n })}\n onFocus={composeEventHandlers(props.onFocus, () => context.onItemFocus(id))}\n onKeyDown={composeEventHandlers(props.onKeyDown, (event) => {\n if (event.key === 'Tab' && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n\n if (event.target !== event.currentTarget) return;\n\n const focusIntent = getFocusIntent(event, context.orientation, context.dir);\n\n if (focusIntent !== undefined) {\n if (event.metaKey || event.ctrlKey || event.altKey || event.shiftKey) return;\n event.preventDefault();\n const items = getItems().filter((item) => item.focusable);\n let candidateNodes = items.map((item) => item.ref.current!);\n\n if (focusIntent === 'last') candidateNodes.reverse();\n else if (focusIntent === 'prev' || focusIntent === 'next') {\n if (focusIntent === 'prev') candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop\n ? wrapArray(candidateNodes, currentIndex + 1)\n : candidateNodes.slice(currentIndex + 1);\n }\n\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */\n setTimeout(() => focusFirst(candidateNodes));\n }\n })}\n >\n {typeof children === 'function'\n ? children({ isCurrentTabStop, hasTabStop: currentTabStopId != null })\n : children}\n </Primitive.span>\n </Collection.ItemSlot>\n );\n }\n);\n\nRovingFocusGroupItem.displayName = ITEM_NAME;\n\n/* -----------------------------------------------------------------------------------------------*/\n\n// prettier-ignore\nconst MAP_KEY_TO_FOCUS_INTENT: Record<string, FocusIntent> = {\n ArrowLeft: 'prev', ArrowUp: 'prev',\n ArrowRight: 'next', ArrowDown: 'next',\n PageUp: 'first', Home: 'first',\n PageDown: 'last', End: 'last',\n};\n\nfunction getDirectionAwareKey(key: string, dir?: Direction) {\n if (dir !== 'rtl') return key;\n return key === 'ArrowLeft' ? 'ArrowRight' : key === 'ArrowRight' ? 'ArrowLeft' : key;\n}\n\ntype FocusIntent = 'first' | 'last' | 'prev' | 'next';\n\nfunction getFocusIntent(event: React.KeyboardEvent, orientation?: Orientation, dir?: Direction) {\n const key = getDirectionAwareKey(event.key, dir);\n if (orientation === 'vertical' && ['ArrowLeft', 'ArrowRight'].includes(key)) return undefined;\n if (orientation === 'horizontal' && ['ArrowUp', 'ArrowDown'].includes(key)) return undefined;\n return MAP_KEY_TO_FOCUS_INTENT[key];\n}\n\nfunction focusFirst(candidates: HTMLElement[], preventScroll = false) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates) {\n // if focus is already where we want to go, we don't want to keep going through the candidates\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus({ preventScroll });\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\n\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */\nfunction wrapArray<T>(array: T[], startIndex: number) {\n return array.map<T>((_, index) => array[(startIndex + index) % array.length]!);\n}\n\nconst Root = RovingFocusGroup;\nconst Item = RovingFocusGroupItem;\n\nexport {\n createRovingFocusGroupScope,\n //\n RovingFocusGroup,\n RovingFocusGroupItem,\n //\n Root,\n Item,\n};\nexport type { RovingFocusGroupProps, RovingFocusItemProps };\n"],"names":["React","createContextScope","useComposedRefs","createSlot","jsx","createCollection","itemData"],"mappings":"uCAAA,IAAA,EAAuB,EAAA,CAAA,CAAA,EAAX,KAeH,EAAA,EAAA,CAAA,CAAA,AAfc,OAGjB,EAAyB,EAAA,aAAA,CAAqC,KAAA,CAAS,EAUvE,EAAsD,AAAC,IAC3D,GAAM,CAAE,EAD6D,GAC7D,UAAK,CAAA,CAAS,CAAI,EAC1B,MAAO,CAAA,EAAA,EAAA,GAAA,EAAC,EAAiB,EAAlB,MAAkB,CAAjB,CAA0B,MAAO,WAAM,CAAA,CAAS,CAC1D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B,CACF,CAAC,EAEA,OAJ6C,CAAC,CAI1B,YAApB,OAAO,EACJ,EAAS,kBAAE,EAAkB,WAAgC,MAApB,CAAyB,CAAC,EACnE,CAAA,EACN,EAGN,GAGF,EAAqB,WAAA,CAAc,EAKnC,IAAM,EAAuD,CAC3D,UAAW,OAAQ,QAAS,OAC5B,WAAY,OAAQ,UAAW,OAC/B,OAAQ,QAAS,KAAM,QACvB,SAAU,OAAQ,IAAK,MACzB,EAgBA,SAAS,EAAW,CAAA,CAA2B,GAAgB,CAAA,EAC7D,AADoE,IAC9D,EAA6B,SAAS,aAAA,CAC5C,IAAA,IAAW,KAAa,EAEtB,GAAI,IAAc,EAFgB,EAGlC,EAAU,KAAA,CAAM,eAAE,AAD4B,CACd,CAAC,EAC7B,SAAS,aAAA,GAAkB,GAFe,MAIlD,iBAWa,CAbkD,CAAA,WAYlD"}
|
package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
module.exports=[228,a=>{"use strict";var b=a.i(10973);a.i(78454);var c=a.i(24255),d=a.i(2824),e=a.i(58339),f=a.i(13126),g=a.i(3195);function h({skill:a,onClose:h}){return(0,b.jsx)(c.BaseDrawer,{open:null!==a,onClose:h,size:"sm",modal:!0,"data-testid":"skill-detail-drawer",header:a?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(d.DrawerTitle,{children:a.displayName}),(0,b.jsx)(d.DrawerDescription,{children:a.name})]}):void 0,children:a?(0,b.jsxs)("div",{className:"px-4 pb-4",children:[(0,b.jsx)("p",{className:"text-muted-foreground text-sm",children:a.description}),(0,b.jsxs)("div",{className:"mt-4 flex flex-wrap items-center gap-1.5",children:[(0,b.jsx)(e.Badge,{variant:"project"===a.source?"secondary":"outline",children:"project"===a.source?"Project":"Global"}),(0,b.jsx)(e.Badge,{variant:"outline",children:a.category}),a.context?(0,b.jsx)(e.Badge,{variant:"outline",children:a.context}):null]}),a.allowedTools?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f.Separator,{className:"my-4"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:"Allowed Tools"}),(0,b.jsx)("p",{className:"text-muted-foreground mt-1 text-sm",children:a.allowedTools})]})]}):null,a.resources.length>0?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f.Separator,{className:"my-4"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-sm font-semibold",children:"Resources"}),(0,b.jsx)("ul",{className:"mt-2 space-y-1.5",children:a.resources.map(a=>(0,b.jsxs)("li",{className:"text-muted-foreground flex items-center gap-2 text-sm",children:[(0,b.jsx)(g.FolderOpen,{className:"size-3.5 shrink-0"}),(0,b.jsxs)("span",{children:[a.name,"/ — ",a.fileCount," ",1===a.fileCount?"file":"files"]})]},a.name))})]})]}):null,a.body?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(f.Separator,{className:"my-4"}),(0,b.jsx)("pre",{className:"text-muted-foreground text-sm leading-relaxed whitespace-pre-wrap",children:a.body})]}):null]}):null})}a.s(["SkillDetailDrawer",()=>h])},74468,a=>{"use strict";var b=a.i(10973),c=a.i(96960),d=a.i(31378),e=a.i(67424),f=a.i(90920),g=a.i(18948);a.i(55135);var h=a.i(75550);a.i(38702);var i=a.i(16223),j=a.i(84117),k=a.i(58339),l=a.i(3195);function m({skill:a,onSelect:c}){return(0,b.jsxs)(j.Card,{className:"hover:border-primary/50 cursor-pointer transition-colors",role:"button",tabIndex:0,onClick:()=>c(a),onKeyDown:b=>{("Enter"===b.key||" "===b.key)&&(b.preventDefault(),c(a))},"data-testid":`skill-card-${a.name}`,children:[(0,b.jsxs)(j.CardHeader,{className:"pb-3",children:[(0,b.jsx)(j.CardTitle,{className:"text-base",children:a.displayName}),(0,b.jsx)("p",{className:"text-muted-foreground font-mono text-xs",children:a.name})]}),(0,b.jsxs)(j.CardContent,{className:"space-y-3",children:[(0,b.jsx)("p",{className:"text-muted-foreground line-clamp-2 text-sm",children:a.description}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,b.jsx)(k.Badge,{variant:"project"===a.source?"secondary":"outline",children:"project"===a.source?"Project":"Global"}),a.context?(0,b.jsx)(k.Badge,{variant:"outline",children:a.context}):null,a.allowedTools?(0,b.jsx)(k.Badge,{variant:"outline",children:"Tools"}):null,a.resources.length>0?(0,b.jsxs)("span",{className:"text-muted-foreground inline-flex items-center gap-1 text-xs",children:[(0,b.jsx)(l.FolderOpen,{className:"size-3"}),a.resources.length," ",1===a.resources.length?"resource":"resources"]}):null]})]})]})}let n=["Workflow","Code Generation","Analysis","Reference"];function o({skills:a,onSkillSelect:c}){let d=function(a){let b=new Map;for(let c of a){let a=b.get(c.category)??[];a.push(c),b.set(c.category,a)}return b}(a);return(0,b.jsx)("div",{className:"space-y-8",children:n.map(a=>{let e=d.get(a);return e&&0!==e.length?(0,b.jsxs)("section",{children:[(0,b.jsxs)("h2",{className:"mb-4 text-lg font-semibold",children:[a," ",(0,b.jsxs)("span",{className:"text-muted-foreground text-sm font-normal",children:["(",e.length,")"]})]}),(0,b.jsx)("div",{className:"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3",children:e.map(a=>(0,b.jsx)(m,{skill:a,onSelect:c},a.name))})]},a):null})})}let p=[{label:"All",value:null},{label:"Workflow",value:"Workflow"},{label:"Code Generation",value:"Code Generation"},{label:"Analysis",value:"Analysis"},{label:"Reference",value:"Reference"}];function q({activeCategory:a,onCategoryChange:c,counts:d}){return(0,b.jsx)("div",{className:"flex flex-wrap gap-2",role:"group","aria-label":"Filter by category",children:p.map(({label:e,value:f})=>(0,b.jsxs)(g.Button,{variant:a===f?"default":"outline",size:"sm",onClick:()=>c(f),children:[e,d&&f?(0,b.jsxs)("span",{className:"ms-1 text-xs opacity-70",children:["(",d[f],")"]}):null]},e))})}var r=a.i(228),s=a.i(13126),t=a.i(69845),u=a.i(67837),v=a.i(2807),w=a.i(52313),x=a.i(25674);let y=(0,x.createServerReference)("4073db0b4bef40089c46e4f48f8120a5962b685503",x.callServer,void 0,x.findSourceMapURL,"removeInjectedSkill");var z=a.i(45670),A=a.i(584),B=a.i(41305);let C=(0,x.createServerReference)("40a1c8fe5c55d898770460e6b25d2297c7687e4967",x.callServer,void 0,x.findSourceMapURL,"addInjectedSkill");function D({open:a,onOpenChange:d,onAdded:e,discoveredSkills:h,existingSkillNames:i}){let[j,k]=(0,c.useState)(!1),[l,m]=(0,c.useState)(""),[n,o]=(0,c.useState)(""),[p,q]=(0,c.useState)(""),r=h.filter(a=>!i.includes(a.name)),s=async a=>{k(!0);let b=await C({name:a.name,type:"local",source:`.claude/skills/${a.name}`});(k(!1),b.success)?(w.toast.success(`Added "${a.name}" to feature skills`),e()):w.toast.error(b.error??"Failed to add skill")},t=async()=>{if(!l.trim()||!n.trim())return void w.toast.error("Name and source are required");k(!0);let a=await C({name:l.trim(),type:"remote",source:n.trim(),...p.trim()&&{remoteSkillName:p.trim()}});(k(!1),a.success)?(w.toast.success(`Added "${l.trim()}" to feature skills`),m(""),o(""),q(""),e()):w.toast.error(a.error??"Failed to add skill")};return(0,b.jsx)(z.Dialog,{open:a,onOpenChange:d,children:(0,b.jsxs)(z.DialogContent,{className:"sm:max-w-md","data-testid":"add-skill-dialog",children:[(0,b.jsx)(z.DialogHeader,{children:(0,b.jsx)(z.DialogTitle,{children:"Add Skill to Features"})}),(0,b.jsxs)(B.Tabs,{defaultValue:"local",children:[(0,b.jsxs)(B.TabsList,{className:"w-full",children:[(0,b.jsx)(B.TabsTrigger,{value:"local",className:"flex-1",children:"Local"}),(0,b.jsx)(B.TabsTrigger,{value:"remote",className:"flex-1",children:"Remote"})]}),(0,b.jsx)(B.TabsContent,{value:"local",className:"mt-4",children:0===r.length?(0,b.jsx)("p",{className:"text-muted-foreground text-sm",children:"All discovered skills are already configured."}):(0,b.jsx)("div",{className:"flex max-h-60 flex-col gap-2 overflow-y-auto",children:r.map(a=>(0,b.jsxs)("button",{type:"button",className:"hover:bg-accent flex flex-col gap-0.5 rounded-md border p-3 text-left transition-colors",onClick:()=>s(a),disabled:j,"data-testid":`add-local-skill-${a.name}`,children:[(0,b.jsx)("span",{className:"text-sm font-medium",children:a.displayName}),(0,b.jsx)("span",{className:"text-muted-foreground line-clamp-1 text-xs",children:a.description})]},a.name))})}),(0,b.jsx)(B.TabsContent,{value:"remote",className:"mt-4",children:(0,b.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,b.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,b.jsx)(A.Label,{htmlFor:"remote-name",children:"Name"}),(0,b.jsx)(f.Input,{id:"remote-name",placeholder:"e.g. remotion-best-practices",value:l,onChange:a=>m(a.target.value),"data-testid":"remote-skill-name"})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,b.jsx)(A.Label,{htmlFor:"remote-source",children:"Source (npm package or URL)"}),(0,b.jsx)(f.Input,{id:"remote-source",placeholder:"e.g. @anthropic/remotion-skills",value:n,onChange:a=>o(a.target.value),"data-testid":"remote-skill-source"})]}),(0,b.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,b.jsx)(A.Label,{htmlFor:"remote-skill-name",children:"Skill Name (optional)"}),(0,b.jsx)(f.Input,{id:"remote-skill-name",placeholder:"e.g. remotion-best-practices",value:p,onChange:a=>q(a.target.value),"data-testid":"remote-skill-skill-name"})]}),(0,b.jsx)(z.DialogFooter,{children:(0,b.jsx)(g.Button,{onClick:t,disabled:j||!l.trim()||!n.trim(),"data-testid":"add-remote-skill-submit",children:"Add Remote Skill"})})]})})]})]})})}function E({config:a,discoveredSkills:d}){let e=(0,t.useRouter)(),[f,h]=(0,c.useState)(!1),[i,j]=(0,c.useState)(null),k=(0,c.useMemo)(()=>{let a=new Map;for(let b of d)a.set(b.name,b.description);return a},[d]),l=async a=>{j(a);let b=await y(a);(j(null),b.success)?(w.toast.success(`Removed "${a}" from feature skills`),e.refresh()):w.toast.error(b.error??"Failed to remove skill")};return(0,b.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-base font-semibold",children:"Feature Skills"}),(0,b.jsx)("p",{className:"text-muted-foreground text-sm",children:"Curated skills included in new feature worktrees to guide the agent"})]}),a.skills.length>0?(0,b.jsx)("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:a.skills.map(a=>(0,b.jsx)(F,{skill:a,description:k.get(a.name),onRemove:()=>l(a.name),isRemoving:i===a.name},a.name))}):(0,b.jsx)("p",{className:"text-muted-foreground text-sm",children:"No skills configured. Add skills to guide the agent when working on new features."}),(0,b.jsx)("div",{children:(0,b.jsxs)(g.Button,{variant:"outline",size:"sm",onClick:()=>h(!0),"data-testid":"add-injected-skill-button",children:[(0,b.jsx)(u.Plus,{className:"mr-1.5 size-4"}),"Add Skill"]})}),(0,b.jsx)(D,{open:f,onOpenChange:h,onAdded:()=>{h(!1),e.refresh()},discoveredSkills:d,existingSkillNames:a.skills.map(a=>a.name)})]})}function F({skill:a,description:c,onRemove:d,isRemoving:e}){return(0,b.jsxs)(j.Card,{"data-testid":`injected-skill-${a.name}`,children:[(0,b.jsxs)(j.CardHeader,{className:"flex flex-row items-start justify-between gap-2 pb-2",children:[(0,b.jsx)("div",{className:"min-w-0",children:(0,b.jsx)(j.CardTitle,{className:"truncate text-sm",children:a.name})}),(0,b.jsx)(g.Button,{variant:"ghost",size:"icon-sm",className:"shrink-0",onClick:d,disabled:e,"aria-label":`Remove ${a.name}`,"data-testid":`remove-injected-skill-${a.name}`,children:(0,b.jsx)(v.X,{className:"size-4"})})]}),(0,b.jsxs)(j.CardContent,{className:"space-y-2 pt-0",children:[c?(0,b.jsx)("p",{className:"text-muted-foreground line-clamp-2 text-xs",children:c}):null,(0,b.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,b.jsx)(k.Badge,{variant:"local"===a.type?"secondary":"outline",className:"text-xs",children:"local"===a.type?"Local":"Remote"}),(0,b.jsx)("span",{className:"text-muted-foreground max-w-37.5 truncate text-xs",children:a.source})]})]})]})}function G({skills:a,injectionConfig:j}){let[k,l]=(0,c.useState)(""),[m,n]=(0,c.useState)(null),[p,t]=(0,c.useState)(null),u=(0,c.useMemo)(()=>(function(a){let b={Workflow:0,"Code Generation":0,Analysis:0,Reference:0};for(let c of a)b[c.category]++;return b})(a),[a]),v=(0,c.useMemo)(()=>{let b=k.toLowerCase();return a.filter(a=>{if(m&&a.category!==m)return!1;if(b){let c=a.name.toLowerCase().includes(b),d=a.description.toLowerCase().includes(b);if(!c&&!d)return!1}return!0})},[a,k,m]);return 0===a.length?(0,b.jsxs)("div",{className:"flex flex-col gap-6 p-6",children:[(0,b.jsx)(h.PageHeader,{title:"Skills",description:"Claude Code skills available to this project"}),(0,b.jsx)(E,{config:j,discoveredSkills:a}),(0,b.jsx)(s.Separator,{}),(0,b.jsx)(i.EmptyState,{icon:(0,b.jsx)(e.Puzzle,{className:"size-10"}),title:"No skills found",description:"No Claude Code skills are installed. Add skills to .claude/skills/ to get started."})]}):(0,b.jsxs)("div",{className:"flex flex-col gap-6 p-6",children:[(0,b.jsx)(h.PageHeader,{title:"Skills",description:"Claude Code skills available to this project"}),(0,b.jsx)(E,{config:j,discoveredSkills:a}),(0,b.jsx)(s.Separator,{}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(d.Search,{className:"text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2"}),(0,b.jsx)(f.Input,{placeholder:"Search skills...",value:k,onChange:a=>l(a.target.value),className:"ps-9"})]}),(0,b.jsx)(q,{activeCategory:m,onCategoryChange:n,counts:u}),v.length>0?(0,b.jsx)(o,{skills:v,onSkillSelect:t}):(0,b.jsx)(i.EmptyState,{icon:(0,b.jsx)(d.Search,{className:"size-10"}),title:"No matching skills",description:"No skills match your current search and filter criteria.",action:(0,b.jsx)(g.Button,{variant:"outline",onClick:()=>{l(""),n(null)},children:"Clear filters"})}),(0,b.jsx)(r.SkillDetailDrawer,{skill:p,onClose:()=>t(null)})]})}a.s(["SkillsPageClient",()=>G],74468)}];
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=src_presentation_web_components_features_skills_8a174cac._.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../../src/presentation/web/components/features/skills/skill-detail-drawer.tsx","../../../../../../../src/presentation/web/components/features/skills/skills-page-client.tsx","../../../../../../../src/presentation/web/components/features/skills/skill-card.tsx","../../../../../../../src/presentation/web/components/features/skills/skill-list.tsx","../../../../../../../src/presentation/web/components/features/skills/category-filter.tsx","../../../../../../../src/presentation/web/components/features/skills/auto-injected-skills-section.tsx","../../../../../../../src/presentation/web/app/actions/data%3A28e581%20%3Ctext/javascript%3E","../../../../../../../src/presentation/web/components/features/skills/add-skill-dialog.tsx","../../../../../../../src/presentation/web/app/actions/data%3Ae9ea5e%20%3Ctext/javascript%3E"],"sourcesContent":["'use client';\n\nimport { BaseDrawer } from '@/components/common/base-drawer';\nimport { DrawerTitle, DrawerDescription } from '@/components/ui/drawer';\nimport { Badge } from '@/components/ui/badge';\nimport { Separator } from '@/components/ui/separator';\nimport { FolderOpen } from 'lucide-react';\nimport type { SkillData } from '@/lib/skills';\n\nexport interface SkillDetailDrawerProps {\n skill: SkillData | null;\n onClose: () => void;\n}\n\nexport function SkillDetailDrawer({ skill, onClose }: SkillDetailDrawerProps) {\n return (\n <BaseDrawer\n open={skill !== null}\n onClose={onClose}\n size=\"sm\"\n modal\n data-testid=\"skill-detail-drawer\"\n header={\n skill ? (\n <>\n <DrawerTitle>{skill.displayName}</DrawerTitle>\n <DrawerDescription>{skill.name}</DrawerDescription>\n </>\n ) : undefined\n }\n >\n {skill ? (\n <div className=\"px-4 pb-4\">\n {/* Description */}\n <p className=\"text-muted-foreground text-sm\">{skill.description}</p>\n\n {/* Badges */}\n <div className=\"mt-4 flex flex-wrap items-center gap-1.5\">\n <Badge variant={skill.source === 'project' ? 'secondary' : 'outline'}>\n {skill.source === 'project' ? 'Project' : 'Global'}\n </Badge>\n <Badge variant=\"outline\">{skill.category}</Badge>\n {skill.context ? <Badge variant=\"outline\">{skill.context}</Badge> : null}\n </div>\n\n {/* Allowed Tools */}\n {skill.allowedTools ? (\n <>\n <Separator className=\"my-4\" />\n <div>\n <h3 className=\"text-sm font-semibold\">Allowed Tools</h3>\n <p className=\"text-muted-foreground mt-1 text-sm\">{skill.allowedTools}</p>\n </div>\n </>\n ) : null}\n\n {/* Resources */}\n {skill.resources.length > 0 ? (\n <>\n <Separator className=\"my-4\" />\n <div>\n <h3 className=\"text-sm font-semibold\">Resources</h3>\n <ul className=\"mt-2 space-y-1.5\">\n {skill.resources.map((resource) => (\n <li\n key={resource.name}\n className=\"text-muted-foreground flex items-center gap-2 text-sm\"\n >\n <FolderOpen className=\"size-3.5 shrink-0\" />\n <span>\n {resource.name}/ — {resource.fileCount}{' '}\n {resource.fileCount === 1 ? 'file' : 'files'}\n </span>\n </li>\n ))}\n </ul>\n </div>\n </>\n ) : null}\n\n {/* Body */}\n {skill.body ? (\n <>\n <Separator className=\"my-4\" />\n <pre className=\"text-muted-foreground text-sm leading-relaxed whitespace-pre-wrap\">\n {skill.body}\n </pre>\n </>\n ) : null}\n </div>\n ) : null}\n </BaseDrawer>\n );\n}\n","'use client';\n\nimport { useState, useMemo } from 'react';\nimport { Search, Puzzle } from 'lucide-react';\nimport { Input } from '@/components/ui/input';\nimport { Button } from '@/components/ui/button';\nimport { PageHeader } from '@/components/common/page-header';\nimport { EmptyState } from '@/components/common/empty-state';\nimport { SkillList } from './skill-list';\nimport { CategoryFilter } from './category-filter';\nimport { SkillDetailDrawer } from './skill-detail-drawer';\nimport type { SkillInjectionConfig } from '@shepai/core/domain/generated/output';\nimport { Separator } from '@/components/ui/separator';\nimport { AutoInjectedSkillsSection } from './auto-injected-skills-section';\nimport type { SkillCategory, SkillData } from '@/lib/skills';\n\nexport interface SkillsPageClientProps {\n skills: SkillData[];\n injectionConfig: SkillInjectionConfig;\n}\n\nfunction computeCategoryCounts(skills: SkillData[]): Record<SkillCategory, number> {\n const counts: Record<SkillCategory, number> = {\n Workflow: 0,\n 'Code Generation': 0,\n Analysis: 0,\n Reference: 0,\n };\n for (const skill of skills) {\n counts[skill.category]++;\n }\n return counts;\n}\n\nexport function SkillsPageClient({ skills, injectionConfig }: SkillsPageClientProps) {\n const [searchQuery, setSearchQuery] = useState('');\n const [activeCategory, setActiveCategory] = useState<SkillCategory | null>(null);\n const [selectedSkill, setSelectedSkill] = useState<SkillData | null>(null);\n\n const categoryCounts = useMemo(() => computeCategoryCounts(skills), [skills]);\n\n const filteredSkills = useMemo(() => {\n const query = searchQuery.toLowerCase();\n return skills.filter((skill) => {\n if (activeCategory && skill.category !== activeCategory) return false;\n if (query) {\n const matchesName = skill.name.toLowerCase().includes(query);\n const matchesDescription = skill.description.toLowerCase().includes(query);\n if (!matchesName && !matchesDescription) return false;\n }\n return true;\n });\n }, [skills, searchQuery, activeCategory]);\n\n const clearFilters = () => {\n setSearchQuery('');\n setActiveCategory(null);\n };\n\n // No skills installed at all\n if (skills.length === 0) {\n return (\n <div className=\"flex flex-col gap-6 p-6\">\n <PageHeader title=\"Skills\" description=\"Claude Code skills available to this project\" />\n <AutoInjectedSkillsSection config={injectionConfig} discoveredSkills={skills} />\n <Separator />\n <EmptyState\n icon={<Puzzle className=\"size-10\" />}\n title=\"No skills found\"\n description=\"No Claude Code skills are installed. Add skills to .claude/skills/ to get started.\"\n />\n </div>\n );\n }\n\n return (\n <div className=\"flex flex-col gap-6 p-6\">\n <PageHeader title=\"Skills\" description=\"Claude Code skills available to this project\" />\n\n {/* Feature Skills */}\n <AutoInjectedSkillsSection config={injectionConfig} discoveredSkills={skills} />\n <Separator />\n\n {/* Search */}\n <div className=\"relative\">\n <Search className=\"text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2\" />\n <Input\n placeholder=\"Search skills...\"\n value={searchQuery}\n onChange={(e) => setSearchQuery(e.target.value)}\n className=\"ps-9\"\n />\n </div>\n\n {/* Category Filter */}\n <CategoryFilter\n activeCategory={activeCategory}\n onCategoryChange={setActiveCategory}\n counts={categoryCounts}\n />\n\n {/* Skill List or Empty Filter State */}\n {filteredSkills.length > 0 ? (\n <SkillList skills={filteredSkills} onSkillSelect={setSelectedSkill} />\n ) : (\n <EmptyState\n icon={<Search className=\"size-10\" />}\n title=\"No matching skills\"\n description=\"No skills match your current search and filter criteria.\"\n action={\n <Button variant=\"outline\" onClick={clearFilters}>\n Clear filters\n </Button>\n }\n />\n )}\n\n {/* Skill Detail Drawer */}\n <SkillDetailDrawer skill={selectedSkill} onClose={() => setSelectedSkill(null)} />\n </div>\n );\n}\n","import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';\nimport { Badge } from '@/components/ui/badge';\nimport type { SkillData } from '@/lib/skills';\nimport { FolderOpen } from 'lucide-react';\n\nexport interface SkillCardProps {\n skill: SkillData;\n onSelect: (skill: SkillData) => void;\n}\n\nexport function SkillCard({ skill, onSelect }: SkillCardProps) {\n return (\n <Card\n className=\"hover:border-primary/50 cursor-pointer transition-colors\"\n role=\"button\"\n tabIndex={0}\n onClick={() => onSelect(skill)}\n onKeyDown={(e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n onSelect(skill);\n }\n }}\n data-testid={`skill-card-${skill.name}`}\n >\n <CardHeader className=\"pb-3\">\n <CardTitle className=\"text-base\">{skill.displayName}</CardTitle>\n <p className=\"text-muted-foreground font-mono text-xs\">{skill.name}</p>\n </CardHeader>\n <CardContent className=\"space-y-3\">\n <p className=\"text-muted-foreground line-clamp-2 text-sm\">{skill.description}</p>\n <div className=\"flex flex-wrap items-center gap-1.5\">\n <Badge variant={skill.source === 'project' ? 'secondary' : 'outline'}>\n {skill.source === 'project' ? 'Project' : 'Global'}\n </Badge>\n {skill.context ? <Badge variant=\"outline\">{skill.context}</Badge> : null}\n {skill.allowedTools ? <Badge variant=\"outline\">Tools</Badge> : null}\n {skill.resources.length > 0 ? (\n <span className=\"text-muted-foreground inline-flex items-center gap-1 text-xs\">\n <FolderOpen className=\"size-3\" />\n {skill.resources.length} {skill.resources.length === 1 ? 'resource' : 'resources'}\n </span>\n ) : null}\n </div>\n </CardContent>\n </Card>\n );\n}\n","import { SkillCard } from './skill-card';\nimport type { SkillCategory, SkillData } from '@/lib/skills';\n\nconst CATEGORY_ORDER: SkillCategory[] = ['Workflow', 'Code Generation', 'Analysis', 'Reference'];\n\nexport interface SkillListProps {\n skills: SkillData[];\n onSkillSelect: (skill: SkillData) => void;\n}\n\nfunction groupByCategory(skills: SkillData[]): Map<SkillCategory, SkillData[]> {\n const groups = new Map<SkillCategory, SkillData[]>();\n for (const skill of skills) {\n const group = groups.get(skill.category) ?? [];\n group.push(skill);\n groups.set(skill.category, group);\n }\n return groups;\n}\n\nexport function SkillList({ skills, onSkillSelect }: SkillListProps) {\n const groups = groupByCategory(skills);\n\n return (\n <div className=\"space-y-8\">\n {CATEGORY_ORDER.map((category) => {\n const categorySkills = groups.get(category);\n if (!categorySkills || categorySkills.length === 0) return null;\n\n return (\n <section key={category}>\n <h2 className=\"mb-4 text-lg font-semibold\">\n {category}{' '}\n <span className=\"text-muted-foreground text-sm font-normal\">\n ({categorySkills.length})\n </span>\n </h2>\n <div className=\"grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3\">\n {categorySkills.map((skill) => (\n <SkillCard key={skill.name} skill={skill} onSelect={onSkillSelect} />\n ))}\n </div>\n </section>\n );\n })}\n </div>\n );\n}\n","import { Button } from '@/components/ui/button';\nimport type { SkillCategory } from '@/lib/skills';\n\nconst CATEGORIES: { label: string; value: SkillCategory | null }[] = [\n { label: 'All', value: null },\n { label: 'Workflow', value: 'Workflow' },\n { label: 'Code Generation', value: 'Code Generation' },\n { label: 'Analysis', value: 'Analysis' },\n { label: 'Reference', value: 'Reference' },\n];\n\nexport interface CategoryFilterProps {\n activeCategory: SkillCategory | null;\n onCategoryChange: (category: SkillCategory | null) => void;\n counts?: Record<SkillCategory, number>;\n}\n\nexport function CategoryFilter({ activeCategory, onCategoryChange, counts }: CategoryFilterProps) {\n return (\n <div className=\"flex flex-wrap gap-2\" role=\"group\" aria-label=\"Filter by category\">\n {CATEGORIES.map(({ label, value }) => (\n <Button\n key={label}\n variant={activeCategory === value ? 'default' : 'outline'}\n size=\"sm\"\n onClick={() => onCategoryChange(value)}\n >\n {label}\n {counts && value ? (\n <span className=\"ms-1 text-xs opacity-70\">({counts[value]})</span>\n ) : null}\n </Button>\n ))}\n </div>\n );\n}\n","'use client';\n\nimport { useMemo, useState } from 'react';\nimport { useRouter } from 'next/navigation';\nimport { Plus, X } from 'lucide-react';\nimport { toast } from 'sonner';\nimport type { SkillInjectionConfig, SkillSource } from '@shepai/core/domain/generated/output';\nimport { Badge } from '@/components/ui/badge';\nimport { Button } from '@/components/ui/button';\nimport { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';\nimport { removeInjectedSkill } from '@/app/actions/remove-injected-skill';\nimport { AddSkillDialog } from './add-skill-dialog';\nimport type { SkillData } from '@/lib/skills';\n\nexport interface AutoInjectedSkillsSectionProps {\n config: SkillInjectionConfig;\n discoveredSkills: SkillData[];\n}\n\nexport function AutoInjectedSkillsSection({\n config,\n discoveredSkills,\n}: AutoInjectedSkillsSectionProps) {\n const router = useRouter();\n const [addDialogOpen, setAddDialogOpen] = useState(false);\n const [removingSkill, setRemovingSkill] = useState<string | null>(null);\n\n const skillDescriptions = useMemo(() => {\n const map = new Map<string, string>();\n for (const s of discoveredSkills) {\n map.set(s.name, s.description);\n }\n return map;\n }, [discoveredSkills]);\n\n const handleRemove = async (skillName: string) => {\n setRemovingSkill(skillName);\n const result = await removeInjectedSkill(skillName);\n setRemovingSkill(null);\n if (!result.success) {\n toast.error(result.error ?? 'Failed to remove skill');\n return;\n }\n toast.success(`Removed \"${skillName}\" from feature skills`);\n router.refresh();\n };\n\n const handleAdded = () => {\n setAddDialogOpen(false);\n router.refresh();\n };\n\n return (\n <div className=\"flex flex-col gap-3\">\n <div>\n <h2 className=\"text-base font-semibold\">Feature Skills</h2>\n <p className=\"text-muted-foreground text-sm\">\n Curated skills included in new feature worktrees to guide the agent\n </p>\n </div>\n {config.skills.length > 0 ? (\n <div className=\"grid gap-2 sm:grid-cols-2 lg:grid-cols-3\">\n {config.skills.map((skill) => (\n <InjectedSkillCard\n key={skill.name}\n skill={skill}\n description={skillDescriptions.get(skill.name)}\n onRemove={() => handleRemove(skill.name)}\n isRemoving={removingSkill === skill.name}\n />\n ))}\n </div>\n ) : (\n <p className=\"text-muted-foreground text-sm\">\n No skills configured. Add skills to guide the agent when working on new features.\n </p>\n )}\n <div>\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={() => setAddDialogOpen(true)}\n data-testid=\"add-injected-skill-button\"\n >\n <Plus className=\"mr-1.5 size-4\" />\n Add Skill\n </Button>\n </div>\n <AddSkillDialog\n open={addDialogOpen}\n onOpenChange={setAddDialogOpen}\n onAdded={handleAdded}\n discoveredSkills={discoveredSkills}\n existingSkillNames={config.skills.map((s) => s.name)}\n />\n </div>\n );\n}\n\nfunction InjectedSkillCard({\n skill,\n description,\n onRemove,\n isRemoving,\n}: {\n skill: SkillSource;\n description?: string;\n onRemove: () => void;\n isRemoving: boolean;\n}) {\n return (\n <Card data-testid={`injected-skill-${skill.name}`}>\n <CardHeader className=\"flex flex-row items-start justify-between gap-2 pb-2\">\n <div className=\"min-w-0\">\n <CardTitle className=\"truncate text-sm\">{skill.name}</CardTitle>\n </div>\n <Button\n variant=\"ghost\"\n size=\"icon-sm\"\n className=\"shrink-0\"\n onClick={onRemove}\n disabled={isRemoving}\n aria-label={`Remove ${skill.name}`}\n data-testid={`remove-injected-skill-${skill.name}`}\n >\n <X className=\"size-4\" />\n </Button>\n </CardHeader>\n <CardContent className=\"space-y-2 pt-0\">\n {description ? (\n <p className=\"text-muted-foreground line-clamp-2 text-xs\">{description}</p>\n ) : null}\n <div className=\"flex items-center gap-1.5\">\n <Badge variant={skill.type === 'local' ? 'secondary' : 'outline'} className=\"text-xs\">\n {skill.type === 'local' ? 'Local' : 'Remote'}\n </Badge>\n <span className=\"text-muted-foreground max-w-37.5 truncate text-xs\">{skill.source}</span>\n </div>\n </CardContent>\n </Card>\n );\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"4073db0b4bef40089c46e4f48f8120a5962b685503\":\"removeInjectedSkill\"},\"src/presentation/web/app/actions/remove-injected-skill.ts\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_0=/*#__PURE__*/createServerReference(\"4073db0b4bef40089c46e4f48f8120a5962b685503\",callServer,void 0,findSourceMapURL,\"removeInjectedSkill\");export{$$RSC_SERVER_ACTION_0 as removeInjectedSkill};","'use client';\n\nimport { useState } from 'react';\nimport { toast } from 'sonner';\nimport type { SkillSourceType } from '@shepai/core/domain/generated/output';\nimport {\n Dialog,\n DialogContent,\n DialogHeader,\n DialogTitle,\n DialogFooter,\n} from '@/components/ui/dialog';\nimport { Button } from '@/components/ui/button';\nimport { Input } from '@/components/ui/input';\nimport { Label } from '@/components/ui/label';\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';\nimport { addInjectedSkill } from '@/app/actions/add-injected-skill';\nimport type { SkillData } from '@/lib/skills';\n\nexport interface AddSkillDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n onAdded: () => void;\n discoveredSkills: SkillData[];\n existingSkillNames: string[];\n}\n\nexport function AddSkillDialog({\n open,\n onOpenChange,\n onAdded,\n discoveredSkills,\n existingSkillNames,\n}: AddSkillDialogProps) {\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [remoteName, setRemoteName] = useState('');\n const [remoteSource, setRemoteSource] = useState('');\n const [remoteSkillName, setRemoteSkillName] = useState('');\n\n const availableSkills = discoveredSkills.filter((s) => !existingSkillNames.includes(s.name));\n\n const handleAddLocal = async (skill: SkillData) => {\n setIsSubmitting(true);\n const result = await addInjectedSkill({\n name: skill.name,\n type: 'local' as SkillSourceType,\n source: `.claude/skills/${skill.name}`,\n });\n setIsSubmitting(false);\n if (!result.success) {\n toast.error(result.error ?? 'Failed to add skill');\n return;\n }\n toast.success(`Added \"${skill.name}\" to feature skills`);\n onAdded();\n };\n\n const handleAddRemote = async () => {\n if (!remoteName.trim() || !remoteSource.trim()) {\n toast.error('Name and source are required');\n return;\n }\n setIsSubmitting(true);\n const result = await addInjectedSkill({\n name: remoteName.trim(),\n type: 'remote' as SkillSourceType,\n source: remoteSource.trim(),\n ...(remoteSkillName.trim() && { remoteSkillName: remoteSkillName.trim() }),\n });\n setIsSubmitting(false);\n if (!result.success) {\n toast.error(result.error ?? 'Failed to add skill');\n return;\n }\n toast.success(`Added \"${remoteName.trim()}\" to feature skills`);\n setRemoteName('');\n setRemoteSource('');\n setRemoteSkillName('');\n onAdded();\n };\n\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent className=\"sm:max-w-md\" data-testid=\"add-skill-dialog\">\n <DialogHeader>\n <DialogTitle>Add Skill to Features</DialogTitle>\n </DialogHeader>\n <Tabs defaultValue=\"local\">\n <TabsList className=\"w-full\">\n <TabsTrigger value=\"local\" className=\"flex-1\">\n Local\n </TabsTrigger>\n <TabsTrigger value=\"remote\" className=\"flex-1\">\n Remote\n </TabsTrigger>\n </TabsList>\n <TabsContent value=\"local\" className=\"mt-4\">\n {availableSkills.length === 0 ? (\n <p className=\"text-muted-foreground text-sm\">\n All discovered skills are already configured.\n </p>\n ) : (\n <div className=\"flex max-h-60 flex-col gap-2 overflow-y-auto\">\n {availableSkills.map((skill) => (\n <button\n key={skill.name}\n type=\"button\"\n className=\"hover:bg-accent flex flex-col gap-0.5 rounded-md border p-3 text-left transition-colors\"\n onClick={() => handleAddLocal(skill)}\n disabled={isSubmitting}\n data-testid={`add-local-skill-${skill.name}`}\n >\n <span className=\"text-sm font-medium\">{skill.displayName}</span>\n <span className=\"text-muted-foreground line-clamp-1 text-xs\">\n {skill.description}\n </span>\n </button>\n ))}\n </div>\n )}\n </TabsContent>\n <TabsContent value=\"remote\" className=\"mt-4\">\n <div className=\"flex flex-col gap-3\">\n <div className=\"flex flex-col gap-1.5\">\n <Label htmlFor=\"remote-name\">Name</Label>\n <Input\n id=\"remote-name\"\n placeholder=\"e.g. remotion-best-practices\"\n value={remoteName}\n onChange={(e) => setRemoteName(e.target.value)}\n data-testid=\"remote-skill-name\"\n />\n </div>\n <div className=\"flex flex-col gap-1.5\">\n <Label htmlFor=\"remote-source\">Source (npm package or URL)</Label>\n <Input\n id=\"remote-source\"\n placeholder=\"e.g. @anthropic/remotion-skills\"\n value={remoteSource}\n onChange={(e) => setRemoteSource(e.target.value)}\n data-testid=\"remote-skill-source\"\n />\n </div>\n <div className=\"flex flex-col gap-1.5\">\n <Label htmlFor=\"remote-skill-name\">Skill Name (optional)</Label>\n <Input\n id=\"remote-skill-name\"\n placeholder=\"e.g. remotion-best-practices\"\n value={remoteSkillName}\n onChange={(e) => setRemoteSkillName(e.target.value)}\n data-testid=\"remote-skill-skill-name\"\n />\n </div>\n <DialogFooter>\n <Button\n onClick={handleAddRemote}\n disabled={isSubmitting || !remoteName.trim() || !remoteSource.trim()}\n data-testid=\"add-remote-skill-submit\"\n >\n Add Remote Skill\n </Button>\n </DialogFooter>\n </div>\n </TabsContent>\n </Tabs>\n </DialogContent>\n </Dialog>\n );\n}\n","/* __next_internal_action_entry_do_not_use__ [{\"40a1c8fe5c55d898770460e6b25d2297c7687e4967\":\"addInjectedSkill\"},\"src/presentation/web/app/actions/add-injected-skill.ts\",\"\"] */\"use turbopack no side effects\";import{createServerReference,callServer,findSourceMapURL}from\"private-next-rsc-action-client-wrapper\";const $$RSC_SERVER_ACTION_0=/*#__PURE__*/createServerReference(\"40a1c8fe5c55d898770460e6b25d2297c7687e4967\",callServer,void 0,findSourceMapURL,\"addInjectedSkill\");export{$$RSC_SERVER_ACTION_0 as addInjectedS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A,GAAA,EAAC,EAAA,CACC,eAAgB,EAChB,iBAAkB,EAClB,OAAQ,IAIT,EAAe,MAAM,CAAG,EACvB,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,CAAU,OAAQ,EAAgB,cAAe,IAElD,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,UAAU,CAAA,CACT,KAAM,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,MAAM,CAAA,CAAC,UAAU,YACxB,MAAM,qBACN,YAAY,2DACZ,OACE,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,MAAM,CAAA,CAAC,QAAQ,UAAU,QAxDf,CAwDwB,IAvD3C,EAAe,IACf,EAAkB,KACpB,WAqD2D,oBAQvD,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,iBAAiB,CAAA,CAAC,MAAO,EAAe,QAAS,IAAM,EAAiB,UAG/E"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,59311,e=>{"use strict";let t=(0,e.i(3645).default)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);e.s(["RefreshCw",()=>t],59311)},16868,e=>{"use strict";var t=e.i(43698);e.s(["PaperclipIcon",()=>t.default])},70471,e=>{"use strict";var t=e.i(16298);e.s(["FileText",()=>t.default])},42076,e=>{"use strict";async function t(){let e=await fetch("/api/dialog/pick-files",{method:"POST"});if(!e.ok)throw Error("Failed to open file dialog");let t=await e.json();return t.cancelled?null:t.files}e.s(["pickFiles",()=>t])},83843,e=>{"use strict";let t=(0,e.i(3645).default)("chevrons-up-down",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);e.s(["ChevronsUpDown",()=>t],83843)},51911,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(91967),s=e.i(5978),i=e.i(22528),o=e.i(36589),l=e.i(23405),n=e.i(77624),c=e.i(87620),d="Switch",[p,u]=(0,i.createContextScope)(d),[h,m]=p(d),x=r.forwardRef((e,i)=>{let{__scopeSwitch:l,name:n,checked:p,defaultChecked:u,required:m,disabled:x,value:f="on",onCheckedChange:g,form:j,...v}=e,[k,C]=r.useState(null),y=(0,s.useComposedRefs)(i,e=>C(e)),N=r.useRef(!1),D=!k||j||!!k.closest("form"),[T,S]=(0,o.useControllableState)({prop:p,defaultProp:u??!1,onChange:g,caller:d});return(0,t.jsxs)(h,{scope:l,checked:T,disabled:x,children:[(0,t.jsx)(c.Primitive.button,{type:"button",role:"switch","aria-checked":T,"aria-required":m,"data-state":w(T),"data-disabled":x?"":void 0,disabled:x,value:f,...v,ref:y,onClick:(0,a.composeEventHandlers)(e.onClick,e=>{S(e=>!e),D&&(N.current=e.isPropagationStopped(),N.current||e.stopPropagation())})}),D&&(0,t.jsx)(b,{control:k,bubbles:!N.current,name:n,value:f,checked:T,required:m,disabled:x,form:j,style:{transform:"translateX(-100%)"}})]})});x.displayName=d;var f="SwitchThumb",g=r.forwardRef((e,r)=>{let{__scopeSwitch:a,...s}=e,i=m(f,a);return(0,t.jsx)(c.Primitive.span,{"data-state":w(i.checked),"data-disabled":i.disabled?"":void 0,...s,ref:r})});g.displayName=f;var b=r.forwardRef(({__scopeSwitch:e,control:a,checked:i,bubbles:o=!0,...c},d)=>{let p=r.useRef(null),u=(0,s.useComposedRefs)(p,d),h=(0,l.usePrevious)(i),m=(0,n.useSize)(a);return r.useEffect(()=>{let e=p.current;if(!e)return;let t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(h!==i&&t){let r=new Event("click",{bubbles:o});t.call(e,i),e.dispatchEvent(r)}},[h,i,o]),(0,t.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:i,...c,tabIndex:-1,ref:u,style:{...c.style,...m,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function w(e){return e?"checked":"unchecked"}b.displayName="SwitchBubbleInput",e.s(["Root",()=>x,"Switch",()=>x,"SwitchThumb",()=>g,"Thumb",()=>g,"createSwitchScope",()=>u],95291);var j=e.i(95291),j=j,v=e.i(31777);function k({className:e,size:r="default",...a}){return(0,t.jsx)(j.Root,{"data-slot":"switch","data-size":r,className:(0,v.cn)("peer group/switch focus-visible:border-ring focus-visible:ring-ring/50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80 inline-flex shrink-0 cursor-pointer items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6",e),...a,children:(0,t.jsx)(j.Thumb,{"data-slot":"switch-thumb",className:(0,v.cn)("bg-background dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground pointer-events-none block rounded-full ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 rtl:data-[state=checked]:-translate-x-[calc(100%-2px)]")})})}e.s(["Switch",()=>k],51911)},15203,e=>{"use strict";var t=e.i(20314),r=e.i(79054),a=e.i(31406),s=e.i(60112),i=e.i(21023);let o=(0,i.createServerReference)("40c68aea48432d7795326f8350d052d35e83584151",i.callServer,void 0,i.findSourceMapURL,"createFeature");e.i(41001);var l=e.i(64780),n=e.i(16868),c=e.i(83843),d=e.i(97667),p=e.i(53360),u=e.i(55016),h=e.i(91925),m=e.i(83428),x=e.i(81542),f=e.i(70471),g=e.i(12103),b=e.i(59311),w=e.i(31777),j=e.i(8361);e.i(1650);var v=e.i(11495),k=e.i(45811),C=e.i(35364),y=e.i(98127),N=e.i(48306),D=e.i(41957),T=e.i(81846),S=e.i(90382),P=e.i(51911),F=e.i(2828),z=e.i(30153);e.i(50032);var E=e.i(86254);let L=(0,i.createServerReference)("401f1c146f69e19eb8dac1a6d260eecddc0b17b0ca",i.callServer,void 0,i.findSourceMapURL,"getViewerPermission");var R=e.i(41413),M=e.i(25235),I=e.i(78521);e.i(13322);var U=e.i(61201),A=e.i(75921),O=e.i(66075),B=e.i(42076);let $=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"]),q={allowPrd:!1,allowPlan:!1,allowMerge:!1};function G({open:e,onClose:a,onSubmit:s,repositoryPath:i,isSubmitting:o=!1,workflowDefaults:c,features:d,repositories:h,initialParentId:m,currentAgentType:y,currentModel:S,initialDescription:M,canPushDirectly:I}){let U=(0,j.useSoundAction)("create"),{t:A}=(0,l.useTranslation)("web"),O=i&&(!h||0===h.length||h.some(e=>e.path===i))?i:"",G=c?.approvalGates??q,H=c?.push??!1,Z=c?.openPr??!1,J=c?.ciWatchEnabled!==!1,V=c?.enableEvidence??!1,X=c?.commitEvidence??!1,Q=c?.fast!==!1,[Y,_]=(0,r.useState)(M??"");(0,r.useEffect)(()=>{M&&_(M)},[M]);let[ee,et]=(0,r.useState)([]),[er,ea]=(0,r.useState)({...G}),[es,ei]=(0,r.useState)(H),[eo,el]=(0,r.useState)(Z),[en,ec]=(0,r.useState)(c?.ciWatchEnabled!==!1),[ed,ep]=(0,r.useState)(V),[eu,eh]=(0,r.useState)(X),[em,ex]=(0,r.useState)(void 0),[ef,eg]=(0,r.useState)(Q),[eb,ew]=(0,r.useState)(!1),[ej,ev]=(0,r.useState)(!1),[ek,eC]=(0,r.useState)(!0),[ey,eN]=(0,r.useState)(!0),[eD,eT]=(0,r.useState)(c?.injectSkills??!1),[eS,eP]=(0,r.useState)(void 0),[eF,ez]=(0,r.useState)(void 0),[eE,eL]=(0,r.useState)(O||void 0),[eR,eM]=(0,r.useState)(h??[]),[eI,eU]=(0,r.useState)(!1),[eA,eO]=(0,r.useState)(null),[eB,e$]=(0,r.useState)(!1),eq=(0,r.useRef)(crypto.randomUUID()),eG=(0,r.useRef)(0),eK=(0,r.useRef)(null);(0,r.useEffect)(()=>{c&&(ea({...c.approvalGates}),ei(c.push),el(c.openPr),ec(!1!==c.ciWatchEnabled),ep(c.enableEvidence),eh(c.commitEvidence),eg(!1!==c.fast),eT(c.injectSkills??!1))},[c]),(0,r.useEffect)(()=>{eM(h??[])},[h]),(0,r.useEffect)(()=>{e&&m&&ex(m)},[e,m]);let[eW,eH]=(0,r.useState)(I??!1);(0,r.useEffect)(()=>{eH(I??!1)},[I]);let eZ=(0,r.useRef)(eE);(0,r.useEffect)(()=>{eE&&eE!==eZ.current&&(eZ.current=eE,L(eE).then(e=>eH(e.canPushDirectly)).catch(()=>eH(!1)))},[eE]),(0,r.useEffect)(()=>{eW&&(ev(!1),ei(H),el(Z),eC(!0))},[eW,H,Z]);let eJ=(0,r.useCallback)(()=>{_(""),et([]),ea({...G}),ei(H),el(Z),ec(J),ep(V),eh(X),ex(void 0),eL(O||void 0),eM(h??[]),eg(Q),ew(!1),ev(!1),eC(!0),eN(!0),eP(void 0),ez(void 0),eO(null),eG.current=0,eU(!1)},[G,H,Z,V,J,X,Q,O,h]),eV=""!==Y.trim()||ee.length>0,{attemptClose:eX}=(0,z.useGuardedDrawerClose)({open:e,isDirty:eV,onClose:a,onReset:eJ}),eQ=(0,r.useCallback)(async e=>{for(let t of(eO(null),e)){if(t.size>0xa00000)return void eO(`"${t.name}" exceeds 10 MB limit`);let e=function(e){let t=e.lastIndexOf(".");return t>=0?e.slice(t).toLowerCase():""}(t.name);if(e&&!$.has(e))return void eO(`File type "${e}" is not allowed`)}for(let t of e){let e=crypto.randomUUID();et(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:t.type||"application/octet-stream",path:"",loading:!0}]);try{let r=new FormData;r.append("file",t),r.append("sessionId",eq.current);let a=await fetch("/api/attachments/upload",{method:"POST",body:r});if(!a.ok){let t=await a.json().catch(()=>({error:"Upload failed"}));et(t=>t.filter(t=>t.id!==e)),eO(t.error??"Upload failed");return}let s=await a.json();et(t=>t.some(t=>t.id!==e&&t.path===s.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...s,id:e,loading:!1}:t))}catch{et(t=>t.filter(t=>t.id!==e)),eO("Upload failed")}}},[]),eY=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eG.current+=1,1===eG.current&&eU(!0)},[]),e_=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eG.current-=1,0===eG.current&&eU(!1)},[]),e0=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),e1=(0,r.useCallback)(e=>{e.preventDefault(),e.stopPropagation(),eG.current=0,eU(!1);let t=Array.from(e.dataTransfer.files);t.length>0&&eQ(t)},[eQ]),e5=(0,r.useCallback)(e=>{let t=e.clipboardData?.items;if(!t)return;let r=[];for(let e of Array.from(t))if("file"===e.kind){let t=e.getAsFile();t&&r.push(t)}r.length>0&&(e.preventDefault(),eQ(r))},[eQ]),e2=(0,r.useCallback)(e=>{if(e.preventDefault(),!Y.trim())return;let t=eE??O;t&&(U.play(),s({description:Y.trim(),attachments:ee.filter(e=>!e.loading),repositoryPath:t,approvalGates:{allowPrd:er.allowPrd??!1,allowPlan:er.allowPlan??!1,allowMerge:er.allowMerge??!1},push:!!ej||es||eo,openPr:!!ej||eo,ciWatchEnabled:en,enableEvidence:ed,commitEvidence:eu,fast:ef,forkAndPr:ej,commitSpecs:ek,rebaseBeforeBranch:ey,injectSkills:eD,...eb?{pending:eb}:{},...eS?{agentType:eS}:{},...eF?{model:eF}:{},...em?{parentId:em}:{},sessionId:eq.current}),eJ())},[Y,ee,er,eE,O,s,es,eo,ed,en,eu,ef,ej,ek,ey,eD,eb,eS,eF,em,U,eJ]),e3=(0,r.useCallback)(async()=>{try{let e=await (0,B.pickFiles)();if(!e)return;for(let t of e){let e=crypto.randomUUID();et(r=>[...r,{id:e,name:t.name,size:t.size,mimeType:"application/octet-stream",path:"",loading:!0}]);try{let r=await fetch("/api/attachments/upload-from-path",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:t.path,sessionId:eq.current})});if(!r.ok){let t=await r.json().catch(()=>({error:"Upload failed"}));et(t=>t.filter(t=>t.id!==e)),eO(t.error??"Upload failed");return}let a=await r.json();et(t=>t.some(t=>t.id!==e&&t.path===a.path)?t.filter(t=>t.id!==e):t.map(t=>t.id===e?{...a,id:e,loading:!1}:t))}catch{et(t=>t.filter(t=>t.id!==e)),eO("Upload failed")}}}catch{}},[]),e4=(0,r.useCallback)(e=>{et(t=>t.filter(t=>t.id!==e))},[]),e8=(0,r.useCallback)((e,t)=>{et(r=>r.map(r=>r.id===e?{...r,notes:t}:r))},[]),e6=(0,r.useRef)(null),e9=(0,r.useCallback)(e=>{(e.ctrlKey||e.metaKey)&&"Enter"===e.key&&(e.preventDefault(),e6.current?.requestSubmit())},[]),e7=(0,r.useCallback)(()=>{e$(!0)},[]),te=(0,r.useCallback)(()=>{setTimeout(()=>{let e=eK.current?.contains(document.activeElement),t=eK.current?.querySelector('[aria-expanded="true"]')!==null;e||t||e$(!1)},0)},[]),tt=d&&d.length>0,tr=!O&&!eE,ta=!O&&void 0!==h,ts=[{id:"allowPrd",label:A("createDrawer.prd"),description:A("createDrawer.prdDescription")},{id:"allowPlan",label:A("createDrawer.plan"),description:A("createDrawer.planDescription")},{id:"allowMerge",label:A("createDrawer.merge"),description:A("createDrawer.mergeDescription")}];return(0,t.jsx)(v.BaseDrawer,{open:e,onClose:eX,size:"md",modal:!1,dismissOnOutsideClick:!0,"data-testid":"feature-create-drawer",header:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("div",{className:"h-2.5 w-2.5 shrink-0 rounded-full bg-blue-500"}),(0,t.jsx)(k.DrawerTitle,{children:A("createDrawer.title")})]}),o?(0,t.jsx)(k.DrawerDescription,{asChild:!0,children:(0,t.jsx)("div",{children:(0,t.jsx)(T.Badge,{variant:"secondary",children:A("createDrawer.creating")})})}):null]}),footer:(0,t.jsxs)("div",{className:"flex flex-row justify-end gap-2",children:[(0,t.jsx)(C.Button,{variant:"outline",onClick:eX,disabled:o,children:A("createDrawer.cancel")}),(0,t.jsx)(C.Button,{type:"submit",form:"create-feature-form",disabled:!Y.trim()||o||tr,children:o?A("createDrawer.creating"):A("createDrawer.createFeature")})]}),children:(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(F.TooltipProvider,{delayDuration:400,children:(0,t.jsxs)("form",{ref:e6,id:"create-feature-form",onSubmit:e2,onKeyDown:e9,className:"flex flex-col gap-4",children:[ta?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-selector-section",children:[(0,t.jsx)(D.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:A("createDrawer.repository")}),(0,t.jsx)(W,{repositories:eR,value:eE,onChange:eL,onAddRepository:e=>{eM(t=>[...t,e]),eL(e.path)},disabled:o})]}):O?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"repo-readonly-section",children:[(0,t.jsx)(D.Label,{className:"text-muted-foreground text-xs font-semibold tracking-wider",children:A("createDrawer.repository")}),(0,t.jsx)("p",{className:"text-sm","data-testid":"repo-readonly-label",children:h?.find(e=>e.path===O)?.name??O.split("/").pop()})]}):null,(0,t.jsxs)("div",{role:"region","aria-label":A("createDrawer.fileDropZone"),"data-drag-over":eI?"true":"false",onDragEnter:eY,onDragLeave:e_,onDragOver:e0,onDrop:e1,className:(0,w.cn)("flex flex-col gap-1.5 rounded-md border-2 border-transparent p-1 transition-colors",eI&&"border-primary/50 bg-primary/5"),children:[(0,t.jsx)(D.Label,{htmlFor:"feature-description",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:A("createDrawer.describeFeature")}),(0,t.jsxs)("div",{ref:eK,onFocus:e7,onBlur:te,className:(0,w.cn)("border-input flex h-56 flex-col overflow-hidden rounded-md border shadow-xs transition-[color,box-shadow]",eB&&"ring-ring/50 border-ring ring-[3px]"),children:[(0,t.jsx)(N.Textarea,{id:"feature-description",placeholder:A("createDrawer.featurePlaceholder"),value:Y,onChange:e=>_(e.target.value),onPaste:e5,required:!0,disabled:o,className:"min-h-0 flex-1 resize-none rounded-none border-0 shadow-none focus-visible:ring-0"}),ee.length>0&&(0,t.jsx)("div",{className:"flex flex-wrap items-center gap-1.5 px-3 py-2",children:ee.map(e=>(0,t.jsx)(E.AttachmentChip,{name:e.name,size:e.size,mimeType:e.mimeType,path:e.path,onRemove:()=>e4(e.id),disabled:o,loading:e.loading,notes:e.notes,onNotesChange:t=>e8(e.id,t)},e.id))}),eA?(0,t.jsx)("p",{className:"text-destructive px-3 pb-2 text-xs",children:eA}):null,(0,t.jsxs)("div",{className:"border-input flex items-center gap-3 border-t px-3 py-1.5",children:[(0,t.jsx)(R.AgentModelPicker,{initialAgentType:eS??y??"claude-code",initialModel:eF??S??"claude-sonnet-4-6",mode:"override",onAgentModelChange:(e,t)=>{eP(e),ez(t)},disabled:o,className:"w-55"}),(0,t.jsxs)(F.Tooltip,{children:[(0,t.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"ml-auto flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(P.Switch,{id:"pending-mode",checked:eb,onCheckedChange:ew,disabled:o}),(0,t.jsxs)(D.Label,{htmlFor:"pending-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(u.Clock,{className:"h-3.5 w-3.5"}),A("createDrawer.pendingMode")]})]})}),(0,t.jsx)(F.TooltipContent,{side:"bottom",children:A("createDrawer.pendingModeDescription")})]}),(0,t.jsxs)(F.Tooltip,{children:[(0,t.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-2",children:[(0,t.jsx)(P.Switch,{id:"fast-mode",checked:ef,onCheckedChange:eg,disabled:o}),(0,t.jsxs)(D.Label,{htmlFor:"fast-mode",className:"flex cursor-pointer items-center gap-1 text-sm font-medium",children:[(0,t.jsx)(p.Zap,{className:"h-3.5 w-3.5"}),A("createDrawer.fastModeLabel")]})]})}),(0,t.jsx)(F.TooltipContent,{side:"bottom",children:A("createDrawer.fastModeDescription")})]}),(0,t.jsxs)(F.Tooltip,{children:[(0,t.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:e3,disabled:o,"aria-label":A("chat.attachFiles"),className:"text-muted-foreground hover:text-foreground cursor-pointer rounded p-1 transition-colors",children:(0,t.jsx)(n.PaperclipIcon,{className:"h-4 w-4"})})}),(0,t.jsx)(F.TooltipContent,{side:"bottom",children:A("chat.attachFiles")})]})]})]})]}),tt&&void 0!==m?(0,t.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,t.jsx)(D.Label,{htmlFor:"parent-feature",className:"text-muted-foreground text-xs font-semibold tracking-wider",children:A("createDrawer.parentFeature")}),(0,t.jsx)(K,{features:d,value:em,onChange:ex,disabled:o})]}):null,(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(F.Tooltip,{children:[(0,t.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:A("createDrawer.approve")})}),(0,t.jsx)(F.TooltipContent,{side:"bottom",children:A("createDrawer.approveDescription")})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:ts.map(e=>(0,t.jsxs)(F.Tooltip,{children:[(0,t.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(P.Switch,{id:`approve-${e.id}`,size:"sm",checked:er[e.id]??!1,onCheckedChange:t=>ea(r=>({...r,[e.id]:t})),disabled:o||ef&&("allowPrd"===e.id||"allowPlan"===e.id)}),(0,t.jsx)(D.Label,{htmlFor:`approve-${e.id}`,className:"cursor-pointer text-xs font-medium",children:e.label})]})}),(0,t.jsx)(F.TooltipContent,{side:"bottom",children:ef&&("allowPrd"===e.id||"allowPlan"===e.id)?A("createDrawer.skippedInFastMode"):e.description})]},e.id))}),(0,t.jsxs)(F.Tooltip,{children:[(0,t.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("button",{type:"button",onClick:()=>{let e=ts.every(e=>er[e.id]),t={};for(let r of ts)t[r.id]=!e;ea(t)},disabled:o,className:(0,w.cn)("text-muted-foreground hover:text-foreground cursor-pointer rounded px-1.5 py-0.5 text-[10px] font-semibold tracking-wider uppercase transition-colors",ts.every(e=>er[e.id])&&"text-primary"),children:A("createDrawer.all")})}),(0,t.jsx)(F.TooltipContent,{side:"bottom",children:A("createDrawer.toggleAllApprovalGates")})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(F.Tooltip,{children:[(0,t.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:A("createDrawer.evidence")})}),(0,t.jsx)(F.TooltipContent,{side:"bottom",children:A("createDrawer.evidenceDescription")})]}),(0,t.jsxs)("div",{className:"flex flex-1 items-center gap-4",children:[(0,t.jsxs)(F.Tooltip,{children:[(0,t.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(P.Switch,{id:"enable-evidence",size:"sm",checked:ed,onCheckedChange:e=>{ep(e),e||eh(!1)},disabled:o}),(0,t.jsx)(D.Label,{htmlFor:"enable-evidence",className:"cursor-pointer text-xs font-medium",children:A("createDrawer.collect")})]})}),(0,t.jsx)(F.TooltipContent,{side:"bottom",children:A("createDrawer.collectDescription")})]}),(0,t.jsxs)(F.Tooltip,{children:[(0,t.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(P.Switch,{id:"commit-evidence",size:"sm",checked:eu,onCheckedChange:eh,disabled:o||!ed||!eo&&!ej}),(0,t.jsx)(D.Label,{htmlFor:"commit-evidence",className:(0,w.cn)("cursor-pointer text-xs font-medium",(!ed||!eo&&!ej)&&"opacity-50"),children:A("createDrawer.addToPr")})]})}),(0,t.jsx)(F.TooltipContent,{side:"bottom",children:eo||ej?ed?A("createDrawer.addToPrDescription"):A("createDrawer.requiresEvidence"):A("createDrawer.requiresPr")})]})]})]}),(0,t.jsxs)("div",{className:"border-input flex items-center gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsxs)(F.Tooltip,{children:[(0,t.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 cursor-default text-xs font-semibold tracking-wider",children:A("createDrawer.skills")})}),(0,t.jsx)(F.TooltipContent,{side:"bottom",children:A("createDrawer.skillsDescription")})]}),(0,t.jsx)("div",{className:"flex flex-1 items-center gap-4",children:(0,t.jsxs)(F.Tooltip,{children:[(0,t.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(P.Switch,{id:"inject-skills",size:"sm",checked:eD,onCheckedChange:eT,disabled:o}),(0,t.jsxs)(D.Label,{htmlFor:"inject-skills",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(g.Puzzle,{className:"h-3 w-3"}),A("createDrawer.injectSkills")]})]})}),(0,t.jsx)(F.TooltipContent,{side:"bottom",children:A("createDrawer.injectSkillsDescription")})]})})]}),(0,t.jsxs)("div",{className:"border-input flex items-start gap-4 rounded-md border px-3 py-2.5",children:[(0,t.jsx)("span",{className:"text-muted-foreground w-16 shrink-0 pt-0.5 text-xs font-semibold tracking-wider",children:A("createDrawer.git")}),(0,t.jsxs)("div",{className:"flex flex-1 flex-wrap items-center gap-4",children:[(0,t.jsxs)(F.Tooltip,{children:[(0,t.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(P.Switch,{id:"push",size:"sm",checked:!!ej||es||eo,onCheckedChange:e=>{ei(e),!e&&eo&&el(!1)},disabled:o||ej}),(0,t.jsx)(D.Label,{htmlFor:"push",className:(0,w.cn)("cursor-pointer text-xs font-medium",ej&&"opacity-50"),children:A("createDrawer.push")})]})}),(0,t.jsx)(F.TooltipContent,{side:"bottom",children:ej?"Enabled — contributing to upstream":A("createDrawer.pushDescription")})]}),(0,t.jsxs)(F.Tooltip,{children:[(0,t.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(P.Switch,{id:"open-pr",size:"sm",checked:!!ej||eo,onCheckedChange:e=>{el(e),e||eh(!1)},disabled:o||ej}),(0,t.jsx)(D.Label,{htmlFor:"open-pr",className:(0,w.cn)("cursor-pointer text-xs font-medium",ej&&"opacity-50"),children:A("createDrawer.pr")})]})}),(0,t.jsx)(F.TooltipContent,{side:"bottom",children:ej?"Enabled — contributing to upstream":A("createDrawer.prDescription")})]}),(0,t.jsxs)(F.Tooltip,{children:[(0,t.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(P.Switch,{id:"ci-watch",size:"sm",checked:en,onCheckedChange:ec,disabled:o}),(0,t.jsx)(D.Label,{htmlFor:"ci-watch",className:"cursor-pointer text-xs font-medium",children:A("createDrawer.watch")})]})}),(0,t.jsx)(F.TooltipContent,{side:"bottom",children:A("createDrawer.watchDescription")})]}),(0,t.jsx)("div",{className:"bg-border h-4 w-px shrink-0"}),(0,t.jsxs)(F.Tooltip,{children:[(0,t.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(P.Switch,{id:"rebase-before-branch",size:"sm",checked:ey,onCheckedChange:eN,disabled:o}),(0,t.jsxs)(D.Label,{htmlFor:"rebase-before-branch",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(b.RefreshCw,{className:"h-3 w-3"}),A("createDrawer.sync")]})]})}),(0,t.jsx)(F.TooltipContent,{side:"bottom",children:A("createDrawer.syncDescription")})]}),(0,t.jsxs)(F.Tooltip,{children:[(0,t.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(P.Switch,{id:"commit-specs",size:"sm",checked:ek,onCheckedChange:eC,disabled:o}),(0,t.jsxs)(D.Label,{htmlFor:"commit-specs",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(f.FileText,{className:"h-3 w-3"}),A("createDrawer.commitSpecs")]})]})}),(0,t.jsx)(F.TooltipContent,{side:"bottom",children:A("createDrawer.commitSpecsDescription")})]}),!eW&&(0,t.jsxs)(F.Tooltip,{children:[(0,t.jsx)(F.TooltipTrigger,{asChild:!0,children:(0,t.jsxs)("div",{className:"flex cursor-pointer items-center gap-1.5",children:[(0,t.jsx)(P.Switch,{id:"fork-and-pr",size:"sm",checked:ej,onCheckedChange:e=>{ev(e),e&&eC(!1)},disabled:o}),(0,t.jsxs)(D.Label,{htmlFor:"fork-and-pr",className:"flex cursor-pointer items-center gap-1 text-xs font-medium",children:[(0,t.jsx)(x.GitFork,{className:"h-3 w-3"}),A("createDrawer.forkAndPr")]})]})}),(0,t.jsx)(F.TooltipContent,{side:"bottom",children:A("createDrawer.forkAndPrDescription")})]})]})]})]})]})})})})}function K({features:e,value:a,onChange:s,disabled:i}){let{t:o}=(0,l.useTranslation)("web"),[n,p]=(0,r.useState)(!1),[u,h]=(0,r.useState)(""),m=(0,r.useRef)(null),x=e.find(e=>e.id===a),f=u.trim()?e.filter(e=>e.name.toLowerCase().includes(u.toLowerCase())||e.id.toLowerCase().includes(u.toLowerCase())):e,g=(0,r.useCallback)(e=>{s(e),p(!1),h("")},[s]);return(0,r.useEffect)(()=>{n?setTimeout(()=>m.current?.focus(),0):h("")},[n]),(0,t.jsxs)(S.Popover,{open:n,onOpenChange:p,children:[(0,t.jsx)(S.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{id:"parent-feature",type:"button",role:"combobox","aria-expanded":n,"aria-label":"Parent Feature",disabled:i,"data-testid":"parent-feature-combobox",className:(0,w.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!x&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:x?`${x.name} (${x.id.slice(0,8)})`:o("createDrawer.selectParent")}),(0,t.jsx)(c.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(S.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"parent-feature-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(y.Input,{ref:m,placeholder:o("createDrawer.searchFeatures"),value:u,onChange:e=>h(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"parent-feature-search"})}),(0,t.jsxs)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Features",children:[(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":void 0===a,onClick:()=>g(void 0),className:(0,w.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",void 0===a&&"bg-accent/50"),"data-testid":"parent-feature-option-none",children:[(0,t.jsx)(d.CheckIcon,{className:(0,w.cn)("h-4 w-4 shrink-0",void 0!==a&&"invisible")}),(0,t.jsx)("span",{className:"text-muted-foreground italic",children:o("createDrawer.noParent")})]}),0===f.length&&u?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm",children:o("createDrawer.noFeaturesFound")}):f.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.id,onClick:()=>g(e.id),className:(0,w.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.id&&"bg-accent/50"),"data-testid":`parent-feature-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,w.cn)("h-4 w-4 shrink-0",a!==e.id&&"invisible")}),(0,t.jsxs)("span",{className:"truncate",children:[e.name," ",(0,t.jsxs)("span",{className:"text-muted-foreground font-mono text-xs",children:["(",e.id.slice(0,8),")"]})]})]},e.id))]})]})})]})}function W({repositories:e,value:a,onChange:s,onAddRepository:i,disabled:o}){let[n,p]=(0,r.useState)(!1),[u,x]=(0,r.useState)(""),[f,g]=(0,r.useState)(!1),[b,j]=(0,r.useState)(null),[v,k]=(0,r.useState)(!1),C=(0,r.useRef)(null),{reactFileManager:N}=(0,A.useFeatureFlags)(),{t:D}=(0,l.useTranslation)("web"),T=e.find(e=>e.path===a),P=u.trim()?e.filter(e=>e.name.toLowerCase().includes(u.toLowerCase())||e.path.toLowerCase().includes(u.toLowerCase())):e,F=(0,r.useCallback)(e=>{s(e),p(!1),x("")},[s]),z=(0,r.useCallback)(async e=>{let t=await (0,O.addRepository)({path:e});if(t.error){j(t.error),g(!1);return}if(t.repository){let e={id:t.repository.id,name:t.repository.name,path:t.repository.path};i?.(e),s(e.path),p(!1),x("")}},[i,s]),E=(0,r.useCallback)(async()=>{if(!f){if(N)return void k(!0);g(!0),j(null);try{let e=await (0,I.pickFolder)();if(!e)return void g(!1);await z(e)}catch{k(!0)}finally{g(!1)}}},[f,N,z]),L=(0,r.useCallback)(async e=>{if(k(!1),e){g(!0),j(null);try{await z(e)}catch(e){j(e instanceof Error?e.message:"Failed to add repository")}finally{g(!1)}}},[z]);return(0,r.useEffect)(()=>{n?setTimeout(()=>C.current?.focus(),0):x("")},[n]),(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)(S.Popover,{open:n,onOpenChange:p,children:[(0,t.jsx)(S.PopoverTrigger,{asChild:!0,children:(0,t.jsxs)("button",{type:"button",role:"combobox","aria-expanded":n,"aria-label":"Repository",disabled:o,"data-testid":"repository-combobox",className:(0,w.cn)("border-input bg-background ring-offset-background focus:ring-ring flex h-9 w-full items-center justify-between rounded-md border px-3 py-2 text-sm focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",!T&&"text-muted-foreground"),children:[(0,t.jsx)("span",{className:"truncate",children:T?T.name:"Select repository..."}),(0,t.jsx)(c.ChevronsUpDown,{className:"ms-2 h-4 w-4 shrink-0 opacity-50"})]})}),(0,t.jsx)(S.PopoverContent,{className:"w-80 p-0",align:"start","data-testid":"repository-combobox-content",children:(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)("div",{className:"border-b p-2",children:(0,t.jsx)(y.Input,{ref:C,placeholder:D("createDrawer.searchRepositories"),value:u,onChange:e=>x(e.target.value),className:"h-8 border-0 p-0 text-sm shadow-none focus-visible:ring-0","data-testid":"repository-search"})}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto py-1",role:"listbox","aria-label":"Repositories",children:0===P.length?(0,t.jsx)("p",{className:"text-muted-foreground px-3 py-2 text-sm","data-testid":"repository-empty",children:"No repositories found."}):P.map(e=>(0,t.jsxs)("button",{type:"button",role:"option","aria-selected":a===e.path,onClick:()=>F(e.path),className:(0,w.cn)("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm",a===e.path&&"bg-accent/50"),"data-testid":`repository-option-${e.id}`,children:[(0,t.jsx)(d.CheckIcon,{className:(0,w.cn)("h-4 w-4 shrink-0",a!==e.path&&"invisible")}),(0,t.jsxs)("span",{className:"flex flex-col items-start truncate",children:[(0,t.jsx)("span",{className:"truncate",children:e.name}),(0,t.jsx)("span",{className:"text-muted-foreground truncate text-xs",children:e.path})]})]},e.id))}),(0,t.jsx)(M.Separator,{}),(0,t.jsxs)("button",{type:"button",onClick:E,disabled:f,className:"hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 px-3 py-2 text-sm","data-testid":"add-repository-item",children:[f?(0,t.jsx)(m.Loader2,{className:"h-4 w-4 shrink-0 animate-spin"}):(0,t.jsx)(h.FolderPlus,{className:"h-4 w-4 shrink-0"}),(0,t.jsx)("span",{children:"Add new repository..."})]}),b?(0,t.jsx)("p",{className:"px-3 pb-2 text-xs text-red-500","data-testid":"add-repository-error",children:b}):null]})})]}),(0,t.jsx)(U.ReactFileManagerDialog,{open:v,onOpenChange:e=>{e||k(!1)},onSelect:L})]})}function H({repositoryPath:e,initialParentId:i,initialDescription:l,features:n,repositories:c,workflowDefaults:d,currentAgentType:p,currentModel:u,canPushDirectly:h}){let m=(0,a.useRouter)(),[x,f]=(0,r.useState)(!1),g=(0,a.usePathname)().startsWith("/create"),b=!x&&g;(0,r.useEffect)(()=>{!g&&x&&f(!1)},[g,x]);let w=(0,r.useCallback)(()=>{m.push("/")},[m]),j=(0,r.useCallback)(e=>{f(!0),m.push("/"),o(e).then(t=>{t.error?s.toast.error(t.error):window.dispatchEvent(new CustomEvent("shep:feature-created",{detail:{featureId:t.feature.id,name:t.feature.name,description:t.feature.description,repositoryPath:t.feature.repositoryPath,parentId:e.parentId}}))}).catch(()=>{s.toast.error("Failed to create feature"),f(!1)})},[m]);return(0,t.jsx)(G,{open:b,onClose:w,onSubmit:j,repositoryPath:e,features:n,repositories:c,workflowDefaults:d,initialParentId:i,initialDescription:l,isSubmitting:x,currentAgentType:p,currentModel:u,canPushDirectly:h})}e.s(["CreateDrawerClient",()=>H],15203)}]);
|