pennyrouter 0.1.19 โ 0.1.20
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/package.json +1 -1
- package/src/statusline.js +13 -1
package/package.json
CHANGED
package/src/statusline.js
CHANGED
|
@@ -153,13 +153,25 @@ function authSuffix(mode) {
|
|
|
153
153
|
return mode === "sub" || mode === "byok" ? " (" + mode + ")" : "";
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
// Teammate badges (@penny ask). Rendered from the STRUCTURED fields, not the gateway's
|
|
157
|
+
// prebuilt \`label\` โ this line is composed here (and may be appended to a wrap_command's
|
|
158
|
+
// output), so the client owns the layout. ๐จ = questions waiting on you; ๐ฌ = an answer came
|
|
159
|
+
// back to you. Both absent on an older gateway, which renders nothing.
|
|
160
|
+
function askBadges(c) {
|
|
161
|
+
if (!c) return "";
|
|
162
|
+
let out = "";
|
|
163
|
+
if (c.asks_open > 0) out += " ยท ๐จ " + c.asks_open;
|
|
164
|
+
if (c.answers_fresh > 0) out += " ยท ๐ฌ " + c.answers_fresh;
|
|
165
|
+
return out;
|
|
166
|
+
}
|
|
167
|
+
|
|
156
168
|
let penny;
|
|
157
169
|
if (!pennyInstalled) {
|
|
158
170
|
penny = "๐ช penny off";
|
|
159
171
|
} else if (cache && cache.known && cache.bypass) {
|
|
160
172
|
penny = "๐ช penny off";
|
|
161
173
|
} else {
|
|
162
|
-
penny = "๐ช penny" + authSuffix(cache && cache.auth_mode);
|
|
174
|
+
penny = "๐ช penny" + authSuffix(cache && cache.auth_mode) + askBadges(cache);
|
|
163
175
|
}
|
|
164
176
|
|
|
165
177
|
let lines;
|