felo-ai 0.2.7 → 0.2.9
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/.github/workflows/publish-npm.yml +39 -0
- package/CHANGELOG.md +30 -30
- package/CONTRIBUTING.md +346 -346
- package/README.en.md +129 -129
- package/README.md +435 -414
- package/docs/EXAMPLES.md +632 -632
- package/docs/FAQ.md +479 -479
- package/felo-search/LICENSE +21 -21
- package/felo-search/README.md +440 -440
- package/felo-search/SKILL.md +291 -291
- package/felo-slides/LICENSE +21 -21
- package/felo-slides/README.md +87 -87
- package/felo-slides/SKILL.md +166 -166
- package/felo-slides/scripts/run_ppt_task.mjs +251 -251
- package/felo-superAgent/LICENSE +21 -0
- package/felo-superAgent/README.md +125 -0
- package/felo-superAgent/SKILL.md +165 -0
- package/felo-web-fetch/README.md +127 -78
- package/felo-web-fetch/SKILL.md +204 -200
- package/felo-web-fetch/scripts/run_web_fetch.mjs +316 -232
- package/felo-x-search/SKILL.md +204 -0
- package/felo-x-search/scripts/run_x_search.mjs +385 -0
- package/felo-youtube-subtitling/README.md +59 -59
- package/felo-youtube-subtitling/SKILL.md +161 -161
- package/felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs +239 -239
- package/package.json +37 -35
- package/src/cli.js +370 -252
- package/src/config.js +66 -66
- package/src/search.js +142 -142
- package/src/slides.js +332 -332
- package/src/superAgent.js +609 -0
- package/src/webFetch.js +148 -148
- package/src/xSearch.js +366 -0
- package/src/youtubeSubtitling.js +179 -179
- package/tests/config.test.js +78 -78
- package/tests/search.test.js +100 -100
package/felo-web-fetch/SKILL.md
CHANGED
|
@@ -1,200 +1,204 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: felo-web-fetch
|
|
3
|
-
description: "
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Felo Web Fetch Skill
|
|
7
|
-
|
|
8
|
-
## When to Use
|
|
9
|
-
|
|
10
|
-
Trigger this skill when
|
|
11
|
-
|
|
12
|
-
- Fetch or scrape content from a webpage URL
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
1.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
```powershell
|
|
48
|
-
$env:FELO_API_KEY="your-api-key-here"
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
## How to Execute
|
|
52
|
-
|
|
53
|
-
### Option A: Use the bundled script or packaged CLI
|
|
54
|
-
|
|
55
|
-
**Script** (from repo):
|
|
56
|
-
|
|
57
|
-
```bash
|
|
58
|
-
node felo-web-fetch/scripts/run_web_fetch.mjs --url "https://example.com/article" [options]
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
**Packaged CLI** (after `npm install -g felo-ai`): same options, with short forms allowed:
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
felo web-fetch -u "https://example.com" [options]
|
|
65
|
-
# Short forms: -u (url), -f (format), -t (timeout, seconds), -j (json)
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
-
|
|
86
|
-
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
|
138
|
-
|
|
139
|
-
|
|
|
140
|
-
|
|
|
141
|
-
|
|
|
142
|
-
|
|
|
143
|
-
|
|
|
144
|
-
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
-
|
|
187
|
-
-
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
## Important Notes
|
|
191
|
-
|
|
192
|
-
- Always
|
|
193
|
-
-
|
|
194
|
-
-
|
|
195
|
-
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
-
|
|
200
|
-
|
|
1
|
+
---
|
|
2
|
+
name: felo-web-fetch
|
|
3
|
+
description: "Extract webpage content with Felo Web Extract API. Use for turning URLs into html/markdown/text, selecting specific page areas with CSS selectors, and controlling extraction options like crawl mode, cookies, user-agent, and timeout."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Felo Web Fetch Skill
|
|
7
|
+
|
|
8
|
+
## When to Use
|
|
9
|
+
|
|
10
|
+
Trigger this skill when users want to extract or convert webpage content from a URL:
|
|
11
|
+
|
|
12
|
+
- Fetch or scrape content from a webpage URL
|
|
13
|
+
- Convert webpage content to `html`, `markdown`, or `text`
|
|
14
|
+
- Extract specific blocks using CSS selector
|
|
15
|
+
- Get article/main text from a link with readability mode
|
|
16
|
+
- Tune extraction behavior with crawl mode (`fast`/`fine`)
|
|
17
|
+
- Pass request details such as cookies, user-agent, timeout
|
|
18
|
+
|
|
19
|
+
Trigger keywords (examples):
|
|
20
|
+
|
|
21
|
+
- fetch webpage, scrape URL, fetch page content, web fetch, url to markdown
|
|
22
|
+
- Explicit: `/felo-web-fetch`, "use felo web fetch", "extract this URL with felo"
|
|
23
|
+
- Same intent in other languages (e.g. 网页抓取, 提取网页内容) also triggers this skill
|
|
24
|
+
|
|
25
|
+
Do NOT use this skill for:
|
|
26
|
+
|
|
27
|
+
- Real-time Q&A search summaries (use `felo-search`)
|
|
28
|
+
- Slide generation tasks (use `felo-slides`)
|
|
29
|
+
- Local file parsing in current workspace
|
|
30
|
+
|
|
31
|
+
## Setup
|
|
32
|
+
|
|
33
|
+
### 1. Get API key
|
|
34
|
+
|
|
35
|
+
1. Visit [felo.ai](https://felo.ai)
|
|
36
|
+
2. Open Settings -> API Keys
|
|
37
|
+
3. Create and copy your API key
|
|
38
|
+
|
|
39
|
+
### 2. Configure environment variable
|
|
40
|
+
|
|
41
|
+
Linux/macOS:
|
|
42
|
+
```bash
|
|
43
|
+
export FELO_API_KEY="your-api-key-here"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Windows PowerShell:
|
|
47
|
+
```powershell
|
|
48
|
+
$env:FELO_API_KEY="your-api-key-here"
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## How to Execute
|
|
52
|
+
|
|
53
|
+
### Option A: Use the bundled script or packaged CLI
|
|
54
|
+
|
|
55
|
+
**Script** (from repo):
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
node felo-web-fetch/scripts/run_web_fetch.mjs --url "https://example.com/article" [options]
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Packaged CLI** (after `npm install -g felo-ai`): same options, with short forms allowed:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
felo web-fetch -u "https://example.com" [options]
|
|
65
|
+
# Short forms: -u (url), -f (format), -t (timeout, seconds), -j (json)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Required parameter:
|
|
69
|
+
- `--url`
|
|
70
|
+
|
|
71
|
+
Core optional parameters:
|
|
72
|
+
- `--output-format html|markdown|text`
|
|
73
|
+
- `--crawl-mode fast|fine`
|
|
74
|
+
- `--target-selector "article.main-content"`
|
|
75
|
+
- `--wait-for-selector ".content-ready"`
|
|
76
|
+
|
|
77
|
+
Other key optional parameters:
|
|
78
|
+
- `--cookie "session_id=xxx"` (repeatable)
|
|
79
|
+
- `--set-cookies-json '[{"name":"sid","value":"xxx","domain":"example.com"}]'`
|
|
80
|
+
- `--user-agent "Mozilla/5.0 ..."`
|
|
81
|
+
- `--timeout 60` (HTTP request timeout in seconds)
|
|
82
|
+
- `--request-timeout-ms 15000` (API payload `timeout` in ms)
|
|
83
|
+
- `--with-readability true`
|
|
84
|
+
- `--with-links-summary true`
|
|
85
|
+
- `--with-images-summary true`
|
|
86
|
+
- `--with-images-readability true`
|
|
87
|
+
- `--with-images true`
|
|
88
|
+
- `--with-links true`
|
|
89
|
+
- `--ignore-empty-text-image true`
|
|
90
|
+
- `--with-cache false`
|
|
91
|
+
- `--with-stypes true`
|
|
92
|
+
- `--json` (print full JSON response)
|
|
93
|
+
|
|
94
|
+
### How to write instructions (target_selector + output_format)
|
|
95
|
+
|
|
96
|
+
When the user wants a **specific part** of the page or a **specific output format**, phrase the command like this:
|
|
97
|
+
|
|
98
|
+
- **Output format**: "Fetch as **text**" / "Get **markdown**" / "Return **html**" → use `--output-format text`, `--output-format markdown`, or `--output-format html`.
|
|
99
|
+
- **Target one element**: "Only the **main article**" / "Just the **content inside** `#main`" / "Fetch only **article.main-content**" → use `--target-selector "article.main"` or the selector they give.
|
|
100
|
+
|
|
101
|
+
Examples:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Basic: fetch as Markdown
|
|
105
|
+
node felo-web-fetch/scripts/run_web_fetch.mjs --url "https://example.com" --output-format markdown
|
|
106
|
+
|
|
107
|
+
# Article-style with readability
|
|
108
|
+
node felo-web-fetch/scripts/run_web_fetch.mjs --url "https://example.com/article" --with-readability true --output-format markdown
|
|
109
|
+
|
|
110
|
+
# Only the element matching a CSS selector
|
|
111
|
+
node felo-web-fetch/scripts/run_web_fetch.mjs --url "https://example.com" --target-selector "article.main" --output-format markdown
|
|
112
|
+
|
|
113
|
+
# With cookies and custom user-agent
|
|
114
|
+
node felo-web-fetch/scripts/run_web_fetch.mjs --url "https://example.com/private" --cookie "session_id=abc123" --with-readability true --json
|
|
115
|
+
|
|
116
|
+
# Full JSON response
|
|
117
|
+
node felo-web-fetch/scripts/run_web_fetch.mjs --url "https://example.com" --output-format text --json
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
### Option B: Call API with curl
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
curl -X POST "https://openapi.felo.ai/v2/web/extract" \
|
|
124
|
+
-H "Authorization: Bearer $FELO_API_KEY" \
|
|
125
|
+
-H "Content-Type: application/json" \
|
|
126
|
+
-d '{"url": "https://example.com", "output_format": "markdown", "with_readability": true}'
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
## API Reference (summary)
|
|
130
|
+
|
|
131
|
+
- **Endpoint**: `POST /v2/web/extract`
|
|
132
|
+
- **Base URL**: `https://openapi.felo.ai`. Override with `FELO_API_BASE` env if needed.
|
|
133
|
+
- **Auth**: `Authorization: Bearer YOUR_API_KEY`
|
|
134
|
+
|
|
135
|
+
### Request body (JSON)
|
|
136
|
+
|
|
137
|
+
| Parameter | Type | Required | Default | Description |
|
|
138
|
+
|-----------|------|----------|---------|-------------|
|
|
139
|
+
| url | string | Yes | - | Webpage URL to fetch |
|
|
140
|
+
| crawl_mode | string | No | fast | `fast` or `fine` |
|
|
141
|
+
| output_format | string | No | html | `html`, `text`, `markdown` |
|
|
142
|
+
| with_readability | boolean | No | - | Use readability (main content) |
|
|
143
|
+
| with_links_summary | boolean | No | - | Include links summary |
|
|
144
|
+
| with_images_summary | boolean | No | - | Include images summary |
|
|
145
|
+
| target_selector | string | No | - | CSS selector for target element |
|
|
146
|
+
| wait_for_selector | string | No | - | Wait for selector before fetch |
|
|
147
|
+
| timeout | integer | No | - | Timeout in milliseconds |
|
|
148
|
+
| with_cache | boolean | No | true | Use cache |
|
|
149
|
+
| set_cookies | array | No | - | Cookie entries |
|
|
150
|
+
| user_agent | string | No | - | Custom user-agent |
|
|
151
|
+
|
|
152
|
+
### Response
|
|
153
|
+
|
|
154
|
+
Success (200):
|
|
155
|
+
|
|
156
|
+
```json
|
|
157
|
+
{
|
|
158
|
+
"code": 0,
|
|
159
|
+
"message": "success",
|
|
160
|
+
"data": {
|
|
161
|
+
"content": { ... }
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
```
|
|
165
|
+
|
|
166
|
+
Fetched content is in `data.content`; structure depends on `output_format`.
|
|
167
|
+
|
|
168
|
+
### Error codes
|
|
169
|
+
|
|
170
|
+
| HTTP | Code | Description |
|
|
171
|
+
|------|------|-------------|
|
|
172
|
+
| 400 | - | Parameter validation failed |
|
|
173
|
+
| 401 | INVALID_API_KEY | API key invalid or revoked |
|
|
174
|
+
| 500/502 | WEB_EXTRACT_FAILED | Fetch failed (server or page error) |
|
|
175
|
+
|
|
176
|
+
## Output Format
|
|
177
|
+
|
|
178
|
+
- Default output is extracted content only (for direct use or piping).
|
|
179
|
+
- If response content is not a string, script prints JSON.
|
|
180
|
+
- Use `--json` when user needs metadata and full response object.
|
|
181
|
+
|
|
182
|
+
Error response format:
|
|
183
|
+
|
|
184
|
+
```markdown
|
|
185
|
+
## Web Fetch Failed
|
|
186
|
+
- Message: <error message>
|
|
187
|
+
- Suggested Action: verify URL/parameters and retry
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Important Notes
|
|
191
|
+
|
|
192
|
+
- Always require URL before running.
|
|
193
|
+
- Validate enum values:
|
|
194
|
+
- `output_format`: `html`, `markdown`, `text`
|
|
195
|
+
- `crawl_mode`: `fast`, `fine`
|
|
196
|
+
- Use `--target-selector` when users only want a specific part of the page.
|
|
197
|
+
- Use `--request-timeout-ms` for page rendering/extraction wait, and `--timeout` for local HTTP timeout.
|
|
198
|
+
- For long articles or slow sites, consider increasing `--timeout`.
|
|
199
|
+
- API may cache results; use `--with-cache false` only when fresh content is required.
|
|
200
|
+
|
|
201
|
+
## References
|
|
202
|
+
|
|
203
|
+
- [Web Extract API](https://openapi.felo.ai/docs/api-reference/v2/web-extract.html)
|
|
204
|
+
- [Felo Open Platform](https://openapi.felo.ai/docs/)
|