blun-king-cli 7.0.1 → 7.0.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/lib/chat.js +2 -1
- package/lib/ui.js +17 -39
- package/package.json +1 -1
package/lib/chat.js
CHANGED
|
@@ -14,7 +14,7 @@ var localMode = false;
|
|
|
14
14
|
var permissionMode = "normal"; // safe, normal, god
|
|
15
15
|
|
|
16
16
|
function showPrompt(rl, username, model) {
|
|
17
|
-
ui.
|
|
17
|
+
ui.setCurrentPerm(permissionMode);
|
|
18
18
|
rl.prompt();
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -22,6 +22,7 @@ function cyclePermission() {
|
|
|
22
22
|
var modes = ui.PERMISSION_MODES;
|
|
23
23
|
var idx = modes.indexOf(permissionMode);
|
|
24
24
|
permissionMode = modes[(idx + 1) % modes.length];
|
|
25
|
+
ui.setCurrentPerm(permissionMode);
|
|
25
26
|
return permissionMode;
|
|
26
27
|
}
|
|
27
28
|
|
package/lib/ui.js
CHANGED
|
@@ -60,31 +60,20 @@ function getInputBoxWidth() {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
function renderInputBox(username, model, permMode) {
|
|
63
|
-
|
|
64
|
-
var u = username || "user";
|
|
65
|
-
var m = model || "auto";
|
|
66
|
-
var pm = permMode || "normal";
|
|
67
|
-
var hints = "/help \u2502 /settings \u2502 /model \u2502 /exit";
|
|
68
|
-
var labelText = " " + u + " [" + m + "] ";
|
|
69
|
-
var hintsText = " " + hints + " ";
|
|
70
|
-
var topFill = w - labelText.length - hintsText.length;
|
|
71
|
-
if (topFill < 2) topFill = 2;
|
|
72
|
-
var topLine =
|
|
73
|
-
chalk.dim("\u256d") +
|
|
74
|
-
chalk.cyan(labelText) +
|
|
75
|
-
chalk.dim("\u2500".repeat(topFill)) +
|
|
76
|
-
chalk.dim(hintsText) +
|
|
77
|
-
chalk.dim("\u256e");
|
|
78
|
-
console.log(topLine);
|
|
63
|
+
// Claude Code style - no box, just clean space
|
|
79
64
|
}
|
|
80
65
|
|
|
66
|
+
var currentPermMode = "normal";
|
|
67
|
+
function setCurrentPerm(pm) { currentPermMode = pm; }
|
|
68
|
+
|
|
81
69
|
function renderInputBoxClose() {
|
|
82
|
-
|
|
83
|
-
|
|
70
|
+
// Show permission line after input (like Claude Code)
|
|
71
|
+
var label = permissionLabels[currentPermMode] || permissionLabels.normal;
|
|
72
|
+
console.log(chalk.dim(" \u276f\u276f ") + chalk.dim("bypass permissions ") + label + chalk.dim(" (shift+tab to cycle)"));
|
|
84
73
|
}
|
|
85
74
|
|
|
86
75
|
function renderPrompt() {
|
|
87
|
-
return chalk.
|
|
76
|
+
return chalk.bold.green("> ");
|
|
88
77
|
}
|
|
89
78
|
|
|
90
79
|
function renderPermissionLine(permMode) {
|
|
@@ -114,27 +103,15 @@ function renderResponse(text, type) {
|
|
|
114
103
|
var rendered = renderMarkdown(text);
|
|
115
104
|
|
|
116
105
|
if (type === "agent") {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
borderStyle: "round",
|
|
124
|
-
borderColor: "green",
|
|
125
|
-
})
|
|
126
|
-
);
|
|
106
|
+
// Claude Code style - plain text with green prefix, no box
|
|
107
|
+
var lines = rendered.split("\n");
|
|
108
|
+
lines.forEach(function (line) {
|
|
109
|
+
console.log(" " + chalk.green(line));
|
|
110
|
+
});
|
|
111
|
+
console.log();
|
|
127
112
|
} else if (type === "error") {
|
|
128
|
-
console.log(
|
|
129
|
-
|
|
130
|
-
title: chalk.red.bold(" \u2718 Error "),
|
|
131
|
-
titleAlignment: "left",
|
|
132
|
-
padding: { top: 0, bottom: 0, left: 1, right: 1 },
|
|
133
|
-
margin: { top: 0, bottom: 0, left: 1, right: 1 },
|
|
134
|
-
borderStyle: "round",
|
|
135
|
-
borderColor: "red",
|
|
136
|
-
})
|
|
137
|
-
);
|
|
113
|
+
console.log(chalk.red(" \u2718 " + rendered));
|
|
114
|
+
console.log();
|
|
138
115
|
} else if (type === "system") {
|
|
139
116
|
console.log(chalk.yellow.bold(" [SYS] ") + chalk.yellow(rendered));
|
|
140
117
|
console.log();
|
|
@@ -381,6 +358,7 @@ module.exports = {
|
|
|
381
358
|
renderPrompt: renderPrompt,
|
|
382
359
|
renderInputBox: renderInputBox,
|
|
383
360
|
renderInputBoxClose: renderInputBoxClose,
|
|
361
|
+
setCurrentPerm: setCurrentPerm,
|
|
384
362
|
renderWelcomeInfo: renderWelcomeInfo,
|
|
385
363
|
renderPermissionLine: renderPermissionLine,
|
|
386
364
|
renderMiniStatus: renderMiniStatus,
|