thumbgate 1.4.3 → 1.4.4

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 (266) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.well-known/mcp/server-card.json +1 -1
  4. package/adapters/README.md +1 -1
  5. package/adapters/claude/.mcp.json +2 -2
  6. package/adapters/codex/config.toml +2 -2
  7. package/adapters/mcp/server-stdio.js +1 -1
  8. package/adapters/opencode/opencode.json +1 -1
  9. package/package.json +157 -9
  10. package/scripts/statusline.sh +1 -0
  11. package/src/api/server.js +113 -16
  12. package/src/index.js +3 -0
  13. package/.claude-plugin/bundle/icon.png +0 -0
  14. package/.claude-plugin/bundle/icon.svg +0 -18
  15. package/.claude-plugin/bundle/server/index.js +0 -24
  16. package/adapters/chatgpt/INSTALL.md +0 -158
  17. package/adapters/perplexity/.mcp.json +0 -36
  18. package/adapters/perplexity/config.toml +0 -16
  19. package/adapters/perplexity/opencode.json +0 -29
  20. package/bin/memory.sh +0 -64
  21. package/bin/obsidian-sync.sh +0 -20
  22. package/plugins/amp-skill/INSTALL.md +0 -52
  23. package/plugins/amp-skill/SKILL.md +0 -64
  24. package/plugins/claude-codex-bridge/.claude-plugin/plugin.json +0 -22
  25. package/plugins/claude-codex-bridge/.mcp.json +0 -14
  26. package/plugins/claude-codex-bridge/INSTALL.md +0 -43
  27. package/plugins/claude-codex-bridge/README.md +0 -46
  28. package/plugins/claude-codex-bridge/scripts/codex-bridge.js +0 -286
  29. package/plugins/claude-codex-bridge/skills/adversarial-review/SKILL.md +0 -24
  30. package/plugins/claude-codex-bridge/skills/result/SKILL.md +0 -22
  31. package/plugins/claude-codex-bridge/skills/review/SKILL.md +0 -28
  32. package/plugins/claude-codex-bridge/skills/second-pass/SKILL.md +0 -27
  33. package/plugins/claude-codex-bridge/skills/setup/SKILL.md +0 -21
  34. package/plugins/claude-codex-bridge/skills/status/SKILL.md +0 -19
  35. package/plugins/claude-skill/INSTALL.md +0 -55
  36. package/plugins/claude-skill/SKILL.md +0 -46
  37. package/plugins/codex-profile/.codex-plugin/plugin.json +0 -43
  38. package/plugins/codex-profile/.mcp.json +0 -14
  39. package/plugins/codex-profile/AGENTS.md +0 -20
  40. package/plugins/codex-profile/INSTALL.md +0 -89
  41. package/plugins/codex-profile/README.md +0 -61
  42. package/plugins/cursor-marketplace/.cursor-plugin/plugin.json +0 -23
  43. package/plugins/cursor-marketplace/CHANGELOG.md +0 -30
  44. package/plugins/cursor-marketplace/LICENSE +0 -21
  45. package/plugins/cursor-marketplace/README.md +0 -124
  46. package/plugins/cursor-marketplace/agents/reliability-reviewer.md +0 -31
  47. package/plugins/cursor-marketplace/assets/logo-400x400.png +0 -0
  48. package/plugins/cursor-marketplace/commands/capture-feedback.md +0 -33
  49. package/plugins/cursor-marketplace/commands/check-gates.md +0 -25
  50. package/plugins/cursor-marketplace/commands/show-lessons.md +0 -27
  51. package/plugins/cursor-marketplace/hooks/hooks.json +0 -10
  52. package/plugins/cursor-marketplace/mcp.json +0 -14
  53. package/plugins/cursor-marketplace/rules/feedback-capture.mdc +0 -34
  54. package/plugins/cursor-marketplace/rules/pre-action-gates.mdc +0 -30
  55. package/plugins/cursor-marketplace/rules/session-continuity.mdc +0 -28
  56. package/plugins/cursor-marketplace/scripts/gate-check.sh +0 -21
  57. package/plugins/cursor-marketplace/skills/capture-feedback/SKILL.md +0 -48
  58. package/plugins/cursor-marketplace/skills/prevention-rules/SKILL.md +0 -31
  59. package/plugins/cursor-marketplace/skills/recall-context/SKILL.md +0 -30
  60. package/plugins/cursor-marketplace/skills/search-lessons/SKILL.md +0 -33
  61. package/plugins/gemini-extension/INSTALL.md +0 -92
  62. package/plugins/gemini-extension/gemini_prompt.txt +0 -14
  63. package/plugins/gemini-extension/tool_contract.json +0 -45
  64. package/plugins/opencode-profile/INSTALL.md +0 -57
  65. package/public/assets/instagram-card.png +0 -0
  66. package/public/assets/tiktok-agent-memory.mp4 +0 -0
  67. package/public/blog.html +0 -474
  68. package/public/compare/mem0.html +0 -189
  69. package/public/compare/speclock.html +0 -180
  70. package/public/compare.html +0 -310
  71. package/public/dashboard.html +0 -1100
  72. package/public/guide.html +0 -317
  73. package/public/guides/claude-code-prevent-repeated-mistakes.html +0 -161
  74. package/public/guides/codex-cli-guardrails.html +0 -158
  75. package/public/guides/cursor-prevent-repeated-mistakes.html +0 -161
  76. package/public/guides/pre-action-gates.html +0 -162
  77. package/public/guides/stop-repeated-ai-agent-mistakes.html +0 -159
  78. package/public/index.html +0 -1225
  79. package/public/js/buyer-intent.js +0 -252
  80. package/public/learn/agent-harness-pattern.html +0 -180
  81. package/public/learn/ai-agent-persistent-memory.html +0 -203
  82. package/public/learn/learn.css +0 -45
  83. package/public/learn/mcp-pre-action-gates-explained.html +0 -172
  84. package/public/learn/stop-ai-agent-force-push.html +0 -134
  85. package/public/learn/vibe-coding-safety-net.html +0 -142
  86. package/public/learn.html +0 -274
  87. package/public/lessons.html +0 -967
  88. package/public/llm-context.md +0 -156
  89. package/public/pro.html +0 -1087
  90. package/public/vercel.json +0 -8
  91. package/scripts/a2ui-engine.js +0 -73
  92. package/scripts/adk-consolidator.js +0 -274
  93. package/scripts/agent-security-hardening.js +0 -225
  94. package/scripts/ai-search-visibility.js +0 -116
  95. package/scripts/autonomous-sales-agent.js +0 -39
  96. package/scripts/autoresearch-runner.js +0 -216
  97. package/scripts/background-agent-governance.js +0 -229
  98. package/scripts/behavioral-extraction.js +0 -93
  99. package/scripts/budget-enforcer.js +0 -173
  100. package/scripts/budget-guard.js +0 -173
  101. package/scripts/build-claude-mcpb.js +0 -255
  102. package/scripts/build-codex-plugin.js +0 -152
  103. package/scripts/capture-railway-diagnostics.sh +0 -97
  104. package/scripts/changeset-check.js +0 -372
  105. package/scripts/check-congruence.js +0 -443
  106. package/scripts/computer-use-firewall.js +0 -280
  107. package/scripts/content-engine/linkedin-content-generator.js +0 -154
  108. package/scripts/content-engine/output/linkedin-memento-validation.md +0 -17
  109. package/scripts/content-engine/output/linkedin-posts-2026-04-09.md +0 -175
  110. package/scripts/content-engine/reddit-thread-finder.js +0 -154
  111. package/scripts/context-engine.js +0 -710
  112. package/scripts/daily-digest.js +0 -11
  113. package/scripts/data-governance.js +0 -173
  114. package/scripts/deploy-gcp.sh +0 -44
  115. package/scripts/deploy-policy.js +0 -249
  116. package/scripts/disagreement-mining.js +0 -315
  117. package/scripts/dpo-optimizer.js +0 -206
  118. package/scripts/ensure-repo-bootstrap.js +0 -130
  119. package/scripts/ephemeral-agent-store.js +0 -212
  120. package/scripts/eval-harness.js +0 -56
  121. package/scripts/export-kto-pairs.js +0 -309
  122. package/scripts/export-training.js +0 -446
  123. package/scripts/feedback-fallback.js +0 -111
  124. package/scripts/feedback-inbox-read.js +0 -162
  125. package/scripts/feedback-root-consolidator.js +0 -233
  126. package/scripts/feedback-to-memory.js +0 -185
  127. package/scripts/gate-satisfy.js +0 -42
  128. package/scripts/generate-paperbanana-diagrams.sh +0 -99
  129. package/scripts/generate-pretool-hook.sh +0 -40
  130. package/scripts/github-about.js +0 -430
  131. package/scripts/github-outreach.js +0 -65
  132. package/scripts/gtm-revenue-loop.js +0 -535
  133. package/scripts/hallucination-detector.js +0 -226
  134. package/scripts/hf-papers.js +0 -317
  135. package/scripts/hook-auto-capture.sh +0 -100
  136. package/scripts/hook-stop-pr-thread-check.sh +0 -68
  137. package/scripts/hook-stop-self-score.sh +0 -51
  138. package/scripts/hook-stop-verify-deploy.sh +0 -31
  139. package/scripts/hook-verify-before-done.sh +0 -20
  140. package/scripts/managed-dpo-export.js +0 -91
  141. package/scripts/markdown-escape.js +0 -12
  142. package/scripts/marketing-experiment.js +0 -657
  143. package/scripts/memalign-recall.js +0 -111
  144. package/scripts/memory-migration.js +0 -296
  145. package/scripts/meta-policy.js +0 -190
  146. package/scripts/metered-billing.js +0 -16
  147. package/scripts/model-tier-router.js +0 -310
  148. package/scripts/money-watcher.js +0 -218
  149. package/scripts/multi-hop-recall.js +0 -240
  150. package/scripts/per-step-scoring.js +0 -163
  151. package/scripts/perplexity-command-center.js +0 -644
  152. package/scripts/perplexity-marketing.js +0 -454
  153. package/scripts/pii-scanner.js +0 -153
  154. package/scripts/plan-gate.js +0 -154
  155. package/scripts/post-everywhere.js +0 -341
  156. package/scripts/post-to-x-retry.sh +0 -22
  157. package/scripts/post-to-x.js +0 -369
  158. package/scripts/pr-manager.js +0 -421
  159. package/scripts/principle-extractor.js +0 -162
  160. package/scripts/pro-features.js +0 -41
  161. package/scripts/prompt-dlp.js +0 -222
  162. package/scripts/prove-adapters.js +0 -860
  163. package/scripts/prove-attribution.js +0 -361
  164. package/scripts/prove-automation.js +0 -651
  165. package/scripts/prove-autoresearch.js +0 -304
  166. package/scripts/prove-claim-verification.js +0 -277
  167. package/scripts/prove-cloudflare-sandbox.js +0 -161
  168. package/scripts/prove-data-pipeline.js +0 -408
  169. package/scripts/prove-data-quality.js +0 -227
  170. package/scripts/prove-evolution.js +0 -352
  171. package/scripts/prove-harnesses.js +0 -287
  172. package/scripts/prove-intelligence.js +0 -257
  173. package/scripts/prove-lancedb.js +0 -425
  174. package/scripts/prove-local-intelligence.js +0 -340
  175. package/scripts/prove-loop-closure.js +0 -263
  176. package/scripts/prove-packaged-runtime.js +0 -327
  177. package/scripts/prove-predictive-insights.js +0 -355
  178. package/scripts/prove-runtime.js +0 -363
  179. package/scripts/prove-seo-gsd.js +0 -234
  180. package/scripts/prove-settings.js +0 -279
  181. package/scripts/prove-subway-upgrades.js +0 -277
  182. package/scripts/prove-tessl.js +0 -229
  183. package/scripts/prove-training-export.js +0 -325
  184. package/scripts/prove-workflow-contract.js +0 -112
  185. package/scripts/prove-xmemory.js +0 -332
  186. package/scripts/publish-decision.js +0 -159
  187. package/scripts/ralph-loop.js +0 -376
  188. package/scripts/ralph-mode-ci.js +0 -434
  189. package/scripts/reddit-dm-outreach.js +0 -192
  190. package/scripts/reddit-monitor-cron.sh +0 -26
  191. package/scripts/reminder-engine.js +0 -132
  192. package/scripts/revenue-status.js +0 -472
  193. package/scripts/rotate-stripe-webhook-secret.js +0 -314
  194. package/scripts/schedule-manager.js +0 -249
  195. package/scripts/self-healing-check.js +0 -193
  196. package/scripts/session-analyzer.js +0 -533
  197. package/scripts/shieldcortex-memory-firewall-runner.mjs +0 -53
  198. package/scripts/skill-exporter.js +0 -260
  199. package/scripts/skill-materializer.js +0 -134
  200. package/scripts/skill-packs.js +0 -136
  201. package/scripts/skill-proposer.js +0 -99
  202. package/scripts/skill-quality-tracker.js +0 -282
  203. package/scripts/slow-loop.js +0 -72
  204. package/scripts/social-analytics/db/marketing-db.js +0 -179
  205. package/scripts/social-analytics/db/schema.sql +0 -55
  206. package/scripts/social-analytics/digest.js +0 -256
  207. package/scripts/social-analytics/engagement-audit.js +0 -185
  208. package/scripts/social-analytics/generate-instagram-card.js +0 -123
  209. package/scripts/social-analytics/generate-slides.js +0 -268
  210. package/scripts/social-analytics/instagram-thumbgate-post.js +0 -111
  211. package/scripts/social-analytics/install-growth-automation.js +0 -114
  212. package/scripts/social-analytics/load-env.js +0 -77
  213. package/scripts/social-analytics/mcp-server.js +0 -289
  214. package/scripts/social-analytics/normalizer.js +0 -580
  215. package/scripts/social-analytics/notify.js +0 -162
  216. package/scripts/social-analytics/poll-all.js +0 -107
  217. package/scripts/social-analytics/pollers/github.js +0 -195
  218. package/scripts/social-analytics/pollers/instagram.js +0 -253
  219. package/scripts/social-analytics/pollers/linkedin.js +0 -340
  220. package/scripts/social-analytics/pollers/plausible.js +0 -245
  221. package/scripts/social-analytics/pollers/reddit.js +0 -306
  222. package/scripts/social-analytics/pollers/threads.js +0 -233
  223. package/scripts/social-analytics/pollers/tiktok.js +0 -203
  224. package/scripts/social-analytics/pollers/x.js +0 -227
  225. package/scripts/social-analytics/pollers/youtube.js +0 -304
  226. package/scripts/social-analytics/pollers/zernio.js +0 -183
  227. package/scripts/social-analytics/post-video.js +0 -316
  228. package/scripts/social-analytics/publish-instagram-thumbgate.js +0 -104
  229. package/scripts/social-analytics/publish-thumbgate-launch.js +0 -322
  230. package/scripts/social-analytics/publishers/devto.js +0 -122
  231. package/scripts/social-analytics/publishers/instagram.js +0 -317
  232. package/scripts/social-analytics/publishers/linkedin.js +0 -294
  233. package/scripts/social-analytics/publishers/reddit.js +0 -385
  234. package/scripts/social-analytics/publishers/threads.js +0 -275
  235. package/scripts/social-analytics/publishers/tiktok.js +0 -217
  236. package/scripts/social-analytics/publishers/x.js +0 -259
  237. package/scripts/social-analytics/publishers/youtube.js +0 -223
  238. package/scripts/social-analytics/publishers/zernio.js +0 -568
  239. package/scripts/social-analytics/reconcile-thumbgate-campaign.js +0 -165
  240. package/scripts/social-analytics/run-digest.js +0 -34
  241. package/scripts/social-analytics/schedule-thumbgate-campaign.js +0 -275
  242. package/scripts/social-analytics/store.js +0 -455
  243. package/scripts/social-analytics/sync-launch-assets.js +0 -185
  244. package/scripts/social-analytics/utm.js +0 -143
  245. package/scripts/social-pipeline.js +0 -2626
  246. package/scripts/social-post-hourly.js +0 -228
  247. package/scripts/social-quality-gate.js +0 -134
  248. package/scripts/social-reply-monitor.js +0 -592
  249. package/scripts/status-dashboard.js +0 -155
  250. package/scripts/stripe-live-status.js +0 -115
  251. package/scripts/subagent-profiles.js +0 -79
  252. package/scripts/sync-branch-protection.js +0 -340
  253. package/scripts/sync-gh-secrets-from-env.sh +0 -70
  254. package/scripts/sync-github-about.js +0 -55
  255. package/scripts/sync-version.js +0 -479
  256. package/scripts/synthetic-dpo.js +0 -234
  257. package/scripts/tessl-export.js +0 -369
  258. package/scripts/test-coverage.js +0 -128
  259. package/scripts/thumbgate-bench.js +0 -494
  260. package/scripts/thumbgate_session_start.sh +0 -32
  261. package/scripts/train_from_feedback.py +0 -929
  262. package/scripts/validate-feedback.js +0 -581
  263. package/scripts/verify-obsidian-setup.sh +0 -269
  264. package/scripts/verify-run.js +0 -269
  265. package/scripts/weekly-auto-post.js +0 -124
  266. package/scripts/x-autonomous-marketing.js +0 -139
