pi-pair-programmer 0.1.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/LICENSE +21 -0
- package/README.md +65 -0
- package/package.json +72 -0
- package/src/change-evidence.ts +840 -0
- package/src/finding-admission.ts +167 -0
- package/src/index.ts +952 -0
- package/src/logger.ts +396 -0
- package/src/model-usage.ts +285 -0
- package/src/pair-stats.ts +372 -0
- package/src/review-runner.ts +301 -0
- package/src/review-store.ts +268 -0
- package/src/reviewers.ts +165 -0
- package/src/stats-view.ts +172 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Matthieu Pernelle
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Pi Pair Programmer
|
|
2
|
+
|
|
3
|
+
Background code review for [Pi](https://pi.dev/docs/extensions) and [OMP](https://omp.sh/docs/extension-authoring).
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Why
|
|
8
|
+
|
|
9
|
+
Coding with AI adds entropy to a codebase.
|
|
10
|
+
Agents optimize for local correctness instead of thinking about the global system. They repeat code and reinvent the wheel.
|
|
11
|
+
|
|
12
|
+
Turn-by-turn static analysis is necessary but not sufficient.
|
|
13
|
+
Code review happens too late in the code production pipeline.
|
|
14
|
+
|
|
15
|
+
This extension lets you run multiple highly specialized reviewers, each focused on a specific concern, to catch issues static analysis cannot detect as soon as code is generated. Without bloating the context window, thanks to a Jev-based filter that removes inherited and duplicate findings.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
With Pi:
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
pi install git:github.com/T-moz/pi-pair-programmer
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
With OMP:
|
|
26
|
+
|
|
27
|
+
```sh
|
|
28
|
+
omp plugin install github:T-moz/pi-pair-programmer
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
For the Jev filter, set your TypeSafe API key before starting Pi or OMP:
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
export TYPESAFE_API_KEY="your-api-key"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Without it, reviews still run, but only exact duplicate findings are filtered.
|
|
38
|
+
|
|
39
|
+
## Use
|
|
40
|
+
|
|
41
|
+
Reviews are on by default. After each successful `write` or `edit`, reviewers run in the background. The coding agent must accept or reject each finding with a reason before continuing with other tools. Only accepted findings appear in your transcript.
|
|
42
|
+
|
|
43
|
+
Run `/pair-programmer` to toggle reviews.
|
|
44
|
+
|
|
45
|
+
Run `/pair-clear` to cancel reviews and clear all findings.
|
|
46
|
+
|
|
47
|
+
The default reviewer uses your current model and asks: “Does it add entropy?” To change the prompt, model, or files reviewed, create `pair-programmer.reviewers.json` in your working directory:
|
|
48
|
+
|
|
49
|
+
```json
|
|
50
|
+
{
|
|
51
|
+
"reviewers": [
|
|
52
|
+
{
|
|
53
|
+
"model": "current",
|
|
54
|
+
"prompt": "Does it add entropy?",
|
|
55
|
+
"include": ["src/**/*.ts"],
|
|
56
|
+
"exclude": ["**/*.test.ts"]
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Use `current` or a `provider/model` identifier. File patterns are relative to your working directory; exclusions take precedence. Add entries for more reviewers.
|
|
63
|
+
|
|
64
|
+
- `/pair-stats`: view review activity, findings, tokens, and estimated costs on demand; missing usage stays unknown.
|
|
65
|
+
- Diagnostics stay in files, never the terminal: OMP uses its native logs; Pi uses `~/.pi/agent/logs/pair-programmer/` (or `$PI_CODING_AGENT_DIR/logs/pair-programmer/`).
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pi-pair-programmer",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A TypeScript extension for Pi and OMP",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/T-moz/pi-pair-programmer.git"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"keywords": [
|
|
12
|
+
"pi-package"
|
|
13
|
+
],
|
|
14
|
+
"files": [
|
|
15
|
+
"src"
|
|
16
|
+
],
|
|
17
|
+
"pi": {
|
|
18
|
+
"extensions": [
|
|
19
|
+
"./src/index.ts"
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
"omp": {
|
|
23
|
+
"extensions": [
|
|
24
|
+
"./src/index.ts"
|
|
25
|
+
]
|
|
26
|
+
},
|
|
27
|
+
"scripts": {
|
|
28
|
+
"check": "tsc --noEmit && eslint . --max-warnings 0 && prettier --check . && npm test",
|
|
29
|
+
"test": "vitest run --coverage",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"lint": "eslint . --max-warnings 0",
|
|
32
|
+
"format:check": "prettier --check .",
|
|
33
|
+
"format": "prettier --write ."
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@earendil-works/pi-coding-agent": "*"
|
|
37
|
+
},
|
|
38
|
+
"peerDependenciesMeta": {
|
|
39
|
+
"@earendil-works/pi-coding-agent": {
|
|
40
|
+
"optional": true
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@earendil-works/pi-coding-agent": "^0.87.1",
|
|
45
|
+
"@eslint/js": "^10.0.1",
|
|
46
|
+
"@vitest/coverage-v8": "^5.0.1",
|
|
47
|
+
"eslint": "^10.11.0",
|
|
48
|
+
"eslint-config-prettier": "^10.1.8",
|
|
49
|
+
"eslint-import-resolver-typescript": "^4.4.5",
|
|
50
|
+
"eslint-plugin-import-x": "^4.17.1",
|
|
51
|
+
"eslint-plugin-promise": "^7.3.0",
|
|
52
|
+
"eslint-plugin-regexp": "^3.3.1",
|
|
53
|
+
"eslint-plugin-security": "^4.0.1",
|
|
54
|
+
"eslint-plugin-sonarjs": "^4.2.1",
|
|
55
|
+
"eslint-plugin-unicorn": "^76.0.0",
|
|
56
|
+
"globals": "^17.12.0",
|
|
57
|
+
"prettier": "^3.9.9",
|
|
58
|
+
"typescript": "^6.0.3",
|
|
59
|
+
"typescript-eslint": "^8.70.1",
|
|
60
|
+
"vitest": "^5.0.1"
|
|
61
|
+
},
|
|
62
|
+
"engines": {
|
|
63
|
+
"node": ">=22.19.0"
|
|
64
|
+
},
|
|
65
|
+
"dependencies": {
|
|
66
|
+
"@typesafe-ai/sdk": "^0.6.0",
|
|
67
|
+
"minimatch": "^10.2.6",
|
|
68
|
+
"pino": "^10.3.1",
|
|
69
|
+
"typebox": "^1.3.34",
|
|
70
|
+
"zod": "^4.6.5"
|
|
71
|
+
}
|
|
72
|
+
}
|