@raven.js/cli 1.0.0-alpha.24 → 1.0.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 ADDED
@@ -0,0 +1,31 @@
1
+ # RavenJS CLI
2
+
3
+ The RavenJS CLI is designed for **Agent consumption**. AI skills (raven-setup, raven-add, raven-learn, raven-use) invoke it via `bunx raven`. Humans typically run only `bunx raven init`; all other workflows go through skills.
4
+
5
+ **Install**: Project-local (recommended). Requires Bun `>=1.0`:
6
+
7
+ ```bash
8
+ bun add -d @raven.js/cli
9
+ ```
10
+
11
+ ## Commands
12
+
13
+ | Command | Description |
14
+ |---------|-------------|
15
+ | `bunx raven init` | Initialize AI skills and raven root. Run once before using raven-setup. |
16
+ | `bunx raven add <module>` | Add a module. Installs dependencies (`dependsOn`) in topological order, copies files, and rewrites `@ravenjs/*` imports to relative paths. |
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
+
20
+ ## Options
21
+
22
+ | Option | Description |
23
+ |--------|-------------|
24
+ | `--root <dir>` | RavenJS root directory (default: `raven`). Overridable via `RAVEN_ROOT`. |
25
+ | `--source <path>` | Local module source path instead of GitHub. Overridable via `RAVEN_SOURCE`. |
26
+ | `--registry <path>` | Path to registry JSON (default: bundled with CLI). Overridable via `RAVEN_DEFAULT_REGISTRY_PATH`. |
27
+ | `--verbose, -v` | Verbose output. |
28
+
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
@@ -1,20 +1,30 @@
1
- #!/usr/bin/env bun
2
- // @bun
1
+ #!/usr/bin/env node
3
2
 
4
3
  // index.ts
5
4
  import { cac } from "cac";
6
- import { mkdir, readdir, stat } from "fs/promises";
5
+ import { mkdir, readdir, stat, readFile, writeFile, access } from "fs/promises";
7
6
  import { join, dirname, resolve, isAbsolute } from "path";
8
7
  import { cwd } from "process";
8
+ import { createHash } from "crypto";
9
+ import { fileURLToPath } from "url";
9
10
  import pc from "picocolors";
10
11
  import { spinner as makeSpinner, log } from "@clack/prompts";
11
12
  import { parse, stringify } from "yaml";
13
+ var __dirname2 = dirname(fileURLToPath(import.meta.url));
12
14
  function loadCliVersion() {
13
15
  return process.env.RAVEN_CLI_VERSION ?? "0.0.0";
14
16
  }
15
17
  var GITHUB_REPO = "myWsq/RavenJS";
16
18
  var GITHUB_RAW_URL = `https://raw.githubusercontent.com/${GITHUB_REPO}`;
17
19
  var DEFAULT_ROOT = "raven";
