neoctl 0.1.17 → 0.1.18
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/context/prompts.js +2 -2
- package/dist/context/prompts.js.map +1 -1
- package/dist/repl/index.js +6 -2
- package/dist/repl/index.js.map +1 -1
- package/dist/tools/builtins/image-generation-tool.d.ts +28 -0
- package/dist/tools/builtins/image-generation-tool.js +169 -13
- package/dist/tools/builtins/image-generation-tool.js.map +1 -1
- package/dist/web/index.js +6 -2
- package/dist/web/index.js.map +1 -1
- package/package.json +1 -1
package/dist/context/prompts.js
CHANGED
|
@@ -30,8 +30,8 @@ export function buildDefaultSystemPromptSections(enabledTools = []) {
|
|
|
30
30
|
: "Available tools are provided separately by the runtime.",
|
|
31
31
|
"When using tools, you may briefly state the intent of the tool call; if a tool result contains valuable information, you may briefly report it.",
|
|
32
32
|
hasImageGenerationTool
|
|
33
|
-
? "When the user asks for drawing/image generation, use the image2 tool. It is backed by OpenAI's Images API."
|
|
34
|
-
: "This runtime has no drawing/image generation tool. If the user asks you to draw, create, render, or
|
|
33
|
+
? "When the user asks for drawing/image generation or image editing/modification, use the image2 tool. It is backed by OpenAI's Images API; use mode=generate for new images and mode=edit for modifying existing images."
|
|
34
|
+
: "This runtime has no drawing/image generation/editing tool. If the user asks you to draw, create, render, generate, or edit an image, say that the current model/provider does not have drawing capability instead of pretending to generate one.",
|
|
35
35
|
].join("\n"),
|
|
36
36
|
},
|
|
37
37
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.js","sourceRoot":"","sources":["../../src/context/prompts.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,8BAA8B,GAAG,oCAAoC,CAAC;AAkBnF,MAAM,UAAU,gCAAgC,CAAC,eAAkC,EAAE;IACnF,MAAM,sBAAsB,GAAG,YAAY,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,YAAY,CA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;IAC/F,OAAO,CAAC,GAAG,MAAM,EAAE,8BAA8B,EAAE,GAAG,OAAO,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AAC9F,CAAC;AAED,SAAS,aAAa,CAAC,OAAsB;IAC3C,OAAO,kBAAkB,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAY,EAAE,OAAe;IACvD,OAAO,MAAM,IAAI,KAAK,OAAO,EAAE,CAAC;AAClC,CAAC;AAED,SAAS,kBAAkB,CAAC,OAAqC;IAC/D,MAAM,MAAM,GAAG,OAAO,OAAO,CAAC,WAAW,KAAK,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC;IAC7H,OAAO,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AAC9B,CAAC"}
|
package/dist/repl/index.js
CHANGED
|
@@ -3274,18 +3274,22 @@ function isRecord(value) {
|
|
|
3274
3274
|
}
|
|
3275
3275
|
function formatImageGenerationToolResult(output, ok) {
|
|
3276
3276
|
const error = typeof output.error === "string" ? output.error : undefined;
|
|
3277
|
+
const mode = output.mode === "edit" ? "edit" : "generate";
|
|
3277
3278
|
if (!ok || error)
|
|
3278
|
-
return [
|
|
3279
|
+
return [`image ${mode} failed`, error ?? formatReplData(output, 1200)].join("\n");
|
|
3279
3280
|
const provider = typeof output.provider === "string" ? output.provider : "openai";
|
|
3280
3281
|
const model = typeof output.model === "string" ? output.model : undefined;
|
|
3281
3282
|
const returnedImages = typeof output.returnedImages === "number" ? output.returnedImages : Array.isArray(output.images) ? output.images.length : undefined;
|
|
3282
3283
|
const size = typeof output.size === "string" ? output.size : undefined;
|
|
3283
3284
|
const quality = typeof output.quality === "string" ? output.quality : undefined;
|
|
3284
3285
|
const format = typeof output.outputFormat === "string" ? output.outputFormat : undefined;
|
|
3285
|
-
const
|
|
3286
|
+
const sourceImages = typeof output.sourceImages === "number" ? output.sourceImages : undefined;
|
|
3287
|
+
const lines = [`${mode === "edit" ? "edited" : "generated"} ${returnedImages ?? 0} image${returnedImages === 1 ? "" : "s"}`];
|
|
3286
3288
|
const details = [provider, model, size, quality && quality !== "auto" ? quality : undefined, format].filter((value) => Boolean(value));
|
|
3287
3289
|
if (details.length > 0)
|
|
3288
3290
|
lines.push(details.join(" · "));
|
|
3291
|
+
if (sourceImages !== undefined)
|
|
3292
|
+
lines.push(`source images: ${sourceImages}`);
|
|
3289
3293
|
const duration = imageGenerationDuration(output);
|
|
3290
3294
|
if (duration !== undefined)
|
|
3291
3295
|
lines.push(`duration: ${duration}ms`);
|