(host: ExtensionHost, sessionId: string)
| 36 | const STREAM_RESUME_WAIT_TIMEOUT_MS = 2_000 |
| 37 | |
| 38 | async 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 | |
| 48 | function normalizeError(error: unknown): Error { |
| 49 | return error instanceof Error ? error : new Error(String(error)) |
no test coverage detected