MCPcopy Index your code
hub / github.com/anomalyco/opencode / scrollQuestionFinal

Function scrollQuestionFinal

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

Source from the content-addressed store, hash-verified

829}
830
831function scrollQuestionFinal(p: ToolProps<typeof QuestionTool>): string {
832 const q = p.input.questions ?? []
833 const a = p.metadata.answers ?? []
834 const time = span(p.frame.state)
835 if (q.length === 0) {
836 if (!time) {
837 return "0 questions"
838 }
839
840 return `0 questions · ${time}`
841 }
842
843 const rows: string[] = []
844 for (const [i, item] of q.slice(0, 4).entries()) {
845 const prompt = item.question
846 const reply = a[i] ?? []
847 rows.push(`? ${prompt || `Question ${i + 1}`}`)
848 rows.push(` ${reply.length > 0 ? reply.join(", ") : "(no answer)"}`)
849 }
850
851 if (q.length > 4) {
852 rows.push(`... and ${q.length - 4} more`)
853 }
854
855 return rows.join("\n")
856}
857
858function scrollLspStart(p: ToolProps<typeof LspTool>): string {
859 return `→ ${lspTitle(p.input)}`

Callers

nothing calls this directly

Calls 2

pushMethod · 0.80
spanFunction · 0.70

Tested by

no test coverage detected