@0dai-dev/cli 3.3.2 → 3.3.3
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/bin/0dai.js +26 -8
- package/package.json +1 -1
package/bin/0dai.js
CHANGED
|
@@ -38,10 +38,20 @@ const VERSION_CHECK_FILE = path.join(CONFIG_DIR, ".version_check");
|
|
|
38
38
|
const PROJECTS_FILE = path.join(CONFIG_DIR, "projects.json");
|
|
39
39
|
|
|
40
40
|
const MANIFEST_FILES = [
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
"next.config.
|
|
44
|
-
"
|
|
41
|
+
// Node ecosystem
|
|
42
|
+
"package.json", "tsconfig.json",
|
|
43
|
+
"next.config.js", "next.config.mjs", "next.config.ts",
|
|
44
|
+
"vite.config.js", "vite.config.ts", "vite.config.mjs",
|
|
45
|
+
"vue.config.js", "nuxt.config.js", "nuxt.config.ts",
|
|
46
|
+
"svelte.config.js", "astro.config.mjs", "astro.config.ts",
|
|
47
|
+
"remix.config.js", "angular.json",
|
|
48
|
+
// Other languages
|
|
49
|
+
"go.mod", "pyproject.toml", "requirements.txt", "setup.py",
|
|
50
|
+
"pubspec.yaml", "Cargo.toml", "pom.xml", "build.gradle",
|
|
51
|
+
"Gemfile", "composer.json",
|
|
52
|
+
// Build/deploy
|
|
53
|
+
"Makefile", "docker-compose.yml", "Dockerfile",
|
|
54
|
+
"pnpm-workspace.yaml", "lerna.json", "turbo.json", "nx.json",
|
|
45
55
|
];
|
|
46
56
|
|
|
47
57
|
const PROBE_DIRS = [
|
|
@@ -589,11 +599,17 @@ async function cmdSync(target, args = []) {
|
|
|
589
599
|
|
|
590
600
|
async function cmdDetect(target) {
|
|
591
601
|
const OPTIONAL_CLIS = ["gemini", "aider", "opencode"];
|
|
592
|
-
const { projectFiles } = collectMetadata(target);
|
|
593
|
-
|
|
602
|
+
const { projectFiles, fileContents, clis: localClis } = collectMetadata(target);
|
|
603
|
+
// Send file contents AND local CLI inventory so server can do content-based detection
|
|
604
|
+
const result = await apiCall("/v1/detect", {
|
|
605
|
+
project_files: projectFiles,
|
|
606
|
+
file_contents: fileContents,
|
|
607
|
+
available_clis: localClis,
|
|
608
|
+
});
|
|
594
609
|
if (result.error) { log(`error: ${result.error}`); return; }
|
|
595
610
|
console.log(`stack: ${result.stack || "?"}`);
|
|
596
|
-
|
|
611
|
+
// Use local CLIs if server didn't return any (server can't detect locally installed binaries)
|
|
612
|
+
const clis = (result.available_clis && result.available_clis.length && result.available_clis[0]) ? result.available_clis : localClis;
|
|
597
613
|
if (clis.length) {
|
|
598
614
|
console.log(`clis: ${clis.join(", ")}`);
|
|
599
615
|
} else {
|
|
@@ -1609,7 +1625,9 @@ async function cmdRedeem(code) {
|
|
|
1609
1625
|
async function cmdAuthStatus() {
|
|
1610
1626
|
try {
|
|
1611
1627
|
const auth = JSON.parse(fs.readFileSync(AUTH_FILE, "utf8"));
|
|
1612
|
-
|
|
1628
|
+
// Backwards compat: old auth.json used `user`, new uses `email`
|
|
1629
|
+
const email = auth.email || auth.user || "unknown";
|
|
1630
|
+
log(`${email} (${auth.plan || "free"} plan)`);
|
|
1613
1631
|
// Get usage from API
|
|
1614
1632
|
const status = await apiCall("/v1/auth/status");
|
|
1615
1633
|
if (status.usage_today) {
|