tokens-for-good 0.3.3 → 0.3.5
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/LICENSE +21 -0
- package/package.json +6 -1
- package/src/mcp-server.js +15 -2
- package/src/state.js +2 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tokens for Good
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tokens-for-good",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Donate your spare AI tokens to research nonprofits for Fierce Philanthropy",
|
|
6
6
|
"bin": {
|
|
7
7
|
"tokens-for-good": "src/cli.js"
|
|
8
8
|
},
|
|
9
9
|
"main": "./src/mcp-server.js",
|
|
10
|
+
"files": [
|
|
11
|
+
"src/",
|
|
12
|
+
"pipeline/",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
10
15
|
"scripts": {
|
|
11
16
|
"start": "node src/mcp-server.js",
|
|
12
17
|
"test": "node --test src/**/*.test.js"
|
package/src/mcp-server.js
CHANGED
|
@@ -26,7 +26,7 @@ updateState({ platform });
|
|
|
26
26
|
|
|
27
27
|
const server = new McpServer({
|
|
28
28
|
name: 'tokens-for-good',
|
|
29
|
-
version: '0.3.
|
|
29
|
+
version: '0.3.5',
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
// --- No-key onboarding message ---
|
|
@@ -345,7 +345,20 @@ server.tool('check_permissions', 'Check if permissions and hooks are set up for
|
|
|
345
345
|
|
|
346
346
|
The hook reads TFG_API_KEY from the environment (set in .mcp.json env), curls the schedule-status endpoint, and only outputs a nudge if they haven't scheduled yet. Once they schedule, the hook goes silent.
|
|
347
347
|
|
|
348
|
-
|
|
348
|
+
3. **Skill** — create the file ~/.claude/skills/tfg/SKILL.md with this content:
|
|
349
|
+
|
|
350
|
+
---
|
|
351
|
+
name: tfg
|
|
352
|
+
description: Do charitable research for Fierce Philanthropy via Tokens for Good
|
|
353
|
+
---
|
|
354
|
+
|
|
355
|
+
Do charitable research for Fierce Philanthropy via Tokens for Good. Call next_action to check whether to research or review. Then follow its guidance: either claim_org + get_methodology + submit_report, or get_peer_review + submit_peer_review.
|
|
356
|
+
|
|
357
|
+
---
|
|
358
|
+
|
|
359
|
+
This lets the user type /tfg to start a research session.
|
|
360
|
+
|
|
361
|
+
After setting up everything, tell the user: "Done! Permissions, schedule reminder, and /tfg command are configured."` }],
|
|
349
362
|
};
|
|
350
363
|
});
|
|
351
364
|
|
package/src/state.js
CHANGED
|
@@ -28,9 +28,9 @@ export function loadState() {
|
|
|
28
28
|
|
|
29
29
|
export function saveState(state) {
|
|
30
30
|
if (!existsSync(STATE_DIR)) {
|
|
31
|
-
mkdirSync(STATE_DIR, { recursive: true });
|
|
31
|
+
mkdirSync(STATE_DIR, { recursive: true, mode: 0o700 });
|
|
32
32
|
}
|
|
33
|
-
writeFileSync(STATE_FILE, JSON.stringify(state, null, 2), 'utf-8');
|
|
33
|
+
writeFileSync(STATE_FILE, JSON.stringify(state, null, 2), { encoding: 'utf-8', mode: 0o600 });
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
export function updateState(updates) {
|