aiblueprint-cli 1.4.49 → 1.4.50
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 +26 -131
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -35784,39 +35784,18 @@ async function analyzeCategory(category, claudeDir, agentsDir, githubToken) {
|
|
|
35784
35784
|
}
|
|
35785
35785
|
}
|
|
35786
35786
|
}
|
|
35787
|
-
const migrationTopLevels = new Set;
|
|
35788
35787
|
if (useAgents) {
|
|
35789
35788
|
const agentsTopLevels = new Set;
|
|
35790
35789
|
for (const localPath of localSet) {
|
|
35791
35790
|
agentsTopLevels.add(localPath.split("/")[0]);
|
|
35792
35791
|
}
|
|
35793
|
-
for (const top of agentsTopLevels) {
|
|
35794
|
-
if (remoteTopLevels.has(top))
|
|
35795
|
-
continue;
|
|
35796
|
-
if (migrationTopLevels.has(top))
|
|
35797
|
-
continue;
|
|
35798
|
-
const fullPath = path16.join(localDir, top);
|
|
35799
|
-
const stat = await import_fs_extra13.default.stat(fullPath).catch(() => null);
|
|
35800
|
-
if (!stat)
|
|
35801
|
-
continue;
|
|
35802
|
-
migrationTopLevels.add(top);
|
|
35803
|
-
items.push({
|
|
35804
|
-
name: top,
|
|
35805
|
-
relativePath: `${category}/${top}`,
|
|
35806
|
-
status: "migration",
|
|
35807
|
-
category,
|
|
35808
|
-
isFolder: stat.isDirectory(),
|
|
35809
|
-
migrationKind: "preserve-in-agents"
|
|
35810
|
-
});
|
|
35811
|
-
}
|
|
35812
35792
|
const claudeCategoryDir = path16.join(claudeDir, category);
|
|
35813
35793
|
const claudeRealEntries = await listClaudeRealTopLevel(claudeCategoryDir);
|
|
35814
35794
|
for (const top of claudeRealEntries) {
|
|
35815
|
-
if (
|
|
35795
|
+
if (!remoteTopLevels.has(top))
|
|
35816
35796
|
continue;
|
|
35817
|
-
if (
|
|
35797
|
+
if (agentsTopLevels.has(top))
|
|
35818
35798
|
continue;
|
|
35819
|
-
migrationTopLevels.add(top);
|
|
35820
35799
|
items.push({
|
|
35821
35800
|
name: top,
|
|
35822
35801
|
relativePath: `${category}/${top}`,
|
|
@@ -35827,39 +35806,6 @@ async function analyzeCategory(category, claudeDir, agentsDir, githubToken) {
|
|
|
35827
35806
|
});
|
|
35828
35807
|
}
|
|
35829
35808
|
}
|
|
35830
|
-
const deletedPaths = new Set;
|
|
35831
|
-
for (const localPath of localSet) {
|
|
35832
|
-
if (remoteSet.has(localPath))
|
|
35833
|
-
continue;
|
|
35834
|
-
const topLevel = localPath.split("/")[0];
|
|
35835
|
-
if (migrationTopLevels.has(topLevel))
|
|
35836
|
-
continue;
|
|
35837
|
-
const pathParts = localPath.split("/");
|
|
35838
|
-
const parentAlreadyDeleted = pathParts.some((_4, idx) => {
|
|
35839
|
-
if (idx === 0)
|
|
35840
|
-
return false;
|
|
35841
|
-
const parentPath = pathParts.slice(0, idx).join("/");
|
|
35842
|
-
return deletedPaths.has(parentPath);
|
|
35843
|
-
});
|
|
35844
|
-
if (parentAlreadyDeleted) {
|
|
35845
|
-
continue;
|
|
35846
|
-
}
|
|
35847
|
-
const fullPath = path16.join(localDir, localPath);
|
|
35848
|
-
const stat = await import_fs_extra13.default.stat(fullPath).catch(() => null);
|
|
35849
|
-
if (stat) {
|
|
35850
|
-
const isFolder = stat.isDirectory();
|
|
35851
|
-
items.push({
|
|
35852
|
-
name: localPath,
|
|
35853
|
-
relativePath: `${category}/${localPath}`,
|
|
35854
|
-
status: "deleted",
|
|
35855
|
-
category,
|
|
35856
|
-
isFolder
|
|
35857
|
-
});
|
|
35858
|
-
if (isFolder) {
|
|
35859
|
-
deletedPaths.add(localPath);
|
|
35860
|
-
}
|
|
35861
|
-
}
|
|
35862
|
-
}
|
|
35863
35809
|
return items;
|
|
35864
35810
|
}
|
|
35865
35811
|
async function analyzeSyncChanges(claudeDir, githubToken, agentsDir) {
|
|
@@ -35925,31 +35871,21 @@ async function syncSelectedItems(claudeDir, items, githubToken, agentsDir, onPro
|
|
|
35925
35871
|
const agentsTop = path16.join(agentsDir, item.category, topName);
|
|
35926
35872
|
const claudeTop = path16.join(claudeDir, item.category, topName);
|
|
35927
35873
|
try {
|
|
35928
|
-
|
|
35929
|
-
|
|
35930
|
-
|
|
35931
|
-
|
|
35932
|
-
|
|
35933
|
-
continue;
|
|
35934
|
-
}
|
|
35935
|
-
const agentsExists = await import_fs_extra13.default.pathExists(agentsTop);
|
|
35936
|
-
if (agentsExists) {
|
|
35937
|
-
onProgress?.(item.relativePath, "skipping (already in .agents)");
|
|
35938
|
-
failed++;
|
|
35939
|
-
continue;
|
|
35940
|
-
}
|
|
35941
|
-
onProgress?.(item.relativePath, "moving to .agents");
|
|
35942
|
-
await import_fs_extra13.default.ensureDir(path16.dirname(agentsTop));
|
|
35943
|
-
await import_fs_extra13.default.move(claudeTop, agentsTop);
|
|
35944
|
-
} else {
|
|
35945
|
-
const claudeStat = await import_fs_extra13.default.lstat(claudeTop).catch(() => null);
|
|
35946
|
-
if (claudeStat && !claudeStat.isSymbolicLink()) {
|
|
35947
|
-
onProgress?.(item.relativePath, "skipping (real dir in .claude)");
|
|
35948
|
-
failed++;
|
|
35949
|
-
continue;
|
|
35950
|
-
}
|
|
35951
|
-
onProgress?.(item.relativePath, "preserving in .agents");
|
|
35874
|
+
const claudeStat = await import_fs_extra13.default.lstat(claudeTop).catch(() => null);
|
|
35875
|
+
if (!claudeStat || claudeStat.isSymbolicLink()) {
|
|
35876
|
+
onProgress?.(item.relativePath, "skipping (no real dir to migrate)");
|
|
35877
|
+
failed++;
|
|
35878
|
+
continue;
|
|
35952
35879
|
}
|
|
35880
|
+
const agentsExists = await import_fs_extra13.default.pathExists(agentsTop);
|
|
35881
|
+
if (agentsExists) {
|
|
35882
|
+
onProgress?.(item.relativePath, "skipping (already in .agents)");
|
|
35883
|
+
failed++;
|
|
35884
|
+
continue;
|
|
35885
|
+
}
|
|
35886
|
+
onProgress?.(item.relativePath, "moving to .agents");
|
|
35887
|
+
await import_fs_extra13.default.ensureDir(path16.dirname(agentsTop));
|
|
35888
|
+
await import_fs_extra13.default.move(claudeTop, agentsTop);
|
|
35953
35889
|
migrated++;
|
|
35954
35890
|
touchedAgentCategories.add(item.category);
|
|
35955
35891
|
} catch {
|
|
@@ -36014,7 +35950,7 @@ function formatItem(item) {
|
|
|
36014
35950
|
migration: source_default.blue
|
|
36015
35951
|
};
|
|
36016
35952
|
const folderPrefix = item.isFolder ? "\uD83D\uDCC1 " : "";
|
|
36017
|
-
const suffix = item.status === "migration"
|
|
35953
|
+
const suffix = item.status === "migration" ? source_default.gray(" (move .claude → .agents)") : "";
|
|
36018
35954
|
return `${icons[item.status]} ${folderPrefix}${colors12[item.status](item.relativePath)}${suffix}`;
|
|
36019
35955
|
}
|
|
36020
35956
|
function groupByCategory(items) {
|
|
@@ -36164,7 +36100,6 @@ async function proSyncCommand(options = {}) {
|
|
|
36164
36100
|
if (result.migrationCount > 0) {
|
|
36165
36101
|
summaryParts.push(source_default.blue(`${result.migrationCount} to migrate`));
|
|
36166
36102
|
}
|
|
36167
|
-
summaryParts.push(source_default.red(`${result.deletedCount} to remove`));
|
|
36168
36103
|
summaryParts.push(source_default.gray(`${result.unchangedCount} unchanged`));
|
|
36169
36104
|
M2.info(`Found: ${summaryParts.join(", ")}`);
|
|
36170
36105
|
M2.message("");
|
|
@@ -36189,9 +36124,7 @@ async function proSyncCommand(options = {}) {
|
|
|
36189
36124
|
const choices = createSelectionChoices(changedItems);
|
|
36190
36125
|
const newItems = changedItems.filter((i) => i.status === "new");
|
|
36191
36126
|
const modifiedItems = changedItems.filter((i) => i.status === "modified");
|
|
36192
|
-
const deletedItems = changedItems.filter((i) => i.status === "deleted");
|
|
36193
36127
|
const migrationItems = changedItems.filter((i) => i.status === "migration");
|
|
36194
|
-
const hasDeletions = deletedItems.length > 0;
|
|
36195
36128
|
const hasMigrations = migrationItems.length > 0;
|
|
36196
36129
|
const updatesHintParts = [
|
|
36197
36130
|
`add ${newItems.length}`,
|
|
@@ -36205,21 +36138,13 @@ async function proSyncCommand(options = {}) {
|
|
|
36205
36138
|
value: "updates",
|
|
36206
36139
|
label: "Import all updates",
|
|
36207
36140
|
hint: `${updatesHintParts.join(" + ")} files`
|
|
36141
|
+
},
|
|
36142
|
+
{
|
|
36143
|
+
value: "custom",
|
|
36144
|
+
label: "Custom choice",
|
|
36145
|
+
hint: "select specific files to sync"
|
|
36208
36146
|
}
|
|
36209
36147
|
];
|
|
36210
|
-
if (hasDeletions) {
|
|
36211
|
-
const deleteHintParts = [...updatesHintParts, `delete ${deletedItems.length}`];
|
|
36212
|
-
syncModeOptions.push({
|
|
36213
|
-
value: "updates_and_delete",
|
|
36214
|
-
label: "Import all updates and delete files",
|
|
36215
|
-
hint: `${deleteHintParts.join(" + ")} files`
|
|
36216
|
-
});
|
|
36217
|
-
}
|
|
36218
|
-
syncModeOptions.push({
|
|
36219
|
-
value: "custom",
|
|
36220
|
-
label: "Custom choice",
|
|
36221
|
-
hint: "select specific files to sync"
|
|
36222
|
-
});
|
|
36223
36148
|
const syncMode = await ve({
|
|
36224
36149
|
message: "How would you like to sync?",
|
|
36225
36150
|
options: syncModeOptions
|
|
@@ -36231,40 +36156,13 @@ async function proSyncCommand(options = {}) {
|
|
|
36231
36156
|
let selectedItems = [];
|
|
36232
36157
|
if (syncMode === "updates") {
|
|
36233
36158
|
selectedItems = [...newItems, ...modifiedItems, ...migrationItems];
|
|
36234
|
-
} else if (syncMode === "updates_and_delete") {
|
|
36235
|
-
M2.message("");
|
|
36236
|
-
M2.message(source_default.red.bold("⚠️ WARNING: DESTRUCTIVE ACTION"));
|
|
36237
|
-
M2.message(source_default.red("━".repeat(50)));
|
|
36238
|
-
M2.message(source_default.red(`${deletedItems.length} commands/agents/scripts not in the premium version`));
|
|
36239
|
-
M2.message(source_default.red("will be PERMANENTLY DELETED and replaced by the new version."));
|
|
36240
|
-
if (hasMigrations) {
|
|
36241
|
-
M2.message(source_default.gray(`(Skills are NOT deleted - they will be migrated to ~/.agents instead.)`));
|
|
36242
|
-
}
|
|
36243
|
-
M2.message(source_default.red("━".repeat(50)));
|
|
36244
|
-
M2.message("");
|
|
36245
|
-
const deleteConfirm = await ye({
|
|
36246
|
-
message: source_default.red.bold("Are you sure you want to delete and replace all files?"),
|
|
36247
|
-
initialValue: false
|
|
36248
|
-
});
|
|
36249
|
-
if (pD(deleteConfirm) || !deleteConfirm) {
|
|
36250
|
-
xe("Sync cancelled");
|
|
36251
|
-
process.exit(0);
|
|
36252
|
-
}
|
|
36253
|
-
selectedItems = [...newItems, ...modifiedItems, ...migrationItems, ...deletedItems];
|
|
36254
36159
|
} else {
|
|
36255
36160
|
const fileChoices = choices;
|
|
36256
|
-
const
|
|
36257
|
-
if (c.value.type === "file")
|
|
36258
|
-
return c.value.item.status !== "deleted";
|
|
36259
|
-
if (c.value.type === "folder")
|
|
36260
|
-
return !c.value.items.every((i) => i.status === "deleted");
|
|
36261
|
-
return true;
|
|
36262
|
-
});
|
|
36263
|
-
const nonDeleteInitialValues = nonDeleteChoices.map((c) => c.value);
|
|
36161
|
+
const initialValues = fileChoices.map((c) => c.value);
|
|
36264
36162
|
const customSelected = await fe({
|
|
36265
|
-
message: "Select files to sync
|
|
36163
|
+
message: "Select files to sync:",
|
|
36266
36164
|
options: fileChoices,
|
|
36267
|
-
initialValues
|
|
36165
|
+
initialValues,
|
|
36268
36166
|
required: false
|
|
36269
36167
|
});
|
|
36270
36168
|
if (pD(customSelected)) {
|
|
@@ -36281,7 +36179,6 @@ async function proSyncCommand(options = {}) {
|
|
|
36281
36179
|
}
|
|
36282
36180
|
const toAdd = selectedItems.filter((i) => i.status === "new").length;
|
|
36283
36181
|
const toUpdate = selectedItems.filter((i) => i.status === "modified").length;
|
|
36284
|
-
const toRemove = selectedItems.filter((i) => i.status === "deleted").length;
|
|
36285
36182
|
const toMigrate = selectedItems.filter((i) => i.status === "migration").length;
|
|
36286
36183
|
M2.message("");
|
|
36287
36184
|
M2.message(source_default.bold("What will happen:"));
|
|
@@ -36290,9 +36187,7 @@ async function proSyncCommand(options = {}) {
|
|
|
36290
36187
|
if (toUpdate > 0)
|
|
36291
36188
|
M2.message(source_default.yellow(` ✓ Update ${toUpdate} file${toUpdate > 1 ? "s" : ""}`));
|
|
36292
36189
|
if (toMigrate > 0)
|
|
36293
|
-
M2.message(source_default.blue(` ✓
|
|
36294
|
-
if (toRemove > 0)
|
|
36295
|
-
M2.message(source_default.red(` ✓ Delete ${toRemove} file${toRemove > 1 ? "s" : ""}`));
|
|
36190
|
+
M2.message(source_default.blue(` ✓ Move ${toMigrate} skill${toMigrate > 1 ? "s" : ""} from .claude to .agents`));
|
|
36296
36191
|
M2.message(source_default.gray(` ✓ Backup current config to ~/.config/aiblueprint/backup/`));
|
|
36297
36192
|
M2.message("");
|
|
36298
36193
|
const confirmResult = await ye({
|