@aethrekh/pi-cs 0.1.9-alpha.2 → 0.1.10-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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,28 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ---
9
9
 
10
+ ## [0.1.10-alpha.0](https://github.com/AshishBagdane/pi-cs/compare/v0.1.9...v0.1.10-alpha.0) (2026-06-05)
11
+
12
+ ### ### Fixed
13
+
14
+ * scope persona injection to active sessions, remove global APPEND_SYSTEM.md write ([eb86028](https://github.com/AshishBagdane/pi-cs/commit/eb86028a14c2f34eb982da127e0806e1a7bad219))
15
+
16
+ ### ### Changed
17
+
18
+ * fix and expand CLAUDE.md with accurate architecture details ([fc7d4d8](https://github.com/AshishBagdane/pi-cs/commit/fc7d4d8c382b1bea1286de2f6dc8be59f5bcf74b))
19
+
20
+ ## [0.1.9](https://github.com/AshishBagdane/pi-cs/compare/v0.1.8...v0.1.9) (2026-06-04)
21
+
22
+ ### Fixed
23
+
24
+ - **semester skill: `--init` now writes `SEMESTER.md` directly** — previously the skill output a code block the student had to copy-paste; it now uses Pi's file write tool to create the file in the current directory and confirms the absolute path written
25
+ - **semester skill: `--update` now writes the file directly** — reads the current `SEMESTER.md`, applies changes, and writes the complete file back without requiring copy-paste
26
+ - **semester skill: removed false "reloads on every cd" claim** — context is loaded once at Pi startup; corrected to "restart Pi after moving the file"
27
+ - **folder-detector / semester-detector: removed `on_directory_change` trigger** — Pi has no such event; both extensions run at `session_start` only; removed from `pi-package.yaml` and file comments to match actual behavior
28
+ - **STUDENT_GUIDE.md: corrected all lifecycle descriptions** — removed `on_directory_change` references, fixed `--init`/`--update` descriptions, updated folder structure diagram and workflow steps to reflect startup-only detection
29
+
30
+ ---
31
+
10
32
  ## [0.1.8](https://github.com/AshishBagdane/pi-cs/compare/v0.1.7...v0.1.8) (2026-06-04)
11
33
 
12
34
  ### Fixed
package/README.md CHANGED
@@ -29,14 +29,12 @@ It covers every dimension of a CS degree:
29
29
  ## Quick Start
30
30
 
31
31
  ```bash
32
- # Install pi-cs
33
- pi install npm:@aethrekh/pi-cs
34
-
35
- # Navigate to your university folder
36
- cd ~/university/fall2025
32
+ # Install Pisces in your university workspace (recommended)
33
+ cd ~/university
34
+ pi install npm:@aethrekh/pi-cs -l
37
35
 
38
36
  # Initialize your semester context
39
- /semester
37
+ /semester --init
40
38
 
41
39
  # Start working
42
40
  /homework
@@ -44,6 +42,8 @@ cd ~/university/fall2025
44
42
  /leetcode 42
45
43
  ```
46
44
 
45
+ > **Global install:** `pi install npm:@aethrekh/pi-cs` (without `-l`) activates Pisces in every Pi session, including non-university projects. Use this only if you want Pisces everywhere.
46
+
47
47
  ---
48
48
 
49
49
  ## Semester Context
@@ -193,7 +193,7 @@ See [`config/schema.json`](config/schema.json) for the full configuration refere
193
193
 
194
194
  ## Installation
195
195
 
196
- **Requirements:** Pi >= 1.0.0, Node.js >= 18
196
+ **Requirements:** Pi >= 0.78.0, Node.js >= 18
197
197
 
198
198
  ```bash
199
199
  pi install npm:@aethrekh/pi-cs
@@ -182,11 +182,10 @@ function semesterContextBlock(ctx) {
182
182
  .filter(Boolean)
183
183
  .join("\n");
184
184
  }
185
- // ─── Persona ───────────────────────────────────────────────────────────────
186
- const APPEND_SYSTEM_PATH = path.join(os.homedir(), ".pi", "agent", "APPEND_SYSTEM.md");
185
+ // ─── Persona Loader ────────────────────────────────────────────────────────
187
186
  function loadPersona() {
188
187
  const candidates = [
189
- path.resolve(__dirname, "../SYSTEM.md"), // compiled: extensions/ → package root
188
+ path.resolve(__dirname, "../SYSTEM.md"), // compiled: dist/extensions/ → dist/
190
189
  path.resolve(__dirname, "../../SYSTEM.md"), // dev ts-node: src/extensions/ → project root
191
190
  path.resolve(__dirname, "../../../SYSTEM.md"),
192
191
  ];
@@ -202,32 +201,11 @@ function loadPersona() {
202
201
  }
203
202
  return "";
204
203
  }
205
- const PERSONA = loadPersona();
206
- function ensurePersonaInstalled() {
207
- if (!PERSONA)
208
- return "noop";
209
- try {
210
- const existing = fs.existsSync(APPEND_SYSTEM_PATH)
211
- ? fs.readFileSync(APPEND_SYSTEM_PATH, "utf-8").trim()
212
- : "";
213
- if (existing === PERSONA)
214
- return "noop";
215
- fs.mkdirSync(path.dirname(APPEND_SYSTEM_PATH), { recursive: true });
216
- fs.writeFileSync(APPEND_SYSTEM_PATH, PERSONA, "utf-8");
217
- return existing === "" ? "installed" : "updated";
218
- }
219
- catch {
220
- return "noop";
221
- }
222
- }
223
204
  // ─── Pi Extension Factory ──────────────────────────────────────────────────
224
205
  function default_1(pi) {
206
+ const persona = loadPersona();
225
207
  let semesterCtx = null;
226
208
  pi.on("session_start", async (_event, ctx) => {
227
- const personaStatus = ensurePersonaInstalled();
228
- if (personaStatus === "installed" || personaStatus === "updated") {
229
- ctx.ui.notify(`🐠 Pisces persona ${personaStatus} — restart Pi for it to take effect.`, "info");
230
- }
231
209
  const result = detectSemesterContext();
232
210
  if (result.found && result.context) {
233
211
  semesterCtx = result.context;
@@ -239,9 +217,14 @@ function default_1(pi) {
239
217
  }
240
218
  });
241
219
  pi.on("before_agent_start", async (event) => {
242
- if (!semesterCtx)
220
+ const parts = [];
221
+ if (persona)
222
+ parts.push(persona);
223
+ if (semesterCtx)
224
+ parts.push(semesterContextBlock(semesterCtx));
225
+ if (parts.length === 0)
243
226
  return;
244
- return { systemPrompt: `${event.systemPrompt}\n\n${semesterContextBlock(semesterCtx)}` };
227
+ return { systemPrompt: [event.systemPrompt, ...parts].join("\n\n") };
245
228
  });
246
229
  }
247
230
  // ─── Pi Extension Entry Point ──────────────────────────────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aethrekh/pi-cs",
3
- "version": "0.1.9-alpha.2",
3
+ "version": "0.1.10-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.9-alpha.2",
4
- "built_at": "2026-06-04T16:30:47.926Z",
3
+ "version": "0.1.10-alpha.0",
4
+ "built_at": "2026-06-05T09:26:35.040Z",
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.9-alpha.0
2
+ version: 0.1.10-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
package/postinstall.d.ts CHANGED
@@ -2,8 +2,8 @@
2
2
  * postinstall.ts
3
3
  *
4
4
  * Runs automatically after `pi install npm:@aethrekh/pi-cs`.
5
- * Writes SYSTEM.md to ~/.pi/agent/APPEND_SYSTEM.md so the Pisces persona
6
- * is active from the very first Pi session — no restart required.
5
+ * Persona injection is handled at runtime via the before_agent_start hook
6
+ * in semester-detector.ts, scoped to sessions where pi-cs is active.
7
+ * No global APPEND_SYSTEM.md write is performed.
7
8
  */
8
- export {};
9
9
  //# sourceMappingURL=postinstall.d.ts.map
package/postinstall.js CHANGED
@@ -3,64 +3,8 @@
3
3
  * postinstall.ts
4
4
  *
5
5
  * Runs automatically after `pi install npm:@aethrekh/pi-cs`.
6
- * Writes SYSTEM.md to ~/.pi/agent/APPEND_SYSTEM.md so the Pisces persona
7
- * is active from the very first Pi session — no restart required.
6
+ * Persona injection is handled at runtime via the before_agent_start hook
7
+ * in semester-detector.ts, scoped to sessions where pi-cs is active.
8
+ * No global APPEND_SYSTEM.md write is performed.
8
9
  */
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- var desc = Object.getOwnPropertyDescriptor(m, k);
12
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
- desc = { enumerable: true, get: function() { return m[k]; } };
14
- }
15
- Object.defineProperty(o, k2, desc);
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || (function () {
26
- var ownKeys = function(o) {
27
- ownKeys = Object.getOwnPropertyNames || function (o) {
28
- var ar = [];
29
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
- return ar;
31
- };
32
- return ownKeys(o);
33
- };
34
- return function (mod) {
35
- if (mod && mod.__esModule) return mod;
36
- var result = {};
37
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
- __setModuleDefault(result, mod);
39
- return result;
40
- };
41
- })();
42
- Object.defineProperty(exports, "__esModule", { value: true });
43
- const fs = __importStar(require("fs"));
44
- const path = __importStar(require("path"));
45
- const os = __importStar(require("os"));
46
- const systemMdPath = path.join(__dirname, "SYSTEM.md");
47
- const appendPath = path.join(os.homedir(), ".pi", "agent", "APPEND_SYSTEM.md");
48
- try {
49
- if (!fs.existsSync(systemMdPath))
50
- process.exit(0);
51
- const content = fs.readFileSync(systemMdPath, "utf-8").trim();
52
- if (!content)
53
- process.exit(0);
54
- fs.mkdirSync(path.dirname(appendPath), { recursive: true });
55
- const existing = fs.existsSync(appendPath)
56
- ? fs.readFileSync(appendPath, "utf-8").trim()
57
- : "";
58
- if (existing !== content) {
59
- fs.writeFileSync(appendPath, content, "utf-8");
60
- console.log("🐠 Pisces persona installed → ~/.pi/agent/APPEND_SYSTEM.md");
61
- }
62
- }
63
- catch {
64
- // Never fail install
65
- }
66
10
  //#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