@synapsync/cli 0.1.6 → 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 +203 -362
- 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
|
|
|
@@ -82,7 +84,9 @@ var CATEGORIES = [
|
|
|
82
84
|
"testing",
|
|
83
85
|
"analytics",
|
|
84
86
|
"automation",
|
|
85
|
-
"general"
|
|
87
|
+
"general",
|
|
88
|
+
"integrations",
|
|
89
|
+
"planning"
|
|
86
90
|
];
|
|
87
91
|
var SUPPORTED_PROVIDERS = [
|
|
88
92
|
"claude",
|
|
@@ -145,7 +149,7 @@ var REGISTRY_MANIFEST_FILE = "manifest.json";
|
|
|
145
149
|
// src/ui/repl.ts
|
|
146
150
|
init_esm_shims();
|
|
147
151
|
import * as readline from "readline";
|
|
148
|
-
import
|
|
152
|
+
import pc16 from "picocolors";
|
|
149
153
|
|
|
150
154
|
// src/ui/banner.ts
|
|
151
155
|
init_esm_shims();
|
|
@@ -337,7 +341,7 @@ function showBanner() {
|
|
|
337
341
|
logger.line();
|
|
338
342
|
logger.command("synapsync init", "Initialize a new project");
|
|
339
343
|
logger.command("synapsync connect", "Connect to AI providers");
|
|
340
|
-
logger.command("synapsync
|
|
344
|
+
logger.command("synapsync list --remote", "Browse registry for cognitives");
|
|
341
345
|
logger.command("synapsync add <name>", "Add skill, agent, or prompt");
|
|
342
346
|
logger.command("synapsync sync", "Sync assets to providers");
|
|
343
347
|
logger.line();
|
|
@@ -574,7 +578,9 @@ function showCategoriesInfo() {
|
|
|
574
578
|
{ name: "testing", description: "Unit tests, E2E, test generation", color: pc3.green },
|
|
575
579
|
{ name: "analytics", description: "Metrics, tracking, data analysis", color: pc3.cyan },
|
|
576
580
|
{ name: "automation", description: "Scripts, workflows, task automation", color: pc3.green },
|
|
577
|
-
{ name: "general", description: "General purpose, code review, docs", color: pc3.white }
|
|
581
|
+
{ name: "general", description: "General purpose, code review, docs", color: pc3.white },
|
|
582
|
+
{ name: "integrations", description: "External services (Supabase, Stripe, etc.)", color: pc3.blue },
|
|
583
|
+
{ name: "planning", description: "Project planning, SDLC, requirements, architecture", color: pc3.magenta }
|
|
578
584
|
];
|
|
579
585
|
logger.log(` ${pc3.dim("Category")} ${pc3.dim("Description")}`);
|
|
580
586
|
logger.log(pc3.dim(" " + "\u2500".repeat(55)));
|
|
@@ -588,7 +594,7 @@ function showCategoriesInfo() {
|
|
|
588
594
|
logger.line();
|
|
589
595
|
logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync add")} react-patterns ${pc3.dim("--category frontend")}`);
|
|
590
596
|
logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync list")} --category devops`);
|
|
591
|
-
logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync
|
|
597
|
+
logger.log(` ${pc3.dim("$")} ${pc3.cyan("synapsync list")} --remote --category security`);
|
|
592
598
|
logger.line();
|
|
593
599
|
}
|
|
594
600
|
function showSyncInfo() {
|
|
@@ -1644,7 +1650,7 @@ var AgentsMdGenerator = class {
|
|
|
1644
1650
|
START_MARKER,
|
|
1645
1651
|
"# SynapSync Project Cognitives",
|
|
1646
1652
|
"",
|
|
1647
|
-
"> 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.",
|
|
1648
1654
|
""
|
|
1649
1655
|
];
|
|
1650
1656
|
if (entries.length === 0) {
|
|
@@ -1675,7 +1681,7 @@ var AgentsMdGenerator = class {
|
|
|
1675
1681
|
START_MARKER,
|
|
1676
1682
|
"# SynapSync Project Cognitives",
|
|
1677
1683
|
"",
|
|
1678
|
-
"> 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.",
|
|
1679
1685
|
"",
|
|
1680
1686
|
"*No cognitives installed yet. Run `synapsync add <name>` to get started.*",
|
|
1681
1687
|
END_MARKER
|
|
@@ -2505,8 +2511,10 @@ function registerProvidersCommand(program) {
|
|
|
2505
2511
|
});
|
|
2506
2512
|
}
|
|
2507
2513
|
|
|
2508
|
-
// src/commands/
|
|
2514
|
+
// src/commands/add.ts
|
|
2509
2515
|
init_esm_shims();
|
|
2516
|
+
import * as fs9 from "fs";
|
|
2517
|
+
import * as path11 from "path";
|
|
2510
2518
|
import pc8 from "picocolors";
|
|
2511
2519
|
|
|
2512
2520
|
// src/services/registry/client.ts
|
|
@@ -2726,146 +2734,6 @@ var CognitiveNotFoundError = class extends Error {
|
|
|
2726
2734
|
}
|
|
2727
2735
|
};
|
|
2728
2736
|
|
|
2729
|
-
// src/commands/search.ts
|
|
2730
|
-
async function executeSearchCommand(query, options) {
|
|
2731
|
-
logger.line();
|
|
2732
|
-
const validatedOptions = validateOptions(options);
|
|
2733
|
-
if (validatedOptions === null) {
|
|
2734
|
-
return;
|
|
2735
|
-
}
|
|
2736
|
-
const searchingText = query !== void 0 && query.trim() !== "" ? `Searching for "${query}"...` : "Fetching cognitives from registry...";
|
|
2737
|
-
logger.log(` ${pc8.dim(searchingText)}`);
|
|
2738
|
-
try {
|
|
2739
|
-
const client = new RegistryClient();
|
|
2740
|
-
const isReachable = await client.ping();
|
|
2741
|
-
if (!isReachable) {
|
|
2742
|
-
logger.line();
|
|
2743
|
-
logger.error("Unable to reach the registry. Check your internet connection.");
|
|
2744
|
-
return;
|
|
2745
|
-
}
|
|
2746
|
-
const searchOpts = {};
|
|
2747
|
-
if (validatedOptions.type !== void 0) searchOpts.type = validatedOptions.type;
|
|
2748
|
-
if (validatedOptions.category !== void 0) searchOpts.category = validatedOptions.category;
|
|
2749
|
-
if (validatedOptions.tag !== void 0) searchOpts.tag = validatedOptions.tag;
|
|
2750
|
-
if (validatedOptions.limit !== void 0) searchOpts.limit = validatedOptions.limit;
|
|
2751
|
-
const result = await client.search(query, searchOpts);
|
|
2752
|
-
process.stdout.write("\x1B[1A\x1B[2K");
|
|
2753
|
-
if (options.json === true) {
|
|
2754
|
-
console.log(JSON.stringify(result, null, 2));
|
|
2755
|
-
return;
|
|
2756
|
-
}
|
|
2757
|
-
displaySearchResults(result.cognitives, query, result.total);
|
|
2758
|
-
} catch (error) {
|
|
2759
|
-
logger.line();
|
|
2760
|
-
if (error instanceof RegistryError) {
|
|
2761
|
-
logger.error(`Registry error: ${error.message}`);
|
|
2762
|
-
} else if (error instanceof Error) {
|
|
2763
|
-
logger.error(`Search failed: ${error.message}`);
|
|
2764
|
-
} else {
|
|
2765
|
-
logger.error("Search failed with unknown error");
|
|
2766
|
-
}
|
|
2767
|
-
}
|
|
2768
|
-
}
|
|
2769
|
-
function validateOptions(options) {
|
|
2770
|
-
const validated = {};
|
|
2771
|
-
if (options.type !== void 0) {
|
|
2772
|
-
if (!COGNITIVE_TYPES.includes(options.type)) {
|
|
2773
|
-
logger.error(`Invalid type: ${options.type}`);
|
|
2774
|
-
logger.hint(`Valid types: ${COGNITIVE_TYPES.join(", ")}`);
|
|
2775
|
-
return null;
|
|
2776
|
-
}
|
|
2777
|
-
validated.type = options.type;
|
|
2778
|
-
}
|
|
2779
|
-
if (options.category !== void 0) {
|
|
2780
|
-
if (!CATEGORIES.includes(options.category)) {
|
|
2781
|
-
logger.error(`Invalid category: ${options.category}`);
|
|
2782
|
-
logger.hint(`Valid categories: ${CATEGORIES.join(", ")}`);
|
|
2783
|
-
return null;
|
|
2784
|
-
}
|
|
2785
|
-
validated.category = options.category;
|
|
2786
|
-
}
|
|
2787
|
-
if (options.tag !== void 0) {
|
|
2788
|
-
validated.tag = options.tag;
|
|
2789
|
-
}
|
|
2790
|
-
if (options.limit !== void 0) {
|
|
2791
|
-
const limit = parseInt(options.limit, 10);
|
|
2792
|
-
if (isNaN(limit) || limit < 1) {
|
|
2793
|
-
logger.error("Limit must be a positive number");
|
|
2794
|
-
return null;
|
|
2795
|
-
}
|
|
2796
|
-
validated.limit = limit;
|
|
2797
|
-
}
|
|
2798
|
-
return validated;
|
|
2799
|
-
}
|
|
2800
|
-
function displaySearchResults(cognitives, query, total) {
|
|
2801
|
-
if (query !== void 0 && query.trim() !== "") {
|
|
2802
|
-
logger.bold(` Search Results for "${query}"`);
|
|
2803
|
-
} else {
|
|
2804
|
-
logger.bold(" Registry Cognitives");
|
|
2805
|
-
}
|
|
2806
|
-
logger.line();
|
|
2807
|
-
if (cognitives.length === 0) {
|
|
2808
|
-
logger.log(` ${pc8.dim("No cognitives found")}`);
|
|
2809
|
-
logger.line();
|
|
2810
|
-
logger.hint("Try a different search query or remove filters.");
|
|
2811
|
-
return;
|
|
2812
|
-
}
|
|
2813
|
-
if (cognitives.length < total) {
|
|
2814
|
-
logger.log(` ${pc8.dim(`Showing ${cognitives.length} of ${total} results`)}`);
|
|
2815
|
-
} else {
|
|
2816
|
-
logger.log(` ${pc8.dim(`Found ${total} cognitive${total === 1 ? "" : "s"}`)}`);
|
|
2817
|
-
}
|
|
2818
|
-
logger.line();
|
|
2819
|
-
for (const cognitive of cognitives) {
|
|
2820
|
-
displayCognitive(cognitive);
|
|
2821
|
-
}
|
|
2822
|
-
logger.line();
|
|
2823
|
-
logger.hint("Run synapsync add <name> to add a cognitive.");
|
|
2824
|
-
}
|
|
2825
|
-
function displayCognitive(cognitive) {
|
|
2826
|
-
const typeIcon = getCognitiveIcon2(cognitive.type);
|
|
2827
|
-
const typeLabel = pc8.dim(`[${cognitive.type}]`);
|
|
2828
|
-
logger.log(` ${typeIcon} ${pc8.bold(pc8.white(cognitive.name))} ${typeLabel}`);
|
|
2829
|
-
logger.log(` ${pc8.dim(truncate(cognitive.description, 60))}`);
|
|
2830
|
-
const meta = [];
|
|
2831
|
-
meta.push(pc8.dim(`v${cognitive.version}`));
|
|
2832
|
-
meta.push(pc8.dim(cognitive.category));
|
|
2833
|
-
if (cognitive.downloads > 0) {
|
|
2834
|
-
meta.push(pc8.dim(`${cognitive.downloads} downloads`));
|
|
2835
|
-
}
|
|
2836
|
-
logger.log(` ${meta.join(" \xB7 ")}`);
|
|
2837
|
-
if (cognitive.tags.length > 0) {
|
|
2838
|
-
const tags = cognitive.tags.slice(0, 5).map((t) => pc8.cyan(t)).join(" ");
|
|
2839
|
-
logger.log(` ${tags}`);
|
|
2840
|
-
}
|
|
2841
|
-
logger.line();
|
|
2842
|
-
}
|
|
2843
|
-
function getCognitiveIcon2(type) {
|
|
2844
|
-
const icons = {
|
|
2845
|
-
skill: pc8.blue("\u25C6"),
|
|
2846
|
-
agent: pc8.magenta("\u25C6"),
|
|
2847
|
-
prompt: pc8.yellow("\u25C6"),
|
|
2848
|
-
workflow: pc8.cyan("\u25C6"),
|
|
2849
|
-
tool: pc8.green("\u25C6")
|
|
2850
|
-
};
|
|
2851
|
-
return icons[type];
|
|
2852
|
-
}
|
|
2853
|
-
function truncate(text2, maxLength) {
|
|
2854
|
-
if (text2.length <= maxLength) return text2;
|
|
2855
|
-
return text2.slice(0, maxLength - 3) + "...";
|
|
2856
|
-
}
|
|
2857
|
-
function registerSearchCommand(program) {
|
|
2858
|
-
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) => {
|
|
2859
|
-
await executeSearchCommand(query, options);
|
|
2860
|
-
});
|
|
2861
|
-
}
|
|
2862
|
-
|
|
2863
|
-
// src/commands/add.ts
|
|
2864
|
-
init_esm_shims();
|
|
2865
|
-
import * as fs9 from "fs";
|
|
2866
|
-
import * as path11 from "path";
|
|
2867
|
-
import pc9 from "picocolors";
|
|
2868
|
-
|
|
2869
2737
|
// src/services/sync/engine.ts
|
|
2870
2738
|
init_esm_shims();
|
|
2871
2739
|
import * as path10 from "path";
|
|
@@ -3559,7 +3427,7 @@ async function executeAddCommand(source, options) {
|
|
|
3559
3427
|
return;
|
|
3560
3428
|
}
|
|
3561
3429
|
const parsedSource = parseSource(source);
|
|
3562
|
-
logger.log(` ${
|
|
3430
|
+
logger.log(` ${pc8.dim(`Installing from ${parsedSource.type}...`)}`);
|
|
3563
3431
|
let success = false;
|
|
3564
3432
|
try {
|
|
3565
3433
|
switch (parsedSource.type) {
|
|
@@ -3576,7 +3444,7 @@ async function executeAddCommand(source, options) {
|
|
|
3576
3444
|
break;
|
|
3577
3445
|
}
|
|
3578
3446
|
if (success) {
|
|
3579
|
-
logger.log(` ${
|
|
3447
|
+
logger.log(` ${pc8.dim("Syncing to providers...")}`);
|
|
3580
3448
|
const synapSyncDir = configManager.getSynapSyncDir();
|
|
3581
3449
|
const projectRoot = configManager.getProjectRoot();
|
|
3582
3450
|
const config = configManager.getConfig();
|
|
@@ -3587,9 +3455,9 @@ async function executeAddCommand(source, options) {
|
|
|
3587
3455
|
const created = pr.created.filter((c) => c.success).length;
|
|
3588
3456
|
const skipped = pr.skipped.length;
|
|
3589
3457
|
if (created > 0) {
|
|
3590
|
-
logger.log(` ${
|
|
3458
|
+
logger.log(` ${pc8.green("\u2713")} Synced to ${pr.provider} (${created} created)`);
|
|
3591
3459
|
} else if (skipped > 0) {
|
|
3592
|
-
logger.log(` ${
|
|
3460
|
+
logger.log(` ${pc8.green("\u2713")} Synced to ${pr.provider} (already up to date)`);
|
|
3593
3461
|
}
|
|
3594
3462
|
}
|
|
3595
3463
|
}
|
|
@@ -3600,7 +3468,7 @@ async function executeAddCommand(source, options) {
|
|
|
3600
3468
|
logger.line();
|
|
3601
3469
|
if (error instanceof CognitiveNotFoundError) {
|
|
3602
3470
|
logger.error(`Cognitive '${error.cognitiveName}' not found in registry.`);
|
|
3603
|
-
logger.hint("Run synapsync
|
|
3471
|
+
logger.hint("Run synapsync list --remote to browse available cognitives.");
|
|
3604
3472
|
} else if (error instanceof RegistryError) {
|
|
3605
3473
|
logger.error(`Registry error: ${error.message}`);
|
|
3606
3474
|
} else if (error instanceof Error) {
|
|
@@ -3661,10 +3529,10 @@ async function installFromRegistry(name, options, configManager) {
|
|
|
3661
3529
|
saveCognitive(targetDir, manifest, downloaded.content, assets);
|
|
3662
3530
|
updateProjectManifest(configManager, manifest, "registry");
|
|
3663
3531
|
logger.line();
|
|
3664
|
-
logger.log(` ${
|
|
3665
|
-
logger.log(` ${
|
|
3666
|
-
logger.log(` ${
|
|
3667
|
-
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)}`);
|
|
3668
3536
|
return true;
|
|
3669
3537
|
}
|
|
3670
3538
|
async function downloadAssets(client, name, _manifest) {
|
|
@@ -3739,11 +3607,11 @@ function installFromLocal(sourcePath, options, configManager) {
|
|
|
3739
3607
|
saveCognitive(targetDir, manifest, content, assets);
|
|
3740
3608
|
updateProjectManifest(configManager, manifest, "local");
|
|
3741
3609
|
logger.line();
|
|
3742
|
-
logger.log(` ${
|
|
3743
|
-
logger.log(` ${
|
|
3744
|
-
logger.log(` ${
|
|
3745
|
-
logger.log(` ${
|
|
3746
|
-
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)}`);
|
|
3747
3615
|
return true;
|
|
3748
3616
|
}
|
|
3749
3617
|
function detectCognitiveType(dirPath) {
|
|
@@ -3860,7 +3728,7 @@ function registerAddCommand(program) {
|
|
|
3860
3728
|
init_esm_shims();
|
|
3861
3729
|
import * as fs10 from "fs";
|
|
3862
3730
|
import * as path12 from "path";
|
|
3863
|
-
import
|
|
3731
|
+
import pc9 from "picocolors";
|
|
3864
3732
|
async function executeListCommand(options) {
|
|
3865
3733
|
logger.line();
|
|
3866
3734
|
if (options.remote === true) {
|
|
@@ -3873,7 +3741,7 @@ async function executeListCommand(options) {
|
|
|
3873
3741
|
logger.hint("Run synapsync init to initialize a project first.");
|
|
3874
3742
|
return;
|
|
3875
3743
|
}
|
|
3876
|
-
const validatedOptions =
|
|
3744
|
+
const validatedOptions = validateOptions(options);
|
|
3877
3745
|
if (validatedOptions === null) {
|
|
3878
3746
|
return;
|
|
3879
3747
|
}
|
|
@@ -3888,10 +3756,10 @@ async function executeListCommand(options) {
|
|
|
3888
3756
|
}
|
|
3889
3757
|
async function listRemoteCognitives(options) {
|
|
3890
3758
|
const client = new RegistryClient();
|
|
3891
|
-
logger.log(` ${
|
|
3759
|
+
logger.log(` ${pc9.dim("Fetching registry...")}`);
|
|
3892
3760
|
try {
|
|
3893
3761
|
const cognitives = await client.list();
|
|
3894
|
-
const validatedOptions =
|
|
3762
|
+
const validatedOptions = validateOptions(options);
|
|
3895
3763
|
if (validatedOptions === null) {
|
|
3896
3764
|
return;
|
|
3897
3765
|
}
|
|
@@ -3913,6 +3781,12 @@ function filterRemoteCognitives(cognitives, options) {
|
|
|
3913
3781
|
if (options.category !== void 0 && c.category !== options.category) {
|
|
3914
3782
|
return false;
|
|
3915
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
|
+
}
|
|
3916
3790
|
return true;
|
|
3917
3791
|
});
|
|
3918
3792
|
}
|
|
@@ -3921,7 +3795,7 @@ function displayRemoteCognitives(cognitives) {
|
|
|
3921
3795
|
logger.bold(" Available Cognitives (Registry)");
|
|
3922
3796
|
logger.line();
|
|
3923
3797
|
if (cognitives.length === 0) {
|
|
3924
|
-
logger.log(` ${
|
|
3798
|
+
logger.log(` ${pc9.dim("No cognitives found in registry.")}`);
|
|
3925
3799
|
return;
|
|
3926
3800
|
}
|
|
3927
3801
|
const grouped = {};
|
|
@@ -3930,34 +3804,34 @@ function displayRemoteCognitives(cognitives) {
|
|
|
3930
3804
|
grouped[cognitive.type].push(cognitive);
|
|
3931
3805
|
}
|
|
3932
3806
|
for (const [type, items] of Object.entries(grouped)) {
|
|
3933
|
-
const typeIcon =
|
|
3807
|
+
const typeIcon = getCognitiveIcon2(type);
|
|
3934
3808
|
const typeLabel = `${type}s`;
|
|
3935
|
-
logger.log(` ${typeIcon} ${
|
|
3809
|
+
logger.log(` ${typeIcon} ${pc9.bold(typeLabel.charAt(0).toUpperCase() + typeLabel.slice(1))} (${items.length})`);
|
|
3936
3810
|
logger.line();
|
|
3937
3811
|
for (const cognitive of items) {
|
|
3938
|
-
logger.log(` ${
|
|
3812
|
+
logger.log(` ${pc9.white(cognitive.name)} ${pc9.dim(`v${cognitive.version}`)}`);
|
|
3939
3813
|
if (cognitive.description) {
|
|
3940
3814
|
const desc = cognitive.description.length > 60 ? cognitive.description.slice(0, 57) + "..." : cognitive.description;
|
|
3941
|
-
logger.log(` ${
|
|
3815
|
+
logger.log(` ${pc9.dim(desc)}`);
|
|
3942
3816
|
}
|
|
3943
3817
|
const details = [];
|
|
3944
|
-
details.push(
|
|
3818
|
+
details.push(pc9.dim(cognitive.category));
|
|
3945
3819
|
if (cognitive.author) {
|
|
3946
|
-
details.push(
|
|
3820
|
+
details.push(pc9.dim(`by ${cognitive.author}`));
|
|
3947
3821
|
}
|
|
3948
3822
|
logger.log(` ${details.join(" \xB7 ")}`);
|
|
3949
3823
|
if (cognitive.tags !== void 0 && cognitive.tags.length > 0) {
|
|
3950
3824
|
const tagsStr = cognitive.tags.slice(0, 5).join(" ");
|
|
3951
|
-
logger.log(` ${
|
|
3825
|
+
logger.log(` ${pc9.cyan(tagsStr)}`);
|
|
3952
3826
|
}
|
|
3953
3827
|
logger.line();
|
|
3954
3828
|
}
|
|
3955
3829
|
}
|
|
3956
|
-
logger.log(` ${
|
|
3830
|
+
logger.log(` ${pc9.dim(`Total: ${cognitives.length} cognitive${cognitives.length === 1 ? "" : "s"} available`)}`);
|
|
3957
3831
|
logger.line();
|
|
3958
3832
|
logger.hint("Run synapsync add <name> to add a cognitive.");
|
|
3959
3833
|
}
|
|
3960
|
-
function
|
|
3834
|
+
function validateOptions(options) {
|
|
3961
3835
|
const validated = {};
|
|
3962
3836
|
if (options.type !== void 0) {
|
|
3963
3837
|
if (!COGNITIVE_TYPES.includes(options.type)) {
|
|
@@ -3975,6 +3849,9 @@ function validateOptions2(options) {
|
|
|
3975
3849
|
}
|
|
3976
3850
|
validated.category = options.category;
|
|
3977
3851
|
}
|
|
3852
|
+
if (options.tag !== void 0) {
|
|
3853
|
+
validated.tag = options.tag;
|
|
3854
|
+
}
|
|
3978
3855
|
return validated;
|
|
3979
3856
|
}
|
|
3980
3857
|
function readManifest(configManager) {
|
|
@@ -4018,11 +3895,11 @@ function displayCognitives(manifest, options) {
|
|
|
4018
3895
|
logger.line();
|
|
4019
3896
|
if (filtered.length === 0) {
|
|
4020
3897
|
if (cognitives.length === 0) {
|
|
4021
|
-
logger.log(` ${
|
|
3898
|
+
logger.log(` ${pc9.dim("No cognitives installed yet.")}`);
|
|
4022
3899
|
logger.line();
|
|
4023
|
-
logger.hint("Run synapsync
|
|
3900
|
+
logger.hint("Run synapsync list --remote to browse available cognitives.");
|
|
4024
3901
|
} else {
|
|
4025
|
-
logger.log(` ${
|
|
3902
|
+
logger.log(` ${pc9.dim("No cognitives match the specified filters.")}`);
|
|
4026
3903
|
logger.line();
|
|
4027
3904
|
logger.hint("Try removing filters to see all installed cognitives.");
|
|
4028
3905
|
}
|
|
@@ -4030,16 +3907,16 @@ function displayCognitives(manifest, options) {
|
|
|
4030
3907
|
}
|
|
4031
3908
|
const grouped = groupByType(filtered);
|
|
4032
3909
|
for (const [type, items] of Object.entries(grouped)) {
|
|
4033
|
-
const typeIcon =
|
|
3910
|
+
const typeIcon = getCognitiveIcon2(type);
|
|
4034
3911
|
const typeLabel = `${type}s`;
|
|
4035
|
-
logger.log(` ${typeIcon} ${
|
|
3912
|
+
logger.log(` ${typeIcon} ${pc9.bold(typeLabel.charAt(0).toUpperCase() + typeLabel.slice(1))} (${items.length})`);
|
|
4036
3913
|
logger.line();
|
|
4037
3914
|
for (const cognitive of items) {
|
|
4038
|
-
|
|
3915
|
+
displayCognitive(cognitive);
|
|
4039
3916
|
}
|
|
4040
3917
|
}
|
|
4041
3918
|
logger.line();
|
|
4042
|
-
logger.log(` ${
|
|
3919
|
+
logger.log(` ${pc9.dim(`Total: ${filtered.length} cognitive${filtered.length === 1 ? "" : "s"}`)}`);
|
|
4043
3920
|
logger.line();
|
|
4044
3921
|
logger.hint("Run synapsync uninstall <name> to remove a cognitive.");
|
|
4045
3922
|
}
|
|
@@ -4051,25 +3928,25 @@ function groupByType(cognitives) {
|
|
|
4051
3928
|
}
|
|
4052
3929
|
return grouped;
|
|
4053
3930
|
}
|
|
4054
|
-
function
|
|
4055
|
-
logger.log(` ${
|
|
3931
|
+
function displayCognitive(cognitive) {
|
|
3932
|
+
logger.log(` ${pc9.white(cognitive.name)} ${pc9.dim(`v${cognitive.version}`)}`);
|
|
4056
3933
|
const details = [];
|
|
4057
|
-
details.push(
|
|
4058
|
-
details.push(
|
|
3934
|
+
details.push(pc9.dim(cognitive.category));
|
|
3935
|
+
details.push(pc9.dim(`from ${cognitive.source}`));
|
|
4059
3936
|
if (cognitive.installedAt !== void 0) {
|
|
4060
3937
|
const date = new Date(cognitive.installedAt);
|
|
4061
|
-
details.push(
|
|
3938
|
+
details.push(pc9.dim(`installed ${formatDate(date)}`));
|
|
4062
3939
|
}
|
|
4063
3940
|
logger.log(` ${details.join(" \xB7 ")}`);
|
|
4064
3941
|
logger.line();
|
|
4065
3942
|
}
|
|
4066
|
-
function
|
|
3943
|
+
function getCognitiveIcon2(type) {
|
|
4067
3944
|
const icons = {
|
|
4068
|
-
skill:
|
|
4069
|
-
agent:
|
|
4070
|
-
prompt:
|
|
4071
|
-
workflow:
|
|
4072
|
-
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")
|
|
4073
3950
|
};
|
|
4074
3951
|
return icons[type];
|
|
4075
3952
|
}
|
|
@@ -4091,7 +3968,7 @@ function formatDate(date) {
|
|
|
4091
3968
|
}
|
|
4092
3969
|
}
|
|
4093
3970
|
function registerListCommand(program) {
|
|
4094
|
-
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) => {
|
|
4095
3972
|
await executeListCommand(options);
|
|
4096
3973
|
});
|
|
4097
3974
|
}
|
|
@@ -4100,7 +3977,7 @@ function registerListCommand(program) {
|
|
|
4100
3977
|
init_esm_shims();
|
|
4101
3978
|
import * as fs11 from "fs";
|
|
4102
3979
|
import * as path13 from "path";
|
|
4103
|
-
import
|
|
3980
|
+
import pc10 from "picocolors";
|
|
4104
3981
|
function executeUninstallCommand(name, options) {
|
|
4105
3982
|
logger.line();
|
|
4106
3983
|
const configManager = ConfigManager.findConfig();
|
|
@@ -4117,13 +3994,13 @@ function executeUninstallCommand(name, options) {
|
|
|
4117
3994
|
return;
|
|
4118
3995
|
}
|
|
4119
3996
|
if (options.force !== true) {
|
|
4120
|
-
logger.log(` ${
|
|
4121
|
-
logger.log(` ${
|
|
4122
|
-
logger.log(` ${
|
|
4123
|
-
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}`);
|
|
4124
4001
|
logger.line();
|
|
4125
4002
|
logger.hint("Use --force to skip confirmation and uninstall directly.");
|
|
4126
|
-
logger.log(` ${
|
|
4003
|
+
logger.log(` ${pc10.dim("To confirm, run:")} synapsync uninstall ${name} --force`);
|
|
4127
4004
|
return;
|
|
4128
4005
|
}
|
|
4129
4006
|
try {
|
|
@@ -4131,7 +4008,7 @@ function executeUninstallCommand(name, options) {
|
|
|
4131
4008
|
const cognitiveDir = getCognitiveDir(configManager, cognitive);
|
|
4132
4009
|
if (fs11.existsSync(cognitiveDir)) {
|
|
4133
4010
|
fs11.rmSync(cognitiveDir, { recursive: true, force: true });
|
|
4134
|
-
logger.log(` ${
|
|
4011
|
+
logger.log(` ${pc10.dim("Removed files from")} ${path13.relative(process.cwd(), cognitiveDir)}`);
|
|
4135
4012
|
}
|
|
4136
4013
|
}
|
|
4137
4014
|
delete manifest.cognitives[name];
|
|
@@ -4139,7 +4016,7 @@ function executeUninstallCommand(name, options) {
|
|
|
4139
4016
|
saveManifest(configManager, manifest);
|
|
4140
4017
|
regenerateAgentsMd(configManager.getProjectRoot(), configManager.getSynapSyncDir());
|
|
4141
4018
|
logger.line();
|
|
4142
|
-
logger.log(` ${
|
|
4019
|
+
logger.log(` ${pc10.green("\u2713")} Uninstalled ${pc10.bold(name)}`);
|
|
4143
4020
|
logger.line();
|
|
4144
4021
|
logger.hint("Note: Provider symlinks may need manual cleanup if sync was run.");
|
|
4145
4022
|
} catch (error) {
|
|
@@ -4191,7 +4068,7 @@ function registerUninstallCommand(program) {
|
|
|
4191
4068
|
|
|
4192
4069
|
// src/commands/sync.ts
|
|
4193
4070
|
init_esm_shims();
|
|
4194
|
-
import
|
|
4071
|
+
import pc11 from "picocolors";
|
|
4195
4072
|
function executeSyncCommand(options) {
|
|
4196
4073
|
logger.line();
|
|
4197
4074
|
const configManager = ConfigManager.findConfig();
|
|
@@ -4200,7 +4077,7 @@ function executeSyncCommand(options) {
|
|
|
4200
4077
|
logger.hint("Run synapsync init to initialize a project first.");
|
|
4201
4078
|
return;
|
|
4202
4079
|
}
|
|
4203
|
-
const validatedOptions =
|
|
4080
|
+
const validatedOptions = validateOptions2(options);
|
|
4204
4081
|
if (validatedOptions === null) {
|
|
4205
4082
|
return;
|
|
4206
4083
|
}
|
|
@@ -4228,7 +4105,7 @@ function executeSyncCommand(options) {
|
|
|
4228
4105
|
syncOpts,
|
|
4229
4106
|
options.json !== true ? (status) => {
|
|
4230
4107
|
if (options.verbose === true) {
|
|
4231
|
-
logger.log(` ${
|
|
4108
|
+
logger.log(` ${pc11.dim(status.message)}`);
|
|
4232
4109
|
}
|
|
4233
4110
|
} : void 0
|
|
4234
4111
|
);
|
|
@@ -4243,7 +4120,7 @@ function executeSyncCommand(options) {
|
|
|
4243
4120
|
}
|
|
4244
4121
|
displayResults(result, options);
|
|
4245
4122
|
}
|
|
4246
|
-
function
|
|
4123
|
+
function validateOptions2(options) {
|
|
4247
4124
|
const validated = {};
|
|
4248
4125
|
if (options.type !== void 0) {
|
|
4249
4126
|
if (!COGNITIVE_TYPES.includes(options.type)) {
|
|
@@ -4278,13 +4155,13 @@ function displayResults(result, options) {
|
|
|
4278
4155
|
(pr) => pr.created.length > 0 || pr.removed.length > 0
|
|
4279
4156
|
);
|
|
4280
4157
|
if (!hasManifestChanges && hasProviderChanges !== true) {
|
|
4281
|
-
logger.log(` ${
|
|
4158
|
+
logger.log(` ${pc11.green("\u2713")} Everything is in sync`);
|
|
4282
4159
|
logger.line();
|
|
4283
|
-
logger.log(` ${
|
|
4160
|
+
logger.log(` ${pc11.dim(`${result.total} cognitives in manifest`)}`);
|
|
4284
4161
|
if (hasProviderResults && result.providerResults !== void 0) {
|
|
4285
4162
|
const syncedProviders = result.providerResults.filter((pr) => pr.skipped.length > 0 || pr.created.length > 0);
|
|
4286
4163
|
if (syncedProviders.length > 0) {
|
|
4287
|
-
logger.log(` ${
|
|
4164
|
+
logger.log(` ${pc11.dim(`${syncedProviders.length} provider(s) synced`)}`);
|
|
4288
4165
|
}
|
|
4289
4166
|
}
|
|
4290
4167
|
logger.line();
|
|
@@ -4304,16 +4181,16 @@ function displayResults(result, options) {
|
|
|
4304
4181
|
}
|
|
4305
4182
|
logger.line();
|
|
4306
4183
|
if (result.added > 0) {
|
|
4307
|
-
logger.log(` ${
|
|
4184
|
+
logger.log(` ${pc11.green("+")} ${result.added} added`);
|
|
4308
4185
|
}
|
|
4309
4186
|
if (result.updated > 0) {
|
|
4310
|
-
logger.log(` ${
|
|
4187
|
+
logger.log(` ${pc11.yellow("~")} ${result.updated} updated`);
|
|
4311
4188
|
}
|
|
4312
4189
|
if (result.removed > 0) {
|
|
4313
|
-
logger.log(` ${
|
|
4190
|
+
logger.log(` ${pc11.red("-")} ${result.removed} removed`);
|
|
4314
4191
|
}
|
|
4315
4192
|
if (result.unchanged > 0) {
|
|
4316
|
-
logger.log(` ${
|
|
4193
|
+
logger.log(` ${pc11.dim("\u25CB")} ${result.unchanged} unchanged`);
|
|
4317
4194
|
}
|
|
4318
4195
|
logger.line();
|
|
4319
4196
|
}
|
|
@@ -4324,14 +4201,14 @@ function displayResults(result, options) {
|
|
|
4324
4201
|
displayProviderResult(providerResult, options);
|
|
4325
4202
|
}
|
|
4326
4203
|
}
|
|
4327
|
-
logger.log(` ${
|
|
4204
|
+
logger.log(` ${pc11.dim(`Total: ${result.total} cognitives | Duration: ${result.duration}ms`)}`);
|
|
4328
4205
|
logger.line();
|
|
4329
4206
|
if (result.errors.length > 0) {
|
|
4330
4207
|
logger.line();
|
|
4331
|
-
logger.bold(` ${
|
|
4208
|
+
logger.bold(` ${pc11.red("Errors:")}`);
|
|
4332
4209
|
logger.line();
|
|
4333
4210
|
for (const error of result.errors) {
|
|
4334
|
-
logger.log(` ${
|
|
4211
|
+
logger.log(` ${pc11.red("\u2717")} ${error.cognitive ?? "Unknown"}: ${error.message}`);
|
|
4335
4212
|
}
|
|
4336
4213
|
logger.line();
|
|
4337
4214
|
}
|
|
@@ -4347,13 +4224,13 @@ function displayActions(actions, isDryRun) {
|
|
|
4347
4224
|
const name = typeof action.cognitive === "string" ? action.cognitive : action.cognitive.name;
|
|
4348
4225
|
switch (action.operation) {
|
|
4349
4226
|
case "add":
|
|
4350
|
-
logger.log(` ${
|
|
4227
|
+
logger.log(` ${pc11.green("+")} ${verb} add: ${pc11.white(name)}`);
|
|
4351
4228
|
break;
|
|
4352
4229
|
case "update":
|
|
4353
|
-
logger.log(` ${
|
|
4230
|
+
logger.log(` ${pc11.yellow("~")} ${verb} update: ${pc11.white(name)}`);
|
|
4354
4231
|
break;
|
|
4355
4232
|
case "remove":
|
|
4356
|
-
logger.log(` ${
|
|
4233
|
+
logger.log(` ${pc11.red("-")} ${verb} remove: ${pc11.white(name)}`);
|
|
4357
4234
|
break;
|
|
4358
4235
|
}
|
|
4359
4236
|
}
|
|
@@ -4365,22 +4242,22 @@ function displayProviderResult(result, options) {
|
|
|
4365
4242
|
const errors = result.errors.length;
|
|
4366
4243
|
const methodLabel = result.method === "symlink" ? "symlinks" : "copies";
|
|
4367
4244
|
const hasChanges = created > 0 || removed > 0;
|
|
4368
|
-
logger.log(` ${
|
|
4245
|
+
logger.log(` ${pc11.cyan(result.provider)}:`);
|
|
4369
4246
|
if (hasChanges || options.verbose === true) {
|
|
4370
4247
|
if (created > 0) {
|
|
4371
|
-
logger.log(` ${
|
|
4248
|
+
logger.log(` ${pc11.green("\u2713")} ${created} ${methodLabel} created`);
|
|
4372
4249
|
}
|
|
4373
4250
|
if (skipped > 0) {
|
|
4374
|
-
logger.log(` ${
|
|
4251
|
+
logger.log(` ${pc11.dim("\u25CB")} ${skipped} already synced`);
|
|
4375
4252
|
}
|
|
4376
4253
|
if (removed > 0) {
|
|
4377
|
-
logger.log(` ${
|
|
4254
|
+
logger.log(` ${pc11.red("-")} ${removed} orphaned removed`);
|
|
4378
4255
|
}
|
|
4379
4256
|
if (errors > 0) {
|
|
4380
|
-
logger.log(` ${
|
|
4257
|
+
logger.log(` ${pc11.red("\u2717")} ${errors} errors`);
|
|
4381
4258
|
}
|
|
4382
4259
|
} else {
|
|
4383
|
-
logger.log(` ${
|
|
4260
|
+
logger.log(` ${pc11.green("\u2713")} ${skipped + created} ${methodLabel} synced`);
|
|
4384
4261
|
}
|
|
4385
4262
|
logger.line();
|
|
4386
4263
|
}
|
|
@@ -4410,23 +4287,23 @@ function executeSyncStatusCommand(options) {
|
|
|
4410
4287
|
logger.bold(" Sync Status");
|
|
4411
4288
|
logger.line();
|
|
4412
4289
|
if (status.inSync) {
|
|
4413
|
-
logger.log(` ${
|
|
4290
|
+
logger.log(` ${pc11.green("\u2713")} Filesystem and manifest are in sync`);
|
|
4414
4291
|
} else {
|
|
4415
|
-
logger.log(` ${
|
|
4292
|
+
logger.log(` ${pc11.yellow("!")} Out of sync`);
|
|
4416
4293
|
}
|
|
4417
4294
|
logger.line();
|
|
4418
|
-
logger.log(` ${
|
|
4419
|
-
logger.log(` ${
|
|
4295
|
+
logger.log(` ${pc11.dim("Manifest:")} ${status.manifest} cognitives`);
|
|
4296
|
+
logger.log(` ${pc11.dim("Filesystem:")} ${status.filesystem} cognitives`);
|
|
4420
4297
|
if (!status.inSync) {
|
|
4421
4298
|
logger.line();
|
|
4422
4299
|
if (status.newInFilesystem > 0) {
|
|
4423
|
-
logger.log(` ${
|
|
4300
|
+
logger.log(` ${pc11.green("+")} ${status.newInFilesystem} new in filesystem`);
|
|
4424
4301
|
}
|
|
4425
4302
|
if (status.removedFromFilesystem > 0) {
|
|
4426
|
-
logger.log(` ${
|
|
4303
|
+
logger.log(` ${pc11.red("-")} ${status.removedFromFilesystem} removed from filesystem`);
|
|
4427
4304
|
}
|
|
4428
4305
|
if (status.modified > 0) {
|
|
4429
|
-
logger.log(` ${
|
|
4306
|
+
logger.log(` ${pc11.yellow("~")} ${status.modified} modified`);
|
|
4430
4307
|
}
|
|
4431
4308
|
}
|
|
4432
4309
|
if (enabledProviders.length > 0) {
|
|
@@ -4438,19 +4315,19 @@ function executeSyncStatusCommand(options) {
|
|
|
4438
4315
|
if (pStatus === void 0) continue;
|
|
4439
4316
|
const total = pStatus.valid + pStatus.broken + pStatus.orphaned;
|
|
4440
4317
|
const hasIssues = pStatus.broken > 0 || pStatus.orphaned > 0;
|
|
4441
|
-
logger.log(` ${
|
|
4318
|
+
logger.log(` ${pc11.cyan(provider)}:`);
|
|
4442
4319
|
if (hasIssues) {
|
|
4443
|
-
logger.log(` ${
|
|
4320
|
+
logger.log(` ${pc11.green("\u2713")} ${pStatus.valid} valid`);
|
|
4444
4321
|
if (pStatus.broken > 0) {
|
|
4445
|
-
logger.log(` ${
|
|
4322
|
+
logger.log(` ${pc11.red("\u2717")} ${pStatus.broken} broken`);
|
|
4446
4323
|
}
|
|
4447
4324
|
if (pStatus.orphaned > 0) {
|
|
4448
|
-
logger.log(` ${
|
|
4325
|
+
logger.log(` ${pc11.yellow("?")} ${pStatus.orphaned} orphaned`);
|
|
4449
4326
|
}
|
|
4450
4327
|
} else if (total > 0) {
|
|
4451
|
-
logger.log(` ${
|
|
4328
|
+
logger.log(` ${pc11.green("\u2713")} ${total} symlinks valid`);
|
|
4452
4329
|
} else {
|
|
4453
|
-
logger.log(` ${
|
|
4330
|
+
logger.log(` ${pc11.dim("\u25CB")} No symlinks yet`);
|
|
4454
4331
|
}
|
|
4455
4332
|
}
|
|
4456
4333
|
}
|
|
@@ -4472,7 +4349,7 @@ function registerSyncCommand(program) {
|
|
|
4472
4349
|
init_esm_shims();
|
|
4473
4350
|
import * as fs12 from "fs";
|
|
4474
4351
|
import * as path14 from "path";
|
|
4475
|
-
import
|
|
4352
|
+
import pc12 from "picocolors";
|
|
4476
4353
|
|
|
4477
4354
|
// src/services/maintenance/update-checker.ts
|
|
4478
4355
|
init_esm_shims();
|
|
@@ -4595,7 +4472,7 @@ async function executeUpdateCommand(cognitiveName, options = {}) {
|
|
|
4595
4472
|
if (options.json === true) {
|
|
4596
4473
|
console.log(JSON.stringify({ message: "No cognitives installed" }));
|
|
4597
4474
|
} else {
|
|
4598
|
-
logger.log(` ${
|
|
4475
|
+
logger.log(` ${pc12.dim("No cognitives installed.")}`);
|
|
4599
4476
|
logger.hint("Run synapsync add <name> to add a cognitive.");
|
|
4600
4477
|
}
|
|
4601
4478
|
return;
|
|
@@ -4630,7 +4507,7 @@ async function executeUpdateCommand(cognitiveName, options = {}) {
|
|
|
4630
4507
|
displayCheckResults(checkResult);
|
|
4631
4508
|
if (checkResult.updatesAvailable.length === 0) {
|
|
4632
4509
|
logger.line();
|
|
4633
|
-
logger.log(` ${
|
|
4510
|
+
logger.log(` ${pc12.green("\u2713")} All cognitives are up to date`);
|
|
4634
4511
|
logger.line();
|
|
4635
4512
|
return;
|
|
4636
4513
|
}
|
|
@@ -4646,7 +4523,7 @@ async function executeUpdateCommand(cognitiveName, options = {}) {
|
|
|
4646
4523
|
const failed = [];
|
|
4647
4524
|
for (const update of checkResult.updatesAvailable) {
|
|
4648
4525
|
try {
|
|
4649
|
-
logger.log(` ${
|
|
4526
|
+
logger.log(` ${pc12.cyan("\u2193")} Updating ${update.name}...`);
|
|
4650
4527
|
const downloaded = await registry.download(update.name);
|
|
4651
4528
|
const manifestEntry = installed.find((c) => c.name === update.name);
|
|
4652
4529
|
if (manifestEntry === void 0) continue;
|
|
@@ -4666,28 +4543,28 @@ async function executeUpdateCommand(cognitiveName, options = {}) {
|
|
|
4666
4543
|
version: update.latestVersion
|
|
4667
4544
|
});
|
|
4668
4545
|
updated.push(update.name);
|
|
4669
|
-
logger.log(` ${
|
|
4546
|
+
logger.log(` ${pc12.green("\u2713")} Updated to v${update.latestVersion}`);
|
|
4670
4547
|
} catch (error) {
|
|
4671
4548
|
failed.push({
|
|
4672
4549
|
name: update.name,
|
|
4673
4550
|
error: error instanceof Error ? error.message : "Unknown error"
|
|
4674
4551
|
});
|
|
4675
|
-
logger.log(` ${
|
|
4552
|
+
logger.log(` ${pc12.red("\u2717")} Failed: ${error instanceof Error ? error.message : "Unknown error"}`);
|
|
4676
4553
|
}
|
|
4677
4554
|
}
|
|
4678
4555
|
manifest.save();
|
|
4679
4556
|
logger.line();
|
|
4680
|
-
logger.log(` ${
|
|
4557
|
+
logger.log(` ${pc12.dim("Syncing providers...")}`);
|
|
4681
4558
|
const config = configManager.getConfig();
|
|
4682
4559
|
const syncEngine = new SyncEngine(synapSyncDir, projectRoot, config);
|
|
4683
4560
|
syncEngine.sync();
|
|
4684
4561
|
regenerateAgentsMd(projectRoot, synapSyncDir);
|
|
4685
4562
|
logger.line();
|
|
4686
4563
|
if (updated.length > 0) {
|
|
4687
|
-
logger.log(` ${
|
|
4564
|
+
logger.log(` ${pc12.green("\u2713")} Updated ${updated.length} cognitive(s)`);
|
|
4688
4565
|
}
|
|
4689
4566
|
if (failed.length > 0) {
|
|
4690
|
-
logger.log(` ${
|
|
4567
|
+
logger.log(` ${pc12.red("\u2717")} Failed to update ${failed.length} cognitive(s)`);
|
|
4691
4568
|
}
|
|
4692
4569
|
logger.line();
|
|
4693
4570
|
}
|
|
@@ -4697,19 +4574,19 @@ function displayCheckResults(result) {
|
|
|
4697
4574
|
logger.line();
|
|
4698
4575
|
for (const update of result.updatesAvailable) {
|
|
4699
4576
|
logger.log(
|
|
4700
|
-
` ${
|
|
4577
|
+
` ${pc12.yellow("\u2191")} ${pc12.white(update.name)} ${pc12.dim(update.currentVersion)} \u2192 ${pc12.green(update.latestVersion)}`
|
|
4701
4578
|
);
|
|
4702
4579
|
}
|
|
4703
4580
|
}
|
|
4704
4581
|
if (result.upToDate.length > 0 && result.updatesAvailable.length > 0) {
|
|
4705
4582
|
logger.line();
|
|
4706
|
-
logger.log(` ${
|
|
4583
|
+
logger.log(` ${pc12.dim(`${result.upToDate.length} cognitive(s) up to date`)}`);
|
|
4707
4584
|
}
|
|
4708
4585
|
if (result.errors.length > 0) {
|
|
4709
4586
|
logger.line();
|
|
4710
|
-
logger.log(` ${
|
|
4587
|
+
logger.log(` ${pc12.red("Errors:")}`);
|
|
4711
4588
|
for (const error of result.errors) {
|
|
4712
|
-
logger.log(` ${
|
|
4589
|
+
logger.log(` ${pc12.red("\u2717")} ${error.cognitive}: ${error.message}`);
|
|
4713
4590
|
}
|
|
4714
4591
|
}
|
|
4715
4592
|
}
|
|
@@ -4721,7 +4598,7 @@ function registerUpdateCommand(program) {
|
|
|
4721
4598
|
|
|
4722
4599
|
// src/commands/doctor.ts
|
|
4723
4600
|
init_esm_shims();
|
|
4724
|
-
import
|
|
4601
|
+
import pc13 from "picocolors";
|
|
4725
4602
|
|
|
4726
4603
|
// src/services/maintenance/doctor.ts
|
|
4727
4604
|
init_esm_shims();
|
|
@@ -5201,17 +5078,17 @@ async function executeDoctorCommand(options = {}) {
|
|
|
5201
5078
|
}
|
|
5202
5079
|
logger.line();
|
|
5203
5080
|
if (result.healthy) {
|
|
5204
|
-
logger.log(` ${
|
|
5081
|
+
logger.log(` ${pc13.green("\u2713")} Your project is healthy!`);
|
|
5205
5082
|
} else if (result.failed > 0) {
|
|
5206
|
-
logger.log(` ${
|
|
5083
|
+
logger.log(` ${pc13.red("!")} ${result.failed} issue(s) found`);
|
|
5207
5084
|
if (options.fix !== true) {
|
|
5208
5085
|
logger.hint("Run synapsync doctor --fix to auto-repair fixable issues.");
|
|
5209
5086
|
}
|
|
5210
5087
|
} else if (result.warnings > 0) {
|
|
5211
|
-
logger.log(` ${
|
|
5088
|
+
logger.log(` ${pc13.yellow("!")} ${result.warnings} warning(s)`);
|
|
5212
5089
|
}
|
|
5213
5090
|
logger.line();
|
|
5214
|
-
logger.log(` ${
|
|
5091
|
+
logger.log(` ${pc13.dim(`Checked ${result.checks.length} items in ${result.duration}ms`)}`);
|
|
5215
5092
|
logger.line();
|
|
5216
5093
|
}
|
|
5217
5094
|
function displayDiagnostics(result, verbose = false) {
|
|
@@ -5224,10 +5101,10 @@ function displayCheck(check, verbose = false) {
|
|
|
5224
5101
|
const statusColor = getStatusColor(check.status);
|
|
5225
5102
|
logger.log(` ${statusIcon} ${statusColor(check.name)}`);
|
|
5226
5103
|
if (verbose || check.status === "fail" || check.status === "warn") {
|
|
5227
|
-
logger.log(` ${
|
|
5104
|
+
logger.log(` ${pc13.dim(check.message)}`);
|
|
5228
5105
|
if (check.details !== void 0 && check.details.length > 0) {
|
|
5229
5106
|
for (const detail of check.details) {
|
|
5230
|
-
logger.log(` ${
|
|
5107
|
+
logger.log(` ${pc13.dim("\u2022")} ${pc13.dim(detail)}`);
|
|
5231
5108
|
}
|
|
5232
5109
|
}
|
|
5233
5110
|
}
|
|
@@ -5237,40 +5114,40 @@ function displayFixes(result) {
|
|
|
5237
5114
|
logger.line();
|
|
5238
5115
|
if (result.fixed.length > 0) {
|
|
5239
5116
|
for (const fix of result.fixed) {
|
|
5240
|
-
logger.log(` ${
|
|
5117
|
+
logger.log(` ${pc13.green("\u2713")} Fixed: ${fix}`);
|
|
5241
5118
|
}
|
|
5242
5119
|
}
|
|
5243
5120
|
if (result.failed.length > 0) {
|
|
5244
5121
|
for (const fail of result.failed) {
|
|
5245
|
-
logger.log(` ${
|
|
5122
|
+
logger.log(` ${pc13.red("\u2717")} Failed: ${fail.check} - ${fail.error}`);
|
|
5246
5123
|
}
|
|
5247
5124
|
}
|
|
5248
5125
|
if (result.fixed.length === 0 && result.failed.length === 0) {
|
|
5249
|
-
logger.log(` ${
|
|
5126
|
+
logger.log(` ${pc13.dim("No fixes needed")}`);
|
|
5250
5127
|
}
|
|
5251
5128
|
}
|
|
5252
5129
|
function getStatusIcon(status) {
|
|
5253
5130
|
switch (status) {
|
|
5254
5131
|
case "pass":
|
|
5255
|
-
return
|
|
5132
|
+
return pc13.green("\u2713");
|
|
5256
5133
|
case "warn":
|
|
5257
|
-
return
|
|
5134
|
+
return pc13.yellow("!");
|
|
5258
5135
|
case "fail":
|
|
5259
|
-
return
|
|
5136
|
+
return pc13.red("\u2717");
|
|
5260
5137
|
case "skip":
|
|
5261
|
-
return
|
|
5138
|
+
return pc13.dim("\u25CB");
|
|
5262
5139
|
}
|
|
5263
5140
|
}
|
|
5264
5141
|
function getStatusColor(status) {
|
|
5265
5142
|
switch (status) {
|
|
5266
5143
|
case "pass":
|
|
5267
|
-
return
|
|
5144
|
+
return pc13.green;
|
|
5268
5145
|
case "warn":
|
|
5269
|
-
return
|
|
5146
|
+
return pc13.yellow;
|
|
5270
5147
|
case "fail":
|
|
5271
|
-
return
|
|
5148
|
+
return pc13.red;
|
|
5272
5149
|
case "skip":
|
|
5273
|
-
return
|
|
5150
|
+
return pc13.dim;
|
|
5274
5151
|
}
|
|
5275
5152
|
}
|
|
5276
5153
|
function registerDoctorCommand(program) {
|
|
@@ -5281,7 +5158,7 @@ function registerDoctorCommand(program) {
|
|
|
5281
5158
|
|
|
5282
5159
|
// src/commands/clean.ts
|
|
5283
5160
|
init_esm_shims();
|
|
5284
|
-
import
|
|
5161
|
+
import pc14 from "picocolors";
|
|
5285
5162
|
|
|
5286
5163
|
// src/services/maintenance/cleaner.ts
|
|
5287
5164
|
init_esm_shims();
|
|
@@ -5583,47 +5460,47 @@ function executeCleanCommand(options = {}) {
|
|
|
5583
5460
|
displayResults2(result, options);
|
|
5584
5461
|
logger.line();
|
|
5585
5462
|
if (result.cleaned.length === 0) {
|
|
5586
|
-
logger.log(` ${
|
|
5463
|
+
logger.log(` ${pc14.green("\u2713")} Nothing to clean`);
|
|
5587
5464
|
} else if (options.dryRun === true) {
|
|
5588
|
-
logger.log(` ${
|
|
5465
|
+
logger.log(` ${pc14.dim(`Would clean ${result.cleaned.length} item(s), freeing ${result.sizeFreed}`)}`);
|
|
5589
5466
|
logger.hint("Run synapsync clean without --dry-run to apply changes.");
|
|
5590
5467
|
} else {
|
|
5591
|
-
logger.log(` ${
|
|
5468
|
+
logger.log(` ${pc14.green("\u2713")} Cleaned ${result.cleaned.length} item(s), freed ${result.sizeFreed}`);
|
|
5592
5469
|
}
|
|
5593
5470
|
if (result.errors.length > 0) {
|
|
5594
|
-
logger.log(` ${
|
|
5471
|
+
logger.log(` ${pc14.red("!")} ${result.errors.length} error(s) occurred`);
|
|
5595
5472
|
}
|
|
5596
5473
|
logger.line();
|
|
5597
5474
|
}
|
|
5598
5475
|
function displayResults2(result, _options) {
|
|
5599
5476
|
const byType = groupByType2(result.cleaned);
|
|
5600
5477
|
if (byType.cache.length > 0) {
|
|
5601
|
-
logger.log(` ${
|
|
5478
|
+
logger.log(` ${pc14.cyan("Cache:")}`);
|
|
5602
5479
|
for (const item of byType.cache) {
|
|
5603
5480
|
const size = formatBytes(item.size);
|
|
5604
|
-
logger.log(` ${
|
|
5481
|
+
logger.log(` ${pc14.dim("-")} ${getRelativePath(item.path)} ${pc14.dim(`(${size})`)}`);
|
|
5605
5482
|
}
|
|
5606
5483
|
logger.line();
|
|
5607
5484
|
}
|
|
5608
5485
|
if (byType.orphan.length > 0) {
|
|
5609
|
-
logger.log(` ${
|
|
5486
|
+
logger.log(` ${pc14.cyan("Orphaned symlinks:")}`);
|
|
5610
5487
|
for (const item of byType.orphan) {
|
|
5611
|
-
logger.log(` ${
|
|
5488
|
+
logger.log(` ${pc14.dim("-")} ${item.path}`);
|
|
5612
5489
|
}
|
|
5613
5490
|
logger.line();
|
|
5614
5491
|
}
|
|
5615
5492
|
if (byType.temp.length > 0) {
|
|
5616
|
-
logger.log(` ${
|
|
5493
|
+
logger.log(` ${pc14.cyan("Temp files:")}`);
|
|
5617
5494
|
for (const item of byType.temp) {
|
|
5618
5495
|
const size = formatBytes(item.size);
|
|
5619
|
-
logger.log(` ${
|
|
5496
|
+
logger.log(` ${pc14.dim("-")} ${getRelativePath(item.path)} ${pc14.dim(`(${size})`)}`);
|
|
5620
5497
|
}
|
|
5621
5498
|
logger.line();
|
|
5622
5499
|
}
|
|
5623
5500
|
if (result.errors.length > 0) {
|
|
5624
|
-
logger.log(` ${
|
|
5501
|
+
logger.log(` ${pc14.red("Errors:")}`);
|
|
5625
5502
|
for (const error of result.errors) {
|
|
5626
|
-
logger.log(` ${
|
|
5503
|
+
logger.log(` ${pc14.red("\u2717")} ${error.path}: ${error.message}`);
|
|
5627
5504
|
}
|
|
5628
5505
|
logger.line();
|
|
5629
5506
|
}
|
|
@@ -5663,7 +5540,7 @@ function registerCleanCommand(program) {
|
|
|
5663
5540
|
init_esm_shims();
|
|
5664
5541
|
import * as fs15 from "fs";
|
|
5665
5542
|
import * as path17 from "path";
|
|
5666
|
-
import
|
|
5543
|
+
import pc15 from "picocolors";
|
|
5667
5544
|
function executePurgeCommand(options) {
|
|
5668
5545
|
logger.line();
|
|
5669
5546
|
const configManager = ConfigManager.findConfig();
|
|
@@ -5674,15 +5551,15 @@ function executePurgeCommand(options) {
|
|
|
5674
5551
|
const projectRoot = configManager.getProjectRoot();
|
|
5675
5552
|
const synapSyncDir = configManager.getSynapSyncDir();
|
|
5676
5553
|
if (options.force !== true) {
|
|
5677
|
-
logger.log(` ${
|
|
5554
|
+
logger.log(` ${pc15.yellow("!")} This will completely remove SynapSync from your project:`);
|
|
5678
5555
|
logger.line();
|
|
5679
5556
|
const itemsToRemove = collectItemsToRemove(projectRoot, synapSyncDir);
|
|
5680
5557
|
for (const item of itemsToRemove) {
|
|
5681
|
-
logger.log(` ${
|
|
5558
|
+
logger.log(` ${pc15.red("\u2717")} ${item}`);
|
|
5682
5559
|
}
|
|
5683
5560
|
logger.line();
|
|
5684
5561
|
logger.hint("Use --force to confirm and remove everything.");
|
|
5685
|
-
logger.log(` ${
|
|
5562
|
+
logger.log(` ${pc15.dim("To confirm, run:")} synapsync purge --force`);
|
|
5686
5563
|
return;
|
|
5687
5564
|
}
|
|
5688
5565
|
let removedCount = 0;
|
|
@@ -5690,30 +5567,30 @@ function executePurgeCommand(options) {
|
|
|
5690
5567
|
removedCount += removeProviderSymlinks(projectRoot, synapSyncDir);
|
|
5691
5568
|
if (fs15.existsSync(synapSyncDir)) {
|
|
5692
5569
|
fs15.rmSync(synapSyncDir, { recursive: true, force: true });
|
|
5693
|
-
logger.log(` ${
|
|
5570
|
+
logger.log(` ${pc15.red("\u2717")} Removed ${path17.relative(projectRoot, synapSyncDir)}/`);
|
|
5694
5571
|
removedCount++;
|
|
5695
5572
|
}
|
|
5696
5573
|
const configPath = path17.join(projectRoot, "synapsync.config.yaml");
|
|
5697
5574
|
if (fs15.existsSync(configPath)) {
|
|
5698
5575
|
fs15.unlinkSync(configPath);
|
|
5699
|
-
logger.log(` ${
|
|
5576
|
+
logger.log(` ${pc15.red("\u2717")} Removed synapsync.config.yaml`);
|
|
5700
5577
|
removedCount++;
|
|
5701
5578
|
}
|
|
5702
5579
|
const agentsMdPath = path17.join(projectRoot, AGENTS_MD_FILE_NAME);
|
|
5703
5580
|
if (fs15.existsSync(agentsMdPath)) {
|
|
5704
5581
|
fs15.unlinkSync(agentsMdPath);
|
|
5705
|
-
logger.log(` ${
|
|
5582
|
+
logger.log(` ${pc15.red("\u2717")} Removed ${AGENTS_MD_FILE_NAME}`);
|
|
5706
5583
|
removedCount++;
|
|
5707
5584
|
}
|
|
5708
5585
|
if (cleanGitignore(projectRoot)) {
|
|
5709
|
-
logger.log(` ${
|
|
5586
|
+
logger.log(` ${pc15.red("\u2717")} Cleaned SynapSync entries from .gitignore`);
|
|
5710
5587
|
removedCount++;
|
|
5711
5588
|
}
|
|
5712
5589
|
logger.line();
|
|
5713
5590
|
if (removedCount > 0) {
|
|
5714
|
-
logger.log(` ${
|
|
5591
|
+
logger.log(` ${pc15.green("\u2713")} SynapSync has been completely removed from this project.`);
|
|
5715
5592
|
} else {
|
|
5716
|
-
logger.log(` ${
|
|
5593
|
+
logger.log(` ${pc15.green("\u2713")} Nothing to remove.`);
|
|
5717
5594
|
}
|
|
5718
5595
|
logger.line();
|
|
5719
5596
|
} catch (error) {
|
|
@@ -5780,7 +5657,7 @@ function removeProviderSymlinks(projectRoot, synapSyncDir) {
|
|
|
5780
5657
|
const symlinks = findSynapSyncSymlinks(projectRoot, synapSyncDir);
|
|
5781
5658
|
for (const link of symlinks) {
|
|
5782
5659
|
fs15.unlinkSync(link);
|
|
5783
|
-
logger.log(` ${
|
|
5660
|
+
logger.log(` ${pc15.red("\u2717")} Removed symlink ${path17.relative(projectRoot, link)}`);
|
|
5784
5661
|
}
|
|
5785
5662
|
return symlinks.length;
|
|
5786
5663
|
}
|
|
@@ -5819,24 +5696,24 @@ function showCommandHelp(commandName) {
|
|
|
5819
5696
|
return;
|
|
5820
5697
|
}
|
|
5821
5698
|
logger.line();
|
|
5822
|
-
logger.log(
|
|
5699
|
+
logger.log(pc16.bold(pc16.cyan(` /${commandName}`)) + pc16.dim(` - ${cmd.description}`));
|
|
5823
5700
|
logger.line();
|
|
5824
5701
|
if (cmd.usage) {
|
|
5825
|
-
logger.log(
|
|
5826
|
-
logger.log(` ${
|
|
5702
|
+
logger.log(pc16.bold(" Usage:"));
|
|
5703
|
+
logger.log(` ${pc16.cyan(cmd.usage)}`);
|
|
5827
5704
|
logger.line();
|
|
5828
5705
|
}
|
|
5829
5706
|
if (cmd.options && cmd.options.length > 0) {
|
|
5830
|
-
logger.log(
|
|
5707
|
+
logger.log(pc16.bold(" Options:"));
|
|
5831
5708
|
for (const opt of cmd.options) {
|
|
5832
|
-
logger.log(` ${
|
|
5709
|
+
logger.log(` ${pc16.yellow(opt.flag.padEnd(16))} ${pc16.dim(opt.description)}`);
|
|
5833
5710
|
}
|
|
5834
5711
|
logger.line();
|
|
5835
5712
|
}
|
|
5836
5713
|
if (cmd.examples && cmd.examples.length > 0) {
|
|
5837
|
-
logger.log(
|
|
5714
|
+
logger.log(pc16.bold(" Examples:"));
|
|
5838
5715
|
for (const example of cmd.examples) {
|
|
5839
|
-
logger.log(` ${
|
|
5716
|
+
logger.log(` ${pc16.dim("$")} ${pc16.cyan(example)}`);
|
|
5840
5717
|
}
|
|
5841
5718
|
logger.line();
|
|
5842
5719
|
}
|
|
@@ -5853,15 +5730,15 @@ registerInteractiveCommand(
|
|
|
5853
5730
|
logger.line();
|
|
5854
5731
|
logger.bold(" Available Commands:");
|
|
5855
5732
|
logger.line();
|
|
5856
|
-
logger.log(` ${
|
|
5857
|
-
logger.log(` ${
|
|
5858
|
-
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")}`);
|
|
5859
5736
|
logger.line();
|
|
5860
5737
|
const categories = {
|
|
5861
5738
|
"Information": ["info", "version"],
|
|
5862
5739
|
"Project": ["init", "config", "status"],
|
|
5863
5740
|
"Providers": ["providers"],
|
|
5864
|
-
"Cognitives": ["
|
|
5741
|
+
"Cognitives": ["add", "list", "uninstall"],
|
|
5865
5742
|
"Sync": ["sync"],
|
|
5866
5743
|
"Maintenance": ["update", "doctor", "clean", "purge"]
|
|
5867
5744
|
};
|
|
@@ -5873,8 +5750,8 @@ registerInteractiveCommand(
|
|
|
5873
5750
|
const cmd = COMMANDS[name];
|
|
5874
5751
|
const hasOptions = cmd?.options !== void 0 && cmd.options.length > 0;
|
|
5875
5752
|
const paddedName = `/${name}`.padEnd(18);
|
|
5876
|
-
const optionsHint = hasOptions ?
|
|
5877
|
-
logger.log(` ${
|
|
5753
|
+
const optionsHint = hasOptions ? pc16.yellow(" [options]") : "";
|
|
5754
|
+
logger.log(` ${pc16.cyan(paddedName)} ${pc16.dim(cmd?.description ?? "")}${optionsHint}`);
|
|
5878
5755
|
}
|
|
5879
5756
|
logger.line();
|
|
5880
5757
|
}
|
|
@@ -5980,44 +5857,6 @@ registerInteractiveCommand(
|
|
|
5980
5857
|
]
|
|
5981
5858
|
}
|
|
5982
5859
|
);
|
|
5983
|
-
registerInteractiveCommand(
|
|
5984
|
-
"search",
|
|
5985
|
-
"Search for cognitives in the registry",
|
|
5986
|
-
async (args) => {
|
|
5987
|
-
const parts = args.split(/\s+/);
|
|
5988
|
-
let query;
|
|
5989
|
-
const options = {};
|
|
5990
|
-
for (let i = 0; i < parts.length; i++) {
|
|
5991
|
-
const part = parts[i];
|
|
5992
|
-
if (part === void 0 || part === "") continue;
|
|
5993
|
-
if (part === "--type" || part === "-t") {
|
|
5994
|
-
options["type"] = parts[++i] ?? "";
|
|
5995
|
-
} else if (part === "--category" || part === "-c") {
|
|
5996
|
-
options["category"] = parts[++i] ?? "";
|
|
5997
|
-
} else if (part === "--tag") {
|
|
5998
|
-
options["tag"] = parts[++i] ?? "";
|
|
5999
|
-
} else if (part === "--limit" || part === "-l") {
|
|
6000
|
-
options["limit"] = parts[++i] ?? "20";
|
|
6001
|
-
} else if (part === "--json") {
|
|
6002
|
-
options["json"] = true;
|
|
6003
|
-
} else if (!part.startsWith("-")) {
|
|
6004
|
-
query = part;
|
|
6005
|
-
}
|
|
6006
|
-
}
|
|
6007
|
-
await executeSearchCommand(query, options);
|
|
6008
|
-
},
|
|
6009
|
-
{
|
|
6010
|
-
usage: "/search [query] [options]",
|
|
6011
|
-
options: [
|
|
6012
|
-
{ flag: "-t, --type <type>", description: "Filter by type (skill, agent, prompt, etc.)" },
|
|
6013
|
-
{ flag: "-c, --category <cat>", description: "Filter by category" },
|
|
6014
|
-
{ flag: "--tag <tag>", description: "Filter by tag" },
|
|
6015
|
-
{ flag: "-l, --limit <n>", description: "Limit results (default: 20)" },
|
|
6016
|
-
{ flag: "--json", description: "Output as JSON" }
|
|
6017
|
-
],
|
|
6018
|
-
examples: ["/search", "/search react", "/search --type skill", "/search api --category backend"]
|
|
6019
|
-
}
|
|
6020
|
-
);
|
|
6021
5860
|
registerInteractiveCommand(
|
|
6022
5861
|
"add",
|
|
6023
5862
|
"Add a cognitive from registry, local path, or GitHub",
|
|
@@ -6073,6 +5912,8 @@ registerInteractiveCommand(
|
|
|
6073
5912
|
options["type"] = parts[++i] ?? "";
|
|
6074
5913
|
} else if (part === "--category" || part === "-c") {
|
|
6075
5914
|
options["category"] = parts[++i] ?? "";
|
|
5915
|
+
} else if (part === "--tag") {
|
|
5916
|
+
options["tag"] = parts[++i] ?? "";
|
|
6076
5917
|
} else if (part === "--remote" || part === "-r") {
|
|
6077
5918
|
options["remote"] = true;
|
|
6078
5919
|
} else if (part === "--json") {
|
|
@@ -6086,10 +5927,11 @@ registerInteractiveCommand(
|
|
|
6086
5927
|
options: [
|
|
6087
5928
|
{ flag: "-t, --type <type>", description: "Filter by type (skill, agent, prompt, etc.)" },
|
|
6088
5929
|
{ flag: "-c, --category <cat>", description: "Filter by category" },
|
|
5930
|
+
{ flag: "--tag <tag>", description: "Filter by tag (remote only)" },
|
|
6089
5931
|
{ flag: "-r, --remote", description: "Browse all cognitives in registry" },
|
|
6090
5932
|
{ flag: "--json", description: "Output as JSON" }
|
|
6091
5933
|
],
|
|
6092
|
-
examples: ["/list", "/list --remote", "/list --
|
|
5934
|
+
examples: ["/list", "/list --remote", "/list --remote --category planning", "/list --type skill"]
|
|
6093
5935
|
}
|
|
6094
5936
|
);
|
|
6095
5937
|
registerInteractiveCommand(
|
|
@@ -6298,7 +6140,7 @@ registerInteractiveCommand(
|
|
|
6298
6140
|
registerInteractiveCommand("version", "Show version information", async (_args) => {
|
|
6299
6141
|
const { version: version2 } = await Promise.resolve().then(() => (init_version(), version_exports));
|
|
6300
6142
|
logger.line();
|
|
6301
|
-
logger.log(`${
|
|
6143
|
+
logger.log(`${pc16.bold("SynapSync CLI")} ${pc16.cyan(`v${version2}`)}`);
|
|
6302
6144
|
logger.line();
|
|
6303
6145
|
logger.label("Node.js", process.version);
|
|
6304
6146
|
logger.label("Platform", `${process.platform} ${process.arch}`);
|
|
@@ -6311,7 +6153,7 @@ async function executeCommand(input) {
|
|
|
6311
6153
|
}
|
|
6312
6154
|
if (!trimmed.startsWith("/")) {
|
|
6313
6155
|
showError(`Unknown input. Commands must start with /`);
|
|
6314
|
-
logger.log(`${
|
|
6156
|
+
logger.log(`${pc16.dim("Type")} ${pc16.cyan("/help")} ${pc16.dim("for available commands.")}`);
|
|
6315
6157
|
return;
|
|
6316
6158
|
}
|
|
6317
6159
|
const parts = trimmed.slice(1).split(/\s+/);
|
|
@@ -6323,7 +6165,7 @@ async function executeCommand(input) {
|
|
|
6323
6165
|
const command = COMMANDS[commandName];
|
|
6324
6166
|
if (!command) {
|
|
6325
6167
|
showError(`Unknown command: /${commandName}`);
|
|
6326
|
-
logger.log(`${
|
|
6168
|
+
logger.log(`${pc16.dim("Type")} ${pc16.cyan("/help")} ${pc16.dim("for available commands.")}`);
|
|
6327
6169
|
return;
|
|
6328
6170
|
}
|
|
6329
6171
|
try {
|
|
@@ -6339,13 +6181,13 @@ async function executeCommand(input) {
|
|
|
6339
6181
|
function startInteractiveMode() {
|
|
6340
6182
|
showBanner();
|
|
6341
6183
|
logger.log(
|
|
6342
|
-
`${
|
|
6184
|
+
`${pc16.dim("Type")} ${pc16.cyan("/help")} ${pc16.dim("for commands,")} ${pc16.cyan("/exit")} ${pc16.dim("to quit.")}`
|
|
6343
6185
|
);
|
|
6344
6186
|
logger.line();
|
|
6345
6187
|
const rl = readline.createInterface({
|
|
6346
6188
|
input: process.stdin,
|
|
6347
6189
|
output: process.stdout,
|
|
6348
|
-
prompt: `${
|
|
6190
|
+
prompt: `${pc16.green(CLI_NAME)} ${pc16.dim(">")} `,
|
|
6349
6191
|
terminal: true
|
|
6350
6192
|
});
|
|
6351
6193
|
rl.on("line", (line) => {
|
|
@@ -6371,7 +6213,7 @@ init_version();
|
|
|
6371
6213
|
|
|
6372
6214
|
// src/commands/help.ts
|
|
6373
6215
|
init_esm_shims();
|
|
6374
|
-
import
|
|
6216
|
+
import pc17 from "picocolors";
|
|
6375
6217
|
function registerHelpCommand(program) {
|
|
6376
6218
|
program.command("help [command]").description("Display help for a command").action((commandName) => {
|
|
6377
6219
|
if (commandName) {
|
|
@@ -6381,7 +6223,7 @@ function registerHelpCommand(program) {
|
|
|
6381
6223
|
} else {
|
|
6382
6224
|
logger.error(`Unknown command: ${commandName}`);
|
|
6383
6225
|
logger.line();
|
|
6384
|
-
logger.log(`Run ${
|
|
6226
|
+
logger.log(`Run ${pc17.cyan("synapsync --help")} to see available commands.`);
|
|
6385
6227
|
}
|
|
6386
6228
|
} else {
|
|
6387
6229
|
program.outputHelp();
|
|
@@ -6392,7 +6234,7 @@ function registerHelpCommand(program) {
|
|
|
6392
6234
|
// src/commands/version.ts
|
|
6393
6235
|
init_esm_shims();
|
|
6394
6236
|
init_version();
|
|
6395
|
-
import
|
|
6237
|
+
import pc18 from "picocolors";
|
|
6396
6238
|
var PACKAGE_NAME = "synapsync";
|
|
6397
6239
|
function compareVersions(a, b) {
|
|
6398
6240
|
const partsA = a.split(".").map(Number);
|
|
@@ -6433,12 +6275,12 @@ async function checkForUpdates() {
|
|
|
6433
6275
|
const comparison = compareVersions(version, latestVersion);
|
|
6434
6276
|
if (comparison < 0) {
|
|
6435
6277
|
logger.line();
|
|
6436
|
-
logger.warning(`Update available: ${
|
|
6278
|
+
logger.warning(`Update available: ${pc18.cyan(`v${version}`)} \u2192 ${pc18.green(`v${latestVersion}`)}`);
|
|
6437
6279
|
logger.line();
|
|
6438
|
-
logger.log(` Run ${
|
|
6280
|
+
logger.log(` Run ${pc18.cyan("npm install -g synapsync")} to update`);
|
|
6439
6281
|
} else if (comparison > 0) {
|
|
6440
|
-
logger.info(`You are running a development version (${
|
|
6441
|
-
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}`)}`);
|
|
6442
6284
|
} else {
|
|
6443
6285
|
logger.success("You are using the latest version");
|
|
6444
6286
|
}
|
|
@@ -6446,7 +6288,7 @@ async function checkForUpdates() {
|
|
|
6446
6288
|
function registerVersionCommand(program) {
|
|
6447
6289
|
program.command("version").description("Show detailed version information").option("--check", "Check for available updates").action(async (options) => {
|
|
6448
6290
|
logger.line();
|
|
6449
|
-
logger.log(`${
|
|
6291
|
+
logger.log(`${pc18.bold("SynapSync CLI")} ${pc18.cyan(`v${version}`)}`);
|
|
6450
6292
|
logger.line();
|
|
6451
6293
|
logger.label("Node.js", process.version);
|
|
6452
6294
|
logger.label("Platform", `${process.platform} ${process.arch}`);
|
|
@@ -6473,7 +6315,6 @@ function createCLI() {
|
|
|
6473
6315
|
registerConfigCommand(program);
|
|
6474
6316
|
registerStatusCommand(program);
|
|
6475
6317
|
registerProvidersCommand(program);
|
|
6476
|
-
registerSearchCommand(program);
|
|
6477
6318
|
registerAddCommand(program);
|
|
6478
6319
|
registerListCommand(program);
|
|
6479
6320
|
registerUninstallCommand(program);
|