compose-blocks
Composing blocks (BYO generation)
In Pireel Studio, you are the model for block HTML. Blocks are the designed graphic fragments laid over the video (metric cards, charts, diagrams, callouts, titles). The flow is always:
compose_block_brief → generate the block yourself → apply_block
This burns YOUR agent subscription, not the user's Pireel credits. The tools that run Pireel's own LLM instead (add_block, edit_block, add_graphics) charge the account's credits — use them only if the BYO flow fails repeatedly.
Step 1 — get the contract: compose_block_brief
Returns the FULL generation contract {system, prompt}, assembled live from the composition: theme tokens, frame design language, box size, on-screen beats, neighbor roster. Three targeting modes:
- Fill a placeholder: pass
blockIdof a待配图placeholder (ids fromget_state). Its design spec becomes the instruction — omitinstruction. - Rewrite an existing block: pass its
blockIdplus aninstructiondescribing the change. Callget_blockfirst when the rewrite must preserve specifics of what's already inside. - New element: pass
instructiononly (noblockId), optionallyatSecfor the timeline start (defaults to the playhead).
instruction is what to build/change — concrete and self-contained; Chinese preferred. If you call it with neither a placeholder blockId nor an instruction, it errors (instruction required).