MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / parseBotCallbackStep

Function parseBotCallbackStep

apps/web/src/lib/bot/step-budget.ts:3–10  ·  view source on GitHub ↗
(value: string | null)

Source from the content-addressed store, hash-verified

1import { MAX_ITERATIONS } from '@/lib/bot/constants';
2
3export function parseBotCallbackStep(value: string | null): number {
4 if (!value) return 0;
5
6 const parsed = Number(value);
7 if (!Number.isSafeInteger(parsed) || parsed < 0) return 0;
8
9 return Math.min(parsed, MAX_ITERATIONS);
10}
11
12export function getRemainingBotIterations(completedStepCount: number): number {
13 if (!Number.isSafeInteger(completedStepCount) || completedStepCount < 0) {

Callers 3

buildBotCallbackUrlFunction · 0.90
POSTFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected