tokens-for-good 0.4.24 → 0.4.26
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/README.md +1 -2
- package/package.json +1 -1
- package/pipeline/01-research/PROMPT.md +1 -1
- package/src/cli.js +6 -7
- package/src/mcp-server.js +4 -5
- package/src/platform.js +1 -1
package/README.md
CHANGED
|
@@ -48,7 +48,6 @@ Once installed, these are available to your AI via the MCP server:
|
|
|
48
48
|
|
|
49
49
|
| Tool | Purpose |
|
|
50
50
|
|---|---|
|
|
51
|
-
| `next_action` | Tells you whether to validate, consolidate, or research next |
|
|
52
51
|
| `claim_org` | Reserves the next available nonprofit (up to 2 researchers per org under v3) |
|
|
53
52
|
| `get_methodology` | Fetches research / verify / humanize / validate / consolidate instructions |
|
|
54
53
|
| `submit_report` | Submits a finished report (or a merged consolidation report with `disagreement_rows`) |
|
|
@@ -58,7 +57,7 @@ Once installed, these are available to your AI via the MCP server:
|
|
|
58
57
|
| `set_role_preference` | Prefer the low-fetch roles (validation/consolidation); best for local models |
|
|
59
58
|
| `create_agent` / `list_agents` / `rotate_agent_key` / `revoke_agent` | Run several harnesses at once: each agent gets its own key + research slot |
|
|
60
59
|
| `setup_automation` | Emits `/schedule` prompt (normally called by `/tfg-schedule` skill) |
|
|
61
|
-
| `my_impact` / `research_status`
|
|
60
|
+
| `my_impact` / `research_status` | Your stats + the project leaderboard |
|
|
62
61
|
| `snooze` | Quiet the session-start prompt for N days |
|
|
63
62
|
|
|
64
63
|
## Non-Claude-Code platforms
|
package/package.json
CHANGED
|
@@ -183,7 +183,7 @@ Run these checks before submitting. They are not optional.
|
|
|
183
183
|
- [ ] EVIDENCE TABLE quotes appear verbatim on the cited pages (substring-checked at submit time)
|
|
184
184
|
|
|
185
185
|
**Writing style:**
|
|
186
|
-
- [ ] No em dashes
|
|
186
|
+
- [ ] No em dashes. Replace with periods, commas, semicolons, or parentheses.
|
|
187
187
|
- [ ] No filler adjectives: seamless, robust, comprehensive, innovative, cutting-edge, holistic, game-changing
|
|
188
188
|
- [ ] No AI transitions: "It's worth noting", "Here's the thing", "Let's dive in", "Simply put"
|
|
189
189
|
- [ ] Replace "leverage" with "use", "utilize" with "use"
|
package/src/cli.js
CHANGED
|
@@ -50,19 +50,18 @@ if (args.includes('-v') || args.includes('--version')) {
|
|
|
50
50
|
try {
|
|
51
51
|
const client = new ApiClient(process.env.TFG_API_KEY || 'public', { version: pkg.version, installId: getOrCreateInstallId() });
|
|
52
52
|
const status = await client.getStatus();
|
|
53
|
-
const sys = status.system_stats || status;
|
|
54
53
|
console.log('\nTokens for Good - Project Status\n');
|
|
55
|
-
console.log(`Total orgs: ${
|
|
56
|
-
console.log(`Pending research: ${
|
|
57
|
-
console.log(`Active contributors (7d): ${
|
|
54
|
+
console.log(`Total orgs: ${status.total_orgs ?? 'n/a'}`);
|
|
55
|
+
console.log(`Pending research: ${status.pending_orgs ?? 'n/a'}`);
|
|
56
|
+
console.log(`Active contributors (7d): ${status.active_contributors_7d ?? 'n/a'}`);
|
|
58
57
|
console.log('\nQueue:');
|
|
59
|
-
for (const [k, v] of Object.entries(status.
|
|
58
|
+
for (const [k, v] of Object.entries(status.queue || {})) {
|
|
60
59
|
console.log(` ${k}: ${v}`);
|
|
61
60
|
}
|
|
62
61
|
console.log('\nTop Contributors:');
|
|
63
62
|
(status.top_contributors || []).forEach((c, i) => {
|
|
64
|
-
const name = c.display_name ||
|
|
65
|
-
console.log(` ${
|
|
63
|
+
const name = c.display_name || 'anonymous';
|
|
64
|
+
console.log(` ${i + 1}. ${name} (${c.total_orgs} orgs, ${c.tier})`);
|
|
66
65
|
});
|
|
67
66
|
} catch (err) {
|
|
68
67
|
console.error('Error:', err.message);
|
package/src/mcp-server.js
CHANGED
|
@@ -112,7 +112,7 @@ server.tool('claim_org', 'Claim the next available nonprofit org to research.',
|
|
|
112
112
|
try {
|
|
113
113
|
const result = await client.claimOrg(plat || platform);
|
|
114
114
|
return {
|
|
115
|
-
content: [{ type: 'text', text: `Claimed: ${result.org.name} (${result.org.url})\nclaim_id: ${result.claim_id}\nexpires: ${result.expires_at}\nNext: get_methodology step="research", then submit_report
|
|
115
|
+
content: [{ type: 'text', text: `Claimed: ${result.org.name} (${result.org.url})\nclaim_id: ${result.claim_id}\nexpires: ${result.expires_at}\nNext: get_methodology step="research" to research, then step="verify" and step="humanize" to check citations and clean the voice, then submit_report. (The /tfg skill walks all four.)` }],
|
|
116
116
|
};
|
|
117
117
|
} catch (err) {
|
|
118
118
|
// 409 means you already have an active claim; usually an auto-assigned
|
|
@@ -331,14 +331,13 @@ server.tool('research_status', 'See the overall Tokens for Good project progress
|
|
|
331
331
|
try {
|
|
332
332
|
const clientForStatus = client || new ApiClient('dummy', { version: PKG_VERSION, platform, installId }); // Status is public
|
|
333
333
|
const result = await clientForStatus.getStatus();
|
|
334
|
-
const
|
|
335
|
-
const queue = result.queue_status || result.queue || {};
|
|
334
|
+
const queue = result.queue || {};
|
|
336
335
|
const topList = result.top_contributors?.map((c, i) =>
|
|
337
|
-
`${
|
|
336
|
+
`${i + 1}. ${c.display_name || 'anonymous'} (${c.total_orgs} orgs, ${c.tier})`
|
|
338
337
|
).join('\n') || 'No contributors yet';
|
|
339
338
|
|
|
340
339
|
return {
|
|
341
|
-
content: [{ type: 'text', text: `Tokens for Good Progress:\n\nTotal orgs: ${
|
|
340
|
+
content: [{ type: 'text', text: `Tokens for Good Progress:\n\nTotal orgs: ${result.total_orgs}\nPending research: ${result.pending_orgs}\nActive contributors (7d): ${result.active_contributors_7d}\n\nQueue:\n${Object.entries(queue).map(([k, v]) => ` ${k}: ${v}`).join('\n')}\n\nTop Contributors:\n${topList}` }],
|
|
342
341
|
};
|
|
343
342
|
} catch (err) {
|
|
344
343
|
return { content: [{ type: 'text', text: `Error: ${err.message}` }] };
|
package/src/platform.js
CHANGED
|
@@ -33,7 +33,7 @@ API Base: ${base}
|
|
|
33
33
|
Your API key: ${apiKey}
|
|
34
34
|
|
|
35
35
|
## Calling the API; read first
|
|
36
|
-
Use the **Bash tool with \`curl\`** for every authenticated ${base}/* call (next-action, claim, submit, consolidate). **WebFetch will NOT work for these; it cannot send the X-TFG-Api-Key header or POST a body, so it returns 401/403 and the run fails.** Always include \`-H "X-TFG-Api-Key: ${apiKey}"\`. WebSearch and WebFetch are only for the actual web research, not for our API.
|
|
36
|
+
Use the **Bash tool with \`curl\`** for every authenticated ${base}/* call (next-action, claim, submit, validate, consolidate). **WebFetch will NOT work for these; it cannot send the X-TFG-Api-Key header or POST a body, so it returns 401/403 and the run fails.** Always include \`-H "X-TFG-Api-Key: ${apiKey}"\`. WebSearch and WebFetch are only for the actual web research, not for our API.
|
|
37
37
|
|
|
38
38
|
## Instructions
|
|
39
39
|
1. Fetch the batch flow (public): \`curl -s "${base}/research/schedule-instructions"\`
|