@shepai/cli 1.136.0-pr438.9e52ee5 → 1.136.0-pr439.2a7af41
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 +3 -0
- package/apis/json-schema/WorkflowConfig.yaml +0 -5
- package/dist/packages/core/src/application/index.d.ts +1 -1
- package/dist/packages/core/src/application/index.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/index.d.ts +1 -1
- package/dist/packages/core/src/application/ports/output/index.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/repositories/repository-repository.interface.d.ts +1 -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 +0 -28
- 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/github-repository-service.interface.d.ts +0 -37
- 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 +0 -12
- package/dist/packages/core/src/application/ports/output/services/index.d.ts +4 -6
- package/dist/packages/core/src/application/ports/output/services/index.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/services/index.js +1 -2
- package/dist/packages/core/src/application/ports/output/services/spec-initializer.interface.d.ts +21 -5
- package/dist/packages/core/src/application/ports/output/services/spec-initializer.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.d.ts +1 -1
- package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.d.ts.map +1 -1
- package/dist/packages/core/src/application/use-cases/features/create/create-feature.use-case.js +8 -2
- package/dist/packages/core/src/domain/generated/output.d.ts +4 -75
- 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 +0 -4
- package/dist/packages/core/src/infrastructure/persistence/sqlite/mappers/repository.mapper.d.ts +1 -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 +2 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/044-add-spec-storage-mode.d.ts +12 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/044-add-spec-storage-mode.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/persistence/sqlite/migrations/044-add-spec-storage-mode.js +19 -0
- package/dist/packages/core/src/infrastructure/repositories/sqlite-repository.repository.d.ts +1 -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 +6 -2
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/evidence-prompts.d.ts +4 -2
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/evidence-prompts.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/prompts/evidence-prompts.js +15 -8
- package/dist/packages/core/src/infrastructure/services/external/github-repository.service.d.ts +1 -3
- 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 +1 -37
- package/dist/packages/core/src/infrastructure/services/filesystem/repo-hash.d.ts +17 -0
- package/dist/packages/core/src/infrastructure/services/filesystem/repo-hash.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/filesystem/repo-hash.js +21 -0
- package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts +1 -2
- 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 +0 -21
- package/dist/packages/core/src/infrastructure/services/git/worktree.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/git/worktree.service.js +2 -4
- package/dist/packages/core/src/infrastructure/services/ide-launchers/compute-worktree-path.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/ide-launchers/compute-worktree-path.js +2 -4
- package/dist/packages/core/src/infrastructure/services/spec/spec-initializer.service.d.ts +17 -3
- package/dist/packages/core/src/infrastructure/services/spec/spec-initializer.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/spec/spec-initializer.service.js +49 -13
- package/dist/src/presentation/cli/index.js +0 -2
- 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 +1 -1
- package/web/.next/required-server-files.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +25 -25
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +25 -25
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +31 -31
- 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 +31 -31
- 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 +23 -23
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +25 -25
- package/web/.next/server/app/(dashboard)/create/page.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +31 -31
- 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 +31 -31
- 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 +23 -23
- package/web/.next/server/app/(dashboard)/page.js +1 -1
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +23 -23
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.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/graph-data/route.js +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_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_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__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_b49d9c97.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_b49d9c97.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/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_28632197.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_28632197.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_10695d37.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_10695d37.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]__3ef34e4c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__3ef34e4c._.js.map +1 -1
- 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]__6ec59045._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6ec59045._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__fdd058b2._.js → [root-of-the-server]__785e8499._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__fdd058b2._.js.map → [root-of-the-server]__785e8499._.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]__a5f9c6e5._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a5f9c6e5._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__718766da._.js → [root-of-the-server]__b1670307._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__718766da._.js.map → [root-of-the-server]__b1670307._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__d48c5b11._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__68ce373c._.js → [root-of-the-server]__d68f61dd._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__68ce373c._.js.map → [root-of-the-server]__d68f61dd._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__47ded061._.js → [root-of-the-server]__f4e193d3._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__47ded061._.js.map → [root-of-the-server]__f4e193d3._.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/{_4dfa8bc3._.js → _32961561._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_4dfa8bc3._.js.map → _32961561._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_503680be._.js +3 -0
- package/web/.next/server/chunks/ssr/{_501af15d._.js.map → _503680be._.js.map} +1 -1
- 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/_a9f57758._.js +1 -1
- package/web/.next/server/chunks/ssr/_a9f57758._.js.map +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/_e69a26ba._.js +4 -0
- package/web/.next/server/chunks/ssr/_e69a26ba._.js.map +1 -0
- 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/src_presentation_web_06ffd221._.js +3 -0
- package/web/.next/server/chunks/ssr/{src_presentation_web_5c40524e._.js.map → src_presentation_web_06ffd221._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_53666118._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_53666118._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_d95e128d.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_d95e128d.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_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/chunks/ssr/src_presentation_web_e4df6dd7._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_e4df6dd7._.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 +39 -39
- package/web/.next/static/chunks/{5074c99e4cbb0b4c.js → 2bbb31a39a80d011.js} +1 -1
- package/web/.next/static/chunks/{29cefe3a2fa5573c.js → 5466ac7c8d7c6b2b.js} +1 -1
- package/web/.next/static/chunks/{fee7ef7b7b194025.js → 6daf875725c43e2c.js} +2 -2
- package/web/.next/static/chunks/{d03d87ed71050c43.js → 796bb98fb3f35b71.js} +1 -1
- package/web/.next/static/chunks/{a18c3f33018082cb.js → 991f2fcba923f3ed.js} +1 -1
- package/web/.next/static/chunks/{f86e433dbea0ca20.js → af4d1051b6fa73d5.js} +1 -1
- package/web/.next/static/chunks/{bb15bf7fcedc3a8d.js → c317cd6a6f76361d.js} +1 -1
- package/web/.next/static/chunks/{10d405c1707bb323.js → d0be9b22c3b9bce8.js} +1 -1
- package/web/.next/static/chunks/db862617e62ba1f9.js +1 -0
- package/web/.next/static/chunks/{3de3ea3b101bf406.js → e15904973d49ff89.js} +1 -1
- package/web/.next/static/chunks/{5a7a5794e1ece049.js → e6cff1dacc561fa0.js} +1 -1
- package/web/.next/static/chunks/{546a7dc733f92913.js → e8d49a8e1274cb49.js} +1 -1
- package/apis/json-schema/DoctorDiagnosticReport.yaml +0 -30
- package/apis/json-schema/FailedRunSummary.yaml +0 -22
- package/apis/json-schema/SystemInfo.yaml +0 -22
- package/dist/packages/core/src/application/ports/output/services/github-issue-service.interface.d.ts +0 -57
- package/dist/packages/core/src/application/ports/output/services/github-issue-service.interface.d.ts.map +0 -1
- package/dist/packages/core/src/application/ports/output/services/github-issue-service.interface.js +0 -39
- package/dist/packages/core/src/application/use-cases/doctor/doctor-diagnose.use-case.d.ts +0 -56
- package/dist/packages/core/src/application/use-cases/doctor/doctor-diagnose.use-case.d.ts.map +0 -1
- package/dist/packages/core/src/application/use-cases/doctor/doctor-diagnose.use-case.js +0 -294
- package/dist/packages/core/src/infrastructure/services/external/github-issue-creator.service.d.ts +0 -17
- package/dist/packages/core/src/infrastructure/services/external/github-issue-creator.service.d.ts.map +0 -1
- package/dist/packages/core/src/infrastructure/services/external/github-issue-creator.service.js +0 -69
- package/dist/src/presentation/cli/commands/doctor.command.d.ts +0 -20
- package/dist/src/presentation/cli/commands/doctor.command.d.ts.map +0 -1
- package/dist/src/presentation/cli/commands/doctor.command.js +0 -129
- package/web/.next/server/chunks/ssr/_501af15d._.js +0 -3
- package/web/.next/server/chunks/ssr/_75d1e2c9._.js +0 -4
- package/web/.next/server/chunks/ssr/_75d1e2c9._.js.map +0 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_5c40524e._.js +0 -3
- package/web/.next/static/chunks/499c19f1bac689cf.js +0 -1
- /package/web/.next/static/{u2GE3dKD5GVgXCtUA64to → xpAWvEAtoYdP3klvh5Yyo}/_buildManifest.js +0 -0
- /package/web/.next/static/{u2GE3dKD5GVgXCtUA64to → xpAWvEAtoYdP3klvh5Yyo}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{u2GE3dKD5GVgXCtUA64to → xpAWvEAtoYdP3klvh5Yyo}/_ssgManifest.js +0 -0
package/dist/packages/core/src/application/ports/output/services/github-issue-service.interface.d.ts
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GitHub Issue Service Interface
|
|
3
|
-
*
|
|
4
|
-
* Output port for creating GitHub issues via the gh CLI.
|
|
5
|
-
* Implementations wrap `gh issue create` for issue creation on
|
|
6
|
-
* any GitHub repository. Separate from IExternalIssueFetcher which
|
|
7
|
-
* is a read-only fetcher — this service handles write operations.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Error codes for GitHub issue creation operations.
|
|
11
|
-
*/
|
|
12
|
-
export declare enum GitHubIssueErrorCode {
|
|
13
|
-
/** The target repository was not found or the user lacks access */
|
|
14
|
-
GH_NOT_FOUND = "GH_NOT_FOUND",
|
|
15
|
-
/** GitHub CLI authentication failure */
|
|
16
|
-
AUTH_FAILURE = "AUTH_FAILURE",
|
|
17
|
-
/** Network connectivity error during API call */
|
|
18
|
-
NETWORK_ERROR = "NETWORK_ERROR",
|
|
19
|
-
/** Issue creation failed for an unspecified reason */
|
|
20
|
-
CREATE_FAILED = "CREATE_FAILED"
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Typed error for GitHub issue creation operations.
|
|
24
|
-
*/
|
|
25
|
-
export declare class GitHubIssueError extends Error {
|
|
26
|
-
readonly code: GitHubIssueErrorCode;
|
|
27
|
-
readonly cause?: Error | undefined;
|
|
28
|
-
constructor(message: string, code: GitHubIssueErrorCode, cause?: Error | undefined);
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Result of creating a GitHub issue.
|
|
32
|
-
*/
|
|
33
|
-
export interface GitHubIssueCreateResult {
|
|
34
|
-
/** URL of the created issue (e.g. "https://github.com/owner/repo/issues/42") */
|
|
35
|
-
url: string;
|
|
36
|
-
/** Issue number */
|
|
37
|
-
number: number;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Output port for GitHub issue creation.
|
|
41
|
-
*
|
|
42
|
-
* Implementations use the `gh` CLI for all GitHub interactions.
|
|
43
|
-
*/
|
|
44
|
-
export interface IGitHubIssueService {
|
|
45
|
-
/**
|
|
46
|
-
* Create a new issue on a GitHub repository.
|
|
47
|
-
*
|
|
48
|
-
* @param repo - Full owner/repo identifier (e.g. "shep-ai/cli")
|
|
49
|
-
* @param title - Issue title
|
|
50
|
-
* @param body - Issue body (Markdown)
|
|
51
|
-
* @param labels - Labels to apply to the issue (e.g. ["bug", "shep-doctor"])
|
|
52
|
-
* @returns The created issue's URL and number
|
|
53
|
-
* @throws {GitHubIssueError} with appropriate error code on failure
|
|
54
|
-
*/
|
|
55
|
-
createIssue(repo: string, title: string, body: string, labels: string[]): Promise<GitHubIssueCreateResult>;
|
|
56
|
-
}
|
|
57
|
-
//# sourceMappingURL=github-issue-service.interface.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"github-issue-service.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/github-issue-service.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH;;GAEG;AACH,oBAAY,oBAAoB;IAC9B,mEAAmE;IACnE,YAAY,iBAAiB;IAC7B,wCAAwC;IACxC,YAAY,iBAAiB;IAC7B,iDAAiD;IACjD,aAAa,kBAAkB;IAC/B,sDAAsD;IACtD,aAAa,kBAAkB;CAChC;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;aAGvB,IAAI,EAAE,oBAAoB;aAC1B,KAAK,CAAC,EAAE,KAAK;gBAF7B,OAAO,EAAE,MAAM,EACC,IAAI,EAAE,oBAAoB,EAC1B,KAAK,CAAC,EAAE,KAAK,YAAA;CAMhC;AAMD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAC;IACZ,mBAAmB;IACnB,MAAM,EAAE,MAAM,CAAC;CAChB;AAMD;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;;;;;;OASG;IACH,WAAW,CACT,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EAAE,GACf,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACrC"}
|
package/dist/packages/core/src/application/ports/output/services/github-issue-service.interface.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GitHub Issue Service Interface
|
|
3
|
-
*
|
|
4
|
-
* Output port for creating GitHub issues via the gh CLI.
|
|
5
|
-
* Implementations wrap `gh issue create` for issue creation on
|
|
6
|
-
* any GitHub repository. Separate from IExternalIssueFetcher which
|
|
7
|
-
* is a read-only fetcher — this service handles write operations.
|
|
8
|
-
*/
|
|
9
|
-
// ---------------------------------------------------------------------------
|
|
10
|
-
// Error types
|
|
11
|
-
// ---------------------------------------------------------------------------
|
|
12
|
-
/**
|
|
13
|
-
* Error codes for GitHub issue creation operations.
|
|
14
|
-
*/
|
|
15
|
-
export var GitHubIssueErrorCode;
|
|
16
|
-
(function (GitHubIssueErrorCode) {
|
|
17
|
-
/** The target repository was not found or the user lacks access */
|
|
18
|
-
GitHubIssueErrorCode["GH_NOT_FOUND"] = "GH_NOT_FOUND";
|
|
19
|
-
/** GitHub CLI authentication failure */
|
|
20
|
-
GitHubIssueErrorCode["AUTH_FAILURE"] = "AUTH_FAILURE";
|
|
21
|
-
/** Network connectivity error during API call */
|
|
22
|
-
GitHubIssueErrorCode["NETWORK_ERROR"] = "NETWORK_ERROR";
|
|
23
|
-
/** Issue creation failed for an unspecified reason */
|
|
24
|
-
GitHubIssueErrorCode["CREATE_FAILED"] = "CREATE_FAILED";
|
|
25
|
-
})(GitHubIssueErrorCode || (GitHubIssueErrorCode = {}));
|
|
26
|
-
/**
|
|
27
|
-
* Typed error for GitHub issue creation operations.
|
|
28
|
-
*/
|
|
29
|
-
export class GitHubIssueError extends Error {
|
|
30
|
-
code;
|
|
31
|
-
cause;
|
|
32
|
-
constructor(message, code, cause) {
|
|
33
|
-
super(message);
|
|
34
|
-
this.code = code;
|
|
35
|
-
this.cause = cause;
|
|
36
|
-
this.name = 'GitHubIssueError';
|
|
37
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Doctor Diagnose Use Case
|
|
3
|
-
*
|
|
4
|
-
* Orchestrates the shep doctor workflow:
|
|
5
|
-
* 1. Collect diagnostic context (failed agent runs, version, system info)
|
|
6
|
-
* 2. Create a structured GitHub issue on shep-ai/cli
|
|
7
|
-
* 3. Optionally attempt a fix via AI agent
|
|
8
|
-
* 4. Open a PR with the fix (direct push for maintainers, fork for contributors)
|
|
9
|
-
*
|
|
10
|
-
* Following Clean Architecture: all external operations are injected via interfaces.
|
|
11
|
-
*/
|
|
12
|
-
import type { IAgentRunRepository } from '../../ports/output/agents/agent-run-repository.interface.js';
|
|
13
|
-
import type { IVersionService } from '../../ports/output/services/version-service.interface.js';
|
|
14
|
-
import type { IGitHubIssueService } from '../../ports/output/services/github-issue-service.interface.js';
|
|
15
|
-
import type { IGitHubRepositoryService } from '../../ports/output/services/github-repository-service.interface.js';
|
|
16
|
-
import type { IGitPrService } from '../../ports/output/services/git-pr-service.interface.js';
|
|
17
|
-
import type { IAgentExecutorProvider } from '../../ports/output/agents/agent-executor-provider.interface.js';
|
|
18
|
-
import type { IFeatureRepository } from '../../ports/output/repositories/feature-repository.interface.js';
|
|
19
|
-
import type { ExecFunction } from '../../../infrastructure/services/git/worktree.service.js';
|
|
20
|
-
import type { DoctorDiagnosticReport } from '../../../domain/generated/output.js';
|
|
21
|
-
export interface DoctorDiagnoseInput {
|
|
22
|
-
description: string;
|
|
23
|
-
fix: boolean;
|
|
24
|
-
workdir?: string;
|
|
25
|
-
featureId?: string;
|
|
26
|
-
}
|
|
27
|
-
export interface DoctorDiagnoseResult {
|
|
28
|
-
diagnosticReport: DoctorDiagnosticReport;
|
|
29
|
-
issueUrl: string;
|
|
30
|
-
issueNumber: number;
|
|
31
|
-
prUrl?: string;
|
|
32
|
-
flowType?: 'maintainer' | 'contributor';
|
|
33
|
-
error?: string;
|
|
34
|
-
cleanedUp: boolean;
|
|
35
|
-
}
|
|
36
|
-
export declare class DoctorDiagnoseUseCase {
|
|
37
|
-
private readonly agentRunRepo;
|
|
38
|
-
private readonly versionService;
|
|
39
|
-
private readonly issueService;
|
|
40
|
-
private readonly repoService;
|
|
41
|
-
private readonly prService;
|
|
42
|
-
private readonly agentExecutorProvider;
|
|
43
|
-
private readonly execFile;
|
|
44
|
-
private readonly featureRepo;
|
|
45
|
-
constructor(agentRunRepo: IAgentRunRepository, versionService: IVersionService, issueService: IGitHubIssueService, repoService: IGitHubRepositoryService, prService: IGitPrService, agentExecutorProvider: IAgentExecutorProvider, execFile: ExecFunction, featureRepo: IFeatureRepository);
|
|
46
|
-
execute(input: DoctorDiagnoseInput): Promise<DoctorDiagnoseResult>;
|
|
47
|
-
private collectDiagnostics;
|
|
48
|
-
private collectFailedRuns;
|
|
49
|
-
private sanitizeRunSummary;
|
|
50
|
-
private collectSystemInfo;
|
|
51
|
-
private formatIssueTitle;
|
|
52
|
-
private formatIssueBody;
|
|
53
|
-
private attemptFix;
|
|
54
|
-
private buildFixPrompt;
|
|
55
|
-
}
|
|
56
|
-
//# sourceMappingURL=doctor-diagnose.use-case.d.ts.map
|
package/dist/packages/core/src/application/use-cases/doctor/doctor-diagnose.use-case.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"doctor-diagnose.use-case.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/application/use-cases/doctor/doctor-diagnose.use-case.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6DAA6D,CAAC;AACvG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,0DAA0D,CAAC;AAChG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+DAA+D,CAAC;AACzG,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oEAAoE,CAAC;AACnH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yDAAyD,CAAC;AAC7F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gEAAgE,CAAC;AAC7G,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iEAAiE,CAAC;AAC1G,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0DAA0D,CAAC;AAC7F,OAAO,KAAK,EACV,sBAAsB,EAIvB,MAAM,qCAAqC,CAAC;AAO7C,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,OAAO,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,gBAAgB,EAAE,sBAAsB,CAAC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,YAAY,GAAG,aAAa,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;CACpB;AAcD,qBACa,qBAAqB;IAG9B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAE7B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAE/B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAE7B,OAAO,CAAC,QAAQ,CAAC,WAAW;IAE5B,OAAO,CAAC,QAAQ,CAAC,SAAS;IAE1B,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IAEtC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAEzB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBAdX,YAAY,EAAE,mBAAmB,EAEjC,cAAc,EAAE,eAAe,EAE/B,YAAY,EAAE,mBAAmB,EAEjC,WAAW,EAAE,wBAAwB,EAErC,SAAS,EAAE,aAAa,EAExB,qBAAqB,EAAE,sBAAsB,EAE7C,QAAQ,EAAE,YAAY,EAEtB,WAAW,EAAE,kBAAkB;IAG5C,OAAO,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,oBAAoB,CAAC;YAgC1D,kBAAkB;YAiClB,iBAAiB;IAa/B,OAAO,CAAC,kBAAkB;YAUZ,iBAAiB;IAqB/B,OAAO,CAAC,gBAAgB;IAMxB,OAAO,CAAC,eAAe;YA2CT,UAAU;IA8FxB,OAAO,CAAC,cAAc;CAyBvB"}
|
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Doctor Diagnose Use Case
|
|
3
|
-
*
|
|
4
|
-
* Orchestrates the shep doctor workflow:
|
|
5
|
-
* 1. Collect diagnostic context (failed agent runs, version, system info)
|
|
6
|
-
* 2. Create a structured GitHub issue on shep-ai/cli
|
|
7
|
-
* 3. Optionally attempt a fix via AI agent
|
|
8
|
-
* 4. Open a PR with the fix (direct push for maintainers, fork for contributors)
|
|
9
|
-
*
|
|
10
|
-
* Following Clean Architecture: all external operations are injected via interfaces.
|
|
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 { randomUUID } from 'node:crypto';
|
|
26
|
-
import { tmpdir } from 'node:os';
|
|
27
|
-
import { mkdir, rm } from 'node:fs/promises';
|
|
28
|
-
import path from 'node:path';
|
|
29
|
-
import { AgentRunStatus } from '../../../domain/generated/output.js';
|
|
30
|
-
// ---------------------------------------------------------------------------
|
|
31
|
-
// Constants
|
|
32
|
-
// ---------------------------------------------------------------------------
|
|
33
|
-
const SHEP_REPO = 'shep-ai/cli';
|
|
34
|
-
const MAX_FAILED_RUNS = 10;
|
|
35
|
-
const ISSUE_LABELS = ['bug', 'shep-doctor'];
|
|
36
|
-
// ---------------------------------------------------------------------------
|
|
37
|
-
// Use Case
|
|
38
|
-
// ---------------------------------------------------------------------------
|
|
39
|
-
let DoctorDiagnoseUseCase = class DoctorDiagnoseUseCase {
|
|
40
|
-
agentRunRepo;
|
|
41
|
-
versionService;
|
|
42
|
-
issueService;
|
|
43
|
-
repoService;
|
|
44
|
-
prService;
|
|
45
|
-
agentExecutorProvider;
|
|
46
|
-
execFile;
|
|
47
|
-
featureRepo;
|
|
48
|
-
constructor(agentRunRepo, versionService, issueService, repoService, prService, agentExecutorProvider, execFile, featureRepo) {
|
|
49
|
-
this.agentRunRepo = agentRunRepo;
|
|
50
|
-
this.versionService = versionService;
|
|
51
|
-
this.issueService = issueService;
|
|
52
|
-
this.repoService = repoService;
|
|
53
|
-
this.prService = prService;
|
|
54
|
-
this.agentExecutorProvider = agentExecutorProvider;
|
|
55
|
-
this.execFile = execFile;
|
|
56
|
-
this.featureRepo = featureRepo;
|
|
57
|
-
}
|
|
58
|
-
async execute(input) {
|
|
59
|
-
// Step 1: Collect diagnostics
|
|
60
|
-
const diagnosticReport = await this.collectDiagnostics(input.description, input.featureId);
|
|
61
|
-
// Step 2: Create GitHub issue
|
|
62
|
-
const issueTitle = this.formatIssueTitle(input.description);
|
|
63
|
-
const issueBody = this.formatIssueBody(diagnosticReport);
|
|
64
|
-
const { url: issueUrl, number: issueNumber } = await this.issueService.createIssue(SHEP_REPO, issueTitle, issueBody, ISSUE_LABELS);
|
|
65
|
-
// Step 3: If no fix requested, return early
|
|
66
|
-
if (!input.fix) {
|
|
67
|
-
return {
|
|
68
|
-
diagnosticReport,
|
|
69
|
-
issueUrl,
|
|
70
|
-
issueNumber,
|
|
71
|
-
cleanedUp: false,
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
// Step 4: Attempt fix
|
|
75
|
-
return this.attemptFix(input, diagnosticReport, issueUrl, issueNumber);
|
|
76
|
-
}
|
|
77
|
-
// -------------------------------------------------------------------------
|
|
78
|
-
// Diagnostic Collection (Task 10)
|
|
79
|
-
// -------------------------------------------------------------------------
|
|
80
|
-
async collectDiagnostics(userDescription, featureId) {
|
|
81
|
-
// Resolve feature context if featureId is provided
|
|
82
|
-
let resolvedFeatureId;
|
|
83
|
-
let featureName;
|
|
84
|
-
if (featureId) {
|
|
85
|
-
const feature = (await this.featureRepo.findById(featureId)) ??
|
|
86
|
-
(await this.featureRepo.findByIdPrefix(featureId));
|
|
87
|
-
if (feature) {
|
|
88
|
-
resolvedFeatureId = feature.id;
|
|
89
|
-
featureName = feature.name;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
const [failedRunSummaries, systemInfo, cliVersion] = await Promise.all([
|
|
93
|
-
this.collectFailedRuns(resolvedFeatureId),
|
|
94
|
-
this.collectSystemInfo(),
|
|
95
|
-
Promise.resolve(this.versionService.getVersion().version),
|
|
96
|
-
]);
|
|
97
|
-
return {
|
|
98
|
-
userDescription,
|
|
99
|
-
failedRunSummaries,
|
|
100
|
-
systemInfo,
|
|
101
|
-
cliVersion,
|
|
102
|
-
featureId: resolvedFeatureId,
|
|
103
|
-
featureName,
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
async collectFailedRuns(featureId) {
|
|
107
|
-
const allRuns = await this.agentRunRepo.list();
|
|
108
|
-
let filtered = allRuns.filter((run) => run.status === AgentRunStatus.failed);
|
|
109
|
-
// When a feature ID is provided, scope to runs associated with that feature
|
|
110
|
-
if (featureId) {
|
|
111
|
-
filtered = filtered.filter((run) => run.featureId === featureId);
|
|
112
|
-
}
|
|
113
|
-
return filtered.slice(0, MAX_FAILED_RUNS).map((run) => this.sanitizeRunSummary(run));
|
|
114
|
-
}
|
|
115
|
-
sanitizeRunSummary(run) {
|
|
116
|
-
return {
|
|
117
|
-
agentType: run.agentType,
|
|
118
|
-
agentName: run.agentName,
|
|
119
|
-
error: run.error ?? 'Unknown error',
|
|
120
|
-
timestamp: run.createdAt instanceof Date ? run.createdAt.toISOString() : String(run.createdAt),
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
async collectSystemInfo() {
|
|
124
|
-
let ghVersion = 'unknown';
|
|
125
|
-
try {
|
|
126
|
-
const { stdout } = await this.execFile('gh', ['--version']);
|
|
127
|
-
ghVersion = stdout.trim();
|
|
128
|
-
}
|
|
129
|
-
catch {
|
|
130
|
-
// gh not installed or not available — use fallback
|
|
131
|
-
}
|
|
132
|
-
return {
|
|
133
|
-
nodeVersion: process.version,
|
|
134
|
-
platform: process.platform,
|
|
135
|
-
arch: process.arch,
|
|
136
|
-
ghVersion,
|
|
137
|
-
};
|
|
138
|
-
}
|
|
139
|
-
// -------------------------------------------------------------------------
|
|
140
|
-
// Issue Formatting (Task 11)
|
|
141
|
-
// -------------------------------------------------------------------------
|
|
142
|
-
formatIssueTitle(description) {
|
|
143
|
-
const firstLine = description.split('\n')[0].trim();
|
|
144
|
-
const truncated = firstLine.length > 60 ? `${firstLine.slice(0, 60)}...` : firstLine;
|
|
145
|
-
return `[shep doctor] ${truncated}`;
|
|
146
|
-
}
|
|
147
|
-
formatIssueBody(report) {
|
|
148
|
-
const sections = [];
|
|
149
|
-
sections.push('## Problem Description\n');
|
|
150
|
-
sections.push(report.userDescription);
|
|
151
|
-
if (report.featureId) {
|
|
152
|
-
sections.push('\n## Feature Context\n');
|
|
153
|
-
sections.push(`- **Feature ID:** ${report.featureId}`);
|
|
154
|
-
if (report.featureName) {
|
|
155
|
-
sections.push(`- **Feature Name:** ${report.featureName}`);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
sections.push('\n## Environment\n');
|
|
159
|
-
sections.push(`- **shep CLI version:** ${report.cliVersion}`);
|
|
160
|
-
sections.push(`- **Node.js:** ${report.systemInfo.nodeVersion}`);
|
|
161
|
-
sections.push(`- **Platform:** ${report.systemInfo.platform} (${report.systemInfo.arch})`);
|
|
162
|
-
sections.push(`- **gh CLI:** ${report.systemInfo.ghVersion}`);
|
|
163
|
-
if (report.failedRunSummaries.length > 0) {
|
|
164
|
-
const heading = report.featureId
|
|
165
|
-
? '\n## Failed Agent Runs (feature-scoped)\n'
|
|
166
|
-
: '\n## Recent Failed Agent Runs\n';
|
|
167
|
-
sections.push(heading);
|
|
168
|
-
for (const run of report.failedRunSummaries) {
|
|
169
|
-
sections.push(`### ${run.agentName} (${run.agentType})`);
|
|
170
|
-
sections.push(`- **Error:** ${run.error}`);
|
|
171
|
-
sections.push(`- **Timestamp:** ${run.timestamp}`);
|
|
172
|
-
sections.push('');
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
sections.push('\n---\n');
|
|
176
|
-
sections.push('_Reported via `shep doctor`_');
|
|
177
|
-
return sections.join('\n');
|
|
178
|
-
}
|
|
179
|
-
// -------------------------------------------------------------------------
|
|
180
|
-
// Fix Workflow (Task 11)
|
|
181
|
-
// -------------------------------------------------------------------------
|
|
182
|
-
async attemptFix(input, diagnosticReport, issueUrl, issueNumber) {
|
|
183
|
-
const isUserWorkdir = !!input.workdir;
|
|
184
|
-
const workdir = input.workdir ?? path.join(tmpdir(), `shep-doctor-${randomUUID()}`);
|
|
185
|
-
// Use a mutable result object so finally block can update cleanedUp
|
|
186
|
-
const result = {
|
|
187
|
-
diagnosticReport,
|
|
188
|
-
issueUrl,
|
|
189
|
-
issueNumber,
|
|
190
|
-
cleanedUp: false,
|
|
191
|
-
};
|
|
192
|
-
try {
|
|
193
|
-
// Ensure working directory exists
|
|
194
|
-
await mkdir(workdir, { recursive: true });
|
|
195
|
-
// Check push access (fall back to contributor flow on error)
|
|
196
|
-
let hasPushAccess = false;
|
|
197
|
-
try {
|
|
198
|
-
hasPushAccess = await this.repoService.checkPushAccess(SHEP_REPO);
|
|
199
|
-
}
|
|
200
|
-
catch {
|
|
201
|
-
// NFR-9: fall back to fork path on any detection failure
|
|
202
|
-
}
|
|
203
|
-
const flowType = hasPushAccess ? 'maintainer' : 'contributor';
|
|
204
|
-
result.flowType = flowType;
|
|
205
|
-
// Clone repository (direct or via fork)
|
|
206
|
-
let repoToClone = SHEP_REPO;
|
|
207
|
-
if (flowType === 'contributor') {
|
|
208
|
-
const { nameWithOwner } = await this.repoService.forkRepository(SHEP_REPO);
|
|
209
|
-
repoToClone = nameWithOwner;
|
|
210
|
-
}
|
|
211
|
-
await this.repoService.cloneRepository(repoToClone, workdir, undefined);
|
|
212
|
-
// Create fix branch
|
|
213
|
-
const branchName = `doctor/fix-${issueNumber}`;
|
|
214
|
-
await this.execFile('git', ['checkout', '-b', branchName], {
|
|
215
|
-
cwd: workdir,
|
|
216
|
-
});
|
|
217
|
-
// Invoke AI agent
|
|
218
|
-
try {
|
|
219
|
-
const executor = await this.agentExecutorProvider.getExecutor();
|
|
220
|
-
const prompt = this.buildFixPrompt(diagnosticReport, issueNumber);
|
|
221
|
-
await executor.execute(prompt, { cwd: workdir });
|
|
222
|
-
}
|
|
223
|
-
catch (agentError) {
|
|
224
|
-
result.error = `Fix attempt failed: ${agentError.message}`;
|
|
225
|
-
return result;
|
|
226
|
-
}
|
|
227
|
-
// Check if agent produced changes
|
|
228
|
-
const hasChanges = await this.prService.hasUncommittedChanges(workdir);
|
|
229
|
-
if (!hasChanges) {
|
|
230
|
-
result.error = 'Fix attempt produced no changes';
|
|
231
|
-
return result;
|
|
232
|
-
}
|
|
233
|
-
// Commit, push, and create PR
|
|
234
|
-
await this.prService.commitAll(workdir, `fix: address issue #${issueNumber} reported via shep doctor`);
|
|
235
|
-
await this.prService.push(workdir, branchName, true);
|
|
236
|
-
const prResult = await this.prService.createPrFromArgs(workdir, {
|
|
237
|
-
title: `fix: address shep doctor issue #${issueNumber}`,
|
|
238
|
-
body: `## Summary\n\nAutomated fix attempt for #${issueNumber}.\n\nThis PR was created by \`shep doctor\` after diagnosing a reported issue.\n\nRelates to #${issueNumber}`,
|
|
239
|
-
labels: ['shep-doctor'],
|
|
240
|
-
base: 'main',
|
|
241
|
-
repo: flowType === 'contributor' ? SHEP_REPO : undefined,
|
|
242
|
-
});
|
|
243
|
-
result.prUrl = prResult.url;
|
|
244
|
-
return result;
|
|
245
|
-
}
|
|
246
|
-
finally {
|
|
247
|
-
// Cleanup temp directory (unless user specified --workdir)
|
|
248
|
-
if (!isUserWorkdir) {
|
|
249
|
-
try {
|
|
250
|
-
await rm(workdir, { recursive: true, force: true });
|
|
251
|
-
result.cleanedUp = true;
|
|
252
|
-
}
|
|
253
|
-
catch {
|
|
254
|
-
// Best-effort cleanup
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
buildFixPrompt(report, issueNumber) {
|
|
260
|
-
const lines = [];
|
|
261
|
-
lines.push(`You are fixing issue #${issueNumber} in the shep-ai/cli codebase.`);
|
|
262
|
-
lines.push('');
|
|
263
|
-
lines.push('## Problem Description');
|
|
264
|
-
lines.push(report.userDescription);
|
|
265
|
-
lines.push('');
|
|
266
|
-
if (report.failedRunSummaries.length > 0) {
|
|
267
|
-
lines.push('## Error Context');
|
|
268
|
-
for (const run of report.failedRunSummaries) {
|
|
269
|
-
lines.push(`- Agent: ${run.agentName} (${run.agentType})`);
|
|
270
|
-
lines.push(` Error: ${run.error}`);
|
|
271
|
-
}
|
|
272
|
-
lines.push('');
|
|
273
|
-
}
|
|
274
|
-
lines.push('## Instructions');
|
|
275
|
-
lines.push('1. Analyze the codebase to identify the root cause');
|
|
276
|
-
lines.push('2. Implement a fix for the identified issue');
|
|
277
|
-
lines.push('3. Run tests to verify the fix works');
|
|
278
|
-
lines.push('4. Keep changes minimal and focused');
|
|
279
|
-
return lines.join('\n');
|
|
280
|
-
}
|
|
281
|
-
};
|
|
282
|
-
DoctorDiagnoseUseCase = __decorate([
|
|
283
|
-
injectable(),
|
|
284
|
-
__param(0, inject('IAgentRunRepository')),
|
|
285
|
-
__param(1, inject('IVersionService')),
|
|
286
|
-
__param(2, inject('IGitHubIssueService')),
|
|
287
|
-
__param(3, inject('IGitHubRepositoryService')),
|
|
288
|
-
__param(4, inject('IGitPrService')),
|
|
289
|
-
__param(5, inject('IAgentExecutorProvider')),
|
|
290
|
-
__param(6, inject('ExecFunction')),
|
|
291
|
-
__param(7, inject('IFeatureRepository')),
|
|
292
|
-
__metadata("design:paramtypes", [Object, Object, Object, Object, Object, Object, Function, Object])
|
|
293
|
-
], DoctorDiagnoseUseCase);
|
|
294
|
-
export { DoctorDiagnoseUseCase };
|
package/dist/packages/core/src/infrastructure/services/external/github-issue-creator.service.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GitHub Issue Creator Service Implementation
|
|
3
|
-
*
|
|
4
|
-
* Implements IGitHubIssueService using the gh CLI for creating issues
|
|
5
|
-
* on GitHub repositories. Wraps `gh issue create` with structured
|
|
6
|
-
* error handling and result parsing.
|
|
7
|
-
*/
|
|
8
|
-
import type { ExecFunction } from '../git/worktree.service.js';
|
|
9
|
-
import type { IGitHubIssueService, GitHubIssueCreateResult } from '../../../application/ports/output/services/github-issue-service.interface.js';
|
|
10
|
-
export declare class GitHubIssueCreatorService implements IGitHubIssueService {
|
|
11
|
-
private readonly execFile;
|
|
12
|
-
constructor(execFile: ExecFunction);
|
|
13
|
-
createIssue(repo: string, title: string, body: string, labels: string[]): Promise<GitHubIssueCreateResult>;
|
|
14
|
-
private parseIssueNumberFromUrl;
|
|
15
|
-
private mapError;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=github-issue-creator.service.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"github-issue-creator.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/external/github-issue-creator.service.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,KAAK,EACV,mBAAmB,EACnB,uBAAuB,EACxB,MAAM,8EAA8E,CAAC;AAMtF,qBACa,yBAA0B,YAAW,mBAAmB;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,YAAY;IAErE,WAAW,CACf,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EAAE,GACf,OAAO,CAAC,uBAAuB,CAAC;IAkBnC,OAAO,CAAC,uBAAuB;IAK/B,OAAO,CAAC,QAAQ;CAuCjB"}
|
package/dist/packages/core/src/infrastructure/services/external/github-issue-creator.service.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GitHub Issue Creator Service Implementation
|
|
3
|
-
*
|
|
4
|
-
* Implements IGitHubIssueService using the gh CLI for creating issues
|
|
5
|
-
* on GitHub repositories. Wraps `gh issue create` with structured
|
|
6
|
-
* error handling and result parsing.
|
|
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 { GitHubIssueError, GitHubIssueErrorCode, } from '../../../application/ports/output/services/github-issue-service.interface.js';
|
|
22
|
-
let GitHubIssueCreatorService = class GitHubIssueCreatorService {
|
|
23
|
-
execFile;
|
|
24
|
-
constructor(execFile) {
|
|
25
|
-
this.execFile = execFile;
|
|
26
|
-
}
|
|
27
|
-
async createIssue(repo, title, body, labels) {
|
|
28
|
-
const args = ['issue', 'create', '--repo', repo, '--title', title, '--body', body];
|
|
29
|
-
for (const label of labels) {
|
|
30
|
-
args.push('--label', label);
|
|
31
|
-
}
|
|
32
|
-
try {
|
|
33
|
-
const { stdout } = await this.execFile('gh', args);
|
|
34
|
-
const url = stdout.trim();
|
|
35
|
-
const number = this.parseIssueNumberFromUrl(url);
|
|
36
|
-
return { url, number };
|
|
37
|
-
}
|
|
38
|
-
catch (error) {
|
|
39
|
-
throw this.mapError(error);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
parseIssueNumberFromUrl(url) {
|
|
43
|
-
const match = url.match(/\/issues\/(\d+)/);
|
|
44
|
-
return match ? parseInt(match[1], 10) : 0;
|
|
45
|
-
}
|
|
46
|
-
mapError(error) {
|
|
47
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
48
|
-
const cause = error instanceof Error ? error : undefined;
|
|
49
|
-
const errnoCode = error?.code;
|
|
50
|
-
if (errnoCode === 'ENOENT' || message.includes('ENOENT')) {
|
|
51
|
-
return new GitHubIssueError('GitHub CLI (gh) is not installed. Install it from https://cli.github.com/', GitHubIssueErrorCode.GH_NOT_FOUND, cause);
|
|
52
|
-
}
|
|
53
|
-
if (message.includes('auth') || message.includes('Authentication') || message.includes('403')) {
|
|
54
|
-
return new GitHubIssueError('GitHub CLI is not authenticated. Run `gh auth login` to sign in.', GitHubIssueErrorCode.AUTH_FAILURE, cause);
|
|
55
|
-
}
|
|
56
|
-
if (message.includes('network') ||
|
|
57
|
-
message.includes('ECONNREFUSED') ||
|
|
58
|
-
message.includes('ETIMEDOUT')) {
|
|
59
|
-
return new GitHubIssueError(`Network error creating issue: ${message}`, GitHubIssueErrorCode.NETWORK_ERROR, cause);
|
|
60
|
-
}
|
|
61
|
-
return new GitHubIssueError(`Failed to create issue on ${message}`, GitHubIssueErrorCode.CREATE_FAILED, cause);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
GitHubIssueCreatorService = __decorate([
|
|
65
|
-
injectable(),
|
|
66
|
-
__param(0, inject('ExecFunction')),
|
|
67
|
-
__metadata("design:paramtypes", [Function])
|
|
68
|
-
], GitHubIssueCreatorService);
|
|
69
|
-
export { GitHubIssueCreatorService };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Doctor Command
|
|
3
|
-
*
|
|
4
|
-
* Diagnoses shep operation failures, opens a GitHub issue on shep-ai/cli,
|
|
5
|
-
* and optionally invokes an AI agent to attempt a fix and open a PR.
|
|
6
|
-
*
|
|
7
|
-
* Usage: shep doctor [description] [options]
|
|
8
|
-
*
|
|
9
|
-
* @example
|
|
10
|
-
* $ shep doctor "agent crashed during planning"
|
|
11
|
-
* $ shep doctor --fix
|
|
12
|
-
* $ shep doctor --no-fix
|
|
13
|
-
* $ shep doctor "broken workflow" --fix --workdir /tmp/my-fix
|
|
14
|
-
*/
|
|
15
|
-
import { Command } from 'commander';
|
|
16
|
-
/**
|
|
17
|
-
* Create the doctor command
|
|
18
|
-
*/
|
|
19
|
-
export declare function createDoctorCommand(): Command;
|
|
20
|
-
//# sourceMappingURL=doctor.command.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"doctor.command.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/commands/doctor.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAapC;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAgF7C"}
|