@garuda-agent/garuda 0.18.0 → 0.18.2
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/CHANGELOG.md +156 -0
- package/README.md +3 -2
- package/dist/{acpCommand-IUZPLPLI.js → acpCommand-PUJHFWYU.js} +10 -8
- package/dist/advise-C777SZ5M.js +433 -0
- package/dist/brief-RWKESOPT.js +91 -0
- package/dist/buildCheck-HB46NWLX.js +19 -0
- package/dist/buildInfo-Z4P7QAQL.js +8 -0
- package/dist/chunk-2OYTNNUJ.js +216 -0
- package/dist/chunk-4BELTWP4.js +156 -0
- package/dist/chunk-4QRTTRVK.js +88 -0
- package/dist/chunk-6JQTPW3P.js +88 -0
- package/dist/chunk-A5DLAXB4.js +1780 -0
- package/dist/{chunk-FARS4R67.js → chunk-AX3A5KPH.js} +18 -1
- package/dist/chunk-CFDRP6XW.js +9 -0
- package/dist/chunk-E6YRCDSF.js +9 -0
- package/dist/{chunk-OQ26W5L4.js → chunk-HP6EGFHV.js} +132 -75
- package/dist/chunk-L55VUSX3.js +54 -0
- package/dist/{chunk-B4SJY7KT.js → chunk-LMKGSYJC.js} +77 -8
- package/dist/{chunk-Q4P3W657.js → chunk-LWNMEGDF.js} +10 -1124
- package/dist/{chunk-23FXBNBB.js → chunk-MNE7HHX2.js} +2 -1
- package/dist/{chunk-UKIE4AAM.js → chunk-NLS7GMF7.js} +11 -105
- package/dist/{chunk-6XHON3Q6.js → chunk-QXTHEFKP.js} +3 -3
- package/dist/{chunk-4BVCYCQT.js → chunk-R7RCW4BQ.js} +9 -7
- package/dist/{chunk-NHWHG3SW.js → chunk-STVFWSIL.js} +350 -57
- package/dist/{chunk-5B5HDTUR.js → chunk-TWQ7V2L6.js} +2 -2
- package/dist/chunk-ULAJPMY7.js +107 -0
- package/dist/chunk-VISKX36R.js +306 -0
- package/dist/{chunk-55CFEEIN.js → chunk-WK5NE6RY.js} +2 -2
- package/dist/chunk-Y62J7PTD.js +90 -0
- package/dist/chunk-YAQ6QLKB.js +40 -0
- package/dist/{chunk-FOPBOB7W.js → chunk-YEH2OONM.js} +6 -4
- package/dist/{chunk-7TH3NHCQ.js → chunk-ZKT4P2PC.js} +2 -2
- package/dist/cli/index.js +242 -52
- package/dist/{create-W6BV75QX.js → create-OACSGJ37.js} +5 -5
- package/dist/{evalCommand-SKJQ6CW2.js → evalCommand-MRO6ENCA.js} +77 -39
- package/dist/{evalTune-CZRCPSZ3.js → evalTune-VL5RHYOG.js} +24 -18
- package/dist/{export-SJ3DUP6W.js → export-ZPF3AMO6.js} +27 -4
- package/dist/exportHtml-ISISG5HG.js +21 -0
- package/dist/{inkChat-WYYAFZXD.js → inkChat-UDFX6GH6.js} +256 -41
- package/dist/{install-TKWN5AYH.js → install-4ST5BNRG.js} +3 -3
- package/dist/{jobCommand-2ODQLHB3.js → jobCommand-ILOTYOX3.js} +8 -7
- package/dist/{launchd-3A3ONEW5.js → launchd-QG6R5RAK.js} +4 -4
- package/dist/{lspCommand-ZZ6R4PA2.js → lspCommand-X4FTTONR.js} +3 -3
- package/dist/{manager-TCYTA5XU.js → manager-YH7722C2.js} +3 -3
- package/dist/{nightCommand-WJU6VZA6.js → nightCommand-XPWT6CQZ.js} +8 -7
- package/dist/receiptView-YFDHV253.js +19 -0
- package/dist/{remove-42WQNVPX.js → remove-STX5UO7X.js} +3 -3
- package/dist/{run-PTMRQCIU.js → run-W4TK52WT.js} +5 -5
- package/dist/runner-EBF6EOYM.js +97 -0
- package/dist/{server-VEYIJHEU.js → server-ASM73QVY.js} +3 -3
- package/dist/tour-CEVMAC5S.js +18 -0
- package/dist/tune-KSNKBPNJ.js +51 -0
- package/dist/uiState-YFJQ43D7.js +16 -0
- package/package.json +1 -1
- package/dist/chunk-4JSUUDFQ.js +0 -118
- package/dist/chunk-C57GHLKP.js +0 -9
- package/dist/chunk-DOCDCQVM.js +0 -484
- package/dist/tune-YVI2KWQF.js +0 -31
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
RECEIPT_BOX_MIN_COLUMNS,
|
|
4
|
+
RECEIPT_MAX_WIDTH,
|
|
5
|
+
cells,
|
|
6
|
+
receiptText,
|
|
7
|
+
screenReaderMode
|
|
8
|
+
} from "./chunk-2OYTNNUJ.js";
|
|
9
|
+
import "./chunk-NLS7GMF7.js";
|
|
10
|
+
import "./chunk-7KBOIPUT.js";
|
|
11
|
+
import "./chunk-BHZ6G65V.js";
|
|
12
|
+
export {
|
|
13
|
+
RECEIPT_BOX_MIN_COLUMNS,
|
|
14
|
+
RECEIPT_MAX_WIDTH,
|
|
15
|
+
cells,
|
|
16
|
+
receiptText,
|
|
17
|
+
screenReaderMode
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=receiptView-YFDHV253.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
git
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-QXTHEFKP.js";
|
|
5
|
+
import "./chunk-LMKGSYJC.js";
|
|
6
6
|
import "./chunk-BHZ6G65V.js";
|
|
7
7
|
import "./chunk-P6XWWIEK.js";
|
|
8
8
|
import {
|
|
@@ -58,4 +58,4 @@ export {
|
|
|
58
58
|
jobLeftovers,
|
|
59
59
|
removeJob
|
|
60
60
|
};
|
|
61
|
-
//# sourceMappingURL=remove-
|
|
61
|
+
//# sourceMappingURL=remove-STX5UO7X.js.map
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
folderKind
|
|
4
|
-
} from "./chunk-42DSA4EA.js";
|
|
5
2
|
import {
|
|
6
3
|
loadSearchConfig,
|
|
7
4
|
providerLabel,
|
|
@@ -9,7 +6,10 @@ import {
|
|
|
9
6
|
} from "./chunk-B25VL4RU.js";
|
|
10
7
|
import {
|
|
11
8
|
BUILTIN_COMMANDS
|
|
12
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MNE7HHX2.js";
|
|
10
|
+
import {
|
|
11
|
+
folderKind
|
|
12
|
+
} from "./chunk-42DSA4EA.js";
|
|
13
13
|
import {
|
|
14
14
|
SERVER_NAME,
|
|
15
15
|
checkServerUrl
|
|
@@ -885,4 +885,4 @@ export {
|
|
|
885
885
|
initPrompt,
|
|
886
886
|
runInit
|
|
887
887
|
};
|
|
888
|
-
//# sourceMappingURL=run-
|
|
888
|
+
//# sourceMappingURL=run-W4TK52WT.js.map
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
EVAL_BIOME_CONFIG,
|
|
4
|
+
EVAL_DENY_RULES,
|
|
5
|
+
EVAL_TASK_TIMEOUT_MS,
|
|
6
|
+
FAILURE_KINDS,
|
|
7
|
+
MCP_NOT_STARTED,
|
|
8
|
+
MCP_PREPARE_FAILED,
|
|
9
|
+
MCP_PREPARE_TIMEOUT_MS,
|
|
10
|
+
ModelWatch,
|
|
11
|
+
PROTECTED_FILES_CHANGED,
|
|
12
|
+
PROVIDER_STALLED,
|
|
13
|
+
PROVIDER_STALL_MS,
|
|
14
|
+
REPO_CHECK_TIMEOUT_MS,
|
|
15
|
+
checkAsEval,
|
|
16
|
+
failureKind,
|
|
17
|
+
failureLine,
|
|
18
|
+
failureSummary,
|
|
19
|
+
formatProject,
|
|
20
|
+
formatReport,
|
|
21
|
+
idWidth,
|
|
22
|
+
isAuthFailure,
|
|
23
|
+
isConnectionFailure,
|
|
24
|
+
isErrorRun,
|
|
25
|
+
isMcpFailure,
|
|
26
|
+
isProviderStall,
|
|
27
|
+
isSetupFailure,
|
|
28
|
+
repoTaskSandbox,
|
|
29
|
+
runCheck,
|
|
30
|
+
runEvalTask,
|
|
31
|
+
runEvals,
|
|
32
|
+
saveUnique,
|
|
33
|
+
summarize,
|
|
34
|
+
withStalledRun,
|
|
35
|
+
writeFiles
|
|
36
|
+
} from "./chunk-A5DLAXB4.js";
|
|
37
|
+
import "./chunk-NXJ4XLB5.js";
|
|
38
|
+
import "./chunk-STVFWSIL.js";
|
|
39
|
+
import "./chunk-G2AX7MGS.js";
|
|
40
|
+
import "./chunk-ULAJPMY7.js";
|
|
41
|
+
import "./chunk-65NUEOI7.js";
|
|
42
|
+
import "./chunk-4QRTTRVK.js";
|
|
43
|
+
import "./chunk-A2QAIRQL.js";
|
|
44
|
+
import "./chunk-NLS7GMF7.js";
|
|
45
|
+
import "./chunk-7KBOIPUT.js";
|
|
46
|
+
import "./chunk-B25VL4RU.js";
|
|
47
|
+
import "./chunk-MNE7HHX2.js";
|
|
48
|
+
import "./chunk-CFDRP6XW.js";
|
|
49
|
+
import "./chunk-5DEWP3YX.js";
|
|
50
|
+
import "./chunk-PZS3V6P3.js";
|
|
51
|
+
import "./chunk-QANRZW7W.js";
|
|
52
|
+
import "./chunk-ATW7BNIG.js";
|
|
53
|
+
import "./chunk-WK5NE6RY.js";
|
|
54
|
+
import "./chunk-AOGFYUKG.js";
|
|
55
|
+
import "./chunk-QXTHEFKP.js";
|
|
56
|
+
import "./chunk-LMKGSYJC.js";
|
|
57
|
+
import "./chunk-BHZ6G65V.js";
|
|
58
|
+
import "./chunk-P6XWWIEK.js";
|
|
59
|
+
import "./chunk-UIRJOQQS.js";
|
|
60
|
+
import "./chunk-4LFJFDCF.js";
|
|
61
|
+
import "./chunk-3NJNVZTK.js";
|
|
62
|
+
export {
|
|
63
|
+
EVAL_BIOME_CONFIG,
|
|
64
|
+
EVAL_DENY_RULES,
|
|
65
|
+
EVAL_TASK_TIMEOUT_MS,
|
|
66
|
+
FAILURE_KINDS,
|
|
67
|
+
MCP_NOT_STARTED,
|
|
68
|
+
MCP_PREPARE_FAILED,
|
|
69
|
+
MCP_PREPARE_TIMEOUT_MS,
|
|
70
|
+
ModelWatch,
|
|
71
|
+
PROTECTED_FILES_CHANGED,
|
|
72
|
+
PROVIDER_STALLED,
|
|
73
|
+
PROVIDER_STALL_MS,
|
|
74
|
+
REPO_CHECK_TIMEOUT_MS,
|
|
75
|
+
checkAsEval,
|
|
76
|
+
failureKind,
|
|
77
|
+
failureLine,
|
|
78
|
+
failureSummary,
|
|
79
|
+
formatProject,
|
|
80
|
+
formatReport,
|
|
81
|
+
idWidth,
|
|
82
|
+
isAuthFailure,
|
|
83
|
+
isConnectionFailure,
|
|
84
|
+
isErrorRun,
|
|
85
|
+
isMcpFailure,
|
|
86
|
+
isProviderStall,
|
|
87
|
+
isSetupFailure,
|
|
88
|
+
repoTaskSandbox,
|
|
89
|
+
runCheck,
|
|
90
|
+
runEvalTask,
|
|
91
|
+
runEvals,
|
|
92
|
+
saveUnique,
|
|
93
|
+
summarize,
|
|
94
|
+
withStalledRun,
|
|
95
|
+
writeFiles
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=runner-EBF6EOYM.js.map
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
hasHidden,
|
|
5
5
|
headerText,
|
|
6
6
|
visible
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-VISKX36R.js";
|
|
8
8
|
import {
|
|
9
9
|
BUILTIN_COMMANDS
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-MNE7HHX2.js";
|
|
11
11
|
|
|
12
12
|
// src/acp/server.ts
|
|
13
13
|
import { randomUUID } from "crypto";
|
|
@@ -695,4 +695,4 @@ export {
|
|
|
695
695
|
canRunTerminalAuth,
|
|
696
696
|
setupNeeded
|
|
697
697
|
};
|
|
698
|
-
//# sourceMappingURL=server-
|
|
698
|
+
//# sourceMappingURL=server-ASM73QVY.js.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
detectStack,
|
|
4
|
+
firstRunTour,
|
|
5
|
+
tourChoice,
|
|
6
|
+
tourPrompts,
|
|
7
|
+
tourText
|
|
8
|
+
} from "./chunk-Y62J7PTD.js";
|
|
9
|
+
import "./chunk-42DSA4EA.js";
|
|
10
|
+
import "./chunk-AOGFYUKG.js";
|
|
11
|
+
export {
|
|
12
|
+
detectStack,
|
|
13
|
+
firstRunTour,
|
|
14
|
+
tourChoice,
|
|
15
|
+
tourPrompts,
|
|
16
|
+
tourText
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=tour-CEVMAC5S.js.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
ADDENDUM_MAX_CHARS,
|
|
4
|
+
PROPOSER_SYSTEM,
|
|
5
|
+
decide,
|
|
6
|
+
parseProposal,
|
|
7
|
+
proposerInput,
|
|
8
|
+
readAddendum,
|
|
9
|
+
rejectReason,
|
|
10
|
+
tune
|
|
11
|
+
} from "./chunk-YEH2OONM.js";
|
|
12
|
+
import "./chunk-6JQTPW3P.js";
|
|
13
|
+
import "./chunk-YAQ6QLKB.js";
|
|
14
|
+
import "./chunk-E6YRCDSF.js";
|
|
15
|
+
import "./chunk-A5DLAXB4.js";
|
|
16
|
+
import "./chunk-NXJ4XLB5.js";
|
|
17
|
+
import "./chunk-STVFWSIL.js";
|
|
18
|
+
import "./chunk-G2AX7MGS.js";
|
|
19
|
+
import "./chunk-ULAJPMY7.js";
|
|
20
|
+
import "./chunk-65NUEOI7.js";
|
|
21
|
+
import "./chunk-4QRTTRVK.js";
|
|
22
|
+
import "./chunk-A2QAIRQL.js";
|
|
23
|
+
import "./chunk-NLS7GMF7.js";
|
|
24
|
+
import "./chunk-7KBOIPUT.js";
|
|
25
|
+
import "./chunk-B25VL4RU.js";
|
|
26
|
+
import "./chunk-MNE7HHX2.js";
|
|
27
|
+
import "./chunk-CFDRP6XW.js";
|
|
28
|
+
import "./chunk-5DEWP3YX.js";
|
|
29
|
+
import "./chunk-PZS3V6P3.js";
|
|
30
|
+
import "./chunk-QANRZW7W.js";
|
|
31
|
+
import "./chunk-ATW7BNIG.js";
|
|
32
|
+
import "./chunk-WK5NE6RY.js";
|
|
33
|
+
import "./chunk-AOGFYUKG.js";
|
|
34
|
+
import "./chunk-QXTHEFKP.js";
|
|
35
|
+
import "./chunk-LMKGSYJC.js";
|
|
36
|
+
import "./chunk-BHZ6G65V.js";
|
|
37
|
+
import "./chunk-P6XWWIEK.js";
|
|
38
|
+
import "./chunk-UIRJOQQS.js";
|
|
39
|
+
import "./chunk-4LFJFDCF.js";
|
|
40
|
+
import "./chunk-3NJNVZTK.js";
|
|
41
|
+
export {
|
|
42
|
+
ADDENDUM_MAX_CHARS,
|
|
43
|
+
PROPOSER_SYSTEM,
|
|
44
|
+
decide,
|
|
45
|
+
parseProposal,
|
|
46
|
+
proposerInput,
|
|
47
|
+
readAddendum,
|
|
48
|
+
rejectReason,
|
|
49
|
+
tune
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=tune-KSNKBPNJ.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
KEYS_HELP,
|
|
4
|
+
KEY_HINT_CHATS,
|
|
5
|
+
contextBar,
|
|
6
|
+
contextLevel,
|
|
7
|
+
countChat
|
|
8
|
+
} from "./chunk-L55VUSX3.js";
|
|
9
|
+
export {
|
|
10
|
+
KEYS_HELP,
|
|
11
|
+
KEY_HINT_CHATS,
|
|
12
|
+
contextBar,
|
|
13
|
+
contextLevel,
|
|
14
|
+
countChat
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=uiState-YFJQ43D7.js.map
|
package/package.json
CHANGED
package/dist/chunk-4JSUUDFQ.js
DELETED
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// src/cli/approver.ts
|
|
4
|
-
import { styleText } from "util";
|
|
5
|
-
var TerminalApprover = class {
|
|
6
|
-
/** Set by the CLI: it aborts the current turn. */
|
|
7
|
-
onInterrupt = () => {
|
|
8
|
-
};
|
|
9
|
-
/** One question at a time (0.14.1, review): two prompts at once mixed their keys. */
|
|
10
|
-
ask(request, signal) {
|
|
11
|
-
const next = this.asking === 0 ? this.askNow(request, signal) : this.queue.then(() => this.askNow(request, signal));
|
|
12
|
-
this.asking++;
|
|
13
|
-
this.queue = next.catch(() => {
|
|
14
|
-
}).finally(() => {
|
|
15
|
-
this.asking--;
|
|
16
|
-
});
|
|
17
|
-
return next;
|
|
18
|
-
}
|
|
19
|
-
asking = 0;
|
|
20
|
-
queue = Promise.resolve();
|
|
21
|
-
async askNow(request, signal) {
|
|
22
|
-
signal.throwIfAborted();
|
|
23
|
-
const out = process.stderr;
|
|
24
|
-
out.write(`
|
|
25
|
-
${header(request)}
|
|
26
|
-
${colorPreview(request)}
|
|
27
|
-
`);
|
|
28
|
-
if (!process.stdin.isTTY) {
|
|
29
|
-
out.write("No terminal to ask for approval, so Garuda denies this call.\n");
|
|
30
|
-
return "deny";
|
|
31
|
-
}
|
|
32
|
-
const sessionLabel = request.labels?.session ?? (request.target.kind === "command" ? "Yes, and allow this exact command for this session" : request.target.kind === "url" ? `Yes, and allow ${request.target.host} for this session` : `Yes, and allow all ${request.tool} calls for this session`);
|
|
33
|
-
const { select } = await import("@inquirer/prompts");
|
|
34
|
-
try {
|
|
35
|
-
return await select(
|
|
36
|
-
{
|
|
37
|
-
message: request.question ?? "Allow?",
|
|
38
|
-
choices: [
|
|
39
|
-
{ name: request.labels?.once ?? "Yes, once", value: "once" },
|
|
40
|
-
{ name: sessionLabel, value: "session" },
|
|
41
|
-
{ name: request.labels?.deny ?? "No, deny", value: "deny" }
|
|
42
|
-
].filter((c) => request.choices?.includes(c.value) ?? true)
|
|
43
|
-
},
|
|
44
|
-
{ signal, output: out }
|
|
45
|
-
);
|
|
46
|
-
} catch (error) {
|
|
47
|
-
if (error.name === "ExitPromptError") this.onInterrupt();
|
|
48
|
-
throw error;
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
var SwitchApprover = class {
|
|
53
|
-
constructor(current) {
|
|
54
|
-
this.current = current;
|
|
55
|
-
}
|
|
56
|
-
current;
|
|
57
|
-
/** Called before each question: the chat's notifier (0.6). */
|
|
58
|
-
onAsk = () => {
|
|
59
|
-
};
|
|
60
|
-
ask(request, signal) {
|
|
61
|
-
this.onAsk(request);
|
|
62
|
-
return this.current.ask(request, signal);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
function visible(text) {
|
|
66
|
-
return text.replace(/[\u0000-\u0008\u000b-\u001f]/g, (c) => String.fromCodePoint(9216 + c.charCodeAt(0))).replace(/\u007f/g, "\u2421").replace(
|
|
67
|
-
/[\u0080-\u009f\u200b-\u200f\u202a-\u202e\u2060-\u2064\u2066-\u2069\ufeff\u{e0000}-\u{e007f}]/gu,
|
|
68
|
-
(c) => `[U+${(c.codePointAt(0) ?? 0).toString(16).toUpperCase().padStart(4, "0")}]`
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
function hasHidden(text) {
|
|
72
|
-
return visible(text) !== text;
|
|
73
|
-
}
|
|
74
|
-
var HIDDEN_WARNING = "! This holds hidden or control characters, shown as \u240D, \u241B or [U+\u2026]. Read it with care.";
|
|
75
|
-
function headerText(request) {
|
|
76
|
-
const { tool, target, isolation } = request;
|
|
77
|
-
if (request.title !== void 0) return visible(request.title);
|
|
78
|
-
if (target.kind === "command") {
|
|
79
|
-
const where = isolation === "none" ? "on your machine, no sandbox" : target.outsideSandbox ? "OUTSIDE the sandbox: network on, writes anywhere" : `sandbox: ${isolation}`;
|
|
80
|
-
return `${tool} wants to run a command (${where}):`;
|
|
81
|
-
}
|
|
82
|
-
if (target.kind === "input") return `${tool} wants to run with this input:`;
|
|
83
|
-
if (target.kind === "url") return `${tool} wants to fetch from ${visible(target.host)}:`;
|
|
84
|
-
return `${tool} wants to change ${visible(target.path)}:`;
|
|
85
|
-
}
|
|
86
|
-
function header(request) {
|
|
87
|
-
return styleText("bold", headerText(request));
|
|
88
|
-
}
|
|
89
|
-
function colorPreview({ target, preview }) {
|
|
90
|
-
const warning = hasHidden(preview) ? `
|
|
91
|
-
${styleText("yellow", ` ${HIDDEN_WARNING}`)}` : "";
|
|
92
|
-
if (target.kind === "command") return `${styleText("cyan", ` $ ${visible(preview)}`)}${warning}`;
|
|
93
|
-
if (target.kind === "url") return `${visible(preview)}${warning}`;
|
|
94
|
-
return `${colorDiff(visible(preview))}${warning}`;
|
|
95
|
-
}
|
|
96
|
-
function colorDiff(text) {
|
|
97
|
-
return text.split("\n").map((line) => {
|
|
98
|
-
if (line.startsWith("+++") || line.startsWith("---") || line.startsWith("diff --git"))
|
|
99
|
-
return styleText("bold", line);
|
|
100
|
-
if (line.startsWith("+")) return styleText("green", line);
|
|
101
|
-
if (line.startsWith("-")) return styleText("red", line);
|
|
102
|
-
if (line.startsWith("@@")) return styleText("cyan", line);
|
|
103
|
-
return line;
|
|
104
|
-
}).join("\n");
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export {
|
|
108
|
-
TerminalApprover,
|
|
109
|
-
SwitchApprover,
|
|
110
|
-
visible,
|
|
111
|
-
hasHidden,
|
|
112
|
-
HIDDEN_WARNING,
|
|
113
|
-
headerText,
|
|
114
|
-
header,
|
|
115
|
-
colorPreview,
|
|
116
|
-
colorDiff
|
|
117
|
-
};
|
|
118
|
-
//# sourceMappingURL=chunk-4JSUUDFQ.js.map
|