(phase: ToolPhase, ctx: ToolFrame)
| 1312 | } |
| 1313 | |
| 1314 | export 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 | |
| 1341 | export function toolPermissionInfo( |
| 1342 | name: string, |
no test coverage detected