MCPcopy Create free account
hub / github.com/apache/maka / runRuntimeHostProjectCli

Function runRuntimeHostProjectCli

packages/cli/src/runtime-host-project-command.ts:23–42  ·  view source on GitHub ↗
(
  command: RuntimeHostProjectCommand,
  overrides: Partial<RuntimeHostProjectCommandDeps> = {},
)

Source from the content-addressed store, hash-verified

21}
22
23export async function runRuntimeHostProjectCli(
24 command: RuntimeHostProjectCommand,
25 overrides: Partial<RuntimeHostProjectCommandDeps> = {},
26): Promise<number> {
27 const deps = { ...defaultDeps(), ...overrides };
28 const connection = await deps.connect(command.rootPath);
29 try {
30 const result =
31 command.kind === 'list'
32 ? await readRuntimeHostProjectDetails(connection)
33 : await connection.request('project.catalog.mutate', {
34 kind: 'register',
35 path: resolve(command.path),
36 });
37 deps.write(`${JSON.stringify(result, null, 2)}\n`);
38 return 0;
39 } finally {
40 await connection.close();
41 }
42}
43
44function defaultDeps(): RuntimeHostProjectCommandDeps {
45 return {

Callers 2

runMakaCliFunction · 0.85

Calls 7

defaultDepsFunction · 0.70
connectMethod · 0.65
requestMethod · 0.65
writeMethod · 0.65
closeMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected