thumbgate 1.7.0 → 1.8.0

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.
@@ -108,17 +108,28 @@ fi
108
108
  # ── ThumbGate package metadata ────────────────────────────────────────
109
109
  TG_VERSION="unknown"; TG_TIER="Free"
110
110
  _META_JSON=$(node "${SCRIPT_DIR}/statusline-meta.js" 2>/dev/null)
111
- if [ -n "$_META_JSON" ]; then
111
+ if [[ -n "$_META_JSON" ]]; then
112
112
  eval "$(echo "$_META_JSON" | jq -r '
113
113
  @sh "TG_VERSION=\(.version // "unknown")",
114
114
  @sh "TG_TIER=\(.tier // "Free")"
115
115
  ' 2>/dev/null)"
116
116
  fi
117
117
 
118
+ # ── Repo context (branch / work item / PR) ───────────────────────────
119
+ BRANCH_NAME=""; WORK_ITEM_LABEL=""; PR_LABEL=""
120
+ _CONTEXT_JSON=$(node "${SCRIPT_DIR}/statusline-context.js" 2>/dev/null)
121
+ if [[ -n "$_CONTEXT_JSON" ]]; then
122
+ eval "$(echo "$_CONTEXT_JSON" | jq -r '
123
+ @sh "BRANCH_NAME=\(.branchName // "")",
124
+ @sh "WORK_ITEM_LABEL=\(.workItemLabel // "")",
125
+ @sh "PR_LABEL=\(.prLabel // "")"
126
+ ' 2>/dev/null)"
127
+ fi
128
+
118
129
  # ── Control Tower stats ──────────────────────────────────────────
119
130
  SLO_V="0"; AT_RISK="0"; ANOMALIES="0"
120
131
  _TOWER_JSON=$(node "${SCRIPT_DIR}/statusline-tower.js" 2>/dev/null)
121
- if [ -n "$_TOWER_JSON" ]; then
132
+ if [[ -n "$_TOWER_JSON" ]]; then
122
133
  eval "$(echo "$_TOWER_JSON" | jq -r '
123
134
  @sh "SLO_V=\(.sloViolations // 0)",
124
135
  @sh "AT_RISK=\(.atRiskToolCount // 0)",
@@ -129,7 +140,7 @@ fi
129
140
  # ── Latest lesson (data available for extensions; not rendered in statusbar) ──
130
141
  LESSON_TEXT=""; LESSON_ID=""; LESSON_LABEL=""; LESSON_LINK=""
131
142
  _LESSON_JSON=$(node "${SCRIPT_DIR}/statusline-lesson.js" 2>/dev/null)
132
- if [ -n "$_LESSON_JSON" ]; then
143
+ if [[ -n "$_LESSON_JSON" ]]; then
133
144
  eval "$(echo "$_LESSON_JSON" | jq -r '
134
145
  @sh "LESSON_TEXT=\(.text // "")",
135
146
  @sh "LESSON_ID=\(.lessonId // "")",
