@shepai/cli 1.134.0 → 1.134.1-pr396.fe65c43
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/FeatureFlags.yaml +5 -0
- package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts +73 -5
- 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 +6 -4
- package/dist/packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.d.ts +28 -0
- package/dist/packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/features/rebase-feature-on-main.use-case.js +81 -0
- package/dist/packages/core/src/application/use-cases/repositories/sync-repository-main.use-case.d.ts +16 -0
- package/dist/packages/core/src/application/use-cases/repositories/sync-repository-main.use-case.d.ts.map +1 -0
- package/dist/packages/core/src/application/use-cases/repositories/sync-repository-main.use-case.js +43 -0
- 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 -0
- package/dist/packages/core/src/domain/generated/output.d.ts +4 -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 +15 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/settings.mapper.js +2 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/042-add-feature-flag-git-rebase-sync.d.ts +11 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/042-add-feature-flag-git-rebase-sync.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/042-add-feature-flag-git-rebase-sync.js +17 -0
- package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/repositories/sqlite-settings.repository.js +3 -2
- package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.d.ts +35 -0
- package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.js +66 -0
- package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.d.ts +42 -0
- package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.js +169 -0
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/analyze.prompt.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/analyze.prompt.js +3 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/plan.prompt.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/plan.prompt.js +6 -2
- package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts +6 -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 +134 -0
- package/dist/src/presentation/web/app/(dashboard)/get-graph-data.d.ts.map +1 -1
- package/dist/src/presentation/web/app/(dashboard)/get-graph-data.js +5 -12
- package/dist/src/presentation/web/app/actions/rebase-feature.d.ts +5 -0
- package/dist/src/presentation/web/app/actions/rebase-feature.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/rebase-feature.js +16 -0
- package/dist/src/presentation/web/app/actions/sync-repository.d.ts +5 -0
- package/dist/src/presentation/web/app/actions/sync-repository.d.ts.map +1 -0
- package/dist/src/presentation/web/app/actions/sync-repository.js +16 -0
- package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js +2 -1
- package/dist/src/presentation/web/components/common/control-center-drawer/repository-drawer-client.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/control-center-drawer/repository-drawer-client.js +4 -4
- package/dist/src/presentation/web/components/common/feature-drawer/use-feature-actions.d.ts +4 -0
- package/dist/src/presentation/web/components/common/feature-drawer/use-feature-actions.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer/use-feature-actions.js +32 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts +4 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/feature-drawer-tabs.js +2 -2
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.d.ts +4 -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 +8 -3
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.d.ts +6 -0
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/feature-drawer-tabs/overview-tab.stories.js +30 -0
- package/dist/src/presentation/web/components/common/open-action-menu/open-action-menu.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/open-action-menu/open-action-menu.stories.js +3 -0
- package/dist/src/presentation/web/components/common/repository-node/repository-drawer.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/repository-node/repository-drawer.js +5 -3
- package/dist/src/presentation/web/components/common/repository-node/repository-node.js +1 -1
- package/dist/src/presentation/web/components/common/repository-node/use-repository-actions.d.ts +4 -0
- package/dist/src/presentation/web/components/common/repository-node/use-repository-actions.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/repository-node/use-repository-actions.js +11 -0
- package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.js +3 -0
- package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/feature-flags-settings-section.stories.js +3 -0
- package/dist/src/presentation/web/components/features/settings/settings-page-client.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/settings-page-client.js +5 -0
- package/dist/src/presentation/web/components/features/settings/settings-page-client.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/features/settings/settings-page-client.stories.js +1 -0
- package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/layouts/app-sidebar/app-sidebar.stories.js +1 -0
- package/dist/src/presentation/web/hooks/feature-flags-context.d.ts.map +1 -1
- package/dist/src/presentation/web/hooks/feature-flags-context.js +1 -0
- package/dist/src/presentation/web/lib/feature-flags.d.ts +2 -0
- package/dist/src/presentation/web/lib/feature-flags.d.ts.map +1 -1
- package/dist/src/presentation/web/lib/feature-flags.js +5 -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 +3 -3
- package/web/.next/required-server-files.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +63 -48
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +2 -2
- 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/create/page/server-reference-manifest.json +63 -48
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +90 -60
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +90 -60
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +59 -44
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +63 -48
- package/web/.next/server/app/(dashboard)/create/page.js +2 -2
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +90 -60
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +2 -2
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +90 -60
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +2 -2
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +59 -44
- package/web/.next/server/app/(dashboard)/page.js +2 -2
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +59 -44
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +2 -2
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.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 +3 -3
- 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/settings/page/server-reference-manifest.json +8 -8
- 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 +8 -8
- 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 +8 -8
- 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 +3 -3
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js +1 -1
- package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__c6e32a23._.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_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/[root-of-the-server]__04df2195._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__04df2195._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__30fd2260._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__30fd2260._.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]__3ef34e4c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__40580adc._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__40580adc._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__50fa3453._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__50fa3453._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7894f27f._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__7894f27f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8aa5ff34._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8aa5ff34._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__961d4950._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__961d4950._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__96670392._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__96670392._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9c45d070._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b693281b._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b693281b._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b947ac03._.js +6 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b947ac03._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c8a38109._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c8a38109._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ecc11d40._.js +6 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__ecc11d40._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_0020fddd._.js +1 -1
- package/web/.next/server/chunks/ssr/_0020fddd._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_02ec1aea._.js +1 -1
- package/web/.next/server/chunks/ssr/_02ec1aea._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_ea60b5f4._.js → _2e5868a9._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_ea60b5f4._.js.map → _2e5868a9._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_fd42092e._.js → _603a2eaf._.js} +2 -2
- package/web/.next/server/chunks/ssr/_603a2eaf._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_7dca1882._.js +1 -1
- package/web/.next/server/chunks/ssr/_7dca1882._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_a37f5f18._.js +1 -1
- package/web/.next/server/chunks/ssr/_a37f5f18._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_a9f57758._.js +1 -1
- package/web/.next/server/chunks/ssr/_d4b20e29._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_d8575088._.js +1 -1
- package/web/.next/server/chunks/ssr/_d8575088._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_f39a1adb._.js +1 -1
- package/web/.next/server/chunks/ssr/_f39a1adb._.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/{src_presentation_web_2d80bde6._.js → src_presentation_web_710a9720._.js} +2 -2
- package/web/.next/server/chunks/ssr/{src_presentation_web_2d80bde6._.js.map → src_presentation_web_710a9720._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +3 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.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/pages/500.html +2 -2
- package/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/server/server-reference-manifest.json +410 -296
- package/web/.next/static/chunks/{f263e4e1259dab80.js → 0103bfce71394b3e.js} +1 -1
- package/web/.next/static/chunks/{00a530b48eebc6b4.js → 0a80c44ce8a1f1fd.js} +1 -1
- package/web/.next/static/chunks/{f7378196fe6de59d.js → 111f1e12d864702a.js} +1 -1
- package/web/.next/static/chunks/{29eab2723d39c7d4.js → 11e073c0f6278fd6.js} +1 -1
- package/web/.next/static/chunks/{e81a300637893d1d.js → 15b00310b1685c71.js} +1 -1
- package/web/.next/static/chunks/{c69250d23ccb42f3.js → 43d6ab1dbcedca24.js} +1 -1
- package/web/.next/static/chunks/{f33304a0a79c3d37.js → 6fbe24b1a446fbe8.js} +1 -1
- package/web/.next/static/chunks/{1c6abff75a174baf.js → a3fdbfbbd8731960.js} +2 -2
- package/web/.next/static/chunks/b3eb81676cb7c0db.js +1 -0
- package/web/.next/static/chunks/{8781938b01a2556a.js → b99d1df592920249.js} +1 -1
- package/web/.next/static/chunks/bfda4e4194a4a633.js +1 -0
- package/web/.next/static/chunks/{dd23116f5b0692c7.js → c432480cc3a40ca9.js} +1 -1
- package/web/.next/static/chunks/{0b7fe2ac4f078f54.js → f070c67389a686ff.js} +1 -1
- package/web/.next/static/chunks/f2f04d68700ee881.js +1 -0
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_4e741df2.js +0 -3
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_4e741df2.js.map +0 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_026fdffa.js +0 -3
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_026fdffa.js.map +0 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_8b91e197.js +0 -3
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_8b91e197.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2c791c42._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2c791c42._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__755cfe02._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__755cfe02._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a628fb91._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a628fb91._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__bfba58e6._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__bfba58e6._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c3ab8422._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c3ab8422._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_fd42092e._.js.map +0 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_8e7fe0d1._.js +0 -5
- package/web/.next/server/chunks/ssr/src_presentation_web_8e7fe0d1._.js.map +0 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_ca051134.js +0 -3
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_ca051134.js.map +0 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_b9023017._.js +0 -5
- package/web/.next/server/chunks/ssr/src_presentation_web_b9023017._.js.map +0 -1
- package/web/.next/static/chunks/5986c66ede9b4cf3.js +0 -1
- package/web/.next/static/chunks/db6f95d0aeac37a7.js +0 -1
- package/web/.next/static/chunks/eb9841ec4d80af01.js +0 -1
- /package/web/.next/static/{085-5yYoC3xdOOOQEmCO1 → MC7r1jyUyHMlJ8Ig_nOAh}/_buildManifest.js +0 -0
- /package/web/.next/static/{085-5yYoC3xdOOOQEmCO1 → MC7r1jyUyHMlJ8Ig_nOAh}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{085-5yYoC3xdOOOQEmCO1 → MC7r1jyUyHMlJ8Ig_nOAh}/_ssgManifest.js +0 -0
|
@@ -64,7 +64,7 @@ let SQLiteSettingsRepository = class SQLiteSettingsRepository {
|
|
|
64
64
|
onboarding_complete,
|
|
65
65
|
approval_gate_allow_prd, approval_gate_allow_plan,
|
|
66
66
|
approval_gate_allow_merge, approval_gate_push_on_impl_complete,
|
|
67
|
-
feature_flag_skills, feature_flag_env_deploy, feature_flag_debug, feature_flag_github_import, feature_flag_adopt_branch,
|
|
67
|
+
feature_flag_skills, feature_flag_env_deploy, feature_flag_debug, feature_flag_github_import, feature_flag_adopt_branch, feature_flag_git_rebase_sync,
|
|
68
68
|
feature_flag_react_file_manager,
|
|
69
69
|
workflow_enable_evidence, workflow_commit_evidence,
|
|
70
70
|
hide_ci_status
|
|
@@ -90,7 +90,7 @@ let SQLiteSettingsRepository = class SQLiteSettingsRepository {
|
|
|
90
90
|
@onboarding_complete,
|
|
91
91
|
@approval_gate_allow_prd, @approval_gate_allow_plan,
|
|
92
92
|
@approval_gate_allow_merge, @approval_gate_push_on_impl_complete,
|
|
93
|
-
@feature_flag_skills, @feature_flag_env_deploy, @feature_flag_debug, @feature_flag_github_import, @feature_flag_adopt_branch,
|
|
93
|
+
@feature_flag_skills, @feature_flag_env_deploy, @feature_flag_debug, @feature_flag_github_import, @feature_flag_adopt_branch, @feature_flag_git_rebase_sync,
|
|
94
94
|
@feature_flag_react_file_manager,
|
|
95
95
|
@workflow_enable_evidence, @workflow_commit_evidence,
|
|
96
96
|
@hide_ci_status
|
|
@@ -186,6 +186,7 @@ let SQLiteSettingsRepository = class SQLiteSettingsRepository {
|
|
|
186
186
|
feature_flag_debug = @feature_flag_debug,
|
|
187
187
|
feature_flag_github_import = @feature_flag_github_import,
|
|
188
188
|
feature_flag_adopt_branch = @feature_flag_adopt_branch,
|
|
189
|
+
feature_flag_git_rebase_sync = @feature_flag_git_rebase_sync,
|
|
189
190
|
feature_flag_react_file_manager = @feature_flag_react_file_manager,
|
|
190
191
|
workflow_enable_evidence = @workflow_enable_evidence,
|
|
191
192
|
workflow_commit_evidence = @workflow_commit_evidence,
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conflict Resolution Prompt Builder
|
|
3
|
+
*
|
|
4
|
+
* Builds prompts for the AI agent to resolve git rebase conflicts.
|
|
5
|
+
* Follows the merge-prompts.ts pattern of pure functions returning
|
|
6
|
+
* markdown strings.
|
|
7
|
+
*/
|
|
8
|
+
export interface ConflictedFile {
|
|
9
|
+
/** Relative file path from repo root */
|
|
10
|
+
path: string;
|
|
11
|
+
/** Full file contents including conflict markers */
|
|
12
|
+
content: string;
|
|
13
|
+
}
|
|
14
|
+
export interface ConflictResolutionPromptParams {
|
|
15
|
+
/** Files with conflict markers */
|
|
16
|
+
conflictedFiles: ConflictedFile[];
|
|
17
|
+
/** The feature branch being rebased */
|
|
18
|
+
featureBranch: string;
|
|
19
|
+
/** The base branch being rebased onto */
|
|
20
|
+
baseBranch: string;
|
|
21
|
+
/** 1-based attempt number */
|
|
22
|
+
attemptNumber: number;
|
|
23
|
+
/** Maximum allowed attempts */
|
|
24
|
+
maxAttempts: number;
|
|
25
|
+
/** Feedback from previous failed attempt (remaining markers info) */
|
|
26
|
+
previousFeedback?: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Build a prompt for the conflict resolution agent.
|
|
30
|
+
*
|
|
31
|
+
* The agent receives conflicted file contents and instructions to resolve
|
|
32
|
+
* all conflict markers by editing files in the working directory.
|
|
33
|
+
*/
|
|
34
|
+
export declare function buildConflictResolutionPrompt(params: ConflictResolutionPromptParams): string;
|
|
35
|
+
//# sourceMappingURL=conflict-resolution.prompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conflict-resolution.prompt.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.prompt.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,cAAc;IAC7B,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,8BAA8B;IAC7C,kCAAkC;IAClC,eAAe,EAAE,cAAc,EAAE,CAAC;IAClC,uCAAuC;IACvC,aAAa,EAAE,MAAM,CAAC;IACtB,yCAAyC;IACzC,UAAU,EAAE,MAAM,CAAC;IACnB,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,8BAA8B,GAAG,MAAM,CAgE5F"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conflict Resolution Prompt Builder
|
|
3
|
+
*
|
|
4
|
+
* Builds prompts for the AI agent to resolve git rebase conflicts.
|
|
5
|
+
* Follows the merge-prompts.ts pattern of pure functions returning
|
|
6
|
+
* markdown strings.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Build a prompt for the conflict resolution agent.
|
|
10
|
+
*
|
|
11
|
+
* The agent receives conflicted file contents and instructions to resolve
|
|
12
|
+
* all conflict markers by editing files in the working directory.
|
|
13
|
+
*/
|
|
14
|
+
export function buildConflictResolutionPrompt(params) {
|
|
15
|
+
const { conflictedFiles, featureBranch, baseBranch, attemptNumber, maxAttempts, previousFeedback, } = params;
|
|
16
|
+
const fileSection = conflictedFiles
|
|
17
|
+
.map((f) => `### \`${f.path}\`
|
|
18
|
+
|
|
19
|
+
\`\`\`
|
|
20
|
+
${f.content}
|
|
21
|
+
\`\`\``)
|
|
22
|
+
.join('\n\n');
|
|
23
|
+
const feedbackSection = previousFeedback
|
|
24
|
+
? `
|
|
25
|
+
## Previous Attempt Feedback
|
|
26
|
+
|
|
27
|
+
Your previous resolution attempt (${attemptNumber - 1}/${maxAttempts}) was incomplete:
|
|
28
|
+
|
|
29
|
+
${previousFeedback}
|
|
30
|
+
|
|
31
|
+
You MUST resolve all remaining conflict markers in this attempt.
|
|
32
|
+
`
|
|
33
|
+
: '';
|
|
34
|
+
return `You are resolving git rebase conflicts (attempt ${attemptNumber}/${maxAttempts}).
|
|
35
|
+
|
|
36
|
+
## Branch Context
|
|
37
|
+
|
|
38
|
+
- Feature branch: \`${featureBranch}\`
|
|
39
|
+
- Base branch: \`${baseBranch}\`
|
|
40
|
+
- The feature branch is being rebased onto the latest \`${baseBranch}\`.
|
|
41
|
+
${feedbackSection}
|
|
42
|
+
## Conflicted Files
|
|
43
|
+
|
|
44
|
+
The following files contain conflict markers that must be resolved:
|
|
45
|
+
|
|
46
|
+
${fileSection}
|
|
47
|
+
|
|
48
|
+
## Instructions
|
|
49
|
+
|
|
50
|
+
1. Read each conflicted file listed above
|
|
51
|
+
2. Resolve ALL conflict markers (\`<<<<<<<\`, \`=======\`, \`>>>>>>>\`) by editing the files
|
|
52
|
+
3. For each conflict, determine the correct resolution by understanding the intent of both sides:
|
|
53
|
+
- The \`<<<<<<< HEAD\` section contains changes from \`${baseBranch}\` (theirs during rebase)
|
|
54
|
+
- The \`>>>>>>> ...\` section contains changes from \`${featureBranch}\` (ours during rebase)
|
|
55
|
+
4. Produce a merged result that preserves the intent of both sides where possible
|
|
56
|
+
5. If the changes conflict logically (not just textually), prefer the feature branch changes but ensure compatibility with the base branch
|
|
57
|
+
|
|
58
|
+
## Constraints
|
|
59
|
+
|
|
60
|
+
- Edit ONLY the conflicted files listed above — do NOT modify any other files
|
|
61
|
+
- Remove ALL conflict markers (\`<<<<<<<\`, \`=======\`, \`>>>>>>>\`) from every conflicted file
|
|
62
|
+
- Do NOT add new files or delete files
|
|
63
|
+
- Do NOT run git commands — only edit files to resolve conflicts
|
|
64
|
+
- Do NOT run tests, builds, or linters — only resolve the conflict markers
|
|
65
|
+
- Every conflicted file must have zero remaining conflict markers when you are done`;
|
|
66
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conflict Resolution Service
|
|
3
|
+
*
|
|
4
|
+
* Orchestrates agent-powered conflict resolution during git rebase.
|
|
5
|
+
* Follows the CI watch/fix loop pattern: detect conflict → invoke agent →
|
|
6
|
+
* validate resolution → stage files → continue rebase, with retry logic.
|
|
7
|
+
*/
|
|
8
|
+
import type { IAgentExecutorProvider } from '../../../../application/ports/output/agents/agent-executor-provider.interface.js';
|
|
9
|
+
import type { IGitPrService } from '../../../../application/ports/output/services/git-pr-service.interface.js';
|
|
10
|
+
export declare class ConflictResolutionService {
|
|
11
|
+
private readonly agentProvider;
|
|
12
|
+
private readonly gitPrService;
|
|
13
|
+
constructor(agentProvider: IAgentExecutorProvider, gitPrService: IGitPrService);
|
|
14
|
+
/**
|
|
15
|
+
* Resolve all conflicts during a rebase operation.
|
|
16
|
+
*
|
|
17
|
+
* Handles multi-commit rebases where each commit may introduce conflicts.
|
|
18
|
+
* For each conflicted commit: reads conflicted files, invokes agent to
|
|
19
|
+
* resolve, validates no remaining markers, stages resolved files, and
|
|
20
|
+
* continues the rebase. Retries up to MAX_RETRIES_PER_COMMIT times.
|
|
21
|
+
*
|
|
22
|
+
* If retries are exhausted, aborts the rebase and throws REBASE_CONFLICT.
|
|
23
|
+
*
|
|
24
|
+
* @param cwd - Working directory (repo root or worktree path)
|
|
25
|
+
* @param featureBranch - Feature branch being rebased
|
|
26
|
+
* @param baseBranch - Base branch being rebased onto
|
|
27
|
+
*/
|
|
28
|
+
resolve(cwd: string, featureBranch: string, baseBranch: string): Promise<void>;
|
|
29
|
+
/**
|
|
30
|
+
* Read the contents of conflicted files from the working directory.
|
|
31
|
+
*/
|
|
32
|
+
private readConflictedFileContents;
|
|
33
|
+
/**
|
|
34
|
+
* Validate that no conflict markers remain in the previously-conflicted files.
|
|
35
|
+
*/
|
|
36
|
+
private validateResolution;
|
|
37
|
+
/**
|
|
38
|
+
* Build feedback about remaining conflict markers for retry attempts.
|
|
39
|
+
*/
|
|
40
|
+
private buildFeedbackFromRemainingMarkers;
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=conflict-resolution.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conflict-resolution.service.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/infrastructure/services/agents/conflict-resolution/conflict-resolution.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAKH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wEAAwE,CAAC;AACrH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iEAAiE,CAAC;AAerG,qBACa,yBAAyB;IAGlC,OAAO,CAAC,QAAQ,CAAC,aAAa;IAE9B,OAAO,CAAC,QAAQ,CAAC,YAAY;gBAFZ,aAAa,EAAE,sBAAsB,EAErC,YAAY,EAAE,aAAa;IAG9C;;;;;;;;;;;;;OAaG;IACG,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkEpF;;OAEG;IACH,OAAO,CAAC,0BAA0B;IAWlC;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAgB1B;;OAEG;IACH,OAAO,CAAC,iCAAiC;CAyB1C"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conflict Resolution Service
|
|
3
|
+
*
|
|
4
|
+
* Orchestrates agent-powered conflict resolution during git rebase.
|
|
5
|
+
* Follows the CI watch/fix loop pattern: detect conflict → invoke agent →
|
|
6
|
+
* validate resolution → stage files → continue rebase, with retry logic.
|
|
7
|
+
*/
|
|
8
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
9
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
10
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
11
|
+
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;
|
|
12
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
13
|
+
};
|
|
14
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
15
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
16
|
+
};
|
|
17
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
18
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
19
|
+
};
|
|
20
|
+
import { injectable, inject } from 'tsyringe';
|
|
21
|
+
import { readFileSync } from 'node:fs';
|
|
22
|
+
import { join } from 'node:path';
|
|
23
|
+
import { GitPrError, GitPrErrorCode, } from '../../../../application/ports/output/services/git-pr-service.interface.js';
|
|
24
|
+
import { buildConflictResolutionPrompt, } from './conflict-resolution.prompt.js';
|
|
25
|
+
const MAX_RETRIES_PER_COMMIT = 3;
|
|
26
|
+
/** Conflict markers that indicate unresolved conflicts */
|
|
27
|
+
const CONFLICT_MARKERS = ['<<<<<<<', '=======', '>>>>>>>'];
|
|
28
|
+
let ConflictResolutionService = class ConflictResolutionService {
|
|
29
|
+
agentProvider;
|
|
30
|
+
gitPrService;
|
|
31
|
+
constructor(agentProvider, gitPrService) {
|
|
32
|
+
this.agentProvider = agentProvider;
|
|
33
|
+
this.gitPrService = gitPrService;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Resolve all conflicts during a rebase operation.
|
|
37
|
+
*
|
|
38
|
+
* Handles multi-commit rebases where each commit may introduce conflicts.
|
|
39
|
+
* For each conflicted commit: reads conflicted files, invokes agent to
|
|
40
|
+
* resolve, validates no remaining markers, stages resolved files, and
|
|
41
|
+
* continues the rebase. Retries up to MAX_RETRIES_PER_COMMIT times.
|
|
42
|
+
*
|
|
43
|
+
* If retries are exhausted, aborts the rebase and throws REBASE_CONFLICT.
|
|
44
|
+
*
|
|
45
|
+
* @param cwd - Working directory (repo root or worktree path)
|
|
46
|
+
* @param featureBranch - Feature branch being rebased
|
|
47
|
+
* @param baseBranch - Base branch being rebased onto
|
|
48
|
+
*/
|
|
49
|
+
async resolve(cwd, featureBranch, baseBranch) {
|
|
50
|
+
const executor = await this.agentProvider.getExecutor();
|
|
51
|
+
// Outer loop: handle multi-commit rebases where rebaseContinue
|
|
52
|
+
// may reveal conflicts on the next commit
|
|
53
|
+
while (true) {
|
|
54
|
+
const conflictedFiles = await this.gitPrService.getConflictedFiles(cwd);
|
|
55
|
+
if (conflictedFiles.length === 0) {
|
|
56
|
+
return; // No conflicts — rebase is complete
|
|
57
|
+
}
|
|
58
|
+
// Inner loop: retry agent resolution for the current commit's conflicts
|
|
59
|
+
let resolved = false;
|
|
60
|
+
for (let attempt = 1; attempt <= MAX_RETRIES_PER_COMMIT; attempt++) {
|
|
61
|
+
const fileContents = this.readConflictedFileContents(cwd, conflictedFiles);
|
|
62
|
+
const previousFeedback = attempt > 1 ? this.buildFeedbackFromRemainingMarkers(cwd, conflictedFiles) : undefined;
|
|
63
|
+
const prompt = buildConflictResolutionPrompt({
|
|
64
|
+
conflictedFiles: fileContents,
|
|
65
|
+
featureBranch,
|
|
66
|
+
baseBranch,
|
|
67
|
+
attemptNumber: attempt,
|
|
68
|
+
maxAttempts: MAX_RETRIES_PER_COMMIT,
|
|
69
|
+
previousFeedback,
|
|
70
|
+
});
|
|
71
|
+
await executor.execute(prompt, { cwd });
|
|
72
|
+
// Validate: check no conflict markers remain
|
|
73
|
+
if (this.validateResolution(cwd, conflictedFiles)) {
|
|
74
|
+
resolved = true;
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
if (!resolved) {
|
|
79
|
+
// Exhausted retries — abort and report
|
|
80
|
+
await this.gitPrService.rebaseAbort(cwd);
|
|
81
|
+
const remaining = conflictedFiles.join(', ');
|
|
82
|
+
throw new GitPrError(`Failed to resolve conflicts after ${MAX_RETRIES_PER_COMMIT} attempts. ` +
|
|
83
|
+
`Unresolved files: ${remaining}. The rebase has been aborted.`, GitPrErrorCode.REBASE_CONFLICT);
|
|
84
|
+
}
|
|
85
|
+
// Resolution succeeded — stage files and continue rebase
|
|
86
|
+
await this.gitPrService.stageFiles(cwd, conflictedFiles);
|
|
87
|
+
try {
|
|
88
|
+
await this.gitPrService.rebaseContinue(cwd);
|
|
89
|
+
// rebaseContinue succeeded — check if there are more conflicts
|
|
90
|
+
// from subsequent commits (loop continues)
|
|
91
|
+
return; // No more conflicts
|
|
92
|
+
}
|
|
93
|
+
catch (error) {
|
|
94
|
+
if (error instanceof GitPrError && error.code === GitPrErrorCode.REBASE_CONFLICT) {
|
|
95
|
+
// Next commit has conflicts — loop back to resolve them
|
|
96
|
+
continue;
|
|
97
|
+
}
|
|
98
|
+
throw error; // Unexpected error
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Read the contents of conflicted files from the working directory.
|
|
104
|
+
*/
|
|
105
|
+
readConflictedFileContents(cwd, filePaths) {
|
|
106
|
+
return filePaths.map((filePath) => {
|
|
107
|
+
try {
|
|
108
|
+
const content = readFileSync(join(cwd, filePath), 'utf-8');
|
|
109
|
+
return { path: filePath, content };
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
return { path: filePath, content: '(unable to read file)' };
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Validate that no conflict markers remain in the previously-conflicted files.
|
|
118
|
+
*/
|
|
119
|
+
validateResolution(cwd, filePaths) {
|
|
120
|
+
for (const filePath of filePaths) {
|
|
121
|
+
try {
|
|
122
|
+
const content = readFileSync(join(cwd, filePath), 'utf-8');
|
|
123
|
+
for (const marker of CONFLICT_MARKERS) {
|
|
124
|
+
if (content.includes(marker)) {
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Build feedback about remaining conflict markers for retry attempts.
|
|
137
|
+
*/
|
|
138
|
+
buildFeedbackFromRemainingMarkers(cwd, filePaths) {
|
|
139
|
+
const remaining = [];
|
|
140
|
+
for (const filePath of filePaths) {
|
|
141
|
+
try {
|
|
142
|
+
const content = readFileSync(join(cwd, filePath), 'utf-8');
|
|
143
|
+
const lines = content.split('\n');
|
|
144
|
+
const markerLines = [];
|
|
145
|
+
lines.forEach((line, index) => {
|
|
146
|
+
if (CONFLICT_MARKERS.some((marker) => line.includes(marker))) {
|
|
147
|
+
markerLines.push(index + 1);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
if (markerLines.length > 0) {
|
|
151
|
+
remaining.push(`- \`${filePath}\`: conflict markers remain on lines ${markerLines.join(', ')}`);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
catch {
|
|
155
|
+
remaining.push(`- \`${filePath}\`: unable to read file`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return remaining.length > 0
|
|
159
|
+
? remaining.join('\n')
|
|
160
|
+
: 'No specific markers found, but validation failed.';
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
ConflictResolutionService = __decorate([
|
|
164
|
+
injectable(),
|
|
165
|
+
__param(0, inject('IAgentExecutorProvider')),
|
|
166
|
+
__param(1, inject('IGitPrService')),
|
|
167
|
+
__metadata("design:paramtypes", [Object, Object])
|
|
168
|
+
], ConflictResolutionService);
|
|
169
|
+
export { ConflictResolutionService };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyze.prompt.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/analyze.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"analyze.prompt.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/analyze.prompt.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CA6GnE"}
|
|
@@ -50,7 +50,9 @@ You MUST write the COMPLETE file (not a partial update). Preserve the existing n
|
|
|
50
50
|
technologies:
|
|
51
51
|
- (list each technology relevant to implementing this feature)
|
|
52
52
|
|
|
53
|
-
relatedLinks:
|
|
53
|
+
relatedLinks:
|
|
54
|
+
- title: '(Human-readable title for the resource)'
|
|
55
|
+
url: '(URL to external documentation or reference)'
|
|
54
56
|
|
|
55
57
|
openQuestions: []
|
|
56
58
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plan.prompt.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/plan.prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,wBAAgB,eAAe,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"plan.prompt.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/plan.prompt.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,wBAAgB,eAAe,CAAC,KAAK,EAAE,iBAAiB,GAAG,MAAM,CA6NhE"}
|
|
@@ -92,7 +92,9 @@ You MUST write TWO files:
|
|
|
92
92
|
relatedFeatures: []
|
|
93
93
|
technologies:
|
|
94
94
|
- (technologies needed)
|
|
95
|
-
relatedLinks:
|
|
95
|
+
relatedLinks:
|
|
96
|
+
- title: '(Human-readable title for the resource)'
|
|
97
|
+
url: '(URL to external documentation or reference)'
|
|
96
98
|
|
|
97
99
|
phases:
|
|
98
100
|
- id: phase-1
|
|
@@ -141,7 +143,9 @@ You MUST write TWO files:
|
|
|
141
143
|
|
|
142
144
|
relatedFeatures: []
|
|
143
145
|
technologies: []
|
|
144
|
-
relatedLinks:
|
|
146
|
+
relatedLinks:
|
|
147
|
+
- title: '(Human-readable title for the resource)'
|
|
148
|
+
url: '(URL to external documentation or reference)'
|
|
145
149
|
|
|
146
150
|
tasks:
|
|
147
151
|
- id: task-1
|
|
@@ -45,5 +45,11 @@ export declare class GitPrService implements IGitPrService {
|
|
|
45
45
|
private parseGhError;
|
|
46
46
|
private parsePrNumberFromUrl;
|
|
47
47
|
private parseDiffStat;
|
|
48
|
+
syncMain(cwd: string, baseBranch: string): Promise<void>;
|
|
49
|
+
rebaseOnMain(cwd: string, featureBranch: string, baseBranch: string): Promise<void>;
|
|
50
|
+
getConflictedFiles(cwd: string): Promise<string[]>;
|
|
51
|
+
stageFiles(cwd: string, files: string[]): Promise<void>;
|
|
52
|
+
rebaseContinue(cwd: string): Promise<void>;
|
|
53
|
+
rebaseAbort(cwd: string): Promise<void>;
|
|
48
54
|
}
|
|
49
55
|
//# sourceMappingURL=git-pr.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-pr.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/git/git-pr.service.ts"],"names":[],"mappings":"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
|
|
1
|
+
{"version":3,"file":"git-pr.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/git/git-pr.service.ts"],"names":[],"mappings":"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"}
|
|
@@ -609,6 +609,14 @@ let GitPrService = class GitPrService {
|
|
|
609
609
|
parseGitError(error) {
|
|
610
610
|
const message = error instanceof Error ? error.message : String(error);
|
|
611
611
|
const cause = error instanceof Error ? error : undefined;
|
|
612
|
+
// Rebase-specific: detect "CONFLICT" during rebase operations
|
|
613
|
+
if (message.includes('CONFLICT') && message.includes('rebase')) {
|
|
614
|
+
return new GitPrError(message, GitPrErrorCode.REBASE_CONFLICT, cause);
|
|
615
|
+
}
|
|
616
|
+
// Sync-specific: non-fast-forward or diverged branch
|
|
617
|
+
if (message.includes('non-fast-forward') || message.includes('diverged')) {
|
|
618
|
+
return new GitPrError(message, GitPrErrorCode.SYNC_FAILED, cause);
|
|
619
|
+
}
|
|
612
620
|
if (message.includes('rejected') || message.includes('conflict')) {
|
|
613
621
|
return new GitPrError(message, GitPrErrorCode.MERGE_CONFLICT, cause);
|
|
614
622
|
}
|
|
@@ -649,6 +657,132 @@ let GitPrService = class GitPrService {
|
|
|
649
657
|
commitCount,
|
|
650
658
|
};
|
|
651
659
|
}
|
|
660
|
+
// --- Rebase & Sync operations ---
|
|
661
|
+
async syncMain(cwd, baseBranch) {
|
|
662
|
+
try {
|
|
663
|
+
// Detect current branch
|
|
664
|
+
const { stdout } = await this.execFile('git', ['rev-parse', '--abbrev-ref', 'HEAD'], { cwd });
|
|
665
|
+
const currentBranch = stdout.trim();
|
|
666
|
+
if (currentBranch === baseBranch) {
|
|
667
|
+
// On the base branch — use git pull --ff-only
|
|
668
|
+
await this.execFile('git', ['pull', '--ff-only', 'origin', baseBranch], { cwd });
|
|
669
|
+
}
|
|
670
|
+
else {
|
|
671
|
+
// On a different branch — fetch the remote ref only (updates origin/<baseBranch>).
|
|
672
|
+
// We intentionally do NOT update the local <baseBranch> ref because it may be
|
|
673
|
+
// checked out in another worktree, which causes git to refuse the update with:
|
|
674
|
+
// "fatal: refusing to fetch into branch 'refs/heads/main' checked out at ..."
|
|
675
|
+
await this.execFile('git', ['fetch', 'origin', baseBranch], { cwd });
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
catch (error) {
|
|
679
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
680
|
+
const cause = error instanceof Error ? error : undefined;
|
|
681
|
+
if (message.includes('non-fast-forward') ||
|
|
682
|
+
message.includes('Not possible to fast-forward') ||
|
|
683
|
+
message.includes('diverged')) {
|
|
684
|
+
throw new GitPrError(`Cannot fast-forward '${baseBranch}': local branch has diverged from remote. ` +
|
|
685
|
+
`Resolve the divergence manually with 'git checkout ${baseBranch} && git reset --hard origin/${baseBranch}' ` +
|
|
686
|
+
`if you want to discard local changes on ${baseBranch}.`, GitPrErrorCode.SYNC_FAILED, cause);
|
|
687
|
+
}
|
|
688
|
+
throw new GitPrError(`Failed to sync '${baseBranch}' with remote: ${message}`, GitPrErrorCode.GIT_ERROR, cause);
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
async rebaseOnMain(cwd, featureBranch, baseBranch) {
|
|
692
|
+
// Check for dirty worktree before starting
|
|
693
|
+
const dirty = await this.hasUncommittedChanges(cwd);
|
|
694
|
+
if (dirty) {
|
|
695
|
+
throw new GitPrError(`Cannot rebase: working directory has uncommitted changes. ` +
|
|
696
|
+
`Please commit or stash your changes before rebasing.`, GitPrErrorCode.GIT_ERROR);
|
|
697
|
+
}
|
|
698
|
+
// Checkout the feature branch
|
|
699
|
+
try {
|
|
700
|
+
await this.execFile('git', ['checkout', featureBranch], { cwd });
|
|
701
|
+
}
|
|
702
|
+
catch (error) {
|
|
703
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
704
|
+
const cause = error instanceof Error ? error : undefined;
|
|
705
|
+
if (message.includes('did not match') ||
|
|
706
|
+
message.includes('not a commit') ||
|
|
707
|
+
message.includes('pathspec')) {
|
|
708
|
+
throw new GitPrError(`Branch '${featureBranch}' not found.`, GitPrErrorCode.BRANCH_NOT_FOUND, cause);
|
|
709
|
+
}
|
|
710
|
+
throw new GitPrError(`Failed to checkout '${featureBranch}': ${message}`, GitPrErrorCode.GIT_ERROR, cause);
|
|
711
|
+
}
|
|
712
|
+
// Rebase onto origin/<baseBranch> (the remote-tracking ref).
|
|
713
|
+
// We use origin/<baseBranch> rather than the local <baseBranch> because:
|
|
714
|
+
// 1. syncMain fetches origin/<baseBranch> — it's always up-to-date
|
|
715
|
+
// 2. The local <baseBranch> may be checked out in another worktree and stale
|
|
716
|
+
const rebaseTarget = `origin/${baseBranch}`;
|
|
717
|
+
try {
|
|
718
|
+
await this.execFile('git', ['rebase', rebaseTarget], { cwd });
|
|
719
|
+
}
|
|
720
|
+
catch (error) {
|
|
721
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
722
|
+
const cause = error instanceof Error ? error : undefined;
|
|
723
|
+
// Detect rebase conflict from git stderr/exit code
|
|
724
|
+
if (message.includes('CONFLICT') || message.includes('could not apply')) {
|
|
725
|
+
// Get the list of conflicted files to include in the error message
|
|
726
|
+
let conflictedFiles = [];
|
|
727
|
+
try {
|
|
728
|
+
conflictedFiles = await this.getConflictedFiles(cwd);
|
|
729
|
+
}
|
|
730
|
+
catch {
|
|
731
|
+
// Failed to get conflicted files — still report the conflict
|
|
732
|
+
}
|
|
733
|
+
const fileList = conflictedFiles.length > 0 ? ` Conflicted files: ${conflictedFiles.join(', ')}` : '';
|
|
734
|
+
throw new GitPrError(`Rebase of '${featureBranch}' onto '${baseBranch}' encountered conflicts.${fileList}`, GitPrErrorCode.REBASE_CONFLICT, cause);
|
|
735
|
+
}
|
|
736
|
+
throw new GitPrError(`Rebase of '${featureBranch}' onto '${baseBranch}' failed: ${message}`, GitPrErrorCode.GIT_ERROR, cause);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
async getConflictedFiles(cwd) {
|
|
740
|
+
try {
|
|
741
|
+
const { stdout } = await this.execFile('git', ['diff', '--name-only', '--diff-filter=U'], {
|
|
742
|
+
cwd,
|
|
743
|
+
});
|
|
744
|
+
return stdout
|
|
745
|
+
.trim()
|
|
746
|
+
.split('\n')
|
|
747
|
+
.filter((f) => f.length > 0)
|
|
748
|
+
.map((f) => f.replace(/\\/g, '/'));
|
|
749
|
+
}
|
|
750
|
+
catch (error) {
|
|
751
|
+
throw this.parseGitError(error);
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
async stageFiles(cwd, files) {
|
|
755
|
+
try {
|
|
756
|
+
await this.execFile('git', ['add', ...files], { cwd });
|
|
757
|
+
}
|
|
758
|
+
catch (error) {
|
|
759
|
+
throw this.parseGitError(error);
|
|
760
|
+
}
|
|
761
|
+
}
|
|
762
|
+
async rebaseContinue(cwd) {
|
|
763
|
+
try {
|
|
764
|
+
await this.execFile('git', ['rebase', '--continue'], {
|
|
765
|
+
cwd,
|
|
766
|
+
env: { ...process.env, GIT_EDITOR: 'true' },
|
|
767
|
+
});
|
|
768
|
+
}
|
|
769
|
+
catch (error) {
|
|
770
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
771
|
+
const cause = error instanceof Error ? error : undefined;
|
|
772
|
+
if (message.includes('CONFLICT') || message.includes('could not apply')) {
|
|
773
|
+
throw new GitPrError(`Rebase continue encountered new conflicts: ${message}`, GitPrErrorCode.REBASE_CONFLICT, cause);
|
|
774
|
+
}
|
|
775
|
+
throw this.parseGitError(error);
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
async rebaseAbort(cwd) {
|
|
779
|
+
try {
|
|
780
|
+
await this.execFile('git', ['rebase', '--abort'], { cwd });
|
|
781
|
+
}
|
|
782
|
+
catch (error) {
|
|
783
|
+
throw this.parseGitError(error);
|
|
784
|
+
}
|
|
785
|
+
}
|
|
652
786
|
};
|
|
653
787
|
GitPrService = __decorate([
|
|
654
788
|
injectable(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-graph-data.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/(dashboard)/get-graph-data.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAE5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAI1C,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;
|
|
1
|
+
{"version":3,"file":"get-graph-data.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/(dashboard)/get-graph-data.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAE5E,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAI1C,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAiFD,MAAM,MAAM,aAAa,GACrB;IAAE,MAAM,EAAE,SAAS,CAAA;CAAE,GACrB;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,WAAW,CAAA;CAAE,GACtC;IAAE,MAAM,EAAE,YAAY,CAAA;CAAE,CAAC;AA6B7B,wBAAsB,YAAY,IAAI,OAAO,CAAC;IAAE,KAAK,EAAE,cAAc,EAAE,CAAC;IAAC,KAAK,EAAE,IAAI,EAAE,CAAA;CAAE,CAAC,CA6DxF"}
|
|
@@ -31,13 +31,7 @@ async function refreshRepoGitInfo(repo) {
|
|
|
31
31
|
gitInfoCache.set(repo.path, { kind: 'not-a-repo', checkedAt: Date.now() });
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
if (cached?.kind === 'repo' && cached.sha === headSha) {
|
|
36
|
-
// HEAD unchanged — just bump checkedAt
|
|
37
|
-
cached.checkedAt = Date.now();
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
// HEAD changed — fetch branch + subject & author in parallel
|
|
34
|
+
// Fetch branch + subject & author in parallel
|
|
41
35
|
const [currentBranch, logLine] = await Promise.all([
|
|
42
36
|
gitCommand(repo.path, ['symbolic-ref', '--short', 'HEAD']),
|
|
43
37
|
gitCommand(repo.path, ['log', '-1', `--format=%s${FIELD_SEP}%an`]),
|
|
@@ -45,7 +39,8 @@ async function refreshRepoGitInfo(repo) {
|
|
|
45
39
|
if (!currentBranch)
|
|
46
40
|
return;
|
|
47
41
|
const [commitMessage, committer] = (logLine ?? '').split(FIELD_SEP);
|
|
48
|
-
// Behind count
|
|
42
|
+
// Behind count — always compute, even when on the default branch,
|
|
43
|
+
// because local main can be behind origin/main.
|
|
49
44
|
let behindCount = null;
|
|
50
45
|
const defaultBranchRef = await gitCommand(repo.path, [
|
|
51
46
|
'symbolic-ref',
|
|
@@ -53,7 +48,8 @@ async function refreshRepoGitInfo(repo) {
|
|
|
53
48
|
'refs/remotes/origin/HEAD',
|
|
54
49
|
]);
|
|
55
50
|
const defaultBranch = defaultBranchRef?.replace('origin/', '') ?? null;
|
|
56
|
-
if (defaultBranch
|
|
51
|
+
if (defaultBranch) {
|
|
52
|
+
// Compare current branch (or default branch itself) against origin
|
|
57
53
|
const behind = await gitCommand(repo.path, [
|
|
58
54
|
'rev-list',
|
|
59
55
|
'--count',
|
|
@@ -63,9 +59,6 @@ async function refreshRepoGitInfo(repo) {
|
|
|
63
59
|
if (isNaN(behindCount))
|
|
64
60
|
behindCount = null;
|
|
65
61
|
}
|
|
66
|
-
else {
|
|
67
|
-
behindCount = 0;
|
|
68
|
-
}
|
|
69
62
|
gitInfoCache.set(repo.path, {
|
|
70
63
|
kind: 'repo',
|
|
71
64
|
sha: headSha,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rebase-feature.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/rebase-feature.ts"],"names":[],"mappings":"AAKA,wBAAsB,aAAa,CACjC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAa/C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
import { resolve } from '../../lib/server-container.js';
|
|
3
|
+
export async function rebaseFeature(featureId) {
|
|
4
|
+
if (!featureId?.trim()) {
|
|
5
|
+
return { success: false, error: 'Feature id is required' };
|
|
6
|
+
}
|
|
7
|
+
try {
|
|
8
|
+
const useCase = resolve('RebaseFeatureOnMainUseCase');
|
|
9
|
+
await useCase.execute(featureId);
|
|
10
|
+
return { success: true };
|
|
11
|
+
}
|
|
12
|
+
catch (error) {
|
|
13
|
+
const message = error instanceof Error ? error.message : 'Failed to rebase feature';
|
|
14
|
+
return { success: false, error: message };
|
|
15
|
+
}
|
|
16
|
+
}
|