regen-koi-mcp 1.0.6 → 1.2.0
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 +311 -18
- package/dist/cache.d.ts +70 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +230 -0
- package/dist/cache.js.map +1 -0
- package/dist/graph_tool.d.ts +12 -4
- package/dist/graph_tool.d.ts.map +1 -1
- package/dist/graph_tool.js +335 -26
- package/dist/graph_tool.js.map +1 -1
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +295 -20
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +68 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +133 -0
- package/dist/logger.js.map +1 -0
- package/dist/metrics.d.ts +111 -0
- package/dist/metrics.d.ts.map +1 -0
- package/dist/metrics.js +279 -0
- package/dist/metrics.js.map +1 -0
- package/dist/resilience.d.ts +128 -0
- package/dist/resilience.d.ts.map +1 -0
- package/dist/resilience.js +317 -0
- package/dist/resilience.js.map +1 -0
- package/dist/tools.d.ts.map +1 -1
- package/dist/tools.js +30 -1
- package/dist/tools.js.map +1 -1
- package/dist/validation.d.ts +223 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +287 -0
- package/dist/validation.js.map +1 -0
- package/package.json +8 -2
package/README.md
CHANGED
|
@@ -12,6 +12,8 @@ curl -fsSL https://raw.githubusercontent.com/gaiaaiagent/regen-koi-mcp/main/inst
|
|
|
12
12
|
|
|
13
13
|
This automatically configures Claude Desktop and Claude Code CLI. Just restart and you're done! 🎉
|
|
14
14
|
|
|
15
|
+
**Quick Test:** After restarting, open Claude and ask: _"What repositories are indexed in KOI?"_ to verify the tools are working.
|
|
16
|
+
|
|
15
17
|
---
|
|
16
18
|
|
|
17
19
|
### Option 1: NPM (Recommended - Auto-Updates)
|
|
@@ -45,6 +47,8 @@ Config file locations:
|
|
|
45
47
|
|
|
46
48
|
Then restart Claude Desktop and you're done! 🎉
|
|
47
49
|
|
|
50
|
+
**Quick Test:** Ask Claude: _"What repositories are indexed in KOI?"_ to verify the tools are working.
|
|
51
|
+
|
|
48
52
|
**For existing git users**: See the migration section below for a simple one-line script to switch to npx.
|
|
49
53
|
|
|
50
54
|
---
|
|
@@ -101,6 +105,93 @@ Want complete control including data collection? You'll need:
|
|
|
101
105
|
|
|
102
106
|
See [ARCHITECTURE.md](ARCHITECTURE.md) for detailed setup instructions and architecture overview.
|
|
103
107
|
|
|
108
|
+
## 🔐 Authentication (Optional - Team Members Only)
|
|
109
|
+
|
|
110
|
+
### Public Data (No Auth Required)
|
|
111
|
+
KOI provides access to extensive public Regen Network knowledge:
|
|
112
|
+
- ✅ Regen Ledger code and documentation
|
|
113
|
+
- ✅ Regen Network forum discussions
|
|
114
|
+
- ✅ Public GitHub repositories
|
|
115
|
+
- ✅ Website content and blogs
|
|
116
|
+
|
|
117
|
+
**Most users don't need authentication** - just install and start querying!
|
|
118
|
+
|
|
119
|
+
### Internal Documentation (Regen Network Team)
|
|
120
|
+
Regen Network team members with `@regen.network` emails can optionally authenticate to access additional internal documentation.
|
|
121
|
+
|
|
122
|
+
**To authenticate:**
|
|
123
|
+
```
|
|
124
|
+
User: "Please use the regen_koi_authenticate tool"
|
|
125
|
+
|
|
126
|
+
MCP: Opening browser for authentication...
|
|
127
|
+
[Browser opens to Google OAuth]
|
|
128
|
+
|
|
129
|
+
User: [Log in with yourname@regen.network]
|
|
130
|
+
[Grant permissions: email, profile]
|
|
131
|
+
|
|
132
|
+
MCP: ✅ Authentication successful!
|
|
133
|
+
Authenticated as: yourname@regen.network
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**After authentication:**
|
|
137
|
+
- Queries automatically include internal documentation
|
|
138
|
+
- Token is saved on the server (not your machine)
|
|
139
|
+
- No need to re-authenticate unless token expires (~7 days)
|
|
140
|
+
|
|
141
|
+
### What Permissions Are Requested
|
|
142
|
+
|
|
143
|
+
The OAuth flow requests **minimal, identity-only permissions**:
|
|
144
|
+
- ✅ `openid` - Verify your identity
|
|
145
|
+
- ✅ `email` - Confirm you're @regen.network
|
|
146
|
+
- ✅ `profile` - Basic profile info
|
|
147
|
+
|
|
148
|
+
**NOT requested:**
|
|
149
|
+
- ❌ Access to your personal Drive files
|
|
150
|
+
- ❌ Access to your Gmail
|
|
151
|
+
- ❌ Any write/modification permissions
|
|
152
|
+
|
|
153
|
+
The service account (not your OAuth token) handles all data access.
|
|
154
|
+
|
|
155
|
+
### Example: Team Member Workflow
|
|
156
|
+
|
|
157
|
+
```
|
|
158
|
+
# First time - authenticate
|
|
159
|
+
User: "Use regen_koi_authenticate to authenticate me"
|
|
160
|
+
|
|
161
|
+
MCP: Opening browser...
|
|
162
|
+
✅ Authenticated as: alice@regen.network
|
|
163
|
+
|
|
164
|
+
# Now all queries include internal docs
|
|
165
|
+
User: "How do I register a carbon project?"
|
|
166
|
+
|
|
167
|
+
MCP: Found 23 results from multiple sources:
|
|
168
|
+
- Project Registration Guide (2024)
|
|
169
|
+
- Registry Standards Documentation
|
|
170
|
+
- Carbon Methodology Overview
|
|
171
|
+
...
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Token Security
|
|
175
|
+
|
|
176
|
+
Your authentication tokens are:
|
|
177
|
+
- 🔒 Stored server-side only (never on your machine)
|
|
178
|
+
- 🔒 Encrypted in PostgreSQL database
|
|
179
|
+
- 🔒 User-specific (never shared between users)
|
|
180
|
+
- 🔒 Automatically refreshed when needed
|
|
181
|
+
|
|
182
|
+
### Troubleshooting
|
|
183
|
+
|
|
184
|
+
**"Authentication window opened but nothing happened"**
|
|
185
|
+
- Check if your browser blocked the popup
|
|
186
|
+
- Try manually clicking the URL shown in the terminal
|
|
187
|
+
|
|
188
|
+
**"Access denied" after logging in**
|
|
189
|
+
- Ensure you're using your `@regen.network` email (not personal Gmail)
|
|
190
|
+
- Contact your Workspace admin if you don't have access
|
|
191
|
+
|
|
192
|
+
**Still having issues?**
|
|
193
|
+
- Open an issue: https://github.com/gaiaaiagent/regen-koi-mcp/issues
|
|
194
|
+
|
|
104
195
|
## 🎯 What This Does
|
|
105
196
|
|
|
106
197
|
This MCP server gives AI assistants access to Regen Network's comprehensive knowledge base with 15,000+ documents about:
|
|
@@ -112,6 +203,66 @@ This MCP server gives AI assistants access to Regen Network's comprehensive know
|
|
|
112
203
|
|
|
113
204
|
**Note:** This MCP server connects to our hosted KOI API at `https://regen.gaiaai.xyz/api/koi` (behind HTTPS via Nginx), so you don't need to run any infrastructure locally.
|
|
114
205
|
|
|
206
|
+
## 🎓 Quick Start: Example Queries
|
|
207
|
+
|
|
208
|
+
Once you've installed the MCP server, try these queries in Claude to explore what's available:
|
|
209
|
+
|
|
210
|
+
### 🔍 Discovery: What's Indexed?
|
|
211
|
+
|
|
212
|
+
```
|
|
213
|
+
"What repositories are indexed in the KOI knowledge base?"
|
|
214
|
+
"What types of code entities exist?"
|
|
215
|
+
"Show me statistics about what's in the knowledge base"
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
**What you'll get:** The system has indexed 5 repositories (regen-ledger, regen-web, koi-sensors, and more) with 26,768 code entities including Methods, Functions, Structs, and Interfaces.
|
|
219
|
+
|
|
220
|
+
### 💻 Code Exploration: Find Specific Code
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
"Search for functions containing 'keeper' in regen-ledger"
|
|
224
|
+
"Find all code related to MsgCreateBatch"
|
|
225
|
+
"What Structs exist in the ecocredit module?"
|
|
226
|
+
"Show me all Interface types in regen-ledger"
|
|
227
|
+
"Search for retirement-related code"
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
**What you'll get:** Direct links to code entities with file paths and signatures. The graph contains Methods, Functions, Structs, and Interfaces extracted via tree-sitter AST parsing.
|
|
231
|
+
|
|
232
|
+
### 📚 Documentation: Understanding the System
|
|
233
|
+
|
|
234
|
+
```
|
|
235
|
+
"Explain the ecocredit module architecture"
|
|
236
|
+
"What's the tech stack for regen-web?"
|
|
237
|
+
"Search GitHub docs for information about credit classes"
|
|
238
|
+
"Get an overview of the regen-ledger repository"
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**What you'll get:** Architectural explanations, technology choices, and relevant documentation from GitHub repositories.
|
|
242
|
+
|
|
243
|
+
### 🔬 Advanced: Graph Traversal
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
"What functions call CreateBatch?"
|
|
247
|
+
"What does the NewKeeper function call?"
|
|
248
|
+
"Find orphaned code that's never called"
|
|
249
|
+
"Show me the call graph for MsgRetire"
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**What you'll get:** Call graph traversal showing function relationships (CALLS edges), orphan detection, and code dependency analysis.
|
|
253
|
+
|
|
254
|
+
### 📊 Knowledge Base: Recent Activity
|
|
255
|
+
|
|
256
|
+
```
|
|
257
|
+
"Generate a weekly digest of Regen Network discussions"
|
|
258
|
+
"Search for recent discussions about carbon credits from the past week"
|
|
259
|
+
"Find documentation about basket creation from 2024"
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
**What you'll get:** Summaries of community discussions, forum posts, and activity with source citations.
|
|
263
|
+
|
|
264
|
+
---
|
|
265
|
+
|
|
115
266
|
## 📦 Available Tools
|
|
116
267
|
|
|
117
268
|
### Knowledge Base Search
|
|
@@ -120,7 +271,8 @@ This MCP server gives AI assistants access to Regen Network's comprehensive know
|
|
|
120
271
|
| `search_knowledge` | Hybrid search (vectors + graph with RRF) | `query` (string), `limit` (1–20, default 5), `published_from` (YYYY‑MM‑DD), `published_to` (YYYY‑MM‑DD), `include_undated` (bool, default false) |
|
|
121
272
|
| `hybrid_search` | Intelligent search routing (auto-detects entity vs conceptual queries) | `query` (string), `limit` (1–50, default 10) |
|
|
122
273
|
| `get_stats` | Knowledge base statistics | `detailed` (boolean) |
|
|
123
|
-
| `generate_weekly_digest` | Generate weekly digest of Regen Network activity | `start_date` (YYYY-MM-DD, default: 7 days ago), `end_date` (YYYY-MM-DD, default: today), `save_to_file` (bool, default false), `output_path` (string), `format` ('markdown' or 'json', default: 'markdown') |
|
|
274
|
+
| `generate_weekly_digest` | Generate weekly digest SUMMARY of Regen Network activity | `start_date` (YYYY-MM-DD, default: 7 days ago), `end_date` (YYYY-MM-DD, default: today), `save_to_file` (bool, default false), `output_path` (string), `format` ('markdown' or 'json', default: 'markdown') |
|
|
275
|
+
| `get_notebooklm_export` | Get FULL NotebookLM export with complete forum posts, Notion pages, and source material | `save_to_file` (bool, default false), `output_path` (string) |
|
|
124
276
|
|
|
125
277
|
### Code Knowledge Graph
|
|
126
278
|
| Tool | Description | Key Inputs |
|
|
@@ -134,6 +286,88 @@ This MCP server gives AI assistants access to Regen Network's comprehensive know
|
|
|
134
286
|
| `get_repo_overview` | Get structured overview of a Regen repository | `repository` (enum: regen-ledger, regen-web, regen-data-standards, regenie-corpus) |
|
|
135
287
|
| `get_tech_stack` | Get technical stack information for Regen repositories | `repository` (optional, omit to show all repos) |
|
|
136
288
|
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## 🤔 What Can I Ask? User Guide
|
|
292
|
+
|
|
293
|
+
This table helps you understand which tool to use for different tasks. Just ask Claude in natural language - it will automatically use the right tool.
|
|
294
|
+
|
|
295
|
+
| **When You Want To...** | **Ask Claude** | **Tool Used** |
|
|
296
|
+
|----------------------------------------------------------|----------------------------------------------------------|--------------------------|
|
|
297
|
+
| **Discover what's indexed** | | |
|
|
298
|
+
| See what repositories are available | "What repositories are indexed?" | `list_repos` |
|
|
299
|
+
| See what types of code entities exist | "What entity types are available?" | `list_entity_types` |
|
|
300
|
+
| Get comprehensive statistics | "Show me statistics about the knowledge base" | `get_entity_stats` |
|
|
301
|
+
| **Find specific code** | | |
|
|
302
|
+
| Find all entities of a type | "Show me all Keepers in regen-ledger" | `find_by_type` |
|
|
303
|
+
| Search for entities by name | "Find entities related to MsgCreateBatch" | `search_entities` |
|
|
304
|
+
| Find related code entities | "What's related to the ecocredit Keeper?" | `related_entities` |
|
|
305
|
+
| **Understand relationships** | | |
|
|
306
|
+
| Find which Keeper handles a Message | "Which Keeper handles MsgCreateBatch?" | `keeper_for_msg` |
|
|
307
|
+
| Find what Messages a Keeper handles | "What messages does the ecocredit Keeper handle?" | `msgs_for_keeper` |
|
|
308
|
+
| Find what documentation mentions an entity | "What docs mention MsgRetire?" | `docs_mentioning` |
|
|
309
|
+
| Find entities in a file | "What entities are in keeper.go?" | `entities_in_doc` |
|
|
310
|
+
| **Navigate by modules** | | |
|
|
311
|
+
| List all modules | "What modules exist in regen-ledger?" | `list_modules` |
|
|
312
|
+
| Get details about a module | "Tell me about the ecocredit module" | `get_module` |
|
|
313
|
+
| Search for modules | "Find modules related to baskets" | `search_modules` |
|
|
314
|
+
| Find entities in a module | "What entities are in the ecocredit module?" | `module_entities` |
|
|
315
|
+
| **Search documentation** | | |
|
|
316
|
+
| Search GitHub docs | "Search for documentation about credit classes" | `search_github_docs` |
|
|
317
|
+
| Get repository overview | "Give me an overview of regen-web" | `get_repo_overview` |
|
|
318
|
+
| Understand tech stack | "What's the tech stack for regen-ledger?" | `get_tech_stack` |
|
|
319
|
+
| **Search everything (hybrid)** | | |
|
|
320
|
+
| Semantic search across code and docs | "How does credit retirement work?" | `hybrid_search` |
|
|
321
|
+
| Advanced filtering by date | "Find discussions about tokens from last week" | `search_knowledge` |
|
|
322
|
+
| **Get activity summaries** | | |
|
|
323
|
+
| Generate weekly digest summary | "Create a weekly digest of Regen activity" | `generate_weekly_digest` |
|
|
324
|
+
| Get full content for NotebookLM | "Get the full NotebookLM export with all forum posts" | `get_notebooklm_export` |
|
|
325
|
+
|
|
326
|
+
### Query Type Reference
|
|
327
|
+
|
|
328
|
+
The `query_code_graph` tool supports these query types:
|
|
329
|
+
|
|
330
|
+
#### Discovery
|
|
331
|
+
- **`list_repos`** - Show all indexed repositories with entity counts
|
|
332
|
+
- **`list_entity_types`** - Show all entity types (Function, Class, Keeper, Message, etc.) with counts
|
|
333
|
+
- **`get_entity_stats`** - Comprehensive statistics: entities by type, language, repository
|
|
334
|
+
- **`list_modules`** - Show all modules across repositories
|
|
335
|
+
|
|
336
|
+
#### Entity Queries
|
|
337
|
+
- **`find_by_type`** - Find all entities of a specific type (requires `entity_type` parameter)
|
|
338
|
+
- **`search_entities`** - Search entities by name pattern (requires `entity_name` parameter)
|
|
339
|
+
- **`related_entities`** - Find entities related to a given entity (requires `entity_name` parameter)
|
|
340
|
+
|
|
341
|
+
#### Relationship Queries
|
|
342
|
+
- **`keeper_for_msg`** - Find which Keeper handles a Message (requires `entity_name` parameter)
|
|
343
|
+
- **`msgs_for_keeper`** - Find what Messages a Keeper handles (requires `entity_name` parameter)
|
|
344
|
+
- **`docs_mentioning`** - Find documentation mentioning an entity (requires `entity_name` parameter)
|
|
345
|
+
- **`entities_in_doc`** - Find entities defined in a document (requires `doc_path` parameter)
|
|
346
|
+
|
|
347
|
+
#### Module Queries
|
|
348
|
+
- **`get_module`** - Get details about a specific module (requires `module_name` parameter)
|
|
349
|
+
- **`search_modules`** - Search modules by keyword (requires `entity_name` parameter)
|
|
350
|
+
- **`module_entities`** - Get entities in a module (requires `module_name` parameter)
|
|
351
|
+
- **`module_for_entity`** - Find which module contains an entity (requires `entity_name` parameter)
|
|
352
|
+
|
|
353
|
+
### What's Currently Indexed
|
|
354
|
+
|
|
355
|
+
**Repositories:** 5 total
|
|
356
|
+
- `regen-ledger`: 18,619 entities (Go, Cosmos SDK modules)
|
|
357
|
+
- `regen-web`: 3,164 entities (TypeScript/React frontend)
|
|
358
|
+
- `koi-sensors`: 1,250 entities (Python data collection)
|
|
359
|
+
- `regen-koi-mcp`: 688 entities (TypeScript MCP server)
|
|
360
|
+
- `regen-data-standards`: 6 entities (JSON schemas)
|
|
361
|
+
|
|
362
|
+
**Entity Types:** 10 types
|
|
363
|
+
- Function, Class, Interface, Method, Type
|
|
364
|
+
- Keeper, Message, Query, Event (Cosmos SDK specific)
|
|
365
|
+
- Module, Repository
|
|
366
|
+
|
|
367
|
+
**Total:** 23,728 code entities
|
|
368
|
+
|
|
369
|
+
---
|
|
370
|
+
|
|
137
371
|
## 🏗️ Architecture
|
|
138
372
|
|
|
139
373
|
This repo contains everything you need to run a complete KOI MCP setup:
|
|
@@ -184,16 +418,35 @@ Or manually add to config (`~/Library/Application Support/Claude/claude_desktop_
|
|
|
184
418
|
|
|
185
419
|
### Claude Code CLI
|
|
186
420
|
|
|
187
|
-
**
|
|
421
|
+
**Option 1: Use the automated installer (recommended)**
|
|
188
422
|
```bash
|
|
189
|
-
|
|
423
|
+
curl -fsSL https://raw.githubusercontent.com/gaiaaiagent/regen-koi-mcp/main/install.sh | bash
|
|
190
424
|
```
|
|
425
|
+
This configures both Claude Desktop and Claude Code CLI with the correct environment variables.
|
|
191
426
|
|
|
192
|
-
|
|
427
|
+
**Option 2: Manual installation**
|
|
428
|
+
1. Add the MCP server:
|
|
193
429
|
```bash
|
|
194
|
-
|
|
430
|
+
claude mcp add regen-koi npx -y regen-koi-mcp@latest
|
|
195
431
|
```
|
|
196
432
|
|
|
433
|
+
2. Configure the environment variable in your Claude Code settings file (`~/.claude/settings.json` or similar):
|
|
434
|
+
```json
|
|
435
|
+
{
|
|
436
|
+
"mcpServers": {
|
|
437
|
+
"regen-koi": {
|
|
438
|
+
"command": "npx",
|
|
439
|
+
"args": ["-y", "regen-koi-mcp@latest"],
|
|
440
|
+
"env": {
|
|
441
|
+
"KOI_API_ENDPOINT": "https://regen.gaiaai.xyz/api/koi"
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
**Verification:** After installation, restart Claude Code and ask: "What repositories are indexed?" to verify the tools are working.
|
|
449
|
+
|
|
197
450
|
---
|
|
198
451
|
|
|
199
452
|
### VS Code / VS Code Insiders
|
|
@@ -545,6 +798,27 @@ The setup connects to our hosted KOI API at `https://regen.gaiaai.xyz/api/koi`.
|
|
|
545
798
|
### "Command not found"
|
|
546
799
|
Make sure Node.js is installed and in your PATH. The setup script uses `node` command.
|
|
547
800
|
|
|
801
|
+
### "Connection error: localhost:8301" or "localhost:8910"
|
|
802
|
+
|
|
803
|
+
**Cause:** Claude caches MCP configurations in `~/.claude.json`. If you previously ran a local dev server, it may have cached `localhost` URLs that override your current config.
|
|
804
|
+
|
|
805
|
+
**Fix:**
|
|
806
|
+
```bash
|
|
807
|
+
# 1. Check for cached localhost configs
|
|
808
|
+
grep -i "localhost.*8301\|localhost.*8910" ~/.claude.json
|
|
809
|
+
|
|
810
|
+
# 2. Backup your config
|
|
811
|
+
cp ~/.claude.json ~/.claude.json.backup
|
|
812
|
+
|
|
813
|
+
# 3. Replace localhost with public API
|
|
814
|
+
sed -i '' 's|http://localhost:8301/api/koi|https://regen.gaiaai.xyz/api/koi|g' ~/.claude.json
|
|
815
|
+
sed -i '' 's|http://localhost:8910/api/koi|https://regen.gaiaai.xyz/api/koi|g' ~/.claude.json
|
|
816
|
+
|
|
817
|
+
# 4. Restart Claude Code/Desktop
|
|
818
|
+
```
|
|
819
|
+
|
|
820
|
+
**Prevention:** Always use `https://regen.gaiaai.xyz/api/koi` in MCP configs unless you're actively developing the API server locally.
|
|
821
|
+
|
|
548
822
|
## 📚 Example Usage
|
|
549
823
|
|
|
550
824
|
Once configured, you can ask Claude:
|
|
@@ -556,30 +830,49 @@ Once configured, you can ask Claude:
|
|
|
556
830
|
- "Generate a weekly digest of Regen Network activity from the past week"
|
|
557
831
|
- "Create a digest of discussions from January 1 to January 7, 2025"
|
|
558
832
|
|
|
559
|
-
### Weekly Digest
|
|
833
|
+
### Weekly Digest Tools
|
|
834
|
+
|
|
835
|
+
There are two tools for getting weekly activity information, each designed for different use cases:
|
|
560
836
|
|
|
561
|
-
|
|
837
|
+
#### `generate_weekly_digest` - Curated Summary
|
|
838
|
+
|
|
839
|
+
Creates a condensed, curated markdown summary of Regen Network activity. Best for quick overview and reading in Claude.
|
|
562
840
|
|
|
563
841
|
**Features:**
|
|
842
|
+
- Executive summary with key highlights
|
|
843
|
+
- Curated selection of important discussions and updates
|
|
844
|
+
- Governance analysis and community insights
|
|
845
|
+
- On-chain metrics summary
|
|
564
846
|
- Automatically aggregates content from the past 7 days (or custom date range)
|
|
565
|
-
- Returns markdown content that can be used directly in Claude Desktop as an artifact
|
|
566
|
-
- Optionally saves to a file for use with NotebookLM or other tools
|
|
567
|
-
- Includes proper source citations and statistics
|
|
568
847
|
|
|
569
848
|
**Examples:**
|
|
570
|
-
|
|
571
|
-
```javascript
|
|
572
|
-
// In Claude Desktop or Claude Code CLI:
|
|
849
|
+
```
|
|
573
850
|
"Generate a weekly digest of Regen Network activity"
|
|
574
|
-
|
|
575
|
-
// With custom date range:
|
|
576
851
|
"Create a digest from December 1 to December 8, 2024"
|
|
577
|
-
|
|
578
|
-
// Save to file:
|
|
579
852
|
"Generate a weekly digest and save it to weekly_summary.md"
|
|
580
853
|
```
|
|
581
854
|
|
|
582
|
-
|
|
855
|
+
#### `get_notebooklm_export` - Full Content Export
|
|
856
|
+
|
|
857
|
+
Returns the complete, unabridged source material. Best for deep analysis or loading into NotebookLM.
|
|
858
|
+
|
|
859
|
+
**Features:**
|
|
860
|
+
- **Full forum thread posts** - Complete text of all posts, not just summaries
|
|
861
|
+
- **Complete Notion page content** - All chunks combined into full documents
|
|
862
|
+
- **Enriched URLs** - Metadata and context for linked resources
|
|
863
|
+
- **Detailed source material** - Everything you need for thorough analysis
|
|
864
|
+
- Generates on demand if no recent cached version exists (takes 2-3 minutes)
|
|
865
|
+
|
|
866
|
+
**Examples:**
|
|
867
|
+
```
|
|
868
|
+
"Get the full NotebookLM export"
|
|
869
|
+
"Get the complete weekly content with all forum posts"
|
|
870
|
+
"Export the full source material and save it to notebooklm_export.md"
|
|
871
|
+
```
|
|
872
|
+
|
|
873
|
+
**When to use which:**
|
|
874
|
+
- Use `generate_weekly_digest` for a quick, readable summary
|
|
875
|
+
- Use `get_notebooklm_export` when you need raw source content for deep analysis, fact-checking, or loading into external tools like NotebookLM
|
|
583
876
|
|
|
584
877
|
## 🤝 Contributing
|
|
585
878
|
|
package/dist/cache.d.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cache Module - LRU Caching for Query Results
|
|
3
|
+
*
|
|
4
|
+
* Provides in-memory caching with TTL for query results to reduce
|
|
5
|
+
* database load and improve response times.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Query Cache class
|
|
9
|
+
*/
|
|
10
|
+
declare class QueryCache {
|
|
11
|
+
private caches;
|
|
12
|
+
constructor();
|
|
13
|
+
/**
|
|
14
|
+
* Get cache for a specific category
|
|
15
|
+
*/
|
|
16
|
+
private getCache;
|
|
17
|
+
/**
|
|
18
|
+
* Get the category for a query type
|
|
19
|
+
*/
|
|
20
|
+
private getCategory;
|
|
21
|
+
/**
|
|
22
|
+
* Get a cached result
|
|
23
|
+
*/
|
|
24
|
+
get<T>(tool: string, queryType: string, params: Record<string, any>): T | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* Set a cached result
|
|
27
|
+
*/
|
|
28
|
+
set<T>(tool: string, queryType: string, params: Record<string, any>, value: T): void;
|
|
29
|
+
/**
|
|
30
|
+
* Check if a key exists in cache
|
|
31
|
+
*/
|
|
32
|
+
has(tool: string, queryType: string, params: Record<string, any>): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Delete a specific cached result
|
|
35
|
+
*/
|
|
36
|
+
delete(tool: string, queryType: string, params: Record<string, any>): void;
|
|
37
|
+
/**
|
|
38
|
+
* Clear all caches
|
|
39
|
+
*/
|
|
40
|
+
clear(): void;
|
|
41
|
+
/**
|
|
42
|
+
* Clear a specific category's cache
|
|
43
|
+
*/
|
|
44
|
+
clearCategory(category: string): void;
|
|
45
|
+
/**
|
|
46
|
+
* Get cache statistics
|
|
47
|
+
*/
|
|
48
|
+
getStats(): {
|
|
49
|
+
totalSize: number;
|
|
50
|
+
byCategory: Record<string, {
|
|
51
|
+
size: number;
|
|
52
|
+
maxSize: number;
|
|
53
|
+
}>;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
export declare const queryCache: QueryCache;
|
|
57
|
+
/**
|
|
58
|
+
* Wrapper function to cache async query results
|
|
59
|
+
*/
|
|
60
|
+
export declare function cachedQuery<T>(tool: string, queryType: string, params: Record<string, any>, fetchFn: () => Promise<T>): Promise<T>;
|
|
61
|
+
/**
|
|
62
|
+
* Check if a query type should be cached
|
|
63
|
+
*/
|
|
64
|
+
export declare function shouldCache(queryType: string): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Get TTL for a query type
|
|
67
|
+
*/
|
|
68
|
+
export declare function getTTL(queryType: string): number;
|
|
69
|
+
export default queryCache;
|
|
70
|
+
//# sourceMappingURL=cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../src/cache.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgGH;;GAEG;AACH,cAAM,UAAU;IACd,OAAO,CAAC,MAAM,CAAiD;;IAc/D;;OAEG;IACH,OAAO,CAAC,QAAQ;IAShB;;OAEG;IACH,OAAO,CAAC,WAAW;IAInB;;OAEG;IACH,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,CAAC,GAAG,SAAS;IAkBnF;;OAEG;IACH,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI;IAUpF;;OAEG;IACH,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO;IAO1E;;OAEG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI;IAQ1E;;OAEG;IACH,KAAK,IAAI,IAAI;IAMb;;OAEG;IACH,aAAa,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAOrC;;OAEG;IACH,QAAQ,IAAI;QACV,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,CAAC,CAAC;KAC/D;CAeF;AAGD,eAAO,MAAM,UAAU,YAAmB,CAAC;AAE3C;;GAEG;AACH,wBAAsB,WAAW,CAAC,CAAC,EACjC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACxB,OAAO,CAAC,CAAC,CAAC,CAcZ;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAGtD;AAED;;GAEG;AACH,wBAAgB,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAGhD;AAED,eAAe,UAAU,CAAC"}
|