multi-agents-cli 1.0.18 → 1.0.20
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/init.js +30 -4
- package/package.json +1 -1
package/init.js
CHANGED
|
@@ -919,13 +919,39 @@ const main = async () => {
|
|
|
919
919
|
|
|
920
920
|
const TEMPLATES = path.join(CORE_DIR, 'templates');
|
|
921
921
|
|
|
922
|
-
|
|
923
|
-
|
|
922
|
+
// ── Copy scope directories (app code + CLAUDE.md only) ─────────────────────
|
|
923
|
+
// agents/ and frameworks/ are now at repo root as .agents/ and .frameworks/
|
|
924
|
+
// We copy client/backend/shared but exclude agents/ and frameworks/ subdirs
|
|
925
|
+
|
|
926
|
+
const copyDirExcluding = (src, dest, exclude = []) => {
|
|
927
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
928
|
+
for (const entry of fs.readdirSync(src)) {
|
|
929
|
+
if (exclude.includes(entry)) continue;
|
|
930
|
+
const srcFile = path.join(src, entry);
|
|
931
|
+
const destFile = path.join(dest, entry);
|
|
932
|
+
if (fs.statSync(srcFile).isDirectory()) copyDirExcluding(srcFile, destFile, []);
|
|
933
|
+
else fs.copyFileSync(srcFile, destFile);
|
|
934
|
+
}
|
|
935
|
+
};
|
|
936
|
+
|
|
937
|
+
copyDirExcluding(path.join(TEMPLATES, 'client'), path.join(ROOT, 'client'), ['agents', 'frameworks']);
|
|
938
|
+
if (fs.existsSync(path.join(TEMPLATES, 'shared')))
|
|
939
|
+
copyDirExcluding(path.join(TEMPLATES, 'shared'), path.join(ROOT, 'shared'), ['agents', 'frameworks']);
|
|
924
940
|
if (backendType === 'separate') {
|
|
925
|
-
|
|
926
|
-
// Ensure backend/ is tracked by git even before the API agent scaffolds
|
|
941
|
+
copyDirExcluding(path.join(TEMPLATES, 'backend'), path.join(ROOT, 'backend'), ['agents', 'frameworks']);
|
|
927
942
|
fs.writeFileSync(path.join(ROOT, 'backend', '.gitkeep'), '', 'utf8');
|
|
928
943
|
}
|
|
944
|
+
|
|
945
|
+
// ── Copy agents and frameworks to repo root as .agents/ and .frameworks/ ────
|
|
946
|
+
|
|
947
|
+
copyDir(path.join(TEMPLATES, 'client', 'agents'), path.join(ROOT, '.agents', 'client'));
|
|
948
|
+
copyDir(path.join(TEMPLATES, 'client', 'frameworks'), path.join(ROOT, '.frameworks', 'client'));
|
|
949
|
+
copyDir(path.join(TEMPLATES, 'shared', 'agents'), path.join(ROOT, '.agents', 'shared'));
|
|
950
|
+
if (backendType === 'separate') {
|
|
951
|
+
copyDir(path.join(TEMPLATES, 'backend', 'agents'), path.join(ROOT, '.agents', 'backend'));
|
|
952
|
+
copyDir(path.join(TEMPLATES, 'backend', 'frameworks'), path.join(ROOT, '.frameworks', 'backend'));
|
|
953
|
+
}
|
|
954
|
+
|
|
929
955
|
fs.copyFileSync(path.join(TEMPLATES, 'CLAUDE.md'), path.join(ROOT, 'CLAUDE.md'));
|
|
930
956
|
fs.copyFileSync(path.join(TEMPLATES, 'CONTRACTS.md'), path.join(ROOT, 'CONTRACTS.md'));
|
|
931
957
|
console.log(` ${green('✓')} Templates copied`);
|
package/package.json
CHANGED