ai-native-core 0.2.4 → 0.2.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-native-core",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "让任何项目拥有 AI Native 开发能力的运行时框架",
5
5
  "keywords": [
6
6
  "ai-native",
@@ -3,6 +3,12 @@
3
3
  const fs = require('fs');
4
4
  const path = require('path');
5
5
  const readline = require('readline');
6
+ const { execSync } = require('child_process');
7
+
8
+ function getProjectRoot() {
9
+ try { return execSync('git rev-parse --show-toplevel', { encoding: 'utf-8' }).trim(); }
10
+ catch { return process.cwd(); }
11
+ }
6
12
 
7
13
  const VALID_STACKS = ['react-spa', 'nextjs', 'vue', 'backend-go', 'backend-python', 'backend-java'];
8
14
 
@@ -76,7 +82,7 @@ function interactiveInit(isForce) {
76
82
  }
77
83
 
78
84
  function doInit(stacks, isForce, answers = {}) {
79
- const root = process.cwd();
85
+ const root = getProjectRoot();
80
86
  const dirs = ['.ai-native/memory', '.ai-native/hooks', '.ai-native/reports', 'docs/.ai-native/memory', 'docs/decisions'];
81
87
 
82
88
  console.log(`\n[ai-native] Initializing...\n`);