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.
Files changed (2) hide show
  1. package/index.ts +19 -16
  2. 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: strip whatever is there
885
- // (other extensions may inject extra skills), then rebuild
886
- // from our resolved skill set.
887
- const skillsOpen = "\n<available_skills>";
888
- const skillsIdx = content.indexOf(skillsOpen);
889
- if (skillsIdx >= 0) {
890
- const skillsEnd = content.indexOf("\n</available_skills>", skillsIdx);
891
- if (skillsEnd >= 0) {
892
- content =
893
- content.substring(0, skillsIdx) +
894
- content.substring(
895
- skillsEnd + "\n</available_skills>".length,
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
- // Rebuild clean skills block from our resolved config
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.6",
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": {