thumbgate 1.39.1 → 1.40.2
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/llms.txt +2 -2
- package/.well-known/mcp/server-card.json +1 -1
- package/README.md +5 -4
- package/adapters/claude/.mcp.json +6 -2
- package/adapters/codex/config.toml +5 -0
- package/adapters/forge/forge.yaml +4 -4
- 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 +82 -7
- package/adapters/opencode/opencode.json +1 -1
- package/bin/cli.js +128 -15
- package/config/brand-standards.json +131 -0
- package/config/gates/default.json +18 -1
- package/config/github-about.json +1 -1
- package/config/mcp-allowlists.json +16 -3
- package/config/merge-quality-checks.json +1 -0
- package/config/post-deploy-marketing-pages.json +3 -3
- package/config/schemas/task-outcome-receipt.schema.json +9 -0
- package/openapi/openapi.yaml +7 -3
- package/package.json +98 -31
- package/public/about.html +2 -2
- package/public/admin.html +771 -0
- package/public/agent-manager.html +3 -3
- package/public/agents-cost-savings.html +1 -1
- package/public/ai-malpractice-prevention.html +12 -12
- package/public/architecture.html +0 -1
- package/public/assets/diagrams/decision.svg +3 -3
- package/public/blog/2026-10-05-why-3-days-of-triage-wont-save-ai-speed-code.html +1 -1
- package/public/blog/2026-10-09-your-code-got-a-third-author-governance.html +1 -1
- package/public/blog/git-at-agent-scale.html +2 -2
- package/public/blog/inside-your-boundary.html +1 -1
- package/public/blog/process-over-outcome-gates.html +1 -1
- package/public/case-studies.html +1 -2
- package/public/codex-enterprise.html +1 -1
- package/public/codex-plugin.html +1 -1
- package/public/dashboard.html +773 -481
- package/public/diagnostic.html +8 -3
- package/public/enterprise-governance.html +26 -174
- package/public/eval-scorecard.html +3 -4
- package/public/eval-scorecard.json +2 -2
- package/public/evaluations.html +0 -1
- package/public/founders.html +3 -3
- package/public/gaming-playbook.html +4 -4
- package/public/guide.html +3 -5
- package/public/index.html +181 -205
- package/public/install.html +12 -11
- package/public/js/buyer-intent.js +49 -8
- package/public/lessons.html +103 -46
- package/public/numbers.html +32 -33
- package/public/operator-framework.html +44 -72
- package/public/peter.html +3 -3
- package/public/platform-partners.html +1 -1
- package/public/pricing.html +61 -327
- package/public/pro.html +3 -1
- package/public/project-switcher.js +76 -0
- package/public/whitepaper.html +1 -2
- package/scripts/activation-quickstart.js +15 -3
- package/scripts/activation-tracker.js +280 -3
- package/scripts/agent-action-inventory.js +235 -143
- package/scripts/agent-operations-planner.js +1 -1
- package/scripts/agent-readiness.js +36 -6
- package/scripts/agentic-prompt-pipelines.js +901 -0
- package/scripts/analytics-report.js +363 -0
- package/scripts/analytics-window.js +7 -1
- package/scripts/async-job-runner.js +66 -11
- package/scripts/audit-trail.js +37 -24
- package/scripts/auto-context-packs.js +249 -0
- package/scripts/auto-promote-gates.js +37 -27
- package/scripts/backfill-lesson-scopes.js +122 -0
- package/scripts/billing-setup.js +137 -0
- package/scripts/billing.js +889 -132
- package/scripts/bot-detection.js +112 -0
- package/scripts/brand-standards-gate.js +571 -0
- package/scripts/chatgpt-ads-readiness-pack.js +1 -1
- package/scripts/check-update.js +236 -0
- package/scripts/cli-schema.js +1 -1
- package/scripts/commercial-offer.js +2 -2
- package/scripts/contextfs.js +9 -3
- package/scripts/conversion-rate-stats.js +442 -0
- package/scripts/cost-cli.js +147 -0
- package/scripts/creator-campaigns.js +239 -0
- package/scripts/cross-encoder-reranker.js +4 -0
- package/scripts/cuda-gate-batch.js +560 -0
- package/scripts/daemon-manager.js +108 -0
- package/scripts/dashboard-chat.js +11 -0
- package/scripts/dashboard.js +576 -169
- package/scripts/decision-journal.js +7 -4
- package/scripts/delegation-runtime.js +1036 -0
- package/scripts/dispatch-brief.js +159 -0
- package/scripts/distribution-surfaces.js +110 -0
- package/scripts/docker-sandbox-planner.js +3 -3
- package/scripts/egm-goldfish-packet.js +95 -0
- package/scripts/embeddinggemma-adapter.js +407 -0
- package/scripts/export-dpo-pairs.js +12 -7
- package/scripts/feedback-aggregate.js +4 -0
- package/scripts/feedback-attribution.js +6 -4
- package/scripts/feedback-history-distiller.js +18 -6
- package/scripts/feedback-loop.js +255 -89
- package/scripts/feedback-paths.js +8 -1
- package/scripts/feedback-sanitizer.js +5 -0
- package/scripts/feedback-scope.js +106 -0
- package/scripts/feedback-session.js +8 -2
- package/scripts/filesystem-search.js +13 -8
- package/scripts/financial-control-plane.js +707 -45
- package/scripts/funnel-analytics.js +35 -0
- package/scripts/gate-semantic-layer.js +292 -0
- package/scripts/gate-stats.js +8 -2
- package/scripts/gates-engine.js +694 -230
- package/scripts/generate-eval-scorecard.js +0 -1
- package/scripts/harness-tool-names.js +31 -5
- package/scripts/hybrid-feedback-context.js +5 -2
- package/scripts/implementation-notes.js +241 -0
- package/scripts/intent-router.js +518 -0
- package/scripts/intervention-policy.js +2 -1
- package/scripts/latency-budget.js +164 -0
- package/scripts/lesson-canonical.js +2 -2
- package/scripts/lesson-db.js +55 -14
- package/scripts/lesson-graph.js +2 -1
- package/scripts/lesson-retrieval.js +95 -9
- package/scripts/lesson-search.js +86 -22
- package/scripts/lesson-synthesis.js +21 -5
- package/scripts/mailer/index.js +17 -1
- package/scripts/mailer/resend-mailer.js +213 -179
- package/scripts/mcp-writeguard.js +158 -0
- package/scripts/migrate-project-scope.js +209 -0
- package/scripts/model-candidates.js +414 -0
- package/scripts/openrouter-armor-partnership-diode.js +2419 -0
- package/scripts/operational-dashboard.js +172 -0
- package/scripts/operational-integrity.js +436 -3
- package/scripts/operational-summary.js +190 -0
- package/scripts/operator-artifacts.js +622 -0
- package/scripts/optimize-context.js +17 -0
- package/scripts/override-audit.js +2 -0
- package/scripts/owner-admin.js +338 -0
- package/scripts/pr-manager.js +194 -1
- package/scripts/predictive-insights.js +449 -0
- package/scripts/profound-aeo-citation-engine.js +583 -0
- package/scripts/progressive-signoff.js +260 -0
- package/scripts/project-catalog.js +243 -0
- package/scripts/project-dashboard.js +61 -0
- package/scripts/project-evidence.js +172 -0
- package/scripts/project-identity.js +182 -0
- package/scripts/project-scope.js +381 -0
- package/scripts/prompt-guard.js +446 -52
- package/scripts/proof-report.js +232 -0
- package/scripts/provider-action-normalizer.js +14 -6
- package/scripts/pulse.js +80 -0
- package/scripts/rate-limiter.js +41 -0
- package/scripts/rrsi-doctor.js +2698 -0
- package/scripts/secret-redaction.js +171 -25
- package/scripts/secret-scanner.js +101 -42
- package/scripts/self-protection.js +2 -2
- package/scripts/seo-gsd.js +14 -14
- package/scripts/session-context-dedupe.js +66 -0
- package/scripts/session-report.js +120 -0
- package/scripts/settings-hierarchy.js +4 -2
- package/scripts/statusline-meta.js +34 -23
- package/scripts/subagent-profiles.js +79 -0
- package/scripts/task-outcomes.js +29 -2
- package/scripts/telemetry-analytics.js +238 -13
- package/scripts/third-author-cli.js +118 -0
- package/scripts/third-author-governance.js +437 -0
- package/scripts/thumbgate-dream.js +878 -0
- package/scripts/thumbgate-search.js +23 -9
- package/scripts/tool-kpi-tracker.js +5 -2
- package/scripts/tool-registry.js +42 -1
- package/scripts/triage-savings-calculator.js +1 -1
- package/scripts/vector-store.js +4 -1
- package/scripts/verified-lessons.js +270 -0
- package/scripts/verify-marketing-pages-deployed.js +2 -2
- package/scripts/workflow-sentinel.js +29 -10
- package/server.json +2 -2
- package/skills/thumbgate-daily-discoveries/SKILL.md +25 -41
- package/src/api/server.js +2371 -451
- package/src/feedback.js +21 -0
- package/src/hermes-sync-plane.js +2 -1
- package/src/index.js +2 -0
- package/src/lesson-search.js +9 -0
- package/src/mckinsey-top-company-ai-coding.js +493 -0
- package/src/mcp/server.js +3 -0
- package/src/mcp-writeguard.js +772 -11
- package/src/openshell-lovable-engine.js +1475 -0
- package/src/task-outcome.js +3 -0
- package/config/evals/agent-safety-eval.json +0 -447
- package/config/evals/retrieval-ranking-golden.json +0 -522
- package/config/progressive/01-wire-only.json +0 -11
- package/config/progressive/02-dashboard-empty-ok.json +0 -10
- package/config/progressive/03-one-lesson.json +0 -10
- package/config/progressive/04-warn-fires.json +0 -11
- package/config/progressive/05-strict-optional.json +0 -11
- package/config/progressive/README.md +0 -15
- package/public/assets/diagrams/agent-integration.png +0 -0
- package/public/assets/diagrams/thumbgate-architecture.png +0 -0
- package/scripts/install-thumbgate-daily-publish-launchd.sh +0 -83
- package/scripts/thumbgate-daily-discoveries-publish.js +0 -461
- package/scripts/thumbgate-daily-discoveries-publish.sh +0 -18
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const path = require('path');
|
|
6
|
+
const https = require('https');
|
|
7
|
+
const { execSync } = require('child_process');
|
|
8
|
+
|
|
9
|
+
const PROJECT_ROOT = path.join(__dirname, '..');
|
|
10
|
+
const GITHUB_REPO = 'IgorGanapolsky/ThumbGate';
|
|
11
|
+
|
|
12
|
+
function getLocalVersion() {
|
|
13
|
+
try {
|
|
14
|
+
const pkg = JSON.parse(fs.readFileSync(path.join(PROJECT_ROOT, 'package.json'), 'utf8'));
|
|
15
|
+
return pkg.version;
|
|
16
|
+
} catch (_) {
|
|
17
|
+
return '0.0.0';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function httpsGetJson(url) {
|
|
22
|
+
const headers = { 'User-Agent': 'thumbgate-updater' };
|
|
23
|
+
let parsedUrl;
|
|
24
|
+
try {
|
|
25
|
+
parsedUrl = new URL(url);
|
|
26
|
+
} catch (_) {}
|
|
27
|
+
if (parsedUrl && parsedUrl.hostname === 'api.github.com' && process.env.GITHUB_TOKEN) {
|
|
28
|
+
headers['Authorization'] = `token ${process.env.GITHUB_TOKEN}`;
|
|
29
|
+
}
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
https.get(url, { headers, timeout: 5000 }, (res) => {
|
|
32
|
+
let data = '';
|
|
33
|
+
res.on('data', (chunk) => { data += chunk; });
|
|
34
|
+
res.on('end', () => {
|
|
35
|
+
if (res.statusCode >= 400) {
|
|
36
|
+
reject(new Error(`HTTP ${res.statusCode} for ${url}`));
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
resolve(JSON.parse(data));
|
|
41
|
+
} catch (e) {
|
|
42
|
+
reject(e);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}).on('error', reject).on('timeout', () => reject(new Error('Request timeout')));
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function parseVersion(v) {
|
|
50
|
+
return String(v || '').replace(/^v/, '').split('-')[0].split('.').map(Number);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function isNewer(current, latest) {
|
|
54
|
+
const cParts = parseVersion(current);
|
|
55
|
+
const lParts = parseVersion(latest);
|
|
56
|
+
for (let i = 0; i < 3; i++) {
|
|
57
|
+
const c = cParts[i] || 0;
|
|
58
|
+
const l = lParts[i] || 0;
|
|
59
|
+
if (l > c) return true;
|
|
60
|
+
if (c > l) return false;
|
|
61
|
+
}
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function isSourceCheckout() {
|
|
66
|
+
return fs.existsSync(path.join(PROJECT_ROOT, '.git'));
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const HOME = process.env.HOME || process.env.USERPROFILE || '';
|
|
70
|
+
const CACHE_DIR = path.join(HOME, '.thumbgate');
|
|
71
|
+
const CACHE_FILE = path.join(CACHE_DIR, 'update-cache.json');
|
|
72
|
+
|
|
73
|
+
async function getLatestReleaseInfo(force = false) {
|
|
74
|
+
if (!force && fs.existsSync(CACHE_FILE)) {
|
|
75
|
+
try {
|
|
76
|
+
const cached = JSON.parse(fs.readFileSync(CACHE_FILE, 'utf8'));
|
|
77
|
+
if (Date.now() - cached.timestamp < 24 * 60 * 60 * 1000) {
|
|
78
|
+
return cached.data;
|
|
79
|
+
}
|
|
80
|
+
} catch (_) {
|
|
81
|
+
// Ignore cache read errors
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// First attempt: NPM Registry (very reliable, fast, no rate limits)
|
|
86
|
+
let npmVersion = null;
|
|
87
|
+
try {
|
|
88
|
+
const npmMeta = await httpsGetJson('https://registry.npmjs.org/thumbgate/latest');
|
|
89
|
+
npmVersion = npmMeta.version;
|
|
90
|
+
} catch (_) {
|
|
91
|
+
// Ignore and let GitHub releases handle it or fall back
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
// Second attempt: GitHub releases for changelog / backup version check
|
|
95
|
+
let githubVersion = null;
|
|
96
|
+
let changelog = null;
|
|
97
|
+
let htmlUrl = null;
|
|
98
|
+
try {
|
|
99
|
+
const ghRelease = await httpsGetJson(`https://api.github.com/repos/${GITHUB_REPO}/releases/latest`);
|
|
100
|
+
githubVersion = ghRelease.tag_name ? ghRelease.tag_name.replace(/^v/, '') : null;
|
|
101
|
+
changelog = ghRelease.body || null;
|
|
102
|
+
htmlUrl = ghRelease.html_url || null;
|
|
103
|
+
} catch (_) {
|
|
104
|
+
// Ignore GitHub API errors (e.g. offline, rate-limited)
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
const latestVersion = npmVersion || githubVersion;
|
|
108
|
+
const data = {
|
|
109
|
+
latestVersion,
|
|
110
|
+
changelog,
|
|
111
|
+
htmlUrl,
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
if (latestVersion) {
|
|
115
|
+
try {
|
|
116
|
+
if (!fs.existsSync(CACHE_DIR)) {
|
|
117
|
+
fs.mkdirSync(CACHE_DIR, { recursive: true });
|
|
118
|
+
}
|
|
119
|
+
fs.writeFileSync(CACHE_FILE, JSON.stringify({
|
|
120
|
+
timestamp: Date.now(),
|
|
121
|
+
data,
|
|
122
|
+
}, null, 2), 'utf8');
|
|
123
|
+
} catch (_) {
|
|
124
|
+
// Ignore cache write errors
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return data;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
async function checkUpdate(options = {}) {
|
|
132
|
+
const current = getLocalVersion();
|
|
133
|
+
const verbose = options.verbose !== false;
|
|
134
|
+
const force = options.force || false;
|
|
135
|
+
|
|
136
|
+
if (verbose) {
|
|
137
|
+
console.log(`Checking for ThumbGate updates... (Current version: v${current})`);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
try {
|
|
141
|
+
const { latestVersion, changelog, htmlUrl } = await getLatestReleaseInfo(force);
|
|
142
|
+
|
|
143
|
+
if (!latestVersion) {
|
|
144
|
+
if (verbose) {
|
|
145
|
+
console.log('⚠️ Unable to check for updates. Please check your internet connection.');
|
|
146
|
+
}
|
|
147
|
+
return { updateAvailable: false, current, error: 'Offline or API error' };
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const updateAvailable = isNewer(current, latestVersion);
|
|
151
|
+
|
|
152
|
+
if (updateAvailable) {
|
|
153
|
+
if (verbose) {
|
|
154
|
+
console.log('\n┌────────────────────────────────────────────────────────┐');
|
|
155
|
+
console.log(`│ 🔔 A new version of ThumbGate is available: v${latestVersion.padEnd(8)} │`);
|
|
156
|
+
console.log(`│ Current version: v${current.padEnd(31)} │`);
|
|
157
|
+
console.log('├────────────────────────────────────────────────────────┤');
|
|
158
|
+
if (changelog) {
|
|
159
|
+
console.log('│ What\'s New: │');
|
|
160
|
+
const lines = changelog
|
|
161
|
+
.split('\n')
|
|
162
|
+
.map(line => line.trim())
|
|
163
|
+
.filter(line => line.startsWith('-') || line.startsWith('*'))
|
|
164
|
+
.slice(0, 5);
|
|
165
|
+
for (const line of lines) {
|
|
166
|
+
const truncated = line.length > 50 ? line.slice(0, 47) + '...' : line;
|
|
167
|
+
console.log(`│ ${truncated.padEnd(52)} │`);
|
|
168
|
+
}
|
|
169
|
+
if (lines.length > 0) {
|
|
170
|
+
console.log('├────────────────────────────────────────────────────────┤');
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
if (isSourceCheckout()) {
|
|
174
|
+
console.log('│ 👉 You are running from a source checkout. │');
|
|
175
|
+
console.log('│ To update, run: git pull │');
|
|
176
|
+
} else {
|
|
177
|
+
console.log('│ 👉 To install this update, run: │');
|
|
178
|
+
console.log('│ npm install -g thumbgate@latest │');
|
|
179
|
+
console.log('│ 👉 Or update in-place with: │');
|
|
180
|
+
console.log('│ npx thumbgate self-update │');
|
|
181
|
+
}
|
|
182
|
+
console.log('└────────────────────────────────────────────────────────┘\n');
|
|
183
|
+
}
|
|
184
|
+
return { updateAvailable: true, current, latest: latestVersion, changelog, htmlUrl };
|
|
185
|
+
} else {
|
|
186
|
+
if (verbose) {
|
|
187
|
+
console.log(`✨ ThumbGate is up to date (v${current}).`);
|
|
188
|
+
}
|
|
189
|
+
return { updateAvailable: false, current, latest: latestVersion };
|
|
190
|
+
}
|
|
191
|
+
} catch (err) {
|
|
192
|
+
if (verbose) {
|
|
193
|
+
console.log(`⚠️ Error checking for updates: ${err.message}`);
|
|
194
|
+
}
|
|
195
|
+
return { updateAvailable: false, current, error: err.message };
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function selfUpdate() {
|
|
200
|
+
const current = getLocalVersion();
|
|
201
|
+
console.log(`Attempting self-update for ThumbGate...`);
|
|
202
|
+
|
|
203
|
+
if (isSourceCheckout()) {
|
|
204
|
+
console.log('❌ Cannot run self-update from a source checkout family.');
|
|
205
|
+
console.log('Please run `git pull` manually to update the repository.');
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
try {
|
|
210
|
+
console.log('Running: npm install -g thumbgate@latest');
|
|
211
|
+
execSync('npm install -g thumbgate@latest', { stdio: 'inherit' });
|
|
212
|
+
console.log('✨ Self-update complete! Run `thumbgate version` to verify.');
|
|
213
|
+
return true;
|
|
214
|
+
} catch (err) {
|
|
215
|
+
console.error(`❌ Self-update failed: ${err.message}`);
|
|
216
|
+
console.log('Please run: sudo npm install -g thumbgate@latest');
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
module.exports = {
|
|
222
|
+
checkUpdate,
|
|
223
|
+
selfUpdate,
|
|
224
|
+
getLocalVersion,
|
|
225
|
+
isNewer,
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
if (require.main === module) {
|
|
229
|
+
const args = process.argv.slice(2);
|
|
230
|
+
if (args.includes('--self-update') || args.includes('self-update')) {
|
|
231
|
+
selfUpdate();
|
|
232
|
+
} else {
|
|
233
|
+
const force = args.includes('--force');
|
|
234
|
+
checkUpdate({ verbose: true, force });
|
|
235
|
+
}
|
|
236
|
+
}
|
package/scripts/cli-schema.js
CHANGED
|
@@ -328,7 +328,7 @@ const CLI_COMMANDS = [
|
|
|
328
328
|
mcpTool: 'plan_chatgpt_ads_readiness',
|
|
329
329
|
flags: [
|
|
330
330
|
jsonFlag(),
|
|
331
|
-
{ name: 'offer', type: 'string', description: 'Offer to advertise, such as Pro or
|
|
331
|
+
{ name: 'offer', type: 'string', description: 'Offer to advertise, such as Pro or Setup Sprint' },
|
|
332
332
|
{ name: 'audience', type: 'string', description: 'Audience segment to target' },
|
|
333
333
|
{ name: 'budget', type: 'number', description: 'Initial test budget' },
|
|
334
334
|
{ name: 'keywords', type: 'string', description: 'Comma-separated high-intent conversational queries' },
|
|
@@ -22,10 +22,10 @@ const TEAM_ANNUAL_PRICE_DOLLARS = 588;
|
|
|
22
22
|
const TEAM_MIN_SEATS = 3;
|
|
23
23
|
|
|
24
24
|
const PRO_PRICE_LABEL = '$19/mo or $149/yr (individual)';
|
|
25
|
-
// The
|
|
25
|
+
// The Setup Sprint is the one promoted public service offer. The
|
|
26
26
|
// dormant TEAM_* Stripe constants below remain only as inert billing plumbing
|
|
27
27
|
// pending a dedicated cleanup; they are no longer a customer-facing tier.
|
|
28
|
-
const ENTERPRISE_PRICE_LABEL = '
|
|
28
|
+
const ENTERPRISE_PRICE_LABEL = 'Setup Sprint — $499 one-time for one supported workflow';
|
|
29
29
|
const ENTERPRISE_ENTRY_URL = 'https://thumbgate.ai/pricing';
|
|
30
30
|
|
|
31
31
|
function normalizePlanId(value) {
|
package/scripts/contextfs.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* - Evaluator: record pack outcome for learning loop
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
const { tenantDataScope, assertScopedDataPath } = require('./feedback-scope');
|
|
11
12
|
const fs = require('fs');
|
|
12
13
|
const path = require('path');
|
|
13
14
|
const crypto = require('crypto');
|
|
@@ -25,13 +26,15 @@ function getFeedbackBaseDir() {
|
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
function getContextFsRoot() {
|
|
29
|
+
const scope = tenantDataScope();
|
|
30
|
+
if (scope) return assertScopedDataPath(path.join(scope.feedbackDir, 'contextfs'));
|
|
28
31
|
const feedbackDir = getFeedbackBaseDir();
|
|
29
32
|
if (process.env.THUMBGATE_CONTEXTFS_DIR) return process.env.THUMBGATE_CONTEXTFS_DIR;
|
|
30
33
|
return feedbackDir.endsWith('contextfs') ? feedbackDir : path.join(feedbackDir, 'contextfs');
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
function contextFsPath(...segments) {
|
|
34
|
-
return path.join(getContextFsRoot(), ...segments);
|
|
37
|
+
return assertScopedDataPath(path.join(getContextFsRoot(), ...segments));
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
const NAMESPACES = {
|
|
@@ -130,21 +133,24 @@ function toSlug(input) {
|
|
|
130
133
|
}
|
|
131
134
|
|
|
132
135
|
function writeJson(filePath, payload) {
|
|
136
|
+
assertScopedDataPath(filePath);
|
|
133
137
|
ensureDir(path.dirname(filePath));
|
|
134
138
|
fs.writeFileSync(filePath, `${JSON.stringify(payload, null, 2)}\n`);
|
|
135
139
|
}
|
|
136
140
|
|
|
137
141
|
function appendJsonl(filePath, payload) {
|
|
142
|
+
assertScopedDataPath(filePath);
|
|
138
143
|
ensureDir(path.dirname(filePath));
|
|
139
144
|
fs.appendFileSync(filePath, `${JSON.stringify(payload)}\n`);
|
|
140
145
|
}
|
|
141
146
|
|
|
142
147
|
function listJsonFiles(dirPath) {
|
|
148
|
+
assertScopedDataPath(dirPath);
|
|
143
149
|
if (!fs.existsSync(dirPath)) return [];
|
|
144
150
|
const files = fs.readdirSync(dirPath, { withFileTypes: true });
|
|
145
151
|
const out = [];
|
|
146
152
|
files.forEach((entry) => {
|
|
147
|
-
const fullPath = path.join(dirPath, entry.name);
|
|
153
|
+
const fullPath = assertScopedDataPath(path.join(dirPath, entry.name));
|
|
148
154
|
if (entry.isDirectory()) {
|
|
149
155
|
out.push(...listJsonFiles(fullPath));
|
|
150
156
|
return;
|
|
@@ -851,7 +857,7 @@ function loadMemexIndex() {
|
|
|
851
857
|
function dereferenceEntry(entry) {
|
|
852
858
|
if (!entry || !entry.stableRef) return null;
|
|
853
859
|
try {
|
|
854
|
-
return JSON.parse(fs.readFileSync(entry.stableRef, 'utf-8'));
|
|
860
|
+
return JSON.parse(fs.readFileSync(assertScopedDataPath(entry.stableRef), 'utf-8'));
|
|
855
861
|
} catch {
|
|
856
862
|
return null;
|
|
857
863
|
}
|