| 458 | ) |
| 459 | |
| 460 | const resolvePrompt = (input: PromptInput.Prompt) => |
| 461 | Prompt.make({ |
| 462 | text: input.text, |
| 463 | agents: input.agents, |
| 464 | files: input.files?.map((file) => { |
| 465 | const dataMime = file.uri.match(/^data:([^;,]+)[;,]/i)?.[1] |
| 466 | const target = URL.canParse(file.uri) ? new URL(file.uri).pathname : (file.name ?? file.uri) |
| 467 | return { |
| 468 | ...file, |
| 469 | mime: dataMime ?? (target.endsWith("/") ? "application/x-directory" : FSUtil.mimeType(target)), |
| 470 | } |
| 471 | }), |
| 472 | }) |
| 473 | |
| 474 | export const node = makeGlobalNode({ |
| 475 | service: Service, |