tokens-for-good 0.3.8 → 0.3.9
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/package.json +1 -1
- package/src/api-client.js +2 -1
- package/src/mcp-server.js +2 -1
package/package.json
CHANGED
package/src/api-client.js
CHANGED
|
@@ -43,13 +43,14 @@ export class ApiClient {
|
|
|
43
43
|
return this.request('POST', '/research/claim', { platform });
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
async submitReport(claimId, reportMarkdown, tokenUsage = null, metrics = null, modelUsed = null) {
|
|
46
|
+
async submitReport(claimId, reportMarkdown, tokenUsage = null, metrics = null, modelUsed = null, promptVersion = null) {
|
|
47
47
|
return this.request('POST', '/research/submit', {
|
|
48
48
|
claim_id: claimId,
|
|
49
49
|
report_markdown: reportMarkdown,
|
|
50
50
|
token_usage: tokenUsage,
|
|
51
51
|
metrics: metrics,
|
|
52
52
|
model_used: modelUsed,
|
|
53
|
+
prompt_version: promptVersion,
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
56
|
|
package/src/mcp-server.js
CHANGED
|
@@ -11,6 +11,7 @@ import { fileURLToPath } from 'url';
|
|
|
11
11
|
|
|
12
12
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
13
13
|
const PIPELINE_DIR = join(__dirname, '..', 'pipeline');
|
|
14
|
+
const PKG_VERSION = JSON.parse(readFileSync(join(__dirname, '..', 'package.json'), 'utf-8')).version;
|
|
14
15
|
|
|
15
16
|
const apiKey = process.env.TFG_API_KEY;
|
|
16
17
|
let client;
|
|
@@ -168,7 +169,7 @@ server.tool('submit_report', 'Submit a completed research report for an org you
|
|
|
168
169
|
if (!client) return { content: [{ type: 'text', text: 'Error: TFG_API_KEY not set.' }] };
|
|
169
170
|
|
|
170
171
|
try {
|
|
171
|
-
const result = await client.submitReport(claim_id, report_markdown, null, null, model_used);
|
|
172
|
+
const result = await client.submitReport(claim_id, report_markdown, null, null, model_used, PKG_VERSION);
|
|
172
173
|
markContributed();
|
|
173
174
|
return {
|
|
174
175
|
content: [{ type: 'text', text: `Report submitted for ${result.org_name}!\n\nYour stats:\n- Total orgs: ${result.contributor_stats.total_orgs}\n- Tier: ${result.contributor_stats.tier}\n- Orgs remaining: ${result.orgs_remaining}\n\nYour report will now go through peer review. Thank you for contributing!` }],
|