Agent JSX

One authored definition ยท explicit runtime contracts

Write agents normally.
Compose the hierarchy once.

Agent files render one model-facing definition for models, prompts, input/output schemas, tools, skills, and MCP servers while owning state and callable methods. Composition JSX owns parent/child relationships and explicit authority. The model-driven Cloudflare target lowers the complete definition; deterministic reconcile and legacy Flue adapters keep their narrower existing contracts.

agents/chess-match.agent.tsx
class ChessMatch extends Agent<ChessState> {
  static agentName = "chess-match";
  initialState = initialChessState;

  render() {
    return this.define({
      model: "openrouter/openai/gpt-5-mini",
      description: "Run a validated chess match."
    });
  }

  get turn() {
    return turnFor(this.state);
  }

  @callable()
  handleTurn(decision: ChessDecision) {
    this.setState(state =>
      reduceChessTurn(state, decision)
    );
  }
}
match.tsx
composeAgent(
  <ChessMatch name="match">
    {({ turn, handleTurn }) => turn && (
      <Board turn={turn}>
        <Player
          agentClass={OpenAIPlayer}
          turn={turn}
          onTurn={result(handleTurn)}
        />
      </Board>
    )}
  </ChessMatch>
);
Cloudflare model-driven boundary: Native agentTool returns child output to the parent model. It does not carry parent callbacks, methods, result(...) callables, or render-prop continuations into the child facet; the Think target emits a diagnostic for each dropped capability kind.

Core primitives

A small authored surface

Compiler targets

Runtime glue is derived

TargetGenerated mapping
Cloudflare reconcileDurable classes, callable proxies, props, callback RPC, migrations, and deterministic infrastructure convergence.
Cloudflare model-drivenThe complete rendered definition: model, live prompt composition, schema boundaries, tools, skills, MCP clients, durable turns, and reasoning traces.
Legacy FlueThe existing low-level profile, roster, tool, and workflow adapter; no new full-definition support is implied.