pi-diff-review 0.1.26 → 0.1.27
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-diff-review",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.27",
|
|
4
4
|
"description": "Local diff review TUI extension for pi",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"typecheck": "tsc --noEmit"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@earendil-works/pi-ai": "^0.
|
|
38
|
-
"@earendil-works/pi-coding-agent": "^0.
|
|
39
|
-
"@earendil-works/pi-tui": "^0.
|
|
40
|
-
"@types/node": "^
|
|
41
|
-
"prettier": "^3.
|
|
42
|
-
"tsx": "^4.
|
|
43
|
-
"typescript": "^
|
|
37
|
+
"@earendil-works/pi-ai": "^0.85.1",
|
|
38
|
+
"@earendil-works/pi-coding-agent": "^0.85.1",
|
|
39
|
+
"@earendil-works/pi-tui": "^0.85.1",
|
|
40
|
+
"@types/node": "^26.5.1",
|
|
41
|
+
"prettier": "^3.9.6",
|
|
42
|
+
"tsx": "^4.23.13",
|
|
43
|
+
"typescript": "^7.0.2"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"@earendil-works/pi-ai": "*",
|
|
@@ -65,6 +65,6 @@
|
|
|
65
65
|
"image": "https://github.com/user-attachments/assets/3fd00163-5d19-489b-94ed-3d4816c6cad3"
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@pierre/diffs": "^1.
|
|
68
|
+
"@pierre/diffs": "^1.4.2"
|
|
69
69
|
}
|
|
70
70
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { streamSimple } from "@earendil-works/pi-ai";
|
|
2
1
|
import type { ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
|
|
3
2
|
import type { AssistantMessage, Context } from "@earendil-works/pi-ai";
|
|
4
3
|
|
|
@@ -90,6 +89,11 @@ export class PiModelDiffExplainer implements DiffExplainer {
|
|
|
90
89
|
throw new Error(auth.error);
|
|
91
90
|
}
|
|
92
91
|
|
|
92
|
+
const provider = this.ctx.modelRegistry.getProvider(model.provider);
|
|
93
|
+
if (!provider) {
|
|
94
|
+
throw new Error(`No provider is registered for ${model.provider}.`);
|
|
95
|
+
}
|
|
96
|
+
|
|
93
97
|
const context: Context = {
|
|
94
98
|
systemPrompt:
|
|
95
99
|
"You explain code clearly and concisely for review. Focus on intent, behavior, and risk. Avoid restating every line.",
|
|
@@ -105,7 +109,7 @@ export class PiModelDiffExplainer implements DiffExplainer {
|
|
|
105
109
|
};
|
|
106
110
|
|
|
107
111
|
let streamedText = "";
|
|
108
|
-
const stream = streamSimple(model, context, {
|
|
112
|
+
const stream = provider.streamSimple(model, context, {
|
|
109
113
|
apiKey: auth.apiKey,
|
|
110
114
|
headers: auth.headers,
|
|
111
115
|
signal: options.signal,
|
package/src/review/types.ts
CHANGED
|
@@ -29,8 +29,7 @@ export type ReviewLine = {
|
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
export type ReviewResult =
|
|
32
|
-
|
|
33
|
-
| { action: "cancel" };
|
|
32
|
+
{ action: "submit"; comments: ReviewComment[] } | { action: "cancel" };
|
|
34
33
|
|
|
35
34
|
export type SelectionBounds = {
|
|
36
35
|
start: number;
|