(kind, args)
| 869 | * Returns null if `kind` has no encoder (caller should fall back). |
| 870 | */ |
| 871 | export function buildAdditionalStep(kind, args) { |
| 872 | const meta = CASCADE_STEP[kind]; |
| 873 | const builder = STEP_BODY_BUILDER[kind]; |
| 874 | if (!meta || !builder) return null; |
| 875 | const body = builder(args || {}); |
| 876 | // CortexTrajectoryStep envelope: type=1, status=4, oneof step body |
| 877 | return Buffer.concat([ |
| 878 | writeVarintField(1, meta.typeEnum), |
| 879 | writeVarintField(4, CASCADE_STEP_STATUS_DONE), |
| 880 | writeMessageField(meta.oneofField, body), |
| 881 | ]); |
| 882 | } |
| 883 | |
| 884 | // ─── Reverse: parse cascade trajectory step → OpenAI tool_call ──────── |
| 885 | // |
no test coverage detected