@teammates/cli 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/dist/cli.js +24 -11
- package/dist/onboard.d.ts +1 -0
- package/dist/onboard.js +3 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -1431,16 +1431,22 @@ Do NOT modify any other teammate's files. Only edit your own SOUL.md and daily l
|
|
|
1431
1431
|
const teammatesDir = join(projectDir, ".teammates");
|
|
1432
1432
|
console.log();
|
|
1433
1433
|
try {
|
|
1434
|
-
const { teammates, files } = await importTeammates(sourceDir, teammatesDir);
|
|
1435
|
-
|
|
1434
|
+
const { teammates, skipped, files } = await importTeammates(sourceDir, teammatesDir);
|
|
1435
|
+
const allTeammates = [...teammates, ...skipped];
|
|
1436
|
+
if (allTeammates.length === 0) {
|
|
1436
1437
|
console.log(chalk.yellow(" No teammates found at ") + chalk.white(sourceDir));
|
|
1437
1438
|
console.log(chalk.gray(" The directory should contain teammate folders (each with a SOUL.md)."));
|
|
1438
1439
|
return;
|
|
1439
1440
|
}
|
|
1440
|
-
|
|
1441
|
-
chalk.
|
|
1442
|
-
|
|
1443
|
-
|
|
1441
|
+
if (teammates.length > 0) {
|
|
1442
|
+
console.log(chalk.green(" ✔") +
|
|
1443
|
+
chalk.white(` Imported ${teammates.length} teammate${teammates.length > 1 ? "s" : ""}: `) +
|
|
1444
|
+
chalk.cyan(teammates.join(", ")));
|
|
1445
|
+
console.log(chalk.gray(` (${files.length} files copied)`));
|
|
1446
|
+
}
|
|
1447
|
+
if (skipped.length > 0) {
|
|
1448
|
+
console.log(chalk.gray(` ${skipped.length} already present: ${skipped.join(", ")} (will re-adapt)`));
|
|
1449
|
+
}
|
|
1444
1450
|
console.log();
|
|
1445
1451
|
// Copy framework files so the agent has TEMPLATE.md etc. available
|
|
1446
1452
|
await copyTemplateFiles(teammatesDir);
|
|
@@ -1452,7 +1458,7 @@ Do NOT modify any other teammate's files. Only edit your own SOUL.md and daily l
|
|
|
1452
1458
|
console.log();
|
|
1453
1459
|
const adapt = await this.askChoice("Adapt now? (y/n): ", ["y", "n"]);
|
|
1454
1460
|
if (adapt === "y") {
|
|
1455
|
-
await this.runAdaptationAgent(this.adapter, projectDir,
|
|
1461
|
+
await this.runAdaptationAgent(this.adapter, projectDir, allTeammates, sourceDir);
|
|
1456
1462
|
}
|
|
1457
1463
|
else {
|
|
1458
1464
|
console.log(chalk.gray(" Skipped adaptation. Run /init to adapt later."));
|
|
@@ -3011,18 +3017,25 @@ Do NOT modify any other teammate's files. Only edit your own SOUL.md and daily l
|
|
|
3011
3017
|
sourceDir = resolved;
|
|
3012
3018
|
}
|
|
3013
3019
|
try {
|
|
3014
|
-
const { teammates, files } = await importTeammates(sourceDir, teammatesDir);
|
|
3015
|
-
|
|
3020
|
+
const { teammates, skipped, files } = await importTeammates(sourceDir, teammatesDir);
|
|
3021
|
+
// Combine newly imported + already existing for adaptation
|
|
3022
|
+
const allTeammates = [...teammates, ...skipped];
|
|
3023
|
+
if (allTeammates.length === 0) {
|
|
3016
3024
|
this.feedLine(tp.warning(` No teammates found at ${sourceDir}`));
|
|
3017
3025
|
this.refreshView();
|
|
3018
3026
|
return;
|
|
3019
3027
|
}
|
|
3020
|
-
|
|
3028
|
+
if (teammates.length > 0) {
|
|
3029
|
+
this.feedLine(tp.success(` Imported ${teammates.length} teammate${teammates.length > 1 ? "s" : ""}: ${teammates.join(", ")} (${files.length} files)`));
|
|
3030
|
+
}
|
|
3031
|
+
if (skipped.length > 0) {
|
|
3032
|
+
this.feedLine(tp.muted(` ${skipped.length} already present: ${skipped.join(", ")} (will re-adapt)`));
|
|
3033
|
+
}
|
|
3021
3034
|
// Copy framework files so the agent has TEMPLATE.md etc. available
|
|
3022
3035
|
await copyTemplateFiles(teammatesDir);
|
|
3023
3036
|
// Queue a single adaptation task that handles all teammates
|
|
3024
3037
|
this.feedLine(tp.muted(` Queuing ${this.adapterName} to scan this project and adapt the team...`));
|
|
3025
|
-
const prompt = await buildImportAdaptationPrompt(teammatesDir,
|
|
3038
|
+
const prompt = await buildImportAdaptationPrompt(teammatesDir, allTeammates, sourceDir);
|
|
3026
3039
|
this.taskQueue.push({
|
|
3027
3040
|
type: "agent",
|
|
3028
3041
|
teammate: this.adapterName,
|
package/dist/onboard.d.ts
CHANGED
package/dist/onboard.js
CHANGED
|
@@ -129,6 +129,7 @@ export async function importTeammates(sourceDir, targetDir) {
|
|
|
129
129
|
}
|
|
130
130
|
await mkdir(targetDir, { recursive: true });
|
|
131
131
|
const teammates = [];
|
|
132
|
+
const skipped = [];
|
|
132
133
|
const files = [];
|
|
133
134
|
const entries = await readdir(sourceDir, { withFileTypes: true });
|
|
134
135
|
for (const entry of entries) {
|
|
@@ -140,6 +141,7 @@ export async function importTeammates(sourceDir, targetDir) {
|
|
|
140
141
|
// Skip if teammate already exists in target
|
|
141
142
|
try {
|
|
142
143
|
await stat(destPath);
|
|
144
|
+
skipped.push(entry.name);
|
|
143
145
|
continue;
|
|
144
146
|
}
|
|
145
147
|
catch {
|
|
@@ -185,7 +187,7 @@ export async function importTeammates(sourceDir, targetDir) {
|
|
|
185
187
|
await writeFile(gitignoreDest, "USER.md\n.*/\n", "utf-8");
|
|
186
188
|
files.push(".gitignore");
|
|
187
189
|
}
|
|
188
|
-
return { teammates, files };
|
|
190
|
+
return { teammates, skipped, files };
|
|
189
191
|
}
|
|
190
192
|
/**
|
|
191
193
|
* Build an import-adaptation prompt that runs as a single non-interactive agent session.
|
package/package.json
CHANGED