velloo 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +29 -7
  2. package/canvas/assets/index-BDBBHdHH.css +2 -0
  3. package/canvas/assets/index-QdsLJNY9.js +29 -0
  4. package/canvas/assets/{lucide-all-Bcm80WFX.js → lucide-all-R8DUyY-B.js} +1 -1
  5. package/canvas/index.html +2 -2
  6. package/chunk-0rdf6trc.js +2 -0
  7. package/{chunk-npsg7btt.js → chunk-0wafc9aw.js} +1 -1
  8. package/chunk-0wqxb8r9.js +3 -0
  9. package/{chunk-e6nhc3ay.js → chunk-10hap8kc.js} +1 -1
  10. package/chunk-18eqh3s1.js +2 -0
  11. package/chunk-19xyzep8.js +2 -0
  12. package/{chunk-7gtvstne.js → chunk-1h3gqy7w.js} +1 -1
  13. package/{chunk-vjrn10xr.js → chunk-33t0csxs.js} +2 -2
  14. package/{chunk-7xffbj5h.js → chunk-3ffs39e8.js} +1 -1
  15. package/chunk-42bj6r30.js +3 -0
  16. package/chunk-49w26e94.js +5 -0
  17. package/{chunk-7a45tn73.js → chunk-4pkw6d9n.js} +2 -2
  18. package/{chunk-ph94nrc8.js → chunk-4sjvdakg.js} +1 -1
  19. package/chunk-5f0xv80x.js +5 -0
  20. package/{chunk-2dm4x17z.js → chunk-5ma8zbty.js} +1 -1
  21. package/{chunk-t9ygewjx.js → chunk-5y9hem1j.js} +1 -1
  22. package/chunk-66qgm91k.js +708 -0
  23. package/{chunk-dj1pp4e3.js → chunk-675tr675.js} +1 -1
  24. package/{chunk-jwzhhhzn.js → chunk-6cgvzwec.js} +1 -1
  25. package/chunk-6k05kqnc.js +3 -0
  26. package/{chunk-py6sjyzk.js → chunk-6ytv1v2r.js} +1 -1
  27. package/{chunk-2h24va0j.js → chunk-75sc3adm.js} +1 -1
  28. package/chunk-7cexzg71.js +2 -0
  29. package/chunk-98rann8t.js +2 -0
  30. package/{chunk-b58pnj20.js → chunk-a16mz9zf.js} +1 -1
  31. package/{chunk-m1wp8cpt.js → chunk-afe25dpr.js} +1 -1
  32. package/{chunk-k3dpwjx4.js → chunk-ahm4zd56.js} +1 -1
  33. package/chunk-asvdqkdp.js +6 -0
  34. package/{chunk-rfrbnw8r.js → chunk-b3x80jc1.js} +1 -1
  35. package/{chunk-tr49kraa.js → chunk-cdqah1hy.js} +1 -1
  36. package/{chunk-r03aywsb.js → chunk-cqt1dpxd.js} +1 -1
  37. package/{chunk-xbhxzdat.js → chunk-d4r0myxr.js} +1 -1
  38. package/{chunk-km3z2czq.js → chunk-d9kx7v12.js} +1 -1
  39. package/{chunk-2y9nnzpr.js → chunk-df557bn4.js} +1 -1
  40. package/{chunk-6zr596r2.js → chunk-edgwx026.js} +1 -1
  41. package/chunk-emv1j50t.js +2 -0
  42. package/{chunk-jep31ffe.js → chunk-ewgdcgrk.js} +1 -1
  43. package/chunk-f45p6kcb.js +2 -0
  44. package/{chunk-b4jy4hcd.js → chunk-gn9wcc1b.js} +1 -1
  45. package/{chunk-cejmmx3r.js → chunk-hr3gbak5.js} +2 -2
  46. package/{chunk-91pajfnm.js → chunk-j7tzbt3d.js} +1 -1
  47. package/chunk-mm8wv3bg.js +3 -0
  48. package/chunk-nbbnb5e9.js +3 -0
  49. package/{chunk-a9mgvspm.js → chunk-ngbqd7kb.js} +32 -12
  50. package/chunk-nkqtnwzz.js +2 -0
  51. package/{chunk-2jbhv7vh.js → chunk-q3kf8243.js} +1 -1
  52. package/{chunk-8t5phg0s.js → chunk-qpv28z8d.js} +1 -1
  53. package/{chunk-hsrg23gd.js → chunk-rd65xm6r.js} +1 -1
  54. package/{chunk-aa3str7g.js → chunk-ryga3ny1.js} +1 -1
  55. package/{chunk-cvn689d5.js → chunk-sb5h27w9.js} +2 -2
  56. package/chunk-tw4kw4ps.js +22 -0
  57. package/chunk-v6c3h9ft.js +3 -0
  58. package/chunk-vgx47anc.js +3 -0
  59. package/chunk-vrvkvb0v.js +244 -0
  60. package/{chunk-db7mf114.js → chunk-vryadew3.js} +9 -7
  61. package/chunk-w6f40y2x.js +11 -0
  62. package/{chunk-0446t32z.js → chunk-we8hvy6e.js} +1 -1
  63. package/{chunk-ykdx12na.js → chunk-wkqrb2tz.js} +1 -1
  64. package/{chunk-r9ekd92e.js → chunk-xzkczmgg.js} +1 -1
  65. package/{chunk-yfttm20w.js → chunk-ycrddh47.js} +1 -1
  66. package/{chunk-j5axqyan.js → chunk-z78c1kf8.js} +1 -1
  67. package/cli.js +1 -1
  68. package/package.json +3 -1
  69. package/pkgs/provider-html/src/index.ts +68 -0
  70. package/pkgs/provider-html/src/registry.ts +121 -0
  71. package/pkgs/provider-html/src/version.ts +1 -0
  72. package/pkgs/provider-none/src/components-inline.tsx +12 -3
  73. package/pkgs/provider-none/src/components.tsx +11 -3
  74. package/pkgs/provider-none/src/manifest.ts +1 -0
  75. package/pkgs/schema/src/config.ts +33 -1
  76. package/pkgs/schema/src/css-declarations.ts +41 -0
  77. package/pkgs/schema/src/index.ts +3 -0
  78. package/pkgs/schema/src/theme.ts +40 -0
  79. package/plugins/claude/velloo/agents/velloo-design-reviewer.md +56 -13
  80. package/plugins/claude/velloo/agents/velloo-designer.md +4 -1
  81. package/skills/velloo-setup/SKILL.md +19 -55
  82. package/canvas/assets/index-B1OD0Yz5.css +0 -2
  83. package/canvas/assets/index-BWYFx2Rr.js +0 -29
  84. package/chunk-00t0bz7x.js +0 -244
  85. package/chunk-0zen7bzb.js +0 -3
  86. package/chunk-5ywkk7d6.js +0 -2
  87. package/chunk-b7famda5.js +0 -3
  88. package/chunk-f5g45xed.js +0 -2
  89. package/chunk-fjbzk4sw.js +0 -3
  90. package/chunk-hv52a6hf.js +0 -2
  91. package/chunk-mcymwefw.js +0 -5
  92. package/chunk-n0kx20s2.js +0 -2
  93. package/chunk-nwf2kn41.js +0 -26
  94. package/chunk-phz993p3.js +0 -2
  95. package/chunk-qan5dnjt.js +0 -688
  96. package/chunk-r5d0jsnd.js +0 -5
  97. package/chunk-shac6bat.js +0 -6
  98. package/chunk-t4zvcece.js +0 -10
  99. package/chunk-tarws372.js +0 -2
  100. package/chunk-yghypth2.js +0 -2
  101. package/chunk-zqtz23xk.js +0 -3
