(
sid: string,
body: { prompt_id: string },
)
| 385 | } |
| 386 | |
| 387 | async function injectActivePrompt( |
| 388 | sid: string, |
| 389 | body: { prompt_id: string }, |
| 390 | ): Promise<{ prompt_id: string }> { |
| 391 | const res = await fetchWithReport( |
| 392 | `${BASE_URL}${API_PREFIX}/debug/prompts/${encodeURIComponent(sid)}/active`, |
| 393 | { |
| 394 | method: 'POST', |
| 395 | headers: { accept: 'application/json', 'content-type': 'application/json' }, |
| 396 | body: JSON.stringify(body), |
| 397 | }, |
| 398 | ); |
| 399 | const envelope = (await res.json()) as { |
| 400 | code: number; |
| 401 | msg: string; |
| 402 | data: { prompt_id: string }; |
| 403 | }; |
| 404 | expect(envelope.code, envelope.msg).toBe(0); |
| 405 | return envelope.data; |
| 406 | } |
no test coverage detected