@@ -155,7 +166,7 @@ osc_link() {
155
166
  # ThumbGate as a non-last row in a multi-line statusline should set this, because
156
167
  # some agents (Claude Code) silently drop downstream rows when a preceding row
157
168
  # contains OSC 8 sequences.
158
- if [ "${THUMBGATE_STATUSLINE_PLAIN:-0}" = "1" ]; then
169
+ if [[ "${THUMBGATE_STATUSLINE_PLAIN:-0}" = "1" ]]; then
159
170
  printf '%s' "$label"
160
171
  return 0
161
172
  fi
@@ -171,9 +182,9 @@ DOWN_LINK="$(osc_link "$DOWN_URL" "👎")"
171
182
  DASHBOARD_LINK="$(osc_link "$DASHBOARD_URL" "$DASHBOARD_LABEL")"
172
183
  LESSONS_LINK="$(osc_link "$LESSONS_URL" "$LESSONS_LABEL")"
173
184
  LATEST_LESSON_LINK=""
174
- if [ -n "$LESSON_LABEL" ]; then
185
+ if [[ -n "$LESSON_LABEL" ]]; then
175
186
  _DISPLAY_LINK="$LESSON_LINK"
176
- if [ -n "$LESSON_TEXT" ]; then
187
+ if [[ -n "$LESSON_TEXT" ]]; then
177
188
  LATEST_LESSON_LINK="$(osc_link "$_DISPLAY_LINK" "${LESSON_LABEL}: ${LESSON_TEXT}")"
178
189
  else
179
190
  LATEST_LESSON_LINK="$(osc_link "$_DISPLAY_LINK" "$LESSON_LABEL")"
@@ -181,20 +192,26 @@ if [ -n "$LESSON_LABEL" ]; then
181
192
  fi
182
193
 
183
194
  # ── Output (single line) ─────────────────────────────────────────
184
- LINE="ThumbGate v${TG_VERSION} · ${TG_TIER}"
185
- if [ "$UP" = "0" ] && [ "$DOWN" = "0" ]; then
186
- LINE="${D}${LINE} · no feedback yet${RST} · ${C}${DASHBOARD_LINK}${RST} · ${M}${LESSONS_LINK}${RST}"
187
- [ -n "$LATEST_LESSON_LINK" ] && LINE="${LINE} · ${D}${LATEST_LESSON_LINK}${RST}"
195
+ LINE=""
196
+ [[ -n "$BRANCH_NAME" ]] && LINE="${BRANCH_NAME}"
197
+ [[ -n "$WORK_ITEM_LABEL" ]] && LINE="${LINE:+${LINE} · }${WORK_ITEM_LABEL}"
198
+ LINE="${LINE:+${LINE} · }ThumbGate v${TG_VERSION} · ${TG_TIER}"
199
+ if [[ "$UP" = "0" && "$DOWN" = "0" ]]; then
200
+ LINE="${D}${LINE}${RST} · no feedback yet"
201
+ [[ -n "$PR_LABEL" ]] && LINE="${LINE} · ${D}${PR_LABEL}${RST}"
202
+ LINE="${LINE} · ${C}${DASHBOARD_LINK}${RST} · ${M}${LESSONS_LINK}${RST}"
203
+ [[ -n "$LATEST_LESSON_LINK" ]] && LINE="${LINE} · ${D}${LATEST_LESSON_LINK}${RST}"
188
204
  printf '%b\n' "$LINE"
189
205
  else
190
206
  LINE="${LINE} · ${G}${BD}${UP}${RST}${UP_LINK} ${R}${BD}${DOWN}${RST}${DOWN_LINK} ${ARROW}"
191
207
 
192
208
  # Control Tower alerts (if any)
193
- [ "${SLO_V:-0}" -gt 0 ] && LINE="${LINE} ${R}${SLO_V} SLO${RST}"
194
- [ "${AT_RISK:-0}" -gt 0 ] && LINE="${LINE} ${R}${AT_RISK}⚠${RST}"
195
- [ "${ANOMALIES:-0}" -gt 0 ] && LINE="${LINE} ${R}${ANOMALIES}☠${RST}"
209
+ [[ "${SLO_V:-0}" -gt 0 ]] && LINE="${LINE} ${R}${SLO_V} SLO${RST}"
210
+ [[ "${AT_RISK:-0}" -gt 0 ]] && LINE="${LINE} ${R}${AT_RISK}⚠${RST}"
211
+ [[ "${ANOMALIES:-0}" -gt 0 ]] && LINE="${LINE} ${R}${ANOMALIES}☠${RST}"
212
+ [[ -n "$PR_LABEL" ]] && LINE="${LINE} · ${D}${PR_LABEL}${RST}"
196
213
  LINE="${LINE} · ${C}${DASHBOARD_LINK}${RST} · ${M}${LESSONS_LINK}${RST}"
197
- [ -n "$LATEST_LESSON_LINK" ] && LINE="${LINE} · ${D}${LATEST_LESSON_LINK}${RST}"
214
+ [[ -n "$LATEST_LESSON_LINK" ]] && LINE="${LINE} · ${D}${LATEST_LESSON_LINK}${RST}"
198
215
 
199
216
  printf '%b\n' "$LINE"
200
217
  fi
@@ -1041,6 +1041,45 @@ const TOOLS = [
1041
1041
  properties: {},
1042
1042
  },
1043
1043
  }),
1044
+ readOnlyTool({
1045
+ name: 'require_evidence_for_claim',
1046
+ description: 'Leader-Agent completion gate. Before any agent declares done/fixed/shipped/resolved, require tracked evidence. Blocking response when evidence missing; callers honor the blocking flag to stop completion claims.',
1047
+ inputSchema: {
1048
+ type: 'object',
1049
+ required: ['claim'],
1050
+ properties: {
1051
+ claim: { type: 'string', description: 'The completion claim text to verify (e.g. "Fix shipped", "Tests passing")' },
1052
+ mode: { type: 'string', enum: ['blocking', 'advisory'], description: 'blocking (default) returns blocking=true when evidence missing; advisory returns blocking=false' },
1053
+ sessionId: { type: 'string', description: 'Optional session id to associate with the gate decision' },
1054
+ },
1055
+ },
1056
+ }),
1057
+ destructiveTool({
1058
+ name: 'distribute_context_to_agents',
1059
+ description: 'Leader-Agent swarm coordinator. Constructs one context pack and distributes it to N worker agents (perplexity-bug-resolver, codex-reviewer, grok-x-intelligence, etc.), recording provenance per agent. Replaces N independent context derivations with a single shared pack.',
1060
+ inputSchema: {
1061
+ type: 'object',
1062
+ required: ['agents'],
1063
+ properties: {
1064
+ query: { type: 'string', description: 'Context query used to construct the pack' },
1065
+ agents: { type: 'array', items: { type: 'string' }, description: 'Agent names that should receive the pack' },
1066
+ maxItems: { type: 'number', description: 'Max items in the constructed pack (default 8)' },
1067
+ maxChars: { type: 'number', description: 'Max characters in the constructed pack (default 6000)' },
1068
+ namespaces: { type: 'array', items: { type: 'string' }, description: 'Optional contextfs namespaces to source from' },
1069
+ ttlMs: { type: 'number', description: 'Optional pack TTL in milliseconds (default 15 minutes)' },
1070
+ },
1071
+ },
1072
+ }),
1073
+ readOnlyTool({
1074
+ name: 'session_report',
1075
+ description: 'Unified observability rollup. Aggregates feedback stats, gate stats, and recent context/provenance events over a time window in one call. Replaces separate dashboard/gate_stats/feedback_stats calls with a single LangSmith-style report.',
1076
+ inputSchema: {
1077
+ type: 'object',
1078
+ properties: {
1079
+ windowHours: { type: 'number', description: 'Lookback window in hours (default 24, max 720)' },
1080
+ },
1081
+ },
1082
+ }),
1044
1083
  readOnlyTool({
1045
1084
  name: 'context_stuff_lessons',
1046
1085
  description: 'Dump ALL prevention lessons into a single text block for context-window injection. Bypasses RAG/search — returns every lesson sorted by confidence. For most projects (20-200 lessons), fits in 1K-10K tokens.',