pi-vision-handoff 0.10.3 → 0.10.5
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 +4 -4
- package/src/describer.ts +20 -12
- package/src/prewarm-editor.ts +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-vision-handoff",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5",
|
|
4
4
|
"description": "Give text-only pi models vision — describe images with a vision model you pick via an interactive picker, then hand off the text description to non-vision models",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Tom X Nguyen",
|
|
@@ -38,9 +38,9 @@
|
|
|
38
38
|
"lint:dead": "knip --no-gitignore"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@earendil-works/pi-ai": "0.
|
|
42
|
-
"@earendil-works/pi-coding-agent": "0.
|
|
43
|
-
"@earendil-works/pi-tui": "0.
|
|
41
|
+
"@earendil-works/pi-ai": "0.86.0",
|
|
42
|
+
"@earendil-works/pi-coding-agent": "0.86.0",
|
|
43
|
+
"@earendil-works/pi-tui": "0.86.0",
|
|
44
44
|
"@types/node": "25.9.1",
|
|
45
45
|
"@vitest/coverage-v8": "4.1.7",
|
|
46
46
|
"knip": "6.14.1",
|
package/src/describer.ts
CHANGED
|
@@ -26,16 +26,18 @@
|
|
|
26
26
|
* abort listener.
|
|
27
27
|
*/
|
|
28
28
|
|
|
29
|
-
import
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
29
|
+
import {
|
|
30
|
+
normalizeContext,
|
|
31
|
+
type Api,
|
|
32
|
+
type AssistantMessage,
|
|
33
|
+
type Context,
|
|
34
|
+
type ImageContent,
|
|
35
|
+
type Message,
|
|
36
|
+
type Model,
|
|
37
|
+
type SimpleStreamOptions,
|
|
38
|
+
type TextContent,
|
|
39
|
+
type ThinkingLevel,
|
|
40
|
+
type TranscriptContext,
|
|
39
41
|
} from "@earendil-works/pi-ai";
|
|
40
42
|
import { completeSimple } from "@earendil-works/pi-ai/compat";
|
|
41
43
|
import type { ModelRegistry } from "@earendil-works/pi-coding-agent";
|
|
@@ -170,11 +172,17 @@ export async function completeVisionModel(
|
|
|
170
172
|
options: SimpleStreamOptions,
|
|
171
173
|
): Promise<AssistantMessage> {
|
|
172
174
|
const isolatedOptions = isolateVisionRequest(model, options);
|
|
175
|
+
// pi 0.86 providers take a normalized `TranscriptContext` (the system prompt and
|
|
176
|
+
// tool declarations now live in transcript system messages). Fold the callers'
|
|
177
|
+
// legacy `{ systemPrompt, messages }` shorthand into a leading system message once
|
|
178
|
+
// here, then hand the same transcript to both the registered-provider stream and
|
|
179
|
+
// the compat `completeSimple` fallback (which also accepts a TranscriptContext).
|
|
180
|
+
const transcript: TranscriptContext = normalizeContext(context);
|
|
173
181
|
const provider = modelRegistry.getRegisteredProviderConfig?.(model.provider);
|
|
174
182
|
if (provider?.streamSimple && provider.api === model.api) {
|
|
175
|
-
return provider.streamSimple(model,
|
|
183
|
+
return provider.streamSimple(model, transcript, isolatedOptions).result();
|
|
176
184
|
}
|
|
177
|
-
return completeSimple(model,
|
|
185
|
+
return completeSimple(model, transcript, isolatedOptions);
|
|
178
186
|
}
|
|
179
187
|
|
|
180
188
|
/** Dependencies the describer can't own itself (held by the engine). */
|
package/src/prewarm-editor.ts
CHANGED
|
@@ -55,7 +55,9 @@ export class PrewarmEditor extends CustomEditor {
|
|
|
55
55
|
private readonly modelRegistry: ModelRegistry;
|
|
56
56
|
|
|
57
57
|
constructor(tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager, deps: PrewarmEditorDeps) {
|
|
58
|
-
|
|
58
|
+
// Keep Pi's embedded working status: without this opt-in the streaming
|
|
59
|
+
// spinner falls back to the standalone row above the editor.
|
|
60
|
+
super(tui, theme, keybindings, { embedWorkingStatus: true });
|
|
59
61
|
this.shouldPrewarm = deps.shouldPrewarm;
|
|
60
62
|
this.prewarmPath = deps.prewarmPath;
|
|
61
63
|
this.modelRegistry = deps.modelRegistry;
|