package/chunk-r5d0jsnd.js DELETED
@@ -1,5 +0,0 @@
1
- // @bun
2
- import{ThemeSchema}from"./chunk-7a45tn73.js";import{colorizeDiff,emitTheme,emitNativeTheme,loadDesignFolder,resolveProviders}from"./chunk-qan5dnjt.js";import"./chunk-m1wp8cpt.js";import"./chunk-a9mgvspm.js";import"./chunk-80fjfyha.js";import"./chunk-s23gtejf.js";import{detectHost}from"./chunk-b7famda5.js";import{DESIGN_ARG_DESCRIPTION,resolveDesign}from"./chunk-dj1pp4e3.js";import{defineCommand}from"./chunk-2smsg2ct.js";import{readFile}from"fs/promises";import{isAbsolute,join,resolve}from"path";import{stdin,stdout}from"process";import{createInterface}from"readline/promises";async function readMaybe(path){try{return await readFile(path,"utf8")}catch{return}}async function themeEmitter(folderRoot,theme,outDir,cssOnly,tailwind3){let design=await loadDesignFolder(folderRoot),{defaultProvider}=await resolveProviders(design.config,folderRoot),adapter=defaultProvider;if(adapter.themeToNative&&adapter.themeModule){let toNative=adapter.themeToNative.bind(adapter),spec=adapter.themeModule;return{native:!0,produce:(apply)=>emitNativeTheme(toNative(theme),{spec,outputDir:outDir,apply,...theme.colorsDark?{darkThemeOptions:toNative(theme,!0)}:{},sourceTheme:theme})}}let customCss=await readMaybe(join(folderRoot,"theme","custom.css"));return{native:!1,produce:(apply)=>emitTheme(theme,{outputDir:outDir,apply,cssOnly,...customCss?{customCss}:{},...tailwind3?{tailwindMajor:3}:{}})}}var exportTheme=defineCommand({meta:{name:"export",description:"Export DTCG tokens.json plus the framework theme in diff mode \u2014 Tailwind v4 globals.css by default, or v3 CSS + preset when detected"},args:{to:{type:"string",required:!0,description:"Target app directory (writes <to>/app/globals.css and <to>/tailwind.config.ts)"},design:{type:"string",description:DESIGN_ARG_DESCRIPTION},theme:{type:"string",description:"Path to theme JSON (default: the design's theme/default.json)"},apply:{type:"boolean",description:"Write files instead of printing diffs. Default: dry-run."},"css-only":{type:"boolean",description:"Skip tailwind.config.ts (CSS-only export)."},"force-v4":{type:"boolean",description:"Emit the v4 artifacts even when the target app looks like Tailwind v3."}},async run({args}){let folderRoot=await resolveDesign(args.design,"theme export",{designFlag:"--design"}),themePath=args.theme?resolve(args.theme):join(folderRoot,"theme","default.json"),outDir=isAbsolute(args.to)?args.to:resolve(args.to),themeJson=JSON.parse(await readFile(themePath,"utf8")),theme=ThemeSchema.parse(themeJson),tailwind3=!args["force-v4"]&&detectHost(outDir).tailwindMajor===3,{native,produce}=await themeEmitter(folderRoot,theme,outDir,Boolean(args["css-only"]),tailwind3);if(!native&&tailwind3)console.log("velloo theme export: target looks like Tailwind v3 \u2014 emitting velloo-theme.css + velloo.preset (pass --force-v4 for the v4 artifacts).");let result=await produce(Boolean(args.apply)),useColor=stdout.isTTY===!0,anyChange=!1;for(let warning of result.warnings)console.error(`velloo theme export: warning: ${warning}`);for(let file of result.files){if(file.diff.identical){console.log(`velloo theme export: ${file.path} is already up to date.`);continue}if(anyChange=!0,file.applied)console.log(`velloo theme export: wrote ${file.path}`);else{let rendered=useColor?colorizeDiff(file.diff.diff):file.diff.diff;stdout.write(`${rendered}
3
- `),stdout.write(`Would write to: ${file.path}
4
-
5
- `)}}for(let note of result.notes)console.log(`velloo theme export: ${note}`);if(!anyChange||args.apply)return;if(!stdin.isTTY){console.log("(non-TTY) re-run with --apply to write the files.");return}let rl=createInterface({input:stdin,output:stdout}),answer=(await rl.question("Apply all? (y/N) ")).trim().toLowerCase();if(rl.close(),answer==="y"||answer==="yes"){let final=await produce(!0);for(let file of final.files)if(file.applied)console.log(`velloo theme export: wrote ${file.path}`)}else console.log("velloo theme export: skipped (no changes written).")}}),theme_default=defineCommand({meta:{name:"theme",description:"Work with a design's theme"},subCommands:{export:exportTheme}});export{theme_default as default};
package/chunk-shac6bat.js DELETED
@@ -1,6 +0,0 @@
1
- // @bun
2
- import{string,number,object,CURRENT_SCHEMA_VERSION,schemaVersionOf}from"./chunk-7a45tn73.js";import{writeJsonAtomic}from"./chunk-qan5dnjt.js";import{TOOL_VERSION}from"./chunk-zqtz23xk.js";import{defaultCloudUrl}from"./chunk-6zr596r2.js";function isLoopbackHost(host){let normalized=host.trim().toLowerCase().replace(/^\[|\]$/g,"").replace(/\.$/,"");if(normalized==="localhost"||normalized==="::1")return!0;let octets=normalized.split(".");return octets.length===4&&octets[0]==="127"&&octets.every((part)=>/^\d+$/.test(part))}function assertLoopbackHost(host){if(isLoopbackHost(host))return;throw Error(`refusing to bind ${JSON.stringify(host)}: the canvas and MCP endpoints have no authentication and only serve loopback (use 127.0.0.1, localhost or ::1)`)}import{closeSync,existsSync,mkdirSync,openSync,readFileSync,realpathSync,statSync,unlinkSync,writeSync}from"fs";import{mkdir,readFile}from"fs/promises";import{homedir}from"os";import{dirname,join,resolve}from"path";var DaemonRecordSchema=object({root:string().min(1),pid:number().int().positive(),canvasUrl:string().min(1),canvasPort:number().int().positive(),mcpUrl:string().min(1),mcpPort:number().int().positive(),cloudUrl:string().min(1),version:string().min(1),startedAt:string().min(1)});function daemonMatchesRuntime(rec,cloudUrl=defaultCloudUrl()){return rec.version===TOOL_VERSION&&rec.cloudUrl===cloudUrl}var MUTEX_STALE_MS=15000,HEALTHY_TIMEOUT_MS=15000,cacheDir=(root)=>join(root,".design","cache"),lockPath=(root)=>join(cacheDir(root),"runtime.json"),mutexPath=(root)=>join(cacheDir(root),"runtime.lock"),logPath=(root)=>join(cacheDir(root),"daemon.log"),portMemoPath=(root)=>join(cacheDir(root),"port.json"),registryPath=()=>process.env.VELLOO_DAEMONS_PATH??join(homedir(),".velloo","daemons.json");function daemonRoot(folder){let abs=resolve(folder);return existsSync(abs)?realpathSync(abs):abs}class DesignFolderFormatError extends Error{root;found;current;constructor(message,root,found,current){super(message);this.root=root;this.found=found;this.current=current;this.name="DesignFolderFormatError"}}function assertFolderFormatCurrent(root){let raw;try{raw=JSON.parse(readFileSync(join(root,".design","config.json"),"utf8"))}catch{return}let found=schemaVersionOf(raw);if(found===CURRENT_SCHEMA_VERSION)return;let message=found>CURRENT_SCHEMA_VERSION?`velloo: ${root} uses design-folder schema version ${found}, but this velloo only knows version ${CURRENT_SCHEMA_VERSION}. Upgrade velloo to open it.`:`velloo: ${root} uses design-folder schema version ${found} (current: ${CURRENT_SCHEMA_VERSION}). Run \`velloo upgrade ${root}\` to migrate it.`;throw new DesignFolderFormatError(message,root,found,CURRENT_SCHEMA_VERSION)}async function readLock(root){try{let parsed=DaemonRecordSchema.safeParse(JSON.parse(await readFile(lockPath(root),"utf8")));return parsed.success?parsed.data:null}catch{return null}}async function writeLock(rec){await writeJsonAtomic(lockPath(rec.root),rec)}function removeLock(root){try{unlinkSync(lockPath(root))}catch{}}var DEFAULT_CANVAS_PORT=7300,DERIVED_BAND={start:7310,size:90},PortMemoSchema=object({canvasPort:number().int().min(1).max(65535)});async function readRememberedPort(root){try{let parsed=PortMemoSchema.safeParse(JSON.parse(await readFile(portMemoPath(root),"utf8")));return parsed.success?parsed.data.canvasPort:null}catch{return null}}async function rememberPort(root,canvasPort){await writeJsonAtomic(portMemoPath(root),{canvasPort})}function derivedPort(root){let digest=Bun.CryptoHasher.hash("sha256",root,"hex");return DERIVED_BAND.start+Number.parseInt(digest.slice(0,8),16)%DERIVED_BAND.size}function portCandidates(opts){if(opts.explicit!==void 0)return[opts.explicit];let wanted=[opts.remembered,DEFAULT_CANVAS_PORT,derivedPort(opts.root)];return[...new Set(wanted.filter((p)=>typeof p==="number"))]}var HealthSchema=object({app:string().optional(),root:string().optional()});async function isLive(rec){try{let res=await fetch(`http://127.0.0.1:${rec.canvasPort}/api/health`,{signal:AbortSignal.timeout(1000)});if(!res.ok)return!1;let body=await res.json(),health=HealthSchema.safeParse(body);return health.success&&health.data.app==="velloo"&&health.data.root===rec.root}catch{return!1}}async function registryRead(){try{let raw=JSON.parse(await readFile(registryPath(),"utf8"));if(!Array.isArray(raw))return[];return raw.flatMap((entry)=>{let parsed=DaemonRecordSchema.safeParse(entry);return parsed.success?[parsed.data]:[]})}catch{return[]}}async function registryWrite(records){let p=registryPath();await mkdir(dirname(p),{recursive:!0}),await writeJsonAtomic(p,records)}async function registryUpsert(rec){let others=(await registryRead()).filter((r)=>r.root!==rec.root);await registryWrite([...others,rec])}async function registryRemove(root){await registryWrite((await registryRead()).filter((r)=>r.root!==root))}async function listDaemons(){let all=await registryRead(),live=[];for(let rec of all)if(await isLive(rec))live.push(rec);if(live.length!==all.length)await registryWrite(live);return live}function daemonSpawnCmd(root,preferredPort,host){let args=["__daemon",root,"--host",host];if(preferredPort!==void 0)args.push("--port",String(preferredPort));let entry=Bun.main;return existsSync(entry)?[process.execPath,entry,...args]:[process.execPath,...args]}function spawnDetached(root,preferredPort,host){mkdirSync(cacheDir(root),{recursive:!0});let logStart=0;try{logStart=statSync(logPath(root)).size}catch{}let log=openSync(logPath(root),"a"),proc=Bun.spawn(daemonSpawnCmd(root,preferredPort,host),{stdin:"ignore",stdout:log,stderr:log,detached:process.platform==="win32"});return proc.unref(),{exited:proc.exited,logStart}}function claimMutex(root){let path=mutexPath(root);try{let fd=openSync(path,"wx");return writeSync(fd,String(process.pid)),closeSync(fd),!0}catch{try{if(Date.now()-statSync(path).mtimeMs>MUTEX_STALE_MS)return unlinkSync(path),claimMutex(root)}catch{}return!1}}function releaseMutex(root){try{unlinkSync(mutexPath(root))}catch{}}function startupFailure(root,logStart){let appended="";try{appended=readFileSync(logPath(root),"utf8").slice(logStart)}catch{}let lines=appended.split(`
3
- `).map((l)=>l.replace(/^velloo __daemon: /,"").trimEnd()).filter((l)=>l.trim().length>0).slice(-8);if(lines.length===0)return`velloo: the canvas daemon for ${root} exited during startup with no output \u2014 see ${logPath(root)}`;return`velloo: the canvas daemon for ${root} exited during startup:
4
- ${lines.join(`
5
- `)}`}async function waitForHealthy(root,spawned){let deadline=Date.now()+HEALTHY_TIMEOUT_MS,died=!1;if(spawned)spawned.exited.then(()=>died=!0);while(Date.now()<deadline){let rec=await readLock(root);if(rec&&await isLive(rec))return rec;if(died)throw Error(startupFailure(root,spawned?.logStart??0));await new Promise((r)=>setTimeout(r,150))}throw Error(`velloo: canvas daemon for ${root} didn't come up \u2014 see ${logPath(root)}`)}async function ensureDaemon(folder,opts={}){let root=daemonRoot(folder);assertFolderFormatCurrent(root);let host=opts.host??"127.0.0.1";assertLoopbackHost(host),mkdirSync(cacheDir(root),{recursive:!0});let deadline=Date.now()+HEALTHY_TIMEOUT_MS+5000;while(Date.now()<deadline){let existing=await readLock(root);if(existing&&await isLive(existing)){if(daemonMatchesRuntime(existing))return existing;await stopDaemon(root)}if(claimMutex(root))try{let again=await readLock(root);if(again&&await isLive(again)){if(daemonMatchesRuntime(again))return again;await stopDaemon(root)}let spawned=spawnDetached(root,opts.preferredPort,host);return opts.onSpawn?.(),await waitForHealthy(root,spawned)}finally{releaseMutex(root)}await new Promise((r)=>setTimeout(r,200))}throw Error(`velloo: timed out ensuring a canvas daemon for ${root}`)}async function stopDaemon(root){let rec=await readLock(root);if(!rec)return!1;try{process.kill(rec.pid,"SIGTERM")}catch{}for(let i=0;i<30;i++){if(!await isLive(rec))break;await new Promise((r)=>setTimeout(r,100))}return removeLock(root),await registryRemove(root),!0}
6
- export{assertLoopbackHost,daemonRoot,DesignFolderFormatError,assertFolderFormatCurrent,readLock,writeLock,removeLock,readRememberedPort,rememberPort,portCandidates,isLive,registryUpsert,registryRemove,listDaemons,ensureDaemon,stopDaemon};
package/chunk-t4zvcece.js DELETED
@@ -1,10 +0,0 @@
1
- // @bun
2
- import{ScreenSchema}from"./chunk-7a45tn73.js";import{detectTailwindMajor,emitCode,moduleTarget,v3ClassIssues,classNamesInJsx,styleChannelOf,loadDesignFolder,hostAppRootFrom,resolveProviders}from"./chunk-qan5dnjt.js";import"./chunk-m1wp8cpt.js";import"./chunk-a9mgvspm.js";import"./chunk-80fjfyha.js";import{fail}from"./chunk-s23gtejf.js";import{findDesignConfig}from"./chunk-j5axqyan.js";import{createProgress}from"./chunk-pjtg3wnm.js";import{DESIGN_ARG_DESCRIPTION,resolveDesign,pickScreen}from"./chunk-dj1pp4e3.js";import{defineCommand}from"./chunk-2smsg2ct.js";import{readFile,writeFile}from"fs/promises";import{isAbsolute,resolve}from"path";import{stdout}from"process";async function folderEmitContext(screenPath,screen){let found=await findDesignConfig(screenPath);if(!found)return{};let design=await loadDesignFolder(found.folder),{providers,defaultProvider}=await resolveProviders(design.config,found.folder),provider=screen.library&&providers[screen.library]||defaultProvider,adapter=provider,target;if(adapter.codegenModule){let manifest=await provider.loadManifest();target=moduleTarget(manifest.filter((c)=>c.source!=="velloo").map((c)=>c.id),adapter.codegenModule)}let inlineStyle=styleChannelOf(provider,design.config.styling?.framework).kind==="style";return{snippets:design.snippets,...design.config.extensions?{extensions:design.config.extensions}:{},...target?{target}:{},...inlineStyle?{inlineStyle:!0}:{}}}var emit_default=defineCommand({meta:{name:"emit",description:"Print or write agent-consumed IR for a screen."},args:{screen:{type:"positional",required:!1,description:"Screen id, or a path to a screen JSON. Omit to pick interactively."},design:{type:"string",description:DESIGN_ARG_DESCRIPTION},to:{type:"string",description:"Write IR as JSON to this path. Omit to print the JSX body to stdout (agent-friendly when piped)."},"components-alias":{type:"string",description:'Override the import prefix the IR mentions in snippet identifiers. Defaults to .design/config.json#codegen.componentsAlias, else "@/components/ui".'}},async run({args}){let interactive=Boolean(process.stdin.isTTY),screenArg=args.screen,screenPath=!!screenArg&&(screenArg.includes("/")||screenArg.endsWith(".json"))?resolve(screenArg):(await pickScreen(await resolveDesign(args.design,"emit",{designFlag:"--design"}),screenArg,interactive,"emit")).path,screenJson=JSON.parse(await readFile(screenPath,"utf8")),screen=ScreenSchema.parse(screenJson),progress=createProgress();progress.start("preparing code");try{let componentsAlias=args["components-alias"]??await readConfigAlias(screenPath),context=await folderEmitContext(screenPath,screen);progress.step("generating code");let result=await emitCode(screen,{...componentsAlias?{componentsAlias}:{},...context});if(!result.ok){progress.fail("code generation failed");let e=result.error;if(e.kind==="UnknownComponent")fail("emit",`unknown component: ${JSON.stringify(e.ref)}`);else if(e.kind==="SnippetNotFound")fail("emit",`snippet not found: ${JSON.stringify(e.snippetId)}`);else fail("emit",`screen not found: ${JSON.stringify(e.screenId)}`)}let found=await findDesignConfig(screenPath),tailwindV3Compat=found&&!context?.target&&!context?.inlineStyle?detectTailwindMajor(hostAppRootFrom(found.folder,found.config.hostApp))===3?v3ClassIssues([...result.value.classesUsed,...result.value.snippetsUsed.flatMap((s)=>classNamesInJsx(s.jsx))]):[]:[];if(args.to){progress.step("writing code");let outPath=isAbsolute(args.to)?args.to:resolve(args.to),ir=tailwindV3Compat.length>0?{...result.value,tailwindV3Compat}:result.value;await writeFile(outPath,JSON.stringify(ir,null,2),"utf8"),progress.succeed("generated code"),console.log(`velloo emit: wrote ${outPath}`);return}if(progress.succeed("generated code"),stdout.write(`// screen: ${result.value.screen.id} (${result.value.screen.name})
3
- `),stdout.write(`// components: ${result.value.componentsUsed.join(", ")||"(none)"}
4
- `),result.value.iconsUsed.length>0)stdout.write(`// icons (lucide): ${result.value.iconsUsed.join(", ")}
5
- `);if(result.value.snippetsUsed.length>0)stdout.write(`// snippets: ${result.value.snippetsUsed.map((s)=>`${s.componentName}(${s.id})`).join(", ")}
6
- `);for(let issue of tailwindV3Compat)stdout.write(issue.v3?`// tailwind v3 host: \`${issue.class}\` \u2192 \`${issue.v3}\` (${issue.note})
7
- `:`// tailwind v3 host: \`${issue.class}\` \u2014 ${issue.note}
8
- `);stdout.write(`
9
- `),stdout.write(`${result.value.jsx}
10
- `)}catch(error){throw progress.fail("code generation failed"),error}}});async function readConfigAlias(screenPath){return(await findDesignConfig(screenPath))?.config.codegen?.componentsAlias}export{emit_default as default};
package/chunk-tarws372.js DELETED
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{clsx,helperDescriptors,require_react_jsx_dev_runtime_development,helpersRegistry,TAILWIND_CLASSNAME,helperSourcePath}from"./chunk-qan5dnjt.js";import{headingInlineStyle,textInlineStyle}from"./chunk-7a45tn73.js";import{resolveProviderSrcDir}from"./chunk-fjbzk4sw.js";import{require_react_development}from"./chunk-a9mgvspm.js";import{__toESM}from"./chunk-2smsg2ct.js";import{noLibVersion}from"./chunk-cxe6jjwj.js";import{dirname,join}from"path";import{fileURLToPath}from"url";var NONE_INTRO=["**This folder has no component library** \u2014 only bare primitives wrapping plain HTML: `Box`/`Stack`/`Container` for layout, `Card`, `Button`, `Input`, plus the velloo helpers (`Heading`/`Text`, `Image`, `Gradient`, `Layer`, `SVG`, `Divider`, `Placeholder`, `Icon`). The primitives stop there: for a `Badge`/`Tabs`/`Dialog`, use the app's own component when `list_components` shows one on a Repo shelf, else build it from primitives or a snippet. Call `list_components` for the exact set. Styling is **Tailwind classes**.",""],NONE_INLINE_INTRO=["**This folder has no component library and no CSS framework** \u2014 bare primitives wrapping plain HTML (`Box`/`Stack`/`Container`, `Card`, `Button`, `Input`) plus the velloo helpers (`Heading`/`Text`, `Image`, `Icon`, `SVG`, `Divider`, `Gradient`, `Layer`, `Placeholder`). The primitives stop there: for a `Badge`/`Tabs`/`Dialog`, use the app's own component when `list_components` shows one on a Repo shelf, else build it from primitives or a snippet. Call `list_components` for the exact set.","",'**Style through inline `style` objects.** `update_props { style: { display: "flex", gap: "16px", padding: "24px", borderRadius: "8px", color: "var(--color-foreground)" } }` \u2014 a plain React style object (merges shallowly; an inner `null` drops a key, `style: null` clears). Reference theme tokens as CSS variables (`var(--color-primary)`, `var(--radius)`) from `get_theme` so the design stays themable. `emit_code` emits `style={{\u2026}}` on plain elements \u2014 no imports, no Tailwind. Tailwind utility diagnostics do not apply.',""];var React=__toESM(require_react_development(),1),jsx_dev_runtime=__toESM(require_react_jsx_dev_runtime_development(),1),Box=React.forwardRef(({className,...rest},ref)=>jsx_dev_runtime.jsxDEV("div",{ref,className:clsx(className),...rest},void 0,!1,void 0,this));Box.displayName="Box";var alignClass={start:"items-start",center:"items-center",end:"items-end",stretch:"items-stretch"},justifyClass={start:"justify-start",center:"justify-center",end:"justify-end",between:"justify-between",around:"justify-around"},Stack=React.forwardRef(({direction="col",gap=4,align,justify,className,...rest},ref)=>jsx_dev_runtime.jsxDEV("div",{ref,className:clsx("flex",direction==="row"?"flex-row":"flex-col",`gap-${gap}`,align?alignClass[align]:void 0,justify?justifyClass[justify]:void 0,className),...rest},void 0,!1,void 0,this));Stack.displayName="Stack";var containerWidth={sm:"max-w-screen-sm",md:"max-w-screen-md",lg:"max-w-screen-lg",xl:"max-w-screen-xl",full:"max-w-full"},Container=React.forwardRef(({size="md",className,...rest},ref)=>jsx_dev_runtime.jsxDEV("div",{ref,className:clsx("mx-auto w-full px-4",containerWidth[size],className),...rest},void 0,!1,void 0,this));Container.displayName="Container";var buttonVariant={default:"bg-foreground text-background hover:bg-foreground/90",ghost:"bg-transparent text-foreground hover:bg-muted",outline:"bg-transparent text-foreground border border-border hover:bg-muted"},Button=React.forwardRef(({variant="default",className,type,...rest},ref)=>jsx_dev_runtime.jsxDEV("button",{ref,type:type??"button",className:clsx("inline-flex items-center justify-center gap-2 rounded-md px-4 py-2 text-sm font-medium","focus-visible:outline-2 focus-visible:outline-offset-2",buttonVariant[variant],className),...rest},void 0,!1,void 0,this));Button.displayName="Button";var Input=React.forwardRef(({className,type="text",value,onChange,...rest},ref)=>jsx_dev_runtime.jsxDEV("input",{ref,type,value,onChange,readOnly:value!==void 0&&onChange===void 0||rest.readOnly,className:clsx("block w-full rounded-md border border-input bg-background px-3 py-2 text-sm","placeholder:text-muted-foreground focus-visible:outline-2 focus-visible:outline-offset-2",className),...rest},void 0,!1,void 0,this));Input.displayName="Input";var Card=React.forwardRef(({className,...rest},ref)=>jsx_dev_runtime.jsxDEV("div",{ref,className:clsx("rounded-lg border border-border bg-card p-6 text-card-foreground shadow-sm",className),...rest},void 0,!1,void 0,this));Card.displayName="Card";var REUSED_HELPER_IDS=["Heading","Text","Prose","Icon","SVG","Image","Layer","Divider","Gradient","Placeholder"],registry={Box,Stack,Container,Card,Button,Input,...helpersRegistry(REUSED_HELPER_IDS)};var PRIMITIVE_DESCRIPTORS=[{id:"Box",category:"ui",source:"velloo",props:[{name:"className",type:"string | undefined",optional:!0,control:"string"}]},{id:"Stack",category:"ui",source:"velloo",props:[{name:"direction",type:'"row" | "col" | undefined',optional:!0,control:"enum",enumValues:["row","col"],defaultValue:"col"},{name:"gap",type:"number | undefined",optional:!0,control:"number",defaultValue:"4"},{name:"align",type:'"start" | "center" | "end" | "stretch" | undefined',optional:!0,control:"enum",enumValues:["start","center","end","stretch"]},{name:"justify",type:'"start" | "center" | "end" | "between" | "around" | undefined',optional:!0,control:"enum",enumValues:["start","center","end","between","around"]},{name:"className",type:"string | undefined",optional:!0,control:"string"}]},{id:"Container",category:"ui",source:"velloo",props:[{name:"size",type:'"sm" | "md" | "lg" | "xl" | "full" | undefined',optional:!0,control:"enum",enumValues:["sm","md","lg","xl","full"],defaultValue:"md"},{name:"className",type:"string | undefined",optional:!0,control:"string"}]},{id:"Card",category:"ui",source:"velloo",props:[{name:"className",type:"string | undefined",optional:!0,control:"string"}]},{id:"Button",category:"ui",source:"velloo",props:[{name:"variant",type:'"default" | "ghost" | "outline" | undefined',optional:!0,control:"enum",enumValues:["default","ghost","outline"],defaultValue:"default"},{name:"className",type:"string | undefined",optional:!0,control:"string"}]},{id:"Input",category:"ui",source:"velloo",props:[{name:"placeholder",type:"string | undefined",optional:!0,control:"string"},{name:"value",type:"string | undefined",optional:!0,control:"string"},{name:"type",type:"string | undefined",optional:!0,control:"string",defaultValue:"text"},{name:"className",type:"string | undefined",optional:!0,control:"string"}]}],NONE_MANIFEST=[...PRIMITIVE_DESCRIPTORS,...helperDescriptors(REUSED_HELPER_IDS)];var React2=__toESM(require_react_development(),1),jsx_dev_runtime2=__toESM(require_react_jsx_dev_runtime_development(),1);function merge(defaults,authored){return authored?{...defaults,...authored}:defaults}var space=(n)=>`${n*0.25}rem`,Box2=React2.forwardRef(({style,...rest},ref)=>jsx_dev_runtime2.jsxDEV("div",{ref,style,...rest},void 0,!1,void 0,this));Box2.displayName="Box";var alignStyle={start:"flex-start",center:"center",end:"flex-end",stretch:"stretch"},justifyStyle={start:"flex-start",center:"center",end:"flex-end",between:"space-between",around:"space-around"},Stack2=React2.forwardRef(({direction="col",gap=4,align,justify,style,...rest},ref)=>jsx_dev_runtime2.jsxDEV("div",{ref,style:merge({display:"flex",flexDirection:direction==="row"?"row":"column",gap:space(gap),...align?{alignItems:alignStyle[align]}:{},...justify?{justifyContent:justifyStyle[justify]}:{}},style),...rest},void 0,!1,void 0,this));Stack2.displayName="Stack";var containerMaxWidth={sm:"640px",md:"768px",lg:"1024px",xl:"1280px",full:"100%"},Container2=React2.forwardRef(({size="md",style,...rest},ref)=>jsx_dev_runtime2.jsxDEV("div",{ref,style:merge({marginInline:"auto",width:"100%",paddingInline:"1rem",maxWidth:containerMaxWidth[size]},style),...rest},void 0,!1,void 0,this));Container2.displayName="Container";var buttonVariantStyle={default:{background:"var(--color-foreground)",color:"var(--color-background)"},ghost:{background:"transparent",color:"var(--color-foreground)"},outline:{background:"transparent",color:"var(--color-foreground)",border:"1px solid var(--color-border)"}},Button2=React2.forwardRef(({variant="default",type,style,...rest},ref)=>jsx_dev_runtime2.jsxDEV("button",{ref,type:type??"button",style:merge({display:"inline-flex",alignItems:"center",justifyContent:"center",gap:"0.5rem",borderRadius:"var(--radius)",padding:"0.5rem 1rem",fontSize:"0.875rem",fontWeight:500,cursor:"pointer",...buttonVariantStyle[variant]},style),...rest},void 0,!1,void 0,this));Button2.displayName="Button";var Input2=React2.forwardRef(({type="text",value,onChange,style,...rest},ref)=>jsx_dev_runtime2.jsxDEV("input",{ref,type,value,onChange,readOnly:value!==void 0&&onChange===void 0||rest.readOnly,style:merge({display:"block",width:"100%",borderRadius:"var(--radius)",border:"1px solid var(--color-input)",background:"var(--color-background)",padding:"0.5rem 0.75rem",fontSize:"0.875rem"},style),...rest},void 0,!1,void 0,this));Input2.displayName="Input";var Card2=React2.forwardRef(({style,...rest},ref)=>jsx_dev_runtime2.jsxDEV("div",{ref,style:merge({borderRadius:"var(--radius)",border:"1px solid var(--color-border)",background:"var(--color-card)",color:"var(--color-card-foreground)",padding:"1.5rem",boxShadow:"0 1px 2px 0 rgb(0 0 0 / 0.05)"},style),...rest},void 0,!1,void 0,this));Card2.displayName="Card";var Heading=React2.forwardRef(({level=1,style,...rest},ref)=>{let Tag=`h${level}`;return jsx_dev_runtime2.jsxDEV(Tag,{ref,style:merge(headingInlineStyle(level),style),...rest},void 0,!1,void 0,this)});Heading.displayName="Heading";var Text=React2.forwardRef(({variant="default",style,...rest},ref)=>jsx_dev_runtime2.jsxDEV("p",{ref,style:merge(textInlineStyle(variant),style),...rest},void 0,!1,void 0,this));Text.displayName="Text";var REUSED_HELPER_IDS2=["Prose","Icon","SVG","Image","Layer","Divider","Gradient","Placeholder"],inlineRegistry={Box:Box2,Stack:Stack2,Container:Container2,Card:Card2,Button:Button2,Input:Input2,Heading,Text,...helpersRegistry(REUSED_HELPER_IDS2)};var PRIMITIVES=new Set(["Box","Stack","Container","Card","Button","Input"]),INLINE_TYPOGRAPHY=new Set(["Heading","Text"]),here=dirname(fileURLToPath(import.meta.url)),srcDir=resolveProviderSrcDir(here,"provider-none",process.env.VELLOO_NOLIB_SRC),entryCssPath=join(srcDir,"tailwind-entry.css"),componentsDir=srcDir;async function loadManifest(){return NONE_MANIFEST}function createProvider(){return{id:"none",version:noLibVersion,componentsDir,styleEntryPath:entryCssPath,registry,loadManifest,label:`none ${noLibVersion}`,styleChannel:TAILWIND_CLASSNAME,styleChannels:["tailwind-classname","style"],mcpIntro:(channel)=>[...channel==="style"?NONE_INLINE_INTRO:NONE_INTRO],registryForChannel:(kind)=>kind==="style"?inlineRegistry:registry,canvasBundleSpec:{styleRuntime:{kind:"none"},onlyWithRepository:!0,components:(ids,context)=>{let inline=context?.channel==="style";return ids.flatMap((id)=>{let own=PRIMITIVES.has(id)||inline&&INLINE_TYPOGRAPHY.has(id)?join(srcDir,inline?"components-inline.tsx":"components.tsx"):helperSourcePath(id);return own?[{id,sources:[{importPath:own,exportName:id,fidelity:"exact",note:"Velloo primitive, mounted beside the app's components."}]}]:[]})}}}}export{createProvider};
package/chunk-yghypth2.js DELETED
@@ -1,2 +0,0 @@
1
- // @bun
2
- import{init_default,runInit2}from"./chunk-nwf2kn41.js";import"./chunk-b7famda5.js";import"./chunk-vjrn10xr.js";import"./chunk-rfrbnw8r.js";import"./chunk-dj1pp4e3.js";import"./chunk-ykdx12na.js";import"./chunk-db7mf114.js";import"./chunk-ph94nrc8.js";import"./chunk-2dm4x17z.js";import"./chunk-shac6bat.js";import"./chunk-80fjfyha.js";import"./chunk-qan5dnjt.js";import"./chunk-a9mgvspm.js";import"./chunk-6zr596r2.js";import"./chunk-m1wp8cpt.js";import"./chunk-npsg7btt.js";import"./chunk-r03aywsb.js";import"./chunk-zqtz23xk.js";import"./chunk-s23gtejf.js";import"./chunk-7a45tn73.js";import"./chunk-cvn689d5.js";export{init_default as default,runInit2 as runInit};
package/chunk-zqtz23xk.js DELETED
@@ -1,3 +0,0 @@
1
- // @bun
2
- var package_default={name:"@velloo/cli",version:"0.4.1",license:"Apache-2.0",private:!0,type:"module",description:"Velloo CLI",bin:{velloo:"./src/cli.ts"},exports:{".":"./src/cli.ts"},engines:{bun:">=1.4.0"},scripts:{build:"bun run build.ts"},dependencies:{"@clack/prompts":"1.7.0","@velloo/canvas":"workspace:*","@velloo/codegen":"workspace:*","@velloo/protocol":"workspace:*","@velloo/provider":"workspace:*","@velloo/provider-antd":"workspace:*","@velloo/provider-chakra":"workspace:*","@velloo/provider-mui":"workspace:*","@velloo/provider-none":"workspace:*","@velloo/renderer":"workspace:*","@velloo/result":"workspace:*","@velloo/schema":"workspace:*","@velloo/server":"workspace:*","@velloo/shadcn-snapshot":"workspace:*",citty:"0.2.2",picocolors:"1.1.1",zod:"4.5.4"}};var PACKAGE_VERSION=package_default.version,TOOL_VERSION="0.4.1",BUILD_TIME_MS=1790460357469;
3
- export{PACKAGE_VERSION,TOOL_VERSION,BUILD_TIME_MS};