Observed behavior
The docstring on LoopCliConfig.maxPrompts in src/types.ts reads:
/**
* Maximum number of prompts to process. Unlimited when null/undefined.
*/
readonly maxPrompts?: number;
The doc says the field is unlimited when set to null or undefined. But the field's TypeScript type is number | undefined (optional number), so a strict TypeScript caller cannot legally pass null. The implementation in loop.ts does coalesce with ?? Infinity, which would accept null at runtime, but the type contract forbids it.
This is a small TS/JS hazard: a JavaScript caller reading the JSDoc might set maxPrompts: null and have it work; a TypeScript caller doing the same will see a compile error and assume the JSDoc is wrong.
Expected behavior
Either:
- The docstring should drop the mention of
null and read "Unlimited when omitted" (matching the JSON schema in schema/loop-the-loop.schema.json, which also requires an integer); or
- The type should be widened to
number | null | undefined if null is genuinely supported.
Option 1 matches existing intent (the JSON schema requires integer >= 0, not nullable).
Minimal reproduction
Open src/types.ts at line 86 and compare the JSDoc with the field type immediately below it. Also note that schema/loop-the-loop.schema.json declares maxPrompts as a non-nullable integer.
Suggested fix
Change the docstring to "Maximum number of prompts to process. Unlimited when omitted."
Observed behavior
The docstring on
LoopCliConfig.maxPromptsinsrc/types.tsreads:The doc says the field is unlimited when set to
nullorundefined. But the field's TypeScript type isnumber | undefined(optionalnumber), so a strict TypeScript caller cannot legally passnull. The implementation inloop.tsdoes coalesce with?? Infinity, which would acceptnullat runtime, but the type contract forbids it.This is a small TS/JS hazard: a JavaScript caller reading the JSDoc might set
maxPrompts: nulland have it work; a TypeScript caller doing the same will see a compile error and assume the JSDoc is wrong.Expected behavior
Either:
nulland read "Unlimited when omitted" (matching the JSON schema inschema/loop-the-loop.schema.json, which also requires an integer); ornumber | null | undefinedifnullis genuinely supported.Option 1 matches existing intent (the JSON schema requires
integer >= 0, not nullable).Minimal reproduction
Open
src/types.tsat line 86 and compare the JSDoc with the field type immediately below it. Also note thatschema/loop-the-loop.schema.jsondeclaresmaxPromptsas a non-nullable integer.Suggested fix
Change the docstring to "Maximum number of prompts to process. Unlimited when omitted."