multi-agents-cli 1.0.18 → 1.0.19
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 +29 -4
- package/package.json +1 -1
package/init.js
CHANGED
|
@@ -919,13 +919,38 @@ 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
|
+
copyDirExcluding(path.join(TEMPLATES, 'shared'), path.join(ROOT, 'shared'), ['agents', 'frameworks']);
|
|
924
939
|
if (backendType === 'separate') {
|
|
925
|
-
|
|
926
|
-
// Ensure backend/ is tracked by git even before the API agent scaffolds
|
|
940
|
+
copyDirExcluding(path.join(TEMPLATES, 'backend'), path.join(ROOT, 'backend'), ['agents', 'frameworks']);
|
|
927
941
|
fs.writeFileSync(path.join(ROOT, 'backend', '.gitkeep'), '', 'utf8');
|
|
928
942
|
}
|
|
943
|
+
|
|
944
|
+
// ── Copy agents and frameworks to repo root as .agents/ and .frameworks/ ────
|
|
945
|
+
|
|
946
|
+
copyDir(path.join(TEMPLATES, 'client', 'agents'), path.join(ROOT, '.agents', 'client'));
|
|
947
|
+
copyDir(path.join(TEMPLATES, 'client', 'frameworks'), path.join(ROOT, '.frameworks', 'client'));
|
|
948
|
+
copyDir(path.join(TEMPLATES, 'shared', 'agents'), path.join(ROOT, '.agents', 'shared'));
|
|
949
|
+
if (backendType === 'separate') {
|
|
950
|
+
copyDir(path.join(TEMPLATES, 'backend', 'agents'), path.join(ROOT, '.agents', 'backend'));
|
|
951
|
+
copyDir(path.join(TEMPLATES, 'backend', 'frameworks'), path.join(ROOT, '.frameworks', 'backend'));
|
|
952
|
+
}
|
|
953
|
+
|
|
929
954
|
fs.copyFileSync(path.join(TEMPLATES, 'CLAUDE.md'), path.join(ROOT, 'CLAUDE.md'));
|
|
930
955
|
fs.copyFileSync(path.join(TEMPLATES, 'CONTRACTS.md'), path.join(ROOT, 'CONTRACTS.md'));
|
|
931
956
|
console.log(` ${green('✓')} Templates copied`);
|
package/package.json
CHANGED