@object-ui/cli 17.6.0 → 17.7.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.
- package/CHANGELOG.md +2107 -0
- package/README.md +9 -24
- package/dist/{chunk-AP2INOE7.js → chunk-VMMIGYU3.js} +79 -80
- package/dist/chunk-VMMIGYU3.js.map +1 -0
- package/dist/cli.js +497 -506
- package/dist/cli.js.map +1 -1
- package/dist/index.js +1 -1
- package/package.json +7 -6
- package/dist/chunk-AP2INOE7.js.map +0 -1
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli.ts","../src/commands/dev.ts","../src/commands/build.ts","../src/commands/start.ts","../src/commands/lint.ts","../src/commands/test.ts","../src/commands/generate.ts","../src/commands/doctor.ts","../src/commands/add.ts","../src/commands/studio.ts","../src/commands/check.ts","../src/utils/known-schema-types.ts","../src/commands/validate.ts","../src/utils/spec-vocabulary-hint.ts","../src/commands/create-plugin.ts","../src/commands/analyze.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport { serve } from './commands/serve.js';\nimport { init } from './commands/init.js';\nimport { dev } from './commands/dev.js';\nimport { buildApp } from './commands/build.js';\nimport { start } from './commands/start.js';\nimport { lint } from './commands/lint.js';\nimport { test } from './commands/test.js';\nimport { generate } from './commands/generate.js';\nimport { doctor } from './commands/doctor.js';\nimport { add } from './commands/add.js';\nimport { studio } from './commands/studio.js';\nimport { check } from './commands/check.js';\nimport { validate } from './commands/validate.js';\nimport { createPlugin } from './commands/create-plugin.js';\nimport { analyze } from './commands/analyze.js';\nimport { readFileSync } from 'fs';\nimport { fileURLToPath } from 'url';\nimport { dirname, join } from 'path';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Read package.json for version\nconst packageJson = JSON.parse(\n readFileSync(join(__dirname, '../package.json'), 'utf-8')\n);\n\nconst program = new Command();\n\nprogram\n .name('objectui')\n .description('CLI tool for Object UI - Build applications from JSON schemas')\n .version(packageJson.version);\n\nprogram\n .command('serve')\n .description('Start a development server with your JSON/YAML schema')\n .argument('[schema]', 'Path to JSON/YAML schema file, or a project / pages directory', 'app.json')\n .option('-p, --port <port>', 'Port to run the server on', '3000')\n .option('-h, --host <host>', 'Host to bind the server to', 'localhost')\n .option('--no-open', 'Do not open browser automatically')\n .action(async (schema, options) => {\n try {\n await serve(schema, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('dev')\n .description('Start development server (alias for serve)')\n .argument('[schema]', 'Path to JSON/YAML schema file, or a project / pages directory', 'app.json')\n .option('-p, --port <port>', 'Port to run the server on', '3000')\n .option('-h, --host <host>', 'Host to bind the server to', 'localhost')\n .option('--no-open', 'Do not open browser automatically')\n .action(async (schema, options) => {\n try {\n await dev(schema, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('build')\n .description('Build application for production')\n .argument('[schema]', 'Path to JSON/YAML schema file, or a project / pages directory', 'app.json')\n .option('-o, --out-dir <dir>', 'Output directory', 'dist')\n .option('--clean', 'Clean output directory before build', false)\n .action(async (schema, options) => {\n try {\n await buildApp(schema, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('start')\n .description('Start production server')\n .option('-p, --port <port>', 'Port to run the server on', '3000')\n .option('-h, --host <host>', 'Host to bind the server to', '0.0.0.0')\n .option('-d, --dir <dir>', 'Directory to serve', 'dist')\n .action(async (options) => {\n try {\n await start(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('init')\n .description('Initialize a new Object UI application with sample schema')\n .argument('[name]', 'Application name', 'my-app')\n .option('-t, --template <template>', 'Template to use (dashboard, form, simple)', 'dashboard')\n .action(async (name, options) => {\n try {\n await init(name, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('lint')\n .description('Lint the generated application code')\n .option('--fix', 'Automatically fix linting issues')\n .action(async (options) => {\n try {\n await lint(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('test')\n .description('Run tests for the application')\n .option('-w, --watch', 'Run tests in watch mode')\n .option('-c, --coverage', 'Generate test coverage report')\n .option('--ui', 'Run tests with Vitest UI')\n .action(async (options) => {\n try {\n await test(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('generate')\n .alias('g')\n .description('Generate new resources (objects, pages, plugins)')\n .argument('<type>', 'Type of resource to generate (resource/object, page, plugin)')\n .argument('<name>', 'Name of the resource')\n .option('--from <source>', 'Generate schema from external source (openapi.yaml, prisma.schema)')\n .option('--output <dir>', 'Output directory for generated schemas', 'schemas/')\n .action(async (type, name, options) => {\n try {\n // Handle schema generation from external sources\n if (options.from) {\n console.log(chalk.yellow('\\n⚠ Schema generation from external sources (OpenAPI/Prisma) is not yet implemented.'));\n console.log(chalk.gray('This feature will be available in a future release.\\n'));\n process.exit(0);\n }\n \n await generate(type, name);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('doctor')\n .description('Diagnose and fix common issues')\n .action(async () => {\n try {\n await doctor();\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('add')\n .description('Add a new component renderer to your project')\n .argument('<component>', 'Component name (e.g. Input, Grid)')\n .action(async (component) => {\n try {\n await add(component);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('studio')\n .description('Start the visual designer')\n .action(async () => {\n try {\n await studio();\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('check')\n .description('Validate schema files')\n .action(async () => {\n try {\n await check();\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('validate')\n .description('Validate a schema file against ObjectUI specifications')\n .argument('[schema]', 'Path to schema file (JSON or YAML)', 'app.json')\n .action(async (schema) => {\n try {\n await validate(schema);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('create')\n .description('Create new resources')\n .argument('<type>', 'Type of resource to create (plugin)')\n .argument('<name>', 'Name of the resource')\n .action(async (type, name) => {\n try {\n if (type === 'plugin') {\n await createPlugin(name);\n } else {\n console.error(chalk.red(`Unknown resource type: ${type}`));\n console.log(chalk.gray('Available types: plugin'));\n process.exit(1);\n }\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('analyze')\n .description('Analyze application performance')\n .option('--bundle-size', 'Analyze bundle size')\n .option('--render-performance', 'Analyze render performance')\n .action(async (options) => {\n try {\n await analyze(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\n\nprogram.parse();\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { createServer } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport { mkdirSync } from 'fs';\nimport { join } from 'path';\nimport chalk from 'chalk';\nimport { execSync } from 'child_process';\nimport { createTempAppWithRouting, createTempApp } from '../utils/app-generator.js';\nimport { reportProjectSource, resolveProjectSource } from '../utils/project-source.js';\nimport { isWorkspaceRoot, prepareWorkspaceTempApp } from '../utils/workspace-vite.js';\n\ninterface DevOptions {\n port: string;\n host: string;\n open?: boolean;\n}\n\nexport async function dev(schemaPath: string, options: DevOptions) {\n const cwd = process.cwd();\n\n // What this invocation names — the project root, the routes, the app config —\n // resolved by the helper all three commands share, so `dev`, `serve` and\n // `build` cannot answer the same invocation differently (objectui#4923).\n const source = resolveProjectSource(cwd, schemaPath);\n reportProjectSource(source, cwd);\n\n // Create temporary app directory (always in cwd to keep node_modules access)\n const tmpDir = join(cwd, '.objectui-tmp');\n mkdirSync(tmpDir, { recursive: true });\n\n // Create temporary app files\n if (source.mode === 'routes') {\n createTempAppWithRouting(tmpDir, source.routes, source.appConfig);\n } else {\n createTempApp(tmpDir, source.schema);\n }\n\n\n // Install dependencies\n const isMonorepo = isWorkspaceRoot(cwd);\n\n if (isMonorepo) {\n console.log(chalk.blue('📦 Detected monorepo - using root node_modules'));\n } else {\n console.log(chalk.blue('📦 Installing dependencies...'));\n console.log(chalk.dim(' This may take a moment on first run...'));\n try {\n execSync('npm install --silent --prefer-offline', { \n cwd: tmpDir, \n stdio: 'inherit',\n });\n console.log(chalk.green('✓ Dependencies installed'));\n } catch {\n throw new Error('Failed to install dependencies. Please check your internet connection and try again.');\n }\n }\n\n console.log(chalk.green('✓ Schema loaded successfully'));\n console.log(chalk.blue('🚀 Starting development server...\\n'));\n\n // Everything the temp app needs to resolve platform packages from workspace\n // source — the alias table, and the PostCSS pipeline that replaces the\n // generated config file. Shared with `serve` and `build` so the three cannot\n // drift apart (objectui#3890); see `utils/workspace-vite.ts`.\n if (isMonorepo) {\n console.log(chalk.blue('📦 Detected monorepo - configuring workspace aliases'));\n }\n const workspaceConfig = isMonorepo ? await prepareWorkspaceTempApp(cwd, tmpDir) : {};\n\n // Create Vite config\n const viteConfig: any = {\n root: tmpDir,\n server: {\n port: parseInt(options.port),\n host: options.host,\n open: options.open !== false,\n fs: {\n // Allow serving files from workspace root\n allow: [cwd],\n }\n },\n plugins: [react()],\n ...workspaceConfig,\n };\n\n // Create Vite server\n const server = await createServer(viteConfig);\n\n await server.listen();\n\n const { port, host } = server.config.server;\n const protocol = server.config.server.https ? 'https' : 'http';\n const displayHost = host === '0.0.0.0' ? 'localhost' : host;\n\n console.log();\n console.log(chalk.green('✓ Development server started successfully!'));\n console.log();\n console.log(chalk.bold(' Local: ') + chalk.cyan(`${protocol}://${displayHost}:${port}`));\n console.log();\n console.log(chalk.dim(' Press Ctrl+C to stop the server'));\n console.log();\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { build as viteBuild } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport { existsSync, mkdirSync, cpSync, rmSync } from 'fs';\nimport { join, resolve } from 'path';\nimport chalk from 'chalk';\nimport { execSync } from 'child_process';\nimport { createTempAppWithRouting, createTempApp } from '../utils/app-generator.js';\nimport { reportProjectSource, resolveProjectSource } from '../utils/project-source.js';\nimport { isWorkspaceRoot, prepareWorkspaceTempApp } from '../utils/workspace-vite.js';\n\ninterface BuildOptions {\n outDir?: string;\n clean?: boolean;\n}\n\nexport async function buildApp(schemaPath: string, options: BuildOptions) {\n const cwd = process.cwd();\n const outDir = options.outDir || 'dist';\n const outputPath = resolve(cwd, outDir);\n \n console.log(chalk.blue('🔨 Building application for production...'));\n console.log();\n \n // What this invocation names — the project root, the routes, the app config —\n // resolved by the helper all three commands share. This command used to look\n // for a pages/ directory under cwd and nowhere else, so from any directory\n // above the project it emitted a bundle with the app config rendered as the\n // page schema, exit 0 (objectui#4923).\n const source = resolveProjectSource(cwd, schemaPath);\n reportProjectSource(source, cwd);\n\n // Create temporary app directory\n const tmpDir = join(cwd, '.objectui-tmp');\n mkdirSync(tmpDir, { recursive: true });\n\n // Create temporary app files\n if (source.mode === 'routes') {\n createTempAppWithRouting(tmpDir, source.routes, source.appConfig);\n } else {\n createTempApp(tmpDir, source.schema);\n }\n\n // Install dependencies\n const isMonorepo = isWorkspaceRoot(cwd);\n\n if (isMonorepo) {\n console.log(chalk.blue('📦 Detected monorepo - using root node_modules'));\n } else {\n console.log(chalk.blue('📦 Installing dependencies...'));\n try {\n execSync('npm install --silent --prefer-offline', {\n cwd: tmpDir,\n stdio: 'pipe',\n });\n console.log(chalk.green('✓ Dependencies installed'));\n } catch {\n throw new Error('Failed to install dependencies. Please check your internet connection and try again.');\n }\n }\n\n // Everything the temp app needs to resolve platform packages from workspace\n // source — the alias table, and the PostCSS pipeline that replaces the\n // generated config file. Shared with `dev` and `serve` so the three cannot\n // drift apart (objectui#3890); see `utils/workspace-vite.ts`.\n if (isMonorepo) {\n console.log(chalk.blue('📦 Detected monorepo - configuring workspace aliases'));\n }\n const workspaceConfig = isMonorepo ? await prepareWorkspaceTempApp(cwd, tmpDir) : {};\n\n console.log(chalk.blue('⚙️ Building with Vite...'));\n console.log();\n\n // Clean output directory if requested\n if (options.clean && existsSync(outputPath)) {\n console.log(chalk.dim(` Cleaning ${outDir}/ directory...`));\n rmSync(outputPath, { recursive: true, force: true });\n }\n\n // Build with Vite\n try {\n await viteBuild({\n root: tmpDir,\n build: {\n outDir: join(tmpDir, 'dist'),\n emptyOutDir: true,\n reportCompressedSize: true,\n },\n plugins: [react()],\n logLevel: 'info',\n ...workspaceConfig,\n });\n\n // Copy built files to output directory\n mkdirSync(outputPath, { recursive: true });\n cpSync(join(tmpDir, 'dist'), outputPath, { recursive: true });\n\n console.log();\n console.log(chalk.green('✓ Build completed successfully!'));\n console.log();\n console.log(chalk.bold(' Output: ') + chalk.cyan(outDir + '/'));\n console.log();\n console.log(chalk.dim(' To serve the production build, run:'));\n console.log(chalk.cyan(` objectui start --dir ${outDir}`));\n console.log();\n } catch (error) {\n // The caught error's message is inlined below. We can't pass it as the\n // `Error` `cause` option because this package targets ES2020, whose lib\n // types the 1-arg `Error` constructor only; hence the scoped disable.\n // eslint-disable-next-line preserve-caught-error\n throw new Error(`Build failed: ${error instanceof Error ? error.message : error}`);\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport express from 'express';\nimport rateLimit from 'express-rate-limit';\nimport { existsSync } from 'fs';\nimport { join, resolve } from 'path';\nimport chalk from 'chalk';\n\ninterface StartOptions {\n port: string;\n host: string;\n dir?: string;\n}\n\nexport async function start(options: StartOptions) {\n const cwd = process.cwd();\n const distDir = options.dir || 'dist';\n const distPath = resolve(cwd, distDir);\n\n // Check if dist directory exists\n if (!existsSync(distPath)) {\n throw new Error(\n `Build directory not found: ${distDir}\\n` +\n `Run 'objectui build' first to create a production build.`\n );\n }\n\n // Check if index.html exists\n const indexPath = join(distPath, 'index.html');\n if (!existsSync(indexPath)) {\n throw new Error(\n `index.html not found in ${distDir}/\\n` +\n `Make sure you have a valid production build.`\n );\n }\n\n console.log(chalk.blue('🚀 Starting production server...\\n'));\n\n const app = express();\n const port = parseInt(options.port);\n const host = options.host;\n\n // Configure rate limiting to prevent abuse\n const limiter = rateLimit({\n windowMs: 15 * 60 * 1000, // 15 minutes\n max: 1000, // Limit each IP to 1000 requests per windowMs\n message: 'Too many requests from this IP, please try again later.',\n standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers\n legacyHeaders: false, // Disable the `X-RateLimit-*` headers\n });\n\n // Apply rate limiting to all routes\n app.use(limiter);\n\n // Serve static files from dist directory\n app.use(express.static(distPath));\n\n // SPA fallback - serve index.html for all routes\n app.get('*', (_req, res) => {\n res.sendFile(indexPath);\n });\n\n // Start server\n app.listen(port, host, () => {\n const protocol = 'http';\n const displayHost = host === '0.0.0.0' ? 'localhost' : host;\n\n console.log(chalk.green('✓ Production server started successfully!'));\n console.log();\n console.log(chalk.bold(' Local: ') + chalk.cyan(`${protocol}://${displayHost}:${port}`));\n console.log(chalk.bold(' Serving: ') + chalk.dim(distDir + '/'));\n console.log();\n console.log(chalk.dim(' Press Ctrl+C to stop the server'));\n console.log();\n });\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { execSync } from 'child_process';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\nimport chalk from 'chalk';\n\ninterface LintOptions {\n fix?: boolean;\n}\n\nexport async function lint(options: LintOptions) {\n const cwd = process.cwd();\n \n console.log(chalk.blue('🔍 Running linter...\\n'));\n\n // Check if the generated temp app exists\n const tmpDir = join(cwd, '.objectui-tmp');\n const hasTempApp = existsSync(tmpDir);\n\n if (!hasTempApp) {\n throw new Error(\n 'No Object UI application found. Run \\'objectui dev\\' first to generate the application.'\n );\n }\n\n // Check if package.json and node_modules exist\n const packageJsonPath = join(tmpDir, 'package.json');\n const nodeModulesPath = join(tmpDir, 'node_modules');\n \n if (!existsSync(packageJsonPath) || !existsSync(nodeModulesPath)) {\n throw new Error(\n 'Dependencies not installed. Run \\'objectui dev\\' first to set up the application.'\n );\n }\n\n try {\n const fixFlag = options.fix ? '--fix' : '';\n const command = `npx eslint \"src/**/*.{js,jsx,ts,tsx}\" ${fixFlag}`.trim();\n \n console.log(chalk.dim(` Running: ${command}\\n`));\n \n execSync(command, {\n cwd: tmpDir,\n stdio: 'inherit',\n });\n\n console.log();\n console.log(chalk.green('✓ Linting completed successfully!'));\n console.log();\n } catch {\n // ESLint returns non-zero exit code when there are linting errors\n console.log();\n console.log(chalk.yellow('⚠ Linting found issues.'));\n if (!options.fix) {\n console.log(chalk.dim(' Run \\'objectui lint --fix\\' to automatically fix some issues.'));\n }\n console.log();\n process.exit(1);\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { execSync } from 'child_process';\nimport { existsSync } from 'fs';\nimport { join } from 'path';\nimport chalk from 'chalk';\n\ninterface TestOptions {\n watch?: boolean;\n coverage?: boolean;\n ui?: boolean;\n}\n\nexport async function test(options: TestOptions) {\n const cwd = process.cwd();\n \n console.log(chalk.blue('🧪 Running tests...\\n'));\n\n // Check if the generated temp app exists\n const tmpDir = join(cwd, '.objectui-tmp');\n const hasTempApp = existsSync(tmpDir);\n\n if (!hasTempApp) {\n throw new Error(\n 'No Object UI application found. Run \\'objectui dev\\' first to generate the application.'\n );\n }\n\n // Check if package.json and node_modules exist\n const packageJsonPath = join(tmpDir, 'package.json');\n const nodeModulesPath = join(tmpDir, 'node_modules');\n \n if (!existsSync(packageJsonPath) || !existsSync(nodeModulesPath)) {\n throw new Error(\n 'Dependencies not installed. Run \\'objectui dev\\' first to set up the application.'\n );\n }\n\n try {\n let command = 'npx vitest';\n \n if (options.watch) {\n command += ' --watch';\n } else if (options.ui) {\n command += ' --ui';\n } else {\n command += ' run';\n }\n\n if (options.coverage) {\n command += ' --coverage';\n }\n\n console.log(chalk.dim(` Running: ${command}\\n`));\n \n execSync(command, {\n cwd: tmpDir,\n stdio: 'inherit',\n });\n\n if (!options.watch && !options.ui) {\n console.log();\n console.log(chalk.green('✓ Tests completed successfully!'));\n console.log();\n }\n } catch {\n // Vitest returns non-zero exit code when tests fail\n console.log();\n console.log(chalk.red('✗ Some tests failed.'));\n console.log();\n process.exit(1);\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { existsSync, mkdirSync, writeFileSync } from 'fs';\nimport { join } from 'path';\n\nexport async function generate(type: string, name: string) {\n const cwd = process.cwd();\n\n switch (type) {\n case 'resource':\n case 'object':\n generateResource(cwd, name);\n break;\n case 'page':\n generatePage(cwd, name);\n break;\n case 'plugin':\n generatePlugin(cwd, name);\n break;\n default:\n console.log(chalk.red(`Unknown type: ${type}`));\n console.log(`Available types: resource, page, plugin`);\n process.exit(1);\n }\n}\n\nfunction generateResource(cwd: string, name: string) {\n const dir = join(cwd, 'objects');\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n\n const fileName = `${name.toLowerCase()}.json`;\n const filePath = join(dir, fileName);\n\n if (existsSync(filePath)) {\n console.log(chalk.yellow(`Object ${name} already exists at ${filePath}`));\n return;\n }\n\n const content = {\n name: name,\n fields: {\n name: { type: 'text', label: 'Name', required: true }\n }\n };\n\n writeFileSync(filePath, JSON.stringify(content, null, 2));\n console.log(chalk.green(`✓ Generated resource schema: ${filePath}`));\n}\n\nfunction generatePage(cwd: string, name: string) {\n const dir = join(cwd, 'pages');\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n\n const fileName = `${name.toLowerCase()}.json`;\n const filePath = join(dir, fileName);\n\n if (existsSync(filePath)) {\n console.log(chalk.yellow(`Page ${name} already exists at ${filePath}`));\n return;\n }\n\n const content = {\n type: \"page\",\n title: name,\n body: [\n {\n type: \"markdown\",\n content: `# Welcome to ${name}`\n }\n ]\n };\n\n writeFileSync(filePath, JSON.stringify(content, null, 2));\n console.log(chalk.green(`✓ Generated page schema: ${filePath}`));\n}\n\nfunction generatePlugin(cwd: string, name: string) {\n const dir = join(cwd, 'plugins', name);\n if (existsSync(dir)) {\n console.log(chalk.yellow(`Plugin ${name} already exists`));\n return;\n }\n mkdirSync(dir, { recursive: true });\n\n const content = `\nexport const ${name}Plugin = {\n name: '${name}',\n install(app) {\n console.log('${name} plugin installed');\n }\n};\n`;\n\n writeFileSync(join(dir, 'index.ts'), content.trim());\n console.log(chalk.green(`✓ Generated plugin: ${dir}`));\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * `objectui doctor` — project health diagnosis.\n *\n * ## Tailwind: v4-only, because this repo is v4-only (objectui#3891)\n *\n * The Tailwind section used to be written against Tailwind 3 and got every\n * question backwards on a v4 project:\n *\n * - It counted a **missing `tailwind.config.js` as an issue**. In v4 that file\n * is not part of the setup at all — the engine reads CSS-first configuration\n * (`@import 'tailwindcss'`, `@theme`, `@source`) and only looks at a JS\n * config when a stylesheet explicitly opts in with `@config`. So the advice\n * pushed readers toward creating a file Tailwind would never read. Running\n * `objectui doctor` at this repo's own root reproduced it: there is no root\n * `tailwind.config.*`, and doctor reported a problem that did not exist.\n * - It then graded that file on its **`content` array**, the v3 key that\n * `@source` replaced. The two `tailwind.config.*` files still tracked in this\n * repo (`apps/console`, `examples/byo-backend-console`) are exactly this\n * trap: both declare `content: ['./src/**\\/*.{ts,tsx}', …]`, no stylesheet\n * anywhere in the repo contains `@config`, so both files are inert — and the\n * old check answered \"✓ Tailwind content paths configured\" for them. A false\n * green on a dead file is worse than silence.\n * - It **never checked `@tailwindcss/postcss`**, which is the one dependency a\n * v4 project genuinely cannot build without. v4 moved the PostCSS plugin out\n * of `tailwindcss` into that separate package; naming the old `tailwindcss`\n * key in a PostCSS config resolves to a shim whose only job is to throw. That\n * is the failure form objectui#3852 measured on the generated app, and doctor\n * happily printed \"✓ Tailwind CSS installed\" through it.\n *\n * So the checks below are the v4 contract, matching what `objectui init`\n * scaffolds (see `utils/app-generator.ts`): `@tailwindcss/postcss` available, a\n * PostCSS config that names it rather than the v3 `tailwindcss` key, and a CSS\n * entry that runs `@import 'tailwindcss'`. A missing `tailwind.config.*` is\n * **not** reported; a *present* one is reported only when nothing opts into it\n * via `@config`, which is the case where it silently does nothing.\n *\n * A v3-tolerant dual path (branching on the declared `tailwindcss` major and\n * running two sets of checks) was considered and deliberately not built — it\n * widens the product surface past this repo's v4-only posture. v3 spellings are\n * therefore diagnosed as *migration debt*, not supported as a second mode.\n *\n * ## Structure\n *\n * `runDiagnostics(cwd)` is the whole diagnosis and returns structured results;\n * `doctor()` only renders them and counts. Splitting the two is what makes the\n * matrix above testable against real fixture directories instead of scraped\n * console output.\n */\n\nimport chalk from 'chalk';\nimport { existsSync, readFileSync } from 'fs';\nimport { dirname, join, resolve as resolvePath } from 'path';\n\n/** `ok` never counts toward the issue total; `warn` and `error` both do. */\nexport type DiagnosticLevel = 'ok' | 'warn' | 'error';\n\nexport interface Diagnostic {\n level: DiagnosticLevel;\n /** The single line rendered for this finding. */\n message: string;\n /**\n * Stable identifier for the finding, so tests (and any future machine\n * readable output) pin the *verdict* rather than prose wording.\n */\n id: string;\n}\n\n/**\n * CSS entrypoint candidates, in the order doctor prefers them. `src/index.css`\n * is first because that is what `objectui init` generates; the rest cover the\n * common Vite / Next.js / plain layouts. Every candidate that exists is read —\n * the Tailwind verdicts below ask \"does *any* entry do this\", so a project with\n * several stylesheets is not judged on whichever one happens to sort first.\n */\nconst CSS_ENTRY_CANDIDATES = [\n 'src/index.css',\n 'src/main.css',\n 'src/styles.css',\n 'src/style.css',\n 'src/app.css',\n 'src/global.css',\n 'src/globals.css',\n 'app/globals.css',\n 'app/global.css',\n 'styles/globals.css',\n 'index.css',\n 'styles.css',\n];\n\nconst TAILWIND_CONFIG_CANDIDATES = [\n 'tailwind.config.js',\n 'tailwind.config.cjs',\n 'tailwind.config.mjs',\n 'tailwind.config.ts',\n];\n\nconst POSTCSS_CONFIG_CANDIDATES = [\n 'postcss.config.js',\n 'postcss.config.cjs',\n 'postcss.config.mjs',\n 'postcss.config.ts',\n];\n\n/** `@import 'tailwindcss'` — the v4 entrypoint, with or without a `layer()`. */\nconst V4_CSS_IMPORT = /@import\\s+[\"']tailwindcss[\"']/;\n/** `@tailwind base;` / `components` / `utilities` — the v3 directives. */\nconst V3_CSS_DIRECTIVE = /@tailwind\\s+(?:base|components|utilities|screens|variants)\\b/;\nconst CSS_SOURCE_DIRECTIVE = /@source\\s+[\"']/;\nconst CSS_CONFIG_DIRECTIVE = /@config\\s+[\"']/;\n\n/**\n * The v4 PostCSS plugin, in either object (`'@tailwindcss/postcss': {}`) or\n * array (`require('@tailwindcss/postcss')`) form.\n */\nconst V4_POSTCSS_PLUGIN = /@tailwindcss\\/postcss/;\n/**\n * The v3 spelling: `tailwindcss` named as a plugin itself, in either the\n * quoted (`'tailwindcss': {}`, `require('tailwindcss')`) or the bare-key\n * (`tailwindcss: {}`) form.\n *\n * Neither alternative can match inside `'@tailwindcss/postcss'`: the quoted one\n * needs a quote immediately before `tailwindcss` and finds `@`, and the bare\n * one needs a key boundary before it and a `:` after it, where the scoped name\n * has `@` and `/`. That non-match is pinned by a test — it is the difference\n * between diagnosing a v3 config and having every healthy v4 project\n * self-report.\n */\nconst V3_POSTCSS_PLUGIN = /[\"']tailwindcss[\"']|(?:^|[{,\\s])tailwindcss\\s*:/m;\n\nfunction readIfExists(path: string): string | null {\n try {\n return existsSync(path) ? readFileSync(path, 'utf-8') : null;\n } catch {\n return null;\n }\n}\n\n/** First existing path from `candidates`, relative to `cwd`. */\nfunction findFile(cwd: string, candidates: readonly string[]): string | null {\n for (const rel of candidates) {\n const abs = join(cwd, rel);\n if (existsSync(abs)) return abs;\n }\n return null;\n}\n\n/**\n * Leading major of a dependency range. Returns `null` for anything without a\n * usable number — `workspace:*`, `catalog:`, a git URL, `latest` — because\n * \"cannot tell\" must not be reported as \"wrong version\".\n */\nfunction majorOf(range: string): number | null {\n const match = /(\\d+)/.exec(range);\n if (!match) return null;\n const major = Number.parseInt(match[1], 10);\n return Number.isNaN(major) ? null : major;\n}\n\n/**\n * Is `specifier` installed for this project — i.e. present in a `node_modules`\n * at `cwd` or any ancestor?\n *\n * Declaration in `package.json` is the primary signal, but it is not the only\n * valid setup: inside a workspace the plugin is frequently installed by a\n * parent while the leaf `package.json` stays silent. Checking the tree is what\n * keeps this from replacing objectui#3891's false positive with a new one on\n * every workspace package.\n *\n * Deliberately a manual walk rather than `createRequire(…).resolve()`, even\n * though the latter looks more authoritative. Node's resolver also consults\n * `NODE_PATH` and the global folders, and `NODE_PATH` is not hypothetical\n * here: vitest sets it to pnpm's virtual store (`node_modules/.pnpm/…`), so\n * under test *every* package in the monorepo resolves from *any* directory —\n * including a fresh `os.tmpdir()` fixture with an empty `package.json`. That\n * made the \"plugin is missing\" branch unreachable in tests and would have\n * shipped it unverified. The walk below answers the question a bundler\n * actually asks and depends on nothing but the filesystem.\n */\nfunction isInstalledFrom(cwd: string, specifier: string): boolean {\n let dir = resolvePath(cwd);\n for (;;) {\n if (existsSync(join(dir, 'node_modules', ...specifier.split('/')))) return true;\n const parent = dirname(dir);\n if (parent === dir) return false;\n dir = parent;\n }\n}\n\n/**\n * Run every diagnostic against `cwd` and return the findings in render order.\n * Pure with respect to stdout — see the module docblock.\n */\nexport function runDiagnostics(cwd: string): Diagnostic[] {\n const results: Diagnostic[] = [];\n const ok = (id: string, message: string): void => {\n results.push({ id, level: 'ok', message });\n };\n const warn = (id: string, message: string): void => {\n results.push({ id, level: 'warn', message });\n };\n const error = (id: string, message: string): void => {\n results.push({ id, level: 'error', message });\n };\n\n // ---------------------------------------------------------------- package.json\n const pkgPath = join(cwd, 'package.json');\n const pkgRaw = readIfExists(pkgPath);\n let pkg: Record<string, Record<string, string> | undefined> | null = null;\n\n if (pkgRaw === null) {\n error('package-json-missing', 'package.json not found');\n } else {\n try {\n pkg = JSON.parse(pkgRaw);\n } catch {\n error('package-json-unreadable', 'Failed to parse package.json');\n }\n }\n\n const deps: Record<string, string> = pkg\n ? { ...(pkg.dependencies ?? {}), ...(pkg.devDependencies ?? {}) }\n : {};\n\n if (pkg) {\n if (deps.react) {\n ok('react-installed', 'React installed');\n } else {\n warn('react-missing', 'React not found in dependencies');\n }\n }\n\n // -------------------------------------------------------------------- Tailwind\n //\n // Everything below is gated on the project declaring `tailwindcss` at all. A\n // directory that does not use Tailwind must not collect Tailwind findings —\n // the \"not found\" line above already says the one thing worth saying.\n const tailwindRange = pkg ? deps.tailwindcss : undefined;\n\n if (pkg && !tailwindRange) {\n warn('tailwind-missing', 'Tailwind CSS not found in dependencies');\n }\n\n if (tailwindRange) {\n const major = majorOf(tailwindRange);\n if (major !== null && major < 4) {\n warn(\n 'tailwind-major-legacy',\n `Tailwind CSS ${tailwindRange} detected — ObjectUI targets Tailwind 4. ` +\n 'Upgrade with `npx @tailwindcss/upgrade`, then move configuration into ' +\n \"your CSS entry (`@import 'tailwindcss'`, `@theme`, `@source`).\",\n );\n } else {\n ok('tailwind-installed', `Tailwind CSS ${tailwindRange} installed`);\n }\n\n // 1. The v4 PostCSS plugin — the dependency a v4 build actually fails without.\n if (deps['@tailwindcss/postcss']) {\n ok('tailwind-postcss-declared', '@tailwindcss/postcss declared');\n } else if (isInstalledFrom(cwd, '@tailwindcss/postcss')) {\n ok(\n 'tailwind-postcss-installed',\n '@tailwindcss/postcss installed (provided by the workspace)',\n );\n } else {\n error(\n 'tailwind-postcss-missing',\n 'Tailwind CSS 4 needs @tailwindcss/postcss, which is neither declared ' +\n 'nor installed here. v4 moved the PostCSS plugin out of `tailwindcss` ' +\n 'into its own package; without it PostCSS fails to load and no ' +\n 'styles are emitted. Install it: `npm i -D @tailwindcss/postcss`.',\n );\n }\n\n // 2. The PostCSS config, when there is one, must name the v4 plugin.\n const postcssConfigPath = findFile(cwd, POSTCSS_CONFIG_CANDIDATES);\n if (postcssConfigPath) {\n const postcssConfig = readIfExists(postcssConfigPath) ?? '';\n const hasV4Plugin = V4_POSTCSS_PLUGIN.test(postcssConfig);\n // Evaluated independently of `hasV4Plugin`, not as its `else` branch: a\n // half-finished migration that lists both entries still throws on the\n // v3 one, and that is the state worth naming.\n const hasV3Plugin = V3_POSTCSS_PLUGIN.test(postcssConfig);\n\n if (hasV3Plugin) {\n error(\n 'postcss-plugin-v3',\n 'PostCSS config names `tailwindcss` as a plugin — the Tailwind 3 ' +\n 'spelling. In v4 that entry resolves to a shim whose only job is ' +\n \"to throw. Replace it with `'@tailwindcss/postcss': {}`.\",\n );\n } else if (hasV4Plugin) {\n ok('postcss-plugin-v4', 'PostCSS config uses @tailwindcss/postcss');\n } else {\n warn(\n 'postcss-plugin-absent',\n 'PostCSS config does not register a Tailwind plugin. Add ' +\n \"`'@tailwindcss/postcss': {}` so Tailwind runs during the build.\",\n );\n }\n }\n\n // 3. The CSS entry must start the v4 engine. Read every candidate that\n // exists and ask whether *any* of them does — see CSS_ENTRY_CANDIDATES.\n const cssEntries = CSS_ENTRY_CANDIDATES.map((rel) => ({\n rel,\n content: readIfExists(join(cwd, rel)),\n })).filter((entry): entry is { rel: string; content: string } => entry.content !== null);\n\n const importsTailwind = cssEntries.some((entry) => V4_CSS_IMPORT.test(entry.content));\n const usesV3Directives = cssEntries.some((entry) => V3_CSS_DIRECTIVE.test(entry.content));\n const declaresSource = cssEntries.some((entry) => CSS_SOURCE_DIRECTIVE.test(entry.content));\n const optsIntoJsConfig = cssEntries.some((entry) => CSS_CONFIG_DIRECTIVE.test(entry.content));\n\n if (cssEntries.length === 0) {\n // No recognised entrypoint — say nothing. A monorepo root or an app with\n // a bespoke CSS layout is not evidence of a misconfiguration, and\n // objectui#3891 is precisely about doctor asserting things it cannot see.\n } else if (importsTailwind) {\n ok('css-entry-v4-import', \"CSS entry runs `@import 'tailwindcss'`\");\n if (declaresSource) {\n ok('css-entry-source', 'CSS entry declares `@source` scanning paths');\n }\n } else if (usesV3Directives) {\n error(\n 'css-entry-v3-directives',\n 'CSS entry still uses the Tailwind 3 `@tailwind base/components/' +\n \"utilities` directives. Tailwind 4 replaces all three with a single \" +\n \"`@import 'tailwindcss';`.\",\n );\n } else {\n warn(\n 'css-entry-no-tailwind',\n \"No CSS entry runs `@import 'tailwindcss'`, so Tailwind never starts. \" +\n `Checked: ${cssEntries.map((entry) => entry.rel).join(', ')}.`,\n );\n }\n\n // 4. `tailwind.config.*` — absence is correct in v4 and reported as nothing\n // at all. Presence is reported only when it is inert.\n const tailwindConfigPath = findFile(cwd, TAILWIND_CONFIG_CANDIDATES);\n if (tailwindConfigPath && !optsIntoJsConfig) {\n const rel = tailwindConfigPath.slice(cwd.length + 1);\n warn(\n 'tailwind-config-inert',\n `${rel} exists but nothing opts into it — Tailwind 4 ignores a JS ` +\n 'config unless a stylesheet declares `@config`. Anything it sets ' +\n '(theme, content/@source paths, plugins) has no effect today. ' +\n 'Either delete it and move the settings into your CSS entry, or add ' +\n `\\`@config '${rel}';\\` there.`,\n );\n } else if (tailwindConfigPath) {\n ok('tailwind-config-active', 'JS Tailwind config is loaded via `@config`');\n }\n }\n\n // ------------------------------------------------------------------ TypeScript\n if (existsSync(join(cwd, 'tsconfig.json'))) {\n ok('tsconfig-found', 'tsconfig.json found');\n const tsRange = deps.typescript;\n if (tsRange) {\n const major = majorOf(tsRange);\n if (major !== null && major < 5) {\n warn('typescript-legacy', `TypeScript ${tsRange} detected — version 5.0+ recommended`);\n } else {\n ok('typescript-version', `TypeScript ${tsRange} (5.0+ required)`);\n }\n }\n } else {\n warn('tsconfig-missing', 'tsconfig.json not found');\n }\n\n // -------------------------------------------------------------- Peer contracts\n if (pkg) {\n if (deps['@object-ui/react'] && !deps.react) {\n warn('peer-react', '@object-ui/react requires react as a peer dependency');\n }\n if (deps['@object-ui/components'] && !deps.tailwindcss) {\n warn('peer-tailwind', '@object-ui/components requires tailwindcss as a peer dependency');\n }\n }\n\n return results;\n}\n\n/** Number of findings that count as problems. `ok` findings never do. */\nexport function countIssues(results: readonly Diagnostic[]): number {\n return results.filter((result) => result.level !== 'ok').length;\n}\n\nexport async function doctor() {\n console.log(chalk.bold('Object UI Doctor'));\n console.log('Diagnosis in progress...\\n');\n\n const results = runDiagnostics(process.cwd());\n\n for (const result of results) {\n if (result.level === 'ok') {\n console.log(chalk.green(`✓ ${result.message}`));\n } else if (result.level === 'warn') {\n console.log(chalk.yellow(`⚠️ ${result.message}`));\n } else {\n console.log(chalk.red(`x ${result.message}`));\n }\n }\n\n const issues = countIssues(results);\n console.log('\\nResult:');\n if (issues === 0) {\n console.log(chalk.green('Everything looks good! ✨'));\n } else {\n console.log(chalk.yellow(`Found ${issues} issue(s).`));\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { existsSync, mkdirSync, writeFileSync } from 'fs';\nimport { join } from 'path';\n\nexport async function add(component: string) {\n console.log(chalk.bold(`Object UI Add: ${component}`));\n console.log(chalk.yellow('Feature not implemented yet.'));\n console.log(`This command will download the source code for ${component}Renderer to your project.`);\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { spawn } from 'child_process';\nimport { existsSync } from 'fs';\nimport { join, resolve, dirname } from 'path';\nimport { fileURLToPath } from 'url';\n\nexport async function studio() {\n console.log(chalk.bold('\\n🎨 Starting ObjectUI Studio...\\n'));\n\n const cwd = process.cwd();\n const __filename = fileURLToPath(import.meta.url);\n const __dirname = dirname(__filename);\n\n // Resolve the console app directory\n // 1. Check monorepo structure (apps/console)\n // 2. Check relative path (../../apps/console from packages/cli)\n const candidates = [\n join(cwd, 'apps/console'),\n resolve(__dirname, '../../apps/console'),\n resolve(__dirname, '../../../apps/console'),\n ];\n\n let consolePath: string | null = null;\n for (const candidate of candidates) {\n if (existsSync(join(candidate, 'package.json'))) {\n consolePath = candidate;\n break;\n }\n }\n\n if (!consolePath) {\n console.log(chalk.yellow('⚠ Console app not found in workspace.'));\n console.log(chalk.dim(' Hint: Run this command from the monorepo root.'));\n console.log(chalk.dim(' Expected: apps/console/package.json\\n'));\n process.exit(1);\n }\n\n console.log(chalk.dim(` Console: ${consolePath}`));\n console.log(chalk.dim(' Mode: MSW (in-browser mock server)\\n'));\n\n // Delegate to the console's dev script which starts Vite + MSW\n const child = spawn('pnpm', ['run', 'dev'], {\n cwd: consolePath,\n stdio: 'inherit',\n env: { ...process.env, NODE_ENV: 'development' },\n shell: true,\n });\n\n child.on('error', (err) => {\n console.error(chalk.red(`\\n ✗ Failed to start studio: ${err.message}`));\n process.exit(1);\n });\n\n child.on('exit', (code) => process.exit(code ?? 0));\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { globSync } from 'glob';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\nimport { parse as parseJsonc, printParseErrorCode, type ParseError } from 'jsonc-parser';\n\nimport { isKnownSchemaType } from '../utils/known-schema-types.js';\n\n/**\n * Root keys that positively identify a file as an ObjectUI schema node.\n *\n * Every entry is a property DECLARED on `BaseSchema`\n * (`packages/types/src/base.ts`) — this set is read out of the protocol's own\n * node contract, not invented here, and it is closed: it grows only when\n * `BaseSchema` grows.\n *\n * `BaseSchema`'s remaining properties are deliberately absent because their\n * NAMES are generic enough to head foreign root vocabularies, and a marker\n * that matches a foreign file re-creates the exact defect this gate exists to\n * remove. Measured over this repository (objectui#5127): `name` appears at the\n * root of 45 of the 46 foreign judged files and `description` at 44 — both are\n * `package.json` keys — so admitting `BaseSchema` wholesale takes the foreign\n * retention from 0 files to all 46. `id`, `label`, `data` and `type` itself are\n * held out on the same reasoning.\n */\nconst OBJECTUI_STRUCTURAL_KEYS: readonly string[] = [\n // Composition — the `children`/`body`-class keys the ruling names.\n 'body',\n 'children',\n // Presentation.\n 'className',\n 'style',\n 'placeholder',\n // Conditional rendering and interaction state.\n 'visible',\n 'visibleWhen',\n 'visibleOn',\n 'hidden',\n 'hiddenOn',\n 'disabled',\n 'disabledOn',\n // Test and accessibility handles.\n 'testId',\n 'ariaLabel',\n];\n\n/**\n * ⛔ There is deliberately NO `$schema` arm, and no ObjectUI `$schema` URL\n * exists to declare.\n *\n * An earlier revision of this file admitted a file whose root `$schema` had an\n * `objectui.org` host, completed by a canonical URL proposed for the\n * maintainer to confirm. The maintainer ruled against minting that identifier\n * (2026-08-20, objectui#5127, verbatim 「C」), superseding the `$schema` half of\n * the 2026-08-19 ruling. The structural arm below is unaffected and stands.\n *\n * - A `$schema` URL is a permanent public identifier that lives in USERS'\n * files, which no sweep can ever reach. Minting the address before the\n * document it names exists is backwards.\n * - The only consumer that needs a URL rather than any agreed marker is an\n * editor resolving `$schema` over HTTP. An agent authoring schemas instead\n * needs a contract it can read BEFORE writing — a file, and `node_modules`\n * is right there — and a good error AFTER writing, which is this command,\n * already version-correct from the installed packages.\n * - The value would be untyped, unchecked and host-matched, so an agent that\n * mis-remembered the path would be silently accepted: a version-fossil\n * generator, in files we cannot fix.\n * - Zero files declared it, in this repository or anywhere else, so the arm\n * matched nothing. Dropping it gives up no coverage that was being\n * delivered.\n *\n * Because that matching was host-based rather than literal, the arm can be\n * added later without invalidating a single file — most soundly once\n * `@object-ui/types` ships a generated JSON Schema, which is filed separately.\n */\n\n/**\n * Does this parsed file positively read as an ObjectUI schema (objectui#5127)?\n *\n * `type` carries at least seven unrelated vocabularies in JSON — the most\n * common of them being `package.json`'s `\"type\": \"module\"` — so the presence\n * of a root `type` is not evidence that a file is a UI schema. Before this\n * gate, `objectui check` judged every root `type` against the component-key\n * universe and the FIRST line a user saw in their own project was a warning\n * about their own `package.json`: 45 of the 46 warnings this repository\n * produced were exactly that.\n *\n * The fix is a positive marker, not a consumer-side skip list: a file is\n * judged when it is structurally recognisable as an ObjectUI node. A list of\n * filenames to exclude was\n * considered and rejected — it is a second hand-maintained list of the shape\n * objectui#5115 had just finished deleting, and it can only ever enumerate the\n * foreign vocabularies someone already thought of.\n *\n * ⚠️ The structural arm is a TRANSITIONAL fallback, not the contract. It is\n * drawn for precision over recall on purpose: a foreign file wrongly judged is\n * this card's defect reappearing in a user's project, while a real schema\n * wrongly skipped is a coverage debt that the corpus migration repays and that\n * the skipped-file count below keeps visible in the meantime.\n */\nfunction isObjectUiSchemaFile(content: Record<string, unknown>): boolean {\n return OBJECTUI_STRUCTURAL_KEYS.some((key) => key in content);\n}\n\n/**\n * Render a `jsonc-parser` error the way `JSON.parse` renders its own: a reason,\n * then where it happened. The parser reports a byte offset; the line/column is\n * derived here because a bare offset is not actionable in an editor.\n */\nfunction describeParseError(text: string, error: ParseError): string {\n const upTo = text.slice(0, error.offset);\n const line = upTo.split('\\n').length;\n const column = error.offset - (upTo.lastIndexOf('\\n') + 1) + 1;\n return `${printParseErrorCode(error.error)} at line ${line} column ${column}`;\n}\n\n/**\n * @param cwd Directory to scan. Defaults to the process working directory,\n * which is what the `objectui check` command passes. Taking it as an\n * argument is what lets the tests scan a fixture tree without `chdir`, which\n * Vitest's worker threads do not support.\n */\nexport async function check(cwd: string = process.cwd()) {\n console.log(chalk.bold('Object UI Schema Check'));\n\n // 1. Find all JSON/YAML files\n const files = globSync('**/*.{json,yaml,yml}', { \n cwd, \n ignore: ['node_modules/**', 'dist/**', '.git/**'] \n });\n \n console.log(`Analyzing ${files.length} files...`);\n \n let errors = 0;\n // Files that a root `type` string made ELIGIBLE for type judgement and that\n // no ObjectUI marker admitted. Reported below so the narrowed judgement\n // surface is never silent (objectui#5127) — a check that quietly stops\n // checking is worse than one that warns too loudly, because nothing prompts\n // a re-read.\n let skipped = 0;\n \n for (const file of files) {\n try {\n // Basic JSON parsing check\n if (file.endsWith('.json')) {\n // `.json` on disk means JSONC in practice — comments and trailing\n // commas are how `tsconfig.json`, `.eslintrc.json`, `devcontainer.json`\n // and VS Code's own settings are documented to be written. `JSON.parse`\n // rejected every one of them, and because a parse failure is the only\n // thing that increments `errors`, `objectui check` exited 1 in any\n // TypeScript project — 64 errors in this repository alone (objectui#5237).\n //\n // The reader is `jsonc-parser` (already shipped by `@object-ui/app-shell`),\n // NOT a comment-stripping regex: a `//` inside a string value — say a\n // URL — is not a comment, and a stripper that cannot tell the\n // difference corrupts valid files instead of reading them.\n const text = readFileSync(join(cwd, file), 'utf-8');\n const parseErrors: ParseError[] = [];\n // Comments are permitted by default; trailing commas are opt-in.\n // `allowEmptyContent` stays off so an empty `.json` is still an error,\n // exactly as `JSON.parse('')` was.\n const content = parseJsonc(text, parseErrors, { allowTrailingComma: true });\n\n // `parseJsonc` is error-TOLERANT: it recovers and returns a best-effort\n // value rather than throwing, so genuinely malformed JSON is caught by\n // consulting this array. Dropping this check would turn the fix into\n // \"never fail on anything\".\n if (parseErrors.length > 0) {\n const [first] = parseErrors;\n console.log(\n chalk.red(`x Invalid JSON in ${file}: ${describeParseError(text, first)}`)\n );\n errors++;\n continue;\n }\n\n // Schema validation: check for ObjectUI schema patterns\n if (content && typeof content === 'object' && content.type) {\n if (typeof content.type === 'string') {\n // The marker gate (objectui#5127). Only a file that positively\n // reads as an ObjectUI schema enters type judgement; every other\n // root-`type` vocabulary — `package.json`'s `\"module\"`,\n // JSON Schema's `\"object\"`, and the rest — is simply not judged.\n //\n // Note this arm is reached for `.json` only, as the parse above\n // is. The glob also matches `.yaml`/`.yml`, and those files are\n // read by neither arm, before this change or after it.\n if (!isObjectUiSchemaFile(content as Record<string, unknown>)) {\n skipped++;\n } else if (!isKnownSchemaType(content.type)) {\n // The known-type universe is DERIVED from the repository's\n // registration calls (see `packages/cli/src/utils/known-schema-types.ts`\n // and the script that writes it), not typed by hand. The array that\n // used to sit here had drifted both ways at once — objectui#5115.\n console.log(chalk.yellow(`⚠️ Unknown schema type \"${content.type}\" in ${file}`));\n }\n }\n }\n }\n } catch (e) {\n console.log(chalk.red(`x Invalid JSON in ${file}: ${(e as Error).message}`));\n errors++;\n }\n }\n\n if (skipped > 0) {\n console.log(\n chalk.dim(\n `Skipped ${skipped} file${skipped === 1 ? '' : 's'} with a root \"type\" and no ObjectUI schema marker.`\n )\n );\n // The hint names the marker keys by rendering the gate's OWN array, never\n // a sentence written alongside it. A hint that describes a way in that the\n // build does not honour is worse than no hint: the reader follows it,\n // nothing changes, and the command looks broken rather than narrow. The\n // previous revision of this line advised declaring a `$schema` URL — an\n // arm the 2026-08-20 ruling removed — which is exactly that failure had it\n // outlived the code it described.\n console.log(\n chalk.dim(\n ` A file is checked when its root carries an ObjectUI structural key: ${OBJECTUI_STRUCTURAL_KEYS.join(', ')}.`\n )\n );\n }\n \n if (errors === 0) {\n console.log(chalk.green('✓ All checks passed'));\n } else {\n console.log(chalk.red(`Found ${errors} errors`));\n process.exit(1);\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * GENERATED FILE — do not edit by hand.\n *\n * Regenerate: node scripts/regenerate-known-schema-types.mjs\n * Pinned by: scripts/__tests__/known-schema-types-derivation-5115.test.ts\n *\n * Every component `type` this repository registers, as read out of the\n * registration calls themselves. `objectui check` uses it to decide whether a\n * schema's `type` names a component that exists.\n *\n * This list replaces a seventeen-entry array that was typed by hand into\n * `check.ts` and had drifted from the registry in both directions at once\n * (objectui#5115): it blessed `crud` and `gallery`, which nothing registers\n * and which render the OBJUI-001 \"Unknown component type\" panel, while\n * reporting 221 real bare keys — and every namespaced spelling, `view:grid`\n * included — as unknown. The header of the regeneration script carries the\n * measurements and explains why the CLI cannot simply ask `ComponentRegistry`.\n *\n * Both bare and namespaced spellings are present because both are real\n * registry keys: `register('grid', C, { namespace: 'view' })` stores\n * `view:grid` AND, unless `skipFallback` is set, bare `grid`.\n */\n\nexport const KNOWN_SCHEMA_TYPES: readonly string[] = [\n 'a',\n 'abbr',\n 'accordion',\n 'action:bar',\n 'action:button',\n 'action:group',\n 'action:icon',\n 'action:menu',\n 'address',\n 'advanced-chart',\n 'ai-form-assist',\n 'ai-recommendations',\n 'ai:feedback',\n 'ai:input',\n 'ai:suggestion',\n 'alert',\n 'alert-dialog',\n 'app',\n 'app-creation-wizard',\n 'app-schema-renderer',\n 'app-shell:cloud-connection:panel',\n 'app-shell:cloud:ai-model-status',\n 'app-shell:cloud:onboarding-next',\n 'app-shell:marketplace:installed-list',\n 'app-shell:mcp:connect-agent',\n 'app:launcher',\n 'area-chart',\n 'article',\n 'aside',\n 'aspect-ratio',\n 'auto_number',\n 'avatar',\n 'b',\n 'badge',\n 'bar-chart',\n 'blockquote',\n 'boolean',\n 'br',\n 'branding-editor',\n 'breadcrumb',\n 'button',\n 'button-group',\n 'calendar',\n 'calendar-view',\n 'card',\n 'carousel',\n 'chart',\n 'chart:bar',\n 'chatbot',\n 'chatbot-enhanced',\n 'chatbot-floating',\n 'checkbox',\n 'checkboxes',\n 'cite',\n 'cloud-connection:panel',\n 'cloud:ai-model-status',\n 'cloud:onboarding-next',\n 'code',\n 'code-editor',\n 'collapsible',\n 'color',\n 'combobox',\n 'command',\n 'container',\n 'context-menu',\n 'currency',\n 'dashboard',\n 'dashboard-editor',\n 'dashboard-grid',\n 'data-model-designer',\n 'data-table',\n 'date',\n 'date-picker',\n 'datetime',\n 'dd',\n 'del',\n 'detail',\n 'detail-section',\n 'detail-view',\n 'dialog',\n 'div',\n 'dl',\n 'donut-chart',\n 'drawer',\n 'dropdown-menu',\n 'dt',\n 'element:button',\n 'element:definition-list',\n 'element:divider',\n 'element:image',\n 'element:metadata_viewer',\n 'element:number',\n 'element:record_picker',\n 'element:repeater',\n 'element:text',\n 'element:text_input',\n 'em',\n 'email',\n 'embeddable-form',\n 'empty',\n 'field-designer',\n 'field:address',\n 'field:audio',\n 'field:auto_number',\n 'field:avatar',\n 'field:boolean',\n 'field:checkboxes',\n 'field:code',\n 'field:color',\n 'field:currency',\n 'field:date',\n 'field:datetime',\n 'field:duration',\n 'field:email',\n 'field:file',\n 'field:filter-condition',\n 'field:formula',\n 'field:geolocation',\n 'field:grid',\n 'field:html',\n 'field:image',\n 'field:json',\n 'field:location',\n 'field:lookup',\n 'field:markdown',\n 'field:master_detail',\n 'field:multiselect',\n 'field:number',\n 'field:object',\n 'field:object-ref',\n 'field:password',\n 'field:percent',\n 'field:permission-facet-link',\n 'field:phone',\n 'field:progress',\n 'field:qrcode',\n 'field:radio',\n 'field:rating',\n 'field:recipient-picker',\n 'field:richtext',\n 'field:select',\n 'field:signature',\n 'field:slider',\n 'field:summary',\n 'field:tags',\n 'field:text',\n 'field:textarea',\n 'field:time',\n 'field:tree',\n 'field:url',\n 'field:user',\n 'field:vector',\n 'field:video',\n 'figcaption',\n 'figure',\n 'file',\n 'file-upload',\n 'filter-builder',\n 'filter-ui',\n 'flex',\n 'footer',\n 'form',\n 'form-analytics',\n 'formula',\n 'gantt',\n 'geolocation',\n 'global:notifications',\n 'global:search',\n 'grid',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'header',\n 'header-bar',\n 'home',\n 'hover-card',\n 'hr',\n 'html',\n 'i',\n 'icon',\n 'image',\n 'img',\n 'import-wizard',\n 'input',\n 'input-otp',\n 'ins',\n 'kanban',\n 'kanban-enhanced',\n 'kanban-ui',\n 'kbd',\n 'label',\n 'layout:app-schema-renderer',\n 'layout:navigation-renderer',\n 'layout:page-header',\n 'layout:page:card',\n 'layout:responsive-grid',\n 'li',\n 'line-chart',\n 'list',\n 'list-view',\n 'loading',\n 'location',\n 'lookup',\n 'main',\n 'map',\n 'mark',\n 'markdown',\n 'marketplace:installed-list',\n 'master_detail',\n 'mcp:connect-agent',\n 'menubar',\n 'metric',\n 'metric-card',\n 'multiselect',\n 'nav',\n 'nav:breadcrumb',\n 'nav:menu',\n 'navigation-designer',\n 'navigation-menu',\n 'navigation-renderer',\n 'nl-query',\n 'number',\n 'object',\n 'object-calendar',\n 'object-chart',\n 'object-data-table',\n 'object-form',\n 'object-gallery',\n 'object-gantt',\n 'object-grid',\n 'object-kanban',\n 'object-manager',\n 'object-map',\n 'object-master-detail-form',\n 'object-metric',\n 'object-pivot',\n 'object-timeline',\n 'object-tree',\n 'object-view',\n 'ol',\n 'p',\n 'page',\n 'page-designer',\n 'page-header',\n 'page:accordion',\n 'page:card',\n 'page:footer',\n 'page:header',\n 'page:section',\n 'page:sidebar',\n 'page:tabs',\n 'pagination',\n 'password',\n 'percent',\n 'phone',\n 'pie-chart',\n 'pivot',\n 'plugin-calendar:calendar-view',\n 'plugin-calendar:object-calendar',\n 'plugin-charts:advanced-chart',\n 'plugin-charts:area-chart',\n 'plugin-charts:bar-chart',\n 'plugin-charts:chart',\n 'plugin-charts:chart:bar',\n 'plugin-charts:donut-chart',\n 'plugin-charts:line-chart',\n 'plugin-charts:object-chart',\n 'plugin-charts:pie-chart',\n 'plugin-charts:radar-chart',\n 'plugin-charts:scatter-chart',\n 'plugin-chatbot:chatbot',\n 'plugin-chatbot:chatbot-enhanced',\n 'plugin-chatbot:chatbot-floating',\n 'plugin-dashboard:dashboard',\n 'plugin-dashboard:dashboard-grid',\n 'plugin-dashboard:metric',\n 'plugin-dashboard:metric-card',\n 'plugin-dashboard:object-data-table',\n 'plugin-dashboard:object-metric',\n 'plugin-dashboard:object-pivot',\n 'plugin-dashboard:pivot',\n 'plugin-designer:app-creation-wizard',\n 'plugin-designer:branding-editor',\n 'plugin-designer:dashboard-editor',\n 'plugin-designer:data-model-designer',\n 'plugin-designer:field-designer',\n 'plugin-designer:navigation-designer',\n 'plugin-designer:object-manager',\n 'plugin-designer:page-designer',\n 'plugin-designer:process-designer',\n 'plugin-designer:report-designer',\n 'plugin-detail:detail-section',\n 'plugin-detail:detail-view',\n 'plugin-detail:related-list',\n 'plugin-editor:code-editor',\n 'plugin-form:embeddable-form',\n 'plugin-form:form-analytics',\n 'plugin-form:object-form',\n 'plugin-form:object-master-detail-form',\n 'plugin-gantt:object-gantt',\n 'plugin-grid:import-wizard',\n 'plugin-grid:object-grid',\n 'plugin-kanban:kanban-enhanced',\n 'plugin-kanban:kanban-ui',\n 'plugin-kanban:object-kanban',\n 'plugin-list:list-view',\n 'plugin-list:object-gallery',\n 'plugin-map:object-map',\n 'plugin-markdown:markdown',\n 'plugin-report:report',\n 'plugin-report:report-viewer',\n 'plugin-report:spec-report',\n 'plugin-timeline:object-timeline',\n 'plugin-timeline:timeline',\n 'plugin-tree:object-tree',\n 'plugin-view:object-view',\n 'plugin-view:view',\n 'plugin-view:view:simple',\n 'popover',\n 'pre',\n 'process-designer',\n 'progress',\n 'protocol-placeholder:ai:feedback',\n 'protocol-placeholder:ai:input',\n 'protocol-placeholder:ai:suggestion',\n 'protocol-placeholder:app:launcher',\n 'protocol-placeholder:field:address',\n 'protocol-placeholder:field:audio',\n 'protocol-placeholder:field:avatar',\n 'protocol-placeholder:field:boolean',\n 'protocol-placeholder:field:checkboxes',\n 'protocol-placeholder:field:code',\n 'protocol-placeholder:field:color',\n 'protocol-placeholder:field:currency',\n 'protocol-placeholder:field:date',\n 'protocol-placeholder:field:datetime',\n 'protocol-placeholder:field:duration',\n 'protocol-placeholder:field:email',\n 'protocol-placeholder:field:file',\n 'protocol-placeholder:field:html',\n 'protocol-placeholder:field:image',\n 'protocol-placeholder:field:json',\n 'protocol-placeholder:field:location',\n 'protocol-placeholder:field:lookup',\n 'protocol-placeholder:field:markdown',\n 'protocol-placeholder:field:master_detail',\n 'protocol-placeholder:field:multiselect',\n 'protocol-placeholder:field:number',\n 'protocol-placeholder:field:password',\n 'protocol-placeholder:field:percent',\n 'protocol-placeholder:field:phone',\n 'protocol-placeholder:field:progress',\n 'protocol-placeholder:field:qrcode',\n 'protocol-placeholder:field:radio',\n 'protocol-placeholder:field:rating',\n 'protocol-placeholder:field:select',\n 'protocol-placeholder:field:signature',\n 'protocol-placeholder:field:slider',\n 'protocol-placeholder:field:text',\n 'protocol-placeholder:field:textarea',\n 'protocol-placeholder:field:time',\n 'protocol-placeholder:field:tree',\n 'protocol-placeholder:field:url',\n 'protocol-placeholder:field:video',\n 'protocol-placeholder:global:notifications',\n 'protocol-placeholder:global:search',\n 'protocol-placeholder:nav:breadcrumb',\n 'protocol-placeholder:nav:menu',\n 'protocol-placeholder:page-header',\n 'protocol-placeholder:page:accordion',\n 'protocol-placeholder:page:card',\n 'protocol-placeholder:page:footer',\n 'protocol-placeholder:page:header',\n 'protocol-placeholder:page:sidebar',\n 'protocol-placeholder:page:tabs',\n 'protocol-placeholder:record:activity',\n 'protocol-placeholder:record:chatter',\n 'protocol-placeholder:record:details',\n 'protocol-placeholder:record:highlights',\n 'protocol-placeholder:record:path',\n 'protocol-placeholder:record:related_list',\n 'protocol-placeholder:user:profile',\n 'protocol-placeholder:view:calendar',\n 'protocol-placeholder:view:drawer',\n 'protocol-placeholder:view:gallery',\n 'protocol-placeholder:view:gantt',\n 'protocol-placeholder:view:grid',\n 'protocol-placeholder:view:kanban',\n 'protocol-placeholder:view:map',\n 'protocol-placeholder:view:modal',\n 'protocol-placeholder:view:simple',\n 'protocol-placeholder:view:split',\n 'protocol-placeholder:view:tabbed',\n 'protocol-placeholder:view:timeline',\n 'protocol-placeholder:view:wizard',\n 'protocol-placeholder:widget:bar',\n 'protocol-placeholder:widget:funnel',\n 'protocol-placeholder:widget:heatmap',\n 'protocol-placeholder:widget:image',\n 'protocol-placeholder:widget:line',\n 'protocol-placeholder:widget:metric',\n 'protocol-placeholder:widget:pie',\n 'protocol-placeholder:widget:pivot',\n 'protocol-placeholder:widget:radar',\n 'protocol-placeholder:widget:scatter',\n 'protocol-placeholder:widget:table',\n 'protocol-placeholder:widget:text',\n 'q',\n 'qrcode',\n 'radar-chart',\n 'radio',\n 'radio-group',\n 'rating',\n 'record',\n 'record:activity',\n 'record:alert',\n 'record:approvals',\n 'record:attachments',\n 'record:chatter',\n 'record:details',\n 'record:discussion',\n 'record:highlights',\n 'record:history',\n 'record:line_items',\n 'record:path',\n 'record:quick_actions',\n 'record:reference_rail',\n 'record:related_list',\n 'related-list',\n 'report',\n 'report-designer',\n 'report-viewer',\n 'report:report',\n 'report:report-viewer',\n 'report:spec-report',\n 'resizable',\n 'responsive-grid',\n 'richtext',\n 'scatter-chart',\n 'scroll-area',\n 'section',\n 'select',\n 'separator',\n 'shared-view-link',\n 'sheet',\n 'sidebar',\n 'sidebar-content',\n 'sidebar-footer',\n 'sidebar-group',\n 'sidebar-header',\n 'sidebar-inset',\n 'sidebar-menu',\n 'sidebar-menu-button',\n 'sidebar-menu-item',\n 'sidebar-provider',\n 'sidebar-trigger',\n 'signature',\n 'skeleton',\n 'slider',\n 'small',\n 'sonner',\n 'sort-ui',\n 'span',\n 'spec-report',\n 'spinner',\n 'stack',\n 'statistic',\n 'strong',\n 'sub',\n 'summary',\n 'sup',\n 'switch',\n 'table',\n 'tabs',\n 'tags',\n 'text',\n 'textarea',\n 'time',\n 'timeline',\n 'toast',\n 'toaster',\n 'toggle',\n 'toggle-group',\n 'tooltip',\n 'tree',\n 'tree-view',\n 'u',\n 'ui:a',\n 'ui:abbr',\n 'ui:accordion',\n 'ui:address',\n 'ui:alert',\n 'ui:alert-dialog',\n 'ui:article',\n 'ui:aside',\n 'ui:aspect-ratio',\n 'ui:avatar',\n 'ui:b',\n 'ui:badge',\n 'ui:blockquote',\n 'ui:br',\n 'ui:breadcrumb',\n 'ui:button',\n 'ui:button-group',\n 'ui:calendar',\n 'ui:card',\n 'ui:carousel',\n 'ui:checkbox',\n 'ui:cite',\n 'ui:collapsible',\n 'ui:combobox',\n 'ui:command',\n 'ui:container',\n 'ui:context-menu',\n 'ui:data-table',\n 'ui:date-picker',\n 'ui:dd',\n 'ui:del',\n 'ui:dialog',\n 'ui:div',\n 'ui:dl',\n 'ui:drawer',\n 'ui:dropdown-menu',\n 'ui:dt',\n 'ui:em',\n 'ui:email',\n 'ui:empty',\n 'ui:figcaption',\n 'ui:figure',\n 'ui:file-upload',\n 'ui:filter-builder',\n 'ui:flex',\n 'ui:footer',\n 'ui:grid',\n 'ui:h1',\n 'ui:h2',\n 'ui:h3',\n 'ui:h4',\n 'ui:h5',\n 'ui:h6',\n 'ui:header',\n 'ui:header-bar',\n 'ui:hover-card',\n 'ui:hr',\n 'ui:html',\n 'ui:i',\n 'ui:icon',\n 'ui:image',\n 'ui:img',\n 'ui:input',\n 'ui:input-otp',\n 'ui:ins',\n 'ui:kbd',\n 'ui:label',\n 'ui:li',\n 'ui:list',\n 'ui:loading',\n 'ui:main',\n 'ui:mark',\n 'ui:menubar',\n 'ui:nav',\n 'ui:navigation-menu',\n 'ui:ol',\n 'ui:p',\n 'ui:pagination',\n 'ui:password',\n 'ui:popover',\n 'ui:pre',\n 'ui:progress',\n 'ui:q',\n 'ui:radio-group',\n 'ui:resizable',\n 'ui:scroll-area',\n 'ui:section',\n 'ui:select',\n 'ui:separator',\n 'ui:sheet',\n 'ui:sidebar',\n 'ui:sidebar-content',\n 'ui:sidebar-footer',\n 'ui:sidebar-group',\n 'ui:sidebar-header',\n 'ui:sidebar-inset',\n 'ui:sidebar-menu',\n 'ui:sidebar-menu-button',\n 'ui:sidebar-menu-item',\n 'ui:sidebar-provider',\n 'ui:sidebar-trigger',\n 'ui:skeleton',\n 'ui:slider',\n 'ui:small',\n 'ui:sonner',\n 'ui:span',\n 'ui:spinner',\n 'ui:stack',\n 'ui:statistic',\n 'ui:strong',\n 'ui:sub',\n 'ui:sup',\n 'ui:switch',\n 'ui:table',\n 'ui:tabs',\n 'ui:text',\n 'ui:textarea',\n 'ui:time',\n 'ui:toast',\n 'ui:toaster',\n 'ui:toggle',\n 'ui:toggle-group',\n 'ui:tooltip',\n 'ui:tree-view',\n 'ui:u',\n 'ui:ul',\n 'ul',\n 'url',\n 'user',\n 'user:profile',\n 'utility',\n 'vector',\n 'view',\n 'view-switcher',\n 'view:calendar',\n 'view:chart',\n 'view:dashboard',\n 'view:detail',\n 'view:drawer',\n 'view:filter-ui',\n 'view:form',\n 'view:gallery',\n 'view:gantt',\n 'view:grid',\n 'view:kanban',\n 'view:list',\n 'view:map',\n 'view:modal',\n 'view:shared-view-link',\n 'view:simple',\n 'view:sort-ui',\n 'view:split',\n 'view:tabbed',\n 'view:timeline',\n 'view:tree',\n 'view:view-switcher',\n 'view:wizard',\n 'widget:bar',\n 'widget:funnel',\n 'widget:heatmap',\n 'widget:image',\n 'widget:line',\n 'widget:metric',\n 'widget:pie',\n 'widget:pivot',\n 'widget:radar',\n 'widget:scatter',\n 'widget:table',\n 'widget:text',\n];\n\nconst KNOWN_SCHEMA_TYPE_SET: ReadonlySet<string> = new Set(KNOWN_SCHEMA_TYPES);\n\n/**\n * Does `type` name a component the ObjectUI stack registers?\n *\n * Answers about THIS repository's registrations only. A user project that\n * registers its own components will have keys this cannot know about, which is\n * why `objectui check` reports an unrecognised type as a warning and never\n * fails the run on it.\n */\nexport function isKnownSchemaType(type: string): boolean {\n return KNOWN_SCHEMA_TYPE_SET.has(type);\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { readFileSync, existsSync } from 'fs';\nimport { resolve } from 'path';\nimport { load as loadYaml } from 'js-yaml';\nimport { safeValidateSchema } from '@object-ui/types/zod';\nimport { findSpecVocabularyFormFields } from '../utils/spec-vocabulary-hint.js';\n\n/**\n * Validate a schema file\n * \n * @param schemaPath - Path to the schema file (JSON or YAML)\n */\nexport async function validate(schemaPath: string) {\n console.log(chalk.blue('🔍 ObjectUI Schema Validator\\n'));\n\n // Resolve the schema path\n const resolvedPath = resolve(process.cwd(), schemaPath);\n\n // Check if file exists\n if (!existsSync(resolvedPath)) {\n console.error(chalk.red(`✗ Error: Schema file not found: ${schemaPath}`));\n process.exit(1);\n }\n\n try {\n // Read the file\n const fileContent = readFileSync(resolvedPath, 'utf-8');\n let schema: unknown;\n\n // Parse based on file extension\n if (schemaPath.endsWith('.yaml') || schemaPath.endsWith('.yml')) {\n console.log(chalk.gray(`Reading YAML schema from: ${schemaPath}`));\n schema = loadYaml(fileContent);\n } else if (schemaPath.endsWith('.json')) {\n console.log(chalk.gray(`Reading JSON schema from: ${schemaPath}`));\n schema = JSON.parse(fileContent);\n } else {\n // Try JSON first, then YAML\n try {\n schema = JSON.parse(fileContent);\n console.log(chalk.gray(`Reading schema from: ${schemaPath} (detected as JSON)`));\n } catch {\n schema = loadYaml(fileContent);\n console.log(chalk.gray(`Reading schema from: ${schemaPath} (detected as YAML)`));\n }\n }\n\n // Validate the schema\n console.log(chalk.gray('Validating schema...\\n'));\n const result = safeValidateSchema(schema);\n\n if (result.success) {\n console.log(chalk.green('✓ Schema is valid!\\n'));\n \n // Show some info about the schema\n const data = result.data;\n console.log(chalk.bold('Schema Information:'));\n console.log(chalk.gray(' Type:'), data.type || 'unknown');\n \n if (data.id) {\n console.log(chalk.gray(' ID:'), data.id);\n }\n \n if (data.label || data.title) {\n console.log(chalk.gray(' Label:'), data.label || data.title);\n }\n \n // Count children if present\n if (data.children && Array.isArray(data.children)) {\n console.log(chalk.gray(' Children:'), data.children.length);\n }\n\n // Mixed-vocabulary entries validate (the runtime `name` satisfies the\n // schema) but the spec `field` key is dead weight: the renderer ignores\n // it and strip-mode validation drops it. Valid ≠ clean — say so (#3090).\n const mixed = findSpecVocabularyFormFields(schema).filter((f) => f.mixedName);\n if (mixed.length > 0) {\n console.log(chalk.yellow('\\nWarnings:'));\n for (const m of mixed) {\n console.log(chalk.yellow(\n ` ${m.path}: '${m.mixedName}' also carries { field: '${m.field}' } — mixed form-field ` +\n `vocabularies. The renderer ignores \\`field\\` here; drop one of the two.`,\n ));\n }\n }\n\n console.log('');\n process.exit(0);\n } else {\n console.error(chalk.red('✗ Schema validation failed!\\n'));\n console.error(chalk.bold('Validation Errors:'));\n \n // Format Zod errors nicely. `.issues` is the only accessor on a Zod 4\n // ZodError — the `.errors` alias was removed, so reading it yielded\n // undefined and this loop threw a TypeError that the catch below\n // reported as \"Error reading or parsing schema file\", hiding the very\n // errors this command exists to print.\n result.error.issues.forEach((issue, index) => {\n console.error(chalk.red(`\\n${index + 1}. ${issue.message}`));\n if (issue.path && issue.path.length > 0) {\n console.error(chalk.gray(` Path: ${issue.path.join(' → ')}`));\n }\n if (issue.code) {\n console.error(chalk.gray(` Code: ${issue.code}`));\n }\n });\n\n // \"name: expected string, received undefined\" on a `{ field: … }` entry\n // reads as an instruction to bolt a `name` on — which converts the\n // metadata WRONGLY (the spec shape stands for an object-schema merge\n // that a bare rename throws away). When the input matches that\n // signature, name the actual boundary and the real fixes (#3090).\n const specShaped = findSpecVocabularyFormFields(schema).filter((f) => !f.mixedName);\n if (specShaped.length > 0) {\n console.error(chalk.bold('\\nLikely cause — spec form-view vocabulary in a standalone form:'));\n for (const s of specShaped) {\n console.error(chalk.yellow(\n ` ${s.path}: { field: '${s.field}' } is the spec form-VIEW shape (an object-field reference).`,\n ));\n }\n console.error(chalk.yellow(\n ` A standalone \\`type: 'form'\\` component uses { name: … } (the form data path).\\n` +\n ` Fix: author the field with \\`name\\` and its own type/label — or, to reference object fields\\n` +\n ` with the spec shape, use an object-bound form (\\`type: 'object-form'\\` with objectName +\\n` +\n ` sections), whose section fields are translated by the renderer.`,\n ));\n }\n\n console.error('');\n process.exit(1);\n }\n } catch (error) {\n console.error(chalk.red('\\n✗ Error reading or parsing schema file:'));\n console.error(chalk.red((error as Error).message));\n console.error('');\n process.exit(1);\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Spec-vocabulary detector for `objectui validate` (#3090).\n *\n * `{ field: 'x' }` inside a standalone `type: 'form'` component is the spec\n * form-VIEW vocabulary (an object-field reference) — a different layer from\n * the runtime vocabulary this CLI validates (`name` = form data path). The\n * zod error for it (\"name: expected string, received undefined\") reads as an\n * instruction to bolt a `name` on, which converts the metadata WRONGLY: an\n * agent following it loses the object-schema merge the spec shape stands for.\n * This detector lets the CLI say what actually happened and what the real fix\n * is. The error message is the prompt the next agent executes — it has to\n * point at the boundary, not at the symptom.\n *\n * Scope is deliberately exact: only `fields` arrays hanging DIRECTLY off a\n * `type: 'form'` node. Section fields (`type: 'object-form'` → `sections[]`)\n * legitimately accept the spec shape — `normalizeSectionField` translates\n * them — and a runtime FormField's `field` key legitimately holds the\n * resolved metadata OBJECT, so only a STRING `field` marks the spec shape.\n */\n\nexport interface SpecVocabularyFinding {\n /** JSON-ish path to the entry, e.g. `children[0].fields[2]`. */\n path: string;\n /** The spec `field` value (the referenced object field). */\n field: string;\n /** Set when the entry ALSO carries a runtime `name` (mixed vocabularies). */\n mixedName?: string;\n}\n\nexport function findSpecVocabularyFormFields(\n node: unknown,\n path = '',\n): SpecVocabularyFinding[] {\n if (Array.isArray(node)) {\n return node.flatMap((child, i) => findSpecVocabularyFormFields(child, `${path}[${i}]`));\n }\n if (node === null || typeof node !== 'object') return [];\n\n const record = node as Record<string, unknown>;\n const findings: SpecVocabularyFinding[] = [];\n\n if (record.type === 'form' && Array.isArray(record.fields)) {\n record.fields.forEach((f, i) => {\n if (f && typeof f === 'object' && typeof (f as any).field === 'string') {\n const name = (f as any).name;\n findings.push({\n path: `${path ? `${path}.` : ''}fields[${i}]`,\n field: (f as any).field,\n ...(typeof name === 'string' ? { mixedName: name } : {}),\n });\n }\n });\n }\n\n for (const [key, value] of Object.entries(record)) {\n // The entries themselves were just inspected; don't re-walk them as\n // generic children or each finding would double-report.\n if (record.type === 'form' && key === 'fields') continue;\n findings.push(\n ...findSpecVocabularyFormFields(value, path ? `${path}.${key}` : key),\n );\n }\n return findings;\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { spawn } from 'child_process';\nimport { resolve, dirname } from 'path';\nimport { fileURLToPath } from 'url';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n/**\n * Create a new plugin using the @object-ui/create-plugin package\n * \n * @param pluginName - Name of the plugin to create\n */\nexport async function createPlugin(pluginName: string) {\n console.log(chalk.blue('🚀 Creating ObjectUI plugin...\\n'));\n\n // Resolve the create-plugin script path\n const createPluginScript = resolve(\n __dirname,\n '../../../create-plugin/dist/index.js'\n );\n\n return new Promise<void>((resolve, reject) => {\n // Spawn the create-plugin command\n const child = spawn('node', [createPluginScript, pluginName], {\n stdio: 'inherit',\n shell: true,\n });\n\n child.on('error', (error) => {\n console.error(chalk.red('Failed to create plugin:'), error);\n reject(error);\n });\n\n child.on('exit', (code) => {\n if (code === 0) {\n resolve();\n } else {\n reject(new Error(`create-plugin exited with code ${code}`));\n }\n });\n });\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { existsSync, statSync, readdirSync } from 'fs';\nimport { resolve, join, extname } from 'path';\n\ninterface AnalyzeOptions {\n bundleSize?: boolean;\n renderPerformance?: boolean;\n}\n\n/**\n * Analyze bundle size by scanning dist directory\n */\nasync function analyzeBundleSize() {\n console.log(chalk.bold('\\n📦 Bundle Size Analysis\\n'));\n\n const distDir = resolve(process.cwd(), 'dist');\n \n if (!existsSync(distDir)) {\n console.log(chalk.yellow('⚠ No dist directory found. Run build first.'));\n return;\n }\n\n const files: Array<{ path: string; size: number }> = [];\n \n function scanDirectory(dir: string) {\n const items = readdirSync(dir);\n \n for (const item of items) {\n const fullPath = join(dir, item);\n const stat = statSync(fullPath);\n \n if (stat.isDirectory()) {\n scanDirectory(fullPath);\n } else {\n files.push({\n path: fullPath.replace(distDir + '/', ''),\n size: stat.size,\n });\n }\n }\n }\n \n scanDirectory(distDir);\n \n // Sort by size (largest first)\n files.sort((a, b) => b.size - a.size);\n \n // Calculate totals\n const totalSize = files.reduce((sum, file) => sum + file.size, 0);\n const jsFiles = files.filter(f => extname(f.path) === '.js');\n const cssFiles = files.filter(f => extname(f.path) === '.css');\n \n const jsSize = jsFiles.reduce((sum, file) => sum + file.size, 0);\n const cssSize = cssFiles.reduce((sum, file) => sum + file.size, 0);\n \n console.log(chalk.bold('Summary:'));\n console.log(chalk.gray(' Total Size:'), formatBytes(totalSize));\n console.log(chalk.gray(' JavaScript:'), formatBytes(jsSize), chalk.dim(`(${jsFiles.length} files)`));\n console.log(chalk.gray(' CSS: '), formatBytes(cssSize), chalk.dim(`(${cssFiles.length} files)`));\n console.log(chalk.gray(' Other: '), formatBytes(totalSize - jsSize - cssSize));\n \n console.log(chalk.bold('\\nLargest Files:'));\n files.slice(0, 10).forEach((file) => {\n const sizeStr = formatBytes(file.size).padStart(10);\n console.log(chalk.gray(` ${sizeStr}`), file.path);\n });\n \n // Bundle size recommendations\n console.log(chalk.bold('\\n💡 Recommendations:'));\n \n if (totalSize > 1024 * 1024) {\n console.log(chalk.yellow(' ⚠ Total bundle size is large (> 1MB)'));\n console.log(chalk.gray(' Consider code splitting or lazy loading'));\n }\n \n if (jsSize > 500 * 1024) {\n console.log(chalk.yellow(' ⚠ JavaScript bundle is large (> 500KB)'));\n console.log(chalk.gray(' Consider:'));\n console.log(chalk.gray(' - Tree shaking unused code'));\n console.log(chalk.gray(' - Lazy loading components'));\n console.log(chalk.gray(' - Using dynamic imports'));\n }\n \n if (files.length > 100) {\n console.log(chalk.yellow(` ⚠ Large number of files (${files.length})`));\n console.log(chalk.gray(' Consider bundling or combining files'));\n }\n \n console.log('');\n}\n\n/**\n * Analyze render performance (placeholder for now)\n */\nasync function analyzeRenderPerformance() {\n console.log(chalk.bold('\\n⚡ Render Performance Analysis\\n'));\n \n console.log(chalk.gray('Performance analysis features:'));\n console.log(chalk.gray(' ✓ Expression caching enabled'));\n console.log(chalk.gray(' ✓ Component memoization available'));\n console.log(chalk.gray(' ✓ Virtual scrolling support for large lists'));\n \n console.log(chalk.bold('\\n💡 Performance Tips:'));\n console.log(chalk.gray(' • Use virtual scrolling for lists > 100 items'));\n console.log(chalk.gray(' • Cache frequently evaluated expressions'));\n console.log(chalk.gray(' • Use React.memo for expensive components'));\n console.log(chalk.gray(' • Implement pagination for large datasets'));\n console.log(chalk.gray(' • Use code splitting for large apps'));\n \n console.log('');\n}\n\n/**\n * Format bytes to human-readable string\n */\nfunction formatBytes(bytes: number): string {\n if (bytes === 0) return '0 B';\n \n const k = 1024;\n const sizes = ['B', 'KB', 'MB', 'GB'];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n \n return `${(bytes / Math.pow(k, i)).toFixed(2)} ${sizes[i]}`;\n}\n\n/**\n * Analyze application performance\n * \n * @param options - Analysis options\n */\nexport async function analyze(options: AnalyzeOptions = {}) {\n console.log(chalk.blue('🔍 ObjectUI Performance Analyzer\\n'));\n\n const runAll = !options.bundleSize && !options.renderPerformance;\n \n if (options.bundleSize || runAll) {\n await analyzeBundleSize();\n }\n \n if (options.renderPerformance || runAll) {\n await analyzeRenderPerformance();\n }\n \n console.log(chalk.green('✓ Analysis complete!\\n'));\n}\n"],"mappings":";;;;;;;;;;;;;AAQA,SAAS,eAAe;AACxB,OAAOA,aAAW;;;ACDlB,SAAS,oBAAoB;AAC7B,OAAO,WAAW;AAClB,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AACrB,OAAO,WAAW;AAClB,SAAS,gBAAgB;AAWzB,eAAsB,IAAI,YAAoB,SAAqB;AACjE,QAAM,MAAM,QAAQ,IAAI;AAKxB,QAAM,SAAS,qBAAqB,KAAK,UAAU;AACnD,sBAAoB,QAAQ,GAAG;AAG/B,QAAM,SAAS,KAAK,KAAK,eAAe;AACxC,YAAU,QAAQ,EAAE,WAAW,KAAK,CAAC;AAGrC,MAAI,OAAO,SAAS,UAAU;AAC5B,6BAAyB,QAAQ,OAAO,QAAQ,OAAO,SAAS;AAAA,EAClE,OAAO;AACL,kBAAc,QAAQ,OAAO,MAAM;AAAA,EACrC;AAIA,QAAM,aAAa,gBAAgB,GAAG;AAEtC,MAAI,YAAY;AACd,YAAQ,IAAI,MAAM,KAAK,uDAAgD,CAAC;AAAA,EAC1E,OAAO;AACL,YAAQ,IAAI,MAAM,KAAK,sCAA+B,CAAC;AACvD,YAAQ,IAAI,MAAM,IAAI,0CAA0C,CAAC;AACjE,QAAI;AACF,eAAS,yCAAyC;AAAA,QAChD,KAAK;AAAA,QACL,OAAO;AAAA,MACT,CAAC;AACD,cAAQ,IAAI,MAAM,MAAM,+BAA0B,CAAC;AAAA,IACrD,QAAQ;AACN,YAAM,IAAI,MAAM,sFAAsF;AAAA,IACxG;AAAA,EACF;AAEA,UAAQ,IAAI,MAAM,MAAM,mC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A,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEA,IA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AAO,wBAAwB,4BAA4B,EAC3D,OAAO,OAAO,YAAY;AACzB,MAAI;AACF,UAAM,QAAQ,OAAO;AAAA,EACvB,SAAS,OAAO;AACd,YAAQ,MAAMA,QAAM,IAAI,QAAQ,GAAG,iBAAiB,QAAQ,MAAM,UAAU,KAAK;AACjF,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAGH,QAAQ,MAAM;","names":["chalk","react","mkdirSync","join","chalk","execSync","chalk","join","mkdirSync","execSync","react","existsSync","join","resolve","chalk","execSync","existsSync","join","chalk","execSync","existsSync","join","chalk","chalk","existsSync","mkdirSync","join","chalk","existsSync","join","chalk","chalk","existsSync","join","resolve","dirname","__filename","__dirname","chalk","readFileSync","join","chalk","readFileSync","join","chalk","readFileSync","existsSync","resolve","chalk","resolve","existsSync","readFileSync","chalk","spawn","resolve","dirname","fileURLToPath","chalk","existsSync","resolve","join","readFileSync","fileURLToPath","dirname","join","__filename","__dirname","chalk"]}
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts","../src/commands/dev.ts","../src/commands/build.ts","../src/commands/start.ts","../src/commands/generate.ts","../src/commands/doctor.ts","../src/commands/check.ts","../src/utils/issue-path.ts","../src/utils/known-schema-types.ts","../src/utils/known-type-case-suggestion.ts","../src/utils/unbindable-text-expressions.ts","../src/commands/validate.ts","../src/utils/spec-vocabulary-hint.ts","../src/utils/union-arm-diagnostics.ts","../src/commands/analyze.ts"],"sourcesContent":["#!/usr/bin/env node\n/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\nimport { Command } from 'commander';\nimport chalk from 'chalk';\nimport { serve } from './commands/serve.js';\nimport { init } from './commands/init.js';\nimport { dev } from './commands/dev.js';\nimport { buildApp } from './commands/build.js';\nimport { start } from './commands/start.js';\nimport { generate } from './commands/generate.js';\nimport { doctor } from './commands/doctor.js';\nimport { check } from './commands/check.js';\nimport { validate } from './commands/validate.js';\nimport { analyze } from './commands/analyze.js';\nimport { readFileSync } from 'fs';\nimport { fileURLToPath } from 'url';\nimport { dirname, join } from 'path';\n\nconst __filename = fileURLToPath(import.meta.url);\nconst __dirname = dirname(__filename);\n\n// Read package.json for version\nconst packageJson = JSON.parse(\n readFileSync(join(__dirname, '../package.json'), 'utf-8')\n);\n\nconst program = new Command();\n\nprogram\n .name('objectui')\n .description('CLI tool for Object UI - Build applications from JSON schemas')\n .version(packageJson.version);\n\nprogram\n .command('serve')\n .description('Start a development server with your JSON/YAML schema')\n .argument('[schema]', 'Path to JSON/YAML schema file, or a project / pages directory', 'app.json')\n .option('-p, --port <port>', 'Port to run the server on', '3000')\n .option('-h, --host <host>', 'Host to bind the server to', 'localhost')\n .option('--no-open', 'Do not open browser automatically')\n .action(async (schema, options) => {\n try {\n await serve(schema, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('dev')\n .description('Start development server (alias for serve)')\n .argument('[schema]', 'Path to JSON/YAML schema file, or a project / pages directory', 'app.json')\n .option('-p, --port <port>', 'Port to run the server on', '3000')\n .option('-h, --host <host>', 'Host to bind the server to', 'localhost')\n .option('--no-open', 'Do not open browser automatically')\n .action(async (schema, options) => {\n try {\n await dev(schema, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('build')\n .description('Build application for production')\n .argument('[schema]', 'Path to JSON/YAML schema file, or a project / pages directory', 'app.json')\n .option('-o, --out-dir <dir>', 'Output directory', 'dist')\n .option('--clean', 'Clean output directory before build', false)\n .action(async (schema, options) => {\n try {\n await buildApp(schema, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('start')\n .description('Start production server')\n .option('-p, --port <port>', 'Port to run the server on', '3000')\n .option('-h, --host <host>', 'Host to bind the server to', '0.0.0.0')\n .option('-d, --dir <dir>', 'Directory to serve', 'dist')\n .action(async (options) => {\n try {\n await start(options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('init')\n .description('Initialize a new Object UI application with sample schema')\n .argument('[name]', 'Application name', 'my-app')\n .option('-t, --template <template>', 'Template to use (dashboard, form, simple)', 'dashboard')\n .action(async (name, options) => {\n try {\n await init(name, options);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('generate')\n .alias('g')\n .description('Generate new resources (objects, pages, plugins)')\n .argument('<type>', 'Type of resource to generate (resource/object, page, plugin)')\n .argument('<name>', 'Name of the resource')\n .action(async (type, name) => {\n try {\n await generate(type, name);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('doctor')\n .description('Diagnose common project setup issues (reports only, changes nothing)')\n .action(async () => {\n try {\n await doctor();\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('check')\n .description('Advisory JSON file sweep; run objectui validate for a verdict')\n .action(async () => {\n try {\n await check();\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('validate')\n .description('Validate a schema file against ObjectUI specifications')\n .argument('[schema]', 'Path to schema file (JSON or YAML)', 'app.json')\n .action(async (schema) => {\n try {\n await validate(schema);\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\nprogram\n .command('analyze')\n .description('Analyze application performance')\n .action(async () => {\n try {\n await analyze();\n } catch (error) {\n console.error(chalk.red('Error:'), error instanceof Error ? error.message : error);\n process.exit(1);\n }\n });\n\n\nprogram.parse();\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { createServer } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport { mkdirSync } from 'fs';\nimport { join } from 'path';\nimport chalk from 'chalk';\nimport { execSync } from 'child_process';\nimport { createTempAppWithRouting, createTempApp } from '../utils/app-generator.js';\nimport { reportProjectSource, resolveProjectSource } from '../utils/project-source.js';\nimport { isWorkspaceRoot, prepareWorkspaceTempApp } from '../utils/workspace-vite.js';\n\ninterface DevOptions {\n port: string;\n host: string;\n open?: boolean;\n}\n\nexport async function dev(schemaPath: string, options: DevOptions) {\n const cwd = process.cwd();\n\n // What this invocation names — the project root, the routes, the app config —\n // resolved by the helper all three commands share, so `dev`, `serve` and\n // `build` cannot answer the same invocation differently (objectui#4923).\n const source = resolveProjectSource(cwd, schemaPath);\n reportProjectSource(source, cwd);\n\n // Create temporary app directory (always in cwd to keep node_modules access)\n const tmpDir = join(cwd, '.objectui-tmp');\n mkdirSync(tmpDir, { recursive: true });\n\n // Create temporary app files\n if (source.mode === 'routes') {\n createTempAppWithRouting(tmpDir, source.routes, source.appConfig);\n } else {\n createTempApp(tmpDir, source.schema);\n }\n\n\n // Install dependencies\n const isMonorepo = isWorkspaceRoot(cwd);\n\n if (isMonorepo) {\n console.log(chalk.blue('📦 Detected monorepo - using root node_modules'));\n } else {\n console.log(chalk.blue('📦 Installing dependencies...'));\n console.log(chalk.dim(' This may take a moment on first run...'));\n try {\n execSync('npm install --silent --prefer-offline', { \n cwd: tmpDir, \n stdio: 'inherit',\n });\n console.log(chalk.green('✓ Dependencies installed'));\n } catch {\n throw new Error('Failed to install dependencies. Please check your internet connection and try again.');\n }\n }\n\n console.log(chalk.green('✓ Schema loaded successfully'));\n console.log(chalk.blue('🚀 Starting development server...\\n'));\n\n // Everything the temp app needs to resolve platform packages from workspace\n // source — the alias table, and the PostCSS pipeline that replaces the\n // generated config file. Shared with `serve` and `build` so the three cannot\n // drift apart (objectui#3890); see `utils/workspace-vite.ts`.\n if (isMonorepo) {\n console.log(chalk.blue('📦 Detected monorepo - configuring workspace aliases'));\n }\n const workspaceConfig = isMonorepo ? await prepareWorkspaceTempApp(cwd, tmpDir) : {};\n\n // Create Vite config\n const viteConfig: any = {\n root: tmpDir,\n server: {\n port: parseInt(options.port),\n host: options.host,\n open: options.open !== false,\n fs: {\n // Allow serving files from workspace root\n allow: [cwd],\n }\n },\n plugins: [react()],\n ...workspaceConfig,\n };\n\n // Create Vite server\n const server = await createServer(viteConfig);\n\n await server.listen();\n\n const { port, host } = server.config.server;\n const protocol = server.config.server.https ? 'https' : 'http';\n const displayHost = host === '0.0.0.0' ? 'localhost' : host;\n\n console.log();\n console.log(chalk.green('✓ Development server started successfully!'));\n console.log();\n console.log(chalk.bold(' Local: ') + chalk.cyan(`${protocol}://${displayHost}:${port}`));\n console.log();\n console.log(chalk.dim(' Press Ctrl+C to stop the server'));\n console.log();\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { build as viteBuild } from 'vite';\nimport react from '@vitejs/plugin-react';\nimport { existsSync, mkdirSync, cpSync, rmSync } from 'fs';\nimport { join, resolve } from 'path';\nimport chalk from 'chalk';\nimport { execSync } from 'child_process';\nimport { createTempAppWithRouting, createTempApp } from '../utils/app-generator.js';\nimport { reportProjectSource, resolveProjectSource } from '../utils/project-source.js';\nimport { isWorkspaceRoot, prepareWorkspaceTempApp } from '../utils/workspace-vite.js';\n\ninterface BuildOptions {\n outDir?: string;\n clean?: boolean;\n}\n\nexport async function buildApp(schemaPath: string, options: BuildOptions) {\n const cwd = process.cwd();\n const outDir = options.outDir || 'dist';\n const outputPath = resolve(cwd, outDir);\n \n console.log(chalk.blue('🔨 Building application for production...'));\n console.log();\n \n // What this invocation names — the project root, the routes, the app config —\n // resolved by the helper all three commands share. This command used to look\n // for a pages/ directory under cwd and nowhere else, so from any directory\n // above the project it emitted a bundle with the app config rendered as the\n // page schema, exit 0 (objectui#4923).\n const source = resolveProjectSource(cwd, schemaPath);\n reportProjectSource(source, cwd);\n\n // Create temporary app directory\n const tmpDir = join(cwd, '.objectui-tmp');\n mkdirSync(tmpDir, { recursive: true });\n\n // Create temporary app files\n if (source.mode === 'routes') {\n createTempAppWithRouting(tmpDir, source.routes, source.appConfig);\n } else {\n createTempApp(tmpDir, source.schema);\n }\n\n // Install dependencies\n const isMonorepo = isWorkspaceRoot(cwd);\n\n if (isMonorepo) {\n console.log(chalk.blue('📦 Detected monorepo - using root node_modules'));\n } else {\n console.log(chalk.blue('📦 Installing dependencies...'));\n try {\n execSync('npm install --silent --prefer-offline', {\n cwd: tmpDir,\n stdio: 'pipe',\n });\n console.log(chalk.green('✓ Dependencies installed'));\n } catch {\n throw new Error('Failed to install dependencies. Please check your internet connection and try again.');\n }\n }\n\n // Everything the temp app needs to resolve platform packages from workspace\n // source — the alias table, and the PostCSS pipeline that replaces the\n // generated config file. Shared with `dev` and `serve` so the three cannot\n // drift apart (objectui#3890); see `utils/workspace-vite.ts`.\n if (isMonorepo) {\n console.log(chalk.blue('📦 Detected monorepo - configuring workspace aliases'));\n }\n const workspaceConfig = isMonorepo ? await prepareWorkspaceTempApp(cwd, tmpDir) : {};\n\n console.log(chalk.blue('⚙️ Building with Vite...'));\n console.log();\n\n // Clean output directory if requested\n if (options.clean && existsSync(outputPath)) {\n console.log(chalk.dim(` Cleaning ${outDir}/ directory...`));\n rmSync(outputPath, { recursive: true, force: true });\n }\n\n // Build with Vite\n try {\n await viteBuild({\n root: tmpDir,\n build: {\n outDir: join(tmpDir, 'dist'),\n emptyOutDir: true,\n reportCompressedSize: true,\n },\n plugins: [react()],\n logLevel: 'info',\n ...workspaceConfig,\n });\n\n // Copy built files to output directory\n mkdirSync(outputPath, { recursive: true });\n cpSync(join(tmpDir, 'dist'), outputPath, { recursive: true });\n\n console.log();\n console.log(chalk.green('✓ Build completed successfully!'));\n console.log();\n console.log(chalk.bold(' Output: ') + chalk.cyan(outDir + '/'));\n console.log();\n console.log(chalk.dim(' To serve the production build, run:'));\n console.log(chalk.cyan(` objectui start --dir ${outDir}`));\n console.log();\n } catch (error) {\n // The caught error's message is inlined below. We can't pass it as the\n // `Error` `cause` option because this package targets ES2020, whose lib\n // types the 1-arg `Error` constructor only; hence the scoped disable.\n // eslint-disable-next-line preserve-caught-error\n throw new Error(`Build failed: ${error instanceof Error ? error.message : error}`);\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport express from 'express';\nimport rateLimit from 'express-rate-limit';\nimport { existsSync } from 'fs';\nimport { join, resolve } from 'path';\nimport chalk from 'chalk';\n\ninterface StartOptions {\n port: string;\n host: string;\n dir?: string;\n}\n\nexport async function start(options: StartOptions) {\n const cwd = process.cwd();\n const distDir = options.dir || 'dist';\n const distPath = resolve(cwd, distDir);\n\n // Check if dist directory exists\n if (!existsSync(distPath)) {\n throw new Error(\n `Build directory not found: ${distDir}\\n` +\n `Run 'objectui build' first to create a production build.`\n );\n }\n\n // Check if index.html exists\n const indexPath = join(distPath, 'index.html');\n if (!existsSync(indexPath)) {\n throw new Error(\n `index.html not found in ${distDir}/\\n` +\n `Make sure you have a valid production build.`\n );\n }\n\n console.log(chalk.blue('🚀 Starting production server...\\n'));\n\n const app = express();\n const port = parseInt(options.port);\n const host = options.host;\n\n // Configure rate limiting to prevent abuse\n const limiter = rateLimit({\n windowMs: 15 * 60 * 1000, // 15 minutes\n max: 1000, // Limit each IP to 1000 requests per windowMs\n message: 'Too many requests from this IP, please try again later.',\n standardHeaders: true, // Return rate limit info in the `RateLimit-*` headers\n legacyHeaders: false, // Disable the `X-RateLimit-*` headers\n });\n\n // Apply rate limiting to all routes\n app.use(limiter);\n\n // Serve static files from dist directory\n app.use(express.static(distPath));\n\n // SPA fallback - serve index.html for all routes\n app.get('*', (_req, res) => {\n res.sendFile(indexPath);\n });\n\n // Start server\n app.listen(port, host, () => {\n const protocol = 'http';\n const displayHost = host === '0.0.0.0' ? 'localhost' : host;\n\n console.log(chalk.green('✓ Production server started successfully!'));\n console.log();\n console.log(chalk.bold(' Local: ') + chalk.cyan(`${protocol}://${displayHost}:${port}`));\n console.log(chalk.bold(' Serving: ') + chalk.dim(distDir + '/'));\n console.log();\n console.log(chalk.dim(' Press Ctrl+C to stop the server'));\n console.log();\n });\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { existsSync, mkdirSync, writeFileSync } from 'fs';\nimport { join } from 'path';\n\nexport async function generate(type: string, name: string) {\n const cwd = process.cwd();\n\n switch (type) {\n case 'resource':\n case 'object':\n generateResource(cwd, name);\n break;\n case 'page':\n generatePage(cwd, name);\n break;\n case 'plugin':\n generatePlugin(cwd, name);\n break;\n default:\n console.log(chalk.red(`Unknown type: ${type}`));\n console.log(`Available types: resource, page, plugin`);\n process.exit(1);\n }\n}\n\nfunction generateResource(cwd: string, name: string) {\n const dir = join(cwd, 'objects');\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n\n const fileName = `${name.toLowerCase()}.json`;\n const filePath = join(dir, fileName);\n\n if (existsSync(filePath)) {\n console.log(chalk.yellow(`Object ${name} already exists at ${filePath}`));\n return;\n }\n\n const content = {\n name: name,\n fields: {\n name: { type: 'text', label: 'Name', required: true }\n }\n };\n\n writeFileSync(filePath, JSON.stringify(content, null, 2));\n console.log(chalk.green(`✓ Generated resource schema: ${filePath}`));\n}\n\nfunction generatePage(cwd: string, name: string) {\n const dir = join(cwd, 'pages');\n if (!existsSync(dir)) mkdirSync(dir, { recursive: true });\n\n const fileName = `${name.toLowerCase()}.json`;\n const filePath = join(dir, fileName);\n\n if (existsSync(filePath)) {\n console.log(chalk.yellow(`Page ${name} already exists at ${filePath}`));\n return;\n }\n\n // A page with no `pageType` is a `record` page, which draws neither `title`\n // nor `description`; `app` draws `title` as the page's one `h1`. So the\n // markdown under it opens with prose, not a `#` heading that would draw a\n // second `h1` (one page, one h1: objectui#3434; objectui#11450).\n const content = {\n type: \"page\",\n pageType: \"app\",\n title: name,\n children: [\n {\n type: \"markdown\",\n content: `Welcome to ${name}`\n }\n ]\n };\n\n writeFileSync(filePath, JSON.stringify(content, null, 2));\n console.log(chalk.green(`✓ Generated page schema: ${filePath}`));\n}\n\nfunction generatePlugin(cwd: string, name: string) {\n const dir = join(cwd, 'plugins', name);\n if (existsSync(dir)) {\n console.log(chalk.yellow(`Plugin ${name} already exists`));\n return;\n }\n mkdirSync(dir, { recursive: true });\n\n const content = `\nexport const ${name}Plugin = {\n name: '${name}',\n install(app) {\n console.log('${name} plugin installed');\n }\n};\n`;\n\n writeFileSync(join(dir, 'index.ts'), content.trim());\n console.log(chalk.green(`✓ Generated plugin: ${dir}`));\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * `objectui doctor` — project health diagnosis.\n *\n * ## Tailwind: v4-only, because this repo is v4-only (objectui#3891)\n *\n * The Tailwind section used to be written against Tailwind 3 and got every\n * question backwards on a v4 project:\n *\n * - It counted a **missing `tailwind.config.js` as an issue**. In v4 that file\n * is not part of the setup at all — the engine reads CSS-first configuration\n * (`@import 'tailwindcss'`, `@theme`, `@source`) and only looks at a JS\n * config when a stylesheet explicitly opts in with `@config`. So the advice\n * pushed readers toward creating a file Tailwind would never read. Running\n * `objectui doctor` at this repo's own root reproduced it: there is no root\n * `tailwind.config.*`, and doctor reported a problem that did not exist.\n * - It then graded that file on its **`content` array**, the v3 key that\n * `@source` replaced. The two `tailwind.config.*` files still tracked in this\n * repo (`apps/console`, `examples/byo-backend-console`) are exactly this\n * trap: both declare `content: ['./src/**\\/*.{ts,tsx}', …]`, no stylesheet\n * anywhere in the repo contains `@config`, so both files are inert — and the\n * old check answered \"✓ Tailwind content paths configured\" for them. A false\n * green on a dead file is worse than silence.\n * - It **never checked `@tailwindcss/postcss`**, which is the one dependency a\n * v4 project genuinely cannot build without. v4 moved the PostCSS plugin out\n * of `tailwindcss` into that separate package; naming the old `tailwindcss`\n * key in a PostCSS config resolves to a shim whose only job is to throw. That\n * is the failure form objectui#3852 measured on the generated app, and doctor\n * happily printed \"✓ Tailwind CSS installed\" through it.\n *\n * So the checks below are the v4 contract, matching what `objectui init`\n * scaffolds (see `utils/app-generator.ts`): `@tailwindcss/postcss` available, a\n * PostCSS config that names it rather than the v3 `tailwindcss` key, and a CSS\n * entry that runs `@import 'tailwindcss'`. A missing `tailwind.config.*` is\n * **not** reported; a *present* one is reported only when nothing opts into it\n * via `@config`, which is the case where it silently does nothing.\n *\n * A v3-tolerant dual path (branching on the declared `tailwindcss` major and\n * running two sets of checks) was considered and deliberately not built — it\n * widens the product surface past this repo's v4-only posture. v3 spellings are\n * therefore diagnosed as *migration debt*, not supported as a second mode.\n *\n * ## Structure\n *\n * `runDiagnostics(cwd)` is the whole diagnosis and returns structured results;\n * `doctor()` only renders them and counts. Splitting the two is what makes the\n * matrix above testable against real fixture directories instead of scraped\n * console output.\n */\n\nimport chalk from 'chalk';\nimport { existsSync, readFileSync } from 'fs';\nimport { dirname, join, resolve as resolvePath } from 'path';\n\n/** `ok` never counts toward the issue total; `warn` and `error` both do. */\nexport type DiagnosticLevel = 'ok' | 'warn' | 'error';\n\nexport interface Diagnostic {\n level: DiagnosticLevel;\n /** The single line rendered for this finding. */\n message: string;\n /**\n * Stable identifier for the finding, so tests (and any future machine\n * readable output) pin the *verdict* rather than prose wording.\n */\n id: string;\n}\n\n/**\n * CSS entrypoint candidates, in the order doctor prefers them. `src/index.css`\n * is first because that is what `objectui init` generates; the rest cover the\n * common Vite / Next.js / plain layouts. Every candidate that exists is read —\n * the Tailwind verdicts below ask \"does *any* entry do this\", so a project with\n * several stylesheets is not judged on whichever one happens to sort first.\n */\nconst CSS_ENTRY_CANDIDATES = [\n 'src/index.css',\n 'src/main.css',\n 'src/styles.css',\n 'src/style.css',\n 'src/app.css',\n 'src/global.css',\n 'src/globals.css',\n 'app/globals.css',\n 'app/global.css',\n 'styles/globals.css',\n 'index.css',\n 'styles.css',\n];\n\nconst TAILWIND_CONFIG_CANDIDATES = [\n 'tailwind.config.js',\n 'tailwind.config.cjs',\n 'tailwind.config.mjs',\n 'tailwind.config.ts',\n];\n\nconst POSTCSS_CONFIG_CANDIDATES = [\n 'postcss.config.js',\n 'postcss.config.cjs',\n 'postcss.config.mjs',\n 'postcss.config.ts',\n];\n\n/** `@import 'tailwindcss'` — the v4 entrypoint, with or without a `layer()`. */\nconst V4_CSS_IMPORT = /@import\\s+[\"']tailwindcss[\"']/;\n/** `@tailwind base;` / `components` / `utilities` — the v3 directives. */\nconst V3_CSS_DIRECTIVE = /@tailwind\\s+(?:base|components|utilities|screens|variants)\\b/;\nconst CSS_SOURCE_DIRECTIVE = /@source\\s+[\"']/;\nconst CSS_CONFIG_DIRECTIVE = /@config\\s+[\"']/;\n\n/**\n * The v4 PostCSS plugin, in either object (`'@tailwindcss/postcss': {}`) or\n * array (`require('@tailwindcss/postcss')`) form.\n */\nconst V4_POSTCSS_PLUGIN = /@tailwindcss\\/postcss/;\n/**\n * The v3 spelling: `tailwindcss` named as a plugin itself, in either the\n * quoted (`'tailwindcss': {}`, `require('tailwindcss')`) or the bare-key\n * (`tailwindcss: {}`) form.\n *\n * Neither alternative can match inside `'@tailwindcss/postcss'`: the quoted one\n * needs a quote immediately before `tailwindcss` and finds `@`, and the bare\n * one needs a key boundary before it and a `:` after it, where the scoped name\n * has `@` and `/`. That non-match is pinned by a test — it is the difference\n * between diagnosing a v3 config and having every healthy v4 project\n * self-report.\n */\nconst V3_POSTCSS_PLUGIN = /[\"']tailwindcss[\"']|(?:^|[{,\\s])tailwindcss\\s*:/m;\n\nfunction readIfExists(path: string): string | null {\n try {\n return existsSync(path) ? readFileSync(path, 'utf-8') : null;\n } catch {\n return null;\n }\n}\n\n/** First existing path from `candidates`, relative to `cwd`. */\nfunction findFile(cwd: string, candidates: readonly string[]): string | null {\n for (const rel of candidates) {\n const abs = join(cwd, rel);\n if (existsSync(abs)) return abs;\n }\n return null;\n}\n\n/**\n * Leading major of a dependency range. Returns `null` for anything without a\n * usable number — `workspace:*`, `catalog:`, a git URL, `latest` — because\n * \"cannot tell\" must not be reported as \"wrong version\".\n */\nfunction majorOf(range: string): number | null {\n const match = /(\\d+)/.exec(range);\n if (!match) return null;\n const major = Number.parseInt(match[1], 10);\n return Number.isNaN(major) ? null : major;\n}\n\n/**\n * Is `specifier` installed for this project — i.e. present in a `node_modules`\n * at `cwd` or any ancestor?\n *\n * Declaration in `package.json` is the primary signal, but it is not the only\n * valid setup: inside a workspace the plugin is frequently installed by a\n * parent while the leaf `package.json` stays silent. Checking the tree is what\n * keeps this from replacing objectui#3891's false positive with a new one on\n * every workspace package.\n *\n * Deliberately a manual walk rather than `createRequire(…).resolve()`, even\n * though the latter looks more authoritative. Node's resolver also consults\n * `NODE_PATH` and the global folders, and `NODE_PATH` is not hypothetical\n * here: vitest sets it to pnpm's virtual store (`node_modules/.pnpm/…`), so\n * under test *every* package in the monorepo resolves from *any* directory —\n * including a fresh `os.tmpdir()` fixture with an empty `package.json`. That\n * made the \"plugin is missing\" branch unreachable in tests and would have\n * shipped it unverified. The walk below answers the question a bundler\n * actually asks and depends on nothing but the filesystem.\n */\nfunction isInstalledFrom(cwd: string, specifier: string): boolean {\n let dir = resolvePath(cwd);\n for (;;) {\n if (existsSync(join(dir, 'node_modules', ...specifier.split('/')))) return true;\n const parent = dirname(dir);\n if (parent === dir) return false;\n dir = parent;\n }\n}\n\n/**\n * Run every diagnostic against `cwd` and return the findings in render order.\n * Pure with respect to stdout — see the module docblock.\n */\nexport function runDiagnostics(cwd: string): Diagnostic[] {\n const results: Diagnostic[] = [];\n const ok = (id: string, message: string): void => {\n results.push({ id, level: 'ok', message });\n };\n const warn = (id: string, message: string): void => {\n results.push({ id, level: 'warn', message });\n };\n const error = (id: string, message: string): void => {\n results.push({ id, level: 'error', message });\n };\n\n // ---------------------------------------------------------------- package.json\n const pkgPath = join(cwd, 'package.json');\n const pkgRaw = readIfExists(pkgPath);\n let pkg: Record<string, Record<string, string> | undefined> | null = null;\n\n if (pkgRaw === null) {\n error('package-json-missing', 'package.json not found');\n } else {\n try {\n pkg = JSON.parse(pkgRaw);\n } catch {\n error('package-json-unreadable', 'Failed to parse package.json');\n }\n }\n\n const deps: Record<string, string> = pkg\n ? { ...(pkg.dependencies ?? {}), ...(pkg.devDependencies ?? {}) }\n : {};\n\n if (pkg) {\n if (deps.react) {\n ok('react-installed', 'React installed');\n } else {\n warn('react-missing', 'React not found in dependencies');\n }\n }\n\n // -------------------------------------------------------------------- Tailwind\n //\n // Everything below is gated on the project declaring `tailwindcss` at all. A\n // directory that does not use Tailwind must not collect Tailwind findings —\n // the \"not found\" line above already says the one thing worth saying.\n const tailwindRange = pkg ? deps.tailwindcss : undefined;\n\n if (pkg && !tailwindRange) {\n warn('tailwind-missing', 'Tailwind CSS not found in dependencies');\n }\n\n if (tailwindRange) {\n const major = majorOf(tailwindRange);\n if (major !== null && major < 4) {\n warn(\n 'tailwind-major-legacy',\n `Tailwind CSS ${tailwindRange} detected — ObjectUI targets Tailwind 4. ` +\n 'Upgrade with `npx @tailwindcss/upgrade`, then move configuration into ' +\n \"your CSS entry (`@import 'tailwindcss'`, `@theme`, `@source`).\",\n );\n } else {\n ok('tailwind-installed', `Tailwind CSS ${tailwindRange} installed`);\n }\n\n // 1. The v4 PostCSS plugin — the dependency a v4 build actually fails without.\n if (deps['@tailwindcss/postcss']) {\n ok('tailwind-postcss-declared', '@tailwindcss/postcss declared');\n } else if (isInstalledFrom(cwd, '@tailwindcss/postcss')) {\n ok(\n 'tailwind-postcss-installed',\n '@tailwindcss/postcss installed (provided by the workspace)',\n );\n } else {\n error(\n 'tailwind-postcss-missing',\n 'Tailwind CSS 4 needs @tailwindcss/postcss, which is neither declared ' +\n 'nor installed here. v4 moved the PostCSS plugin out of `tailwindcss` ' +\n 'into its own package; without it PostCSS fails to load and no ' +\n 'styles are emitted. Install it: `npm i -D @tailwindcss/postcss`.',\n );\n }\n\n // 2. The PostCSS config, when there is one, must name the v4 plugin.\n const postcssConfigPath = findFile(cwd, POSTCSS_CONFIG_CANDIDATES);\n if (postcssConfigPath) {\n const postcssConfig = readIfExists(postcssConfigPath) ?? '';\n const hasV4Plugin = V4_POSTCSS_PLUGIN.test(postcssConfig);\n // Evaluated independently of `hasV4Plugin`, not as its `else` branch: a\n // half-finished migration that lists both entries still throws on the\n // v3 one, and that is the state worth naming.\n const hasV3Plugin = V3_POSTCSS_PLUGIN.test(postcssConfig);\n\n if (hasV3Plugin) {\n error(\n 'postcss-plugin-v3',\n 'PostCSS config names `tailwindcss` as a plugin — the Tailwind 3 ' +\n 'spelling. In v4 that entry resolves to a shim whose only job is ' +\n \"to throw. Replace it with `'@tailwindcss/postcss': {}`.\",\n );\n } else if (hasV4Plugin) {\n ok('postcss-plugin-v4', 'PostCSS config uses @tailwindcss/postcss');\n } else {\n warn(\n 'postcss-plugin-absent',\n 'PostCSS config does not register a Tailwind plugin. Add ' +\n \"`'@tailwindcss/postcss': {}` so Tailwind runs during the build.\",\n );\n }\n }\n\n // 3. The CSS entry must start the v4 engine. Read every candidate that\n // exists and ask whether *any* of them does — see CSS_ENTRY_CANDIDATES.\n const cssEntries = CSS_ENTRY_CANDIDATES.map((rel) => ({\n rel,\n content: readIfExists(join(cwd, rel)),\n })).filter((entry): entry is { rel: string; content: string } => entry.content !== null);\n\n const importsTailwind = cssEntries.some((entry) => V4_CSS_IMPORT.test(entry.content));\n const usesV3Directives = cssEntries.some((entry) => V3_CSS_DIRECTIVE.test(entry.content));\n const declaresSource = cssEntries.some((entry) => CSS_SOURCE_DIRECTIVE.test(entry.content));\n const optsIntoJsConfig = cssEntries.some((entry) => CSS_CONFIG_DIRECTIVE.test(entry.content));\n\n if (cssEntries.length === 0) {\n // No recognised entrypoint — say nothing. A monorepo root or an app with\n // a bespoke CSS layout is not evidence of a misconfiguration, and\n // objectui#3891 is precisely about doctor asserting things it cannot see.\n } else if (importsTailwind) {\n ok('css-entry-v4-import', \"CSS entry runs `@import 'tailwindcss'`\");\n if (declaresSource) {\n ok('css-entry-source', 'CSS entry declares `@source` scanning paths');\n }\n } else if (usesV3Directives) {\n error(\n 'css-entry-v3-directives',\n 'CSS entry still uses the Tailwind 3 `@tailwind base/components/' +\n \"utilities` directives. Tailwind 4 replaces all three with a single \" +\n \"`@import 'tailwindcss';`.\",\n );\n } else {\n warn(\n 'css-entry-no-tailwind',\n \"No CSS entry runs `@import 'tailwindcss'`, so Tailwind never starts. \" +\n `Checked: ${cssEntries.map((entry) => entry.rel).join(', ')}.`,\n );\n }\n\n // 4. `tailwind.config.*` — absence is correct in v4 and reported as nothing\n // at all. Presence is reported only when it is inert.\n const tailwindConfigPath = findFile(cwd, TAILWIND_CONFIG_CANDIDATES);\n if (tailwindConfigPath && !optsIntoJsConfig) {\n const rel = tailwindConfigPath.slice(cwd.length + 1);\n warn(\n 'tailwind-config-inert',\n `${rel} exists but nothing opts into it — Tailwind 4 ignores a JS ` +\n 'config unless a stylesheet declares `@config`. Anything it sets ' +\n '(theme, content/@source paths, plugins) has no effect today. ' +\n 'Either delete it and move the settings into your CSS entry, or add ' +\n `\\`@config '${rel}';\\` there.`,\n );\n } else if (tailwindConfigPath) {\n ok('tailwind-config-active', 'JS Tailwind config is loaded via `@config`');\n }\n }\n\n // ------------------------------------------------------------------ TypeScript\n if (existsSync(join(cwd, 'tsconfig.json'))) {\n ok('tsconfig-found', 'tsconfig.json found');\n const tsRange = deps.typescript;\n if (tsRange) {\n const major = majorOf(tsRange);\n if (major !== null && major < 5) {\n warn('typescript-legacy', `TypeScript ${tsRange} detected — version 5.0+ recommended`);\n } else {\n ok('typescript-version', `TypeScript ${tsRange} (5.0+ required)`);\n }\n }\n } else {\n warn('tsconfig-missing', 'tsconfig.json not found');\n }\n\n // -------------------------------------------------------------- Peer contracts\n if (pkg) {\n if (deps['@object-ui/react'] && !deps.react) {\n warn('peer-react', '@object-ui/react requires react as a peer dependency');\n }\n if (deps['@object-ui/components'] && !deps.tailwindcss) {\n warn('peer-tailwind', '@object-ui/components requires tailwindcss as a peer dependency');\n }\n }\n\n return results;\n}\n\n/** Number of findings that count as problems. `ok` findings never do. */\nexport function countIssues(results: readonly Diagnostic[]): number {\n return results.filter((result) => result.level !== 'ok').length;\n}\n\nexport async function doctor() {\n console.log(chalk.bold('Object UI Doctor'));\n console.log('Diagnosis in progress...\\n');\n\n const results = runDiagnostics(process.cwd());\n\n for (const result of results) {\n if (result.level === 'ok') {\n console.log(chalk.green(`✓ ${result.message}`));\n } else if (result.level === 'warn') {\n console.log(chalk.yellow(`⚠️ ${result.message}`));\n } else {\n console.log(chalk.red(`x ${result.message}`));\n }\n }\n\n const issues = countIssues(results);\n console.log('\\nResult:');\n if (issues === 0) {\n console.log(chalk.green('Everything looks good! ✨'));\n } else {\n console.log(chalk.yellow(`Found ${issues} issue(s).`));\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { globSync } from 'glob';\nimport { readFileSync } from 'fs';\nimport { join } from 'path';\nimport { parse as parseJsonc, printParseErrorCode, type ParseError } from 'jsonc-parser';\nimport { safeValidateSchema } from '@object-ui/types/zod';\n\nimport { formatIssuePath } from '../utils/issue-path.js';\nimport { isKnownSchemaType } from '../utils/known-schema-types.js';\nimport { didYouMeanClause } from '../utils/known-type-case-suggestion.js';\nimport {\n describeUnbindableTextExpression,\n findUnbindableTextExpressions,\n workingChannels,\n} from '../utils/unbindable-text-expressions.js';\n\n/**\n * Root keys that positively identify a file as an ObjectUI schema node.\n *\n * Every entry is a property `BaseSchema` DECLARES — with one deliberate\n * exception, `body`, which objectui#6771 retired to a `?: never` tombstone.\n * ⛔ It stays in this list ON PURPOSE and the distinction is the whole point of\n * the list: this is a file-IDENTIFICATION marker, not an accept set. A file\n * authored under the retired spelling must still be RECOGNISED as an ObjectUI\n * node, so that the tier can refuse it by name; drop the marker and the same\n * file stops being judged at all, which is the silence the retirement ends.\n * ⇒ read this set as \"keys that identify the vocabulary\", which is a superset\n * of \"keys you may author\". Otherwise it is read out of the protocol's own\n * node contract, not invented here, and it is closed: it grows only when\n * `BaseSchema` grows.\n *\n * `BaseSchema`'s remaining properties are deliberately absent because their\n * NAMES are generic enough to head foreign root vocabularies, and a marker\n * that matches a foreign file re-creates the exact defect this gate exists to\n * remove. Measured over this repository (objectui#5127): `name` appears at the\n * root of 45 of the 46 foreign judged files and `description` at 44 — both are\n * `package.json` keys — so admitting `BaseSchema` wholesale takes the foreign\n * retention from 0 files to all 46. `id`, `label`, `data` and `type` itself are\n * held out on the same reasoning.\n */\nconst OBJECTUI_STRUCTURAL_KEYS: readonly string[] = [\n // Composition — the `children`/`body`-class keys the ruling names.\n // `body` is the RETIRED spelling, kept so old files are still identified and\n // then refused — see the docblock above (objectui#6771).\n 'body',\n 'children',\n // Presentation.\n 'className',\n 'style',\n 'placeholder',\n // Conditional rendering and interaction state.\n 'visible',\n 'visibleWhen',\n 'visibleOn',\n 'hidden',\n 'hiddenOn',\n 'disabled',\n 'disabledOn',\n // Test and accessibility handles.\n 'testId',\n 'ariaLabel',\n];\n\n/**\n * ⛔ There is deliberately NO `$schema` arm, and no ObjectUI `$schema` URL\n * exists to declare.\n *\n * An earlier revision of this file admitted a file whose root `$schema` had an\n * `objectui.org` host, completed by a canonical URL proposed for the\n * maintainer to confirm. The maintainer ruled against minting that identifier\n * (2026-08-20, objectui#5127, verbatim 「C」), superseding the `$schema` half of\n * the 2026-08-19 ruling. The structural arm below is unaffected and stands.\n *\n * - A `$schema` URL is a permanent public identifier that lives in USERS'\n * files, which no sweep can ever reach. Minting the address before the\n * document it names exists is backwards.\n * - The only consumer that needs a URL rather than any agreed marker is an\n * editor resolving `$schema` over HTTP. An agent authoring schemas instead\n * needs a contract it can read BEFORE writing — a file, and `node_modules`\n * is right there — and a good error AFTER writing, which is this command,\n * already version-correct from the installed packages.\n * - The value would be untyped, unchecked and host-matched, so an agent that\n * mis-remembered the path would be silently accepted: a version-fossil\n * generator, in files we cannot fix.\n * - Zero files declared it, in this repository or anywhere else, so the arm\n * matched nothing. Dropping it gives up no coverage that was being\n * delivered.\n *\n * Because that matching was host-based rather than literal, the arm can be\n * added later without invalidating a single file. The trigger that clause once\n * pointed at is gone: `@object-ui/types` shipping a generated JSON Schema was\n * objectui#5392, and the maintainer ruled it Option B on 2026-08-25 — no\n * shipped artifact. There is therefore no document a `$schema` URL could name,\n * and the recall that arm was being kept in reserve for is repaid instead by\n * the validity arm below, which reads the Zod schemas already in\n * `node_modules` rather than a URL fetched over HTTP.\n */\n\n/** The part of a Zod issue this command prints. */\ninterface IssueLike {\n path?: readonly PropertyKey[];\n message: string;\n}\n\ntype Recognition =\n | { recognised: true; validated: boolean }\n | { recognised: false; issues: readonly IssueLike[] };\n\n/**\n * Does this parsed file positively read as an ObjectUI schema (objectui#5127,\n * objectui#6075)?\n *\n * `type` carries at least seven unrelated vocabularies in JSON — the most\n * common of them being `package.json`'s `\"type\": \"module\"` — so the presence\n * of a root `type` is not evidence that a file is a UI schema. Before this\n * gate, `objectui check` judged every root `type` against the component-key\n * universe and the FIRST line a user saw in their own project was a warning\n * about their own `package.json`: 45 of the 46 warnings this repository\n * produced were exactly that.\n *\n * The fix is a positive marker, not a consumer-side skip list: a file is\n * judged when it is recognisable as an ObjectUI node. A list of filenames to\n * exclude was considered and rejected — it is a second hand-maintained list of\n * the shape objectui#5115 had just finished deleting, and it can only ever\n * enumerate the foreign vocabularies someone already thought of.\n *\n * There are two arms, and the ORDER is load-bearing:\n *\n * 1. The structural arm (`OBJECTUI_STRUCTURAL_KEYS`, above) — a set-membership\n * test over the parsed root, and the cheap one. It runs first so the\n * common case never pays for arm 2.\n * 2. The validity arm — the document parses as an ObjectUI component schema\n * under `@object-ui/types`' own Zod union. This is the recogniser the\n * 2026-08-25 ruling on objectui#5392 selected (Option B, no shipped schema\n * artifact): measured over this repository it admits schemas the structural\n * arm cannot see — leaf nodes that carry only their own vocabulary — while\n * refusing every `package.json`, because `\"module\"` is not a component the\n * protocol models.\n *\n * ⛔ There is deliberately no third arm reading a registered root `type`\n * alone. `{ \"name\": \"x\", \"type\": \"form\" }` is a plausible `package.json` and\n * `form` is a real component key; admitting on the type name re-creates the\n * exact defect this gate exists to remove. Recognition needs SHAPE.\n *\n * ⚠️ The validity arm couples this command's recall to `@object-ui/types`:\n * tightening a Zod schema moves files out of recognition. That is not a\n * hazard left to chance — it is the reason `check` reports a third bucket\n * rather than two (see `UNVALIDATED_CANDIDATE` below). A file that stops\n * validating stops being *judged*, but it does not stop being *mentioned*.\n *\n * The answer says WHICH arm admitted the file, because the two arms promise\n * different things (objectui#11007). The validity arm parsed the whole\n * document, nested nodes included. The structural arm parsed nothing: a page\n * whose `children` hold a refused node is admitted on `children` alone. So a\n * file the structural arm admitted is counted as \"recognised but not\n * validated\", never as a pass. ⛔ Do not close that gap by parsing it here —\n * the verdict on a document is `objectui validate`'s, and a second walk in\n * this command would duplicate it (triage ruling on objectui#11007).\n *\n * A refusal carries the validator's issues from the parse the validity arm\n * already ran, so the report below can name the first one without parsing\n * the file a second time.\n */\nfunction recogniseObjectUiSchemaFile(content: Record<string, unknown>): Recognition {\n if (OBJECTUI_STRUCTURAL_KEYS.some((key) => key in content)) {\n return { recognised: true, validated: false };\n }\n const result = safeValidateSchema(content);\n return result.success\n ? { recognised: true, validated: true }\n : { recognised: false, issues: result.error.issues };\n}\n\n/**\n * The one line `check` prints under a file that did not validate: where the\n * validator's first issue points, and what it says (objectui#11007).\n *\n * Only the first, and ⛔ no union-arm selection: the full diagnosis is\n * `objectui validate`'s, and the report sends the reader there. The count is\n * in the line so a reader who fixes this one issue knows whether it was the\n * only one. The path is spelled by `formatIssuePath`, the formatter\n * `objectui validate` prints its `Path:` lines with.\n *\n * `undefined` for an empty list, which a failed parse does not produce; the\n * caller prints nothing rather than an invented reason.\n */\nexport function describeFirstIssue(issues: readonly IssueLike[]): string | undefined {\n const [first] = issues;\n if (first === undefined) return undefined;\n const lead = issues.length === 1 ? 'Issue' : `First of ${issues.length} issues`;\n return `${lead} at ${formatIssuePath(first.path)}: ${first.message}`;\n}\n\n/** What the closing line counts, one bucket per recognition outcome. */\nexport interface CheckTally {\n /** Recognised by the validity arm: the whole document parsed. */\n validated: number;\n /** Recognised by a structural root key: never parsed by this command. */\n notValidated: number;\n /** Refused by both arms, with a registered root `type`: listed by name. */\n didNotValidate: number;\n}\n\n/**\n * The line a run with no parse errors ends on (objectui#11007).\n *\n * It used to be 「✓ All checks passed」, printed over files this command never\n * validated — a page whose nested node carries a refused key among them. An\n * AI pipeline reads a line like that as a verdict. So the line states what was\n * actually established, bucket by bucket, and sends the reader to\n * `objectui validate` for the verdict. ⛔ It says nothing that reads as a pass.\n *\n * It is printed only when nothing was refused. A run exits non-zero on\n * unreadable JSON, and on a `${…}` expression refused on a text key its node\n * never evaluates (objectui#4795).\n */\nexport function closingLine(tally: CheckTally): string {\n return (\n `ObjectUI schema files: ${tally.validated} validated, ` +\n `${tally.notValidated} recognised but not validated, ` +\n `${tally.didNotValidate} did not validate. ` +\n 'This sweep is advisory; run `objectui validate <file>` for a verdict.'\n );\n}\n\n/**\n * `UNVALIDATED_CANDIDATE` — the bucket a validity-based recogniser MUST report\n * rather than swallow (objectui#6075).\n *\n * A recogniser built on validation conflates two entirely different findings:\n * \"this file is not ours\" and \"this file is ours and it is broken\". The second\n * is the more valuable of the two — it is the thing this command exists to\n * find — and filing it under the first makes it vanish. The symptom of that\n * bug is an ABSENCE: the file simply stops being mentioned, and nothing\n * prompts a re-read.\n *\n * It is not a theoretical bucket. Measured over a clean checkout of this\n * repository at the commit that introduced this function, 100 eligible files\n * failed the validity arm; 54 of those land here, and 53 of the 54 are real\n * ObjectUI content — schema-catalog leaves such as\n * `{ \"type\": \"text\", \"content\": \"Small text\", \"variant\": \"small\" }`, whose\n * `variant` is not in `TextSchema`'s enum. Reported as foreign, all 53 would\n * have gone quiet.\n *\n * The discriminator is `isKnownSchemaType`: does the root `type` name a\n * component THIS BUILD registers? It is the same derived universe the\n * judgement arm uses, so it needs no second list, and it is the one signal\n * that separates a broken `\"type\": \"text\"` node from `\"type\": \"module\"`.\n *\n * Its cost, stated rather than hidden: a foreign document whose root `type`\n * happens to collide with a registered component key lands here. A JSON Schema\n * document with `\"type\": \"object\"` is exactly that, and this repository\n * contains one. The cost is one advisory line naming a file — not a warning\n * about the reader's `package.json`, which is the failure this gate was built\n * for. The opposite error is the one that cannot be seen.\n *\n * ⛔ This bucket is REPORTED, never counted as skipped. Moving files from the\n * skipped count into an unreported bucket would make the recall debt look\n * repaid while nothing had been repaid, which is the one outcome objectui#6075\n * names as unacceptable.\n *\n * Each entry also carries the validator's first issue (objectui#11007). A file\n * name and a type are not actionable on their own: the root `object-map` with\n * a mistyped `map` key was listed, and the key it was refused for was not.\n * The issue comes from the parse the recogniser already ran. Printing it for\n * THIS bucket only is what keeps it from flooding the report — a skipped file\n * is foreign, and its parse failure says nothing about ObjectUI.\n */\nfunction isUnvalidatedCandidate(type: string): boolean {\n return isKnownSchemaType(type);\n}\n\n/**\n * Render a `jsonc-parser` error the way `JSON.parse` renders its own: a reason,\n * then where it happened. The parser reports a byte offset; the line/column is\n * derived here because a bare offset is not actionable in an editor.\n */\nfunction describeParseError(text: string, error: ParseError): string {\n const upTo = text.slice(0, error.offset);\n const line = upTo.split('\\n').length;\n const column = error.offset - (upTo.lastIndexOf('\\n') + 1) + 1;\n return `${printParseErrorCode(error.error)} at line ${line} column ${column}`;\n}\n\n/**\n * @param cwd Directory to scan. Defaults to the process working directory,\n * which is what the `objectui check` command passes. Taking it as an\n * argument is what lets the tests scan a fixture tree without `chdir`, which\n * Vitest's worker threads do not support.\n */\nexport async function check(cwd: string = process.cwd()) {\n console.log(chalk.bold('Object UI Schema Check'));\n\n // 1. Find all JSON/YAML files\n const files = globSync('**/*.{json,yaml,yml}', {\n cwd,\n // `glob` matches `ignore` patterns against the path relative to `cwd`, so\n // an unanchored `dist/**`/`node_modules/**` excludes only a directory of\n // that name at the scan root — every nested `packages/*/dist/`,\n // `examples/*/dist/`, `apps/*/dist/` (and their `node_modules/`) is still\n // scanned. `**/` anchors the match at any depth (objectui#6320): measured\n // on this repository, a built tree without it reports roughly double the\n // files of a clean checkout, almost all of it re-reading the author's own\n // schemas from build output.\n ignore: ['**/node_modules/**', '**/dist/**', '.git/**']\n });\n \n console.log(`Analyzing ${files.length} files...`);\n \n let errors = 0;\n // Files that a root `type` string made ELIGIBLE for type judgement and that\n // no ObjectUI recogniser admitted. Reported below so the narrowed judgement\n // surface is never silent (objectui#5127) — a check that quietly stops\n // checking is worse than one that warns too loudly, because nothing prompts\n // a re-read.\n let skipped = 0;\n // The third bucket (objectui#6075): eligible files the recogniser refused\n // whose root `type` nevertheless names a component this build registers.\n // These are ObjectUI content that does not validate — a finding, not a\n // foreign file — so they are listed by name rather than folded into the\n // count above.\n const unvalidatedCandidates: {\n file: string;\n type: string;\n issues: readonly IssueLike[];\n }[] = [];\n // Recognised files, split by the arm that admitted them — the closing line\n // reports them apart because only one arm validated anything (objectui#11007).\n let validated = 0;\n let notValidated = 0;\n\n for (const file of files) {\n try {\n // Basic JSON parsing check\n if (file.endsWith('.json')) {\n // `.json` on disk means JSONC in practice — comments and trailing\n // commas are how `tsconfig.json`, `.eslintrc.json`, `devcontainer.json`\n // and VS Code's own settings are documented to be written. `JSON.parse`\n // rejected every one of them, and because a parse failure is the only\n // thing that increments `errors`, `objectui check` exited 1 in any\n // TypeScript project — 64 errors in this repository alone (objectui#5237).\n //\n // The reader is `jsonc-parser` (already shipped by `@object-ui/app-shell`),\n // NOT a comment-stripping regex: a `//` inside a string value — say a\n // URL — is not a comment, and a stripper that cannot tell the\n // difference corrupts valid files instead of reading them.\n const text = readFileSync(join(cwd, file), 'utf-8');\n const parseErrors: ParseError[] = [];\n // Comments are permitted by default; trailing commas are opt-in.\n // `allowEmptyContent` stays off so an empty `.json` is still an error,\n // exactly as `JSON.parse('')` was.\n const content = parseJsonc(text, parseErrors, { allowTrailingComma: true });\n\n // `parseJsonc` is error-TOLERANT: it recovers and returns a best-effort\n // value rather than throwing, so genuinely malformed JSON is caught by\n // consulting this array. Dropping this check would turn the fix into\n // \"never fail on anything\".\n if (parseErrors.length > 0) {\n const [first] = parseErrors;\n console.log(\n chalk.red(`x Invalid JSON in ${file}: ${describeParseError(text, first)}`)\n );\n errors++;\n continue;\n }\n\n // Schema validation: check for ObjectUI schema patterns\n if (content && typeof content === 'object' && content.type) {\n if (typeof content.type === 'string') {\n // The marker gate (objectui#5127). Only a file that positively\n // reads as an ObjectUI schema enters type judgement; every other\n // root-`type` vocabulary — `package.json`'s `\"module\"`,\n // JSON Schema's `\"object\"`, and the rest — is simply not judged.\n //\n // Note this arm is reached for `.json` only, as the parse above\n // is. The glob also matches `.yaml`/`.yml`, and those files are\n // read by neither arm, before this change or after it.\n const recognition = recogniseObjectUiSchemaFile(\n content as Record<string, unknown>\n );\n if (!recognition.recognised) {\n // Refused. Which of the two refusals is this? A file whose root\n // `type` names a registered component is ObjectUI content the\n // recogniser could not validate — say so. Everything else is\n // simply not ours.\n if (isUnvalidatedCandidate(content.type)) {\n unvalidatedCandidates.push({\n file,\n type: content.type,\n issues: recognition.issues,\n });\n } else {\n skipped++;\n }\n continue;\n }\n if (recognition.validated) {\n validated++;\n } else {\n notValidated++;\n }\n if (!isKnownSchemaType(content.type)) {\n // The known-type universe is DERIVED from the repository's\n // registration calls (see `packages/cli/src/utils/known-schema-types.ts`\n // and the script that writes it), not typed by hand. The array that\n // used to sit here had drifted both ways at once — objectui#5115.\n // objectui#5247 — the type is still UNKNOWN and still reported;\n // the clause only names the spelling that would have resolved,\n // and is empty whenever no known type differs by case alone.\n console.log(\n chalk.yellow(\n `⚠️ Unknown schema type \"${content.type}\" in ${file}` +\n didYouMeanClause(content.type)\n )\n );\n }\n // objectui#4795, ruling item 2: a `${…}` on a closed text key its\n // component node never evaluates reaches the user as literal\n // text. Refused on a registered type, warned on any other\n // (sub-rule ii). Judged on recognised files only, from either arm.\n for (const finding of findUnbindableTextExpressions(content)) {\n const line = `${file} ${describeUnbindableTextExpression(finding)}`;\n if (finding.severity === 'refusal') {\n console.log(chalk.red(`x Unevaluated expression in ${line}`));\n console.log(chalk.dim(` ${workingChannels(finding)}`));\n errors++;\n } else {\n console.log(chalk.yellow(`⚠️ Expression not judged in ${line}`));\n }\n }\n }\n }\n }\n } catch (e) {\n console.log(chalk.red(`x Invalid JSON in ${file}: ${(e as Error).message}`));\n errors++;\n }\n }\n\n // Printed BEFORE the skipped count, and per file rather than as a bare\n // number: this bucket is the one a two-bucket report would have destroyed,\n // and a count alone is not enough to act on (objectui#6075). The list is\n // uncapped for the same reason the unknown-type warnings above are — a cap\n // is a quieter way of losing the finding.\n if (unvalidatedCandidates.length > 0) {\n const n = unvalidatedCandidates.length;\n console.log(\n chalk.yellow(\n `⚠️ ${n} file${n === 1 ? '' : 's'} carr${n === 1 ? 'ies' : 'y'} a registered ObjectUI component type but did not validate as an ObjectUI schema:`\n )\n );\n for (const { file, type, issues } of unvalidatedCandidates) {\n console.log(chalk.yellow(` ${file} (type \"${type}\")`));\n // Indented under its file, so it reads as that file's reason and never\n // as another entry (objectui#11007).\n const firstIssue = describeFirstIssue(issues);\n if (firstIssue !== undefined) {\n console.log(chalk.yellow(` ${firstIssue}`));\n }\n }\n console.log(\n chalk.dim(' Run `objectui validate <file>` on any of them for the full diagnosis.')\n );\n console.log(\n chalk.dim(\n ' Either the document is off-spec, or its component type is not modelled by @object-ui/types.'\n )\n );\n console.log(\n chalk.dim(\n ' These are NOT counted as skipped: a schema that fails validation is a broken schema, not a foreign file.'\n )\n );\n }\n\n if (skipped > 0) {\n console.log(\n chalk.dim(\n `Skipped ${skipped} file${skipped === 1 ? '' : 's'} with a root \"type\" that no ObjectUI recogniser admitted.`\n )\n );\n // The hint names the marker keys by rendering the gate's OWN array, never\n // a sentence written alongside it. A hint that describes a way in that the\n // build does not honour is worse than no hint: the reader follows it,\n // nothing changes, and the command looks broken rather than narrow. The\n // previous revision of this line advised declaring a `$schema` URL — an\n // arm the 2026-08-20 ruling removed — which is exactly that failure had it\n // outlived the code it described.\n console.log(\n chalk.dim(\n ` A file is checked when its root carries an ObjectUI structural key: ${OBJECTUI_STRUCTURAL_KEYS.join(', ')}.`\n )\n );\n // The second arm, stated because the sentence above no longer describes\n // the whole predicate — and an explanation that has stopped describing\n // what the code does is the defect class objectui#6074 had just finished\n // removing from this file.\n console.log(\n chalk.dim(\n ' It is also checked when the whole document validates as an ObjectUI component schema.'\n )\n );\n }\n \n if (errors === 0) {\n console.log(\n closingLine({\n validated,\n notValidated,\n didNotValidate: unvalidatedCandidates.length,\n })\n );\n } else {\n console.log(chalk.red(`Found ${errors} errors`));\n process.exit(1);\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * How the CLI spells the place a Zod issue points at: the path's segments\n * joined with ` → `, or `(root)` when the path is empty.\n *\n * `objectui validate` prints it on every issue's `Path:` line, and\n * `objectui check` prints it on the one issue line it gives each file that did\n * not validate (objectui#11007). It is one function so the two commands cannot\n * drift into two spellings of the same place.\n *\n * `(root)` is parenthesised so it cannot be read as a real key literally named\n * `root` — a genuine path to one prints as `root`. An empty path used to drop\n * the line altogether in `validate`, silent in exactly the case a reader most\n * needs oriented (`85b495795`).\n */\nexport function formatIssuePath(path: readonly PropertyKey[] | undefined): string {\n const segments = path ?? [];\n return segments.length > 0 ? segments.join(' → ') : '(root)';\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * GENERATED FILE — do not edit by hand.\n *\n * Regenerate: node scripts/regenerate-known-schema-types.mjs\n * Pinned by: scripts/__tests__/known-schema-types-derivation-5115.test.ts\n *\n * Every component `type` this repository registers, as read out of the\n * registration calls themselves. `objectui check` uses it to decide whether a\n * schema's `type` names a component that exists.\n *\n * This list replaces a seventeen-entry array that was typed by hand into\n * `check.ts` and had drifted from the registry in both directions at once\n * (objectui#5115): it blessed `crud` and `gallery`, which nothing registers\n * and which render the OBJUI-001 \"Unknown component type\" panel, while\n * reporting 221 real bare keys — and every namespaced spelling, `view:grid`\n * included — as unknown. The header of the regeneration script carries the\n * measurements and explains why the CLI cannot simply ask `ComponentRegistry`.\n *\n * Both bare and namespaced spellings are present because both are real\n * registry keys: `register('grid', C, { namespace: 'view' })` stores\n * `view:grid` AND, unless `skipFallback` is set, bare `grid`.\n */\n\nexport const KNOWN_SCHEMA_TYPES: readonly string[] = [\n 'a',\n 'abbr',\n 'accordion',\n 'action:bar',\n 'action:button',\n 'action:group',\n 'action:icon',\n 'action:menu',\n 'address',\n 'ai-form-assist',\n 'ai-recommendations',\n 'ai:feedback',\n 'ai:input',\n 'ai:suggestion',\n 'alert',\n 'alert-dialog',\n 'app',\n 'app-schema-renderer',\n 'app-shell:cloud-connection:panel',\n 'app-shell:cloud:ai-model-status',\n 'app-shell:cloud:onboarding-next',\n 'app-shell:marketplace:installed-list',\n 'app-shell:mcp:connect-agent',\n 'app:launcher',\n 'article',\n 'aside',\n 'aspect-ratio',\n 'avatar',\n 'b',\n 'badge',\n 'bar-chart',\n 'blockquote',\n 'box',\n 'br',\n 'breadcrumb',\n 'button',\n 'button-group',\n 'calendar',\n 'calendar-view',\n 'card',\n 'carousel',\n 'chart',\n 'chart:bar',\n 'chatbot',\n 'chatbot-enhanced',\n 'chatbot-floating',\n 'checkbox',\n 'cite',\n 'cloud-connection:panel',\n 'cloud:ai-model-status',\n 'cloud:onboarding-next',\n 'cloud:plan-status',\n 'code',\n 'code-editor',\n 'collapsible',\n 'combobox',\n 'command',\n 'container',\n 'context-menu',\n 'dashboard',\n 'data-model-designer',\n 'data-table',\n 'date-picker',\n 'dd',\n 'del',\n 'detail',\n 'detail-section',\n 'detail-view',\n 'dialog',\n 'div',\n 'dl',\n 'drawer',\n 'dropdown-menu',\n 'dt',\n 'element:button',\n 'element:definition-list',\n 'element:divider',\n 'element:image',\n 'element:metadata_viewer',\n 'element:number',\n 'element:record_picker',\n 'element:repeater',\n 'element:text',\n 'element:text_input',\n 'em',\n 'email',\n 'embeddable-form',\n 'empty',\n 'field-designer',\n 'field:address',\n 'field:audio',\n 'field:auto_number',\n 'field:avatar',\n 'field:boolean',\n 'field:checkboxes',\n 'field:code',\n 'field:color',\n 'field:currency',\n 'field:date',\n 'field:datetime',\n 'field:duration',\n 'field:email',\n 'field:file',\n 'field:filter-condition',\n 'field:formula',\n 'field:geolocation',\n 'field:grid',\n 'field:html',\n 'field:image',\n 'field:json',\n 'field:location',\n 'field:lookup',\n 'field:markdown',\n 'field:master_detail',\n 'field:multiselect',\n 'field:number',\n 'field:object',\n 'field:object-ref',\n 'field:password',\n 'field:percent',\n 'field:permission-facet-link',\n 'field:phone',\n 'field:progress',\n 'field:qrcode',\n 'field:radio',\n 'field:rating',\n 'field:recipient-picker',\n 'field:richtext',\n 'field:select',\n 'field:signature',\n 'field:slider',\n 'field:summary',\n 'field:tags',\n 'field:text',\n 'field:textarea',\n 'field:time',\n 'field:tree',\n 'field:url',\n 'field:user',\n 'field:vector',\n 'field:video',\n 'figcaption',\n 'figure',\n 'file-upload',\n 'filter-builder',\n 'filter-ui',\n 'flex',\n 'footer',\n 'form',\n 'global:notifications',\n 'global:search',\n 'grid',\n 'h1',\n 'h2',\n 'h3',\n 'h4',\n 'h5',\n 'h6',\n 'header',\n 'header-bar',\n 'home',\n 'hover-card',\n 'hr',\n 'html',\n 'i',\n 'icon',\n 'image',\n 'img',\n 'input',\n 'input-otp',\n 'ins',\n 'kbd',\n 'label',\n 'layout:app-schema-renderer',\n 'layout:page:card',\n 'li',\n 'list',\n 'list-view',\n 'loading',\n 'main',\n 'mark',\n 'markdown',\n 'marketplace:installed-list',\n 'mcp:connect-agent',\n 'menubar',\n 'nav',\n 'nav:breadcrumb',\n 'nav:menu',\n 'navigation-menu',\n 'nl-query',\n 'object-calendar',\n 'object-chart',\n 'object-data-table',\n 'object-form',\n 'object-gallery',\n 'object-gantt',\n 'object-grid',\n 'object-kanban',\n 'object-manager',\n 'object-map',\n 'object-master-detail-form',\n 'object-metric',\n 'object-pivot',\n 'object-timeline',\n 'object-tree',\n 'object-view',\n 'ol',\n 'p',\n 'page',\n 'page-designer',\n 'page:accordion',\n 'page:card',\n 'page:footer',\n 'page:header',\n 'page:section',\n 'page:sidebar',\n 'page:tabs',\n 'pagination',\n 'password',\n 'pivot',\n 'plugin-calendar:calendar-view',\n 'plugin-calendar:object-calendar',\n 'plugin-charts:bar-chart',\n 'plugin-charts:chart',\n 'plugin-charts:chart:bar',\n 'plugin-charts:object-chart',\n 'plugin-chatbot:chatbot',\n 'plugin-chatbot:chatbot-enhanced',\n 'plugin-chatbot:chatbot-floating',\n 'plugin-dashboard:dashboard',\n 'plugin-dashboard:metric',\n 'plugin-dashboard:metric-card',\n 'plugin-dashboard:object-data-table',\n 'plugin-dashboard:object-metric',\n 'plugin-dashboard:object-pivot',\n 'plugin-dashboard:pivot',\n 'plugin-designer:data-model-designer',\n 'plugin-designer:field-designer',\n 'plugin-designer:object-manager',\n 'plugin-designer:page-designer',\n 'plugin-designer:process-designer',\n 'plugin-designer:report-designer',\n 'plugin-detail:detail-section',\n 'plugin-detail:detail-view',\n 'plugin-editor:code-editor',\n 'plugin-form:embeddable-form',\n 'plugin-form:object-form',\n 'plugin-form:object-master-detail-form',\n 'plugin-gantt:object-gantt',\n 'plugin-grid:object-grid',\n 'plugin-kanban:object-kanban',\n 'plugin-list:list-view',\n 'plugin-list:object-gallery',\n 'plugin-map:object-map',\n 'plugin-markdown:markdown',\n 'plugin-report:report',\n 'plugin-report:report-viewer',\n 'plugin-timeline:object-timeline',\n 'plugin-timeline:timeline',\n 'plugin-tree:object-tree',\n 'plugin-view:object-view',\n 'plugin-view:view:simple',\n 'popover',\n 'pre',\n 'process-designer',\n 'progress',\n 'protocol-placeholder:ai:feedback',\n 'protocol-placeholder:ai:input',\n 'protocol-placeholder:ai:suggestion',\n 'protocol-placeholder:app:launcher',\n 'protocol-placeholder:field:address',\n 'protocol-placeholder:field:audio',\n 'protocol-placeholder:field:avatar',\n 'protocol-placeholder:field:boolean',\n 'protocol-placeholder:field:checkboxes',\n 'protocol-placeholder:field:code',\n 'protocol-placeholder:field:color',\n 'protocol-placeholder:field:currency',\n 'protocol-placeholder:field:date',\n 'protocol-placeholder:field:datetime',\n 'protocol-placeholder:field:duration',\n 'protocol-placeholder:field:email',\n 'protocol-placeholder:field:file',\n 'protocol-placeholder:field:html',\n 'protocol-placeholder:field:image',\n 'protocol-placeholder:field:json',\n 'protocol-placeholder:field:location',\n 'protocol-placeholder:field:lookup',\n 'protocol-placeholder:field:markdown',\n 'protocol-placeholder:field:master_detail',\n 'protocol-placeholder:field:multiselect',\n 'protocol-placeholder:field:number',\n 'protocol-placeholder:field:password',\n 'protocol-placeholder:field:percent',\n 'protocol-placeholder:field:phone',\n 'protocol-placeholder:field:progress',\n 'protocol-placeholder:field:qrcode',\n 'protocol-placeholder:field:radio',\n 'protocol-placeholder:field:rating',\n 'protocol-placeholder:field:select',\n 'protocol-placeholder:field:signature',\n 'protocol-placeholder:field:slider',\n 'protocol-placeholder:field:text',\n 'protocol-placeholder:field:textarea',\n 'protocol-placeholder:field:time',\n 'protocol-placeholder:field:tree',\n 'protocol-placeholder:field:url',\n 'protocol-placeholder:field:video',\n 'protocol-placeholder:global:notifications',\n 'protocol-placeholder:global:search',\n 'protocol-placeholder:nav:breadcrumb',\n 'protocol-placeholder:nav:menu',\n 'protocol-placeholder:page:accordion',\n 'protocol-placeholder:page:card',\n 'protocol-placeholder:page:footer',\n 'protocol-placeholder:page:header',\n 'protocol-placeholder:page:sidebar',\n 'protocol-placeholder:page:tabs',\n 'protocol-placeholder:record:activity',\n 'protocol-placeholder:record:chatter',\n 'protocol-placeholder:record:details',\n 'protocol-placeholder:record:highlights',\n 'protocol-placeholder:record:path',\n 'protocol-placeholder:record:related_list',\n 'protocol-placeholder:view:calendar',\n 'protocol-placeholder:view:drawer',\n 'protocol-placeholder:view:gallery',\n 'protocol-placeholder:view:gantt',\n 'protocol-placeholder:view:grid',\n 'protocol-placeholder:view:kanban',\n 'protocol-placeholder:view:map',\n 'protocol-placeholder:view:modal',\n 'protocol-placeholder:view:simple',\n 'protocol-placeholder:view:split',\n 'protocol-placeholder:view:tabbed',\n 'protocol-placeholder:view:timeline',\n 'protocol-placeholder:view:wizard',\n 'protocol-placeholder:widget:bar',\n 'protocol-placeholder:widget:funnel',\n 'protocol-placeholder:widget:heatmap',\n 'protocol-placeholder:widget:image',\n 'protocol-placeholder:widget:line',\n 'protocol-placeholder:widget:metric',\n 'protocol-placeholder:widget:pie',\n 'protocol-placeholder:widget:pivot',\n 'protocol-placeholder:widget:radar',\n 'protocol-placeholder:widget:scatter',\n 'protocol-placeholder:widget:table',\n 'protocol-placeholder:widget:text',\n 'q',\n 'radio-group',\n 'record',\n 'record:activity',\n 'record:alert',\n 'record:approvals',\n 'record:attachments',\n 'record:chatter',\n 'record:details',\n 'record:discussion',\n 'record:highlights',\n 'record:history',\n 'record:line_items',\n 'record:path',\n 'record:quick_actions',\n 'record:reference_rail',\n 'record:related_list',\n 'report',\n 'report-designer',\n 'report-viewer',\n 'resizable',\n 'scroll-area',\n 'section',\n 'select',\n 'separator',\n 'sheet',\n 'sidebar',\n 'skeleton',\n 'slider',\n 'small',\n 'sonner',\n 'sort-ui',\n 'span',\n 'spinner',\n 'stack',\n 'statistic',\n 'strong',\n 'sub',\n 'sup',\n 'switch',\n 'table',\n 'tabs',\n 'text',\n 'textarea',\n 'time',\n 'timeline',\n 'toast',\n 'toaster',\n 'toggle',\n 'toggle-group',\n 'tooltip',\n 'tree-view',\n 'u',\n 'ui:a',\n 'ui:abbr',\n 'ui:accordion',\n 'ui:address',\n 'ui:alert',\n 'ui:alert-dialog',\n 'ui:app',\n 'ui:article',\n 'ui:aside',\n 'ui:aspect-ratio',\n 'ui:avatar',\n 'ui:b',\n 'ui:badge',\n 'ui:blockquote',\n 'ui:box',\n 'ui:br',\n 'ui:breadcrumb',\n 'ui:button',\n 'ui:button-group',\n 'ui:calendar',\n 'ui:card',\n 'ui:carousel',\n 'ui:checkbox',\n 'ui:cite',\n 'ui:code',\n 'ui:collapsible',\n 'ui:combobox',\n 'ui:command',\n 'ui:container',\n 'ui:context-menu',\n 'ui:data-table',\n 'ui:date-picker',\n 'ui:dd',\n 'ui:del',\n 'ui:dialog',\n 'ui:div',\n 'ui:dl',\n 'ui:drawer',\n 'ui:dropdown-menu',\n 'ui:dt',\n 'ui:em',\n 'ui:email',\n 'ui:empty',\n 'ui:figcaption',\n 'ui:figure',\n 'ui:file-upload',\n 'ui:filter-builder',\n 'ui:flex',\n 'ui:footer',\n 'ui:grid',\n 'ui:h1',\n 'ui:h2',\n 'ui:h3',\n 'ui:h4',\n 'ui:h5',\n 'ui:h6',\n 'ui:header',\n 'ui:header-bar',\n 'ui:home',\n 'ui:hover-card',\n 'ui:hr',\n 'ui:html',\n 'ui:i',\n 'ui:icon',\n 'ui:image',\n 'ui:img',\n 'ui:input',\n 'ui:input-otp',\n 'ui:ins',\n 'ui:kbd',\n 'ui:label',\n 'ui:li',\n 'ui:list',\n 'ui:loading',\n 'ui:main',\n 'ui:mark',\n 'ui:menubar',\n 'ui:nav',\n 'ui:navigation-menu',\n 'ui:ol',\n 'ui:p',\n 'ui:page',\n 'ui:pagination',\n 'ui:password',\n 'ui:popover',\n 'ui:pre',\n 'ui:progress',\n 'ui:q',\n 'ui:radio-group',\n 'ui:record',\n 'ui:resizable',\n 'ui:scroll-area',\n 'ui:section',\n 'ui:select',\n 'ui:separator',\n 'ui:sheet',\n 'ui:sidebar',\n 'ui:skeleton',\n 'ui:slider',\n 'ui:small',\n 'ui:sonner',\n 'ui:span',\n 'ui:spinner',\n 'ui:stack',\n 'ui:statistic',\n 'ui:strong',\n 'ui:sub',\n 'ui:sup',\n 'ui:switch',\n 'ui:table',\n 'ui:tabs',\n 'ui:text',\n 'ui:textarea',\n 'ui:time',\n 'ui:toast',\n 'ui:toaster',\n 'ui:toggle',\n 'ui:toggle-group',\n 'ui:tooltip',\n 'ui:tree-view',\n 'ui:u',\n 'ui:ul',\n 'ui:utility',\n 'ul',\n 'utility',\n 'view-switcher',\n 'view:calendar',\n 'view:chart',\n 'view:detail',\n 'view:drawer',\n 'view:filter-ui',\n 'view:form',\n 'view:gallery',\n 'view:gantt',\n 'view:grid',\n 'view:kanban',\n 'view:list',\n 'view:map',\n 'view:modal',\n 'view:simple',\n 'view:sort-ui',\n 'view:split',\n 'view:tabbed',\n 'view:timeline',\n 'view:view-switcher',\n 'view:wizard',\n 'widget:bar',\n 'widget:funnel',\n 'widget:heatmap',\n 'widget:image',\n 'widget:line',\n 'widget:metric',\n 'widget:pie',\n 'widget:pivot',\n 'widget:radar',\n 'widget:scatter',\n 'widget:table',\n 'widget:text',\n];\n\nconst KNOWN_SCHEMA_TYPE_SET: ReadonlySet<string> = new Set(KNOWN_SCHEMA_TYPES);\n\n/**\n * Does `type` name a component the ObjectUI stack registers?\n *\n * Answers about THIS repository's registrations only. A user project that\n * registers its own components will have keys this cannot know about, which is\n * why `objectui check` reports an unrecognised type as a warning and never\n * fails the run on it.\n */\nexport function isKnownSchemaType(type: string): boolean {\n return KNOWN_SCHEMA_TYPE_SET.has(type);\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * \"Did you mean\" for `objectui check`, on CASE ALONE (objectui#5247).\n *\n * The 2026-08-19 ruling on objectui#5247 chose Option C — keep lookup strict,\n * make the failure teach. Nothing here makes a mis-cased type VALID: `check`\n * still reports `Page` as an unknown schema type, and `SchemaRenderer` still\n * paints the OBJUI-001 panel for it. All that changes is that the report names\n * the spelling that would have worked. Resolving `Page` to `page` is the\n * REJECTED option B.\n *\n * ## Why the candidate set is `KNOWN_SCHEMA_TYPES` and not a list typed here\n *\n * `KNOWN_SCHEMA_TYPES` is DERIVED from this repository's registration calls by\n * `scripts/regenerate-known-schema-types.mjs` and pinned by\n * `scripts/__tests__/known-schema-types-derivation-5115.test.ts`. Reading it is\n * the whole point: a suggestion built against a hand-maintained copy goes stale\n * silently and then confidently names a type nothing registers any more.\n * objectui#5115 measured that copy drifting in BOTH directions at once, which\n * is why the derivation exists.\n *\n * ## Why this is not shared with the renderer's copy of the same clause\n *\n * `packages/react/src/SchemaRenderer.tsx` emits the same clause for the\n * OBJUI-001 panel, from `ComponentRegistry.getKnownTypes()`. The two cannot\n * share one implementation because they cannot share a candidate SET. The\n * published CLI runs inside a USER's project and depends on neither\n * `@object-ui/core` nor the plugin packages that register most component\n * types; the header of `scripts/regenerate-known-schema-types.mjs` records the\n * measurement (eleven of the fifteen real types in the old hand list are\n * registered by packages the CLI does not depend on) and the reason a runtime\n * lookup would answer the wrong question anyway. What the two surfaces DO share\n * is the emitted wording, and each side pins it in its own test.\n *\n * ## Case only\n *\n * Case is the only trigger the ruling grants. This is deliberately not an edit\n * distance — `pge` suggests nothing — because a fuzzy match is scope the\n * ruling did not give and would guess where this merely names.\n */\n\nimport { KNOWN_SCHEMA_TYPES } from './known-schema-types.js';\n\n/**\n * The known schema type that differs from `type` only in case, if there is one.\n *\n * Returns `undefined` when nothing matches case-insensitively — the caller must\n * then say nothing at all, so `Unknown schema type \"zzz\"` never acquires a\n * bogus suggestion.\n */\nexport function suggestKnownTypeByCase(type: string): string | undefined {\n if (typeof type !== 'string' || type === '') return undefined;\n const wanted = type.toLowerCase();\n for (const candidate of KNOWN_SCHEMA_TYPES) {\n if (candidate !== type && candidate.toLowerCase() === wanted) return candidate;\n }\n return undefined;\n}\n\n/**\n * The suggestion clause `objectui check` appends to an unknown-type warning, or\n * the empty string when there is nothing to suggest.\n *\n * Quoting follows this surface's own convention — the warning already spells\n * the offending type as `\"Page\"` — so the two halves of one line agree. The\n * OBJUI-001 panel quotes with `'…'` for the same reason on its side.\n */\nexport function didYouMeanClause(type: string): string {\n const match = suggestKnownTypeByCase(type);\n return match === undefined ? '' : ` — did you mean \"${match}\"?`;\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n EXPRESSION_BINDABLE_TEXT_KEYS,\n expressionBindableTextKeysFor,\n} from '@objectstack/spec/ui';\n\nimport { formatIssuePath } from './issue-path.js';\nimport { isKnownSchemaType } from './known-schema-types.js';\n\n/**\n * `objectui check` refuses a `${…}` expression written into a text key that\n * `SchemaRenderer` never evaluates (objectui#4795, ruling item 2).\n *\n * ## The defect this refuses\n *\n * A value reaches the screen only when `SchemaRenderer` evaluates it AND the\n * renderer reads it back. For the four closed text keys — `title`, `label`,\n * `value`, `description` — the evaluation half is decided by one lookup:\n * `expressionBindableTextKeysFor(type)` from `@objectstack/spec`, which\n * `SchemaRenderer`'s evaluation memo consumes. A key the lookup does not list\n * for the node's type is passed through untouched, so `${data.total}` reaches\n * the user as those literal characters, or the node renders blank.\n *\n * The ruling (maintainer, 2026-08-31, on objectui#4795): reject a `${…}` in\n * any of the four keys on a component node whose lookup answer excludes that\n * key — types with no row included, since the empty set is the contract's\n * answer for them. Two sub-rules:\n *\n * (i) Component nodes only. The page document root's own `title` is a page\n * key, not a component text key.\n * (ii) A type no registered component answers to gets a WARNING, not a\n * refusal: a custom renderer may evaluate its own keys.\n *\n * ## One lookup, called the way the runtime calls it\n *\n * The vocabulary and the carriage map are the spec's, IMPORTED here rather\n * than copied, so a row added upstream moves this gate and the runtime in the\n * same install. The type string is passed VERBATIM, because that is what the\n * evaluation memo in `SchemaRenderer` passes: no prefix stripping, so\n * `ui:card` answers the empty set exactly as it does at render time. Each half\n * is pinned against that verbatim lookup: the runtime's by the `@object-ui/react`\n * suite `SchemaRenderer.bindableTextKeys.test.tsx`, this gate's over every\n * registered type by `check-unbindable-text-expression-4795.test.ts`.\n *\n * ## What a component node is: the root, and what `children` holds\n *\n * `SchemaRenderer` does not recurse on its own. Each renderer decides which of\n * its keys it hands back to `SchemaRenderer`, and many keys that hold objects\n * with a string `type` are not nodes at all: a form's `fields[]` entries are\n * field definitions rendered by the form's field widgets, a grid's `columns[]`\n * entries are column definitions, and `{ \"type\": \"multiple\" }` can be a\n * selection mode. A walk over every object with a string `type` would refuse\n * `{ \"type\": \"text\", \"label\": \"${…}\" }` inside `fields[]` — a false refusal\n * on a key this gate has no business judging.\n *\n * So the walk follows the protocol's ONE composition key,\n * `BaseSchema.children`, from the document root: the same single spelling the\n * core validator's recursive walk and the SDUI parser's child-list key follow.\n * Nodes that a renderer reaches through a key of its own (`trigger`, `footer`,\n * a page's `regions`, a tab's `content`) are not walked. That is a stated\n * boundary, and it fails quiet in the safe direction: a node the walk does not\n * reach is not refused, and nothing outside a component node is refused.\n *\n * ## What an expression is\n *\n * The evaluator's own interpolation pattern: a `${` closed by a `}` with at\n * least one character between them. A lone `${`, or an empty `${}`, is not an\n * expression to the evaluator, so it is not one here either.\n */\n\n/** The evaluator's interpolation pattern, as `ExpressionEvaluator.evaluate` matches it. */\nconst EXPRESSION_PATTERN = /\\$\\{[^}]+\\}/;\n\n/** The protocol's one composition key: `BaseSchema.children`. */\nconst COMPOSITION_KEY = 'children';\n\n/**\n * The document-root type whose own text keys are page keys (sub-rule i). Its\n * `children` are still component nodes and are still walked.\n */\nconst PAGE_DOCUMENT_ROOT_TYPE = 'page';\n\n/** One `${…}` sitting on a closed text key its node's type does not evaluate. */\nexport interface UnbindableTextExpression {\n /**\n * `refusal` when the type is a registered component; `warning` when no\n * registered component answers to it (sub-rule ii).\n */\n severity: 'refusal' | 'warning';\n /** From the document root to the key: `['children', 0, 'value']`. */\n path: readonly (string | number)[];\n /** The node's `type`, verbatim. */\n type: string;\n /** The closed text key holding the expression. */\n key: string;\n /** The keys of the four this type's node DOES evaluate: the lookup's answer. */\n evaluatedKeys: readonly string[];\n}\n\ntype ComponentNode = Record<string, unknown> & { type: string };\n\nfunction isComponentNode(value: unknown): value is ComponentNode {\n return (\n typeof value === 'object' &&\n value !== null &&\n !Array.isArray(value) &&\n typeof (value as { type?: unknown }).type === 'string'\n );\n}\n\nfunction judge(\n node: ComponentNode,\n path: readonly (string | number)[],\n into: UnbindableTextExpression[],\n): void {\n const evaluatedKeys: readonly string[] = expressionBindableTextKeysFor(node.type);\n for (const key of EXPRESSION_BINDABLE_TEXT_KEYS) {\n const value = node[key];\n if (typeof value !== 'string' || !EXPRESSION_PATTERN.test(value)) continue;\n if (evaluatedKeys.includes(key)) continue;\n into.push({\n severity: isKnownSchemaType(node.type) ? 'refusal' : 'warning',\n path: [...path, key],\n type: node.type,\n key,\n evaluatedKeys,\n });\n }\n}\n\nfunction visit(\n node: ComponentNode,\n path: readonly (string | number)[],\n isDocumentRoot: boolean,\n into: UnbindableTextExpression[],\n): void {\n if (!(isDocumentRoot && node.type === PAGE_DOCUMENT_ROOT_TYPE)) {\n judge(node, path, into);\n }\n const children = node[COMPOSITION_KEY];\n if (Array.isArray(children)) {\n children.forEach((child, index) => {\n if (isComponentNode(child)) visit(child, [...path, COMPOSITION_KEY, index], false, into);\n });\n } else if (isComponentNode(children)) {\n visit(children, [...path, COMPOSITION_KEY], false, into);\n }\n}\n\n/**\n * Every `${…}` on one of the four closed text keys of a component node whose\n * type does not evaluate that key, in document order. `document` is a parsed\n * file `objectui check` has recognised as an ObjectUI schema.\n */\nexport function findUnbindableTextExpressions(document: unknown): UnbindableTextExpression[] {\n const found: UnbindableTextExpression[] = [];\n if (isComponentNode(document)) visit(document, [], true, found);\n return found;\n}\n\nconst inCode = (key: string): string => '`' + key + '`';\n\n/**\n * The line `check` prints for a finding, after the file name: the path spelled\n * as `objectui validate` spells it, the type, the key, and the keys this type\n * does evaluate.\n */\nexport function describeUnbindableTextExpression(finding: UnbindableTextExpression): string {\n const at = formatIssuePath(finding.path);\n if (finding.severity === 'warning') {\n return (\n `at ${at}: \"${finding.type}\" is not a registered component, so the expression on ` +\n `${inCode(finding.key)} is not refused; a custom renderer may evaluate it itself.`\n );\n }\n const evaluates =\n finding.evaluatedKeys.length > 0\n ? `it evaluates only ${finding.evaluatedKeys.map(inCode).join(', ')}`\n : `it evaluates none of ${EXPRESSION_BINDABLE_TEXT_KEYS.map(inCode).join(', ')}`;\n return (\n `at ${at}: \"${finding.type}\" never evaluates ${inCode(finding.key)} ` +\n `(${evaluates}), so the expression is never resolved: the user sees its ` +\n 'literal text, or nothing.'\n );\n}\n\n/**\n * The channels a refused expression can move to: the keys this type evaluates,\n * then the channels the runtime's unevaluated-expression diagnostic names —\n * `content`, the `properties` bag (evaluated, then hoisted onto the node), and\n * resolving the value in the host. The line says these are EVALUATED; whether\n * a renderer reads a key back is the renderer's, and this gate cannot see it.\n */\nexport function workingChannels(finding: UnbindableTextExpression): string {\n const channels = [\n ...finding.evaluatedKeys.map(inCode),\n inCode('content'),\n `${inCode(`properties.${finding.key}`)} (evaluated, then hoisted onto the node)`,\n ];\n return (\n `Channels SchemaRenderer evaluates: ${channels.join(', ')}; ` +\n 'or resolve the value in the host before the schema reaches SchemaRenderer.'\n );\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { readFileSync, existsSync } from 'fs';\nimport { resolve } from 'path';\nimport { load as loadYaml } from 'js-yaml';\nimport { safeValidateSchema } from '@object-ui/types/zod';\nimport { findSpecVocabularyFormFields } from '../utils/spec-vocabulary-hint.js';\nimport { explainUnionIssue } from '../utils/union-arm-diagnostics.js';\nimport { formatIssuePath } from '../utils/issue-path.js';\n\n/**\n * Validate a schema file\n * \n * @param schemaPath - Path to the schema file (JSON or YAML)\n */\nexport async function validate(schemaPath: string) {\n console.log(chalk.blue('🔍 ObjectUI Schema Validator\\n'));\n\n // Resolve the schema path\n const resolvedPath = resolve(process.cwd(), schemaPath);\n\n // Check if file exists\n if (!existsSync(resolvedPath)) {\n console.error(chalk.red(`✗ Error: Schema file not found: ${schemaPath}`));\n process.exit(1);\n }\n\n try {\n // Read the file\n const fileContent = readFileSync(resolvedPath, 'utf-8');\n let schema: unknown;\n\n // Parse based on file extension\n if (schemaPath.endsWith('.yaml') || schemaPath.endsWith('.yml')) {\n console.log(chalk.gray(`Reading YAML schema from: ${schemaPath}`));\n schema = loadYaml(fileContent);\n } else if (schemaPath.endsWith('.json')) {\n console.log(chalk.gray(`Reading JSON schema from: ${schemaPath}`));\n schema = JSON.parse(fileContent);\n } else {\n // Try JSON first, then YAML\n try {\n schema = JSON.parse(fileContent);\n console.log(chalk.gray(`Reading schema from: ${schemaPath} (detected as JSON)`));\n } catch {\n schema = loadYaml(fileContent);\n console.log(chalk.gray(`Reading schema from: ${schemaPath} (detected as YAML)`));\n }\n }\n\n // Validate the schema\n console.log(chalk.gray('Validating schema...\\n'));\n const result = safeValidateSchema(schema);\n\n if (result.success) {\n console.log(chalk.green('✓ Schema is valid!\\n'));\n \n // Show some info about the schema\n const data = result.data;\n console.log(chalk.bold('Schema Information:'));\n console.log(chalk.gray(' Type:'), data.type || 'unknown');\n \n if (data.id) {\n console.log(chalk.gray(' ID:'), data.id);\n }\n \n // `title` is declared by some arms of the parsed union and not others, so\n // it is read only where the parsed node carries it (objectui#11355).\n const title = 'title' in data ? data.title : undefined;\n if (data.label || title) {\n console.log(chalk.gray(' Label:'), data.label || title);\n }\n \n // Count children if present\n if (data.children && Array.isArray(data.children)) {\n console.log(chalk.gray(' Children:'), data.children.length);\n }\n\n // Mixed-vocabulary entries validate (the runtime `name` satisfies the\n // schema) but the spec `field` key is dead weight: the renderer ignores\n // it and strip-mode validation drops it. Valid ≠ clean — say so (#3090).\n const mixed = findSpecVocabularyFormFields(schema).filter((f) => f.mixedName);\n if (mixed.length > 0) {\n console.log(chalk.yellow('\\nWarnings:'));\n for (const m of mixed) {\n console.log(chalk.yellow(\n ` ${m.path}: '${m.mixedName}' also carries { field: '${m.field}' } — mixed form-field ` +\n `vocabularies. The renderer ignores \\`field\\` here; drop one of the two.`,\n ));\n }\n }\n\n console.log('');\n process.exit(0);\n } else {\n console.error(chalk.red('✗ Schema validation failed!\\n'));\n console.error(chalk.bold('Validation Errors:'));\n \n // Format Zod errors nicely. `.issues` is the only accessor on a Zod 4\n // ZodError — the `.errors` alias was removed, so reading it yielded\n // undefined and this loop threw a TypeError that the catch below\n // reported as \"Error reading or parsing schema file\", hiding the very\n // errors this command exists to print.\n // Every issue gets a Path line, INCLUDING a root-level one (`85b495795`).\n //\n // The guard here used to be `issue.path.length > 0`, which dropped the\n // line entirely for `path: []` — silent in exactly the case a reader\n // most needs oriented. Measured before that change, a menu carrying the\n // retired `{ type: 'separator' }` divider spelling printed\n // `1. Invalid input` and a Code line, and nothing said whether the whole\n // document or some node inside it had been judged.\n //\n // ⚠️ WHERE A ROOT ISSUE COMES FROM MOVED (objectui#8498). This block read\n // \"`AnyComponentSchema`, a `z.union` of every component arm, so ANY\n // document matching no arm reports one top-level issue at the root\".\n // It discriminates on `type` now and both halves are false: a `type` that\n // SELECTS an arm yields that arm's own issues as the top-level entries,\n // already absolute, with no union issue at the root; a `type` that matches\n // nothing is judged at `['type']`. A root path now means a non-object.\n //\n // The path is spelled by `formatIssuePath`, which owns the `(root)`\n // convention and is shared with `objectui check` (objectui#11007).\n //\n // The ARM-SELECTION half (`a5d55472b`) landed on the 2026-09-02\n // maintainer ruling (option B): print the issues of the arm the authored\n // `type` selects, and nothing from the others. Since objectui#8498 ZOD\n // does that selecting — a matched discriminator yields the arm's issues\n // directly, so there is no union issue here to expand. What\n // `explainUnionIssue` still answers is the other half of the ruling: the\n // capped candidate note when NO arm accepts, and the undiscriminated\n // unions still reached at nested slots. Everything about WHICH arm lives\n // in `../utils/union-arm-diagnostics.js`; this file only prints, and it\n // is the CLI's full zod-issue printer. `objectui check` prints one line\n // per file that did not validate — that file's first issue, through the\n // same path formatter — and sends the reader here for the rest.\n result.error.issues.forEach((issue, index) => {\n console.error(chalk.red(`\\n${index + 1}. ${issue.message}`));\n console.error(chalk.gray(` Path: ${formatIssuePath(issue.path)}`));\n if (issue.code) {\n console.error(chalk.gray(` Code: ${issue.code}`));\n }\n\n // The selected arm's own diagnosis, indented under the entry it\n // explains and numbered `<n>.<k>` so it can never be mistaken for a\n // separate top-level issue (`1.1` does not match the `^\\d+\\. ` shape a\n // numbered entry has).\n explainUnionIssue(issue, schema).forEach((line, sub) => {\n const where = formatIssuePath(line.path);\n if (line.kind === 'note') {\n // No arm accepts the authored `type`. Name that, then the nearest\n // few of the accepted values — never all of them, which is the\n // noise the ruling rejected option A for.\n const at = line.path.length > 0 ? ` at ${where}` : '';\n if (line.authoredType === undefined) {\n console.error(\n chalk.yellow(\n ` No \\`type\\` is declared${at}, so none of the ${line.totalArmNames} ` +\n `accepted component types can be selected.`,\n ),\n );\n return;\n }\n console.error(\n chalk.yellow(` No arm accepts type \"${line.authoredType}\"${at}.`),\n );\n if (line.candidates.length > 0) {\n console.error(\n chalk.gray(\n ` Nearest of the ${line.totalArmNames} accepted types: ` +\n line.candidates.join(', '),\n ),\n );\n }\n return;\n }\n const arm = line.arm === undefined ? '' : `[arm ${line.arm}] `;\n console.error(chalk.red(` ${index + 1}.${sub + 1} ${arm}${line.message}`));\n console.error(chalk.gray(` Path: ${where}`));\n if (line.code) {\n console.error(chalk.gray(` Code: ${line.code}`));\n }\n });\n });\n\n // \"name: expected string, received undefined\" on a `{ field: … }` entry\n // reads as an instruction to bolt a `name` on — which converts the\n // metadata WRONGLY (the spec shape stands for an object-schema merge\n // that a bare rename throws away). When the input matches that\n // signature, name the actual boundary and the real fixes (#3090).\n const specShaped = findSpecVocabularyFormFields(schema).filter((f) => !f.mixedName);\n if (specShaped.length > 0) {\n console.error(chalk.bold('\\nLikely cause — spec form-view vocabulary in a standalone form:'));\n for (const s of specShaped) {\n console.error(chalk.yellow(\n ` ${s.path}: { field: '${s.field}' } is the spec form-VIEW shape (an object-field reference).`,\n ));\n }\n console.error(chalk.yellow(\n ` A standalone \\`type: 'form'\\` component uses { name: … } (the form data path).\\n` +\n ` Fix: author the field with \\`name\\` and its own type/label — or, to reference object fields\\n` +\n ` with the spec shape, use an object-bound form (\\`type: 'object-form'\\` with objectName +\\n` +\n ` sections), whose section fields are translated by the renderer.`,\n ));\n }\n\n console.error('');\n process.exit(1);\n }\n } catch (error) {\n console.error(chalk.red('\\n✗ Error reading or parsing schema file:'));\n console.error(chalk.red((error as Error).message));\n console.error('');\n process.exit(1);\n }\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Spec-vocabulary detector for `objectui validate` (#3090).\n *\n * `{ field: 'x' }` inside a standalone `type: 'form'` component is the spec\n * form-VIEW vocabulary (an object-field reference) — a different layer from\n * the runtime vocabulary this CLI validates (`name` = form data path). The\n * zod error for it (\"name: expected string, received undefined\") reads as an\n * instruction to bolt a `name` on, which converts the metadata WRONGLY: an\n * agent following it loses the object-schema merge the spec shape stands for.\n * This detector lets the CLI say what actually happened and what the real fix\n * is. The error message is the prompt the next agent executes — it has to\n * point at the boundary, not at the symptom.\n *\n * Scope is deliberately exact: only `fields` arrays hanging DIRECTLY off a\n * `type: 'form'` node. Section fields (`type: 'object-form'` → `sections[]`)\n * legitimately accept the spec shape — `normalizeSectionField` translates\n * them — and a runtime FormField's `field` key legitimately holds the\n * resolved metadata OBJECT, so only a STRING `field` marks the spec shape.\n */\n\nexport interface SpecVocabularyFinding {\n /** JSON-ish path to the entry, e.g. `children[0].fields[2]`. */\n path: string;\n /** The spec `field` value (the referenced object field). */\n field: string;\n /** Set when the entry ALSO carries a runtime `name` (mixed vocabularies). */\n mixedName?: string;\n}\n\nexport function findSpecVocabularyFormFields(\n node: unknown,\n path = '',\n): SpecVocabularyFinding[] {\n if (Array.isArray(node)) {\n return node.flatMap((child, i) => findSpecVocabularyFormFields(child, `${path}[${i}]`));\n }\n if (node === null || typeof node !== 'object') return [];\n\n const record = node as Record<string, unknown>;\n const findings: SpecVocabularyFinding[] = [];\n\n if (record.type === 'form' && Array.isArray(record.fields)) {\n record.fields.forEach((f, i) => {\n if (f && typeof f === 'object' && typeof (f as any).field === 'string') {\n const name = (f as any).name;\n findings.push({\n path: `${path ? `${path}.` : ''}fields[${i}]`,\n field: (f as any).field,\n ...(typeof name === 'string' ? { mixedName: name } : {}),\n });\n }\n });\n }\n\n for (const [key, value] of Object.entries(record)) {\n // The entries themselves were just inspected; don't re-walk them as\n // generic children or each finding would double-report.\n if (record.type === 'form' && key === 'fields') continue;\n findings.push(\n ...findSpecVocabularyFormFields(value, path ? `${path}.${key}` : key),\n );\n }\n return findings;\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n/**\n * Arm selection for a failing union (`a5d55472b`).\n *\n * ## What this exists for\n *\n * `safeValidateSchema` runs `AnyComponentSchema`. When it was a `z.union`, a\n * document matching no arm got ONE top-level issue — `invalid_union` · `Invalid\n * input` · `path: []` — with every arm's real diagnosis hung off that issue's\n * `errors` array. `validate.ts` used to print only the top level, so the author\n * got a bare verdict on the whole document even when the schema had diagnosed\n * the defect precisely, remediation text and all. ⚠️ Since objectui#8498 that\n * union discriminates on `type`: the root issue sits at `['type']` when nothing\n * matches and there is no root union issue at all when something does; the shape\n * above still arrives from the undiscriminated unions at nested slots.\n *\n * The 2026-09-02 maintainer ruling chose **B — discriminator-selected arm**:\n * print the issues of the single arm that accepts the authored `type`, and\n * nothing from the others; when no arm accepts it, print a note plus a CAPPED\n * list of the nearest candidate arm names. Printing every arm (option A),\n * picking the arm with the fewest issues (option C) and the status quo (option\n * D) were all rejected.\n *\n * This module performs the SELECTION only. Every `console.*` call that prints\n * its lines stays in `validate.ts`, the CLI's full zod-issue printer.\n * `objectui check` prints one line per file that did not validate — the first\n * issue only, never an arm selection (objectui#11007) — and the two share\n * nothing but `formatIssuePath`, so no second arm-rendering surface exists.\n *\n * ## Measured facts this rests on (Zod 4.4.3, re-measured on this tree)\n *\n * 1. A union that TRIES EVERY ARM reports `errors`, positionally aligned with\n * its options: `errors[i]` is option `i`'s issues. Selection here never\n * relies on that alignment — see (2) — but it is why the arm lists can be\n * read as arms at all. ⚠️ `AnyComponentSchema` stopped being such a union in\n * objectui#8498: it discriminates on `type`, so it produces NO `errors` array\n * at all. This fact now describes the unions that remain undiscriminated —\n * `MenuItemSchema` and its kind, reached at nested slots — which is where the\n * fallback at the bottom of `explain` earns its keep.\n * 2. **A union names the literals it accepts.** THREE shapes do it, and (c) is\n * the one objectui#8498 added — the previous count of two was a totality\n * claim, and it is restated rather than patched because it went false:\n * - (a) `invalid_value` at `['type']`, carrying `values: ['app']` — an\n * object arm whose `type` is a `z.literal`;\n * - (b) `invalid_union` at `['type']` with `note: 'No matching\n * discriminator'` and `options: ['div', 'box', …]` — a\n * `z.discriminatedUnion` sitting as an ARM of a wider union, reporting\n * relative to its own node;\n * - (c) the same `invalid_union` · `No matching discriminator` · `options`\n * issue reported for the union the document was measured against\n * DIRECTLY, at `[…node, 'type']` — no arms, nothing to select among,\n * because the discriminator already answered. `AnyComponentSchema` is\n * this shape now, so it is the shape `objectui validate` meets first.\n * So the accepted-literal set is still derivable from the error tree ALONE.\n * This module therefore never imports or introspects the schema, and cannot\n * drift from it.\n * 3. **Paths inside `errors` are RELATIVE to their union's node.** The nested\n * union at `['items', 0]` reports its arm issues at `['type']`, not at\n * `['items', 0, 'type']`. Printing them raw would name the wrong node, so\n * every path here is rebased onto its parent's prefix.\n * 4. Every leaf arm of `AnyComponentSchema` carries a DISTINCT `type` literal —\n * no literal is claimed by two arms — so \"exactly one arm accepts that\n * literal\" is total and unambiguous at the document root. Stated as a\n * property and not as a count on purpose: the number of arms moves every\n * time a component lands, the distinctness does not, and it is the\n * distinctness the selection rests on.\n *\n * ## The third branch, and why it is not option A\n *\n * The ruling partitions on \"exactly one arm accepts\" vs \"no arm accepts\". Both\n * presuppose arms that DECLARE a `type` contract. Not every union has them:\n * `MenuItemSchema` — the union this card was filed about — is a two-arm\n * `z.union` whose arms both declare `type` as an ADR-0049 retirement tombstone\n * (`z.never()`), so neither names a literal and no discriminator exists to\n * select on. Measured: its arms report `invalid_type` (`expected: 'never'`)\n * with no `values`.\n *\n * Routing that to the \"no arm accepts\" branch would be literally true and\n * exactly wrong: the candidate list would be empty and the objectui#6523\n * remediation text — the very text this card exists to deliver — would be\n * dropped. So a union with NO declaring arm falls back to the ruling's own\n * named fallback, \"A with a cap\": every arm reported, capped by\n * {@link MAX_UNION_ARMS_REPORTED}. This is not option A at the root, which the\n * ruling rejected on the arm-count noise argument — the root is always\n * discriminated (fact 4), and undiscriminated unions in this mirror are small\n * (`MenuItemSchema` has two arms).\n */\n\n/**\n * The shape this module reads out of a Zod issue.\n *\n * Structural rather than imported from `zod`: the CLI receives issues across a\n * package boundary and only ever reads them, so a narrow local shape keeps this\n * module honest about exactly which fields the selection depends on.\n */\nexport interface UnionIssueLike {\n code?: string;\n path?: readonly PropertyKey[];\n message?: string;\n /** Present on `invalid_union`: one entry per arm, positionally aligned. */\n errors?: readonly (readonly UnionIssueLike[])[];\n /** Present on `invalid_value`: the literal values the arm accepts. */\n values?: readonly unknown[];\n /** Present on a discriminated union's `No matching discriminator`. */\n options?: readonly unknown[];\n /** The key that union dispatches on. ⛔ Not always `type` — see the guard. */\n discriminator?: string;\n note?: string;\n}\n\n/** One arm issue, rebased onto an absolute path. */\nexport interface UnionArmIssue {\n kind: 'issue';\n path: PropertyKey[];\n message: string;\n code?: string;\n /**\n * Set only when several arms are reported at once (the undiscriminated\n * fallback), so the reader can tell whose diagnosis is whose. A selected arm\n * needs no label — there is only one.\n */\n arm?: string;\n}\n\n/** The \"no arm accepts type X\" note, with its capped candidate list. */\nexport interface UnionArmNote {\n kind: 'note';\n path: PropertyKey[];\n /** The authored `type`, or `undefined` when the document carries none. */\n authoredType?: string;\n /**\n * Nearest arm names, already ranked and capped.\n *\n * EMPTY when the document declares no `type` at all. \"Nearest\" needs\n * something to be near, and an alphabetical slice of the arm names presented\n * under a `type` the author never wrote is a bogus suggestion — the failure\n * `known-type-case-suggestion.ts` refuses by returning `undefined` rather\n * than guessing. The note still fires; it just names the missing `type` key\n * instead of pretending to rank against it.\n */\n candidates: string[];\n /**\n * How many `type` values the union accepts in total. Printed with the\n * candidates so the list reads as \"the nearest few of a closed set\" rather\n * than as a confident \"did you mean\" — which matters because a foreign\n * `type` has no near miss at all: measured, `module`'s nearest arm is\n * `toggle` at distance 3.\n */\n totalArmNames: number;\n}\n\nexport type UnionArmLine = UnionArmIssue | UnionArmNote;\n\n/**\n * The cap the 2026-09-02 ruling requires (\"a **capped** list of the nearest\n * candidate arm names — the cap is a named constant, chosen by the implementer\n * and pinned\").\n *\n * Five, from a measurement rather than taste. The candidate set is the union's\n * arm names, and the document root carries far more of them than five, so the\n * cap is the whole distance between a hint and the option A the ruling\n * rejected.\n *\n * Ranking those arm names by edit distance against four authored typos gave the\n * same shape every time: the intended arm is rank 1 and ALONE in its distance\n * band (`dropdwn-menu` -> `dropdown-menu` at 1, one name at that distance;\n * `dropdwon-menu` -> `dropdown-menu` at 2, one name; `Page` -> `page` at 1, one\n * name; `obect-grid` -> `object-grid` at 1, one name), and the next band opens\n * 1-6 edits further out holding 1-5 names. So a cap of 5 shows the winner plus\n * the following band entire, and stops well short of the arm count. A cap of 1\n * would print the winner with nothing around it and read as a confident answer\n * rather than as a ranked list — the same over-claim\n * `known-type-case-suggestion.ts` refuses on the sibling surface. Five is also\n * the conventional shell and compiler suggestion size and holds one terminal\n * line at these name lengths.\n *\n * The same number caps the arms reported when a union has no discriminator to\n * select on (see this module's header). Both lists answer the same question —\n * how many arm-shaped things may be printed before the output becomes the noise\n * option A was rejected for — so they share one constant rather than inviting a\n * second magic number to drift from it.\n */\nexport const MAX_UNION_ARMS_REPORTED = 5;\n\n/** Unit-cost Levenshtein distance (insert / delete / substitute). */\nfunction editDistance(a: string, b: string): number {\n if (a === b) return 0;\n if (a.length === 0) return b.length;\n if (b.length === 0) return a.length;\n let previous = Array.from({ length: b.length + 1 }, (_, i) => i);\n for (let i = 1; i <= a.length; i += 1) {\n const current = [i];\n for (let j = 1; j <= b.length; j += 1) {\n current[j] = Math.min(\n previous[j] + 1,\n current[j - 1] + 1,\n previous[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1),\n );\n }\n previous = current;\n }\n return previous[b.length];\n}\n\n/**\n * The nearest arm names to the authored `type`, capped.\n *\n * Unit-cost edit distance, ascending, ties broken lexicographically so the\n * output is deterministic. Chosen because the authored `type` and the arm names\n * are short kebab-case identifiers whose realistic authoring errors are a\n * dropped, added, doubled or mistyped character (`dropdwn-menu`), which is\n * precisely what unit-cost distance ranks nearest; a prefix or case-only match\n * would miss any typo in the first token, and a transposition-aware metric\n * (Damerau) buys a case this tree's arm names do not need — a transposition\n * scores 2 here and still lands at the top of the list.\n *\n * ⚠️ Not to be confused with `known-type-case-suggestion.ts`, which is\n * deliberately case-only under a DIFFERENT ruling (objectui#5247) for a\n * DIFFERENT surface (`objectui check`) over a DIFFERENT candidate set\n * (`KNOWN_SCHEMA_TYPES`, the registry's keys). This surface's candidates are the\n * schema union's arms, and the 2026-09-02 ruling `a5d55472b` implements asks for the\n * \"nearest\" ones by name — so proximity is granted here and is not a widening\n * of that one.\n */\nexport function nearestArmNames(\n authoredType: string | undefined,\n armNames: readonly string[],\n): { candidates: string[]; total: number } {\n const unique = [...new Set(armNames)].sort();\n // Nothing to be near: say nothing rather than rank against a `type` the\n // author never wrote. See `UnionArmNote.candidates`.\n if (typeof authoredType !== 'string' || authoredType === '') {\n return { candidates: [], total: unique.length };\n }\n const ordered = [...unique].sort((x, y) => {\n const d = editDistance(authoredType, x) - editDistance(authoredType, y);\n return d !== 0 ? d : x.localeCompare(y);\n });\n return { candidates: ordered.slice(0, MAX_UNION_ARMS_REPORTED), total: unique.length };\n}\n\n/** Read `document[...path].type`, when it is a string. */\nfunction authoredTypeAt(document: unknown, path: readonly PropertyKey[]): string | undefined {\n let node: unknown = document;\n for (const key of path) {\n if (node === null || typeof node !== 'object') return undefined;\n node = (node as Record<PropertyKey, unknown>)[key];\n }\n if (node === null || typeof node !== 'object') return undefined;\n const type = (node as Record<string, unknown>).type;\n return typeof type === 'string' ? type : undefined;\n}\n\nfunction isUnion(issue: UnionIssueLike): boolean {\n return issue.code === 'invalid_union' && Array.isArray(issue.errors);\n}\n\n/** Zod's own wording for the shape (b)/(c) issues of header fact 2. */\nconst NO_MATCHING_DISCRIMINATOR = 'No matching discriminator';\n\n/**\n * The ruling's \"no arm accepts\" line, built for one node.\n *\n * Shared by both routes to that branch — the arm walk below, and the\n * discriminated shape (c) — because it is ONE ruling: a note naming the\n * authored `type`, plus a capped list of the nearest accepted literals. Two\n * copies would be two places for the cap to drift.\n */\nfunction noArmAccepts(\n node: readonly PropertyKey[],\n literals: readonly string[],\n document: unknown,\n): UnionArmNote {\n const authoredType = authoredTypeAt(document, node);\n const { candidates, total } = nearestArmNames(authoredType, literals);\n return {\n kind: 'note',\n path: [...node],\n ...(authoredType === undefined ? {} : { authoredType }),\n candidates,\n totalArmNames: total,\n };\n}\n\n/**\n * Header fact 2 shape (c): the union the document was measured against IS\n * discriminated and the authored `type` selected nothing.\n *\n * Zod reports one issue and NO arms — `errors` is present but empty, the\n * literals live in `options`, and the path ends at the discriminator key\n * (`[…node, 'type']`), so the node itself is that path minus its last segment.\n * Returning `undefined` for every other issue keeps this off the arm-walk path\n * entirely: an `invalid_union` that carries real arms still goes there, and one\n * carrying neither arms nor options is still not this module's business.\n */\nfunction noMatchingDiscriminator(\n issue: UnionIssueLike,\n document: unknown,\n): UnionArmNote | undefined {\n if (issue.code !== 'invalid_union') return undefined;\n if (issue.note !== NO_MATCHING_DISCRIMINATOR) return undefined;\n if (!Array.isArray(issue.options)) return undefined;\n if ((issue.errors ?? []).length > 0) return undefined;\n // ⚠️ NOT every discriminated union is keyed on `type`, and this branch is only\n // correct for the ones that are: `@objectstack/spec`'s `ViewDataSchema` is\n // `discriminatedUnion('provider', …)` and rides `.data` on `object-grid` and\n // three siblings. ⛔ Both conditions, establishing different facts: the path\n // ending at `type` is what makes `slice(0, -1)` the node, the discriminator\n // being `type` is what makes the note's wording and `authoredTypeAt` right.\n // Zod 4.4.3 fills both from `def.discriminator` (schemas.js:1187/1190) so they\n // cannot disagree today — written this way, a shape that ever separates them\n // falls through to SILENT rather than to WRONG.\n const path = issue.path ?? [];\n if (path[path.length - 1] !== 'type') return undefined;\n if (issue.discriminator !== undefined && issue.discriminator !== 'type') return undefined;\n const literals = issue.options.filter((v): v is string => typeof v === 'string');\n if (literals.length === 0) return undefined;\n return noArmAccepts(path.slice(0, -1), literals, document);\n}\n\nfunction isAtTypeKey(issue: UnionIssueLike): boolean {\n const path = issue.path ?? [];\n return path.length === 1 && path[0] === 'type';\n}\n\n/**\n * The `type` literals an arm declares it accepts, or `undefined` when the arm\n * declares no `type` contract at all.\n *\n * `undefined` and `[]` are different answers and the caller depends on the\n * difference: `undefined` means \"this arm has no discriminator\" (an ADR-0049\n * tombstone arm, or one that simply never mentions `type`), which is what sends\n * a union to the undiscriminated fallback instead of to \"no arm accepts\".\n */\nfunction declaredTypeLiterals(armIssues: readonly UnionIssueLike[]): string[] | undefined {\n const literals: string[] = [];\n let declares = false;\n for (const issue of armIssues) {\n if (isAtTypeKey(issue) && issue.code === 'invalid_value' && Array.isArray(issue.values)) {\n declares = true;\n literals.push(...issue.values.filter((v): v is string => typeof v === 'string'));\n continue;\n }\n if (isAtTypeKey(issue) && isUnion(issue) && Array.isArray(issue.options)) {\n declares = true;\n literals.push(...issue.options.filter((v): v is string => typeof v === 'string'));\n continue;\n }\n // A nested union at the arm's own node (a `z.union` member that is itself a\n // union, e.g. `ObjectQLComponentSchema`): it declares a contract only if\n // every one of ITS arms does, and its literals are their union.\n if ((issue.path ?? []).length === 0 && isUnion(issue)) {\n const nested = (issue.errors ?? []).map((sub) => declaredTypeLiterals(sub));\n if (nested.length > 0 && nested.every((n) => n !== undefined)) {\n declares = true;\n for (const n of nested) literals.push(...(n as string[]));\n }\n }\n }\n return declares ? literals : undefined;\n}\n\n/**\n * Recursion terminates by construction: every call descends one level into\n * `issue.errors`, which Zod materialises eagerly as plain nested arrays at parse\n * time — a finite tree with no lazy getters and therefore no cycle, even for a\n * `z.lazy` schema like `MenuItemSchema` (the laziness is in the SCHEMA, not in\n * the issue tree it produces). Measured max depth on this tree: 3.\n */\nfunction explain(\n unionIssue: UnionIssueLike,\n prefix: readonly PropertyKey[],\n document: unknown,\n): UnionArmLine[] {\n const arms = unionIssue.errors ?? [];\n const declared = arms.map((arm) => declaredTypeLiterals(arm));\n const declaringArms = declared.filter((d) => d !== undefined) as string[][];\n const acceptingIndexes = declared\n .map((d, i) => (d === undefined ? i : -1))\n .filter((i) => i >= 0);\n\n const expand = (armIssues: readonly UnionIssueLike[], arm?: string): UnionArmLine[] =>\n armIssues.flatMap((issue) => {\n const absolute = [...prefix, ...(issue.path ?? [])];\n const discriminated = noMatchingDiscriminator({ ...issue, path: absolute }, document);\n if (discriminated) return [discriminated];\n if (isUnion(issue)) return explain(issue, absolute, document);\n return [\n {\n kind: 'issue' as const,\n path: absolute,\n message: issue.message ?? '',\n code: issue.code,\n ...(arm === undefined ? {} : { arm }),\n },\n ];\n });\n\n // B — exactly one arm accepts the authored literal. Print its issues, and\n // nothing from the others.\n if (declaringArms.length > 0 && acceptingIndexes.length === 1) {\n return expand(arms[acceptingIndexes[0]]);\n }\n\n // B's other half — the union IS discriminated and no arm accepts.\n if (declaringArms.length > 0 && acceptingIndexes.length === 0) {\n return [noArmAccepts(prefix, declaringArms.flat(), document)];\n }\n\n // No discriminator to select on (or, defensively, more than one accepting\n // arm): the ruling's named fallback, every arm capped.\n return arms\n .slice(0, MAX_UNION_ARMS_REPORTED)\n .flatMap((arm, i) => expand(arm, `${i + 1}/${arms.length}`));\n}\n\n/**\n * The lines to print beneath a top-level `invalid_union` entry.\n *\n * Returns `[]` for any issue that is not a union with arm errors, so the caller\n * can call it unconditionally.\n */\nexport function explainUnionIssue(issue: UnionIssueLike, document: unknown): UnionArmLine[] {\n const discriminated = noMatchingDiscriminator(issue, document);\n if (discriminated) return [discriminated];\n if (!isUnion(issue)) return [];\n return explain(issue, issue.path ?? [], document);\n}\n","/**\n * ObjectUI\n * Copyright (c) 2024-present ObjectStack Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport chalk from 'chalk';\nimport { existsSync, statSync, readdirSync } from 'fs';\nimport { resolve, join, extname } from 'path';\n\n/**\n * Analyze bundle size by scanning dist directory\n */\nasync function analyzeBundleSize() {\n console.log(chalk.bold('\\n📦 Bundle Size Analysis\\n'));\n\n const distDir = resolve(process.cwd(), 'dist');\n \n if (!existsSync(distDir)) {\n throw new Error('No dist/ directory to analyze. Run `objectui build` first.');\n }\n\n const files: Array<{ path: string; size: number }> = [];\n \n function scanDirectory(dir: string) {\n const items = readdirSync(dir);\n \n for (const item of items) {\n const fullPath = join(dir, item);\n const stat = statSync(fullPath);\n \n if (stat.isDirectory()) {\n scanDirectory(fullPath);\n } else {\n files.push({\n path: fullPath.replace(distDir + '/', ''),\n size: stat.size,\n });\n }\n }\n }\n \n scanDirectory(distDir);\n \n // Sort by size (largest first)\n files.sort((a, b) => b.size - a.size);\n \n // Calculate totals\n const totalSize = files.reduce((sum, file) => sum + file.size, 0);\n const jsFiles = files.filter(f => extname(f.path) === '.js');\n const cssFiles = files.filter(f => extname(f.path) === '.css');\n \n const jsSize = jsFiles.reduce((sum, file) => sum + file.size, 0);\n const cssSize = cssFiles.reduce((sum, file) => sum + file.size, 0);\n \n console.log(chalk.bold('Summary:'));\n console.log(chalk.gray(' Total Size:'), formatBytes(totalSize));\n console.log(chalk.gray(' JavaScript:'), formatBytes(jsSize), chalk.dim(`(${jsFiles.length} files)`));\n console.log(chalk.gray(' CSS: '), formatBytes(cssSize), chalk.dim(`(${cssFiles.length} files)`));\n console.log(chalk.gray(' Other: '), formatBytes(totalSize - jsSize - cssSize));\n \n console.log(chalk.bold('\\nLargest Files:'));\n files.slice(0, 10).forEach((file) => {\n const sizeStr = formatBytes(file.size).padStart(10);\n console.log(chalk.gray(` ${sizeStr}`), file.path);\n });\n \n // Bundle size recommendations\n console.log(chalk.bold('\\n💡 Recommendations:'));\n \n if (totalSize > 1024 * 1024) {\n console.log(chalk.yellow(' ⚠ Total bundle size is large (> 1MB)'));\n console.log(chalk.gray(' Consider code splitting or lazy loading'));\n }\n \n if (jsSize > 500 * 1024) {\n console.log(chalk.yellow(' ⚠ JavaScript bundle is large (> 500KB)'));\n console.log(chalk.gray(' Consider:'));\n console.log(chalk.gray(' - Tree shaking unused code'));\n console.log(chalk.gray(' - Lazy loading components'));\n console.log(chalk.gray(' - Using dynamic imports'));\n }\n \n if (files.length > 100) {\n console.log(chalk.yellow(` ⚠ Large number of files (${files.length})`));\n console.log(chalk.gray(' Consider bundling or combining files'));\n }\n \n console.log('');\n}\n\n/**\n * Format bytes to human-readable string\n */\nfunction formatBytes(bytes: number): string {\n if (bytes === 0) return '0 B';\n \n const k = 1024;\n const sizes = ['B', 'KB', 'MB', 'GB'];\n const i = Math.floor(Math.log(bytes) / Math.log(k));\n \n return `${(bytes / Math.pow(k, i)).toFixed(2)} ${sizes[i]}`;\n}\n\n/**\n * Analyze application performance: the bundle-size report over `dist/`.\n *\n * It used to take `--bundle-size` and `--render-performance`. The second printed\n * a fixed list of tips in any directory and analysed nothing, so it was retired,\n * and the first went with it, having nothing left to choose between\n * (objectui#11496).\n */\nexport async function analyze() {\n console.log(chalk.blue('🔍 ObjectUI Performance Analyzer\\n'));\n\n await analyzeBundleSize();\n\n console.log(chalk.green('✓ Analysis complete!\\n'));\n}\n"],"mappings":";;;;;;;;;;;;;AAQA,SAAS,eAAe;AACxB,OAAOA,YAAW;;;ACDlB,SAAS,oBAAoB;AAC7B,OAAO,WAAW;AAClB,SAAS,iBAAiB;AAC1B,SAAS,YAAY;AACrB,OAAO,WAAW;AAClB,SAAS,gBAAgB;AAWzB,eAAsB,IAAI,YAAoB,SAAqB;AACjE,QAAM,MAAM,QAAQ,IAAI;AAKxB,QAAM,SAAS,qBAAqB,KAAK,UAAU;AACnD,sBAAoB,QAAQ,GAAG;AAG/B,QAAM,SAAS,KAAK,KAAK,eAAe;AACxC,YAAU,QAAQ,EAAE,WAAW,KAAK,CAAC;AAGrC,MAAI,OAAO,SAAS,UAAU;AAC5B,6BAAyB,QAAQ,OAAO,QAAQ,OAAO,SAAS;AAAA,EAClE,OAAO;AACL,kBAAc,QAAQ,OAAO,MAAM;AAAA,EACrC;AAIA,QAAM,aAAa,gBAAgB,GAAG;AAEtC,MAAI,YAAY;AACd,YAAQ,IAAI,MAAM,KAAK,uDAAgD,CAAC;AAAA,EAC1E,OAAO;AACL,YAAQ,IAAI,MAAM,KAAK,sCAA+B,CAAC;AACvD,YAAQ,IAAI,MAAM,IAAI,0CAA0C,CAAC;AACjE,QAAI;AACF,eAAS,yCAAyC;AAAA,QAChD,KAAK;AAAA,QACL,OAAO;AAAA,MACT,CAAC;AACD,cAAQ,IAAI,MAAM,MAAM,+BAA0B,CAAC;AAAA,IACrD,QAAQ;AACN,YAAM,IAAI,MAAM,sFAAsF;AAAA,IACxG;AAAA,EACF;AAEA,UAAQ,IAAI,MAAM,MAAM,mCAA8B,CAAC;AACvD,UAAQ,IAAI,MAAM,KAAK,4CAAqC,CAAC;AAM7D,MAAI,YAAY;AACd,YAAQ,IAAI,MAAM,KAAK,6DAAsD,CAAC;A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AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;A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M,IAAI,QAAQ,GAAG,iBAAiB,QAAQ,MAAM,UAAU,KAAK;AACjF,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAEH,QACG,QAAQ,OAAO,EACf,YAAY,+DAA+D,EAC3E,OAAO,YAAY;AAClB,MAAI;AACF,UAAM,MAAM;AAAA,EACd,SAAS,OAAO;AACd,YAAQ,MAAMA,OAAM,IAAI,QAAQ,GAAG,iBAAiB,QAAQ,MAAM,UAAU,KAAK;AACjF,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAEH,QACG,QAAQ,UAAU,EAClB,YAAY,wDAAwD,EACpE,SAAS,YAAY,sCAAsC,UAAU,EACrE,OAAO,OAAO,WAAW;AACxB,MAAI;AACF,UAAM,SAAS,MAAM;AAAA,EACvB,SAAS,OAAO;AACd,YAAQ,MAAMA,OAAM,IAAI,QAAQ,GAAG,iBAAiB,QAAQ,MAAM,UAAU,KAAK;AACjF,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAEH,QACG,QAAQ,SAAS,EACjB,YAAY,iCAAiC,EAC7C,OAAO,YAAY;AAClB,MAAI;AACF,UAAM,QAAQ;AAAA,EAChB,SAAS,OAAO;AACd,YAAQ,MAAMA,OAAM,IAAI,QAAQ,GAAG,iBAAiB,QAAQ,MAAM,UAAU,KAAK;AACjF,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAGH,QAAQ,MAAM;","names":["chalk","react","mkdirSync","join","chalk","execSync","chalk","join","mkdirSync","execSync","react","existsSync","join","resolve","chalk","chalk","existsSync","mkdirSync","join","chalk","existsSync","join","chalk","readFileSync","join","chalk","readFileSync","join","chalk","readFileSync","existsSync","resolve","safeValidateSchema","chalk","resolve","existsSync","readFileSync","safeValidateSchema","chalk","existsSync","resolve","join","readFileSync","dirname","join","chalk"]}
|