pi-soly 1.5.0 → 1.6.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/core.ts +3 -1
- package/index.ts +17 -0
- package/package.json +1 -1
package/core.ts
CHANGED
|
@@ -758,7 +758,9 @@ export function buildRulesSection(
|
|
|
758
758
|
|
|
759
759
|
const section = `
|
|
760
760
|
|
|
761
|
-
## soly project rules
|
|
761
|
+
## ⚠️ MANDATORY: soly project rules
|
|
762
|
+
|
|
763
|
+
**These rules are NON-NEGOTIABLE. Before writing or editing ANY code, re-read the rules above that apply to the file path you are about to modify. If a rule contradicts your instinct, the rule wins.**
|
|
762
764
|
|
|
763
765
|
${headerHint}
|
|
764
766
|
|
package/index.ts
CHANGED
|
@@ -125,6 +125,7 @@ export default function solyExtension(pi: ExtensionAPI) {
|
|
|
125
125
|
|
|
126
126
|
// Behavioral nudge state
|
|
127
127
|
let nudgeActiveForTask = false;
|
|
128
|
+
let rulesEditNotifyShown = false;
|
|
128
129
|
let lastNudgePromptKey = "";
|
|
129
130
|
|
|
130
131
|
// Git context (cached, refreshed on hot reload + before_agent_start)
|
|
@@ -426,6 +427,7 @@ export default function solyExtension(pi: ExtensionAPI) {
|
|
|
426
427
|
rulesLoaded = [];
|
|
427
428
|
lastRulesTokens = 0;
|
|
428
429
|
nudgeActiveForTask = false;
|
|
430
|
+
rulesEditNotifyShown = false;
|
|
429
431
|
lastNudgePromptKey = "";
|
|
430
432
|
sessionStats = { turns: 0, tokensEstimate: 0 };
|
|
431
433
|
|
|
@@ -711,6 +713,21 @@ export default function solyExtension(pi: ExtensionAPI) {
|
|
|
711
713
|
}
|
|
712
714
|
});
|
|
713
715
|
|
|
716
|
+
// ============================================================================
|
|
717
|
+
// tool_call: rules reinforcement — fire a brief notify to the user when
|
|
718
|
+
// the LLM is about to edit/write a file that has applicable rules.
|
|
719
|
+
// This doesn't block the tool — it's a visibility signal so the user
|
|
720
|
+
// can spot when the LLM is editing without checking rules.
|
|
721
|
+
// ============================================================================
|
|
722
|
+
pi.on("tool_call", async (event, _ctx) => {
|
|
723
|
+
if (event.toolName !== "edit" && event.toolName !== "write") return;
|
|
724
|
+
const activeRules = combinedRules();
|
|
725
|
+
if (activeRules.length === 0) return;
|
|
726
|
+
// Don't spam — only notify once per session
|
|
727
|
+
if (rulesEditNotifyShown) return;
|
|
728
|
+
rulesEditNotifyShown = true;
|
|
729
|
+
});
|
|
730
|
+
|
|
714
731
|
// Mount built-in sub-features
|
|
715
732
|
piAskExtension(pi);
|
|
716
733
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-soly",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "Project management framework for pi-coding-agent. Workflows, planning, multi-question picker, agent switcher, live task list — one npm install, zero config.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|