@synapsync/cli 0.1.3 → 0.1.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/index.js +29 -32
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -28,7 +28,7 @@ var init_version = __esm({
|
|
|
28
28
|
"src/version.ts"() {
|
|
29
29
|
"use strict";
|
|
30
30
|
init_esm_shims();
|
|
31
|
-
version = "0.1.
|
|
31
|
+
version = "0.1.5";
|
|
32
32
|
}
|
|
33
33
|
});
|
|
34
34
|
|
|
@@ -1193,16 +1193,13 @@ function showSuccessMessage(setup, configPath, storagePath) {
|
|
|
1193
1193
|
logger.line();
|
|
1194
1194
|
logger.bold(" Next Steps:");
|
|
1195
1195
|
logger.line();
|
|
1196
|
-
logger.log(` ${pc4.cyan("1.")}
|
|
1197
|
-
logger.log(` ${pc4.dim("$")} synapsync
|
|
1196
|
+
logger.log(` ${pc4.cyan("1.")} Browse available cognitives:`);
|
|
1197
|
+
logger.log(` ${pc4.dim("$")} synapsync list --remote`);
|
|
1198
1198
|
logger.line();
|
|
1199
1199
|
logger.log(` ${pc4.cyan("2.")} Add cognitives:`);
|
|
1200
1200
|
logger.log(` ${pc4.dim("$")} synapsync add code-reviewer`);
|
|
1201
1201
|
logger.log(` ${pc4.dim("$")} synapsync add github:user/my-skill`);
|
|
1202
1202
|
logger.line();
|
|
1203
|
-
logger.log(` ${pc4.cyan("3.")} Sync to providers:`);
|
|
1204
|
-
logger.log(` ${pc4.dim("$")} synapsync sync`);
|
|
1205
|
-
logger.line();
|
|
1206
1203
|
p.outro(pc4.green("Happy syncing!"));
|
|
1207
1204
|
}
|
|
1208
1205
|
function registerInitCommand(program) {
|
|
@@ -5447,7 +5444,7 @@ function executePurgeCommand(options) {
|
|
|
5447
5444
|
}
|
|
5448
5445
|
let removedCount = 0;
|
|
5449
5446
|
try {
|
|
5450
|
-
removedCount +=
|
|
5447
|
+
removedCount += removeProviderSymlinks(projectRoot, synapSyncDir);
|
|
5451
5448
|
if (fs14.existsSync(synapSyncDir)) {
|
|
5452
5449
|
fs14.rmSync(synapSyncDir, { recursive: true, force: true });
|
|
5453
5450
|
logger.log(` ${pc16.red("\u2717")} Removed ${path16.relative(projectRoot, synapSyncDir)}/`);
|
|
@@ -5481,14 +5478,9 @@ function executePurgeCommand(options) {
|
|
|
5481
5478
|
}
|
|
5482
5479
|
function collectItemsToRemove(projectRoot, synapSyncDir) {
|
|
5483
5480
|
const items = [];
|
|
5484
|
-
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
const typePath = path16.join(projectRoot, providerPaths[type]);
|
|
5488
|
-
if (fs14.existsSync(typePath)) {
|
|
5489
|
-
items.push(path16.relative(projectRoot, typePath) + "/");
|
|
5490
|
-
}
|
|
5491
|
-
}
|
|
5481
|
+
const symlinks = findSynapSyncSymlinks(projectRoot, synapSyncDir);
|
|
5482
|
+
for (const link of symlinks) {
|
|
5483
|
+
items.push(`${path16.relative(projectRoot, link)} (symlink)`);
|
|
5492
5484
|
}
|
|
5493
5485
|
if (fs14.existsSync(synapSyncDir)) {
|
|
5494
5486
|
items.push(path16.relative(projectRoot, synapSyncDir) + "/");
|
|
@@ -5506,33 +5498,38 @@ function collectItemsToRemove(projectRoot, synapSyncDir) {
|
|
|
5506
5498
|
}
|
|
5507
5499
|
return items;
|
|
5508
5500
|
}
|
|
5509
|
-
function
|
|
5510
|
-
|
|
5501
|
+
function findSynapSyncSymlinks(projectRoot, synapSyncDir) {
|
|
5502
|
+
const symlinks = [];
|
|
5503
|
+
const resolvedSynapSync = path16.resolve(synapSyncDir);
|
|
5511
5504
|
for (const provider of SUPPORTED_PROVIDERS) {
|
|
5512
5505
|
const providerPaths = PROVIDER_PATHS[provider];
|
|
5513
5506
|
for (const type of COGNITIVE_TYPES) {
|
|
5514
5507
|
const typePath = path16.join(projectRoot, providerPaths[type]);
|
|
5515
|
-
if (fs14.existsSync(typePath))
|
|
5516
|
-
fs14.rmSync(typePath, { recursive: true, force: true });
|
|
5517
|
-
logger.log(` ${pc16.red("\u2717")} Removed ${path16.relative(projectRoot, typePath)}/`);
|
|
5518
|
-
removed++;
|
|
5519
|
-
}
|
|
5520
|
-
}
|
|
5521
|
-
const providerDir = path16.join(projectRoot, providerPaths[COGNITIVE_TYPES[0]], "..");
|
|
5522
|
-
const resolvedDir = path16.resolve(providerDir);
|
|
5523
|
-
if (fs14.existsSync(resolvedDir)) {
|
|
5508
|
+
if (!fs14.existsSync(typePath)) continue;
|
|
5524
5509
|
try {
|
|
5525
|
-
const
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5510
|
+
const entries = fs14.readdirSync(typePath, { withFileTypes: true });
|
|
5511
|
+
for (const entry of entries) {
|
|
5512
|
+
const fullPath = path16.join(typePath, entry.name);
|
|
5513
|
+
if (entry.isSymbolicLink()) {
|
|
5514
|
+
const target = path16.resolve(typePath, fs14.readlinkSync(fullPath));
|
|
5515
|
+
if (target.startsWith(resolvedSynapSync)) {
|
|
5516
|
+
symlinks.push(fullPath);
|
|
5517
|
+
}
|
|
5518
|
+
}
|
|
5530
5519
|
}
|
|
5531
5520
|
} catch {
|
|
5532
5521
|
}
|
|
5533
5522
|
}
|
|
5534
5523
|
}
|
|
5535
|
-
return
|
|
5524
|
+
return symlinks;
|
|
5525
|
+
}
|
|
5526
|
+
function removeProviderSymlinks(projectRoot, synapSyncDir) {
|
|
5527
|
+
const symlinks = findSynapSyncSymlinks(projectRoot, synapSyncDir);
|
|
5528
|
+
for (const link of symlinks) {
|
|
5529
|
+
fs14.unlinkSync(link);
|
|
5530
|
+
logger.log(` ${pc16.red("\u2717")} Removed symlink ${path16.relative(projectRoot, link)}`);
|
|
5531
|
+
}
|
|
5532
|
+
return symlinks.length;
|
|
5536
5533
|
}
|
|
5537
5534
|
function cleanGitignore(projectRoot) {
|
|
5538
5535
|
const gitignorePath = path16.join(projectRoot, ".gitignore");
|