MCPcopy Index your code
hub / github.com/anomalyco/opencode / start

Function start

packages/desktop/src/main/sidecar.ts:51–71  ·  view source on GitHub ↗
(command: StartCommand)

Source from the content-addressed store, hash-verified

49})
50
51async function start(command: StartCommand) {
52 try {
53 prepareSidecarEnv(command.password, command.userDataPath)
54 ensureLoopbackNoProxy()
55 useSystemCertificates()
56 useEnvProxy()
57 const { Server } = await import("virtual:opencode-server")
58
59 listener = await Server.listen({
60 port: command.port,
61 hostname: command.hostname,
62 username: "opencode",
63 password: command.password,
64 cors: ["oc://renderer"],
65 })
66 parentPort.postMessage({ type: "ready" })
67 } catch (error) {
68 parentPort.postMessage({ type: "error", error: serializeError(error) })
69 setImmediate(() => process.exit(1))
70 }
71}
72
73async function stop() {
74 try {

Callers 1

sidecar.tsFile · 0.70

Calls 5

prepareSidecarEnvFunction · 0.85
useSystemCertificatesFunction · 0.85
ensureLoopbackNoProxyFunction · 0.70
useEnvProxyFunction · 0.70
serializeErrorFunction · 0.70

Tested by

no test coverage detected