Skip to content

A local plugin for image-heavy chats in Codex, Claude Code and other agents: earlier images stop going out with every message, and the model fetches the one it needs by its ID, also after compaction.

docs(readme): 新图标、README 头图和仓库分享图

chipfighter4900245df7ab
diff --git a/README.md b/README.md
index ebd17e9..3f16990 100644
--- a/README.md
+++ b/README.md
@@ -18,7 +18,7 @@
<p align="center"><b>English</b> · <a href="README_CN.md">简体中文</a></p>
<p align="center">
- <img src="docs/images/panel.png" alt="Three views of the panel on a task of rainy-night keyframes. Left: the request card, the search box, filters for uploads, generated images and scenes, and the thumbnails by turn. Middle: a search for best face finds the close-up the user called the best face. Right: that close-up previewed across the panel, with its Send every turn checkbox." width="100%">
+ <img src="docs/images/hero.png" alt="Three views of the panel on a task of period-drama keyframes. Auto-select: the model manages its own images, and the card shows the next request at 1.7 MB instead of 7.5 MB. Search: typing best face finds the close-up the user called the best face three turns ago. Preview: that close-up shown full size." width="100%">
</p>
## Why I made this
diff --git a/README_CN.md b/README_CN.md
index 3175132..f7e0087 100644
--- a/README_CN.md
+++ b/README_CN.md
@@ -18,7 +18,7 @@
<p align="center"><a href="README.md">English</a> · <b>简体中文</b></p>
<p align="center">
- <img src="docs/images/panel-zh.png" alt="面板的三个画面,任务是人物雨夜关键帧。左边:请求占用卡片、搜索框、上传、生成和各个场景的筛选按钮,以及按轮分组的缩略图。中间:搜索“最好”,找到用户说脸最好的那张特写。右边:这张特写占满面板的预览,右下角是“每轮都发”的勾选框。" width="100%">
+ <img src="docs/images/hero-zh.png" alt="面板的三个画面,任务是古装短剧的关键帧。自动选图:模型自己管理图片,卡片显示下一条请求约 1.7 MB,全部发送要 7.5 MB。凭印象找图:搜索“最好”,找到三轮前用户说脸最好的那张特写。预览:这张特写的大图。" width="100%">
</p>
## 为什么做这个
diff --git a/docs/images/hero-zh.png b/docs/images/hero-zh.png
new file mode 100644
index 0000000..0e846e6
Binary files /dev/null and b/docs/images/hero-zh.png differ
diff --git a/docs/images/hero.png b/docs/images/hero.png
new file mode 100644
index 0000000..267a771
Binary files /dev/null and b/docs/images/hero.png differ
diff --git a/docs/images/panel-zh.png b/docs/images/panel-zh.png
deleted file mode 100644
index 0a08a38..0000000
Binary files a/docs/images/panel-zh.png and /dev/null differ
diff --git a/docs/images/panel.png b/docs/images/panel.png
deleted file mode 100644
index 528393c..0000000
Binary files a/docs/images/panel.png and /dev/null differ
diff --git a/docs/images/social-preview.png b/docs/images/social-preview.png
index 441c331..09bc532 100644
Binary files a/docs/images/social-preview.png and b/docs/images/social-preview.png differ
diff --git a/plugin/assets/logo.png b/plugin/assets/logo.png
index e8b8ab6..34990f5 100644
Binary files a/plugin/assets/logo.png and b/plugin/assets/logo.png differ
diff --git a/spike/scripts/panel-dev.ts b/spike/scripts/panel-dev.ts
index 3d41fe4..f26024b 100644
--- a/spike/scripts/panel-dev.ts
+++ b/spike/scripts/panel-dev.ts
@@ -1,7 +1,9 @@
// Purpose: P4 — develop and screenshot the panel without Codex. Serves a page that plays Codex's side panel (the
// MCP Apps host side of the bridge) around the real panel.html, and answers its tool calls with the real plugin
// server code over a synthetic thread of test images (no user material).
-// Input: none; `node spike/scripts/panel-dev.ts [--port 17895]`. Output: http://127.0.0.1:<port>/
+// Input: none; `node spike/scripts/panel-dev.ts [--port 17895] [--images <folder>]`. Output: http://127.0.0.1:<port>/
+// --images swaps the drawn keyframes of ?thread=v08 for real ones from a folder kept out of the repository (local/):
+// reference.png, rain-1.png … rain-7.png, warm-1.png … warm-4.png, sketch.png, whichever are there.
// (?theme=dark, ?solo=1 for the panel alone, ?demo=preview|disabled for a state to screenshot, ?slow=1 for slow calls,
// ?stats=none|skipped|websocket for other engine statistics than a normal rewritten request, ?setup=off for a Codex that
// does not go through the engine yet, ?demo=disabled for right after 停用插件, ?thread=fresh for a task with no rollout;
@@ -17,7 +19,7 @@
// Everything is written to a temporary folder, including a Codex home of its own: nothing in the user's Codex home is
// read or changed, whatever is clicked.
-import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
+import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import { createServer } from "node:http";
import { tmpdir } from "node:os";
import { dirname, join } from "node:path";
@@ -156,11 +158,14 @@ const keyframe = (sky: number[], glow: number[], size: "wide" | "medium" | "clos
return (x * 7 + y * 13) % 89 === 0 ? glow : [sky[0] + y / 14, sky[1] + y / 16, sky[2] + y / 12].map(Math.round);
});
const NIGHT = [14, 24, 60], NEON = [255, 80, 180], WARM = [96, 52, 30], LAMP = [255, 205, 120];
-const reference = keyframe([200, 200, 205], [200, 200, 205], "medium");
+const images = process.argv.includes("--images") ? process.argv[process.argv.indexOf("--images") + 1] : "";
+const real = (name: string, drawn: Buffer) => (images && existsSync(join(images, name)) ? readFileSync(join(images, name)) : drawn);
+const reference = real("reference.png", keyframe([200, 200, 205], [200, 200, 205], "medium"));
const rain = [keyframe(NIGHT, NEON, "medium", 0.66, true), keyframe(NIGHT, NEON, "wide"), keyframe(NIGHT, NEON, "close", 0.62), keyframe(NIGHT, NEON, "close"),
- keyframe(NIGHT, NEON, "medium", 0.7), keyframe(NIGHT, NEON, "wide", 0.4), keyframe(NIGHT, NEON, "close", 0.48)];
-const warm = [keyframe(WARM, LAMP, "medium", 0.4), keyframe(WARM, LAMP, "close", 0.45), keyframe(WARM, LAMP, "wide", 0.3), keyframe(WARM, LAMP, "wide", 0.55)];
-const sketch = png(480, 480, (x, y) => ((Math.abs((x - 300) ** 2 + (y - 200) ** 2 - 60 ** 2) < 400 || Math.abs(x - y * 0.4 - 120) < 2 || (y > 300 && Math.abs(y - 300 - Math.abs(x - 300) * 0.3) < 2)) ? [70, 70, 80] : [248, 246, 240]));
+ keyframe(NIGHT, NEON, "medium", 0.7), keyframe(NIGHT, NEON, "wide", 0.4), keyframe(NIGHT, NEON, "close", 0.48)].map((drawn, i) => real(`rain-${i + 1}.png`, drawn));
+const warm = [keyframe(WARM, LAMP, "medium", 0.4), keyframe(WARM, LAMP, "close", 0.45), keyframe(WARM, LAMP, "wide", 0.3), keyframe(WARM, LAMP, "wide", 0.55)]
+ .map((drawn, i) => real(`warm-${i + 1}.png`, drawn));
+const sketch = real("sketch.png", png(480, 480, (x, y) => ((Math.abs((x - 300) ** 2 + (y - 200) ** 2 - 60 ** 2) < 400 || Math.abs(x - y * 0.4 - 120) < 2 || (y > 300 && Math.abs(y - 300 - Math.abs(x - 300) * 0.3) < 2)) ? [70, 70, 80] : [248, 246, 240])));
const ask = (id: string, turnId: string, text: string, files: Array<[string, Buffer]> = []) => line("response_item", {
type: "message", id, role: "user",
content: [{ type: "input_text", text }, ...files.flatMap(([name, bytes], i) => [