felo-ai 0.2.6 → 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.
Files changed (39) hide show
  1. package/.github/workflows/publish-npm.yml +39 -0
  2. package/CHANGELOG.md +30 -0
  3. package/CONTRIBUTING.md +346 -346
  4. package/README.en.md +129 -129
  5. package/README.md +435 -408
  6. package/docs/EXAMPLES.md +632 -632
  7. package/docs/FAQ.md +479 -479
  8. package/felo-search/LICENSE +21 -21
  9. package/felo-search/README.md +440 -440
  10. package/felo-search/SKILL.md +291 -291
  11. package/felo-slides/LICENSE +21 -21
  12. package/felo-slides/README.md +87 -87
  13. package/felo-slides/SKILL.md +166 -166
  14. package/felo-slides/scripts/run_ppt_task.mjs +251 -251
  15. package/felo-superAgent/LICENSE +21 -0
  16. package/felo-superAgent/README.md +125 -0
  17. package/felo-superAgent/SKILL.md +165 -0
  18. package/felo-web-fetch/README.md +127 -0
  19. package/felo-web-fetch/SKILL.md +204 -0
  20. package/felo-web-fetch/scripts/run_web_fetch.mjs +316 -0
  21. package/felo-x-search/SKILL.md +204 -0
  22. package/felo-x-search/scripts/run_x_search.mjs +385 -0
  23. package/felo-youtube-subtitling/README.md +59 -59
  24. package/felo-youtube-subtitling/SKILL.md +161 -161
  25. package/felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs +239 -239
  26. package/package.json +37 -35
  27. package/src/cli.js +370 -252
  28. package/src/config.js +66 -66
  29. package/src/search.js +142 -142
  30. package/src/slides.js +332 -332
  31. package/src/superAgent.js +609 -0
  32. package/src/{webExtract.js → webFetch.js} +148 -148
  33. package/src/xSearch.js +366 -0
  34. package/src/youtubeSubtitling.js +179 -179
  35. package/tests/config.test.js +78 -78
  36. package/tests/search.test.js +100 -100
  37. package/felo-web-extract/README.md +0 -78
  38. package/felo-web-extract/SKILL.md +0 -200
  39. package/felo-web-extract/scripts/run_web_extract.mjs +0 -232
