@shepai/cli 1.138.0-pr445.9f2c136 → 1.139.0-pr446.9a4d670
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/dist/packages/core/src/infrastructure/services/deployment/deployment.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/deployment/deployment.service.js +41 -20
- package/dist/src/presentation/web/app/actions/deploy-feature.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/deploy-feature.js +8 -0
- package/dist/src/presentation/web/app/actions/deploy-repository.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/deploy-repository.js +8 -0
- package/dist/src/presentation/web/lib/is-same-shep-instance.d.ts +7 -0
- package/dist/src/presentation/web/lib/is-same-shep-instance.d.ts.map +1 -0
- package/dist/src/presentation/web/lib/is-same-shep-instance.js +18 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/web/.next/BUILD_ID +1 -1
- package/web/.next/build-manifest.json +2 -2
- package/web/.next/fallback-build-manifest.json +2 -2
- package/web/.next/prerender-manifest.json +3 -3
- package/web/.next/required-server-files.js +2 -2
- package/web/.next/required-server-files.json +2 -2
- package/web/.next/server/app/(dashboard)/@drawer/adopt/page/server-reference-manifest.json +28 -28
- 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 +28 -28
- 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 +36 -36
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page/server-reference-manifest.json +26 -26
- 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 +28 -28
- 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 +36 -36
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page/server-reference-manifest.json +36 -36
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/page/server-reference-manifest.json +26 -26
- 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 +26 -26
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +3 -3
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/api/attachments/preview/route.js.nft.json +1 -1
- package/web/.next/server/app/api/evidence/route.js.nft.json +1 -1
- package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/settings/page.js.nft.json +1 -1
- package/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/skills/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/skills/page.js.nft.json +1 -1
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +8 -8
- package/web/.next/server/app/tools/page.js.nft.json +1 -1
- package/web/.next/server/app/tools/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/version/page/server-reference-manifest.json +3 -3
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js +1 -1
- package/web/.next/server/chunks/ssr/744ca_web_components_common_control-center-drawer_create-drawer-client_tsx_5e26fc0a._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2bdf88a0._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2bdf88a0._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__357d99f9._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__3ef34e4c._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__42faf5ae._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__42faf5ae._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__43f51aa6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__685ee565._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__685ee565._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__74756aae._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__74756aae._.js.map +1 -0
- 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]__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/_02ec1aea._.js +1 -1
- package/web/.next/server/chunks/ssr/_02ec1aea._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_0c5f56e3._.js +2 -2
- package/web/.next/server/chunks/ssr/_0c5f56e3._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_1b719e7f._.js +1 -1
- package/web/.next/server/chunks/ssr/_1b719e7f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_74c3ee79._.js → _362a65ec._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_74c3ee79._.js.map → _362a65ec._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_37e8548b._.js +1 -1
- package/web/.next/server/chunks/ssr/_37e8548b._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_55d763e2._.js +1 -1
- package/web/.next/server/chunks/ssr/_55d763e2._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_64bdfc6f._.js +2 -2
- package/web/.next/server/chunks/ssr/_64bdfc6f._.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/{_817e2ffb._.js → _92a1e417._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_817e2ffb._.js.map → _92a1e417._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_a9f57758._.js +1 -1
- package/web/.next/server/chunks/ssr/_b71645b4._.js +1 -1
- package/web/.next/server/chunks/ssr/_b71645b4._.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_7512ae5c._.js → src_presentation_web_8832f8a0._.js} +2 -2
- package/web/.next/server/chunks/ssr/{src_presentation_web_7512ae5c._.js.map → src_presentation_web_8832f8a0._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1b176e3c.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_bd9f0dda.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_app_actions_open-ide_ts_baaca5d5._.js +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 +44 -44
- package/web/.next/static/chunks/{69be489ef69b0a66.js → 1e4101146fba345a.js} +1 -1
- package/web/.next/static/chunks/{00e7cffbd2b4d181.js → 2bc95df962e4ccb4.js} +1 -1
- package/web/.next/static/chunks/{6dfdade9e67387b4.js → 310de4832855feb0.js} +1 -1
- package/web/.next/static/chunks/{ccb0bfb16178e592.js → 5241d86d18aea5a8.js} +1 -1
- package/web/.next/static/chunks/{970496436becf660.js → 55a21a7f828091b4.js} +1 -1
- package/web/.next/static/chunks/{f627005f412cf658.js → 656b8c7be54a9a62.js} +1 -1
- package/web/.next/static/chunks/{1787aa31bde0a9b5.js → 784d4bcaebc16e66.js} +1 -1
- package/web/.next/static/chunks/{7b0a014d05edbd4b.js → 7cddbd2eef52fb7d.js} +2 -2
- package/web/.next/static/chunks/{294cf0803b1e5b91.js → a083cbc927bb8708.js} +1 -1
- package/web/.next/static/chunks/{37f736bbf17e91e7.js → c4289472b20b5ca3.js} +1 -1
- package/web/.next/static/chunks/{50e8000dd2361904.js → dec195dca4c1ddc1.js} +1 -1
- package/web/.next/static/chunks/{4a889c493442a597.js → e47d4364e6de6a3c.js} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2c703b78._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__2c703b78._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__59a3897b._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__59a3897b._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__78aecdd5._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__78aecdd5._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f222995d._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__f222995d._.js.map +0 -1
- /package/web/.next/static/{qsD7mHHMpZAzAyBy-5rSN → mySbQkxwHdK9HUj3SJDSq}/_buildManifest.js +0 -0
- /package/web/.next/static/{qsD7mHHMpZAzAyBy-5rSN → mySbQkxwHdK9HUj3SJDSq}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{qsD7mHHMpZAzAyBy-5rSN → mySbQkxwHdK9HUj3SJDSq}/_ssgManifest.js +0 -0
package/dist/packages/core/src/infrastructure/services/deployment/deployment.service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/deployment/deployment.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,KAAK,EAAmC,MAAM,oBAAoB,CAAC;AAK5E,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAK3C,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACT,MAAM,qEAAqE,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAiCzD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACnC;AA0CD,qBAAa,iBAAkB,YAAW,kBAAkB;IAC1D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsC;IAClE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwB;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;IAC9C,OAAO,CAAC,EAAE,CAAkC;gBAEhC,IAAI,GAAE,OAAO,CAAC,qBAAqB,CAAM;IAIrD;;OAEG;IACH,WAAW,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI;IAIxC;;;;;;;;;;;;OAYG;IACH,UAAU,IAAI,IAAI;
|
|
1
|
+
{"version":3,"file":"deployment.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/deployment/deployment.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,KAAK,EAAmC,MAAM,oBAAoB,CAAC;AAK5E,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;AAK3C,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACT,MAAM,qEAAqE,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAiCzD,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,eAAe,EAAE,OAAO,eAAe,CAAC;IACxC,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,OAAO,GAAG,MAAM,KAAK,IAAI,CAAC;IAC7D,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;CACnC;AA0CD,qBAAa,iBAAkB,YAAW,kBAAkB;IAC1D,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAsC;IAClE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAwB;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;IAC9C,OAAO,CAAC,EAAE,CAAkC;gBAEhC,IAAI,GAAE,OAAO,CAAC,qBAAqB,CAAM;IAIrD;;OAEG;IACH,WAAW,CAAC,EAAE,EAAE,QAAQ,CAAC,QAAQ,GAAG,IAAI;IAIxC;;;;;;;;;;;;OAYG;IACH,UAAU,IAAI,IAAI;IAqFlB;;;OAGG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,SAAe,GAAG,IAAI;IA6H5E;;;;OAIG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IA4CpD;;OAEG;IACG,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA0D3C;;OAEG;IACH,OAAO,IAAI,IAAI;IAef;;OAEG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,GAAG,IAAI;IAM5C;;OAEG;IACH,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI;IAI1D;;OAEG;IACH,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI;IAM3D,OAAO,CAAC,QAAQ;IAuBhB,OAAO,CAAC,aAAa;IAWrB,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,MAAM;IAed,OAAO,CAAC,WAAW;IAQnB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;YA4Dd,aAAa;IAW3B,OAAO,CAAC,WAAW;IAUnB;;;;OAIG;YACW,kBAAkB;IAsChC;;;OAGG;IACH,OAAO,CAAC,SAAS;CAwBlB"}
|
|
@@ -99,6 +99,12 @@ export class DeploymentService {
|
|
|
99
99
|
recoverAll() {
|
|
100
100
|
if (!this.db)
|
|
101
101
|
return;
|
|
102
|
+
// Child dev servers spawned by DeploymentService share the same global DB.
|
|
103
|
+
// Skip recovery to avoid killing processes owned by the parent instance.
|
|
104
|
+
if (process.env.SHEP_SKIP_RECOVERY) {
|
|
105
|
+
log.info('SHEP_SKIP_RECOVERY set — skipping dev server recovery');
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
102
108
|
let rows;
|
|
103
109
|
try {
|
|
104
110
|
const stmt = this.db.prepare('SELECT * FROM dev_servers');
|
|
@@ -137,20 +143,16 @@ export class DeploymentService {
|
|
|
137
143
|
continue;
|
|
138
144
|
}
|
|
139
145
|
if (alive) {
|
|
140
|
-
// Strategy 2: Process alive but stuck in Booting —
|
|
141
|
-
//
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
// already dead
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
else {
|
|
151
|
-
log.info(`Dev server "${row.target_id}" (pid=${row.pid}) is dead — will re-spawn`);
|
|
146
|
+
// Strategy 2: Process alive but stuck in Booting — leave it running.
|
|
147
|
+
// We can't re-attach stdout so we can't detect when it becomes Ready,
|
|
148
|
+
// but killing it would be destructive (another process on the same
|
|
149
|
+
// shared DB may have just spawned it). The user can restart manually.
|
|
150
|
+
log.info(`Orphan "${row.target_id}" (pid=${row.pid}) stuck in ${row.state} — leaving alive (cannot re-attach)`);
|
|
151
|
+
this.dbDelete(row.target_id);
|
|
152
|
+
continue;
|
|
152
153
|
}
|
|
153
|
-
// Strategy
|
|
154
|
+
// Strategy 3: Dead process — re-spawn if target directory still exists
|
|
155
|
+
log.info(`Dev server "${row.target_id}" (pid=${row.pid}) is dead — will re-spawn`);
|
|
154
156
|
this.dbDelete(row.target_id);
|
|
155
157
|
if (!existsSync(join(row.target_path, 'package.json'))) {
|
|
156
158
|
log.warn(`Skipping re-spawn for "${row.target_id}" — no package.json at "${row.target_path}"`);
|
|
@@ -215,6 +217,9 @@ export class DeploymentService {
|
|
|
215
217
|
// stdout/stderr — we don't need it because taskkill /F /T handles tree kill.
|
|
216
218
|
...(IS_WINDOWS ? { windowsHide: true } : { detached: true }),
|
|
217
219
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
220
|
+
// Prevent child shep instances (e.g. worktree dev servers) from running
|
|
221
|
+
// recoverAll() on the shared ~/.shep/data DB and killing our processes.
|
|
222
|
+
env: { ...process.env, SHEP_SKIP_RECOVERY: '1' },
|
|
218
223
|
});
|
|
219
224
|
if (!child.pid) {
|
|
220
225
|
log.error('spawn() returned no PID — process failed to start');
|
|
@@ -234,7 +239,10 @@ export class DeploymentService {
|
|
|
234
239
|
logs: new LogRingBuffer(),
|
|
235
240
|
};
|
|
236
241
|
this.deployments.set(targetId, entry);
|
|
237
|
-
|
|
242
|
+
// NOTE: Do NOT write to DB during Booting. The spawned process may be
|
|
243
|
+
// another shep instance sharing ~/.shep/data — its recoverAll() would
|
|
244
|
+
// find this Booting entry, see its own PID as alive, and SIGKILL itself.
|
|
245
|
+
// We persist to DB only when the state transitions to Ready (URL detected).
|
|
238
246
|
// Attach stdout/stderr listeners for port detection
|
|
239
247
|
this.attachOutputListener(entry, 'stdout');
|
|
240
248
|
this.attachOutputListener(entry, 'stderr');
|
|
@@ -245,12 +253,25 @@ export class DeploymentService {
|
|
|
245
253
|
this.deployments.delete(targetId);
|
|
246
254
|
this.dbDelete(targetId);
|
|
247
255
|
});
|
|
248
|
-
//
|
|
249
|
-
|
|
256
|
+
// Use 'close' instead of 'exit' — 'close' fires after stdio streams are
|
|
257
|
+
// fully consumed, so entry.logs will contain all captured output.
|
|
258
|
+
child.on('close', (code, signal) => {
|
|
250
259
|
const wasBooting = entry.state === DeploymentState.Booting;
|
|
251
|
-
log.info(`Process
|
|
260
|
+
log.info(`Process closed for "${targetId}" (pid=${entry.pid}) — code=${code}, signal=${signal}, wasBooting=${wasBooting}`);
|
|
252
261
|
if (wasBooting) {
|
|
253
|
-
log.warn(
|
|
262
|
+
log.warn(`Process exited while still in Booting state — dev server likely crashed on startup (code=${code}, signal=${signal}).`);
|
|
263
|
+
const allLogs = entry.logs.getAll();
|
|
264
|
+
const stdoutLines = allLogs.filter((l) => l.stream === 'stdout');
|
|
265
|
+
const stderrLines = allLogs.filter((l) => l.stream === 'stderr');
|
|
266
|
+
if (stdoutLines.length > 0) {
|
|
267
|
+
log.warn(`[${targetId}] stdout:\n${stdoutLines.map((l) => l.line).join('\n')}`);
|
|
268
|
+
}
|
|
269
|
+
if (stderrLines.length > 0) {
|
|
270
|
+
log.warn(`[${targetId}] stderr:\n${stderrLines.map((l) => l.line).join('\n')}`);
|
|
271
|
+
}
|
|
272
|
+
if (allLogs.length === 0) {
|
|
273
|
+
log.warn(`[${targetId}] No output captured from the process.`);
|
|
274
|
+
}
|
|
254
275
|
}
|
|
255
276
|
this.deployments.delete(targetId);
|
|
256
277
|
this.dbDelete(targetId);
|
|
@@ -485,7 +506,7 @@ export class DeploymentService {
|
|
|
485
506
|
log.info(`[${entry.targetId}] Port detected — url="${url}" (from ${stream})`);
|
|
486
507
|
entry.state = DeploymentState.Ready;
|
|
487
508
|
entry.url = url;
|
|
488
|
-
this.
|
|
509
|
+
this.dbUpsert(entry);
|
|
489
510
|
}
|
|
490
511
|
}
|
|
491
512
|
}
|
|
@@ -500,7 +521,7 @@ export class DeploymentService {
|
|
|
500
521
|
log.info(`[${entry.targetId}] Port detected in flushed buffer — url="${url}"`);
|
|
501
522
|
entry.state = DeploymentState.Ready;
|
|
502
523
|
entry.url = url;
|
|
503
|
-
this.
|
|
524
|
+
this.dbUpsert(entry);
|
|
504
525
|
}
|
|
505
526
|
}
|
|
506
527
|
entry[bufferKey] = '';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-feature.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/deploy-feature.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy-feature.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/deploy-feature.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAKvE,wBAAsB,aAAa,CACjC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,eAAe,CAAA;CAAE,CAAC,CAgDxE"}
|
|
@@ -4,6 +4,7 @@ import { resolve } from '../../lib/server-container.js';
|
|
|
4
4
|
import { createDeploymentLogger } from '../../../../../packages/core/src/infrastructure/services/deployment/deployment-logger.js';
|
|
5
5
|
import { computeWorktreePath } from '../../../../../packages/core/src/infrastructure/services/ide-launchers/compute-worktree-path.js';
|
|
6
6
|
import { DeploymentState } from '../../../../../packages/core/src/domain/generated/output.js';
|
|
7
|
+
import { isSameShepInstance } from '../../lib/is-same-shep-instance.js';
|
|
7
8
|
const log = createDeploymentLogger('[deployFeature]');
|
|
8
9
|
export async function deployFeature(featureId) {
|
|
9
10
|
log.info(`called — featureId="${featureId}"`);
|
|
@@ -25,6 +26,13 @@ export async function deployFeature(featureId) {
|
|
|
25
26
|
log.warn(`worktree path does not exist on disk: "${worktreePath}"`);
|
|
26
27
|
return { success: false, error: `Worktree path does not exist: ${worktreePath}` };
|
|
27
28
|
}
|
|
29
|
+
if (isSameShepInstance(feature.repositoryPath)) {
|
|
30
|
+
log.warn('rejected — feature belongs to the running shep instance');
|
|
31
|
+
return {
|
|
32
|
+
success: false,
|
|
33
|
+
error: 'Cannot start a dev server for features of the repository Shep is running from',
|
|
34
|
+
};
|
|
35
|
+
}
|
|
28
36
|
log.info('worktree path exists, calling deploymentService.start()');
|
|
29
37
|
const deploymentService = resolve('IDeploymentService');
|
|
30
38
|
deploymentService.start(featureId, worktreePath, 'feature');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy-repository.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/deploy-repository.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"deploy-repository.d.ts","sourceRoot":"","sources":["../../../../../../src/presentation/web/app/actions/deploy-repository.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAKvE,wBAAsB,gBAAgB,CACpC,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,eAAe,CAAA;CAAE,CAAC,CAiCxE"}
|
|
@@ -4,6 +4,7 @@ import { isAbsolute } from 'node:path';
|
|
|
4
4
|
import { resolve } from '../../lib/server-container.js';
|
|
5
5
|
import { createDeploymentLogger } from '../../../../../packages/core/src/infrastructure/services/deployment/deployment-logger.js';
|
|
6
6
|
import { DeploymentState } from '../../../../../packages/core/src/domain/generated/output.js';
|
|
7
|
+
import { isSameShepInstance } from '../../lib/is-same-shep-instance.js';
|
|
7
8
|
const log = createDeploymentLogger('[deployRepository]');
|
|
8
9
|
export async function deployRepository(repositoryPath) {
|
|
9
10
|
log.info(`called — repositoryPath="${repositoryPath}"`);
|
|
@@ -16,6 +17,13 @@ export async function deployRepository(repositoryPath) {
|
|
|
16
17
|
log.warn(`directory does not exist: "${repositoryPath}"`);
|
|
17
18
|
return { success: false, error: `Directory does not exist: ${repositoryPath}` };
|
|
18
19
|
}
|
|
20
|
+
if (isSameShepInstance(repositoryPath)) {
|
|
21
|
+
log.warn('rejected — target is the running shep instance');
|
|
22
|
+
return {
|
|
23
|
+
success: false,
|
|
24
|
+
error: 'Cannot start a dev server for the repository Shep is running from',
|
|
25
|
+
};
|
|
26
|
+
}
|
|
19
27
|
log.info('directory exists, calling deploymentService.start()');
|
|
20
28
|
const deploymentService = resolve('IDeploymentService');
|
|
21
29
|
deploymentService.start(repositoryPath, repositoryPath, 'repository');
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Check if a target path is the same directory (or a worktree of) the
|
|
3
|
+
* currently running shep instance. Starting a dev server there would spawn
|
|
4
|
+
* another shep instance that conflicts with the shared ~/.shep/data DB.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isSameShepInstance(targetPath: string): boolean;
|
|
7
|
+
//# sourceMappingURL=is-same-shep-instance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-same-shep-instance.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/web/lib/is-same-shep-instance.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAU9D"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { realpathSync } from 'node:fs';
|
|
2
|
+
import { resolve } from 'node:path';
|
|
3
|
+
/**
|
|
4
|
+
* Check if a target path is the same directory (or a worktree of) the
|
|
5
|
+
* currently running shep instance. Starting a dev server there would spawn
|
|
6
|
+
* another shep instance that conflicts with the shared ~/.shep/data DB.
|
|
7
|
+
*/
|
|
8
|
+
export function isSameShepInstance(targetPath) {
|
|
9
|
+
const instancePath = process.env.NEXT_PUBLIC_SHEP_INSTANCE_PATH ?? process.cwd();
|
|
10
|
+
try {
|
|
11
|
+
const normalizedTarget = realpathSync(resolve(targetPath)).replace(/\\/g, '/');
|
|
12
|
+
const normalizedInstance = realpathSync(resolve(instancePath)).replace(/\\/g, '/');
|
|
13
|
+
return normalizedTarget === normalizedInstance;
|
|
14
|
+
}
|
|
15
|
+
catch {
|
|
16
|
+
return false;
|
|
17
|
+
}
|
|
18
|
+
}
|