MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / constructor

Method constructor

source code/utils/ShellCommand.ts:150–182  ·  view source on GitHub ↗
(
    childProcess: ChildProcess,
    abortSignal: AbortSignal,
    timeout: number,
    taskOutput: TaskOutput,
    shouldAutoBackground = false,
    maxOutputBytes = MAX_TASK_OUTPUT_BYTES,
  )

Source from the content-addressed store, hash-verified

148 ) => void
149
150 constructor(
151 childProcess: ChildProcess,
152 abortSignal: AbortSignal,
153 timeout: number,
154 taskOutput: TaskOutput,
155 shouldAutoBackground = false,
156 maxOutputBytes = MAX_TASK_OUTPUT_BYTES,
157 ) {
158 this.#childProcess = childProcess
159 this.#abortSignal = abortSignal
160 this.#timeout = timeout
161 this.#shouldAutoBackground = shouldAutoBackground
162 this.#maxOutputBytes = maxOutputBytes
163 this.taskOutput = taskOutput
164
165 // In file mode (bash commands), both stdout and stderr go to the
166 // output file fd — childProcess.stdout/.stderr are both null.
167 // In pipe mode (hooks), wrap streams to funnel data into TaskOutput.
168 this.#stderrWrapper = childProcess.stderr
169 ? new StreamWrapper(childProcess.stderr, taskOutput, true)
170 : null
171 this.#stdoutWrapper = childProcess.stdout
172 ? new StreamWrapper(childProcess.stdout, taskOutput, false)
173 : null
174
175 if (shouldAutoBackground) {
176 this.onTimeout = (callback): void => {
177 this.#onTimeoutCallback = callback
178 }
179 }
180
181 this.result = this.#createResultPromise()
182 }
183
184 get status(): 'running' | 'backgrounded' | 'completed' | 'killed' {
185 return this.#status

Callers

nothing calls this directly

Calls 1

#createResultPromiseMethod · 0.95

Tested by

no test coverage detected