MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / startInteractiveServer

Function startInteractiveServer

src/cm/lsp/serverLauncher.ts:907–934  ·  view source on GitHub ↗
(
  command: string,
  serverId: string,
)

Source from the content-addressed store, hash-verified

905}
906
907async function startInteractiveServer(
908 command: string,
909 serverId: string,
910): Promise<string> {
911 const executor = getExecutor();
912 const callback: ExecutorCallback = (type, data) => {
913 if (type === "stderr") {
914 if (/proot warning/i.test(data)) return;
915 addLspLog(serverId, "stderr", data);
916 console.warn(`[LSP:${serverId}] ${data}`);
917 } else if (type === "stdout" && data && data.trim()) {
918 addLspLog(serverId, "info", data);
919 console.info(`[LSP:${serverId}] ${data}`);
920 // Detect when the axs proxy signals it's listening
921 if (/listening on/i.test(data)) {
922 signalServerReady(serverId);
923 }
924 }
925 };
926 const uuid = await executor.start(command, callback, true);
927 addLspLog(serverId, "info", `Started shell process ${uuid}`);
928 managedServers.set(serverId, {
929 uuid,
930 command,
931 startedAt: Date.now(),
932 });
933 return uuid;
934}
935
936function sleep(ms: number): Promise<void> {
937 return new Promise((resolve) => setTimeout(resolve, ms));

Callers 1

ensureServerRunningFunction · 0.85

Calls 4

addLspLogFunction · 0.90
setMethod · 0.80
getExecutorFunction · 0.70
startMethod · 0.45

Tested by

no test coverage detected