thumbgate 1.3.0 → 1.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/README.md +25 -0
- package/.claude-plugin/marketplace.json +32 -13
- package/.claude-plugin/plugin.json +15 -2
- package/.well-known/llms.txt +60 -0
- package/.well-known/mcp/server-card.json +1 -1
- package/README.md +242 -126
- package/adapters/README.md +1 -1
- package/adapters/chatgpt/INSTALL.md +59 -4
- package/adapters/chatgpt/openapi.yaml +168 -0
- package/adapters/claude/.mcp.json +2 -2
- package/adapters/codex/config.toml +2 -2
- package/adapters/mcp/server-stdio.js +84 -1
- package/adapters/opencode/opencode.json +1 -1
- package/bin/cli.js +204 -13
- package/bin/postinstall.js +8 -2
- package/config/budget.json +18 -0
- package/config/gates/code-edit.json +61 -0
- package/config/gates/db-write.json +61 -0
- package/config/gates/default.json +154 -3
- package/config/gates/deploy.json +61 -0
- package/config/github-about.json +2 -1
- package/config/merge-quality-checks.json +23 -0
- package/openapi/openapi.yaml +168 -0
- package/package.json +47 -11
- package/plugins/claude-codex-bridge/.claude-plugin/plugin.json +1 -1
- package/plugins/claude-codex-bridge/.mcp.json +1 -1
- package/plugins/claude-codex-bridge/scripts/codex-bridge.js +1 -3
- package/plugins/codex-profile/.codex-plugin/plugin.json +1 -1
- package/plugins/codex-profile/.mcp.json +1 -1
- package/plugins/codex-profile/INSTALL.md +27 -4
- package/plugins/codex-profile/README.md +33 -9
- package/plugins/cursor-marketplace/.cursor-plugin/plugin.json +1 -1
- package/plugins/opencode-profile/INSTALL.md +1 -1
- package/public/blog.html +73 -0
- package/public/compare/mem0.html +189 -0
- package/public/compare/speclock.html +180 -0
- package/public/compare.html +10 -2
- package/public/guide.html +2 -2
- package/public/guides/claude-code-prevent-repeated-mistakes.html +161 -0
- package/public/guides/codex-cli-guardrails.html +158 -0
- package/public/guides/cursor-prevent-repeated-mistakes.html +161 -0
- package/public/guides/pre-action-gates.html +162 -0
- package/public/guides/stop-repeated-ai-agent-mistakes.html +159 -0
- package/public/index.html +172 -65
- package/public/lessons.html +33 -24
- package/public/llm-context.md +140 -0
- package/public/pro.html +24 -22
- package/scripts/access-anomaly-detector.js +1 -1
- package/scripts/adk-consolidator.js +1 -5
- package/scripts/agent-security-hardening.js +4 -6
- package/scripts/agentic-data-pipeline.js +1 -3
- package/scripts/async-job-runner.js +1 -5
- package/scripts/audit-trail.js +1 -5
- package/scripts/auto-promote-gates.js +5 -3
- package/scripts/background-agent-governance.js +2 -10
- package/scripts/billing-setup.js +109 -0
- package/scripts/billing.js +2 -16
- package/scripts/budget-enforcer.js +173 -0
- package/scripts/build-claude-mcpb.js +71 -5
- package/scripts/build-codex-plugin.js +152 -0
- package/scripts/check-congruence.js +132 -14
- package/scripts/commercial-offer.js +5 -7
- package/scripts/content-engine/linkedin-content-generator.js +154 -0
- package/scripts/content-engine/output/linkedin-memento-validation.md +17 -0
- package/scripts/content-engine/output/linkedin-posts-2026-04-09.md +175 -0
- package/scripts/content-engine/reddit-thread-finder.js +154 -0
- package/scripts/context-engine.js +21 -6
- package/scripts/contextfs.js +1 -21
- package/scripts/dashboard.js +20 -0
- package/scripts/decision-journal.js +341 -0
- package/scripts/delegation-runtime.js +1 -5
- package/scripts/distribution-surfaces.js +54 -0
- package/scripts/document-intake.js +927 -0
- package/scripts/ephemeral-agent-store.js +1 -8
- package/scripts/evolution-state.js +1 -5
- package/scripts/experiment-tracker.js +1 -5
- package/scripts/export-databricks-bundle.js +1 -5
- package/scripts/export-hf-dataset.js +1 -5
- package/scripts/export-training.js +1 -5
- package/scripts/feedback-attribution.js +1 -16
- package/scripts/feedback-history-distiller.js +1 -16
- package/scripts/feedback-loop.js +1 -5
- package/scripts/feedback-root-consolidator.js +2 -21
- package/scripts/feedback-session.js +49 -0
- package/scripts/feedback-to-rules.js +215 -36
- package/scripts/filesystem-search.js +1 -9
- package/scripts/fs-utils.js +104 -0
- package/scripts/gates-engine.js +200 -11
- package/scripts/github-about.js +32 -8
- package/scripts/gtm-revenue-loop.js +1 -5
- package/scripts/harness-selector.js +148 -0
- package/scripts/hosted-config.js +2 -0
- package/scripts/hosted-job-launcher.js +1 -5
- package/scripts/hybrid-feedback-context.js +33 -49
- package/scripts/intervention-policy.js +58 -1
- package/scripts/lesson-db.js +3 -18
- package/scripts/lesson-inference.js +194 -16
- package/scripts/lesson-retrieval.js +60 -24
- package/scripts/llm-client.js +59 -0
- package/scripts/managed-lesson-agent.js +183 -0
- package/scripts/marketing-experiment.js +8 -22
- package/scripts/meta-agent-loop.js +624 -0
- package/scripts/metered-billing.js +1 -1
- package/scripts/money-watcher.js +1 -4
- package/scripts/obsidian-export.js +1 -5
- package/scripts/operational-integrity.js +15 -3
- package/scripts/operational-summary.js +41 -5
- package/scripts/org-dashboard.js +6 -1
- package/scripts/per-step-scoring.js +2 -4
- package/scripts/pr-manager.js +201 -19
- package/scripts/pro-features.js +3 -2
- package/scripts/prompt-dlp.js +3 -3
- package/scripts/prove-adapters.js +1 -5
- package/scripts/prove-attribution.js +1 -5
- package/scripts/prove-automation.js +1 -3
- package/scripts/prove-cloudflare-sandbox.js +1 -3
- package/scripts/prove-data-pipeline.js +1 -3
- package/scripts/prove-intelligence.js +1 -3
- package/scripts/prove-lancedb.js +1 -5
- package/scripts/prove-local-intelligence.js +1 -3
- package/scripts/prove-packaged-runtime.js +75 -9
- package/scripts/prove-predictive-insights.js +1 -3
- package/scripts/prove-training-export.js +1 -3
- package/scripts/prove-workflow-contract.js +1 -5
- package/scripts/ralph-loop.js +376 -0
- package/scripts/ralph-mode-ci.js +331 -0
- package/scripts/rate-limiter.js +3 -1
- package/scripts/reddit-dm-outreach.js +14 -4
- package/scripts/rotate-stripe-webhook-secret.js +314 -0
- package/scripts/schedule-manager.js +3 -5
- package/scripts/security-scanner.js +448 -0
- package/scripts/self-distill-agent.js +579 -0
- package/scripts/semantic-dedup.js +115 -0
- package/scripts/skill-exporter.js +1 -3
- package/scripts/skill-generator.js +1 -5
- package/scripts/social-analytics/engagement-audit.js +1 -18
- package/scripts/social-analytics/pollers/linkedin.js +26 -16
- package/scripts/social-analytics/publishers/linkedin.js +1 -1
- package/scripts/social-analytics/publishers/zernio.js +51 -0
- package/scripts/social-pipeline.js +1 -3
- package/scripts/social-post-hourly.js +47 -4
- package/scripts/statusline-links.js +6 -5
- package/scripts/statusline.sh +29 -153
- package/scripts/sync-branch-protection.js +340 -0
- package/scripts/tessl-export.js +1 -3
- package/scripts/thumbgate-search.js +32 -1
- package/scripts/tool-kpi-tracker.js +1 -1
- package/scripts/tool-registry.js +106 -2
- package/scripts/vector-store.js +1 -5
- package/scripts/weekly-auto-post.js +1 -1
- package/scripts/workflow-sentinel.js +91 -0
- package/skills/thumbgate/SKILL.md +1 -1
- package/src/api/server.js +296 -7
- package/scripts/__pycache__/train_from_feedback.cpython-312.pyc +0 -0
- package/scripts/social-analytics/db/social-analytics.db-shm +0 -0
- /package/scripts/social-analytics/db/{social-analytics.db-wal → analytics.sqlite} +0 -0
|
@@ -0,0 +1,331 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Ralph Mode CI — runs in GitHub Actions with secrets injected.
|
|
6
|
+
* Handles: X tweets, X mention replies, LinkedIn posts, GitHub issue monitoring,
|
|
7
|
+
* GitHub repo search + outreach, dev.to publishing, ThumbGate stats.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const crypto = require('crypto');
|
|
11
|
+
const https = require('https');
|
|
12
|
+
|
|
13
|
+
// ── Env ─────────────────────────────────────────────────────────────────
|
|
14
|
+
const X_API_KEY = process.env.X_API_KEY;
|
|
15
|
+
const X_API_SECRET = process.env.X_API_SECRET;
|
|
16
|
+
const X_ACCESS_TOKEN = process.env.X_ACCESS_TOKEN;
|
|
17
|
+
const X_ACCESS_TOKEN_SECRET = process.env.X_ACCESS_TOKEN_SECRET;
|
|
18
|
+
const X_BEARER_TOKEN = process.env.X_BEARER_TOKEN;
|
|
19
|
+
const LINKEDIN_ACCESS_TOKEN = process.env.LINKEDIN_ACCESS_TOKEN;
|
|
20
|
+
const LINKEDIN_PERSON_URN = process.env.LINKEDIN_PERSON_URN;
|
|
21
|
+
const DEVTO_API_KEY = process.env.DEVTO_API_KEY;
|
|
22
|
+
const GH_TOKEN = process.env.GH_TOKEN;
|
|
23
|
+
|
|
24
|
+
// ── X OAuth 1.0a ───────────────────────────────────────────────────────
|
|
25
|
+
function oauthSign(method, url, params, consumerSecret, tokenSecret) {
|
|
26
|
+
const sp = Object.keys(params).sort().map(k => encodeURIComponent(k) + '=' + encodeURIComponent(params[k])).join('&');
|
|
27
|
+
const bs = method + '&' + encodeURIComponent(url) + '&' + encodeURIComponent(sp);
|
|
28
|
+
return crypto.createHmac('sha1', encodeURIComponent(consumerSecret) + '&' + encodeURIComponent(tokenSecret)).update(bs).digest('base64');
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function xAuthHeader(method, url) {
|
|
32
|
+
const p = {
|
|
33
|
+
oauth_consumer_key: X_API_KEY,
|
|
34
|
+
oauth_nonce: crypto.randomBytes(16).toString('hex'),
|
|
35
|
+
oauth_signature_method: 'HMAC-SHA1',
|
|
36
|
+
oauth_timestamp: Math.floor(Date.now() / 1000).toString(),
|
|
37
|
+
oauth_token: X_ACCESS_TOKEN,
|
|
38
|
+
oauth_version: '1.0',
|
|
39
|
+
};
|
|
40
|
+
p.oauth_signature = oauthSign(method, url, p, X_API_SECRET, X_ACCESS_TOKEN_SECRET);
|
|
41
|
+
return 'OAuth ' + Object.keys(p).sort().map(k => encodeURIComponent(k) + '="' + encodeURIComponent(p[k]) + '"').join(', ');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// ── Helpers ─────────────────────────────────────────────────────────────
|
|
45
|
+
async function postTweet(text) {
|
|
46
|
+
const url = 'https://api.twitter.com/2/tweets';
|
|
47
|
+
const r = await fetch(url, {
|
|
48
|
+
method: 'POST',
|
|
49
|
+
headers: { Authorization: xAuthHeader('POST', url), 'Content-Type': 'application/json' },
|
|
50
|
+
body: JSON.stringify({ text }),
|
|
51
|
+
});
|
|
52
|
+
const j = await r.json();
|
|
53
|
+
return { id: j.data?.id, error: j.detail };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function replyTweet(text, replyTo) {
|
|
57
|
+
const url = 'https://api.twitter.com/2/tweets';
|
|
58
|
+
const r = await fetch(url, {
|
|
59
|
+
method: 'POST',
|
|
60
|
+
headers: { Authorization: xAuthHeader('POST', url), 'Content-Type': 'application/json' },
|
|
61
|
+
body: JSON.stringify({ text, reply: { in_reply_to_tweet_id: replyTo } }),
|
|
62
|
+
});
|
|
63
|
+
const j = await r.json();
|
|
64
|
+
return { id: j.data?.id, error: j.detail };
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async function postLinkedIn(text) {
|
|
68
|
+
const r = await fetch('https://api.linkedin.com/v2/ugcPosts', {
|
|
69
|
+
method: 'POST',
|
|
70
|
+
headers: {
|
|
71
|
+
Authorization: 'Bearer ' + LINKEDIN_ACCESS_TOKEN,
|
|
72
|
+
'Content-Type': 'application/json',
|
|
73
|
+
'X-Restli-Protocol-Version': '2.0.0',
|
|
74
|
+
},
|
|
75
|
+
body: JSON.stringify({
|
|
76
|
+
author: LINKEDIN_PERSON_URN,
|
|
77
|
+
lifecycleState: 'PUBLISHED',
|
|
78
|
+
specificContent: {
|
|
79
|
+
'com.linkedin.ugc.ShareContent': {
|
|
80
|
+
shareCommentary: { text },
|
|
81
|
+
shareMediaCategory: 'NONE',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
visibility: { 'com.linkedin.ugc.MemberNetworkVisibility': 'PUBLIC' },
|
|
85
|
+
}),
|
|
86
|
+
});
|
|
87
|
+
const j = await r.json();
|
|
88
|
+
return { id: j.id, status: r.status };
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
async function ghApi(endpoint) {
|
|
92
|
+
const r = await fetch('https://api.github.com' + endpoint, {
|
|
93
|
+
headers: { Authorization: 'token ' + GH_TOKEN, Accept: 'application/vnd.github+json' },
|
|
94
|
+
});
|
|
95
|
+
return r.json();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
async function ghPostComment(repo, issueNum, body) {
|
|
99
|
+
const r = await fetch(`https://api.github.com/repos/${repo}/issues/${issueNum}/comments`, {
|
|
100
|
+
method: 'POST',
|
|
101
|
+
headers: {
|
|
102
|
+
Authorization: 'token ' + GH_TOKEN,
|
|
103
|
+
Accept: 'application/vnd.github+json',
|
|
104
|
+
'Content-Type': 'application/json',
|
|
105
|
+
},
|
|
106
|
+
body: JSON.stringify({ body }),
|
|
107
|
+
});
|
|
108
|
+
return r.json();
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// ── State file (persisted via git) ──────────────────────────────────────
|
|
112
|
+
const fs = require('fs');
|
|
113
|
+
const STATE_PATH = '.thumbgate/ralph-state.json';
|
|
114
|
+
|
|
115
|
+
function loadState() {
|
|
116
|
+
try { return JSON.parse(fs.readFileSync(STATE_PATH, 'utf8')); } catch { return {}; }
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function saveState(state) {
|
|
120
|
+
fs.mkdirSync('.thumbgate', { recursive: true });
|
|
121
|
+
fs.writeFileSync(STATE_PATH, JSON.stringify(state, null, 2) + '\n');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// ── Tweet angles ────────────────────────────────────────────────────────
|
|
125
|
+
const TWEET_ANGLES = [
|
|
126
|
+
'Your CLAUDE.md has 50 rules. Your agent ignores half.\n\nThumbGate turns each into a PreToolUse gate — a physical block before the tool call executes.\n\nnpx thumbgate quick-start\nhttps://github.com/IgorGanapolsky/ThumbGate',
|
|
127
|
+
'Self-distillation: your AI agent learns from its own mistakes.\n\n1. Agent runs tool call\n2. System checks outcome\n3. Failure → rule auto-generated\n4. Next session: gate blocks it\n\nZero human feedback needed.\n\nhttps://github.com/IgorGanapolsky/ThumbGate',
|
|
128
|
+
'Thompson Sampling for AI agent gates:\n\nEach gate: Beta(alpha, beta)\nCorrect block → alpha++ → tighter\nFalse positive → beta++ → relaxes\n\nNo thresholds. Gates converge on their own.\n\nhttps://github.com/IgorGanapolsky/ThumbGate',
|
|
129
|
+
'Google DeepMind: hidden prompt injections commandeer AI agents 86% of the time.\n\nThumbGate gates the action, not the prompt. PreToolUse hooks are the last defense.\n\nhttps://github.com/IgorGanapolsky/ThumbGate',
|
|
130
|
+
'Every AI agent framework ships memory. None ship enforcement.\n\nMemory: "Don\'t force-push to main"\nEnforcement: *physically blocked*\n\nThumbGate is the enforcement layer.\n\nhttps://github.com/IgorGanapolsky/ThumbGate',
|
|
131
|
+
'Founding Member: $49 once. ThumbGate Pro forever.\n\n50 spots. No subscription.\n\nSelf-distillation, SQL MCP gates, Thompson Sampling, context-stuffing, 68 tools on Smithery.\n\nhttps://buy.stripe.com/aFa4gz1M84r419v7mb3sI05',
|
|
132
|
+
'Context-stuffing: skip RAG entirely.\n\nDump ALL prevention rules into agent context at session start. 20-200 rules = 1K-10K tokens.\n\nInspired by Karpathy. Simpler. Faster.\n\nhttps://github.com/IgorGanapolsky/ThumbGate',
|
|
133
|
+
'The AI agent safety stack:\n\nGovernance: Paperclip\nOrchestration: iloom\nContext: RepoWise\nEnforcement: ThumbGate\n\nAll open source. All necessary.\n\nhttps://github.com/IgorGanapolsky/ThumbGate',
|
|
134
|
+
];
|
|
135
|
+
|
|
136
|
+
// ── GitHub issues to monitor ────────────────────────────────────────────
|
|
137
|
+
const WATCHED_ISSUES = [
|
|
138
|
+
{ repo: 'leogodin217/leos_claude_starter', num: 1 },
|
|
139
|
+
{ repo: 'RepoWise/backend', num: 34 },
|
|
140
|
+
{ repo: 'ScaleLeanChris/paperclip-ing', num: 1 },
|
|
141
|
+
{ repo: 'sd0xdev/sd0x-dev-flow', num: 5 },
|
|
142
|
+
{ repo: 'logi-cmd/agent-guardrails', num: 3 },
|
|
143
|
+
];
|
|
144
|
+
|
|
145
|
+
// ── Main ────────────────────────────────────────────────────────────────
|
|
146
|
+
async function main() {
|
|
147
|
+
console.log('=== RALPH MODE CI — ' + new Date().toISOString() + ' ===\n');
|
|
148
|
+
const state = loadState();
|
|
149
|
+
const report = { tweets: 0, replies: 0, linkedin: 0, ghIssues: 0, ghOutreach: 0 };
|
|
150
|
+
|
|
151
|
+
// ── 1. Check X mentions and reply ──
|
|
152
|
+
if (X_BEARER_TOKEN && X_API_KEY) {
|
|
153
|
+
try {
|
|
154
|
+
const bearer = decodeURIComponent(X_BEARER_TOKEN);
|
|
155
|
+
const mentionsRes = await fetch(
|
|
156
|
+
'https://api.twitter.com/2/tweets/search/recent?query=(@IgorGanapolsky OR thumbgate) -from:IgorGanapolsky&max_results=20&tweet.fields=author_id,text,created_at,id&expansions=author_id&user.fields=username',
|
|
157
|
+
{ headers: { Authorization: 'Bearer ' + bearer } }
|
|
158
|
+
).then(r => r.json());
|
|
159
|
+
|
|
160
|
+
const mu = {};
|
|
161
|
+
(mentionsRes.includes?.users || []).forEach(u => mu[u.id] = u);
|
|
162
|
+
const lastChecked = state.lastMentionCheck || '2026-04-01T00:00:00Z';
|
|
163
|
+
const newMentions = (mentionsRes.data || []).filter(
|
|
164
|
+
t => new Date(t.created_at) > new Date(lastChecked) && (mu[t.author_id] || {}).username !== 'IgorGanapolsky'
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
console.log('X mentions since last check: ' + newMentions.length);
|
|
168
|
+
|
|
169
|
+
for (const t of newMentions.slice(0, 5)) {
|
|
170
|
+
const u = mu[t.author_id] || {};
|
|
171
|
+
const replyText = '@' + u.username + ' ThumbGate: PreToolUse enforcement for AI agents. Thompson Sampling adapts confidence. 68 tools on Smithery.\n\nhttps://github.com/IgorGanapolsky/ThumbGate';
|
|
172
|
+
const r = await replyTweet(replyText, t.id);
|
|
173
|
+
console.log(' Replied to @' + u.username + ': ' + (r.id || r.error));
|
|
174
|
+
report.replies++;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
state.lastMentionCheck = new Date().toISOString();
|
|
178
|
+
} catch (e) {
|
|
179
|
+
console.log('X mentions error: ' + e.message);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// ── 2. Post new tweet ──
|
|
183
|
+
try {
|
|
184
|
+
const angleIndex = Math.floor(Date.now() / 7200000) % TWEET_ANGLES.length;
|
|
185
|
+
const r = await postTweet(TWEET_ANGLES[angleIndex]);
|
|
186
|
+
console.log('Tweet posted: ' + (r.id || r.error));
|
|
187
|
+
report.tweets++;
|
|
188
|
+
} catch (e) {
|
|
189
|
+
console.log('Tweet error: ' + e.message);
|
|
190
|
+
}
|
|
191
|
+
} else {
|
|
192
|
+
console.log('X: skipped (no API keys)');
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// ── 3. LinkedIn post ──
|
|
196
|
+
if (LINKEDIN_ACCESS_TOKEN && LINKEDIN_PERSON_URN) {
|
|
197
|
+
try {
|
|
198
|
+
const lastLinkedin = state.lastLinkedinPost || '2026-04-01T00:00:00Z';
|
|
199
|
+
const hoursSince = (Date.now() - new Date(lastLinkedin).getTime()) / 3600000;
|
|
200
|
+
if (hoursSince >= 4) {
|
|
201
|
+
const angles = [
|
|
202
|
+
'ThumbGate: pre-action gates for AI coding agents. 68 tools on Smithery. Works with Claude Code, Cursor, Codex, Gemini, Amp.\n\nnpx thumbgate quick-start\n\nhttps://github.com/IgorGanapolsky/ThumbGate',
|
|
203
|
+
'Every AI agent framework ships memory. None ship enforcement.\n\nThumbGate adds PreToolUse hooks that block bad actions before execution. Thompson Sampling adapts. Self-distillation auto-learns.\n\nhttps://github.com/IgorGanapolsky/ThumbGate',
|
|
204
|
+
];
|
|
205
|
+
const r = await postLinkedIn(angles[Math.floor(Date.now() / 14400000) % angles.length]);
|
|
206
|
+
console.log('LinkedIn posted: ' + (r.id || r.status));
|
|
207
|
+
state.lastLinkedinPost = new Date().toISOString();
|
|
208
|
+
report.linkedin++;
|
|
209
|
+
} else {
|
|
210
|
+
console.log('LinkedIn: skipped (' + Math.round(4 - hoursSince) + 'hr until next)');
|
|
211
|
+
}
|
|
212
|
+
} catch (e) {
|
|
213
|
+
console.log('LinkedIn error: ' + e.message);
|
|
214
|
+
}
|
|
215
|
+
} else {
|
|
216
|
+
console.log('LinkedIn: skipped (no token)');
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// ── 4. GitHub issue monitoring ──
|
|
220
|
+
if (GH_TOKEN) {
|
|
221
|
+
const knownComments = state.issueComments || {};
|
|
222
|
+
|
|
223
|
+
for (const { repo, num } of WATCHED_ISSUES) {
|
|
224
|
+
try {
|
|
225
|
+
const issue = await ghApi('/repos/' + repo + '/issues/' + num);
|
|
226
|
+
const key = repo + '#' + num;
|
|
227
|
+
const prev = knownComments[key] || 0;
|
|
228
|
+
|
|
229
|
+
if (issue.comments > prev) {
|
|
230
|
+
console.log(key + ': ' + (issue.comments - prev) + ' new comment(s)');
|
|
231
|
+
|
|
232
|
+
// Read latest comment
|
|
233
|
+
const comments = await ghApi('/repos/' + repo + '/issues/' + num + '/comments?per_page=1&page=' + issue.comments);
|
|
234
|
+
const latest = comments[0];
|
|
235
|
+
if (latest && latest.user.login !== 'IgorGanapolsky') {
|
|
236
|
+
const reply = 'Thanks for the response! ThumbGate adds PreToolUse enforcement — gates that block known-bad actions before execution. Thompson Sampling adapts confidence. Self-distillation auto-generates rules from outcomes.\n\n68 tools on [Smithery](https://smithery.ai/servers/rlhf-loop/thumbgate). Would love to explore integration.\n\nhttps://github.com/IgorGanapolsky/ThumbGate';
|
|
237
|
+
await ghPostComment(repo, num, reply);
|
|
238
|
+
console.log(' Replied to @' + latest.user.login);
|
|
239
|
+
report.ghIssues++;
|
|
240
|
+
}
|
|
241
|
+
} else {
|
|
242
|
+
console.log(key + ': no new comments');
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
knownComments[key] = issue.comments;
|
|
246
|
+
} catch (e) {
|
|
247
|
+
console.log(repo + '#' + num + ' error: ' + e.message);
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
// ── 5. Search for new repos ──
|
|
252
|
+
try {
|
|
253
|
+
const weekAgo = new Date(Date.now() - 7 * 86400000).toISOString().slice(0, 10);
|
|
254
|
+
const search = await ghApi('/search/repositories?q=agent+safety+OR+pretooluse+OR+claude+code+hooks+OR+mcp+gate+pushed:>' + weekAgo + '&sort=stars&order=desc&per_page=5');
|
|
255
|
+
const contacted = new Set(state.contactedRepos || []);
|
|
256
|
+
let opened = 0;
|
|
257
|
+
|
|
258
|
+
for (const repo of (search.items || [])) {
|
|
259
|
+
if (opened >= 2) break;
|
|
260
|
+
if (repo.stargazers_count < 3) continue;
|
|
261
|
+
if (contacted.has(repo.full_name)) continue;
|
|
262
|
+
if (repo.full_name.includes('IgorGanapolsky')) continue;
|
|
263
|
+
|
|
264
|
+
const body = 'Hey — noticed you\'re building in the AI agent safety space. [ThumbGate](https://github.com/IgorGanapolsky/ThumbGate) adds PreToolUse hooks that block known-bad actions before execution, with Thompson Sampling for adaptive gate confidence and self-distillation for auto-learning from outcomes.\n\n68 tools on [Smithery](https://smithery.ai/servers/rlhf-loop/thumbgate). Could be complementary — would love to explore integration.\n\nMIT licensed, free tier available.';
|
|
265
|
+
|
|
266
|
+
try {
|
|
267
|
+
await fetch('https://api.github.com/repos/' + repo.full_name + '/issues', {
|
|
268
|
+
method: 'POST',
|
|
269
|
+
headers: {
|
|
270
|
+
Authorization: 'token ' + GH_TOKEN,
|
|
271
|
+
Accept: 'application/vnd.github+json',
|
|
272
|
+
'Content-Type': 'application/json',
|
|
273
|
+
},
|
|
274
|
+
body: JSON.stringify({
|
|
275
|
+
title: 'Integration: ThumbGate enforcement layer for ' + repo.name,
|
|
276
|
+
body: body,
|
|
277
|
+
}),
|
|
278
|
+
});
|
|
279
|
+
console.log('Opened issue on ' + repo.full_name + ' (stars=' + repo.stargazers_count + ')');
|
|
280
|
+
contacted.add(repo.full_name);
|
|
281
|
+
opened++;
|
|
282
|
+
report.ghOutreach++;
|
|
283
|
+
} catch (e) {
|
|
284
|
+
console.log('Issue creation failed on ' + repo.full_name + ': ' + e.message);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
state.contactedRepos = [...contacted];
|
|
289
|
+
} catch (e) {
|
|
290
|
+
console.log('Repo search error: ' + e.message);
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
// ── 6. ThumbGate stats ──
|
|
294
|
+
try {
|
|
295
|
+
const repo = await ghApi('/repos/IgorGanapolsky/ThumbGate');
|
|
296
|
+
console.log('ThumbGate: stars=' + repo.stargazers_count + ' forks=' + repo.forks_count);
|
|
297
|
+
} catch (e) {
|
|
298
|
+
console.log('Stats error: ' + e.message);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
// ── 7. awesome-mcp PR ──
|
|
302
|
+
try {
|
|
303
|
+
const pr = await ghApi('/repos/punkpeye/awesome-mcp-servers/pulls/4474');
|
|
304
|
+
console.log('awesome-mcp#4474: state=' + pr.state + ' merged=' + pr.merged);
|
|
305
|
+
} catch (e) {
|
|
306
|
+
console.log('PR check error: ' + e.message);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
state.issueComments = knownComments;
|
|
310
|
+
} else {
|
|
311
|
+
console.log('GitHub: skipped (no token)');
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
// ── Save state ──
|
|
315
|
+
state.lastRun = new Date().toISOString();
|
|
316
|
+
saveState(state);
|
|
317
|
+
|
|
318
|
+
// ── Report ──
|
|
319
|
+
console.log('\n=== REPORT ===');
|
|
320
|
+
console.log('Tweets: ' + report.tweets);
|
|
321
|
+
console.log('Replies: ' + report.replies);
|
|
322
|
+
console.log('LinkedIn: ' + report.linkedin);
|
|
323
|
+
console.log('GitHub issues responded: ' + report.ghIssues);
|
|
324
|
+
console.log('GitHub outreach opened: ' + report.ghOutreach);
|
|
325
|
+
console.log('=== DONE ===');
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
main().catch(e => {
|
|
329
|
+
console.error('Ralph Mode CI fatal error:', e.message);
|
|
330
|
+
process.exit(1);
|
|
331
|
+
});
|
package/scripts/rate-limiter.js
CHANGED
|
@@ -5,6 +5,8 @@ const fs = require('fs');
|
|
|
5
5
|
const path = require('path');
|
|
6
6
|
const {
|
|
7
7
|
PRO_MONTHLY_PAYMENT_LINK,
|
|
8
|
+
PRO_PRICE_LABEL,
|
|
9
|
+
TEAM_PRICE_LABEL,
|
|
8
10
|
} = require('./commercial-offer');
|
|
9
11
|
|
|
10
12
|
const USAGE_FILE = path.join(process.env.HOME || '/tmp', '.thumbgate', 'usage-limits.json');
|
|
@@ -20,7 +22,7 @@ const FREE_TIER_LIMITS = {
|
|
|
20
22
|
|
|
21
23
|
const FREE_TIER_MAX_GATES = 5;
|
|
22
24
|
|
|
23
|
-
const UPGRADE_MESSAGE = `
|
|
25
|
+
const UPGRADE_MESSAGE = `Pro: ${PRO_PRICE_LABEL} — dashboard and DPO export: ${PRO_MONTHLY_PAYMENT_LINK}\n Team: ${TEAM_PRICE_LABEL} after workflow qualification.`;
|
|
24
26
|
|
|
25
27
|
function isProTier(authContext) {
|
|
26
28
|
if (authContext && authContext.tier === 'pro') return true;
|
|
@@ -151,13 +151,23 @@ async function main() {
|
|
|
151
151
|
const messages = [
|
|
152
152
|
{
|
|
153
153
|
to: 'game-of-kton',
|
|
154
|
-
subject: '
|
|
155
|
-
text: 'Hey
|
|
154
|
+
subject: 'Quick question about your agent workflow',
|
|
155
|
+
text: 'Hey — you left some really thoughtful comments on the AI coding agent thread. I\'m building ThumbGate (agent mistake prevention via PreToolUse hooks) and your feedback was the most useful I got.\n\nI\'m trying to figure out if this is worth building further. Would you be open to a quick 15-min call this week? Just want to understand how you handle agent mistakes in your workflow.\n\nI\'ll give you lifetime Pro access regardless — no strings attached.\n\nHere\'s the repo if you want to look first: https://github.com/IgorGanapolsky/ThumbGate'
|
|
156
156
|
},
|
|
157
157
|
{
|
|
158
158
|
to: 'Deep_Ad1959',
|
|
159
|
-
subject: '
|
|
160
|
-
text: 'Hey
|
|
159
|
+
subject: 'Your context-dependent blocking idea',
|
|
160
|
+
text: 'Hey — your point about context-dependent blocking was really insightful. That\'s exactly the problem I\'m trying to solve with ThumbGate (using Thompson Sampling for adaptive gates instead of hard binary blocks).\n\nWould you be open to a quick 15-min call this week? I\'m trying to figure out what developers would actually pay for in this space. Your perspective would be genuinely valuable.\n\nLifetime Pro access is yours either way. Repo: https://github.com/IgorGanapolsky/ThumbGate'
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
to: 'leogodin217',
|
|
164
|
+
subject: 'Quick question about AI agent safety in your workflow',
|
|
165
|
+
text: 'Hey — you engaged with one of my posts about AI coding agent tooling and your take stood out. I\'m building ThumbGate (prevents AI agents from repeating mistakes via automated prevention rules).\n\nI\'m at the stage where I need honest feedback from people who actually use agents daily. Would you do a quick 15-min call this week? Just want to understand your pain points.\n\nLifetime Pro access is yours regardless. Repo: https://github.com/IgorGanapolsky/ThumbGate'
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
to: 'Enthu-Cutlet-1337',
|
|
169
|
+
subject: 'Quick question about your AI coding agent setup',
|
|
170
|
+
text: 'Hey — you commented on one of my posts about agent memory/safety tooling and your feedback was one of the few that was genuinely useful.\n\nI\'m building ThumbGate (automated mistake prevention for AI coding agents) and I\'m trying to figure out if this solves a real problem or if everyone just uses CLAUDE.md files. Would you be open to a quick 15-min call this week?\n\nLifetime Pro access is yours either way — no pitch, just questions. Repo: https://github.com/IgorGanapolsky/ThumbGate'
|
|
161
171
|
}
|
|
162
172
|
];
|
|
163
173
|
|