thumbgate 1.4.2 → 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 (279) hide show
  1. package/.claude-plugin/README.md +45 -34
  2. package/.claude-plugin/marketplace.json +3 -3
  3. package/.claude-plugin/plugin.json +3 -3
  4. package/.well-known/llms.txt +1 -1
  5. package/.well-known/mcp/server-card.json +1 -1
  6. package/README.md +26 -2
  7. package/adapters/README.md +4 -1
  8. package/adapters/claude/.mcp.json +2 -2
  9. package/adapters/codex/config.toml +2 -2
  10. package/adapters/mcp/server-stdio.js +10 -4
  11. package/adapters/opencode/opencode.json +1 -1
  12. package/bin/cli.js +246 -90
  13. package/config/mcp-allowlists.json +11 -3
  14. package/package.json +184 -21
  15. package/scripts/audit-trail.js +25 -15
  16. package/scripts/auto-wire-hooks.js +127 -0
  17. package/scripts/cli-demo.js +102 -0
  18. package/scripts/cli-schema.js +285 -0
  19. package/scripts/cli-status.js +166 -0
  20. package/scripts/cross-encoder-reranker.js +235 -0
  21. package/scripts/explore-subcommands.js +277 -0
  22. package/scripts/explore.js +569 -0
  23. package/scripts/feedback-loop.js +20 -6
  24. package/scripts/lesson-inference.js +7 -1
  25. package/scripts/lesson-reranker.js +263 -0
  26. package/scripts/lesson-retrieval.js +34 -17
  27. package/scripts/lesson-search.js +69 -0
  28. package/scripts/perplexity-client.js +210 -0
  29. package/scripts/reflector-agent.js +2 -2
  30. package/scripts/statusline-local-stats.js +3 -1
  31. package/scripts/statusline.sh +12 -11
  32. package/src/api/server.js +178 -17
  33. package/src/index.js +3 -0
  34. package/.claude-plugin/bundle/icon.png +0 -0
  35. package/.claude-plugin/bundle/icon.svg +0 -18
  36. package/.claude-plugin/bundle/server/index.js +0 -24
  37. package/adapters/chatgpt/INSTALL.md +0 -138
  38. package/bin/memory.sh +0 -64
  39. package/bin/obsidian-sync.sh +0 -20
  40. package/plugins/amp-skill/INSTALL.md +0 -52
  41. package/plugins/amp-skill/SKILL.md +0 -64
  42. package/plugins/claude-codex-bridge/.claude-plugin/plugin.json +0 -22
  43. package/plugins/claude-codex-bridge/.mcp.json +0 -14
  44. package/plugins/claude-codex-bridge/INSTALL.md +0 -43
  45. package/plugins/claude-codex-bridge/README.md +0 -46
  46. package/plugins/claude-codex-bridge/scripts/codex-bridge.js +0 -286
  47. package/plugins/claude-codex-bridge/skills/adversarial-review/SKILL.md +0 -24
  48. package/plugins/claude-codex-bridge/skills/result/SKILL.md +0 -22
  49. package/plugins/claude-codex-bridge/skills/review/SKILL.md +0 -28
  50. package/plugins/claude-codex-bridge/skills/second-pass/SKILL.md +0 -27
  51. package/plugins/claude-codex-bridge/skills/setup/SKILL.md +0 -21
  52. package/plugins/claude-codex-bridge/skills/status/SKILL.md +0 -19
  53. package/plugins/claude-skill/INSTALL.md +0 -55
  54. package/plugins/claude-skill/SKILL.md +0 -46
  55. package/plugins/codex-profile/.codex-plugin/plugin.json +0 -43
  56. package/plugins/codex-profile/.mcp.json +0 -14
  57. package/plugins/codex-profile/AGENTS.md +0 -20
  58. package/plugins/codex-profile/INSTALL.md +0 -89
  59. package/plugins/codex-profile/README.md +0 -61
  60. package/plugins/cursor-marketplace/.cursor-plugin/plugin.json +0 -23
  61. package/plugins/cursor-marketplace/CHANGELOG.md +0 -30
  62. package/plugins/cursor-marketplace/LICENSE +0 -21
  63. package/plugins/cursor-marketplace/README.md +0 -124
  64. package/plugins/cursor-marketplace/agents/reliability-reviewer.md +0 -31
  65. package/plugins/cursor-marketplace/assets/logo-400x400.png +0 -0
  66. package/plugins/cursor-marketplace/commands/capture-feedback.md +0 -33
  67. package/plugins/cursor-marketplace/commands/check-gates.md +0 -25
  68. package/plugins/cursor-marketplace/commands/show-lessons.md +0 -27
  69. package/plugins/cursor-marketplace/hooks/hooks.json +0 -10
  70. package/plugins/cursor-marketplace/mcp.json +0 -14
  71. package/plugins/cursor-marketplace/rules/feedback-capture.mdc +0 -34
  72. package/plugins/cursor-marketplace/rules/pre-action-gates.mdc +0 -30
  73. package/plugins/cursor-marketplace/rules/session-continuity.mdc +0 -28
  74. package/plugins/cursor-marketplace/scripts/gate-check.sh +0 -21
  75. package/plugins/cursor-marketplace/skills/capture-feedback/SKILL.md +0 -48
  76. package/plugins/cursor-marketplace/skills/prevention-rules/SKILL.md +0 -31
  77. package/plugins/cursor-marketplace/skills/recall-context/SKILL.md +0 -30
  78. package/plugins/cursor-marketplace/skills/search-lessons/SKILL.md +0 -33
  79. package/plugins/gemini-extension/INSTALL.md +0 -92
  80. package/plugins/gemini-extension/gemini_prompt.txt +0 -14
  81. package/plugins/gemini-extension/tool_contract.json +0 -45
  82. package/plugins/opencode-profile/INSTALL.md +0 -57
  83. package/public/assets/instagram-card.png +0 -0
  84. package/public/assets/tiktok-agent-memory.mp4 +0 -0
  85. package/public/blog.html +0 -474
  86. package/public/compare/mem0.html +0 -189
  87. package/public/compare/speclock.html +0 -180
  88. package/public/compare.html +0 -310
  89. package/public/dashboard.html +0 -1100
  90. package/public/guide.html +0 -317
  91. package/public/guides/claude-code-prevent-repeated-mistakes.html +0 -161
  92. package/public/guides/codex-cli-guardrails.html +0 -158
  93. package/public/guides/cursor-prevent-repeated-mistakes.html +0 -161
  94. package/public/guides/pre-action-gates.html +0 -162
  95. package/public/guides/stop-repeated-ai-agent-mistakes.html +0 -159
  96. package/public/index.html +0 -1128
  97. package/public/js/buyer-intent.js +0 -252
  98. package/public/learn/agent-harness-pattern.html +0 -180
  99. package/public/learn/ai-agent-persistent-memory.html +0 -203
  100. package/public/learn/learn.css +0 -45
  101. package/public/learn/mcp-pre-action-gates-explained.html +0 -172
  102. package/public/learn/stop-ai-agent-force-push.html +0 -134
  103. package/public/learn/vibe-coding-safety-net.html +0 -142
  104. package/public/learn.html +0 -274
  105. package/public/lessons.html +0 -967
  106. package/public/llm-context.md +0 -140
  107. package/public/pro.html +0 -1087
  108. package/public/vercel.json +0 -8
  109. package/scripts/a2ui-engine.js +0 -73
  110. package/scripts/adk-consolidator.js +0 -274
  111. package/scripts/agent-security-hardening.js +0 -225
  112. package/scripts/ai-search-visibility.js +0 -142
  113. package/scripts/autonomous-sales-agent.js +0 -39
  114. package/scripts/autoresearch-runner.js +0 -216
  115. package/scripts/background-agent-governance.js +0 -229
  116. package/scripts/behavioral-extraction.js +0 -93
  117. package/scripts/budget-enforcer.js +0 -173
  118. package/scripts/budget-guard.js +0 -173
  119. package/scripts/build-claude-mcpb.js +0 -255
  120. package/scripts/build-codex-plugin.js +0 -152
  121. package/scripts/capture-railway-diagnostics.sh +0 -97
  122. package/scripts/changeset-check.js +0 -372
  123. package/scripts/check-congruence.js +0 -443
  124. package/scripts/computer-use-firewall.js +0 -280
  125. package/scripts/content-engine/linkedin-content-generator.js +0 -154
  126. package/scripts/content-engine/output/linkedin-memento-validation.md +0 -17
  127. package/scripts/content-engine/output/linkedin-posts-2026-04-09.md +0 -175
  128. package/scripts/content-engine/reddit-thread-finder.js +0 -154
  129. package/scripts/context-engine.js +0 -710
  130. package/scripts/daily-digest.js +0 -11
  131. package/scripts/data-governance.js +0 -173
  132. package/scripts/deploy-gcp.sh +0 -44
  133. package/scripts/deploy-policy.js +0 -249
  134. package/scripts/disagreement-mining.js +0 -315
  135. package/scripts/dpo-optimizer.js +0 -206
  136. package/scripts/ensure-repo-bootstrap.js +0 -130
  137. package/scripts/ephemeral-agent-store.js +0 -212
  138. package/scripts/eval-harness.js +0 -56
  139. package/scripts/export-kto-pairs.js +0 -309
  140. package/scripts/export-training.js +0 -446
  141. package/scripts/feedback-fallback.js +0 -111
  142. package/scripts/feedback-inbox-read.js +0 -162
  143. package/scripts/feedback-root-consolidator.js +0 -233
  144. package/scripts/feedback-to-memory.js +0 -185
  145. package/scripts/gate-satisfy.js +0 -42
  146. package/scripts/generate-paperbanana-diagrams.sh +0 -99
  147. package/scripts/generate-pretool-hook.sh +0 -40
  148. package/scripts/github-about.js +0 -430
  149. package/scripts/github-outreach.js +0 -65
  150. package/scripts/gtm-revenue-loop.js +0 -535
  151. package/scripts/hallucination-detector.js +0 -226
  152. package/scripts/hf-papers.js +0 -317
  153. package/scripts/hook-auto-capture.sh +0 -100
  154. package/scripts/hook-stop-pr-thread-check.sh +0 -68
  155. package/scripts/hook-stop-self-score.sh +0 -51
  156. package/scripts/hook-stop-verify-deploy.sh +0 -31
  157. package/scripts/hook-verify-before-done.sh +0 -20
  158. package/scripts/managed-dpo-export.js +0 -91
  159. package/scripts/markdown-escape.js +0 -12
  160. package/scripts/marketing-experiment.js +0 -657
  161. package/scripts/memalign-recall.js +0 -111
  162. package/scripts/memory-migration.js +0 -296
  163. package/scripts/meta-policy.js +0 -190
  164. package/scripts/metered-billing.js +0 -16
  165. package/scripts/model-tier-router.js +0 -310
  166. package/scripts/money-watcher.js +0 -218
  167. package/scripts/multi-hop-recall.js +0 -240
  168. package/scripts/per-step-scoring.js +0 -163
  169. package/scripts/perplexity-marketing.js +0 -466
  170. package/scripts/pii-scanner.js +0 -153
  171. package/scripts/plan-gate.js +0 -154
  172. package/scripts/post-everywhere.js +0 -341
  173. package/scripts/post-to-x-retry.sh +0 -22
  174. package/scripts/post-to-x.js +0 -369
  175. package/scripts/pr-manager.js +0 -421
  176. package/scripts/principle-extractor.js +0 -162
  177. package/scripts/pro-features.js +0 -41
  178. package/scripts/prompt-dlp.js +0 -222
  179. package/scripts/prove-adapters.js +0 -860
  180. package/scripts/prove-attribution.js +0 -361
  181. package/scripts/prove-automation.js +0 -651
  182. package/scripts/prove-autoresearch.js +0 -304
  183. package/scripts/prove-claim-verification.js +0 -277
  184. package/scripts/prove-cloudflare-sandbox.js +0 -161
  185. package/scripts/prove-data-pipeline.js +0 -408
  186. package/scripts/prove-data-quality.js +0 -227
  187. package/scripts/prove-evolution.js +0 -352
  188. package/scripts/prove-harnesses.js +0 -287
  189. package/scripts/prove-intelligence.js +0 -257
  190. package/scripts/prove-lancedb.js +0 -425
  191. package/scripts/prove-local-intelligence.js +0 -340
  192. package/scripts/prove-loop-closure.js +0 -263
  193. package/scripts/prove-packaged-runtime.js +0 -326
  194. package/scripts/prove-predictive-insights.js +0 -355
  195. package/scripts/prove-runtime.js +0 -363
  196. package/scripts/prove-seo-gsd.js +0 -234
  197. package/scripts/prove-settings.js +0 -279
  198. package/scripts/prove-subway-upgrades.js +0 -277
  199. package/scripts/prove-tessl.js +0 -229
  200. package/scripts/prove-training-export.js +0 -325
  201. package/scripts/prove-workflow-contract.js +0 -112
  202. package/scripts/prove-xmemory.js +0 -332
  203. package/scripts/publish-decision.js +0 -159
  204. package/scripts/ralph-loop.js +0 -376
  205. package/scripts/ralph-mode-ci.js +0 -331
  206. package/scripts/reddit-dm-outreach.js +0 -192
  207. package/scripts/reddit-monitor-cron.sh +0 -26
  208. package/scripts/reminder-engine.js +0 -132
  209. package/scripts/revenue-status.js +0 -472
  210. package/scripts/rotate-stripe-webhook-secret.js +0 -314
  211. package/scripts/schedule-manager.js +0 -249
  212. package/scripts/self-healing-check.js +0 -193
  213. package/scripts/shieldcortex-memory-firewall-runner.mjs +0 -53
  214. package/scripts/skill-exporter.js +0 -260
  215. package/scripts/skill-materializer.js +0 -134
  216. package/scripts/skill-packs.js +0 -136
  217. package/scripts/skill-proposer.js +0 -99
  218. package/scripts/skill-quality-tracker.js +0 -282
  219. package/scripts/slow-loop.js +0 -72
  220. package/scripts/social-analytics/db/analytics.sqlite +0 -0
  221. package/scripts/social-analytics/db/schema.sql +0 -32
  222. package/scripts/social-analytics/digest.js +0 -256
  223. package/scripts/social-analytics/engagement-audit.js +0 -185
  224. package/scripts/social-analytics/generate-instagram-card.js +0 -97
  225. package/scripts/social-analytics/instagram-thumbgate-post.js +0 -111
  226. package/scripts/social-analytics/install-growth-automation.js +0 -114
  227. package/scripts/social-analytics/load-env.js +0 -77
  228. package/scripts/social-analytics/mcp-server.js +0 -289
  229. package/scripts/social-analytics/normalizer.js +0 -580
  230. package/scripts/social-analytics/notify.js +0 -162
  231. package/scripts/social-analytics/poll-all.js +0 -107
  232. package/scripts/social-analytics/pollers/github.js +0 -195
  233. package/scripts/social-analytics/pollers/instagram.js +0 -253
  234. package/scripts/social-analytics/pollers/linkedin.js +0 -340
  235. package/scripts/social-analytics/pollers/plausible.js +0 -245
  236. package/scripts/social-analytics/pollers/reddit.js +0 -306
  237. package/scripts/social-analytics/pollers/threads.js +0 -233
  238. package/scripts/social-analytics/pollers/tiktok.js +0 -203
  239. package/scripts/social-analytics/pollers/x.js +0 -227
  240. package/scripts/social-analytics/pollers/youtube.js +0 -304
  241. package/scripts/social-analytics/pollers/zernio.js +0 -183
  242. package/scripts/social-analytics/publish-instagram-thumbgate.js +0 -104
  243. package/scripts/social-analytics/publish-thumbgate-launch.js +0 -322
  244. package/scripts/social-analytics/publishers/devto.js +0 -122
  245. package/scripts/social-analytics/publishers/instagram.js +0 -317
  246. package/scripts/social-analytics/publishers/linkedin.js +0 -294
  247. package/scripts/social-analytics/publishers/reddit.js +0 -385
  248. package/scripts/social-analytics/publishers/threads.js +0 -275
  249. package/scripts/social-analytics/publishers/tiktok.js +0 -217
  250. package/scripts/social-analytics/publishers/x.js +0 -259
  251. package/scripts/social-analytics/publishers/youtube.js +0 -223
  252. package/scripts/social-analytics/publishers/zernio.js +0 -539
  253. package/scripts/social-analytics/reconcile-thumbgate-campaign.js +0 -165
  254. package/scripts/social-analytics/run-digest.js +0 -34
  255. package/scripts/social-analytics/schedule-thumbgate-campaign.js +0 -275
  256. package/scripts/social-analytics/store.js +0 -455
  257. package/scripts/social-analytics/sync-launch-assets.js +0 -185
  258. package/scripts/social-analytics/utm.js +0 -143
  259. package/scripts/social-pipeline.js +0 -2626
  260. package/scripts/social-post-hourly.js +0 -228
  261. package/scripts/social-quality-gate.js +0 -134
  262. package/scripts/social-reply-monitor.js +0 -592
  263. package/scripts/status-dashboard.js +0 -155
  264. package/scripts/stripe-live-status.js +0 -115
  265. package/scripts/subagent-profiles.js +0 -79
  266. package/scripts/sync-branch-protection.js +0 -340
  267. package/scripts/sync-gh-secrets-from-env.sh +0 -70
  268. package/scripts/sync-github-about.js +0 -55
  269. package/scripts/sync-version.js +0 -479
  270. package/scripts/synthetic-dpo.js +0 -234
  271. package/scripts/tessl-export.js +0 -369
  272. package/scripts/test-coverage.js +0 -128
  273. package/scripts/thumbgate_session_start.sh +0 -32
  274. package/scripts/train_from_feedback.py +0 -929
  275. package/scripts/validate-feedback.js +0 -581
  276. package/scripts/verify-obsidian-setup.sh +0 -269
  277. package/scripts/verify-run.js +0 -269
  278. package/scripts/weekly-auto-post.js +0 -124
  279. package/scripts/x-autonomous-marketing.js +0 -139
