@aethrekh/pi-cs 0.1.9 → 0.1.10-alpha.1
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 +16 -0
- package/README.md +7 -7
- package/extensions/semester-detector.js +25 -21
- package/package.json +1 -1
- package/pi-cs.meta.json +2 -2
- package/pi-package.yaml +1 -1
- package/postinstall.d.ts +3 -3
- package/postinstall.js +3 -59
- package/postinstall.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,22 @@ 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.1](https://github.com/AshishBagdane/pi-cs/compare/v0.1.10-alpha.0...v0.1.10-alpha.1) (2026-06-05)
|
|
11
|
+
|
|
12
|
+
### ### Fixed
|
|
13
|
+
|
|
14
|
+
* self-heal stale APPEND_SYSTEM.md on session_start ([c0c5027](https://github.com/AshishBagdane/pi-cs/commit/c0c50279d8682a5e8d15e6789ffdbc229ab5cfeb))
|
|
15
|
+
|
|
16
|
+
## [0.1.10-alpha.0](https://github.com/AshishBagdane/pi-cs/compare/v0.1.9...v0.1.10-alpha.0) (2026-06-05)
|
|
17
|
+
|
|
18
|
+
### ### Fixed
|
|
19
|
+
|
|
20
|
+
* scope persona injection to active sessions, remove global APPEND_SYSTEM.md write ([eb86028](https://github.com/AshishBagdane/pi-cs/commit/eb86028a14c2f34eb982da127e0806e1a7bad219))
|
|
21
|
+
|
|
22
|
+
### ### Changed
|
|
23
|
+
|
|
24
|
+
* fix and expand CLAUDE.md with accurate architecture details ([fc7d4d8](https://github.com/AshishBagdane/pi-cs/commit/fc7d4d8c382b1bea1286de2f6dc8be59f5bcf74b))
|
|
25
|
+
|
|
10
26
|
## [0.1.9](https://github.com/AshishBagdane/pi-cs/compare/v0.1.8...v0.1.9) (2026-06-04)
|
|
11
27
|
|
|
12
28
|
### 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
|
|
33
|
-
|
|
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 >=
|
|
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/ →
|
|
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,31 +201,31 @@ function loadPersona() {
|
|
|
202
201
|
}
|
|
203
202
|
return "";
|
|
204
203
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
204
|
+
// ─── Stale Global File Cleanup ─────────────────────────────────────────────
|
|
205
|
+
const LEGACY_APPEND_PATH = path.join(os.homedir(), ".pi", "agent", "APPEND_SYSTEM.md");
|
|
206
|
+
function removeLegacyGlobalPersona(persona) {
|
|
207
|
+
if (!persona)
|
|
208
|
+
return false;
|
|
209
209
|
try {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if (existing
|
|
214
|
-
return
|
|
215
|
-
fs.
|
|
216
|
-
|
|
217
|
-
return existing === "" ? "installed" : "updated";
|
|
210
|
+
if (!fs.existsSync(LEGACY_APPEND_PATH))
|
|
211
|
+
return false;
|
|
212
|
+
const existing = fs.readFileSync(LEGACY_APPEND_PATH, "utf-8").trim();
|
|
213
|
+
if (existing !== persona)
|
|
214
|
+
return false;
|
|
215
|
+
fs.unlinkSync(LEGACY_APPEND_PATH);
|
|
216
|
+
return true;
|
|
218
217
|
}
|
|
219
218
|
catch {
|
|
220
|
-
return
|
|
219
|
+
return false;
|
|
221
220
|
}
|
|
222
221
|
}
|
|
223
222
|
// ─── Pi Extension Factory ──────────────────────────────────────────────────
|
|
224
223
|
function default_1(pi) {
|
|
224
|
+
const persona = loadPersona();
|
|
225
225
|
let semesterCtx = null;
|
|
226
226
|
pi.on("session_start", async (_event, ctx) => {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
ctx.ui.notify(`🐠 Pisces persona ${personaStatus} — restart Pi for it to take effect.`, "info");
|
|
227
|
+
if (removeLegacyGlobalPersona(persona)) {
|
|
228
|
+
ctx.ui.notify("🐠 Pisces: cleaned up a stale ~/.pi/agent/APPEND_SYSTEM.md from an older install. Persona is now session-scoped.", "info");
|
|
230
229
|
}
|
|
231
230
|
const result = detectSemesterContext();
|
|
232
231
|
if (result.found && result.context) {
|
|
@@ -239,9 +238,14 @@ function default_1(pi) {
|
|
|
239
238
|
}
|
|
240
239
|
});
|
|
241
240
|
pi.on("before_agent_start", async (event) => {
|
|
242
|
-
|
|
241
|
+
const parts = [];
|
|
242
|
+
if (persona)
|
|
243
|
+
parts.push(persona);
|
|
244
|
+
if (semesterCtx)
|
|
245
|
+
parts.push(semesterContextBlock(semesterCtx));
|
|
246
|
+
if (parts.length === 0)
|
|
243
247
|
return;
|
|
244
|
-
return { systemPrompt:
|
|
248
|
+
return { systemPrompt: [event.systemPrompt, ...parts].join("\n\n") };
|
|
245
249
|
});
|
|
246
250
|
}
|
|
247
251
|
// ─── Pi Extension Entry Point ──────────────────────────────────────────────
|
package/package.json
CHANGED
package/pi-cs.meta.json
CHANGED
package/pi-package.yaml
CHANGED
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
|
-
*
|
|
6
|
-
*
|
|
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
|
-
*
|
|
7
|
-
*
|
|
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
|
//# sourceMappingURL=postinstall.js.map
|
package/postinstall.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postinstall.js","sourceRoot":"","sources":["../src/postinstall.ts"],"names":[],"mappings":";AAAA
|
|
1
|
+
{"version":3,"file":"postinstall.js","sourceRoot":"","sources":["../src/postinstall.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG"}
|