pi-agents-switch 0.2.6 → 0.2.7
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/index.ts +19 -16
- package/package.json +1 -1
package/index.ts
CHANGED
|
@@ -881,24 +881,27 @@ export default function agentsSwitch(pi: ExtensionAPI) {
|
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
883
|
|
|
884
|
-
// Replace <available_skills> block:
|
|
885
|
-
//
|
|
886
|
-
//
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
884
|
+
// Replace <available_skills> block: only touch skills when the agent
|
|
885
|
+
// has explicit skill config (skillNames.length > 0).
|
|
886
|
+
// For agents without skill config, leave Pi's default skills intact.
|
|
887
|
+
if (currentResolved.skillNames.length > 0) {
|
|
888
|
+
const skillsOpen = "\n<available_skills>";
|
|
889
|
+
const skillsIdx = content.indexOf(skillsOpen);
|
|
890
|
+
if (skillsIdx >= 0) {
|
|
891
|
+
const skillsEnd = content.indexOf(
|
|
892
|
+
"\n</available_skills>",
|
|
893
|
+
skillsIdx,
|
|
894
|
+
);
|
|
895
|
+
if (skillsEnd >= 0) {
|
|
896
|
+
content =
|
|
897
|
+
content.substring(0, skillsIdx) +
|
|
898
|
+
content.substring(
|
|
899
|
+
skillsEnd + "\n</available_skills>".length,
|
|
900
|
+
);
|
|
901
|
+
}
|
|
897
902
|
}
|
|
898
|
-
}
|
|
899
903
|
|
|
900
|
-
|
|
901
|
-
if (currentResolved.skillNames.length > 0) {
|
|
904
|
+
// Rebuild clean skills block from our resolved config
|
|
902
905
|
const selectedSkills = pm.getSkillObjects(
|
|
903
906
|
currentResolved.skillNames,
|
|
904
907
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-agents-switch",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.7",
|
|
4
4
|
"description": "Tab to switch primary agents in Pi — like OpenCode's agent switching. Each agent gets an isolated profile with its own AGENTS.md, extensions, skills, and settings.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"pi": {
|