@raven.js/cli 1.0.1 → 1.1.0-alpha.1

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/README.md CHANGED
@@ -15,7 +15,6 @@ bun add -d @raven.js/cli
15
15
  | `bunx raven init` | Initialize AI skills and raven root. Run once before using raven-setup. |
16
16
  | `bunx raven add <module>` | Add a module. Installs dependencies (`dependsOn`) in topological order, copies files, and rewrites `@ravenjs/*` imports to relative paths. |
17
17
  | `bunx raven status` | Installation status for all modules. Output is JSON for Agent consumption. |
18
- | `bunx raven guide <module>` | Output module GUIDE.md. Used by raven-learn. |
19
18
 
20
19
  ## Options
21
20
 
@@ -26,6 +25,3 @@ bun add -d @raven.js/cli
26
25
  | `--registry <path>` | Path to registry JSON (default: bundled with CLI). Overridable via `RAVEN_DEFAULT_REGISTRY_PATH`. |
27
26
  | `--verbose, -v` | Verbose output. |
28
27
 
29
- ## Agent-facing output
30
-
31
- All commands except `raven init` and `raven guide` output JSON by default. `raven status` includes version info, file hashes, and modified file status for Agent decision-making.
package/dist/raven CHANGED
@@ -441,38 +441,13 @@ async function cmdStatus(options) {
441
441
  const status = await getStatus(registry, options);
442
442
  console.log(JSON.stringify(status));
443
443
  }
444
- async function cmdGuide(moduleName, options) {
445
- const { ravenDir } = await ensureRavenInstalled(options);
446
- const availableModules = [];
447
- try {
448
- const entries = await readdir(ravenDir, { withFileTypes: true });
449
- for (const entry of entries) {
450
- if (entry.isDirectory() && entry.name !== ".") {
451
- availableModules.push(entry.name);
452
- }
453
- }
454
- } catch (e) {
455
- error(`Failed to list modules: ${e}`);
456
- }
457
- const moduleDir = join(ravenDir, moduleName);
458
- if (!await pathExists(moduleDir)) {
459
- error(`Module '${moduleName}' not found.${availableModules.length > 0 ? ` Available: ${availableModules.join(", ")}` : ""}`);
460
- }
461
- const guidePath = join(moduleDir, "GUIDE.md");
462
- if (!await pathExists(guidePath)) {
463
- error(`Module '${moduleName}' has no GUIDE.md. Cannot show guide.`);
464
- }
465
- const guideContent = await readFile(guidePath, "utf-8");
466
- console.log(guideContent);
467
- }
468
444
  var cli = cac("raven");
469
445
  cli.version(loadCliVersion()).help();
470
446
  cli.option("--registry <path>", "Registry json path (default: same dir as CLI)").option("--root <dir>", "RavenJS root directory (default: raven)").option("--source <path>", "Local module source path (default: github)").option("--verbose, -v", "Verbose output");
471
447
  cli.command("init", "Initialize RavenJS AI resources").action((options) => cmdInit(options));
472
- cli.command("add <module>", "Add a module (e.g., jtd-validator)").action((module, options) => cmdAdd(module, options));
448
+ cli.command("add <module>", "Add a module (e.g., core)").action((module, options) => cmdAdd(module, options));
473
449
  cli.command("status", "Show RavenJS installation status (core, modules)").action((options) => cmdStatus(options));
474
- cli.command("guide <module>", "Get guide for a specific module (outputs module GUIDE.md)").action((moduleName, options) => cmdGuide(moduleName, options));
475
450
  cli.parse();
476
451
 
477
- //# debugId=CFDA2FD99DBE500164756E2164756E21
452
+ //# debugId=BB7C5D0CB5BDF0EF64756E2164756E21
478
453
  //# sourceMappingURL=raven.map
package/dist/raven.map CHANGED
@@ -2,9 +2,9 @@
2
2
  "version": 3,
3
3
  "sources": ["../index.ts"],
