@aethrekh/pi-cs 0.2.0-alpha.1 → 0.2.0-alpha.3

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/CHANGELOG.md CHANGED
@@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ---
9
9
 
10
+ ## [0.2.0-alpha.3](https://github.com/AshishBagdane/pi-cs/compare/v0.2.0-alpha.2...v0.2.0-alpha.3) (2026-06-05)
11
+
12
+ ### ### Fixed
13
+
14
+ * remove pi.skills from package.json so Pi doesn't load skills globally ([ada95e5](https://github.com/AshishBagdane/pi-cs/commit/ada95e5a5088fe38ad439f408092663e4cdf8090))
15
+ * use ctx.cwd/event.cwd instead of process.cwd() in all extension handlers ([10f6d85](https://github.com/AshishBagdane/pi-cs/commit/10f6d853d58181a69efa5efc1d4b9de02b532c33))
16
+
17
+ ## [0.2.0-alpha.2](https://github.com/AshishBagdane/pi-cs/compare/v0.2.0-alpha.1...v0.2.0-alpha.2) (2026-06-05)
18
+
19
+ ### ### Fixed
20
+
21
+ * gate persona and skills to active Pisces workspaces ([3949f96](https://github.com/AshishBagdane/pi-cs/commit/3949f96f391306811c71e3290cb36eae3af14f42))
22
+
10
23
  ## [0.2.0-alpha.1](https://github.com/AshishBagdane/pi-cs/compare/v0.2.0-alpha.0...v0.2.0-alpha.1) (2026-06-05)
11
24
 
12
25
  ### ### Fixed
@@ -189,9 +189,9 @@ function summarizeFolderContext(result) {
189
189
  }
190
190
  // ─── Pi Extension Factory ──────────────────────────────────────────────────
191
191
  function default_1(pi) {
192
- pi.on("before_agent_start", async (event) => {
192
+ pi.on("before_agent_start", async (event, ctx) => {
193
193
  // Re-check workspace on every agent turn — no closure state needed.
194
- if (!(0, workspace_1.findPiscesMarker)())
194
+ if (!(0, workspace_1.findPiscesMarker)(ctx.cwd))
195
195
  return;
196
196
  const summary = summarizeFolderContext(detectFolderContext());
197
197
  if (!summary)
@@ -106,14 +106,14 @@ function default_1(pi) {
106
106
  // Guard against sendUserMessage re-triggering this handler — warning text
107
107
  // contains words like "graded" that would otherwise match medium-risk patterns.
108
108
  let handlingWarning = false;
109
- pi.on("session_start", async () => {
110
- isActive = (0, workspace_1.findPiscesMarker)() !== null;
109
+ pi.on("session_start", async (_event, ctx) => {
110
+ isActive = (0, workspace_1.findPiscesMarker)(ctx.cwd) !== null;
111
111
  });
112
112
  // Refresh isActive before each agent turn so mid-session workspace changes
113
113
  // are picked up. The input handler may still use a one-turn-stale value for
114
114
  // messages that arrive before the first before_agent_start of a new turn.
115
- pi.on("before_agent_start", async () => {
116
- isActive = (0, workspace_1.findPiscesMarker)() !== null;
115
+ pi.on("before_agent_start", async (_event, ctx) => {
116
+ isActive = (0, workspace_1.findPiscesMarker)(ctx.cwd) !== null;
117
117
  });
118
118
  pi.on("input", async (event) => {
119
119
  if (!isActive)
@@ -164,8 +164,8 @@ function default_1(pi) {
164
164
  const skillsUsed = [];
165
165
  let isActive = false;
166
166
  let workspaceRoot = null;
167
- pi.on("session_start", async () => {
168
- workspaceRoot = (0, workspace_1.findPiscesMarker)();
167
+ pi.on("session_start", async (_event, ctx) => {
168
+ workspaceRoot = (0, workspace_1.findPiscesMarker)(ctx.cwd);
169
169
  isActive = workspaceRoot !== null;
170
170
  });
171
171
  pi.on("input", async (event) => {
@@ -179,7 +179,7 @@ function default_1(pi) {
179
179
  });
180
180
  pi.on("before_agent_start", async (_event, ctx) => {
181
181
  // Refresh workspace state on every agent turn so mid-session changes are reflected.
182
- workspaceRoot = (0, workspace_1.findPiscesMarker)();
182
+ workspaceRoot = (0, workspace_1.findPiscesMarker)(ctx.cwd);
183
183
  isActive = workspaceRoot !== null;
184
184
  if (!isActive)
185
185
  return;
@@ -219,9 +219,9 @@ function default_1(pi) {
219
219
  ` ${workspace_1.PISCES_MARKER} created.`,
220
220
  ``,
221
221
  `All Pi sessions in this directory tree will now activate Pisces.`,
222
- ``,
223
- `Run /semester --init to set up semester context, or start working right away.`,
222
+ `Reloading to register Pisces skills (/homework, /explain, etc.)...`,
224
223
  ].join("\n"), "info");
224
+ await ctx.reload();
225
225
  }
226
226
  catch (err) {
227
227
  ctx.ui.notify(`❌ Failed to create ${workspace_1.PISCES_MARKER}: ${String(err)}`, "error");
@@ -239,7 +239,8 @@ function default_1(pi) {
239
239
  const removed = workspaceRoot;
240
240
  workspaceRoot = null;
241
241
  isActive = false;
242
- ctx.ui.notify(`✅ Workspace deactivated.\n Removed ${workspace_1.PISCES_MARKER} from: ${removed}\n\nTakes full effect on next session start.`, "info");
242
+ ctx.ui.notify(`✅ Workspace deactivated.\n Removed ${workspace_1.PISCES_MARKER} from: ${removed}\n\nReloading to unregister Pisces skills...`, "info");
243
+ await ctx.reload();
243
244
  }
244
245
  catch (err) {
245
246
  ctx.ui.notify(`❌ Failed to remove ${workspace_1.PISCES_MARKER}: ${String(err)}`, "error");
@@ -224,8 +224,17 @@ function removeLegacyGlobalPersona(persona) {
224
224
  function default_1(pi) {
225
225
  const persona = loadPersona();
226
226
  let semesterCtx = null;
227
+ // Dynamically register skills only when a Pisces workspace is active.
228
+ // Skills are absent outside a workspace — they never appear in the global command list.
229
+ pi.on("resources_discover", async (event) => {
230
+ if (!(0, workspace_1.findPiscesMarker)(event.cwd))
231
+ return;
232
+ // Relative path works for both pack (extensions/ → skills/) and dev (src/extensions/ → src/skills/) layouts
233
+ const skillsDir = path.resolve(__dirname, "../skills");
234
+ return fs.existsSync(skillsDir) ? { skillPaths: [skillsDir] } : undefined;
235
+ });
227
236
  pi.on("session_start", async (_event, ctx) => {
228
- if (!(0, workspace_1.findPiscesMarker)())
237
+ if (!(0, workspace_1.findPiscesMarker)(ctx.cwd))
229
238
  return;
230
239
  if (removeLegacyGlobalPersona(persona)) {
231
240
  ctx.ui.notify("🐠 Pisces: cleaned up a stale ~/.pi/agent/APPEND_SYSTEM.md from an older install. Persona is now session-scoped.", "info");
@@ -240,10 +249,10 @@ function default_1(pi) {
240
249
  ctx.ui.notify("🐠 Pisces loaded — no SEMESTER.md found. Create one to enable context awareness.", "info");
241
250
  }
242
251
  });
243
- pi.on("before_agent_start", async (event) => {
252
+ pi.on("before_agent_start", async (event, ctx) => {
244
253
  // Re-check workspace on every agent turn so mid-session activation/deactivation
245
254
  // is reflected without needing a session restart.
246
- if (!(0, workspace_1.findPiscesMarker)())
255
+ if (!(0, workspace_1.findPiscesMarker)(ctx.cwd))
247
256
  return;
248
257
  // Lazy-load semester context if it was not available at session_start
249
258
  // (e.g. workspace was activated mid-session via /pisces --activate).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aethrekh/pi-cs",
3
- "version": "0.2.0-alpha.1",
3
+ "version": "0.2.0-alpha.3",
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",
@@ -37,9 +37,6 @@
37
37
  "./extensions/folder-detector.js",
38
38
  "./extensions/integrity-guard.js",
39
39
  "./extensions/progress-tracker.js"
40
- ],
41
- "skills": [
42
- "./skills"
43
40
  ]
44
41
  },
45
42
  "scripts": {
package/pi-cs.meta.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pi-cs",
3
- "version": "0.2.0-alpha.1",
4
- "built_at": "2026-06-05T16:24:49.514Z",
3
+ "version": "0.2.0-alpha.3",
4
+ "built_at": "2026-06-05T17:49:06.388Z",
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.2.0-alpha.1
2
+ version: 0.2.0-alpha.3
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
@@ -7,36 +7,6 @@ author: ""
7
7
  license: MIT
8
8
  pi_version: ">=1.0.0"
9
9
 
10
- # Core system prompt that defines the academic persona
11
- system: SYSTEM.md
12
-
13
- # Skills (slash commands) registered by this package
14
- skills:
15
- - name: homework
16
- path: skills/homework/SKILL.md
17
- description: "Break down problems, provide guided hints, and walk through step-by-step implementation"
18
- - name: project
19
- path: skills/project/SKILL.md
20
- description: "Full project kickoff: requirements → architecture → tech stack → scaffolding"
21
- - name: review
22
- path: skills/review/SKILL.md
23
- description: "Strict TA-level code review covering style, efficiency, edge cases, and security"
24
- - name: explain
25
- path: skills/explain/SKILL.md
26
- description: "Concept explanations with analogies, Mermaid diagrams, and connections to prior knowledge"
27
- - name: leetcode
28
- path: skills/leetcode/SKILL.md
29
- description: "Problem parsing, optimized solutions with time/space complexity analysis"
30
- - name: exam
31
- path: skills/exam/SKILL.md
32
- description: "Practice questions, mind maps, and revision plans for upcoming exams"
33
- - name: research
34
- path: skills/research/SKILL.md
35
- description: "Paper summarization, arXiv search, and literature review assistance"
36
- - name: semester
37
- path: skills/semester/SKILL.md
38
- description: "Manage semester context: scaffold a new SEMESTER.md (--init), update fields (--update), or inspect what Pisces detects (--status)"
39
-
40
10
  # Extensions that run automatically in the background
41
11
  extensions:
42
12
  - name: workspace