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

Function emitQuestionTool

packages/opencode/src/cli/cmd/run/demo.ts:760–791  ·  view source on GitHub ↗
(state: State)

Source from the content-addressed store, hash-verified

758}
759
760function emitQuestionTool(state: State): void {
761 const ref = make(state, "question", {
762 questions: [
763 {
764 header: "Style",
765 question: "Which output style do you want to inspect?",
766 options: [
767 { label: "Diff", description: "Show diff block" },
768 { label: "Code", description: "Show code block" },
769 ],
770 multiple: false,
771 },
772 {
773 header: "Extras",
774 question: "Pick extra rows",
775 options: [
776 { label: "Usage", description: "Add usage row" },
777 { label: "Duration", description: "Add duration row" },
778 ],
779 multiple: true,
780 custom: true,
781 },
782 ],
783 })
784 doneTool(state, ref, {
785 title: "question",
786 output: "",
787 metadata: {
788 answers: [["Diff"], ["Usage", "custom-note"]],
789 },
790 })
791}
792
793function emitPermission(state: State, kind: PermissionKind = "edit"): void {
794 const root = process.cwd()

Callers 1

emitFmtFunction · 0.85

Calls 2

makeFunction · 0.70
doneToolFunction · 0.70

Tested by

no test coverage detected