@@ -1,99 +0,0 @@
1
- #!/usr/bin/env bash
2
- set -euo pipefail
3
-
4
- ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
5
- cd "$ROOT_DIR"
6
-
7
- if [[ -f .env.paperbanana ]]; then
8
- # shellcheck source=/dev/null
9
- source .env.paperbanana
10
- fi
11
-
12
- if [[ ! -f .env ]]; then
13
- echo "Missing .env. Add GEMINI_API_KEY first."
14
- exit 1
15
- fi
16
-
17
- # shellcheck source=/dev/null
18
- source .env
19
-
20
- if [[ -z "${GOOGLE_API_KEY:-}" && -z "${GEMINI_API_KEY:-}" ]]; then
21
- echo "GEMINI_API_KEY or GOOGLE_API_KEY is required in .env"
22
- exit 1
23
- fi
24
-
25
- # Prefer explicit GOOGLE_API_KEY since paperbanana/google-genai prioritizes it.
26
- if [[ -z "${GOOGLE_API_KEY:-}" ]]; then
27
- export GOOGLE_API_KEY="$GEMINI_API_KEY"
28
- fi
29
-
30
- PB_ESTIMATE_PER_DIAGRAM="${PB_ESTIMATE_PER_DIAGRAM:-0.80}"
31
- PB_MAX_ITERATIONS="${PB_MAX_ITERATIONS:-1}"
32
- PB_VLM_MODEL="${PB_VLM_MODEL:-gemini-2.5-flash}"
33
- PB_IMAGE_MODEL="${PB_IMAGE_MODEL:-gemini-3-pro-image-preview}"
34
-
35
- budget_check() {
36
- local estimate="$1"
37
- node -e '
38
- const { getBudgetStatus } = require("./scripts/budget-guard");
39
- const est = Number(process.argv[1]);
40
- const s = getBudgetStatus();
41
- const projected = s.totalUsd + est;
42
- if (projected > s.budgetUsd) {
43
- console.error(`Blocked: projected spend ${projected.toFixed(2)} exceeds budget ${s.budgetUsd.toFixed(2)} USD`);
44
- process.exit(3);
45
- }
46
- ' "$estimate"
47
- }
48
-
49
- mkdir -p docs/diagrams
50
-
51
- cat > docs/diagrams/thumbgate-architecture.txt <<'TXT'
52
- The system starts when a user gives explicit thumbs up/down feedback. A capture layer enriches the signal with context and tags.
53
- An action resolver maps the signal to store-learning, store-mistake, or no-action.
54
- A schema validator enforces strict structure before memory promotion.
55
- Valid records are stored in a local memory log categorized as error or learning.
56
- An analytics layer computes quality trends and recurrence patterns.
57
- A prevention-rule engine converts repeated mistakes into hard guardrails.
58
- A DPO export layer pairs learning and error memories into prompt/chosen/rejected JSONL.
59
- All channels (ChatGPT Actions, Claude MCP, Codex MCP, Gemini tools, Amp skills) route through one shared API and policy core.
60
- TXT
61
-
62
- cat > docs/diagrams/plugin-topology.txt <<'TXT'
63
- Show a central ThumbGate Feedback API with five adapters around it.
64
- Adapter 1: ChatGPT via GPT Actions OpenAPI.
65
- Adapter 2: Claude via local MCP server and .mcp.json.
66
- Adapter 3: Codex via MCP server config.toml.
67
- Adapter 4: Gemini via function-calling tool declarations.
68
- Adapter 5: Amp via skills template.
69
- Include bidirectional arrows from each adapter to the API.
70
- Under the API place three internal modules: schema validation, prevention rules, and DPO export.
71
- Add a budget guard module enforcing a strict monthly cost cap of 10 USD.
72
- TXT
73
-
74
- budget_check "$PB_ESTIMATE_PER_DIAGRAM"
75
- paperbanana generate \
76
- --input docs/diagrams/thumbgate-architecture.txt \
77
- --caption "ThumbGate architecture for AI coding agents with schema gate, memory store, prevention rules, and DPO export" \
78
- --vlm-provider gemini \
79
- --vlm-model "$PB_VLM_MODEL" \
80
- --image-provider google_imagen \
81
- --image-model "$PB_IMAGE_MODEL" \
82
- --iterations "$PB_MAX_ITERATIONS" \
83
- --output docs/diagrams/thumbgate-architecture.png
84
- node scripts/budget-guard.js --add="$PB_ESTIMATE_PER_DIAGRAM" --source=paperbanana --note="architecture-overview"
85
-
86
- budget_check "$PB_ESTIMATE_PER_DIAGRAM"
87
- paperbanana generate \
88
- --input docs/diagrams/plugin-topology.txt \
89
- --caption "Go-to-market plugin topology: ChatGPT Actions, Claude MCP, Codex MCP, Gemini function calling, and Amp skills through one ThumbGate API core" \
90
- --vlm-provider gemini \
91
- --vlm-model "$PB_VLM_MODEL" \
92
- --image-provider google_imagen \
93
- --image-model "$PB_IMAGE_MODEL" \
94
- --iterations "$PB_MAX_ITERATIONS" \
95
- --output docs/diagrams/plugin-topology.png
96
- node scripts/budget-guard.js --add="$PB_ESTIMATE_PER_DIAGRAM" --source=paperbanana --note="plugin-topology"
97
-
98
- echo "Generated diagrams:"
99
- ls -la docs/diagrams/*.png
@@ -1,40 +0,0 @@
1
- #!/usr/bin/env bash
2
- # generate-pretool-hook.sh — PreToolUse hook for ThumbGate gate checking.
3
- #
4
- # Installed as a Claude Code / Codex / Gemini PreToolUse hook.
5
- # Reads tool call JSON from stdin, pipes it to the gate-check engine,
6
- # and outputs the result (allow/block with reason).
7
- #
8
- # Exit codes:
9
- # 0 = allow (or gate-check unavailable — fail open)
10
- # 2 = block (gate-check returned a block verdict)
11
-
12
- set -euo pipefail
13
-
14
- INPUT=$(cat)
15
-
16
- # Resolve the gate-check command.
17
- # Prefer local node path if inside the repo, otherwise use npx.
18
- SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
19
- GATE_ENGINE="$SCRIPT_DIR/gates-engine.js"
20
-
21
- if [ -f "$GATE_ENGINE" ]; then
22
- RESULT=$(echo "$INPUT" | node "$GATE_ENGINE" 2>/dev/null) || true
23
- else
24
- RESULT=$(echo "$INPUT" | npx -y thumbgate@latest gate-check 2>/dev/null) || true
25
- fi
26
-
27
- # If no result, fail open (allow)
28
- if [ -z "$RESULT" ]; then
29
- exit 0
30
- fi
31
-
32
- # Output the result for the agent to consume
33
- echo "$RESULT"
34
-
35
- # Check if blocked
36
- if echo "$RESULT" | grep -q '"permissionDecision":\s*"deny"'; then
37
- exit 2
38
- fi
39
-
40
- exit 0
@@ -1,430 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- const fs = require('node:fs');
5
- const path = require('node:path');
6
- const { execFileSync } = require('node:child_process');
7
- const {
8
- getClaudePluginLatestDownloadUrl,
9
- } = require('./distribution-surfaces');
10
-
11
- const ROOT = path.join(__dirname, '..');
12
- const CONFIG_RELATIVE_PATH = path.join('config', 'github-about.json');
13
- const LEGACY_REPOSITORY_URL = 'https://github.com/IgorGanapolsky/thumbgate';
14
- const GITHUB_API_BASE_URL = 'https://api.github.com';
15
- const DEFAULT_VERIFY_ATTEMPTS = 5;
16
- const DEFAULT_VERIFY_DELAY_MS = 2000;
17
- const MAX_GITHUB_DESCRIPTION_LENGTH = 160;
18
- const VERIFY_ATTEMPTS_ENV = 'THUMBGATE_GITHUB_ABOUT_VERIFY_ATTEMPTS';
19
- const VERIFY_DELAY_MS_ENV = 'THUMBGATE_GITHUB_ABOUT_VERIFY_DELAY_MS';
20
-
21
- function readText(root, relativePath) {
22
- return fs.readFileSync(path.join(root, relativePath), 'utf8');
23
- }
24
-
25
- function readJson(root, relativePath) {
26
- return JSON.parse(readText(root, relativePath));
27
- }
28
-
29
- function normalizeText(value) {
30
- return String(value || '').replace(/\s+/g, ' ').trim();
31
- }
32
-
33
- function normalizeTopics(topics) {
34
- return [...new Set((topics || []).map((topic) => normalizeText(topic).toLowerCase()).filter(Boolean))].sort();
35
- }
36
-
37
- function normalizeUrl(value) {
38
- const text = normalizeText(value);
39
- if (!text) return '';
40
- try {
41
- const parsed = new URL(text);
42
- return `${parsed.protocol}//${parsed.host}${parsed.pathname.replace(/\/+$/, '')}`;
43
- } catch {
44
- return text.replace(/\/+$/, '');
45
- }
46
- }
47
-
48
- function extractUrls(text) {
49
- return (String(text || '').match(/https?:\/\/[^\s"'`<>]+/g) || []).map((url) => normalizeUrl(url));
50
- }
51
-
52
- function hasExactUrl(text, targetUrl) {
53
- const normalizedTarget = normalizeUrl(targetUrl);
54
- return extractUrls(text).includes(normalizedTarget);
55
- }
56
-
57
- function hasRepositoryUrl(text, targetUrl) {
58
- const normalizedTarget = normalizeUrl(targetUrl);
59
- return extractUrls(text).some((candidate) => (
60
- candidate === normalizedTarget ||
61
- candidate.startsWith(`${normalizedTarget}/`) ||
62
- candidate.startsWith(`${normalizedTarget}?`) ||
63
- candidate.startsWith(`${normalizedTarget}#`)
64
- ));
65
- }
66
-
67
- function loadGitHubAboutConfig(root = ROOT) {
68
- const about = readJson(root, CONFIG_RELATIVE_PATH);
69
- const metaDescription = normalizeText(about.metaDescription || about.description);
70
- const githubDescription = normalizeText(about.githubDescription || about.description);
71
- return {
72
- repo: normalizeText(about.repo),
73
- repositoryUrl: normalizeText(about.repositoryUrl),
74
- homepageUrl: normalizeText(about.homepageUrl),
75
- githubDescription,
76
- metaDescription,
77
- topics: normalizeTopics(about.topics),
78
- };
79
- }
80
-
81
- function buildCanonicalRepoUrls(about) {
82
- return {
83
- repositoryUrl: about.repositoryUrl,
84
- repositoryGitUrl: `${about.repositoryUrl}.git`,
85
- issuesUrl: `${about.repositoryUrl}/issues`,
86
- actionsUrl: `${about.repositoryUrl}/actions`,
87
- licenseUrl: `${about.repositoryUrl}/blob/main/LICENSE`,
88
- quickStartUrl: `${about.repositoryUrl}#quick-start`,
89
- pluginsUrl: `${about.repositoryUrl}/tree/main/plugins`,
90
- readmeImageUrl: `https://raw.githubusercontent.com/${about.repo}/main/docs/diagrams/thumbgate-architecture-pb.png`,
91
- verificationEvidenceUrl: `${about.repositoryUrl}/blob/main/docs/VERIFICATION_EVIDENCE.md`,
92
- compatibilityReportUrl: `${about.repositoryUrl}/blob/main/proof/compatibility/report.json`,
93
- automationReportUrl: `${about.repositoryUrl}/blob/main/proof/automation/report.json`,
94
- gtmPlanUrl: `${about.repositoryUrl}/blob/main/docs/GO_TO_MARKET_REVENUE_WEDGE_2026-03.md`,
95
- sprintBriefUrl: `${about.repositoryUrl}/blob/main/docs/WORKFLOW_HARDENING_SPRINT.md`,
96
- };
97
- }
98
-
99
- function extractMetaDescription(html) {
100
- const match = html.match(/<meta\s+name="description"\s+content="([^"]+)"/i);
101
- return match ? normalizeText(match[1]) : '';
102
- }
103
-
104
- function compareGitHubAbout(expected, actual, label = 'Live GitHub About') {
105
- const errors = [];
106
- const actualDescription = normalizeText(actual.description);
107
- const actualHomepage = normalizeText(actual.homepageUrl || actual.homepage);
108
- const actualTopics = normalizeTopics(actual.topics);
109
-
110
- if (actualDescription !== expected.githubDescription) {
111
- errors.push(`${label} description mismatch`);
112
- }
113
- if (actualHomepage !== expected.homepageUrl) {
114
- errors.push(`${label} homepage mismatch`);
115
- }
116
- if (JSON.stringify(actualTopics) !== JSON.stringify(expected.topics)) {
117
- errors.push(`${label} topics mismatch`);
118
- }
119
-
120
- return errors;
121
- }
122
-
123
- function collectLocalGitHubAboutErrors(root = ROOT) {
124
- const about = loadGitHubAboutConfig(root);
125
- const canonical = buildCanonicalRepoUrls(about);
126
- const landingHtml = readText(root, 'public/index.html');
127
- const readme = readText(root, 'README.md');
128
- const packageJson = readJson(root, 'package.json');
129
- const serverManifest = readJson(root, 'server.json');
130
- const appManifest = readJson(root, path.join('.github', 'github-app-manifest.json'));
131
- const marketingCopy = readText(root, path.join('docs', 'MARKETING_COPY_CONGRUENCE.md'));
132
- const claude = readText(root, 'CLAUDE.md');
133
- const serverSource = readText(root, path.join('src', 'api', 'server.js'));
134
- const claudePluginManifest = readJson(root, path.join('.claude-plugin', 'plugin.json'));
135
- const claudePluginMarketplace = readJson(root, path.join('.claude-plugin', 'marketplace.json'));
136
- const claudePluginReadme = readText(root, path.join('.claude-plugin', 'README.md'));
137
- const errors = [];
138
-
139
- function check(condition, message) {
140
- if (!condition) errors.push(message);
141
- }
142
-
143
- check(
144
- extractMetaDescription(landingHtml) === about.metaDescription,
145
- 'config/github-about.json metaDescription must match public/index.html meta description'
146
- );
147
- check(
148
- about.githubDescription.length <= MAX_GITHUB_DESCRIPTION_LENGTH,
149
- `config/github-about.json githubDescription must be ${MAX_GITHUB_DESCRIPTION_LENGTH} characters or fewer for GitHub repo metadata`
150
- );
151
- check(
152
- packageJson.homepage === about.homepageUrl,
153
- `package.json homepage must match ${about.homepageUrl}`
154
- );
155
- check(
156
- packageJson.repository.url === canonical.repositoryGitUrl,
157
- `package.json repository.url must match ${canonical.repositoryGitUrl}`
158
- );
159
- check(
160
- packageJson.bugs.url === canonical.issuesUrl,
161
- `package.json bugs.url must match ${canonical.issuesUrl}`
162
- );
163
- check(
164
- serverManifest.websiteUrl === about.homepageUrl,
165
- `server.json websiteUrl must match ${about.homepageUrl}`
166
- );
167
- check(
168
- serverManifest.repository.url === about.repositoryUrl,
169
- `server.json repository.url must match ${about.repositoryUrl}`
170
- );
171
- check(
172
- hasRepositoryUrl(landingHtml, canonical.repositoryUrl),
173
- `public/index.html must link to ${canonical.repositoryUrl}`
174
- );
175
- check(
176
- !hasRepositoryUrl(landingHtml, LEGACY_REPOSITORY_URL),
177
- 'public/index.html still links to the legacy GitHub repo URL'
178
- );
179
- check(
180
- hasRepositoryUrl(readme, canonical.repositoryUrl),
181
- `README.md must link to ${canonical.repositoryUrl}`
182
- );
183
- check(
184
- !hasRepositoryUrl(readme, LEGACY_REPOSITORY_URL),
185
- 'README.md still links to the legacy GitHub repo URL'
186
- );
187
- check(
188
- marketingCopy.includes('config/github-about.json'),
189
- 'docs/MARKETING_COPY_CONGRUENCE.md must reference config/github-about.json as the source of truth'
190
- );
191
- check(
192
- marketingCopy.includes(about.metaDescription),
193
- 'docs/MARKETING_COPY_CONGRUENCE.md must include the canonical landing meta description'
194
- );
195
- check(
196
- marketingCopy.includes(about.githubDescription),
197
- 'docs/MARKETING_COPY_CONGRUENCE.md must include the canonical GitHub About description'
198
- );
199
- check(
200
- claude.includes(`REPO = ${about.repo}`),
201
- `CLAUDE.md must declare REPO = ${about.repo}`
202
- );
203
- check(
204
- appManifest.url === about.homepageUrl,
205
- `.github/github-app-manifest.json url must match ${about.homepageUrl}`
206
- );
207
- check(
208
- /pre-action gates/i.test(appManifest.description),
209
- '.github/github-app-manifest.json description must mention pre-action gates'
210
- );
211
- check(
212
- !/persistent memory/i.test(appManifest.description),
213
- '.github/github-app-manifest.json description must not use stale persistent-memory positioning'
214
- );
215
- check(
216
- hasRepositoryUrl(serverSource, canonical.repositoryUrl),
217
- `src/api/server.js must link to ${canonical.repositoryUrl}`
218
- );
219
- check(
220
- !hasRepositoryUrl(serverSource, LEGACY_REPOSITORY_URL),
221
- 'src/api/server.js still links to the legacy GitHub repo URL'
222
- );
223
- check(
224
- normalizeUrl(claudePluginManifest.homepage) === about.homepageUrl,
225
- `.claude-plugin/plugin.json homepage must match ${about.homepageUrl}`
226
- );
227
- check(
228
- normalizeUrl(claudePluginManifest.repository) === about.repositoryUrl,
229
- `.claude-plugin/plugin.json repository must match ${about.repositoryUrl}`
230
- );
231
- check(
232
- normalizeUrl(claudePluginMarketplace.plugins[0].metadata.homepage) === about.homepageUrl,
233
- `.claude-plugin/marketplace.json metadata.homepage must match ${about.homepageUrl}`
234
- );
235
- check(
236
- hasRepositoryUrl(claudePluginReadme, canonical.repositoryUrl),
237
- `.claude-plugin/README.md must link to ${canonical.repositoryUrl}`
238
- );
239
- check(
240
- !hasRepositoryUrl(claudePluginReadme, LEGACY_REPOSITORY_URL),
241
- '.claude-plugin/README.md still links to the legacy GitHub repo URL'
242
- );
243
- check(
244
- hasExactUrl(claudePluginReadme, getClaudePluginLatestDownloadUrl(root)),
245
- '.claude-plugin/README.md must link to the latest Claude plugin bundle download'
246
- );
247
-
248
- return errors;
249
- }
250
-
251
- function resolveGitHubToken(explicitToken) {
252
- return normalizeText(explicitToken || process.env.GITHUB_TOKEN || process.env.GH_TOKEN || process.env.GH_PAT) || null;
253
- }
254
-
255
- function buildGitHubApiHeaders(token) {
256
- const headers = {
257
- 'Accept': 'application/vnd.github+json',
258
- 'Content-Type': 'application/json',
259
- 'User-Agent': 'thumbgate-github-about-sync',
260
- 'X-GitHub-Api-Version': '2022-11-28',
261
- };
262
- if (token) headers.Authorization = `Bearer ${token}`;
263
- return headers;
264
- }
265
-
266
- async function parseGitHubError(response) {
267
- try {
268
- const payload = await response.json();
269
- return payload.message || JSON.stringify(payload);
270
- } catch {
271
- return response.statusText || `HTTP ${response.status}`;
272
- }
273
- }
274
-
275
- async function fetchLiveGitHubAbout(options = {}) {
276
- const about = loadGitHubAboutConfig(options.root || ROOT);
277
- const repo = normalizeText(options.repo) || about.repo;
278
- const token = resolveGitHubToken(options.token);
279
-
280
- if (!token) {
281
- try {
282
- const ghPayload = execFileSync('gh', ['api', `repos/${repo}`], {
283
- encoding: 'utf8',
284
- stdio: ['ignore', 'pipe', 'ignore'],
285
- });
286
- const payload = JSON.parse(ghPayload);
287
- return {
288
- repo,
289
- description: normalizeText(payload.description),
290
- homepageUrl: normalizeText(payload.homepage),
291
- topics: normalizeTopics(payload.topics),
292
- };
293
- } catch {
294
- // Fall back to the public REST API when GitHub CLI auth is unavailable.
295
- }
296
- }
297
-
298
- const response = await fetch(`${GITHUB_API_BASE_URL}/repos/${repo}`, {
299
- headers: buildGitHubApiHeaders(token),
300
- });
301
-
302
- if (!response.ok) {
303
- throw new Error(`GitHub repo metadata fetch failed for ${repo}: ${response.status} ${await parseGitHubError(response)}`);
304
- }
305
-
306
- const payload = await response.json();
307
- return {
308
- repo,
309
- description: normalizeText(payload.description),
310
- homepageUrl: normalizeText(payload.homepage),
311
- topics: normalizeTopics(payload.topics),
312
- };
313
- }
314
-
315
- function normalizePositiveInteger(value, fallback) {
316
- const parsed = Number.parseInt(value, 10);
317
- return Number.isFinite(parsed) && parsed > 0 ? parsed : fallback;
318
- }
319
-
320
- function resolveVerifySetting(optionValue, envName, fallback) {
321
- if (optionValue !== undefined) {
322
- return normalizePositiveInteger(optionValue, fallback);
323
- }
324
- return normalizePositiveInteger(process.env[envName], fallback);
325
- }
326
-
327
- function sleep(delayMs) {
328
- return new Promise((resolve) => {
329
- setTimeout(resolve, delayMs);
330
- });
331
- }
332
-
333
- async function verifyLiveGitHubAbout(options = {}) {
334
- const root = options.root || ROOT;
335
- const expected = options.expected || loadGitHubAboutConfig(root);
336
- const repo = normalizeText(options.repo) || expected.repo;
337
- const label = options.label || `Live GitHub About (${repo})`;
338
- const attempts = resolveVerifySetting(options.attempts, VERIFY_ATTEMPTS_ENV, DEFAULT_VERIFY_ATTEMPTS);
339
- const delayMs = resolveVerifySetting(options.delayMs, VERIFY_DELAY_MS_ENV, DEFAULT_VERIFY_DELAY_MS);
340
- const fetcher = typeof options.fetcher === 'function' ? options.fetcher : fetchLiveGitHubAbout;
341
- const sleeper = typeof options.sleep === 'function' ? options.sleep : sleep;
342
- let actual = null;
343
- let errors = [];
344
-
345
- for (let attempt = 1; attempt <= attempts; attempt += 1) {
346
- actual = await fetcher({
347
- root,
348
- repo,
349
- token: options.token,
350
- });
351
- errors = compareGitHubAbout(expected, actual, label);
352
- if (errors.length === 0) {
353
- return {
354
- ok: true,
355
- actual,
356
- attemptsUsed: attempt,
357
- errors: [],
358
- };
359
- }
360
- if (attempt < attempts) {
361
- await sleeper(delayMs * attempt);
362
- }
363
- }
364
-
365
- return {
366
- ok: false,
367
- actual,
368
- attemptsUsed: attempts,
369
- errors,
370
- };
371
- }
372
-
373
- async function updateLiveGitHubAbout(options = {}) {
374
- const about = loadGitHubAboutConfig(options.root || ROOT);
375
- const repo = normalizeText(options.repo) || about.repo;
376
- const token = resolveGitHubToken(options.token);
377
-
378
- if (!token) {
379
- throw new Error('GITHUB_TOKEN, GH_TOKEN, or GH_PAT is required to update live GitHub About metadata');
380
- }
381
-
382
- const repoResponse = await fetch(`${GITHUB_API_BASE_URL}/repos/${repo}`, {
383
- method: 'PATCH',
384
- headers: buildGitHubApiHeaders(token),
385
- body: JSON.stringify({
386
- description: about.githubDescription,
387
- homepage: about.homepageUrl,
388
- }),
389
- });
390
-
391
- if (!repoResponse.ok) {
392
- throw new Error(`GitHub repo metadata update failed for ${repo}: ${repoResponse.status} ${await parseGitHubError(repoResponse)}`);
393
- }
394
-
395
- const topicsResponse = await fetch(`${GITHUB_API_BASE_URL}/repos/${repo}/topics`, {
396
- method: 'PUT',
397
- headers: buildGitHubApiHeaders(token),
398
- body: JSON.stringify({
399
- names: about.topics,
400
- }),
401
- });
402
-
403
- if (!topicsResponse.ok) {
404
- throw new Error(`GitHub repo topics update failed for ${repo}: ${topicsResponse.status} ${await parseGitHubError(topicsResponse)}`);
405
- }
406
-
407
- return about;
408
- }
409
-
410
- module.exports = {
411
- DEFAULT_VERIFY_ATTEMPTS,
412
- DEFAULT_VERIFY_DELAY_MS,
413
- LEGACY_REPOSITORY_URL,
414
- MAX_GITHUB_DESCRIPTION_LENGTH,
415
- VERIFY_ATTEMPTS_ENV,
416
- VERIFY_DELAY_MS_ENV,
417
- buildCanonicalRepoUrls,
418
- collectLocalGitHubAboutErrors,
419
- compareGitHubAbout,
420
- extractMetaDescription,
421
- fetchLiveGitHubAbout,
422
- hasExactUrl,
423
- hasRepositoryUrl,
424
- loadGitHubAboutConfig,
425
- normalizeText,
426
- normalizeTopics,
427
- normalizeUrl,
428
- updateLiveGitHubAbout,
429
- verifyLiveGitHubAbout,
430
- };
@@ -1,65 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * github-outreach.js
4
- * Scans recent GitHub activity for developers working with MCP (Model Context Protocol)
5
- * and generates targeted outreach messages pointing to the sprint intake.
6
- */
7
-
8
- 'use strict';
9
-
10
- const { spawnSync } = require('child_process');
11
- const fs = require('fs');
12
- const path = require('path');
13
- const { resolveHostedBillingConfig } = require('./hosted-config');
14
-
15
- const APP_ORIGIN = resolveHostedBillingConfig({
16
- requestOrigin: 'https://thumbgate-production.up.railway.app',
17
- }).appOrigin;
18
- const SPRINT_LINK = `${APP_ORIGIN}/#workflow-sprint-intake`;
19
-
20
- function runGH(args) {
21
- const result = spawnSync('gh', ['api', ...args], { encoding: 'utf-8' });
22
- if (result.status !== 0) {
23
- console.error(`GH API Error: ${result.stderr}`);
24
- return null;
25
- }
26
- return JSON.parse(result.stdout);
27
- }
28
-
29
- function findMCPDevelopers() {
30
- console.log('🔍 Scanning GitHub for recent MCP developers...');
31
- // Search for recent repos with MCP in the name or description
32
- const searchResult = runGH(['search/repositories?q=MCP+Model+Context+Protocol&sort=updated']);
33
-
34
- if (!searchResult || !searchResult.items) {
35
- console.log('No recent MCP activity found or API rate limited.');
36
- return [];
37
- }
38
-
39
- const targets = searchResult.items.slice(0, 5).map(repo => ({
40
- username: repo.owner.login,
41
- repoName: repo.name,
42
- repoUrl: repo.html_url
43
- }));
44
-
45
- return targets;
46
- }
47
-
48
- function generateOutreachScript(targets) {
49
- if (targets.length === 0) return;
50
-
51
- let report = '# 🚀 First Dollar Outreach Targets\n\nSend these notes only when the target already has one workflow, one owner, and one repeated failure pattern:\n\n';
52
-
53
- targets.forEach(t => {
54
- report += `### Target: @${t.username} (Author of ${t.repoName})\n`;
55
- report += `**DM Script:**\n`;
56
- report += `> "Hey @${t.username}, saw you're building with MCP on \`${t.repoName}\`. I am not pitching another agent platform. I am pitching a Workflow Hardening Sprint for one workflow that keeps repeating the same failure pattern. If that pain is real on your side, the intake is here: ${SPRINT_LINK}"\n\n`;
57
- });
58
-
59
- const reportPath = path.join(__dirname, '../docs/OUTREACH_TARGETS.md');
60
- fs.writeFileSync(reportPath, report);
61
- console.log(`✅ Generated 5 targeted leads. Open docs/OUTREACH_TARGETS.md and send the DMs.`);
62
- }
63
-
64
- const targets = findMCPDevelopers();
65
- generateOutreachScript(targets);