thumbgate 1.40.10 → 1.40.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/.well-known/mcp/server-card.json +1 -1
- package/README.md +46 -40
- package/adapters/claude/.mcp.json +3 -3
- package/adapters/forge/forge.yaml +3 -3
- package/adapters/future-agi/.mcp.json +1 -1
- package/adapters/future-agi/config.toml +1 -1
- package/adapters/future-agi/opencode.json +1 -1
- package/adapters/herdr/herdr-plugin.toml +2 -2
- package/adapters/mcp/server-stdio.js +1 -1
- package/adapters/opencode/opencode.json +1 -1
- package/bin/cli.js +9 -8
- package/bin/postinstall.js +2 -2
- package/config/unit-costs.json +47 -0
- package/package.json +16 -5
- package/public/admin.html +284 -29
- package/public/agent-manager.html +2 -2
- package/public/agents-cost-savings.html +1 -1
- package/public/codex-enterprise.html +2 -2
- package/public/compare.html +3 -3
- package/public/dashboard.html +28 -9
- package/public/diagnostic.html +1 -1
- package/public/founders.html +1 -1
- package/public/guide.html +4 -4
- package/public/index.html +80 -116
- package/public/install.html +19 -19
- package/public/js/connect-panel.js +21 -7
- package/public/learn.html +8 -0
- package/public/lessons.html +1 -1
- package/public/numbers.html +2 -2
- package/public/pricing.html +12 -9
- package/public/pro.html +96 -137
- package/public/project-switcher.js +50 -19
- package/scripts/auto-wire-hooks.js +36 -2
- package/scripts/billing.js +3 -1
- package/scripts/cli-schema.js +2 -3
- package/scripts/commercial-offer.js +1 -1
- package/scripts/cost-meter.js +161 -0
- package/scripts/gates-engine.js +26 -8
- package/scripts/hook-runtime.js +18 -1
- package/scripts/mailer/resend-mailer.js +2 -0
- package/scripts/owner-admin.js +338 -16
- package/scripts/owner-alerts.js +79 -0
- package/scripts/owner-telemetry.js +113 -3
- package/scripts/pr-manager.js +156 -41
- package/scripts/project-catalog.js +3 -1
- package/scripts/project-identity.js +10 -2
- package/scripts/seo-gsd.js +1 -1
- package/scripts/telemetry-analytics.js +7 -1
- package/scripts/unit-economics.js +138 -0
- package/server.json +2 -2
- package/src/api/server.js +62 -4
- package/src/mcp-writeguard.js +2 -2
package/scripts/billing.js
CHANGED
|
@@ -2422,7 +2422,9 @@ async function listStripeReconciledRevenueEvents({ signal, deadline = Infinity }
|
|
|
2422
2422
|
// qualified checkout start.
|
|
2423
2423
|
function classifyCheckoutSessionDepth(session) {
|
|
2424
2424
|
if (!session || typeof session !== 'object') return 'raw';
|
|
2425
|
-
|
|
2425
|
+
// Session completion can precede asynchronous payment settlement.
|
|
2426
|
+
// Only the payment status supports the paid bucket.
|
|
2427
|
+
if (session.payment_status === 'paid') return 'paid';
|
|
2426
2428
|
if (normalizeText(session.payment_intent) || normalizeText(session.setup_intent)) return 'payment_attempt';
|
|
2427
2429
|
const email = normalizeText(session.customer_details?.email) || normalizeText(session.customer_email);
|
|
2428
2430
|
if (email && !isSyntheticOrOwnerCheckoutEmail(email)) return 'identified';
|
package/scripts/cli-schema.js
CHANGED
|
@@ -814,7 +814,6 @@ const CLI_COMMANDS = [
|
|
|
814
814
|
flags: [],
|
|
815
815
|
},
|
|
816
816
|
{
|
|
817
|
-
<<<<<<< HEAD
|
|
818
817
|
name: 'cuda-gate',
|
|
819
818
|
aliases: ['cuda-gate-batch'],
|
|
820
819
|
description: 'CUDA-inspired parallel PreToolUse gate evaluation (SIMT + shared-memory hot cache)',
|
|
@@ -837,12 +836,12 @@ const CLI_COMMANDS = [
|
|
|
837
836
|
{ name: 'json', type: 'boolean', description: 'Output as JSON' },
|
|
838
837
|
{ name: 'memory-dir', type: 'string', description: 'Custom memory directory path' },
|
|
839
838
|
],
|
|
840
|
-
|
|
839
|
+
},
|
|
840
|
+
{
|
|
841
841
|
name: 'cursor-shell-gate',
|
|
842
842
|
description: 'Cursor beforeShellExecution hook: map command JSON to gate pipeline and emit permission allow/deny',
|
|
843
843
|
group: 'gates',
|
|
844
844
|
flags: [],
|
|
845
|
-
>>>>>>> c47af0f9f (feat(cursor): add beforeShellExecution adapter for gate-check)
|
|
846
845
|
},
|
|
847
846
|
{
|
|
848
847
|
name: 'force-gate',
|
|
@@ -78,7 +78,7 @@ function buildCaptureReceipt({ signal, feedbackId, memoryId, actionType } = {})
|
|
|
78
78
|
' Next proof : npx thumbgate stats',
|
|
79
79
|
' Cost proof : npx thumbgate cost',
|
|
80
80
|
'',
|
|
81
|
-
` Solo Pro : ${PRO_PRICE_LABEL} for
|
|
81
|
+
` Solo Pro : ${PRO_PRICE_LABEL} for every learned rule, unlimited thumbs, recall, lesson search, and exports`,
|
|
82
82
|
` Upgrade : ${trackedProUrl('cli_capture_receipt', actionType || normalizedSignal.toLowerCase())}`,
|
|
83
83
|
` Enterprise : ${ENTERPRISE_PRICE_LABEL}; start with one repeated workflow failure`,
|
|
84
84
|
` ${ENTERPRISE_ENTRY_URL}`,
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Cost meter: what it costs to run ThumbGate's hosted service, measured from inside the container for free.
|
|
4
|
+
//
|
|
5
|
+
// Railway bills each service by the minute for the vCPU and memory it uses. This meter samples the container's own
|
|
6
|
+
// cgroup counters once a minute (falling back to this Node process when the cgroup files are not readable), keeps
|
|
7
|
+
// one row per UTC day for 35 days in <feedbackDir>/cost-meter.json, and counts emails the mailer sent. Nothing here
|
|
8
|
+
// calls a paid API, and no address, subject or customer identity is stored: only daily totals.
|
|
9
|
+
//
|
|
10
|
+
// The owner console turns these totals into dollars with the list rates in config/unit-costs.json.
|
|
11
|
+
|
|
12
|
+
const fs = require('node:fs');
|
|
13
|
+
const path = require('node:path');
|
|
14
|
+
|
|
15
|
+
const FILE = 'cost-meter.json';
|
|
16
|
+
const KEEP_DAYS = 35;
|
|
17
|
+
const MAX_FILE_BYTES = 256 * 1024;
|
|
18
|
+
const state = { feedbackDir: null, days: {}, loaded: false, last: null, timer: null };
|
|
19
|
+
|
|
20
|
+
const dayKey = (ms) => new Date(ms).toISOString().slice(0, 10);
|
|
21
|
+
const finite = (n) => (Number.isFinite(n) && n >= 0 ? n : 0);
|
|
22
|
+
|
|
23
|
+
function readFileSafe(file) {
|
|
24
|
+
try {
|
|
25
|
+
const stat = fs.statSync(file);
|
|
26
|
+
if (!stat.isFile() || stat.size > MAX_FILE_BYTES) return null;
|
|
27
|
+
return JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
28
|
+
} catch { return null; }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function cleanDays(raw) {
|
|
32
|
+
const out = {};
|
|
33
|
+
for (const [key, row] of Object.entries(raw && typeof raw === 'object' ? raw : {})) {
|
|
34
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(key) || !row || typeof row !== 'object') continue;
|
|
35
|
+
out[key] = { sampledSeconds: finite(row.sampledSeconds), cpuSeconds: finite(row.cpuSeconds), memoryGbSeconds: finite(row.memoryGbSeconds), emails: Math.floor(finite(row.emails)), source: typeof row.source === 'string' ? row.source.slice(0, 16) : null };
|
|
36
|
+
}
|
|
37
|
+
return out;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function prune(days, nowMs) {
|
|
41
|
+
const oldest = dayKey(nowMs - KEEP_DAYS * 86400000);
|
|
42
|
+
for (const key of Object.keys(days)) if (key < oldest) delete days[key];
|
|
43
|
+
return days;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function load() {
|
|
47
|
+
if (state.loaded || !state.feedbackDir) return;
|
|
48
|
+
state.loaded = true;
|
|
49
|
+
const saved = readFileSafe(path.join(state.feedbackDir, FILE));
|
|
50
|
+
// Counts made before the file was read (for example an email sent during start-up) are added to what was saved.
|
|
51
|
+
const saved_days = cleanDays(saved?.days);
|
|
52
|
+
for (const [key, row] of Object.entries(state.days)) {
|
|
53
|
+
const into = saved_days[key] || (saved_days[key] = { sampledSeconds: 0, cpuSeconds: 0, memoryGbSeconds: 0, emails: 0, source: row.source });
|
|
54
|
+
into.sampledSeconds += row.sampledSeconds; into.cpuSeconds += row.cpuSeconds; into.memoryGbSeconds += row.memoryGbSeconds; into.emails += row.emails;
|
|
55
|
+
}
|
|
56
|
+
state.days = saved_days;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function flush(nowMs = Date.now()) {
|
|
60
|
+
if (!state.feedbackDir) return false;
|
|
61
|
+
load();
|
|
62
|
+
prune(state.days, nowMs);
|
|
63
|
+
const file = path.join(state.feedbackDir, FILE);
|
|
64
|
+
const tmp = `${file}.${process.pid}.tmp`;
|
|
65
|
+
try {
|
|
66
|
+
fs.mkdirSync(state.feedbackDir, { recursive: true });
|
|
67
|
+
fs.writeFileSync(tmp, JSON.stringify({ version: 1, updatedAt: new Date(nowMs).toISOString(), days: state.days }));
|
|
68
|
+
fs.renameSync(tmp, file);
|
|
69
|
+
return true;
|
|
70
|
+
} catch {
|
|
71
|
+
try { fs.rmSync(tmp, { force: true }); } catch { /* nothing to clean */ }
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function row(nowMs, source) {
|
|
77
|
+
const key = dayKey(nowMs);
|
|
78
|
+
return state.days[key] || (state.days[key] = { sampledSeconds: 0, cpuSeconds: 0, memoryGbSeconds: 0, emails: 0, source });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// Container counters when Railway's cgroup v2 files are readable, else this process. Returns null when nothing is readable.
|
|
82
|
+
function readCounters({ cgroupRoot = '/sys/fs/cgroup', proc = process } = {}) {
|
|
83
|
+
try {
|
|
84
|
+
const stat = fs.readFileSync(path.join(cgroupRoot, 'cpu.stat'), 'utf8');
|
|
85
|
+
const usage = /usage_usec\s+(\d+)/.exec(stat);
|
|
86
|
+
const memory = Number(fs.readFileSync(path.join(cgroupRoot, 'memory.current'), 'utf8').trim());
|
|
87
|
+
if (usage && Number.isFinite(memory)) return { source: 'container', cpuSeconds: Number(usage[1]) / 1e6, memoryBytes: memory };
|
|
88
|
+
} catch { /* not a cgroup v2 container */ }
|
|
89
|
+
try {
|
|
90
|
+
const cpu = proc.cpuUsage();
|
|
91
|
+
return { source: 'process', cpuSeconds: (cpu.user + cpu.system) / 1e6, memoryBytes: proc.memoryUsage().rss };
|
|
92
|
+
} catch { return null; }
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
// One sample: CPU used since the last sample, and memory held for the time between them.
|
|
96
|
+
function sample({ nowMs = Date.now(), counters = readCounters() } = {}) {
|
|
97
|
+
if (!counters) return null;
|
|
98
|
+
const last = state.last;
|
|
99
|
+
state.last = { at: nowMs, ...counters };
|
|
100
|
+
if (!last || last.source !== counters.source) return null;
|
|
101
|
+
const seconds = (nowMs - last.at) / 1000;
|
|
102
|
+
const cpu = counters.cpuSeconds - last.cpuSeconds;
|
|
103
|
+
// A restart, a clock jump or a counter reset gives a gap or a negative step: skip it rather than guess.
|
|
104
|
+
if (!(seconds > 0 && seconds <= 600) || !(cpu >= 0)) return null;
|
|
105
|
+
load();
|
|
106
|
+
const into = row(nowMs, counters.source);
|
|
107
|
+
into.sampledSeconds += seconds;
|
|
108
|
+
into.cpuSeconds += cpu;
|
|
109
|
+
into.memoryGbSeconds += ((last.memoryBytes + counters.memoryBytes) / 2 / 1e9) * seconds;
|
|
110
|
+
into.source = counters.source;
|
|
111
|
+
return { seconds, cpuSeconds: cpu };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function recordEmailSend({ nowMs = Date.now(), count = 1 } = {}) {
|
|
115
|
+
if (!Number.isInteger(count) || count < 1) return;
|
|
116
|
+
load();
|
|
117
|
+
row(nowMs, state.last?.source || null).emails += count;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function configure({ feedbackDir } = {}) {
|
|
121
|
+
if (feedbackDir && feedbackDir !== state.feedbackDir) { state.feedbackDir = feedbackDir; state.loaded = false; }
|
|
122
|
+
return state.feedbackDir;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function start({ feedbackDir, intervalMs = 60000 } = {}) {
|
|
126
|
+
configure({ feedbackDir });
|
|
127
|
+
if (state.timer) return state.timer;
|
|
128
|
+
sample();
|
|
129
|
+
state.timer = setInterval(() => { sample(); flush(); }, intervalMs);
|
|
130
|
+
state.timer.unref?.();
|
|
131
|
+
return state.timer;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function stop() { if (state.timer) clearInterval(state.timer); state.timer = null; }
|
|
135
|
+
|
|
136
|
+
function reset() { stop(); state.feedbackDir = null; state.days = {}; state.loaded = false; state.last = null; }
|
|
137
|
+
|
|
138
|
+
// Totals for the last `days` UTC days, today included, read from disk plus anything not yet written.
|
|
139
|
+
function readWindow({ feedbackDir = state.feedbackDir, days = 30, nowMs = Date.now() } = {}) {
|
|
140
|
+
let rows = {};
|
|
141
|
+
if (feedbackDir && feedbackDir === state.feedbackDir) { load(); rows = state.days; }
|
|
142
|
+
else if (feedbackDir) rows = cleanDays(readFileSafe(path.join(feedbackDir, FILE))?.days);
|
|
143
|
+
const oldest = dayKey(nowMs - (days - 1) * 86400000);
|
|
144
|
+
const total = { days, daysWithSamples: 0, sampledSeconds: 0, cpuSeconds: 0, memoryGbSeconds: 0, emails: 0, sources: [] };
|
|
145
|
+
const sources = new Set();
|
|
146
|
+
for (const [key, entry] of Object.entries(rows)) {
|
|
147
|
+
if (key < oldest || key > dayKey(nowMs)) continue;
|
|
148
|
+
if (entry.sampledSeconds > 0) total.daysWithSamples += 1;
|
|
149
|
+
total.sampledSeconds += entry.sampledSeconds;
|
|
150
|
+
total.cpuSeconds += entry.cpuSeconds;
|
|
151
|
+
total.memoryGbSeconds += entry.memoryGbSeconds;
|
|
152
|
+
total.emails += entry.emails;
|
|
153
|
+
if (entry.source) sources.add(entry.source);
|
|
154
|
+
}
|
|
155
|
+
total.sources = [...sources].sort();
|
|
156
|
+
total.windowSeconds = days * 86400;
|
|
157
|
+
total.coverage = Math.min(1, total.sampledSeconds / total.windowSeconds);
|
|
158
|
+
return total;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
module.exports = { configure, start, stop, reset, sample, flush, recordEmailSend, readWindow, readCounters, FILE };
|
package/scripts/gates-engine.js
CHANGED
|
@@ -80,6 +80,7 @@ const {
|
|
|
80
80
|
redactText,
|
|
81
81
|
isSafeSecretStorageWrite,
|
|
82
82
|
SAFE_SECRET_STORAGE_DIRS,
|
|
83
|
+
SECRET_FILE_PATTERNS,
|
|
83
84
|
} = require('./secret-scanner');
|
|
84
85
|
const {
|
|
85
86
|
evaluateSecurityScan,
|
|
@@ -4250,12 +4251,24 @@ function evaluateGatesInner(toolName, toolInput, configPath, options = {}) {
|
|
|
4250
4251
|
// Turn a secret-exfiltration block into actionable guidance that names the
|
|
4251
4252
|
// safe path, instead of a dead-end that drives agents toward brittle
|
|
4252
4253
|
// workarounds (e.g. writing secrets to /tmp). The vault dirs referenced here
|
|
4253
|
-
//
|
|
4254
|
-
// from enforcement.
|
|
4255
|
-
|
|
4256
|
-
|
|
4257
|
-
|
|
4258
|
-
|
|
4254
|
+
// come from the SAME constant the scanner whitelists, so the hint can never
|
|
4255
|
+
// drift from enforcement. `.resume_secrets` stays whitelisted for existing
|
|
4256
|
+
// installs but is a legacy, operator-specific name, so it is not advertised.
|
|
4257
|
+
const LEGACY_SECRET_STORAGE_DIRS = new Set(['.resume_secrets']);
|
|
4258
|
+
const SECRET_FILE_FINDING_IDS = new Set((SECRET_FILE_PATTERNS || []).map((pattern) => pattern.id));
|
|
4259
|
+
|
|
4260
|
+
function listAdvertisedVaultDirs() {
|
|
4261
|
+
const dirs = (SAFE_SECRET_STORAGE_DIRS || []).filter((dir) => !LEGACY_SECRET_STORAGE_DIRS.has(dir));
|
|
4262
|
+
return (dirs.length ? dirs : ['.thumbgate/secrets']).map((dir) => `~/${dir}`);
|
|
4263
|
+
}
|
|
4264
|
+
|
|
4265
|
+
function isSecretFileReadOnly(findings = []) {
|
|
4266
|
+
return findings.length > 0 && findings.every((finding) => SECRET_FILE_FINDING_IDS.has(finding.id));
|
|
4267
|
+
}
|
|
4268
|
+
|
|
4269
|
+
function buildSecretRemediation(toolName = '', toolInput = {}, findings = []) {
|
|
4270
|
+
const vaultDirs = listAdvertisedVaultDirs();
|
|
4271
|
+
const vaultList = vaultDirs.join(', ');
|
|
4259
4272
|
|
|
4260
4273
|
if (EDIT_LIKE_TOOLS && EDIT_LIKE_TOOLS.has(toolName)) {
|
|
4261
4274
|
const target = toolInput.file_path || toolInput.path || toolInput.filePath || toolInput.target_path;
|
|
@@ -4265,6 +4278,11 @@ function buildSecretRemediation(toolName = '', toolInput = {}) {
|
|
|
4265
4278
|
+ `Do not route around this by writing to /tmp or another path — that leaves the secret in a world-readable location and does not make it safe.`;
|
|
4266
4279
|
}
|
|
4267
4280
|
|
|
4281
|
+
if (toolName === 'Bash' && isSecretFileReadOnly(findings)) {
|
|
4282
|
+
return `Do not print or send a credentials file — its contents would land in the session transcript and logs. `
|
|
4283
|
+
+ `Let the code load those values at runtime (for example from environment variables), or ask the user which specific setting you need.`;
|
|
4284
|
+
}
|
|
4285
|
+
|
|
4268
4286
|
if (toolName === 'Bash') {
|
|
4269
4287
|
return `Do not inline a live secret literal into a shell command — it leaks into shell history and process args. `
|
|
4270
4288
|
+ `Instead, store the value with the Write tool to a file under ${vaultList}, then reference it via an environment variable or by reading that file at runtime.`;
|
|
@@ -4274,7 +4292,7 @@ function buildSecretRemediation(toolName = '', toolInput = {}) {
|
|
|
4274
4292
|
}
|
|
4275
4293
|
|
|
4276
4294
|
function buildSecretGuardResult(scanResult, context = {}) {
|
|
4277
|
-
const remediation = buildSecretRemediation(context.toolName, context.toolInput || {});
|
|
4295
|
+
const remediation = buildSecretRemediation(context.toolName, context.toolInput || {}, scanResult.findings || []);
|
|
4278
4296
|
const summary = buildSafeSummary(
|
|
4279
4297
|
scanResult.findings,
|
|
4280
4298
|
'Blocked because the action appears to expose secret material'
|
|
@@ -5078,7 +5096,7 @@ function buildBlockActionProCta() {
|
|
|
5078
5096
|
return '\n\n💡 Pro: keep this rule searchable, exportable, and visible → thumbgate.ai/go/pro';
|
|
5079
5097
|
}
|
|
5080
5098
|
if (totalBlocks < 100) {
|
|
5081
|
-
return `\n\n💡 ${totalBlocks} actions blocked. Pro
|
|
5099
|
+
return `\n\n💡 ${totalBlocks} actions blocked. Pro keeps every learned rule active and adds recall and exports → thumbgate.ai/go/pro ($19/mo)`;
|
|
5082
5100
|
}
|
|
5083
5101
|
return `\n\n💡 ${totalBlocks} mistakes caught. Your team could use Enterprise shared hosted enforcement → thumbgate.ai/go/pro`;
|
|
5084
5102
|
} catch (_) {
|
package/scripts/hook-runtime.js
CHANGED
|
@@ -34,9 +34,25 @@ function publishedHookCommandsAvailable(version) {
|
|
|
34
34
|
return available;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
// A linked git worktree (or anything under .thumbgate-worktrees) is deleted after merge.
|
|
38
|
+
// A hook that points inside one breaks every tool call once it is gone (23 Nov 2026).
|
|
39
|
+
function isDisposableCheckout(root) {
|
|
40
|
+
const normalized = String(root).split(path.sep).join('/');
|
|
41
|
+
if (normalized.includes('/.thumbgate-worktrees/') || normalized.includes('/worktrees/')) return true;
|
|
42
|
+
try {
|
|
43
|
+
return fs.statSync(path.join(root, '.git')).isFile();
|
|
44
|
+
} catch {
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
37
49
|
function resolveCliCommand(subcommand) {
|
|
38
|
-
// Source checkout:
|
|
50
|
+
// Source checkout: direct node command for development, but never from a disposable
|
|
51
|
+
// worktree. Those get the stable launcher at ~/.thumbgate/bin/thumbgate-hook.
|
|
39
52
|
if (isSourceCheckout(PKG_ROOT)) {
|
|
53
|
+
if (isDisposableCheckout(PKG_ROOT)) {
|
|
54
|
+
return `${shellQuote(shimPath())} ${subcommand}`;
|
|
55
|
+
}
|
|
40
56
|
return `node ${shellQuote(path.join(PKG_ROOT, 'bin', 'cli.js'))} ${subcommand}`;
|
|
41
57
|
}
|
|
42
58
|
// Prefer stable shim — always resolves @latest, survives version bumps
|
|
@@ -153,4 +169,5 @@ module.exports = {
|
|
|
153
169
|
statuslineCommand,
|
|
154
170
|
userPromptHookCommand,
|
|
155
171
|
cursorShellGateHookCommand,
|
|
172
|
+
isDisposableCheckout,
|
|
156
173
|
};
|
|
@@ -277,6 +277,8 @@ async function sendEmail({ to, subject, html, text, from, replyTo, idempotencyKe
|
|
|
277
277
|
console.warn(`[mailer] Resend returned ${res.status}:`, bodyText);
|
|
278
278
|
return { sent: false, reason: 'api_error', status: res.status, body: bodyJson || bodyText };
|
|
279
279
|
}
|
|
280
|
+
// Daily send count for the owner console's delivery cost. A count only: nothing about the message is kept.
|
|
281
|
+
try { require('../cost-meter').recordEmailSend(); } catch { /* best-effort */ }
|
|
280
282
|
return buildSendSuccess({ bodyJson, status: res.status, senderFallback: sender.senderFallback });
|
|
281
283
|
} catch (err) {
|
|
282
284
|
// eslint-disable-next-line no-console
|