opencode-gpt-imagegen 1.0.0 → 1.0.2
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/README.md +3 -1
- package/dist/index.js +16 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# opencode-gpt-imagegen
|
|
2
2
|
|
|
3
|
-
> **⚠️
|
|
3
|
+
> **⚠️ Plugin versions before `0.1.13` no longer generate images.** [GPT-5.5 retired from Codex with ChatGPT sign-in](https://learn.chatgpt.com/docs/models#gpt-55-retirement) on October 14, 2026, and those versions use it. Follow the [update steps](#updating-the-plugin) to install the latest version.
|
|
4
|
+
|
|
5
|
+
> **📣 `1.0.0` changes how `gpt_imagegen` is used.** `size` now accepts only seven fixed sizes, and `quality` is removed. See the [release notes](https://github.com/yuji-hatakeyama/opencode-gpt-imagegen/releases/tag/v1.0.0) for all changes.
|
|
4
6
|
|
|
5
7
|
> **📣 OpenAI API key support is on hold.** This plugin supports only ChatGPT sign-in. If you need API key support, please share your use case in [#120](https://github.com/yuji-hatakeyama/opencode-gpt-imagegen/issues/120).
|
|
6
8
|
|
package/dist/index.js
CHANGED
|
@@ -126,9 +126,24 @@ function buildSavedMessage(savedPath, requestedPath, size) {
|
|
|
126
126
|
const versionNote = savedPath !== requestedPath ? ` (the requested path ${requestedPath} already existed; the new image was versioned to avoid overwriting it)` : "";
|
|
127
127
|
return `Generated image saved to ${savedPath}${versionNote}. The image is ${size.width}x${size.height} pixels.`;
|
|
128
128
|
}
|
|
129
|
+
async function isDirectory(p) {
|
|
130
|
+
try {
|
|
131
|
+
return (await fs3.stat(p)).isDirectory();
|
|
132
|
+
} catch {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
async function ensureDir(dir) {
|
|
137
|
+
try {
|
|
138
|
+
await fs3.mkdir(dir, { recursive: true });
|
|
139
|
+
} catch (e) {
|
|
140
|
+
if (e.code !== "EEXIST" || !await isDirectory(dir))
|
|
141
|
+
throw e;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
129
144
|
async function saveGeneratedImage(out, ctxDir, base64) {
|
|
130
145
|
const requestedPath = path3.isAbsolute(out) ? out : path3.resolve(ctxDir, out);
|
|
131
|
-
await
|
|
146
|
+
await ensureDir(path3.dirname(requestedPath));
|
|
132
147
|
const savedPath = await pickNonOverwritePath(requestedPath);
|
|
133
148
|
const png = Buffer.from(base64, "base64");
|
|
134
149
|
await fs3.writeFile(savedPath, png);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "opencode-gpt-imagegen",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "OpenCode plugin for GPT Image 2 generation through your ChatGPT subscription, with reference images and safe PNG output.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|