MCPcopy Create free account
hub / github.com/MigoXLab/coderio / launch

Function launch

src/nodes/validation/launch/index.ts:21–58  ·  view source on GitHub ↗
(appPath: string, config?: LaunchConfig)

Source from the content-addressed store, hash-verified

19}
20
21export const launch = async (appPath: string, config?: LaunchConfig): Promise<LaunchResult> => {
22 if (!appPath) {
23 throw new Error('appPath is required');
24 }
25
26 try {
27 // Agent.run() returns the parsed LaunchAgentResult via postProcessor
28 const agentResult = (await createLaunchAgent().run(
29 launchAgentInstruction({
30 appPath,
31 skipDependencyInstall: config?.skipDependencyInstall,
32 })
33 )) as LaunchAgentResult;
34
35 // If agent explicitly failed, return the error
36 if (agentResult.success === false) {
37 return {
38 success: false,
39 error: agentResult.error ?? 'Launch agent failed without error message',
40 };
41 }
42
43 // postProcessor already validates serverKey, url, port are present when success=true
44 // So we can safely return them here
45 return {
46 success: true,
47 message: agentResult.message ?? 'Launch and quality assurance completed',
48 serverKey: agentResult.serverKey,
49 url: agentResult.url,
50 port: agentResult.port,
51 };
52 } catch (error) {
53 return {
54 success: false,
55 error: error instanceof Error ? error.message : String(error),
56 };
57 }
58};

Callers 1

validationLoopFunction · 0.90

Calls 2

createLaunchAgentFunction · 0.90
launchAgentInstructionFunction · 0.90

Tested by

no test coverage detected