freshcontext-mcp 0.3.14 → 0.3.16
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/.env.example +8 -0
- package/README.md +117 -125
- package/RESEARCH.md +487 -0
- package/RISKS.md +137 -0
- package/cleanup.ps1 +99 -0
- package/demo/README.md +70 -0
- package/demo/data.json +88 -0
- package/demo/generate.mjs +199 -0
- package/demo/index.html +513 -0
- package/demo/logo-export.html +61 -0
- package/demo/logo.svg +23 -0
- package/dist/server.js +124 -66
- package/dist/tools/freshnessStamp.js +30 -22
- package/freshcontext-validate.js +196 -0
- package/freshcontext.schema.json +103 -0
- package/package.json +2 -2
- package/server.json +3 -3
- package/time-check.ps1 +46 -0
- package/.actor/Dockerfile +0 -16
- package/.actor/actor.json +0 -9
- package/.actor/output_schema.json +0 -13
- package/ARCHITECTURE_UPGRADE_CHECKLIST.md +0 -88
- package/ARCHITECTURE_UPGRADE_ROADMAP_V1.md +0 -174
- package/FRESHCONTEXT_SPEC.md +0 -178
- package/HANDOFF.md +0 -184
- package/ROADMAP.md +0 -174
- package/SESSION_SAVE_ARCHITECTURE_V1.md +0 -67
- package/SESSION_SAVE_ARCHITECTURE_V2.md +0 -142
- package/SESSION_SAVE_V4.md +0 -60
- package/SESSION_SAVE_V5.md +0 -121
- package/USAGE.md +0 -294
- package/add-cache.cjs +0 -86
- package/dataset_schema.json +0 -41
- package/input_schema.json +0 -48
package/SESSION_SAVE_V5.md
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
# FreshContext — Session Save V5
|
|
2
|
-
**Date:** 2026-03-27
|
|
3
|
-
**npm:** freshcontext-mcp@0.3.13
|
|
4
|
-
**Tools:** 19 live
|
|
5
|
-
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## What Was Done This Session
|
|
9
|
-
|
|
10
|
-
- npm tokens renewed: freshcontext-publish + NPM_TOKEN (both renewed, NPM_TOKEN updated in GitHub secrets)
|
|
11
|
-
- GitHub granular token renewed
|
|
12
|
-
- v0.3.13 pushed — extract_gebiz added (Singapore GeBIZ procurement via data.gov.sg)
|
|
13
|
-
- README fully rewritten — 19 tools, company landscape section with PLTR demo, all unique adapters documented
|
|
14
|
-
- GovTech Singapore follow-up sent (delivered on commitment: GeBIZ tool built and live)
|
|
15
|
-
- Palantir follow-up sent (references PLTR company landscape report, $1.1B contracts, Rule of 40 127%)
|
|
16
|
-
- 10 follow-up drafts created in Gmail (PatSnap, Mistral, HF, Klarna, SAP, Moonshot, MiniMax, Apify, Cloudflare, Sea)
|
|
17
|
-
- PLTR company landscape report confirmed working — full intelligence output documented
|
|
18
|
-
- Apify rebuild needed for v0.3.13 (manual trigger required)
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Current Tool Count: 19
|
|
23
|
-
|
|
24
|
-
**Standard (11):** extract_github, extract_hackernews, extract_scholar, extract_arxiv,
|
|
25
|
-
extract_reddit, extract_yc, extract_producthunt, search_repos, package_trends,
|
|
26
|
-
extract_finance, search_jobs
|
|
27
|
-
|
|
28
|
-
**Composite landscapes (4):**
|
|
29
|
-
- extract_landscape — YC + GitHub + HN + Reddit + Product Hunt + npm
|
|
30
|
-
- extract_gov_landscape — govcontracts + HN + GitHub + changelog
|
|
31
|
-
- extract_finance_landscape — finance + HN + Reddit + GitHub + changelog
|
|
32
|
-
- extract_company_landscape — SEC + govcontracts + GDELT + changelog + finance
|
|
33
|
-
|
|
34
|
-
**Unique — not in any other MCP server (4 + GeBIZ):**
|
|
35
|
-
- extract_changelog — release history from any repo/package/site
|
|
36
|
-
- extract_govcontracts — US federal contract awards (USASpending.gov)
|
|
37
|
-
- extract_sec_filings — 8-K material event disclosures (SEC EDGAR)
|
|
38
|
-
- extract_gdelt — global news events (GDELT Project, 100+ languages)
|
|
39
|
-
- extract_gebiz — Singapore Government procurement (data.gov.sg) ← NEW
|
|
40
|
-
|
|
41
|
-
---
|
|
42
|
-
|
|
43
|
-
## Outreach Status
|
|
44
|
-
|
|
45
|
-
**Active threads:**
|
|
46
|
-
- GovTech Singapore — delivered GeBIZ tool, awaiting response
|
|
47
|
-
- Palantir — follow-up sent with PLTR company landscape report
|
|
48
|
-
|
|
49
|
-
**Follow-up drafts sitting in Gmail (10):**
|
|
50
|
-
- PatSnap — contact@patsnap.com
|
|
51
|
-
- Mistral AI — contact@mistral.ai
|
|
52
|
-
- Hugging Face — api-enterprise@huggingface.co
|
|
53
|
-
- Klarna — partnerships@klarna.com
|
|
54
|
-
- SAP Startups — startups@sap.com
|
|
55
|
-
- Moonshot AI — support@moonshot.cn
|
|
56
|
-
- MiniMax — contact@minimax.io
|
|
57
|
-
- Apify / Jan — jan@apify.com
|
|
58
|
-
- Cloudflare Startups — startups@cloudflare.com
|
|
59
|
-
- Sea / Shopee — ir@sea.com
|
|
60
|
-
|
|
61
|
-
**Bounced — need correct addresses (9):**
|
|
62
|
-
- Revolut — bd@revolut.com + press@revolut.com both dead
|
|
63
|
-
- Zalando — partnerships@zalando.de + tech@zalando.de both dead
|
|
64
|
-
- Celonis — partnerships@celonis.com dead
|
|
65
|
-
- Grab — partnerships@grab.com + developer@grab.com both dead
|
|
66
|
-
- Sea Limited — partnerships@sea.com dead (ir@sea.com delivered but wrong team)
|
|
67
|
-
- Zhipu AI — bd@zhipuai.cn + contact@zhipuai.cn both dead
|
|
68
|
-
- MiniMax — bd@minimaxi.com dead (contact@minimax.io delivered)
|
|
69
|
-
- Moonshot AI — business@moonshot.cn dead (support@moonshot.cn delivered)
|
|
70
|
-
- Apollo — hello@apollo.io dead
|
|
71
|
-
|
|
72
|
-
**New targets identified (not yet contacted):**
|
|
73
|
-
- IMDA Singapore (Infocomm Media Development Authority)
|
|
74
|
-
- Australian Digital Transformation Agency
|
|
75
|
-
- UK Government Digital Service (GDS)
|
|
76
|
-
- LangChain / LangSmith
|
|
77
|
-
- LlamaIndex
|
|
78
|
-
- CrewAI
|
|
79
|
-
- Vercel AI SDK
|
|
80
|
-
- FactSet
|
|
81
|
-
- Morningstar
|
|
82
|
-
|
|
83
|
-
**Correct addresses to find for bounced:**
|
|
84
|
-
- Revolut → try partnerships@revolut.com
|
|
85
|
-
- Grab → try business@grab.com
|
|
86
|
-
- Celonis → try hello@celonis.com
|
|
87
|
-
- Apollo.io → try partnerships@apollo.io
|
|
88
|
-
- Zhipu AI → LinkedIn outreach (email dead)
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## Pending Items
|
|
93
|
-
|
|
94
|
-
- Send 10 follow-up drafts from Gmail Drafts folder
|
|
95
|
-
- Trigger Apify rebuild for v0.3.13
|
|
96
|
-
- Find correct addresses for 9 bounced companies
|
|
97
|
-
- Contact new targets: IMDA, GDS, LangChain, LlamaIndex, CrewAI, FactSet
|
|
98
|
-
- GKG upgrade for extract_gdelt (tone scores, goldstein scale) — deferred
|
|
99
|
-
- Agnost AI analytics integration — sign up at app.agnost.ai, one line in server.ts
|
|
100
|
-
- Synthesis endpoint (/briefing/now) — needs ANTHROPIC_KEY + $5 credits
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
## Demo Assets
|
|
105
|
-
1. intelligence-report.html — Anthropic/OpenAI/Palantir government intelligence report
|
|
106
|
-
2. PLTR company landscape — Q4 2025 earnings, $1.1B contracts, Rule of 40 127%
|
|
107
|
-
|
|
108
|
-
Both are best-in-class product demos. Use these in outreach.
|
|
109
|
-
|
|
110
|
-
---
|
|
111
|
-
|
|
112
|
-
## Resume Prompt
|
|
113
|
-
"I'm building freshcontext-mcp — 19 tools live at v0.3.13. Last session: built extract_gebiz
|
|
114
|
-
(Singapore GeBIZ), sent GovTech and Palantir follow-ups, drafted 10 follow-up emails.
|
|
115
|
-
Next: send the 10 drafts, fix bounced email addresses, contact new targets.
|
|
116
|
-
See SESSION_SAVE_V5.md."
|
|
117
|
-
|
|
118
|
-
---
|
|
119
|
-
|
|
120
|
-
*"The work isn't gone. It's just waiting to be continued."*
|
|
121
|
-
*— Prince Gabriel, Grootfontein, Namibia 🇳🇦*
|
package/USAGE.md
DELETED
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
# FreshContext — Usage Guide
|
|
2
|
-
> *13 tools. No API keys. Every result timestamped.*
|
|
3
|
-
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
## Quick Start
|
|
7
|
-
|
|
8
|
-
Add FreshContext to Claude Desktop (no install required):
|
|
9
|
-
|
|
10
|
-
```json
|
|
11
|
-
{
|
|
12
|
-
"mcpServers": {
|
|
13
|
-
"freshcontext": {
|
|
14
|
-
"command": "npx",
|
|
15
|
-
"args": ["-y", "mcp-remote", "https://freshcontext-mcp.gimmanuel73.workers.dev/mcp"]
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
Restart Claude. Done. All 13 tools are now available.
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## The 13 Tools
|
|
26
|
-
|
|
27
|
-
| Tool | What it does | Input |
|
|
28
|
-
|---|---|---|
|
|
29
|
-
| `extract_github` | README, stars, forks, last commit | GitHub URL |
|
|
30
|
-
| `extract_hackernews` | Stories + scores with timestamps | HN URL or search query |
|
|
31
|
-
| `extract_scholar` | Research papers ranked by year | Google Scholar URL |
|
|
32
|
-
| `extract_arxiv` | arXiv papers via official API | Search query or arXiv URL |
|
|
33
|
-
| `extract_reddit` | Subreddit posts + community sentiment | Subreddit URL |
|
|
34
|
-
| `extract_yc` | YC company listings by keyword | Topic keyword |
|
|
35
|
-
| `extract_producthunt` | Recent launches by topic | Topic or PH URL |
|
|
36
|
-
| `search_repos` | GitHub repos ranked by stars + recency | Search query |
|
|
37
|
-
| `package_trends` | npm/PyPI metadata + download stats | Package name(s) |
|
|
38
|
-
| `extract_finance` | Live stock data — price, P/E, 52w range | Ticker symbol(s) |
|
|
39
|
-
| `extract_landscape` | 6 sources in one call | Topic keyword |
|
|
40
|
-
| `extract_changelog` | Update history from any product/repo | GitHub URL, npm name, or website URL |
|
|
41
|
-
| `extract_govcontracts` | US federal contract awards | Company name, keyword, or NAICS code |
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## Command Reference
|
|
46
|
-
|
|
47
|
-
Copy and paste these directly into Claude.
|
|
48
|
-
|
|
49
|
-
---
|
|
50
|
-
|
|
51
|
-
### Competitive Research
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
Use extract_landscape with topic "AI data freshness"
|
|
55
|
-
```
|
|
56
|
-
*Full picture: who's funded, what's trending, what repos exist, what packages are moving.*
|
|
57
|
-
|
|
58
|
-
```
|
|
59
|
-
Use search_repos with query "mcp server typescript"
|
|
60
|
-
```
|
|
61
|
-
*GitHub repos ranked by stars. See who's already building in your space.*
|
|
62
|
-
|
|
63
|
-
```
|
|
64
|
-
Use extract_yc with query "developer infrastructure"
|
|
65
|
-
```
|
|
66
|
-
*Which YC companies are funded in your category.*
|
|
67
|
-
|
|
68
|
-
```
|
|
69
|
-
Use extract_producthunt with url "developer tools"
|
|
70
|
-
```
|
|
71
|
-
*What launched this week in your category.*
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
### Market Intelligence
|
|
76
|
-
|
|
77
|
-
```
|
|
78
|
-
Use extract_hackernews with url "https://hn.algolia.com/?q=model+context+protocol+2026"
|
|
79
|
-
```
|
|
80
|
-
*What the developer community is saying about a topic right now.*
|
|
81
|
-
|
|
82
|
-
```
|
|
83
|
-
Use extract_reddit with url "https://www.reddit.com/r/MachineLearning/"
|
|
84
|
-
```
|
|
85
|
-
*Subreddit sentiment — what problems people are complaining about or excited about.*
|
|
86
|
-
|
|
87
|
-
```
|
|
88
|
-
Use extract_finance with url "NVDA,MSFT,GOOGL"
|
|
89
|
-
```
|
|
90
|
-
*Live stock data for competitive set. Know the market before a pitch.*
|
|
91
|
-
|
|
92
|
-
```
|
|
93
|
-
Use extract_govcontracts with url "AI infrastructure"
|
|
94
|
-
```
|
|
95
|
-
*Which companies are winning federal AI contracts. High-signal GTM data.*
|
|
96
|
-
|
|
97
|
-
```
|
|
98
|
-
Use extract_govcontracts with url "Palantir"
|
|
99
|
-
```
|
|
100
|
-
*How much government business a specific company is doing — and when.*
|
|
101
|
-
|
|
102
|
-
---
|
|
103
|
-
|
|
104
|
-
### Job Market Intelligence
|
|
105
|
-
|
|
106
|
-
```
|
|
107
|
-
Use search_jobs with query "AI engineer" location "remote" max_age_days 7
|
|
108
|
-
```
|
|
109
|
-
*Fresh job listings only. Every result has a freshness badge — never apply to a closed role again.*
|
|
110
|
-
|
|
111
|
-
```
|
|
112
|
-
Use search_jobs with query "typescript developer" remote_only true
|
|
113
|
-
```
|
|
114
|
-
*Remote-only filtered results with publish dates.*
|
|
115
|
-
|
|
116
|
-
```
|
|
117
|
-
Use extract_govcontracts with url "541511"
|
|
118
|
-
```
|
|
119
|
-
*NAICS 541511 = Custom Computer Programming Services. See who's hiring via contract awards.*
|
|
120
|
-
|
|
121
|
-
---
|
|
122
|
-
|
|
123
|
-
### Developer Ecosystem Research
|
|
124
|
-
|
|
125
|
-
```
|
|
126
|
-
Use package_trends with url "mcp,wrangler,anthropic"
|
|
127
|
-
```
|
|
128
|
-
*npm download trends for multiple packages. See what's gaining traction.*
|
|
129
|
-
|
|
130
|
-
```
|
|
131
|
-
Use extract_changelog with url "https://github.com/anthropics/anthropic-sdk-python"
|
|
132
|
-
```
|
|
133
|
-
*Latest releases with dates. Know exactly when a dependency shipped a change.*
|
|
134
|
-
|
|
135
|
-
```
|
|
136
|
-
Use extract_changelog with url "freshcontext-mcp"
|
|
137
|
-
```
|
|
138
|
-
*npm package changelog — version history and release cadence.*
|
|
139
|
-
|
|
140
|
-
```
|
|
141
|
-
Use extract_changelog with url "https://linear.app"
|
|
142
|
-
```
|
|
143
|
-
*Auto-discovers the changelog page and extracts update history.*
|
|
144
|
-
|
|
145
|
-
```
|
|
146
|
-
Use search_repos with query "cloudflare workers MCP 2026"
|
|
147
|
-
```
|
|
148
|
-
*What's being built on a platform right now.*
|
|
149
|
-
|
|
150
|
-
---
|
|
151
|
-
|
|
152
|
-
### Academic & Research Intelligence
|
|
153
|
-
|
|
154
|
-
```
|
|
155
|
-
Use extract_arxiv with url "https://arxiv.org/search/?query=model+context+protocol&searchtype=all"
|
|
156
|
-
```
|
|
157
|
-
*Latest papers on a topic with submission dates.*
|
|
158
|
-
|
|
159
|
-
```
|
|
160
|
-
Use extract_scholar with url "https://scholar.google.com/scholar?q=AI+agent+grounding"
|
|
161
|
-
```
|
|
162
|
-
*Google Scholar results ranked by recency.*
|
|
163
|
-
|
|
164
|
-
---
|
|
165
|
-
|
|
166
|
-
### Full Research Workflows
|
|
167
|
-
|
|
168
|
-
#### Validate a startup idea
|
|
169
|
-
```
|
|
170
|
-
1. Use extract_landscape with topic "[your idea]"
|
|
171
|
-
2. Use extract_yc with query "[your idea]"
|
|
172
|
-
3. Use extract_govcontracts with url "[your idea keyword]"
|
|
173
|
-
4. Use extract_hackernews with url "https://hn.algolia.com/?q=[your+idea]"
|
|
174
|
-
```
|
|
175
|
-
*Tells you: who's funded, what's trending, is there government demand, what do developers think.*
|
|
176
|
-
|
|
177
|
-
#### Research a company before a meeting
|
|
178
|
-
```
|
|
179
|
-
1. Use extract_github with url "https://github.com/[company]"
|
|
180
|
-
2. Use extract_changelog with url "https://github.com/[company]/[main-repo]"
|
|
181
|
-
3. Use extract_govcontracts with url "[company name]"
|
|
182
|
-
4. Use extract_finance with url "[ticker]"
|
|
183
|
-
```
|
|
184
|
-
*Tells you: how active is their engineering team, what did they ship recently, do they have government contracts, what's the stock doing.*
|
|
185
|
-
|
|
186
|
-
#### Find your next job
|
|
187
|
-
```
|
|
188
|
-
1. Use search_jobs with query "[your role]" max_age_days 7
|
|
189
|
-
2. Use extract_govcontracts with url "[target company]"
|
|
190
|
-
3. Use extract_changelog with url "https://github.com/[target-company]/[repo]"
|
|
191
|
-
```
|
|
192
|
-
*Fresh listings only + proof the company is growing + proof they're actively shipping.*
|
|
193
|
-
|
|
194
|
-
#### Track a competitor
|
|
195
|
-
```
|
|
196
|
-
1. Use extract_changelog with url "https://[competitor].com"
|
|
197
|
-
2. Use extract_github with url "https://github.com/[competitor]/[repo]"
|
|
198
|
-
3. Use package_trends with url "[competitor-npm-package]"
|
|
199
|
-
4. Use extract_hackernews with url "https://hn.algolia.com/?q=[competitor+name]"
|
|
200
|
-
```
|
|
201
|
-
*When did they last ship? Is their repo active? Are downloads growing? What is the community saying?*
|
|
202
|
-
|
|
203
|
-
---
|
|
204
|
-
|
|
205
|
-
## Who This Is For
|
|
206
|
-
|
|
207
|
-
### Jobseekers
|
|
208
|
-
The tool FreshContext was built for. Stop applying to roles that closed months ago. Every job listing comes with a freshness badge — green means posted this week, red means posted 60+ days ago. Filter by `max_age_days` to only see roles posted recently.
|
|
209
|
-
|
|
210
|
-
**Key tools:** `search_jobs`, `extract_govcontracts`, `extract_changelog`
|
|
211
|
-
|
|
212
|
-
---
|
|
213
|
-
|
|
214
|
-
### Founders & Product Teams
|
|
215
|
-
Validate ideas, track competitors, monitor your ecosystem. `extract_landscape` gives you a full competitive picture in one call — YC funding, GitHub activity, HN sentiment, Product Hunt launches, npm traction, all timestamped.
|
|
216
|
-
|
|
217
|
-
**Key tools:** `extract_landscape`, `extract_yc`, `extract_changelog`, `extract_hackernews`
|
|
218
|
-
|
|
219
|
-
---
|
|
220
|
-
|
|
221
|
-
### GTM & Sales Teams
|
|
222
|
-
Government contracts are buying intent signals. A company that just won a $5M DoD contract is hiring, spending, and building. FreshContext is the only MCP server with access to USASpending.gov contract data.
|
|
223
|
-
|
|
224
|
-
**Key tools:** `extract_govcontracts`, `extract_landscape`, `extract_finance`
|
|
225
|
-
|
|
226
|
-
---
|
|
227
|
-
|
|
228
|
-
### Investors & Analysts
|
|
229
|
-
Track portfolio companies, find signals before they're obvious, monitor competitor funding. `extract_govcontracts` shows government contract pipeline. `extract_changelog` shows engineering velocity. `extract_finance` gives live market data.
|
|
230
|
-
|
|
231
|
-
**Key tools:** `extract_govcontracts`, `extract_landscape`, `extract_finance`, `extract_changelog`
|
|
232
|
-
|
|
233
|
-
---
|
|
234
|
-
|
|
235
|
-
### Researchers & Academics
|
|
236
|
-
Fresh papers from arXiv and Google Scholar, ranked by date. Never cite a paper without knowing exactly when it was published and retrieved.
|
|
237
|
-
|
|
238
|
-
**Key tools:** `extract_arxiv`, `extract_scholar`, `extract_hackernews`
|
|
239
|
-
|
|
240
|
-
---
|
|
241
|
-
|
|
242
|
-
### Developers & DevRel Teams
|
|
243
|
-
Monitor your dependencies, track ecosystem traction, see what's getting attention in the community. `extract_changelog` works on any GitHub repo, npm package, or website that has a changelog.
|
|
244
|
-
|
|
245
|
-
**Key tools:** `extract_changelog`, `package_trends`, `search_repos`, `extract_github`
|
|
246
|
-
|
|
247
|
-
---
|
|
248
|
-
|
|
249
|
-
## Understanding the FreshContext Envelope
|
|
250
|
-
|
|
251
|
-
Every result is wrapped like this:
|
|
252
|
-
|
|
253
|
-
```
|
|
254
|
-
[FRESHCONTEXT]
|
|
255
|
-
Source: https://github.com/owner/repo
|
|
256
|
-
Published: 2026-03-10
|
|
257
|
-
Retrieved: 2026-03-17T09:19:00Z
|
|
258
|
-
Confidence: high
|
|
259
|
-
---
|
|
260
|
-
... content ...
|
|
261
|
-
[/FRESHCONTEXT]
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
**Confidence levels:**
|
|
265
|
-
- `high` — date came from a structured API field. Reliable.
|
|
266
|
-
- `medium` — date inferred from page signals or URL patterns. Likely correct.
|
|
267
|
-
- `low` — no date signal found. Treat with caution.
|
|
268
|
-
|
|
269
|
-
The gap between `Published` and `Retrieved` is your staleness indicator. If a job was published 90 days ago and retrieved today, the role is likely filled. If a GitHub repo was last pushed 2 years ago, the project may be abandoned.
|
|
270
|
-
|
|
271
|
-
---
|
|
272
|
-
|
|
273
|
-
## Freshness Score (coming in v0.4.0)
|
|
274
|
-
|
|
275
|
-
A numeric score from 0–100 will be added to every result:
|
|
276
|
-
|
|
277
|
-
```
|
|
278
|
-
freshness_score = max(0, 100 - (days_since_retrieved × decay_rate))
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
Different data types decay at different rates — financial data goes stale faster than academic papers. You'll be able to filter results by `freshness_score > 70` directly in your prompts.
|
|
282
|
-
|
|
283
|
-
---
|
|
284
|
-
|
|
285
|
-
## The Standard
|
|
286
|
-
|
|
287
|
-
FreshContext implements the **FreshContext Specification v1.0** — an open standard for data freshness envelopes. See `FRESHCONTEXT_SPEC.md` for the full specification.
|
|
288
|
-
|
|
289
|
-
Any tool or agent that wraps its retrieved data in the FreshContext envelope is **FreshContext-compatible**.
|
|
290
|
-
|
|
291
|
-
---
|
|
292
|
-
|
|
293
|
-
*Built by Prince Gabriel — Grootfontein, Namibia 🇳🇦*
|
|
294
|
-
*"The work isn't gone. It's just waiting to be continued."*
|
package/add-cache.cjs
DELETED
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
2
|
-
let content = fs.readFileSync('./worker/src/worker.ts', 'utf8');
|
|
3
|
-
|
|
4
|
-
// Tools that need withCache wrapping (github already done)
|
|
5
|
-
// For each: find the async handler start and add withCache open
|
|
6
|
-
// Then find the corresponding catch line and add the closing
|
|
7
|
-
|
|
8
|
-
const tools = [
|
|
9
|
-
{ name: 'extract_hackernews', adapter: 'hackernews', input: 'url' },
|
|
10
|
-
{ name: 'extract_scholar', adapter: 'scholar', input: 'url' },
|
|
11
|
-
{ name: 'extract_yc', adapter: 'yc', input: 'url' },
|
|
12
|
-
{ name: 'search_repos', adapter: 'reposearch', input: 'query' },
|
|
13
|
-
{ name: 'package_trends', adapter: 'packagetrends', input: 'packages' },
|
|
14
|
-
{ name: 'extract_reddit', adapter: 'reddit', input: 'url' },
|
|
15
|
-
{ name: 'extract_producthunt', adapter: 'producthunt', input: 'url' },
|
|
16
|
-
{ name: 'extract_finance', adapter: 'finance', input: 'url' },
|
|
17
|
-
{ name: 'search_jobs', adapter: 'jobs', input: 'query' },
|
|
18
|
-
{ name: 'extract_landscape', adapter: 'landscape', input: 'topic' },
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
// We'll work line-by-line for precision
|
|
22
|
-
const lines = content.split('\n');
|
|
23
|
-
const result = [];
|
|
24
|
-
let i = 0;
|
|
25
|
-
|
|
26
|
-
while (i < lines.length) {
|
|
27
|
-
const line = lines[i];
|
|
28
|
-
|
|
29
|
-
// Check if this line closes a tool handler that needs wrapping
|
|
30
|
-
// Pattern: " } catch (err: any) { return ..." followed by " });"
|
|
31
|
-
// We add " }); // end withCache" before the closing });
|
|
32
|
-
if (
|
|
33
|
-
line.match(/^\s+\} catch \(err: any\) \{ return \{ content/) &&
|
|
34
|
-
lines[i + 1] && lines[i + 1].trim() === '});' &&
|
|
35
|
-
!(lines[i + 1].includes('end withCache'))
|
|
36
|
-
) {
|
|
37
|
-
result.push(line);
|
|
38
|
-
result.push(' }); // end withCache');
|
|
39
|
-
i++;
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
result.push(line);
|
|
44
|
-
i++;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
content = result.join('\n');
|
|
48
|
-
|
|
49
|
-
// Now add the withCache OPEN for each tool
|
|
50
|
-
// Pattern to find: the }, async ({ INPUT }) => {\n try {
|
|
51
|
-
// for each tool, but only if not already wrapped
|
|
52
|
-
|
|
53
|
-
for (const tool of tools) {
|
|
54
|
-
// Build a specific marker string that is unique per tool
|
|
55
|
-
// Look for the line: " }, async ({ url/query/etc }) => {"
|
|
56
|
-
// followed by next non-empty content being " try {"
|
|
57
|
-
// We replace " try {" with " return withCache(...); try {"
|
|
58
|
-
|
|
59
|
-
// Find the tool's registerTool call, then find the first "try {" after it
|
|
60
|
-
const toolMarker = `server.registerTool("${tool.name}"`;
|
|
61
|
-
const idx = content.indexOf(toolMarker);
|
|
62
|
-
if (idx === -1) { console.log('Tool not found: ' + tool.name); continue; }
|
|
63
|
-
|
|
64
|
-
// From that position, find the first " try {" that is NOT already preceded by withCache
|
|
65
|
-
const afterTool = content.slice(idx);
|
|
66
|
-
const tryIdx = afterTool.indexOf('\n try {');
|
|
67
|
-
if (tryIdx === -1) { console.log('No try block for: ' + tool.name); continue; }
|
|
68
|
-
|
|
69
|
-
// Check if withCache is already there (look 200 chars before the try)
|
|
70
|
-
const beforeTry = afterTool.slice(Math.max(0, tryIdx - 200), tryIdx);
|
|
71
|
-
if (beforeTry.includes('withCache')) {
|
|
72
|
-
console.log('Already wrapped: ' + tool.name);
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// Insert the withCache line before " try {"
|
|
77
|
-
const absoluteIdx = idx + tryIdx;
|
|
78
|
-
content = content.slice(0, absoluteIdx) +
|
|
79
|
-
`\n return withCache("${tool.adapter}", ${tool.input}, env.CACHE, async () => {` +
|
|
80
|
-
content.slice(absoluteIdx);
|
|
81
|
-
|
|
82
|
-
console.log('Wrapped: ' + tool.name);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
fs.writeFileSync('./worker/src/worker.ts', content, 'utf8');
|
|
86
|
-
console.log('\nAll done. Lines: ' + content.split('\n').length);
|
package/dataset_schema.json
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"actorSpecification": 1,
|
|
3
|
-
"fields": [
|
|
4
|
-
{
|
|
5
|
-
"fieldId": "adapter",
|
|
6
|
-
"fieldType": "String",
|
|
7
|
-
"title": "Adapter",
|
|
8
|
-
"description": "The source adapter used to retrieve the data (e.g. github, hackernews, reddit, yc, scholar)."
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"fieldId": "source_url",
|
|
12
|
-
"fieldType": "String",
|
|
13
|
-
"title": "Source URL",
|
|
14
|
-
"description": "The URL of the original source the data was retrieved from."
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"fieldId": "content",
|
|
18
|
-
"fieldType": "String",
|
|
19
|
-
"title": "Content",
|
|
20
|
-
"description": "The retrieved content from the source, truncated to max_length characters."
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
"fieldId": "retrieved_at",
|
|
24
|
-
"fieldType": "String",
|
|
25
|
-
"title": "Retrieved at",
|
|
26
|
-
"description": "ISO 8601 timestamp of when FreshContext fetched this data. Always reflects the actual retrieval time."
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
"fieldId": "content_date",
|
|
30
|
-
"fieldType": "String",
|
|
31
|
-
"title": "Content date",
|
|
32
|
-
"description": "Best estimate of when the original content was published. Null if unknown."
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"fieldId": "freshness_confidence",
|
|
36
|
-
"fieldType": "String",
|
|
37
|
-
"title": "Freshness confidence",
|
|
38
|
-
"description": "Confidence level of the content_date estimate. One of: high (from structured API/metadata), medium (inferred from page signals), low (estimated or unknown)."
|
|
39
|
-
}
|
|
40
|
-
]
|
|
41
|
-
}
|
package/input_schema.json
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"title": "FreshContext Input",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"schemaVersion": 1,
|
|
5
|
-
"properties": {
|
|
6
|
-
"tool": {
|
|
7
|
-
"title": "Tool",
|
|
8
|
-
"type": "string",
|
|
9
|
-
"description": "The FreshContext tool to run. See README for full descriptions.",
|
|
10
|
-
"enum": [
|
|
11
|
-
"extract_hackernews",
|
|
12
|
-
"extract_github",
|
|
13
|
-
"extract_govcontracts",
|
|
14
|
-
"extract_sec_filings",
|
|
15
|
-
"extract_gdelt",
|
|
16
|
-
"extract_gebiz",
|
|
17
|
-
"extract_finance",
|
|
18
|
-
"extract_changelog",
|
|
19
|
-
"extract_arxiv",
|
|
20
|
-
"extract_scholar",
|
|
21
|
-
"extract_reddit",
|
|
22
|
-
"extract_yc",
|
|
23
|
-
"extract_producthunt",
|
|
24
|
-
"search_repos",
|
|
25
|
-
"package_trends",
|
|
26
|
-
"search_jobs"
|
|
27
|
-
],
|
|
28
|
-
"default": "extract_hackernews",
|
|
29
|
-
"editor": "select"
|
|
30
|
-
},
|
|
31
|
-
"url": {
|
|
32
|
-
"title": "URL or Query",
|
|
33
|
-
"type": "string",
|
|
34
|
-
"description": "The main input for the tool. For extract_github: full GitHub URL. For extract_hackernews: HN URL or search URL. For extract_govcontracts/extract_sec_filings/extract_gdelt/extract_gebiz/extract_finance: company name, keyword, or ticker. For search_repos/package_trends/search_jobs: search keyword.",
|
|
35
|
-
"editor": "textfield"
|
|
36
|
-
},
|
|
37
|
-
"max_length": {
|
|
38
|
-
"title": "Max content length",
|
|
39
|
-
"type": "integer",
|
|
40
|
-
"description": "Maximum characters returned. Default: 8000.",
|
|
41
|
-
"default": 8000,
|
|
42
|
-
"minimum": 500,
|
|
43
|
-
"maximum": 20000,
|
|
44
|
-
"editor": "number"
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
"required": ["tool"]
|
|
48
|
-
}
|