MCPcopy
hub / github.com/anomalyco/opencode / toolScroll

Function toolScroll

packages/opencode/src/cli/cmd/run/tool.ts:1314–1339  ·  view source on GitHub ↗
(phase: ToolPhase, ctx: ToolFrame)

Source from the content-addressed store, hash-verified

1312}
1313
1314export function toolScroll(phase: ToolPhase, ctx: ToolFrame): string {
1315 const draw = rule(ctx.name)?.scroll?.[phase]
1316 try {
1317 if (draw) {
1318 return draw(props(ctx))
1319 }
1320 } catch {
1321 if (phase === "start") {
1322 return fallbackStart(ctx)
1323 }
1324 if (phase === "progress") {
1325 return ctx.raw
1326 }
1327 return fallbackFinal(ctx)
1328 }
1329
1330 if (phase === "start") {
1331 return fallbackStart(ctx)
1332 }
1333
1334 if (phase === "progress") {
1335 return ctx.raw
1336 }
1337
1338 return fallbackFinal(ctx)
1339}
1340
1341export function toolPermissionInfo(
1342 name: string,

Callers 1

toolEntryBodyFunction · 0.85

Calls 5

ruleFunction · 0.85
propsFunction · 0.85
fallbackStartFunction · 0.85
fallbackFinalFunction · 0.85
drawFunction · 0.70

Tested by

no test coverage detected