claude-task-worker 0.11.0 → 0.12.0
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/index.js +8 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -81,13 +81,13 @@ function runHerdr(args) {
|
|
|
81
81
|
} catch {
|
|
82
82
|
parsed = void 0;
|
|
83
83
|
}
|
|
84
|
-
resolve2({ execError: error, parsed, stderr });
|
|
84
|
+
resolve2({ execError: error, parsed, stdout, stderr });
|
|
85
85
|
}
|
|
86
86
|
);
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
-
async function execHerdr(args) {
|
|
90
|
-
const { execError, parsed, stderr } = await runHerdr(args);
|
|
89
|
+
async function execHerdr(args, options) {
|
|
90
|
+
const { execError, parsed, stdout, stderr } = await runHerdr(args);
|
|
91
91
|
const stderrSuffix = stderr.trim() ? `: ${stderr.trim()}` : "";
|
|
92
92
|
if (parsed?.error) {
|
|
93
93
|
throw new HerdrError(
|
|
@@ -99,6 +99,9 @@ async function execHerdr(args) {
|
|
|
99
99
|
throw new Error(`herdr ${args.join(" ")} failed: ${execError.message}${stderrSuffix}`);
|
|
100
100
|
}
|
|
101
101
|
if (!parsed) {
|
|
102
|
+
if (options?.allowEmptyResult && stdout.trim() === "" && stderr.trim() === "") {
|
|
103
|
+
return void 0;
|
|
104
|
+
}
|
|
102
105
|
throw new Error(`herdr ${args.join(" ")} failed: invalid JSON output${stderrSuffix}`);
|
|
103
106
|
}
|
|
104
107
|
return parsed.result;
|
|
@@ -127,10 +130,10 @@ async function tabList() {
|
|
|
127
130
|
}));
|
|
128
131
|
}
|
|
129
132
|
async function paneSendText(paneId, text) {
|
|
130
|
-
await execHerdr(["pane", "send-text", paneId, text]);
|
|
133
|
+
await execHerdr(["pane", "send-text", paneId, text], { allowEmptyResult: true });
|
|
131
134
|
}
|
|
132
135
|
async function paneSendKeys(paneId, ...keys) {
|
|
133
|
-
await execHerdr(["pane", "send-keys", paneId, ...keys]);
|
|
136
|
+
await execHerdr(["pane", "send-keys", paneId, ...keys], { allowEmptyResult: true });
|
|
134
137
|
}
|
|
135
138
|
async function paneProcessInfo(paneId) {
|
|
136
139
|
const result = await execHerdr(["pane", "process-info", "--pane", paneId]);
|