patchrelay 0.21.0 → 0.21.1
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/build-info.json +3 -3
- package/dist/cli/watch/ItemLine.js +15 -3
- package/package.json +1 -1
package/dist/build-info.json
CHANGED
|
@@ -25,11 +25,23 @@ function truncate(text, max) {
|
|
|
25
25
|
function renderAgentMessage(item) {
|
|
26
26
|
return (_jsxs(Text, { children: [_jsx(Text, { dimColor: true, children: "message: " }), _jsx(Text, { wrap: "wrap", children: item.text ?? "" })] }));
|
|
27
27
|
}
|
|
28
|
+
function cleanCommand(raw) {
|
|
29
|
+
// Strip /bin/bash -lc '...' wrapper — show the inner command
|
|
30
|
+
const bashMatch = raw.match(/^\/bin\/(?:ba)?sh\s+-\w*c\s+['"](.+?)['"]$/s);
|
|
31
|
+
if (bashMatch?.[1])
|
|
32
|
+
return bashMatch[1];
|
|
33
|
+
// Strip /bin/bash -lc "..." (double quotes)
|
|
34
|
+
const bashMatch2 = raw.match(/^\/bin\/(?:ba)?sh\s+-\w*c\s+"(.+?)"$/s);
|
|
35
|
+
if (bashMatch2?.[1])
|
|
36
|
+
return bashMatch2[1];
|
|
37
|
+
return raw;
|
|
38
|
+
}
|
|
28
39
|
function renderCommand(item) {
|
|
29
|
-
const cmd = item.command ?? "?";
|
|
30
|
-
const
|
|
40
|
+
const cmd = cleanCommand(item.command ?? "?");
|
|
41
|
+
const exitCode = item.exitCode;
|
|
42
|
+
const exitLabel = exitCode !== undefined ? (exitCode === 0 ? "" : ` exit:${exitCode}`) : "";
|
|
31
43
|
const duration = item.durationMs !== undefined ? ` ${(item.durationMs / 1000).toFixed(1)}s` : "";
|
|
32
|
-
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { children: [_jsx(Text, { dimColor: true, children: "$ " }), _jsx(Text, { children: truncate(cmd,
|
|
44
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { children: [_jsx(Text, { dimColor: true, children: "$ " }), _jsx(Text, { children: truncate(cmd, 80) }), exitLabel && _jsx(Text, { color: "red", children: exitLabel }), duration && _jsx(Text, { dimColor: true, children: duration })] }), item.output && item.status === "inProgress" && (_jsxs(Text, { dimColor: true, children: [" ", truncate(item.output.split("\n").filter(Boolean).at(-1) ?? "", 100)] }))] }));
|
|
33
45
|
}
|
|
34
46
|
function renderFileChange(item) {
|
|
35
47
|
const count = item.changes?.length ?? 0;
|