Tools / code_generate
code_generate
Generate React/Vue file sets or a standalone static HTML document from a validated UiSchema.
Generated from @oods/foundry 0.19.0
One of the 26 tools your assistant sees by default.
Use it when a schema already exists; use design_compose instead to choose a layout or pipeline_run to compose, validate, render and generate together. Returns versioned artifacts, exact dependencies, required domain handlers and validationReceipt. Supply schema or schemaRef before its 30-minute expiry. profile selects draft/build/release; build performs static checks, while release verifies supplied evidence without rerunning it. options.output selects component/application; options.payloadMode:file returns file references, as does oversized output unless inline. Domain actions require consumer handlers. React and Vue shadcn mappings support components, screen apps and workflow apps. Full schema: oods://schemas/code_generate.input.json.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
schema | object | no | A structurally valid UiSchema tree to generate code from. UiElement.state branches are checked against the canonical workflow-state vocabulary by the state-contract gate. |
schemaRef | string | no | Reference to a cached UiSchema returned by design_compose. |
framework | "react" | "vue" | "html" | yes | Target framework. HTML uses the same record document renderer as repl render; build checks are static and do not execute a browser. |
profile | "draft" | "build" | "release" | no | Validation profile. See full schema for details. |
releaseEvidence | object | no | Evidence for release. See full schema for details. |
options | object | no | Operation options. |
Outputs
| Name | Type | Required | Description |
|---|---|---|---|
componentContracts | object[] | no | Advisory shared-scenario component reports. Each declared obligation is met, unmet or not checked with a reason; browser availability never blocks generation. |
status | "ok" | "error" | yes | Whether code generation succeeded. |
framework | "react" | "vue" | "html" | yes | The target framework that was used. |
artifact | generatedArtifact | no | Primary versioned, content-addressed file-set payload. Present when status is ok and options.payloadMode is inline (the default); with payloadMode file it is written to payload.directory as artifact.json instead. |
payload | object | no | payloadMode file: where the large output was written instead of being returned inline; the directory is beside the saved-schema store (<store>/../payloads/<tool>-<digest>). |
code | string | yes | Deprecated v0 compatibility alias for artifact.files[0].contents. Empty string on error. |
fileExtension | string | yes | Deprecated v0 compatibility alias for the primary generated file extension. |
imports | string[] | yes | Deprecated v0 compatibility alias. Use artifact.dependencies for exact versions and dependency kinds. |
warnings | codegenIssue[] | yes | Non-fatal issues encountered during generation. |
validationReceipt | validationReceipt | yes | Mandatory disclosure of the applied profile, independent policy axes, checks performed, and checks not reached. When generation reaches an artifact, the receipt names its content hash; release receipts retain accepted caller-supplied evidence envelopes for auditability. |
errors | codegenIssue[] | no | Fatal issues that prevented code generation. |
install | object | no | Present on success when the generated code imports @oods packages (react and vue), or mapped team packages: the exact versions it needs and the npm commands that install them, run in the app's directory in order. The @oods packages install from npm. An application's package.json pins the @oods packages its code imports at exact versions, and npm install brings the @oods packages those depend on: @oods/tokens arrives through @oods/component-styles. |
meta | object | no |
A real call
Recorded by this site's harbor run, step react, with the published OODS Foundry
0.19.0.
Its input:
{
"schemaRef": "compose-cb4a54e6",
"framework": "react",
"profile": "build",
"options": {
"output": "application",
"brand": "Harbor",
"theme": "light",
"payloadMode": "file"
}
} Its result, first lines:
{
"status": "ok",
"framework": "react",
"payload": {
"mode": "file",
"directory": "~/.oods-foundry/payloads/code.generate-93be549e1ad0",
"bytes": 135833,
"files": [
{
"path": "README.md",
"bytes": 743,
"sha256": "ff76faf406015d87e3f30252a34b2d91c2d49aeafb7063d91b299f17fe7e8444"
},
{
"path": "index.html",
"bytes": 335,
"sha256": "34921f4f0b77c5c7ee527d247867a8c497fd698481c792bcd00e9c4166ac1099"
},
{
"path": "package.json",
"bytes": 684,
"sha256": "39a7b7e4277a93cbde22e7f1e845f8dff744d5e803bcd67e5354f4fd7ead402f"
},
{
"path": "src/App.tsx",
"bytes": 1707,
"sha256": "42f6117dcc3f4136a1d1373b3eb2ac50cc8f686e5fc3cb27c209457d27c10601"
},
{
"path": "src/GeneratedUI.tsx",
"bytes": 14518,
"sha256": "142806962d19985a47d425c536dbb005b663291425d5dbc0a36262d8f8b27d82"
},
{
"path": "src/app.css",
"bytes": 600,
"sha256": "691e2dd49f7615425a9e76c073cecd186d03ed6df034a9a8d4c6e750bae59844"
},
{
"path": "src/main.tsx",
"bytes": 160,
"sha256": "44f61db45209da70184e2b43272c8825db1152e7d300df266ed4400da939f579"
},
{
"path": "src/oods-brand-harbor.css",
"bytes": 42272,
"sha256": "4c81c59cb58ebee92438ebe3f34319b3c84cba2c012c361fd835119bdb54f16f"
},
{
"path": "tsconfig.json",
"bytes": 333,
"sha256": "a0c6dad213106eebefcf5e817d07e31a8b6666e4bc678a449b7c578f62f6fb3a"
},
{
"path": "vite.config.mjs",
"bytes": 54,
"sha256": "ba9f5d24cd9f7332074aa5d15af690839bd18252ab8a31e4b47c11f5a2c1cd38"
},
{
"path": "artifact.json",