clawmoney 0.8.7 → 0.8.9
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 +5 -4
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/hub/executor.js
CHANGED
|
@@ -25,13 +25,14 @@ function buildPrompt(call, config) {
|
|
|
25
25
|
].join("\n");
|
|
26
26
|
}
|
|
27
27
|
// ── CLI execution (openclaw agent / claude -p) ──
|
|
28
|
-
function runCli(command, prompt, timeoutMs) {
|
|
28
|
+
function runCli(command, prompt, timeoutMs, orderId) {
|
|
29
29
|
return new Promise((resolve) => {
|
|
30
30
|
// Build args based on command
|
|
31
31
|
let args;
|
|
32
32
|
if (command === "openclaw") {
|
|
33
|
-
// openclaw agent --message "..." --local
|
|
34
|
-
|
|
33
|
+
// openclaw agent --message "..." --session-id <order_id> --local --json
|
|
34
|
+
// session-id doesn't need to be pre-created, openclaw auto-creates it
|
|
35
|
+
args = ["agent", "--message", prompt, "--session-id", orderId || "hub-task", "--local", "--json"];
|
|
35
36
|
}
|
|
36
37
|
else {
|
|
37
38
|
// claude -p "..." --output-format json
|
|
@@ -132,7 +133,7 @@ export class Executor {
|
|
|
132
133
|
const timeoutS = Math.max(call.timeout - TIMEOUT_BUFFER_S, 30);
|
|
133
134
|
const command = this.config.provider.cli_command;
|
|
134
135
|
logger.info(`Executing: ${command} for skill="${call.skill}" order=${call.order_id} (timeout=${timeoutS}s)`);
|
|
135
|
-
const { stdout, stderr, exitCode } = await runCli(command, prompt, timeoutS * 1000);
|
|
136
|
+
const { stdout, stderr, exitCode } = await runCli(command, prompt, timeoutS * 1000, call.order_id);
|
|
136
137
|
if (exitCode !== 0) {
|
|
137
138
|
const errMsg = stderr.trim() || `CLI exited with code ${exitCode}`;
|
|
138
139
|
logger.error(`CLI failed (code=${exitCode}):`, errMsg);
|
package/dist/index.js
CHANGED