MCPcopy Create free account
hub / github.com/Zoo-Code-Org/Zoo-Code / bootstrapResumeForStdinStream

Function bootstrapResumeForStdinStream

apps/cli/src/commands/cli/run.ts:38–46  ·  view source on GitHub ↗
(host: ExtensionHost, sessionId: string)

Source from the content-addressed store, hash-verified

36const STREAM_RESUME_WAIT_TIMEOUT_MS = 2_000
37
38async function bootstrapResumeForStdinStream(host: ExtensionHost, sessionId: string): Promise<void> {
39 host.sendToExtension({ type: "showTaskWithId", text: sessionId })
40
41 // Best-effort wait so early stdin "message" commands can target the resumed task.
42 await pWaitFor(() => host.client.hasActiveTask() || host.isWaitingForInput(), {
43 interval: 25,
44 timeout: STREAM_RESUME_WAIT_TIMEOUT_MS,
45 }).catch(() => undefined)
46}
47
48function normalizeError(error: unknown): Error {
49 return error instanceof Error ? error : new Error(String(error))

Callers 1

runFunction · 0.85

Calls 3

hasActiveTaskMethod · 0.80
sendToExtensionMethod · 0.65
isWaitingForInputMethod · 0.45

Tested by

no test coverage detected