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

Function setup

packages/opencode/test/cli/run/scrollback.surface.test.ts:62–90  ·  view source on GitHub ↗
(
  input: {
    width?: number
    wrote?: boolean
    theme?: RunTheme
    onThemeRelease?: (theme: RunTheme) => void
  } = {},
)

Source from the content-addressed store, hash-verified

60}
61
62async function setup(
63 input: {
64 width?: number
65 wrote?: boolean
66 theme?: RunTheme
67 onThemeRelease?: (theme: RunTheme) => void
68 } = {},
69) {
70 const out = await createTestRenderer({
71 width: input.width ?? 80,
72 screenMode: "split-footer",
73 footerHeight: 6,
74 externalOutputMode: "capture-stdout",
75 consoleMode: "disabled",
76 })
77 active.push(out.renderer)
78
79 const treeSitterClient = new MockTreeSitterClient({ autoResolveTimeout: 0 })
80 treeSitterClient.setMockResult({ highlights: [] })
81
82 return {
83 renderer: out.renderer,
84 scrollback: new RunScrollbackStream(out.renderer, input.theme ?? RUN_THEME_FALLBACK, {
85 treeSitterClient,
86 wrote: input.wrote ?? false,
87 onThemeRelease: input.onThemeRelease,
88 }),
89 }
90}
91
92function assistant(text: string, phase: StreamCommit["phase"] = "progress"): StreamCommit {
93 return {

Callers 3

acquireResourceFunction · 0.50
index.tsFile · 0.50

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected