@shepai/cli 1.122.2-pr381.7d9e407 → 1.122.2-pr390.b1ef40f
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-executor-factory.service.js +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/cursor-executor.service.d.ts +8 -28
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/cursor-executor.service.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/common/executors/cursor-executor.service.js +29 -187
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.js +0 -9
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.d.ts +0 -5
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.js +54 -82
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.d.ts +1 -1
- package/dist/packages/core/src/infrastructure/services/agents/feature-agent/nodes/node-helpers.js +2 -2
- package/dist/src/presentation/web/app/(dashboard)/get-graph-data.d.ts +6 -0
- package/dist/src/presentation/web/app/(dashboard)/get-graph-data.d.ts.map +1 -1
- package/dist/src/presentation/web/app/(dashboard)/get-graph-data.js +60 -0
- package/dist/src/presentation/web/app/build-graph-nodes.d.ts +7 -0
- package/dist/src/presentation/web/app/build-graph-nodes.d.ts.map +1 -1
- package/dist/src/presentation/web/app/build-graph-nodes.js +7 -0
- package/dist/src/presentation/web/components/common/repository-node/repository-node-config.d.ts +8 -0
- package/dist/src/presentation/web/components/common/repository-node/repository-node-config.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/repository-node/repository-node.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/repository-node/repository-node.js +6 -6
- package/dist/src/presentation/web/components/common/repository-node/repository-node.stories.d.ts +2 -0
- package/dist/src/presentation/web/components/common/repository-node/repository-node.stories.d.ts.map +1 -1
- package/dist/src/presentation/web/components/common/repository-node/repository-node.stories.js +107 -17
- package/dist/src/presentation/web/lib/layout-with-dagre.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 +1 -1
- package/web/.next/required-server-files.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +22 -22
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js +2 -2
- 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 +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page.js +3 -3
- 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 +28 -28
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/page.js +3 -3
- 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 +20 -20
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +2 -2
- 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 +22 -22
- package/web/.next/server/app/(dashboard)/create/page.js +2 -2
- 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 +28 -28
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page.js +3 -3
- 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 +28 -28
- package/web/.next/server/app/(dashboard)/feature/[featureId]/page.js +3 -3
- 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 +20 -20
- package/web/.next/server/app/(dashboard)/page.js +2 -2
- 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 +20 -20
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +2 -2
- 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 +1 -1
- package/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/api/graph-data/route.js +1 -1
- package/web/.next/server/app/api/graph-data/route.js.nft.json +1 -1
- package/web/.next/server/app/settings/page/server-reference-manifest.json +6 -6
- 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 +6 -6
- package/web/.next/server/app/skills/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/tools/page/server-reference-manifest.json +6 -6
- 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 +1 -1
- package/web/.next/server/app/version/page_client-reference-manifest.js +1 -1
- package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js +1 -1
- package/web/.next/server/chunks/403f9_next_dist_esm_build_templates_app-route_370c43b1.js.map +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__a402b567._.js +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__dcd4f847._.js +3 -0
- package/web/.next/server/chunks/{[root-of-the-server]__42b7ab55._.js.map → [root-of-the-server]__dcd4f847._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_31ea46d3._.js +1 -1
- package/web/.next/server/chunks/ssr/403f9_next_dist_c9d9b4d7._.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/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_f30d0343.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_f30d0343.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_9f1775bb.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_9f1775bb.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__06fef644._.js +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__a022445f._.js → [root-of-the-server]__14664e9b._.js} +3 -3
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__a022445f._.js.map → [root-of-the-server]__14664e9b._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__545792ab._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6677a82c._.js +3 -0
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__b724df9e._.js.map → [root-of-the-server]__6677a82c._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__6b17a22d._.js.map +1 -1
- 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]__8e3bf5d7._.js → [root-of-the-server]__7cbda1ea._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__8e3bf5d7._.js.map → [root-of-the-server]__7cbda1ea._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__804c006d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8c553503._.js +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__2698e9f4._.js → [root-of-the-server]__9e8b25ad._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__2698e9f4._.js.map → [root-of-the-server]__9e8b25ad._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a7de2711._.js +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__c07f9f79._.js → [root-of-the-server]__aed1d6f8._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__c07f9f79._.js.map → [root-of-the-server]__aed1d6f8._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__c605a375._.js → [root-of-the-server]__ce6057f6._.js} +2 -2
- package/web/.next/server/chunks/ssr/{[root-of-the-server]__c605a375._.js.map → [root-of-the-server]__ce6057f6._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e7258841._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__e7258841._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_135edb9c._.js +1 -1
- package/web/.next/server/chunks/ssr/_135edb9c._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_434878d3._.js → _15fe9326._.js} +2 -2
- package/web/.next/server/chunks/ssr/_15fe9326._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_2f6f48b8._.js +1 -1
- package/web/.next/server/chunks/ssr/_2f6f48b8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_3a4c94e3._.js +1 -1
- package/web/.next/server/chunks/ssr/_90a34ae9._.js +3 -0
- package/web/.next/server/chunks/ssr/{_204ecb5a._.js.map → _90a34ae9._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_b56e7571._.js +3 -0
- package/web/.next/server/chunks/ssr/_b56e7571._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_cc77a143._.js +1 -1
- package/web/.next/server/chunks/ssr/_cc77a143._.js.map +1 -1
- package/web/.next/server/chunks/ssr/_e9703421._.js +3 -0
- package/web/.next/server/chunks/ssr/_e9703421._.js.map +1 -0
- package/web/.next/server/chunks/ssr/_f096ab6a._.js +3 -0
- package/web/.next/server/chunks/ssr/_f096ab6a._.js.map +1 -0
- 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/node_modules__pnpm_bc66dcc6._.js +3 -0
- package/web/.next/server/chunks/ssr/node_modules__pnpm_bc66dcc6._.js.map +1 -0
- package/web/.next/server/chunks/ssr/src_presentation_web_5f039db1._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_5f039db1._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_2a52b697.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_2a52b697.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_c4337169._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_c4337169._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_ca99d62d._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_bf50c527._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web_components_de814675._.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 +34 -34
- package/web/.next/static/chunks/{89ffd07cdb158389.js → 24a0b215d72d8f26.js} +1 -1
- package/web/.next/static/chunks/{50bf223ed146d4ed.js → 2c0cf874cda01236.js} +1 -1
- package/web/.next/static/chunks/4232eb19944a519e.js +1 -0
- package/web/.next/static/chunks/4443ee9c7733399b.js +1 -0
- package/web/.next/static/chunks/6b8c3e3d8d4ee08e.js +1 -0
- package/web/.next/static/chunks/{df88f3e08b196bbf.js → 9fba6bb38ff0cb38.js} +2 -2
- package/web/.next/static/chunks/a58429fc5be52aad.js +1 -0
- package/web/.next/static/chunks/b200a40ffcc15eb7.css +1 -0
- package/web/.next/static/chunks/{2c0191c062d5f7ae.js → b67d183d3c074a4c.js} +2 -2
- package/web/.next/static/chunks/ca946dcbfbb2df74.js +1 -0
- package/web/.next/static/chunks/{19401b65e1298cb0.js → cd2bb43fe9138791.js} +1 -1
- package/web/.next/static/chunks/d2bfdee31e1a7d8d.js +1 -0
- package/web/.next/static/chunks/{4da275e6ef808c4d.js → fadc79bbbae100a7.js} +1 -1
- package/web/.next/server/chunks/[root-of-the-server]__42b7ab55._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9f155c0e._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__9f155c0e._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b724df9e._.js +0 -3
- package/web/.next/server/chunks/ssr/_0dc2cfd3._.js +0 -3
- package/web/.next/server/chunks/ssr/_0dc2cfd3._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_204ecb5a._.js +0 -3
- package/web/.next/server/chunks/ssr/_434878d3._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_510be09a._.js +0 -3
- package/web/.next/server/chunks/ssr/_510be09a._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_75f4ccb3._.js +0 -3
- package/web/.next/server/chunks/ssr/_75f4ccb3._.js.map +0 -1
- package/web/.next/server/chunks/ssr/node_modules__pnpm_b59e4b16._.js +0 -3
- package/web/.next/server/chunks/ssr/node_modules__pnpm_b59e4b16._.js.map +0 -1
- package/web/.next/static/chunks/0d2af96e64960ef5.css +0 -1
- package/web/.next/static/chunks/4562ee849ea13c3a.js +0 -1
- package/web/.next/static/chunks/5a9e671eb04de758.js +0 -1
- package/web/.next/static/chunks/6a8fb1992b738cc9.js +0 -1
- package/web/.next/static/chunks/845d8e58a91014e6.js +0 -1
- package/web/.next/static/chunks/a637e16d364af323.js +0 -1
- package/web/.next/static/chunks/bc1ce100834f414a.js +0 -1
- /package/web/.next/static/{NKkt3_PEmNxKD_ihRAzNE → Fr059mDxLxW71ARoHnB8W}/_buildManifest.js +0 -0
- /package/web/.next/static/{NKkt3_PEmNxKD_ihRAzNE → Fr059mDxLxW71ARoHnB8W}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{NKkt3_PEmNxKD_ihRAzNE → Fr059mDxLxW71ARoHnB8W}/_ssgManifest.js +0 -0
|
@@ -45,7 +45,7 @@ export class AgentExecutorFactory {
|
|
|
45
45
|
executor = new ClaudeCodeExecutorService(this.spawn);
|
|
46
46
|
break;
|
|
47
47
|
case 'cursor':
|
|
48
|
-
executor = new CursorExecutorService(this.spawn
|
|
48
|
+
executor = new CursorExecutorService(this.spawn);
|
|
49
49
|
break;
|
|
50
50
|
case 'dev':
|
|
51
51
|
executor = new DevAgentExecutorService();
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Uses constructor dependency injection for the spawn function
|
|
9
9
|
* to enable testability without mocking node:child_process directly.
|
|
10
10
|
*/
|
|
11
|
-
import type { AgentType, AgentFeature
|
|
11
|
+
import type { AgentType, AgentFeature } from '../../../../../domain/generated/output.js';
|
|
12
12
|
import type { IAgentExecutor, AgentExecutionOptions, AgentExecutionResult, AgentExecutionStreamEvent } from '../../../../../application/ports/output/agents/agent-executor.interface.js';
|
|
13
13
|
import type { SpawnFunction } from '../types.js';
|
|
14
14
|
/**
|
|
@@ -17,11 +17,10 @@ import type { SpawnFunction } from '../types.js';
|
|
|
17
17
|
*/
|
|
18
18
|
export declare class CursorExecutorService implements IAgentExecutor {
|
|
19
19
|
private readonly spawn;
|
|
20
|
-
private readonly authConfig?;
|
|
21
20
|
readonly agentType: AgentType;
|
|
22
21
|
/** When true, suppresses debug logging (set per-call via options.silent) */
|
|
23
22
|
private silent;
|
|
24
|
-
constructor(spawn: SpawnFunction
|
|
23
|
+
constructor(spawn: SpawnFunction);
|
|
25
24
|
/** Debug logging — writes to stdout so it appears in the worker log file */
|
|
26
25
|
private log;
|
|
27
26
|
supportsFeature(feature: AgentFeature): boolean;
|
|
@@ -34,35 +33,16 @@ export declare class CursorExecutorService implements IAgentExecutor {
|
|
|
34
33
|
private buildArgs;
|
|
35
34
|
private buildStreamArgs;
|
|
36
35
|
/**
|
|
37
|
-
*
|
|
36
|
+
* Spawn the agent process, handling Windows specially via PowerShell.
|
|
38
37
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* PowerShell → agent.cmd → PowerShell → cursor-agent.ps1 → node.exe
|
|
45
|
-
* This chain hangs on Windows CI runners. Direct invocation bypasses it.
|
|
46
|
-
*
|
|
47
|
-
* @returns `{ nodePath, indexPath }` or `undefined` if not found
|
|
48
|
-
*/
|
|
49
|
-
private resolveCursorBinary;
|
|
50
|
-
/**
|
|
51
|
-
* Spawn the agent process, handling Windows specially.
|
|
52
|
-
*
|
|
53
|
-
* On Windows, the cursor CLI ships as `agent.cmd` which spawns PowerShell
|
|
54
|
-
* which runs `cursor-agent.ps1` which runs `node.exe index.js`. This triple
|
|
55
|
-
* nesting (PowerShell → cmd.exe → PowerShell → node.exe) hangs on Windows
|
|
56
|
-
* CI runners. Solution: resolve the cursor CLI's bundled `node.exe` and
|
|
57
|
-
* `index.js` directly, bypassing all shell wrappers.
|
|
38
|
+
* On Windows, cursor CLI ships as `agent.cmd` which requires `shell: true`,
|
|
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
|
|
41
|
+
* reads the file and passes the content as `-p`. PowerShell handles long
|
|
42
|
+
* strings natively (32K limit) and doesn't mangle arguments.
|
|
58
43
|
*
|
|
59
44
|
* On Linux/macOS, spawn `agent` directly — no shell needed.
|
|
60
45
|
*/
|
|
61
|
-
/**
|
|
62
|
-
* Build the subprocess environment: strip CLAUDECODE, inject CURSOR_API_KEY
|
|
63
|
-
* from authConfig when token auth is configured.
|
|
64
|
-
*/
|
|
65
|
-
private buildEnv;
|
|
66
46
|
private spawnAgent;
|
|
67
47
|
private parseStreamLine;
|
|
68
48
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cursor-executor.service.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/core/src/infrastructure/services/agents/common/executors/cursor-executor.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"cursor-executor.service.d.ts","sourceRoot":"","sources":["../../../../../../../../../packages/core/src/infrastructure/services/agents/common/executors/cursor-executor.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAC;AACzF,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EAC1B,MAAM,4EAA4E,CAAC;AACpF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAuBjD;;;GAGG;AACH,qBAAa,qBAAsB,YAAW,cAAc;IAM9C,OAAO,CAAC,QAAQ,CAAC,KAAK;IALlC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAyB;IAEtD,4EAA4E;IAC5E,OAAO,CAAC,MAAM,CAAS;gBAEM,KAAK,EAAE,aAAa;IAEjD,4EAA4E;IAC5E,OAAO,CAAC,GAAG;IAMX,eAAe,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO;IAIzC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAoItF,aAAa,CAClB,MAAM,EAAE,MAAM,EACd,OAAO,CAAC,EAAE,qBAAqB,GAC9B,aAAa,CAAC,yBAAyB,CAAC;IAkF3C;;OAEG;IACH,OAAO,CAAC,cAAc;IAkCtB,OAAO,CAAC,SAAS;IASjB,OAAO,CAAC,eAAe;IAOvB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,UAAU;IA2DlB,OAAO,CAAC,eAAe;CAgDxB"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Uses constructor dependency injection for the spawn function
|
|
9
9
|
* to enable testability without mocking node:child_process directly.
|
|
10
10
|
*/
|
|
11
|
-
import { writeFileSync, unlinkSync
|
|
11
|
+
import { writeFileSync, unlinkSync } from 'node:fs';
|
|
12
12
|
import { execFileSync } from 'node:child_process';
|
|
13
13
|
import { tmpdir } from 'node:os';
|
|
14
14
|
import { join } from 'node:path';
|
|
@@ -36,13 +36,11 @@ const SUPPORTED_FEATURES = new Set(['session-resume', 'streaming']);
|
|
|
36
36
|
*/
|
|
37
37
|
export class CursorExecutorService {
|
|
38
38
|
spawn;
|
|
39
|
-
authConfig;
|
|
40
39
|
agentType = 'cursor';
|
|
41
40
|
/** When true, suppresses debug logging (set per-call via options.silent) */
|
|
42
41
|
silent = false;
|
|
43
|
-
constructor(spawn
|
|
42
|
+
constructor(spawn) {
|
|
44
43
|
this.spawn = spawn;
|
|
45
|
-
this.authConfig = authConfig;
|
|
46
44
|
}
|
|
47
45
|
/** Debug logging — writes to stdout so it appears in the worker log file */
|
|
48
46
|
log(message) {
|
|
@@ -60,34 +58,19 @@ export class CursorExecutorService {
|
|
|
60
58
|
// stream-json is unreliable on Windows where shell: true can mangle args.
|
|
61
59
|
const args = this.buildArgs(prompt, options);
|
|
62
60
|
const { proc, tmpFile } = this.spawnAgent(prompt, args, options);
|
|
63
|
-
// Diagnostic: verify streams are connected and process is alive
|
|
64
|
-
this.log(`[diag] proc.pid=${proc.pid}, killed=${proc.killed}`);
|
|
65
|
-
this.log(`[diag] stdout=${!!proc.stdout}, stderr=${!!proc.stderr}, stdin=${!!proc.stdin}`);
|
|
66
|
-
this.log(`[diag] CURSOR_API_KEY set=${!!process.env.CURSOR_API_KEY}, len=${process.env.CURSOR_API_KEY?.length ?? 0}`);
|
|
67
|
-
this.log(`[diag] authConfig.token set=${!!this.authConfig?.token}, method=${this.authConfig?.authMethod ?? 'none'}`);
|
|
68
|
-
this.log(`[diag] platform=${process.platform}, cwd=${options?.cwd ?? '(inherited)'}`);
|
|
69
61
|
return new Promise((resolve, reject) => {
|
|
70
62
|
let lineBuffer = '';
|
|
71
63
|
let stderr = '';
|
|
72
64
|
let timedOut = false;
|
|
73
65
|
let timeoutId;
|
|
74
|
-
let stdoutChunks = 0;
|
|
75
|
-
let stderrChunks = 0;
|
|
76
|
-
const startTime = Date.now();
|
|
77
66
|
// Accumulated from JSON events or raw text fallback
|
|
78
67
|
let resultText = '';
|
|
79
68
|
let rawText = '';
|
|
80
69
|
let sessionId;
|
|
81
70
|
let metadata;
|
|
82
|
-
// Periodic heartbeat to prove the executor is alive and waiting
|
|
83
|
-
const heartbeatId = setInterval(() => {
|
|
84
|
-
const elapsed = Math.round((Date.now() - startTime) / 1000);
|
|
85
|
-
this.log(`[diag] heartbeat ${elapsed}s: stdout_chunks=${stdoutChunks}, stderr_chunks=${stderrChunks}, pid_killed=${proc.killed}`);
|
|
86
|
-
}, 15_000);
|
|
87
71
|
if (options?.timeout) {
|
|
88
72
|
timeoutId = setTimeout(() => {
|
|
89
73
|
timedOut = true;
|
|
90
|
-
this.log(`[diag] TIMEOUT after ${options.timeout}ms — killing process tree`);
|
|
91
74
|
// On Windows, proc.kill() may not kill the entire process tree
|
|
92
75
|
// (PowerShell + child agent process). Use taskkill /T for tree kill.
|
|
93
76
|
if (process.platform === 'win32' && proc.pid) {
|
|
@@ -95,11 +78,9 @@ export class CursorExecutorService {
|
|
|
95
78
|
execFileSync('taskkill', ['/F', '/T', '/PID', String(proc.pid)], {
|
|
96
79
|
stdio: 'ignore',
|
|
97
80
|
});
|
|
98
|
-
this.log(`[diag] taskkill /T /PID ${proc.pid} succeeded`);
|
|
99
81
|
}
|
|
100
82
|
catch {
|
|
101
83
|
proc.kill();
|
|
102
|
-
this.log(`[diag] taskkill failed, fell back to proc.kill()`);
|
|
103
84
|
}
|
|
104
85
|
}
|
|
105
86
|
else {
|
|
@@ -126,35 +107,17 @@ export class CursorExecutorService {
|
|
|
126
107
|
if (parsed.duration_ms !== undefined) {
|
|
127
108
|
metadata = { ...metadata, duration_ms: parsed.duration_ms };
|
|
128
109
|
}
|
|
129
|
-
if (parsed.is_error) {
|
|
130
|
-
this.log(`[diag] result event has is_error=true: ${JSON.stringify(parsed).slice(0, 300)}`);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
else if (parsed.type === 'error') {
|
|
134
|
-
this.log(`[diag] cursor error event: ${JSON.stringify(parsed).slice(0, 500)}`);
|
|
135
|
-
}
|
|
136
|
-
else if (parsed.type !== 'user' &&
|
|
137
|
-
parsed.type !== 'system' &&
|
|
138
|
-
parsed.type !== 'thinking' &&
|
|
139
|
-
parsed.type !== 'tool_call') {
|
|
140
|
-
this.log(`[diag] unknown event type="${parsed.type}": ${JSON.stringify(parsed).slice(0, 300)}`);
|
|
141
110
|
}
|
|
111
|
+
// user, system, thinking events: logged but don't affect result
|
|
142
112
|
}
|
|
143
113
|
catch {
|
|
144
114
|
// Non-JSON output — accumulate as raw text fallback
|
|
145
|
-
if (line.length > 0)
|
|
115
|
+
if (line.length > 0)
|
|
146
116
|
rawText += `${line}\n`;
|
|
147
|
-
this.log(`[diag] non-JSON line (${line.length} chars): ${line.slice(0, 200)}`);
|
|
148
|
-
}
|
|
149
117
|
}
|
|
150
118
|
};
|
|
151
119
|
proc.stdout?.on('data', (chunk) => {
|
|
152
|
-
|
|
153
|
-
const data = chunk.toString();
|
|
154
|
-
if (stdoutChunks <= 3) {
|
|
155
|
-
this.log(`[diag] stdout chunk #${stdoutChunks}: ${data.length} bytes, first 200: ${data.slice(0, 200).replace(/\n/g, '\\n')}`);
|
|
156
|
-
}
|
|
157
|
-
lineBuffer += data;
|
|
120
|
+
lineBuffer += chunk.toString();
|
|
158
121
|
const lines = lineBuffer.split('\n');
|
|
159
122
|
lineBuffer = lines.pop() ?? '';
|
|
160
123
|
for (const line of lines) {
|
|
@@ -164,22 +127,19 @@ export class CursorExecutorService {
|
|
|
164
127
|
}
|
|
165
128
|
});
|
|
166
129
|
proc.stderr?.on('data', (chunk) => {
|
|
167
|
-
stderrChunks++;
|
|
168
130
|
const data = chunk.toString();
|
|
169
131
|
stderr += data;
|
|
170
|
-
this.log(`
|
|
132
|
+
this.log(`stderr: ${data.trimEnd()}`);
|
|
171
133
|
// Detect fatal errors early so callers don't waste time retrying
|
|
172
134
|
if (data.includes('Cannot use this model')) {
|
|
173
135
|
if (timeoutId)
|
|
174
136
|
clearTimeout(timeoutId);
|
|
175
|
-
clearInterval(heartbeatId);
|
|
176
137
|
proc.kill();
|
|
177
138
|
reject(new Error(data.trim()));
|
|
178
139
|
}
|
|
179
140
|
});
|
|
180
141
|
proc.on('error', (error) => {
|
|
181
|
-
this.log(`
|
|
182
|
-
clearInterval(heartbeatId);
|
|
142
|
+
this.log(`Process error event: ${error.message}`);
|
|
183
143
|
if (timeoutId)
|
|
184
144
|
clearTimeout(timeoutId);
|
|
185
145
|
if (error.code === 'ENOENT') {
|
|
@@ -190,8 +150,6 @@ export class CursorExecutorService {
|
|
|
190
150
|
}
|
|
191
151
|
});
|
|
192
152
|
proc.on('close', (code) => {
|
|
193
|
-
const elapsed = Math.round((Date.now() - startTime) / 1000);
|
|
194
|
-
clearInterval(heartbeatId);
|
|
195
153
|
// Clean up temp file on Windows
|
|
196
154
|
if (tmpFile) {
|
|
197
155
|
try {
|
|
@@ -205,7 +163,7 @@ export class CursorExecutorService {
|
|
|
205
163
|
processLine(lineBuffer.trim());
|
|
206
164
|
// Use raw text as fallback when no JSON result was captured
|
|
207
165
|
const finalText = resultText || rawText.trim();
|
|
208
|
-
this.log(`
|
|
166
|
+
this.log(`Process closed with code ${code}, result=${finalText.length} chars`);
|
|
209
167
|
if (timeoutId)
|
|
210
168
|
clearTimeout(timeoutId);
|
|
211
169
|
if (timedOut) {
|
|
@@ -213,17 +171,9 @@ export class CursorExecutorService {
|
|
|
213
171
|
return;
|
|
214
172
|
}
|
|
215
173
|
if (code !== 0 && code !== null) {
|
|
216
|
-
|
|
217
|
-
this.log(`[diag] non-zero exit — rejecting with: ${errMsg.slice(0, 200)}`);
|
|
218
|
-
reject(new Error(errMsg));
|
|
174
|
+
reject(new Error(stderr.trim() || `Process exited with code ${code}`));
|
|
219
175
|
return;
|
|
220
176
|
}
|
|
221
|
-
if (stdoutChunks === 0 && stderrChunks === 0) {
|
|
222
|
-
this.log(`[diag] WARNING: process exited with code 0 but produced ZERO output (stdout=0, stderr=0, elapsed=${elapsed}s)`);
|
|
223
|
-
}
|
|
224
|
-
if (!finalText && code === 0) {
|
|
225
|
-
this.log(`[diag] WARNING: process exited code=0 but result is empty (resultText=${resultText.length}, rawText=${rawText.length})`);
|
|
226
|
-
}
|
|
227
177
|
const result = { result: finalText };
|
|
228
178
|
if (sessionId)
|
|
229
179
|
result.sessionId = sessionId;
|
|
@@ -234,25 +184,20 @@ export class CursorExecutorService {
|
|
|
234
184
|
});
|
|
235
185
|
}
|
|
236
186
|
async *executeStream(prompt, options) {
|
|
237
|
-
this.silent = options?.silent ?? false;
|
|
238
187
|
const args = this.buildStreamArgs(prompt, options);
|
|
239
188
|
const { proc, tmpFile } = this.spawnAgent(prompt, args, options);
|
|
240
|
-
this.log(`[stream] pid=${proc.pid}, stdout=${!!proc.stdout}, stderr=${!!proc.stderr}`);
|
|
241
189
|
let lineBuffer = '';
|
|
242
190
|
let stderr = '';
|
|
243
|
-
let stdoutChunks = 0;
|
|
244
|
-
let stderrChunks = 0;
|
|
245
|
-
const startTime = Date.now();
|
|
246
191
|
const queue = [];
|
|
247
192
|
let resolve = null;
|
|
248
193
|
let error = null;
|
|
249
|
-
|
|
194
|
+
function enqueue(event) {
|
|
250
195
|
queue.push(event);
|
|
251
196
|
if (resolve) {
|
|
252
197
|
resolve();
|
|
253
198
|
resolve = null;
|
|
254
199
|
}
|
|
255
|
-
}
|
|
200
|
+
}
|
|
256
201
|
function waitForItem() {
|
|
257
202
|
if (queue.length > 0)
|
|
258
203
|
return Promise.resolve();
|
|
@@ -260,18 +205,8 @@ export class CursorExecutorService {
|
|
|
260
205
|
resolve = r;
|
|
261
206
|
});
|
|
262
207
|
}
|
|
263
|
-
// Heartbeat for stream mode too
|
|
264
|
-
const heartbeatId = setInterval(() => {
|
|
265
|
-
const elapsed = Math.round((Date.now() - startTime) / 1000);
|
|
266
|
-
this.log(`[stream] heartbeat ${elapsed}s: stdout_chunks=${stdoutChunks}, stderr_chunks=${stderrChunks}, pid_killed=${proc.killed}`);
|
|
267
|
-
}, 30_000);
|
|
268
208
|
proc.stdout?.on('data', (chunk) => {
|
|
269
|
-
|
|
270
|
-
const data = chunk.toString();
|
|
271
|
-
if (stdoutChunks <= 3) {
|
|
272
|
-
this.log(`[stream] stdout chunk #${stdoutChunks}: ${data.length} bytes`);
|
|
273
|
-
}
|
|
274
|
-
lineBuffer += data;
|
|
209
|
+
lineBuffer += chunk.toString();
|
|
275
210
|
const lines = lineBuffer.split('\n');
|
|
276
211
|
lineBuffer = lines.pop() ?? '';
|
|
277
212
|
for (const line of lines) {
|
|
@@ -284,21 +219,13 @@ export class CursorExecutorService {
|
|
|
284
219
|
}
|
|
285
220
|
});
|
|
286
221
|
proc.stderr?.on('data', (chunk) => {
|
|
287
|
-
|
|
288
|
-
const data = chunk.toString();
|
|
289
|
-
stderr += data;
|
|
290
|
-
this.log(`[stream] stderr chunk #${stderrChunks}: ${data.trimEnd()}`);
|
|
222
|
+
stderr += chunk.toString();
|
|
291
223
|
});
|
|
292
224
|
proc.on('error', (err) => {
|
|
293
|
-
this.log(`[stream] Process ERROR: ${err.message}`);
|
|
294
|
-
clearInterval(heartbeatId);
|
|
295
225
|
error = err;
|
|
296
226
|
enqueue(null);
|
|
297
227
|
});
|
|
298
228
|
proc.on('close', (code) => {
|
|
299
|
-
const elapsed = Math.round((Date.now() - startTime) / 1000);
|
|
300
|
-
clearInterval(heartbeatId);
|
|
301
|
-
this.log(`[stream] Process CLOSE: code=${code}, elapsed=${elapsed}s, stdout_chunks=${stdoutChunks}, stderr_chunks=${stderrChunks}`);
|
|
302
229
|
if (tmpFile) {
|
|
303
230
|
try {
|
|
304
231
|
unlinkSync(tmpFile);
|
|
@@ -312,10 +239,8 @@ export class CursorExecutorService {
|
|
|
312
239
|
if (event)
|
|
313
240
|
enqueue(event);
|
|
314
241
|
}
|
|
315
|
-
if (code !== 0 && code !== null) {
|
|
316
|
-
|
|
317
|
-
this.log(`[stream] non-zero exit: ${errMsg}`);
|
|
318
|
-
enqueue({ type: 'error', content: errMsg, timestamp: new Date() });
|
|
242
|
+
if (code !== 0 && code !== null && stderr.trim()) {
|
|
243
|
+
enqueue({ type: 'error', content: stderr.trim(), timestamp: new Date() });
|
|
319
244
|
}
|
|
320
245
|
enqueue(null);
|
|
321
246
|
});
|
|
@@ -361,10 +286,6 @@ export class CursorExecutorService {
|
|
|
361
286
|
}
|
|
362
287
|
if (parsed.type === 'user')
|
|
363
288
|
return; // Skip echoed input
|
|
364
|
-
// Log any unrecognized event type so nothing is silently dropped
|
|
365
|
-
if (!['assistant', 'tool_call', 'result', 'user', 'system', 'thinking'].includes(parsed.type)) {
|
|
366
|
-
this.log(`[diag] unhandled stream event type="${parsed.type}": ${line.slice(0, 200)}`);
|
|
367
|
-
}
|
|
368
289
|
}
|
|
369
290
|
catch {
|
|
370
291
|
if (line.length > 0)
|
|
@@ -389,115 +310,36 @@ export class CursorExecutorService {
|
|
|
389
310
|
return args;
|
|
390
311
|
}
|
|
391
312
|
/**
|
|
392
|
-
*
|
|
393
|
-
*
|
|
394
|
-
* The cursor CLI installs to `%LOCALAPPDATA%\cursor-agent\` with:
|
|
395
|
-
* - `agent.cmd` / `cursor-agent.ps1` (shell wrappers)
|
|
396
|
-
* - `versions/<YYYY.MM.DD-commit>/node.exe` + `index.js`
|
|
313
|
+
* Spawn the agent process, handling Windows specially via PowerShell.
|
|
397
314
|
*
|
|
398
|
-
*
|
|
399
|
-
*
|
|
400
|
-
*
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
*/
|
|
404
|
-
resolveCursorBinary() {
|
|
405
|
-
const localAppData = process.env.LOCALAPPDATA;
|
|
406
|
-
if (!localAppData) {
|
|
407
|
-
this.log('[diag] resolveCursorBinary: LOCALAPPDATA not set');
|
|
408
|
-
return undefined;
|
|
409
|
-
}
|
|
410
|
-
const versionsDir = join(localAppData, 'cursor-agent', 'versions');
|
|
411
|
-
if (!existsSync(versionsDir)) {
|
|
412
|
-
this.log(`[diag] resolveCursorBinary: versions dir not found: ${versionsDir}`);
|
|
413
|
-
return undefined;
|
|
414
|
-
}
|
|
415
|
-
// Find the latest version directory (format: YYYY.MM.DD-commit)
|
|
416
|
-
const versionPattern = /^\d{4}\.\d{1,2}\.\d{1,2}-[a-f0-9]+$/;
|
|
417
|
-
const versions = readdirSync(versionsDir)
|
|
418
|
-
.filter((d) => versionPattern.test(d))
|
|
419
|
-
.sort()
|
|
420
|
-
.reverse();
|
|
421
|
-
if (versions.length === 0) {
|
|
422
|
-
this.log(`[diag] resolveCursorBinary: no version dirs in ${versionsDir}`);
|
|
423
|
-
return undefined;
|
|
424
|
-
}
|
|
425
|
-
const versionDir = join(versionsDir, versions[0]);
|
|
426
|
-
const nodePath = join(versionDir, 'node.exe');
|
|
427
|
-
const indexPath = join(versionDir, 'index.js');
|
|
428
|
-
if (!existsSync(nodePath) || !existsSync(indexPath)) {
|
|
429
|
-
this.log(`[diag] resolveCursorBinary: missing binary — node=${existsSync(nodePath)}, index=${existsSync(indexPath)}`);
|
|
430
|
-
return undefined;
|
|
431
|
-
}
|
|
432
|
-
this.log(`[diag] resolveCursorBinary: resolved version=${versions[0]}`);
|
|
433
|
-
return { nodePath, indexPath };
|
|
434
|
-
}
|
|
435
|
-
/**
|
|
436
|
-
* Spawn the agent process, handling Windows specially.
|
|
437
|
-
*
|
|
438
|
-
* On Windows, the cursor CLI ships as `agent.cmd` which spawns PowerShell
|
|
439
|
-
* which runs `cursor-agent.ps1` which runs `node.exe index.js`. This triple
|
|
440
|
-
* nesting (PowerShell → cmd.exe → PowerShell → node.exe) hangs on Windows
|
|
441
|
-
* CI runners. Solution: resolve the cursor CLI's bundled `node.exe` and
|
|
442
|
-
* `index.js` directly, bypassing all shell wrappers.
|
|
315
|
+
* On Windows, cursor CLI ships as `agent.cmd` which requires `shell: true`,
|
|
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
|
|
318
|
+
* reads the file and passes the content as `-p`. PowerShell handles long
|
|
319
|
+
* strings natively (32K limit) and doesn't mangle arguments.
|
|
443
320
|
*
|
|
444
321
|
* On Linux/macOS, spawn `agent` directly — no shell needed.
|
|
445
322
|
*/
|
|
446
|
-
/**
|
|
447
|
-
* Build the subprocess environment: strip CLAUDECODE, inject CURSOR_API_KEY
|
|
448
|
-
* from authConfig when token auth is configured.
|
|
449
|
-
*/
|
|
450
|
-
buildEnv(extra) {
|
|
451
|
-
const { CLAUDECODE: _, ...cleanEnv } = process.env;
|
|
452
|
-
// Inject CURSOR_API_KEY from stored settings so the cursor CLI authenticates
|
|
453
|
-
// even when the env var isn't inherited (e.g. direct node.exe invocation on Windows).
|
|
454
|
-
if (this.authConfig?.authMethod === 'token' && this.authConfig.token) {
|
|
455
|
-
cleanEnv.CURSOR_API_KEY = this.authConfig.token;
|
|
456
|
-
this.log(`[diag] buildEnv: injected CURSOR_API_KEY from authConfig (${this.authConfig.token.length} chars)`);
|
|
457
|
-
}
|
|
458
|
-
else {
|
|
459
|
-
this.log(`[diag] buildEnv: NO token injection (authMethod=${this.authConfig?.authMethod ?? 'none'}, hasToken=${!!this.authConfig?.token}, envKey=${!!cleanEnv.CURSOR_API_KEY})`);
|
|
460
|
-
}
|
|
461
|
-
const env = extra ? { ...cleanEnv, ...extra } : cleanEnv;
|
|
462
|
-
this.log(`[diag] buildEnv: final CURSOR_API_KEY in env=${!!env.CURSOR_API_KEY}, len=${env.CURSOR_API_KEY?.length ?? 0}`);
|
|
463
|
-
return env;
|
|
464
|
-
}
|
|
465
323
|
spawnAgent(prompt, args, options) {
|
|
324
|
+
const { CLAUDECODE: _, ...cleanEnv } = process.env;
|
|
466
325
|
const cwd = options?.cwd;
|
|
467
326
|
if (IS_WINDOWS) {
|
|
468
|
-
|
|
469
|
-
if (resolved) {
|
|
470
|
-
// Direct invocation: node.exe index.js <args>
|
|
471
|
-
// No shell wrappers, no nesting, no hangs.
|
|
472
|
-
const directArgs = [resolved.indexPath, ...args];
|
|
473
|
-
this.log(`Windows direct mode: ${resolved.nodePath}`);
|
|
474
|
-
this.log(`Args: ${directArgs.map((a) => (a.length > 80 ? `${a.slice(0, 77)}...` : a)).join(' ')}`);
|
|
475
|
-
const proc = this.spawn(resolved.nodePath, directArgs, {
|
|
476
|
-
cwd,
|
|
477
|
-
stdio: ['pipe', 'pipe', 'pipe'],
|
|
478
|
-
windowsHide: true,
|
|
479
|
-
env: this.buildEnv({ CURSOR_INVOKED_AS: 'agent' }),
|
|
480
|
-
});
|
|
481
|
-
this.log(`Direct PID: ${proc.pid ?? 'undefined (spawn may have failed)'}`);
|
|
482
|
-
if (proc.stdin)
|
|
483
|
-
proc.stdin.end();
|
|
484
|
-
return { proc, tmpFile: undefined };
|
|
485
|
-
}
|
|
486
|
-
// Fallback: if direct resolution fails, use PowerShell + temp file
|
|
487
|
-
this.log('[diag] Windows fallback: cursor binary not resolved, using PowerShell + temp file');
|
|
327
|
+
// Write prompt to temp file to bypass cmd.exe argument mangling
|
|
488
328
|
const tmpFile = join(tmpdir(), `shep-cursor-${Date.now()}-${Math.random().toString(36).slice(2, 6)}.txt`);
|
|
489
329
|
writeFileSync(tmpFile, prompt, 'utf8');
|
|
330
|
+
// Build the agent args WITHOUT -p and the prompt (they go via temp file)
|
|
490
331
|
const agentFlags = args.filter((a) => a !== '-p' && a !== prompt).join(' ');
|
|
491
332
|
const safePath = tmpFile.replace(/'/g, "''");
|
|
492
333
|
const psCmd = `$p = Get-Content -Raw '${safePath}'; & agent ${agentFlags} -p $p`;
|
|
493
|
-
this.log(`
|
|
334
|
+
this.log(`Windows PowerShell mode: wrote ${prompt.length} chars to ${tmpFile}`);
|
|
335
|
+
this.log(`PS command: ${psCmd.replace(prompt, `<${prompt.length} chars>`)}`);
|
|
494
336
|
const proc = this.spawn('powershell.exe', ['-NoProfile', '-NonInteractive', '-Command', psCmd], {
|
|
495
337
|
cwd,
|
|
496
338
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
497
339
|
windowsHide: true,
|
|
498
|
-
env:
|
|
340
|
+
env: cleanEnv,
|
|
499
341
|
});
|
|
500
|
-
this.log(`
|
|
342
|
+
this.log(`PowerShell PID: ${proc.pid ?? 'undefined (spawn may have failed)'}`);
|
|
501
343
|
if (proc.stdin)
|
|
502
344
|
proc.stdin.end();
|
|
503
345
|
return { proc, tmpFile };
|
|
@@ -505,7 +347,7 @@ export class CursorExecutorService {
|
|
|
505
347
|
// Linux/macOS: spawn agent directly, no shell needed
|
|
506
348
|
const spawnOpts = {
|
|
507
349
|
stdio: ['pipe', 'pipe', 'pipe'],
|
|
508
|
-
env:
|
|
350
|
+
env: cleanEnv,
|
|
509
351
|
};
|
|
510
352
|
if (cwd)
|
|
511
353
|
spawnOpts.cwd = cwd;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-agent-worker.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.ts"],"names":[],"mappings":";AACA;;;;;;;;GAQG;AAEH,OAAO,kBAAkB,CAAC;AAe1B,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAW7F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAwE1D;AAgCD;;;GAGG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"feature-agent-worker.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.ts"],"names":[],"mappings":";AACA;;;;;;;;GAQG;AAEH,OAAO,kBAAkB,CAAC;AAe1B,OAAO,EAAiC,KAAK,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAW7F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CAwE1D;AAgCD;;;GAGG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CA0R/D"}
|
package/dist/packages/core/src/infrastructure/services/agents/feature-agent/feature-agent-worker.js
CHANGED
|
@@ -182,15 +182,6 @@ export async function runWorker(args) {
|
|
|
182
182
|
getDefaultBranch: (cwd) => gitPrService.getDefaultBranch(cwd),
|
|
183
183
|
verifyMerge: (cwd, featureBranch, baseBranch, premergeBaseSha) => gitPrService.verifyMerge(cwd, featureBranch, baseBranch, premergeBaseSha),
|
|
184
184
|
revParse: (cwd, ref) => gitPrService.revParse(cwd, ref),
|
|
185
|
-
commitAll: async (cwd, message) => {
|
|
186
|
-
try {
|
|
187
|
-
return await gitPrService.commitAll(cwd, message);
|
|
188
|
-
}
|
|
189
|
-
catch {
|
|
190
|
-
// commitAll throws when there's nothing to commit — return undefined
|
|
191
|
-
return undefined;
|
|
192
|
-
}
|
|
193
|
-
},
|
|
194
185
|
localMergeSquash: (cwd, featureBranch, baseBranch, commitMessage, hasRemote) => gitPrService.localMergeSquash(cwd, featureBranch, baseBranch, commitMessage, hasRemote),
|
|
195
186
|
featureRepository,
|
|
196
187
|
gitPrService,
|
|
@@ -36,11 +36,6 @@ export interface MergeNodeDeps {
|
|
|
36
36
|
* Resolve a branch ref to its current SHA.
|
|
37
37
|
*/
|
|
38
38
|
revParse: (cwd: string, ref: string) => Promise<string>;
|
|
39
|
-
/**
|
|
40
|
-
* Stage all changes and commit in the given directory.
|
|
41
|
-
* Returns the commit hash, or undefined if there was nothing to commit.
|
|
42
|
-
*/
|
|
43
|
-
commitAll: (cwd: string, message: string) => Promise<string | undefined>;
|
|
44
39
|
gitPrService: IGitPrService;
|
|
45
40
|
cleanupFeatureWorktreeUseCase: Pick<CleanupFeatureWorktreeUseCase, 'execute'>;
|
|
46
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.node.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+DAA+D,CAAC;AACpG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yEAAyE,CAAC;AAClH,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACd,MAAM,iEAAiE,CAAC;AAmBzE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uEAAuE,CAAC;AAE3H,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,cAAc,CAAC;IACzB,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;IAC1E,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACnD,iBAAiB,EAAE,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,QAAQ,CAAC,CAAC;IACnE;;OAEG;IACH,gBAAgB,EAAE,CAChB,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,SAAS,CAAC,EAAE,OAAO,KAChB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB;;;OAGG;IACH,WAAW,EAAE,CACX,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,eAAe,CAAC,EAAE,MAAM,KACrB,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACxD
|
|
1
|
+
{"version":3,"file":"merge.node.d.ts","sourceRoot":"","sources":["../../../../../../../../../../packages/core/src/infrastructure/services/agents/feature-agent/nodes/merge/merge.node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+DAA+D,CAAC;AACpG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yEAAyE,CAAC;AAClH,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACd,MAAM,iEAAiE,CAAC;AAmBzE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,uEAAuE,CAAC;AAE3H,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,cAAc,CAAC;IACzB,cAAc,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;IAC1E,SAAS,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC7C,gBAAgB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACnD,iBAAiB,EAAE,IAAI,CAAC,kBAAkB,EAAE,UAAU,GAAG,QAAQ,CAAC,CAAC;IACnE;;OAEG;IACH,gBAAgB,EAAE,CAChB,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,aAAa,EAAE,MAAM,EACrB,SAAS,CAAC,EAAE,OAAO,KAChB,OAAO,CAAC,IAAI,CAAC,CAAC;IACnB;;;OAGG;IACH,WAAW,EAAE,CACX,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,eAAe,CAAC,EAAE,MAAM,KACrB,OAAO,CAAC,OAAO,CAAC,CAAC;IACtB;;OAEG;IACH,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACxD,YAAY,EAAE,aAAa,CAAC;IAC5B,6BAA6B,EAAE,IAAI,CAAC,6BAA6B,EAAE,SAAS,CAAC,CAAC;CAC/E;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,aAAa,IAGnC,OAAO,iBAAiB,KAAG,OAAO,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CA+T7E"}
|