@shepai/cli 1.135.1 → 1.135.2-pr438.e15badd

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.
Files changed (192) hide show
  1. package/apis/json-schema/DoctorDiagnosticReport.yaml +24 -0
  2. package/apis/json-schema/FailedRunSummary.yaml +22 -0
  3. package/apis/json-schema/SystemInfo.yaml +22 -0
  4. package/apis/json-schema/WorkflowConfig.yaml +5 -0
  5. package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts +28 -0
  6. package/dist/packages/core/src/application/ports/output/services/git-pr-service.interface.d.ts.map +1 -1
  7. package/dist/packages/core/src/application/ports/output/services/github-issue-service.interface.d.ts +57 -0
  8. package/dist/packages/core/src/application/ports/output/services/github-issue-service.interface.d.ts.map +1 -0
  9. package/dist/packages/core/src/application/ports/output/services/github-issue-service.interface.js +39 -0
  10. package/dist/packages/core/src/application/ports/output/services/github-repository-service.interface.d.ts +37 -0
  11. package/dist/packages/core/src/application/ports/output/services/github-repository-service.interface.d.ts.map +1 -1
  12. package/dist/packages/core/src/application/ports/output/services/github-repository-service.interface.js +12 -0
  13. package/dist/packages/core/src/application/ports/output/services/index.d.ts +5 -3
  14. package/dist/packages/core/src/application/ports/output/services/index.d.ts.map +1 -1
  15. package/dist/packages/core/src/application/ports/output/services/index.js +2 -1
  16. package/dist/packages/core/src/application/use-cases/doctor/doctor-diagnose.use-case.d.ts +53 -0
  17. package/dist/packages/core/src/application/use-cases/doctor/doctor-diagnose.use-case.d.ts.map +1 -0
  18. package/dist/packages/core/src/application/use-cases/doctor/doctor-diagnose.use-case.js +266 -0
  19. package/dist/packages/core/src/domain/generated/output.d.ts +67 -0
  20. package/dist/packages/core/src/domain/generated/output.d.ts.map +1 -1
  21. package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
  22. package/dist/packages/core/src/infrastructure/di/container.js +4 -0
  23. package/dist/packages/core/src/infrastructure/services/external/github-issue-creator.service.d.ts +17 -0
  24. package/dist/packages/core/src/infrastructure/services/external/github-issue-creator.service.d.ts.map +1 -0
  25. package/dist/packages/core/src/infrastructure/services/external/github-issue-creator.service.js +69 -0
  26. package/dist/packages/core/src/infrastructure/services/external/github-repository.service.d.ts +3 -1
  27. package/dist/packages/core/src/infrastructure/services/external/github-repository.service.d.ts.map +1 -1
  28. package/dist/packages/core/src/infrastructure/services/external/github-repository.service.js +37 -1
  29. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts +2 -1
  30. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.d.ts.map +1 -1
  31. package/dist/packages/core/src/infrastructure/services/git/git-pr.service.js +21 -0
  32. package/dist/src/presentation/cli/commands/doctor.command.d.ts +20 -0
  33. package/dist/src/presentation/cli/commands/doctor.command.d.ts.map +1 -0
  34. package/dist/src/presentation/cli/commands/doctor.command.js +127 -0
  35. package/dist/src/presentation/cli/index.js +2 -0
  36. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.d.ts.map +1 -1
  37. package/dist/src/presentation/web/components/common/control-center-drawer/feature-drawer-client.js +3 -2
  38. package/dist/tsconfig.build.tsbuildinfo +1 -1
  39. package/package.json +1 -1
  40. package/web/.next/BUILD_ID +1 -1
  41. package/web/.next/build-manifest.json +2 -2
  42. package/web/.next/fallback-build-manifest.json +2 -2
  43. package/web/.next/prerender-manifest.json +3 -3
  44. package/web/.next/required-server-files.js +3 -3
  45. package/web/.next/required-server-files.json +3 -3
  46. package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +24 -24
  47. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js +1 -1
  48. package/web/.next/server/app/(dashboard)/@drawer/adopt/page.js.nft.json +1 -1
  49. package/web/.next/server/app/(dashboard)/@drawer/adopt/page_client-reference-manifest.js +1 -1
  50. package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +24 -24
  51. package/web/.next/server/app/(dashboard)/@drawer/create/page.js +1 -1
  52. package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
  53. package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
  54. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +30 -30
  55. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +1 -1
  56. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  57. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  58. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +30 -30
  59. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +1 -1
  60. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
  61. package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
  62. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +22 -22
  63. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +1 -1
  64. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
  65. package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  66. package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +24 -24
  67. package/web/.next/server/app/(dashboard)/create/page.js +1 -1
  68. package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
  69. package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
  70. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +30 -30
  71. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +1 -1
  72. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
  73. package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
  74. package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +30 -30
  75. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +1 -1
  76. package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
  77. package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
  78. package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +22 -22
  79. package/web/.next/server/app/(dashboard)/page.js +1 -1
  80. package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
  81. package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
  82. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +22 -22
  83. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +1 -1
  84. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
  85. package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
  86. package/web/.next/server/app/_global-error.html +2 -2
  87. package/web/.next/server/app/_global-error.rsc +1 -1
  88. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  89. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  90. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  91. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  92. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  93. package/web/.next/server/app/_not-found/page/server-reference-manifest.json +3 -3
  94. package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  95. package/web/.next/server/app/settings/page/server-reference-manifest.json +8 -8
  96. package/web/.next/server/app/settings/page.js.nft.json +1 -1
  97. package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  98. package/web/.next/server/app/skills/page/server-reference-manifest.json +8 -8
  99. package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
  100. package/web/.next/server/app/tools/page/server-reference-manifest.json +8 -8
  101. package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
  102. package/web/.next/server/app/version/page/server-reference-manifest.json +3 -3
  103. package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
  104. package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
  105. package/web/.next/server/chunks/[root-of-the-server]__c6e32a23._.js.map +1 -1
  106. package/web/.next/server/chunks/[root-of-the-server]__cd67a84c._.js.map +1 -1
  107. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_4e741df2.js +1 -1
  108. package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_4e741df2.js.map +1 -1
  109. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
  110. package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
  111. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_026fdffa.js +1 -1
  112. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_026fdffa.js.map +1 -1
  113. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_8b91e197.js +1 -1
  114. package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_8b91e197.js.map +1 -1
  115. package/web/.next/server/chunks/ssr/[root-of-the-server]__31bc28da._.js +1 -1
  116. package/web/.next/server/chunks/ssr/[root-of-the-server]__31bc28da._.js.map +1 -1
  117. package/web/.next/server/chunks/ssr/[root-of-the-server]__32ecbed9._.js +1 -1
  118. package/web/.next/server/chunks/ssr/[root-of-the-server]__32ecbed9._.js.map +1 -1
  119. package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
  120. package/web/.next/server/chunks/ssr/[root-of-the-server]__3ef34e4c._.js +1 -1
  121. package/web/.next/server/chunks/ssr/[root-of-the-server]__3ef34e4c._.js.map +1 -1
  122. package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js +1 -1
  123. package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js.map +1 -1
  124. package/web/.next/server/chunks/ssr/[root-of-the-server]__7894f27f._.js +1 -1
  125. package/web/.next/server/chunks/ssr/[root-of-the-server]__7894f27f._.js.map +1 -1
  126. package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js +1 -1
  127. package/web/.next/server/chunks/ssr/[root-of-the-server]__815546bd._.js.map +1 -1
  128. package/web/.next/server/chunks/ssr/[root-of-the-server]__90ce4b6d._.js +1 -1
  129. package/web/.next/server/chunks/ssr/[root-of-the-server]__90ce4b6d._.js.map +1 -1
  130. package/web/.next/server/chunks/ssr/[root-of-the-server]__90f9ae71._.js +1 -1
  131. package/web/.next/server/chunks/ssr/[root-of-the-server]__90f9ae71._.js.map +1 -1
  132. package/web/.next/server/chunks/ssr/[root-of-the-server]__96670392._.js +2 -2
  133. package/web/.next/server/chunks/ssr/[root-of-the-server]__96670392._.js.map +1 -1
  134. package/web/.next/server/chunks/ssr/[root-of-the-server]__9c45d070._.js.map +1 -1
  135. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js +2 -2
  136. package/web/.next/server/chunks/ssr/[root-of-the-server]__aad040c0._.js.map +1 -1
  137. package/web/.next/server/chunks/ssr/_02ec1aea._.js +1 -1
  138. package/web/.next/server/chunks/ssr/_02ec1aea._.js.map +1 -1
  139. package/web/.next/server/chunks/ssr/{_b6960ca0._.js → _77083321._.js} +3 -3
  140. package/web/.next/server/chunks/ssr/_77083321._.js.map +1 -0
  141. package/web/.next/server/chunks/ssr/{_76c02473._.js → _77554d3d._.js} +2 -2
  142. package/web/.next/server/chunks/ssr/{_76c02473._.js.map → _77554d3d._.js.map} +1 -1
  143. package/web/.next/server/chunks/ssr/_7dca1882._.js +1 -1
  144. package/web/.next/server/chunks/ssr/_7dca1882._.js.map +1 -1
  145. package/web/.next/server/chunks/ssr/_a9f57758._.js +1 -1
  146. package/web/.next/server/chunks/ssr/_b5d75071._.js +3 -0
  147. package/web/.next/server/chunks/ssr/{_f4036c66._.js.map → _b5d75071._.js.map} +1 -1
  148. package/web/.next/server/chunks/ssr/_d4b20e29._.js.map +1 -1
  149. package/web/.next/server/chunks/ssr/_d8575088._.js +1 -1
  150. package/web/.next/server/chunks/ssr/_d8575088._.js.map +1 -1
  151. package/web/.next/server/chunks/ssr/_f39a1adb._.js +1 -1
  152. package/web/.next/server/chunks/ssr/_f39a1adb._.js.map +1 -1
  153. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js +1 -1
  154. package/web/.next/server/chunks/ssr/b1a17_presentation_web_components_features_settings_settings-page-client_tsx_6ed9d5f8._.js.map +1 -1
  155. package/web/.next/server/chunks/ssr/src_presentation_web_8e7fe0d1._.js +2 -2
  156. package/web/.next/server/chunks/ssr/src_presentation_web_8e7fe0d1._.js.map +1 -1
  157. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_ca051134.js +1 -1
  158. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_ca051134.js.map +1 -1
  159. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js +1 -1
  160. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js.map +1 -1
  161. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js +1 -1
  162. package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js.map +1 -1
  163. package/web/.next/server/chunks/ssr/src_presentation_web_b9023017._.js +2 -2
  164. package/web/.next/server/chunks/ssr/src_presentation_web_b9023017._.js.map +1 -1
  165. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js +1 -1
  166. package/web/.next/server/chunks/ssr/src_presentation_web_components_e599bb8c._.js.map +1 -1
  167. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js +1 -1
  168. package/web/.next/server/chunks/ssr/src_presentation_web_components_features_control-center_7ac3562e._.js.map +1 -1
  169. package/web/.next/server/chunks/ssr/{src_presentation_web_7f2bd8b5._.js → src_presentation_web_e1bde3d9._.js} +2 -2
  170. package/web/.next/server/chunks/ssr/{src_presentation_web_7f2bd8b5._.js.map → src_presentation_web_e1bde3d9._.js.map} +1 -1
  171. package/web/.next/server/pages/500.html +2 -2
  172. package/web/.next/server/server-reference-manifest.js +1 -1
  173. package/web/.next/server/server-reference-manifest.json +38 -38
  174. package/web/.next/static/chunks/{fc30f9f869b6d879.js → 2afbd8ea610fa167.js} +1 -1
  175. package/web/.next/static/chunks/{fbcce031d4f6a933.js → 2c9ac55a4fa44ac4.js} +2 -2
  176. package/web/.next/static/chunks/2f507a6530863471.js +2 -0
  177. package/web/.next/static/chunks/{2b2bcf845ca00af0.js → 34a56908d5760236.js} +1 -1
  178. package/web/.next/static/chunks/{4d4a06751c4a6dc5.js → 439da912fae0dfb5.js} +1 -1
  179. package/web/.next/static/chunks/{c4dc75f937edf746.js → 45b13708047590eb.js} +1 -1
  180. package/web/.next/static/chunks/{b6117e16e4642568.js → 5cc1898809217e44.js} +1 -1
  181. package/web/.next/static/chunks/{7c62d50a59d1296b.js → 844b1f46c44b62da.js} +1 -1
  182. package/web/.next/static/chunks/{7c858879658287c9.js → a7946b5a536614d8.js} +1 -1
  183. package/web/.next/static/chunks/{e804b8565e41d2d0.js → c1fe426c1186e317.js} +1 -1
  184. package/web/.next/static/chunks/{7ad0e3ee269e90ca.js → e3f1b9a2e8b3a0f8.js} +1 -1
  185. package/web/.next/static/chunks/ee3933e1eca61c86.js +1 -0
  186. package/web/.next/server/chunks/ssr/_b6960ca0._.js.map +0 -1
  187. package/web/.next/server/chunks/ssr/_f4036c66._.js +0 -3
  188. package/web/.next/static/chunks/56ce7ec52973f61f.js +0 -2
  189. package/web/.next/static/chunks/5dbecf32f1f3b9aa.js +0 -1
  190. /package/web/.next/static/{eTSgKFGuzFHv4FcGxc30f → hD6XLMKjNGlLX4l-q7_q6}/_buildManifest.js +0 -0
  191. /package/web/.next/static/{eTSgKFGuzFHv4FcGxc30f → hD6XLMKjNGlLX4l-q7_q6}/_clientMiddlewareManifest.json +0 -0
  192. /package/web/.next/static/{eTSgKFGuzFHv4FcGxc30f → hD6XLMKjNGlLX4l-q7_q6}/_ssgManifest.js +0 -0
@@ -20,7 +20,7 @@ import { injectable, inject } from 'tsyringe';
20
20
  import { resolve, normalize } from 'node:path';
21
21
  import { rm } from 'node:fs/promises';
22
22
  import { spawn } from 'node:child_process';
23
- import { GitHubAuthError, GitHubCloneError, GitHubRepoListError, GitHubUrlParseError, } from '../../../application/ports/output/services/github-repository-service.interface.js';
23
+ import { GitHubAuthError, GitHubCloneError, GitHubForkError, GitHubRepoListError, GitHubUrlParseError, } from '../../../application/ports/output/services/github-repository-service.interface.js';
24
24
  // ---------------------------------------------------------------------------
25
25
  // URL regex patterns
26
26
  // ---------------------------------------------------------------------------
@@ -154,6 +154,42 @@ let GitHubRepositoryService = class GitHubRepositoryService {
154
154
  'Supported formats: https://github.com/owner/repo, ' +
155
155
  'git@github.com:owner/repo.git, or owner/repo shorthand.');
156
156
  }
157
+ async checkPushAccess(repoNameWithOwner) {
158
+ try {
159
+ const { stdout } = await this.execFile('gh', [
160
+ 'api',
161
+ `repos/${repoNameWithOwner}`,
162
+ '--jq',
163
+ '.permissions.push',
164
+ ]);
165
+ return stdout.trim() === 'true';
166
+ }
167
+ catch {
168
+ // Safe fallback: assume no push access on any error (NFR-9)
169
+ return false;
170
+ }
171
+ }
172
+ async forkRepository(repoNameWithOwner) {
173
+ try {
174
+ const { stdout } = await this.execFile('gh', [
175
+ 'repo',
176
+ 'fork',
177
+ repoNameWithOwner,
178
+ '--clone=false',
179
+ '--json',
180
+ 'nameWithOwner,url',
181
+ ]);
182
+ const parsed = JSON.parse(stdout);
183
+ return {
184
+ nameWithOwner: parsed.nameWithOwner,
185
+ cloneUrl: parsed.url.endsWith('.git') ? parsed.url : `${parsed.url}.git`,
186
+ };
187
+ }
188
+ catch (error) {
189
+ const cause = error instanceof Error ? error : undefined;
190
+ throw new GitHubForkError(`Failed to fork ${repoNameWithOwner}: ${cause?.message ?? String(error)}`, cause);
191
+ }
192
+ }
157
193
  async cleanupPartialClone(destination) {
158
194
  try {
159
195
  await rm(destination, { recursive: true, force: true });
@@ -5,7 +5,7 @@
5
5
  * Uses constructor dependency injection for the command executor.
6
6
  */
7
7
  import type { IGitPrService } from '../../../application/ports/output/services/git-pr-service.interface.js';
8
- import type { CiStatusResult, DiffSummary, FileDiff, MergeStrategy, PrCreateResult, PrStatusInfo } from '../../../application/ports/output/services/git-pr-service.interface.js';
8
+ import type { CiStatusResult, DiffSummary, FileDiff, MergeStrategy, PrCreateArgs, PrCreateResult, PrStatusInfo } from '../../../application/ports/output/services/git-pr-service.interface.js';
9
9
  import type { ExecFunction } from './worktree.service.js';
10
10
  export declare class GitPrService implements IGitPrService {
11
11
  private readonly execFile;
@@ -18,6 +18,7 @@ export declare class GitPrService implements IGitPrService {
18
18
  commitAll(cwd: string, message: string): Promise<string>;
19
19
  push(cwd: string, branch: string, setUpstream?: boolean): Promise<void>;
20
20
  createPr(cwd: string, prYamlPath: string): Promise<PrCreateResult>;
21
+ createPrFromArgs(cwd: string, args: PrCreateArgs): Promise<PrCreateResult>;
21
22
  mergePr(cwd: string, prNumber: number, strategy?: MergeStrategy): Promise<void>;
22
23
  private getPrHeadBranch;
23
24
  localMergeSquash(cwd: string, featureBranch: string, baseBranch: string, commitMessage: string, hasRemote?: boolean): Promise<void>;
@@ -1 +1 @@
1
- {"version":3,"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OAGG;YACW,UAAU;IAmBlB,cAAc,CAClB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,WAAW,SAAS,GACnB,OAAO,CAAC,MAAM,CAAC;IAWlB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,oBAAoB;IAK5B,OAAO,CAAC,aAAa;CAiBtB"}
1
+ {"version":3,"file":"git-pr.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/git/git-pr.service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wEAAwE,CAAC;AAC5G,OAAO,KAAK,EACV,cAAc,EAGd,WAAW,EACX,QAAQ,EACR,aAAa,EACb,YAAY,EACZ,cAAc,EACd,YAAY,EACb,MAAM,wEAAwE,CAAC;AAUhF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,qBACa,YAAa,YAAW,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBAAR,QAAQ,EAAE,YAAY;IAErE,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKxC,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAgBjD,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAgF9C,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKnD,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKpD,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAA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AAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAaxE,OAAO,CAAC,gBAAgB;IAexB,OAAO,CAAC,aAAa;IAmFf,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAoCpD,kBAAkB,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC;IAc/E,WAAW,CACf,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,eAAe,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC,OAAO,CAAC;IA6CnB;;;OAGG;YACW,UAAU;IAmBlB,cAAc,CAClB,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,EACf,WAAW,SAAS,GACnB,OAAO,CAAC,MAAM,CAAC;IAWlB,OAAO,CAAC,WAAW;IAQnB,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,aAAa;IAcrB,OAAO,CAAC,YAAY;IAepB,OAAO,CAAC,oBAAoB;IAK5B,OAAO,CAAC,aAAa;CAiBtB"}
@@ -184,6 +184,27 @@ let GitPrService = class GitPrService {
184
184
  throw this.parseGhError(error);
185
185
  }
186
186
  }
187
+ async createPrFromArgs(cwd, args) {
188
+ try {
189
+ const ghArgs = ['pr', 'create', '--title', args.title, '--body', args.body];
190
+ if (args.base) {
191
+ ghArgs.push('--base', args.base);
192
+ }
193
+ if (args.labels?.length) {
194
+ ghArgs.push('--label', args.labels.join(','));
195
+ }
196
+ if (args.repo) {
197
+ ghArgs.push('--repo', args.repo);
198
+ }
199
+ const { stdout } = await this.execFile('gh', ghArgs, { cwd });
200
+ const url = stdout.trim();
201
+ const number = this.parsePrNumberFromUrl(url);
202
+ return { url, number };
203
+ }
204
+ catch (error) {
205
+ throw this.parseGhError(error);
206
+ }
207
+ }
187
208
  async mergePr(cwd, prNumber, strategy = 'squash') {
188
209
  try {
189
210
  await this.execFile('gh', ['pr', 'merge', String(prNumber), `--${strategy}`], {
@@ -0,0 +1,20 @@
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
@@ -0,0 +1 @@
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;AAYpC;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CA8E7C"}
@@ -0,0 +1,127 @@
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
+ import { container } from '../../../../packages/core/src/infrastructure/di/container.js';
17
+ import { DoctorDiagnoseUseCase } from '../../../../packages/core/src/application/use-cases/doctor/doctor-diagnose.use-case.js';
18
+ import { colors, messages, spinner } from '../ui/index.js';
19
+ /**
20
+ * Create the doctor command
21
+ */
22
+ export function createDoctorCommand() {
23
+ const cmd = new Command('doctor')
24
+ .description('Diagnose shep failures, open a GitHub issue, and optionally attempt a fix')
25
+ .argument('[description]', 'Problem description (prompted interactively if omitted)')
26
+ .option('--fix', 'Skip confirmation and attempt a fix automatically')
27
+ .option('--no-fix', 'Skip the fix attempt entirely (only create the issue)')
28
+ .action(async (description, options) => {
29
+ try {
30
+ // Step 1: Validate prerequisites
31
+ await validatePrerequisites();
32
+ // Step 2: Collect description (argument or interactive prompt)
33
+ const problemDescription = description ?? (await promptForDescription());
34
+ if (!problemDescription) {
35
+ messages.info('No description provided. Cancelled.');
36
+ return;
37
+ }
38
+ // Step 3: Determine fix behavior
39
+ const shouldFix = await resolveFix(options);
40
+ // Step 4: Run the use case
41
+ const useCase = container.resolve(DoctorDiagnoseUseCase);
42
+ messages.newline();
43
+ messages.info('Running shep doctor...');
44
+ messages.newline();
45
+ const result = await spinner('Collecting diagnostics and creating issue', () => useCase.execute({
46
+ description: problemDescription,
47
+ fix: shouldFix,
48
+ workdir: options.workdir,
49
+ }));
50
+ // Step 5: Display results
51
+ messages.newline();
52
+ messages.success(`GitHub issue created: ${colors.accent(result.issueUrl)}`);
53
+ if (result.prUrl) {
54
+ messages.success(`Pull request created: ${colors.accent(result.prUrl)}`);
55
+ if (result.flowType) {
56
+ messages.info(`Flow: ${result.flowType === 'maintainer' ? 'direct push (maintainer)' : 'fork (contributor)'}`);
57
+ }
58
+ }
59
+ else if (shouldFix && result.error) {
60
+ messages.warning(`Fix attempt failed: ${result.error}`);
61
+ messages.info('The issue has been created — a maintainer can review it.');
62
+ }
63
+ else if (!shouldFix) {
64
+ messages.info('Issue created. Use --fix to attempt an automated fix.');
65
+ }
66
+ if (result.cleanedUp) {
67
+ messages.info('Temporary working directory cleaned up.');
68
+ }
69
+ messages.newline();
70
+ }
71
+ catch (error) {
72
+ const err = error instanceof Error ? error : new Error(String(error));
73
+ // Handle Ctrl+C gracefully
74
+ if (err.message.includes('force closed') || err.message.includes('User force closed')) {
75
+ messages.info('Cancelled.');
76
+ return;
77
+ }
78
+ messages.error('Doctor failed', err);
79
+ process.exitCode = 1;
80
+ }
81
+ });
82
+ // Commander handles --no-fix by negating the --fix option, but we need
83
+ // explicit --workdir as a separate option
84
+ cmd.option('--workdir <path>', 'Custom directory for the cloned repository');
85
+ return cmd;
86
+ }
87
+ /**
88
+ * Validate that gh CLI is installed and authenticated.
89
+ */
90
+ async function validatePrerequisites() {
91
+ const toolInstaller = container.resolve('IToolInstallerService');
92
+ const ghStatus = await toolInstaller.checkAvailability('gh');
93
+ if (ghStatus.status !== 'available') {
94
+ throw new Error('GitHub CLI (gh) is not installed. Install it from https://cli.github.com/ and run: gh auth login');
95
+ }
96
+ const repoService = container.resolve('IGitHubRepositoryService');
97
+ await repoService.checkAuth();
98
+ }
99
+ /**
100
+ * Prompt the user interactively for a problem description.
101
+ */
102
+ async function promptForDescription() {
103
+ const { input } = await import('@inquirer/prompts');
104
+ const description = await input({
105
+ message: 'Describe the problem you encountered:',
106
+ });
107
+ return description.trim() || undefined;
108
+ }
109
+ /**
110
+ * Determine whether to attempt a fix based on flags or interactive prompt.
111
+ */
112
+ async function resolveFix(options) {
113
+ // --fix explicitly set: always fix
114
+ if (options.fix === true) {
115
+ return true;
116
+ }
117
+ // --no-fix explicitly set (Commander sets fix to false): skip fix
118
+ if (options.fix === false) {
119
+ return false;
120
+ }
121
+ // Interactive: ask the user
122
+ const { confirm } = await import('@inquirer/prompts');
123
+ return confirm({
124
+ message: 'Would you like shep to attempt a fix?',
125
+ default: false,
126
+ });
127
+ }
@@ -42,6 +42,7 @@ import { createIdeOpenCommand } from './commands/ide-open.command.js';
42
42
  import { createInstallCommand } from './commands/install.command.js';
43
43
  import { createUpgradeCommand } from './commands/upgrade.command.js';
44
44
  import { createToolsCommand } from './commands/tools.command.js';
45
+ import { createDoctorCommand } from './commands/doctor.command.js';
45
46
  import { messages } from './ui/index.js';
46
47
  // Daemon lifecycle commands
47
48
  import { createStartCommand } from './commands/start.command.js';
@@ -110,6 +111,7 @@ async function bootstrap() {
110
111
  program.addCommand(createInstallCommand());
111
112
  program.addCommand(createToolsCommand());
112
113
  program.addCommand(createUpgradeCommand());
114
+ program.addCommand(createDoctorCommand());
113
115
  // Daemon lifecycle commands (task-9)
114
116
  program.addCommand(createStartCommand());
115
117
  program.addCommand(createStopCommand());
@@ -1 +1 @@
1
- {"version":3,"file":"feature-drawer-client.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/control-center-drawer/feature-drawer-client.tsx"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI/D,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,UAAU,CAAC;IACjB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,wBAAwB,2CAgmB1F"}
1
+ {"version":3,"file":"feature-drawer-client.d.ts","sourceRoot":"","sources":["../../../../../../../src/presentation/web/components/common/control-center-drawer/feature-drawer-client.tsx"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAI/D,MAAM,WAAW,wBAAwB;IACvC,IAAI,EAAE,UAAU,CAAC;IACjB,8FAA8F;IAC9F,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,EAAE,wBAAwB,2CAimB1F"}
@@ -169,8 +169,9 @@ export function FeatureDrawerClient({ view: initialView, urlTab }) {
169
169
  if (result.productDecisions)
170
170
  setTechProductData(result.productDecisions);
171
171
  }, () => setTechProductData(undefined), undefined, artifactRefreshKey);
172
- const mergeFeatureId = featureNode?.lifecycle === 'review' &&
173
- (featureNode?.state === 'action-required' || featureNode?.state === 'error')
172
+ const mergeFeatureId = (featureNode?.lifecycle === 'review' &&
173
+ (featureNode?.state === 'action-required' || featureNode?.state === 'error')) ||
174
+ (featureNode?.lifecycle === 'maintain' && featureNode?.pr)
174
175
  ? featureNode.featureId
175
176
  : null;
176
177
  const isLoadingMerge = useArtifactFetch(mergeFeatureId, getMergeReviewData, (result) => {