@shepai/cli 1.135.2-pr438.f43bc1e → 1.135.2-pr439.e1871c8
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 -67
- 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 +24 -24
- 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 +24 -24
- 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 +30 -30
- 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 +30 -30
- 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 +22 -22
- 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 +24 -24
- 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 +30 -30
- 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 +30 -30
- 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 +22 -22
- 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 +22 -22
- 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/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/[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_4e741df2.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web__next-internal_server_app_(dashboard)_@drawer_adopt_page_actions_4e741df2.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_026fdffa.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_026fdffa.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_8b91e197.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_8b91e197.js.map +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__90f9ae71._.js → [root-of-the-server]__2096f24f._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__31bc28da._.js.map → [root-of-the-server]__2096f24f._.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]__31bc28da._.js → [root-of-the-server]__3f6cd19e._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__90ce4b6d._.js.map → [root-of-the-server]__3f6cd19e._.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]__32ecbed9._.js → [root-of-the-server]__6c83fbec._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__32ecbed9._.js.map → [root-of-the-server]__6c83fbec._.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]__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]__90ce4b6d._.js → [root-of-the-server]__a13f3ed8._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__90f9ae71._.js.map → [root-of-the-server]__a13f3ed8._.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/_02ec1aea._.js +1 -1
- package/web/.next/server/chunks/ssr/_02ec1aea._.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/{_77083321._.js → _b6960ca0._.js} +3 -3
- package/web/.next/server/chunks/ssr/_b6960ca0._.js.map +1 -0
- package/web/.next/server/chunks/ssr/{_7e29a7bc._.js → _c5a0904f._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_7e29a7bc._.js.map → _c5a0904f._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_8b0c1045._.js → _c80f0ee4._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_8b0c1045._.js.map → _c80f0ee4._.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/_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_cfea7939._.js → src_presentation_web_5cbfa9c3._.js} +2 -2
- package/web/.next/server/chunks/ssr/{src_presentation_web_cfea7939._.js.map → src_presentation_web_5cbfa9c3._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_8e7fe0d1._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_8e7fe0d1._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_ca051134.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_ca051134.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_b9023017._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_b9023017._.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 +38 -38
- package/web/.next/static/chunks/{0d539860f56e6468.js → 0f7a03924ffe9201.js} +1 -1
- package/web/.next/static/chunks/290b9ee95370f3e6.js +2 -0
- package/web/.next/static/chunks/{d45958925d9b5068.js → 32a0eb00cc8f57a5.js} +1 -1
- package/web/.next/static/chunks/47151663050b874d.js +1 -0
- package/web/.next/static/chunks/6472785bb556ec8a.js +1 -0
- package/web/.next/static/chunks/{475a8dfc028d8ade.js → 6cf053583d146b73.js} +1 -1
- package/web/.next/static/chunks/{67b290f5a29737c1.js → 769db91c3a32cb62.js} +1 -1
- package/web/.next/static/chunks/{daf11c5cc3adbcbc.js → 7eb6cae52a1a3747.js} +1 -1
- package/web/.next/static/chunks/{2b853c80d6032a5b.js → 9a53c38c866d6fd6.js} +1 -1
- package/web/.next/static/chunks/{13daed9124d5db9d.js → 9cde06b0bf7f313d.js} +1 -1
- package/web/.next/static/chunks/{fe4aab39650fe1da.js → d4ea4340c78d8fe8.js} +1 -1
- package/web/.next/static/chunks/{9b5e512c27b112a5.js → dca377b2a0726988.js} +1 -1
- package/apis/json-schema/DoctorDiagnosticReport.yaml +0 -24
- 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 -53
- 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 -266
- 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 -127
- package/web/.next/server/chunks/ssr/_77083321._.js.map +0 -1
- package/web/.next/static/chunks/30f300c565f39570.js +0 -1
- package/web/.next/static/chunks/3cf03a4faffa22e9.js +0 -1
- package/web/.next/static/chunks/e87e22afc1ecf600.js +0 -2
- /package/web/.next/static/{rYnuAm9xTEAUIz5Pqp9fP → joXWxy8xjQS31B-KrKQy2}/_buildManifest.js +0 -0
- /package/web/.next/static/{rYnuAm9xTEAUIz5Pqp9fP → joXWxy8xjQS31B-KrKQy2}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{rYnuAm9xTEAUIz5Pqp9fP → joXWxy8xjQS31B-KrKQy2}/_ssgManifest.js +0 -0
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import { mkdir, readdir, writeFile } from 'node:fs/promises';
|
|
9
9
|
import { join } from 'node:path';
|
|
10
|
+
import { computeRepoHash } from '../../services/filesystem/repo-hash.js';
|
|
11
|
+
import { getShepHomeDir } from '../../services/filesystem/shep-directory.service.js';
|
|
10
12
|
/**
|
|
11
13
|
* Pad a number to 3 digits with leading zeros.
|
|
12
14
|
*/
|
|
@@ -240,13 +242,14 @@ const TEMPLATES = [
|
|
|
240
242
|
{ filename: 'feature.yaml', content: FEATURE_YAML },
|
|
241
243
|
];
|
|
242
244
|
export class SpecInitializerService {
|
|
243
|
-
async initialize(basePath, slug, featureNumber, description, mode) {
|
|
244
|
-
|
|
245
|
+
async initialize(basePath, slug, featureNumber, description, mode, options) {
|
|
246
|
+
const storageMode = options?.storageMode ?? 'in-repo';
|
|
247
|
+
// Scan existing spec directories for highest NNN prefix to avoid collisions
|
|
245
248
|
// (specs may have been created outside the DB, e.g., via /shep-kit:new-feature)
|
|
246
|
-
const resolvedNumber = await this.resolveNextNumber(basePath, featureNumber);
|
|
249
|
+
const resolvedNumber = await this.resolveNextNumber(basePath, featureNumber, options?.repositoryPath);
|
|
247
250
|
const nnn = padNumber(resolvedNumber);
|
|
248
251
|
const specDirName = `${nnn}-${slug}`;
|
|
249
|
-
const specDir =
|
|
252
|
+
const specDir = this.computeSpecDir(basePath, specDirName, storageMode, options?.repositoryPath);
|
|
250
253
|
// Create the spec directory
|
|
251
254
|
await mkdir(specDir, { recursive: true });
|
|
252
255
|
const now = new Date();
|
|
@@ -263,26 +266,59 @@ export class SpecInitializerService {
|
|
|
263
266
|
return { specDir, featureNumber: nnn };
|
|
264
267
|
}
|
|
265
268
|
/**
|
|
266
|
-
*
|
|
269
|
+
* Compute the spec directory path based on storage mode.
|
|
270
|
+
*/
|
|
271
|
+
computeSpecDir(basePath, specDirName, storageMode, repositoryPath) {
|
|
272
|
+
if (storageMode === 'shep-managed') {
|
|
273
|
+
if (!repositoryPath) {
|
|
274
|
+
throw new Error('repositoryPath is required when storageMode is shep-managed');
|
|
275
|
+
}
|
|
276
|
+
const repoHash = computeRepoHash(repositoryPath);
|
|
277
|
+
return join(getShepHomeDir(), 'repos', repoHash, 'specs', specDirName);
|
|
278
|
+
}
|
|
279
|
+
return join(basePath, '.shep', 'specs', specDirName);
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Scan spec directories for existing NNN-* entries and return the next available number.
|
|
283
|
+
* Scans up to 3 locations to prevent collisions during the transition period:
|
|
284
|
+
* 1. specs/ (legacy location)
|
|
285
|
+
* 2. .shep/specs/ (new in-repo location)
|
|
286
|
+
* 3. ~/.shep/repos/<hash>/specs/ (shep-managed location, when repositoryPath provided)
|
|
287
|
+
*
|
|
267
288
|
* Uses the DB-derived hint as a minimum, but always respects filesystem state.
|
|
268
289
|
*/
|
|
269
|
-
async resolveNextNumber(basePath, hint) {
|
|
270
|
-
const
|
|
290
|
+
async resolveNextNumber(basePath, hint, repositoryPath) {
|
|
291
|
+
const dirsToScan = [join(basePath, 'specs'), join(basePath, '.shep', 'specs')];
|
|
292
|
+
if (repositoryPath) {
|
|
293
|
+
const repoHash = computeRepoHash(repositoryPath);
|
|
294
|
+
dirsToScan.push(join(getShepHomeDir(), 'repos', repoHash, 'specs'));
|
|
295
|
+
}
|
|
296
|
+
let maxExisting = 0;
|
|
297
|
+
for (const dir of dirsToScan) {
|
|
298
|
+
const max = await this.scanDirForMaxNumber(dir);
|
|
299
|
+
maxExisting = Math.max(maxExisting, max);
|
|
300
|
+
}
|
|
301
|
+
return Math.max(maxExisting + 1, hint);
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Scan a single directory for NNN-* prefixed entries and return the max number found.
|
|
305
|
+
* Returns 0 if the directory does not exist or is empty.
|
|
306
|
+
*/
|
|
307
|
+
async scanDirForMaxNumber(dirPath) {
|
|
271
308
|
let entries;
|
|
272
309
|
try {
|
|
273
|
-
entries = await readdir(
|
|
310
|
+
entries = await readdir(dirPath);
|
|
274
311
|
}
|
|
275
312
|
catch {
|
|
276
|
-
|
|
277
|
-
return hint;
|
|
313
|
+
return 0;
|
|
278
314
|
}
|
|
279
|
-
let
|
|
315
|
+
let max = 0;
|
|
280
316
|
for (const entry of entries) {
|
|
281
317
|
const match = entry.match(/^(\d{3})-/);
|
|
282
318
|
if (match) {
|
|
283
|
-
|
|
319
|
+
max = Math.max(max, parseInt(match[1], 10));
|
|
284
320
|
}
|
|
285
321
|
}
|
|
286
|
-
return
|
|
322
|
+
return max;
|
|
287
323
|
}
|
|
288
324
|
}
|
|
@@ -42,7 +42,6 @@ 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';
|
|
46
45
|
import { messages } from './ui/index.js';
|
|
47
46
|
// Daemon lifecycle commands
|
|
48
47
|
import { createStartCommand } from './commands/start.command.js';
|
|
@@ -111,7 +110,6 @@ async function bootstrap() {
|
|
|
111
110
|
program.addCommand(createInstallCommand());
|
|
112
111
|
program.addCommand(createToolsCommand());
|
|
113
112
|
program.addCommand(createUpgradeCommand());
|
|
114
|
-
program.addCommand(createDoctorCommand());
|
|
115
113
|
// Daemon lifecycle commands (task-9)
|
|
116
114
|
program.addCommand(createStartCommand());
|
|
117
115
|
program.addCommand(createStopCommand());
|