thumbgate 1.4.3 → 1.4.5

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.
Files changed (270) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.well-known/llms.txt +12 -8
  4. package/.well-known/mcp/server-card.json +1 -1
  5. package/README.md +18 -8
  6. package/adapters/README.md +1 -1
  7. package/adapters/claude/.mcp.json +2 -2
  8. package/adapters/codex/config.toml +2 -2
  9. package/adapters/mcp/server-stdio.js +1 -1
  10. package/adapters/opencode/opencode.json +1 -1
  11. package/config/github-about.json +2 -2
  12. package/package.json +158 -10
  13. package/scripts/billing.js +5 -2
  14. package/scripts/statusline.sh +1 -0
  15. package/src/api/server.js +113 -16
  16. package/src/index.js +3 -0
  17. package/.claude-plugin/bundle/icon.png +0 -0
  18. package/.claude-plugin/bundle/icon.svg +0 -18
  19. package/.claude-plugin/bundle/server/index.js +0 -24
  20. package/adapters/chatgpt/INSTALL.md +0 -158
  21. package/adapters/perplexity/.mcp.json +0 -36
  22. package/adapters/perplexity/config.toml +0 -16
  23. package/adapters/perplexity/opencode.json +0 -29
  24. package/bin/memory.sh +0 -64
  25. package/bin/obsidian-sync.sh +0 -20
  26. package/plugins/amp-skill/INSTALL.md +0 -52
  27. package/plugins/amp-skill/SKILL.md +0 -64
  28. package/plugins/claude-codex-bridge/.claude-plugin/plugin.json +0 -22
  29. package/plugins/claude-codex-bridge/.mcp.json +0 -14
  30. package/plugins/claude-codex-bridge/INSTALL.md +0 -43
  31. package/plugins/claude-codex-bridge/README.md +0 -46
  32. package/plugins/claude-codex-bridge/scripts/codex-bridge.js +0 -286
  33. package/plugins/claude-codex-bridge/skills/adversarial-review/SKILL.md +0 -24
  34. package/plugins/claude-codex-bridge/skills/result/SKILL.md +0 -22
  35. package/plugins/claude-codex-bridge/skills/review/SKILL.md +0 -28
  36. package/plugins/claude-codex-bridge/skills/second-pass/SKILL.md +0 -27
  37. package/plugins/claude-codex-bridge/skills/setup/SKILL.md +0 -21
  38. package/plugins/claude-codex-bridge/skills/status/SKILL.md +0 -19
  39. package/plugins/claude-skill/INSTALL.md +0 -55
  40. package/plugins/claude-skill/SKILL.md +0 -46
  41. package/plugins/codex-profile/.codex-plugin/plugin.json +0 -43
  42. package/plugins/codex-profile/.mcp.json +0 -14
  43. package/plugins/codex-profile/AGENTS.md +0 -20
  44. package/plugins/codex-profile/INSTALL.md +0 -89
  45. package/plugins/codex-profile/README.md +0 -61
  46. package/plugins/cursor-marketplace/.cursor-plugin/plugin.json +0 -23
  47. package/plugins/cursor-marketplace/CHANGELOG.md +0 -30
  48. package/plugins/cursor-marketplace/LICENSE +0 -21
  49. package/plugins/cursor-marketplace/README.md +0 -124
  50. package/plugins/cursor-marketplace/agents/reliability-reviewer.md +0 -31
  51. package/plugins/cursor-marketplace/assets/logo-400x400.png +0 -0
  52. package/plugins/cursor-marketplace/commands/capture-feedback.md +0 -33
  53. package/plugins/cursor-marketplace/commands/check-gates.md +0 -25
  54. package/plugins/cursor-marketplace/commands/show-lessons.md +0 -27
  55. package/plugins/cursor-marketplace/hooks/hooks.json +0 -10
  56. package/plugins/cursor-marketplace/mcp.json +0 -14
  57. package/plugins/cursor-marketplace/rules/feedback-capture.mdc +0 -34
  58. package/plugins/cursor-marketplace/rules/pre-action-gates.mdc +0 -30
  59. package/plugins/cursor-marketplace/rules/session-continuity.mdc +0 -28
  60. package/plugins/cursor-marketplace/scripts/gate-check.sh +0 -21
  61. package/plugins/cursor-marketplace/skills/capture-feedback/SKILL.md +0 -48
  62. package/plugins/cursor-marketplace/skills/prevention-rules/SKILL.md +0 -31
  63. package/plugins/cursor-marketplace/skills/recall-context/SKILL.md +0 -30
  64. package/plugins/cursor-marketplace/skills/search-lessons/SKILL.md +0 -33
  65. package/plugins/gemini-extension/INSTALL.md +0 -92
  66. package/plugins/gemini-extension/gemini_prompt.txt +0 -14
  67. package/plugins/gemini-extension/tool_contract.json +0 -45
  68. package/plugins/opencode-profile/INSTALL.md +0 -57
  69. package/public/assets/instagram-card.png +0 -0
  70. package/public/assets/tiktok-agent-memory.mp4 +0 -0
  71. package/public/blog.html +0 -474
  72. package/public/compare/mem0.html +0 -189
  73. package/public/compare/speclock.html +0 -180
  74. package/public/compare.html +0 -310
  75. package/public/dashboard.html +0 -1100
  76. package/public/guide.html +0 -317
  77. package/public/guides/claude-code-prevent-repeated-mistakes.html +0 -161
  78. package/public/guides/codex-cli-guardrails.html +0 -158
  79. package/public/guides/cursor-prevent-repeated-mistakes.html +0 -161
  80. package/public/guides/pre-action-gates.html +0 -162
  81. package/public/guides/stop-repeated-ai-agent-mistakes.html +0 -159
  82. package/public/index.html +0 -1225
  83. package/public/js/buyer-intent.js +0 -252
  84. package/public/learn/agent-harness-pattern.html +0 -180
  85. package/public/learn/ai-agent-persistent-memory.html +0 -203
  86. package/public/learn/learn.css +0 -45
  87. package/public/learn/mcp-pre-action-gates-explained.html +0 -172
  88. package/public/learn/stop-ai-agent-force-push.html +0 -134
  89. package/public/learn/vibe-coding-safety-net.html +0 -142
  90. package/public/learn.html +0 -274
  91. package/public/lessons.html +0 -967
  92. package/public/llm-context.md +0 -156
  93. package/public/pro.html +0 -1087
  94. package/public/vercel.json +0 -8
  95. package/scripts/a2ui-engine.js +0 -73
  96. package/scripts/adk-consolidator.js +0 -274
  97. package/scripts/agent-security-hardening.js +0 -225
  98. package/scripts/ai-search-visibility.js +0 -116
  99. package/scripts/autonomous-sales-agent.js +0 -39
  100. package/scripts/autoresearch-runner.js +0 -216
  101. package/scripts/background-agent-governance.js +0 -229
  102. package/scripts/behavioral-extraction.js +0 -93
  103. package/scripts/budget-enforcer.js +0 -173
  104. package/scripts/budget-guard.js +0 -173
  105. package/scripts/build-claude-mcpb.js +0 -255
  106. package/scripts/build-codex-plugin.js +0 -152
  107. package/scripts/capture-railway-diagnostics.sh +0 -97
  108. package/scripts/changeset-check.js +0 -372
  109. package/scripts/check-congruence.js +0 -443
  110. package/scripts/computer-use-firewall.js +0 -280
  111. package/scripts/content-engine/linkedin-content-generator.js +0 -154
  112. package/scripts/content-engine/output/linkedin-memento-validation.md +0 -17
  113. package/scripts/content-engine/output/linkedin-posts-2026-04-09.md +0 -175
  114. package/scripts/content-engine/reddit-thread-finder.js +0 -154
  115. package/scripts/context-engine.js +0 -710
  116. package/scripts/daily-digest.js +0 -11
  117. package/scripts/data-governance.js +0 -173
  118. package/scripts/deploy-gcp.sh +0 -44
  119. package/scripts/deploy-policy.js +0 -249
  120. package/scripts/disagreement-mining.js +0 -315
  121. package/scripts/dpo-optimizer.js +0 -206
  122. package/scripts/ensure-repo-bootstrap.js +0 -130
  123. package/scripts/ephemeral-agent-store.js +0 -212
  124. package/scripts/eval-harness.js +0 -56
  125. package/scripts/export-kto-pairs.js +0 -309
  126. package/scripts/export-training.js +0 -446
  127. package/scripts/feedback-fallback.js +0 -111
  128. package/scripts/feedback-inbox-read.js +0 -162
  129. package/scripts/feedback-root-consolidator.js +0 -233
  130. package/scripts/feedback-to-memory.js +0 -185
  131. package/scripts/gate-satisfy.js +0 -42
  132. package/scripts/generate-paperbanana-diagrams.sh +0 -99
  133. package/scripts/generate-pretool-hook.sh +0 -40
  134. package/scripts/github-about.js +0 -430
  135. package/scripts/github-outreach.js +0 -65
  136. package/scripts/gtm-revenue-loop.js +0 -535
  137. package/scripts/hallucination-detector.js +0 -226
  138. package/scripts/hf-papers.js +0 -317
  139. package/scripts/hook-auto-capture.sh +0 -100
  140. package/scripts/hook-stop-pr-thread-check.sh +0 -68
  141. package/scripts/hook-stop-self-score.sh +0 -51
  142. package/scripts/hook-stop-verify-deploy.sh +0 -31
  143. package/scripts/hook-verify-before-done.sh +0 -20
  144. package/scripts/managed-dpo-export.js +0 -91
  145. package/scripts/markdown-escape.js +0 -12
  146. package/scripts/marketing-experiment.js +0 -657
  147. package/scripts/memalign-recall.js +0 -111
  148. package/scripts/memory-migration.js +0 -296
  149. package/scripts/meta-policy.js +0 -190
  150. package/scripts/metered-billing.js +0 -16
  151. package/scripts/model-tier-router.js +0 -310
  152. package/scripts/money-watcher.js +0 -218
  153. package/scripts/multi-hop-recall.js +0 -240
  154. package/scripts/per-step-scoring.js +0 -163
  155. package/scripts/perplexity-command-center.js +0 -644
  156. package/scripts/perplexity-marketing.js +0 -454
  157. package/scripts/pii-scanner.js +0 -153
  158. package/scripts/plan-gate.js +0 -154
  159. package/scripts/post-everywhere.js +0 -341
  160. package/scripts/post-to-x-retry.sh +0 -22
  161. package/scripts/post-to-x.js +0 -369
  162. package/scripts/pr-manager.js +0 -421
  163. package/scripts/principle-extractor.js +0 -162
  164. package/scripts/pro-features.js +0 -41
  165. package/scripts/prompt-dlp.js +0 -222
  166. package/scripts/prove-adapters.js +0 -860
  167. package/scripts/prove-attribution.js +0 -361
  168. package/scripts/prove-automation.js +0 -651
  169. package/scripts/prove-autoresearch.js +0 -304
  170. package/scripts/prove-claim-verification.js +0 -277
  171. package/scripts/prove-cloudflare-sandbox.js +0 -161
  172. package/scripts/prove-data-pipeline.js +0 -408
  173. package/scripts/prove-data-quality.js +0 -227
  174. package/scripts/prove-evolution.js +0 -352
  175. package/scripts/prove-harnesses.js +0 -287
  176. package/scripts/prove-intelligence.js +0 -257
  177. package/scripts/prove-lancedb.js +0 -425
  178. package/scripts/prove-local-intelligence.js +0 -340
  179. package/scripts/prove-loop-closure.js +0 -263
  180. package/scripts/prove-packaged-runtime.js +0 -327
  181. package/scripts/prove-predictive-insights.js +0 -355
  182. package/scripts/prove-runtime.js +0 -363
  183. package/scripts/prove-seo-gsd.js +0 -234
  184. package/scripts/prove-settings.js +0 -279
  185. package/scripts/prove-subway-upgrades.js +0 -277
  186. package/scripts/prove-tessl.js +0 -229
  187. package/scripts/prove-training-export.js +0 -325
  188. package/scripts/prove-workflow-contract.js +0 -112
  189. package/scripts/prove-xmemory.js +0 -332
  190. package/scripts/publish-decision.js +0 -159
  191. package/scripts/ralph-loop.js +0 -376
  192. package/scripts/ralph-mode-ci.js +0 -434
  193. package/scripts/reddit-dm-outreach.js +0 -192
  194. package/scripts/reddit-monitor-cron.sh +0 -26
  195. package/scripts/reminder-engine.js +0 -132
  196. package/scripts/revenue-status.js +0 -472
  197. package/scripts/rotate-stripe-webhook-secret.js +0 -314
  198. package/scripts/schedule-manager.js +0 -249
  199. package/scripts/self-healing-check.js +0 -193
  200. package/scripts/session-analyzer.js +0 -533
  201. package/scripts/shieldcortex-memory-firewall-runner.mjs +0 -53
  202. package/scripts/skill-exporter.js +0 -260
  203. package/scripts/skill-materializer.js +0 -134
  204. package/scripts/skill-packs.js +0 -136
  205. package/scripts/skill-proposer.js +0 -99
  206. package/scripts/skill-quality-tracker.js +0 -282
  207. package/scripts/slow-loop.js +0 -72
  208. package/scripts/social-analytics/db/marketing-db.js +0 -179
  209. package/scripts/social-analytics/db/schema.sql +0 -55
  210. package/scripts/social-analytics/digest.js +0 -256
  211. package/scripts/social-analytics/engagement-audit.js +0 -185
  212. package/scripts/social-analytics/generate-instagram-card.js +0 -123
  213. package/scripts/social-analytics/generate-slides.js +0 -268
  214. package/scripts/social-analytics/instagram-thumbgate-post.js +0 -111
  215. package/scripts/social-analytics/install-growth-automation.js +0 -114
  216. package/scripts/social-analytics/load-env.js +0 -77
  217. package/scripts/social-analytics/mcp-server.js +0 -289
  218. package/scripts/social-analytics/normalizer.js +0 -580
  219. package/scripts/social-analytics/notify.js +0 -162
  220. package/scripts/social-analytics/poll-all.js +0 -107
  221. package/scripts/social-analytics/pollers/github.js +0 -195
  222. package/scripts/social-analytics/pollers/instagram.js +0 -253
  223. package/scripts/social-analytics/pollers/linkedin.js +0 -340
  224. package/scripts/social-analytics/pollers/plausible.js +0 -245
  225. package/scripts/social-analytics/pollers/reddit.js +0 -306
  226. package/scripts/social-analytics/pollers/threads.js +0 -233
  227. package/scripts/social-analytics/pollers/tiktok.js +0 -203
  228. package/scripts/social-analytics/pollers/x.js +0 -227
  229. package/scripts/social-analytics/pollers/youtube.js +0 -304
  230. package/scripts/social-analytics/pollers/zernio.js +0 -183
  231. package/scripts/social-analytics/post-video.js +0 -316
  232. package/scripts/social-analytics/publish-instagram-thumbgate.js +0 -104
  233. package/scripts/social-analytics/publish-thumbgate-launch.js +0 -322
  234. package/scripts/social-analytics/publishers/devto.js +0 -122
  235. package/scripts/social-analytics/publishers/instagram.js +0 -317
  236. package/scripts/social-analytics/publishers/linkedin.js +0 -294
  237. package/scripts/social-analytics/publishers/reddit.js +0 -385
  238. package/scripts/social-analytics/publishers/threads.js +0 -275
  239. package/scripts/social-analytics/publishers/tiktok.js +0 -217
  240. package/scripts/social-analytics/publishers/x.js +0 -259
  241. package/scripts/social-analytics/publishers/youtube.js +0 -223
  242. package/scripts/social-analytics/publishers/zernio.js +0 -568
  243. package/scripts/social-analytics/reconcile-thumbgate-campaign.js +0 -165
  244. package/scripts/social-analytics/run-digest.js +0 -34
  245. package/scripts/social-analytics/schedule-thumbgate-campaign.js +0 -275
  246. package/scripts/social-analytics/store.js +0 -455
  247. package/scripts/social-analytics/sync-launch-assets.js +0 -185
  248. package/scripts/social-analytics/utm.js +0 -143
  249. package/scripts/social-pipeline.js +0 -2626
  250. package/scripts/social-post-hourly.js +0 -228
  251. package/scripts/social-quality-gate.js +0 -134
  252. package/scripts/social-reply-monitor.js +0 -592
  253. package/scripts/status-dashboard.js +0 -155
  254. package/scripts/stripe-live-status.js +0 -115
  255. package/scripts/subagent-profiles.js +0 -79
  256. package/scripts/sync-branch-protection.js +0 -340
  257. package/scripts/sync-gh-secrets-from-env.sh +0 -70
  258. package/scripts/sync-github-about.js +0 -55
  259. package/scripts/sync-version.js +0 -479
  260. package/scripts/synthetic-dpo.js +0 -234
  261. package/scripts/tessl-export.js +0 -369
  262. package/scripts/test-coverage.js +0 -128
  263. package/scripts/thumbgate-bench.js +0 -494
  264. package/scripts/thumbgate_session_start.sh +0 -32
  265. package/scripts/train_from_feedback.py +0 -929
  266. package/scripts/validate-feedback.js +0 -581
  267. package/scripts/verify-obsidian-setup.sh +0 -269
  268. package/scripts/verify-run.js +0 -269
  269. package/scripts/weekly-auto-post.js +0 -124
  270. package/scripts/x-autonomous-marketing.js +0 -139
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thumbgate-marketplace",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "owner": {
5
5
  "name": "Igor Ganapolsky",
