MCPcopy Create free account
hub / github.com/code100x/mobile-magic / onShellCommand

Function onShellCommand

mobile-magic/apps/worker/os.ts:31–53  ·  view source on GitHub ↗
(shellCommand: string, projectId: string, promptId: string)

Source from the content-addressed store, hash-verified

29}
30
31export async function onShellCommand(shellCommand: string, projectId: string, promptId: string) {
32 //npm run build && npm run start
33 const commands = shellCommand.split("&&");
34 for (const command of commands) {
35 console.log(`Running command: ${command}`);
36
37 ws.send(JSON.stringify({
38 event: "admin",
39 data: {
40 type: "command",
41 content: command
42 }
43 }))
44
45 await prismaClient.action.create({
46 data: {
47 projectId,
48 promptId,
49 content: `Ran command: ${command}`,
50 },
51 });
52 }
53}
54
55
56export function onPromptEnd(promptId: string) {

Callers 1

index.tsFile · 0.90

Calls 1

sendMethod · 0.80

Tested by

no test coverage detected