agentic-rss-parser 1.0.1
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/CHANGELOG.md +20 -0
- package/CODE_OF_CONDUCT.md +71 -0
- package/CONTRIBUTING.md +42 -0
- package/LICENSE +21 -0
- package/README.md +282 -0
- package/SECURITY.md +66 -0
- package/SUPPORT.md +23 -0
- package/agentic-rss-mcp +2 -0
- package/agentic-rss-parser +2 -0
- package/examples/README.md +14 -0
- package/examples/adk-real.mjs +36 -0
- package/examples/direct.mjs +18 -0
- package/package.json +74 -0
- package/src/adapters/index.js +1 -0
- package/src/adapters/provider.js +73 -0
- package/src/agent.js +71 -0
- package/src/cli.js +40 -0
- package/src/compat.js +82 -0
- package/src/core/http.js +63 -0
- package/src/core/parser.js +143 -0
- package/src/fetch-article.js +29 -0
- package/src/index.d.ts +135 -0
- package/src/index.js +7 -0
- package/src/mcp/server.js +62 -0
- package/src/parser.js +81 -0
- package/src/storage.js +62 -0
- package/src/tools.js +2 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 1.0.1
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- from-scratch RSS and Atom parsing with a compatibility layer for `rss-parser`-style usage
|
|
8
|
+
- agentic analysis pipeline with deduplication, enrichment, and provider adapters
|
|
9
|
+
- MCP-ready tooling and CLI entrypoints
|
|
10
|
+
- realistic RSS and Atom fixture coverage
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- replaced the old XML stack with `fast-xml-parser`
|
|
15
|
+
- updated the public package surface and release metadata
|
|
16
|
+
|
|
17
|
+
### Notes
|
|
18
|
+
|
|
19
|
+
- `parseURL()` and `parseString()` are supported for migration purposes
|
|
20
|
+
- `parseFeed()` exposes the agentic workflow for programmatic use
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or sexual identity and orientation.
|
|
6
|
+
|
|
7
|
+
We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
|
|
8
|
+
|
|
9
|
+
## Our Standards
|
|
10
|
+
|
|
11
|
+
Examples of behavior that contributes to a positive environment for our community include:
|
|
12
|
+
|
|
13
|
+
- demonstrating empathy and kindness toward other people
|
|
14
|
+
- being respectful of differing opinions, viewpoints, and experiences
|
|
15
|
+
- giving and gracefully accepting constructive feedback
|
|
16
|
+
- accepting responsibility and apologizing to those affected by our mistakes
|
|
17
|
+
- focusing on what is best not just for us as individuals, but for the overall community
|
|
18
|
+
|
|
19
|
+
Examples of unacceptable behavior include:
|
|
20
|
+
|
|
21
|
+
- the use of sexualized language or imagery, and sexual attention or advances of any kind
|
|
22
|
+
- trolling, insulting or derogatory comments, and personal or political attacks
|
|
23
|
+
- public or private harassment
|
|
24
|
+
- publishing others' private information, such as a physical or email address, without their explicit permission
|
|
25
|
+
- other conduct which could reasonably be considered inappropriate in a professional setting
|
|
26
|
+
|
|
27
|
+
## Enforcement Responsibilities
|
|
28
|
+
|
|
29
|
+
Project maintainers are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
|
|
30
|
+
|
|
31
|
+
## Scope
|
|
32
|
+
|
|
33
|
+
This Code of Conduct applies within all project spaces, and also applies when an individual is officially representing the project in public spaces.
|
|
34
|
+
|
|
35
|
+
## Enforcement
|
|
36
|
+
|
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project maintainers.
|
|
38
|
+
|
|
39
|
+
All complaints will be reviewed and investigated promptly and fairly.
|
|
40
|
+
|
|
41
|
+
## Enforcement Guidelines
|
|
42
|
+
|
|
43
|
+
Project maintainers will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
|
|
44
|
+
|
|
45
|
+
### 1. Correction
|
|
46
|
+
|
|
47
|
+
Community Impact: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
|
|
48
|
+
|
|
49
|
+
Consequence: A private, written warning from maintainers, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate.
|
|
50
|
+
|
|
51
|
+
### 2. Warning
|
|
52
|
+
|
|
53
|
+
Community Impact: A violation through a single incident or series of actions.
|
|
54
|
+
|
|
55
|
+
Consequence: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time.
|
|
56
|
+
|
|
57
|
+
### 3. Temporary Ban
|
|
58
|
+
|
|
59
|
+
Community Impact: A serious violation of community standards, including sustained inappropriate behavior.
|
|
60
|
+
|
|
61
|
+
Consequence: A temporary ban from any sort of interaction or public communication with the community for a specified period of time.
|
|
62
|
+
|
|
63
|
+
### 4. Permanent Ban
|
|
64
|
+
|
|
65
|
+
Community Impact: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
|
|
66
|
+
|
|
67
|
+
Consequence: A permanent ban from any sort of public interaction within the community.
|
|
68
|
+
|
|
69
|
+
## Attribution
|
|
70
|
+
|
|
71
|
+
This Code of Conduct is adapted from the Contributor Covenant, version 2.1.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for helping improve `agentic-rss-parser`.
|
|
4
|
+
|
|
5
|
+
This project follows a lightweight but standard open-source workflow:
|
|
6
|
+
|
|
7
|
+
- keep changes focused and reviewable
|
|
8
|
+
- add or update tests for behavior changes
|
|
9
|
+
- preserve compatibility unless a breaking change is intentional and documented
|
|
10
|
+
- prefer clear documentation alongside code changes
|
|
11
|
+
- avoid unnecessary dependency growth
|
|
12
|
+
|
|
13
|
+
## Local setup
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install
|
|
17
|
+
npm test
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Before You Open a PR
|
|
21
|
+
|
|
22
|
+
- run `npm test`
|
|
23
|
+
- run `npm audit`
|
|
24
|
+
- make sure `README.md` and `CHANGELOG.md` stay accurate if the public surface changes
|
|
25
|
+
- include a concise summary of user impact in the PR description
|
|
26
|
+
|
|
27
|
+
## What to contribute
|
|
28
|
+
|
|
29
|
+
- parser improvements
|
|
30
|
+
- provider adapters
|
|
31
|
+
- MCP compatibility
|
|
32
|
+
- feed normalization and deduplication improvements
|
|
33
|
+
- docs, examples, and tests
|
|
34
|
+
|
|
35
|
+
## Guidelines
|
|
36
|
+
|
|
37
|
+
- keep the public API stable
|
|
38
|
+
- add tests for behavior changes
|
|
39
|
+
- prefer small, focused changes
|
|
40
|
+
- avoid adding heavyweight dependencies unless they clearly improve the library
|
|
41
|
+
- document any compatibility tradeoffs in the PR
|
|
42
|
+
- follow the existing code style and naming patterns
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Bluecarbons / Agentic RSS Parser contributors
|
|
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/README.md
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
# Agentic RSS Parser
|
|
2
|
+
|
|
3
|
+
[](https://github.com/bluecarbons/agentic-rss-parser/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/agentic-rss-parser)
|
|
5
|
+
[](./SUPPORT.md)
|
|
6
|
+
[](./LICENSE)
|
|
7
|
+
[](./LICENSE)
|
|
8
|
+
[](https://github.com/bluecarbons/agentic-rss-parser)
|
|
9
|
+
[](https://github.com/bluecarbons/agentic-rss-parser/issues)
|
|
10
|
+
|
|
11
|
+
Agentic RSS Parser is a from-scratch Node.js library for parsing RSS and Atom feeds, normalizing them into a familiar `Parser` API, and optionally running agentic analysis on top of feed items.
|
|
12
|
+
|
|
13
|
+
## Supported Environments
|
|
14
|
+
|
|
15
|
+
- Node.js `>=22.5.0`
|
|
16
|
+
- ESM-only package
|
|
17
|
+
- Linux, macOS, and Windows
|
|
18
|
+
|
|
19
|
+
Why Node.js 22.5.0 or newer:
|
|
20
|
+
|
|
21
|
+
- the project uses the built-in `node:sqlite` module
|
|
22
|
+
- `node:sqlite` was added in Node.js 22.5.0
|
|
23
|
+
- Node.js 20 does not support the current codebase
|
|
24
|
+
|
|
25
|
+
## Design Goals
|
|
26
|
+
|
|
27
|
+
- compatible migration path for `rss-parser`-style code
|
|
28
|
+
- small, well-documented public API
|
|
29
|
+
- modern XML parsing with `fast-xml-parser`
|
|
30
|
+
- conservative normalization for compatibility
|
|
31
|
+
- agentic features are opt-in, not forced
|
|
32
|
+
- no dependency on the deprecated `rss-parser` package
|
|
33
|
+
|
|
34
|
+
## Features
|
|
35
|
+
|
|
36
|
+
- parses RSS 2.0 and Atom feeds
|
|
37
|
+
- supports `Parser`, `parseURL`, `parseString`, and `parseFile`
|
|
38
|
+
- normalizes output into stable feed and item objects
|
|
39
|
+
- supports callback and promise styles
|
|
40
|
+
- supports `customFields`, `timeout`, `headers`, `maxRedirects`, `requestOptions`, `defaultRSS`, and `xml2js`
|
|
41
|
+
- deduplicates processed items with SQLite
|
|
42
|
+
- enriches summaries with full article text
|
|
43
|
+
- supports provider-backed analysis with OpenAI-compatible and Anthropic-compatible adapters
|
|
44
|
+
- exposes a CLI and MCP tool entrypoint
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
npm install agentic-rss-parser
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
pnpm add agentic-rss-parser
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Usage
|
|
57
|
+
|
|
58
|
+
### Parse a feed
|
|
59
|
+
|
|
60
|
+
```js
|
|
61
|
+
import Parser from 'agentic-rss-parser';
|
|
62
|
+
|
|
63
|
+
const parser = new Parser({
|
|
64
|
+
timeout: 10000,
|
|
65
|
+
headers: { 'user-agent': 'my-app/1.0' }
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const feed = await parser.parseURL('https://news.ycombinator.com/rss');
|
|
69
|
+
console.log(feed.title);
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### Use the compatibility API
|
|
73
|
+
|
|
74
|
+
```js
|
|
75
|
+
import Parser from 'agentic-rss-parser';
|
|
76
|
+
|
|
77
|
+
const parser = new Parser({
|
|
78
|
+
customFields: {
|
|
79
|
+
item: [['dc:creator', 'creator']]
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const feed = await parser.parseString(xml);
|
|
84
|
+
console.log(feed.items[0].creator);
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Callback style
|
|
88
|
+
|
|
89
|
+
```js
|
|
90
|
+
const parser = new Parser();
|
|
91
|
+
|
|
92
|
+
parser.parseString(xml, (err, feed) => {
|
|
93
|
+
if (err) throw err;
|
|
94
|
+
console.log(feed.title);
|
|
95
|
+
});
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Parse from a file
|
|
99
|
+
|
|
100
|
+
```js
|
|
101
|
+
import Parser from 'agentic-rss-parser';
|
|
102
|
+
|
|
103
|
+
const parser = new Parser();
|
|
104
|
+
const feed = await parser.parseFile('./feed.xml');
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Agentic workflow
|
|
108
|
+
|
|
109
|
+
```js
|
|
110
|
+
import { runAgenticParser } from 'agentic-rss-parser';
|
|
111
|
+
|
|
112
|
+
const results = await runAgenticParser({
|
|
113
|
+
feedUrls: ['https://news.ycombinator.com/rss'],
|
|
114
|
+
dbPath: './data/rss-agent.db',
|
|
115
|
+
fetchFullArticle: true,
|
|
116
|
+
model: {
|
|
117
|
+
provider: 'openai',
|
|
118
|
+
model: 'gpt-4o-mini'
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
for (const entry of results) {
|
|
123
|
+
if (entry.analysis.decision === 'relevant') {
|
|
124
|
+
console.log(entry.analysis.summary);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
You can also control concurrent feed processing:
|
|
130
|
+
|
|
131
|
+
```js
|
|
132
|
+
const results = await runAgenticParser({
|
|
133
|
+
feedUrls: [
|
|
134
|
+
'https://news.ycombinator.com/rss',
|
|
135
|
+
'https://hnrss.org/frontpage'
|
|
136
|
+
],
|
|
137
|
+
dbPath: './data/rss-agent.db',
|
|
138
|
+
concurrency: 2
|
|
139
|
+
});
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Works With Google ADK And Other Agent Frameworks
|
|
143
|
+
|
|
144
|
+
Agentic RSS Parser is designed to complement agent frameworks, not replace them.
|
|
145
|
+
|
|
146
|
+
Use it when you want:
|
|
147
|
+
|
|
148
|
+
- feed ingestion and normalization
|
|
149
|
+
- `rss-parser`-style compatibility for existing code
|
|
150
|
+
- deduplication and article enrichment
|
|
151
|
+
- a clean, agent-ready tool surface
|
|
152
|
+
|
|
153
|
+
It fits naturally alongside frameworks like Google ADK, where the framework handles agent orchestration and this package handles RSS and Atom data retrieval, normalization, and enrichment.
|
|
154
|
+
|
|
155
|
+
Typical integration patterns:
|
|
156
|
+
|
|
157
|
+
- call the library directly from a Node.js tool or workflow
|
|
158
|
+
- wrap `Parser` or `runAgenticParser` inside an ADK custom tool
|
|
159
|
+
- expose the parser through MCP for agent clients that prefer tool protocols
|
|
160
|
+
|
|
161
|
+
Mental model:
|
|
162
|
+
|
|
163
|
+
- ADK decides what to do
|
|
164
|
+
- Agentic RSS Parser gathers, normalizes, deduplicates, and enriches the feed data
|
|
165
|
+
- ADK or another orchestrator uses the structured result to continue the workflow
|
|
166
|
+
|
|
167
|
+
For a concrete starting point, see:
|
|
168
|
+
|
|
169
|
+
- [`examples/direct.mjs`](./examples/direct.mjs)
|
|
170
|
+
- [`examples/README.md`](./examples/README.md)
|
|
171
|
+
- [`examples/adk-real.mjs`](./examples/adk-real.mjs)
|
|
172
|
+
- [`examples/adk-tool.mjs`](./examples/adk-tool.mjs)
|
|
173
|
+
|
|
174
|
+
## Migration From `rss-parser`
|
|
175
|
+
|
|
176
|
+
Most existing code can switch imports with minimal changes:
|
|
177
|
+
|
|
178
|
+
```js
|
|
179
|
+
import Parser from 'agentic-rss-parser';
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
Supported compatibility surface:
|
|
183
|
+
|
|
184
|
+
- `new Parser(options)`
|
|
185
|
+
- `parseURL(url[, callback])`
|
|
186
|
+
- `parseString(xml[, callback])`
|
|
187
|
+
- `parseFile(path[, callback])`
|
|
188
|
+
- `customFields`
|
|
189
|
+
- `timeout`
|
|
190
|
+
- `headers`
|
|
191
|
+
- `maxRedirects`
|
|
192
|
+
- `requestOptions`
|
|
193
|
+
- `defaultRSS`
|
|
194
|
+
- `xml2js`
|
|
195
|
+
|
|
196
|
+
Supported XML shapes:
|
|
197
|
+
|
|
198
|
+
- RSS 2.0 feeds with `<item>` entries
|
|
199
|
+
- Atom feeds with `<entry>` entries
|
|
200
|
+
- namespaced fields like `dc:creator` and `content:encoded`
|
|
201
|
+
- repeated tags, attributes, and CDATA
|
|
202
|
+
|
|
203
|
+
The compatibility layer normalizes output into familiar feed and item objects while preserving the agentic feature set.
|
|
204
|
+
|
|
205
|
+
## CLI
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
npx agentic-rss-parser --feed https://news.ycombinator.com/rss
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Multiple feeds:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
npx agentic-rss-parser \
|
|
215
|
+
--feed https://news.ycombinator.com/rss \
|
|
216
|
+
--feed https://hnrss.org/frontpage \
|
|
217
|
+
--db ./data/rss-agent.db
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## MCP Tooling
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
npx agentic-rss-mcp --feed https://news.ycombinator.com/rss
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## Parallelism
|
|
227
|
+
|
|
228
|
+
Agentic RSS Parser does not currently run a swarm-style parallel orchestration layer on its own.
|
|
229
|
+
|
|
230
|
+
What it does support:
|
|
231
|
+
|
|
232
|
+
- you can call it multiple times from your own code in parallel when that makes sense
|
|
233
|
+
- you can wrap it in an ADK workflow that uses parallel agents or parallel tool calls
|
|
234
|
+
- you can manage concurrency at the orchestration layer instead of inside the parser
|
|
235
|
+
- you can set `concurrency` on `runAgenticParser` to process multiple feeds at once
|
|
236
|
+
|
|
237
|
+
What it does not do yet:
|
|
238
|
+
|
|
239
|
+
- automatic swarm scheduling
|
|
240
|
+
- distributed scraping coordination
|
|
241
|
+
- cross-feed task planning
|
|
242
|
+
|
|
243
|
+
## Development
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
npm install
|
|
247
|
+
npm test
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
```bash
|
|
251
|
+
pnpm install
|
|
252
|
+
pnpm test
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
## Package Health
|
|
256
|
+
|
|
257
|
+
- pinned Node.js support is documented in [SUPPORT.md](./SUPPORT.md)
|
|
258
|
+
- dependency updates should be reviewed before release
|
|
259
|
+
- `npm audit` should stay clean before merging
|
|
260
|
+
- release steps are documented in [PUBLISHING.md](./PUBLISHING.md)
|
|
261
|
+
|
|
262
|
+
## Project Structure
|
|
263
|
+
|
|
264
|
+
- `src/core/parser.js`: XML parsing and normalization
|
|
265
|
+
- `src/core/http.js`: redirect-aware feed fetching
|
|
266
|
+
- `src/compat.js`: `Parser` compatibility surface
|
|
267
|
+
- `src/parser.js`: agentic feed pipeline
|
|
268
|
+
- `src/adapters/provider.js`: model provider adapters
|
|
269
|
+
- `src/mcp/server.js`: MCP entrypoint
|
|
270
|
+
|
|
271
|
+
## Security
|
|
272
|
+
|
|
273
|
+
- only fetch trusted feed URLs
|
|
274
|
+
- keep model-provider API keys out of source control
|
|
275
|
+
- review custom XML feeds before processing them in production
|
|
276
|
+
- see [SECURITY.md](./SECURITY.md) for vulnerability reporting
|
|
277
|
+
|
|
278
|
+
## Contributing
|
|
279
|
+
|
|
280
|
+
Please read [CONTRIBUTING.md](./CONTRIBUTING.md) before opening a pull request.
|
|
281
|
+
|
|
282
|
+
Please also review the [Code of Conduct](./CODE_OF_CONDUCT.md) before participating.
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Supported Versions
|
|
4
|
+
|
|
5
|
+
We support the latest `main` branch and the most recent released version.
|
|
6
|
+
|
|
7
|
+
## Reporting a Vulnerability
|
|
8
|
+
|
|
9
|
+
If you discover a security issue, please do not open a public issue.
|
|
10
|
+
|
|
11
|
+
Instead:
|
|
12
|
+
|
|
13
|
+
- contact the maintainers privately through the repository's security contact process
|
|
14
|
+
- include a clear description of the issue
|
|
15
|
+
- include reproduction steps if possible
|
|
16
|
+
- include any relevant feed sample or payload, if safe to share
|
|
17
|
+
|
|
18
|
+
## Security Guidance
|
|
19
|
+
|
|
20
|
+
- only process feeds from sources you trust
|
|
21
|
+
- prefer HTTPS feed URLs
|
|
22
|
+
- keep API keys and tokens out of source control
|
|
23
|
+
- review custom feed XML before processing untrusted content in production
|
|
24
|
+
- validate feed URLs before use and reject non-HTTP protocols
|
|
25
|
+
- keep MCP servers on least privilege
|
|
26
|
+
- prefer local stdio MCP when possible over exposed remote transports
|
|
27
|
+
- do not trust tool descriptions or tool names from unvetted MCP servers
|
|
28
|
+
- treat feed content as untrusted input, especially when it can influence agent prompts
|
|
29
|
+
|
|
30
|
+
## Threat Model Notes
|
|
31
|
+
|
|
32
|
+
### MITM
|
|
33
|
+
|
|
34
|
+
When fetching feeds over the network, a man-in-the-middle attacker could tamper with XML, inject malicious links, or alter the feed metadata.
|
|
35
|
+
|
|
36
|
+
Mitigations:
|
|
37
|
+
|
|
38
|
+
- use HTTPS whenever possible
|
|
39
|
+
- keep request timeouts enabled
|
|
40
|
+
- only allow `http:` and `https:` URLs
|
|
41
|
+
- avoid logging secrets or credentials from fetched content
|
|
42
|
+
|
|
43
|
+
### MCP Abuse
|
|
44
|
+
|
|
45
|
+
MCP is a powerful integration surface and can be abused through prompt injection, tool poisoning, insecure transport, or over-privileged tool access.
|
|
46
|
+
|
|
47
|
+
Mitigations:
|
|
48
|
+
|
|
49
|
+
- expose only the tools the agent actually needs
|
|
50
|
+
- keep tool descriptions narrow and specific
|
|
51
|
+
- validate all tool arguments before execution
|
|
52
|
+
- avoid connecting untrusted remote MCP servers to privileged data sources
|
|
53
|
+
- prefer explicit user approval for destructive or external side effects
|
|
54
|
+
- apply authentication and authorization controls for any remote MCP deployment
|
|
55
|
+
|
|
56
|
+
### Agent Orchestration
|
|
57
|
+
|
|
58
|
+
If you embed this package inside an agent framework, the orchestrator should control concurrency and tool invocation. This package intentionally stays focused on feed retrieval, normalization, deduplication, and enrichment.
|
|
59
|
+
|
|
60
|
+
## Dependency Updates
|
|
61
|
+
|
|
62
|
+
We review dependency updates regularly and keep the published package audit-clean before release.
|
|
63
|
+
|
|
64
|
+
## Disclosure
|
|
65
|
+
|
|
66
|
+
We aim to acknowledge and address confirmed security issues promptly.
|
package/SUPPORT.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Supported Environments
|
|
2
|
+
|
|
3
|
+
Agentic RSS Parser is supported on:
|
|
4
|
+
|
|
5
|
+
- Node.js `>=22.5.0`
|
|
6
|
+
- ESM modules only
|
|
7
|
+
- Linux, macOS, and Windows
|
|
8
|
+
|
|
9
|
+
Why this matters:
|
|
10
|
+
|
|
11
|
+
- the codebase depends on the built-in `node:sqlite` module
|
|
12
|
+
- `node:sqlite` was introduced in Node.js 22.5.0
|
|
13
|
+
- Node.js 20 is not supported for this package
|
|
14
|
+
|
|
15
|
+
Recommended CI matrix:
|
|
16
|
+
|
|
17
|
+
- Node.js 22.x
|
|
18
|
+
- Node.js 24.x
|
|
19
|
+
|
|
20
|
+
Recommended local setup:
|
|
21
|
+
|
|
22
|
+
- use `npm install`
|
|
23
|
+
- run `npm test` before opening a pull request
|
package/agentic-rss-mcp
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Examples
|
|
2
|
+
|
|
3
|
+
This folder shows a few common ways to use `agentic-rss-parser`.
|
|
4
|
+
|
|
5
|
+
## Files
|
|
6
|
+
|
|
7
|
+
- `direct.mjs`: basic library usage from Node.js
|
|
8
|
+
- `adk-real.mjs`: a more concrete example using `@google/adk`
|
|
9
|
+
|
|
10
|
+
## Notes
|
|
11
|
+
|
|
12
|
+
- The ADK examples assume you install `@google/adk` in your own app.
|
|
13
|
+
- The direct example works with only this package installed.
|
|
14
|
+
- The examples are intentionally small and are meant to be copied into your app, not run as-is in production.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { FunctionTool, LlmAgent } from '@google/adk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { runAgenticParser } from '../src/index.js';
|
|
4
|
+
|
|
5
|
+
const fetchRssFeed = new FunctionTool({
|
|
6
|
+
name: 'fetch_rss_feed',
|
|
7
|
+
description: 'Fetches, normalizes, deduplicates, and optionally enriches RSS or Atom feeds.',
|
|
8
|
+
parameters: z.object({
|
|
9
|
+
url: z.string().url().describe('The RSS or Atom feed URL to fetch.'),
|
|
10
|
+
fetchFullArticle: z.boolean().default(false).describe('Whether to fetch the full article body.'),
|
|
11
|
+
}),
|
|
12
|
+
execute: async ({ url, fetchFullArticle }) => {
|
|
13
|
+
const results = await runAgenticParser({
|
|
14
|
+
feedUrls: [url],
|
|
15
|
+
dbPath: './data/rss-agent.db',
|
|
16
|
+
fetchFullArticle,
|
|
17
|
+
concurrency: 2
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
status: 'success',
|
|
22
|
+
feedCount: results.length,
|
|
23
|
+
items: results.map((entry) => entry.item),
|
|
24
|
+
analyses: results.map((entry) => entry.analysis)
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const rssAgent = new LlmAgent({
|
|
30
|
+
name: 'rss_ingest_agent',
|
|
31
|
+
model: 'gemini-flash-latest',
|
|
32
|
+
description: 'Ingests and summarizes RSS feeds using Agentic RSS Parser.',
|
|
33
|
+
instruction:
|
|
34
|
+
'Use fetch_rss_feed when you need normalized feed items, deduplication, or article enrichment.',
|
|
35
|
+
tools: [fetchRssFeed]
|
|
36
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import Parser, { runAgenticParser } from '../src/index.js';
|
|
2
|
+
|
|
3
|
+
const parser = new Parser({
|
|
4
|
+
timeout: 10000,
|
|
5
|
+
headers: { 'user-agent': 'example-app/1.0' }
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
const feed = await parser.parseURL('https://news.ycombinator.com/rss');
|
|
9
|
+
console.log(feed.title);
|
|
10
|
+
console.log(feed.items.slice(0, 3).map((item) => item.title));
|
|
11
|
+
|
|
12
|
+
const results = await runAgenticParser({
|
|
13
|
+
feedUrls: ['https://news.ycombinator.com/rss'],
|
|
14
|
+
dbPath: './data/rss-agent.db',
|
|
15
|
+
fetchFullArticle: false
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
console.log(results.length);
|
package/package.json
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "agentic-rss-parser",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=22.5.0"
|
|
7
|
+
},
|
|
8
|
+
"description": "An open-source agentic RSS parser and tool server for Node.js.",
|
|
9
|
+
"keywords": [
|
|
10
|
+
"rss",
|
|
11
|
+
"atom",
|
|
12
|
+
"parser",
|
|
13
|
+
"agentic",
|
|
14
|
+
"mcp",
|
|
15
|
+
"nodejs",
|
|
16
|
+
"typescript",
|
|
17
|
+
"feeds",
|
|
18
|
+
"open-source"
|
|
19
|
+
],
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"main": "./src/index.js",
|
|
25
|
+
"types": "./src/index.d.ts",
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "https://github.com/bluecarbons/agentic-rss-parser.git"
|
|
29
|
+
},
|
|
30
|
+
"homepage": "https://github.com/bluecarbons/agentic-rss-parser#readme",
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/bluecarbons/agentic-rss-parser/issues"
|
|
33
|
+
},
|
|
34
|
+
"bin": {
|
|
35
|
+
"agentic-rss-parser": "./agentic-rss-parser",
|
|
36
|
+
"agentic-rss-mcp": "./agentic-rss-mcp"
|
|
37
|
+
},
|
|
38
|
+
"exports": {
|
|
39
|
+
".": {
|
|
40
|
+
"types": "./src/index.d.ts",
|
|
41
|
+
"default": "./src/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./cli": "./src/cli.js",
|
|
44
|
+
"./mcp": "./src/mcp/server.js"
|
|
45
|
+
},
|
|
46
|
+
"scripts": {
|
|
47
|
+
"start": "node ./src/cli.js",
|
|
48
|
+
"mcp": "node ./src/mcp/server.js",
|
|
49
|
+
"test": "node --test",
|
|
50
|
+
"lint": "node --check ./src/cli.js"
|
|
51
|
+
},
|
|
52
|
+
"packageManager": "pnpm@9.15.4",
|
|
53
|
+
"files": [
|
|
54
|
+
"agentic-rss-parser",
|
|
55
|
+
"agentic-rss-mcp",
|
|
56
|
+
"src",
|
|
57
|
+
"examples",
|
|
58
|
+
"README.md",
|
|
59
|
+
"SUPPORT.md",
|
|
60
|
+
"SECURITY.md",
|
|
61
|
+
"CODE_OF_CONDUCT.md",
|
|
62
|
+
"CHANGELOG.md",
|
|
63
|
+
"LICENSE",
|
|
64
|
+
"CONTRIBUTING.md"
|
|
65
|
+
],
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"@ai-sdk/anthropic": "3.0.85",
|
|
68
|
+
"@ai-sdk/openai": "3.0.73",
|
|
69
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
70
|
+
"ai": "6.0.208",
|
|
71
|
+
"fast-xml-parser": "5.9.3",
|
|
72
|
+
"zod": "4.4.3"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createAnalyzer } from './provider.js';
|