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.
- package/extensions/index.ts +14 -12
- package/package.json +1 -1
package/extensions/index.ts
CHANGED
|
@@ -385,12 +385,10 @@ export default function (pi: ExtensionAPI) {
|
|
|
385
385
|
: `Generated → ${outPath}`;
|
|
386
386
|
|
|
387
387
|
return {
|
|
388
|
-
//
|
|
389
|
-
//
|
|
390
|
-
|
|
391
|
-
|
|
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
|
-
//
|
|
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
|
-
|
|
416
|
+
if (summaryText) {
|
|
417
|
+
container.addChild(new Text(theme.fg("success", "✔ " + summaryText), 1, 0));
|
|
418
|
+
}
|
|
417
419
|
|
|
418
|
-
// 2. Image
|
|
419
|
-
|
|
420
|
-
|
|
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(
|
|
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.
|
|
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",
|