MCPcopy Create free account
hub / github.com/callstack/agent-device / readBatchInput

Function readBatchInput

src/commands/batch/metadata.ts:108–118  ·  view source on GitHub ↗
(input: unknown, fields: ReturnType<typeof batchFields>)

Source from the content-addressed store, hash-verified

106}
107
108function readBatchInput(input: unknown, fields: ReturnType<typeof batchFields>): BatchInput {
109 const parsed = readFieldInput(input, fields);
110 const maxSteps = parsed.maxSteps ?? DEFAULT_BATCH_MAX_STEPS;
111 if (!isValidBatchMaxSteps(maxSteps)) {
112 throw new Error(`Invalid batch maxSteps: ${String(parsed.maxSteps)}`);
113 }
114 assertBatchStepCount(parsed.steps.length, maxSteps, batchPlainError);
115 return {
116 ...parsed,
117 };
118}
119
120function readBatchSteps(steps: unknown, nestedCommands: readonly string[]): BatchCommandStep[] {
121 if (!Array.isArray(steps)) {

Callers 1

Calls 3

readFieldInputFunction · 0.90
isValidBatchMaxStepsFunction · 0.90
assertBatchStepCountFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…