@shepai/cli 1.119.0 → 1.120.0-pr384.fdb89bb
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/application/ports/output/services/agent-deployment-service.interface.d.ts +46 -0
- package/dist/packages/core/src/application/ports/output/services/agent-deployment-service.interface.d.ts.map +1 -0
- package/dist/packages/core/src/application/ports/output/services/agent-deployment-service.interface.js +13 -0
- package/dist/packages/core/src/application/ports/output/services/deployment-service.interface.d.ts +9 -1
- package/dist/packages/core/src/application/ports/output/services/deployment-service.interface.d.ts.map +1 -1
- package/dist/packages/core/src/application/ports/output/services/dev-environment-agent.interface.d.ts +65 -0
- package/dist/packages/core/src/application/ports/output/services/dev-environment-agent.interface.d.ts.map +1 -0
- package/dist/packages/core/src/application/ports/output/services/dev-environment-agent.interface.js +14 -0
- package/dist/packages/core/src/infrastructure/di/container.d.ts.map +1 -1
- package/dist/packages/core/src/infrastructure/di/container.js +19 -0
- package/dist/packages/core/src/infrastructure/services/deployment/agent-deployment.service.d.ts +30 -0
- package/dist/packages/core/src/infrastructure/services/deployment/agent-deployment.service.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/deployment/agent-deployment.service.js +110 -0
- package/dist/packages/core/src/infrastructure/services/deployment/deployment.service.d.ts +6 -2
- 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 +30 -13
- package/dist/packages/core/src/infrastructure/services/deployment/dev-environment-agent.service.d.ts +35 -0
- package/dist/packages/core/src/infrastructure/services/deployment/dev-environment-agent.service.d.ts.map +1 -0
- package/dist/packages/core/src/infrastructure/services/deployment/dev-environment-agent.service.js +210 -0
- package/dist/src/presentation/web/app/actions/deploy-feature.d.ts +2 -1
- package/dist/src/presentation/web/app/actions/deploy-feature.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/deploy-feature.js +9 -6
- package/dist/src/presentation/web/app/actions/deploy-repository.d.ts +2 -1
- package/dist/src/presentation/web/app/actions/deploy-repository.d.ts.map +1 -1
- package/dist/src/presentation/web/app/actions/deploy-repository.js +9 -6
- package/dist/src/presentation/web/components/layouts/app-shell/app-shell.d.ts.map +1 -1
- package/dist/src/presentation/web/components/layouts/app-shell/app-shell.js +8 -3
- 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 +3 -3
- package/web/.next/required-server-files.json +3 -3
- package/web/.next/server/app/(dashboard)/@drawer/create/page/server-reference-manifest.json +21 -21
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/feature/[featureId]/[tab]/page/server-reference-manifest.json +27 -27
- 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 +27 -27
- 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 +19 -19
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/@drawer/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page/server-reference-manifest.json +21 -21
- package/web/.next/server/app/(dashboard)/create/page.js +1 -1
- package/web/.next/server/app/(dashboard)/create/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/create/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/feature/[featureId]/[tab]/page/server-reference-manifest.json +27 -27
- 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 +27 -27
- 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 +19 -19
- package/web/.next/server/app/(dashboard)/page.js +1 -1
- package/web/.next/server/app/(dashboard)/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page/server-reference-manifest.json +19 -19
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page.js.nft.json +1 -1
- package/web/.next/server/app/(dashboard)/repository/[repositoryId]/page_client-reference-manifest.js +1 -1
- package/web/.next/server/app/_global-error.html +2 -2
- package/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/server/app/_not-found/page/server-reference-manifest.json +1 -1
- 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 +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.js +1 -2
- 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 +6 -6
- package/web/.next/server/app/tools/page.js +1 -2
- 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/[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/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_ed372306.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_@drawer_repository_[repositoryId]_page_actions_ed372306.js.map +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_32e26434.js +1 -1
- package/web/.next/server/chunks/ssr/8ba4b_server_app_(dashboard)_repository_[repositoryId]_page_actions_32e26434.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0534f358._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__0534f358._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__06fef644._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__3b14e5a0._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__3b14e5a0._.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]__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]__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]__8b59c03e._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__8b59c03e._.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]__994ad9fe._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__994ad9fe._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__997ccfcc._.js +4 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__997ccfcc._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a022445f._.js +2 -2
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a022445f._.js.map +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a6c615b8._.js +3 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a6c615b8._.js.map +1 -0
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c9c1cfee._.js +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__c9c1cfee._.js.map +1 -1
- 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/_2f6f48b8._.js +1 -1
- package/web/.next/server/chunks/ssr/_2f6f48b8._.js.map +1 -1
- package/web/.next/server/chunks/ssr/{_aeb74a70._.js → _3b5f25fa._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_aeb74a70._.js.map → _3b5f25fa._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_3c9e300b._.js +3 -0
- package/web/.next/server/chunks/ssr/{_59ae996e._.js.map → _3c9e300b._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/{_bed4bbb9._.js → _83b11c33._.js} +2 -2
- package/web/.next/server/chunks/ssr/{_bed4bbb9._.js.map → _83b11c33._.js.map} +1 -1
- package/web/.next/server/chunks/ssr/_ab069e13._.js +1 -1
- package/web/.next/server/chunks/ssr/_ab069e13._.js.map +1 -1
- 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/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_0835b28e._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_0835b28e._.js.map +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_e99d78dd.js +1 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_(dashboard)_page_actions_e99d78dd.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_de814675._.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/chunks/ssr/src_presentation_web_e8034a29._.js +2 -2
- package/web/.next/server/chunks/ssr/src_presentation_web_e8034a29._.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 +33 -33
- package/web/.next/static/chunks/06702284aedb4e13.js +1 -0
- package/web/.next/static/chunks/{2b35632c1b784fae.js → 2f9dcf87c0a9c513.js} +1 -1
- package/web/.next/static/chunks/{3678617c34576e18.js → 57063722dbce9768.js} +2 -2
- package/web/.next/static/chunks/{ed113fb744f2e4d8.js → 652d07e1b3da6fd3.js} +1 -1
- package/web/.next/static/chunks/{7c57a9143e66868c.js → 6e9701fc52697f2b.js} +1 -1
- package/web/.next/static/chunks/{619af41a8d3232e5.js → 71161130b2462279.js} +1 -1
- package/web/.next/static/chunks/{f3c4a7bb76c69b01.js → 720858e147830a1b.js} +1 -1
- package/web/.next/static/chunks/{c1a6934d2281c088.js → 7da5a2bd92f03feb.js} +1 -1
- package/web/.next/static/chunks/{30097f88cdf8fad8.js → 83e2aac7e244633a.js} +1 -1
- package/web/.next/static/chunks/9e8ebcb706d0ca6f.js +1 -0
- package/web/.next/static/chunks/{69c6d3ba1606e98d.js → f81995913dac5269.js} +1 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a7de2711._.js +0 -4
- package/web/.next/server/chunks/ssr/[root-of-the-server]__a7de2711._.js.map +0 -1
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b724df9e._.js +0 -3
- package/web/.next/server/chunks/ssr/[root-of-the-server]__b724df9e._.js.map +0 -1
- package/web/.next/server/chunks/ssr/_59ae996e._.js +0 -3
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js +0 -3
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_skills_page_actions_1fa8042e.js.map +0 -1
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js +0 -3
- package/web/.next/server/chunks/ssr/src_presentation_web__next-internal_server_app_tools_page_actions_24684200.js.map +0 -1
- package/web/.next/static/chunks/1c5310cfde612b81.js +0 -1
- package/web/.next/static/chunks/c4477c532d2081e8.js +0 -1
- /package/web/.next/static/{qmHUdyRBvaVksgjcL6w-m → yAqHoeHdmindXxK6kOd6a}/_buildManifest.js +0 -0
- /package/web/.next/static/{qmHUdyRBvaVksgjcL6w-m → yAqHoeHdmindXxK6kOd6a}/_clientMiddlewareManifest.json +0 -0
- /package/web/.next/static/{qmHUdyRBvaVksgjcL6w-m → yAqHoeHdmindXxK6kOd6a}/_ssgManifest.js +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Deployment Service Interface
|
|
3
|
+
*
|
|
4
|
+
* Higher-level deployment service that uses the DevEnvironmentAgent
|
|
5
|
+
* to analyze repos before starting deployments. Wraps the low-level
|
|
6
|
+
* IDeploymentService with AI-driven analysis.
|
|
7
|
+
*
|
|
8
|
+
* Flow:
|
|
9
|
+
* 1. Analyze repo via DevEnvironmentAgent (cached per-repo)
|
|
10
|
+
* 2. If not deployable → return "not deployable" result
|
|
11
|
+
* 3. If deployable → run setup commands → start dev server
|
|
12
|
+
*/
|
|
13
|
+
import type { DeploymentState } from '../../../../domain/generated/output.js';
|
|
14
|
+
import type { DevEnvironmentAnalysis } from './dev-environment-agent.interface.js';
|
|
15
|
+
/** Result of an agent-driven deployment attempt. */
|
|
16
|
+
export interface AgentDeployResult {
|
|
17
|
+
/** Whether the deployment was started successfully. */
|
|
18
|
+
success: boolean;
|
|
19
|
+
/** Error message if the deployment failed. */
|
|
20
|
+
error?: string;
|
|
21
|
+
/** Current deployment state (Booting on success). */
|
|
22
|
+
state?: DeploymentState;
|
|
23
|
+
/** The analysis result from the dev environment agent. */
|
|
24
|
+
analysis?: DevEnvironmentAnalysis;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Port interface for agent-driven deployments.
|
|
28
|
+
*
|
|
29
|
+
* Uses DevEnvironmentAgent to analyze the repo, then starts the
|
|
30
|
+
* deployment using the detected command. Handles repos that have
|
|
31
|
+
* nothing to deploy by returning a descriptive result.
|
|
32
|
+
*/
|
|
33
|
+
export interface IAgentDeploymentService {
|
|
34
|
+
/**
|
|
35
|
+
* Analyze a repository and start its dev environment if possible.
|
|
36
|
+
*
|
|
37
|
+
* @param targetId - Unique identifier for the deployment (featureId or repositoryPath)
|
|
38
|
+
* @param targetPath - Absolute filesystem path to the directory to deploy from
|
|
39
|
+
* @param options - Optional: force re-analysis by skipping cache
|
|
40
|
+
* @returns Result with success/error and the analysis
|
|
41
|
+
*/
|
|
42
|
+
deploy(targetId: string, targetPath: string, options?: {
|
|
43
|
+
skipCache?: boolean;
|
|
44
|
+
}): Promise<AgentDeployResult>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=agent-deployment-service.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-deployment-service.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/agent-deployment-service.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEnF,oDAAoD;AACpD,MAAM,WAAW,iBAAiB;IAChC,uDAAuD;IACvD,OAAO,EAAE,OAAO,CAAC;IAEjB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,qDAAqD;IACrD,KAAK,CAAC,EAAE,eAAe,CAAC;IAExB,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,sBAAsB,CAAC;CACnC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,uBAAuB;IACtC;;;;;;;OAOG;IACH,MAAM,CACJ,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAChC,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC/B"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Deployment Service Interface
|
|
3
|
+
*
|
|
4
|
+
* Higher-level deployment service that uses the DevEnvironmentAgent
|
|
5
|
+
* to analyze repos before starting deployments. Wraps the low-level
|
|
6
|
+
* IDeploymentService with AI-driven analysis.
|
|
7
|
+
*
|
|
8
|
+
* Flow:
|
|
9
|
+
* 1. Analyze repo via DevEnvironmentAgent (cached per-repo)
|
|
10
|
+
* 2. If not deployable → return "not deployable" result
|
|
11
|
+
* 3. If deployable → run setup commands → start dev server
|
|
12
|
+
*/
|
|
13
|
+
export {};
|
package/dist/packages/core/src/application/ports/output/services/deployment-service.interface.d.ts
CHANGED
|
@@ -28,6 +28,13 @@ export interface DeploymentStatus {
|
|
|
28
28
|
/** Detected URL when the dev server is Ready, null while Booting. */
|
|
29
29
|
url: string | null;
|
|
30
30
|
}
|
|
31
|
+
/** Options for overriding the default dev script detection. */
|
|
32
|
+
export interface DeploymentStartOptions {
|
|
33
|
+
/** Shell command to run instead of auto-detecting from package.json. */
|
|
34
|
+
command?: string;
|
|
35
|
+
/** Working directory relative to targetPath (defaults to "."). */
|
|
36
|
+
cwd?: string;
|
|
37
|
+
}
|
|
31
38
|
/**
|
|
32
39
|
* Port interface for managing local dev server deployments.
|
|
33
40
|
*
|
|
@@ -45,10 +52,11 @@ export interface IDeploymentService {
|
|
|
45
52
|
*
|
|
46
53
|
* @param targetId - Unique identifier for the deployment target (featureId or repositoryId)
|
|
47
54
|
* @param targetPath - Absolute filesystem path to the directory to run the dev server in
|
|
55
|
+
* @param options - Optional: override the auto-detected command
|
|
48
56
|
* @returns The initial deployment state (always Booting on success)
|
|
49
57
|
* @throws Error if no dev script is found in package.json or the process fails to spawn
|
|
50
58
|
*/
|
|
51
|
-
start(targetId: string, targetPath: string): void;
|
|
59
|
+
start(targetId: string, targetPath: string, options?: DeploymentStartOptions): void;
|
|
52
60
|
/**
|
|
53
61
|
* Stop a running deployment gracefully.
|
|
54
62
|
* Sends SIGTERM to the process group, then SIGKILL after a timeout.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment-service.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/deployment-service.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,uEAAuE;AACvE,MAAM,WAAW,QAAQ;IACvB,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,+CAA+C;AAC/C,MAAM,WAAW,gBAAgB;IAC/B,iDAAiD;IACjD,KAAK,EAAE,eAAe,CAAC;IACvB,qEAAqE;IACrE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,kBAAkB;IACjC
|
|
1
|
+
{"version":3,"file":"deployment-service.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/deployment-service.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,uEAAuE;AACvE,MAAM,WAAW,QAAQ;IACvB,2CAA2C;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,8CAA8C;IAC9C,MAAM,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC5B,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,+CAA+C;AAC/C,MAAM,WAAW,gBAAgB;IAC/B,iDAAiD;IACjD,KAAK,EAAE,eAAe,CAAC;IACvB,qEAAqE;IACrE,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACpB;AAED,+DAA+D;AAC/D,MAAM,WAAW,sBAAsB;IACrC,wEAAwE;IACxE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kEAAkE;IAClE,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,kBAAkB;IACjC;;;;;;;;;OASG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAEpF;;;;;;OAMG;IACH,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEtC;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAAC;IAErD;;;OAGG;IACH,OAAO,IAAI,IAAI,CAAC;IAIhB;;;;;OAKG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,QAAQ,EAAE,GAAG,IAAI,CAAC;IAE7C;;;;;OAKG;IACH,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI,CAAC;IAE3D;;;;;OAKG;IACH,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,GAAG,IAAI,CAAC;CAC7D"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dev Environment Agent Interface
|
|
3
|
+
*
|
|
4
|
+
* Output port for agent-based dev environment analysis.
|
|
5
|
+
* Uses an AI agent to analyze any repository (language-agnostic) and determine
|
|
6
|
+
* how to start a local development server. Supports per-repo caching for fast
|
|
7
|
+
* repeated invocations.
|
|
8
|
+
*
|
|
9
|
+
* Key behaviors:
|
|
10
|
+
* - Analyzes repo structure to detect dev server commands across all languages
|
|
11
|
+
* - Returns a "not deployable" result for repos with no server/UI to start
|
|
12
|
+
* - Caches analysis results per-repo for fast subsequent calls
|
|
13
|
+
*/
|
|
14
|
+
/** Result of analyzing a repository for dev environment setup. */
|
|
15
|
+
export interface DevEnvironmentAnalysis {
|
|
16
|
+
/** Whether this repo has a startable dev environment. */
|
|
17
|
+
deployable: boolean;
|
|
18
|
+
/** Human-readable explanation of what was detected or why it's not deployable. */
|
|
19
|
+
reason: string;
|
|
20
|
+
/** The shell command to start the dev server (null if not deployable). */
|
|
21
|
+
command: string | null;
|
|
22
|
+
/** Working directory relative to repo root (defaults to "."). */
|
|
23
|
+
cwd: string;
|
|
24
|
+
/** Expected port the dev server will listen on (null if unknown). */
|
|
25
|
+
expectedPort: number | null;
|
|
26
|
+
/** Detected language/framework (e.g., "node", "python", "go", "rust"). */
|
|
27
|
+
language: string | null;
|
|
28
|
+
/** Detected framework if any (e.g., "next.js", "django", "flask", "gin"). */
|
|
29
|
+
framework: string | null;
|
|
30
|
+
/** Setup commands to run before the dev command (e.g., "npm install"). */
|
|
31
|
+
setupCommands: string[];
|
|
32
|
+
}
|
|
33
|
+
/** Options for the analyze method. */
|
|
34
|
+
export interface DevEnvironmentAnalyzeOptions {
|
|
35
|
+
/** Skip the cache and force a fresh analysis. */
|
|
36
|
+
skipCache?: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Port interface for AI-driven dev environment analysis.
|
|
40
|
+
*
|
|
41
|
+
* Implementations use a structured agent caller to analyze repositories
|
|
42
|
+
* and determine how to start a local dev server. Results are cached
|
|
43
|
+
* per-repo (keyed by absolute path) for fast repeated calls.
|
|
44
|
+
*/
|
|
45
|
+
export interface IDevEnvironmentAgent {
|
|
46
|
+
/**
|
|
47
|
+
* Analyze a repository to determine how to start its dev environment.
|
|
48
|
+
*
|
|
49
|
+
* @param repositoryPath - Absolute filesystem path to the repository
|
|
50
|
+
* @param options - Optional configuration (e.g., skip cache)
|
|
51
|
+
* @returns Analysis result with command, language, and deployability info
|
|
52
|
+
*/
|
|
53
|
+
analyze(repositoryPath: string, options?: DevEnvironmentAnalyzeOptions): Promise<DevEnvironmentAnalysis>;
|
|
54
|
+
/**
|
|
55
|
+
* Clear the cached analysis for a specific repository.
|
|
56
|
+
*
|
|
57
|
+
* @param repositoryPath - Absolute filesystem path to the repository
|
|
58
|
+
*/
|
|
59
|
+
clearCache(repositoryPath: string): void;
|
|
60
|
+
/**
|
|
61
|
+
* Clear all cached analyses.
|
|
62
|
+
*/
|
|
63
|
+
clearAllCaches(): void;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=dev-environment-agent.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-environment-agent.interface.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/core/src/application/ports/output/services/dev-environment-agent.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,kEAAkE;AAClE,MAAM,WAAW,sBAAsB;IACrC,yDAAyD;IACzD,UAAU,EAAE,OAAO,CAAC;IAEpB,kFAAkF;IAClF,MAAM,EAAE,MAAM,CAAC;IAEf,0EAA0E;IAC1E,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB,iEAAiE;IACjE,GAAG,EAAE,MAAM,CAAC;IAEZ,qEAAqE;IACrE,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAE5B,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB,6EAA6E;IAC7E,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzB,0EAA0E;IAC1E,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED,sCAAsC;AACtC,MAAM,WAAW,4BAA4B;IAC3C,iDAAiD;IACjD,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;OAMG;IACH,OAAO,CACL,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,4BAA4B,GACrC,OAAO,CAAC,sBAAsB,CAAC,CAAC;IAEnC;;;;OAIG;IACH,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAEzC;;OAEG;IACH,cAAc,IAAI,IAAI,CAAC;CACxB"}
|
package/dist/packages/core/src/application/ports/output/services/dev-environment-agent.interface.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dev Environment Agent Interface
|
|
3
|
+
*
|
|
4
|
+
* Output port for agent-based dev environment analysis.
|
|
5
|
+
* Uses an AI agent to analyze any repository (language-agnostic) and determine
|
|
6
|
+
* how to start a local development server. Supports per-repo caching for fast
|
|
7
|
+
* repeated invocations.
|
|
8
|
+
*
|
|
9
|
+
* Key behaviors:
|
|
10
|
+
* - Analyzes repo structure to detect dev server commands across all languages
|
|
11
|
+
* - Returns a "not deployable" result for repos with no server/UI to start
|
|
12
|
+
* - Caches analysis results per-repo for fast subsequent calls
|
|
13
|
+
*/
|
|
14
|
+
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/infrastructure/di/container.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../../../../packages/core/src/infrastructure/di/container.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAwHrC;;;;;;GAMG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,OAAO,SAAS,CAAC,CAoVrE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAED;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -26,6 +26,8 @@ import { GitPrService } from '../services/git/git-pr.service.js';
|
|
|
26
26
|
import { JsonDrivenIdeLauncherService } from '../services/ide-launchers/json-driven-ide-launcher.service.js';
|
|
27
27
|
import { DaemonPidService } from '../services/daemon/daemon-pid.service.js';
|
|
28
28
|
import { DeploymentService } from '../services/deployment/deployment.service.js';
|
|
29
|
+
import { DevEnvironmentAgentService } from '../services/deployment/dev-environment-agent.service.js';
|
|
30
|
+
import { AgentDeploymentService } from '../services/deployment/agent-deployment.service.js';
|
|
29
31
|
import { AttachmentStorageService } from '../services/attachment-storage.service.js';
|
|
30
32
|
import { AgentExecutorFactory } from '../services/agents/common/agent-executor-factory.service.js';
|
|
31
33
|
import { AgentExecutorProvider } from '../services/agents/common/agent-executor-provider.service.js';
|
|
@@ -238,6 +240,23 @@ export async function initializeContainer() {
|
|
|
238
240
|
return new FeatureAgentProcessService(runRepository);
|
|
239
241
|
},
|
|
240
242
|
});
|
|
243
|
+
// Register agent-based deployment services
|
|
244
|
+
container.register('IDevEnvironmentAgent', {
|
|
245
|
+
useFactory: (c) => {
|
|
246
|
+
const caller = c.resolve('IStructuredAgentCaller');
|
|
247
|
+
return new DevEnvironmentAgentService({ structuredAgentCaller: caller });
|
|
248
|
+
},
|
|
249
|
+
});
|
|
250
|
+
container.register('IAgentDeploymentService', {
|
|
251
|
+
useFactory: (c) => {
|
|
252
|
+
const devEnvAgent = c.resolve('IDevEnvironmentAgent');
|
|
253
|
+
const deploySvc = c.resolve('IDeploymentService');
|
|
254
|
+
return new AgentDeploymentService({
|
|
255
|
+
devEnvironmentAgent: devEnvAgent,
|
|
256
|
+
deploymentService: deploySvc,
|
|
257
|
+
});
|
|
258
|
+
},
|
|
259
|
+
});
|
|
241
260
|
container.register('ISpecInitializerService', {
|
|
242
261
|
useFactory: () => new SpecInitializerService(),
|
|
243
262
|
});
|
package/dist/packages/core/src/infrastructure/services/deployment/agent-deployment.service.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Deployment Service
|
|
3
|
+
*
|
|
4
|
+
* Higher-level deployment orchestrator that uses the DevEnvironmentAgent
|
|
5
|
+
* to analyze repos before starting deployments. Replaces the simple
|
|
6
|
+
* "detect package.json scripts" approach with AI-driven analysis that
|
|
7
|
+
* supports any language/framework.
|
|
8
|
+
*
|
|
9
|
+
* Flow:
|
|
10
|
+
* 1. Analyze repo via DevEnvironmentAgent (cached per-repo for speed)
|
|
11
|
+
* 2. If not deployable → return descriptive reason
|
|
12
|
+
* 3. If deployable → run setup commands → start dev server via DeploymentService
|
|
13
|
+
*/
|
|
14
|
+
import type { IAgentDeploymentService, AgentDeployResult } from '../../../application/ports/output/services/agent-deployment-service.interface.js';
|
|
15
|
+
import type { IDevEnvironmentAgent } from '../../../application/ports/output/services/dev-environment-agent.interface.js';
|
|
16
|
+
import type { IDeploymentService } from '../../../application/ports/output/services/deployment-service.interface.js';
|
|
17
|
+
/** Dependencies injectable for testing. */
|
|
18
|
+
export interface AgentDeploymentServiceDeps {
|
|
19
|
+
devEnvironmentAgent: IDevEnvironmentAgent;
|
|
20
|
+
deploymentService: IDeploymentService;
|
|
21
|
+
execCommand?: (command: string, cwd: string) => Promise<void>;
|
|
22
|
+
}
|
|
23
|
+
export declare class AgentDeploymentService implements IAgentDeploymentService {
|
|
24
|
+
private readonly deps;
|
|
25
|
+
constructor(deps: AgentDeploymentServiceDeps);
|
|
26
|
+
deploy(targetId: string, targetPath: string, options?: {
|
|
27
|
+
skipCache?: boolean;
|
|
28
|
+
}): Promise<AgentDeployResult>;
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=agent-deployment.service.d.ts.map
|
package/dist/packages/core/src/infrastructure/services/deployment/agent-deployment.service.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-deployment.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/deployment/agent-deployment.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,KAAK,EACV,uBAAuB,EACvB,iBAAiB,EAClB,MAAM,2EAA2E,CAAC;AACnF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wEAAwE,CAAC;AACnH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qEAAqE,CAAC;AAM9G,2CAA2C;AAC3C,MAAM,WAAW,0BAA0B;IACzC,mBAAmB,EAAE,oBAAoB,CAAC;IAC1C,iBAAiB,EAAE,kBAAkB,CAAC;IACtC,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/D;AAaD,qBAAa,sBAAuB,YAAW,uBAAuB;IACpE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAe;gBAExB,IAAI,EAAE,0BAA0B;IAOtC,MAAM,CACV,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAChC,OAAO,CAAC,iBAAiB,CAAC;CA+E9B"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Deployment Service
|
|
3
|
+
*
|
|
4
|
+
* Higher-level deployment orchestrator that uses the DevEnvironmentAgent
|
|
5
|
+
* to analyze repos before starting deployments. Replaces the simple
|
|
6
|
+
* "detect package.json scripts" approach with AI-driven analysis that
|
|
7
|
+
* supports any language/framework.
|
|
8
|
+
*
|
|
9
|
+
* Flow:
|
|
10
|
+
* 1. Analyze repo via DevEnvironmentAgent (cached per-repo for speed)
|
|
11
|
+
* 2. If not deployable → return descriptive reason
|
|
12
|
+
* 3. If deployable → run setup commands → start dev server via DeploymentService
|
|
13
|
+
*/
|
|
14
|
+
import { exec } from 'node:child_process';
|
|
15
|
+
import { join } from 'node:path';
|
|
16
|
+
import { DeploymentState } from '../../../domain/generated/output.js';
|
|
17
|
+
import { createDeploymentLogger } from './deployment-logger.js';
|
|
18
|
+
const log = createDeploymentLogger('[AgentDeploymentService]');
|
|
19
|
+
function defaultExecCommand(command, cwd) {
|
|
20
|
+
return new Promise((resolve, reject) => {
|
|
21
|
+
exec(command, { cwd }, (error) => {
|
|
22
|
+
if (error)
|
|
23
|
+
reject(error);
|
|
24
|
+
else
|
|
25
|
+
resolve();
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
export class AgentDeploymentService {
|
|
30
|
+
deps;
|
|
31
|
+
constructor(deps) {
|
|
32
|
+
this.deps = {
|
|
33
|
+
execCommand: defaultExecCommand,
|
|
34
|
+
...deps,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
async deploy(targetId, targetPath, options) {
|
|
38
|
+
log.info(`deploy() called — targetId="${targetId}", targetPath="${targetPath}"`);
|
|
39
|
+
// Step 1: Analyze via agent
|
|
40
|
+
let analysis;
|
|
41
|
+
try {
|
|
42
|
+
analysis = await this.deps.devEnvironmentAgent.analyze(targetPath, {
|
|
43
|
+
skipCache: options?.skipCache,
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
catch (error) {
|
|
47
|
+
const message = error instanceof Error ? error.message : 'Analysis failed';
|
|
48
|
+
log.error(`agent analysis failed: ${message}`);
|
|
49
|
+
return { success: false, error: message };
|
|
50
|
+
}
|
|
51
|
+
log.info(`analysis result — deployable=${analysis.deployable}, command=${analysis.command}`);
|
|
52
|
+
// Step 2: Handle not-deployable repos
|
|
53
|
+
if (!analysis.deployable) {
|
|
54
|
+
log.info(`repo is not deployable: ${analysis.reason}`);
|
|
55
|
+
return {
|
|
56
|
+
success: false,
|
|
57
|
+
error: analysis.reason,
|
|
58
|
+
analysis,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
// Validate: deployable but no command is an error
|
|
62
|
+
if (!analysis.command) {
|
|
63
|
+
log.error('analysis marked repo as deployable but provided no command');
|
|
64
|
+
return {
|
|
65
|
+
success: false,
|
|
66
|
+
error: 'Analysis marked repo as deployable but provided no command',
|
|
67
|
+
analysis,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
// Step 3: Run setup commands
|
|
71
|
+
const resolvedCwd = analysis.cwd && analysis.cwd !== '.' ? join(targetPath, analysis.cwd) : targetPath;
|
|
72
|
+
for (const setupCmd of analysis.setupCommands) {
|
|
73
|
+
log.info(`running setup command: "${setupCmd}" in "${resolvedCwd}"`);
|
|
74
|
+
try {
|
|
75
|
+
await this.deps.execCommand(setupCmd, resolvedCwd);
|
|
76
|
+
}
|
|
77
|
+
catch (error) {
|
|
78
|
+
const message = error instanceof Error ? error.message : 'Setup failed';
|
|
79
|
+
log.error(`setup command failed: ${message}`);
|
|
80
|
+
return {
|
|
81
|
+
success: false,
|
|
82
|
+
error: `Setup command failed: ${message}`,
|
|
83
|
+
analysis,
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
// Step 4: Start the dev server
|
|
88
|
+
try {
|
|
89
|
+
this.deps.deploymentService.start(targetId, targetPath, {
|
|
90
|
+
command: analysis.command,
|
|
91
|
+
cwd: analysis.cwd,
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
const message = error instanceof Error ? error.message : 'Failed to start deployment';
|
|
96
|
+
log.error(`deployment start failed: ${message}`);
|
|
97
|
+
return {
|
|
98
|
+
success: false,
|
|
99
|
+
error: message,
|
|
100
|
+
analysis,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
log.info('deployment started successfully');
|
|
104
|
+
return {
|
|
105
|
+
success: true,
|
|
106
|
+
state: DeploymentState.Booting,
|
|
107
|
+
analysis,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* shutdown (SIGTERM → poll → SIGKILL).
|
|
8
8
|
*/
|
|
9
9
|
import { spawn } from 'node:child_process';
|
|
10
|
-
import type { IDeploymentService, DeploymentStatus, LogEntry } from '../../../application/ports/output/services/deployment-service.interface.js';
|
|
10
|
+
import type { IDeploymentService, DeploymentStatus, DeploymentStartOptions, LogEntry } from '../../../application/ports/output/services/deployment-service.interface.js';
|
|
11
11
|
import { detectDevScript } from './detect-dev-script.js';
|
|
12
12
|
export interface DeploymentServiceDeps {
|
|
13
13
|
spawn: typeof spawn;
|
|
@@ -23,8 +23,12 @@ export declare class DeploymentService implements IDeploymentService {
|
|
|
23
23
|
/**
|
|
24
24
|
* Start a deployment for the given target.
|
|
25
25
|
* If a deployment already exists for this target, it is stopped first.
|
|
26
|
+
*
|
|
27
|
+
* When options.command is provided, the command is executed directly via shell
|
|
28
|
+
* instead of auto-detecting from package.json. This enables agent-based
|
|
29
|
+
* deployment for any language/framework.
|
|
26
30
|
*/
|
|
27
|
-
start(targetId: string, targetPath: string): void;
|
|
31
|
+
start(targetId: string, targetPath: string, options?: DeploymentStartOptions): void;
|
|
28
32
|
/**
|
|
29
33
|
* Get the current deployment status for a target.
|
|
30
34
|
* Returns null if no deployment exists for this target.
|
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;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAC;AAI9D,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,QAAQ,EACT,MAAM,qEAAqE,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAoBzD,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;AAgBD,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;gBAElC,IAAI,GAAE,OAAO,CAAC,qBAAqB,CAAM;IAIrD
|
|
1
|
+
{"version":3,"file":"deployment.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/deployment/deployment.service.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,KAAK,EAAqB,MAAM,oBAAoB,CAAC;AAI9D,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,QAAQ,EACT,MAAM,qEAAqE,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAoBzD,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;AAgBD,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;gBAElC,IAAI,GAAE,OAAO,CAAC,qBAAqB,CAAM;IAIrD;;;;;;;OAOG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,sBAAsB,GAAG,IAAI;IA8FnF;;;OAGG;IACH,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI;IAYpD;;OAEG;IACG,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAyC3C;;OAEG;IACH,OAAO,IAAI,IAAI;IAOf;;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;IAI3D;;OAEG;IACH,OAAO,CAAC,WAAW;IAQnB;;;OAGG;IACH,OAAO,CAAC,oBAAoB;IA+D5B;;OAEG;YACW,aAAa;IAW3B;;OAEG;IACH,OAAO,CAAC,WAAW;CASpB"}
|
|
@@ -41,9 +41,13 @@ export class DeploymentService {
|
|
|
41
41
|
/**
|
|
42
42
|
* Start a deployment for the given target.
|
|
43
43
|
* If a deployment already exists for this target, it is stopped first.
|
|
44
|
+
*
|
|
45
|
+
* When options.command is provided, the command is executed directly via shell
|
|
46
|
+
* instead of auto-detecting from package.json. This enables agent-based
|
|
47
|
+
* deployment for any language/framework.
|
|
44
48
|
*/
|
|
45
|
-
start(targetId, targetPath) {
|
|
46
|
-
log.info(`start() called — targetId="${targetId}", targetPath="${targetPath}"`);
|
|
49
|
+
start(targetId, targetPath, options) {
|
|
50
|
+
log.info(`start() called — targetId="${targetId}", targetPath="${targetPath}", command=${options?.command ?? 'auto-detect'}`);
|
|
47
51
|
// Stop any existing deployment for this target
|
|
48
52
|
const existing = this.deployments.get(targetId);
|
|
49
53
|
if (existing) {
|
|
@@ -51,19 +55,32 @@ export class DeploymentService {
|
|
|
51
55
|
this.killProcess(existing);
|
|
52
56
|
this.deployments.delete(targetId);
|
|
53
57
|
}
|
|
54
|
-
//
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
// Resolve the working directory
|
|
59
|
+
const cwd = options?.cwd && options.cwd !== '.' ? `${targetPath}/${options.cwd}` : targetPath;
|
|
60
|
+
let spawnCommand;
|
|
61
|
+
let spawnArgs;
|
|
62
|
+
if (options?.command) {
|
|
63
|
+
// Agent-provided command — run directly via shell
|
|
64
|
+
const parts = options.command.split(/\s+/);
|
|
65
|
+
spawnCommand = parts[0];
|
|
66
|
+
spawnArgs = parts.slice(1);
|
|
67
|
+
log.info(`Using agent-provided command: "${options.command}", cwd="${cwd}"`);
|
|
59
68
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
69
|
+
else {
|
|
70
|
+
// Legacy auto-detection from package.json
|
|
71
|
+
const detection = this.deps.detectDevScript(targetPath);
|
|
72
|
+
if (!detection.success) {
|
|
73
|
+
log.error(`Dev script detection failed: ${detection.error}`);
|
|
74
|
+
throw new Error(detection.error);
|
|
75
|
+
}
|
|
76
|
+
const { packageManager, scriptName, command } = detection;
|
|
77
|
+
spawnCommand = packageManager;
|
|
78
|
+
spawnArgs = packageManager === 'npm' ? ['run', scriptName] : [scriptName];
|
|
79
|
+
log.info(`Spawning dev server: command="${command}", packageManager="${packageManager}", scriptName="${scriptName}", cwd="${cwd}"`);
|
|
80
|
+
}
|
|
81
|
+
const child = this.deps.spawn(spawnCommand, spawnArgs, {
|
|
65
82
|
shell: true,
|
|
66
|
-
cwd
|
|
83
|
+
cwd,
|
|
67
84
|
detached: true,
|
|
68
85
|
stdio: ['ignore', 'pipe', 'pipe'],
|
|
69
86
|
});
|
package/dist/packages/core/src/infrastructure/services/deployment/dev-environment-agent.service.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dev Environment Agent Service
|
|
3
|
+
*
|
|
4
|
+
* AI-driven service that analyzes any repository to determine how to start
|
|
5
|
+
* a local dev environment. Language-agnostic — supports Node.js, Python,
|
|
6
|
+
* Go, Rust, Java, Ruby, and more. Uses structured agent calls to get
|
|
7
|
+
* typed analysis results.
|
|
8
|
+
*
|
|
9
|
+
* Features:
|
|
10
|
+
* - In-memory per-repo caching for fast repeated calls
|
|
11
|
+
* - Reads key config files (package.json, Cargo.toml, etc.) for context
|
|
12
|
+
* - Handles "not deployable" repos gracefully
|
|
13
|
+
* - Truncates large files to prevent prompt overflow
|
|
14
|
+
*/
|
|
15
|
+
import type { IDevEnvironmentAgent, DevEnvironmentAnalysis, DevEnvironmentAnalyzeOptions } from '../../../application/ports/output/services/dev-environment-agent.interface.js';
|
|
16
|
+
import type { IStructuredAgentCaller } from '../../../application/ports/output/agents/structured-agent-caller.interface.js';
|
|
17
|
+
/** Dependencies injectable for testing. */
|
|
18
|
+
export interface DevEnvironmentAgentDeps {
|
|
19
|
+
structuredAgentCaller: Pick<IStructuredAgentCaller, 'call'>;
|
|
20
|
+
readdir: (path: string) => string[];
|
|
21
|
+
readFile: (path: string) => string;
|
|
22
|
+
existsSync: (path: string) => boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare class DevEnvironmentAgentService implements IDevEnvironmentAgent {
|
|
25
|
+
private readonly cache;
|
|
26
|
+
private readonly deps;
|
|
27
|
+
constructor(deps: Partial<DevEnvironmentAgentDeps> & Pick<DevEnvironmentAgentDeps, 'structuredAgentCaller'>);
|
|
28
|
+
analyze(repositoryPath: string, options?: DevEnvironmentAnalyzeOptions): Promise<DevEnvironmentAnalysis>;
|
|
29
|
+
clearCache(repositoryPath: string): void;
|
|
30
|
+
clearAllCaches(): void;
|
|
31
|
+
private buildPrompt;
|
|
32
|
+
private getDirListing;
|
|
33
|
+
private readConfigFiles;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=dev-environment-agent.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-environment-agent.service.d.ts","sourceRoot":"","sources":["../../../../../../../packages/core/src/infrastructure/services/deployment/dev-environment-agent.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAIH,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,4BAA4B,EAC7B,MAAM,wEAAwE,CAAC;AAChF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,wEAAwE,CAAC;AAqFrH,2CAA2C;AAC3C,MAAM,WAAW,uBAAuB;IACtC,qBAAqB,EAAE,IAAI,CAAC,sBAAsB,EAAE,MAAM,CAAC,CAAC;IAC5D,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,EAAE,CAAC;IACpC,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IACnC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CACvC;AASD,qBAAa,0BAA2B,YAAW,oBAAoB;IACrE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA6C;IACnE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA0B;gBAG7C,IAAI,EAAE,OAAO,CAAC,uBAAuB,CAAC,GAAG,IAAI,CAAC,uBAAuB,EAAE,uBAAuB,CAAC;IAK3F,OAAO,CACX,cAAc,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,4BAA4B,GACrC,OAAO,CAAC,sBAAsB,CAAC;IAyClC,UAAU,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI;IAKxC,cAAc,IAAI,IAAI;IAKtB,OAAO,CAAC,WAAW;IA2CnB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,eAAe;CA2BxB"}
|