MCPcopy Index your code
hub / github.com/callstack/agent-device / legacyStepToStructuredStep

Function legacyStepToStructuredStep

src/cli/batch-steps.ts:46–57  ·  view source on GitHub ↗
(legacyStep: LegacyCliBatchStep)

Source from the content-addressed store, hash-verified

44}
45
46function legacyStepToStructuredStep(legacyStep: LegacyCliBatchStep): BatchStep {
47 const input = readInputFromCli(
48 legacyStep.command,
49 legacyStep.positionals ?? [],
50 cliFlagsFromBatchStep(legacyStep.flags),
51 );
52 return {
53 command: legacyStep.command,
54 input,
55 ...(legacyStep.runtime === undefined ? {} : { runtime: legacyStep.runtime }),
56 };
57}
58
59function isStructuredBatchStepShape(step: unknown): step is Record<string, unknown> & BatchStep {
60 return isRecord(step) && 'input' in step && !('positionals' in step) && !('flags' in step);

Callers 1

normalizeCliBatchStepsFunction · 0.85

Calls 2

readInputFromCliFunction · 0.90
cliFlagsFromBatchStepFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…