sim_code_to_flow
Derive a Petri-net model from source code with the configured LLM (control-flow, state-machine, resources or concurrency focus) and store it as a NEW model you own when it passes sim_create_model's decode and the model validator. Stored, it returns stored: true with id, url, name, usage and warnings (what sim_create_model would warn about the model, omitted when there is nothing to say). Otherwise nothing is stored, and it returns stored: false with the LLM's model JSON as model, usage, and either error — one string: the decode failure ("response is not a model: ...") or the unknown-field refusal worded as sim_create_model words it, each misspelt key by path with the key it most likely meant and the structural reasons after them — or errors, the validator's list (each with code, message and fix); fix the JSON and store it with sim_create_model. A reply with no JSON object in it, or a model the store's own validation still refuses, is a tool error naming why. Runs generator.CodeToFlow directly; this tool is its only surface on sim.pflow.xyz, which mounts no code-to-flow HTTP endpoint. Needs sign-in; refused when this deployment has no LLM provider configured.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | source code to analyse | |
| name | No | name for the derived model; the LLM is asked to use it, and it is filled in, before any check, when the model comes back without one | |
| focus | No | control-flow (default), state-machine, resources or concurrency | |
| language | No | source language hint, e.g. go, python, javascript |