thumbgate 1.40.2 → 1.40.3
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/.claude-plugin/plugin.json +1 -1
- package/.well-known/mcp/server-card.json +1 -1
- package/adapters/claude/.mcp.json +3 -3
- package/adapters/forge/forge.yaml +3 -3
- package/adapters/future-agi/.mcp.json +1 -1
- package/adapters/future-agi/config.toml +1 -1
- package/adapters/future-agi/opencode.json +1 -1
- package/adapters/herdr/herdr-plugin.toml +2 -2
- package/adapters/mcp/server-stdio.js +4 -2
- package/adapters/opencode/opencode.json +1 -1
- package/package.json +4 -2
- package/public/index.html +2 -2
- package/public/install.html +8 -8
- package/public/numbers.html +2 -2
- package/scripts/feedback-loop.js +4 -1
- package/scripts/human-feedback.js +23 -0
- package/scripts/statusline-human-counts.js +69 -0
- package/scripts/statusline-links.js +13 -3
- package/scripts/statusline-local-stats.js +5 -3
- package/scripts/statusline.sh +17 -2
- package/server.json +2 -2
- package/src/api/server.js +6 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "thumbgate",
|
|
3
3
|
"description": "One 👎 becomes a hard rule the agent cannot bypass. Captures thumbs-down feedback, distills it into PreToolUse Pre-Action Checks, enforced across every future Claude Code session.",
|
|
4
|
-
"version": "1.40.
|
|
4
|
+
"version": "1.40.3",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Igor Ganapolsky",
|
|
7
7
|
"email": "ig5973700@gmail.com",
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
"mcpServers": {
|
|
3
3
|
"thumbgate": {
|
|
4
4
|
"command": "npx",
|
|
5
|
-
"args": ["--yes", "--package", "thumbgate@1.40.
|
|
5
|
+
"args": ["--yes", "--package", "thumbgate@1.40.3", "thumbgate", "serve"]
|
|
6
6
|
}
|
|
7
7
|
},
|
|
8
8
|
"hooks": {
|
|
9
9
|
"preToolUse": {
|
|
10
10
|
"command": "npx",
|
|
11
|
-
"args": ["--yes", "--package", "thumbgate@1.40.
|
|
11
|
+
"args": ["--yes", "--package", "thumbgate@1.40.3", "thumbgate", "gate-check"]
|
|
12
12
|
},
|
|
13
13
|
"userPromptSubmit": {
|
|
14
14
|
"command": "npx",
|
|
15
|
-
"args": ["--yes", "--package", "thumbgate@1.40.
|
|
15
|
+
"args": ["--yes", "--package", "thumbgate@1.40.3", "thumbgate", "hook-auto-capture"]
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -9,12 +9,12 @@ version: "1"
|
|
|
9
9
|
skills:
|
|
10
10
|
thumbgate-gate-check:
|
|
11
11
|
description: "ThumbGate PreToolUse gate — blocks known-bad tool calls"
|
|
12
|
-
command: "npx --yes --package thumbgate@1.40.
|
|
12
|
+
command: "npx --yes --package thumbgate@1.40.3 thumbgate gate-check"
|
|
13
13
|
trigger: pre_tool_use
|
|
14
14
|
|
|
15
15
|
thumbgate-feedback:
|
|
16
16
|
description: "ThumbGate UserPromptSubmit guard & feedback capture — blocks pasted passwords/keys and logs safe prompt context"
|
|
17
|
-
command: "npx --yes --package thumbgate@1.40.
|
|
17
|
+
command: "npx --yes --package thumbgate@1.40.3 thumbgate hook-auto-capture"
|
|
18
18
|
trigger: user_prompt
|
|
19
19
|
|
|
20
20
|
mcp:
|
|
@@ -23,6 +23,6 @@ mcp:
|
|
|
23
23
|
args:
|
|
24
24
|
- "--yes"
|
|
25
25
|
- "--package"
|
|
26
|
-
- "thumbgate@1.40.
|
|
26
|
+
- "thumbgate@1.40.3"
|
|
27
27
|
- "thumbgate"
|
|
28
28
|
- "serve"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[plugin]
|
|
2
2
|
id = "thumbgate-approvals"
|
|
3
3
|
name = "ThumbGate Approvals"
|
|
4
|
-
version = "1.40.
|
|
4
|
+
version = "1.40.3"
|
|
5
5
|
minHerdrVersion = "0.7.0"
|
|
6
6
|
description = "Pre-action governance, spend guard, and safety approval gates for multi-agent terminal sessions in Herdr."
|
|
7
7
|
platforms = ["linux", "macos", "windows"]
|
|
@@ -12,7 +12,7 @@ category = "Security & Governance"
|
|
|
12
12
|
|
|
13
13
|
[mcp_server]
|
|
14
14
|
command = "npx"
|
|
15
|
-
args = ["--yes", "--package", "thumbgate@1.40.
|
|
15
|
+
args = ["--yes", "--package", "thumbgate@1.40.3", "thumbgate", "serve"]
|
|
16
16
|
|
|
17
17
|
[mcp_server.env]
|
|
18
18
|
THUMBGATE_ENFORCE_ENTITLEMENTS = "1"
|
|
@@ -334,7 +334,7 @@ const {
|
|
|
334
334
|
finalizeSession: finalizeFeedbackSession,
|
|
335
335
|
} = require('../../scripts/feedback-session');
|
|
336
336
|
|
|
337
|
-
const SERVER_INFO = { name: 'thumbgate-mcp', version: '1.40.
|
|
337
|
+
const SERVER_INFO = { name: 'thumbgate-mcp', version: '1.40.3' };
|
|
338
338
|
const COMMERCE_CATEGORIES = [
|
|
339
339
|
'product_recommendation',
|
|
340
340
|
'brand_compliance',
|
|
@@ -1124,7 +1124,9 @@ async function callToolInner(name, args) {
|
|
|
1124
1124
|
cwd: resolveWorkspaceCwd(args.cwd),
|
|
1125
1125
|
lessonId: args.lessonId,
|
|
1126
1126
|
lessonKey: args.lessonKey,
|
|
1127
|
-
|
|
1127
|
+
// A capture_feedback call carries a person's thumb; callers that are
|
|
1128
|
+
// scripts can pass reviewOrigin 'automated' or 'imported' explicitly.
|
|
1129
|
+
reviewOrigin: ['automated', 'imported'].includes(args.reviewOrigin) ? args.reviewOrigin : 'human',
|
|
1128
1130
|
}));
|
|
1129
1131
|
}
|
|
1130
1132
|
case 'feedback_summary':
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "thumbgate",
|
|
3
|
-
"version": "1.40.
|
|
3
|
+
"version": "1.40.3",
|
|
4
4
|
"description": "ThumbGate Pre-Action Checks self-improve from ranked lessons and repeated failures, hard-block detected secret leaks, and block matches in strict mode.",
|
|
5
5
|
"homepage": "https://thumbgate.ai",
|
|
6
6
|
"repository": {
|
|
@@ -265,6 +265,7 @@
|
|
|
265
265
|
"scripts/hf-papers.js",
|
|
266
266
|
"scripts/hidden-entry-points.js",
|
|
267
267
|
"scripts/hook-runtime.js",
|
|
268
|
+
"scripts/human-feedback.js",
|
|
268
269
|
"scripts/hook-stop-anti-claim.js",
|
|
269
270
|
"scripts/hook-thumbgate-cache-updater.js",
|
|
270
271
|
"scripts/hosted-config.js",
|
|
@@ -419,6 +420,7 @@
|
|
|
419
420
|
"scripts/statusline-cache-path.js",
|
|
420
421
|
"scripts/statusline-cache-read.js",
|
|
421
422
|
"scripts/statusline-context.js",
|
|
423
|
+
"scripts/statusline-human-counts.js",
|
|
422
424
|
"scripts/statusline-lesson.js",
|
|
423
425
|
"scripts/statusline-links.js",
|
|
424
426
|
"scripts/statusline-local-stats.js",
|
|
@@ -822,7 +824,7 @@
|
|
|
822
824
|
"test:thumbgate-skill": "node --test tests/thumbgate-skill.test.js",
|
|
823
825
|
"test:discoverable-skills": "node --test tests/discoverable-skills.test.js",
|
|
824
826
|
"test:discoverable-skill-skills": "node --test tests/discoverable-skill-skills.test.js",
|
|
825
|
-
"test:statusline": "node --test tests/claude-feedback-sync.test.js tests/statusline.test.js tests/statusline-aggregation.test.js tests/statusline-context.test.js tests/statusline-links.test.js tests/statusline-e2e.test.js",
|
|
827
|
+
"test:statusline": "node --test tests/claude-feedback-sync.test.js tests/statusline.test.js tests/statusline-aggregation.test.js tests/statusline-context.test.js tests/statusline-links.test.js tests/statusline-e2e.test.js tests/statusline-human-counts.test.js",
|
|
826
828
|
"test:statusline-cache-aggregate": "node --test tests/statusline-cache-aggregate.test.js",
|
|
827
829
|
"test:no-internal-orchestration-leaks": "node --test tests/no-internal-orchestration-leaks.test.js",
|
|
828
830
|
"test:memory-dedup": "node --test tests/memory-dedup.test.js",
|
package/public/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<meta name="generator" content="ThumbGate">
|
|
7
7
|
<meta name="author" content="Igor Ganapolsky">
|
|
8
|
-
<meta name="thumbgate-version" content="1.40.
|
|
8
|
+
<meta name="thumbgate-version" content="1.40.3">
|
|
9
9
|
__GOOGLE_SITE_VERIFICATION_META__
|
|
10
10
|
<link rel="icon" type="image/png" href="/thumbgate-icon.png">
|
|
11
11
|
<link rel="canonical" href="__APP_ORIGIN__/">
|
|
@@ -957,7 +957,7 @@ next decision recorded before execution</pre>
|
|
|
957
957
|
|
|
958
958
|
<footer>
|
|
959
959
|
<div class="shell footer-inner">
|
|
960
|
-
<span>ThumbGate · MIT License · npm v1.40.
|
|
960
|
+
<span>ThumbGate · MIT License · npm v1.40.3</span>
|
|
961
961
|
<div class="footer-links">
|
|
962
962
|
<a href="https://github.com/IgorGanapolsky/ThumbGate" target="_blank" rel="noopener">GitHub</a>
|
|
963
963
|
<a href="/guide">Technical setup</a>
|
package/public/install.html
CHANGED
|
@@ -139,7 +139,7 @@ __GA_BOOTSTRAP__
|
|
|
139
139
|
<a class="btn-secondary" href="/diagnostic?utm_source=install_page&utm_medium=owned_page&utm_campaign=marketplace_distribution">Harden one workflow</a>
|
|
140
140
|
</div>
|
|
141
141
|
<div class="proof-strip" aria-label="Verified live distribution surfaces">
|
|
142
|
-
<div class="proof"><strong>npm</strong><span>thumbgate@1.40.
|
|
142
|
+
<div class="proof"><strong>npm</strong><span>thumbgate@1.40.3</span></div>
|
|
143
143
|
<div class="proof"><strong>VS Code</strong><span>Marketplace version live</span></div>
|
|
144
144
|
<div class="proof"><strong>Open VSX</strong><span>Antigravity-compatible path</span></div>
|
|
145
145
|
<div class="proof"><strong>MCP Registry</strong><span>1.27.20 is latest</span></div>
|
|
@@ -153,12 +153,12 @@ __GA_BOOTSTRAP__
|
|
|
153
153
|
<p class="section-lede">Use the local CLI path for immediate enforcement. Use marketplace installs where your editor supports them. Use the diagnostic path when you need a human-reviewed gate map for one risky workflow. New install: <a href="/guides/progressive-wiring">prove the pipe first</a> (doctor green, empty dashboard OK) before expecting a gate to fire.</p>
|
|
154
154
|
<div class="grid">
|
|
155
155
|
<article class="card" id="quickstart"><h3>First gate block in one command</h3><p>Promote your first prevention rule, watch ThumbGate block a repeat mistake live, and unlock the built-in safety rule pack + 3 custom block rules on the Free tier (7-day local Pro trial included).</p><pre><code>npx thumbgate quickstart</code></pre></article>
|
|
156
|
-
<article class="card"><h3>CLI and MCP-compatible agents</h3><p>Fastest path for Claude Code, Cursor, Codex, Gemini CLI, Amp, Cline, OpenCode, and local MCP-compatible agents.</p><pre><code>npx -y thumbgate@1.40.
|
|
157
|
-
npx -y thumbgate@1.40.
|
|
158
|
-
npx -y thumbgate@1.40.
|
|
159
|
-
<article class="card"><h3>Claude Desktop</h3><p>Use the npm-backed MCP server today. The Claude Desktop `.mcpb` directory submission packet is prepared separately.</p><pre><code>claude mcp add thumbgate -- npx --yes --package thumbgate@1.40.
|
|
160
|
-
<article class="card"><h3>Cursor</h3><p>The public Cursor Marketplace listing is not live yet. Use the CLI wiring while the dashboard submission is resolved.</p><pre><code>npx -y thumbgate@1.40.
|
|
161
|
-
<article class="card"><h3>Codex</h3><p>Use the local adapter now. Public Codex self-serve plugin publishing is not open yet, so the GitHub Release asset is the distribution proof.</p><pre><code>npx -y thumbgate@1.40.
|
|
156
|
+
<article class="card"><h3>CLI and MCP-compatible agents</h3><p>Fastest path for Claude Code, Cursor, Codex, Gemini CLI, Amp, Cline, OpenCode, and local MCP-compatible agents.</p><pre><code>npx -y thumbgate@1.40.3 init --agent claude
|
|
157
|
+
npx -y thumbgate@1.40.3 doctor
|
|
158
|
+
npx -y thumbgate@1.40.3 doctor --fix</code></pre></article>
|
|
159
|
+
<article class="card"><h3>Claude Desktop</h3><p>Use the npm-backed MCP server today. The Claude Desktop `.mcpb` directory submission packet is prepared separately.</p><pre><code>claude mcp add thumbgate -- npx --yes --package thumbgate@1.40.3 thumbgate serve</code></pre></article>
|
|
160
|
+
<article class="card"><h3>Cursor</h3><p>The public Cursor Marketplace listing is not live yet. Use the CLI wiring while the dashboard submission is resolved.</p><pre><code>npx -y thumbgate@1.40.3 init --agent cursor</code></pre></article>
|
|
161
|
+
<article class="card"><h3>Codex</h3><p>Use the local adapter now. Public Codex self-serve plugin publishing is not open yet, so the GitHub Release asset is the distribution proof.</p><pre><code>npx -y thumbgate@1.40.3 init --agent codex</code></pre></article>
|
|
162
162
|
<article class="card" id="grok"><h3>Grok</h3><p>Grok Build CLI. There is no Grok store listing. This command adds the npm server. <code>npx thumbgate init</code> also writes the Claude-style config Grok reads.</p><pre><code>grok mcp add thumbgate -- npx -y thumbgate mcp</code></pre></article>
|
|
163
163
|
<article class="card" id="hermes"><h3>Hermes</h3><p>Local hook for Nous Research Hermes. Merge <code>adapters/hermes/config.yaml</code> into <code>~/.hermes/config.yaml</code>. There is no Hermes directory listing.</p><pre><code>npx --yes --package thumbgate thumbgate hermes-gate</code></pre></article>
|
|
164
164
|
</div>
|
|
@@ -169,7 +169,7 @@ npx -y thumbgate@1.40.2 doctor --fix</code></pre></article>
|
|
|
169
169
|
<h2>Verified public surfaces.</h2>
|
|
170
170
|
<p class="section-lede">These are the surfaces safe to claim in public copy right now. Pending surfaces are listed so buyers do not get sent to dead marketplace pages.</p>
|
|
171
171
|
<div class="status-list">
|
|
172
|
-
<div class="status"><span class="badge live">LIVE</span><div><strong><a href="https://www.npmjs.com/package/thumbgate">npm package</a></strong><span>`thumbgate@1.40.
|
|
172
|
+
<div class="status"><span class="badge live">LIVE</span><div><strong><a href="https://www.npmjs.com/package/thumbgate">npm package</a></strong><span>`thumbgate@1.40.3` is the canonical runtime install.</span></div></div>
|
|
173
173
|
<div class="status"><span class="badge live">LIVE</span><div><strong><a href="https://marketplace.visualstudio.com/items?itemName=igorganapolsky.thumbgate">VS Code Marketplace</a></strong><span>Marketplace version-list API includes `1.27.20`.</span></div></div>
|
|
174
174
|
<div class="status"><span class="badge live">LIVE</span><div><strong><a href="https://open-vsx.org/extension/igorganapolsky/thumbgate">Open VSX</a></strong><span>Public registry latest version is `1.27.20`; use this path for VS Code-compatible IDEs that consume Open VSX.</span></div></div>
|
|
175
175
|
<div class="status"><span class="badge live">LIVE</span><div><strong><a href="https://registry.modelcontextprotocol.io/v0/servers?search=thumbgate">MCP Registry</a></strong><span>Public search returns `io.github.IgorGanapolsky/thumbgate` version `1.27.20` as latest.</span></div></div>
|
package/public/numbers.html
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"alternateName": "thumbgate",
|
|
27
27
|
"applicationCategory": "DeveloperApplication",
|
|
28
28
|
"operatingSystem": "Cross-platform, Node.js >=18.18.0",
|
|
29
|
-
"softwareVersion": "1.40.
|
|
29
|
+
"softwareVersion": "1.40.3",
|
|
30
30
|
"url": "https://thumbgate-production.up.railway.app/numbers",
|
|
31
31
|
"dateModified": "2026-11-12",
|
|
32
32
|
"creator": {
|
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
<main class="container">
|
|
202
202
|
<h1>The Numbers</h1>
|
|
203
203
|
<p class="subtitle">Generated first-party operational snapshot from the ThumbGate runtime. This is not customer traction, install volume, revenue, or proof that a configured gate has fired.</p>
|
|
204
|
-
<div class="freshness">Updated: 2026-11-12 · Version 1.40.
|
|
204
|
+
<div class="freshness">Updated: 2026-11-12 · Version 1.40.3</div>
|
|
205
205
|
<div class="truth-note"><strong>Read this first:</strong> configured checks are inventory. Recorded blocks and warnings are usage evidence. This snapshot currently reports 8,602 recorded hard-block event(s) and 2 recorded warning event(s).</div>
|
|
206
206
|
|
|
207
207
|
<h2>Gate enforcement</h2>
|
package/scripts/feedback-loop.js
CHANGED
|
@@ -2446,7 +2446,10 @@ function analyzeFeedback(logPath, options = {}) {
|
|
|
2446
2446
|
if (options.projectKey != null) entries = require('./project-catalog').readProjectRows(feedbackDir, 'feedback-log.jsonl', options);
|
|
2447
2447
|
const rawTotal = entries.length;
|
|
2448
2448
|
if (options.humanOnly) {
|
|
2449
|
-
|
|
2449
|
+
// strictHuman (status line) also drops entries scraped from prompt text.
|
|
2450
|
+
entries = options.strictHuman
|
|
2451
|
+
? entries.filter((entry) => require('./human-feedback').isCountedHumanFeedback(entry))
|
|
2452
|
+
: entries.filter((entry) => normalizeReviewOrigin(entry.reviewOrigin) === 'human');
|
|
2450
2453
|
}
|
|
2451
2454
|
const fallback = getSQLiteFallback(useSQLite, entries);
|
|
2452
2455
|
if (fallback) return fallback;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// A status-line thumb counts only when a person gave it. `reviewOrigin: human`
|
|
4
|
+
// alone is not enough: the Claude-history sync and the auto-capture hook write
|
|
5
|
+
// entries with that origin from text they scraped, not from a deliberate click or
|
|
6
|
+
// capture_feedback call.
|
|
7
|
+
const NON_HUMAN_TAGS = new Set([
|
|
8
|
+
'claude-history-sync',
|
|
9
|
+
'auto-capture-fallback',
|
|
10
|
+
'auto-capture',
|
|
11
|
+
'auto-hook',
|
|
12
|
+
'automated',
|
|
13
|
+
]);
|
|
14
|
+
|
|
15
|
+
function isCountedHumanFeedback(entry) {
|
|
16
|
+
if (!entry || String(entry.reviewOrigin || '').trim().toLowerCase() !== 'human') return false;
|
|
17
|
+
const tags = Array.isArray(entry.tags) ? entry.tags : [];
|
|
18
|
+
if (tags.some((tag) => NON_HUMAN_TAGS.has(String(tag).trim().toLowerCase()))) return false;
|
|
19
|
+
const source = String(entry.memorySource || entry.source || '').trim().toLowerCase();
|
|
20
|
+
return !NON_HUMAN_TAGS.has(source);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
module.exports = { NON_HUMAN_TAGS, isCountedHumanFeedback };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
// Status-line thumb counts: only feedback a person gave, only for the project
|
|
5
|
+
// the status line is rendered in. Prints {"up":N,"down":N,"label":"this project"}.
|
|
6
|
+
//
|
|
7
|
+
// Two stores can hold a project's thumbs: the project's own feedback dir, and the
|
|
8
|
+
// global ~/.thumbgate store, where MCP capture_feedback calls land because the MCP
|
|
9
|
+
// server does not run in the project directory. Global rows belong to this
|
|
10
|
+
// project when they carry its project key, or only scope.projectId equal to the
|
|
11
|
+
// project folder name.
|
|
12
|
+
const path = require('node:path');
|
|
13
|
+
const { readProjectRows } = require('./project-catalog');
|
|
14
|
+
const { resolveLocalProject, hash } = require('./project-identity');
|
|
15
|
+
const { resolveProjectDir, resolveFeedbackDir, getHomeDir } = require('./feedback-paths');
|
|
16
|
+
const { isCountedHumanFeedback } = require('./human-feedback');
|
|
17
|
+
|
|
18
|
+
function normalizeSignal(entry) {
|
|
19
|
+
const raw = String(entry.signal || entry.feedback || '').toLowerCase();
|
|
20
|
+
if (raw === 'positive' || raw === 'up' || raw === 'thumbs_up') return 'up';
|
|
21
|
+
if (raw === 'negative' || raw === 'down' || raw === 'thumbs_down') return 'down';
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function computeHumanCounts(options = {}) {
|
|
26
|
+
const env = options.env || process.env;
|
|
27
|
+
const cwd = options.cwd || process.cwd();
|
|
28
|
+
const projectDir = resolveProjectDir({ cwd, env });
|
|
29
|
+
const feedbackDir = resolveFeedbackDir({ projectDir, env });
|
|
30
|
+
const { projectKey } = resolveLocalProject(projectDir);
|
|
31
|
+
const projectName = path.basename(projectDir);
|
|
32
|
+
// readProjectRows maps a row that only names a project in scope.projectId to this legacy key.
|
|
33
|
+
const aliasKey = `legacy_${hash(projectName)}`;
|
|
34
|
+
const globalDir = path.join(getHomeDir({ env }), '.thumbgate');
|
|
35
|
+
|
|
36
|
+
const seen = new Set();
|
|
37
|
+
let up = 0;
|
|
38
|
+
let down = 0;
|
|
39
|
+
const ownDir = path.resolve(feedbackDir);
|
|
40
|
+
for (const dir of new Set([ownDir, path.resolve(globalDir)])) {
|
|
41
|
+
// Rows written before project tracking carry no key. In the project's own
|
|
42
|
+
// feedback dir they are this project's; in the shared global store they are not.
|
|
43
|
+
const ownsUnassigned = dir === ownDir && dir !== path.resolve(globalDir);
|
|
44
|
+
for (const row of readProjectRows(dir, 'feedback-log.jsonl', {})) {
|
|
45
|
+
const mine = row.projectKey === projectKey || row.projectKey === aliasKey
|
|
46
|
+
|| (ownsUnassigned && row.projectKey === 'unassigned');
|
|
47
|
+
if (!mine) continue;
|
|
48
|
+
if (!isCountedHumanFeedback(row)) continue;
|
|
49
|
+
if (row.id) {
|
|
50
|
+
if (seen.has(row.id)) continue;
|
|
51
|
+
seen.add(row.id);
|
|
52
|
+
}
|
|
53
|
+
const signal = normalizeSignal(row);
|
|
54
|
+
if (signal === 'up') up += 1;
|
|
55
|
+
if (signal === 'down') down += 1;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return { up, down, label: 'this project', project: projectName };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (process.argv[1] && path.resolve(process.argv[1]) === path.resolve(__filename)) {
|
|
62
|
+
try {
|
|
63
|
+
process.stdout.write(JSON.stringify(computeHumanCounts()));
|
|
64
|
+
} catch (_) {
|
|
65
|
+
process.exit(0);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
module.exports = { computeHumanCounts };
|
|
@@ -134,7 +134,11 @@ function buildLinkState({
|
|
|
134
134
|
booting,
|
|
135
135
|
origin,
|
|
136
136
|
canBootstrap,
|
|
137
|
+
projectDir,
|
|
137
138
|
}) {
|
|
139
|
+
// The thumb links carry the project so a click is recorded for the project the
|
|
140
|
+
// status line shows, not for whichever directory the local server started in.
|
|
141
|
+
const projectParam = projectDir ? `&projectDir=${encodeURIComponent(projectDir)}` : '';
|
|
138
142
|
if (ready) {
|
|
139
143
|
return {
|
|
140
144
|
state: 'ready',
|
|
@@ -144,8 +148,8 @@ function buildLinkState({
|
|
|
144
148
|
downLabel: '👎',
|
|
145
149
|
dashboardUrl: `${origin}/dashboard`,
|
|
146
150
|
lessonsUrl: `${origin}/lessons`,
|
|
147
|
-
upUrl: `${origin}/feedback/quick?signal=up`,
|
|
148
|
-
downUrl: `${origin}/feedback/quick?signal=down`,
|
|
151
|
+
upUrl: `${origin}/feedback/quick?signal=up${projectParam}`,
|
|
152
|
+
downUrl: `${origin}/feedback/quick?signal=down${projectParam}`,
|
|
149
153
|
};
|
|
150
154
|
}
|
|
151
155
|
|
|
@@ -194,7 +198,13 @@ async function getStatuslineLinks(options = {}) {
|
|
|
194
198
|
|
|
195
199
|
const ready = allowLocalBootstrap ? await probe(origin, options) : false;
|
|
196
200
|
if (ready) {
|
|
197
|
-
return buildLinkState({
|
|
201
|
+
return buildLinkState({
|
|
202
|
+
ready: true,
|
|
203
|
+
booting: false,
|
|
204
|
+
origin,
|
|
205
|
+
canBootstrap,
|
|
206
|
+
projectDir: resolveProjectDir({ env, cwd: options.cwd || process.cwd() }),
|
|
207
|
+
});
|
|
198
208
|
}
|
|
199
209
|
|
|
200
210
|
const state = readRuntimeState({ env, home: homeDir });
|
|
@@ -13,10 +13,12 @@ const { resolveProjectDir } = require('./feedback-paths');
|
|
|
13
13
|
try {
|
|
14
14
|
const projectDir = resolveProjectDir({ cwd: process.cwd(), env: process.env });
|
|
15
15
|
syncClaudeHistoryFeedback({ projectDir });
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
// The status line is per project by default. Global totals mix every repo's
|
|
17
|
+
// entries and are opt-in with THUMBGATE_STATUSLINE_SCOPE=global.
|
|
18
|
+
const scope = String(process.env.THUMBGATE_STATUSLINE_SCOPE || 'project').toLowerCase();
|
|
19
|
+
const stats = scope === 'global' && shouldAggregateFeedback({ env: process.env })
|
|
18
20
|
? computeAggregateFeedbackStats({ projectDir, env: process.env })
|
|
19
|
-
: analyzeFeedback(undefined, { humanOnly: true });
|
|
21
|
+
: analyzeFeedback(undefined, { humanOnly: true, strictHuman: true });
|
|
20
22
|
const payload = {
|
|
21
23
|
...normalizeStatsPayload(stats),
|
|
22
24
|
aggregate: stats.aggregate || { enabled: false },
|
package/scripts/statusline.sh
CHANGED
|
@@ -90,6 +90,21 @@ if [ "$UP" = "0" ] && [ "$DOWN" = "0" ] || [ $(( _NOW - ${CACHE_TS:-0} )) -gt 12
|
|
|
90
90
|
fi
|
|
91
91
|
fi
|
|
92
92
|
|
|
93
|
+
# Thumb counts shown on the line are human feedback for this project only. The
|
|
94
|
+
# caches above are global sums that include automated entries, so they feed
|
|
95
|
+
# lessons and trend, never the thumbs.
|
|
96
|
+
SCOPE_LABEL="this project"
|
|
97
|
+
_HUMAN_JSON="${_TEST_THUMBGATE_STATUSLINE_HUMAN_JSON:-$(node "${SCRIPT_DIR}/statusline-human-counts.js" 2>/dev/null)}"
|
|
98
|
+
if [ -n "$_HUMAN_JSON" ]; then
|
|
99
|
+
eval "$(echo "$_HUMAN_JSON" | jq -r '
|
|
100
|
+
@sh "UP=\(.up // 0)",
|
|
101
|
+
@sh "DOWN=\(.down // 0)",
|
|
102
|
+
@sh "SCOPE_LABEL=\(.label // "this project")"
|
|
103
|
+
' 2>/dev/null)"
|
|
104
|
+
else
|
|
105
|
+
UP="0"; DOWN="0"
|
|
106
|
+
fi
|
|
107
|
+
|
|
93
108
|
# Background refresh from REST API when cache is stale (>120s)
|
|
94
109
|
if [ $(( _NOW - ${CACHE_TS:-0} )) -gt 120 ]; then
|
|
95
110
|
(
|
|
@@ -217,7 +232,7 @@ LINE=""
|
|
|
217
232
|
[[ -n "$WORK_ITEM_LABEL" ]] && LINE="${LINE:+${LINE} · }${WORK_ITEM_LABEL}"
|
|
218
233
|
LINE="${LINE:+${LINE} · }ThumbGate v${TG_VERSION} · ${TG_TIER}"
|
|
219
234
|
if [[ "$UP" = "0" && "$DOWN" = "0" ]]; then
|
|
220
|
-
LINE="${D}${LINE}${RST} · no feedback
|
|
235
|
+
LINE="${D}${LINE}${RST} · ${UP_LINK} ${DOWN_LINK} ${D}no human feedback ${SCOPE_LABEL}${RST}"
|
|
221
236
|
[[ -n "$PR_LABEL" ]] && LINE="${LINE} · ${D}${PR_LABEL}${RST}"
|
|
222
237
|
|
|
223
238
|
LINE="${LINE} · ${C}${DASHBOARD_LINK}${RST}"
|
|
@@ -225,7 +240,7 @@ if [[ "$UP" = "0" && "$DOWN" = "0" ]]; then
|
|
|
225
240
|
|
|
226
241
|
printf '%b\n' "$LINE"
|
|
227
242
|
else
|
|
228
|
-
LINE="${LINE} · ${G}${BD}${UP}${RST}${UP_LINK} ${R}${BD}${DOWN}${RST}${DOWN_LINK} ${
|
|
243
|
+
LINE="${LINE} · ${G}${BD}${UP}${RST}${UP_LINK} ${R}${BD}${DOWN}${RST}${DOWN_LINK} ${D}${SCOPE_LABEL}${RST}"
|
|
229
244
|
|
|
230
245
|
# Control Tower alerts (if any)
|
|
231
246
|
[[ "${SLO_V:-0}" -gt 0 ]] && LINE="${LINE} ${R}${SLO_V} SLO${RST}"
|
package/server.json
CHANGED
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
"source": "github",
|
|
9
9
|
"url": "https://github.com/IgorGanapolsky/ThumbGate"
|
|
10
10
|
},
|
|
11
|
-
"version": "1.40.
|
|
11
|
+
"version": "1.40.3",
|
|
12
12
|
"packages": [
|
|
13
13
|
{
|
|
14
14
|
"registryType": "npm",
|
|
15
15
|
"registryBaseUrl": "https://registry.npmjs.org",
|
|
16
16
|
"identifier": "thumbgate",
|
|
17
|
-
"version": "1.40.
|
|
17
|
+
"version": "1.40.3",
|
|
18
18
|
"runtimeHint": "npx",
|
|
19
19
|
"runtimeArguments": [
|
|
20
20
|
{
|
package/src/api/server.js
CHANGED
|
@@ -7881,7 +7881,13 @@ function createUnscopedApiServer({ ownerAdminDependencies = {} } = {}) {
|
|
|
7881
7881
|
feedbackDir: requestSafeDataDir,
|
|
7882
7882
|
limit: 10,
|
|
7883
7883
|
});
|
|
7884
|
+
// Attribute the click to the project the status line was showing.
|
|
7885
|
+
const quickProject = projectForCapture({}, {
|
|
7886
|
+
hosted: !isLoopbackHost(getRequestHostHeader(req)),
|
|
7887
|
+
cwd: resolveRequestProjectDir(req, parsed),
|
|
7888
|
+
});
|
|
7884
7889
|
const result = captureFeedback({
|
|
7890
|
+
...quickProject,
|
|
7885
7891
|
signal,
|
|
7886
7892
|
context: 'Quick capture from Claude Code statusline',
|
|
7887
7893
|
chatHistory,
|