@@ -1,466 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * Perplexity Max Marketing Engine
5
- *
6
- * Uses Perplexity Sonar APIs to:
7
- * 1. Deep Research — find buyers, competitors, distribution channels
8
- * 2. Search API — find live discussions where ThumbGate is relevant
9
- * 3. Sonar Pro — generate SEO-optimized launch posts for HN, Reddit, dev.to, Twitter
10
- * 4. Generate ready-to-post content with links to purchase channels
11
- *
12
- * Usage:
13
- * PERPLEXITY_API_KEY=pplx-... node scripts/perplexity-marketing.js [command]
14
- *
15
- * Commands:
16
- * research — Deep research on target market and competitors
17
- * find-threads — Find live discussions to engage with
18
- * generate — Generate launch posts for all platforms
19
- * full — Run all three steps (default)
20
- */
21
-
22
- const fs = require('fs');
23
- const path = require('path');
24
-
25
- const API_KEY = process.env.PERPLEXITY_API_KEY;
26
- const OUTPUT_DIR = path.join(__dirname, '..', '.amp', 'in', 'artifacts', 'marketing');
27
- const SONAR_URL = 'https://api.perplexity.ai/chat/completions';
28
-
29
- const PRODUCT = {
30
- name: 'ThumbGate',
31
- npm: 'thumbgate',
32
- repo: 'https://github.com/IgorGanapolsky/ThumbGate',
33
- checkout: 'https://thumbgate-production.up.railway.app/checkout/pro',
34
- sponsor: 'https://github.com/sponsors/IgorGanapolsky',
35
- coffee: 'https://buymeacoffee.com/igorganapolsky',
36
- tagline: 'Local-first memory and feedback pipeline for AI agents. Captures thumbs-up/down signals, promotes reusable memories, generates prevention rules from repeated failures, and exports KTO/DPO pairs for fine-tuning.',
37
- keywords: ['MCP', 'ThumbGate', 'DPO', 'KTO', 'Thompson Sampling', 'AI agent memory', 'Claude Code', 'Amp', 'Gemini CLI', 'context engineering', 'prevention rules', 'Pre-Action Gates'],
38
- proPrice: '$19/mo or $149/yr',
39
- };
40
-
41
- async function sonarRequest(model, messages, options = {}) {
42
- if (!API_KEY) {
43
- throw new Error('PERPLEXITY_API_KEY not set. Get yours at https://www.perplexity.ai/settings/api');
44
- }
45
-
46
- const body = {
47
- model,
48
- messages,
49
- ...options,
50
- };
51
-
52
- const resp = await fetch(SONAR_URL, {
53
- method: 'POST',
54
- headers: {
55
- 'Authorization': `Bearer ${API_KEY}`,
56
- 'Content-Type': 'application/json',
57
- },
58
- body: JSON.stringify(body),
59
- });
60
-
61
- if (!resp.ok) {
62
- const text = await resp.text();
63
- throw new Error(`Perplexity API ${resp.status}: ${text}`);
64
- }
65
-
66
- return resp.json();
67
- }
68
-
69
- function ensureOutputDir() {
70
- fs.mkdirSync(OUTPUT_DIR, { recursive: true });
71
- }
72
-
73
- function saveOutput(filename, content) {
74
- ensureOutputDir();
75
- const p = path.join(OUTPUT_DIR, filename);
76
- fs.writeFileSync(p, content, 'utf-8');
77
- console.log(` ✓ Saved: ${p}`);
78
- return p;
79
- }
80
-
81
- // ─── STEP 1: Deep Research ────────────────────────────────────────────────────
82
-
83
- async function deepResearch() {
84
- console.log('\n🔬 STEP 1: Deep Research — Market Analysis');
85
- console.log(' Using sonar-deep-research for exhaustive analysis...\n');
86
-
87
- const result = await sonarRequest('sonar-deep-research', [
88
- {
89
- role: 'system',
90
- content: 'You are a market research analyst specializing in developer tools and AI infrastructure. Provide actionable intelligence with specific URLs, communities, and buyer personas.',
91
- },
92
- {
93
- role: 'user',
94
- content: `Research the market for MCP (Model Context Protocol) memory and feedback tools for AI coding agents.
95
-
96
- I built "${PRODUCT.name}" — ${PRODUCT.tagline}
97
-
98
- Research and provide:
99
- 1. **Competitor Analysis**: What similar tools exist? (LangSmith, Weights & Biases, custom ThumbGate pipelines, etc.) What do they charge? What gaps does my tool fill?
100
- 2. **Target Buyer Personas**: Who would pay $19/mo or $149/yr for a Pro plan with curated ThumbGate configs? (AI engineers, dev tool builders, agent framework users)
101
- 3. **Distribution Channels**: Specific subreddits, Discord servers, Slack communities, newsletters, and forums where MCP and AI agent reliability tool buyers hang out. Include URLs.
102
- 4. **SEO/GEO Keywords**: High-intent search terms people use when looking for this type of tool
103
- 5. **Launch Strategy**: Specific steps to get first 10 paying customers this week
104
- 6. **Pricing Validation**: Is $19/mo or $149/yr right for a Pro plan? What would similar tools charge?
105
-
106
- Be specific with URLs, community names, and actionable steps.`,
107
- },
108
- ]);
109
-
110
- const content = result.choices[0].message.content;
111
- const citations = result.citations || [];
112
-
113
- let output = `# Market Research Report — ThumbGate\n\nGenerated: ${new Date().toISOString()}\n\n`;
114
- output += content;
115
- if (citations.length) {
116
- output += '\n\n## Sources\n\n';
117
- citations.forEach((c, i) => { output += `${i + 1}. ${c}\n`; });
118
- }
119
-
120
- saveOutput('01-deep-research.md', output);
121
- console.log(' ✓ Deep research complete\n');
122
- return content;
123
- }
124
-
125
- // ─── STEP 2: Find Live Discussions ───────────────────────────────────────────
126
-
127
- async function findThreads() {
128
- console.log('\n🔍 STEP 2: Find Live Discussions to Engage');
129
- console.log(' Using sonar-pro to find active conversations...\n');
130
-
131
- const queries = [
132
- 'MCP Model Context Protocol memory tools discussion site:reddit.com OR site:news.ycombinator.com 2025 2026',
133
- 'feedback-to-enforcement pipeline AI agents local-first tools discussion',
134
- 'Claude Code Amp agent memory context engineering tips',
135
- 'AI coding agent prevention rules guardrails DPO training',
136
- ];
137
-
138
- const results = [];
139
-
140
- for (const q of queries) {
141
- try {
142
- const result = await sonarRequest('sonar-pro', [
143
- {
144
- role: 'system',
145
- content: 'Find active online discussions, forum threads, and community posts. Return specific URLs where people are discussing these topics. Focus on posts from the last 30 days.',
146
- },
147
- { role: 'user', content: q },
148
- ], {
149
- web_search_options: { search_context_size: 'high' },
150
- });
151
-
152
- const content = result.choices[0].message.content;
153
- const citations = result.citations || [];
154
- results.push({ query: q, content, citations });
155
- } catch (err) {
156
- console.log(` ⚠ Query failed: ${q} — ${err.message}`);
157
- }
158
- }
159
-
160
- let output = `# Live Discussion Threads — Engagement Opportunities\n\nGenerated: ${new Date().toISOString()}\n\n`;
161
- for (const r of results) {
162
- output += `## Query: ${r.query}\n\n${r.content}\n\n`;
163
- if (r.citations.length) {
164
- output += '### Sources\n';
165
- r.citations.forEach((c, i) => { output += `${i + 1}. ${c}\n`; });
166
- output += '\n';
167
- }
168
- output += '---\n\n';
169
- }
170
-
171
- saveOutput('02-live-threads.md', output);
172
- console.log(' ✓ Found engagement opportunities\n');
173
- return results;
174
- }
175
-
176
- // ─── STEP 3: Generate Launch Posts ───────────────────────────────────────────
177
-
178
- async function generatePosts() {
179
- console.log('\n✍️ STEP 3: Generate Launch Posts');
180
- console.log(' Using sonar-pro to craft platform-specific content...\n');
181
-
182
- const platforms = [
183
- {
184
- name: 'hackernews',
185
- file: '03-hackernews-post.md',
186
- prompt: `Write a Hacker News "Show HN" post for ${PRODUCT.name}.
187
-
188
- Product: ${PRODUCT.tagline}
189
- npm: npx ${PRODUCT.npm} init
190
- GitHub: ${PRODUCT.repo}
191
- Pro Pack: ${PRODUCT.proPrice} via hosted checkout (${PRODUCT.checkout})
192
-
193
- Requirements:
194
- - Title must start with "Show HN:"
195
- - Keep the post body under 300 words
196
- - Focus on the technical innovation (Thompson Sampling for feedback routing, DPO/KTO export, prevention rules from repeated failures)
197
- - Mention it works with Claude, Codex, Amp, Gemini
198
- - No marketing fluff — HN readers want technical substance
199
- - Include the npm install command
200
- - End with a link to the repo
201
-
202
- Also generate 3 alternative titles to A/B test.`,
203
- },
204
- {
205
- name: 'reddit',
206
- file: '03-reddit-post.md',
207
- prompt: `Write Reddit posts for ${PRODUCT.name} for these subreddits:
208
- 1. r/MachineLearning — focus on ThumbGate/DPO pipeline, academic angle
209
- 2. r/LocalLLaMA — focus on local-first, no cloud dependency
210
- 3. r/ClaudeAI — focus on Claude Code integration, MCP tools
211
- 4. r/programming — focus on the engineering of the feedback loop
212
-
213
- Product: ${PRODUCT.tagline}
214
- npm: npx ${PRODUCT.npm} init
215
- GitHub: ${PRODUCT.repo}
216
- Pro Pack: ${PRODUCT.proPrice} via hosted checkout (${PRODUCT.checkout})
217
-
218
- For each subreddit, write:
219
- - A title
220
- - Post body (respect each subreddit's culture and rules)
221
- - Suggested flair
222
- Keep each post under 250 words. Be genuine, not salesy.`,
223
- },
224
- {
225
- name: 'devto',
226
- file: '03-devto-article.md',
227
- prompt: `Write a dev.to article for ${PRODUCT.name}.
228
-
229
- Product: ${PRODUCT.tagline}
230
- npm: npx ${PRODUCT.npm} init
231
- GitHub: ${PRODUCT.repo}
232
-
233
- Write a technical tutorial titled something like "How I Built a Self-Improving AI Agent Memory System or Teaching AI Agents to Learn from Their Mistakes with ThumbGate".
234
-
235
- Requirements:
236
- - dev.to frontmatter (title, published, description, tags, cover_image)
237
- - 800-1200 words
238
- - Include code snippets showing the MCP tool usage
239
- - Explain the 5-phase pipeline: Capture → Validate → Remember → Prevent → Export
240
- - Include the learning curve dashboard output
241
- - End with links to GitHub, npm, and the Pro Pack
242
- - Tags: ai, machinelearning, webdev, opensource`,
243
- },
244
- {
245
- name: 'twitter',
246
- file: '03-twitter-thread.md',
247
- prompt: `Write a Twitter/X thread (8-12 tweets) launching ${PRODUCT.name}.
248
-
249
- Product: ${PRODUCT.tagline}
250
- npm: npx ${PRODUCT.npm} init
251
- GitHub: ${PRODUCT.repo}
252
- Pro Pack: ${PRODUCT.proPrice} at ${PRODUCT.checkout}
253
-
254
- Requirements:
255
- - First tweet must hook attention (problem statement)
256
- - Use emojis sparingly but effectively
257
- - Include a code snippet tweet showing the CLI
258
- - Include the learning curve dashboard as a tweet
259
- - One tweet about the Pro Pack value prop
260
- - Last tweet: CTA to star the repo + link
261
- - Each tweet under 280 chars
262
- - Number each tweet (1/N format)`,
263
- },
264
- {
265
- name: 'linkedin',
266
- file: '03-linkedin-post.md',
267
- prompt: `Write a LinkedIn post announcing ${PRODUCT.name}.
268
-
269
- Product: ${PRODUCT.tagline}
270
- GitHub: ${PRODUCT.repo}
271
-
272
- Requirements:
273
- - Professional tone, not corporate bland
274
- - Focus on the problem: AI agents repeat the same mistakes
275
- - Position as an engineering innovation
276
- - Mention it's open source (MIT)
277
- - 150-250 words
278
- - Include relevant hashtags
279
- - End with a soft CTA`,
280
- },
281
- {
282
- name: 'producthunt',
283
- file: '03-producthunt-listing.md',
284
- prompt: `Write a Product Hunt listing for ${PRODUCT.name}.
285
-
286
- Product: ${PRODUCT.tagline}
287
- npm: npx ${PRODUCT.npm} init
288
- GitHub: ${PRODUCT.repo}
289
- Pro Pack: ${PRODUCT.proPrice} at ${PRODUCT.checkout}
290
-
291
- Requirements:
292
- - Tagline (under 60 chars)
293
- - Description (under 260 chars)
294
- - Detailed description (300-500 words)
295
- - 5 key features as bullet points
296
- - "First comment" from the maker (personal story, why you built it)
297
- - Suggested categories: Developer Tools, AI, Productivity
298
- - Pricing: Free (open source) + Pro ($19/mo or $149/yr)`,
299
- },
300
- ];
301
-
302
- const posts = [];
303
-
304
- for (const platform of platforms) {
305
- console.log(` Generating ${platform.name} post...`);
306
- try {
307
- const result = await sonarRequest('sonar-pro', [
308
- {
309
- role: 'system',
310
- content: `You are an expert developer advocate and technical content creator. Write authentic, technically accurate content that resonates with developers. Never use generic marketing phrases. Be specific and genuine.`,
311
- },
312
- { role: 'user', content: platform.prompt },
313
- ], {
314
- web_search_options: { search_context_size: 'low' },
315
- });
316
-
317
- const content = result.choices[0].message.content;
318
- saveOutput(platform.file, `# ${platform.name.toUpperCase()} — Launch Post\n\nGenerated: ${new Date().toISOString()}\n\n${content}`);
319
- posts.push({ platform: platform.name, content });
320
- } catch (err) {
321
- console.log(` ⚠ Failed: ${platform.name} — ${err.message}`);
322
- }
323
- }
324
-
325
- console.log(' ✓ All posts generated\n');
326
- return posts;
327
- }
328
-
329
- // ─── STEP 4: Generate SEO Content ────────────────────────────────────────────
330
-
331
- async function generateSEO() {
332
- console.log('\n📈 STEP 4: SEO/GEO Optimization Content');
333
- console.log(' Generating content for AI search visibility...\n');
334
-
335
- const result = await sonarRequest('sonar-pro', [
336
- {
337
- role: 'system',
338
- content: 'You are an SEO expert specializing in developer tools and AI products. Focus on GEO (Generative Engine Optimization) — making content that AI search engines (Perplexity, Claude, ChatGPT) will cite.',
339
- },
340
- {
341
- role: 'user',
342
- content: `Generate SEO/GEO optimization content for ${PRODUCT.name}:
343
-
344
- Product: ${PRODUCT.tagline}
345
- URL: ${PRODUCT.repo}
346
- npm: ${PRODUCT.npm}
347
-
348
- Generate:
349
- 1. **FAQ Page Content** — 10 Q&As that match high-intent developer searches (format as JSON-LD FAQPage schema)
350
- 2. **Meta Descriptions** — for GitHub README, npm page, landing page
351
- 3. **Long-tail Keyword Targets** — 20 specific phrases developers search for
352
- 4. **Comparison Content** — "ThumbGate vs LangSmith", "ThumbGate vs custom ThumbGate setup", "ThumbGate vs Weights & Biases"
353
- 5. **Structured Data** — JSON-LD SoftwareApplication schema for the product
354
-
355
- Make all content factually accurate and technically specific.`,
356
- },
357
- ], {
358
- web_search_options: { search_context_size: 'medium' },
359
- });
360
-
361
- const content = result.choices[0].message.content;
362
- saveOutput('04-seo-geo-content.md', `# SEO/GEO Optimization Content\n\nGenerated: ${new Date().toISOString()}\n\n${content}`);
363
- console.log(' ✓ SEO content generated\n');
364
- return content;
365
- }
366
-
367
- // ─── STEP 5: Generate Outreach Messages ──────────────────────────────────────
368
-
369
- async function generateOutreach() {
370
- console.log('\n📧 STEP 5: Direct Outreach Templates');
371
-
372
- const result = await sonarRequest('sonar', [
373
- {
374
- role: 'system',
375
- content: 'You are a developer relations expert. Write concise, personalized outreach templates.',
376
- },
377
- {
378
- role: 'user',
379
- content: `Write outreach message templates for ${PRODUCT.name} (${PRODUCT.tagline}):
380
-
381
- 1. **Newsletter pitch** — for AI/ML newsletters (The Batch, TLDR AI, etc.)
382
- 2. **Podcast pitch** — for AI dev podcasts
383
- 3. **Influencer DM** — for AI Twitter/YouTube personalities
384
- 4. **Discord/Slack message** — for MCP/AI agent community channels
385
- 5. **Email to AI tool aggregator sites** — to get listed
386
-
387
- Each should be under 150 words, personalized, and include ${PRODUCT.repo}
388
- Include [PERSONALIZATION] placeholders.`,
389
- },
390
- ]);
391
-
392
- const content = result.choices[0].message.content;
393
- saveOutput('05-outreach-templates.md', `# Outreach Templates\n\nGenerated: ${new Date().toISOString()}\n\n${content}`);
394
- console.log(' ✓ Outreach templates generated\n');
395
- return content;
396
- }
397
-
398
- // ─── Main ─────────────────────────────────────────────────────────────────────
399
-
400
- async function main() {
401
- const cmd = process.argv[2] || 'full';
402
-
403
- console.log('╔══════════════════════════════════════════════════════╗');
404
- console.log('║ Perplexity Max Marketing Engine ║');
405
- console.log('║ ThumbGate — First Dollar Campaign ║');
406
- console.log('╚══════════════════════════════════════════════════════╝');
407
-
408
- if (!API_KEY) {
409
- console.error('\n❌ PERPLEXITY_API_KEY not set.');
410
- console.error(' Add it to .env: PERPLEXITY_API_KEY=pplx-...');
411
- console.error(' Get your key: https://www.perplexity.ai/settings/api\n');
412
- process.exit(1);
413
- }
414
-
415
- console.log('\nAPI key configured.');
416
- console.log(`Command: ${cmd}\n`);
417
-
418
- try {
419
- switch (cmd) {
420
- case 'research':
421
- await deepResearch();
422
- break;
423
- case 'find-threads':
424
- await findThreads();
425
- break;
426
- case 'generate':
427
- await generatePosts();
428
- break;
429
- case 'seo':
430
- await generateSEO();
431
- break;
432
- case 'outreach':
433
- await generateOutreach();
434
- break;
435
- case 'full':
436
- await deepResearch();
437
- await findThreads();
438
- await generatePosts();
439
- await generateSEO();
440
- await generateOutreach();
441
- break;
442
- default:
443
- console.error(`Unknown command: ${cmd}`);
444
- console.error('Commands: research, find-threads, generate, seo, outreach, full');
445
- process.exit(1);
446
- }
447
-
448
- console.log('╔══════════════════════════════════════════════════════╗');
449
- console.log('║ ✅ Marketing content generated! ║');
450
- console.log('╠══════════════════════════════════════════════════════╣');
451
- console.log(`║ Output: ${OUTPUT_DIR}`);
452
- console.log('║ ║');
453
- console.log('║ Next steps: ║');
454
- console.log('║ 1. Review generated content in artifacts/marketing ║');
455
- console.log('║ 2. Post to platforms (HN, Reddit, dev.to, Twitter) ║');
456
- console.log('║ 3. Send outreach messages ║');
457
- console.log('║ 4. Update landing page with SEO content ║');
458
- console.log('╚══════════════════════════════════════════════════════╝');
459
-
460
- } catch (err) {
461
- console.error(`\n❌ Error: ${err.message}`);
462
- process.exit(1);
463
- }
464
- }
465
-
466
- main();
@@ -1,153 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- /**
5
- * PII Scanner — LogSentinel-inspired PII detection for ThumbGate.
6
- *
7
- * Scans feedback content, context packs, and DPO exports for PII patterns.
8
- * Applies hierarchical sensitivity labels. Redacts or rejects as configured.
9
- * Builds on secret-scanner.js patterns + adds PII-specific detectors.
10
- */
11
-
12
- const { SECRET_PATTERNS, redactText: redactSecrets } = require('./secret-scanner');
13
-
14
- // PII patterns beyond secrets — emails, phone numbers, SSNs, card numbers, IP addresses
15
- const PII_PATTERNS = [
16
- { id: 'email', label: 'Email address', regex: /\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b/g, sensitivity: 'sensitive' },
17
- { id: 'phone_us', label: 'US phone number', regex: /\b(?:\+?1[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}\b/g, sensitivity: 'sensitive' },
18
- { id: 'ssn', label: 'Social Security Number', regex: /\b\d{3}[-.\s]?\d{2}[-.\s]?\d{4}\b/g, sensitivity: 'restricted' },
19
- { id: 'credit_card', label: 'Credit card number', regex: /\b(?:4\d{3}|5[1-5]\d{2}|3[47]\d{2}|6(?:011|5\d{2}))[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}\b/g, sensitivity: 'restricted' },
20
- { id: 'ip_address', label: 'IP address', regex: /\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\b/g, sensitivity: 'internal' },
21
- { id: 'aws_account', label: 'AWS account ID', regex: /\b\d{12}\b/g, sensitivity: 'internal' },
22
- ];
23
-
24
- const SENSITIVITY_LEVELS = ['public', 'internal', 'sensitive', 'restricted'];
25
-
26
- function sensitivityRank(level) {
27
- const idx = SENSITIVITY_LEVELS.indexOf(level);
28
- return idx >= 0 ? idx : 0;
29
- }
30
-
31
- /**
32
- * Scan text for PII and return findings with sensitivity labels.
33
- */
34
- function scanForPii(text) {
35
- if (!text) return { findings: [], highestSensitivity: 'public', hasPii: false };
36
- const str = String(text);
37
- const findings = [];
38
- let highest = 'public';
39
-
40
- for (const pattern of PII_PATTERNS) {
41
- // Reset regex lastIndex for global patterns
42
- pattern.regex.lastIndex = 0;
43
- const matches = str.match(pattern.regex);
44
- if (matches && matches.length > 0) {
45
- findings.push({
46
- id: pattern.id,
47
- label: pattern.label,
48
- sensitivity: pattern.sensitivity,
49
- matchCount: matches.length,
50
- sample: matches[0].slice(0, 4) + '***',
51
- });
52
- if (sensitivityRank(pattern.sensitivity) > sensitivityRank(highest)) {
53
- highest = pattern.sensitivity;
54
- }
55
- }
56
- }
57
-
58
- return { findings, highestSensitivity: highest, hasPii: findings.length > 0 };
59
- }
60
-
61
- /**
62
- * Redact PII from text. Returns redacted string.
63
- */
64
- function redactPii(text) {
65
- if (!text) return '';
66
- let redacted = String(text);
67
- // First redact secrets (API keys, tokens)
68
- redacted = redactSecrets(redacted);
69
- // Then redact PII
70
- for (const pattern of PII_PATTERNS) {
71
- pattern.regex.lastIndex = 0;
72
- redacted = redacted.replace(pattern.regex, `[REDACTED:${pattern.id}]`);
73
- }
74
- return redacted;
75
- }
76
-
77
- /**
78
- * Assign a sensitivity label to a feedback entry based on content scan.
79
- * Returns: { sensitivity, findings, redactedContent }
80
- */
81
- function classifyFeedback(feedbackEntry) {
82
- const content = [
83
- feedbackEntry.context || '',
84
- feedbackEntry.whatWentWrong || '',
85
- feedbackEntry.whatToChange || '',
86
- feedbackEntry.whatWorked || '',
87
- ].join('\n');
88
-
89
- const scan = scanForPii(content);
90
-
91
- return {
92
- sensitivity: scan.highestSensitivity,
93
- findings: scan.findings,
94
- hasPii: scan.hasPii,
95
- redactedContent: scan.hasPii ? redactPii(content) : content,
96
- originalContentHash: require('crypto').createHash('sha256').update(content).digest('hex').slice(0, 16),
97
- };
98
- }
99
-
100
- /**
101
- * Scan a DPO pair for PII. Returns scan result with pass/fail.
102
- */
103
- function scanDpoPair(pair) {
104
- const chosen = scanForPii(pair.chosen || '');
105
- const rejected = scanForPii(pair.rejected || '');
106
- const prompt = scanForPii(pair.prompt || '');
107
- const allFindings = [...prompt.findings, ...chosen.findings, ...rejected.findings];
108
- const highest = SENSITIVITY_LEVELS[Math.max(
109
- sensitivityRank(prompt.highestSensitivity),
110
- sensitivityRank(chosen.highestSensitivity),
111
- sensitivityRank(rejected.highestSensitivity),
112
- )];
113
-
114
- return {
115
- hasPii: allFindings.length > 0,
116
- highestSensitivity: highest,
117
- findings: allFindings,
118
- safe: sensitivityRank(highest) < sensitivityRank('sensitive'),
119
- };
120
- }
121
-
122
- /**
123
- * Gate a DPO export: filter out pairs containing PII above threshold.
124
- * Returns { safePairs, blockedPairs, blockedCount, totalScanned }.
125
- */
126
- function gateDpoExport(pairs, { maxSensitivity = 'internal' } = {}) {
127
- const maxRank = sensitivityRank(maxSensitivity);
128
- const safePairs = [];
129
- const blockedPairs = [];
130
-
131
- for (const pair of pairs) {
132
- const scan = scanDpoPair(pair);
133
- if (sensitivityRank(scan.highestSensitivity) <= maxRank) {
134
- safePairs.push(pair);
135
- } else {
136
- blockedPairs.push({ pair, scan });
137
- }
138
- }
139
-
140
- return {
141
- safePairs,
142
- blockedPairs,
143
- blockedCount: blockedPairs.length,
144
- totalScanned: pairs.length,
145
- passRate: pairs.length > 0 ? Math.round((safePairs.length / pairs.length) * 1000) / 10 : 100,
146
- };
147
- }
148
-
149
- module.exports = {
150
- PII_PATTERNS, SENSITIVITY_LEVELS,
151
- scanForPii, redactPii, classifyFeedback,
152
- scanDpoPair, gateDpoExport, sensitivityRank,
153
- };