@aethrekh/pi-cs 0.1.7 → 0.1.8-alpha.0

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.
@@ -101,12 +101,22 @@ Just let me know!`;
101
101
  }
102
102
  // ─── Pi Extension Factory ──────────────────────────────────────────────────
103
103
  function default_1(pi) {
104
+ // Guard against sendUserMessage re-triggering this handler — warning text
105
+ // contains words like "graded" that would otherwise match medium-risk patterns.
106
+ let handlingWarning = false;
104
107
  pi.on("input", async (event) => {
105
- const skillMatch = event.text.match(/^\/skill:(\w+)/);
108
+ if (handlingWarning)
109
+ return { action: "continue" };
110
+ const skillMatch = event.text.match(/^\/skill:(\w+)\s*/);
106
111
  const skillName = skillMatch?.[1] ?? "";
107
- const result = checkIntegrityRisk(event.text, skillName);
112
+ // Strip /skill:name prefix so it doesn't trigger keyword patterns
113
+ // e.g. "/skill:homework explain X" should not match \bhomework\b
114
+ const userRequest = skillMatch ? event.text.slice(skillMatch[0].length) : event.text;
115
+ const result = checkIntegrityRisk(userRequest, skillName);
108
116
  if (result.warning) {
117
+ handlingWarning = true;
109
118
  pi.sendUserMessage(result.warning);
119
+ handlingWarning = false;
110
120
  return result.risk === "high"
111
121
  ? { action: "handled" }
112
122
  : { action: "continue" };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aethrekh/pi-cs",
3
- "version": "0.1.7",
3
+ "version": "0.1.8-alpha.0",
4
4
  "description": "Pisces — The CS Student Edition for Pi Coding Agent. Your personal AI teaching assistant from homework to thesis.",
5
5
  "keywords": [
6
6
  "academic",
package/pi-cs.meta.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-cs",
3
- "version": "0.1.7",
4
- "built_at": "2026-06-04T11:34:27.960Z",
3
+ "version": "0.1.8-alpha.0",
4
+ "built_at": "2026-06-04T13:04:47.680Z",
5
5
  "entry": "index.js",
6
6
  "node_minimum": "18.0.0"
7
7
  }
package/pi-package.yaml CHANGED
@@ -1,5 +1,5 @@
1
1
  name: pi-cs
2
- version: 0.1.7
2
+ version: 0.1.8-alpha.0
3
3
  display_name: "pi-cs (Pisces)"
4
4
  description: "The CS Student Edition for Pi — Your personal AI teaching assistant for Computer Science, from homework to thesis."
5
5
  icon: public/pisces-logo-512.png