MCPcopy Create free account
hub / github.com/anomalyco/opencode / resolvePrompt

Function resolvePrompt

packages/core/src/session.ts:460–472  ·  view source on GitHub ↗
(input: PromptInput.Prompt)

Source from the content-addressed store, hash-verified

458)
459
460const 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
474export const node = makeGlobalNode({
475 service: Service,

Callers 1

session.tsFile · 0.85

Calls 1

makeMethod · 0.45

Tested by

no test coverage detected