MCPcopy Create free account
hub / github.com/21st-dev/21st-sdk / handleLine

Function handleLine

packages/cli/src/deploy.ts:63–81  ·  view source on GitHub ↗
(line: string)

Source from the content-addressed store, hash-verified

61 let result: Extract<DeployEvent, { type: "result" }>["result"] | null = null
62
63 const handleLine = (line: string) => {
64 let event: DeployEvent
65 try {
66 event = JSON.parse(line) as DeployEvent
67 } catch {
68 throw new Error(`Invalid deploy stream response: ${line}`)
69 }
70
71 if (event.type === "status") {
72 spinner.message(event.message)
73 return
74 }
75
76 if (event.type === "error") {
77 throw new Error(event.message)
78 }
79
80 result = event.result
81 }
82
83 while (true) {
84 const { done, value } = await reader.read()

Callers 1

readDeployStreamFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected