substrate-ai 0.20.132 → 0.20.133
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/dist/cli/index.js +22 -4
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -1864,24 +1864,42 @@ function syncSkillsToTarget(srcSkillsDir, destSkillsDir, ownershipPrefixes, name
|
|
|
1864
1864
|
}, "Failed to prune stale skills");
|
|
1865
1865
|
}
|
|
1866
1866
|
let count = 0;
|
|
1867
|
+
const failures = [];
|
|
1867
1868
|
for (const entry of sourceEntries) {
|
|
1868
1869
|
const destName = namePrefix && !entry.name.startsWith(namePrefix) ? `${namePrefix}${entry.name}` : entry.name;
|
|
1869
1870
|
const dest = join(destSkillsDir, destName);
|
|
1871
|
+
let stage = "rm";
|
|
1870
1872
|
try {
|
|
1871
1873
|
rmSync$1(dest, {
|
|
1872
1874
|
recursive: true,
|
|
1873
1875
|
force: true
|
|
1874
1876
|
});
|
|
1877
|
+
stage = "cp";
|
|
1875
1878
|
cpSync(join(srcSkillsDir, entry.name), dest, { recursive: true });
|
|
1876
1879
|
count++;
|
|
1877
1880
|
} catch (err) {
|
|
1881
|
+
const msg = err instanceof Error ? err.message : String(err);
|
|
1882
|
+
failures.push({
|
|
1883
|
+
skill: entry.name,
|
|
1884
|
+
op: stage,
|
|
1885
|
+
err: msg
|
|
1886
|
+
});
|
|
1878
1887
|
logger$18.warn({
|
|
1879
1888
|
skill: entry.name,
|
|
1880
1889
|
dest,
|
|
1881
|
-
|
|
1882
|
-
|
|
1890
|
+
stage,
|
|
1891
|
+
err: msg
|
|
1892
|
+
}, `Skipped skill (${stage} failed): ${msg}`);
|
|
1883
1893
|
}
|
|
1884
1894
|
}
|
|
1895
|
+
if (failures.length > 0 && count === 0) {
|
|
1896
|
+
const dominantErr = failures[0].err;
|
|
1897
|
+
logger$18.warn({
|
|
1898
|
+
destSkillsDir,
|
|
1899
|
+
attempted: failures.length,
|
|
1900
|
+
dominantErr
|
|
1901
|
+
}, `All ${String(failures.length)} skills failed under ${destSkillsDir} (e.g. ${dominantErr}). Check that the directory and its parent are writable by the current user.`);
|
|
1902
|
+
}
|
|
1885
1903
|
return count;
|
|
1886
1904
|
}
|
|
1887
1905
|
const PROJECT_OWNERSHIP_PREFIXES = ["bmad-", "substrate-"];
|
|
@@ -2109,12 +2127,12 @@ async function runInitAction(options) {
|
|
|
2109
2127
|
await mkdir(substrateDir, { recursive: true });
|
|
2110
2128
|
const configHeader = "# Substrate Configuration\n# Generated by `substrate init`\n# Edit this file to customize your AI agent orchestration settings.\n# API keys must be set as environment variables — never stored here.\n#\n# Provider API key env vars:\n" + Object.entries(PROVIDER_KEY_ENV).map(([p, env]) => `# ${p}: ${env}`).join("\n") + "\n\n";
|
|
2111
2129
|
const configExists = existsSync$1(configPath);
|
|
2112
|
-
if (configExists && !force) {
|
|
2130
|
+
if (configExists && !force && nonInteractive) {
|
|
2113
2131
|
if (outputFormat !== "json") process.stdout.write(" .substrate/config.yaml already exists — preserving (use --force to overwrite)\n");
|
|
2114
2132
|
} else await writeFile(configPath, configHeader + yaml.dump(config), "utf-8");
|
|
2115
2133
|
const routingHeader = "# Substrate Routing Policy\n# Defines how tasks are routed to AI providers.\n# Customize rules to match your workflow and available agents.\n\n";
|
|
2116
2134
|
const routingExists = existsSync$1(routingPolicyPath);
|
|
2117
|
-
if (routingExists && !force) {
|
|
2135
|
+
if (routingExists && !force && nonInteractive) {
|
|
2118
2136
|
if (outputFormat !== "json") process.stdout.write(" .substrate/routing-policy.yaml already exists — preserving (use --force to overwrite)\n");
|
|
2119
2137
|
} else await writeFile(routingPolicyPath, routingHeader + yaml.dump(routingPolicy), "utf-8");
|
|
2120
2138
|
const projectProfilePath = join(substrateDir, "project-profile.yaml");
|