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

Function snapQuestion

packages/opencode/src/cli/cmd/run/tool.ts:607–622  ·  view source on GitHub ↗
(p: ToolProps<typeof QuestionTool>)

Source from the content-addressed store, hash-verified

605}
606
607function snapQuestion(p: ToolProps<typeof QuestionTool>): ToolSnapshot {
608 const answers = list<unknown[]>(p.frame.meta.answers)
609 const items = list<{ question?: string }>(p.frame.input.questions).map((item, i) => {
610 const answer = list<string>(answers[i]).filter((entry) => typeof entry === "string")
611 return {
612 question: item.question || `Question ${i + 1}`,
613 answer: answer.length > 0 ? answer.join(", ") : "(no answer)",
614 }
615 })
616
617 return {
618 kind: "question",
619 items,
620 tail: "",
621 }
622}
623
624function scrollBashStart(p: ToolProps<typeof BashTool>): string {
625 const cmd = p.input.command ?? ""

Callers

nothing calls this directly

Calls 1

listFunction · 0.70

Tested by

no test coverage detected