4
4
  "sourcesContent": [
5
- "#!/usr/bin/env node\n\nimport { cac } from \"cac\";\nimport { mkdir, readdir, stat, readFile, writeFile, access } from \"fs/promises\";\nimport { join, dirname, resolve, isAbsolute } from \"path\";\nimport { cwd } from \"process\";\nimport { createHash } from \"crypto\";\nimport { fileURLToPath } from \"url\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\nimport pc from \"picocolors\";\nimport { spinner as makeSpinner, log } from \"@clack/prompts\";\nimport { parse, stringify } from \"yaml\";\n\nfunction loadCliVersion(): string {\n return process.env.RAVEN_CLI_VERSION ?? \"0.0.0\";\n}\n\nconst GITHUB_REPO = \"myWsq/RavenJS\";\nconst GITHUB_RAW_URL = `https://raw.githubusercontent.com/${GITHUB_REPO}`;\nconst DEFAULT_ROOT = \"raven\";\n\ninterface CLIOptions {\n verbose?: boolean;\n root?: string;\n source?: string;\n prerelease?: boolean;\n registry?: string;\n}\n\ninterface RegistryModule {\n files: string[];\n fileMapping?: Record<string, string>;\n dependencies?: Record<string, string>;\n dependsOn?: string[];\n description?: string;\n}\n\ninterface RegistryAi {\n claude: Record<string, string>;\n}\n\ninterface Registry {\n version: string;\n modules: Record<string, RegistryModule>;\n ai: RegistryAi;\n}\n\nasync function fileExists(path: string): Promise<boolean> {\n try {\n await access(path);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function loadRegistry(options?: {\n registry?: string;\n}): Promise<Registry> {\n const candidates: string[] = [];\n if (options?.registry) {\n candidates.push(\n isAbsolute(options.registry)\n ? options.registry\n : resolve(cwd(), options.registry),\n );\n }\n if (process.env.RAVEN_DEFAULT_REGISTRY_PATH) {\n const p = process.env.RAVEN_DEFAULT_REGISTRY_PATH;\n candidates.push(isAbsolute(p) ? p : resolve(cwd(), p));\n }\n candidates.push(join(__dirname, \"registry.json\"));\n\n for (const p of candidates) {\n if (await fileExists(p)) {\n const content = await readFile(p, \"utf-8\");\n return JSON.parse(content) as Registry;\n }\n }\n console.error(\n \"registry.json not found. Run 'bun run build' in packages/cli first, or use --registry <path>.\",\n );\n process.exit(1);\n}\n\nfunction getRoot(options: CLIOptions): string {\n return options.root || process.env.RAVEN_ROOT || DEFAULT_ROOT;\n}\n\nfunction getSource(options: CLIOptions): string | undefined {\n return options.source || process.env.RAVEN_SOURCE;\n}\n\nfunction resolveSourcePath(source?: string): string | undefined {\n if (!source || source === \"github\") return undefined;\n return isAbsolute(source) ? source : resolve(cwd(), source);\n}\n\nasync function verboseLog(message: string, options?: CLIOptions) {\n if (options?.verbose) {\n console.log(message);\n }\n}\n\nfunction error(message: string): never {\n // Use stderr for programmatic consumption (e.g. tests, piping). @clack/prompts\n // log.error writes to stdout which breaks stderr-based assertions.\n console.error(message);\n process.exit(1);\n}\n\nfunction success(message: string) {\n log.success(message);\n}\n\nfunction printSectionHeader(title: string) {\n log.step(title);\n}\n\nfunction printListItem(item: string) {\n log.message(item, { symbol: pc.dim(\"-\") });\n}\n\nasync function ensureDir(path: string) {\n try {\n await mkdir(path, { recursive: true });\n } catch (e: any) {\n if (e.code !== \"EEXIST\") throw e;\n }\n}\n\nasync function isDirEmpty(path: string): Promise<boolean> {\n try {\n const entries = await readdir(path);\n return entries.length === 0;\n } catch (e: any) {\n if (e.code === \"ENOENT\") return true;\n throw e;\n }\n}\n\nasync function pathExists(path: string): Promise<boolean> {\n try {\n await stat(path);\n return true;\n } catch (e: any) {\n if (e.code === \"ENOENT\") return false;\n throw e;\n }\n}\n\nasync function ensureRavenInstalled(\n options: CLIOptions,\n): Promise<{ ravenDir: string; version: string }> {\n const targetDir = cwd();\n const root = getRoot(options);\n const ravenDir = join(targetDir, root);\n\n if (!(await pathExists(ravenDir))) {\n error(`RavenJS not installed at ${root}/. Run 'raven init' first.`);\n }\n\n const yamlPath = join(ravenDir, \"raven.yaml\");\n try {\n const content = await readFile(yamlPath, \"utf-8\");\n const config = parse(content) as RavenYamlConfig;\n if (!config?.version) {\n error(\"Invalid raven.yaml: version field is missing\");\n }\n return { ravenDir, version: config.version };\n } catch (e: any) {\n error(`Failed to load raven.yaml: ${e.message}`);\n }\n}\n\nfunction getModuleNames(registry: Registry): string[] {\n return Object.keys(registry.modules);\n}\n\nfunction getInstallOrder(\n moduleName: string,\n registry: Registry,\n installed: Set<string>,\n): string[] {\n const result: string[] = [];\n const visited = new Set<string>();\n const recStack = new Set<string>();\n const path: string[] = [];\n let cycle: string[] | null = null;\n\n function visit(name: string) {\n if (recStack.has(name)) {\n const idx = path.indexOf(name);\n cycle = path.slice(idx).concat(name);\n return;\n }\n if (visited.has(name)) return;\n visited.add(name);\n recStack.add(name);\n path.push(name);\n\n const mod = registry.modules[name];\n if (mod?.dependsOn) {\n for (const dep of mod.dependsOn) {\n if (registry.modules[dep]) visit(dep);\n }\n }\n if (!installed.has(name)) {\n result.push(name);\n }\n path.pop();\n recStack.delete(name);\n }\n\n visit(moduleName);\n if (cycle !== null) {\n error(`Circular dependency: ${(cycle as string[]).join(\" -> \")}`);\n }\n return result;\n}\n\nconst RAVENJS_PREFIX = \"@raven.js/\";\n\nfunction replaceRavenImports(\n content: string,\n fromModuleDir: string,\n registry: Registry,\n): string {\n const moduleNames = Object.keys(registry.modules);\n let out = content;\n const depth = fromModuleDir.split(\"/\").filter(Boolean).length;\n const prefix = depth > 0 ? \"../\".repeat(depth) : \"./\";\n for (const modName of moduleNames) {\n const pkg = `${RAVENJS_PREFIX}${modName}`;\n const rel = prefix + modName;\n\n const dq = new RegExp(\n `from\\\\s+\"${pkg.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")}\"`,\n \"g\",\n );\n const sq = new RegExp(\n `from\\\\s+'${pkg.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")}'`,\n \"g\",\n );\n out = out.replace(dq, `from \"${rel}\"`).replace(sq, `from '${rel}'`);\n }\n return out;\n}\n\nasync function downloadFile(url: string, destPath: string): Promise<void> {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(`Failed to download ${url}: ${response.status}`);\n }\n const content = await response.text();\n await ensureDir(dirname(destPath));\n await writeFile(destPath, content);\n}\n\nasync function copyLocalFile(srcPath: string, destPath: string): Promise<void> {\n if (!(await fileExists(srcPath))) {\n throw new Error(`Missing local file: ${srcPath}`);\n }\n await ensureDir(dirname(destPath));\n const content = await readFile(srcPath);\n await writeFile(destPath, content);\n}\n\nconst SOURCE_EXTENSIONS = [\".ts\", \".tsx\", \".js\", \".jsx\"];\n\nfunction isSourceFile(file: string): boolean {\n return SOURCE_EXTENSIONS.some((ext) => file.endsWith(ext));\n}\n\nasync function downloadModule(\n registry: Registry,\n moduleName: string,\n version: string,\n destDir: string,\n options?: CLIOptions,\n targetSubdir?: string,\n): Promise<string[]> {\n const module = registry.modules[moduleName];\n if (!module) {\n throw new Error(`Module ${moduleName} not found in registry`);\n }\n\n const sourcePath = resolveSourcePath(getSource(options || {}));\n if (sourcePath) {\n verboseLog(`Using local source: ${sourcePath}`, options);\n }\n verboseLog(`Downloading ${moduleName} files...`, options);\n\n const fromModuleDir = targetSubdir ?? moduleName;\n\n const modifiedFiles: string[] = [];\n const downloads = module.files.map(async (file: string) => {\n let destPath: string;\n\n if (module.fileMapping && module.fileMapping[file]) {\n destPath = join(destDir, module.fileMapping[file]);\n } else if (targetSubdir) {\n destPath = join(destDir, targetSubdir, file);\n } else {\n destPath = join(destDir, moduleName, file);\n }\n\n verboseLog(` Downloading ${file}...`, options);\n\n let content: string;\n if (sourcePath) {\n const primaryPath = join(sourcePath, \"modules\", moduleName, file);\n const fallbackPath = join(sourcePath, moduleName, file);\n const src = (await fileExists(primaryPath))\n ? primaryPath\n : (await fileExists(fallbackPath))\n ? fallbackPath\n : \"\";\n if (!src) throw new Error(`Missing local file: ${primaryPath}`);\n content = await readFile(src, \"utf-8\");\n } else {\n const url = `${GITHUB_RAW_URL}/v${version}/modules/${moduleName}/${file}`;\n const response = await fetch(url);\n if (!response.ok)\n throw new Error(`Failed to download ${url}: ${response.status}`);\n content = await response.text();\n }\n\n if (isSourceFile(file)) {\n content = replaceRavenImports(content, fromModuleDir, registry);\n }\n\n await ensureDir(dirname(destPath));\n await writeFile(destPath, content);\n modifiedFiles.push(destPath);\n });\n\n await Promise.all(downloads);\n return modifiedFiles;\n}\n\nasync function downloadAiResources(\n registry: Registry,\n version: string,\n destDir: string,\n options?: CLIOptions,\n): Promise<string[]> {\n const ai = registry.ai;\n if (!ai?.claude) {\n throw new Error(\"AI resources not found in registry\");\n }\n\n const mapping = ai.claude;\n const entries = Object.entries(mapping);\n\n const sourcePath = resolveSourcePath(getSource(options || {}));\n if (sourcePath) {\n verboseLog(`Using local source: ${sourcePath}`, options);\n }\n verboseLog(\"Downloading AI resources...\", options);\n\n const modifiedFiles: string[] = [];\n const downloads = entries.map(async ([file, destRel]) => {\n const destPath = join(destDir, destRel);\n verboseLog(` Downloading ${file}...`, options);\n\n if (sourcePath) {\n const sourceFile = join(sourcePath, \"packages\", \"ai\", file);\n await copyLocalFile(sourceFile, destPath);\n } else {\n const url = `${GITHUB_RAW_URL}/v${version}/packages/ai/${file}`;\n await downloadFile(url, destPath);\n }\n modifiedFiles.push(destPath);\n });\n\n await Promise.all(downloads);\n return modifiedFiles;\n}\n\nasync function cmdInit(options: CLIOptions) {\n const registry = await loadRegistry(options);\n const targetDir = cwd();\n const root = getRoot(options);\n const ravenDir = join(targetDir, root);\n\n verboseLog(`Initializing RavenJS in ${targetDir}`, options);\n\n const version = registry.version;\n const modifiedFiles: string[] = [];\n\n const ravenRootExists = await pathExists(ravenDir);\n const ravenYamlPath = join(ravenDir, \"raven.yaml\");\n const ravenYamlExists = await pathExists(ravenYamlPath);\n\n const doInit = async () => {\n if (!ravenRootExists || !ravenYamlExists) {\n await ensureDir(ravenDir);\n await createRavenYaml(ravenDir, version);\n modifiedFiles.push(ravenYamlPath);\n }\n\n const dotClaudeDir = join(targetDir, \".claude\");\n await ensureDir(dotClaudeDir);\n const aiFiles = await downloadAiResources(\n registry,\n version,\n targetDir,\n options,\n );\n modifiedFiles.push(...aiFiles);\n };\n\n if (options?.verbose) {\n await doInit();\n } else {\n const s = makeSpinner();\n s.start(\"Initializing RavenJS...\");\n try {\n await doInit();\n } catch (e: any) {\n s.stop(\"Initialization failed\");\n error(e.message);\n }\n s.stop(\"Initializing RavenJS...\");\n }\n\n success(\"RavenJS initialized successfully!\");\n\n printSectionHeader(\"Modified Files\");\n for (const file of modifiedFiles) {\n printListItem(file);\n }\n}\n\ninterface RavenYamlConfig {\n version: string;\n}\n\nasync function createRavenYaml(destDir: string, version: string) {\n const content = stringify({ version });\n await writeFile(join(destDir, \"raven.yaml\"), content);\n}\n\nasync function getInstalledModules(\n ravenDir: string,\n registry: Registry,\n): Promise<Set<string>> {\n const installed = new Set<string>();\n for (const name of getModuleNames(registry)) {\n const modDir = join(ravenDir, name);\n if ((await pathExists(modDir)) && !(await isDirEmpty(modDir))) {\n installed.add(name);\n }\n }\n return installed;\n}\n\nasync function cmdAdd(moduleName: string, options: CLIOptions) {\n const registry = await loadRegistry(options);\n if (!moduleName) {\n error(\n `Please specify a module to add. Available: ${getModuleNames(registry).join(\", \")}`,\n );\n }\n\n const available = getModuleNames(registry);\n\n if (!available.includes(moduleName)) {\n error(`Unknown module: ${moduleName}`);\n }\n\n const { ravenDir, version } = await ensureRavenInstalled(options);\n\n const installed = await getInstalledModules(ravenDir, registry);\n const order = getInstallOrder(moduleName, registry, installed);\n\n try {\n const modifiedFiles: string[] = [];\n const allDependencies: Record<string, string> = {};\n for (const name of order) {\n const files = await downloadModule(\n registry,\n name,\n version,\n ravenDir,\n options,\n );\n modifiedFiles.push(...files);\n const mod = registry.modules[name];\n if (mod?.dependencies) {\n Object.assign(allDependencies, mod.dependencies);\n }\n }\n\n console.log(\n JSON.stringify({\n success: true,\n moduleName,\n modifiedFiles,\n dependencies: allDependencies,\n }),\n );\n } catch (e: any) {\n error(e.message);\n }\n}\n\n// === SECTION: Status ===\n\ninterface ModuleInfo {\n name: string;\n description?: string;\n installed: boolean;\n /** 模块目录的绝对路径 */\n installDir?: string;\n}\n\ninterface StatusResult {\n modules: ModuleInfo[];\n version?: string;\n latestVersion?: string;\n modifiedFiles?: string[];\n fileHashes?: Record<string, string>;\n}\n\nasync function computeFileHash(filePath: string): Promise<string> {\n const content = await readFile(filePath);\n return createHash(\"sha256\").update(content).digest(\"hex\");\n}\n\nasync function getStatus(\n registry: Registry,\n options: CLIOptions,\n): Promise<StatusResult> {\n const targetDir = cwd();\n const root = getRoot(options);\n const ravenDir = join(targetDir, root);\n\n let currentVersion: string | undefined;\n const modifiedFiles: string[] = [];\n const fileHashes: Record<string, string> = {};\n\n const knownModules = getModuleNames(registry).sort();\n const moduleStatus: ModuleInfo[] = [];\n\n if (await pathExists(ravenDir)) {\n const yamlPath = join(ravenDir, \"raven.yaml\");\n try {\n const content = await readFile(yamlPath, \"utf-8\");\n const config = parse(content) as RavenYamlConfig;\n if (config?.version) {\n currentVersion = config.version;\n }\n } catch (_e) {\n // raven.yaml missing or invalid\n }\n\n for (const name of knownModules) {\n const modDir = join(ravenDir, name);\n const installed =\n (await pathExists(modDir)) && !(await isDirEmpty(modDir));\n const mod = registry.modules[name];\n moduleStatus.push({\n name,\n description: mod?.description,\n installed,\n installDir: resolve(modDir),\n });\n }\n\n // Compute file hashes for all files in raven/\n async function traverseDir(dir: string, baseDir: string) {\n const dirEntries = await readdir(dir, { withFileTypes: true });\n for (const e of dirEntries) {\n const fullPath = join(dir, e.name);\n const relPath = fullPath.slice(baseDir.length + 1);\n if (e.isDirectory()) {\n await traverseDir(fullPath, baseDir);\n } else {\n const hash = await computeFileHash(fullPath);\n fileHashes[relPath] = hash;\n }\n }\n }\n await traverseDir(ravenDir, ravenDir);\n }\n\n // Try to get latest version from GitHub\n let latestVersion: string | undefined;\n try {\n const response = await fetch(\n `https://api.github.com/repos/${GITHUB_REPO}/releases/latest`,\n );\n if (response.ok) {\n const data = await response.json();\n latestVersion = data.tag_name.replace(/^v/, \"\");\n }\n } catch (e) {\n // ignore if can't fetch latest version\n }\n\n if (moduleStatus.length === 0) {\n for (const name of knownModules) {\n const mod = registry.modules[name];\n const modDir = join(ravenDir, name);\n moduleStatus.push({\n name,\n description: mod?.description,\n installed: false,\n installDir: resolve(modDir),\n });\n }\n }\n\n return {\n modules: moduleStatus,\n version: currentVersion,\n latestVersion,\n modifiedFiles,\n fileHashes,\n };\n}\n\ninterface StatusCLIOptions extends CLIOptions {}\n\nasync function cmdStatus(options: StatusCLIOptions) {\n const registry = await loadRegistry(options);\n const status = await getStatus(registry, options);\n console.log(JSON.stringify(status));\n}\n\nasync function cmdGuide(moduleName: string, options: CLIOptions) {\n const { ravenDir } = await ensureRavenInstalled(options);\n\n const availableModules: string[] = [];\n try {\n const entries = await readdir(ravenDir, { withFileTypes: true });\n for (const entry of entries) {\n if (entry.isDirectory() && entry.name !== \".\") {\n availableModules.push(entry.name);\n }\n }\n } catch (e) {\n error(`Failed to list modules: ${e}`);\n }\n\n const moduleDir = join(ravenDir, moduleName);\n if (!(await pathExists(moduleDir))) {\n error(\n `Module '${moduleName}' not found.${availableModules.length > 0 ? ` Available: ${availableModules.join(\", \")}` : \"\"}`,\n );\n }\n\n const guidePath = join(moduleDir, \"GUIDE.md\");\n if (!(await pathExists(guidePath))) {\n error(`Module '${moduleName}' has no GUIDE.md. Cannot show guide.`);\n }\n\n const guideContent = await readFile(guidePath, \"utf-8\");\n console.log(guideContent);\n}\n\nconst cli = cac(\"raven\");\ncli.version(loadCliVersion()).help();\n\ncli\n .option(\"--registry <path>\", \"Registry json path (default: same dir as CLI)\")\n .option(\"--root <dir>\", \"RavenJS root directory (default: raven)\")\n .option(\"--source <path>\", \"Local module source path (default: github)\")\n .option(\"--verbose, -v\", \"Verbose output\");\n\ncli\n .command(\"init\", \"Initialize RavenJS AI resources\")\n .action((options) => cmdInit(options as CLIOptions));\n\ncli\n .command(\"add <module>\", \"Add a module (e.g., jtd-validator)\")\n .action((module, options) => cmdAdd(module, options as CLIOptions));\n\ncli\n .command(\"status\", \"Show RavenJS installation status (core, modules)\")\n .action((options) => cmdStatus(options as StatusCLIOptions));\n\ncli\n .command(\n \"guide <module>\",\n \"Get guide for a specific module (outputs module GUIDE.md)\",\n )\n .action((moduleName, options) => cmdGuide(moduleName, options as CLIOptions));\n\ncli.parse();\n"
5
+ "#!/usr/bin/env node\n\nimport { cac } from \"cac\";\nimport { mkdir, readdir, stat, readFile, writeFile, access } from \"fs/promises\";\nimport { join, dirname, resolve, isAbsolute } from \"path\";\nimport { cwd } from \"process\";\nimport { createHash } from \"crypto\";\nimport { fileURLToPath } from \"url\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\nimport pc from \"picocolors\";\nimport { spinner as makeSpinner, log } from \"@clack/prompts\";\nimport { parse, stringify } from \"yaml\";\n\nfunction loadCliVersion(): string {\n return process.env.RAVEN_CLI_VERSION ?? \"0.0.0\";\n}\n\nconst GITHUB_REPO = \"myWsq/RavenJS\";\nconst GITHUB_RAW_URL = `https://raw.githubusercontent.com/${GITHUB_REPO}`;\nconst DEFAULT_ROOT = \"raven\";\n\ninterface CLIOptions {\n verbose?: boolean;\n root?: string;\n source?: string;\n prerelease?: boolean;\n registry?: string;\n}\n\ninterface RegistryModule {\n files: string[];\n fileMapping?: Record<string, string>;\n dependencies?: Record<string, string>;\n dependsOn?: string[];\n description?: string;\n}\n\ninterface RegistryAi {\n claude: Record<string, string>;\n}\n\ninterface Registry {\n version: string;\n modules: Record<string, RegistryModule>;\n ai: RegistryAi;\n}\n\nasync function fileExists(path: string): Promise<boolean> {\n try {\n await access(path);\n return true;\n } catch {\n return false;\n }\n}\n\nasync function loadRegistry(options?: {\n registry?: string;\n}): Promise<Registry> {\n const candidates: string[] = [];\n if (options?.registry) {\n candidates.push(\n isAbsolute(options.registry)\n ? options.registry\n : resolve(cwd(), options.registry),\n );\n }\n if (process.env.RAVEN_DEFAULT_REGISTRY_PATH) {\n const p = process.env.RAVEN_DEFAULT_REGISTRY_PATH;\n candidates.push(isAbsolute(p) ? p : resolve(cwd(), p));\n }\n candidates.push(join(__dirname, \"registry.json\"));\n\n for (const p of candidates) {\n if (await fileExists(p)) {\n const content = await readFile(p, \"utf-8\");\n return JSON.parse(content) as Registry;\n }\n }\n console.error(\n \"registry.json not found. Run 'bun run build' in packages/cli first, or use --registry <path>.\",\n );\n process.exit(1);\n}\n\nfunction getRoot(options: CLIOptions): string {\n return options.root || process.env.RAVEN_ROOT || DEFAULT_ROOT;\n}\n\nfunction getSource(options: CLIOptions): string | undefined {\n return options.source || process.env.RAVEN_SOURCE;\n}\n\nfunction resolveSourcePath(source?: string): string | undefined {\n if (!source || source === \"github\") return undefined;\n return isAbsolute(source) ? source : resolve(cwd(), source);\n}\n\nasync function verboseLog(message: string, options?: CLIOptions) {\n if (options?.verbose) {\n console.log(message);\n }\n}\n\nfunction error(message: string): never {\n // Use stderr for programmatic consumption (e.g. tests, piping). @clack/prompts\n // log.error writes to stdout which breaks stderr-based assertions.\n console.error(message);\n process.exit(1);\n}\n\nfunction success(message: string) {\n log.success(message);\n}\n\nfunction printSectionHeader(title: string) {\n log.step(title);\n}\n\nfunction printListItem(item: string) {\n log.message(item, { symbol: pc.dim(\"-\") });\n}\n\nasync function ensureDir(path: string) {\n try {\n await mkdir(path, { recursive: true });\n } catch (e: any) {\n if (e.code !== \"EEXIST\") throw e;\n }\n}\n\nasync function isDirEmpty(path: string): Promise<boolean> {\n try {\n const entries = await readdir(path);\n return entries.length === 0;\n } catch (e: any) {\n if (e.code === \"ENOENT\") return true;\n throw e;\n }\n}\n\nasync function pathExists(path: string): Promise<boolean> {\n try {\n await stat(path);\n return true;\n } catch (e: any) {\n if (e.code === \"ENOENT\") return false;\n throw e;\n }\n}\n\nasync function ensureRavenInstalled(\n options: CLIOptions,\n): Promise<{ ravenDir: string; version: string }> {\n const targetDir = cwd();\n const root = getRoot(options);\n const ravenDir = join(targetDir, root);\n\n if (!(await pathExists(ravenDir))) {\n error(`RavenJS not installed at ${root}/. Run 'raven init' first.`);\n }\n\n const yamlPath = join(ravenDir, \"raven.yaml\");\n try {\n const content = await readFile(yamlPath, \"utf-8\");\n const config = parse(content) as RavenYamlConfig;\n if (!config?.version) {\n error(\"Invalid raven.yaml: version field is missing\");\n }\n return { ravenDir, version: config.version };\n } catch (e: any) {\n error(`Failed to load raven.yaml: ${e.message}`);\n }\n}\n\nfunction getModuleNames(registry: Registry): string[] {\n return Object.keys(registry.modules);\n}\n\nfunction getInstallOrder(\n moduleName: string,\n registry: Registry,\n installed: Set<string>,\n): string[] {\n const result: string[] = [];\n const visited = new Set<string>();\n const recStack = new Set<string>();\n const path: string[] = [];\n let cycle: string[] | null = null;\n\n function visit(name: string) {\n if (recStack.has(name)) {\n const idx = path.indexOf(name);\n cycle = path.slice(idx).concat(name);\n return;\n }\n if (visited.has(name)) return;\n visited.add(name);\n recStack.add(name);\n path.push(name);\n\n const mod = registry.modules[name];\n if (mod?.dependsOn) {\n for (const dep of mod.dependsOn) {\n if (registry.modules[dep]) visit(dep);\n }\n }\n if (!installed.has(name)) {\n result.push(name);\n }\n path.pop();\n recStack.delete(name);\n }\n\n visit(moduleName);\n if (cycle !== null) {\n error(`Circular dependency: ${(cycle as string[]).join(\" -> \")}`);\n }\n return result;\n}\n\nconst RAVENJS_PREFIX = \"@raven.js/\";\n\nfunction replaceRavenImports(\n content: string,\n fromModuleDir: string,\n registry: Registry,\n): string {\n const moduleNames = Object.keys(registry.modules);\n let out = content;\n const depth = fromModuleDir.split(\"/\").filter(Boolean).length;\n const prefix = depth > 0 ? \"../\".repeat(depth) : \"./\";\n for (const modName of moduleNames) {\n const pkg = `${RAVENJS_PREFIX}${modName}`;\n const rel = prefix + modName;\n\n const dq = new RegExp(\n `from\\\\s+\"${pkg.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")}\"`,\n \"g\",\n );\n const sq = new RegExp(\n `from\\\\s+'${pkg.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")}'`,\n \"g\",\n );\n out = out.replace(dq, `from \"${rel}\"`).replace(sq, `from '${rel}'`);\n }\n return out;\n}\n\nasync function downloadFile(url: string, destPath: string): Promise<void> {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(`Failed to download ${url}: ${response.status}`);\n }\n const content = await response.text();\n await ensureDir(dirname(destPath));\n await writeFile(destPath, content);\n}\n\nasync function copyLocalFile(srcPath: string, destPath: string): Promise<void> {\n if (!(await fileExists(srcPath))) {\n throw new Error(`Missing local file: ${srcPath}`);\n }\n await ensureDir(dirname(destPath));\n const content = await readFile(srcPath);\n await writeFile(destPath, content);\n}\n\nconst SOURCE_EXTENSIONS = [\".ts\", \".tsx\", \".js\", \".jsx\"];\n\nfunction isSourceFile(file: string): boolean {\n return SOURCE_EXTENSIONS.some((ext) => file.endsWith(ext));\n}\n\nasync function downloadModule(\n registry: Registry,\n moduleName: string,\n version: string,\n destDir: string,\n options?: CLIOptions,\n targetSubdir?: string,\n): Promise<string[]> {\n const module = registry.modules[moduleName];\n if (!module) {\n throw new Error(`Module ${moduleName} not found in registry`);\n }\n\n const sourcePath = resolveSourcePath(getSource(options || {}));\n if (sourcePath) {\n verboseLog(`Using local source: ${sourcePath}`, options);\n }\n verboseLog(`Downloading ${moduleName} files...`, options);\n\n const fromModuleDir = targetSubdir ?? moduleName;\n\n const modifiedFiles: string[] = [];\n const downloads = module.files.map(async (file: string) => {\n let destPath: string;\n\n if (module.fileMapping && module.fileMapping[file]) {\n destPath = join(destDir, module.fileMapping[file]);\n } else if (targetSubdir) {\n destPath = join(destDir, targetSubdir, file);\n } else {\n destPath = join(destDir, moduleName, file);\n }\n\n verboseLog(` Downloading ${file}...`, options);\n\n let content: string;\n if (sourcePath) {\n const primaryPath = join(sourcePath, \"modules\", moduleName, file);\n const fallbackPath = join(sourcePath, moduleName, file);\n const src = (await fileExists(primaryPath))\n ? primaryPath\n : (await fileExists(fallbackPath))\n ? fallbackPath\n : \"\";\n if (!src) throw new Error(`Missing local file: ${primaryPath}`);\n content = await readFile(src, \"utf-8\");\n } else {\n const url = `${GITHUB_RAW_URL}/v${version}/modules/${moduleName}/${file}`;\n const response = await fetch(url);\n if (!response.ok)\n throw new Error(`Failed to download ${url}: ${response.status}`);\n content = await response.text();\n }\n\n if (isSourceFile(file)) {\n content = replaceRavenImports(content, fromModuleDir, registry);\n }\n\n await ensureDir(dirname(destPath));\n await writeFile(destPath, content);\n modifiedFiles.push(destPath);\n });\n\n await Promise.all(downloads);\n return modifiedFiles;\n}\n\nasync function downloadAiResources(\n registry: Registry,\n version: string,\n destDir: string,\n options?: CLIOptions,\n): Promise<string[]> {\n const ai = registry.ai;\n if (!ai?.claude) {\n throw new Error(\"AI resources not found in registry\");\n }\n\n const mapping = ai.claude;\n const entries = Object.entries(mapping);\n\n const sourcePath = resolveSourcePath(getSource(options || {}));\n if (sourcePath) {\n verboseLog(`Using local source: ${sourcePath}`, options);\n }\n verboseLog(\"Downloading AI resources...\", options);\n\n const modifiedFiles: string[] = [];\n const downloads = entries.map(async ([file, destRel]) => {\n const destPath = join(destDir, destRel);\n verboseLog(` Downloading ${file}...`, options);\n\n if (sourcePath) {\n const sourceFile = join(sourcePath, \"packages\", \"ai\", file);\n await copyLocalFile(sourceFile, destPath);\n } else {\n const url = `${GITHUB_RAW_URL}/v${version}/packages/ai/${file}`;\n await downloadFile(url, destPath);\n }\n modifiedFiles.push(destPath);\n });\n\n await Promise.all(downloads);\n return modifiedFiles;\n}\n\nasync function cmdInit(options: CLIOptions) {\n const registry = await loadRegistry(options);\n const targetDir = cwd();\n const root = getRoot(options);\n const ravenDir = join(targetDir, root);\n\n verboseLog(`Initializing RavenJS in ${targetDir}`, options);\n\n const version = registry.version;\n const modifiedFiles: string[] = [];\n\n const ravenRootExists = await pathExists(ravenDir);\n const ravenYamlPath = join(ravenDir, \"raven.yaml\");\n const ravenYamlExists = await pathExists(ravenYamlPath);\n\n const doInit = async () => {\n if (!ravenRootExists || !ravenYamlExists) {\n await ensureDir(ravenDir);\n await createRavenYaml(ravenDir, version);\n modifiedFiles.push(ravenYamlPath);\n }\n\n const dotClaudeDir = join(targetDir, \".claude\");\n await ensureDir(dotClaudeDir);\n const aiFiles = await downloadAiResources(\n registry,\n version,\n targetDir,\n options,\n );\n modifiedFiles.push(...aiFiles);\n };\n\n if (options?.verbose) {\n await doInit();\n } else {\n const s = makeSpinner();\n s.start(\"Initializing RavenJS...\");\n try {\n await doInit();\n } catch (e: any) {\n s.stop(\"Initialization failed\");\n error(e.message);\n }\n s.stop(\"Initializing RavenJS...\");\n }\n\n success(\"RavenJS initialized successfully!\");\n\n printSectionHeader(\"Modified Files\");\n for (const file of modifiedFiles) {\n printListItem(file);\n }\n}\n\ninterface RavenYamlConfig {\n version: string;\n}\n\nasync function createRavenYaml(destDir: string, version: string) {\n const content = stringify({ version });\n await writeFile(join(destDir, \"raven.yaml\"), content);\n}\n\nasync function getInstalledModules(\n ravenDir: string,\n registry: Registry,\n): Promise<Set<string>> {\n const installed = new Set<string>();\n for (const name of getModuleNames(registry)) {\n const modDir = join(ravenDir, name);\n if ((await pathExists(modDir)) && !(await isDirEmpty(modDir))) {\n installed.add(name);\n }\n }\n return installed;\n}\n\nasync function cmdAdd(moduleName: string, options: CLIOptions) {\n const registry = await loadRegistry(options);\n if (!moduleName) {\n error(\n `Please specify a module to add. Available: ${getModuleNames(registry).join(\", \")}`,\n );\n }\n\n const available = getModuleNames(registry);\n\n if (!available.includes(moduleName)) {\n error(`Unknown module: ${moduleName}`);\n }\n\n const { ravenDir, version } = await ensureRavenInstalled(options);\n\n const installed = await getInstalledModules(ravenDir, registry);\n const order = getInstallOrder(moduleName, registry, installed);\n\n try {\n const modifiedFiles: string[] = [];\n const allDependencies: Record<string, string> = {};\n for (const name of order) {\n const files = await downloadModule(\n registry,\n name,\n version,\n ravenDir,\n options,\n );\n modifiedFiles.push(...files);\n const mod = registry.modules[name];\n if (mod?.dependencies) {\n Object.assign(allDependencies, mod.dependencies);\n }\n }\n\n console.log(\n JSON.stringify({\n success: true,\n moduleName,\n modifiedFiles,\n dependencies: allDependencies,\n }),\n );\n } catch (e: any) {\n error(e.message);\n }\n}\n\n// === SECTION: Status ===\n\ninterface ModuleInfo {\n name: string;\n description?: string;\n installed: boolean;\n /** 模块目录的绝对路径 */\n installDir?: string;\n}\n\ninterface StatusResult {\n modules: ModuleInfo[];\n version?: string;\n latestVersion?: string;\n modifiedFiles?: string[];\n fileHashes?: Record<string, string>;\n}\n\nasync function computeFileHash(filePath: string): Promise<string> {\n const content = await readFile(filePath);\n return createHash(\"sha256\").update(content).digest(\"hex\");\n}\n\nasync function getStatus(\n registry: Registry,\n options: CLIOptions,\n): Promise<StatusResult> {\n const targetDir = cwd();\n const root = getRoot(options);\n const ravenDir = join(targetDir, root);\n\n let currentVersion: string | undefined;\n const modifiedFiles: string[] = [];\n const fileHashes: Record<string, string> = {};\n\n const knownModules = getModuleNames(registry).sort();\n const moduleStatus: ModuleInfo[] = [];\n\n if (await pathExists(ravenDir)) {\n const yamlPath = join(ravenDir, \"raven.yaml\");\n try {\n const content = await readFile(yamlPath, \"utf-8\");\n const config = parse(content) as RavenYamlConfig;\n if (config?.version) {\n currentVersion = config.version;\n }\n } catch (_e) {\n // raven.yaml missing or invalid\n }\n\n for (const name of knownModules) {\n const modDir = join(ravenDir, name);\n const installed =\n (await pathExists(modDir)) && !(await isDirEmpty(modDir));\n const mod = registry.modules[name];\n moduleStatus.push({\n name,\n description: mod?.description,\n installed,\n installDir: resolve(modDir),\n });\n }\n\n // Compute file hashes for all files in raven/\n async function traverseDir(dir: string, baseDir: string) {\n const dirEntries = await readdir(dir, { withFileTypes: true });\n for (const e of dirEntries) {\n const fullPath = join(dir, e.name);\n const relPath = fullPath.slice(baseDir.length + 1);\n if (e.isDirectory()) {\n await traverseDir(fullPath, baseDir);\n } else {\n const hash = await computeFileHash(fullPath);\n fileHashes[relPath] = hash;\n }\n }\n }\n await traverseDir(ravenDir, ravenDir);\n }\n\n // Try to get latest version from GitHub\n let latestVersion: string | undefined;\n try {\n const response = await fetch(\n `https://api.github.com/repos/${GITHUB_REPO}/releases/latest`,\n );\n if (response.ok) {\n const data = await response.json();\n latestVersion = data.tag_name.replace(/^v/, \"\");\n }\n } catch (e) {\n // ignore if can't fetch latest version\n }\n\n if (moduleStatus.length === 0) {\n for (const name of knownModules) {\n const mod = registry.modules[name];\n const modDir = join(ravenDir, name);\n moduleStatus.push({\n name,\n description: mod?.description,\n installed: false,\n installDir: resolve(modDir),\n });\n }\n }\n\n return {\n modules: moduleStatus,\n version: currentVersion,\n latestVersion,\n modifiedFiles,\n fileHashes,\n };\n}\n\ninterface StatusCLIOptions extends CLIOptions {}\n\nasync function cmdStatus(options: StatusCLIOptions) {\n const registry = await loadRegistry(options);\n const status = await getStatus(registry, options);\n console.log(JSON.stringify(status));\n}\n\nconst cli = cac(\"raven\");\ncli.version(loadCliVersion()).help();\n\ncli\n .option(\"--registry <path>\", \"Registry json path (default: same dir as CLI)\")\n .option(\"--root <dir>\", \"RavenJS root directory (default: raven)\")\n .option(\"--source <path>\", \"Local module source path (default: github)\")\n .option(\"--verbose, -v\", \"Verbose output\");\n\ncli\n .command(\"init\", \"Initialize RavenJS AI resources\")\n .action((options) => cmdInit(options as CLIOptions));\n\ncli\n .command(\"add <module>\", \"Add a module (e.g., core)\")\n .action((module, options) => cmdAdd(module, options as CLIOptions));\n\ncli\n .command(\"status\", \"Show RavenJS installation status (core, modules)\")\n .action((options) => cmdStatus(options as StatusCLIOptions));\n\ncli.parse();\n"
6
6
  ],