6
6
  "email": "ig5973700@gmail.com"
@@ -13,7 +13,7 @@
13
13
  "source": "npm",
14
14
  "package": "thumbgate"
15
15
  },
16
- "version": "1.4.3",
16
+ "version": "1.4.5",
17
17
  "author": {
18
18
  "name": "Igor Ganapolsky"
19
19
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "thumbgate",
3
3
  "description": "Type 👍 or 👎 on any agent action. ThumbGate captures it, distills a lesson, and blocks the pattern from repeating. One thumbs-down = the agent physically cannot make that mistake again. 33 pre-action gates, budget enforcement, self-protection, and NIST/SOC2 compliance tags.",
4
- "version": "1.4.3",
4
+ "version": "1.4.5",
5
5
  "author": {
6
6
  "name": "Igor Ganapolsky"
7
7
  },
@@ -1,15 +1,17 @@
1
- # ThumbGate — Type 👍 or 👎 on any AI agent action. Blocks the pattern from repeating. One thumbs-down, never again.
1
+ # ThumbGate — Stop AI agents before they make costly mistakes.
2
2
  # https://thumbgate-production.up.railway.app
3
3
  # https://github.com/IgorGanapolsky/ThumbGate
4
4
  # https://www.npmjs.com/package/thumbgate
5
5
 
6
- > ThumbGate makes AI coding agents self-improving. Every mistake becomes
7
- > a prevention rule that physically blocks the agent from repeating it.
8
- > Feedback-driven enforcement via PreToolUse hooks.
6
+ > ThumbGate prevents expensive AI mistakes before they happen. It checks
7
+ > risky commands, file edits, deploys, payments, API calls, and other agent
8
+ > actions before execution. 👎 Thumbs down becomes a history-aware lesson and
9
+ > a Pre-Action Gate; 👍 thumbs up reinforces safe patterns.
9
10
 
10
11
  ## What ThumbGate solves
11
12
 
12
- - AI coding agents repeat the same mistakes across sessions
13
+ - AI coding agents repeat costly mistakes across sessions
14
+ - Bad commands, destructive SQL, risky deploys, unsafe publishes, and API mistakes are expensive after execution
13
15
  - CLAUDE.md and .cursorrules files are suggestions agents can ignore
14
16
  - No memory between sessions means no learning from corrections
15
17
  - Teams have no shared safety rules across developers
@@ -27,6 +29,7 @@
27
29
  - Developers using Claude Code, Cursor, Codex, Gemini CLI, or any MCP-compatible agent
28
30
  - Engineering teams that need shared agent safety rules
29
31
  - Anyone tired of re-correcting their AI coding assistant
32
+ - Solo operators who want Pro dashboard proof for blocked mistakes and DPO exports
30
33
 
31
34
  ## Install
32
35
 
@@ -36,9 +39,10 @@ npx thumbgate init --agent claude-code
36
39
 
37
40
  ## Pricing
38
41
 
39
- - Free: 3 feedback captures/day, 5 lesson searches/day, 5 built-in gates
40
- - Pro: $19/mo or $149/yr unlimited everything, auto-gate promotion, multi-repo sync
41
- - Founding Member: $49 one-time, Pro forever
42
+ - Free GPT: advice, checkpointing, and setup help in ChatGPT
43
+ - Free local CLI: 3 feedback captures/day, 5 lesson searches/day, recall, and local Pre-Action Gates after install
44
+ - Pro: $19/mo or $149/yr — personal enforcement proof, local dashboard, gate debugger, DPO export, and review-ready exports
45
+ - Team: $99/seat/mo, 3-seat minimum after intake — shared lessons, org visibility, approval boundaries, and rollout proof
42
46
 
43
47
  ## Links
44
48
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thumbgate",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "description": "ThumbGate — 👍👎 feedback that teaches your AI agent. Thumbs down a mistake, it never happens again.",
5
5
  "homepage": "https://github.com/IgorGanapolsky/thumbgate",
6
6
  "transport": "stdio",
package/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # ThumbGate
2
2
 
3
- **Thumbs up or thumbs down — and your AI coding agent never makes the same mistake twice.**
3
+ **Stop AI agents before they make costly mistakes.**
4
+
5
+ ThumbGate checks risky commands, file edits, deploys, API calls, and other agent actions before they run. Thumbs-up/down feedback becomes remembered lessons, repeated failures become Pre-Action Gates, and the next bad action gets blocked instead of becoming another cleanup bill.
4
6
 
5
7
  [![CI](https://github.com/IgorGanapolsky/ThumbGate/actions/workflows/ci.yml/badge.svg)](https://github.com/IgorGanapolsky/ThumbGate/actions/workflows/ci.yml)
6
8
  [![npm](https://img.shields.io/npm/v/thumbgate)](https://www.npmjs.com/package/thumbgate)
@@ -18,7 +20,7 @@
18
20
 
19
21
  ## ThumbGate GPT: start here
20
22
 
21
- **Use ThumbGate in ChatGPT now:** **[Open the live ThumbGate GPT](https://chatgpt.com/g/g-69dcfd1cd5f881918ae31874631d6f08-thumbgate)**, paste the action your AI agent wants to run, and ask whether to allow, block, or checkpoint it.
23
+ **Use ThumbGate in ChatGPT now:** **[Open the live ThumbGate GPT](https://chatgpt.com/g/g-69dcfd1cd5f881918ae31874631d6f08-thumbgate)**, paste the action your AI agent wants to run, and ask whether to allow, block, or checkpoint it before the mistake becomes expensive.
22
24
 
23
25
  Try this first prompt:
24
26
 
@@ -26,7 +28,7 @@ Try this first prompt:
26
28
  Check this agent action before it runs: git push --force --tags
27
29
  ```
28
30
 
29
- **No, users do not have to keep chatting inside the ThumbGate GPT to use ThumbGate.** The GPT is the fast demo, guided setup path, and thumbs-up/down memory surface for ChatGPT users. The hard enforcement layer still runs where the work happens: your local coding agent, CI workflow, or MCP-compatible runtime after `npx thumbgate init`.
31
+ **No, users do not have to keep chatting inside the ThumbGate GPT to use ThumbGate.** The GPT is the fast demo, guided setup path, and thumbs-up/down memory surface for ChatGPT users. Think of the GPT as advice and checkpointing; the hard enforcement layer still runs where the work happens: your local coding agent, CI workflow, or MCP-compatible runtime after `npx thumbgate init`.
30
32
 
31
33
  Developers can import the prepared **[GPT Actions OpenAPI spec](adapters/chatgpt/openapi.yaml)** with the **[ChatGPT Actions setup guide](adapters/chatgpt/INSTALL.md)**. Regular ChatGPT users should just open the GPT and type what happened.
32
34
 
@@ -46,7 +48,13 @@ It scores deterministic GitHub, npm, database, Railway, shell, and filesystem sc
46
48
 
47
49
  ## What problem does this solve?
48
50
 
49
- AI agents repeat mistakes. You fix the same problem in session after session — force-push to main, broken migrations, unauthorized file edits — because the agent has no memory of your feedback.
51
+ AI agents repeat expensive mistakes. You fix the same problem in session after session — force-push to main, broken migrations, unauthorized file edits, risky deploys — because the agent has no durable memory of your feedback and no gate before execution.
52
+
53
+ ThumbGate sells three concrete outcomes:
54
+
55
+ - **Prevent expensive AI mistakes** — catch bad commands, destructive database actions, unsafe publishes, and risky API calls before they run.
56
+ - **Make AI stop repeating mistakes** — fix it once, turn the lesson into a rule, and block the repeat before the next tool call lands.
57
+ - **Turn AI into a reliable operator** — move from a smart assistant that apologizes after damage to a production-ready operator with checkpoints, proof, and enforcement.
50
58
 
51
59
  ```
52
60
  ┌─────────────────────────────────────────────────────────────┐
@@ -64,7 +72,7 @@ AI agents repeat mistakes. You fix the same problem in session after session —
64
72
  └─────────────────────────────────────────────────────────────┘
65
73
  ```
66
74
 
67
- ThumbGate is the **control plane** for AI coding agents — turning your feedback into **enforced rules**, not suggestions.
75
+ ThumbGate is the **Reliability Gateway** for AI coding agents — turning your feedback into **enforced rules**, not suggestions.
68
76
 
69
77
  ---
70
78
 
@@ -130,6 +138,8 @@ Session 3: │ Session 3+:
130
138
 
131
139
  **Paid path for individual operators:** [ThumbGate Pro](https://thumbgate-production.up.railway.app/pro?utm_source=github&utm_medium=readme&utm_campaign=pro_page) is the self-serve side lane for a personal dashboard and export-ready evidence.
132
140
 
141
+ **Plain product line:** GPT preview = advice and checkpointing. Free local CLI (3 daily feedback captures, 5 daily lesson searches) = basic enforcement on one machine. Pro ($19/mo or $149/yr) = personal enforcement proof, dashboard, and exports. Team = shared hosted lesson DB, org dashboard, and shared enforcement so one correction protects every seat.
142
+
133
143
  ---
134
144
 
135
145
  ## Quick Start
@@ -265,9 +275,9 @@ Free and self-hosted users can invoke `search_lessons` directly through MCP, and
265
275
  **[Start Workflow Hardening Sprint](https://thumbgate-production.up.railway.app/?utm_source=github&utm_medium=readme&utm_campaign=top_cta#workflow-sprint-intake)** · **[Live Dashboard](https://thumbgate-production.up.railway.app/dashboard?utm_source=github&utm_medium=readme&utm_campaign=top_cta)** · **[See Pro](https://thumbgate-production.up.railway.app/pro?utm_source=github&utm_medium=readme&utm_campaign=pro_page)**
266
276
 
267
277
  **Where to start:**
268
- - **Teams:** Begin with the Workflow Hardening Sprint — qualify one real repeated failure before committing to a full rollout
269
- - **Solo operators:** ThumbGate Pro adds a personal dashboard and export-ready evidence
270
- - **Individuals & open source:** Free CLI tier, self-hosted
278
+ - **Teams:** Begin with the Workflow Hardening Sprint — prove one costly repeat failure can be blocked before committing to a full rollout
279
+ - **Solo operators:** ThumbGate Pro adds personal enforcement proof, a gate debugger, and export-ready evidence
280
+ - **Individuals & open source:** Free CLI tier, self-hosted, with local Pre-Action Gates after install
271
281
 
272
282
  ---
273
283
 
@@ -3,7 +3,7 @@
3
3
  - `chatgpt/openapi.yaml`: import into GPT Actions.
4
4
  - `gemini/function-declarations.json`: Gemini function-calling definitions.
5
5
  - `mcp/server-stdio.js`: underlying local MCP stdio server implementation.
6
- - `claude/.mcp.json`: example Claude Code MCP config using `npx --yes --package thumbgate@1.4.3 thumbgate serve`.
6
+ - `claude/.mcp.json`: example Claude Code MCP config using `npx --yes --package thumbgate@1.4.5 thumbgate serve`.
7
7
  - `codex/config.toml`: example Codex MCP profile section using the same version-pinned portable launcher.
8
8
  - `amp/skills/thumbgate-feedback/SKILL.md`: Amp skill template.
9
9
  - `opencode/opencode.json`: portable OpenCode MCP profile using the same version-pinned portable launcher.
@@ -2,13 +2,13 @@
2
2
  "mcpServers": {
3
3
  "thumbgate": {
4
4
  "command": "npx",
5
- "args": ["--yes", "--package", "thumbgate@1.4.3", "thumbgate", "serve"]
5
+ "args": ["--yes", "--package", "thumbgate@1.4.5", "thumbgate", "serve"]
6
6
  }
7
7
  },
8
8
  "hooks": {
9
9
  "preToolUse": {
10
10
  "command": "npx",
11
- "args": ["--yes", "--package", "thumbgate@1.4.3", "thumbgate", "gate-check"]
11
+ "args": ["--yes", "--package", "thumbgate@1.4.5", "thumbgate", "gate-check"]
12
12
  }
13
13
  }
14
14
  }
@@ -1,9 +1,9 @@
1
1
  # Codex MCP profile (copy into ~/.codex/config.toml or merge section)
2
2
  [mcp_servers.thumbgate]
3
3
  command = "npx"
4
- args = ["--yes", "--package", "thumbgate@1.4.3", "thumbgate", "serve"]
4
+ args = ["--yes", "--package", "thumbgate@1.4.5", "thumbgate", "serve"]
5
5
 
6
6
  # Hard PreToolUse hook for Codex
7
7
  [hooks.pre_tool_use]
8
8
  command = "npx"
9
- args = ["--yes", "--package", "thumbgate@1.4.3", "thumbgate", "gate-check"]
9
+ args = ["--yes", "--package", "thumbgate@1.4.5", "thumbgate", "gate-check"]
@@ -124,7 +124,7 @@ const {
124
124
  finalizeSession: finalizeFeedbackSession,
125
125
  } = require('../../scripts/feedback-session');
126
126
 
127
- const SERVER_INFO = { name: 'thumbgate-mcp', version: '1.4.3' };
127
+ const SERVER_INFO = { name: 'thumbgate-mcp', version: '1.4.5' };
128
128
  const COMMERCE_CATEGORIES = [
129
129
  'product_recommendation',
130
130
  'brand_compliance',
@@ -7,7 +7,7 @@
7
7
  "npx",
8
8
  "--yes",
9
9
  "--package",
10
- "thumbgate@1.4.3",
10
+ "thumbgate@1.4.5",
11
11
  "thumbgate",
12
12
  "serve"
13
13
  ],
@@ -2,8 +2,8 @@
2
2
  "repo": "IgorGanapolsky/ThumbGate",
3
3
  "repositoryUrl": "https://github.com/IgorGanapolsky/ThumbGate",
4
4
  "homepageUrl": "https://thumbgate-production.up.railway.app",
5
- "githubDescription": "CLI-first agent governance for AI coding workflows: pre-action gates, shared lessons, and team safeguards that stop repeated agent mistakes.",
6
- "metaDescription": "CLI-first agent governance for teams shipping AI-generated changes. \ud83d\udc4e Thumbs down distills history-aware lessons from up to 8 prior entries and stays linked to a 60-second feedback session. \ud83d\udc4d Thumbs up reinforces safe patterns. Pre-action gates, workflow governance, shared lessons and org visibility, release confidence, and isolated execution guidance turn vibe coding mistakes into shared enforcement and proof-ready rollout.",
5
+ "githubDescription": "Agent governance that stops costly AI mistakes before they run: pre-action gates, shared lessons, and team safeguards for AI coding workflows.",
6
+ "metaDescription": "Stop expensive AI agent mistakes before they happen. \ud83d\udc4e Thumbs down becomes history-aware lessons and Pre-Action Gates; \ud83d\udc4d thumbs up reinforces safe patterns. ThumbGate checks risky commands, deploys, API calls, and file edits across ChatGPT, Claude Code, Cursor, Codex, Gemini, Amp, and OpenCode with workflow governance, shared lessons and org visibility for safer vibe coding.",
7
7
  "topics": [
8
8
  "thumbgate",
9
9
  "pre-action-gates",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thumbgate",
3
- "version": "1.4.3",
3
+ "version": "1.4.5",
4
4
  "description": "Self-improving agent governance: type thumbs-up or thumbs-down on any AI agent action. ThumbGate turns every mistake into a prevention rule and blocks the pattern from repeating. One thumbs-down, never again. 33 pre-action gates, budget enforcement, and self-protection for Claude Code, Cursor, Codex, Gemini CLI, and Amp.",
5
5
  "homepage": "https://thumbgate-production.up.railway.app",
6
6
  "repository": {
@@ -10,24 +10,172 @@
10
10
  "bugs": {
11
11
  "url": "https://github.com/IgorGanapolsky/ThumbGate/issues"
12
12
  },
13
- "main": "scripts/feedback-loop.js",
13
+ "main": "src/index.js",
14
14
  "bin": {
15
15
  "thumbgate": "bin/cli.js"
16
16
  },
17
17
  "files": [
18
- "bin/",
18
+ "bin/cli.js",
19
+ "bin/postinstall.js",
19
20
  "src/",
20
- "scripts/",
21
- "adapters/",
21
+ "adapters/mcp/server-stdio.js",
22
+ "adapters/chatgpt/openapi.yaml",
23
+ "adapters/gemini/function-declarations.json",
24
+ "adapters/claude/.mcp.json",
25
+ "adapters/codex/config.toml",
26
+ "adapters/opencode/opencode.json",
27
+ "adapters/amp/skills/thumbgate-feedback/SKILL.md",
28
+ "adapters/forge/forge.yaml",
22
29
  "config/",
23
- "plugins/",
24
30
  "skills/",
25
31
  "openapi/",
26
- "public/",
27
32
  ".well-known/",
28
- ".claude-plugin/",
33
+ ".claude-plugin/plugin.json",
34
+ ".claude-plugin/marketplace.json",
35
+ ".claude-plugin/README.md",
29
36
  "README.md",
30
- "LICENSE"
37
+ "LICENSE",
38
+ "scripts/agent-readiness.js",
39
+ "scripts/access-anomaly-detector.js",
40
+ "scripts/agentic-data-pipeline.js",
41
+ "scripts/analytics-report.js",
42
+ "scripts/analytics-window.js",
43
+ "scripts/async-job-runner.js",
44
+ "scripts/audit-trail.js",
45
+ "scripts/auto-promote-gates.js",
46
+ "scripts/auto-wire-hooks.js",
47
+ "scripts/belief-update.js",
48
+ "scripts/billing-setup.js",
49
+ "scripts/billing.js",
50
+ "scripts/bot-detector.js",
51
+ "scripts/build-metadata.js",
52
+ "scripts/claude-feedback-sync.js",
53
+ "scripts/cli-demo.js",
54
+ "scripts/cli-feedback.js",
55
+ "scripts/cli-schema.js",
56
+ "scripts/cli-status.js",
57
+ "scripts/cli-telemetry.js",
58
+ "scripts/cloudflare-dynamic-sandbox.js",
59
+ "scripts/code-reasoning.js",
60
+ "scripts/codegraph-context.js",
61
+ "scripts/commercial-offer.js",
62
+ "scripts/context-manager.js",
63
+ "scripts/contextfs.js",
64
+ "scripts/conversation-context.js",
65
+ "scripts/creator-campaigns.js",
66
+ "scripts/cross-encoder-reranker.js",
67
+ "scripts/daemon-manager.js",
68
+ "scripts/dashboard-render-spec.js",
69
+ "scripts/dashboard.js",
70
+ "scripts/decision-journal.js",
71
+ "scripts/delegation-runtime.js",
72
+ "scripts/dispatch-brief.js",
73
+ "scripts/distribution-surfaces.js",
74
+ "scripts/docker-sandbox-planner.js",
75
+ "scripts/document-intake.js",
76
+ "scripts/evolution-state.js",
77
+ "scripts/experiment-tracker.js",
78
+ "scripts/explore-subcommands.js",
79
+ "scripts/explore.js",
80
+ "scripts/export-databricks-bundle.js",
81
+ "scripts/export-dpo-pairs.js",
82
+ "scripts/export-hf-dataset.js",
83
+ "scripts/failure-diagnostics.js",
84
+ "scripts/feedback-attribution.js",
85
+ "scripts/feedback-history-distiller.js",
86
+ "scripts/feedback-loop.js",
87
+ "scripts/feedback-paths.js",
88
+ "scripts/feedback-quality.js",
89
+ "scripts/feedback-schema.js",
90
+ "scripts/feedback-session.js",
91
+ "scripts/feedback-to-rules.js",
92
+ "scripts/filesystem-search.js",
93
+ "scripts/fs-utils.js",
94
+ "scripts/funnel-analytics.js",
95
+ "scripts/gate-stats.js",
96
+ "scripts/gate-templates.js",
97
+ "scripts/gates-engine.js",
98
+ "scripts/harness-selector.js",
99
+ "scripts/history-distiller.js",
100
+ "scripts/hook-runtime.js",
101
+ "scripts/hook-thumbgate-cache-updater.js",
102
+ "scripts/hosted-config.js",
103
+ "scripts/hosted-job-launcher.js",
104
+ "scripts/hybrid-feedback-context.js",
105
+ "scripts/install-mcp.js",
106
+ "scripts/intent-router.js",
107
+ "scripts/internal-agent-bootstrap.js",
108
+ "scripts/intervention-policy.js",
109
+ "scripts/jsonl-watcher.js",
110
+ "scripts/lesson-db.js",
111
+ "scripts/lesson-inference.js",
112
+ "scripts/lesson-reranker.js",
113
+ "scripts/lesson-retrieval.js",
114
+ "scripts/lesson-rotation.js",
115
+ "scripts/lesson-search.js",
116
+ "scripts/lesson-synthesis.js",
117
+ "scripts/license.js",
118
+ "scripts/llm-client.js",
119
+ "scripts/local-model-profile.js",
120
+ "scripts/managed-lesson-agent.js",
121
+ "scripts/mcp-config.js",
122
+ "scripts/mcp-policy.js",
123
+ "scripts/memory-firewall.js",
124
+ "scripts/meta-agent-loop.js",
125
+ "scripts/natural-language-harness.js",
126
+ "scripts/obsidian-export.js",
127
+ "scripts/operational-dashboard.js",
128
+ "scripts/operational-integrity.js",
129
+ "scripts/operational-summary.js",
130
+ "scripts/optimize-context.js",
131
+ "scripts/org-dashboard.js",
132
+ "scripts/partner-orchestration.js",
133
+ "scripts/perplexity-client.js",
134
+ "scripts/predictive-insights.js",
135
+ "scripts/pro-local-dashboard.js",
136
+ "scripts/problem-detail.js",
137
+ "scripts/product-feedback.js",
138
+ "scripts/profile-router.js",
139
+ "scripts/prompt-guard.js",
140
+ "scripts/published-cli.js",
141
+ "scripts/pulse.js",
142
+ "scripts/rate-limiter.js",
143
+ "scripts/reflector-agent.js",
144
+ "scripts/risk-scorer.js",
145
+ "scripts/rlaif-self-audit.js",
146
+ "scripts/rubric-engine.js",
147
+ "scripts/secret-scanner.js",
148
+ "scripts/security-scanner.js",
149
+ "scripts/self-distill-agent.js",
150
+ "scripts/self-heal.js",
151
+ "scripts/semantic-dedup.js",
152
+ "scripts/semantic-layer.js",
153
+ "scripts/seo-gsd.js",
154
+ "scripts/settings-hierarchy.js",
155
+ "scripts/skill-generator.js",
156
+ "scripts/slo-alert-engine.js",
157
+ "scripts/statusline-cache-path.js",
158
+ "scripts/statusline-lesson.js",
159
+ "scripts/statusline-links.js",
160
+ "scripts/statusline-local-stats.js",
161
+ "scripts/statusline-meta.js",
162
+ "scripts/statusline.sh",
163
+ "scripts/statusline-tower.js",
164
+ "scripts/telemetry-analytics.js",
165
+ "scripts/thompson-sampling.js",
166
+ "scripts/thumbgate-search.js",
167
+ "scripts/tool-registry.js",
168
+ "scripts/tool-kpi-tracker.js",
169
+ "scripts/user-profile.js",
170
+ "scripts/validate-workflow-contract.js",
171
+ "scripts/vector-store.js",
172
+ "scripts/verification-loop.js",
173
+ "scripts/webhook-delivery.js",
174
+ "scripts/workflow-runs.js",
175
+ "scripts/workflow-sentinel.js",
176
+ "scripts/workflow-sprint-intake.js",
177
+ "scripts/workspace-evolver.js",
178
+ "scripts/xmemory-lite.js"
31
179
  ],
32
180
  "scripts": {
33
181
  "postinstall": "node bin/postinstall.js || true",
@@ -133,7 +281,7 @@
133
281
  "test:quality": "node --test tests/validate-feedback.test.js",
134
282
  "test:intelligence": "node --test tests/intelligence.test.js",
135
283
  "test:training-export": "node --test tests/training-export.test.js tests/databricks-export.test.js",
136
- "test:deployment": "node --test tests/deployment.test.js tests/deploy-policy.test.js tests/publish-decision.test.js tests/changeset-check.test.js tests/sonarcloud-workflow.test.js tests/package-boundary.test.js",
284
+ "test:deployment": "node --test tests/deployment.test.js tests/deploy-policy.test.js tests/publish-decision.test.js tests/changeset-check.test.js tests/release-notes.test.js tests/sonarcloud-workflow.test.js tests/package-boundary.test.js",
137
285
  "test:operational-integrity": "node --test tests/operational-integrity.test.js tests/sync-branch-protection.test.js",
138
286
  "test:workflow": "node --test tests/workflow-contract.test.js tests/social-marketing-assets.test.js tests/social-pipeline.test.js tests/positioning-contract.test.js tests/docs-claim-hygiene.test.js tests/workflow-runs.test.js tests/workflow-sprint-intake.test.js tests/gtm-revenue-loop.test.js tests/enterprise-story.test.js tests/ralph-loop.test.js tests/ralph-mode-ci.test.js",
139
287
  "test:billing": "node --test tests/billing.test.js",
@@ -2068,8 +2068,11 @@ function buildCheckoutSessionPayload({ successUrl, cancelUrl, customerEmail, che
2068
2068
  packId: pack ? pack.id : null,
2069
2069
  credits: pack ? pack.credits : null,
2070
2070
  }),
2071
- // 7-day free trial for subscriptions — reduces checkout abandonment
2072
- ...(pack ? {} : { subscription_data: { trial_period_days: 7 } }),
2071
+ // 7-day free trial for subscriptions — don't require card upfront
2072
+ ...(pack ? {} : {
2073
+ subscription_data: { trial_period_days: 7 },
2074
+ payment_method_collection: 'if_required',
2075
+ }),
2073
2076
  };
2074
2077
 
2075
2078
  const normalizedCustomerEmail = normalizeText(customerEmail);
@@ -155,6 +155,7 @@ osc_link() {
155
155
  *localhost*|*127.0.0.1*|"") printf '%s' "$label" ;;
156
156
  *) printf '\033]8;;%s\007%s\033]8;;\007' "$url" "$label" ;;
157
157
  esac
158
+ return 0
158
159
  }
159
160
 
160
161
  UP_ICON="👍"
package/src/api/server.js CHANGED
@@ -1063,38 +1063,131 @@ function loadProPageHtml(runtimeConfig, pageContext = {}) {
1063
1063
  return loadPublicMarketingTemplateHtml(PRO_PAGE_PATH, runtimeConfig, pageContext);
1064
1064
  }
1065
1065
 
1066
- function loadDashboardPageHtml(req, expectedApiKey) {
1067
- const template = fs.readFileSync(DASHBOARD_PAGE_PATH, 'utf-8');
1066
+ function readOptionalPublicTemplate(filePath) {
1067
+ try {
1068
+ return fs.readFileSync(filePath, 'utf-8');
1069
+ } catch (error) {
1070
+ if (error?.code === 'ENOENT') return null;
1071
+ throw error;
1072
+ }
1073
+ }
1074
+
1075
+ function resolveLocalPageBootstrap(req, expectedApiKey) {
1068
1076
  const forwardedHost = req.headers['x-forwarded-host'];
1069
1077
  const hostHeader = Array.isArray(forwardedHost)
1070
1078
  ? forwardedHost[0]
1071
1079
  : forwardedHost || req.headers.host || '';
1072
1080
  const localProBootstrap = process.env.THUMBGATE_PRO_MODE === '1' && Boolean(expectedApiKey) && isLoopbackHost(hostHeader);
1073
- // Developer override: auth is disabled (expectedApiKey===null), auto-connect with dummy key
1074
1081
  const devOverride = expectedApiKey === null && isLoopbackHost(hostHeader);
1075
1082
  const bootstrapActive = localProBootstrap || devOverride;
1076
1083
  const serializedBootstrapKey = JSON.stringify(localProBootstrap ? expectedApiKey : devOverride ? 'dev-override' : '').replace(/</g, '\\u003c');
1077
1084
 
1085
+ return {
1086
+ bootstrapActive,
1087
+ serializedBootstrapKey,
1088
+ };
1089
+ }
1090
+
1091
+ function renderPackagedDashboardHtml({ bootstrapActive, serializedBootstrapKey }) {
1092
+ return `<!doctype html>
1093
+ <html lang="en">
1094
+ <head>
1095
+ <meta charset="utf-8">
1096
+ <meta name="viewport" content="width=device-width, initial-scale=1">
1097
+ <title>ThumbGate Dashboard</title>
1098
+ <style>
1099
+ :root { color-scheme: light dark; --bg:#0f172a; --panel:#111827; --text:#f8fafc; --muted:#94a3b8; --line:#334155; --accent:#22c55e; }
1100
+ body { margin:0; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background:linear-gradient(135deg,#020617,#111827); color:var(--text); }
1101
+ main { max-width:920px; margin:0 auto; padding:48px 20px; }
1102
+ .panel { border:1px solid var(--line); border-radius:20px; background:rgba(15,23,42,.86); padding:28px; box-shadow:0 24px 80px rgba(0,0,0,.32); }
1103
+ .eyebrow { color:var(--accent); font-size:13px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; }
1104
+ h1 { font-size:clamp(32px,5vw,54px); line-height:1; margin:14px 0; }
1105
+ p { color:var(--muted); font-size:18px; line-height:1.6; }
1106
+ .grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; margin-top:26px; }
1107
+ a { color:var(--text); text-decoration:none; }
1108
+ .card { display:block; border:1px solid var(--line); border-radius:16px; padding:18px; background:rgba(30,41,59,.7); }
1109
+ .card strong { display:block; margin-bottom:8px; }
1110
+ .card span { color:var(--muted); font-size:14px; line-height:1.5; }
1111
+ </style>
1112
+ <script>
1113
+ window.THUMBGATE_DASHBOARD_BOOTSTRAP = { enabled: ${bootstrapActive ? 'true' : 'false'}, apiKey: ${serializedBootstrapKey} };
1114
+ </script>
1115
+ </head>
1116
+ <body>
1117
+ <main>
1118
+ <section class="panel">
1119
+ <div class="eyebrow">Packaged runtime</div>
1120
+ <h1>ThumbGate is running locally.</h1>
1121
+ <p>This lightweight npm dashboard is bundled without marketing assets, so installs stay small while core feedback, lessons, and API routes remain available.</p>
1122
+ <div class="grid">
1123
+ <a class="card" href="/v1/dashboard"><strong>Dashboard JSON</strong><span>Inspect feedback totals, lesson counts, and Reliability Gateway health.</span></a>
1124
+ <a class="card" href="/lessons"><strong>Lessons</strong><span>Review remembered thumbs-up/down lessons and enforcement context.</span></a>
1125
+ <a class="card" href="/health"><strong>Health</strong><span>Verify the installed package version and runtime status.</span></a>
1126
+ </div>
1127
+ </section>
1128
+ </main>
1129
+ </body>
1130
+ </html>`;
1131
+ }
1132
+
1133
+ function renderPackagedLessonsHtml({ bootstrapActive, serializedBootstrapKey }) {
1134
+ return `<!doctype html>
1135
+ <html lang="en">
1136
+ <head>
1137
+ <meta charset="utf-8">
1138
+ <meta name="viewport" content="width=device-width, initial-scale=1">
1139
+ <title>ThumbGate Lessons</title>
1140
+ <style>
1141
+ :root { color-scheme: light dark; --bg:#0f172a; --panel:#111827; --text:#f8fafc; --muted:#94a3b8; --line:#334155; --accent:#38bdf8; }
1142
+ body { margin:0; font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background:linear-gradient(135deg,#020617,#0f172a); color:var(--text); }
1143
+ main { max-width:920px; margin:0 auto; padding:48px 20px; }
1144
+ .panel { border:1px solid var(--line); border-radius:20px; background:rgba(15,23,42,.86); padding:28px; box-shadow:0 24px 80px rgba(0,0,0,.32); }
1145
+ .eyebrow { color:var(--accent); font-size:13px; font-weight:700; letter-spacing:.12em; text-transform:uppercase; }
1146
+ h1 { font-size:clamp(32px,5vw,54px); line-height:1; margin:14px 0; }
1147
+ p { color:var(--muted); font-size:18px; line-height:1.6; }
1148
+ .actions { display:flex; flex-wrap:wrap; gap:12px; margin-top:26px; }
1149
+ a { color:var(--text); text-decoration:none; border:1px solid var(--line); border-radius:999px; padding:12px 16px; background:rgba(30,41,59,.7); }
1150
+ </style>
1151
+ <script>
1152
+ window.THUMBGATE_LESSONS_BOOTSTRAP = { enabled: ${bootstrapActive ? 'true' : 'false'}, apiKey: ${serializedBootstrapKey} };
1153
+ </script>
1154
+ </head>
1155
+ <body>
1156
+ <main>
1157
+ <section class="panel">
1158
+ <div class="eyebrow">Packaged runtime</div>
1159
+ <h1>ThumbGate lessons are available.</h1>
1160
+ <p>The full hosted lessons UI is excluded from the npm tarball, but installed packages still expose the lesson APIs and detail pages needed for local agent feedback loops.</p>
1161
+ <div class="actions">
1162
+ <a href="/v1/lessons/search">Search lessons JSON</a>
1163
+ <a href="/v1/feedback/stats">Feedback stats JSON</a>
1164
+ <a href="/dashboard">Back to dashboard</a>
1165
+ </div>
1166
+ </section>
1167
+ </main>
1168
+ </body>
1169
+ </html>`;
1170
+ }
1171
+
1172
+ function loadDashboardPageHtml(req, expectedApiKey) {
1173
+ const bootstrap = resolveLocalPageBootstrap(req, expectedApiKey);
1174
+ const template = readOptionalPublicTemplate(DASHBOARD_PAGE_PATH);
1175
+ if (!template) return renderPackagedDashboardHtml(bootstrap);
1176
+
1078
1177
  return fillTemplate(template, {
1079
- '__DASHBOARD_BOOTSTRAP_KEY__': serializedBootstrapKey,
1080
- '__DASHBOARD_BOOTSTRAP_ENABLED__': bootstrapActive ? 'true' : 'false',
1178
+ '__DASHBOARD_BOOTSTRAP_KEY__': bootstrap.serializedBootstrapKey,
1179
+ '__DASHBOARD_BOOTSTRAP_ENABLED__': bootstrap.bootstrapActive ? 'true' : 'false',
1081
1180
  });
1082
1181
  }
1083
1182
 
1084
1183
  function loadLessonsPageHtml(req, expectedApiKey) {
1085
- const template = fs.readFileSync(LESSONS_PAGE_PATH, 'utf-8');
1086
- const forwardedHost = req.headers['x-forwarded-host'];
1087
- const hostHeader = Array.isArray(forwardedHost)
1088
- ? forwardedHost[0]
1089
- : forwardedHost || req.headers.host || '';
1090
- const localProBootstrap = process.env.THUMBGATE_PRO_MODE === '1' && Boolean(expectedApiKey) && isLoopbackHost(hostHeader);
1091
- const devOverride = expectedApiKey === null && isLoopbackHost(hostHeader);
1092
- const bootstrapActive = localProBootstrap || devOverride;
1093
- const serializedBootstrapKey = JSON.stringify(localProBootstrap ? expectedApiKey : devOverride ? 'dev-override' : '').replace(/</g, '\\u003c');
1184
+ const bootstrap = resolveLocalPageBootstrap(req, expectedApiKey);
1185
+ const template = readOptionalPublicTemplate(LESSONS_PAGE_PATH);
1186
+ if (!template) return renderPackagedLessonsHtml(bootstrap);
1094
1187
 
1095
1188
  return fillTemplate(template, {
1096
- '__LESSONS_BOOTSTRAP_KEY__': serializedBootstrapKey,
1097
- '__LESSONS_BOOTSTRAP_ENABLED__': bootstrapActive ? 'true' : 'false',
1189
+ '__LESSONS_BOOTSTRAP_KEY__': bootstrap.serializedBootstrapKey,
1190
+ '__LESSONS_BOOTSTRAP_ENABLED__': bootstrap.bootstrapActive ? 'true' : 'false',
1098
1191
  });
1099
1192
  }
1100
1193
 
@@ -5079,6 +5172,10 @@ module.exports = {
5079
5172
  getPosthogProxyPath,
5080
5173
  isAllowedPosthogProxyPath,
5081
5174
  renderSitemapXml,
5175
+ renderPackagedDashboardHtml,
5176
+ renderPackagedLessonsHtml,
5177
+ readOptionalPublicTemplate,
5178
+ resolveLocalPageBootstrap,
5082
5179
  },
5083
5180
  };
5084
5181
 
package/src/index.js ADDED
@@ -0,0 +1,3 @@
1
+ 'use strict';
2
+
3
+ module.exports = require('../scripts/feedback-loop');
Binary file
@@ -1,18 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" role="img" aria-labelledby="title desc">
2
- <title>ThumbGate</title>
3
- <desc>Gateway icon for the Claude Desktop workflow hardening extension.</desc>
4
- <defs>
5
- <linearGradient id="bg" x1="0%" x2="100%" y1="0%" y2="100%">
6
- <stop offset="0%" stop-color="#111827"/>
7
- <stop offset="100%" stop-color="#1f2937"/>
8
- </linearGradient>
9
- <linearGradient id="gate" x1="0%" x2="100%" y1="0%" y2="100%">
10
- <stop offset="0%" stop-color="#f97316"/>
11
- <stop offset="100%" stop-color="#fb7185"/>
12
- </linearGradient>
13
- </defs>
14
- <rect width="512" height="512" rx="96" fill="url(#bg)"/>
15
- <path fill="url(#gate)" d="M152 128h208c17.7 0 32 14.3 32 32v64h-64v-32H184v128h144v-32h64v64c0 17.7-14.3 32-32 32H152c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32Z"/>
16
- <path fill="#fff4ed" d="M248 180h96v48h-48v56h48v48h-96z"/>
17
- <circle cx="196" cy="256" r="26" fill="#fef3c7"/>
18
- </svg>