Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions extensions/paste.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ async function updateComposePreview(ctx: ExtensionContext): Promise<void> {
if (ctx.mode !== "tui") return; // widget is TUI-only

const editorText = ctx.ui.getEditorText();
// Don't show compose preview for slash commands — they have their own UI
if (editorText.trim().startsWith("/")) {
if (lastPreviewTokens) {
ctx.ui.setWidget("vision-compose-preview", undefined);
lastPreviewTokens = "";
}
return;
}
const tokens = findImagePathTokens(editorText);
const tokensKey = tokens.join("\0");

Expand Down
9 changes: 9 additions & 0 deletions extensions/vision.ts
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,15 @@ export default function visionExtension(pi: ExtensionAPI): void {
ctx.ui.notify("Usage: /vision preview <image-path>", "warning");
return;
}
// Clear compose preview widget if active (prevent interference)
if (typeof ctx.ui.setWidget === "function") {
ctx.ui.setWidget("vision-compose-preview", undefined);
}
// Helpful error if the user passed a marker instead of a path
if (path.includes("[Image-#") || path.startsWith("`")) {
ctx.ui.notify("Vision preview: pass a file path, not a marker. Example: /vision preview /tmp/screenshot.png", "warning");
return;
}
if (ctx.mode !== "tui") {
// Non-TUI: notify metadata as text
const loaded = await loadImage(path, { compress: false, maxDimension: 1568, jpegQuality: 85, cwd: ctx.cwd });
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@getpipher/vision",
"version": "0.3.4",
"version": "0.3.5",
"description": "Capability-aware vision + paste extension for the pi coding agent. Delegates image analysis to a vision model only when the active primary model is text-only; passes images through natively for multimodal models (zero delegation).",
"keywords": [
"pi-package",
Expand Down
Loading