7
- "mappings": ";;;AAEA;AACA;AACA;AACA;AACA;AACA;AAGA;AACA,oBAAS;AACT;AAHA,IAAM,aAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;AAKxD,SAAS,cAAc,GAAW;AAChC,SAAO,QAAQ,IAAI,qBAAqB;AAAA;AAG1C,IAAM,cAAc;AACpB,IAAM,iBAAiB,qCAAqC;AAC5D,IAAM,eAAe;AA4BrB,eAAe,UAAU,CAAC,MAAgC;AACxD,MAAI;AACF,UAAM,OAAO,IAAI;AACjB,WAAO;AAAA,UACP;AACA,WAAO;AAAA;AAAA;AAIX,eAAe,YAAY,CAAC,SAEN;AACpB,QAAM,aAAuB,CAAC;AAC9B,MAAI,SAAS,UAAU;AACrB,eAAW,KACT,WAAW,QAAQ,QAAQ,IACvB,QAAQ,WACR,QAAQ,IAAI,GAAG,QAAQ,QAAQ,CACrC;AAAA,EACF;AACA,MAAI,QAAQ,IAAI,6BAA6B;AAC3C,UAAM,IAAI,QAAQ,IAAI;AACtB,eAAW,KAAK,WAAW,CAAC,IAAI,IAAI,QAAQ,IAAI,GAAG,CAAC,CAAC;AAAA,EACvD;AACA,aAAW,KAAK,KAAK,YAAW,eAAe,CAAC;AAEhD,aAAW,KAAK,YAAY;AAC1B,QAAI,MAAM,WAAW,CAAC,GAAG;AACvB,YAAM,UAAU,MAAM,SAAS,GAAG,OAAO;AACzC,aAAO,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CAAC;AAErD,IACG,QAAQ,gBAAgB,2BAA2B,EACnD,OAAO,CAAC,QAAQ,YAAY,OAAO,QAAQ,OAAqB,CAAC;AAEpE,IACG,QAAQ,UAAU,kDAAkD,EACpE,OAAO,CAAC,YAAY,UAAU,OAA2B,CAAC;AAE7D,IAAI,MAAM;",
8
+ "debugId": "BB7C5D0CB5BDF0EF64756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,31 +1,29 @@
1
1
  {
2
- "version": "1.0.1",
2
+ "version": "1.1.0-alpha.1",
3
3
  "modules": {
4
- "core": {
4
+ "schema-validator": {
5
5
  "files": [
6
6
  "GUIDE.md",
7
7
  "README.md",
8
8
  "index.ts",
9
- "router.ts",
10
9
  "standard-schema.ts"
11
10
  ],
12
11
  "dependencies": {},
13
- "dependsOn": [],
14
- "description": "RavenJS core framework providing HTTP services, routing, hooks, and state management. Designed for building web services and handling request/response cycles."
12
+ "dependsOn": [
13
+ "core"
14
+ ],
15
+ "description": "Validation helper based on Standard Schema. Use this module when you need to validate request data (body, query, params, headers) using Zod, Valibot, or ArkType, and want type-safe context in handlers."
15
16
  },
16
- "jtd-validator": {
17
+ "core": {
17
18
  "files": [
18
19
  "GUIDE.md",
19
20
  "README.md",
20
- "index.ts"
21
- ],
22
- "dependencies": {
23
- "ajv": "^8.18.0"
24
- },
25
- "dependsOn": [
26
- "core"
21
+ "index.ts",
22
+ "router.ts"
27
23
  ],
28
- "description": "JTD (JSON Type Definition) data validator. Used for validating request parameters, bodies, and other user input to ensure data conforms to the expected format."
24
+ "dependencies": {},
25
+ "dependsOn": [],
26
+ "description": "RavenJS core framework providing HTTP services, routing, hooks, and state management. Designed for building web services and handling request/response cycles."
29
27
  }
30
28
  },
31
29
  "ai": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raven.js/cli",
3
- "version": "1.0.1",
3
+ "version": "1.1.0-alpha.1",
4
4
  "description": "CLI tool for RavenJS framework",
5
5
  "type": "module",
6
6
  "scripts": {