@@ -1,161 +1,161 @@
1
- ---
2
- name: felo-youtube-subtitling
3
- description: "Fetch YouTube video subtitles/captions using Felo YouTube Subtitling API. Use when users ask to get YouTube subtitles, extract captions from a video, fetch transcript by video ID or URL, or when explicit commands like /felo-youtube-subtitling are used. Supports language and optional timestamps."
4
- ---
5
-
6
- # Felo YouTube Subtitling Skill
7
-
8
- ## When to Use
9
-
10
- Trigger this skill when the user wants to:
11
-
12
- - Get subtitles or captions from a YouTube video
13
- - Extract transcript by video ID or video URL
14
- - Fetch subtitles in a specific language (e.g. en, zh-CN)
15
- - Get subtitles with timestamps for analysis or translation
16
-
17
- Trigger keywords (examples):
18
-
19
- - YouTube subtitles, get captions, video transcript, extract subtitles, YouTube 字幕
20
- - Explicit: `/felo-youtube-subtitling`, "use felo youtube subtitling"
21
-
22
- Do NOT use for:
23
-
24
- - Real-time search (use `felo-search`)
25
- - Web page content (use `felo-web-extract`)
26
- - Generating slides (use `felo-slides`)
27
-
28
- ## Setup
29
-
30
- ### 1. Get API key
31
-
32
- 1. Visit [felo.ai](https://felo.ai)
33
- 2. Open Settings -> API Keys
34
- 3. Create and copy your API key
35
-
36
- ### 2. Configure environment variable
37
-
38
- Linux/macOS:
39
-
40
- ```bash
41
- export FELO_API_KEY="your-api-key-here"
42
- ```
43
-
44
- Windows PowerShell:
45
-
46
- ```powershell
47
- $env:FELO_API_KEY="your-api-key-here"
48
- ```
49
-
50
- ## How to Execute
51
-
52
- ### Option A: Use the bundled script or packaged CLI
53
-
54
- **Script** (from repo):
55
-
56
- ```bash
57
- node felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs --video-code "dQw4w9WgXcQ" [options]
58
- ```
59
-
60
- **Packaged CLI** (after `npm install -g felo-ai`):
61
-
62
- ```bash
63
- felo youtube-subtitling -v "dQw4w9WgXcQ" [options]
64
- # Short forms: -v (video-code), -l (language), -j (json)
65
- ```
66
-
67
- Options:
68
-
69
- | Option | Default | Description |
70
- |--------|---------|-------------|
71
- | `--video-code` / `-v` | (required) | YouTube **video URL** or **video ID** (e.g. `https://youtube.com/watch?v=ID` or `dQw4w9WgXcQ`) |
72
- | `--language` / `-l` | - | Subtitle language code (e.g. `en`, `zh-CN`) |
73
- | `--with-time` | false | Include start/duration timestamps in each segment |
74
- | `--json` / `-j` | false | Print full API response as JSON |
75
-
76
- You can pass either a **full YouTube link** or the **11-character video ID**:
77
-
78
- - Supported URLs: `https://www.youtube.com/watch?v=ID`, `https://youtu.be/ID`, `https://youtube.com/embed/ID`
79
- - Or plain ID: `dQw4w9WgXcQ`
80
-
81
- Examples:
82
-
83
- ```bash
84
- # With video URL
85
- node felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs --video-code "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
86
- felo youtube-subtitling -v "https://youtu.be/dQw4w9WgXcQ"
87
-
88
- # With video ID
89
- node felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs -v "dQw4w9WgXcQ" --language zh-CN
90
-
91
- # With timestamps
92
- node felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs -v "dQw4w9WgXcQ" --with-time --json
93
- ```
94
-
95
- ### Option B: Call API with curl
96
-
97
- ```bash
98
- curl -X GET "https://openapi.felo.ai/v2/youtube/subtitling?video_code=dQw4w9WgXcQ" \
99
- -H "Authorization: Bearer $FELO_API_KEY"
100
- ```
101
-
102
- ## API Reference (summary)
103
-
104
- - **Endpoint**: `GET /v2/youtube/subtitling`
105
- - **Base URL**: `https://openapi.felo.ai`. Override with `FELO_API_BASE` env if needed.
106
- - **Auth**: `Authorization: Bearer YOUR_API_KEY`
107
-
108
- ### Query parameters
109
-
110
- | Parameter | Type | Required | Default | Description |
111
- |-----------|------|----------|---------|-------------|
112
- | video_code | string | Yes | - | YouTube video ID (e.g. dQw4w9WgXcQ) |
113
- | language | string | No | - | Language code (e.g. en, zh-CN) |
114
- | with_time | boolean | No | false | Include start/duration per segment |
115
-
116
- ### Response (200)
117
-
118
- ```json
119
- {
120
- "code": 0,
121
- "message": "success",
122
- "data": {
123
- "title": "Video title",
124
- "contents": [
125
- { "start": 0.32, "duration": 14.26, "text": "Subtitle text" }
126
- ]
127
- }
128
- }
129
- ```
130
-
131
- With `with_time=false`, `start`/`duration` may be absent or zero. `contents[].text` is always present.
132
-
133
- ### Error codes
134
-
135
- | HTTP | Code | Description |
136
- |------|------|-------------|
137
- | 400 | - | Parameter validation failed (e.g. missing video_code) |
138
- | 401 | INVALID_API_KEY | API key invalid or revoked |
139
- | 500/502 | YOUTUBE_SUBTITLING_FAILED | Service error or subtitles unavailable for video |
140
-
141
- ## Output Format
142
-
143
- - Without `--json`: print title and then each segment's text (one per line or concatenated). If `--with-time`, output includes timestamps.
144
- - With `--json`: print full API response.
145
-
146
- On failure (no subtitles, API error): stderr message and exit 1. Example:
147
-
148
- ```
149
- YouTube subtitling failed for video dQw4w9WgXcQ: YOUTUBE_SUBTITLING_FAILED
150
- ```
151
-
152
- ## Important Notes
153
-
154
- - Not all videos have subtitles; the API may return an error for some videos.
155
- - Language code must match a subtitle track available for the video.
156
- - Same `FELO_API_KEY` as other Felo skills.
157
-
158
- ## References
159
-
160
- - [Felo YouTube Subtitling API](https://openapi.felo.ai/docs/api-reference/v2/youtube-subtitling.html)
161
- - [Felo Open Platform](https://openapi.felo.ai/docs/)
1
+ ---
2
+ name: felo-youtube-subtitling
3
+ description: "Fetch YouTube video subtitles/captions using Felo YouTube Subtitling API. Use when users ask to get YouTube subtitles, extract captions from a video, fetch transcript by video ID or URL, or when explicit commands like /felo-youtube-subtitling are used. Supports language and optional timestamps."
4
+ ---
5
+
6
+ # Felo YouTube Subtitling Skill
7
+
8
+ ## When to Use
9
+
10
+ Trigger this skill when the user wants to:
11
+
12
+ - Get subtitles or captions from a YouTube video
13
+ - Extract transcript by video ID or video URL
14
+ - Fetch subtitles in a specific language (e.g. en, zh-CN)
15
+ - Get subtitles with timestamps for analysis or translation
16
+
17
+ Trigger keywords (examples):
18
+
19
+ - YouTube subtitles, get captions, video transcript, extract subtitles, YouTube 字幕
20
+ - Explicit: `/felo-youtube-subtitling`, "use felo youtube subtitling"
21
+
22
+ Do NOT use for:
23
+
24
+ - Real-time search (use `felo-search`)
25
+ - Web page content (use `felo-web-fetch`)
26
+ - Generating slides (use `felo-slides`)
27
+
28
+ ## Setup
29
+
30
+ ### 1. Get API key
31
+
32
+ 1. Visit [felo.ai](https://felo.ai)
33
+ 2. Open Settings -> API Keys
34
+ 3. Create and copy your API key
35
+
36
+ ### 2. Configure environment variable
37
+
38
+ Linux/macOS:
39
+
40
+ ```bash
41
+ export FELO_API_KEY="your-api-key-here"
42
+ ```
43
+
44
+ Windows PowerShell:
45
+
46
+ ```powershell
47
+ $env:FELO_API_KEY="your-api-key-here"
48
+ ```
49
+
50
+ ## How to Execute
51
+
52
+ ### Option A: Use the bundled script or packaged CLI
53
+
54
+ **Script** (from repo):
55
+
56
+ ```bash
57
+ node felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs --video-code "dQw4w9WgXcQ" [options]
58
+ ```
59
+
60
+ **Packaged CLI** (after `npm install -g felo-ai`):
61
+
62
+ ```bash
63
+ felo youtube-subtitling -v "dQw4w9WgXcQ" [options]
64
+ # Short forms: -v (video-code), -l (language), -j (json)
65
+ ```
66
+
67
+ Options:
68
+
69
+ | Option | Default | Description |
70
+ |--------|---------|-------------|
71
+ | `--video-code` / `-v` | (required) | YouTube **video URL** or **video ID** (e.g. `https://youtube.com/watch?v=ID` or `dQw4w9WgXcQ`) |
72
+ | `--language` / `-l` | - | Subtitle language code (e.g. `en`, `zh-CN`) |
73
+ | `--with-time` | false | Include start/duration timestamps in each segment |
74
+ | `--json` / `-j` | false | Print full API response as JSON |
75
+
76
+ You can pass either a **full YouTube link** or the **11-character video ID**:
77
+
78
+ - Supported URLs: `https://www.youtube.com/watch?v=ID`, `https://youtu.be/ID`, `https://youtube.com/embed/ID`
79
+ - Or plain ID: `dQw4w9WgXcQ`
80
+
81
+ Examples:
82
+
83
+ ```bash
84
+ # With video URL
85
+ node felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs --video-code "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
86
+ felo youtube-subtitling -v "https://youtu.be/dQw4w9WgXcQ"
87
+
88
+ # With video ID
89
+ node felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs -v "dQw4w9WgXcQ" --language zh-CN
90
+
91
+ # With timestamps
92
+ node felo-youtube-subtitling/scripts/run_youtube_subtitling.mjs -v "dQw4w9WgXcQ" --with-time --json
93
+ ```
94
+
95
+ ### Option B: Call API with curl
96
+
97
+ ```bash
98
+ curl -X GET "https://openapi.felo.ai/v2/youtube/subtitling?video_code=dQw4w9WgXcQ" \
99
+ -H "Authorization: Bearer $FELO_API_KEY"
100
+ ```
101
+
102
+ ## API Reference (summary)
103
+
104
+ - **Endpoint**: `GET /v2/youtube/subtitling`
105
+ - **Base URL**: `https://openapi.felo.ai`. Override with `FELO_API_BASE` env if needed.
106
+ - **Auth**: `Authorization: Bearer YOUR_API_KEY`
107
+
108
+ ### Query parameters
109
+
110
+ | Parameter | Type | Required | Default | Description |
111
+ |-----------|------|----------|---------|-------------|
112
+ | video_code | string | Yes | - | YouTube video ID (e.g. dQw4w9WgXcQ) |
113
+ | language | string | No | - | Language code (e.g. en, zh-CN) |
114
+ | with_time | boolean | No | false | Include start/duration per segment |
115
+
116
+ ### Response (200)
117
+
118
+ ```json
119
+ {
120
+ "code": 0,
121
+ "message": "success",
122
+ "data": {
123
+ "title": "Video title",
124
+ "contents": [
125
+ { "start": 0.32, "duration": 14.26, "text": "Subtitle text" }
126
+ ]
127
+ }
128
+ }
129
+ ```
130
+
131
+ With `with_time=false`, `start`/`duration` may be absent or zero. `contents[].text` is always present.
132
+
133
+ ### Error codes
134
+
135
+ | HTTP | Code | Description |
136
+ |------|------|-------------|
137
+ | 400 | - | Parameter validation failed (e.g. missing video_code) |
138
+ | 401 | INVALID_API_KEY | API key invalid or revoked |
139
+ | 500/502 | YOUTUBE_SUBTITLING_FAILED | Service error or subtitles unavailable for video |
140
+
141
+ ## Output Format
142
+
143
+ - Without `--json`: print title and then each segment's text (one per line or concatenated). If `--with-time`, output includes timestamps.
144
+ - With `--json`: print full API response.
145
+
146
+ On failure (no subtitles, API error): stderr message and exit 1. Example:
147
+
148
+ ```
149
+ YouTube subtitling failed for video dQw4w9WgXcQ: YOUTUBE_SUBTITLING_FAILED
150
+ ```
151
+
152
+ ## Important Notes
153
+
154
+ - Not all videos have subtitles; the API may return an error for some videos.
155
+ - Language code must match a subtitle track available for the video.
156
+ - Same `FELO_API_KEY` as other Felo skills.
157
+
158
+ ## References
159
+
160
+ - [Felo YouTube Subtitling API](https://openapi.felo.ai/docs/api-reference/v2/youtube-subtitling.html)
161
+ - [Felo Open Platform](https://openapi.felo.ai/docs/)