@skillkit/agents 1.7.6 → 1.7.8
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 +40 -10
- package/dist/index.d.ts +12 -1
- package/dist/index.js +224 -129
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -603,17 +603,81 @@ ${skillsXml}
|
|
|
603
603
|
}
|
|
604
604
|
};
|
|
605
605
|
|
|
606
|
-
// src/
|
|
606
|
+
// src/factory.ts
|
|
607
607
|
import { existsSync as existsSync10 } from "fs";
|
|
608
608
|
import { join as join10 } from "path";
|
|
609
609
|
import { homedir as homedir10 } from "os";
|
|
610
610
|
import { AGENT_CONFIG as AGENT_CONFIG10 } from "@skillkit/core";
|
|
611
|
-
var config10 = AGENT_CONFIG10
|
|
611
|
+
var config10 = AGENT_CONFIG10.factory;
|
|
612
|
+
var FactoryAdapter = class {
|
|
613
|
+
type = "factory";
|
|
614
|
+
name = "Factory";
|
|
615
|
+
skillsDir = config10.skillsDir;
|
|
616
|
+
configFile = config10.configFile;
|
|
617
|
+
generateConfig(skills) {
|
|
618
|
+
const enabledSkills = skills.filter((s) => s.enabled);
|
|
619
|
+
if (enabledSkills.length === 0) {
|
|
620
|
+
return "";
|
|
621
|
+
}
|
|
622
|
+
const skillsXml = enabledSkills.map(createSkillXml).join("\n\n");
|
|
623
|
+
return `<skills_system priority="1">
|
|
624
|
+
|
|
625
|
+
## Available Skills
|
|
626
|
+
|
|
627
|
+
<!-- SKILLS_TABLE_START -->
|
|
628
|
+
<usage>
|
|
629
|
+
When users ask you to perform tasks, check if any of the available skills below can help complete the task more effectively. Skills provide specialized capabilities and domain knowledge.
|
|
630
|
+
|
|
631
|
+
How to use skills:
|
|
632
|
+
- Invoke: \`skillkit read <skill-name>\` or \`npx skillkit read <skill-name>\`
|
|
633
|
+
- The skill content will load with detailed instructions on how to complete the task
|
|
634
|
+
- Base directory provided in output for resolving bundled resources (references/, scripts/, assets/)
|
|
635
|
+
|
|
636
|
+
Usage notes:
|
|
637
|
+
- Only use skills listed in <available_skills> below
|
|
638
|
+
- Do not invoke a skill that is already loaded in your context
|
|
639
|
+
- Each skill invocation is stateless
|
|
640
|
+
</usage>
|
|
641
|
+
|
|
642
|
+
<available_skills>
|
|
643
|
+
|
|
644
|
+
${skillsXml}
|
|
645
|
+
|
|
646
|
+
</available_skills>
|
|
647
|
+
<!-- SKILLS_TABLE_END -->
|
|
648
|
+
|
|
649
|
+
</skills_system>`;
|
|
650
|
+
}
|
|
651
|
+
parseConfig(content) {
|
|
652
|
+
const skillNames = [];
|
|
653
|
+
const skillRegex = /<name>([^<]+)<\/name>/g;
|
|
654
|
+
let match;
|
|
655
|
+
while ((match = skillRegex.exec(content)) !== null) {
|
|
656
|
+
skillNames.push(match[1].trim());
|
|
657
|
+
}
|
|
658
|
+
return skillNames;
|
|
659
|
+
}
|
|
660
|
+
getInvokeCommand(skillName) {
|
|
661
|
+
return `skillkit read ${skillName}`;
|
|
662
|
+
}
|
|
663
|
+
async isDetected() {
|
|
664
|
+
const projectFactory = join10(process.cwd(), ".factory");
|
|
665
|
+
const globalFactory = join10(homedir10(), ".factory");
|
|
666
|
+
return existsSync10(projectFactory) || existsSync10(globalFactory);
|
|
667
|
+
}
|
|
668
|
+
};
|
|
669
|
+
|
|
670
|
+
// src/github-copilot.ts
|
|
671
|
+
import { existsSync as existsSync11 } from "fs";
|
|
672
|
+
import { join as join11 } from "path";
|
|
673
|
+
import { homedir as homedir11 } from "os";
|
|
674
|
+
import { AGENT_CONFIG as AGENT_CONFIG11 } from "@skillkit/core";
|
|
675
|
+
var config11 = AGENT_CONFIG11["github-copilot"];
|
|
612
676
|
var GitHubCopilotAdapter = class {
|
|
613
677
|
type = "github-copilot";
|
|
614
678
|
name = "GitHub Copilot";
|
|
615
|
-
skillsDir =
|
|
616
|
-
configFile =
|
|
679
|
+
skillsDir = config11.skillsDir;
|
|
680
|
+
configFile = config11.configFile;
|
|
617
681
|
generateConfig(skills) {
|
|
618
682
|
const enabledSkills = skills.filter((s) => s.enabled);
|
|
619
683
|
if (enabledSkills.length === 0) {
|
|
@@ -658,24 +722,24 @@ Each skill is self-contained with its own resources.
|
|
|
658
722
|
return `skillkit read ${skillName}`;
|
|
659
723
|
}
|
|
660
724
|
async isDetected() {
|
|
661
|
-
const copilotInstructions =
|
|
662
|
-
const githubInstructions =
|
|
663
|
-
const globalCopilot =
|
|
664
|
-
return
|
|
725
|
+
const copilotInstructions = join11(process.cwd(), ".github", "copilot-instructions.md");
|
|
726
|
+
const githubInstructions = join11(process.cwd(), ".github", "instructions");
|
|
727
|
+
const globalCopilot = join11(homedir11(), ".copilot");
|
|
728
|
+
return existsSync11(copilotInstructions) || existsSync11(githubInstructions) || existsSync11(globalCopilot);
|
|
665
729
|
}
|
|
666
730
|
};
|
|
667
731
|
|
|
668
732
|
// src/goose.ts
|
|
669
|
-
import { existsSync as
|
|
670
|
-
import { join as
|
|
671
|
-
import { homedir as
|
|
672
|
-
import { AGENT_CONFIG as
|
|
673
|
-
var
|
|
733
|
+
import { existsSync as existsSync12 } from "fs";
|
|
734
|
+
import { join as join12 } from "path";
|
|
735
|
+
import { homedir as homedir12 } from "os";
|
|
736
|
+
import { AGENT_CONFIG as AGENT_CONFIG12 } from "@skillkit/core";
|
|
737
|
+
var config12 = AGENT_CONFIG12.goose;
|
|
674
738
|
var GooseAdapter = class {
|
|
675
739
|
type = "goose";
|
|
676
740
|
name = "Goose";
|
|
677
|
-
skillsDir =
|
|
678
|
-
configFile =
|
|
741
|
+
skillsDir = config12.skillsDir;
|
|
742
|
+
configFile = config12.configFile;
|
|
679
743
|
generateConfig(skills) {
|
|
680
744
|
const enabledSkills = skills.filter((s) => s.enabled);
|
|
681
745
|
if (enabledSkills.length === 0) {
|
|
@@ -723,23 +787,23 @@ ${skillsXml}
|
|
|
723
787
|
return `skillkit read ${skillName}`;
|
|
724
788
|
}
|
|
725
789
|
async isDetected() {
|
|
726
|
-
const projectGoose =
|
|
727
|
-
const globalGoose =
|
|
728
|
-
return
|
|
790
|
+
const projectGoose = join12(process.cwd(), ".goose");
|
|
791
|
+
const globalGoose = join12(homedir12(), ".config", "goose");
|
|
792
|
+
return existsSync12(projectGoose) || existsSync12(globalGoose);
|
|
729
793
|
}
|
|
730
794
|
};
|
|
731
795
|
|
|
732
796
|
// src/kilo.ts
|
|
733
|
-
import { existsSync as
|
|
734
|
-
import { join as
|
|
735
|
-
import { homedir as
|
|
736
|
-
import { AGENT_CONFIG as
|
|
737
|
-
var
|
|
797
|
+
import { existsSync as existsSync13 } from "fs";
|
|
798
|
+
import { join as join13 } from "path";
|
|
799
|
+
import { homedir as homedir13 } from "os";
|
|
800
|
+
import { AGENT_CONFIG as AGENT_CONFIG13 } from "@skillkit/core";
|
|
801
|
+
var config13 = AGENT_CONFIG13.kilo;
|
|
738
802
|
var KiloAdapter = class {
|
|
739
803
|
type = "kilo";
|
|
740
804
|
name = "Kilo Code";
|
|
741
|
-
skillsDir =
|
|
742
|
-
configFile =
|
|
805
|
+
skillsDir = config13.skillsDir;
|
|
806
|
+
configFile = config13.configFile;
|
|
743
807
|
generateConfig(skills) {
|
|
744
808
|
const enabledSkills = skills.filter((s) => s.enabled);
|
|
745
809
|
if (enabledSkills.length === 0) {
|
|
@@ -787,24 +851,24 @@ ${skillsXml}
|
|
|
787
851
|
return `skillkit read ${skillName}`;
|
|
788
852
|
}
|
|
789
853
|
async isDetected() {
|
|
790
|
-
const projectKilo =
|
|
791
|
-
const globalKilo =
|
|
792
|
-
const kiloModes =
|
|
793
|
-
return
|
|
854
|
+
const projectKilo = join13(process.cwd(), ".kilocode");
|
|
855
|
+
const globalKilo = join13(homedir13(), ".kilocode");
|
|
856
|
+
const kiloModes = join13(process.cwd(), ".kilocode", "modes");
|
|
857
|
+
return existsSync13(projectKilo) || existsSync13(globalKilo) || existsSync13(kiloModes);
|
|
794
858
|
}
|
|
795
859
|
};
|
|
796
860
|
|
|
797
861
|
// src/kiro-cli.ts
|
|
798
|
-
import { existsSync as
|
|
799
|
-
import { join as
|
|
800
|
-
import { homedir as
|
|
801
|
-
import { AGENT_CONFIG as
|
|
802
|
-
var
|
|
862
|
+
import { existsSync as existsSync14 } from "fs";
|
|
863
|
+
import { join as join14 } from "path";
|
|
864
|
+
import { homedir as homedir14 } from "os";
|
|
865
|
+
import { AGENT_CONFIG as AGENT_CONFIG14 } from "@skillkit/core";
|
|
866
|
+
var config14 = AGENT_CONFIG14["kiro-cli"];
|
|
803
867
|
var KiroCliAdapter = class {
|
|
804
868
|
type = "kiro-cli";
|
|
805
869
|
name = "Kiro CLI";
|
|
806
|
-
skillsDir =
|
|
807
|
-
configFile =
|
|
870
|
+
skillsDir = config14.skillsDir;
|
|
871
|
+
configFile = config14.configFile;
|
|
808
872
|
generateConfig(skills) {
|
|
809
873
|
const enabledSkills = skills.filter((s) => s.enabled);
|
|
810
874
|
if (enabledSkills.length === 0) {
|
|
@@ -862,23 +926,23 @@ ${skillsXml}
|
|
|
862
926
|
return `skillkit read ${skillName}`;
|
|
863
927
|
}
|
|
864
928
|
async isDetected() {
|
|
865
|
-
const projectKiro =
|
|
866
|
-
const globalKiro =
|
|
867
|
-
return
|
|
929
|
+
const projectKiro = join14(process.cwd(), ".kiro");
|
|
930
|
+
const globalKiro = join14(homedir14(), ".kiro");
|
|
931
|
+
return existsSync14(projectKiro) || existsSync14(globalKiro);
|
|
868
932
|
}
|
|
869
933
|
};
|
|
870
934
|
|
|
871
935
|
// src/roo.ts
|
|
872
|
-
import { existsSync as
|
|
873
|
-
import { join as
|
|
874
|
-
import { homedir as
|
|
875
|
-
import { AGENT_CONFIG as
|
|
876
|
-
var
|
|
936
|
+
import { existsSync as existsSync15 } from "fs";
|
|
937
|
+
import { join as join15 } from "path";
|
|
938
|
+
import { homedir as homedir15 } from "os";
|
|
939
|
+
import { AGENT_CONFIG as AGENT_CONFIG15 } from "@skillkit/core";
|
|
940
|
+
var config15 = AGENT_CONFIG15.roo;
|
|
877
941
|
var RooAdapter = class {
|
|
878
942
|
type = "roo";
|
|
879
943
|
name = "Roo Code";
|
|
880
|
-
skillsDir =
|
|
881
|
-
configFile =
|
|
944
|
+
skillsDir = config15.skillsDir;
|
|
945
|
+
configFile = config15.configFile;
|
|
882
946
|
generateConfig(skills) {
|
|
883
947
|
const enabledSkills = skills.filter((s) => s.enabled);
|
|
884
948
|
if (enabledSkills.length === 0) {
|
|
@@ -926,24 +990,24 @@ ${skillsXml}
|
|
|
926
990
|
return `skillkit read ${skillName}`;
|
|
927
991
|
}
|
|
928
992
|
async isDetected() {
|
|
929
|
-
const projectRoo =
|
|
930
|
-
const globalRoo =
|
|
931
|
-
const rooModes =
|
|
932
|
-
return
|
|
993
|
+
const projectRoo = join15(process.cwd(), ".roo");
|
|
994
|
+
const globalRoo = join15(homedir15(), ".roo");
|
|
995
|
+
const rooModes = join15(process.cwd(), ".roo", "modes");
|
|
996
|
+
return existsSync15(projectRoo) || existsSync15(globalRoo) || existsSync15(rooModes);
|
|
933
997
|
}
|
|
934
998
|
};
|
|
935
999
|
|
|
936
1000
|
// src/trae.ts
|
|
937
|
-
import { existsSync as
|
|
938
|
-
import { join as
|
|
939
|
-
import { homedir as
|
|
940
|
-
import { AGENT_CONFIG as
|
|
941
|
-
var
|
|
1001
|
+
import { existsSync as existsSync16 } from "fs";
|
|
1002
|
+
import { join as join16 } from "path";
|
|
1003
|
+
import { homedir as homedir16 } from "os";
|
|
1004
|
+
import { AGENT_CONFIG as AGENT_CONFIG16 } from "@skillkit/core";
|
|
1005
|
+
var config16 = AGENT_CONFIG16.trae;
|
|
942
1006
|
var TraeAdapter = class {
|
|
943
1007
|
type = "trae";
|
|
944
1008
|
name = "Trae";
|
|
945
|
-
skillsDir =
|
|
946
|
-
configFile =
|
|
1009
|
+
skillsDir = config16.skillsDir;
|
|
1010
|
+
configFile = config16.configFile;
|
|
947
1011
|
generateConfig(skills) {
|
|
948
1012
|
const enabledSkills = skills.filter((s) => s.enabled);
|
|
949
1013
|
if (enabledSkills.length === 0) {
|
|
@@ -992,24 +1056,24 @@ Skills provide detailed instructions for completing complex tasks.
|
|
|
992
1056
|
return `skillkit read ${skillName}`;
|
|
993
1057
|
}
|
|
994
1058
|
async isDetected() {
|
|
995
|
-
const projectTrae =
|
|
996
|
-
const traeRulesDir =
|
|
997
|
-
const globalTrae =
|
|
998
|
-
return
|
|
1059
|
+
const projectTrae = join16(process.cwd(), ".trae");
|
|
1060
|
+
const traeRulesDir = join16(process.cwd(), ".trae", "rules");
|
|
1061
|
+
const globalTrae = join16(homedir16(), ".trae");
|
|
1062
|
+
return existsSync16(projectTrae) || existsSync16(traeRulesDir) || existsSync16(globalTrae);
|
|
999
1063
|
}
|
|
1000
1064
|
};
|
|
1001
1065
|
|
|
1002
1066
|
// src/windsurf.ts
|
|
1003
|
-
import { existsSync as
|
|
1004
|
-
import { join as
|
|
1005
|
-
import { homedir as
|
|
1006
|
-
import { AGENT_CONFIG as
|
|
1007
|
-
var
|
|
1067
|
+
import { existsSync as existsSync17 } from "fs";
|
|
1068
|
+
import { join as join17 } from "path";
|
|
1069
|
+
import { homedir as homedir17 } from "os";
|
|
1070
|
+
import { AGENT_CONFIG as AGENT_CONFIG17 } from "@skillkit/core";
|
|
1071
|
+
var config17 = AGENT_CONFIG17.windsurf;
|
|
1008
1072
|
var WindsurfAdapter = class {
|
|
1009
1073
|
type = "windsurf";
|
|
1010
1074
|
name = "Windsurf";
|
|
1011
|
-
skillsDir =
|
|
1012
|
-
configFile =
|
|
1075
|
+
skillsDir = config17.skillsDir;
|
|
1076
|
+
configFile = config17.configFile;
|
|
1013
1077
|
generateConfig(skills) {
|
|
1014
1078
|
const enabledSkills = skills.filter((s) => s.enabled);
|
|
1015
1079
|
if (enabledSkills.length === 0) {
|
|
@@ -1058,23 +1122,23 @@ Each skill is self-contained with its own resources.
|
|
|
1058
1122
|
return `skillkit read ${skillName}`;
|
|
1059
1123
|
}
|
|
1060
1124
|
async isDetected() {
|
|
1061
|
-
const projectWindsurf =
|
|
1062
|
-
const projectRulesDir =
|
|
1063
|
-
const globalWindsurf =
|
|
1064
|
-
return
|
|
1125
|
+
const projectWindsurf = join17(process.cwd(), ".windsurf");
|
|
1126
|
+
const projectRulesDir = join17(process.cwd(), ".windsurf", "rules");
|
|
1127
|
+
const globalWindsurf = join17(homedir17(), ".codeium", "windsurf");
|
|
1128
|
+
return existsSync17(projectWindsurf) || existsSync17(projectRulesDir) || existsSync17(globalWindsurf);
|
|
1065
1129
|
}
|
|
1066
1130
|
};
|
|
1067
1131
|
|
|
1068
1132
|
// src/universal.ts
|
|
1069
|
-
import { existsSync as
|
|
1070
|
-
import { join as
|
|
1071
|
-
import { AGENT_CONFIG as
|
|
1072
|
-
var
|
|
1133
|
+
import { existsSync as existsSync18 } from "fs";
|
|
1134
|
+
import { join as join18 } from "path";
|
|
1135
|
+
import { AGENT_CONFIG as AGENT_CONFIG18 } from "@skillkit/core";
|
|
1136
|
+
var config18 = AGENT_CONFIG18.universal;
|
|
1073
1137
|
var UniversalAdapter = class {
|
|
1074
1138
|
type = "universal";
|
|
1075
1139
|
name = "Universal (Any Agent)";
|
|
1076
|
-
skillsDir =
|
|
1077
|
-
configFile =
|
|
1140
|
+
skillsDir = config18.skillsDir;
|
|
1141
|
+
configFile = config18.configFile;
|
|
1078
1142
|
generateConfig(skills) {
|
|
1079
1143
|
const enabledSkills = skills.filter((s) => s.enabled);
|
|
1080
1144
|
if (enabledSkills.length === 0) {
|
|
@@ -1144,9 +1208,9 @@ ${skillsXml}
|
|
|
1144
1208
|
return `skillkit read ${skillName}`;
|
|
1145
1209
|
}
|
|
1146
1210
|
async isDetected() {
|
|
1147
|
-
const agentDir =
|
|
1148
|
-
const agentsMd =
|
|
1149
|
-
return
|
|
1211
|
+
const agentDir = join18(process.cwd(), ".agent");
|
|
1212
|
+
const agentsMd = join18(process.cwd(), "AGENTS.md");
|
|
1213
|
+
return existsSync18(agentDir) || existsSync18(agentsMd);
|
|
1150
1214
|
}
|
|
1151
1215
|
};
|
|
1152
1216
|
|
|
@@ -1154,14 +1218,14 @@ ${skillsXml}
|
|
|
1154
1218
|
import { minimatch } from "minimatch";
|
|
1155
1219
|
var PermissionManager = class {
|
|
1156
1220
|
config;
|
|
1157
|
-
constructor(
|
|
1158
|
-
this.config =
|
|
1221
|
+
constructor(config19) {
|
|
1222
|
+
this.config = config19 || { default: "ask" };
|
|
1159
1223
|
}
|
|
1160
1224
|
/**
|
|
1161
1225
|
* Set permission configuration
|
|
1162
1226
|
*/
|
|
1163
|
-
setConfig(
|
|
1164
|
-
this.config =
|
|
1227
|
+
setConfig(config19) {
|
|
1228
|
+
this.config = config19;
|
|
1165
1229
|
}
|
|
1166
1230
|
/**
|
|
1167
1231
|
* Get permission configuration
|
|
@@ -1309,20 +1373,20 @@ var PermissionManager = class {
|
|
|
1309
1373
|
* Parse permissions from SKILL.md metadata
|
|
1310
1374
|
*/
|
|
1311
1375
|
static fromMetadata(metadata) {
|
|
1312
|
-
const
|
|
1376
|
+
const config19 = {};
|
|
1313
1377
|
if (metadata.filePermissions && Array.isArray(metadata.filePermissions)) {
|
|
1314
|
-
|
|
1378
|
+
config19.files = metadata.filePermissions;
|
|
1315
1379
|
}
|
|
1316
1380
|
if (metadata.commandPermissions && Array.isArray(metadata.commandPermissions)) {
|
|
1317
|
-
|
|
1381
|
+
config19.commands = metadata.commandPermissions;
|
|
1318
1382
|
}
|
|
1319
1383
|
if (metadata.networkPermissions && Array.isArray(metadata.networkPermissions)) {
|
|
1320
|
-
|
|
1384
|
+
config19.network = metadata.networkPermissions;
|
|
1321
1385
|
}
|
|
1322
1386
|
if (metadata.defaultPermission) {
|
|
1323
|
-
|
|
1387
|
+
config19.default = metadata.defaultPermission;
|
|
1324
1388
|
}
|
|
1325
|
-
return
|
|
1389
|
+
return config19;
|
|
1326
1390
|
}
|
|
1327
1391
|
/**
|
|
1328
1392
|
* Merge two permission configs
|
|
@@ -1337,8 +1401,8 @@ var PermissionManager = class {
|
|
|
1337
1401
|
};
|
|
1338
1402
|
}
|
|
1339
1403
|
};
|
|
1340
|
-
function createPermissionManager(
|
|
1341
|
-
return new PermissionManager(
|
|
1404
|
+
function createPermissionManager(config19) {
|
|
1405
|
+
return new PermissionManager(config19);
|
|
1342
1406
|
}
|
|
1343
1407
|
function isAllowed(level) {
|
|
1344
1408
|
return level === "allow";
|
|
@@ -1356,10 +1420,10 @@ var GlobMatcher = class {
|
|
|
1356
1420
|
config;
|
|
1357
1421
|
includePatterns;
|
|
1358
1422
|
excludePatterns;
|
|
1359
|
-
constructor(
|
|
1360
|
-
this.config =
|
|
1361
|
-
this.includePatterns =
|
|
1362
|
-
this.excludePatterns = (
|
|
1423
|
+
constructor(config19) {
|
|
1424
|
+
this.config = config19;
|
|
1425
|
+
this.includePatterns = config19.include.map((p) => this.patternToRegex(p));
|
|
1426
|
+
this.excludePatterns = (config19.exclude || []).map((p) => this.patternToRegex(p));
|
|
1363
1427
|
}
|
|
1364
1428
|
/**
|
|
1365
1429
|
* Check if a file matches the glob patterns
|
|
@@ -1459,8 +1523,8 @@ var GlobMatcher = class {
|
|
|
1459
1523
|
return `globs: ${JSON.stringify(globs)}`;
|
|
1460
1524
|
}
|
|
1461
1525
|
};
|
|
1462
|
-
function createGlobMatcher(
|
|
1463
|
-
return new GlobMatcher(
|
|
1526
|
+
function createGlobMatcher(config19) {
|
|
1527
|
+
return new GlobMatcher(config19);
|
|
1464
1528
|
}
|
|
1465
1529
|
function matchPattern(pattern) {
|
|
1466
1530
|
return new GlobMatcher({ include: [pattern] });
|
|
@@ -1878,8 +1942,8 @@ var ModeManager = class {
|
|
|
1878
1942
|
/**
|
|
1879
1943
|
* Add a mode configuration
|
|
1880
1944
|
*/
|
|
1881
|
-
addMode(
|
|
1882
|
-
this.modes.set(
|
|
1945
|
+
addMode(config19) {
|
|
1946
|
+
this.modes.set(config19.mode, config19);
|
|
1883
1947
|
}
|
|
1884
1948
|
/**
|
|
1885
1949
|
* Get a mode configuration
|
|
@@ -1903,14 +1967,14 @@ var ModeManager = class {
|
|
|
1903
1967
|
* Set the current mode
|
|
1904
1968
|
*/
|
|
1905
1969
|
setMode(mode) {
|
|
1906
|
-
const
|
|
1907
|
-
if (!
|
|
1970
|
+
const config19 = this.modes.get(mode);
|
|
1971
|
+
if (!config19) {
|
|
1908
1972
|
throw new Error(`Mode not configured: ${mode}`);
|
|
1909
1973
|
}
|
|
1910
1974
|
const previousMode = this.currentMode;
|
|
1911
1975
|
this.currentMode = mode;
|
|
1912
1976
|
for (const listener of this.modeListeners) {
|
|
1913
|
-
listener(mode, previousMode,
|
|
1977
|
+
listener(mode, previousMode, config19);
|
|
1914
1978
|
}
|
|
1915
1979
|
}
|
|
1916
1980
|
/**
|
|
@@ -1929,15 +1993,15 @@ var ModeManager = class {
|
|
|
1929
1993
|
* Get skills for current mode
|
|
1930
1994
|
*/
|
|
1931
1995
|
getCurrentSkills() {
|
|
1932
|
-
const
|
|
1933
|
-
return
|
|
1996
|
+
const config19 = this.getCurrentModeConfig();
|
|
1997
|
+
return config19?.skills || [];
|
|
1934
1998
|
}
|
|
1935
1999
|
/**
|
|
1936
2000
|
* Get tools for current mode
|
|
1937
2001
|
*/
|
|
1938
2002
|
getCurrentTools() {
|
|
1939
|
-
const
|
|
1940
|
-
return
|
|
2003
|
+
const config19 = this.getCurrentModeConfig();
|
|
2004
|
+
return config19?.tools || [];
|
|
1941
2005
|
}
|
|
1942
2006
|
/**
|
|
1943
2007
|
* Check if a skill is available in current mode
|
|
@@ -1950,11 +2014,11 @@ var ModeManager = class {
|
|
|
1950
2014
|
* Check if a file is allowed in current mode
|
|
1951
2015
|
*/
|
|
1952
2016
|
isFileAllowed(filePath) {
|
|
1953
|
-
const
|
|
1954
|
-
if (!
|
|
2017
|
+
const config19 = this.getCurrentModeConfig();
|
|
2018
|
+
if (!config19?.allowedFiles || config19.allowedFiles.length === 0) {
|
|
1955
2019
|
return true;
|
|
1956
2020
|
}
|
|
1957
|
-
const matcher = new GlobMatcher({ include:
|
|
2021
|
+
const matcher = new GlobMatcher({ include: config19.allowedFiles });
|
|
1958
2022
|
return matcher.matches(filePath);
|
|
1959
2023
|
}
|
|
1960
2024
|
/**
|
|
@@ -1983,20 +2047,20 @@ var ModeManager = class {
|
|
|
1983
2047
|
* Generate mode-specific prompt prefix
|
|
1984
2048
|
*/
|
|
1985
2049
|
getPromptPrefix() {
|
|
1986
|
-
const
|
|
1987
|
-
return
|
|
2050
|
+
const config19 = this.getCurrentModeConfig();
|
|
2051
|
+
return config19?.promptPrefix || "";
|
|
1988
2052
|
}
|
|
1989
2053
|
/**
|
|
1990
2054
|
* Generate Roo-compatible mode configuration
|
|
1991
2055
|
*/
|
|
1992
2056
|
generateRooConfig() {
|
|
1993
2057
|
const modes = {};
|
|
1994
|
-
for (const
|
|
1995
|
-
modes[
|
|
1996
|
-
description:
|
|
1997
|
-
skills:
|
|
1998
|
-
tools:
|
|
1999
|
-
promptPrefix:
|
|
2058
|
+
for (const config19 of this.modes.values()) {
|
|
2059
|
+
modes[config19.mode] = {
|
|
2060
|
+
description: config19.description,
|
|
2061
|
+
skills: config19.skills,
|
|
2062
|
+
tools: config19.tools,
|
|
2063
|
+
promptPrefix: config19.promptPrefix
|
|
2000
2064
|
};
|
|
2001
2065
|
}
|
|
2002
2066
|
return {
|
|
@@ -2011,23 +2075,23 @@ var ModeManager = class {
|
|
|
2011
2075
|
const lines = [];
|
|
2012
2076
|
lines.push("# Available Modes");
|
|
2013
2077
|
lines.push("");
|
|
2014
|
-
for (const
|
|
2015
|
-
lines.push(`## ${
|
|
2078
|
+
for (const config19 of this.modes.values()) {
|
|
2079
|
+
lines.push(`## ${config19.mode}`);
|
|
2016
2080
|
lines.push("");
|
|
2017
|
-
lines.push(
|
|
2081
|
+
lines.push(config19.description);
|
|
2018
2082
|
lines.push("");
|
|
2019
|
-
if (
|
|
2083
|
+
if (config19.skills.length > 0) {
|
|
2020
2084
|
lines.push("### Skills");
|
|
2021
2085
|
lines.push("");
|
|
2022
|
-
for (const skill of
|
|
2086
|
+
for (const skill of config19.skills) {
|
|
2023
2087
|
lines.push(`- ${skill}`);
|
|
2024
2088
|
}
|
|
2025
2089
|
lines.push("");
|
|
2026
2090
|
}
|
|
2027
|
-
if (
|
|
2091
|
+
if (config19.tools && config19.tools.length > 0) {
|
|
2028
2092
|
lines.push("### Tools");
|
|
2029
2093
|
lines.push("");
|
|
2030
|
-
for (const tool of
|
|
2094
|
+
for (const tool of config19.tools) {
|
|
2031
2095
|
lines.push(`- ${tool}`);
|
|
2032
2096
|
}
|
|
2033
2097
|
lines.push("");
|
|
@@ -2041,10 +2105,10 @@ function createModeManager(modes) {
|
|
|
2041
2105
|
}
|
|
2042
2106
|
function createDefaultModeManager(skillsPerMode) {
|
|
2043
2107
|
const manager = new ModeManager();
|
|
2044
|
-
for (const [mode,
|
|
2108
|
+
for (const [mode, config19] of Object.entries(DEFAULT_MODES)) {
|
|
2045
2109
|
const skills = skillsPerMode[mode] || [];
|
|
2046
2110
|
manager.addMode({
|
|
2047
|
-
...
|
|
2111
|
+
...config19,
|
|
2048
2112
|
skills
|
|
2049
2113
|
});
|
|
2050
2114
|
}
|
|
@@ -2073,7 +2137,22 @@ var adapters = {
|
|
|
2073
2137
|
roo: new RooAdapter(),
|
|
2074
2138
|
trae: new TraeAdapter(),
|
|
2075
2139
|
windsurf: new WindsurfAdapter(),
|
|
2076
|
-
universal: new UniversalAdapter()
|
|
2140
|
+
universal: new UniversalAdapter(),
|
|
2141
|
+
cline: new UniversalAdapter(),
|
|
2142
|
+
codebuddy: new UniversalAdapter(),
|
|
2143
|
+
commandcode: new UniversalAdapter(),
|
|
2144
|
+
continue: new UniversalAdapter(),
|
|
2145
|
+
crush: new UniversalAdapter(),
|
|
2146
|
+
factory: new FactoryAdapter(),
|
|
2147
|
+
mcpjam: new UniversalAdapter(),
|
|
2148
|
+
mux: new UniversalAdapter(),
|
|
2149
|
+
neovate: new UniversalAdapter(),
|
|
2150
|
+
openhands: new UniversalAdapter(),
|
|
2151
|
+
pi: new UniversalAdapter(),
|
|
2152
|
+
qoder: new UniversalAdapter(),
|
|
2153
|
+
qwen: new UniversalAdapter(),
|
|
2154
|
+
vercel: new UniversalAdapter(),
|
|
2155
|
+
zencoder: new UniversalAdapter()
|
|
2077
2156
|
};
|
|
2078
2157
|
function getAdapter(type) {
|
|
2079
2158
|
return adapters[type];
|
|
@@ -2099,6 +2178,21 @@ async function detectAgent() {
|
|
|
2099
2178
|
"roo",
|
|
2100
2179
|
"trae",
|
|
2101
2180
|
"windsurf",
|
|
2181
|
+
"cline",
|
|
2182
|
+
"codebuddy",
|
|
2183
|
+
"commandcode",
|
|
2184
|
+
"continue",
|
|
2185
|
+
"crush",
|
|
2186
|
+
"factory",
|
|
2187
|
+
"mcpjam",
|
|
2188
|
+
"mux",
|
|
2189
|
+
"neovate",
|
|
2190
|
+
"openhands",
|
|
2191
|
+
"pi",
|
|
2192
|
+
"qoder",
|
|
2193
|
+
"qwen",
|
|
2194
|
+
"vercel",
|
|
2195
|
+
"zencoder",
|
|
2102
2196
|
"universal"
|
|
2103
2197
|
];
|
|
2104
2198
|
for (const type of checkOrder) {
|
|
@@ -2120,6 +2214,7 @@ export {
|
|
|
2120
2214
|
CodexAdapter,
|
|
2121
2215
|
CursorAdapter,
|
|
2122
2216
|
DroidAdapter,
|
|
2217
|
+
FactoryAdapter,
|
|
2123
2218
|
GeminiCliAdapter,
|
|
2124
2219
|
GitHubCopilotAdapter,
|
|
2125
2220
|
GlobMatcher,
|