pi-banana 2.1.2 → 2.1.4

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.
Files changed (2) hide show
  1. package/extensions/index.ts +14 -12
  2. package/package.json +1 -1
@@ -385,12 +385,10 @@ export default function (pi: ExtensionAPI) {
385
385
  : `Generated → ${outPath}`;
386
386
 
387
387
  return {
388
- // Flat ImageContent blockpi-coding-agent auto-renders inline
389
- // in Kitty/iTerm2 terminals. Older terminals get the text fallback.
390
- content: [
391
- { type: "text", text: summary },
392
- { type: "image", data: base64, mimeType },
393
- ],
388
+ // Only text in content the base64 image goes into details
389
+ // so it does not bloat conversation history sent to the LLM.
390
+ // renderResult reads the image from details for inline display.
391
+ content: [{ type: "text", text: summary }],
394
392
  details: {
395
393
  prompt: params.prompt,
396
394
  model,
@@ -401,25 +399,29 @@ export default function (pi: ExtensionAPI) {
401
399
  outputPath: outPath,
402
400
  editing,
403
401
  referenceImages: params.referenceImages,
402
+ imageBase64: base64,
404
403
  },
405
404
  };
406
405
  },
407
406
 
408
407
  renderResult(result, _options, theme) {
409
- // existing renderResult code...
408
+ // Image is in details (not content) so base64 does not bloat
409
+ // conversation history sent to the LLM on subsequent turns.
410
410
  const { details, content } = result;
411
411
  const container = new Container();
412
412
 
413
413
  // 1. Summary
414
414
  const summaryPart = content.find((c: any) => c.type === "text");
415
415
  const summaryText = (summaryPart && summaryPart.type === "text") ? summaryPart.text : "";
416
- container.addChild(new Text(theme.fg("success", "✔ " + summaryText), 1, 0));
416
+ if (summaryText) {
417
+ container.addChild(new Text(theme.fg("success", "✔ " + summaryText), 1, 0));
418
+ }
417
419
 
418
- // 2. Image
419
- const imagePart = content.find((c: any) => c.type === "image");
420
- if (imagePart && imagePart.type === "image") {
420
+ // 2. Image from details
421
+ if (details && (details as any).imageBase64) {
422
+ container.addChild(new Spacer(1));
421
423
  container.addChild(
422
- new Image(imagePart.data, imagePart.mimeType, {
424
+ new Image((details as any).imageBase64, (details as any).mimeType ?? "image/png", {
423
425
  ...theme,
424
426
  fallbackColor: (s: string) => theme.fg("muted", s),
425
427
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-banana",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "description": "Generate, edit, and analyze images in pi using Google Nano Banana (image gen) and Gemini Vision (analysis). Inline terminal preview, reference-image editing, auto-save.",
5
5
  "author": "Francesco Frapporti <effedue@gmail.com>",
6
6
  "license": "MIT",