pi-keeper 0.1.0 → 0.1.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 +78 -0
- package/extensions/ask-mailbox.ts +22 -4
- package/extensions/ask-server.ts +15 -6
- package/extensions/child-cwd.ts +4 -2
- package/extensions/config.ts +24 -12
- package/extensions/index.ts +254 -68
- package/extensions/modes.ts +59 -7
- package/extensions/options.ts +9 -0
- package/extensions/preview.ts +5 -3
- package/extensions/project-rules.ts +81 -12
- package/extensions/remote-relay.ts +10 -5
- package/extensions/rulebook.ts +61 -1
- package/extensions/rules-view.ts +35 -16
- package/extensions/rules.ts +189 -22
- package/extensions/session-grant-store.ts +18 -0
- package/extensions/session-grants.ts +9 -3
- package/extensions/settings-panel.ts +80 -22
- package/extensions/telemetry.ts +99 -2
- package/extensions/ui-relay.ts +6 -1
- package/extensions/utils.ts +1108 -105
- package/package.json +5 -2
- package/prompt-templates/new-rule.md +30 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-keeper",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Permission modes for pi (default, auto and plan) with per-project allow, ask and deny rules and a plan you approve before any edit.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Daniel Blei",
|
|
@@ -45,11 +45,14 @@
|
|
|
45
45
|
"extensions": [
|
|
46
46
|
"./extensions/index.ts"
|
|
47
47
|
],
|
|
48
|
-
"prompts": [
|
|
48
|
+
"prompts": [
|
|
49
|
+
"./prompt-templates"
|
|
50
|
+
]
|
|
49
51
|
},
|
|
50
52
|
"files": [
|
|
51
53
|
"extensions",
|
|
52
54
|
"prompts",
|
|
55
|
+
"prompt-templates",
|
|
53
56
|
"README.md",
|
|
54
57
|
"CHANGELOG.md",
|
|
55
58
|
"NOTICE"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Write a pi-keeper rulebook rule from a description of what the model must not say or do
|
|
3
|
+
argument-hint: "<what must not happen> [project]"
|
|
4
|
+
---
|
|
5
|
+
Create a pi-keeper rulebook rule for this: $@
|
|
6
|
+
|
|
7
|
+
A rule is one Markdown file. It fires once per session when the model's finished answer matches its regex, and the body is the correction the model then receives.
|
|
8
|
+
|
|
9
|
+
Where to save it:
|
|
10
|
+
- Default: `~/.pi/agent/pi-keeper/rules/<short-kebab-name>.md` (all projects).
|
|
11
|
+
- If my request says "project": `<project root>/.pi/rules/<short-kebab-name>.md` instead (pi-keeper asks me to review it once).
|
|
12
|
+
|
|
13
|
+
Format (the file name, without `.md`, is the rule name):
|
|
14
|
+
|
|
15
|
+
```markdown
|
|
16
|
+
---
|
|
17
|
+
description: One line on what must not happen. Shown by /rules and on the card.
|
|
18
|
+
condition: (?i)\bshould work\b
|
|
19
|
+
---
|
|
20
|
+
Do not say the change "should work". Run it and quote the result, or say plainly
|
|
21
|
+
that you did not run it.
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
How to write it well:
|
|
25
|
+
1. `condition` is one JavaScript regex, matched against the end of the answer's text blocks (not thinking, not tool arguments). A leading `(?i)` makes it case-insensitive. Use `\b` at both ends.
|
|
26
|
+
2. Aim at the claim, not the topic: narrow enough that an innocent sentence does not match. Use a lookbehind or lookahead to exclude negations such as "not" or "never".
|
|
27
|
+
3. The body says what to do instead, in one or two short sentences. A forgiving body ("if you did run it, quote the line") is better than a stern one.
|
|
28
|
+
4. Before you save it, test the regex with `node -e` against one sentence that must match and two that must not. Show me the results.
|
|
29
|
+
|
|
30
|
+
Then write the file, tell me its full path, and say that `/rules` lists it. Do not edit other files.
|