thumbgate 1.4.1 → 1.4.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/package.json +1 -1
- package/scripts/lesson-inference.js +20 -1
- package/scripts/statusline.sh +7 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "thumbgate",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "ThumbGate: self-improving agent governance for engineering teams. Three-tier approval routing (block/approve/log), shared enforcement, CI gates, and audit trails. Every mistake becomes a prevention rule. PreToolUse hooks, Thompson Sampling, SQLite+FTS5 lesson DB, and LanceDB vector search.",
|
|
5
5
|
"homepage": "https://thumbgate-production.up.railway.app",
|
|
6
6
|
"repository": {
|
|
@@ -303,7 +303,26 @@ function getStatusbarLessonData() {
|
|
|
303
303
|
if (!recent) return { hasLesson: false, text: null, link: null };
|
|
304
304
|
|
|
305
305
|
const normalizedLesson = stripLessonPrefix(recent.lesson || '');
|
|
306
|
-
|
|
306
|
+
|
|
307
|
+
// Distill to actionable insight: prefer structured rule action, then
|
|
308
|
+
// whatToChange, then the lesson text itself. Raw user feedback
|
|
309
|
+
// ("are you sure?", "is this working?") is not useful in a statusbar.
|
|
310
|
+
let displayText = normalizedLesson;
|
|
311
|
+
if (recent.structuredRule && recent.structuredRule.action && recent.structuredRule.action.description) {
|
|
312
|
+
displayText = recent.structuredRule.action.description;
|
|
313
|
+
} else if (recent.whatToChange || recent.what_to_change) {
|
|
314
|
+
displayText = String(recent.whatToChange || recent.what_to_change);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// Clean up: strip noise prefixes, collapse whitespace
|
|
318
|
+
displayText = displayText
|
|
319
|
+
.replace(/^CRITICAL ERROR - User frustrated:\s*/i, '')
|
|
320
|
+
.replace(/^thumbs?\s*(up|down)\s*:?\s*/i, '')
|
|
321
|
+
.replace(/\s+/g, ' ')
|
|
322
|
+
.trim();
|
|
323
|
+
|
|
324
|
+
// Truncate to 60 chars (enough to be readable, short enough for statusbar)
|
|
325
|
+
const truncated = displayText.length > 60 ? displayText.slice(0, 57) + '...' : displayText;
|
|
307
326
|
|
|
308
327
|
return {
|
|
309
328
|
hasLesson: true,
|
package/scripts/statusline.sh
CHANGED
|
@@ -162,10 +162,15 @@ DASHBOARD_LINK="$DASHBOARD_LABEL"
|
|
|
162
162
|
LESSONS_LINK="$LESSONS_LABEL"
|
|
163
163
|
LATEST_LESSON_LINK=""
|
|
164
164
|
if [ -n "$LESSON_LABEL" ]; then
|
|
165
|
+
# Only include link if it's a real URL (not localhost)
|
|
166
|
+
_DISPLAY_LINK="$LESSON_LINK"
|
|
167
|
+
case "$_DISPLAY_LINK" in
|
|
168
|
+
*localhost*|*127.0.0.1*) _DISPLAY_LINK="" ;;
|
|
169
|
+
esac
|
|
165
170
|
if [ -n "$LESSON_TEXT" ]; then
|
|
166
|
-
LATEST_LESSON_LINK="$(inline_link "$
|
|
171
|
+
LATEST_LESSON_LINK="$(inline_link "$_DISPLAY_LINK" "${LESSON_LABEL}: ${LESSON_TEXT}")"
|
|
167
172
|
else
|
|
168
|
-
LATEST_LESSON_LINK="$(inline_link "$
|
|
173
|
+
LATEST_LESSON_LINK="$(inline_link "$_DISPLAY_LINK" "$LESSON_LABEL")"
|
|
169
174
|
fi
|
|
170
175
|
fi
|
|
171
176
|
|