| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402 |
- {
- "version": "3.16",
- "name": "Parallel-CodeGen",
- "description": "Fully parallel code generation: ProjectMeta -> default Theme/Theme.vth + project database -> all VL files in parallel.",
- "registry": {
- "params": [
- "userRequest(STRING)",
- "targetLang(STRING)"
- ],
- "services": [],
- "apis": [],
- "components": [],
- "vars": [
- "$projectMeta(OBJECT)",
- "$projectMetaStr(STRING)",
- "$vdbContent(STRING)",
- "$codeValidation(OBJECT)",
- "$vthContent(STRING)"
- ],
- "files": {
- "inputs": [],
- "artifacts": [
- "Process/ProjectMeta.json",
- "Database/*",
- "Services/*",
- "ExtComponents/*",
- "Sections/*",
- "Apps/*",
- "Theme/*"
- ]
- },
- "docs": {
- "1": "VL Syntax Rules",
- "100": "Agent-GenDatabase: .vdb generation",
- "102": "Agent-GenServiceDomain: .vs generation",
- "103": "Agent-GenComponent: .cp generation",
- "104": "Agent-GenSection: .sc generation",
- "105": "Agent-GenApp: .vx generation",
- "107": "Agent-RepairVLFile: Targeted repair for failed VL files",
- "111": "Agent-MetaDirect: Generate ProjectMeta directly from user request"
- }
- },
- "steps": [
- {
- "id": "ClearFiles_005_ClearExisting",
- "meta": {
- "title": "0. Clear existing VL files before regeneration"
- },
- "in": {},
- "out": {},
- "next": "LLM_010_GenMeta"
- },
- {
- "id": "LLM_010_GenMeta",
- "meta": {
- "title": "1. Generate ProjectMeta"
- },
- "in": {
- "docs": [
- "1",
- "111"
- ],
- "max_tokens": 16000,
- "stream": true,
- "messages": [
- {
- "role": "user",
- "content": "User Request:"
- },
- {
- "role": "user",
- "content": "=userRequest"
- },
- {
- "role": "user",
- "content": "Target Language: =targetLang"
- },
- {
- "role": "user",
- "content": "Generate the complete ProjectMeta JSON. REQUIRED top-level keys: specVersion, projectName, projectDescription, vlVersion, config, database, theme, dataSchema, services, components, sections, apps. REQUIREMENTS: - projectName MUST be PascalCase English-only. - config.themeFile MUST be \"Theme/Theme.vth\". - database.file MUST be \"Database/<ProjectName>.vdb\". - theme.file MUST be \"Theme/Theme.vth\". - every service MUST have filePath \"Services/<DomainId>.vs\". - every component MUST have filePath \"ExtComponents/<Id>.cp\". - every section MUST have filePath \"Sections/<Id>.sc\" and explicit consumesServices[] / usesComponents[]. - every app MUST have filePath \"Apps/<Id>.vx\". Output ONLY valid JSON."
- }
- ],
- "output_config": {
- "format": {
- "type": "json_object"
- }
- }
- },
- "out": {
- "$projectMeta": "=_result",
- "$projectMetaStr": "=_result",
- "/Process/ProjectMeta.json": "=_result",
- "/.vl-code/ProjectMeta.json": "=_result"
- },
- "next": "Fork_015_Foundation"
- },
- {
- "id": "Fork_015_Foundation",
- "meta": {
- "title": "2. Seed default Theme + generate Database (parallel)"
- },
- "children": [
- "LLM_020_GenDB",
- "SeedTheme_018_DefaultTheme"
- ],
- "next": "Fork_AllCode"
- },
- {
- "id": "LLM_020_GenDB",
- "meta": {
- "title": "2a. Generate Database Schema (.vdb)"
- },
- "in": {
- "docs": [
- "1",
- "100"
- ],
- "max_tokens": 8192,
- "stream": true,
- "messages": [
- {
- "role": "user",
- "content": "ProjectMeta:"
- },
- {
- "role": "user",
- "content": "=$projectMetaStr"
- },
- {
- "role": "user",
- "content": "Generate the .vdb database schema file based on the databases defined in ProjectMeta."
- }
- ]
- },
- "out": {
- "$vdbContent": "=_result",
- "/{$projectMeta.database.file || ('Database/' + $projectMeta.projectName + '.vdb')}": "=_result"
- },
- "next": "RETURN"
- },
- {
- "id": "SeedTheme_018_DefaultTheme",
- "meta": {
- "title": "2b. Seed default Theme/Theme.vth"
- },
- "in": {
- "path": "Theme/Theme.vth"
- },
- "out": {
- "$vthContent": "=_result",
- "/Theme/Theme.vth": "=_result"
- },
- "next": "RETURN"
- },
- {
- "id": "Fork_AllCode",
- "meta": {
- "title": "3. Generate ALL code in parallel"
- },
- "children": [
- "Loop_Services",
- "Loop_Components",
- "Loop_Sections",
- "Loop_Apps"
- ],
- "next": "Set_080_SkipValidation"
- },
- {
- "id": "Loop_Services",
- "meta": {
- "title": "3a. Generate Service Domains (parallel)"
- },
- "source": "=$projectMeta.services",
- "mode": "parallel",
- "children": [
- "LLM_040_GenService"
- ]
- },
- {
- "id": "LLM_040_GenService",
- "meta": {
- "title": "Service: =_item.domainId"
- },
- "in": {
- "docs": [
- "1",
- "102"
- ],
- "max_tokens": 8192,
- "stream": true,
- "messages": [
- {
- "role": "user",
- "content": "ProjectMeta:"
- },
- {
- "role": "user",
- "content": "=$projectMetaStr"
- },
- {
- "role": "user",
- "content": "Database Schema:"
- },
- {
- "role": "user",
- "content": "=$vdbContent"
- },
- {
- "role": "user",
- "content": "Generate the .vs service domain file for:"
- },
- {
- "role": "user",
- "content": "=_item"
- },
- {
- "role": "user",
- "content": "Backend query-safety rules: build filter arrays incrementally. If an optional STRING/INT filter is empty, null, 0, or -1 (used as 'all'), DO NOT include that condition in select/count queries. Never generate conditions like [\"field\",\"*eq\",\"\"] or [\"field\",\"*contains\",\"\"] for optional filters. Prefer `_conditions([]) = []` plus IF checks and `_conditions.push(...)`."
- }
- ]
- },
- "out": {
- "/{_item.filePath}": "=_result"
- },
- "onError": "skip"
- },
- {
- "id": "Loop_Components",
- "meta": {
- "title": "3b. Generate Components"
- },
- "source": "=$projectMeta.components",
- "mode": "parallel",
- "children": [
- "LLM_050_GenComponent"
- ]
- },
- {
- "id": "LLM_050_GenComponent",
- "meta": {
- "title": "Component: =_item.id"
- },
- "in": {
- "docs": [
- "1",
- "103"
- ],
- "max_tokens": 8192,
- "stream": true,
- "messages": [
- {
- "role": "user",
- "content": "ProjectMeta:"
- },
- {
- "role": "user",
- "content": "=$projectMetaStr"
- },
- {
- "role": "user",
- "content": "Generate the .cp component file for:"
- },
- {
- "role": "user",
- "content": "=_item"
- }
- ]
- },
- "out": {
- "/{_item.filePath}": "=_result"
- },
- "onError": "skip"
- },
- {
- "id": "Loop_Sections",
- "meta": {
- "title": "3c. Generate Sections (parallel)"
- },
- "source": "=$projectMeta.sections",
- "mode": "parallel",
- "children": [
- "LLM_060_GenSection"
- ]
- },
- {
- "id": "LLM_060_GenSection",
- "meta": {
- "title": "Section: =_item.id"
- },
- "in": {
- "docs": [
- "1",
- "104"
- ],
- "max_tokens": 16000,
- "stream": true,
- "messages": [
- {
- "role": "user",
- "content": "ProjectMeta:"
- },
- {
- "role": "user",
- "content": "=$projectMetaStr"
- },
- {
- "role": "user",
- "content": "Database Schema:"
- },
- {
- "role": "user",
- "content": "=$vdbContent"
- },
- {
- "role": "user",
- "content": "Generate the .sc section file for:"
- },
- {
- "role": "user",
- "content": "=_item"
- },
- {
- "role": "user",
- "content": "Compile-safety rules: 1) style: values must be static string literals only; NEVER use ternary, concat, variables, or any expression inside style:. If appearance depends on data, split the node with If blocks or use StateStyle conditions; never write style:($cond ? \"a\" : \"b\"). 2) NEVER emit CSS-only skin properties such as border-collapse. 3) Use only services that actually exist in ProjectMeta / generated services, and keep ServiceDomain / Service names aligned with declared ids. 4) Prefer VL-safe layout props over raw CSS. 5) NEVER bind events directly on <For-*> nodes; bind the event on the interactive child inside the loop instead. 6) NEVER emit deprecated <StateStyle-*> trigger:\"hover\" blocks. Output only valid .sc source."
- }
- ]
- },
- "out": {
- "/{_item.filePath}": "=_result"
- },
- "onError": "retry",
- "retryCount": 1
- },
- {
- "id": "Loop_Apps",
- "meta": {
- "title": "3d. Generate Apps"
- },
- "source": "=$projectMeta.apps",
- "mode": "parallel",
- "children": [
- "LLM_070_GenApp"
- ]
- },
- {
- "id": "LLM_070_GenApp",
- "meta": {
- "title": "App: =_item.id"
- },
- "in": {
- "docs": [
- "1",
- "105"
- ],
- "max_tokens": 8192,
- "stream": true,
- "messages": [
- {
- "role": "user",
- "content": "ProjectMeta:"
- },
- {
- "role": "user",
- "content": "=$projectMetaStr"
- },
- {
- "role": "user",
- "content": "Generate the .vx app file for:"
- },
- {
- "role": "user",
- "content": "=_item"
- },
- {
- "role": "user",
- "content": "Compile-safety rules: generate only VL-valid .vx source. Do not invent raw CSS properties, and only reference sections/components that exist in ProjectMeta."
- }
- ]
- },
- "out": {
- "/{_item.filePath}": "=_result"
- },
- "onError": "retry",
- "retryCount": 1
- },
- {
- "id": "Set_080_SkipValidation",
- "meta": {
- "title": "4. Skip validation (generation-only mode)"
- },
- "target": "$codeValidation",
- "value": "={\"success\":true,\"skipped\":true,\"reason\":\"validation disabled\"}",
- "next": "Stop_Done"
- },
- {
- "id": "Stop_Done",
- "meta": {
- "title": "Done"
- }
- }
- ]
- }
|