@synapsync/cli 0.1.7 → 0.1.9
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/README.md +5 -5
- package/dist/index.js +197 -360
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -23,12 +23,14 @@ var version_exports = {};
|
|
|
23
23
|
__export(version_exports, {
|
|
24
24
|
version: () => version
|
|
25
25
|
});
|
|
26
|
-
|
|
26
|
+
import { createRequire } from "module";
|
|
27
|
+
var require2, version;
|
|
27
28
|
var init_version = __esm({
|
|
28
29
|
"src/version.ts"() {
|
|
29
30
|
"use strict";
|
|
30
31
|
init_esm_shims();
|
|
31
|
-
|
|
32
|
+
require2 = createRequire(import.meta.url);
|
|
33
|
+
version = require2("../package.json").version;
|
|
32
34
|
}
|
|
33
35
|
});
|
|
34
36
|
|
|
@@ -147,7 +149,7 @@ var REGISTRY_MANIFEST_FILE = "manifest.json";
|
|
|
147
149
|
// src/ui/repl.ts
|
|
148
150
|
init_esm_shims();
|
|
149
151
|
import * as readline from "readline";
|
|
150
|
-
import
|
|
152
|
+
import pc16 from "picocolors";
|
|
151
153
|
|
|
152
154
|
// src/ui/banner.ts
|
|
153
155
|
init_esm_shims();
|
|
@@ -339,7 +341,7 @@ function showBanner() {
|
|
|
339
341
|
logger.line();
|
|
340
342
|
logger.command("synapsync init", "Initialize a new project");
|
|
341
343
|
logger.command("synapsync connect", "Connect to AI providers");
|
|
342
|
-
logger.command("synapsync
|
|
344
|
+
logger.command("synapsync list --remote", "Browse registry for cognitives");
|
|
343
345
|
logger.command("synapsync add <name>", "Add skill, agent, or prompt");
|
|
344
346
|
logger.command("synapsync sync", "Sync assets to providers");
|
|
345
347
|
logger.line();
|
|
@@ -592,7 +594,7 @@ function showCategoriesInfo() {
|
|
|
592
594
|
logger.line();
|
|
593
595
|
logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync add")} react-patterns ${pc3.dim("--category frontend")}`);
|
|
594
596
|
logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync list")} --category devops`);
|
|
595
|
-
logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync
|
|
597
|
+
logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync list")} --remote --category security`);
|
|
596
598
|
logger.line();
|
|
597
599
|
}
|
|
598
600
|
function showSyncInfo() {
|
|
@@ -1648,7 +1650,7 @@ var AgentsMdGenerator = class {
|
|
|
1648
1650
|
START_MARKER,
|
|
1649
1651
|
"# SynapSync Project Cognitives",
|
|
1650
1652
|
"",
|
|
1651
|
-
"> Auto-generated by [SynapSync](https://synapsync.github.io/
|
|
1653
|
+
"> Auto-generated by [SynapSync](https://synapsync.github.io/synapse-cli/). Do not edit this section manually.",
|
|
1652
1654
|
""
|
|
1653
1655
|
];
|
|
1654
1656
|
if (entries.length === 0) {
|
|
@@ -1679,7 +1681,7 @@ var AgentsMdGenerator = class {
|
|
|
1679
1681
|
START_MARKER,
|
|
1680
1682
|
"# SynapSync Project Cognitives",
|
|
1681
1683
|
"",
|
|
1682
|
-
"> Auto-generated by [SynapSync](https://synapsync.github.io/
|
|
1684
|
+
"> Auto-generated by [SynapSync](https://synapsync.github.io/synapse-cli/). Do not edit this section manually.",
|
|
1683
1685
|
"",
|
|
1684
1686
|
"*No cognitives installed yet. Run `synapsync add <name>` to get started.*",
|
|
1685
1687
|
END_MARKER
|
|
@@ -2509,8 +2511,10 @@ function registerProvidersCommand(program) {
|
|
|
2509
2511
|
});
|
|
2510
2512
|
}
|
|
2511
2513
|
|
|
2512
|
-
// src/commands/
|
|
2514
|
+
// src/commands/add.ts
|
|
2513
2515
|
init_esm_shims();
|
|
2516
|
+
import * as fs9 from "fs";
|
|
2517
|
+
import * as path11 from "path";
|
|
2514
2518
|
import pc8 from "picocolors";
|
|
2515
2519
|
|
|
2516
2520
|
// src/services/registry/client.ts
|
|
@@ -2730,146 +2734,6 @@ var CognitiveNotFoundError = class extends Error {
|
|
|
2730
2734
|
}
|
|
2731
2735
|
};
|
|
2732
2736
|
|
|
2733
|
-
// src/commands/search.ts
|
|
2734
|
-
async function executeSearchCommand(query, options) {
|
|
2735
|
-
logger.line();
|
|
2736
|
-
const validatedOptions = validateOptions(options);
|
|
2737
|
-
if (validatedOptions === null) {
|
|
2738
|
-
return;
|
|
2739
|
-
}
|
|
2740
|
-
const searchingText = query !== void 0 && query.trim() !== "" ? `Searching for "${query}"...` : "Fetching cognitives from registry...";
|
|
2741
|
-
logger.log(` ${pc8.dim(searchingText)}`);
|
|
2742
|
-
try {
|
|
2743
|
-
const client = new RegistryClient();
|
|
2744
|
-
const isReachable = await client.ping();
|
|
2745
|
-
if (!isReachable) {
|
|
2746
|
-
logger.line();
|
|
2747
|
-
logger.error("Unable to reach the registry. Check your internet connection.");
|
|
2748
|
-
return;
|
|
2749
|
-
}
|
|
2750
|
-
const searchOpts = {};
|
|
2751
|
-
if (validatedOptions.type !== void 0) searchOpts.type = validatedOptions.type;
|
|
2752
|
-
if (validatedOptions.category !== void 0) searchOpts.category = validatedOptions.category;
|
|
2753
|
-
if (validatedOptions.tag !== void 0) searchOpts.tag = validatedOptions.tag;
|
|
2754
|
-
if (validatedOptions.limit !== void 0) searchOpts.limit = validatedOptions.limit;
|
|
2755
|
-
const result = await client.search(query, searchOpts);
|
|
2756
|
-
process.stdout.write("\x1B[1A\x1B[2K");
|
|
2757
|
-
if (options.json === true) {
|
|
2758
|
-
console.log(JSON.stringify(result, null, 2));
|
|
2759
|
-
return;
|
|
2760
|
-
}
|
|
2761
|
-
displaySearchResults(result.cognitives, query, result.total);
|
|
2762
|
-
} catch (error) {
|
|
2763
|
-
logger.line();
|
|
2764
|
-
if (error instanceof RegistryError) {
|
|
2765
|
-
logger.error(`Registry error: ${error.message}`);
|
|
2766
|
-
} else if (error instanceof Error) {
|
|
2767
|
-
logger.error(`Search failed: ${error.message}`);
|
|
2768
|
-
} else {
|
|
2769
|
-
logger.error("Search failed with unknown error");
|
|
2770
|
-
}
|
|
2771
|
-
}
|
|
2772
|
-
}
|
|
2773
|
-
function validateOptions(options) {
|
|
2774
|
-
const validated = {};
|
|
2775
|
-
if (options.type !== void 0) {
|
|
2776
|
-
if (!COGNITIVE_TYPES.includes(options.type)) {
|
|
2777
|
-
logger.error(`Invalid type: ${options.type}`);
|
|
2778
|
-
logger.hint(`Valid types: ${COGNITIVE_TYPES.join(", ")}`);
|
|
2779
|
-
return null;
|
|
2780
|
-
}
|
|
2781
|
-
validated.type = options.type;
|
|
2782
|
-
}
|
|
2783
|
-
if (options.category !== void 0) {
|
|
2784
|
-
if (!CATEGORIES.includes(options.category)) {
|
|
2785
|
-
logger.error(`Invalid category: ${options.category}`);
|
|
2786
|
-
logger.hint(`Valid categories: ${CATEGORIES.join(", ")}`);
|
|
2787
|
-
return null;
|
|
2788
|
-
}
|
|
2789
|
-
validated.category = options.category;
|
|
2790
|
-
}
|
|
2791
|
-
if (options.tag !== void 0) {
|
|
2792
|
-
validated.tag = options.tag;
|
|
2793
|
-
}
|
|
2794
|
-
if (options.limit !== void 0) {
|
|
2795
|
-
const limit = parseInt(options.limit, 10);
|
|
2796
|
-
if (isNaN(limit) || limit < 1) {
|
|
2797
|
-
logger.error("Limit must be a positive number");
|
|
2798
|
-
return null;
|
|
2799
|
-
}
|
|
2800
|
-
validated.limit = limit;
|
|
2801
|
-
}
|
|
2802
|
-
return validated;
|
|
2803
|
-
}
|
|
2804
|
-
function displaySearchResults(cognitives, query, total) {
|
|
2805
|
-
if (query !== void 0 && query.trim() !== "") {
|
|
2806
|
-
logger.bold(` Search Results for "${query}"`);
|
|
2807
|
-
} else {
|
|
2808
|
-
logger.bold(" Registry Cognitives");
|
|
2809
|
-
}
|
|
2810
|
-
logger.line();
|
|
2811
|
-
if (cognitives.length === 0) {
|
|
2812
|
-
logger.log(` ${pc8.dim("No cognitives found")}`);
|
|
2813
|
-
logger.line();
|
|
2814
|
-
logger.hint("Try a different search query or remove filters.");
|
|
2815
|
-
return;
|
|
2816
|
-
}
|
|
2817
|
-
if (cognitives.length < total) {
|
|
2818
|
-
logger.log(` ${pc8.dim(`Showing ${cognitives.length} of ${total} results`)}`);
|
|
2819
|
-
} else {
|
|
2820
|
-
logger.log(` ${pc8.dim(`Found ${total} cognitive${total === 1 ? "" : "s"}`)}`);
|
|
2821
|
-
}
|
|
2822
|
-
logger.line();
|
|
2823
|
-
for (const cognitive of cognitives) {
|
|
2824
|
-
displayCognitive(cognitive);
|
|
2825
|
-
}
|
|
2826
|
-
logger.line();
|
|
2827
|
-
logger.hint("Run synapsync add <name> to add a cognitive.");
|
|
2828
|
-
}
|
|
2829
|
-
function displayCognitive(cognitive) {
|
|
2830
|
-
const typeIcon = getCognitiveIcon2(cognitive.type);
|
|
2831
|
-
const typeLabel = pc8.dim(`[${cognitive.type}]`);
|
|
2832
|
-
logger.log(` ${typeIcon} ${pc8.bold(pc8.white(cognitive.name))} ${typeLabel}`);
|
|
2833
|
-
logger.log(` ${pc8.dim(truncate(cognitive.description, 60))}`);
|
|
2834
|
-
const meta = [];
|
|
2835
|
-
meta.push(pc8.dim(`v${cognitive.version}`));
|
|
2836
|
-
meta.push(pc8.dim(cognitive.category));
|
|
2837
|
-
if (cognitive.downloads > 0) {
|
|
2838
|
-
meta.push(pc8.dim(`${cognitive.downloads} downloads`));
|
|
2839
|
-
}
|
|
2840
|
-
logger.log(` ${meta.join(" \xB7 ")}`);
|
|
2841
|
-
if (cognitive.tags.length > 0) {
|
|
2842
|
-
const tags = cognitive.tags.slice(0, 5).map((t) => pc8.cyan(t)).join(" ");
|
|
2843
|
-
logger.log(` ${tags}`);
|
|
2844
|
-
}
|
|
2845
|
-
logger.line();
|
|
2846
|
-
}
|
|
2847
|
-
function getCognitiveIcon2(type) {
|
|
2848
|
-
const icons = {
|
|
2849
|
-
skill: pc8.blue("\u25C6"),
|
|
2850
|
-
agent: pc8.magenta("\u25C6"),
|
|
2851
|
-
prompt: pc8.yellow("\u25C6"),
|
|
2852
|
-
workflow: pc8.cyan("\u25C6"),
|
|
2853
|
-
tool: pc8.green("\u25C6")
|
|
2854
|
-
};
|
|
2855
|
-
return icons[type];
|
|
2856
|
-
}
|
|
2857
|
-
function truncate(text2, maxLength) {
|
|
2858
|
-
if (text2.length <= maxLength) return text2;
|
|
2859
|
-
return text2.slice(0, maxLength - 3) + "...";
|
|
2860
|
-
}
|
|
2861
|
-
function registerSearchCommand(program) {
|
|
2862
|
-
program.command("search [query]").description("Search for cognitives in the registry").option("-t, --type <type>", "Filter by type (skill, agent, prompt, workflow, tool)").option("-c, --category <category>", "Filter by category").option("--tag <tag>", "Filter by tag").option("-l, --limit <number>", "Limit results", "20").option("--json", "Output as JSON").action(async (query, options) => {
|
|
2863
|
-
await executeSearchCommand(query, options);
|
|
2864
|
-
});
|
|
2865
|
-
}
|
|
2866
|
-
|
|
2867
|
-
// src/commands/add.ts
|
|
2868
|
-
init_esm_shims();
|
|
2869
|
-
import * as fs9 from "fs";
|
|
2870
|
-
import * as path11 from "path";
|
|
2871
|
-
import pc9 from "picocolors";
|
|
2872
|
-
|
|
2873
2737
|
// src/services/sync/engine.ts
|
|
2874
2738
|
init_esm_shims();
|
|
2875
2739
|
import * as path10 from "path";
|
|
@@ -3563,7 +3427,7 @@ async function executeAddCommand(source, options) {
|
|
|
3563
3427
|
return;
|
|
3564
3428
|
}
|
|
3565
3429
|
const parsedSource = parseSource(source);
|
|
3566
|
-
logger.log(` ${
|
|
3430
|
+
logger.log(` ${pc8.dim(`Installing from ${parsedSource.type}...`)}`);
|
|
3567
3431
|
let success = false;
|
|
3568
3432
|
try {
|
|
3569
3433
|
switch (parsedSource.type) {
|
|
@@ -3580,7 +3444,7 @@ async function executeAddCommand(source, options) {
|
|
|
3580
3444
|
break;
|
|
3581
3445
|
}
|
|
3582
3446
|
if (success) {
|
|
3583
|
-
logger.log(` ${
|
|
3447
|
+
logger.log(` ${pc8.dim("Syncing to providers...")}`);
|
|
3584
3448
|
const synapSyncDir = configManager.getSynapSyncDir();
|
|
3585
3449
|
const projectRoot = configManager.getProjectRoot();
|
|
3586
3450
|
const config = configManager.getConfig();
|
|
@@ -3591,9 +3455,9 @@ async function executeAddCommand(source, options) {
|
|
|
3591
3455
|
const created = pr.created.filter((c) => c.success).length;
|
|
3592
3456
|
const skipped = pr.skipped.length;
|
|
3593
3457
|
if (created > 0) {
|
|
3594
|
-
logger.log(` ${
|
|
3458
|
+
logger.log(` ${pc8.green("\u2713")} Synced to ${pr.provider} (${created} created)`);
|
|
3595
3459
|
} else if (skipped > 0) {
|
|
3596
|
-
logger.log(` ${
|
|
3460
|
+
logger.log(` ${pc8.green("\u2713")} Synced to ${pr.provider} (already up to date)`);
|
|
3597
3461
|
}
|
|
3598
3462
|
}
|
|
3599
3463
|
}
|
|
@@ -3604,7 +3468,7 @@ async function executeAddCommand(source, options) {
|
|
|
3604
3468
|
logger.line();
|
|
3605
3469
|
if (error instanceof CognitiveNotFoundError) {
|
|
3606
3470
|
logger.error(`Cognitive '${error.cognitiveName}' not found in registry.`);
|
|
3607
|
-
logger.hint("Run synapsync
|
|
3471
|
+
logger.hint("Run synapsync list --remote to browse available cognitives.");
|
|
3608
3472
|
} else if (error instanceof RegistryError) {
|
|
3609
3473
|
logger.error(`Registry error: ${error.message}`);
|
|
3610
3474
|
} else if (error instanceof Error) {
|
|
@@ -3665,10 +3529,10 @@ async function installFromRegistry(name, options, configManager) {
|
|
|
3665
3529
|
saveCognitive(targetDir, manifest, downloaded.content, assets);
|
|
3666
3530
|
updateProjectManifest(configManager, manifest, "registry");
|
|
3667
3531
|
logger.line();
|
|
3668
|
-
logger.log(` ${
|
|
3669
|
-
logger.log(` ${
|
|
3670
|
-
logger.log(` ${
|
|
3671
|
-
logger.log(` ${
|
|
3532
|
+
logger.log(` ${pc8.green("\u2713")} Installed ${pc8.bold(manifest.name)} ${pc8.dim(`v${manifest.version}`)}`);
|
|
3533
|
+
logger.log(` ${pc8.dim("Type:")} ${manifest.type}`);
|
|
3534
|
+
logger.log(` ${pc8.dim("Category:")} ${category}`);
|
|
3535
|
+
logger.log(` ${pc8.dim("Location:")} ${path11.relative(process.cwd(), targetDir)}`);
|
|
3672
3536
|
return true;
|
|
3673
3537
|
}
|
|
3674
3538
|
async function downloadAssets(client, name, _manifest) {
|
|
@@ -3743,11 +3607,11 @@ function installFromLocal(sourcePath, options, configManager) {
|
|
|
3743
3607
|
saveCognitive(targetDir, manifest, content, assets);
|
|
3744
3608
|
updateProjectManifest(configManager, manifest, "local");
|
|
3745
3609
|
logger.line();
|
|
3746
|
-
logger.log(` ${
|
|
3747
|
-
logger.log(` ${
|
|
3748
|
-
logger.log(` ${
|
|
3749
|
-
logger.log(` ${
|
|
3750
|
-
logger.log(` ${
|
|
3610
|
+
logger.log(` ${pc8.green("\u2713")} Installed ${pc8.bold(name)} ${pc8.dim(`v${manifest.version}`)}`);
|
|
3611
|
+
logger.log(` ${pc8.dim("Type:")} ${cognitiveType}`);
|
|
3612
|
+
logger.log(` ${pc8.dim("Category:")} ${category}`);
|
|
3613
|
+
logger.log(` ${pc8.dim("Source:")} local`);
|
|
3614
|
+
logger.log(` ${pc8.dim("Location:")} ${path11.relative(process.cwd(), targetDir)}`);
|
|
3751
3615
|
return true;
|
|
3752
3616
|
}
|
|
3753
3617
|
function detectCognitiveType(dirPath) {
|
|
@@ -3864,7 +3728,7 @@ function registerAddCommand(program) {
|
|
|
3864
3728
|
init_esm_shims();
|
|
3865
3729
|
import * as fs10 from "fs";
|
|
3866
3730
|
import * as path12 from "path";
|
|
3867
|
-
import
|
|
3731
|
+
import pc9 from "picocolors";
|
|
3868
3732
|
async function executeListCommand(options) {
|
|
3869
3733
|
logger.line();
|
|
3870
3734
|
if (options.remote === true) {
|
|
@@ -3877,7 +3741,7 @@ async function executeListCommand(options) {
|
|
|
3877
3741
|
logger.hint("Run synapsync init to initialize a project first.");
|
|
3878
3742
|
return;
|
|
3879
3743
|
}
|
|
3880
|
-
const validatedOptions =
|
|
3744
|
+
const validatedOptions = validateOptions(options);
|
|
3881
3745
|
if (validatedOptions === null) {
|
|
3882
3746
|
return;
|
|
3883
3747
|
}
|
|
@@ -3892,10 +3756,10 @@ async function executeListCommand(options) {
|
|
|
3892
3756
|
}
|
|
3893
3757
|
async function listRemoteCognitives(options) {
|
|
3894
3758
|
const client = new RegistryClient();
|
|
3895
|
-
logger.log(` ${
|
|
3759
|
+
logger.log(` ${pc9.dim("Fetching registry...")}`);
|
|
3896
3760
|
try {
|
|
3897
3761
|
const cognitives = await client.list();
|
|
3898
|
-
const validatedOptions =
|
|
3762
|
+
const validatedOptions = validateOptions(options);
|
|
3899
3763
|
if (validatedOptions === null) {
|
|
3900
3764
|
return;
|
|
3901
3765
|
}
|
|
@@ -3917,6 +3781,12 @@ function filterRemoteCognitives(cognitives, options) {
|
|
|
3917
3781
|
if (options.category !== void 0 && c.category !== options.category) {
|
|
3918
3782
|
return false;
|
|
3919
3783
|
}
|
|
3784
|
+
if (options.tag !== void 0) {
|
|
3785
|
+
const tag = options.tag;
|
|
3786
|
+
if (!c.tags.some((t) => t.toLowerCase() === tag.toLowerCase())) {
|
|
3787
|
+
return false;
|
|
3788
|
+
}
|
|
3789
|
+
}
|
|
3920
3790
|
return true;
|
|
3921
3791
|
});
|
|
3922
3792
|
}
|
|
@@ -3925,7 +3795,7 @@ function displayRemoteCognitives(cognitives) {
|
|
|
3925
3795
|
logger.bold(" Available Cognitives (Registry)");
|
|
3926
3796
|
logger.line();
|
|
3927
3797
|
if (cognitives.length === 0) {
|
|
3928
|
-
logger.log(` ${
|
|
3798
|
+
logger.log(` ${pc9.dim("No cognitives found in registry.")}`);
|
|
3929
3799
|
return;
|
|
3930
3800
|
}
|
|
3931
3801
|
const grouped = {};
|
|
@@ -3934,34 +3804,34 @@ function displayRemoteCognitives(cognitives) {
|
|
|
3934
3804
|
grouped[cognitive.type].push(cognitive);
|
|
3935
3805
|
}
|
|
3936
3806
|
for (const [type, items] of Object.entries(grouped)) {
|
|
3937
|
-
const typeIcon =
|
|
3807
|
+
const typeIcon = getCognitiveIcon2(type);
|
|
3938
3808
|
const typeLabel = `${type}s`;
|
|
3939
|
-
logger.log(` ${typeIcon} ${
|
|
3809
|
+
logger.log(` ${typeIcon} ${pc9.bold(typeLabel.charAt(0).toUpperCase() + typeLabel.slice(1))} (${items.length})`);
|
|
3940
3810
|
logger.line();
|
|
3941
3811
|
for (const cognitive of items) {
|
|
3942
|
-
logger.log(` ${
|
|
3812
|
+
logger.log(` ${pc9.white(cognitive.name)} ${pc9.dim(`v${cognitive.version}`)}`);
|
|
3943
3813
|
if (cognitive.description) {
|
|
3944
3814
|
const desc = cognitive.description.length > 60 ? cognitive.description.slice(0, 57) + "..." : cognitive.description;
|
|
3945
|
-
logger.log(` ${
|
|
3815
|
+
logger.log(` ${pc9.dim(desc)}`);
|
|
3946
3816
|
}
|
|
3947
3817
|
const details = [];
|
|
3948
|
-
details.push(
|
|
3818
|
+
details.push(pc9.dim(cognitive.category));
|
|
3949
3819
|
if (cognitive.author) {
|
|
3950
|
-
details.push(
|
|
3820
|
+
details.push(pc9.dim(`by ${cognitive.author}`));
|
|
3951
3821
|
}
|
|
3952
3822
|
logger.log(` ${details.join(" \xB7 ")}`);
|
|
3953
3823
|
if (cognitive.tags !== void 0 && cognitive.tags.length > 0) {
|
|
3954
3824
|
const tagsStr = cognitive.tags.slice(0, 5).join(" ");
|
|
3955
|
-
logger.log(` ${
|
|
3825
|
+
logger.log(` ${pc9.cyan(tagsStr)}`);
|
|
3956
3826
|
}
|
|
3957
3827
|
logger.line();
|
|
3958
3828
|
}
|
|
3959
3829
|
}
|
|
3960
|
-
logger.log(` ${
|
|
3830
|
+
logger.log(` ${pc9.dim(`Total: ${cognitives.length} cognitive${cognitives.length === 1 ? "" : "s"} available`)}`);
|
|
3961
3831
|
logger.line();
|
|
3962
3832
|
logger.hint("Run synapsync add <name> to add a cognitive.");
|
|
3963
3833
|
}
|
|
3964
|
-
function
|
|
3834
|
+
function validateOptions(options) {
|
|
3965
3835
|
const validated = {};
|
|
3966
3836
|
if (options.type !== void 0) {
|
|
3967
3837
|
if (!COGNITIVE_TYPES.includes(options.type)) {
|
|
@@ -3979,6 +3849,9 @@ function validateOptions2(options) {
|
|
|
3979
3849
|
}
|
|
3980
3850
|
validated.category = options.category;
|
|
3981
3851
|
}
|
|
3852
|
+
if (options.tag !== void 0) {
|
|
3853
|
+
validated.tag = options.tag;
|
|
3854
|
+
}
|
|
3982
3855
|
return validated;
|
|
3983
3856
|
}
|
|
3984
3857
|
function readManifest(configManager) {
|
|
@@ -4022,11 +3895,11 @@ function displayCognitives(manifest, options) {
|
|
|
4022
3895
|
logger.line();
|
|
4023
3896
|
if (filtered.length === 0) {
|
|
4024
3897
|
if (cognitives.length === 0) {
|
|
4025
|
-
logger.log(` ${
|
|
3898
|
+
logger.log(` ${pc9.dim("No cognitives installed yet.")}`);
|
|
4026
3899
|
logger.line();
|
|
4027
|
-
logger.hint("Run synapsync
|
|
3900
|
+
logger.hint("Run synapsync list --remote to browse available cognitives.");
|
|
4028
3901
|
} else {
|
|
4029
|
-
logger.log(` ${
|
|
3902
|
+
logger.log(` ${pc9.dim("No cognitives match the specified filters.")}`);
|
|
4030
3903
|
logger.line();
|
|
4031
3904
|
logger.hint("Try removing filters to see all installed cognitives.");
|
|
4032
3905
|
}
|
|
@@ -4034,16 +3907,16 @@ function displayCognitives(manifest, options) {
|
|
|
4034
3907
|
}
|
|
4035
3908
|
const grouped = groupByType(filtered);
|
|
4036
3909
|
for (const [type, items] of Object.entries(grouped)) {
|
|
4037
|
-
const typeIcon =
|
|
3910
|
+
const typeIcon = getCognitiveIcon2(type);
|
|
4038
3911
|
const typeLabel = `${type}s`;
|
|
4039
|
-
logger.log(` ${typeIcon} ${
|
|
3912
|
+
logger.log(` ${typeIcon} ${pc9.bold(typeLabel.charAt(0).toUpperCase() + typeLabel.slice(1))} (${items.length})`);
|
|
4040
3913
|
logger.line();
|
|
4041
3914
|
for (const cognitive of items) {
|
|
4042
|
-
|
|
3915
|
+
displayCognitive(cognitive);
|
|
4043
3916
|
}
|
|
4044
3917
|
}
|
|
4045
3918
|
logger.line();
|
|
4046
|
-
logger.log(` ${
|
|
3919
|
+
logger.log(` ${pc9.dim(`Total: ${filtered.length} cognitive${filtered.length === 1 ? "" : "s"}`)}`);
|
|
4047
3920
|
logger.line();
|
|
4048
3921
|
logger.hint("Run synapsync uninstall <name> to remove a cognitive.");
|
|
4049
3922
|
}
|
|
@@ -4055,25 +3928,25 @@ function groupByType(cognitives) {
|
|
|
4055
3928
|
}
|
|
4056
3929
|
return grouped;
|
|
4057
3930
|
}
|
|
4058
|
-
function
|
|
4059
|
-
logger.log(` ${
|
|
3931
|
+
function displayCognitive(cognitive) {
|
|
3932
|
+
logger.log(` ${pc9.white(cognitive.name)} ${pc9.dim(`v${cognitive.version}`)}`);
|
|
4060
3933
|
const details = [];
|
|
4061
|
-
details.push(
|
|
4062
|
-
details.push(
|
|
3934
|
+
details.push(pc9.dim(cognitive.category));
|
|
3935
|
+
details.push(pc9.dim(`from ${cognitive.source}`));
|
|
4063
3936
|
if (cognitive.installedAt !== void 0) {
|
|
4064
3937
|
const date = new Date(cognitive.installedAt);
|
|
4065
|
-
details.push(
|
|
3938
|
+
details.push(pc9.dim(`installed ${formatDate(date)}`));
|
|
4066
3939
|
}
|
|
4067
3940
|
logger.log(` ${details.join(" \xB7 ")}`);
|
|
4068
3941
|
logger.line();
|
|
4069
3942
|
}
|
|
4070
|
-
function
|
|
3943
|
+
function getCognitiveIcon2(type) {
|
|
4071
3944
|
const icons = {
|
|
4072
|
-
skill:
|
|
4073
|
-
agent:
|
|
4074
|
-
prompt:
|
|
4075
|
-
workflow:
|
|
4076
|
-
tool:
|
|
3945
|
+
skill: pc9.blue("\u25C6"),
|
|
3946
|
+
agent: pc9.magenta("\u25C6"),
|
|
3947
|
+
prompt: pc9.yellow("\u25C6"),
|
|
3948
|
+
workflow: pc9.cyan("\u25C6"),
|
|
3949
|
+
tool: pc9.green("\u25C6")
|
|
4077
3950
|
};
|
|
4078
3951
|
return icons[type];
|
|
4079
3952
|
}
|
|
@@ -4095,7 +3968,7 @@ function formatDate(date) {
|
|
|
4095
3968
|
}
|
|
4096
3969
|
}
|
|
4097
3970
|
function registerListCommand(program) {
|
|
4098
|
-
program.command("list").alias("ls").description("List installed cognitives or browse registry").option("-t, --type <type>", "Filter by type (skill, agent, prompt, workflow, tool)").option("-c, --category <category>", "Filter by category").option("-r, --remote", "List all cognitives available in the registry").option("--json", "Output as JSON").action(async (options) => {
|
|
3971
|
+
program.command("list").alias("ls").description("List installed cognitives or browse registry").option("-t, --type <type>", "Filter by type (skill, agent, prompt, workflow, tool)").option("-c, --category <category>", "Filter by category").option("--tag <tag>", "Filter by tag (remote only)").option("-r, --remote", "List all cognitives available in the registry").option("--json", "Output as JSON").action(async (options) => {
|
|
4099
3972
|
await executeListCommand(options);
|
|
4100
3973
|
});
|
|
4101
3974
|
}
|
|
@@ -4104,7 +3977,7 @@ function registerListCommand(program) {
|
|
|
4104
3977
|
init_esm_shims();
|
|
4105
3978
|
import * as fs11 from "fs";
|
|
4106
3979
|
import * as path13 from "path";
|
|
4107
|
-
import
|
|
3980
|
+
import pc10 from "picocolors";
|
|
4108
3981
|
function executeUninstallCommand(name, options) {
|
|
4109
3982
|
logger.line();
|
|
4110
3983
|
const configManager = ConfigManager.findConfig();
|
|
@@ -4121,13 +3994,13 @@ function executeUninstallCommand(name, options) {
|
|
|
4121
3994
|
return;
|
|
4122
3995
|
}
|
|
4123
3996
|
if (options.force !== true) {
|
|
4124
|
-
logger.log(` ${
|
|
4125
|
-
logger.log(` ${
|
|
4126
|
-
logger.log(` ${
|
|
4127
|
-
logger.log(` ${
|
|
3997
|
+
logger.log(` ${pc10.yellow("!")} About to uninstall ${pc10.bold(name)}`);
|
|
3998
|
+
logger.log(` ${pc10.dim("Type:")} ${cognitive.type}`);
|
|
3999
|
+
logger.log(` ${pc10.dim("Category:")} ${cognitive.category}`);
|
|
4000
|
+
logger.log(` ${pc10.dim("Version:")} ${cognitive.version}`);
|
|
4128
4001
|
logger.line();
|
|
4129
4002
|
logger.hint("Use --force to skip confirmation and uninstall directly.");
|
|
4130
|
-
logger.log(` ${
|
|
4003
|
+
logger.log(` ${pc10.dim("To confirm, run:")} synapsync uninstall ${name} --force`);
|
|
4131
4004
|
return;
|
|
4132
4005
|
}
|
|
4133
4006
|
try {
|
|
@@ -4135,7 +4008,7 @@ function executeUninstallCommand(name, options) {
|
|
|
4135
4008
|
const cognitiveDir = getCognitiveDir(configManager, cognitive);
|
|
4136
4009
|
if (fs11.existsSync(cognitiveDir)) {
|
|
4137
4010
|
fs11.rmSync(cognitiveDir, { recursive: true, force: true });
|
|
4138
|
-
logger.log(` ${
|
|
4011
|
+
logger.log(` ${pc10.dim("Removed files from")} ${path13.relative(process.cwd(), cognitiveDir)}`);
|
|
4139
4012
|
}
|
|
4140
4013
|
}
|
|
4141
4014
|
delete manifest.cognitives[name];
|
|
@@ -4143,7 +4016,7 @@ function executeUninstallCommand(name, options) {
|
|
|
4143
4016
|
saveManifest(configManager, manifest);
|
|
4144
4017
|
regenerateAgentsMd(configManager.getProjectRoot(), configManager.getSynapSyncDir());
|
|
4145
4018
|
logger.line();
|
|
4146
|
-
logger.log(` ${
|
|
4019
|
+
logger.log(` ${pc10.green("\u2713")} Uninstalled ${pc10.bold(name)}`);
|
|
4147
4020
|
logger.line();
|
|
4148
4021
|
logger.hint("Note: Provider symlinks may need manual cleanup if sync was run.");
|
|
4149
4022
|
} catch (error) {
|
|
@@ -4195,7 +4068,7 @@ function registerUninstallCommand(program) {
|
|
|
4195
4068
|
|
|
4196
4069
|
// src/commands/sync.ts
|
|
4197
4070
|
init_esm_shims();
|
|
4198
|
-
import
|
|
4071
|
+
import pc11 from "picocolors";
|
|
4199
4072
|
function executeSyncCommand(options) {
|
|
4200
4073
|
logger.line();
|
|
4201
4074
|
const configManager = ConfigManager.findConfig();
|
|
@@ -4204,7 +4077,7 @@ function executeSyncCommand(options) {
|
|
|
4204
4077
|
logger.hint("Run synapsync init to initialize a project first.");
|
|
4205
4078
|
return;
|
|
4206
4079
|
}
|
|
4207
|
-
const validatedOptions =
|
|
4080
|
+
const validatedOptions = validateOptions2(options);
|
|
4208
4081
|
if (validatedOptions === null) {
|
|
4209
4082
|
return;
|
|
4210
4083
|
}
|
|
@@ -4232,7 +4105,7 @@ function executeSyncCommand(options) {
|
|
|
4232
4105
|
syncOpts,
|
|
4233
4106
|
options.json !== true ? (status) => {
|
|
4234
4107
|
if (options.verbose === true) {
|
|
4235
|
-
logger.log(` ${
|
|
4108
|
+
logger.log(` ${pc11.dim(status.message)}`);
|
|
4236
4109
|
}
|
|
4237
4110
|
} : void 0
|
|
4238
4111
|
);
|
|
@@ -4247,7 +4120,7 @@ function executeSyncCommand(options) {
|
|
|
4247
4120
|
}
|
|
4248
4121
|
displayResults(result, options);
|
|
4249
4122
|
}
|
|
4250
|
-
function
|
|
4123
|
+
function validateOptions2(options) {
|
|
4251
4124
|
const validated = {};
|
|
4252
4125
|
if (options.type !== void 0) {
|
|
4253
4126
|
if (!COGNITIVE_TYPES.includes(options.type)) {
|
|
@@ -4282,13 +4155,13 @@ function displayResults(result, options) {
|
|
|
4282
4155
|
(pr) => pr.created.length > 0 || pr.removed.length > 0
|
|
4283
4156
|
);
|
|
4284
4157
|
if (!hasManifestChanges && hasProviderChanges !== true) {
|
|
4285
|
-
logger.log(` ${
|
|
4158
|
+
logger.log(` ${pc11.green("\u2713")} Everything is in sync`);
|
|
4286
4159
|
logger.line();
|
|
4287
|
-
logger.log(` ${
|
|
4160
|
+
logger.log(` ${pc11.dim(`${result.total} cognitives in manifest`)}`);
|
|
4288
4161
|
if (hasProviderResults && result.providerResults !== void 0) {
|
|
4289
4162
|
const syncedProviders = result.providerResults.filter((pr) => pr.skipped.length > 0 || pr.created.length > 0);
|
|
4290
4163
|
if (syncedProviders.length > 0) {
|
|
4291
|
-
logger.log(` ${
|
|
4164
|
+
logger.log(` ${pc11.dim(`${syncedProviders.length} provider(s) synced`)}`);
|
|
4292
4165
|
}
|
|
4293
4166
|
}
|
|
4294
4167
|
logger.line();
|
|
@@ -4308,16 +4181,16 @@ function displayResults(result, options) {
|
|
|
4308
4181
|
}
|
|
4309
4182
|
logger.line();
|
|
4310
4183
|
if (result.added > 0) {
|
|
4311
|
-
logger.log(` ${
|
|
4184
|
+
logger.log(` ${pc11.green("+")} ${result.added} added`);
|
|
4312
4185
|
}
|
|
4313
4186
|
if (result.updated > 0) {
|
|
4314
|
-
logger.log(` ${
|
|
4187
|
+
logger.log(` ${pc11.yellow("~")} ${result.updated} updated`);
|
|
4315
4188
|
}
|
|
4316
4189
|
if (result.removed > 0) {
|
|
4317
|
-
logger.log(` ${
|
|
4190
|
+
logger.log(` ${pc11.red("-")} ${result.removed} removed`);
|
|
4318
4191
|
}
|
|
4319
4192
|
if (result.unchanged > 0) {
|
|
4320
|
-
logger.log(` ${
|
|
4193
|
+
logger.log(` ${pc11.dim("\u25CB")} ${result.unchanged} unchanged`);
|
|
4321
4194
|
}
|
|
4322
4195
|
logger.line();
|
|
4323
4196
|
}
|
|
@@ -4328,14 +4201,14 @@ function displayResults(result, options) {
|
|
|
4328
4201
|
displayProviderResult(providerResult, options);
|
|
4329
4202
|
}
|
|
4330
4203
|
}
|
|
4331
|
-
logger.log(` ${
|
|
4204
|
+
logger.log(` ${pc11.dim(`Total: ${result.total} cognitives | Duration: ${result.duration}ms`)}`);
|
|
4332
4205
|
logger.line();
|
|
4333
4206
|
if (result.errors.length > 0) {
|
|
4334
4207
|
logger.line();
|
|
4335
|
-
logger.bold(` ${
|
|
4208
|
+
logger.bold(` ${pc11.red("Errors:")}`);
|
|
4336
4209
|
logger.line();
|
|
4337
4210
|
for (const error of result.errors) {
|
|
4338
|
-
logger.log(` ${
|
|
4211
|
+
logger.log(` ${pc11.red("\u2717")} ${error.cognitive ?? "Unknown"}: ${error.message}`);
|
|
4339
4212
|
}
|
|
4340
4213
|
logger.line();
|
|
4341
4214
|
}
|
|
@@ -4351,13 +4224,13 @@ function displayActions(actions, isDryRun) {
|
|
|
4351
4224
|
const name = typeof action.cognitive === "string" ? action.cognitive : action.cognitive.name;
|
|
4352
4225
|
switch (action.operation) {
|
|
4353
4226
|
case "add":
|
|
4354
|
-
logger.log(` ${
|
|
4227
|
+
logger.log(` ${pc11.green("+")} ${verb} add: ${pc11.white(name)}`);
|
|
4355
4228
|
break;
|
|
4356
4229
|
case "update":
|
|
4357
|
-
logger.log(` ${
|
|
4230
|
+
logger.log(` ${pc11.yellow("~")} ${verb} update: ${pc11.white(name)}`);
|
|
4358
4231
|
break;
|
|
4359
4232
|
case "remove":
|
|
4360
|
-
logger.log(` ${
|
|
4233
|
+
logger.log(` ${pc11.red("-")} ${verb} remove: ${pc11.white(name)}`);
|
|
4361
4234
|
break;
|
|
4362
4235
|
}
|
|
4363
4236
|
}
|
|
@@ -4369,22 +4242,22 @@ function displayProviderResult(result, options) {
|
|
|
4369
4242
|
const errors = result.errors.length;
|
|
4370
4243
|
const methodLabel = result.method === "symlink" ? "symlinks" : "copies";
|
|
4371
4244
|
const hasChanges = created > 0 || removed > 0;
|
|
4372
|
-
logger.log(` ${
|
|
4245
|
+
logger.log(` ${pc11.cyan(result.provider)}:`);
|
|
4373
4246
|
if (hasChanges || options.verbose === true) {
|
|
4374
4247
|
if (created > 0) {
|
|
4375
|
-
logger.log(` ${
|
|
4248
|
+
logger.log(` ${pc11.green("\u2713")} ${created} ${methodLabel} created`);
|
|
4376
4249
|
}
|
|
4377
4250
|
if (skipped > 0) {
|
|
4378
|
-
logger.log(` ${
|
|
4251
|
+
logger.log(` ${pc11.dim("\u25CB")} ${skipped} already synced`);
|
|
4379
4252
|
}
|
|
4380
4253
|
if (removed > 0) {
|
|
4381
|
-
logger.log(` ${
|
|
4254
|
+
logger.log(` ${pc11.red("-")} ${removed} orphaned removed`);
|
|
4382
4255
|
}
|
|
4383
4256
|
if (errors > 0) {
|
|
4384
|
-
logger.log(` ${
|
|
4257
|
+
logger.log(` ${pc11.red("\u2717")} ${errors} errors`);
|
|
4385
4258
|
}
|
|
4386
4259
|
} else {
|
|
4387
|
-
logger.log(` ${
|
|
4260
|
+
logger.log(` ${pc11.green("\u2713")} ${skipped + created} ${methodLabel} synced`);
|
|
4388
4261
|
}
|
|
4389
4262
|
logger.line();
|
|
4390
4263
|
}
|
|
@@ -4414,23 +4287,23 @@ function executeSyncStatusCommand(options) {
|
|
|
4414
4287
|
logger.bold(" Sync Status");
|
|
4415
4288
|
logger.line();
|
|
4416
4289
|
if (status.inSync) {
|
|
4417
|
-
logger.log(` ${
|
|
4290
|
+
logger.log(` ${pc11.green("\u2713")} Filesystem and manifest are in sync`);
|
|
4418
4291
|
} else {
|
|
4419
|
-
logger.log(` ${
|
|
4292
|
+
logger.log(` ${pc11.yellow("!")} Out of sync`);
|
|
4420
4293
|
}
|
|
4421
4294
|
logger.line();
|
|
4422
|
-
logger.log(` ${
|
|
4423
|
-
logger.log(` ${
|
|
4295
|
+
logger.log(` ${pc11.dim("Manifest:")} ${status.manifest} cognitives`);
|
|
4296
|
+
logger.log(` ${pc11.dim("Filesystem:")} ${status.filesystem} cognitives`);
|
|
4424
4297
|
if (!status.inSync) {
|
|
4425
4298
|
logger.line();
|
|
4426
4299
|
if (status.newInFilesystem > 0) {
|
|
4427
|
-
logger.log(` ${
|
|
4300
|
+
logger.log(` ${pc11.green("+")} ${status.newInFilesystem} new in filesystem`);
|
|
4428
4301
|
}
|
|
4429
4302
|
if (status.removedFromFilesystem > 0) {
|
|
4430
|
-
logger.log(` ${
|
|
4303
|
+
logger.log(` ${pc11.red("-")} ${status.removedFromFilesystem} removed from filesystem`);
|
|
4431
4304
|
}
|
|
4432
4305
|
if (status.modified > 0) {
|
|
4433
|
-
logger.log(` ${
|
|
4306
|
+
logger.log(` ${pc11.yellow("~")} ${status.modified} modified`);
|
|
4434
4307
|
}
|
|
4435
4308
|
}
|
|
4436
4309
|
if (enabledProviders.length > 0) {
|
|
@@ -4442,19 +4315,19 @@ function executeSyncStatusCommand(options) {
|
|
|
4442
4315
|
if (pStatus === void 0) continue;
|
|
4443
4316
|
const total = pStatus.valid + pStatus.broken + pStatus.orphaned;
|
|
4444
4317
|
const hasIssues = pStatus.broken > 0 || pStatus.orphaned > 0;
|
|
4445
|
-
logger.log(` ${
|
|
4318
|
+
logger.log(` ${pc11.cyan(provider)}:`);
|
|
4446
4319
|
if (hasIssues) {
|
|
4447
|
-
logger.log(` ${
|
|
4320
|
+
logger.log(` ${pc11.green("\u2713")} ${pStatus.valid} valid`);
|
|
4448
4321
|
if (pStatus.broken > 0) {
|
|
4449
|
-
logger.log(` ${
|
|
4322
|
+
logger.log(` ${pc11.red("\u2717")} ${pStatus.broken} broken`);
|
|
4450
4323
|
}
|
|
4451
4324
|
if (pStatus.orphaned > 0) {
|
|
4452
|
-
logger.log(` ${
|
|
4325
|
+
logger.log(` ${pc11.yellow("?")} ${pStatus.orphaned} orphaned`);
|
|
4453
4326
|
}
|
|
4454
4327
|
} else if (total > 0) {
|
|
4455
|
-
logger.log(` ${
|
|
4328
|
+
logger.log(` ${pc11.green("\u2713")} ${total} symlinks valid`);
|
|
4456
4329
|
} else {
|
|
4457
|
-
logger.log(` ${
|
|
4330
|
+
logger.log(` ${pc11.dim("\u25CB")} No symlinks yet`);
|
|
4458
4331
|
}
|
|
4459
4332
|
}
|
|
4460
4333
|
}
|
|
@@ -4476,7 +4349,7 @@ function registerSyncCommand(program) {
|
|
|
4476
4349
|
init_esm_shims();
|
|
4477
4350
|
import * as fs12 from "fs";
|
|
4478
4351
|
import * as path14 from "path";
|
|
4479
|
-
import
|
|
4352
|
+
import pc12 from "picocolors";
|
|
4480
4353
|
|
|
4481
4354
|
// src/services/maintenance/update-checker.ts
|
|
4482
4355
|
init_esm_shims();
|
|
@@ -4599,7 +4472,7 @@ async function executeUpdateCommand(cognitiveName, options = {}) {
|
|
|
4599
4472
|
if (options.json === true) {
|
|
4600
4473
|
console.log(JSON.stringify({ message: "No cognitives installed" }));
|
|
4601
4474
|
} else {
|
|
4602
|
-
logger.log(` ${
|
|
4475
|
+
logger.log(` ${pc12.dim("No cognitives installed.")}`);
|
|
4603
4476
|
logger.hint("Run synapsync add <name> to add a cognitive.");
|
|
4604
4477
|
}
|
|
4605
4478
|
return;
|
|
@@ -4634,7 +4507,7 @@ async function executeUpdateCommand(cognitiveName, options = {}) {
|
|
|
4634
4507
|
displayCheckResults(checkResult);
|
|
4635
4508
|
if (checkResult.updatesAvailable.length === 0) {
|
|
4636
4509
|
logger.line();
|
|
4637
|
-
logger.log(` ${
|
|
4510
|
+
logger.log(` ${pc12.green("\u2713")} All cognitives are up to date`);
|
|
4638
4511
|
logger.line();
|
|
4639
4512
|
return;
|
|
4640
4513
|
}
|
|
@@ -4650,7 +4523,7 @@ async function executeUpdateCommand(cognitiveName, options = {}) {
|
|
|
4650
4523
|
const failed = [];
|
|
4651
4524
|
for (const update of checkResult.updatesAvailable) {
|
|
4652
4525
|
try {
|
|
4653
|
-
logger.log(` ${
|
|
4526
|
+
logger.log(` ${pc12.cyan("\u2193")} Updating ${update.name}...`);
|
|
4654
4527
|
const downloaded = await registry.download(update.name);
|
|
4655
4528
|
const manifestEntry = installed.find((c) => c.name === update.name);
|
|
4656
4529
|
if (manifestEntry === void 0) continue;
|
|
@@ -4670,28 +4543,28 @@ async function executeUpdateCommand(cognitiveName, options = {}) {
|
|
|
4670
4543
|
version: update.latestVersion
|
|
4671
4544
|
});
|
|
4672
4545
|
updated.push(update.name);
|
|
4673
|
-
logger.log(` ${
|
|
4546
|
+
logger.log(` ${pc12.green("\u2713")} Updated to v${update.latestVersion}`);
|
|
4674
4547
|
} catch (error) {
|
|
4675
4548
|
failed.push({
|
|
4676
4549
|
name: update.name,
|
|
4677
4550
|
error: error instanceof Error ? error.message : "Unknown error"
|
|
4678
4551
|
});
|
|
4679
|
-
logger.log(` ${
|
|
4552
|
+
logger.log(` ${pc12.red("\u2717")} Failed: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
4680
4553
|
}
|
|
4681
4554
|
}
|
|
4682
4555
|
manifest.save();
|
|
4683
4556
|
logger.line();
|
|
4684
|
-
logger.log(` ${
|
|
4557
|
+
logger.log(` ${pc12.dim("Syncing providers...")}`);
|
|
4685
4558
|
const config = configManager.getConfig();
|
|
4686
4559
|
const syncEngine = new SyncEngine(synapSyncDir, projectRoot, config);
|
|
4687
4560
|
syncEngine.sync();
|
|
4688
4561
|
regenerateAgentsMd(projectRoot, synapSyncDir);
|
|
4689
4562
|
logger.line();
|
|
4690
4563
|
if (updated.length > 0) {
|
|
4691
|
-
logger.log(` ${
|
|
4564
|
+
logger.log(` ${pc12.green("\u2713")} Updated ${updated.length} cognitive(s)`);
|
|
4692
4565
|
}
|
|
4693
4566
|
if (failed.length > 0) {
|
|
4694
|
-
logger.log(` ${
|
|
4567
|
+
logger.log(` ${pc12.red("\u2717")} Failed to update ${failed.length} cognitive(s)`);
|
|
4695
4568
|
}
|
|
4696
4569
|
logger.line();
|
|
4697
4570
|
}
|
|
@@ -4701,19 +4574,19 @@ function displayCheckResults(result) {
|
|
|
4701
4574
|
logger.line();
|
|
4702
4575
|
for (const update of result.updatesAvailable) {
|
|
4703
4576
|
logger.log(
|
|
4704
|
-
` ${
|
|
4577
|
+
` ${pc12.yellow("\u2191")} ${pc12.white(update.name)} ${pc12.dim(update.currentVersion)} \u2192 ${pc12.green(update.latestVersion)}`
|
|
4705
4578
|
);
|
|
4706
4579
|
}
|
|
4707
4580
|
}
|
|
4708
4581
|
if (result.upToDate.length > 0 && result.updatesAvailable.length > 0) {
|
|
4709
4582
|
logger.line();
|
|
4710
|
-
logger.log(` ${
|
|
4583
|
+
logger.log(` ${pc12.dim(`${result.upToDate.length} cognitive(s) up to date`)}`);
|
|
4711
4584
|
}
|
|
4712
4585
|
if (result.errors.length > 0) {
|
|
4713
4586
|
logger.line();
|
|
4714
|
-
logger.log(` ${
|
|
4587
|
+
logger.log(` ${pc12.red("Errors:")}`);
|
|
4715
4588
|
for (const error of result.errors) {
|
|
4716
|
-
logger.log(` ${
|
|
4589
|
+
logger.log(` ${pc12.red("\u2717")} ${error.cognitive}: ${error.message}`);
|
|
4717
4590
|
}
|
|
4718
4591
|
}
|
|
4719
4592
|
}
|
|
@@ -4725,7 +4598,7 @@ function registerUpdateCommand(program) {
|
|
|
4725
4598
|
|
|
4726
4599
|
// src/commands/doctor.ts
|
|
4727
4600
|
init_esm_shims();
|
|
4728
|
-
import
|
|
4601
|
+
import pc13 from "picocolors";
|
|
4729
4602
|
|
|
4730
4603
|
// src/services/maintenance/doctor.ts
|
|
4731
4604
|
init_esm_shims();
|
|
@@ -5205,17 +5078,17 @@ async function executeDoctorCommand(options = {}) {
|
|
|
5205
5078
|
}
|
|
5206
5079
|
logger.line();
|
|
5207
5080
|
if (result.healthy) {
|
|
5208
|
-
logger.log(` ${
|
|
5081
|
+
logger.log(` ${pc13.green("\u2713")} Your project is healthy!`);
|
|
5209
5082
|
} else if (result.failed > 0) {
|
|
5210
|
-
logger.log(` ${
|
|
5083
|
+
logger.log(` ${pc13.red("!")} ${result.failed} issue(s) found`);
|
|
5211
5084
|
if (options.fix !== true) {
|
|
5212
5085
|
logger.hint("Run synapsync doctor --fix to auto-repair fixable issues.");
|
|
5213
5086
|
}
|
|
5214
5087
|
} else if (result.warnings > 0) {
|
|
5215
|
-
logger.log(` ${
|
|
5088
|
+
logger.log(` ${pc13.yellow("!")} ${result.warnings} warning(s)`);
|
|
5216
5089
|
}
|
|
5217
5090
|
logger.line();
|
|
5218
|
-
logger.log(` ${
|
|
5091
|
+
logger.log(` ${pc13.dim(`Checked ${result.checks.length} items in ${result.duration}ms`)}`);
|
|
5219
5092
|
logger.line();
|
|
5220
5093
|
}
|
|
5221
5094
|
function displayDiagnostics(result, verbose = false) {
|
|
@@ -5228,10 +5101,10 @@ function displayCheck(check, verbose = false) {
|
|
|
5228
5101
|
const statusColor = getStatusColor(check.status);
|
|
5229
5102
|
logger.log(` ${statusIcon} ${statusColor(check.name)}`);
|
|
5230
5103
|
if (verbose || check.status === "fail" || check.status === "warn") {
|
|
5231
|
-
logger.log(` ${
|
|
5104
|
+
logger.log(` ${pc13.dim(check.message)}`);
|
|
5232
5105
|
if (check.details !== void 0 && check.details.length > 0) {
|
|
5233
5106
|
for (const detail of check.details) {
|
|
5234
|
-
logger.log(` ${
|
|
5107
|
+
logger.log(` ${pc13.dim("\u2022")} ${pc13.dim(detail)}`);
|
|
5235
5108
|
}
|
|
5236
5109
|
}
|
|
5237
5110
|
}
|
|
@@ -5241,40 +5114,40 @@ function displayFixes(result) {
|
|
|
5241
5114
|
logger.line();
|
|
5242
5115
|
if (result.fixed.length > 0) {
|
|
5243
5116
|
for (const fix of result.fixed) {
|
|
5244
|
-
logger.log(` ${
|
|
5117
|
+
logger.log(` ${pc13.green("\u2713")} Fixed: ${fix}`);
|
|
5245
5118
|
}
|
|
5246
5119
|
}
|
|
5247
5120
|
if (result.failed.length > 0) {
|
|
5248
5121
|
for (const fail of result.failed) {
|
|
5249
|
-
logger.log(` ${
|
|
5122
|
+
logger.log(` ${pc13.red("\u2717")} Failed: ${fail.check} - ${fail.error}`);
|
|
5250
5123
|
}
|
|
5251
5124
|
}
|
|
5252
5125
|
if (result.fixed.length === 0 && result.failed.length === 0) {
|
|
5253
|
-
logger.log(` ${
|
|
5126
|
+
logger.log(` ${pc13.dim("No fixes needed")}`);
|
|
5254
5127
|
}
|
|
5255
5128
|
}
|
|
5256
5129
|
function getStatusIcon(status) {
|
|
5257
5130
|
switch (status) {
|
|
5258
5131
|
case "pass":
|
|
5259
|
-
return
|
|
5132
|
+
return pc13.green("\u2713");
|
|
5260
5133
|
case "warn":
|
|
5261
|
-
return
|
|
5134
|
+
return pc13.yellow("!");
|
|
5262
5135
|
case "fail":
|
|
5263
|
-
return
|
|
5136
|
+
return pc13.red("\u2717");
|
|
5264
5137
|
case "skip":
|
|
5265
|
-
return
|
|
5138
|
+
return pc13.dim("\u25CB");
|
|
5266
5139
|
}
|
|
5267
5140
|
}
|
|
5268
5141
|
function getStatusColor(status) {
|
|
5269
5142
|
switch (status) {
|
|
5270
5143
|
case "pass":
|
|
5271
|
-
return
|
|
5144
|
+
return pc13.green;
|
|
5272
5145
|
case "warn":
|
|
5273
|
-
return
|
|
5146
|
+
return pc13.yellow;
|
|
5274
5147
|
case "fail":
|
|
5275
|
-
return
|
|
5148
|
+
return pc13.red;
|
|
5276
5149
|
case "skip":
|
|
5277
|
-
return
|
|
5150
|
+
return pc13.dim;
|
|
5278
5151
|
}
|
|
5279
5152
|
}
|
|
5280
5153
|
function registerDoctorCommand(program) {
|
|
@@ -5285,7 +5158,7 @@ function registerDoctorCommand(program) {
|
|
|
5285
5158
|
|
|
5286
5159
|
// src/commands/clean.ts
|
|
5287
5160
|
init_esm_shims();
|
|
5288
|
-
import
|
|
5161
|
+
import pc14 from "picocolors";
|
|
5289
5162
|
|
|
5290
5163
|
// src/services/maintenance/cleaner.ts
|
|
5291
5164
|
init_esm_shims();
|
|
@@ -5587,47 +5460,47 @@ function executeCleanCommand(options = {}) {
|
|
|
5587
5460
|
displayResults2(result, options);
|
|
5588
5461
|
logger.line();
|
|
5589
5462
|
if (result.cleaned.length === 0) {
|
|
5590
|
-
logger.log(` ${
|
|
5463
|
+
logger.log(` ${pc14.green("\u2713")} Nothing to clean`);
|
|
5591
5464
|
} else if (options.dryRun === true) {
|
|
5592
|
-
logger.log(` ${
|
|
5465
|
+
logger.log(` ${pc14.dim(`Would clean ${result.cleaned.length} item(s), freeing ${result.sizeFreed}`)}`);
|
|
5593
5466
|
logger.hint("Run synapsync clean without --dry-run to apply changes.");
|
|
5594
5467
|
} else {
|
|
5595
|
-
logger.log(` ${
|
|
5468
|
+
logger.log(` ${pc14.green("\u2713")} Cleaned ${result.cleaned.length} item(s), freed ${result.sizeFreed}`);
|
|
5596
5469
|
}
|
|
5597
5470
|
if (result.errors.length > 0) {
|
|
5598
|
-
logger.log(` ${
|
|
5471
|
+
logger.log(` ${pc14.red("!")} ${result.errors.length} error(s) occurred`);
|
|
5599
5472
|
}
|
|
5600
5473
|
logger.line();
|
|
5601
5474
|
}
|
|
5602
5475
|
function displayResults2(result, _options) {
|
|
5603
5476
|
const byType = groupByType2(result.cleaned);
|
|
5604
5477
|
if (byType.cache.length > 0) {
|
|
5605
|
-
logger.log(` ${
|
|
5478
|
+
logger.log(` ${pc14.cyan("Cache:")}`);
|
|
5606
5479
|
for (const item of byType.cache) {
|
|
5607
5480
|
const size = formatBytes(item.size);
|
|
5608
|
-
logger.log(` ${
|
|
5481
|
+
logger.log(` ${pc14.dim("-")} ${getRelativePath(item.path)} ${pc14.dim(`(${size})`)}`);
|
|
5609
5482
|
}
|
|
5610
5483
|
logger.line();
|
|
5611
5484
|
}
|
|
5612
5485
|
if (byType.orphan.length > 0) {
|
|
5613
|
-
logger.log(` ${
|
|
5486
|
+
logger.log(` ${pc14.cyan("Orphaned symlinks:")}`);
|
|
5614
5487
|
for (const item of byType.orphan) {
|
|
5615
|
-
logger.log(` ${
|
|
5488
|
+
logger.log(` ${pc14.dim("-")} ${item.path}`);
|
|
5616
5489
|
}
|
|
5617
5490
|
logger.line();
|
|
5618
5491
|
}
|
|
5619
5492
|
if (byType.temp.length > 0) {
|
|
5620
|
-
logger.log(` ${
|
|
5493
|
+
logger.log(` ${pc14.cyan("Temp files:")}`);
|
|
5621
5494
|
for (const item of byType.temp) {
|
|
5622
5495
|
const size = formatBytes(item.size);
|
|
5623
|
-
logger.log(` ${
|
|
5496
|
+
logger.log(` ${pc14.dim("-")} ${getRelativePath(item.path)} ${pc14.dim(`(${size})`)}`);
|
|
5624
5497
|
}
|
|
5625
5498
|
logger.line();
|
|
5626
5499
|
}
|
|
5627
5500
|
if (result.errors.length > 0) {
|
|
5628
|
-
logger.log(` ${
|
|
5501
|
+
logger.log(` ${pc14.red("Errors:")}`);
|
|
5629
5502
|
for (const error of result.errors) {
|
|
5630
|
-
logger.log(` ${
|
|
5503
|
+
logger.log(` ${pc14.red("\u2717")} ${error.path}: ${error.message}`);
|
|
5631
5504
|
}
|
|
5632
5505
|
logger.line();
|
|
5633
5506
|
}
|
|
@@ -5667,7 +5540,7 @@ function registerCleanCommand(program) {
|
|
|
5667
5540
|
init_esm_shims();
|
|
5668
5541
|
import * as fs15 from "fs";
|
|
5669
5542
|
import * as path17 from "path";
|
|
5670
|
-
import
|
|
5543
|
+
import pc15 from "picocolors";
|
|
5671
5544
|
function executePurgeCommand(options) {
|
|
5672
5545
|
logger.line();
|
|
5673
5546
|
const configManager = ConfigManager.findConfig();
|
|
@@ -5678,15 +5551,15 @@ function executePurgeCommand(options) {
|
|
|
5678
5551
|
const projectRoot = configManager.getProjectRoot();
|
|
5679
5552
|
const synapSyncDir = configManager.getSynapSyncDir();
|
|
5680
5553
|
if (options.force !== true) {
|
|
5681
|
-
logger.log(` ${
|
|
5554
|
+
logger.log(` ${pc15.yellow("!")} This will completely remove SynapSync from your project:`);
|
|
5682
5555
|
logger.line();
|
|
5683
5556
|
const itemsToRemove = collectItemsToRemove(projectRoot, synapSyncDir);
|
|
5684
5557
|
for (const item of itemsToRemove) {
|
|
5685
|
-
logger.log(` ${
|
|
5558
|
+
logger.log(` ${pc15.red("\u2717")} ${item}`);
|
|
5686
5559
|
}
|
|
5687
5560
|
logger.line();
|
|
5688
5561
|
logger.hint("Use --force to confirm and remove everything.");
|
|
5689
|
-
logger.log(` ${
|
|
5562
|
+
logger.log(` ${pc15.dim("To confirm, run:")} synapsync purge --force`);
|
|
5690
5563
|
return;
|
|
5691
5564
|
}
|
|
5692
5565
|
let removedCount = 0;
|
|
@@ -5694,30 +5567,30 @@ function executePurgeCommand(options) {
|
|
|
5694
5567
|
removedCount += removeProviderSymlinks(projectRoot, synapSyncDir);
|
|
5695
5568
|
if (fs15.existsSync(synapSyncDir)) {
|
|
5696
5569
|
fs15.rmSync(synapSyncDir, { recursive: true, force: true });
|
|
5697
|
-
logger.log(` ${
|
|
5570
|
+
logger.log(` ${pc15.red("\u2717")} Removed ${path17.relative(projectRoot, synapSyncDir)}/`);
|
|
5698
5571
|
removedCount++;
|
|
5699
5572
|
}
|
|
5700
5573
|
const configPath = path17.join(projectRoot, "synapsync.config.yaml");
|
|
5701
5574
|
if (fs15.existsSync(configPath)) {
|
|
5702
5575
|
fs15.unlinkSync(configPath);
|
|
5703
|
-
logger.log(` ${
|
|
5576
|
+
logger.log(` ${pc15.red("\u2717")} Removed synapsync.config.yaml`);
|
|
5704
5577
|
removedCount++;
|
|
5705
5578
|
}
|
|
5706
5579
|
const agentsMdPath = path17.join(projectRoot, AGENTS_MD_FILE_NAME);
|
|
5707
5580
|
if (fs15.existsSync(agentsMdPath)) {
|
|
5708
5581
|
fs15.unlinkSync(agentsMdPath);
|
|
5709
|
-
logger.log(` ${
|
|
5582
|
+
logger.log(` ${pc15.red("\u2717")} Removed ${AGENTS_MD_FILE_NAME}`);
|
|
5710
5583
|
removedCount++;
|
|
5711
5584
|
}
|
|
5712
5585
|
if (cleanGitignore(projectRoot)) {
|
|
5713
|
-
logger.log(` ${
|
|
5586
|
+
logger.log(` ${pc15.red("\u2717")} Cleaned SynapSync entries from .gitignore`);
|
|
5714
5587
|
removedCount++;
|
|
5715
5588
|
}
|
|
5716
5589
|
logger.line();
|
|
5717
5590
|
if (removedCount > 0) {
|
|
5718
|
-
logger.log(` ${
|
|
5591
|
+
logger.log(` ${pc15.green("\u2713")} SynapSync has been completely removed from this project.`);
|
|
5719
5592
|
} else {
|
|
5720
|
-
logger.log(` ${
|
|
5593
|
+
logger.log(` ${pc15.green("\u2713")} Nothing to remove.`);
|
|
5721
5594
|
}
|
|
5722
5595
|
logger.line();
|
|
5723
5596
|
} catch (error) {
|
|
@@ -5784,7 +5657,7 @@ function removeProviderSymlinks(projectRoot, synapSyncDir) {
|
|
|
5784
5657
|
const symlinks = findSynapSyncSymlinks(projectRoot, synapSyncDir);
|
|
5785
5658
|
for (const link of symlinks) {
|
|
5786
5659
|
fs15.unlinkSync(link);
|
|
5787
|
-
logger.log(` ${
|
|
5660
|
+
logger.log(` ${pc15.red("\u2717")} Removed symlink ${path17.relative(projectRoot, link)}`);
|
|
5788
5661
|
}
|
|
5789
5662
|
return symlinks.length;
|
|
5790
5663
|
}
|
|
@@ -5823,24 +5696,24 @@ function showCommandHelp(commandName) {
|
|
|
5823
5696
|
return;
|
|
5824
5697
|
}
|
|
5825
5698
|
logger.line();
|
|
5826
|
-
logger.log(
|
|
5699
|
+
logger.log(pc16.bold(pc16.cyan(` /${commandName}`)) + pc16.dim(` - ${cmd.description}`));
|
|
5827
5700
|
logger.line();
|
|
5828
5701
|
if (cmd.usage) {
|
|
5829
|
-
logger.log(
|
|
5830
|
-
logger.log(` ${
|
|
5702
|
+
logger.log(pc16.bold(" Usage:"));
|
|
5703
|
+
logger.log(` ${pc16.cyan(cmd.usage)}`);
|
|
5831
5704
|
logger.line();
|
|
5832
5705
|
}
|
|
5833
5706
|
if (cmd.options && cmd.options.length > 0) {
|
|
5834
|
-
logger.log(
|
|
5707
|
+
logger.log(pc16.bold(" Options:"));
|
|
5835
5708
|
for (const opt of cmd.options) {
|
|
5836
|
-
logger.log(` ${
|
|
5709
|
+
logger.log(` ${pc16.yellow(opt.flag.padEnd(16))} ${pc16.dim(opt.description)}`);
|
|
5837
5710
|
}
|
|
5838
5711
|
logger.line();
|
|
5839
5712
|
}
|
|
5840
5713
|
if (cmd.examples && cmd.examples.length > 0) {
|
|
5841
|
-
logger.log(
|
|
5714
|
+
logger.log(pc16.bold(" Examples:"));
|
|
5842
5715
|
for (const example of cmd.examples) {
|
|
5843
|
-
logger.log(` ${
|
|
5716
|
+
logger.log(` ${pc16.dim("$")} ${pc16.cyan(example)}`);
|
|
5844
5717
|
}
|
|
5845
5718
|
logger.line();
|
|
5846
5719
|
}
|
|
@@ -5857,15 +5730,15 @@ registerInteractiveCommand(
|
|
|
5857
5730
|
logger.line();
|
|
5858
5731
|
logger.bold(" Available Commands:");
|
|
5859
5732
|
logger.line();
|
|
5860
|
-
logger.log(` ${
|
|
5861
|
-
logger.log(` ${
|
|
5862
|
-
logger.log(` ${
|
|
5733
|
+
logger.log(` ${pc16.cyan("/help [command]")} ${pc16.dim("Show help (or help for a command)")}`);
|
|
5734
|
+
logger.log(` ${pc16.cyan("/clear")} ${pc16.dim("Clear the screen")}`);
|
|
5735
|
+
logger.log(` ${pc16.cyan("/exit")} ${pc16.dim("Exit interactive mode")}`);
|
|
5863
5736
|
logger.line();
|
|
5864
5737
|
const categories = {
|
|
5865
5738
|
"Information": ["info", "version"],
|
|
5866
5739
|
"Project": ["init", "config", "status"],
|
|
5867
5740
|
"Providers": ["providers"],
|
|
5868
|
-
"Cognitives": ["
|
|
5741
|
+
"Cognitives": ["add", "list", "uninstall"],
|
|
5869
5742
|
"Sync": ["sync"],
|
|
5870
5743
|
"Maintenance": ["update", "doctor", "clean", "purge"]
|
|
5871
5744
|
};
|
|
@@ -5877,8 +5750,8 @@ registerInteractiveCommand(
|
|
|
5877
5750
|
const cmd = COMMANDS[name];
|
|
5878
5751
|
const hasOptions = cmd?.options !== void 0 && cmd.options.length > 0;
|
|
5879
5752
|
const paddedName = `/${name}`.padEnd(18);
|
|
5880
|
-
const optionsHint = hasOptions ?
|
|
5881
|
-
logger.log(` ${
|
|
5753
|
+
const optionsHint = hasOptions ? pc16.yellow(" [options]") : "";
|
|
5754
|
+
logger.log(` ${pc16.cyan(paddedName)} ${pc16.dim(cmd?.description ?? "")}${optionsHint}`);
|
|
5882
5755
|
}
|
|
5883
5756
|
logger.line();
|
|
5884
5757
|
}
|
|
@@ -5984,44 +5857,6 @@ registerInteractiveCommand(
|
|
|
5984
5857
|
]
|
|
5985
5858
|
}
|
|
5986
5859
|
);
|
|
5987
|
-
registerInteractiveCommand(
|
|
5988
|
-
"search",
|
|
5989
|
-
"Search for cognitives in the registry",
|
|
5990
|
-
async (args) => {
|
|
5991
|
-
const parts = args.split(/\s+/);
|
|
5992
|
-
let query;
|
|
5993
|
-
const options = {};
|
|
5994
|
-
for (let i = 0; i < parts.length; i++) {
|
|
5995
|
-
const part = parts[i];
|
|
5996
|
-
if (part === void 0 || part === "") continue;
|
|
5997
|
-
if (part === "--type" || part === "-t") {
|
|
5998
|
-
options["type"] = parts[++i] ?? "";
|
|
5999
|
-
} else if (part === "--category" || part === "-c") {
|
|
6000
|
-
options["category"] = parts[++i] ?? "";
|
|
6001
|
-
} else if (part === "--tag") {
|
|
6002
|
-
options["tag"] = parts[++i] ?? "";
|
|
6003
|
-
} else if (part === "--limit" || part === "-l") {
|
|
6004
|
-
options["limit"] = parts[++i] ?? "20";
|
|
6005
|
-
} else if (part === "--json") {
|
|
6006
|
-
options["json"] = true;
|
|
6007
|
-
} else if (!part.startsWith("-")) {
|
|
6008
|
-
query = part;
|
|
6009
|
-
}
|
|
6010
|
-
}
|
|
6011
|
-
await executeSearchCommand(query, options);
|
|
6012
|
-
},
|
|
6013
|
-
{
|
|
6014
|
-
usage: "/search [query] [options]",
|
|
6015
|
-
options: [
|
|
6016
|
-
{ flag: "-t, --type <type>", description: "Filter by type (skill, agent, prompt, etc.)" },
|
|
6017
|
-
{ flag: "-c, --category <cat>", description: "Filter by category" },
|
|
6018
|
-
{ flag: "--tag <tag>", description: "Filter by tag" },
|
|
6019
|
-
{ flag: "-l, --limit <n>", description: "Limit results (default: 20)" },
|
|
6020
|
-
{ flag: "--json", description: "Output as JSON" }
|
|
6021
|
-
],
|
|
6022
|
-
examples: ["/search", "/search react", "/search --type skill", "/search api --category backend"]
|
|
6023
|
-
}
|
|
6024
|
-
);
|
|
6025
5860
|
registerInteractiveCommand(
|
|
6026
5861
|
"add",
|
|
6027
5862
|
"Add a cognitive from registry, local path, or GitHub",
|
|
@@ -6077,6 +5912,8 @@ registerInteractiveCommand(
|
|
|
6077
5912
|
options["type"] = parts[++i] ?? "";
|
|
6078
5913
|
} else if (part === "--category" || part === "-c") {
|
|
6079
5914
|
options["category"] = parts[++i] ?? "";
|
|
5915
|
+
} else if (part === "--tag") {
|
|
5916
|
+
options["tag"] = parts[++i] ?? "";
|
|
6080
5917
|
} else if (part === "--remote" || part === "-r") {
|
|
6081
5918
|
options["remote"] = true;
|
|
6082
5919
|
} else if (part === "--json") {
|
|
@@ -6090,10 +5927,11 @@ registerInteractiveCommand(
|
|
|
6090
5927
|
options: [
|
|
6091
5928
|
{ flag: "-t, --type <type>", description: "Filter by type (skill, agent, prompt, etc.)" },
|
|
6092
5929
|
{ flag: "-c, --category <cat>", description: "Filter by category" },
|
|
5930
|
+
{ flag: "--tag <tag>", description: "Filter by tag (remote only)" },
|
|
6093
5931
|
{ flag: "-r, --remote", description: "Browse all cognitives in registry" },
|
|
6094
5932
|
{ flag: "--json", description: "Output as JSON" }
|
|
6095
5933
|
],
|
|
6096
|
-
examples: ["/list", "/list --remote", "/list --
|
|
5934
|
+
examples: ["/list", "/list --remote", "/list --remote --category planning", "/list --type skill"]
|
|
6097
5935
|
}
|
|
6098
5936
|
);
|
|
6099
5937
|
registerInteractiveCommand(
|
|
@@ -6302,7 +6140,7 @@ registerInteractiveCommand(
|
|
|
6302
6140
|
registerInteractiveCommand("version", "Show version information", async (_args) => {
|
|
6303
6141
|
const { version: version2 } = await Promise.resolve().then(() => (init_version(), version_exports));
|
|
6304
6142
|
logger.line();
|
|
6305
|
-
logger.log(`${
|
|
6143
|
+
logger.log(`${pc16.bold("SynapSync CLI")} ${pc16.cyan(`v${version2}`)}`);
|
|
6306
6144
|
logger.line();
|
|
6307
6145
|
logger.label("Node.js", process.version);
|
|
6308
6146
|
logger.label("Platform", `${process.platform} ${process.arch}`);
|
|
@@ -6315,7 +6153,7 @@ async function executeCommand(input) {
|
|
|
6315
6153
|
}
|
|
6316
6154
|
if (!trimmed.startsWith("/")) {
|
|
6317
6155
|
showError(`Unknown input. Commands must start with /`);
|
|
6318
|
-
logger.log(`${
|
|
6156
|
+
logger.log(`${pc16.dim("Type")} ${pc16.cyan("/help")} ${pc16.dim("for available commands.")}`);
|
|
6319
6157
|
return;
|
|
6320
6158
|
}
|
|
6321
6159
|
const parts = trimmed.slice(1).split(/\s+/);
|
|
@@ -6327,7 +6165,7 @@ async function executeCommand(input) {
|
|
|
6327
6165
|
const command = COMMANDS[commandName];
|
|
6328
6166
|
if (!command) {
|
|
6329
6167
|
showError(`Unknown command: /${commandName}`);
|
|
6330
|
-
logger.log(`${
|
|
6168
|
+
logger.log(`${pc16.dim("Type")} ${pc16.cyan("/help")} ${pc16.dim("for available commands.")}`);
|
|
6331
6169
|
return;
|
|
6332
6170
|
}
|
|
6333
6171
|
try {
|
|
@@ -6343,13 +6181,13 @@ async function executeCommand(input) {
|
|
|
6343
6181
|
function startInteractiveMode() {
|
|
6344
6182
|
showBanner();
|
|
6345
6183
|
logger.log(
|
|
6346
|
-
`${
|
|
6184
|
+
`${pc16.dim("Type")} ${pc16.cyan("/help")} ${pc16.dim("for commands,")} ${pc16.cyan("/exit")} ${pc16.dim("to quit.")}`
|
|
6347
6185
|
);
|
|
6348
6186
|
logger.line();
|
|
6349
6187
|
const rl = readline.createInterface({
|
|
6350
6188
|
input: process.stdin,
|
|
6351
6189
|
output: process.stdout,
|
|
6352
|
-
prompt: `${
|
|
6190
|
+
prompt: `${pc16.green(CLI_NAME)} ${pc16.dim(">")} `,
|
|
6353
6191
|
terminal: true
|
|
6354
6192
|
});
|
|
6355
6193
|
rl.on("line", (line) => {
|
|
@@ -6375,7 +6213,7 @@ init_version();
|
|
|
6375
6213
|
|
|
6376
6214
|
// src/commands/help.ts
|
|
6377
6215
|
init_esm_shims();
|
|
6378
|
-
import
|
|
6216
|
+
import pc17 from "picocolors";
|
|
6379
6217
|
function registerHelpCommand(program) {
|
|
6380
6218
|
program.command("help [command]").description("Display help for a command").action((commandName) => {
|
|
6381
6219
|
if (commandName) {
|
|
@@ -6385,7 +6223,7 @@ function registerHelpCommand(program) {
|
|
|
6385
6223
|
} else {
|
|
6386
6224
|
logger.error(`Unknown command: ${commandName}`);
|
|
6387
6225
|
logger.line();
|
|
6388
|
-
logger.log(`Run ${
|
|
6226
|
+
logger.log(`Run ${pc17.cyan("synapsync --help")} to see available commands.`);
|
|
6389
6227
|
}
|
|
6390
6228
|
} else {
|
|
6391
6229
|
program.outputHelp();
|
|
@@ -6396,7 +6234,7 @@ function registerHelpCommand(program) {
|
|
|
6396
6234
|
// src/commands/version.ts
|
|
6397
6235
|
init_esm_shims();
|
|
6398
6236
|
init_version();
|
|
6399
|
-
import
|
|
6237
|
+
import pc18 from "picocolors";
|
|
6400
6238
|
var PACKAGE_NAME = "synapsync";
|
|
6401
6239
|
function compareVersions(a, b) {
|
|
6402
6240
|
const partsA = a.split(".").map(Number);
|
|
@@ -6437,12 +6275,12 @@ async function checkForUpdates() {
|
|
|
6437
6275
|
const comparison = compareVersions(version, latestVersion);
|
|
6438
6276
|
if (comparison < 0) {
|
|
6439
6277
|
logger.line();
|
|
6440
|
-
logger.warning(`Update available: ${
|
|
6278
|
+
logger.warning(`Update available: ${pc18.cyan(`v${version}`)} \u2192 ${pc18.green(`v${latestVersion}`)}`);
|
|
6441
6279
|
logger.line();
|
|
6442
|
-
logger.log(` Run ${
|
|
6280
|
+
logger.log(` Run ${pc18.cyan("npm install -g synapsync")} to update`);
|
|
6443
6281
|
} else if (comparison > 0) {
|
|
6444
|
-
logger.info(`You are running a development version (${
|
|
6445
|
-
logger.log(` Latest published: ${
|
|
6282
|
+
logger.info(`You are running a development version (${pc18.cyan(`v${version}`)})`);
|
|
6283
|
+
logger.log(` Latest published: ${pc18.dim(`v${latestVersion}`)}`);
|
|
6446
6284
|
} else {
|
|
6447
6285
|
logger.success("You are using the latest version");
|
|
6448
6286
|
}
|
|
@@ -6450,7 +6288,7 @@ async function checkForUpdates() {
|
|
|
6450
6288
|
function registerVersionCommand(program) {
|
|
6451
6289
|
program.command("version").description("Show detailed version information").option("--check", "Check for available updates").action(async (options) => {
|
|
6452
6290
|
logger.line();
|
|
6453
|
-
logger.log(`${
|
|
6291
|
+
logger.log(`${pc18.bold("SynapSync CLI")} ${pc18.cyan(`v${version}`)}`);
|
|
6454
6292
|
logger.line();
|
|
6455
6293
|
logger.label("Node.js", process.version);
|
|
6456
6294
|
logger.label("Platform", `${process.platform} ${process.arch}`);
|
|
@@ -6477,7 +6315,6 @@ function createCLI() {
|
|
|
6477
6315
|
registerConfigCommand(program);
|
|
6478
6316
|
registerStatusCommand(program);
|
|
6479
6317
|
registerProvidersCommand(program);
|
|
6480
|
-
registerSearchCommand(program);
|
|
6481
6318
|
registerAddCommand(program);
|
|
6482
6319
|
registerListCommand(program);
|
|
6483
6320
|
registerUninstallCommand(program);
|