@shepai/cli 1.129.4-pr412.cbe0d37 → 1.130.0-pr413.0773bb9
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/agents/common/agent-validator.service.js +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/cursor-executor.service.d.ts +5 -5
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/cursor-executor.service.js +8 -8
- 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 +42 -8
- package/dist/packages/core/src/infrastructure/services/deployment/detect-dev-script.d.ts +1 -0
- package/dist/packages/core/src/infrastructure/services/deployment/detect-dev-script.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/deployment/detect-dev-script.js +3 -2
- package/dist/src/presentation/web/app/actions/check-agent-auth.js +1 -1
- 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 +24 -24
- 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.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.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.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.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.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.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.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.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.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/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]__357d99f9._.js +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]__5142820f._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6bb00d90._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__755cfe02._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__755cfe02._.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]__84f72684._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__99ab2519._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__99ab2519._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a628fb91._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a628fb91._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__bfba58e6._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__bfba58e6._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c3ab8422._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c3ab8422._.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/{_b032a7ac._.js → _18e5397a._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_b032a7ac._.js.map → _18e5397a._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_56c5e92e._.js → _523f2f6d._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_56c5e92e._.js.map → _523f2f6d._.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/_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_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_0a31df6d._.js → src_presentation_web_8eab1fad._.js} +2 -2
- package/web/.next/server/chunks/ssr/{src_presentation_web_0a31df6d._.js.map → src_presentation_web_8eab1fad._.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/{a449ec16975164ef.js → 01653d5435a458ee.js} +1 -1
- package/web/.next/static/chunks/{467005fc66090d82.js → 08ef7dc6818ebd7a.js} +1 -1
- package/web/.next/static/chunks/{d67b9a7e0395aadc.js → 2670b73949e10d8c.js} +1 -1
- package/web/.next/static/chunks/28ef00467f5956bc.js +1 -0
- package/web/.next/static/chunks/{10b5069084213d7b.js → 317bd484909d1d9e.js} +1 -1
- package/web/.next/static/chunks/{5d102c2368573ad4.js → 3f3e1e2df1cfe629.js} +1 -1
- package/web/.next/static/chunks/{fc31060238e90093.js → 5b06c2b203512867.js} +2 -2
- package/web/.next/static/chunks/{7d78b55397522ad9.js → a70fd762b3ed4788.js} +1 -1
- package/web/.next/static/chunks/{0b7fe2ac4f078f54.js → afad5b7ffdb30745.js} +1 -1
- package/web/.next/static/chunks/bbe33a3a4993e0c4.js +1 -0
- package/web/.next/static/chunks/{56986cf0d5665b33.js → d519eb952b36ec01.js} +1 -1
- package/web/.next/static/chunks/{c8ae9f83f18eec9e.js → d6904209f1c50c18.js} +1 -1
- package/web/.next/static/chunks/{768922d1350524f7.js → dca5b0caef486192.js} +1 -1
- package/web/.next/static/chunks/5e0f0eb56caca7b0.js +0 -1
- package/web/.next/static/chunks/791fa3135b12cc5c.js +0 -1
- /package/web/.next/static/{jD-F2qPl8fvHfH8oc0hVX → wS9YDApckYoE-8HrhN7NN}/_buildManifest.js +0 -0
- /package/web/.next/static/{jD-F2qPl8fvHfH8oc0hVX → wS9YDApckYoE-8HrhN7NN}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{jD-F2qPl8fvHfH8oc0hVX → wS9YDApckYoE-8HrhN7NN}/_ssgManifest.js +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Cursor Executor Service
|
|
3
3
|
*
|
|
4
4
|
* Infrastructure implementation of IAgentExecutor for the Cursor agent.
|
|
5
|
-
* Executes prompts via the `agent` CLI subprocess with JSON and stream-json
|
|
5
|
+
* Executes prompts via the `cursor-agent` CLI subprocess with JSON and stream-json
|
|
6
6
|
* output formats.
|
|
7
7
|
*
|
|
8
8
|
* Uses constructor dependency injection for the spawn function
|
|
@@ -13,7 +13,7 @@ import type { IAgentExecutor, AgentExecutionOptions, AgentExecutionResult, Agent
|
|
|
13
13
|
import type { SpawnFunction } from '../types.js';
|
|
14
14
|
/**
|
|
15
15
|
* Executor service for Cursor agent.
|
|
16
|
-
* Uses subprocess spawning to interact with the `agent` CLI.
|
|
16
|
+
* Uses subprocess spawning to interact with the `cursor-agent` CLI.
|
|
17
17
|
*/
|
|
18
18
|
export declare class CursorExecutorService implements IAgentExecutor {
|
|
19
19
|
private readonly spawn;
|
|
@@ -35,13 +35,13 @@ export declare class CursorExecutorService implements IAgentExecutor {
|
|
|
35
35
|
/**
|
|
36
36
|
* Spawn the agent process, handling Windows specially via PowerShell.
|
|
37
37
|
*
|
|
38
|
-
* On Windows, cursor CLI ships as `agent.cmd` which requires `shell: true`,
|
|
38
|
+
* On Windows, cursor CLI ships as `cursor-agent.cmd` which requires `shell: true`,
|
|
39
39
|
* but cmd.exe mangles long `-p` arguments (8191-char limit + special chars).
|
|
40
|
-
* Solution: write prompt to a temp file, invoke agent via PowerShell which
|
|
40
|
+
* Solution: write prompt to a temp file, invoke cursor-agent via PowerShell which
|
|
41
41
|
* reads the file and passes the content as `-p`. PowerShell handles long
|
|
42
42
|
* strings natively (32K limit) and doesn't mangle arguments.
|
|
43
43
|
*
|
|
44
|
-
* On Linux/macOS, spawn `agent` directly — no shell needed.
|
|
44
|
+
* On Linux/macOS, spawn `cursor-agent` directly — no shell needed.
|
|
45
45
|
*/
|
|
46
46
|
private spawnAgent;
|
|
47
47
|
private parseStreamLine;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Cursor Executor Service
|
|
3
3
|
*
|
|
4
4
|
* Infrastructure implementation of IAgentExecutor for the Cursor agent.
|
|
5
|
-
* Executes prompts via the `agent` CLI subprocess with JSON and stream-json
|
|
5
|
+
* Executes prompts via the `cursor-agent` CLI subprocess with JSON and stream-json
|
|
6
6
|
* output formats.
|
|
7
7
|
*
|
|
8
8
|
* Uses constructor dependency injection for the spawn function
|
|
@@ -32,7 +32,7 @@ function toCursorModelName(model) {
|
|
|
32
32
|
const SUPPORTED_FEATURES = new Set(['session-resume', 'streaming']);
|
|
33
33
|
/**
|
|
34
34
|
* Executor service for Cursor agent.
|
|
35
|
-
* Uses subprocess spawning to interact with the `agent` CLI.
|
|
35
|
+
* Uses subprocess spawning to interact with the `cursor-agent` CLI.
|
|
36
36
|
*/
|
|
37
37
|
export class CursorExecutorService {
|
|
38
38
|
spawn;
|
|
@@ -312,13 +312,13 @@ export class CursorExecutorService {
|
|
|
312
312
|
/**
|
|
313
313
|
* Spawn the agent process, handling Windows specially via PowerShell.
|
|
314
314
|
*
|
|
315
|
-
* On Windows, cursor CLI ships as `agent.cmd` which requires `shell: true`,
|
|
315
|
+
* On Windows, cursor CLI ships as `cursor-agent.cmd` which requires `shell: true`,
|
|
316
316
|
* but cmd.exe mangles long `-p` arguments (8191-char limit + special chars).
|
|
317
|
-
* Solution: write prompt to a temp file, invoke agent via PowerShell which
|
|
317
|
+
* Solution: write prompt to a temp file, invoke cursor-agent via PowerShell which
|
|
318
318
|
* reads the file and passes the content as `-p`. PowerShell handles long
|
|
319
319
|
* strings natively (32K limit) and doesn't mangle arguments.
|
|
320
320
|
*
|
|
321
|
-
* On Linux/macOS, spawn `agent` directly — no shell needed.
|
|
321
|
+
* On Linux/macOS, spawn `cursor-agent` directly — no shell needed.
|
|
322
322
|
*/
|
|
323
323
|
spawnAgent(prompt, args, options) {
|
|
324
324
|
const { CLAUDECODE: _, ...cleanEnv } = process.env;
|
|
@@ -330,7 +330,7 @@ export class CursorExecutorService {
|
|
|
330
330
|
// Build the agent args WITHOUT -p and the prompt (they go via temp file)
|
|
331
331
|
const agentFlags = args.filter((a) => a !== '-p' && a !== prompt).join(' ');
|
|
332
332
|
const safePath = tmpFile.replace(/'/g, "''");
|
|
333
|
-
const psCmd = `$p = Get-Content -Raw '${safePath}'; & agent ${agentFlags} -p $p`;
|
|
333
|
+
const psCmd = `$p = Get-Content -Raw '${safePath}'; & cursor-agent ${agentFlags} -p $p`;
|
|
334
334
|
this.log(`Windows PowerShell mode: wrote ${prompt.length} chars to ${tmpFile}`);
|
|
335
335
|
this.log(`PS command: ${psCmd.replace(prompt, `<${prompt.length} chars>`)}`);
|
|
336
336
|
const proc = this.spawn('powershell.exe', ['-NoProfile', '-NonInteractive', '-Command', psCmd], {
|
|
@@ -351,9 +351,9 @@ export class CursorExecutorService {
|
|
|
351
351
|
};
|
|
352
352
|
if (cwd)
|
|
353
353
|
spawnOpts.cwd = cwd;
|
|
354
|
-
this.log(`Spawning: agent ${args.map((a) => (a.length > 80 ? `${a.slice(0, 77)}...` : a)).join(' ')}`);
|
|
354
|
+
this.log(`Spawning: cursor-agent ${args.map((a) => (a.length > 80 ? `${a.slice(0, 77)}...` : a)).join(' ')}`);
|
|
355
355
|
this.log(`Spawn cwd: ${cwd ?? '(inherited)'}`);
|
|
356
|
-
const proc = this.spawn('agent', args, spawnOpts);
|
|
356
|
+
const proc = this.spawn('cursor-agent', args, spawnOpts);
|
|
357
357
|
this.log(`Subprocess PID: ${proc.pid ?? 'undefined (spawn may have failed)'}`);
|
|
358
358
|
if (proc.stdin)
|
|
359
359
|
proc.stdin.end();
|
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,
|
|
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;AAE5E,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;;;OAGG;IACH,UAAU,IAAI,IAAI;IA4ClB;;;OAGG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,SAAe,GAAG,IAAI;IA0G5E;;;;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;CASpB"}
|
|
@@ -9,18 +9,17 @@
|
|
|
9
9
|
* On startup, call `recoverAll()` to reconcile the DB with actual
|
|
10
10
|
* process state (clean up dead PIDs, re-adopt live ones).
|
|
11
11
|
*/
|
|
12
|
-
import { spawn } from 'node:child_process';
|
|
12
|
+
import { spawn, execFileSync } from 'node:child_process';
|
|
13
13
|
import { EventEmitter } from 'node:events';
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
// signals to the process GROUP (since we spawn with detached: true, the
|
|
18
|
-
// child gets its own process group via setsid()).
|
|
14
|
+
// On Unix we use process.kill(-pid) to send signals to the process GROUP
|
|
15
|
+
// (detached: true puts the child in its own group via setsid()).
|
|
16
|
+
// On Windows, negative PIDs are not supported — use taskkill /T for tree kill.
|
|
19
17
|
import { DeploymentState } from '../../../domain/generated/output.js';
|
|
20
18
|
import { detectDevScript } from './detect-dev-script.js';
|
|
21
19
|
import { createDeploymentLogger } from './deployment-logger.js';
|
|
22
20
|
import { parsePort } from './parse-port.js';
|
|
23
21
|
import { LogRingBuffer } from './log-ring-buffer.js';
|
|
22
|
+
import { IS_WINDOWS } from '../../platform.js';
|
|
24
23
|
const log = createDeploymentLogger('[DeploymentService]');
|
|
25
24
|
const POLL_INTERVAL_MS = 200;
|
|
26
25
|
const MAX_WAIT_MS = 5000;
|
|
@@ -28,6 +27,20 @@ const defaultDeps = {
|
|
|
28
27
|
spawn,
|
|
29
28
|
detectDevScript,
|
|
30
29
|
kill: (pid, signal) => {
|
|
30
|
+
if (IS_WINDOWS) {
|
|
31
|
+
// On Windows, negative PIDs are not supported. Use taskkill /T to
|
|
32
|
+
// kill the entire process tree (shell + child dev server).
|
|
33
|
+
try {
|
|
34
|
+
execFileSync('taskkill', ['/F', '/T', '/PID', String(pid)], {
|
|
35
|
+
stdio: 'ignore',
|
|
36
|
+
windowsHide: true,
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
catch {
|
|
40
|
+
// Process already dead
|
|
41
|
+
}
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
31
44
|
try {
|
|
32
45
|
// Kill the entire process group (negative PID) — safe because
|
|
33
46
|
// detached: true puts the child in its own group via setsid().
|
|
@@ -132,13 +145,34 @@ export class DeploymentService {
|
|
|
132
145
|
throw new Error(detection.error);
|
|
133
146
|
}
|
|
134
147
|
// Build spawn args based on package manager
|
|
135
|
-
const { packageManager, scriptName, command } = detection;
|
|
148
|
+
const { packageManager, scriptName, command, needsInstall } = detection;
|
|
136
149
|
const args = packageManager === 'npm' ? ['run', scriptName] : [scriptName];
|
|
150
|
+
// Install dependencies if node_modules is missing (e.g. fresh worktree)
|
|
151
|
+
if (needsInstall) {
|
|
152
|
+
log.info(`node_modules missing in "${targetPath}" — running ${packageManager} install`);
|
|
153
|
+
try {
|
|
154
|
+
execFileSync(packageManager, ['install'], {
|
|
155
|
+
cwd: targetPath,
|
|
156
|
+
shell: true,
|
|
157
|
+
stdio: 'ignore',
|
|
158
|
+
...(IS_WINDOWS ? { windowsHide: true } : {}),
|
|
159
|
+
});
|
|
160
|
+
log.info('Dependencies installed successfully');
|
|
161
|
+
}
|
|
162
|
+
catch (err) {
|
|
163
|
+
log.error(`Dependency install failed: ${err}`);
|
|
164
|
+
throw new Error(`Failed to install dependencies: ${err}`);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
137
167
|
log.info(`Spawning dev server: command="${command}", packageManager="${packageManager}", scriptName="${scriptName}", cwd="${targetPath}"`);
|
|
138
168
|
const child = this.deps.spawn(packageManager, args, {
|
|
139
169
|
shell: true,
|
|
140
170
|
cwd: targetPath,
|
|
141
|
-
detached: true
|
|
171
|
+
// On Unix, detached: true creates a process group via setsid() so we can
|
|
172
|
+
// kill the entire tree with process.kill(-pid). On Windows this flag causes
|
|
173
|
+
// CREATE_NEW_CONSOLE which opens a visible terminal window and disconnects
|
|
174
|
+
// stdout/stderr — we don't need it because taskkill /F /T handles tree kill.
|
|
175
|
+
...(IS_WINDOWS ? { windowsHide: true } : { detached: true }),
|
|
142
176
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
143
177
|
});
|
|
144
178
|
if (!child.pid) {
|
package/dist/packages/core/src/infrastructure/services/deployment/detect-dev-script.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"detect-dev-script.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/deployment/detect-dev-script.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgBH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,IAAI,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"detect-dev-script.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/deployment/detect-dev-script.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgBH,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,IAAI,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,GAAG,oBAAoB,CAAC;AAIlF;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,qBAAqB,CAwCtE"}
|
|
@@ -50,8 +50,9 @@ export function detectDevScript(dirPath) {
|
|
|
50
50
|
const packageManager = detectPackageManager(dirPath);
|
|
51
51
|
// Build the command — pnpm/yarn use `<pm> <script>`, npm uses `npm run <script>`
|
|
52
52
|
const command = packageManager === 'npm' ? `npm run ${scriptName}` : `${packageManager} ${scriptName}`;
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
const needsInstall = !existsSync(join(dirPath, 'node_modules'));
|
|
54
|
+
log.info(`detected — packageManager="${packageManager}", scriptName="${scriptName}", command="${command}", needsInstall=${needsInstall}`);
|
|
55
|
+
return { success: true, packageManager, scriptName, command, needsInstall };
|
|
55
56
|
}
|
|
56
57
|
/**
|
|
57
58
|
* Detect the package manager by checking for lockfile presence.
|