

























@@ -199,14 +199,14 @@ const CAPABILITY_METADATA: CapabilityMetadata[] = [
199199id: "image.describe",
200200description: "Describe one image file through media-understanding providers.",
201201transports: ["local"],
202-flags: ["--file", "--prompt", "--model", "--json"],
202+flags: ["--file", "--prompt", "--model", "--timeout-ms", "--json"],
203203resultShape: "normalized text output",
204204},
205205{
206206id: "image.describe-many",
207207description: "Describe multiple image files independently.",
208208transports: ["local"],
209-flags: ["--file", "--prompt", "--model", "--json"],
209+flags: ["--file", "--prompt", "--model", "--timeout-ms", "--json"],
210210resultShape: "one text output per file",
211211},
212212{
@@ -855,10 +855,13 @@ async function runImageDescribe(params: {
855855capability: "image.describe" | "image.describe-many";
856856files: string[];
857857model?: string;
858+prompt?: string;
859+timeoutMs?: number;
858860}) {
859861const cfg = getRuntimeConfig();
860862const agentDir = resolveAgentDir(cfg, resolveDefaultAgentId(cfg));
861863const activeModel = requireProviderModelOverride(params.model);
864+const prompt = normalizeOptionalString(params.prompt);
862865const outputs = await Promise.all(
863866params.files.map(async (filePath) => {
864867const resolvedPath = path.resolve(filePath);
@@ -869,12 +872,15 @@ async function runImageDescribe(params: {
869872 agentDir,
870873provider: activeModel.provider,
871874model: activeModel.model,
872-prompt: "Describe the image.",
875+prompt: prompt ?? "Describe the image.",
876+timeoutMs: params.timeoutMs,
873877})
874878 : await describeImageFile({
875879filePath: resolvedPath,
876880 cfg,
877881 agentDir,
882+ prompt,
883+timeoutMs: params.timeoutMs,
878884});
879885if (!result.text) {
880886throw new Error(`No description returned for image: ${resolvedPath}`);
@@ -1676,14 +1682,18 @@ export function registerCapabilityCli(program: Command) {
16761682.command("describe")
16771683.description("Describe one image file")
16781684.requiredOption("--file <path>", "Image file")
1685+.option("--prompt <text>", "Prompt hint")
16791686.option("--model <provider/model>", "Model override")
1687+.option("--timeout-ms <ms>", "Provider request timeout in milliseconds")
16801688.option("--json", "Output JSON", false)
16811689.action(async (opts) => {
16821690await runCommandWithRuntime(defaultRuntime, async () => {
16831691const result = await runImageDescribe({
16841692capability: "image.describe",
16851693files: [String(opts.file)],
16861694model: opts.model as string | undefined,
1695+prompt: opts.prompt as string | undefined,
1696+timeoutMs: parseOptionalFiniteNumber(opts.timeoutMs, "--timeout-ms"),
16871697});
16881698emitJsonOrText(defaultRuntime, Boolean(opts.json), result, formatEnvelopeForText);
16891699});
@@ -1693,14 +1703,18 @@ export function registerCapabilityCli(program: Command) {
16931703.command("describe-many")
16941704.description("Describe multiple image files")
16951705.requiredOption("--file <path>", "Image file", collectOption, [])
1706+.option("--prompt <text>", "Prompt hint")
16961707.option("--model <provider/model>", "Model override")
1708+.option("--timeout-ms <ms>", "Provider request timeout in milliseconds")
16971709.option("--json", "Output JSON", false)
16981710.action(async (opts) => {
16991711await runCommandWithRuntime(defaultRuntime, async () => {
17001712const result = await runImageDescribe({
17011713capability: "image.describe-many",
17021714files: opts.file as string[],
17031715model: opts.model as string | undefined,
1716+prompt: opts.prompt as string | undefined,
1717+timeoutMs: parseOptionalFiniteNumber(opts.timeoutMs, "--timeout-ms"),
17041718});
17051719emitJsonOrText(defaultRuntime, Boolean(opts.json), result, formatEnvelopeForText);
17061720});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。