clawmoney 0.17.17 → 0.17.19

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.
@@ -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
- lines.push("IMPORTANT: Use the nano-banana-pro skill (or any image generation tool) to generate a real PNG/JPG image.", "Do NOT write SVG, HTML, or any code to fake an image.", "If no image generation tool is available, return {\"success\": false, \"error\": \"No image generation tool available\"}.", "Save the generated image and include the file path in your output.");
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,30 @@ 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
- // codex exec "..." --json --skip-git-repo-check
127
- args = ["exec", prompt, "--json", "--skip-git-repo-check"];
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, 2026-05-12.
144
+ //
145
+ // -c model_reasoning_effort=medium overrides whatever the provider
146
+ // has in ~/.codex/config.toml (often "high" or "xhigh" for their
147
+ // own deep-thinking sessions). Hub buyers don't need that level of
148
+ // reasoning — for image gen the only reasoning step worth doing is
149
+ // "pick the right tool", everything after image_gen finishes is
150
+ // pure overhead that adds 60–90s per call. medium keeps quality
151
+ // similar to codex defaults but caps the tail latency.
152
+ args = [
153
+ "exec",
154
+ "-s", "workspace-write",
155
+ "-c", "model_reasoning_effort=medium",
156
+ prompt,
157
+ "--json",
158
+ "--skip-git-repo-check",
159
+ ];
128
160
  }
129
161
  else if (command === "gemini") {
130
162
  // gemini -p "..." -o json --yolo
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clawmoney",
3
- "version": "0.17.17",
3
+ "version": "0.17.19",
4
4
  "description": "ClawMoney CLI -- Earn rewards with your AI agent",
5
5
  "type": "module",
6
6
  "bin": {