clawmoney 0.17.17 → 0.17.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/hub/executor.js +21 -4
- package/package.json +1 -1
package/dist/hub/executor.js
CHANGED
|
@@ -21,9 +21,19 @@ function buildPrompt(call, config) {
|
|
|
21
21
|
`Input: ${JSON.stringify(call.input, null, 2)}`,
|
|
22
22
|
"",
|
|
23
23
|
];
|
|
24
|
-
// Category-specific instructions
|
|
24
|
+
// Category-specific instructions. Skill names differ per CLI runtime —
|
|
25
|
+
// openclaw exposes nano-banana-pro, codex exposes built-in imagegen,
|
|
26
|
+
// claude/gemini surface image generation via their own tools. We pick
|
|
27
|
+
// the right hint so the model goes straight to the real tool instead
|
|
28
|
+
// of trying to "be helpful" by writing PIL code or hallucinating a path.
|
|
25
29
|
if (call.category?.startsWith("generation/image")) {
|
|
26
|
-
|
|
30
|
+
const cli = config.provider.cli_command;
|
|
31
|
+
const skillHint = cli === "codex"
|
|
32
|
+
? "Use the imagegen skill (the built-in image_gen tool — do NOT use shell/python to draw an image)"
|
|
33
|
+
: cli === "openclaw"
|
|
34
|
+
? "Use the nano-banana-pro skill"
|
|
35
|
+
: "Use your native image generation tool";
|
|
36
|
+
lines.push(`IMPORTANT: ${skillHint} to generate a real PNG/JPG image.`, "Do NOT write SVG, HTML, Python (PIL), or any code to fake an image.", "If no image generation tool is available in this environment, return {\"success\": false, \"error\": \"No image generation tool available\"}.", "Save the generated image and include the absolute file path in your JSON output as \"image_path\".");
|
|
27
37
|
}
|
|
28
38
|
lines.push("Execute this task and return the result as JSON.", "If you generate any files (images, videos, etc.), save them and include their file paths in the output.", "Return ONLY the JSON result, no other text.");
|
|
29
39
|
return lines.join("\n");
|
|
@@ -123,8 +133,15 @@ function runCli(command, prompt, timeoutMs, orderId) {
|
|
|
123
133
|
args = ["agent", "--message", prompt, "--session-id", orderId || "hub-task", "--json"];
|
|
124
134
|
}
|
|
125
135
|
else if (command === "codex") {
|
|
126
|
-
//
|
|
127
|
-
|
|
136
|
+
// -s workspace-write is required so the built-in image_gen tool can
|
|
137
|
+
// write files under $CODEX_HOME/generated_images and so the model
|
|
138
|
+
// can mv/cp the result to the user-named path. With the default
|
|
139
|
+
// read-only sandbox, image_gen silently degrades — the model falls
|
|
140
|
+
// back to either drawing the image with Python in /tmp (slow, ugly)
|
|
141
|
+
// or hallucinating an image_path with no file behind it (worst
|
|
142
|
+
// case, since the buyer pays for a nonexistent file). Verified on
|
|
143
|
+
// codex 0.128.0 + gpt-5.5 xhigh, 2026-05-12.
|
|
144
|
+
args = ["exec", "-s", "workspace-write", prompt, "--json", "--skip-git-repo-check"];
|
|
128
145
|
}
|
|
129
146
|
else if (command === "gemini") {
|
|
130
147
|
// gemini -p "..." -o json --yolo
|