20
+ async function fileExists(path) {
21
+ try {
22
+ await access(path);
23
+ return true;
24
+ } catch {
25
+ return false;
26
+ }
27
+ }
18
28
  async function loadRegistry(options) {
19
29
  const candidates = [];
20
30
  if (options?.registry) {
@@ -24,11 +34,12 @@ async function loadRegistry(options) {
24
34
  const p = process.env.RAVEN_DEFAULT_REGISTRY_PATH;
25
35
  candidates.push(isAbsolute(p) ? p : resolve(cwd(), p));
26
36
  }
27
- candidates.push(join(import.meta.dir, "registry.json"));
37
+ candidates.push(join(__dirname2, "registry.json"));
28
38
  for (const p of candidates) {
29
- const exists = await Bun.file(p).exists();
30
- if (exists)
31
- return await Bun.file(p).json();
39
+ if (await fileExists(p)) {
40
+ const content = await readFile(p, "utf-8");
41
+ return JSON.parse(content);
42
+ }
32
43
  }
33
44
  console.error("registry.json not found. Run 'bun run build' in packages/cli first, or use --registry <path>.");
34
45
  process.exit(1);
@@ -99,7 +110,7 @@ async function ensureRavenInstalled(options) {
99
110
  }
100
111
  const yamlPath = join(ravenDir, "raven.yaml");
101
112
  try {
102
- const content = await Bun.file(yamlPath).text();
113
+ const content = await readFile(yamlPath, "utf-8");
103
114
  const config = parse(content);
104
115
  if (!config?.version) {
105
116
  error("Invalid raven.yaml: version field is missing");
@@ -170,15 +181,15 @@ async function downloadFile(url, destPath) {
170
181
  }
171
182
  const content = await response.text();
172
183
  await ensureDir(dirname(destPath));
173
- await Bun.write(destPath, content);
184
+ await writeFile(destPath, content);
174
185
  }
175
186
  async function copyLocalFile(srcPath, destPath) {
176
- const exists = await Bun.file(srcPath).exists();
177
- if (!exists) {
187
+ if (!await fileExists(srcPath)) {
178
188
  throw new Error(`Missing local file: ${srcPath}`);
179
189
  }
180
190
  await ensureDir(dirname(destPath));
181
- await Bun.write(destPath, Bun.file(srcPath));
191
+ const content = await readFile(srcPath);
192
+ await writeFile(destPath, content);
182
193
  }
183
194
  var SOURCE_EXTENSIONS = [".ts", ".tsx", ".js", ".jsx"];
184
195
  function isSourceFile(file) {
@@ -210,10 +221,10 @@ async function downloadModule(registry, moduleName, version, destDir, options, t
210
221
  if (sourcePath) {
211
222
  const primaryPath = join(sourcePath, "modules", moduleName, file);
212
223
  const fallbackPath = join(sourcePath, moduleName, file);
213
- const src = await Bun.file(primaryPath).exists() ? primaryPath : await Bun.file(fallbackPath).exists() ? fallbackPath : "";
224
+ const src = await fileExists(primaryPath) ? primaryPath : await fileExists(fallbackPath) ? fallbackPath : "";
214
225
  if (!src)
215
226
  throw new Error(`Missing local file: ${primaryPath}`);
216
- content = await Bun.file(src).text();
227
+ content = await readFile(src, "utf-8");
217
228
  } else {
218
229
  const url = `${GITHUB_RAW_URL}/v${version}/modules/${moduleName}/${file}`;
219
230
  const response = await fetch(url);
@@ -225,7 +236,7 @@ async function downloadModule(registry, moduleName, version, destDir, options, t
225
236
  content = replaceRavenImports(content, fromModuleDir, registry);
226
237
  }
227
238
  await ensureDir(dirname(destPath));
228
- await Bun.write(destPath, content);
239
+ await writeFile(destPath, content);
229
240
  modifiedFiles.push(destPath);
230
241
  });
231
242
  await Promise.all(downloads);
@@ -302,7 +313,7 @@ async function cmdInit(options) {
302
313
  }
303
314
  async function createRavenYaml(destDir, version) {
304
315
  const content = stringify({ version });
305
- await Bun.write(join(destDir, "raven.yaml"), content);
316
+ await writeFile(join(destDir, "raven.yaml"), content);
306
317
  }
307
318
  async function getInstalledModules(ravenDir, registry) {
308
319
  const installed = new Set;
@@ -337,16 +348,19 @@ async function cmdAdd(moduleName, options) {
337
348
  Object.assign(allDependencies, mod.dependencies);
338
349
  }
339
350
  }
340
- console.log(JSON.stringify({ success: true, moduleName, modifiedFiles, dependencies: allDependencies }));
351
+ console.log(JSON.stringify({
352
+ success: true,
353
+ moduleName,
354
+ modifiedFiles,
355
+ dependencies: allDependencies
356
+ }));
341
357
  } catch (e) {
342
358
  error(e.message);
343
359
  }
344
360
  }
345
361
  async function computeFileHash(filePath) {
346
- const content = await Bun.file(filePath).bytes();
347
- const hasher = new Bun.CryptoHasher("sha256");
348
- hasher.update(content);
349
- return hasher.digest("hex");
362
+ const content = await readFile(filePath);
363
+ return createHash("sha256").update(content).digest("hex");
350
364
  }
351
365
  async function getStatus(registry, options) {
352
366
  const targetDir = cwd();
@@ -360,7 +374,7 @@ async function getStatus(registry, options) {
360
374
  if (await pathExists(ravenDir)) {
361
375
  const yamlPath = join(ravenDir, "raven.yaml");
362
376
  try {
363
- const content = await Bun.file(yamlPath).text();
377
+ const content = await readFile(yamlPath, "utf-8");
364
378
  const config = parse(content);
365
379
  if (config?.version) {
366
380
  currentVersion = config.version;
@@ -373,8 +387,9 @@ async function getStatus(registry, options) {
373
387
  const mod = registry.modules[name];
374
388
  moduleStatus.push({
375
389
  name,
390
+ description: mod?.description,
376
391
  installed,
377
- description: mod?.description
392
+ installDir: resolve(modDir)
378
393
  });
379
394
  }
380
395
  async function traverseDir(dir, baseDir) {
@@ -404,7 +419,13 @@ async function getStatus(registry, options) {
404
419
  if (moduleStatus.length === 0) {
405
420
  for (const name of knownModules) {
406
421
  const mod = registry.modules[name];
407
- moduleStatus.push({ name, installed: false, description: mod?.description });
422
+ const modDir = join(ravenDir, name);
423
+ moduleStatus.push({
424
+ name,
425
+ description: mod?.description,
426
+ installed: false,
427
+ installDir: resolve(modDir)
428
+ });
408
429
  }
409
430
  }
410
431
  return {
@@ -437,37 +458,12 @@ async function cmdGuide(moduleName, options) {
437
458
  if (!await pathExists(moduleDir)) {
438
459
  error(`Module '${moduleName}' not found.${availableModules.length > 0 ? ` Available: ${availableModules.join(", ")}` : ""}`);
439
460
  }
440
- const output = [];
441
- const readmePath = join(moduleDir, "README.md");
442
- if (await pathExists(readmePath)) {
443
- const readmeContent = await Bun.file(readmePath).text();
444
- output.push("<readme>");
445
- output.push(readmeContent);
446
- output.push("</readme>");
447
- output.push("");
448
- }
449
- async function collectCodeFiles(dir, baseDir) {
450
- const entries = await readdir(dir, { withFileTypes: true });
451
- for (const entry of entries) {
452
- const fullPath = join(dir, entry.name);
453
- if (entry.isDirectory()) {
454
- await collectCodeFiles(fullPath, baseDir);
455
- } else if (entry.isFile()) {
456
- const relPath = fullPath.slice(baseDir.length + 1);
457
- const content = await Bun.file(fullPath).text();
458
- output.push(`<code>`);
459
- output.push(`File: ${relPath}`);
460
- output.push(`\`\`\``);
461
- output.push(content);
462
- output.push("```");
463
- output.push("</code>");
464
- output.push("");
465
- }
466
- }
461
+ const guidePath = join(moduleDir, "GUIDE.md");
462
+ if (!await pathExists(guidePath)) {
463
+ error(`Module '${moduleName}' has no GUIDE.md. Cannot show guide.`);
467
464
  }
468
- await collectCodeFiles(moduleDir, moduleDir);
469
- console.log(output.join(`
470
- `));
465
+ const guideContent = await readFile(guidePath, "utf-8");
466
+ console.log(guideContent);
471
467
  }
472
468
  var cli = cac("raven");
473
469
  cli.version(loadCliVersion()).help();
@@ -475,8 +471,8 @@ cli.option("--registry <path>", "Registry json path (default: same dir as CLI)")
475
471
  cli.command("init", "Initialize RavenJS AI resources").action((options) => cmdInit(options));
476
472
  cli.command("add <module>", "Add a module (e.g., jtd-validator)").action((module, options) => cmdAdd(module, options));
477
473
  cli.command("status", "Show RavenJS installation status (core, modules)").action((options) => cmdStatus(options));
478
- cli.command("guide <module>", "Get guide for a specific module (outputs README and source code)").action((moduleName, options) => cmdGuide(moduleName, options));
474
+ cli.command("guide <module>", "Get guide for a specific module (outputs module GUIDE.md)").action((moduleName, options) => cmdGuide(moduleName, options));
479
475
  cli.parse();
480
476
 
481
- //# debugId=7F5651AB289BE2E864756E2164756E21
477
+ //# debugId=CFDA2FD99DBE500164756E2164756E21
482
478
  //# 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 bun\n\nimport { cac } from \"cac\";\nimport { mkdir, rm, readdir, stat } from \"fs/promises\";\nimport { join, dirname, resolve, isAbsolute } from \"path\";\nimport { cwd } from \"process\";\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 loadRegistry(options?: { registry?: string }): Promise<Registry> {\n const candidates: string[] = [];\n if (options?.registry) {\n candidates.push(isAbsolute(options.registry) ? options.registry : resolve(cwd(), options.registry));\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(import.meta.dir, \"registry.json\"));\n\n for (const p of candidates) {\n const exists = await Bun.file(p).exists();\n if (exists) return (await Bun.file(p).json()) as Registry;\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(options: CLIOptions): 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 Bun.file(yamlPath).text();\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(`from\\\\s+\"${pkg.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")}\"`, \"g\");\n const sq = new RegExp(`from\\\\s+'${pkg.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\")}'`, \"g\");\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 Bun.write(destPath, content);\n}\n\nasync function copyLocalFile(srcPath: string, destPath: string): Promise<void> {\n const exists = await Bun.file(srcPath).exists();\n if (!exists) {\n throw new Error(`Missing local file: ${srcPath}`);\n }\n await ensureDir(dirname(destPath));\n await Bun.write(destPath, Bun.file(srcPath));\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 Bun.file(primaryPath).exists())\n ? primaryPath\n : (await Bun.file(fallbackPath).exists())\n ? fallbackPath\n : \"\";\n if (!src) throw new Error(`Missing local file: ${primaryPath}`);\n content = await Bun.file(src).text();\n } else {\n const url = `${GITHUB_RAW_URL}/v${version}/modules/${moduleName}/${file}`;\n const response = await fetch(url);\n if (!response.ok) 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 Bun.write(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(registry, version, targetDir, options);\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 Bun.write(join(destDir, \"raven.yaml\"), content);\n}\n\nasync function getInstalledModules(ravenDir: string, registry: Registry): 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(`Please specify a module to add. Available: ${getModuleNames(registry).join(\", \")}`);\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(registry, name, version, ravenDir, options);\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(JSON.stringify({ success: true, moduleName, modifiedFiles, dependencies: allDependencies }));\n } catch (e: any) {\n error(e.message);\n }\n}\n\n// === SECTION: Status ===\n\ninterface ModuleStatus {\n name: string;\n installed: boolean;\n description?: string;\n}\n\ninterface StatusResult {\n modules: ModuleStatus[];\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 Bun.file(filePath).bytes();\n const hasher = new Bun.CryptoHasher(\"sha256\");\n hasher.update(content);\n return hasher.digest(\"hex\");\n}\n\nasync function getStatus(registry: Registry, options: CLIOptions): 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: ModuleStatus[] = [];\n\n if (await pathExists(ravenDir)) {\n const yamlPath = join(ravenDir, \"raven.yaml\");\n try {\n const content = await Bun.file(yamlPath).text();\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 installed,\n description: mod?.description,\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 moduleStatus.push({ name, installed: false, description: mod?.description });\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 output: string[] = [];\n\n const readmePath = join(moduleDir, \"README.md\");\n if (await pathExists(readmePath)) {\n const readmeContent = await Bun.file(readmePath).text();\n output.push(\"<readme>\");\n output.push(readmeContent);\n output.push(\"</readme>\");\n output.push(\"\");\n }\n\n async function collectCodeFiles(dir: string, baseDir: string) {\n const entries = await readdir(dir, { withFileTypes: true });\n for (const entry of entries) {\n const fullPath = join(dir, entry.name);\n if (entry.isDirectory()) {\n await collectCodeFiles(fullPath, baseDir);\n } else if (entry.isFile()) {\n const relPath = fullPath.slice(baseDir.length + 1);\n const content = await Bun.file(fullPath).text();\n output.push(`<code>`);\n output.push(`File: ${relPath}`);\n output.push(`\\`\\`\\``);\n output.push(content);\n output.push(\"```\");\n output.push(\"</code>\");\n output.push(\"\");\n }\n }\n }\n\n await collectCodeFiles(moduleDir, moduleDir);\n\n console.log(output.join(\"\\n\"));\n}\n\nconst cli = cac(\"raven\");\ncli.version(loadCliVersion()).help();\n\ncli\n .option(\n \"--registry <path>\",\n \"Registry json path (default: same dir as CLI)\",\n )\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\n\ncli\n .command(\"status\", \"Show RavenJS installation status (core, modules)\")\n .action((options) => cmdStatus(options as StatusCLIOptions));\n\n\ncli\n .command(\"guide <module>\", \"Get guide for a specific module (outputs README and source code)\")\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\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"
6
6
  ],
7
- "mappings": ";;;;AAEA;AACA;AACA;AACA;AACA;AACA,oBAAS;AACT;AAEA,SAAS,cAAc,GAAW;AAChC,SAAO,QAAQ,IAAI,qBAAqB;AAAA;AAG1C,IAAM,cAAc;AACpB,IAAM,iBAAiB,qCAAqC;AAC5D,IAAM,eAAe;AA4BrB,eAAe,YAAY,CAAC,SAAoD;AAC9E,QAAM,aAAuB,CAAC;AAC9B,MAAI,SAAS,UAAU;AACrB,eAAW,KAAK,WAAW,QAAQ,QAAQ,IAAI,QAAQ,WAAW,QAAQ,IAAI,GAAG,QAAQ,QAAQ,CAAC;AAAA,EACpG;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,YAAY,KAAK,eAAe,CAAC;AAEtD,aAAW,KAAK,YAAY;AAC1B,UAAM,SAAS,MAAM,IAAI,KAAK,CAAC,EAAE,O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EACpE;AAEA,QAAM,eAAe,MAAM,SAAS,WAAW,OAAO;AACtD,UAAQ,IAAI,YAAY;AAAA;AAG1B,IAAM,MAAM,IAAI,OAAO;AACvB,IAAI,QAAQ,eAAe,CAAC,EAAE,KAAK;AAEnC,IACG,OAAO,qBAAqB,+CAA+C,EAC3E,OAAO,gBAAgB,yCAAyC,EAChE,OAAO,mBAAmB,4CAA4C,EACtE,OAAO,iBAAiB,gBAAgB;AAE3C,IACG,QAAQ,QAAQ,iCAAiC,EACjD,OAAO,CAAC,YAAY,QAAQ,OAAqB,CAAC;AAErD,IACG,QAAQ,gBAAgB,oCAAoC,EAC5D,OAAO,CAAC,QAAQ,YAAY,OAAO,QAAQ,OAAqB,CAAC;AAEpE,IACG,QAAQ,UAAU,kDAAkD,EACpE,OAAO,CAAC,YAAY,UAAU,OAA2B,CAAC;AAE7D,IACG,QACC,kBACA,2DACF,EACC,OAAO,CAAC,YAAY,YAAY,SAAS,YAAY,OAAqB,CAAC;AAE9E,IAAI,MAAM;",
8
+ "debugId": "CFDA2FD99DBE500164756E2164756E21",
9
9
  "names": []
10
10
  }
@@ -1,10 +1,13 @@
1
1
  {
2
- "version": "1.0.0-alpha.24",
2
+ "version": "1.0.1",
3
3
  "modules": {
4
4
  "core": {
5
5
  "files": [
6
+ "GUIDE.md",
7
+ "README.md",
6
8
  "index.ts",
7
- "README.md"
9
+ "router.ts",
10
+ "standard-schema.ts"
8
11
  ],
9
12
  "dependencies": {},
10
13
  "dependsOn": [],
@@ -12,8 +15,9 @@
12
15
  },
13
16
  "jtd-validator": {
14
17
  "files": [
15
- "index.ts",
16
- "README.md"
18
+ "GUIDE.md",
19
+ "README.md",
20
+ "index.ts"
17
21
  ],
18
22
  "dependencies": {
19
23
  "ajv": "^8.18.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raven.js/cli",
3
- "version": "1.0.0-alpha.24",
3
+ "version": "1.0.1",
4
4
  "description": "CLI tool for RavenJS framework",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -10,11 +10,9 @@
10
10
  "raven": "./dist/raven"
11
11
  },
12
12
  "files": [
13
- "dist"
13
+ "dist",
14
+ "README.md"
14
15
  ],
15
- "engines": {
16
- "bun": ">=1.0"
17
- },
18
16
  "dependencies": {
19
17
  "@clack/prompts": "^1.0.1",
20
18
  "cac": "^6.7.14",