惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
V
Visual Studio Blog
有赞技术团队
有赞技术团队
T
Tailwind CSS Blog
B
Blog
I
InfoQ
博客园 - 三生石上(FineUI控件)
阮一峰的网络日志
阮一峰的网络日志
F
Fortinet All Blogs
H
Help Net Security
博客园 - Franky
宝玉的分享
宝玉的分享
博客园 - 司徒正美
C
Check Point Blog
G
Google Developers Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Jina AI
Jina AI
T
The Blog of Author Tim Ferriss
MongoDB | Blog
MongoDB | Blog
云风的 BLOG
云风的 BLOG
A
About on SuperTechFans
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
IT之家
IT之家

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix: expose transparent image infer options · openclaw/op...
steipete · 2026-04-26 · via Recent Commits to openclaw:main

@@ -22,6 +22,10 @@ import { buildGatewayConnectionDetailsWithResolvers } from "../gateway/connectio

2222

import { isLoopbackHost } from "../gateway/net.js";

2323

import { GATEWAY_CLIENT_MODES, GATEWAY_CLIENT_NAMES } from "../gateway/protocol/client-info.js";

2424

import { generateImage, listRuntimeImageGenerationProviders } from "../image-generation/runtime.js";

25+

import type {

26+

ImageGenerationOpenAIBackground,

27+

ImageGenerationOutputFormat,

28+

} from "../image-generation/types.js";

2529

import { buildMediaUnderstandingRegistry } from "../media-understanding/provider-registry.js";

2630

import {

2731

describeImageFile,

@@ -78,6 +82,8 @@ import { removeCommandByName } from "./program/command-tree.js";

7882

import { collectOption } from "./program/helpers.js";

79838084

type CapabilityTransport = "local" | "gateway";

85+

const IMAGE_OUTPUT_FORMATS = ["png", "jpeg", "webp"] as const;

86+

const OPENAI_IMAGE_BACKGROUNDS = ["transparent", "opaque", "auto"] as const;

81878288

type CapabilityMetadata = {

8389

id: string;

@@ -702,6 +708,8 @@ async function runImageGenerate(params: {

702708

size?: string;

703709

aspectRatio?: string;

704710

resolution?: "1K" | "2K" | "4K";

711+

outputFormat?: ImageGenerationOutputFormat;

712+

openaiBackground?: ImageGenerationOpenAIBackground;

705713

file?: string[];

706714

output?: string;

707715

timeoutMs?: number;

@@ -728,6 +736,10 @@ async function runImageGenerate(params: {

728736

size: params.size,

729737

aspectRatio: params.aspectRatio,

730738

resolution: params.resolution,

739+

outputFormat: params.outputFormat,

740+

providerOptions: params.openaiBackground

741+

? { openai: { background: params.openaiBackground } }

742+

: undefined,

731743

timeoutMs: params.timeoutMs,

732744

inputImages,

733745

});

@@ -851,6 +863,32 @@ function parseOptionalFiniteNumber(

851863

return value;

852864

}

853865866+

function normalizeImageOutputFormat(

867+

raw: string | undefined,

868+

): ImageGenerationOutputFormat | undefined {

869+

const normalized = normalizeLowercaseStringOrEmpty(raw);

870+

if (!normalized) {

871+

return undefined;

872+

}

873+

if ((IMAGE_OUTPUT_FORMATS as readonly string[]).includes(normalized)) {

874+

return normalized as ImageGenerationOutputFormat;

875+

}

876+

throw new Error("--output-format must be one of png, jpeg, or webp");

877+

}

878+879+

function normalizeOpenAIImageBackground(

880+

raw: string | undefined,

881+

): ImageGenerationOpenAIBackground | undefined {

882+

const normalized = normalizeLowercaseStringOrEmpty(raw);

883+

if (!normalized) {

884+

return undefined;

885+

}

886+

if ((OPENAI_IMAGE_BACKGROUNDS as readonly string[]).includes(normalized)) {

887+

return normalized as ImageGenerationOpenAIBackground;

888+

}

889+

throw new Error("--openai-background must be one of transparent, opaque, or auto");

890+

}

891+854892

function normalizeVideoResolution(raw: string | undefined): VideoGenerationResolution | undefined {

855893

const normalized = raw?.trim().toUpperCase();

856894

if (!normalized) {

@@ -1438,6 +1476,8 @@ export function registerCapabilityCli(program: Command) {

14381476

.option("--size <size>", "Size hint like 1024x1024")

14391477

.option("--aspect-ratio <ratio>", "Aspect ratio hint like 16:9")

14401478

.option("--resolution <value>", "Resolution hint: 1K, 2K, or 4K")

1479+

.option("--output-format <format>", "Output format hint: png, jpeg, or webp")

1480+

.option("--openai-background <value>", "OpenAI background hint: transparent, opaque, or auto")

14411481

.option("--timeout-ms <ms>", "Provider request timeout in milliseconds")

14421482

.option("--output <path>", "Output path")

14431483

.option("--json", "Output JSON", false)

@@ -1451,6 +1491,10 @@ export function registerCapabilityCli(program: Command) {

14511491

size: opts.size as string | undefined,

14521492

aspectRatio: opts.aspectRatio as string | undefined,

14531493

resolution: opts.resolution as "1K" | "2K" | "4K" | undefined,

1494+

outputFormat: normalizeImageOutputFormat(opts.outputFormat as string | undefined),

1495+

openaiBackground: normalizeOpenAIImageBackground(

1496+

opts.openaiBackground as string | undefined,

1497+

),

14541498

timeoutMs: parseOptionalFiniteNumber(opts.timeoutMs, "--timeout-ms"),

14551499

output: opts.output as string | undefined,

14561500

});

@@ -1464,6 +1508,8 @@ export function registerCapabilityCli(program: Command) {

14641508

.requiredOption("--file <path>", "Input file", collectOption, [])

14651509

.requiredOption("--prompt <text>", "Prompt text")

14661510

.option("--model <provider/model>", "Model override")

1511+

.option("--output-format <format>", "Output format hint: png, jpeg, or webp")

1512+

.option("--openai-background <value>", "OpenAI background hint: transparent, opaque, or auto")

14671513

.option("--timeout-ms <ms>", "Provider request timeout in milliseconds")

14681514

.option("--output <path>", "Output path")

14691515

.option("--json", "Output JSON", false)

@@ -1475,6 +1521,10 @@ export function registerCapabilityCli(program: Command) {

14751521

prompt: String(opts.prompt),

14761522

model: opts.model as string | undefined,

14771523

file: files,

1524+

outputFormat: normalizeImageOutputFormat(opts.outputFormat as string | undefined),

1525+

openaiBackground: normalizeOpenAIImageBackground(

1526+

opts.openaiBackground as string | undefined,

1527+

),

14781528

timeoutMs: parseOptionalFiniteNumber(opts.timeoutMs, "--timeout-ms"),

14791529

output: opts.output as string | undefined,

14801530

});