@shepai/cli 1.174.0 → 1.175.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apis/json-schema/Repository.yaml +6 -0
- package/dist/packages/core/src/application/ports/output/repositories/repository-repository.interface.d.ts +3 -1
- package/dist/packages/core/src/application/ports/output/repositories/repository-repository.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts +28 -0
- package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.js +2 -0
- package/dist/packages/core/src/application/ports/output/services/github-repository-service.interface.d.ts +47 -0
- package/dist/packages/core/src/application/ports/output/services/github-repository-service.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/services/github-repository-service.interface.js +12 -0
- package/dist/packages/core/src/application/use-cases/features/create/create-feature-from-remote.use-case.d.ts +67 -0
- package/dist/packages/core/src/application/use-cases/features/create/create-feature-from-remote.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/features/create/create-feature-from-remote.use-case.js +128 -0
- package/dist/packages/core/src/application/use-cases/repositories/import-github-repository.use-case.d.ts +16 -5
- package/dist/packages/core/src/application/use-cases/repositories/import-github-repository.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/repositories/import-github-repository.use-case.js +76 -14
- package/dist/packages/core/src/application/use-cases/repositories/init-remote-repository.use-case.d.ts +30 -0
- package/dist/packages/core/src/application/use-cases/repositories/init-remote-repository.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/repositories/init-remote-repository.use-case.js +51 -0
- package/dist/packages/core/src/domain/generated/output.d.ts +8 -0
- package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.js +10 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/repository.mapper.d.ts +2 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/repository.mapper.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/repository.mapper.js +4 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/055-add-repository-fork-fields.d.ts +12 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/055-add-repository-fork-fields.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/055-add-repository-fork-fields.js +26 -0
- package/dist/packages/core/src/infrastructure/repositories/sqlite-repository.repository.d.ts +2 -1
- package/dist/packages/core/src/infrastructure/repositories/sqlite-repository.repository.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/repositories/sqlite-repository.repository.js +14 -0
- package/dist/packages/core/src/infrastructure/services/external/github-repository.service.d.ts +4 -1
- package/dist/packages/core/src/infrastructure/services/external/github-repository.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/external/github-repository.service.js +55 -1
- package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts +15 -0
- package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/git/git-pr.service.js +62 -0
- package/dist/src/presentation/cli/commands/feat/new.command.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/feat/new.command.js +32 -6
- package/dist/src/presentation/cli/commands/repo/index.d.ts.map +1 -1
- package/dist/src/presentation/cli/commands/repo/index.js +3 -1
- package/dist/src/presentation/cli/commands/repo/init-remote.command.d.ts +15 -0
- package/dist/src/presentation/cli/commands/repo/init-remote.command.d.ts.map +1 -0
- package/dist/src/presentation/cli/commands/repo/init-remote.command.js +44 -0
- package/dist/src/presentation/web/app/actions/create-feature-from-remote.d.ts +31 -0
- package/dist/src/presentation/web/app/actions/create-feature-from-remote.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/create-feature-from-remote.js +69 -0
- package/dist/src/presentation/web/app/actions/import-github-repository.d.ts +1 -0
- package/dist/src/presentation/web/app/actions/import-github-repository.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/import-github-repository.js +1 -1
- package/dist/src/presentation/web/components/common/feature-create-drawer/feature-create-drawer.d.ts +2 -0
- 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 +1 -1
- package/dist/src/presentation/web/components/common/feature-create-drawer/repository-combobox.stories.d.ts +2 -0
- package/dist/src/presentation/web/components/common/feature-create-drawer/repository-combobox.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-create-drawer/repository-combobox.stories.js +22 -0
- package/dist/src/presentation/web/lib/feature-flags.js +1 -1
- package/dist/translations/ar/cli.json +12 -0
- package/dist/translations/de/cli.json +12 -0
- package/dist/translations/en/cli.json +12 -0
- package/dist/translations/es/cli.json +12 -0
- package/dist/translations/fr/cli.json +12 -0
- package/dist/translations/he/cli.json +12 -0
- package/dist/translations/pt/cli.json +12 -0
- package/dist/translations/ru/cli.json +12 -0
- 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 +2 -2
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +2 -2
- package/web/.next/required-server-files.json +2 -2
- 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 +2 -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/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/@drawer/chat/page.js +2 -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/server-reference-manifest.json +30 -30
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js +2 -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/server-reference-manifest.json +38 -38
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +2 -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/server-reference-manifest.json +38 -38
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +2 -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/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/[tab]/page.js +2 -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/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +2 -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/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/chat/page.js +2 -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/server-reference-manifest.json +30 -30
- package/web/.next/server/app/(dashboard)/create/page.js +2 -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/server-reference-manifest.json +38 -38
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +2 -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/server-reference-manifest.json +38 -38
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +2 -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/server-reference-manifest.json +27 -27
- package/web/.next/server/app/(dashboard)/page.js +2 -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/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/[tab]/page.js +2 -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/server-reference-manifest.json +28 -28
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +2 -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.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +6 -6
- 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/server-reference-manifest.json +6 -6
- 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/server-reference-manifest.json +9 -9
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +13 -13
- package/web/.next/server/app/skills/page.js +2 -1
- package/web/.next/server/app/skills/page.js.nft.json +1 -1
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +11 -11
- package/web/.next/server/app/tools/page.js +2 -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/server-reference-manifest.json +6 -6
- 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.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_ad0071c9.js +3 -0
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_ad0071c9.js.map +1 -0
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_90d98b2b.js +3 -0
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_chat_page_actions_90d98b2b.js.map +1 -0
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_chat_page_actions_d3828105.js +3 -0
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_chat_page_actions_d3828105.js.map +1 -0
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_feature-drawer-client_tsx_e9755fc8._.js +2 -2
- 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]__1cd4327c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__1cd4327c._.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]__357d99f9._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__51ec77a8._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__51ec77a8._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__b020c17d._.js → [root-of-the-server]__540c615f._.js} +3 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__540c615f._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__66047a1b._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__66047a1b._.js.map +1 -0
- 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]__a932cd3a._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a932cd3a._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aa72e794._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aa72e794._.js.map +1 -0
- 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/_05c23ad9._.js +1 -1
- package/web/.next/server/chunks/ssr/_05c23ad9._.js.map +1 -1
- 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/_295fffde._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_fd595af2._.js → _2b021b35._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_fd595af2._.js.map → _2b021b35._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_45496654._.js +1 -1
- package/web/.next/server/chunks/ssr/_45496654._.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/_56b9d60f._.js +1 -1
- package/web/.next/server/chunks/ssr/_56b9d60f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_6abfa39e._.js +1 -1
- package/web/.next/server/chunks/ssr/_6abfa39e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_3a71f39b._.js → _af6b8b94._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_3a71f39b._.js.map → _af6b8b94._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_7953be4d._.js → _e0dd6fcf._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_7953be4d._.js.map → _e0dd6fcf._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_f8c55130._.js +4 -0
- package/web/.next/server/chunks/ssr/_f8c55130._.js.map +1 -0
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
- package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/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/src_presentation_web_17d39233._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_17d39233._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_54b02639._.js +5 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_54b02639._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_7b7b9e3b._.js +5 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_7b7b9e3b._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_807cba76._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_807cba76._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_90b5e66e.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_90b5e66e.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_4ce30db7.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_4ce30db7.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_e4032193.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_e4032193.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_components_features_skills_8a174cac._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_features_skills_8a174cac._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_e1cd1869._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_e1cd1869._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_e3a30e30._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_e3a30e30._.js.map +1 -0
- package/web/.next/server/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +50 -50
- package/web/.next/static/chunks/{ad47bc6ddec7508e.js → 0b07ee72b0c639ef.js} +1 -1
- package/web/.next/static/chunks/{f5abbc495d496f5b.js → 1b336d1266a0aa3d.js} +1 -1
- package/web/.next/static/chunks/{d9c9db1823b4dffd.js → 238fdbed09dc61b6.js} +2 -2
- package/web/.next/static/chunks/{5a2e1c8699897c26.js → 28f6b1cab38ab025.js} +3 -3
- package/web/.next/static/chunks/2ad924f5ba5ec0a6.js +1 -0
- package/web/.next/static/chunks/2ceebcc839ee0d4b.js +1 -0
- package/web/.next/static/chunks/{6dc0a23d333274ae.js → 39054eabee156e55.js} +2 -2
- package/web/.next/static/chunks/{a2a03ecb10000974.js → 873e837cd1179cdd.js} +1 -1
- package/web/.next/static/chunks/{a060ad1bb509687f.js → 940c842293a6ee9b.js} +1 -1
- package/web/.next/static/chunks/a20f2d6f76f469b7.css +1 -0
- package/web/.next/static/chunks/{393b27ab5de6c454.js → a22ee308ae1509ca.js} +1 -1
- package/web/.next/static/chunks/{e30aa6d2cf824fa1.js → b2aa69e4b0b032d9.js} +1 -1
- package/web/.next/static/chunks/{6bc240cd4ae43267.js → b7b5d65a5dd2fff1.js} +1 -1
- package/web/.next/static/chunks/{0baf5a2e56d191cf.js → ba0e0fa2d1a650bb.js} +1 -1
- package/web/.next/static/chunks/{c164b157638b2a8b.js → bc41a393614b1192.js} +1 -1
- package/web/.next/static/chunks/{534194b584a151ed.js → d26542df5ecc8717.js} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__4fb81977._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7dcd0917._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__92ffd5ee._.js +0 -4
- 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]__b020c17d._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ba7f5873._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c5e09f6f._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_02e01240._.js +0 -4
- package/web/.next/server/chunks/ssr/_02e01240._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_18886033._.js +0 -4
- package/web/.next/server/chunks/ssr/_18886033._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_22e00a14._.js +0 -4
- package/web/.next/server/chunks/ssr/_22e00a14._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_a5a5901d._.js +0 -4
- package/web/.next/server/chunks/ssr/_a5a5901d._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_ad09f271._.js +0 -4
- package/web/.next/server/chunks/ssr/_ad09f271._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_c3f595c6._.js +0 -4
- package/web/.next/server/chunks/ssr/_c3f595c6._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_ea9e1556._.js +0 -4
- package/web/.next/server/chunks/ssr/_ea9e1556._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_f1ba9be6._.js +0 -6
- package/web/.next/server/chunks/ssr/_f1ba9be6._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_f33cd07e._.js +0 -6
- package/web/.next/server/chunks/ssr/_f33cd07e._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_f8b45233._.js +0 -4
- package/web/.next/server/chunks/ssr/_f8b45233._.js.map +0 -1
- package/web/.next/static/chunks/32c46154c31c58fc.js +0 -1
- package/web/.next/static/chunks/84b480808bd74fa9.css +0 -1
- /package/web/.next/static/{nLYXtW5TIrvQiMl1yyD4O → 9rcv3ICw0kZNuv3TVdO8E}/_buildManifest.js +0 -0
- /package/web/.next/static/{nLYXtW5TIrvQiMl1yyD4O → 9rcv3ICw0kZNuv3TVdO8E}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{nLYXtW5TIrvQiMl1yyD4O → 9rcv3ICw0kZNuv3TVdO8E}/_ssgManifest.js +0 -0
|
@@ -11,6 +11,12 @@ properties:
|
|
|
11
11
|
remoteUrl:
|
|
12
12
|
type: string
|
|
13
13
|
description: "Remote GitHub URL this repository was cloned from (normalized: lowercase, no .git suffix)"
|
|
14
|
+
isFork:
|
|
15
|
+
type: boolean
|
|
16
|
+
description: Whether this repository was auto-forked by shep because the user lacked push access
|
|
17
|
+
upstreamUrl:
|
|
18
|
+
type: string
|
|
19
|
+
description: "Original upstream URL when isFork is true (normalized: lowercase, no .git suffix)"
|
|
14
20
|
required:
|
|
15
21
|
- name
|
|
16
22
|
- path
|
|
@@ -12,12 +12,14 @@ export interface IRepositoryRepository {
|
|
|
12
12
|
findByPathIncludingDeleted(path: string): Promise<Repository | null>;
|
|
13
13
|
/** Find a non-deleted repository by its remote URL (normalized: lowercase, no .git suffix). */
|
|
14
14
|
findByRemoteUrl(url: string): Promise<Repository | null>;
|
|
15
|
+
/** Find a non-deleted repository by its upstream URL (for fork deduplication). */
|
|
16
|
+
findByUpstreamUrl(url: string): Promise<Repository | null>;
|
|
15
17
|
list(): Promise<Repository[]>;
|
|
16
18
|
remove(id: string): Promise<void>;
|
|
17
19
|
softDelete(id: string): Promise<void>;
|
|
18
20
|
/** Restore a soft-deleted repository by clearing deletedAt. */
|
|
19
21
|
restore(id: string): Promise<void>;
|
|
20
22
|
/** Update specific fields on an existing repository. */
|
|
21
|
-
update(id: string, fields: Partial<Pick<Repository, 'name' | 'path' | 'remoteUrl'>>): Promise<Repository>;
|
|
23
|
+
update(id: string, fields: Partial<Pick<Repository, 'name' | 'path' | 'remoteUrl' | 'isFork' | 'upstreamUrl'>>): Promise<Repository>;
|
|
22
24
|
}
|
|
23
25
|
//# sourceMappingURL=repository-repository.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repository-repository.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/repositories/repository-repository.interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AAEzE,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACpD,QAAQ,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IACjD,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IACrD,uEAAuE;IACvE,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IACrE,+FAA+F;IAC/F,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;IACzD,IAAI,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IAC9B,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAClC,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACtC,+DAA+D;IAC/D,OAAO,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC,wDAAwD;IACxD,MAAM,CACJ,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,WAAW,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"repository-repository.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/repositories/repository-repository.interface.ts"],"names":[],"mappings":"A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rErrorCode {
|
|
|
18
18
|
MERGE_FAILED = "MERGE_FAILED",
|
|
19
19
|
NETWORK_ERROR = "NETWORK_ERROR",
|
|
20
20
|
PR_NOT_FOUND = "PR_NOT_FOUND",
|
|
21
|
+
REMOTE_ALREADY_EXISTS = "REMOTE_ALREADY_EXISTS",
|
|
22
|
+
REPO_CREATE_FAILED = "REPO_CREATE_FAILED",
|
|
21
23
|
REBASE_CONFLICT = "REBASE_CONFLICT",
|
|
22
24
|
SYNC_FAILED = "SYNC_FAILED"
|
|
23
25
|
}
|
|
@@ -144,6 +146,32 @@ export interface IGitPrService {
|
|
|
144
146
|
* @returns The remote URL, or null if no remote is configured
|
|
145
147
|
*/
|
|
146
148
|
getRemoteUrl(cwd: string): Promise<string | null>;
|
|
149
|
+
/**
|
|
150
|
+
* Create a GitHub repository and link it to the local repo.
|
|
151
|
+
* Uses `gh repo create` with `--source=.` and `--push` to atomically
|
|
152
|
+
* create the remote repo, add the origin remote, and push the current branch.
|
|
153
|
+
*
|
|
154
|
+
* @param cwd - Working directory path
|
|
155
|
+
* @param name - Repository name (e.g. "my-repo" or "org/my-repo")
|
|
156
|
+
* @param options - Creation options
|
|
157
|
+
* @returns The URL of the created GitHub repository
|
|
158
|
+
* @throws GitPrError with REPO_CREATE_FAILED code on creation failure
|
|
159
|
+
* @throws GitPrError with GH_NOT_FOUND code if gh CLI is not installed
|
|
160
|
+
* @throws GitPrError with AUTH_FAILURE code if gh is not authenticated
|
|
161
|
+
*/
|
|
162
|
+
createGitHubRepo(cwd: string, name: string, options: {
|
|
163
|
+
isPrivate: boolean;
|
|
164
|
+
org?: string;
|
|
165
|
+
}): Promise<string>;
|
|
166
|
+
/**
|
|
167
|
+
* Add a git remote to the local repository.
|
|
168
|
+
*
|
|
169
|
+
* @param cwd - Working directory path
|
|
170
|
+
* @param remoteName - Name for the remote (e.g. "origin")
|
|
171
|
+
* @param remoteUrl - URL of the remote repository
|
|
172
|
+
* @throws GitPrError with GIT_ERROR code on failure
|
|
173
|
+
*/
|
|
174
|
+
addRemote(cwd: string, remoteName: string, remoteUrl: string): Promise<void>;
|
|
147
175
|
/**
|
|
148
176
|
* Detect the repository's default branch with robust fallback chain:
|
|
149
177
|
* 1. Remote HEAD (git symbolic-ref refs/remotes/origin/HEAD)
|
package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-pr-service.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/git-pr-service.interface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAEvE;;GAEG;AACH,oBAAY,cAAc;IACxB,YAAY,iBAAiB;IAC7B,gBAAgB,qBAAqB;IACrC,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,SAAS,cAAc;IACvB,cAAc,mBAAmB;IACjC,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,YAAY,iBAAiB;IAC7B,eAAe,oBAAoB;IACnC,WAAW,gBAAgB;CAC5B;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;aAGjB,IAAI,EAAE,cAAc;aACpB,KAAK,CAAC,EAAE,KAAK;gBAF7B,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,cAAc,EACpB,KAAK,CAAC,EAAE,KAAK,YAAA;CAKhC;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,wBAAwB;IACxB,MAAM,EAAE,QAAQ,CAAC;IACjB,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,8BAA8B;IAC9B,YAA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,CAAC;IAErC;;;;;;OAMG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtC;;;;;;;;;;;;;OAaG;IACH,mBAAmB,CACjB,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC/C"}
|
|
1
|
+
{"version":3,"file":"git-pr-service.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/git-pr-service.interface.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAEvE;;GAEG;AACH,oBAAY,cAAc;IACxB,YAAY,iBAAiB;IAC7B,gBAAgB,qBAAqB;IACrC,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,SAAS,cAAc;IACvB,cAAc,mBAAmB;IACjC,YAAY,iBAAiB;IAC7B,aAAa,kBAAkB;IAC/B,YAAY,iBAAiB;IAC7B,qBAAqB,0BAA0B;IAC/C,kBAAkB,uBAAuB;IACzC,eAAe,oBAAoB;IACnC,WAAW,gBAAgB;CAC5B;AAED;;GAEG;AACH,qBAAa,UAAW,SAAQ,KAAK;aAGjB,IAAI,EAAE,cAAc;aACpB,KAAK,CAAC,EAAE,KAAK;gBAF7B,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,cAAc,EACpB,KAAK,CAAC,EAAE,KAAK,YAAA;CAKhC;AAED;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,wBAAwB;IACxB,MAAM,EAAE,QAAQ,CAAC;IACjB,uDAAuD;IACvD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,k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AE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExD;;;;;;;;OAQG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3C;;;;;;OAMG;IACH,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAExC;;;;;;;;OAQG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAEvD;;;;;;OAMG;IACH,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAErC;;;;;;OAMG;IACH,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtC;;;;;;;;;;;;;OAaG;IACH,mBAAmB,CACjB,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAC/C"}
|
package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.js
CHANGED
|
@@ -18,6 +18,8 @@ export var GitPrErrorCode;
|
|
|
18
18
|
GitPrErrorCode["MERGE_FAILED"] = "MERGE_FAILED";
|
|
19
19
|
GitPrErrorCode["NETWORK_ERROR"] = "NETWORK_ERROR";
|
|
20
20
|
GitPrErrorCode["PR_NOT_FOUND"] = "PR_NOT_FOUND";
|
|
21
|
+
GitPrErrorCode["REMOTE_ALREADY_EXISTS"] = "REMOTE_ALREADY_EXISTS";
|
|
22
|
+
GitPrErrorCode["REPO_CREATE_FAILED"] = "REPO_CREATE_FAILED";
|
|
21
23
|
GitPrErrorCode["REBASE_CONFLICT"] = "REBASE_CONFLICT";
|
|
22
24
|
GitPrErrorCode["SYNC_FAILED"] = "SYNC_FAILED";
|
|
23
25
|
})(GitPrErrorCode || (GitPrErrorCode = {}));
|
|
@@ -35,6 +35,12 @@ export declare class GitHubRepoListError extends Error {
|
|
|
35
35
|
export declare class GitHubPermissionError extends Error {
|
|
36
36
|
constructor(message: string, cause?: Error);
|
|
37
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* Thrown when a fork operation fails.
|
|
40
|
+
*/
|
|
41
|
+
export declare class GitHubForkError extends Error {
|
|
42
|
+
constructor(message: string, cause?: Error);
|
|
43
|
+
}
|
|
38
44
|
/**
|
|
39
45
|
* A GitHub repository as returned by `gh repo list --json`.
|
|
40
46
|
*/
|
|
@@ -88,6 +94,26 @@ export interface ParsedGitHubUrl {
|
|
|
88
94
|
/** Combined owner/repo (e.g. "octocat/my-project") */
|
|
89
95
|
nameWithOwner: string;
|
|
90
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* Options for forking a repository.
|
|
99
|
+
*/
|
|
100
|
+
export interface ForkOptions {
|
|
101
|
+
onProgress?: (message: string) => void;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Result of checking push access on a repository.
|
|
105
|
+
*/
|
|
106
|
+
export interface PushAccessResult {
|
|
107
|
+
hasPushAccess: boolean;
|
|
108
|
+
viewerLogin: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Result of forking a repository.
|
|
112
|
+
*/
|
|
113
|
+
export interface ForkResult {
|
|
114
|
+
nameWithOwner: string;
|
|
115
|
+
alreadyExisted: boolean;
|
|
116
|
+
}
|
|
91
117
|
/**
|
|
92
118
|
* Output port for GitHub repository operations.
|
|
93
119
|
*
|
|
@@ -151,5 +177,26 @@ export interface IGitHubRepositoryService {
|
|
|
151
177
|
* @throws {GitHubPermissionError} if the permission check fails (e.g. gh not installed, not authenticated)
|
|
152
178
|
*/
|
|
153
179
|
getViewerPermission(repoPath: string): Promise<string>;
|
|
180
|
+
/**
|
|
181
|
+
* Get the authenticated GitHub user's login.
|
|
182
|
+
* @returns The login username
|
|
183
|
+
* @throws {GitHubAuthError} if not authenticated
|
|
184
|
+
*/
|
|
185
|
+
getAuthenticatedUser(): Promise<string>;
|
|
186
|
+
/**
|
|
187
|
+
* Check if the authenticated user has push access to a repository.
|
|
188
|
+
* @param nameWithOwner - Full owner/repo identifier
|
|
189
|
+
* @returns Push access result with viewer login
|
|
190
|
+
* @throws {GitHubPermissionError} on failure
|
|
191
|
+
*/
|
|
192
|
+
checkPushAccess(nameWithOwner: string): Promise<PushAccessResult>;
|
|
193
|
+
/**
|
|
194
|
+
* Fork a repository to the authenticated user's account.
|
|
195
|
+
* @param nameWithOwner - Full owner/repo identifier to fork
|
|
196
|
+
* @param options - Optional progress callback
|
|
197
|
+
* @returns Fork result with the fork's nameWithOwner
|
|
198
|
+
* @throws {GitHubForkError} on failure
|
|
199
|
+
*/
|
|
200
|
+
forkRepository(nameWithOwner: string, options?: ForkOptions): Promise<ForkResult>;
|
|
154
201
|
}
|
|
155
202
|
//# sourceMappingURL=github-repository-service.interface.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-repository-service.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/github-repository-service.interface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAM3C;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAM3C;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAM3C;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM,E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AAC,EAAE,YAAY,GACrB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;;;;OAQG;IACH,oBAAoB,CAAC,OAAO,CAAC,EAAE,2BAA2B,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IAEnF;;;;;OAKG;IACH,iBAAiB,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAEnD;;;;;;;;;;;;OAYG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;IAE7C;;;;;;;;;OASG;IACH,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"github-repository-service.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/github-repository-service.interface.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAM3C;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAM3C;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAM3C;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAM3C;AAED;;GAEG;AACH,qBAAa,qBAAsB,SAAQ,KAAK;gBAClC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAM3C;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAM3C;AAMD;;GAEG;AACH,MAAM,WAAW,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;IACH,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAE3B;;;;;;;OAOG;IACH,eAAe,CACb,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjB;;;;;;;;OAQG;IACH,oBAAoB,CAAC,OAAO,CAAC,EAAE,2BAA2B,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;IAEnF;;;;;OAKG;IACH,iBAAiB,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC,CAAC;IAEnD;;;;;;;;;;;;OAYG;IACH,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe,CAAC;IAE7C;;;;;;;;;OASG;IACH,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEvD;;;;OAIG;IACH,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAExC;;;;;OAKG;IACH,eAAe,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAElE;;;;;;OAMG;IACH,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACnF"}
|
|
@@ -68,3 +68,15 @@ export class GitHubPermissionError extends Error {
|
|
|
68
68
|
this.cause = cause;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* Thrown when a fork operation fails.
|
|
73
|
+
*/
|
|
74
|
+
export class GitHubForkError extends Error {
|
|
75
|
+
constructor(message, cause) {
|
|
76
|
+
super(message);
|
|
77
|
+
this.name = 'GitHubForkError';
|
|
78
|
+
Object.setPrototypeOf(this, new.target.prototype);
|
|
79
|
+
if (cause)
|
|
80
|
+
this.cause = cause;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create Feature From Remote Use Case
|
|
3
|
+
*
|
|
4
|
+
* Composite use case that chains ImportGitHubRepositoryUseCase with
|
|
5
|
+
* CreateFeatureUseCase. Enables creating a feature on a remote GitHub
|
|
6
|
+
* repo in a single command — clone (or fork), register, then create feature.
|
|
7
|
+
*
|
|
8
|
+
* Provides two execution modes:
|
|
9
|
+
* - execute(): synchronous full flow for CLI
|
|
10
|
+
* - createRecord() + initializeAndSpawn(): two-phase for Web UI (fast response + background work)
|
|
11
|
+
*/
|
|
12
|
+
import type { Feature } from '../../../../domain/generated/output.js';
|
|
13
|
+
import type { ApprovalGates, Attachment } from '../../../../domain/generated/output.js';
|
|
14
|
+
import type { CloneOptions, ForkOptions } from '../../../ports/output/services/github-repository-service.interface.js';
|
|
15
|
+
import { ImportGitHubRepositoryUseCase } from '../../repositories/import-github-repository.use-case.js';
|
|
16
|
+
import { CreateFeatureUseCase } from './create-feature.use-case.js';
|
|
17
|
+
import type { CreateFeatureResult, CreateRecordResult } from './types.js';
|
|
18
|
+
export interface CreateFeatureFromRemoteInput {
|
|
19
|
+
/** GitHub URL or owner/repo shorthand */
|
|
20
|
+
remoteUrl: string;
|
|
21
|
+
/** Override clone destination directory */
|
|
22
|
+
cloneDest?: string;
|
|
23
|
+
/** Default base directory for clones (from settings) */
|
|
24
|
+
defaultCloneDir?: string;
|
|
25
|
+
/** Options for the clone subprocess */
|
|
26
|
+
cloneOptions?: CloneOptions;
|
|
27
|
+
/** Options for fork operations */
|
|
28
|
+
forkOptions?: ForkOptions;
|
|
29
|
+
userInput: string;
|
|
30
|
+
approvalGates?: ApprovalGates;
|
|
31
|
+
push?: boolean;
|
|
32
|
+
openPr?: boolean;
|
|
33
|
+
parentId?: string;
|
|
34
|
+
name?: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
fast?: boolean;
|
|
37
|
+
pending?: boolean;
|
|
38
|
+
agentType?: string;
|
|
39
|
+
model?: string;
|
|
40
|
+
attachments?: Attachment[];
|
|
41
|
+
sessionId?: string;
|
|
42
|
+
attachmentPaths?: string[];
|
|
43
|
+
}
|
|
44
|
+
export declare class CreateFeatureFromRemoteUseCase {
|
|
45
|
+
private readonly importUseCase;
|
|
46
|
+
private readonly createFeatureUseCase;
|
|
47
|
+
constructor(importUseCase: ImportGitHubRepositoryUseCase, createFeatureUseCase: CreateFeatureUseCase);
|
|
48
|
+
/**
|
|
49
|
+
* Full synchronous execution: import repo then create feature.
|
|
50
|
+
* Used by the CLI which shows a spinner and needs everything done before returning.
|
|
51
|
+
*/
|
|
52
|
+
execute(input: CreateFeatureFromRemoteInput): Promise<CreateFeatureResult>;
|
|
53
|
+
/**
|
|
54
|
+
* Phase 1 (fast): import repo + create DB record. Returns immediately with real feature ID.
|
|
55
|
+
* Used by the Web UI for optimistic display.
|
|
56
|
+
*/
|
|
57
|
+
createRecord(input: CreateFeatureFromRemoteInput): Promise<CreateRecordResult>;
|
|
58
|
+
/**
|
|
59
|
+
* Phase 2 (background): metadata generation, worktree, spec, agent spawn.
|
|
60
|
+
* Fire-and-forget from the Web UI.
|
|
61
|
+
*/
|
|
62
|
+
initializeAndSpawn(feature: Feature, input: CreateFeatureFromRemoteInput, shouldSpawn: boolean): Promise<{
|
|
63
|
+
warning?: string;
|
|
64
|
+
updatedFeature: Feature;
|
|
65
|
+
}>;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=create-feature-from-remote.use-case.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-feature-from-remote.use-case.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/use-cases/features/create/create-feature-from-remote.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wCAAwC,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wCAAwC,CAAC;AACxF,OAAO,KAAK,EACV,YAAY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AAO,CAAC,mBAAmB,CAAC;IA4BhF;;;OAGG;IACG,YAAY,CAAC,KAAK,EAAE,4BAA4B,GAAG,OAAO,CAAC,kBAAkB,CAAC;IA4BpF;;;OAGG;IACG,kBAAkB,CACtB,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,4BAA4B,EACnC,WAAW,EAAE,OAAO,GACnB,OAAO,CAAC;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,OAAO,CAAA;KAAE,CAAC;CA0B1D"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create Feature From Remote Use Case
|
|
3
|
+
*
|
|
4
|
+
* Composite use case that chains ImportGitHubRepositoryUseCase with
|
|
5
|
+
* CreateFeatureUseCase. Enables creating a feature on a remote GitHub
|
|
6
|
+
* repo in a single command — clone (or fork), register, then create feature.
|
|
7
|
+
*
|
|
8
|
+
* Provides two execution modes:
|
|
9
|
+
* - execute(): synchronous full flow for CLI
|
|
10
|
+
* - createRecord() + initializeAndSpawn(): two-phase for Web UI (fast response + background work)
|
|
11
|
+
*/
|
|
12
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
13
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
14
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
15
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
16
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
17
|
+
};
|
|
18
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
19
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
20
|
+
};
|
|
21
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
22
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
23
|
+
};
|
|
24
|
+
import { injectable, inject } from 'tsyringe';
|
|
25
|
+
import { ImportGitHubRepositoryUseCase } from '../../repositories/import-github-repository.use-case.js';
|
|
26
|
+
import { CreateFeatureUseCase } from './create-feature.use-case.js';
|
|
27
|
+
let CreateFeatureFromRemoteUseCase = class CreateFeatureFromRemoteUseCase {
|
|
28
|
+
importUseCase;
|
|
29
|
+
createFeatureUseCase;
|
|
30
|
+
constructor(importUseCase, createFeatureUseCase) {
|
|
31
|
+
this.importUseCase = importUseCase;
|
|
32
|
+
this.createFeatureUseCase = createFeatureUseCase;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Full synchronous execution: import repo then create feature.
|
|
36
|
+
* Used by the CLI which shows a spinner and needs everything done before returning.
|
|
37
|
+
*/
|
|
38
|
+
async execute(input) {
|
|
39
|
+
const repository = await this.importUseCase.execute({
|
|
40
|
+
url: input.remoteUrl,
|
|
41
|
+
dest: input.cloneDest,
|
|
42
|
+
defaultCloneDir: input.defaultCloneDir,
|
|
43
|
+
cloneOptions: input.cloneOptions,
|
|
44
|
+
forkOptions: input.forkOptions,
|
|
45
|
+
});
|
|
46
|
+
return this.createFeatureUseCase.execute({
|
|
47
|
+
userInput: input.userInput,
|
|
48
|
+
repositoryPath: repository.path,
|
|
49
|
+
approvalGates: input.approvalGates,
|
|
50
|
+
push: input.push,
|
|
51
|
+
openPr: input.openPr,
|
|
52
|
+
parentId: input.parentId,
|
|
53
|
+
name: input.name,
|
|
54
|
+
description: input.description,
|
|
55
|
+
fast: input.fast,
|
|
56
|
+
pending: input.pending,
|
|
57
|
+
agentType: input.agentType,
|
|
58
|
+
model: input.model,
|
|
59
|
+
attachments: input.attachments,
|
|
60
|
+
sessionId: input.sessionId,
|
|
61
|
+
attachmentPaths: input.attachmentPaths,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Phase 1 (fast): import repo + create DB record. Returns immediately with real feature ID.
|
|
66
|
+
* Used by the Web UI for optimistic display.
|
|
67
|
+
*/
|
|
68
|
+
async createRecord(input) {
|
|
69
|
+
const repository = await this.importUseCase.execute({
|
|
70
|
+
url: input.remoteUrl,
|
|
71
|
+
dest: input.cloneDest,
|
|
72
|
+
defaultCloneDir: input.defaultCloneDir,
|
|
73
|
+
cloneOptions: input.cloneOptions,
|
|
74
|
+
forkOptions: input.forkOptions,
|
|
75
|
+
});
|
|
76
|
+
return this.createFeatureUseCase.createRecord({
|
|
77
|
+
userInput: input.userInput,
|
|
78
|
+
repositoryPath: repository.path,
|
|
79
|
+
approvalGates: input.approvalGates,
|
|
80
|
+
push: input.push,
|
|
81
|
+
openPr: input.openPr,
|
|
82
|
+
parentId: input.parentId,
|
|
83
|
+
name: input.name,
|
|
84
|
+
description: input.description,
|
|
85
|
+
fast: input.fast,
|
|
86
|
+
pending: input.pending,
|
|
87
|
+
agentType: input.agentType,
|
|
88
|
+
model: input.model,
|
|
89
|
+
attachments: input.attachments,
|
|
90
|
+
sessionId: input.sessionId,
|
|
91
|
+
attachmentPaths: input.attachmentPaths,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Phase 2 (background): metadata generation, worktree, spec, agent spawn.
|
|
96
|
+
* Fire-and-forget from the Web UI.
|
|
97
|
+
*/
|
|
98
|
+
async initializeAndSpawn(feature, input, shouldSpawn) {
|
|
99
|
+
return this.createFeatureUseCase.initializeAndSpawn(feature, {
|
|
100
|
+
userInput: input.userInput,
|
|
101
|
+
// CreateFeatureUseCase.initializeAndSpawn reads the effective repo path
|
|
102
|
+
// from feature.repositoryPath, but the interface still requires this
|
|
103
|
+
// field. Pass the feature's repositoryPath for consistency.
|
|
104
|
+
repositoryPath: feature.repositoryPath,
|
|
105
|
+
approvalGates: input.approvalGates,
|
|
106
|
+
push: input.push,
|
|
107
|
+
openPr: input.openPr,
|
|
108
|
+
parentId: input.parentId,
|
|
109
|
+
name: input.name,
|
|
110
|
+
description: input.description,
|
|
111
|
+
fast: input.fast,
|
|
112
|
+
pending: input.pending,
|
|
113
|
+
agentType: input.agentType,
|
|
114
|
+
model: input.model,
|
|
115
|
+
attachments: input.attachments,
|
|
116
|
+
sessionId: input.sessionId,
|
|
117
|
+
attachmentPaths: input.attachmentPaths,
|
|
118
|
+
}, shouldSpawn);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
CreateFeatureFromRemoteUseCase = __decorate([
|
|
122
|
+
injectable(),
|
|
123
|
+
__param(0, inject(ImportGitHubRepositoryUseCase)),
|
|
124
|
+
__param(1, inject(CreateFeatureUseCase)),
|
|
125
|
+
__metadata("design:paramtypes", [ImportGitHubRepositoryUseCase,
|
|
126
|
+
CreateFeatureUseCase])
|
|
127
|
+
], CreateFeatureFromRemoteUseCase);
|
|
128
|
+
export { CreateFeatureFromRemoteUseCase };
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
* Import GitHub Repository Use Case
|
|
3
3
|
*
|
|
4
4
|
* Orchestrates importing a GitHub repository: validates the URL, checks auth,
|
|
5
|
-
* detects duplicates by remoteUrl,
|
|
6
|
-
*
|
|
7
|
-
* repository record with the normalized remoteUrl.
|
|
5
|
+
* detects duplicates by remoteUrl/upstreamUrl, checks push access, and either
|
|
6
|
+
* clones directly or auto-forks when the user lacks push access.
|
|
8
7
|
*/
|
|
9
8
|
import type { Repository } from '../../../domain/generated/output.js';
|
|
10
|
-
import type { IGitHubRepositoryService, CloneOptions } from '../../ports/output/services/github-repository-service.interface.js';
|
|
9
|
+
import type { IGitHubRepositoryService, CloneOptions, ForkOptions } from '../../ports/output/services/github-repository-service.interface.js';
|
|
10
|
+
import type { IGitPrService } from '../../ports/output/services/git-pr-service.interface.js';
|
|
11
11
|
import type { IRepositoryRepository } from '../../ports/output/repositories/repository-repository.interface.js';
|
|
12
12
|
import { AddRepositoryUseCase } from './add-repository.use-case.js';
|
|
13
13
|
export interface ImportGitHubRepositoryInput {
|
|
@@ -19,13 +19,24 @@ export interface ImportGitHubRepositoryInput {
|
|
|
19
19
|
defaultCloneDir?: string;
|
|
20
20
|
/** Options for the clone subprocess (e.g. progress callback) */
|
|
21
21
|
cloneOptions?: CloneOptions;
|
|
22
|
+
/** Options for fork operations (e.g. progress callback) */
|
|
23
|
+
forkOptions?: ForkOptions;
|
|
22
24
|
}
|
|
23
25
|
export declare class ImportGitHubRepositoryUseCase {
|
|
24
26
|
private readonly gitHubService;
|
|
25
27
|
private readonly repositoryRepo;
|
|
26
28
|
private readonly addRepositoryUseCase;
|
|
27
|
-
|
|
29
|
+
private readonly gitPrService;
|
|
30
|
+
constructor(gitHubService: IGitHubRepositoryService, repositoryRepo: IRepositoryRepository, addRepositoryUseCase: AddRepositoryUseCase, gitPrService: IGitPrService);
|
|
28
31
|
execute(input: ImportGitHubRepositoryInput): Promise<Repository>;
|
|
32
|
+
/**
|
|
33
|
+
* Direct clone path — user has push access to the repository.
|
|
34
|
+
*/
|
|
35
|
+
private cloneDirect;
|
|
36
|
+
/**
|
|
37
|
+
* Fork-and-clone path — user lacks push access, so we auto-fork first.
|
|
38
|
+
*/
|
|
39
|
+
private forkAndClone;
|
|
29
40
|
private resolveDestination;
|
|
30
41
|
}
|
|
31
42
|
//# sourceMappingURL=import-github-repository.use-case.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-github-repository.use-case.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/application/use-cases/repositories/import-github-repository.use-case.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"import-github-repository.use-case.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/application/use-cases/repositories/import-github-repository.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,KAAK,EACV,wBAAwB,EACxB,YAAY,EACZ,WAAW,EACZ,MAAM,oEAAoE,CAAC;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yDAAyD,CAAC;AAC7F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oEAAoE,CAAC;AAChH,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAKpE,MAAM,WAAW,2BAA2B;IAC1C,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ,2CAA2C;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,2DAA2D;IAC3D,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AAUD,qBACa,6BAA6B;IAGtC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAE/B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IAErC,OAAO,CAAC,QAAQ,CAAC,YAAY;gBANZ,aAAa,EAAE,wBAAwB,EAEvC,cAAc,EAAE,qBAAqB,EAErC,oBAAoB,EAAE,oBAAoB,EAE1C,YAAY,EAAE,aAAa;IAGxC,OAAO,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO,CAAC,UAAU,CAAC;IAgCtE;;OAEG;YACW,WAAW;IAsBzB;;OAEG;YACW,YAAY;IAqD1B,OAAO,CAAC,kBAAkB;CAW3B"}
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
* Import GitHub Repository Use Case
|
|
3
3
|
*
|
|
4
4
|
* Orchestrates importing a GitHub repository: validates the URL, checks auth,
|
|
5
|
-
* detects duplicates by remoteUrl,
|
|
6
|
-
*
|
|
7
|
-
* repository record with the normalized remoteUrl.
|
|
5
|
+
* detects duplicates by remoteUrl/upstreamUrl, checks push access, and either
|
|
6
|
+
* clones directly or auto-forks when the user lacks push access.
|
|
8
7
|
*/
|
|
9
8
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
10
9
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -22,6 +21,8 @@ import { injectable, inject } from 'tsyringe';
|
|
|
22
21
|
import { homedir } from 'node:os';
|
|
23
22
|
import { join } from 'node:path';
|
|
24
23
|
import { AddRepositoryUseCase } from './add-repository.use-case.js';
|
|
24
|
+
/** Name of the git remote used to track the original upstream repo of a fork. */
|
|
25
|
+
const UPSTREAM_REMOTE_NAME = 'upstream';
|
|
25
26
|
/**
|
|
26
27
|
* Normalizes a GitHub remote URL for storage and duplicate detection.
|
|
27
28
|
* Lowercases and strips trailing .git suffix.
|
|
@@ -33,10 +34,12 @@ let ImportGitHubRepositoryUseCase = class ImportGitHubRepositoryUseCase {
|
|
|
33
34
|
gitHubService;
|
|
34
35
|
repositoryRepo;
|
|
35
36
|
addRepositoryUseCase;
|
|
36
|
-
|
|
37
|
+
gitPrService;
|
|
38
|
+
constructor(gitHubService, repositoryRepo, addRepositoryUseCase, gitPrService) {
|
|
37
39
|
this.gitHubService = gitHubService;
|
|
38
40
|
this.repositoryRepo = repositoryRepo;
|
|
39
41
|
this.addRepositoryUseCase = addRepositoryUseCase;
|
|
42
|
+
this.gitPrService = gitPrService;
|
|
40
43
|
}
|
|
41
44
|
async execute(input) {
|
|
42
45
|
// 1. Validate URL — throws GitHubUrlParseError for invalid formats
|
|
@@ -48,32 +51,81 @@ let ImportGitHubRepositoryUseCase = class ImportGitHubRepositoryUseCase {
|
|
|
48
51
|
if (existing) {
|
|
49
52
|
return existing;
|
|
50
53
|
}
|
|
54
|
+
// 3b. Check for duplicate by upstreamUrl (fork of this repo already imported)
|
|
55
|
+
const existingFork = await this.repositoryRepo.findByUpstreamUrl(normalizedUrl);
|
|
56
|
+
if (existingFork) {
|
|
57
|
+
return existingFork;
|
|
58
|
+
}
|
|
51
59
|
// 4. Check auth — throws GitHubAuthError if not authenticated
|
|
52
60
|
await this.gitHubService.checkAuth();
|
|
53
|
-
// 5.
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
// 5. Check push access to determine if we need to fork
|
|
62
|
+
const { hasPushAccess } = await this.gitHubService.checkPushAccess(parsed.nameWithOwner);
|
|
63
|
+
if (hasPushAccess) {
|
|
64
|
+
return this.cloneDirect(input, parsed.nameWithOwner, parsed.repo, normalizedUrl);
|
|
65
|
+
}
|
|
66
|
+
return this.forkAndClone(input, parsed.nameWithOwner, parsed.repo, normalizedUrl);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Direct clone path — user has push access to the repository.
|
|
70
|
+
*/
|
|
71
|
+
async cloneDirect(input, nameWithOwner, repoName, normalizedUrl) {
|
|
72
|
+
const destination = this.resolveDestination(input, repoName);
|
|
73
|
+
await this.gitHubService.cloneRepository(nameWithOwner, destination, input.cloneOptions);
|
|
58
74
|
const repository = await this.addRepositoryUseCase.execute({
|
|
59
75
|
path: destination,
|
|
60
|
-
name:
|
|
76
|
+
name: repoName,
|
|
61
77
|
});
|
|
62
|
-
// 8. Update with normalized remoteUrl
|
|
63
78
|
await this.repositoryRepo.update(repository.id, {
|
|
64
79
|
remoteUrl: normalizedUrl,
|
|
65
80
|
});
|
|
66
81
|
return { ...repository, remoteUrl: normalizedUrl };
|
|
67
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Fork-and-clone path — user lacks push access, so we auto-fork first.
|
|
85
|
+
*/
|
|
86
|
+
async forkAndClone(input, originalNameWithOwner, repoName, normalizedOriginalUrl) {
|
|
87
|
+
// Fork the repository
|
|
88
|
+
const forkResult = await this.gitHubService.forkRepository(originalNameWithOwner, input.forkOptions);
|
|
89
|
+
// Check if fork was already tracked
|
|
90
|
+
const normalizedForkUrl = normalizeRemoteUrl(forkResult.nameWithOwner);
|
|
91
|
+
const existingForkByRemote = await this.repositoryRepo.findByRemoteUrl(normalizedForkUrl);
|
|
92
|
+
if (existingForkByRemote) {
|
|
93
|
+
return existingForkByRemote;
|
|
94
|
+
}
|
|
95
|
+
// Clone the fork
|
|
96
|
+
const destination = this.resolveDestination(input, repoName);
|
|
97
|
+
await this.gitHubService.cloneRepository(forkResult.nameWithOwner, destination, input.cloneOptions);
|
|
98
|
+
// Configure the upstream remote so users can `git fetch upstream` / sync
|
|
99
|
+
// with the original repo. Without this, the fork has no knowledge of its
|
|
100
|
+
// upstream — breaking PR workflows that rely on upstream as the merge base.
|
|
101
|
+
await this.gitPrService.addRemote(destination, UPSTREAM_REMOTE_NAME, normalizedOriginalUrl);
|
|
102
|
+
// Register the cloned fork
|
|
103
|
+
const repository = await this.addRepositoryUseCase.execute({
|
|
104
|
+
path: destination,
|
|
105
|
+
name: repoName,
|
|
106
|
+
});
|
|
107
|
+
// Update with fork metadata
|
|
108
|
+
await this.repositoryRepo.update(repository.id, {
|
|
109
|
+
remoteUrl: normalizedForkUrl,
|
|
110
|
+
isFork: true,
|
|
111
|
+
upstreamUrl: normalizedOriginalUrl,
|
|
112
|
+
});
|
|
113
|
+
return {
|
|
114
|
+
...repository,
|
|
115
|
+
remoteUrl: normalizedForkUrl,
|
|
116
|
+
isFork: true,
|
|
117
|
+
upstreamUrl: normalizedOriginalUrl,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
68
120
|
resolveDestination(input, repoName) {
|
|
69
121
|
if (input.dest) {
|
|
70
|
-
return input.dest;
|
|
122
|
+
return normalizePath(input.dest);
|
|
71
123
|
}
|
|
72
124
|
let baseDir = input.defaultCloneDir ?? join(homedir(), 'repos');
|
|
73
125
|
if (baseDir.startsWith('~/')) {
|
|
74
126
|
baseDir = join(homedir(), baseDir.slice(2));
|
|
75
127
|
}
|
|
76
|
-
return join(baseDir, repoName);
|
|
128
|
+
return normalizePath(join(baseDir, repoName));
|
|
77
129
|
}
|
|
78
130
|
};
|
|
79
131
|
ImportGitHubRepositoryUseCase = __decorate([
|
|
@@ -81,6 +133,16 @@ ImportGitHubRepositoryUseCase = __decorate([
|
|
|
81
133
|
__param(0, inject('IGitHubRepositoryService')),
|
|
82
134
|
__param(1, inject('IRepositoryRepository')),
|
|
83
135
|
__param(2, inject(AddRepositoryUseCase)),
|
|
84
|
-
|
|
136
|
+
__param(3, inject('IGitPrService')),
|
|
137
|
+
__metadata("design:paramtypes", [Object, Object, AddRepositoryUseCase, Object])
|
|
85
138
|
], ImportGitHubRepositoryUseCase);
|
|
86
139
|
export { ImportGitHubRepositoryUseCase };
|
|
140
|
+
/**
|
|
141
|
+
* Normalizes a filesystem path to use forward slashes.
|
|
142
|
+
*
|
|
143
|
+
* Per packages/CLAUDE.md, all paths stored in the database MUST use forward
|
|
144
|
+
* slashes so that Windows and POSIX callers resolve/compare identically.
|
|
145
|
+
*/
|
|
146
|
+
function normalizePath(p) {
|
|
147
|
+
return p.replace(/\\/g, '/');
|
|
148
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Init Remote Repository Use Case
|
|
3
|
+
*
|
|
4
|
+
* Orchestrates creating a GitHub repository from a local repo that has
|
|
5
|
+
* no remote yet. Uses `gh repo create` with `--source=.` to create the
|
|
6
|
+
* remote repo, configure the origin remote, and push the current branch.
|
|
7
|
+
*/
|
|
8
|
+
import { type IGitPrService } from '../../ports/output/services/git-pr-service.interface.js';
|
|
9
|
+
export interface InitRemoteRepositoryInput {
|
|
10
|
+
/** Working directory of the local repository */
|
|
11
|
+
cwd: string;
|
|
12
|
+
/** Repository name (defaults to directory basename) */
|
|
13
|
+
name?: string;
|
|
14
|
+
/** Whether to create a private repository (default: true) */
|
|
15
|
+
isPrivate?: boolean;
|
|
16
|
+
/** GitHub organization to create the repo under */
|
|
17
|
+
org?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface InitRemoteRepositoryResult {
|
|
20
|
+
/** URL of the created GitHub repository */
|
|
21
|
+
url: string;
|
|
22
|
+
/** Name used for the repository */
|
|
23
|
+
name: string;
|
|
24
|
+
}
|
|
25
|
+
export declare class InitRemoteRepositoryUseCase {
|
|
26
|
+
private readonly gitPrService;
|
|
27
|
+
constructor(gitPrService: IGitPrService);
|
|
28
|
+
execute(input: InitRemoteRepositoryInput): Promise<InitRemoteRepositoryResult>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=init-remote-repository.use-case.d.ts.map
|