neoctl 0.1.16 → 0.1.17
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/dist/repl/index.js +26 -0
- package/dist/repl/index.js.map +1 -1
- package/dist/tools/builtins/image-generation-tool.d.ts +18 -1
- package/dist/tools/builtins/image-generation-tool.js +18 -1
- package/dist/tools/builtins/image-generation-tool.js.map +1 -1
- package/dist/web/html.js +3 -4
- package/dist/web/html.js.map +1 -1
- package/dist/web/index.js +25 -0
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
package/dist/repl/index.js
CHANGED
|
@@ -3154,6 +3154,9 @@ function formatToolResult(toolName, output, ok) {
|
|
|
3154
3154
|
if (toolName === "search" && isRecord(output)) {
|
|
3155
3155
|
return { text: formatWebSearchToolResult(output, ok), summaryMaxLines: EXPANDED_SUMMARY_MAX_LINES };
|
|
3156
3156
|
}
|
|
3157
|
+
if (toolName === "image2" && isRecord(output)) {
|
|
3158
|
+
return { text: formatImageGenerationToolResult(output, ok), summaryMaxLines: 4 };
|
|
3159
|
+
}
|
|
3157
3160
|
if (toolName === "plan" && isPlanToolPayload(output)) {
|
|
3158
3161
|
return { text: formatPlanToolPayload(output), bodyTitle: planToolBodyTitle(output), full: true };
|
|
3159
3162
|
}
|
|
@@ -3269,6 +3272,29 @@ function formatExecToolResult(output, ok) {
|
|
|
3269
3272
|
function isRecord(value) {
|
|
3270
3273
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
3271
3274
|
}
|
|
3275
|
+
function formatImageGenerationToolResult(output, ok) {
|
|
3276
|
+
const error = typeof output.error === "string" ? output.error : undefined;
|
|
3277
|
+
if (!ok || error)
|
|
3278
|
+
return ["image generation failed", error ?? formatReplData(output, 1200)].join("\n");
|
|
3279
|
+
const provider = typeof output.provider === "string" ? output.provider : "openai";
|
|
3280
|
+
const model = typeof output.model === "string" ? output.model : undefined;
|
|
3281
|
+
const returnedImages = typeof output.returnedImages === "number" ? output.returnedImages : Array.isArray(output.images) ? output.images.length : undefined;
|
|
3282
|
+
const size = typeof output.size === "string" ? output.size : undefined;
|
|
3283
|
+
const quality = typeof output.quality === "string" ? output.quality : undefined;
|
|
3284
|
+
const format = typeof output.outputFormat === "string" ? output.outputFormat : undefined;
|
|
3285
|
+
const lines = [`generated ${returnedImages ?? 0} image${returnedImages === 1 ? "" : "s"}`];
|
|
3286
|
+
const details = [provider, model, size, quality && quality !== "auto" ? quality : undefined, format].filter((value) => Boolean(value));
|
|
3287
|
+
if (details.length > 0)
|
|
3288
|
+
lines.push(details.join(" · "));
|
|
3289
|
+
const duration = imageGenerationDuration(output);
|
|
3290
|
+
if (duration !== undefined)
|
|
3291
|
+
lines.push(`duration: ${duration}ms`);
|
|
3292
|
+
return lines.join("\n");
|
|
3293
|
+
}
|
|
3294
|
+
function imageGenerationDuration(output) {
|
|
3295
|
+
const value = output.duration ?? output.elapsed ?? output.durationMs ?? output.elapsedMs;
|
|
3296
|
+
return typeof value === "number" && Number.isFinite(value) ? Math.max(0, Math.round(value)) : undefined;
|
|
3297
|
+
}
|
|
3272
3298
|
function formatListToolResult(output, ok) {
|
|
3273
3299
|
const pathValue = typeof output.path === "string" ? output.path : "";
|
|
3274
3300
|
const typeValue = typeof output.type === "string" ? output.type : "result";
|