@synapsync/cli 0.1.9 → 0.1.10
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 +12 -18
- package/dist/index.js +778 -589
- package/dist/index.js.map +1 -1
- package/package.json +15 -15
package/dist/index.js
CHANGED
|
@@ -148,8 +148,13 @@ var REGISTRY_MANIFEST_FILE = "manifest.json";
|
|
|
148
148
|
|
|
149
149
|
// src/ui/repl.ts
|
|
150
150
|
init_esm_shims();
|
|
151
|
-
|
|
152
|
-
|
|
151
|
+
|
|
152
|
+
// src/ui/repl/index.ts
|
|
153
|
+
init_esm_shims();
|
|
154
|
+
|
|
155
|
+
// src/ui/repl/help.ts
|
|
156
|
+
init_esm_shims();
|
|
157
|
+
import pc3 from "picocolors";
|
|
153
158
|
|
|
154
159
|
// src/ui/banner.ts
|
|
155
160
|
init_esm_shims();
|
|
@@ -355,9 +360,124 @@ function showInfo(message) {
|
|
|
355
360
|
logger.info(message);
|
|
356
361
|
}
|
|
357
362
|
|
|
363
|
+
// src/ui/repl/registry.ts
|
|
364
|
+
init_esm_shims();
|
|
365
|
+
var COMMANDS = {};
|
|
366
|
+
function registerInteractiveCommand(name, description, handler, options) {
|
|
367
|
+
const def = { description, handler };
|
|
368
|
+
if (options?.usage !== void 0) def.usage = options.usage;
|
|
369
|
+
if (options?.options !== void 0) def.options = options.options;
|
|
370
|
+
if (options?.examples !== void 0) def.examples = options.examples;
|
|
371
|
+
COMMANDS[name] = def;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
// src/ui/repl/help.ts
|
|
375
|
+
function showCommandHelp(commandName) {
|
|
376
|
+
const cmd = COMMANDS[commandName];
|
|
377
|
+
if (!cmd) {
|
|
378
|
+
showError(`Unknown command: /${commandName}`);
|
|
379
|
+
return;
|
|
380
|
+
}
|
|
381
|
+
logger.line();
|
|
382
|
+
logger.log(pc3.bold(pc3.cyan(` /${commandName}`)) + pc3.dim(` - ${cmd.description}`));
|
|
383
|
+
logger.line();
|
|
384
|
+
if (cmd.usage) {
|
|
385
|
+
logger.log(pc3.bold(" Usage:"));
|
|
386
|
+
logger.log(` ${pc3.cyan(cmd.usage)}`);
|
|
387
|
+
logger.line();
|
|
388
|
+
}
|
|
389
|
+
if (cmd.options && cmd.options.length > 0) {
|
|
390
|
+
logger.log(pc3.bold(" Options:"));
|
|
391
|
+
for (const opt of cmd.options) {
|
|
392
|
+
logger.log(` ${pc3.yellow(opt.flag.padEnd(16))} ${pc3.dim(opt.description)}`);
|
|
393
|
+
}
|
|
394
|
+
logger.line();
|
|
395
|
+
}
|
|
396
|
+
if (cmd.examples && cmd.examples.length > 0) {
|
|
397
|
+
logger.log(pc3.bold(" Examples:"));
|
|
398
|
+
for (const example of cmd.examples) {
|
|
399
|
+
logger.log(` ${pc3.dim("$")} ${pc3.cyan(example)}`);
|
|
400
|
+
}
|
|
401
|
+
logger.line();
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
registerInteractiveCommand(
|
|
405
|
+
"help",
|
|
406
|
+
"Show available commands or help for a specific command",
|
|
407
|
+
(args) => {
|
|
408
|
+
const commandName = args.trim().toLowerCase().replace(/^\//, "");
|
|
409
|
+
if (commandName) {
|
|
410
|
+
showCommandHelp(commandName);
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
logger.line();
|
|
414
|
+
logger.bold(" Available Commands:");
|
|
415
|
+
logger.line();
|
|
416
|
+
logger.log(` ${pc3.cyan("/help [command]")} ${pc3.dim("Show help (or help for a command)")}`);
|
|
417
|
+
logger.log(` ${pc3.cyan("/clear")} ${pc3.dim("Clear the screen")}`);
|
|
418
|
+
logger.log(` ${pc3.cyan("/exit")} ${pc3.dim("Exit interactive mode")}`);
|
|
419
|
+
logger.line();
|
|
420
|
+
const categories = {
|
|
421
|
+
Information: ["info", "version"],
|
|
422
|
+
Project: ["init", "config", "status"],
|
|
423
|
+
Providers: ["providers"],
|
|
424
|
+
Cognitives: ["add", "list", "uninstall"],
|
|
425
|
+
Sync: ["sync"],
|
|
426
|
+
Maintenance: ["update", "doctor", "clean", "purge"]
|
|
427
|
+
};
|
|
428
|
+
for (const [category, cmds] of Object.entries(categories)) {
|
|
429
|
+
const availableCmds = cmds.filter((name) => COMMANDS[name]);
|
|
430
|
+
if (availableCmds.length > 0) {
|
|
431
|
+
logger.bold(` ${category}:`);
|
|
432
|
+
for (const name of availableCmds) {
|
|
433
|
+
const cmd = COMMANDS[name];
|
|
434
|
+
const hasOptions = cmd?.options !== void 0 && cmd.options.length > 0;
|
|
435
|
+
const paddedName = `/${name}`.padEnd(18);
|
|
436
|
+
const optionsHint = hasOptions ? pc3.yellow(" [options]") : "";
|
|
437
|
+
logger.log(` ${pc3.cyan(paddedName)} ${pc3.dim(cmd?.description ?? "")}${optionsHint}`);
|
|
438
|
+
}
|
|
439
|
+
logger.line();
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
logger.hint("Tip: Use /help <command> for detailed help. Example: /help info");
|
|
443
|
+
logger.line();
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
usage: "/help [command]",
|
|
447
|
+
examples: ["/help", "/help info", "/help add"]
|
|
448
|
+
}
|
|
449
|
+
);
|
|
450
|
+
|
|
451
|
+
// src/ui/repl/commands.ts
|
|
452
|
+
init_esm_shims();
|
|
453
|
+
import pc17 from "picocolors";
|
|
454
|
+
|
|
455
|
+
// src/ui/repl/arg-parser.ts
|
|
456
|
+
init_esm_shims();
|
|
457
|
+
function parseArgs(argsString, flagDefs) {
|
|
458
|
+
const parts = argsString.split(/\s+/);
|
|
459
|
+
const positional = [];
|
|
460
|
+
const options = {};
|
|
461
|
+
for (let i = 0; i < parts.length; i++) {
|
|
462
|
+
const part = parts[i];
|
|
463
|
+
if (part === void 0 || part === "") continue;
|
|
464
|
+
const flagDef = flagDefs.find((f) => f.flags.includes(part));
|
|
465
|
+
if (flagDef) {
|
|
466
|
+
if (flagDef.type === "boolean") {
|
|
467
|
+
options[flagDef.key] = true;
|
|
468
|
+
} else {
|
|
469
|
+
options[flagDef.key] = parts[++i] ?? "";
|
|
470
|
+
}
|
|
471
|
+
} else if (!part.startsWith("-")) {
|
|
472
|
+
positional.push(part);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
return { positional, options };
|
|
476
|
+
}
|
|
477
|
+
|
|
358
478
|
// src/commands/info.ts
|
|
359
479
|
init_esm_shims();
|
|
360
|
-
import
|
|
480
|
+
import pc4 from "picocolors";
|
|
361
481
|
var INFO_TOPICS = {
|
|
362
482
|
cognitives: {
|
|
363
483
|
name: "Cognitives",
|
|
@@ -392,11 +512,9 @@ var INFO_TOPICS = {
|
|
|
392
512
|
};
|
|
393
513
|
function showCognitivesInfo() {
|
|
394
514
|
logger.line();
|
|
395
|
-
logger.log(
|
|
515
|
+
logger.log(pc4.bold(pc4.cyan(" Cognitive Types")));
|
|
396
516
|
logger.line();
|
|
397
|
-
logger.dim(
|
|
398
|
-
" SynapSync manages multiple types of AI cognitives that can be installed,"
|
|
399
|
-
);
|
|
517
|
+
logger.dim(" SynapSync manages multiple types of AI cognitives that can be installed,");
|
|
400
518
|
logger.dim(" synced across providers, and shared via the registry.");
|
|
401
519
|
logger.line();
|
|
402
520
|
const cognitives = [
|
|
@@ -404,73 +522,85 @@ function showCognitivesInfo() {
|
|
|
404
522
|
type: "skill",
|
|
405
523
|
file: "SKILL.md",
|
|
406
524
|
description: "Reusable instruction sets for AI assistants",
|
|
407
|
-
color:
|
|
525
|
+
color: pc4.blue
|
|
408
526
|
},
|
|
409
527
|
{
|
|
410
528
|
type: "agent",
|
|
411
529
|
file: "AGENT.md",
|
|
412
530
|
description: "Autonomous AI entities with specific behaviors",
|
|
413
|
-
color:
|
|
531
|
+
color: pc4.yellow
|
|
414
532
|
},
|
|
415
533
|
{
|
|
416
534
|
type: "prompt",
|
|
417
535
|
file: "PROMPT.md",
|
|
418
536
|
description: "Reusable prompt templates with variables",
|
|
419
|
-
color:
|
|
537
|
+
color: pc4.magenta
|
|
420
538
|
},
|
|
421
539
|
{
|
|
422
540
|
type: "workflow",
|
|
423
541
|
file: "WORKFLOW.yaml",
|
|
424
542
|
description: "Multi-step processes combining agents and prompts",
|
|
425
|
-
color:
|
|
543
|
+
color: pc4.green
|
|
426
544
|
},
|
|
427
545
|
{
|
|
428
546
|
type: "tool",
|
|
429
547
|
file: "TOOL.md",
|
|
430
548
|
description: "External integrations and functions",
|
|
431
|
-
color:
|
|
549
|
+
color: pc4.cyan
|
|
432
550
|
}
|
|
433
551
|
];
|
|
434
|
-
logger.log(
|
|
435
|
-
|
|
436
|
-
);
|
|
437
|
-
logger.log(pc3.dim(" " + "\u2500".repeat(70)));
|
|
552
|
+
logger.log(` ${pc4.dim("Type")} ${pc4.dim("File")} ${pc4.dim("Description")}`);
|
|
553
|
+
logger.log(pc4.dim(" " + "\u2500".repeat(70)));
|
|
438
554
|
for (const cognitive of cognitives) {
|
|
439
555
|
const typeCol = cognitive.color(cognitive.type.padEnd(10));
|
|
440
|
-
const fileCol =
|
|
441
|
-
const descCol =
|
|
556
|
+
const fileCol = pc4.white(cognitive.file.padEnd(16));
|
|
557
|
+
const descCol = pc4.dim(cognitive.description);
|
|
442
558
|
logger.log(` ${typeCol} ${fileCol} ${descCol}`);
|
|
443
559
|
}
|
|
444
560
|
logger.line();
|
|
445
|
-
logger.log(
|
|
561
|
+
logger.log(pc4.bold(" Usage Examples:"));
|
|
446
562
|
logger.line();
|
|
447
|
-
logger.log(
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
logger.log(
|
|
563
|
+
logger.log(
|
|
564
|
+
` ${pc4.dim("$")} ${pc4.cyan("synapsync add")} code-reviewer ${pc4.dim("# Add a skill")}`
|
|
565
|
+
);
|
|
566
|
+
logger.log(
|
|
567
|
+
` ${pc4.dim("$")} ${pc4.cyan("synapsync add")} ci-agent ${pc4.dim("# Add an agent")}`
|
|
568
|
+
);
|
|
569
|
+
logger.log(
|
|
570
|
+
` ${pc4.dim("$")} ${pc4.cyan("synapsync list")} --type agent ${pc4.dim("# List only agents")}`
|
|
571
|
+
);
|
|
572
|
+
logger.log(
|
|
573
|
+
` ${pc4.dim("$")} ${pc4.cyan("synapsync sync")} --type skill ${pc4.dim("# Sync only skills")}`
|
|
574
|
+
);
|
|
451
575
|
logger.line();
|
|
452
|
-
logger.log(
|
|
576
|
+
logger.log(pc4.bold(" Storage:"));
|
|
453
577
|
logger.line();
|
|
454
578
|
logger.dim(" Cognitives are stored in .synapsync/{type}s/{category}/{name}/");
|
|
455
579
|
logger.dim(" Example: .synapsync/skills/frontend/react-patterns/SKILL.md");
|
|
456
580
|
logger.line();
|
|
457
|
-
logger.log(
|
|
581
|
+
logger.log(pc4.bold(" Type Detection:"));
|
|
458
582
|
logger.line();
|
|
459
583
|
logger.dim(" When adding, SynapSync detects the cognitive type automatically:");
|
|
460
584
|
logger.line();
|
|
461
|
-
logger.log(
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
logger.log(
|
|
585
|
+
logger.log(
|
|
586
|
+
` ${pc4.cyan("1.")} ${pc4.white("Flag")} ${pc4.dim("--type skill (explicit, highest priority)")}`
|
|
587
|
+
);
|
|
588
|
+
logger.log(
|
|
589
|
+
` ${pc4.cyan("2.")} ${pc4.white("Registry")} ${pc4.dim("Metadata from the registry")}`
|
|
590
|
+
);
|
|
591
|
+
logger.log(
|
|
592
|
+
` ${pc4.cyan("3.")} ${pc4.white("File")} ${pc4.dim("Detects SKILL.md, AGENT.md, etc.")}`
|
|
593
|
+
);
|
|
594
|
+
logger.log(` ${pc4.cyan("4.")} ${pc4.white("Prompt")} ${pc4.dim("Asks you if cannot detect")}`);
|
|
465
595
|
logger.line();
|
|
466
596
|
}
|
|
467
597
|
function showAddInfo() {
|
|
468
598
|
logger.line();
|
|
469
|
-
logger.log(
|
|
599
|
+
logger.log(pc4.bold(pc4.cyan(" Installation Sources")));
|
|
470
600
|
logger.line();
|
|
471
601
|
logger.dim(" SynapSync can add cognitives from multiple sources:");
|
|
472
602
|
logger.line();
|
|
473
|
-
logger.log(
|
|
603
|
+
logger.log(pc4.bold(" Supported Sources:"));
|
|
474
604
|
logger.line();
|
|
475
605
|
const sources = [
|
|
476
606
|
{
|
|
@@ -505,166 +635,222 @@ function showAddInfo() {
|
|
|
505
635
|
}
|
|
506
636
|
];
|
|
507
637
|
for (const src of sources) {
|
|
508
|
-
logger.log(` ${
|
|
509
|
-
logger.log(` ${" ".repeat(14)} ${
|
|
638
|
+
logger.log(` ${pc4.green(src.source.padEnd(14))} ${pc4.dim(src.description)}`);
|
|
639
|
+
logger.log(` ${" ".repeat(14)} ${pc4.cyan(src.format)}`);
|
|
510
640
|
logger.line();
|
|
511
641
|
}
|
|
512
|
-
logger.log(
|
|
642
|
+
logger.log(pc4.bold(" Type Detection:"));
|
|
513
643
|
logger.line();
|
|
514
644
|
logger.dim(" SynapSync automatically detects the cognitive type using:");
|
|
515
645
|
logger.line();
|
|
516
|
-
logger.log(
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
logger.log(
|
|
646
|
+
logger.log(
|
|
647
|
+
` ${pc4.cyan("1.")} ${pc4.white("Explicit flag")} ${pc4.dim("synapsync add code-reviewer --type skill")}`
|
|
648
|
+
);
|
|
649
|
+
logger.log(
|
|
650
|
+
` ${pc4.cyan("2.")} ${pc4.white("Registry lookup")} ${pc4.dim("Registry provides type metadata")}`
|
|
651
|
+
);
|
|
652
|
+
logger.log(
|
|
653
|
+
` ${pc4.cyan("3.")} ${pc4.white("File detection")} ${pc4.dim("Scans for SKILL.md, AGENT.md, etc.")}`
|
|
654
|
+
);
|
|
655
|
+
logger.log(
|
|
656
|
+
` ${pc4.cyan("4.")} ${pc4.white("Interactive")} ${pc4.dim("Prompts you to select if unknown")}`
|
|
657
|
+
);
|
|
520
658
|
logger.line();
|
|
521
|
-
logger.log(
|
|
659
|
+
logger.log(pc4.bold(" Version Specification:"));
|
|
522
660
|
logger.line();
|
|
523
|
-
logger.log(
|
|
524
|
-
|
|
525
|
-
|
|
661
|
+
logger.log(
|
|
662
|
+
` ${pc4.dim("$")} ${pc4.cyan("synapsync add")} code-reviewer ${pc4.dim("# Latest version")}`
|
|
663
|
+
);
|
|
664
|
+
logger.log(
|
|
665
|
+
` ${pc4.dim("$")} ${pc4.cyan("synapsync add")} code-reviewer@1.2.0 ${pc4.dim("# Specific version")}`
|
|
666
|
+
);
|
|
667
|
+
logger.log(
|
|
668
|
+
` ${pc4.dim("$")} ${pc4.cyan("synapsync add")} code-reviewer@^1.0.0 ${pc4.dim("# Version range")}`
|
|
669
|
+
);
|
|
526
670
|
logger.line();
|
|
527
|
-
logger.log(
|
|
671
|
+
logger.log(pc4.bold(" Common Options:"));
|
|
528
672
|
logger.line();
|
|
529
|
-
logger.log(
|
|
530
|
-
|
|
531
|
-
|
|
673
|
+
logger.log(
|
|
674
|
+
` ${pc4.yellow("--type <type>")} ${pc4.dim("Explicit cognitive type (skill, agent, prompt, workflow, tool)")}`
|
|
675
|
+
);
|
|
676
|
+
logger.log(
|
|
677
|
+
` ${pc4.yellow("--category <cat>")} ${pc4.dim("Explicit category (frontend, backend, etc.)")}`
|
|
678
|
+
);
|
|
679
|
+
logger.log(` ${pc4.yellow("--force")} ${pc4.dim("Force reinstall even if exists")}`);
|
|
532
680
|
logger.line();
|
|
533
681
|
}
|
|
534
682
|
function showProvidersInfo() {
|
|
535
683
|
logger.line();
|
|
536
|
-
logger.log(
|
|
684
|
+
logger.log(pc4.bold(pc4.cyan(" Supported Providers")));
|
|
537
685
|
logger.line();
|
|
538
686
|
logger.dim(" SynapSync can sync your cognitives to multiple AI providers.");
|
|
539
687
|
logger.dim(" Each provider has its own directory structure for cognitives.");
|
|
540
688
|
logger.line();
|
|
541
689
|
const providers = [
|
|
542
|
-
{ name: "claude", vendor: "Anthropic", path: ".claude/", color:
|
|
543
|
-
{ name: "openai", vendor: "OpenAI", path: ".openai/", color:
|
|
544
|
-
{ name: "gemini", vendor: "Google", path: ".gemini/", color:
|
|
545
|
-
{ name: "cursor", vendor: "Cursor IDE", path: ".cursor/", color:
|
|
546
|
-
{ name: "windsurf", vendor: "Codeium", path: ".windsurf/", color:
|
|
547
|
-
{ name: "copilot", vendor: "GitHub", path: ".github/", color:
|
|
690
|
+
{ name: "claude", vendor: "Anthropic", path: ".claude/", color: pc4.yellow },
|
|
691
|
+
{ name: "openai", vendor: "OpenAI", path: ".openai/", color: pc4.green },
|
|
692
|
+
{ name: "gemini", vendor: "Google", path: ".gemini/", color: pc4.blue },
|
|
693
|
+
{ name: "cursor", vendor: "Cursor IDE", path: ".cursor/", color: pc4.magenta },
|
|
694
|
+
{ name: "windsurf", vendor: "Codeium", path: ".windsurf/", color: pc4.cyan },
|
|
695
|
+
{ name: "copilot", vendor: "GitHub", path: ".github/", color: pc4.white }
|
|
548
696
|
];
|
|
549
|
-
logger.log(` ${
|
|
550
|
-
logger.log(
|
|
697
|
+
logger.log(` ${pc4.dim("Provider")} ${pc4.dim("Vendor")} ${pc4.dim("Path")}`);
|
|
698
|
+
logger.log(pc4.dim(" " + "\u2500".repeat(45)));
|
|
551
699
|
for (const provider of providers) {
|
|
552
700
|
const nameCol = provider.color(provider.name.padEnd(11));
|
|
553
|
-
const vendorCol =
|
|
554
|
-
const pathCol =
|
|
701
|
+
const vendorCol = pc4.white(provider.vendor.padEnd(12));
|
|
702
|
+
const pathCol = pc4.dim(provider.path);
|
|
555
703
|
logger.log(` ${nameCol} ${vendorCol} ${pathCol}`);
|
|
556
704
|
}
|
|
557
705
|
logger.line();
|
|
558
|
-
logger.log(
|
|
706
|
+
logger.log(pc4.bold(" Usage:"));
|
|
559
707
|
logger.line();
|
|
560
|
-
logger.log(
|
|
561
|
-
|
|
562
|
-
|
|
708
|
+
logger.log(
|
|
709
|
+
` ${pc4.dim("$")} ${pc4.cyan("synapsync connect")} claude ${pc4.dim("# Connect to Claude")}`
|
|
710
|
+
);
|
|
711
|
+
logger.log(
|
|
712
|
+
` ${pc4.dim("$")} ${pc4.cyan("synapsync providers")} ${pc4.dim("# List connected providers")}`
|
|
713
|
+
);
|
|
714
|
+
logger.log(
|
|
715
|
+
` ${pc4.dim("$")} ${pc4.cyan("synapsync sync")} --provider claude ${pc4.dim("# Sync to specific provider")}`
|
|
716
|
+
);
|
|
563
717
|
logger.line();
|
|
564
718
|
}
|
|
565
719
|
function showCategoriesInfo() {
|
|
566
720
|
logger.line();
|
|
567
|
-
logger.log(
|
|
721
|
+
logger.log(pc4.bold(pc4.cyan(" Cognitive Categories")));
|
|
568
722
|
logger.line();
|
|
569
723
|
logger.dim(" Cognitives are organized by category for better management.");
|
|
570
724
|
logger.dim(" Categories help group related cognitives together.");
|
|
571
725
|
logger.line();
|
|
572
726
|
const categories = [
|
|
573
|
-
{
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
{ name: "
|
|
579
|
-
{
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
727
|
+
{
|
|
728
|
+
name: "frontend",
|
|
729
|
+
description: "UI, components, styling, React, Vue, etc.",
|
|
730
|
+
color: pc4.yellow
|
|
731
|
+
},
|
|
732
|
+
{ name: "backend", description: "APIs, servers, authentication, databases", color: pc4.blue },
|
|
733
|
+
{
|
|
734
|
+
name: "database",
|
|
735
|
+
description: "Queries, schemas, migrations, optimization",
|
|
736
|
+
color: pc4.yellow
|
|
737
|
+
},
|
|
738
|
+
{ name: "devops", description: "CI/CD, Docker, Kubernetes, infrastructure", color: pc4.magenta },
|
|
739
|
+
{ name: "security", description: "Audits, vulnerabilities, authentication", color: pc4.red },
|
|
740
|
+
{ name: "testing", description: "Unit tests, E2E, test generation", color: pc4.green },
|
|
741
|
+
{ name: "analytics", description: "Metrics, tracking, data analysis", color: pc4.cyan },
|
|
742
|
+
{ name: "automation", description: "Scripts, workflows, task automation", color: pc4.green },
|
|
743
|
+
{ name: "general", description: "General purpose, code review, docs", color: pc4.white },
|
|
744
|
+
{
|
|
745
|
+
name: "integrations",
|
|
746
|
+
description: "External services (Supabase, Stripe, etc.)",
|
|
747
|
+
color: pc4.blue
|
|
748
|
+
},
|
|
749
|
+
{
|
|
750
|
+
name: "planning",
|
|
751
|
+
description: "Project planning, SDLC, requirements, architecture",
|
|
752
|
+
color: pc4.magenta
|
|
753
|
+
}
|
|
584
754
|
];
|
|
585
|
-
logger.log(` ${
|
|
586
|
-
logger.log(
|
|
755
|
+
logger.log(` ${pc4.dim("Category")} ${pc4.dim("Description")}`);
|
|
756
|
+
logger.log(pc4.dim(" " + "\u2500".repeat(55)));
|
|
587
757
|
for (const cat of categories) {
|
|
588
758
|
const nameCol = cat.color(cat.name.padEnd(13));
|
|
589
|
-
const descCol =
|
|
759
|
+
const descCol = pc4.dim(cat.description);
|
|
590
760
|
logger.log(` ${nameCol} ${descCol}`);
|
|
591
761
|
}
|
|
592
762
|
logger.line();
|
|
593
|
-
logger.log(
|
|
763
|
+
logger.log(pc4.bold(" Usage:"));
|
|
594
764
|
logger.line();
|
|
595
|
-
logger.log(
|
|
596
|
-
|
|
597
|
-
|
|
765
|
+
logger.log(
|
|
766
|
+
` ${pc4.dim("$")} ${pc4.cyan("synapsync add")} react-patterns ${pc4.dim("--category frontend")}`
|
|
767
|
+
);
|
|
768
|
+
logger.log(` ${pc4.dim("$")} ${pc4.cyan("synapsync list")} --category devops`);
|
|
769
|
+
logger.log(` ${pc4.dim("$")} ${pc4.cyan("synapsync list")} --remote --category security`);
|
|
598
770
|
logger.line();
|
|
599
771
|
}
|
|
600
772
|
function showSyncInfo() {
|
|
601
773
|
logger.line();
|
|
602
|
-
logger.log(
|
|
774
|
+
logger.log(pc4.bold(pc4.cyan(" Synchronization")));
|
|
603
775
|
logger.line();
|
|
604
776
|
logger.dim(" Sync copies or links your cognitives to provider directories.");
|
|
605
777
|
logger.dim(" This makes them available to each AI provider.");
|
|
606
778
|
logger.line();
|
|
607
|
-
logger.log(
|
|
779
|
+
logger.log(pc4.bold(" Sync Methods:"));
|
|
608
780
|
logger.line();
|
|
609
|
-
logger.log(` ${
|
|
781
|
+
logger.log(` ${pc4.green("symlink")} ${pc4.dim("(recommended)")}`);
|
|
610
782
|
logger.dim(" Creates symbolic links to the central storage.");
|
|
611
783
|
logger.dim(" Changes reflect immediately in all providers.");
|
|
612
784
|
logger.dim(" Single source of truth, less disk space.");
|
|
613
785
|
logger.line();
|
|
614
|
-
logger.log(` ${
|
|
786
|
+
logger.log(` ${pc4.yellow("copy")}`);
|
|
615
787
|
logger.dim(" Creates independent copies in each provider folder.");
|
|
616
788
|
logger.dim(" Works on systems without symlink support.");
|
|
617
789
|
logger.dim(" Requires re-sync after changes.");
|
|
618
790
|
logger.line();
|
|
619
|
-
logger.log(
|
|
791
|
+
logger.log(pc4.bold(" How it works:"));
|
|
620
792
|
logger.line();
|
|
621
|
-
logger.log(
|
|
622
|
-
logger.log(` ${
|
|
793
|
+
logger.log(pc4.dim(" Central storage:"));
|
|
794
|
+
logger.log(` ${pc4.cyan(".synapsync/skills/frontend/react-patterns/SKILL.md")}`);
|
|
623
795
|
logger.line();
|
|
624
|
-
logger.log(
|
|
625
|
-
logger.log(
|
|
626
|
-
|
|
796
|
+
logger.log(pc4.dim(" After sync (symlink):"));
|
|
797
|
+
logger.log(
|
|
798
|
+
` ${pc4.green(".claude/skills/react-patterns/")} -> ${pc4.dim("../../.synapsync/skills/frontend/react-patterns/")}`
|
|
799
|
+
);
|
|
800
|
+
logger.log(
|
|
801
|
+
` ${pc4.green(".openai/skills/react-patterns/")} -> ${pc4.dim("../../.synapsync/skills/frontend/react-patterns/")}`
|
|
802
|
+
);
|
|
627
803
|
logger.line();
|
|
628
|
-
logger.log(
|
|
804
|
+
logger.log(pc4.bold(" Commands:"));
|
|
629
805
|
logger.line();
|
|
630
|
-
logger.log(
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
logger.log(
|
|
634
|
-
|
|
806
|
+
logger.log(
|
|
807
|
+
` ${pc4.dim("$")} ${pc4.cyan("synapsync sync")} ${pc4.dim("# Sync all cognitives to all providers")}`
|
|
808
|
+
);
|
|
809
|
+
logger.log(
|
|
810
|
+
` ${pc4.dim("$")} ${pc4.cyan("synapsync sync")} --provider claude ${pc4.dim("# Sync to specific provider")}`
|
|
811
|
+
);
|
|
812
|
+
logger.log(
|
|
813
|
+
` ${pc4.dim("$")} ${pc4.cyan("synapsync sync")} --type skill ${pc4.dim("# Sync only skills")}`
|
|
814
|
+
);
|
|
815
|
+
logger.log(
|
|
816
|
+
` ${pc4.dim("$")} ${pc4.cyan("synapsync sync")} --copy ${pc4.dim("# Force copy mode")}`
|
|
817
|
+
);
|
|
818
|
+
logger.log(
|
|
819
|
+
` ${pc4.dim("$")} ${pc4.cyan("synapsync sync")} --dry-run ${pc4.dim("# Preview without changes")}`
|
|
820
|
+
);
|
|
635
821
|
logger.line();
|
|
636
822
|
}
|
|
637
823
|
function showStructureInfo() {
|
|
638
824
|
logger.line();
|
|
639
|
-
logger.log(
|
|
825
|
+
logger.log(pc4.bold(pc4.cyan(" Project Structure")));
|
|
640
826
|
logger.line();
|
|
641
827
|
logger.dim(" After running `synapsync init`, your project will have:");
|
|
642
828
|
logger.line();
|
|
643
829
|
const structure = `
|
|
644
|
-
${
|
|
645
|
-
${
|
|
646
|
-
${
|
|
647
|
-
${
|
|
648
|
-
${
|
|
649
|
-
${
|
|
650
|
-
${
|
|
651
|
-
${
|
|
652
|
-
${
|
|
653
|
-
${
|
|
830
|
+
${pc4.cyan(".synapsync/")} ${pc4.dim("# Central cognitive storage")}
|
|
831
|
+
${pc4.dim("\u251C\u2500\u2500")} ${pc4.white("manifest.json")} ${pc4.dim("# Installed cognitives manifest")}
|
|
832
|
+
${pc4.dim("\u251C\u2500\u2500")} ${pc4.cyan("skills/")} ${pc4.dim("# Skills by category")}
|
|
833
|
+
${pc4.dim("\u2502 \u251C\u2500\u2500")} ${pc4.cyan("frontend/")}
|
|
834
|
+
${pc4.dim("\u2502 \u251C\u2500\u2500")} ${pc4.cyan("backend/")}
|
|
835
|
+
${pc4.dim("\u2502 \u2514\u2500\u2500")} ${pc4.cyan("general/")}
|
|
836
|
+
${pc4.dim("\u251C\u2500\u2500")} ${pc4.cyan("agents/")} ${pc4.dim("# Agents by category")}
|
|
837
|
+
${pc4.dim("\u251C\u2500\u2500")} ${pc4.cyan("prompts/")} ${pc4.dim("# Prompts by category")}
|
|
838
|
+
${pc4.dim("\u251C\u2500\u2500")} ${pc4.cyan("workflows/")} ${pc4.dim("# Workflows by category")}
|
|
839
|
+
${pc4.dim("\u2514\u2500\u2500")} ${pc4.cyan("tools/")} ${pc4.dim("# Tools by category")}
|
|
654
840
|
|
|
655
|
-
${
|
|
841
|
+
${pc4.green("synapsync.config.yaml")} ${pc4.dim("# Project configuration")}
|
|
656
842
|
|
|
657
|
-
${
|
|
658
|
-
${
|
|
659
|
-
${
|
|
660
|
-
${
|
|
843
|
+
${pc4.yellow(".claude/")} ${pc4.dim("# Claude provider (after sync)")}
|
|
844
|
+
${pc4.dim("\u251C\u2500\u2500")} ${pc4.white("skills/")} ${pc4.dim("# Symlinks to .synapsync/skills/*")}
|
|
845
|
+
${pc4.dim("\u251C\u2500\u2500")} ${pc4.white("agents/")} ${pc4.dim("# Symlinks to .synapsync/agents/*")}
|
|
846
|
+
${pc4.dim("\u2514\u2500\u2500")} ${pc4.white("prompts/")} ${pc4.dim("# Symlinks to .synapsync/prompts/*")}
|
|
661
847
|
`;
|
|
662
848
|
logger.log(structure);
|
|
663
849
|
logger.line();
|
|
664
850
|
}
|
|
665
851
|
function showAllTopics() {
|
|
666
852
|
logger.line();
|
|
667
|
-
logger.log(
|
|
853
|
+
logger.log(pc4.bold(pc4.cyan(" SynapSync Info")));
|
|
668
854
|
logger.line();
|
|
669
855
|
logger.dim(" Use /info with a topic flag to learn more:");
|
|
670
856
|
logger.line();
|
|
@@ -677,7 +863,7 @@ function showAllTopics() {
|
|
|
677
863
|
{ flag: "--structure", desc: "Project directory structure" }
|
|
678
864
|
];
|
|
679
865
|
for (const topic of topics) {
|
|
680
|
-
logger.log(` ${
|
|
866
|
+
logger.log(` ${pc4.cyan("/info " + topic.flag.padEnd(14))} ${pc4.dim(topic.desc)}`);
|
|
681
867
|
}
|
|
682
868
|
logger.line();
|
|
683
869
|
logger.dim(" Example: /info --cognitives");
|
|
@@ -728,7 +914,7 @@ init_esm_shims();
|
|
|
728
914
|
import * as fs5 from "fs";
|
|
729
915
|
import * as path6 from "path";
|
|
730
916
|
import * as p from "@clack/prompts";
|
|
731
|
-
import
|
|
917
|
+
import pc5 from "picocolors";
|
|
732
918
|
|
|
733
919
|
// src/services/config/manager.ts
|
|
734
920
|
init_esm_shims();
|
|
@@ -771,7 +957,9 @@ function createDefaultConfig(name, description) {
|
|
|
771
957
|
storage: { ...DEFAULT_STORAGE_CONFIG },
|
|
772
958
|
sync: {
|
|
773
959
|
method: DEFAULT_SYNC_CONFIG.method,
|
|
774
|
-
providers: JSON.parse(
|
|
960
|
+
providers: JSON.parse(
|
|
961
|
+
JSON.stringify(DEFAULT_SYNC_CONFIG.providers)
|
|
962
|
+
)
|
|
775
963
|
}
|
|
776
964
|
};
|
|
777
965
|
if (description !== void 0) {
|
|
@@ -820,7 +1008,10 @@ function validateConfig(config) {
|
|
|
820
1008
|
});
|
|
821
1009
|
}
|
|
822
1010
|
if (typeof value !== "object" || value === null) {
|
|
823
|
-
errors.push({
|
|
1011
|
+
errors.push({
|
|
1012
|
+
path: `sync.providers.${key}`,
|
|
1013
|
+
message: "Provider config must be an object"
|
|
1014
|
+
});
|
|
824
1015
|
}
|
|
825
1016
|
}
|
|
826
1017
|
}
|
|
@@ -1625,7 +1816,12 @@ var AgentsMdGenerator = class {
|
|
|
1625
1816
|
fileName = scannedCognitive.fileName ?? path5.basename(scannedCognitive.filePath);
|
|
1626
1817
|
} else {
|
|
1627
1818
|
const typeDir = `${cognitive.type}s`;
|
|
1628
|
-
const expectedDir = path5.join(
|
|
1819
|
+
const expectedDir = path5.join(
|
|
1820
|
+
this.synapSyncDir,
|
|
1821
|
+
typeDir,
|
|
1822
|
+
cognitive.category,
|
|
1823
|
+
cognitive.name
|
|
1824
|
+
);
|
|
1629
1825
|
relativePath = path5.relative(this.projectRoot, expectedDir);
|
|
1630
1826
|
fileName = cognitive.name;
|
|
1631
1827
|
}
|
|
@@ -1668,7 +1864,9 @@ var AgentsMdGenerator = class {
|
|
|
1668
1864
|
}
|
|
1669
1865
|
lines.push("---");
|
|
1670
1866
|
lines.push("");
|
|
1671
|
-
lines.push(
|
|
1867
|
+
lines.push(
|
|
1868
|
+
`*Last updated: ${(/* @__PURE__ */ new Date()).toISOString()} \xB7 ${entries.length} cognitive${entries.length !== 1 ? "s" : ""} installed*`
|
|
1869
|
+
);
|
|
1672
1870
|
}
|
|
1673
1871
|
lines.push(END_MARKER);
|
|
1674
1872
|
return lines.join("\n");
|
|
@@ -1754,8 +1952,8 @@ async function executeInitCommand(options = {}) {
|
|
|
1754
1952
|
if (ConfigManager.isProjectInitialized(projectRoot)) {
|
|
1755
1953
|
logger.line();
|
|
1756
1954
|
logger.warning("Project already initialized.");
|
|
1757
|
-
logger.log(` ${
|
|
1758
|
-
logger.log(` ${
|
|
1955
|
+
logger.log(` ${pc5.dim("Config:")} ${configPath}`);
|
|
1956
|
+
logger.log(` ${pc5.dim("Storage:")} ${storagePath}`);
|
|
1759
1957
|
logger.line();
|
|
1760
1958
|
logger.hint("Use /config to view or modify settings.");
|
|
1761
1959
|
return null;
|
|
@@ -1768,7 +1966,7 @@ async function executeInitCommand(options = {}) {
|
|
|
1768
1966
|
});
|
|
1769
1967
|
}
|
|
1770
1968
|
logger.line();
|
|
1771
|
-
p.intro(
|
|
1969
|
+
p.intro(pc5.bgCyan(pc5.black(" Initialize SynapSync Project ")));
|
|
1772
1970
|
const result = await p.group(
|
|
1773
1971
|
{
|
|
1774
1972
|
name: () => {
|
|
@@ -1778,7 +1976,7 @@ async function executeInitCommand(options = {}) {
|
|
|
1778
1976
|
placeholder: defaultName,
|
|
1779
1977
|
defaultValue: defaultName,
|
|
1780
1978
|
validate: (value) => {
|
|
1781
|
-
const finalValue = value.trim() === "" ? defaultName : value;
|
|
1979
|
+
const finalValue = (value ?? "").trim() === "" ? defaultName : String(value);
|
|
1782
1980
|
if (!/^[a-z0-9-_]+$/i.test(finalValue)) {
|
|
1783
1981
|
return "Project name can only contain letters, numbers, hyphens, and underscores";
|
|
1784
1982
|
}
|
|
@@ -1912,39 +2110,43 @@ function showSuccessMessage(setup, configPath, storagePath) {
|
|
|
1912
2110
|
logger.line();
|
|
1913
2111
|
p.note(
|
|
1914
2112
|
[
|
|
1915
|
-
`${
|
|
1916
|
-
`${
|
|
2113
|
+
`${pc5.dim("Config:")} ${pc5.cyan(configPath)}`,
|
|
2114
|
+
`${pc5.dim("Storage:")} ${pc5.cyan(storagePath)}`,
|
|
1917
2115
|
"",
|
|
1918
|
-
`${
|
|
2116
|
+
`${pc5.dim("Providers:")} ${setup.providers.map((p2) => pc5.green(p2)).join(", ") || pc5.dim("none")}`
|
|
1919
2117
|
].join("\n"),
|
|
1920
2118
|
`Project "${setup.name}" initialized!`
|
|
1921
2119
|
);
|
|
1922
2120
|
logger.line();
|
|
1923
2121
|
logger.bold(" Next Steps:");
|
|
1924
2122
|
logger.line();
|
|
1925
|
-
logger.log(` ${
|
|
1926
|
-
logger.log(` ${
|
|
2123
|
+
logger.log(` ${pc5.cyan("1.")} Browse available cognitives:`);
|
|
2124
|
+
logger.log(` ${pc5.dim("$")} synapsync list --remote`);
|
|
1927
2125
|
logger.line();
|
|
1928
|
-
logger.log(` ${
|
|
1929
|
-
logger.log(` ${
|
|
1930
|
-
logger.log(` ${
|
|
2126
|
+
logger.log(` ${pc5.cyan("2.")} Add cognitives:`);
|
|
2127
|
+
logger.log(` ${pc5.dim("$")} synapsync add code-reviewer`);
|
|
2128
|
+
logger.log(` ${pc5.dim("$")} synapsync add github:user/my-skill`);
|
|
1931
2129
|
logger.line();
|
|
1932
|
-
p.outro(
|
|
2130
|
+
p.outro(pc5.green("Happy syncing!"));
|
|
1933
2131
|
}
|
|
1934
2132
|
function registerInitCommand(program) {
|
|
1935
|
-
program.command("init").description("Initialize a new SynapSync project").option("-n, --name <name>", "Project name").option("-d, --description <desc>", "Project description").option("-p, --provider <providers...>", "Enable providers (claude, openai, etc.)").option("-y, --yes", "Skip prompts and use defaults").action(
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
2133
|
+
program.command("init").description("Initialize a new SynapSync project").option("-n, --name <name>", "Project name").option("-d, --description <desc>", "Project description").option("-p, --provider <providers...>", "Enable providers (claude, openai, etc.)").option("-y, --yes", "Skip prompts and use defaults").action(
|
|
2134
|
+
async (options) => {
|
|
2135
|
+
await executeInitCommand({
|
|
2136
|
+
...options.name !== void 0 && { name: options.name },
|
|
2137
|
+
...options.description !== void 0 && { description: options.description },
|
|
2138
|
+
...options.provider !== void 0 && {
|
|
2139
|
+
providers: options.provider
|
|
2140
|
+
},
|
|
2141
|
+
...options.yes !== void 0 && { yes: options.yes }
|
|
2142
|
+
});
|
|
2143
|
+
}
|
|
2144
|
+
);
|
|
1943
2145
|
}
|
|
1944
2146
|
|
|
1945
2147
|
// src/commands/config.ts
|
|
1946
2148
|
init_esm_shims();
|
|
1947
|
-
import
|
|
2149
|
+
import pc6 from "picocolors";
|
|
1948
2150
|
function executeConfigCommand(args) {
|
|
1949
2151
|
const options = parseConfigArgs(args);
|
|
1950
2152
|
const configManager = ConfigManager.findConfig();
|
|
@@ -1979,11 +2181,11 @@ function showConfigList(configManager) {
|
|
|
1979
2181
|
groups[group2][key] = value;
|
|
1980
2182
|
}
|
|
1981
2183
|
for (const [group2, values] of Object.entries(groups)) {
|
|
1982
|
-
logger.log(` ${
|
|
2184
|
+
logger.log(` ${pc6.cyan(group2)}:`);
|
|
1983
2185
|
for (const [key, value] of Object.entries(values)) {
|
|
1984
2186
|
const displayKey = key.replace(`${group2}.`, "");
|
|
1985
2187
|
const displayValue = formatValue(value);
|
|
1986
|
-
logger.log(` ${
|
|
2188
|
+
logger.log(` ${pc6.dim(displayKey.padEnd(30))} ${displayValue}`);
|
|
1987
2189
|
}
|
|
1988
2190
|
logger.line();
|
|
1989
2191
|
}
|
|
@@ -2000,11 +2202,11 @@ function showConfigValue(configManager, key) {
|
|
|
2000
2202
|
const value = configManager.get(key);
|
|
2001
2203
|
logger.line();
|
|
2002
2204
|
if (value === void 0) {
|
|
2003
|
-
logger.warning(`Key not found: ${
|
|
2205
|
+
logger.warning(`Key not found: ${pc6.cyan(key)}`);
|
|
2004
2206
|
logger.line();
|
|
2005
2207
|
logger.hint("Use /config list to see all available keys.");
|
|
2006
2208
|
} else {
|
|
2007
|
-
logger.log(` ${
|
|
2209
|
+
logger.log(` ${pc6.cyan(key)} = ${formatValue(value)}`);
|
|
2008
2210
|
}
|
|
2009
2211
|
}
|
|
2010
2212
|
function setConfigValue(configManager, key, value) {
|
|
@@ -2028,9 +2230,9 @@ function setConfigValue(configManager, key, value) {
|
|
|
2028
2230
|
configManager.save();
|
|
2029
2231
|
logger.line();
|
|
2030
2232
|
if (isNewKey) {
|
|
2031
|
-
logger.warning(`Created new key: ${
|
|
2233
|
+
logger.warning(`Created new key: ${pc6.cyan(key)}`);
|
|
2032
2234
|
}
|
|
2033
|
-
logger.success(`${
|
|
2235
|
+
logger.success(`${pc6.cyan(key)} = ${formatValue(parsedValue)}`);
|
|
2034
2236
|
}
|
|
2035
2237
|
function parseConfigArgs(args) {
|
|
2036
2238
|
const parts = args.trim().split(/\s+/);
|
|
@@ -2058,21 +2260,21 @@ function parseConfigArgs(args) {
|
|
|
2058
2260
|
}
|
|
2059
2261
|
function formatValue(value) {
|
|
2060
2262
|
if (value === null || value === void 0) {
|
|
2061
|
-
return
|
|
2263
|
+
return pc6.dim("(not set)");
|
|
2062
2264
|
}
|
|
2063
2265
|
if (typeof value === "boolean") {
|
|
2064
|
-
return value ?
|
|
2266
|
+
return value ? pc6.green("true") : pc6.red("false");
|
|
2065
2267
|
}
|
|
2066
2268
|
if (typeof value === "number") {
|
|
2067
|
-
return
|
|
2269
|
+
return pc6.yellow(String(value));
|
|
2068
2270
|
}
|
|
2069
2271
|
if (typeof value === "string") {
|
|
2070
|
-
return
|
|
2272
|
+
return pc6.white(`"${value}"`);
|
|
2071
2273
|
}
|
|
2072
2274
|
if (Array.isArray(value)) {
|
|
2073
|
-
return
|
|
2275
|
+
return pc6.dim(`[${value.join(", ")}]`);
|
|
2074
2276
|
}
|
|
2075
|
-
return
|
|
2277
|
+
return pc6.dim(JSON.stringify(value));
|
|
2076
2278
|
}
|
|
2077
2279
|
function parseValue(value) {
|
|
2078
2280
|
if (value.toLowerCase() === "true") return true;
|
|
@@ -2101,7 +2303,7 @@ function registerConfigCommand(program) {
|
|
|
2101
2303
|
init_esm_shims();
|
|
2102
2304
|
import * as fs6 from "fs";
|
|
2103
2305
|
import * as path7 from "path";
|
|
2104
|
-
import
|
|
2306
|
+
import pc7 from "picocolors";
|
|
2105
2307
|
function executeStatusCommand(_args = "") {
|
|
2106
2308
|
const status = getProjectStatus();
|
|
2107
2309
|
logger.line();
|
|
@@ -2210,59 +2412,59 @@ function getLastSyncTime(storagePath) {
|
|
|
2210
2412
|
function showNotInitialized() {
|
|
2211
2413
|
logger.bold(" Project Status");
|
|
2212
2414
|
logger.line();
|
|
2213
|
-
logger.log(` ${
|
|
2415
|
+
logger.log(` ${pc7.red("\u25CF")} ${pc7.dim("Not initialized")}`);
|
|
2214
2416
|
logger.line();
|
|
2215
2417
|
logger.hint("Run /init to initialize a SynapSync project.");
|
|
2216
2418
|
}
|
|
2217
2419
|
function showProjectStatus(status) {
|
|
2218
2420
|
logger.bold(` ${status.projectName ?? "SynapSync Project"}`);
|
|
2219
2421
|
logger.line();
|
|
2220
|
-
logger.log(` ${
|
|
2221
|
-
logger.log(` ${
|
|
2422
|
+
logger.log(` ${pc7.green("\u25CF")} ${pc7.dim("Initialized")}`);
|
|
2423
|
+
logger.log(` ${pc7.dim("Root:")} ${status.projectRoot}`);
|
|
2222
2424
|
logger.line();
|
|
2223
2425
|
logger.bold(" Cognitives");
|
|
2224
2426
|
const totalCognitives = Object.values(status.cognitives).reduce((a, b) => a + b, 0);
|
|
2225
2427
|
if (totalCognitives === 0) {
|
|
2226
|
-
logger.log(` ${
|
|
2428
|
+
logger.log(` ${pc7.dim("No cognitives installed")}`);
|
|
2227
2429
|
} else {
|
|
2228
2430
|
for (const type of COGNITIVE_TYPES) {
|
|
2229
2431
|
const count = status.cognitives[type];
|
|
2230
2432
|
if (count > 0) {
|
|
2231
2433
|
const icon = getCognitiveIcon(type);
|
|
2232
|
-
logger.log(` ${icon} ${
|
|
2434
|
+
logger.log(` ${icon} ${pc7.white(count.toString().padStart(3))} ${type}s`);
|
|
2233
2435
|
}
|
|
2234
2436
|
}
|
|
2235
|
-
logger.log(` ${
|
|
2236
|
-
logger.log(` ${
|
|
2437
|
+
logger.log(` ${pc7.dim("\u2500\u2500\u2500")}`);
|
|
2438
|
+
logger.log(` ${pc7.bold(totalCognitives.toString().padStart(5))} total`);
|
|
2237
2439
|
}
|
|
2238
2440
|
logger.line();
|
|
2239
2441
|
logger.bold(" Providers");
|
|
2240
2442
|
const enabledProviders = status.providers.filter((p2) => p2.enabled);
|
|
2241
2443
|
if (enabledProviders.length === 0) {
|
|
2242
|
-
logger.log(` ${
|
|
2444
|
+
logger.log(` ${pc7.dim("No providers enabled")}`);
|
|
2243
2445
|
} else {
|
|
2244
2446
|
for (const provider of enabledProviders) {
|
|
2245
|
-
const icon = provider.cognitivesCount > 0 ?
|
|
2246
|
-
const syncStatus = provider.cognitivesCount > 0 ?
|
|
2247
|
-
logger.log(` ${icon} ${
|
|
2447
|
+
const icon = provider.cognitivesCount > 0 ? pc7.green("\u25CF") : pc7.yellow("\u25CB");
|
|
2448
|
+
const syncStatus = provider.cognitivesCount > 0 ? pc7.dim(`(${provider.cognitivesCount} synced)`) : pc7.dim("(not synced)");
|
|
2449
|
+
logger.log(` ${icon} ${pc7.white(provider.name)} ${syncStatus}`);
|
|
2248
2450
|
}
|
|
2249
2451
|
}
|
|
2250
2452
|
logger.line();
|
|
2251
2453
|
if (status.lastSync !== void 0) {
|
|
2252
2454
|
const syncDate = new Date(status.lastSync);
|
|
2253
2455
|
const relativeTime = getRelativeTime(syncDate);
|
|
2254
|
-
logger.log(` ${
|
|
2456
|
+
logger.log(` ${pc7.dim("Last updated:")} ${relativeTime}`);
|
|
2255
2457
|
logger.line();
|
|
2256
2458
|
}
|
|
2257
2459
|
logger.hint("Run /help for available commands.");
|
|
2258
2460
|
}
|
|
2259
2461
|
function getCognitiveIcon(type) {
|
|
2260
2462
|
const icons = {
|
|
2261
|
-
skill:
|
|
2262
|
-
agent:
|
|
2263
|
-
prompt:
|
|
2264
|
-
workflow:
|
|
2265
|
-
tool:
|
|
2463
|
+
skill: pc7.blue("\u25C6"),
|
|
2464
|
+
agent: pc7.magenta("\u25C6"),
|
|
2465
|
+
prompt: pc7.yellow("\u25C6"),
|
|
2466
|
+
workflow: pc7.cyan("\u25C6"),
|
|
2467
|
+
tool: pc7.green("\u25C6")
|
|
2266
2468
|
};
|
|
2267
2469
|
return icons[type];
|
|
2268
2470
|
}
|
|
@@ -2288,7 +2490,7 @@ function registerStatusCommand(program) {
|
|
|
2288
2490
|
init_esm_shims();
|
|
2289
2491
|
import * as fs7 from "fs";
|
|
2290
2492
|
import * as path8 from "path";
|
|
2291
|
-
import
|
|
2493
|
+
import pc8 from "picocolors";
|
|
2292
2494
|
function executeProvidersCommand(args) {
|
|
2293
2495
|
const parts = args.trim().split(/\s+/);
|
|
2294
2496
|
const subcommand = parts[0]?.toLowerCase() ?? "";
|
|
@@ -2329,21 +2531,21 @@ function listProviders(configManager) {
|
|
|
2329
2531
|
logger.bold(" Providers");
|
|
2330
2532
|
logger.line();
|
|
2331
2533
|
logger.log(
|
|
2332
|
-
` ${
|
|
2534
|
+
` ${pc8.dim("Provider".padEnd(12))} ${pc8.dim("Status".padEnd(10))} ${pc8.dim("Path".padEnd(20))} ${pc8.dim("Directory")}`
|
|
2333
2535
|
);
|
|
2334
|
-
logger.log(` ${
|
|
2536
|
+
logger.log(` ${pc8.dim("\u2500".repeat(60))}`);
|
|
2335
2537
|
for (const provider of providers) {
|
|
2336
|
-
const statusIcon = provider.enabled ?
|
|
2337
|
-
const statusText = provider.enabled ?
|
|
2338
|
-
const pathText =
|
|
2339
|
-
const existsText = provider.exists ?
|
|
2538
|
+
const statusIcon = provider.enabled ? pc8.green("\u25CF") : pc8.dim("\u25CB");
|
|
2539
|
+
const statusText = provider.enabled ? pc8.green("enabled") : pc8.dim("disabled");
|
|
2540
|
+
const pathText = pc8.cyan(provider.path);
|
|
2541
|
+
const existsText = provider.exists ? pc8.green("\u2713 exists") : pc8.dim("\u2717 missing");
|
|
2340
2542
|
logger.log(
|
|
2341
|
-
` ${statusIcon} ${
|
|
2543
|
+
` ${statusIcon} ${pc8.white(provider.name.padEnd(10))} ${statusText.padEnd(19)} ${pathText.padEnd(29)} ${existsText}`
|
|
2342
2544
|
);
|
|
2343
2545
|
}
|
|
2344
2546
|
logger.line();
|
|
2345
2547
|
const enabledCount = providers.filter((p2) => p2.enabled).length;
|
|
2346
|
-
logger.log(` ${
|
|
2548
|
+
logger.log(` ${pc8.dim("Enabled:")} ${enabledCount} of ${providers.length} providers`);
|
|
2347
2549
|
logger.line();
|
|
2348
2550
|
logger.hint("Use /providers enable <name> or /providers disable <name>");
|
|
2349
2551
|
}
|
|
@@ -2376,8 +2578,8 @@ function enableProvider(configManager, providerName) {
|
|
|
2376
2578
|
}
|
|
2377
2579
|
configManager.save();
|
|
2378
2580
|
logger.line();
|
|
2379
|
-
logger.success(`Provider '${
|
|
2380
|
-
logger.log(` ${
|
|
2581
|
+
logger.success(`Provider '${pc8.cyan(provider)}' enabled`);
|
|
2582
|
+
logger.log(` ${pc8.dim("Path:")} ${defaultPaths.skill.split("/")[0]}/`);
|
|
2381
2583
|
logger.line();
|
|
2382
2584
|
logger.hint("Run /sync to synchronize cognitives to this provider.");
|
|
2383
2585
|
}
|
|
@@ -2404,7 +2606,7 @@ function disableProvider(configManager, providerName) {
|
|
|
2404
2606
|
configManager.set(`sync.providers.${provider}.enabled`, false);
|
|
2405
2607
|
configManager.save();
|
|
2406
2608
|
logger.line();
|
|
2407
|
-
logger.success(`Provider '${
|
|
2609
|
+
logger.success(`Provider '${pc8.cyan(provider)}' disabled`);
|
|
2408
2610
|
}
|
|
2409
2611
|
function setProviderPath(configManager, providerName, newPath) {
|
|
2410
2612
|
if (providerName === void 0 || providerName === "") {
|
|
@@ -2434,8 +2636,8 @@ function setProviderPath(configManager, providerName, newPath) {
|
|
|
2434
2636
|
}
|
|
2435
2637
|
configManager.save();
|
|
2436
2638
|
logger.line();
|
|
2437
|
-
logger.success(`Updated paths for '${
|
|
2438
|
-
logger.log(` ${
|
|
2639
|
+
logger.success(`Updated paths for '${pc8.cyan(provider)}'`);
|
|
2640
|
+
logger.log(` ${pc8.dim("Base path:")} ${pc8.cyan(normalizedPath)}`);
|
|
2439
2641
|
logger.line();
|
|
2440
2642
|
}
|
|
2441
2643
|
function showProviderInfo(configManager, provider) {
|
|
@@ -2447,18 +2649,18 @@ function showProviderInfo(configManager, provider) {
|
|
|
2447
2649
|
logger.line();
|
|
2448
2650
|
logger.bold(` ${getProviderDisplayName(provider)}`);
|
|
2449
2651
|
logger.line();
|
|
2450
|
-
const statusIcon = enabled ?
|
|
2451
|
-
const statusText = enabled ?
|
|
2452
|
-
logger.log(` ${
|
|
2652
|
+
const statusIcon = enabled ? pc8.green("\u25CF") : pc8.dim("\u25CB");
|
|
2653
|
+
const statusText = enabled ? pc8.green("Enabled") : pc8.dim("Disabled");
|
|
2654
|
+
logger.log(` ${pc8.dim("Status:")} ${statusIcon} ${statusText}`);
|
|
2453
2655
|
logger.line();
|
|
2454
|
-
logger.log(` ${
|
|
2656
|
+
logger.log(` ${pc8.dim("Paths:")}`);
|
|
2455
2657
|
const cognitiveTypes = ["skill", "agent", "prompt", "workflow", "tool"];
|
|
2456
2658
|
for (const type of cognitiveTypes) {
|
|
2457
2659
|
const typePath = paths[type] ?? "";
|
|
2458
2660
|
const fullPath = path8.join(projectRoot, typePath);
|
|
2459
2661
|
const exists = fs7.existsSync(fullPath);
|
|
2460
|
-
const existsIcon = exists ?
|
|
2461
|
-
logger.log(` ${
|
|
2662
|
+
const existsIcon = exists ? pc8.green("\u2713") : pc8.dim("\u2717");
|
|
2663
|
+
logger.log(` ${pc8.dim(type.padEnd(10))} ${pc8.cyan(typePath)} ${existsIcon}`);
|
|
2462
2664
|
}
|
|
2463
2665
|
logger.line();
|
|
2464
2666
|
}
|
|
@@ -2515,7 +2717,7 @@ function registerProvidersCommand(program) {
|
|
|
2515
2717
|
init_esm_shims();
|
|
2516
2718
|
import * as fs9 from "fs";
|
|
2517
2719
|
import * as path11 from "path";
|
|
2518
|
-
import
|
|
2720
|
+
import pc9 from "picocolors";
|
|
2519
2721
|
|
|
2520
2722
|
// src/services/registry/client.ts
|
|
2521
2723
|
init_esm_shims();
|
|
@@ -2542,7 +2744,10 @@ var RegistryClient = class {
|
|
|
2542
2744
|
const url = `${this.baseUrl}/${REGISTRY_INDEX_FILE}`;
|
|
2543
2745
|
const response = await this.fetch(url);
|
|
2544
2746
|
if (!response.ok) {
|
|
2545
|
-
throw new RegistryError(
|
|
2747
|
+
throw new RegistryError(
|
|
2748
|
+
`Failed to fetch registry index: ${response.status} ${response.statusText}`,
|
|
2749
|
+
url
|
|
2750
|
+
);
|
|
2546
2751
|
}
|
|
2547
2752
|
const index = await response.json();
|
|
2548
2753
|
this.indexCache = index;
|
|
@@ -3418,6 +3623,13 @@ var SyncEngine = class {
|
|
|
3418
3623
|
};
|
|
3419
3624
|
|
|
3420
3625
|
// src/commands/add.ts
|
|
3626
|
+
var GitHubInstallError = class extends Error {
|
|
3627
|
+
constructor(message, repoUrl) {
|
|
3628
|
+
super(message);
|
|
3629
|
+
this.repoUrl = repoUrl;
|
|
3630
|
+
this.name = "GitHubInstallError";
|
|
3631
|
+
}
|
|
3632
|
+
};
|
|
3421
3633
|
async function executeAddCommand(source, options) {
|
|
3422
3634
|
logger.line();
|
|
3423
3635
|
const configManager = ConfigManager.findConfig();
|
|
@@ -3427,7 +3639,7 @@ async function executeAddCommand(source, options) {
|
|
|
3427
3639
|
return;
|
|
3428
3640
|
}
|
|
3429
3641
|
const parsedSource = parseSource(source);
|
|
3430
|
-
logger.log(` ${
|
|
3642
|
+
logger.log(` ${pc9.dim(`Installing from ${parsedSource.type}...`)}`);
|
|
3431
3643
|
let success = false;
|
|
3432
3644
|
try {
|
|
3433
3645
|
switch (parsedSource.type) {
|
|
@@ -3440,11 +3652,11 @@ async function executeAddCommand(source, options) {
|
|
|
3440
3652
|
}
|
|
3441
3653
|
break;
|
|
3442
3654
|
case "github":
|
|
3443
|
-
success = installFromGitHub(parsedSource, options, configManager);
|
|
3655
|
+
success = await installFromGitHub(parsedSource, options, configManager);
|
|
3444
3656
|
break;
|
|
3445
3657
|
}
|
|
3446
3658
|
if (success) {
|
|
3447
|
-
logger.log(` ${
|
|
3659
|
+
logger.log(` ${pc9.dim("Syncing to providers...")}`);
|
|
3448
3660
|
const synapSyncDir = configManager.getSynapSyncDir();
|
|
3449
3661
|
const projectRoot = configManager.getProjectRoot();
|
|
3450
3662
|
const config = configManager.getConfig();
|
|
@@ -3455,9 +3667,9 @@ async function executeAddCommand(source, options) {
|
|
|
3455
3667
|
const created = pr.created.filter((c) => c.success).length;
|
|
3456
3668
|
const skipped = pr.skipped.length;
|
|
3457
3669
|
if (created > 0) {
|
|
3458
|
-
logger.log(` ${
|
|
3670
|
+
logger.log(` ${pc9.green("\u2713")} Synced to ${pr.provider} (${created} created)`);
|
|
3459
3671
|
} else if (skipped > 0) {
|
|
3460
|
-
logger.log(` ${
|
|
3672
|
+
logger.log(` ${pc9.green("\u2713")} Synced to ${pr.provider} (already up to date)`);
|
|
3461
3673
|
}
|
|
3462
3674
|
}
|
|
3463
3675
|
}
|
|
@@ -3469,6 +3681,9 @@ async function executeAddCommand(source, options) {
|
|
|
3469
3681
|
if (error instanceof CognitiveNotFoundError) {
|
|
3470
3682
|
logger.error(`Cognitive '${error.cognitiveName}' not found in registry.`);
|
|
3471
3683
|
logger.hint("Run synapsync list --remote to browse available cognitives.");
|
|
3684
|
+
} else if (error instanceof GitHubInstallError) {
|
|
3685
|
+
logger.error(`GitHub install failed: ${error.message}`);
|
|
3686
|
+
logger.hint(`Repository: ${error.repoUrl}`);
|
|
3472
3687
|
} else if (error instanceof RegistryError) {
|
|
3473
3688
|
logger.error(`Registry error: ${error.message}`);
|
|
3474
3689
|
} else if (error instanceof Error) {
|
|
@@ -3529,20 +3744,19 @@ async function installFromRegistry(name, options, configManager) {
|
|
|
3529
3744
|
saveCognitive(targetDir, manifest, downloaded.content, assets);
|
|
3530
3745
|
updateProjectManifest(configManager, manifest, "registry");
|
|
3531
3746
|
logger.line();
|
|
3532
|
-
logger.log(
|
|
3533
|
-
|
|
3534
|
-
|
|
3535
|
-
logger.log(` ${
|
|
3747
|
+
logger.log(
|
|
3748
|
+
` ${pc9.green("\u2713")} Installed ${pc9.bold(manifest.name)} ${pc9.dim(`v${manifest.version}`)}`
|
|
3749
|
+
);
|
|
3750
|
+
logger.log(` ${pc9.dim("Type:")} ${manifest.type}`);
|
|
3751
|
+
logger.log(` ${pc9.dim("Category:")} ${category}`);
|
|
3752
|
+
logger.log(` ${pc9.dim("Location:")} ${path11.relative(process.cwd(), targetDir)}`);
|
|
3536
3753
|
return true;
|
|
3537
3754
|
}
|
|
3538
3755
|
async function downloadAssets(client, name, _manifest) {
|
|
3539
3756
|
const assets = /* @__PURE__ */ new Map();
|
|
3540
3757
|
const entry = await client.findByName(name);
|
|
3541
3758
|
if (entry === null) return assets;
|
|
3542
|
-
const assetFiles = [
|
|
3543
|
-
"assets/SKILL-TEMPLATE-BASIC.md",
|
|
3544
|
-
"assets/SKILL-TEMPLATE-ADVANCED.md"
|
|
3545
|
-
];
|
|
3759
|
+
const assetFiles = ["assets/SKILL-TEMPLATE-BASIC.md", "assets/SKILL-TEMPLATE-ADVANCED.md"];
|
|
3546
3760
|
for (const assetPath of assetFiles) {
|
|
3547
3761
|
try {
|
|
3548
3762
|
const content = await client.downloadAsset(entry, assetPath);
|
|
@@ -3559,9 +3773,7 @@ function installFromLocal(sourcePath, options, configManager) {
|
|
|
3559
3773
|
}
|
|
3560
3774
|
const detected = detectCognitiveType(absolutePath);
|
|
3561
3775
|
if (detected === null && options.type === void 0) {
|
|
3562
|
-
throw new Error(
|
|
3563
|
-
"Could not detect cognitive type. Please specify with --type flag."
|
|
3564
|
-
);
|
|
3776
|
+
throw new Error("Could not detect cognitive type. Please specify with --type flag.");
|
|
3565
3777
|
}
|
|
3566
3778
|
const cognitiveType = options.type ?? detected?.type ?? "skill";
|
|
3567
3779
|
const fileName = detected?.fileName ?? COGNITIVE_FILE_NAMES[cognitiveType];
|
|
@@ -3607,11 +3819,11 @@ function installFromLocal(sourcePath, options, configManager) {
|
|
|
3607
3819
|
saveCognitive(targetDir, manifest, content, assets);
|
|
3608
3820
|
updateProjectManifest(configManager, manifest, "local");
|
|
3609
3821
|
logger.line();
|
|
3610
|
-
logger.log(` ${
|
|
3611
|
-
logger.log(` ${
|
|
3612
|
-
logger.log(` ${
|
|
3613
|
-
logger.log(` ${
|
|
3614
|
-
logger.log(` ${
|
|
3822
|
+
logger.log(` ${pc9.green("\u2713")} Installed ${pc9.bold(name)} ${pc9.dim(`v${manifest.version}`)}`);
|
|
3823
|
+
logger.log(` ${pc9.dim("Type:")} ${cognitiveType}`);
|
|
3824
|
+
logger.log(` ${pc9.dim("Category:")} ${category}`);
|
|
3825
|
+
logger.log(` ${pc9.dim("Source:")} local`);
|
|
3826
|
+
logger.log(` ${pc9.dim("Location:")} ${path11.relative(process.cwd(), targetDir)}`);
|
|
3615
3827
|
return true;
|
|
3616
3828
|
}
|
|
3617
3829
|
function detectCognitiveType(dirPath) {
|
|
@@ -3666,11 +3878,116 @@ function parseMetadata(content) {
|
|
|
3666
3878
|
return {};
|
|
3667
3879
|
}
|
|
3668
3880
|
}
|
|
3669
|
-
function
|
|
3881
|
+
function parseGitHubUrl(url) {
|
|
3882
|
+
const parts = url.replace("https://github.com/", "").split("/");
|
|
3883
|
+
const owner = parts[0];
|
|
3884
|
+
const repo = parts[1];
|
|
3885
|
+
if (!owner || !repo) return null;
|
|
3886
|
+
const subpath = parts.slice(2).join("/");
|
|
3887
|
+
return { owner, repo, subpath };
|
|
3888
|
+
}
|
|
3889
|
+
async function fetchGitHubFile(owner, repo, branch, filePath) {
|
|
3890
|
+
const url = `https://raw.githubusercontent.com/${owner}/${repo}/${branch}/${filePath}`;
|
|
3891
|
+
try {
|
|
3892
|
+
const response = await fetch(url, { headers: { "User-Agent": "SynapSync-CLI" } });
|
|
3893
|
+
if (!response.ok) return null;
|
|
3894
|
+
return response.text();
|
|
3895
|
+
} catch {
|
|
3896
|
+
return null;
|
|
3897
|
+
}
|
|
3898
|
+
}
|
|
3899
|
+
async function installFromGitHub(source, options, configManager) {
|
|
3900
|
+
const repoUrl = source.url ?? "";
|
|
3901
|
+
const branch = source.branch ?? "main";
|
|
3902
|
+
const parsed = parseGitHubUrl(repoUrl);
|
|
3903
|
+
if (!parsed) {
|
|
3904
|
+
throw new GitHubInstallError("Invalid GitHub URL format.", repoUrl);
|
|
3905
|
+
}
|
|
3906
|
+
const { owner, repo, subpath } = parsed;
|
|
3907
|
+
const basePath = subpath ? `${subpath}/` : "";
|
|
3908
|
+
const manifestContent = await fetchGitHubFile(owner, repo, branch, `${basePath}manifest.json`);
|
|
3909
|
+
let manifest;
|
|
3910
|
+
let content;
|
|
3911
|
+
if (manifestContent) {
|
|
3912
|
+
try {
|
|
3913
|
+
manifest = JSON.parse(manifestContent);
|
|
3914
|
+
} catch {
|
|
3915
|
+
throw new GitHubInstallError("Invalid manifest.json in repository.", repoUrl);
|
|
3916
|
+
}
|
|
3917
|
+
const mainFile = await fetchGitHubFile(owner, repo, branch, `${basePath}${manifest.file}`);
|
|
3918
|
+
if (!mainFile) {
|
|
3919
|
+
throw new GitHubInstallError(
|
|
3920
|
+
`Main file '${manifest.file}' referenced in manifest.json not found.`,
|
|
3921
|
+
repoUrl
|
|
3922
|
+
);
|
|
3923
|
+
}
|
|
3924
|
+
content = mainFile;
|
|
3925
|
+
} else {
|
|
3926
|
+
let foundType = null;
|
|
3927
|
+
let foundFileName = null;
|
|
3928
|
+
let foundContent = null;
|
|
3929
|
+
for (const type of COGNITIVE_TYPES) {
|
|
3930
|
+
const fileName = COGNITIVE_FILE_NAMES[type];
|
|
3931
|
+
const fileContent = await fetchGitHubFile(owner, repo, branch, `${basePath}${fileName}`);
|
|
3932
|
+
if (fileContent) {
|
|
3933
|
+
foundType = type;
|
|
3934
|
+
foundFileName = fileName;
|
|
3935
|
+
foundContent = fileContent;
|
|
3936
|
+
break;
|
|
3937
|
+
}
|
|
3938
|
+
}
|
|
3939
|
+
if (!foundType || !foundFileName || !foundContent) {
|
|
3940
|
+
throw new GitHubInstallError(
|
|
3941
|
+
"No cognitive file found in repository. Expected SKILL.md, AGENT.md, PROMPT.md, WORKFLOW.yaml, or TOOL.md.",
|
|
3942
|
+
repoUrl
|
|
3943
|
+
);
|
|
3944
|
+
}
|
|
3945
|
+
content = foundContent;
|
|
3946
|
+
const metadata = parseMetadata(content);
|
|
3947
|
+
const cognitiveType = options.type ?? foundType;
|
|
3948
|
+
const name = metadata["name"] ?? source.name;
|
|
3949
|
+
const category2 = options.category ?? metadata["category"] ?? "general";
|
|
3950
|
+
manifest = {
|
|
3951
|
+
name,
|
|
3952
|
+
type: cognitiveType,
|
|
3953
|
+
version: metadata["version"] ?? "1.0.0",
|
|
3954
|
+
description: metadata["description"] ?? "",
|
|
3955
|
+
author: metadata["author"] ?? `${owner}`,
|
|
3956
|
+
license: metadata["license"] ?? "MIT",
|
|
3957
|
+
category: category2,
|
|
3958
|
+
tags: metadata["tags"] ?? [],
|
|
3959
|
+
providers: metadata["providers"] ?? [],
|
|
3960
|
+
file: foundFileName,
|
|
3961
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3962
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
3963
|
+
};
|
|
3964
|
+
}
|
|
3965
|
+
if (options.type) {
|
|
3966
|
+
manifest.type = options.type;
|
|
3967
|
+
}
|
|
3968
|
+
if (options.category) {
|
|
3969
|
+
manifest.category = options.category;
|
|
3970
|
+
}
|
|
3971
|
+
const category = manifest.category;
|
|
3972
|
+
const targetDir = getTargetDir(configManager, manifest.type, category, manifest.name);
|
|
3973
|
+
if (fs9.existsSync(targetDir) && options.force !== true) {
|
|
3974
|
+
logger.line();
|
|
3975
|
+
logger.error(`Cognitive '${manifest.name}' is already installed.`);
|
|
3976
|
+
logger.hint("Use --force to overwrite.");
|
|
3977
|
+
return false;
|
|
3978
|
+
}
|
|
3979
|
+
const assets = /* @__PURE__ */ new Map();
|
|
3980
|
+
saveCognitive(targetDir, manifest, content, assets);
|
|
3981
|
+
updateProjectManifest(configManager, manifest, "github", repoUrl);
|
|
3670
3982
|
logger.line();
|
|
3671
|
-
logger.
|
|
3672
|
-
|
|
3673
|
-
|
|
3983
|
+
logger.log(
|
|
3984
|
+
` ${pc9.green("\u2713")} Installed ${pc9.bold(manifest.name)} ${pc9.dim(`v${manifest.version}`)}`
|
|
3985
|
+
);
|
|
3986
|
+
logger.log(` ${pc9.dim("Type:")} ${manifest.type}`);
|
|
3987
|
+
logger.log(` ${pc9.dim("Category:")} ${category}`);
|
|
3988
|
+
logger.log(` ${pc9.dim("Source:")} github`);
|
|
3989
|
+
logger.log(` ${pc9.dim("Location:")} ${path11.relative(process.cwd(), targetDir)}`);
|
|
3990
|
+
return true;
|
|
3674
3991
|
}
|
|
3675
3992
|
function getTargetDir(configManager, type, category, name) {
|
|
3676
3993
|
const synapSyncDir = configManager.getSynapSyncDir();
|
|
@@ -3687,7 +4004,7 @@ function saveCognitive(targetDir, manifest, content, assets) {
|
|
|
3687
4004
|
fs9.writeFileSync(fullPath, assetContent, "utf-8");
|
|
3688
4005
|
}
|
|
3689
4006
|
}
|
|
3690
|
-
function updateProjectManifest(configManager, manifest, source) {
|
|
4007
|
+
function updateProjectManifest(configManager, manifest, source, sourceUrl) {
|
|
3691
4008
|
const synapSyncDir = configManager.getSynapSyncDir();
|
|
3692
4009
|
const manifestPath = path11.join(synapSyncDir, "manifest.json");
|
|
3693
4010
|
let projectManifest;
|
|
@@ -3711,7 +4028,9 @@ function updateProjectManifest(configManager, manifest, source) {
|
|
|
3711
4028
|
installedAt: /* @__PURE__ */ new Date(),
|
|
3712
4029
|
source: mappedSource
|
|
3713
4030
|
};
|
|
3714
|
-
if (
|
|
4031
|
+
if (sourceUrl) {
|
|
4032
|
+
entry.sourceUrl = sourceUrl;
|
|
4033
|
+
} else if (source === "registry") {
|
|
3715
4034
|
entry.sourceUrl = "https://github.com/SynapSync/synapse-registry";
|
|
3716
4035
|
}
|
|
3717
4036
|
projectManifest.cognitives[manifest.name] = entry;
|
|
@@ -3728,7 +4047,7 @@ function registerAddCommand(program) {
|
|
|
3728
4047
|
init_esm_shims();
|
|
3729
4048
|
import * as fs10 from "fs";
|
|
3730
4049
|
import * as path12 from "path";
|
|
3731
|
-
import
|
|
4050
|
+
import pc10 from "picocolors";
|
|
3732
4051
|
async function executeListCommand(options) {
|
|
3733
4052
|
logger.line();
|
|
3734
4053
|
if (options.remote === true) {
|
|
@@ -3756,7 +4075,7 @@ async function executeListCommand(options) {
|
|
|
3756
4075
|
}
|
|
3757
4076
|
async function listRemoteCognitives(options) {
|
|
3758
4077
|
const client = new RegistryClient();
|
|
3759
|
-
logger.log(` ${
|
|
4078
|
+
logger.log(` ${pc10.dim("Fetching registry...")}`);
|
|
3760
4079
|
try {
|
|
3761
4080
|
const cognitives = await client.list();
|
|
3762
4081
|
const validatedOptions = validateOptions(options);
|
|
@@ -3770,7 +4089,9 @@ async function listRemoteCognitives(options) {
|
|
|
3770
4089
|
}
|
|
3771
4090
|
displayRemoteCognitives(filtered);
|
|
3772
4091
|
} catch (error) {
|
|
3773
|
-
logger.error(
|
|
4092
|
+
logger.error(
|
|
4093
|
+
`Failed to fetch registry: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
4094
|
+
);
|
|
3774
4095
|
}
|
|
3775
4096
|
}
|
|
3776
4097
|
function filterRemoteCognitives(cognitives, options) {
|
|
@@ -3795,7 +4116,7 @@ function displayRemoteCognitives(cognitives) {
|
|
|
3795
4116
|
logger.bold(" Available Cognitives (Registry)");
|
|
3796
4117
|
logger.line();
|
|
3797
4118
|
if (cognitives.length === 0) {
|
|
3798
|
-
logger.log(` ${
|
|
4119
|
+
logger.log(` ${pc10.dim("No cognitives found in registry.")}`);
|
|
3799
4120
|
return;
|
|
3800
4121
|
}
|
|
3801
4122
|
const grouped = {};
|
|
@@ -3806,28 +4127,32 @@ function displayRemoteCognitives(cognitives) {
|
|
|
3806
4127
|
for (const [type, items] of Object.entries(grouped)) {
|
|
3807
4128
|
const typeIcon = getCognitiveIcon2(type);
|
|
3808
4129
|
const typeLabel = `${type}s`;
|
|
3809
|
-
logger.log(
|
|
4130
|
+
logger.log(
|
|
4131
|
+
` ${typeIcon} ${pc10.bold(typeLabel.charAt(0).toUpperCase() + typeLabel.slice(1))} (${items.length})`
|
|
4132
|
+
);
|
|
3810
4133
|
logger.line();
|
|
3811
4134
|
for (const cognitive of items) {
|
|
3812
|
-
logger.log(` ${
|
|
4135
|
+
logger.log(` ${pc10.white(cognitive.name)} ${pc10.dim(`v${cognitive.version}`)}`);
|
|
3813
4136
|
if (cognitive.description) {
|
|
3814
4137
|
const desc = cognitive.description.length > 60 ? cognitive.description.slice(0, 57) + "..." : cognitive.description;
|
|
3815
|
-
logger.log(` ${
|
|
4138
|
+
logger.log(` ${pc10.dim(desc)}`);
|
|
3816
4139
|
}
|
|
3817
4140
|
const details = [];
|
|
3818
|
-
details.push(
|
|
4141
|
+
details.push(pc10.dim(cognitive.category));
|
|
3819
4142
|
if (cognitive.author) {
|
|
3820
|
-
details.push(
|
|
4143
|
+
details.push(pc10.dim(`by ${cognitive.author}`));
|
|
3821
4144
|
}
|
|
3822
4145
|
logger.log(` ${details.join(" \xB7 ")}`);
|
|
3823
4146
|
if (cognitive.tags !== void 0 && cognitive.tags.length > 0) {
|
|
3824
4147
|
const tagsStr = cognitive.tags.slice(0, 5).join(" ");
|
|
3825
|
-
logger.log(` ${
|
|
4148
|
+
logger.log(` ${pc10.cyan(tagsStr)}`);
|
|
3826
4149
|
}
|
|
3827
4150
|
logger.line();
|
|
3828
4151
|
}
|
|
3829
4152
|
}
|
|
3830
|
-
logger.log(
|
|
4153
|
+
logger.log(
|
|
4154
|
+
` ${pc10.dim(`Total: ${cognitives.length} cognitive${cognitives.length === 1 ? "" : "s"} available`)}`
|
|
4155
|
+
);
|
|
3831
4156
|
logger.line();
|
|
3832
4157
|
logger.hint("Run synapsync add <name> to add a cognitive.");
|
|
3833
4158
|
}
|
|
@@ -3895,11 +4220,11 @@ function displayCognitives(manifest, options) {
|
|
|
3895
4220
|
logger.line();
|
|
3896
4221
|
if (filtered.length === 0) {
|
|
3897
4222
|
if (cognitives.length === 0) {
|
|
3898
|
-
logger.log(` ${
|
|
4223
|
+
logger.log(` ${pc10.dim("No cognitives installed yet.")}`);
|
|
3899
4224
|
logger.line();
|
|
3900
4225
|
logger.hint("Run synapsync list --remote to browse available cognitives.");
|
|
3901
4226
|
} else {
|
|
3902
|
-
logger.log(` ${
|
|
4227
|
+
logger.log(` ${pc10.dim("No cognitives match the specified filters.")}`);
|
|
3903
4228
|
logger.line();
|
|
3904
4229
|
logger.hint("Try removing filters to see all installed cognitives.");
|
|
3905
4230
|
}
|
|
@@ -3909,14 +4234,18 @@ function displayCognitives(manifest, options) {
|
|
|
3909
4234
|
for (const [type, items] of Object.entries(grouped)) {
|
|
3910
4235
|
const typeIcon = getCognitiveIcon2(type);
|
|
3911
4236
|
const typeLabel = `${type}s`;
|
|
3912
|
-
logger.log(
|
|
4237
|
+
logger.log(
|
|
4238
|
+
` ${typeIcon} ${pc10.bold(typeLabel.charAt(0).toUpperCase() + typeLabel.slice(1))} (${items.length})`
|
|
4239
|
+
);
|
|
3913
4240
|
logger.line();
|
|
3914
4241
|
for (const cognitive of items) {
|
|
3915
4242
|
displayCognitive(cognitive);
|
|
3916
4243
|
}
|
|
3917
4244
|
}
|
|
3918
4245
|
logger.line();
|
|
3919
|
-
logger.log(
|
|
4246
|
+
logger.log(
|
|
4247
|
+
` ${pc10.dim(`Total: ${filtered.length} cognitive${filtered.length === 1 ? "" : "s"}`)}`
|
|
4248
|
+
);
|
|
3920
4249
|
logger.line();
|
|
3921
4250
|
logger.hint("Run synapsync uninstall <name> to remove a cognitive.");
|
|
3922
4251
|
}
|
|
@@ -3929,24 +4258,24 @@ function groupByType(cognitives) {
|
|
|
3929
4258
|
return grouped;
|
|
3930
4259
|
}
|
|
3931
4260
|
function displayCognitive(cognitive) {
|
|
3932
|
-
logger.log(` ${
|
|
4261
|
+
logger.log(` ${pc10.white(cognitive.name)} ${pc10.dim(`v${cognitive.version}`)}`);
|
|
3933
4262
|
const details = [];
|
|
3934
|
-
details.push(
|
|
3935
|
-
details.push(
|
|
4263
|
+
details.push(pc10.dim(cognitive.category));
|
|
4264
|
+
details.push(pc10.dim(`from ${cognitive.source}`));
|
|
3936
4265
|
if (cognitive.installedAt !== void 0) {
|
|
3937
4266
|
const date = new Date(cognitive.installedAt);
|
|
3938
|
-
details.push(
|
|
4267
|
+
details.push(pc10.dim(`installed ${formatDate(date)}`));
|
|
3939
4268
|
}
|
|
3940
4269
|
logger.log(` ${details.join(" \xB7 ")}`);
|
|
3941
4270
|
logger.line();
|
|
3942
4271
|
}
|
|
3943
4272
|
function getCognitiveIcon2(type) {
|
|
3944
4273
|
const icons = {
|
|
3945
|
-
skill:
|
|
3946
|
-
agent:
|
|
3947
|
-
prompt:
|
|
3948
|
-
workflow:
|
|
3949
|
-
tool:
|
|
4274
|
+
skill: pc10.blue("\u25C6"),
|
|
4275
|
+
agent: pc10.magenta("\u25C6"),
|
|
4276
|
+
prompt: pc10.yellow("\u25C6"),
|
|
4277
|
+
workflow: pc10.cyan("\u25C6"),
|
|
4278
|
+
tool: pc10.green("\u25C6")
|
|
3950
4279
|
};
|
|
3951
4280
|
return icons[type];
|
|
3952
4281
|
}
|
|
@@ -3977,7 +4306,7 @@ function registerListCommand(program) {
|
|
|
3977
4306
|
init_esm_shims();
|
|
3978
4307
|
import * as fs11 from "fs";
|
|
3979
4308
|
import * as path13 from "path";
|
|
3980
|
-
import
|
|
4309
|
+
import pc11 from "picocolors";
|
|
3981
4310
|
function executeUninstallCommand(name, options) {
|
|
3982
4311
|
logger.line();
|
|
3983
4312
|
const configManager = ConfigManager.findConfig();
|
|
@@ -3994,13 +4323,13 @@ function executeUninstallCommand(name, options) {
|
|
|
3994
4323
|
return;
|
|
3995
4324
|
}
|
|
3996
4325
|
if (options.force !== true) {
|
|
3997
|
-
logger.log(` ${
|
|
3998
|
-
logger.log(` ${
|
|
3999
|
-
logger.log(` ${
|
|
4000
|
-
logger.log(` ${
|
|
4326
|
+
logger.log(` ${pc11.yellow("!")} About to uninstall ${pc11.bold(name)}`);
|
|
4327
|
+
logger.log(` ${pc11.dim("Type:")} ${cognitive.type}`);
|
|
4328
|
+
logger.log(` ${pc11.dim("Category:")} ${cognitive.category}`);
|
|
4329
|
+
logger.log(` ${pc11.dim("Version:")} ${cognitive.version}`);
|
|
4001
4330
|
logger.line();
|
|
4002
4331
|
logger.hint("Use --force to skip confirmation and uninstall directly.");
|
|
4003
|
-
logger.log(` ${
|
|
4332
|
+
logger.log(` ${pc11.dim("To confirm, run:")} synapsync uninstall ${name} --force`);
|
|
4004
4333
|
return;
|
|
4005
4334
|
}
|
|
4006
4335
|
try {
|
|
@@ -4008,7 +4337,9 @@ function executeUninstallCommand(name, options) {
|
|
|
4008
4337
|
const cognitiveDir = getCognitiveDir(configManager, cognitive);
|
|
4009
4338
|
if (fs11.existsSync(cognitiveDir)) {
|
|
4010
4339
|
fs11.rmSync(cognitiveDir, { recursive: true, force: true });
|
|
4011
|
-
logger.log(
|
|
4340
|
+
logger.log(
|
|
4341
|
+
` ${pc11.dim("Removed files from")} ${path13.relative(process.cwd(), cognitiveDir)}`
|
|
4342
|
+
);
|
|
4012
4343
|
}
|
|
4013
4344
|
}
|
|
4014
4345
|
delete manifest.cognitives[name];
|
|
@@ -4016,7 +4347,7 @@ function executeUninstallCommand(name, options) {
|
|
|
4016
4347
|
saveManifest(configManager, manifest);
|
|
4017
4348
|
regenerateAgentsMd(configManager.getProjectRoot(), configManager.getSynapSyncDir());
|
|
4018
4349
|
logger.line();
|
|
4019
|
-
logger.log(` ${
|
|
4350
|
+
logger.log(` ${pc11.green("\u2713")} Uninstalled ${pc11.bold(name)}`);
|
|
4020
4351
|
logger.line();
|
|
4021
4352
|
logger.hint("Note: Provider symlinks may need manual cleanup if sync was run.");
|
|
4022
4353
|
} catch (error) {
|
|
@@ -4068,7 +4399,7 @@ function registerUninstallCommand(program) {
|
|
|
4068
4399
|
|
|
4069
4400
|
// src/commands/sync.ts
|
|
4070
4401
|
init_esm_shims();
|
|
4071
|
-
import
|
|
4402
|
+
import pc12 from "picocolors";
|
|
4072
4403
|
function executeSyncCommand(options) {
|
|
4073
4404
|
logger.line();
|
|
4074
4405
|
const configManager = ConfigManager.findConfig();
|
|
@@ -4105,7 +4436,7 @@ function executeSyncCommand(options) {
|
|
|
4105
4436
|
syncOpts,
|
|
4106
4437
|
options.json !== true ? (status) => {
|
|
4107
4438
|
if (options.verbose === true) {
|
|
4108
|
-
logger.log(` ${
|
|
4439
|
+
logger.log(` ${pc12.dim(status.message)}`);
|
|
4109
4440
|
}
|
|
4110
4441
|
} : void 0
|
|
4111
4442
|
);
|
|
@@ -4151,17 +4482,17 @@ function validateOptions2(options) {
|
|
|
4151
4482
|
function displayResults(result, options) {
|
|
4152
4483
|
const hasManifestChanges = result.added > 0 || result.removed > 0 || result.updated > 0;
|
|
4153
4484
|
const hasProviderResults = result.providerResults !== void 0 && result.providerResults.length > 0;
|
|
4154
|
-
const hasProviderChanges = hasProviderResults && result.providerResults?.some(
|
|
4155
|
-
(pr) => pr.created.length > 0 || pr.removed.length > 0
|
|
4156
|
-
);
|
|
4485
|
+
const hasProviderChanges = hasProviderResults && result.providerResults?.some((pr) => pr.created.length > 0 || pr.removed.length > 0);
|
|
4157
4486
|
if (!hasManifestChanges && hasProviderChanges !== true) {
|
|
4158
|
-
logger.log(` ${
|
|
4487
|
+
logger.log(` ${pc12.green("\u2713")} Everything is in sync`);
|
|
4159
4488
|
logger.line();
|
|
4160
|
-
logger.log(` ${
|
|
4489
|
+
logger.log(` ${pc12.dim(`${result.total} cognitives in manifest`)}`);
|
|
4161
4490
|
if (hasProviderResults && result.providerResults !== void 0) {
|
|
4162
|
-
const syncedProviders = result.providerResults.filter(
|
|
4491
|
+
const syncedProviders = result.providerResults.filter(
|
|
4492
|
+
(pr) => pr.skipped.length > 0 || pr.created.length > 0
|
|
4493
|
+
);
|
|
4163
4494
|
if (syncedProviders.length > 0) {
|
|
4164
|
-
logger.log(` ${
|
|
4495
|
+
logger.log(` ${pc12.dim(`${syncedProviders.length} provider(s) synced`)}`);
|
|
4165
4496
|
}
|
|
4166
4497
|
}
|
|
4167
4498
|
logger.line();
|
|
@@ -4181,16 +4512,16 @@ function displayResults(result, options) {
|
|
|
4181
4512
|
}
|
|
4182
4513
|
logger.line();
|
|
4183
4514
|
if (result.added > 0) {
|
|
4184
|
-
logger.log(` ${
|
|
4515
|
+
logger.log(` ${pc12.green("+")} ${result.added} added`);
|
|
4185
4516
|
}
|
|
4186
4517
|
if (result.updated > 0) {
|
|
4187
|
-
logger.log(` ${
|
|
4518
|
+
logger.log(` ${pc12.yellow("~")} ${result.updated} updated`);
|
|
4188
4519
|
}
|
|
4189
4520
|
if (result.removed > 0) {
|
|
4190
|
-
logger.log(` ${
|
|
4521
|
+
logger.log(` ${pc12.red("-")} ${result.removed} removed`);
|
|
4191
4522
|
}
|
|
4192
4523
|
if (result.unchanged > 0) {
|
|
4193
|
-
logger.log(` ${
|
|
4524
|
+
logger.log(` ${pc12.dim("\u25CB")} ${result.unchanged} unchanged`);
|
|
4194
4525
|
}
|
|
4195
4526
|
logger.line();
|
|
4196
4527
|
}
|
|
@@ -4201,14 +4532,14 @@ function displayResults(result, options) {
|
|
|
4201
4532
|
displayProviderResult(providerResult, options);
|
|
4202
4533
|
}
|
|
4203
4534
|
}
|
|
4204
|
-
logger.log(` ${
|
|
4535
|
+
logger.log(` ${pc12.dim(`Total: ${result.total} cognitives | Duration: ${result.duration}ms`)}`);
|
|
4205
4536
|
logger.line();
|
|
4206
4537
|
if (result.errors.length > 0) {
|
|
4207
4538
|
logger.line();
|
|
4208
|
-
logger.bold(` ${
|
|
4539
|
+
logger.bold(` ${pc12.red("Errors:")}`);
|
|
4209
4540
|
logger.line();
|
|
4210
4541
|
for (const error of result.errors) {
|
|
4211
|
-
logger.log(` ${
|
|
4542
|
+
logger.log(` ${pc12.red("\u2717")} ${error.cognitive ?? "Unknown"}: ${error.message}`);
|
|
4212
4543
|
}
|
|
4213
4544
|
logger.line();
|
|
4214
4545
|
}
|
|
@@ -4224,13 +4555,13 @@ function displayActions(actions, isDryRun) {
|
|
|
4224
4555
|
const name = typeof action.cognitive === "string" ? action.cognitive : action.cognitive.name;
|
|
4225
4556
|
switch (action.operation) {
|
|
4226
4557
|
case "add":
|
|
4227
|
-
logger.log(` ${
|
|
4558
|
+
logger.log(` ${pc12.green("+")} ${verb} add: ${pc12.white(name)}`);
|
|
4228
4559
|
break;
|
|
4229
4560
|
case "update":
|
|
4230
|
-
logger.log(` ${
|
|
4561
|
+
logger.log(` ${pc12.yellow("~")} ${verb} update: ${pc12.white(name)}`);
|
|
4231
4562
|
break;
|
|
4232
4563
|
case "remove":
|
|
4233
|
-
logger.log(` ${
|
|
4564
|
+
logger.log(` ${pc12.red("-")} ${verb} remove: ${pc12.white(name)}`);
|
|
4234
4565
|
break;
|
|
4235
4566
|
}
|
|
4236
4567
|
}
|
|
@@ -4242,22 +4573,22 @@ function displayProviderResult(result, options) {
|
|
|
4242
4573
|
const errors = result.errors.length;
|
|
4243
4574
|
const methodLabel = result.method === "symlink" ? "symlinks" : "copies";
|
|
4244
4575
|
const hasChanges = created > 0 || removed > 0;
|
|
4245
|
-
logger.log(` ${
|
|
4576
|
+
logger.log(` ${pc12.cyan(result.provider)}:`);
|
|
4246
4577
|
if (hasChanges || options.verbose === true) {
|
|
4247
4578
|
if (created > 0) {
|
|
4248
|
-
logger.log(` ${
|
|
4579
|
+
logger.log(` ${pc12.green("\u2713")} ${created} ${methodLabel} created`);
|
|
4249
4580
|
}
|
|
4250
4581
|
if (skipped > 0) {
|
|
4251
|
-
logger.log(` ${
|
|
4582
|
+
logger.log(` ${pc12.dim("\u25CB")} ${skipped} already synced`);
|
|
4252
4583
|
}
|
|
4253
4584
|
if (removed > 0) {
|
|
4254
|
-
logger.log(` ${
|
|
4585
|
+
logger.log(` ${pc12.red("-")} ${removed} orphaned removed`);
|
|
4255
4586
|
}
|
|
4256
4587
|
if (errors > 0) {
|
|
4257
|
-
logger.log(` ${
|
|
4588
|
+
logger.log(` ${pc12.red("\u2717")} ${errors} errors`);
|
|
4258
4589
|
}
|
|
4259
4590
|
} else {
|
|
4260
|
-
logger.log(` ${
|
|
4591
|
+
logger.log(` ${pc12.green("\u2713")} ${skipped + created} ${methodLabel} synced`);
|
|
4261
4592
|
}
|
|
4262
4593
|
logger.line();
|
|
4263
4594
|
}
|
|
@@ -4287,23 +4618,23 @@ function executeSyncStatusCommand(options) {
|
|
|
4287
4618
|
logger.bold(" Sync Status");
|
|
4288
4619
|
logger.line();
|
|
4289
4620
|
if (status.inSync) {
|
|
4290
|
-
logger.log(` ${
|
|
4621
|
+
logger.log(` ${pc12.green("\u2713")} Filesystem and manifest are in sync`);
|
|
4291
4622
|
} else {
|
|
4292
|
-
logger.log(` ${
|
|
4623
|
+
logger.log(` ${pc12.yellow("!")} Out of sync`);
|
|
4293
4624
|
}
|
|
4294
4625
|
logger.line();
|
|
4295
|
-
logger.log(` ${
|
|
4296
|
-
logger.log(` ${
|
|
4626
|
+
logger.log(` ${pc12.dim("Manifest:")} ${status.manifest} cognitives`);
|
|
4627
|
+
logger.log(` ${pc12.dim("Filesystem:")} ${status.filesystem} cognitives`);
|
|
4297
4628
|
if (!status.inSync) {
|
|
4298
4629
|
logger.line();
|
|
4299
4630
|
if (status.newInFilesystem > 0) {
|
|
4300
|
-
logger.log(` ${
|
|
4631
|
+
logger.log(` ${pc12.green("+")} ${status.newInFilesystem} new in filesystem`);
|
|
4301
4632
|
}
|
|
4302
4633
|
if (status.removedFromFilesystem > 0) {
|
|
4303
|
-
logger.log(` ${
|
|
4634
|
+
logger.log(` ${pc12.red("-")} ${status.removedFromFilesystem} removed from filesystem`);
|
|
4304
4635
|
}
|
|
4305
4636
|
if (status.modified > 0) {
|
|
4306
|
-
logger.log(` ${
|
|
4637
|
+
logger.log(` ${pc12.yellow("~")} ${status.modified} modified`);
|
|
4307
4638
|
}
|
|
4308
4639
|
}
|
|
4309
4640
|
if (enabledProviders.length > 0) {
|
|
@@ -4315,19 +4646,19 @@ function executeSyncStatusCommand(options) {
|
|
|
4315
4646
|
if (pStatus === void 0) continue;
|
|
4316
4647
|
const total = pStatus.valid + pStatus.broken + pStatus.orphaned;
|
|
4317
4648
|
const hasIssues = pStatus.broken > 0 || pStatus.orphaned > 0;
|
|
4318
|
-
logger.log(` ${
|
|
4649
|
+
logger.log(` ${pc12.cyan(provider)}:`);
|
|
4319
4650
|
if (hasIssues) {
|
|
4320
|
-
logger.log(` ${
|
|
4651
|
+
logger.log(` ${pc12.green("\u2713")} ${pStatus.valid} valid`);
|
|
4321
4652
|
if (pStatus.broken > 0) {
|
|
4322
|
-
logger.log(` ${
|
|
4653
|
+
logger.log(` ${pc12.red("\u2717")} ${pStatus.broken} broken`);
|
|
4323
4654
|
}
|
|
4324
4655
|
if (pStatus.orphaned > 0) {
|
|
4325
|
-
logger.log(` ${
|
|
4656
|
+
logger.log(` ${pc12.yellow("?")} ${pStatus.orphaned} orphaned`);
|
|
4326
4657
|
}
|
|
4327
4658
|
} else if (total > 0) {
|
|
4328
|
-
logger.log(` ${
|
|
4659
|
+
logger.log(` ${pc12.green("\u2713")} ${total} symlinks valid`);
|
|
4329
4660
|
} else {
|
|
4330
|
-
logger.log(` ${
|
|
4661
|
+
logger.log(` ${pc12.dim("\u25CB")} No symlinks yet`);
|
|
4331
4662
|
}
|
|
4332
4663
|
}
|
|
4333
4664
|
}
|
|
@@ -4349,7 +4680,7 @@ function registerSyncCommand(program) {
|
|
|
4349
4680
|
init_esm_shims();
|
|
4350
4681
|
import * as fs12 from "fs";
|
|
4351
4682
|
import * as path14 from "path";
|
|
4352
|
-
import
|
|
4683
|
+
import pc13 from "picocolors";
|
|
4353
4684
|
|
|
4354
4685
|
// src/services/maintenance/update-checker.ts
|
|
4355
4686
|
init_esm_shims();
|
|
@@ -4472,7 +4803,7 @@ async function executeUpdateCommand(cognitiveName, options = {}) {
|
|
|
4472
4803
|
if (options.json === true) {
|
|
4473
4804
|
console.log(JSON.stringify({ message: "No cognitives installed" }));
|
|
4474
4805
|
} else {
|
|
4475
|
-
logger.log(` ${
|
|
4806
|
+
logger.log(` ${pc13.dim("No cognitives installed.")}`);
|
|
4476
4807
|
logger.hint("Run synapsync add <name> to add a cognitive.");
|
|
4477
4808
|
}
|
|
4478
4809
|
return;
|
|
@@ -4486,7 +4817,9 @@ async function executeUpdateCommand(cognitiveName, options = {}) {
|
|
|
4486
4817
|
return;
|
|
4487
4818
|
}
|
|
4488
4819
|
if (cognitive.source !== "registry") {
|
|
4489
|
-
logger.error(
|
|
4820
|
+
logger.error(
|
|
4821
|
+
`Cognitive '${cognitiveName}' was installed locally and cannot be updated from registry.`
|
|
4822
|
+
);
|
|
4490
4823
|
return;
|
|
4491
4824
|
}
|
|
4492
4825
|
const updateInfo = await checker.checkOne(cognitive);
|
|
@@ -4507,7 +4840,7 @@ async function executeUpdateCommand(cognitiveName, options = {}) {
|
|
|
4507
4840
|
displayCheckResults(checkResult);
|
|
4508
4841
|
if (checkResult.updatesAvailable.length === 0) {
|
|
4509
4842
|
logger.line();
|
|
4510
|
-
logger.log(` ${
|
|
4843
|
+
logger.log(` ${pc13.green("\u2713")} All cognitives are up to date`);
|
|
4511
4844
|
logger.line();
|
|
4512
4845
|
return;
|
|
4513
4846
|
}
|
|
@@ -4523,16 +4856,11 @@ async function executeUpdateCommand(cognitiveName, options = {}) {
|
|
|
4523
4856
|
const failed = [];
|
|
4524
4857
|
for (const update of checkResult.updatesAvailable) {
|
|
4525
4858
|
try {
|
|
4526
|
-
logger.log(` ${
|
|
4859
|
+
logger.log(` ${pc13.cyan("\u2193")} Updating ${update.name}...`);
|
|
4527
4860
|
const downloaded = await registry.download(update.name);
|
|
4528
4861
|
const manifestEntry = installed.find((c) => c.name === update.name);
|
|
4529
4862
|
if (manifestEntry === void 0) continue;
|
|
4530
|
-
const targetDir = path14.join(
|
|
4531
|
-
synapSyncDir,
|
|
4532
|
-
`${update.type}s`,
|
|
4533
|
-
update.category,
|
|
4534
|
-
update.name
|
|
4535
|
-
);
|
|
4863
|
+
const targetDir = path14.join(synapSyncDir, `${update.type}s`, update.category, update.name);
|
|
4536
4864
|
const fileName = COGNITIVE_FILE_NAMES[update.type];
|
|
4537
4865
|
const filePath = path14.join(targetDir, fileName);
|
|
4538
4866
|
if (!fs12.existsSync(targetDir)) {
|
|
@@ -4543,28 +4871,30 @@ async function executeUpdateCommand(cognitiveName, options = {}) {
|
|
|
4543
4871
|
version: update.latestVersion
|
|
4544
4872
|
});
|
|
4545
4873
|
updated.push(update.name);
|
|
4546
|
-
logger.log(` ${
|
|
4874
|
+
logger.log(` ${pc13.green("\u2713")} Updated to v${update.latestVersion}`);
|
|
4547
4875
|
} catch (error) {
|
|
4548
4876
|
failed.push({
|
|
4549
4877
|
name: update.name,
|
|
4550
4878
|
error: error instanceof Error ? error.message : "Unknown error"
|
|
4551
4879
|
});
|
|
4552
|
-
logger.log(
|
|
4880
|
+
logger.log(
|
|
4881
|
+
` ${pc13.red("\u2717")} Failed: ${error instanceof Error ? error.message : "Unknown error"}`
|
|
4882
|
+
);
|
|
4553
4883
|
}
|
|
4554
4884
|
}
|
|
4555
4885
|
manifest.save();
|
|
4556
4886
|
logger.line();
|
|
4557
|
-
logger.log(` ${
|
|
4887
|
+
logger.log(` ${pc13.dim("Syncing providers...")}`);
|
|
4558
4888
|
const config = configManager.getConfig();
|
|
4559
4889
|
const syncEngine = new SyncEngine(synapSyncDir, projectRoot, config);
|
|
4560
4890
|
syncEngine.sync();
|
|
4561
4891
|
regenerateAgentsMd(projectRoot, synapSyncDir);
|
|
4562
4892
|
logger.line();
|
|
4563
4893
|
if (updated.length > 0) {
|
|
4564
|
-
logger.log(` ${
|
|
4894
|
+
logger.log(` ${pc13.green("\u2713")} Updated ${updated.length} cognitive(s)`);
|
|
4565
4895
|
}
|
|
4566
4896
|
if (failed.length > 0) {
|
|
4567
|
-
logger.log(` ${
|
|
4897
|
+
logger.log(` ${pc13.red("\u2717")} Failed to update ${failed.length} cognitive(s)`);
|
|
4568
4898
|
}
|
|
4569
4899
|
logger.line();
|
|
4570
4900
|
}
|
|
@@ -4574,19 +4904,19 @@ function displayCheckResults(result) {
|
|
|
4574
4904
|
logger.line();
|
|
4575
4905
|
for (const update of result.updatesAvailable) {
|
|
4576
4906
|
logger.log(
|
|
4577
|
-
` ${
|
|
4907
|
+
` ${pc13.yellow("\u2191")} ${pc13.white(update.name)} ${pc13.dim(update.currentVersion)} \u2192 ${pc13.green(update.latestVersion)}`
|
|
4578
4908
|
);
|
|
4579
4909
|
}
|
|
4580
4910
|
}
|
|
4581
4911
|
if (result.upToDate.length > 0 && result.updatesAvailable.length > 0) {
|
|
4582
4912
|
logger.line();
|
|
4583
|
-
logger.log(` ${
|
|
4913
|
+
logger.log(` ${pc13.dim(`${result.upToDate.length} cognitive(s) up to date`)}`);
|
|
4584
4914
|
}
|
|
4585
4915
|
if (result.errors.length > 0) {
|
|
4586
4916
|
logger.line();
|
|
4587
|
-
logger.log(` ${
|
|
4917
|
+
logger.log(` ${pc13.red("Errors:")}`);
|
|
4588
4918
|
for (const error of result.errors) {
|
|
4589
|
-
logger.log(` ${
|
|
4919
|
+
logger.log(` ${pc13.red("\u2717")} ${error.cognitive}: ${error.message}`);
|
|
4590
4920
|
}
|
|
4591
4921
|
}
|
|
4592
4922
|
}
|
|
@@ -4598,7 +4928,7 @@ function registerUpdateCommand(program) {
|
|
|
4598
4928
|
|
|
4599
4929
|
// src/commands/doctor.ts
|
|
4600
4930
|
init_esm_shims();
|
|
4601
|
-
import
|
|
4931
|
+
import pc14 from "picocolors";
|
|
4602
4932
|
|
|
4603
4933
|
// src/services/maintenance/doctor.ts
|
|
4604
4934
|
init_esm_shims();
|
|
@@ -5078,17 +5408,17 @@ async function executeDoctorCommand(options = {}) {
|
|
|
5078
5408
|
}
|
|
5079
5409
|
logger.line();
|
|
5080
5410
|
if (result.healthy) {
|
|
5081
|
-
logger.log(` ${
|
|
5411
|
+
logger.log(` ${pc14.green("\u2713")} Your project is healthy!`);
|
|
5082
5412
|
} else if (result.failed > 0) {
|
|
5083
|
-
logger.log(` ${
|
|
5413
|
+
logger.log(` ${pc14.red("!")} ${result.failed} issue(s) found`);
|
|
5084
5414
|
if (options.fix !== true) {
|
|
5085
5415
|
logger.hint("Run synapsync doctor --fix to auto-repair fixable issues.");
|
|
5086
5416
|
}
|
|
5087
5417
|
} else if (result.warnings > 0) {
|
|
5088
|
-
logger.log(` ${
|
|
5418
|
+
logger.log(` ${pc14.yellow("!")} ${result.warnings} warning(s)`);
|
|
5089
5419
|
}
|
|
5090
5420
|
logger.line();
|
|
5091
|
-
logger.log(` ${
|
|
5421
|
+
logger.log(` ${pc14.dim(`Checked ${result.checks.length} items in ${result.duration}ms`)}`);
|
|
5092
5422
|
logger.line();
|
|
5093
5423
|
}
|
|
5094
5424
|
function displayDiagnostics(result, verbose = false) {
|
|
@@ -5101,10 +5431,10 @@ function displayCheck(check, verbose = false) {
|
|
|
5101
5431
|
const statusColor = getStatusColor(check.status);
|
|
5102
5432
|
logger.log(` ${statusIcon} ${statusColor(check.name)}`);
|
|
5103
5433
|
if (verbose || check.status === "fail" || check.status === "warn") {
|
|
5104
|
-
logger.log(` ${
|
|
5434
|
+
logger.log(` ${pc14.dim(check.message)}`);
|
|
5105
5435
|
if (check.details !== void 0 && check.details.length > 0) {
|
|
5106
5436
|
for (const detail of check.details) {
|
|
5107
|
-
logger.log(` ${
|
|
5437
|
+
logger.log(` ${pc14.dim("\u2022")} ${pc14.dim(detail)}`);
|
|
5108
5438
|
}
|
|
5109
5439
|
}
|
|
5110
5440
|
}
|
|
@@ -5114,40 +5444,40 @@ function displayFixes(result) {
|
|
|
5114
5444
|
logger.line();
|
|
5115
5445
|
if (result.fixed.length > 0) {
|
|
5116
5446
|
for (const fix of result.fixed) {
|
|
5117
|
-
logger.log(` ${
|
|
5447
|
+
logger.log(` ${pc14.green("\u2713")} Fixed: ${fix}`);
|
|
5118
5448
|
}
|
|
5119
5449
|
}
|
|
5120
5450
|
if (result.failed.length > 0) {
|
|
5121
5451
|
for (const fail of result.failed) {
|
|
5122
|
-
logger.log(` ${
|
|
5452
|
+
logger.log(` ${pc14.red("\u2717")} Failed: ${fail.check} - ${fail.error}`);
|
|
5123
5453
|
}
|
|
5124
5454
|
}
|
|
5125
5455
|
if (result.fixed.length === 0 && result.failed.length === 0) {
|
|
5126
|
-
logger.log(` ${
|
|
5456
|
+
logger.log(` ${pc14.dim("No fixes needed")}`);
|
|
5127
5457
|
}
|
|
5128
5458
|
}
|
|
5129
5459
|
function getStatusIcon(status) {
|
|
5130
5460
|
switch (status) {
|
|
5131
5461
|
case "pass":
|
|
5132
|
-
return
|
|
5462
|
+
return pc14.green("\u2713");
|
|
5133
5463
|
case "warn":
|
|
5134
|
-
return
|
|
5464
|
+
return pc14.yellow("!");
|
|
5135
5465
|
case "fail":
|
|
5136
|
-
return
|
|
5466
|
+
return pc14.red("\u2717");
|
|
5137
5467
|
case "skip":
|
|
5138
|
-
return
|
|
5468
|
+
return pc14.dim("\u25CB");
|
|
5139
5469
|
}
|
|
5140
5470
|
}
|
|
5141
5471
|
function getStatusColor(status) {
|
|
5142
5472
|
switch (status) {
|
|
5143
5473
|
case "pass":
|
|
5144
|
-
return
|
|
5474
|
+
return pc14.green;
|
|
5145
5475
|
case "warn":
|
|
5146
|
-
return
|
|
5476
|
+
return pc14.yellow;
|
|
5147
5477
|
case "fail":
|
|
5148
|
-
return
|
|
5478
|
+
return pc14.red;
|
|
5149
5479
|
case "skip":
|
|
5150
|
-
return
|
|
5480
|
+
return pc14.dim;
|
|
5151
5481
|
}
|
|
5152
5482
|
}
|
|
5153
5483
|
function registerDoctorCommand(program) {
|
|
@@ -5158,7 +5488,7 @@ function registerDoctorCommand(program) {
|
|
|
5158
5488
|
|
|
5159
5489
|
// src/commands/clean.ts
|
|
5160
5490
|
init_esm_shims();
|
|
5161
|
-
import
|
|
5491
|
+
import pc15 from "picocolors";
|
|
5162
5492
|
|
|
5163
5493
|
// src/services/maintenance/cleaner.ts
|
|
5164
5494
|
init_esm_shims();
|
|
@@ -5460,47 +5790,51 @@ function executeCleanCommand(options = {}) {
|
|
|
5460
5790
|
displayResults2(result, options);
|
|
5461
5791
|
logger.line();
|
|
5462
5792
|
if (result.cleaned.length === 0) {
|
|
5463
|
-
logger.log(` ${
|
|
5793
|
+
logger.log(` ${pc15.green("\u2713")} Nothing to clean`);
|
|
5464
5794
|
} else if (options.dryRun === true) {
|
|
5465
|
-
logger.log(
|
|
5795
|
+
logger.log(
|
|
5796
|
+
` ${pc15.dim(`Would clean ${result.cleaned.length} item(s), freeing ${result.sizeFreed}`)}`
|
|
5797
|
+
);
|
|
5466
5798
|
logger.hint("Run synapsync clean without --dry-run to apply changes.");
|
|
5467
5799
|
} else {
|
|
5468
|
-
logger.log(
|
|
5800
|
+
logger.log(
|
|
5801
|
+
` ${pc15.green("\u2713")} Cleaned ${result.cleaned.length} item(s), freed ${result.sizeFreed}`
|
|
5802
|
+
);
|
|
5469
5803
|
}
|
|
5470
5804
|
if (result.errors.length > 0) {
|
|
5471
|
-
logger.log(` ${
|
|
5805
|
+
logger.log(` ${pc15.red("!")} ${result.errors.length} error(s) occurred`);
|
|
5472
5806
|
}
|
|
5473
5807
|
logger.line();
|
|
5474
5808
|
}
|
|
5475
5809
|
function displayResults2(result, _options) {
|
|
5476
5810
|
const byType = groupByType2(result.cleaned);
|
|
5477
5811
|
if (byType.cache.length > 0) {
|
|
5478
|
-
logger.log(` ${
|
|
5812
|
+
logger.log(` ${pc15.cyan("Cache:")}`);
|
|
5479
5813
|
for (const item of byType.cache) {
|
|
5480
5814
|
const size = formatBytes(item.size);
|
|
5481
|
-
logger.log(` ${
|
|
5815
|
+
logger.log(` ${pc15.dim("-")} ${getRelativePath(item.path)} ${pc15.dim(`(${size})`)}`);
|
|
5482
5816
|
}
|
|
5483
5817
|
logger.line();
|
|
5484
5818
|
}
|
|
5485
5819
|
if (byType.orphan.length > 0) {
|
|
5486
|
-
logger.log(` ${
|
|
5820
|
+
logger.log(` ${pc15.cyan("Orphaned symlinks:")}`);
|
|
5487
5821
|
for (const item of byType.orphan) {
|
|
5488
|
-
logger.log(` ${
|
|
5822
|
+
logger.log(` ${pc15.dim("-")} ${item.path}`);
|
|
5489
5823
|
}
|
|
5490
5824
|
logger.line();
|
|
5491
5825
|
}
|
|
5492
5826
|
if (byType.temp.length > 0) {
|
|
5493
|
-
logger.log(` ${
|
|
5827
|
+
logger.log(` ${pc15.cyan("Temp files:")}`);
|
|
5494
5828
|
for (const item of byType.temp) {
|
|
5495
5829
|
const size = formatBytes(item.size);
|
|
5496
|
-
logger.log(` ${
|
|
5830
|
+
logger.log(` ${pc15.dim("-")} ${getRelativePath(item.path)} ${pc15.dim(`(${size})`)}`);
|
|
5497
5831
|
}
|
|
5498
5832
|
logger.line();
|
|
5499
5833
|
}
|
|
5500
5834
|
if (result.errors.length > 0) {
|
|
5501
|
-
logger.log(` ${
|
|
5835
|
+
logger.log(` ${pc15.red("Errors:")}`);
|
|
5502
5836
|
for (const error of result.errors) {
|
|
5503
|
-
logger.log(` ${
|
|
5837
|
+
logger.log(` ${pc15.red("\u2717")} ${error.path}: ${error.message}`);
|
|
5504
5838
|
}
|
|
5505
5839
|
logger.line();
|
|
5506
5840
|
}
|
|
@@ -5540,7 +5874,7 @@ function registerCleanCommand(program) {
|
|
|
5540
5874
|
init_esm_shims();
|
|
5541
5875
|
import * as fs15 from "fs";
|
|
5542
5876
|
import * as path17 from "path";
|
|
5543
|
-
import
|
|
5877
|
+
import pc16 from "picocolors";
|
|
5544
5878
|
function executePurgeCommand(options) {
|
|
5545
5879
|
logger.line();
|
|
5546
5880
|
const configManager = ConfigManager.findConfig();
|
|
@@ -5551,15 +5885,15 @@ function executePurgeCommand(options) {
|
|
|
5551
5885
|
const projectRoot = configManager.getProjectRoot();
|
|
5552
5886
|
const synapSyncDir = configManager.getSynapSyncDir();
|
|
5553
5887
|
if (options.force !== true) {
|
|
5554
|
-
logger.log(` ${
|
|
5888
|
+
logger.log(` ${pc16.yellow("!")} This will completely remove SynapSync from your project:`);
|
|
5555
5889
|
logger.line();
|
|
5556
5890
|
const itemsToRemove = collectItemsToRemove(projectRoot, synapSyncDir);
|
|
5557
5891
|
for (const item of itemsToRemove) {
|
|
5558
|
-
logger.log(` ${
|
|
5892
|
+
logger.log(` ${pc16.red("\u2717")} ${item}`);
|
|
5559
5893
|
}
|
|
5560
5894
|
logger.line();
|
|
5561
5895
|
logger.hint("Use --force to confirm and remove everything.");
|
|
5562
|
-
logger.log(` ${
|
|
5896
|
+
logger.log(` ${pc16.dim("To confirm, run:")} synapsync purge --force`);
|
|
5563
5897
|
return;
|
|
5564
5898
|
}
|
|
5565
5899
|
let removedCount = 0;
|
|
@@ -5567,30 +5901,30 @@ function executePurgeCommand(options) {
|
|
|
5567
5901
|
removedCount += removeProviderSymlinks(projectRoot, synapSyncDir);
|
|
5568
5902
|
if (fs15.existsSync(synapSyncDir)) {
|
|
5569
5903
|
fs15.rmSync(synapSyncDir, { recursive: true, force: true });
|
|
5570
|
-
logger.log(` ${
|
|
5904
|
+
logger.log(` ${pc16.red("\u2717")} Removed ${path17.relative(projectRoot, synapSyncDir)}/`);
|
|
5571
5905
|
removedCount++;
|
|
5572
5906
|
}
|
|
5573
5907
|
const configPath = path17.join(projectRoot, "synapsync.config.yaml");
|
|
5574
5908
|
if (fs15.existsSync(configPath)) {
|
|
5575
5909
|
fs15.unlinkSync(configPath);
|
|
5576
|
-
logger.log(` ${
|
|
5910
|
+
logger.log(` ${pc16.red("\u2717")} Removed synapsync.config.yaml`);
|
|
5577
5911
|
removedCount++;
|
|
5578
5912
|
}
|
|
5579
5913
|
const agentsMdPath = path17.join(projectRoot, AGENTS_MD_FILE_NAME);
|
|
5580
5914
|
if (fs15.existsSync(agentsMdPath)) {
|
|
5581
5915
|
fs15.unlinkSync(agentsMdPath);
|
|
5582
|
-
logger.log(` ${
|
|
5916
|
+
logger.log(` ${pc16.red("\u2717")} Removed ${AGENTS_MD_FILE_NAME}`);
|
|
5583
5917
|
removedCount++;
|
|
5584
5918
|
}
|
|
5585
5919
|
if (cleanGitignore(projectRoot)) {
|
|
5586
|
-
logger.log(` ${
|
|
5920
|
+
logger.log(` ${pc16.red("\u2717")} Cleaned SynapSync entries from .gitignore`);
|
|
5587
5921
|
removedCount++;
|
|
5588
5922
|
}
|
|
5589
5923
|
logger.line();
|
|
5590
5924
|
if (removedCount > 0) {
|
|
5591
|
-
logger.log(` ${
|
|
5925
|
+
logger.log(` ${pc16.green("\u2713")} SynapSync has been completely removed from this project.`);
|
|
5592
5926
|
} else {
|
|
5593
|
-
logger.log(` ${
|
|
5927
|
+
logger.log(` ${pc16.green("\u2713")} Nothing to remove.`);
|
|
5594
5928
|
}
|
|
5595
5929
|
logger.line();
|
|
5596
5930
|
} catch (error) {
|
|
@@ -5657,7 +5991,7 @@ function removeProviderSymlinks(projectRoot, synapSyncDir) {
|
|
|
5657
5991
|
const symlinks = findSynapSyncSymlinks(projectRoot, synapSyncDir);
|
|
5658
5992
|
for (const link of symlinks) {
|
|
5659
5993
|
fs15.unlinkSync(link);
|
|
5660
|
-
logger.log(` ${
|
|
5994
|
+
logger.log(` ${pc16.red("\u2717")} Removed symlink ${path17.relative(projectRoot, link)}`);
|
|
5661
5995
|
}
|
|
5662
5996
|
return symlinks.length;
|
|
5663
5997
|
}
|
|
@@ -5680,90 +6014,7 @@ function registerPurgeCommand(program) {
|
|
|
5680
6014
|
});
|
|
5681
6015
|
}
|
|
5682
6016
|
|
|
5683
|
-
// src/ui/repl.ts
|
|
5684
|
-
var COMMANDS = {};
|
|
5685
|
-
function registerInteractiveCommand(name, description, handler, options) {
|
|
5686
|
-
const def = { description, handler };
|
|
5687
|
-
if (options?.usage !== void 0) def.usage = options.usage;
|
|
5688
|
-
if (options?.options !== void 0) def.options = options.options;
|
|
5689
|
-
if (options?.examples !== void 0) def.examples = options.examples;
|
|
5690
|
-
COMMANDS[name] = def;
|
|
5691
|
-
}
|
|
5692
|
-
function showCommandHelp(commandName) {
|
|
5693
|
-
const cmd = COMMANDS[commandName];
|
|
5694
|
-
if (!cmd) {
|
|
5695
|
-
showError(`Unknown command: /${commandName}`);
|
|
5696
|
-
return;
|
|
5697
|
-
}
|
|
5698
|
-
logger.line();
|
|
5699
|
-
logger.log(pc16.bold(pc16.cyan(` /${commandName}`)) + pc16.dim(` - ${cmd.description}`));
|
|
5700
|
-
logger.line();
|
|
5701
|
-
if (cmd.usage) {
|
|
5702
|
-
logger.log(pc16.bold(" Usage:"));
|
|
5703
|
-
logger.log(` ${pc16.cyan(cmd.usage)}`);
|
|
5704
|
-
logger.line();
|
|
5705
|
-
}
|
|
5706
|
-
if (cmd.options && cmd.options.length > 0) {
|
|
5707
|
-
logger.log(pc16.bold(" Options:"));
|
|
5708
|
-
for (const opt of cmd.options) {
|
|
5709
|
-
logger.log(` ${pc16.yellow(opt.flag.padEnd(16))} ${pc16.dim(opt.description)}`);
|
|
5710
|
-
}
|
|
5711
|
-
logger.line();
|
|
5712
|
-
}
|
|
5713
|
-
if (cmd.examples && cmd.examples.length > 0) {
|
|
5714
|
-
logger.log(pc16.bold(" Examples:"));
|
|
5715
|
-
for (const example of cmd.examples) {
|
|
5716
|
-
logger.log(` ${pc16.dim("$")} ${pc16.cyan(example)}`);
|
|
5717
|
-
}
|
|
5718
|
-
logger.line();
|
|
5719
|
-
}
|
|
5720
|
-
}
|
|
5721
|
-
registerInteractiveCommand(
|
|
5722
|
-
"help",
|
|
5723
|
-
"Show available commands or help for a specific command",
|
|
5724
|
-
(args) => {
|
|
5725
|
-
const commandName = args.trim().toLowerCase().replace(/^\//, "");
|
|
5726
|
-
if (commandName) {
|
|
5727
|
-
showCommandHelp(commandName);
|
|
5728
|
-
return;
|
|
5729
|
-
}
|
|
5730
|
-
logger.line();
|
|
5731
|
-
logger.bold(" Available Commands:");
|
|
5732
|
-
logger.line();
|
|
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")}`);
|
|
5736
|
-
logger.line();
|
|
5737
|
-
const categories = {
|
|
5738
|
-
"Information": ["info", "version"],
|
|
5739
|
-
"Project": ["init", "config", "status"],
|
|
5740
|
-
"Providers": ["providers"],
|
|
5741
|
-
"Cognitives": ["add", "list", "uninstall"],
|
|
5742
|
-
"Sync": ["sync"],
|
|
5743
|
-
"Maintenance": ["update", "doctor", "clean", "purge"]
|
|
5744
|
-
};
|
|
5745
|
-
for (const [category, cmds] of Object.entries(categories)) {
|
|
5746
|
-
const availableCmds = cmds.filter((name) => COMMANDS[name]);
|
|
5747
|
-
if (availableCmds.length > 0) {
|
|
5748
|
-
logger.bold(` ${category}:`);
|
|
5749
|
-
for (const name of availableCmds) {
|
|
5750
|
-
const cmd = COMMANDS[name];
|
|
5751
|
-
const hasOptions = cmd?.options !== void 0 && cmd.options.length > 0;
|
|
5752
|
-
const paddedName = `/${name}`.padEnd(18);
|
|
5753
|
-
const optionsHint = hasOptions ? pc16.yellow(" [options]") : "";
|
|
5754
|
-
logger.log(` ${pc16.cyan(paddedName)} ${pc16.dim(cmd?.description ?? "")}${optionsHint}`);
|
|
5755
|
-
}
|
|
5756
|
-
logger.line();
|
|
5757
|
-
}
|
|
5758
|
-
}
|
|
5759
|
-
logger.hint("Tip: Use /help <command> for detailed help. Example: /help info");
|
|
5760
|
-
logger.line();
|
|
5761
|
-
},
|
|
5762
|
-
{
|
|
5763
|
-
usage: "/help [command]",
|
|
5764
|
-
examples: ["/help", "/help info", "/help add"]
|
|
5765
|
-
}
|
|
5766
|
-
);
|
|
6017
|
+
// src/ui/repl/commands.ts
|
|
5767
6018
|
registerInteractiveCommand("clear", "Clear the screen", (_args) => {
|
|
5768
6019
|
logger.clear();
|
|
5769
6020
|
showBanner();
|
|
@@ -5793,6 +6044,15 @@ registerInteractiveCommand(
|
|
|
5793
6044
|
examples: ["/info", "/info --cognitives", "/info --add"]
|
|
5794
6045
|
}
|
|
5795
6046
|
);
|
|
6047
|
+
registerInteractiveCommand("version", "Show version information", async (_args) => {
|
|
6048
|
+
const { version: version2 } = await Promise.resolve().then(() => (init_version(), version_exports));
|
|
6049
|
+
logger.line();
|
|
6050
|
+
logger.log(`${pc17.bold("SynapSync CLI")} ${pc17.cyan(`v${version2}`)}`);
|
|
6051
|
+
logger.line();
|
|
6052
|
+
logger.label("Node.js", process.version);
|
|
6053
|
+
logger.label("Platform", `${process.platform} ${process.arch}`);
|
|
6054
|
+
logger.line();
|
|
6055
|
+
});
|
|
5796
6056
|
registerInteractiveCommand(
|
|
5797
6057
|
"init",
|
|
5798
6058
|
"Initialize a new SynapSync project",
|
|
@@ -5861,22 +6121,12 @@ registerInteractiveCommand(
|
|
|
5861
6121
|
"add",
|
|
5862
6122
|
"Add a cognitive from registry, local path, or GitHub",
|
|
5863
6123
|
async (args) => {
|
|
5864
|
-
const
|
|
5865
|
-
|
|
5866
|
-
|
|
5867
|
-
|
|
5868
|
-
|
|
5869
|
-
|
|
5870
|
-
if (part === "--type" || part === "-t") {
|
|
5871
|
-
options["type"] = parts[++i] ?? "";
|
|
5872
|
-
} else if (part === "--category" || part === "-c") {
|
|
5873
|
-
options["category"] = parts[++i] ?? "";
|
|
5874
|
-
} else if (part === "--force" || part === "-f") {
|
|
5875
|
-
options["force"] = true;
|
|
5876
|
-
} else if (!part.startsWith("-")) {
|
|
5877
|
-
source = part;
|
|
5878
|
-
}
|
|
5879
|
-
}
|
|
6124
|
+
const { positional, options } = parseArgs(args, [
|
|
6125
|
+
{ flags: ["--type", "-t"], key: "type", type: "string" },
|
|
6126
|
+
{ flags: ["--category", "-c"], key: "category", type: "string" },
|
|
6127
|
+
{ flags: ["--force", "-f"], key: "force", type: "boolean" }
|
|
6128
|
+
]);
|
|
6129
|
+
const source = positional[0];
|
|
5880
6130
|
if (source === void 0 || source === "") {
|
|
5881
6131
|
logger.error("Please specify a cognitive to add.");
|
|
5882
6132
|
logger.hint("Usage: /add <name|path|github:user/repo>");
|
|
@@ -5903,23 +6153,13 @@ registerInteractiveCommand(
|
|
|
5903
6153
|
"list",
|
|
5904
6154
|
"List installed cognitives or browse registry",
|
|
5905
6155
|
async (args) => {
|
|
5906
|
-
const
|
|
5907
|
-
|
|
5908
|
-
|
|
5909
|
-
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
} else if (part === "--category" || part === "-c") {
|
|
5914
|
-
options["category"] = parts[++i] ?? "";
|
|
5915
|
-
} else if (part === "--tag") {
|
|
5916
|
-
options["tag"] = parts[++i] ?? "";
|
|
5917
|
-
} else if (part === "--remote" || part === "-r") {
|
|
5918
|
-
options["remote"] = true;
|
|
5919
|
-
} else if (part === "--json") {
|
|
5920
|
-
options["json"] = true;
|
|
5921
|
-
}
|
|
5922
|
-
}
|
|
6156
|
+
const { options } = parseArgs(args, [
|
|
6157
|
+
{ flags: ["--type", "-t"], key: "type", type: "string" },
|
|
6158
|
+
{ flags: ["--category", "-c"], key: "category", type: "string" },
|
|
6159
|
+
{ flags: ["--tag"], key: "tag", type: "string" },
|
|
6160
|
+
{ flags: ["--remote", "-r"], key: "remote", type: "boolean" },
|
|
6161
|
+
{ flags: ["--json"], key: "json", type: "boolean" }
|
|
6162
|
+
]);
|
|
5923
6163
|
await executeListCommand(options);
|
|
5924
6164
|
},
|
|
5925
6165
|
{
|
|
@@ -5931,27 +6171,23 @@ registerInteractiveCommand(
|
|
|
5931
6171
|
{ flag: "-r, --remote", description: "Browse all cognitives in registry" },
|
|
5932
6172
|
{ flag: "--json", description: "Output as JSON" }
|
|
5933
6173
|
],
|
|
5934
|
-
examples: [
|
|
6174
|
+
examples: [
|
|
6175
|
+
"/list",
|
|
6176
|
+
"/list --remote",
|
|
6177
|
+
"/list --remote --category planning",
|
|
6178
|
+
"/list --type skill"
|
|
6179
|
+
]
|
|
5935
6180
|
}
|
|
5936
6181
|
);
|
|
5937
6182
|
registerInteractiveCommand(
|
|
5938
6183
|
"uninstall",
|
|
5939
6184
|
"Uninstall a cognitive",
|
|
5940
6185
|
(args) => {
|
|
5941
|
-
const
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5945
|
-
|
|
5946
|
-
if (part === void 0 || part === "") continue;
|
|
5947
|
-
if (part === "--force" || part === "-f") {
|
|
5948
|
-
options["force"] = true;
|
|
5949
|
-
} else if (part === "--keep-files") {
|
|
5950
|
-
options["keepFiles"] = true;
|
|
5951
|
-
} else if (!part.startsWith("-")) {
|
|
5952
|
-
name = part;
|
|
5953
|
-
}
|
|
5954
|
-
}
|
|
6186
|
+
const { positional, options } = parseArgs(args, [
|
|
6187
|
+
{ flags: ["--force", "-f"], key: "force", type: "boolean" },
|
|
6188
|
+
{ flags: ["--keep-files"], key: "keepFiles", type: "boolean" }
|
|
6189
|
+
]);
|
|
6190
|
+
const name = positional[0];
|
|
5955
6191
|
if (name === void 0 || name === "") {
|
|
5956
6192
|
logger.error("Please specify a cognitive to uninstall.");
|
|
5957
6193
|
logger.hint("Usage: /uninstall <name> [--force]");
|
|
@@ -5972,33 +6208,17 @@ registerInteractiveCommand(
|
|
|
5972
6208
|
"sync",
|
|
5973
6209
|
"Sync cognitives to providers",
|
|
5974
6210
|
(args) => {
|
|
5975
|
-
const
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
5980
|
-
|
|
5981
|
-
|
|
5982
|
-
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
5986
|
-
options["type"] = parts[++i] ?? "";
|
|
5987
|
-
} else if (part === "--category" || part === "-c") {
|
|
5988
|
-
options["category"] = parts[++i] ?? "";
|
|
5989
|
-
} else if (part === "--provider" || part === "-p") {
|
|
5990
|
-
options["provider"] = parts[++i] ?? "";
|
|
5991
|
-
} else if (part === "--copy") {
|
|
5992
|
-
options["copy"] = true;
|
|
5993
|
-
} else if (part === "--force" || part === "-f") {
|
|
5994
|
-
options["force"] = true;
|
|
5995
|
-
} else if (part === "--verbose" || part === "-v") {
|
|
5996
|
-
options["verbose"] = true;
|
|
5997
|
-
} else if (part === "--json") {
|
|
5998
|
-
options["json"] = true;
|
|
5999
|
-
}
|
|
6000
|
-
}
|
|
6001
|
-
if (subcommand === "status") {
|
|
6211
|
+
const { positional, options } = parseArgs(args, [
|
|
6212
|
+
{ flags: ["--dry-run", "-n"], key: "dryRun", type: "boolean" },
|
|
6213
|
+
{ flags: ["--type", "-t"], key: "type", type: "string" },
|
|
6214
|
+
{ flags: ["--category", "-c"], key: "category", type: "string" },
|
|
6215
|
+
{ flags: ["--provider", "-p"], key: "provider", type: "string" },
|
|
6216
|
+
{ flags: ["--copy"], key: "copy", type: "boolean" },
|
|
6217
|
+
{ flags: ["--force", "-f"], key: "force", type: "boolean" },
|
|
6218
|
+
{ flags: ["--verbose", "-v"], key: "verbose", type: "boolean" },
|
|
6219
|
+
{ flags: ["--json"], key: "json", type: "boolean" }
|
|
6220
|
+
]);
|
|
6221
|
+
if (positional[0] === "status") {
|
|
6002
6222
|
executeSyncStatusCommand({ json: options["json"] === true });
|
|
6003
6223
|
} else {
|
|
6004
6224
|
executeSyncCommand(options);
|
|
@@ -6024,25 +6244,13 @@ registerInteractiveCommand(
|
|
|
6024
6244
|
"update",
|
|
6025
6245
|
"Update installed cognitives",
|
|
6026
6246
|
async (args) => {
|
|
6027
|
-
const
|
|
6028
|
-
|
|
6029
|
-
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
options["all"] = true;
|
|
6035
|
-
} else if (part === "--force" || part === "-f") {
|
|
6036
|
-
options["force"] = true;
|
|
6037
|
-
} else if (part === "--dry-run" || part === "-n") {
|
|
6038
|
-
options["dryRun"] = true;
|
|
6039
|
-
} else if (part === "--json") {
|
|
6040
|
-
options["json"] = true;
|
|
6041
|
-
} else if (!part.startsWith("-")) {
|
|
6042
|
-
name = part;
|
|
6043
|
-
}
|
|
6044
|
-
}
|
|
6045
|
-
await executeUpdateCommand(name, options);
|
|
6247
|
+
const { positional, options } = parseArgs(args, [
|
|
6248
|
+
{ flags: ["--all", "-a"], key: "all", type: "boolean" },
|
|
6249
|
+
{ flags: ["--force", "-f"], key: "force", type: "boolean" },
|
|
6250
|
+
{ flags: ["--dry-run", "-n"], key: "dryRun", type: "boolean" },
|
|
6251
|
+
{ flags: ["--json"], key: "json", type: "boolean" }
|
|
6252
|
+
]);
|
|
6253
|
+
await executeUpdateCommand(positional[0], options);
|
|
6046
6254
|
},
|
|
6047
6255
|
{
|
|
6048
6256
|
usage: "/update [name] [options]",
|
|
@@ -6059,19 +6267,11 @@ registerInteractiveCommand(
|
|
|
6059
6267
|
"doctor",
|
|
6060
6268
|
"Check project health and diagnose issues",
|
|
6061
6269
|
async (args) => {
|
|
6062
|
-
const
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
if (part === "--fix") {
|
|
6068
|
-
options["fix"] = true;
|
|
6069
|
-
} else if (part === "--verbose" || part === "-v") {
|
|
6070
|
-
options["verbose"] = true;
|
|
6071
|
-
} else if (part === "--json") {
|
|
6072
|
-
options["json"] = true;
|
|
6073
|
-
}
|
|
6074
|
-
}
|
|
6270
|
+
const { options } = parseArgs(args, [
|
|
6271
|
+
{ flags: ["--fix"], key: "fix", type: "boolean" },
|
|
6272
|
+
{ flags: ["--verbose", "-v"], key: "verbose", type: "boolean" },
|
|
6273
|
+
{ flags: ["--json"], key: "json", type: "boolean" }
|
|
6274
|
+
]);
|
|
6075
6275
|
await executeDoctorCommand(options);
|
|
6076
6276
|
},
|
|
6077
6277
|
{
|
|
@@ -6088,21 +6288,12 @@ registerInteractiveCommand(
|
|
|
6088
6288
|
"clean",
|
|
6089
6289
|
"Remove orphaned files and fix broken symlinks",
|
|
6090
6290
|
(args) => {
|
|
6091
|
-
const
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
options["dryRun"] = true;
|
|
6098
|
-
} else if (part === "--force" || part === "-f") {
|
|
6099
|
-
options["force"] = true;
|
|
6100
|
-
} else if (part === "--verbose" || part === "-v") {
|
|
6101
|
-
options["verbose"] = true;
|
|
6102
|
-
} else if (part === "--json") {
|
|
6103
|
-
options["json"] = true;
|
|
6104
|
-
}
|
|
6105
|
-
}
|
|
6291
|
+
const { options } = parseArgs(args, [
|
|
6292
|
+
{ flags: ["--dry-run", "-n"], key: "dryRun", type: "boolean" },
|
|
6293
|
+
{ flags: ["--force", "-f"], key: "force", type: "boolean" },
|
|
6294
|
+
{ flags: ["--verbose", "-v"], key: "verbose", type: "boolean" },
|
|
6295
|
+
{ flags: ["--json"], key: "json", type: "boolean" }
|
|
6296
|
+
]);
|
|
6106
6297
|
executeCleanCommand(options);
|
|
6107
6298
|
},
|
|
6108
6299
|
{
|
|
@@ -6120,32 +6311,26 @@ registerInteractiveCommand(
|
|
|
6120
6311
|
"purge",
|
|
6121
6312
|
"Completely remove SynapSync from the project",
|
|
6122
6313
|
(args) => {
|
|
6123
|
-
const
|
|
6124
|
-
|
|
6125
|
-
|
|
6126
|
-
if (part === "--force" || part === "-f") {
|
|
6127
|
-
options["force"] = true;
|
|
6128
|
-
}
|
|
6129
|
-
}
|
|
6314
|
+
const { options } = parseArgs(args, [
|
|
6315
|
+
{ flags: ["--force", "-f"], key: "force", type: "boolean" }
|
|
6316
|
+
]);
|
|
6130
6317
|
executePurgeCommand(options);
|
|
6131
6318
|
},
|
|
6132
6319
|
{
|
|
6133
6320
|
usage: "/purge [options]",
|
|
6134
|
-
options: [
|
|
6135
|
-
{ flag: "-f, --force", description: "Skip confirmation and remove everything" }
|
|
6136
|
-
],
|
|
6321
|
+
options: [{ flag: "-f, --force", description: "Skip confirmation and remove everything" }],
|
|
6137
6322
|
examples: ["/purge", "/purge --force"]
|
|
6138
6323
|
}
|
|
6139
6324
|
);
|
|
6140
|
-
|
|
6141
|
-
|
|
6142
|
-
|
|
6143
|
-
|
|
6144
|
-
|
|
6145
|
-
|
|
6146
|
-
|
|
6147
|
-
|
|
6148
|
-
|
|
6325
|
+
|
|
6326
|
+
// src/ui/repl/loop.ts
|
|
6327
|
+
init_esm_shims();
|
|
6328
|
+
import * as readline from "readline";
|
|
6329
|
+
import pc19 from "picocolors";
|
|
6330
|
+
|
|
6331
|
+
// src/ui/repl/dispatcher.ts
|
|
6332
|
+
init_esm_shims();
|
|
6333
|
+
import pc18 from "picocolors";
|
|
6149
6334
|
async function executeCommand(input) {
|
|
6150
6335
|
const trimmed = input.trim();
|
|
6151
6336
|
if (!trimmed) {
|
|
@@ -6153,7 +6338,7 @@ async function executeCommand(input) {
|
|
|
6153
6338
|
}
|
|
6154
6339
|
if (!trimmed.startsWith("/")) {
|
|
6155
6340
|
showError(`Unknown input. Commands must start with /`);
|
|
6156
|
-
logger.log(`${
|
|
6341
|
+
logger.log(`${pc18.dim("Type")} ${pc18.cyan("/help")} ${pc18.dim("for available commands.")}`);
|
|
6157
6342
|
return;
|
|
6158
6343
|
}
|
|
6159
6344
|
const parts = trimmed.slice(1).split(/\s+/);
|
|
@@ -6165,7 +6350,7 @@ async function executeCommand(input) {
|
|
|
6165
6350
|
const command = COMMANDS[commandName];
|
|
6166
6351
|
if (!command) {
|
|
6167
6352
|
showError(`Unknown command: /${commandName}`);
|
|
6168
|
-
logger.log(`${
|
|
6353
|
+
logger.log(`${pc18.dim("Type")} ${pc18.cyan("/help")} ${pc18.dim("for available commands.")}`);
|
|
6169
6354
|
return;
|
|
6170
6355
|
}
|
|
6171
6356
|
try {
|
|
@@ -6178,16 +6363,18 @@ async function executeCommand(input) {
|
|
|
6178
6363
|
}
|
|
6179
6364
|
}
|
|
6180
6365
|
}
|
|
6366
|
+
|
|
6367
|
+
// src/ui/repl/loop.ts
|
|
6181
6368
|
function startInteractiveMode() {
|
|
6182
6369
|
showBanner();
|
|
6183
6370
|
logger.log(
|
|
6184
|
-
`${
|
|
6371
|
+
`${pc19.dim("Type")} ${pc19.cyan("/help")} ${pc19.dim("for commands,")} ${pc19.cyan("/exit")} ${pc19.dim("to quit.")}`
|
|
6185
6372
|
);
|
|
6186
6373
|
logger.line();
|
|
6187
6374
|
const rl = readline.createInterface({
|
|
6188
6375
|
input: process.stdin,
|
|
6189
6376
|
output: process.stdout,
|
|
6190
|
-
prompt: `${
|
|
6377
|
+
prompt: `${pc19.green(CLI_NAME)} ${pc19.dim(">")} `,
|
|
6191
6378
|
terminal: true
|
|
6192
6379
|
});
|
|
6193
6380
|
rl.on("line", (line) => {
|
|
@@ -6213,7 +6400,7 @@ init_version();
|
|
|
6213
6400
|
|
|
6214
6401
|
// src/commands/help.ts
|
|
6215
6402
|
init_esm_shims();
|
|
6216
|
-
import
|
|
6403
|
+
import pc20 from "picocolors";
|
|
6217
6404
|
function registerHelpCommand(program) {
|
|
6218
6405
|
program.command("help [command]").description("Display help for a command").action((commandName) => {
|
|
6219
6406
|
if (commandName) {
|
|
@@ -6223,7 +6410,7 @@ function registerHelpCommand(program) {
|
|
|
6223
6410
|
} else {
|
|
6224
6411
|
logger.error(`Unknown command: ${commandName}`);
|
|
6225
6412
|
logger.line();
|
|
6226
|
-
logger.log(`Run ${
|
|
6413
|
+
logger.log(`Run ${pc20.cyan("synapsync --help")} to see available commands.`);
|
|
6227
6414
|
}
|
|
6228
6415
|
} else {
|
|
6229
6416
|
program.outputHelp();
|
|
@@ -6234,7 +6421,7 @@ function registerHelpCommand(program) {
|
|
|
6234
6421
|
// src/commands/version.ts
|
|
6235
6422
|
init_esm_shims();
|
|
6236
6423
|
init_version();
|
|
6237
|
-
import
|
|
6424
|
+
import pc21 from "picocolors";
|
|
6238
6425
|
var PACKAGE_NAME = "synapsync";
|
|
6239
6426
|
function compareVersions(a, b) {
|
|
6240
6427
|
const partsA = a.split(".").map(Number);
|
|
@@ -6275,12 +6462,14 @@ async function checkForUpdates() {
|
|
|
6275
6462
|
const comparison = compareVersions(version, latestVersion);
|
|
6276
6463
|
if (comparison < 0) {
|
|
6277
6464
|
logger.line();
|
|
6278
|
-
logger.warning(
|
|
6465
|
+
logger.warning(
|
|
6466
|
+
`Update available: ${pc21.cyan(`v${version}`)} \u2192 ${pc21.green(`v${latestVersion}`)}`
|
|
6467
|
+
);
|
|
6279
6468
|
logger.line();
|
|
6280
|
-
logger.log(` Run ${
|
|
6469
|
+
logger.log(` Run ${pc21.cyan("npm install -g synapsync")} to update`);
|
|
6281
6470
|
} else if (comparison > 0) {
|
|
6282
|
-
logger.info(`You are running a development version (${
|
|
6283
|
-
logger.log(` Latest published: ${
|
|
6471
|
+
logger.info(`You are running a development version (${pc21.cyan(`v${version}`)})`);
|
|
6472
|
+
logger.log(` Latest published: ${pc21.dim(`v${latestVersion}`)}`);
|
|
6284
6473
|
} else {
|
|
6285
6474
|
logger.success("You are using the latest version");
|
|
6286
6475
|
}
|
|
@@ -6288,7 +6477,7 @@ async function checkForUpdates() {
|
|
|
6288
6477
|
function registerVersionCommand(program) {
|
|
6289
6478
|
program.command("version").description("Show detailed version information").option("--check", "Check for available updates").action(async (options) => {
|
|
6290
6479
|
logger.line();
|
|
6291
|
-
logger.log(`${
|
|
6480
|
+
logger.log(`${pc21.bold("SynapSync CLI")} ${pc21.cyan(`v${version}`)}`);
|
|
6292
6481
|
logger.line();
|
|
6293
6482
|
logger.label("Node.js", process.version);
|
|
6294
6483
|
logger.label("Platform", `${process.platform} ${process.arch}`);
|