pi-better-openai 0.1.15 → 0.1.16
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 +1 -1
- package/src/pets.ts +6 -6
package/package.json
CHANGED
package/src/pets.ts
CHANGED
|
@@ -514,7 +514,6 @@ function encodeKittyRawRgba(frame: PetFrame, imageId: number): string {
|
|
|
514
514
|
|
|
515
515
|
export class CodexPetKittyManager {
|
|
516
516
|
private previousFrameImageId: number | undefined;
|
|
517
|
-
private readonly uploadedFrameImageIds = new Set<number>();
|
|
518
517
|
private readonly pendingCleanupImageIds = new Set<number>();
|
|
519
518
|
|
|
520
519
|
constructor(readonly placementImageId: number) {}
|
|
@@ -526,7 +525,6 @@ export class CodexPetKittyManager {
|
|
|
526
525
|
invalidate(pet?: LoadedCodexPet): void {
|
|
527
526
|
this.queueCleanup(pet);
|
|
528
527
|
this.previousFrameImageId = undefined;
|
|
529
|
-
this.uploadedFrameImageIds.clear();
|
|
530
528
|
markCodexPetKittyFramesUnuploaded(pet);
|
|
531
529
|
}
|
|
532
530
|
|
|
@@ -563,10 +561,12 @@ export class CodexPetKittyManager {
|
|
|
563
561
|
? deleteCodexPetKittyPlacement(this.previousFrameImageId)
|
|
564
562
|
: "";
|
|
565
563
|
const deleteCurrent = deleteCodexPetKittyPlacement(frameImageId);
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
this
|
|
564
|
+
// Do not cache uploads across animation loops. Kitty-compatible terminals may
|
|
565
|
+
// drop image data after clears, quota pressure, or after a placement is
|
|
566
|
+
// deleted; failures are suppressed with q=2 and otherwise show up as an
|
|
567
|
+
// occasionally invisible pet. The TUI diff still avoids writing this payload
|
|
568
|
+
// again when the rendered line is unchanged.
|
|
569
|
+
const upload = encodeKittyRawRgba(frame, frameImageId);
|
|
570
570
|
frame.kittyUploaded = true;
|
|
571
571
|
this.previousFrameImageId = frameImageId;
|
|
572
572
|
// Recent pi-tui versions automatically free Kitty image IDs they own on changed lines.
|