This package generates packages/kie-codegen/src/configs/*.ts and
packages/kie-nodes/src/kie-manifest.json from KIE's docs.
src/schema-fetcher.tsfetcheshttps://docs.kie.ai/llms.txtand the linked English API docs pages.src/schema-parser.tsextracts embedded OpenAPI YAML blocks and converts them toNodeConfigobjects.src/config-writer.tswritessrc/configs/image.ts,src/configs/audio.ts, andsrc/configs/video.ts.src/generate.tsreads those configs and writespackages/kie-nodes/src/kie-manifest.json.packages/kie-nodes/src/kie-factory.tsloads that manifest at runtime and creates node classes dynamically.
npm run generate:kie performs the full flow above. The src/configs/*.ts
files are generated artifacts now; do not patch them by hand for persistent
changes.
- Do not edit
packages/kie-nodes/src/kie-manifest.jsondirectly. - Do not edit
packages/kie-codegen/src/configs/*.tsdirectly unless you are doing a temporary investigation; those files are regenerated from KIE docs. - For persistent static node changes, update the parser/fetcher/writer rules,
then run
npm run generate:kie. - If behavior affects all KIE nodes, prefer fixing
src/types.ts,src/node-generator.ts, orpackages/kie-nodes/src/kie-factory.ts. - URL media inputs must expose AssetRef handles:
- single image URL fields:
type: "image" - single video URL fields:
type: "video" - single audio URL fields:
type: "audio" - multiple media URL fields:
type: "list[image]",type: "list[video]", ortype: "list[audio]"
- single image URL fields:
- Upload configs for list fields must set
isList: trueand the API parameter name, for exampleparamName: "reference_image_urls". - Arrays that are not media get their list type from the item schema —
list[dict],list[int],list[float],list[str]. Never fall back tolist[image]: an asset-typed field with no upload config is skipped bykie-factory.ts, so the parameter silently never reaches the request. - A
_url/_urlsparameter is media even when KIE declares ittype: object(Wan 3.0 reuses one YAML anchor for all of them). A_file_urls/_link_urlsparameter is not media — it stayslist[str].
npm run generate:kie reads live docs pages and live pricing, so its output is
not reproducible and nothing catches a generator change that quietly moves a
node's type, default, or enum. Fixture mode is the reproducible half:
src/fixture-generate.ts reads the checked-in fixtures/llms.txt snapshot and
the docs-page fixtures named by fixtures/generator-manifest.json, and writes
the outputs that manifest declares — the three module configs, the three
node-source modules, and the manifest JSON. No network, no pricing, no
timestamps, so two runs are byte-identical.
npm run generate:kie:check generates into a temporary directory and diffs the
declared outputs against fixtures/expected/. It exits non-zero on any
difference, on a declared docs fixture that is absent, on a declared URL the
llms.txt snapshot no longer lists, and when it compared nothing at all.
--strict also fails on an expected file no manifest output declares.
When a generator change is intended, refresh the expected outputs with
node scripts/provider-codegen-check.mjs --provider kie --write and commit the
diff. Adding a fixture means adding the docs page under fixtures/docs/ and the
entry in the generator manifest.
.github/workflows/provider-codegen.yml runs the check on every diff touching
this package.
After changing KIE codegen or factory behavior:
npm run generate:kie
npm run generate:kie:check
npm run lint --workspace=packages/kie-codegen
npm run test --workspace=packages/kie-codegenThen inspect git diff and confirm generated manifest changes are expected.