felo-ai 0.2.46 → 0.2.48

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.
@@ -1,25 +1,28 @@
1
1
  # Felo SuperAgent Skill for Claude Code
2
2
 
3
- **AI conversation with real-time streaming output, supporting continuous conversation.**
3
+ **AI conversation with real-time streaming output, supporting continuous multi-turn conversation.**
4
4
 
5
- Use the Felo Open Platform SuperAgent API in Claude Code to initiate conversations with SuperAgent, receive real-time SSE streaming responses, and query conversation details.
5
+ Use the Felo Open Platform SuperAgent API in Claude Code to initiate conversations with SuperAgent, receive real-time SSE streaming responses, and manage conversation state across turns.
6
6
 
7
7
  ---
8
8
 
9
9
  ## Features
10
10
 
11
- - **Streaming conversation**: Create a conversation and receive AI responses in real-time via SSE
12
- - **LiveDoc association**: Each conversation corresponds to a LiveDoc for subsequent resource viewing
13
- - **Continuous conversation**: Continue asking questions in an existing conversation using `--thread-id`
14
- - **LiveDoc management**: List LiveDocs and view resources within a specific LiveDoc
15
- - **Multi-language**: Supports `accept_language` (e.g., zh, en, ja, ko)
16
- - **Tool invocation**: Supports image generation, research reports, documents, PPT, HTML, Twitter search, and more
11
+ - **Streaming conversation** create a conversation and receive AI responses in real-time via SSE
12
+ - **LiveDoc association** each conversation is linked to a LiveDoc for resource tracking
13
+ - **Continuous conversation** continue asking questions in an existing thread using `--thread-id`
14
+ - **Brand style support** pass a writing style via `--ext` to guide output (used by `felo-twitter-writer` and other skills)
15
+ - **Style library** fetch saved brand styles from the API with `run_style_library.mjs`
16
+ - **LiveDoc management** list LiveDocs and view resources within a specific LiveDoc
17
+ - **Multi-language** — supports `--accept-language` (e.g., zh, en, ja, ko)
18
+ - **Tool invocation** — image generation, research reports, documents, PPT, HTML, Twitter/X search, and more
17
19
 
18
20
  **Use cases:**
19
21
 
20
22
  - Need SuperAgent streaming answers
21
23
  - Need conversation associated with LiveDoc for traceable resources
22
24
  - Multi-turn/continuous conversation (reuse the same LiveDoc)
25
+ - Tweet writing, logo design, or e-commerce product images with brand style guidance
23
26
 
24
27
  **Not suitable for:**
25
28
 
@@ -34,13 +37,13 @@ Use the Felo Open Platform SuperAgent API in Claude Code to initiate conversatio
34
37
 
35
38
  ### 1. Installation
36
39
 
37
- **One-click install (recommended):**
40
+ **Via ClawHub:**
38
41
 
39
42
  ```bash
40
- npx skills add Felo-Inc/felo-skills --skill felo-superAgent
43
+ clawhub install felo-superAgent
41
44
  ```
42
45
 
43
- **Manual install:** If the above command is unavailable, copy from this repository to Claude Code's skills directory:
46
+ **Manual install:**
44
47
 
45
48
  ```bash
46
49
  # Linux/macOS
@@ -50,14 +53,10 @@ cp -r felo-superAgent ~/.claude/skills/
50
53
  Copy-Item -Recurse felo-superAgent "$env:USERPROFILE\.claude\skills\"
51
54
  ```
52
55
 
53
- (If using a local skill, ensure Cursor/Claude Code has configured the skill path.)
54
-
55
56
  ### 2. Configure API Key
56
57
 
57
- Same as other Felo skills, use the same API Key:
58
-
59
58
  1. Open [felo.ai](https://felo.ai) and log in
60
- 2. Avatar → **Settings** → **API Keys** → Create and copy Key
59
+ 2. Avatar → **Settings** → **API Keys** → Create and copy key
61
60
  3. Set environment variable:
62
61
 
63
62
  ```bash
@@ -68,375 +67,317 @@ export FELO_API_KEY="your-api-key-here"
68
67
  $env:FELO_API_KEY="your-api-key-here"
69
68
  ```
70
69
 
71
- For permanent configuration, add to your shell profile (~/.bashrc, ~/.zshrc) or system environment variables.
70
+ For permanent configuration, add to your shell profile (`~/.bashrc`, `~/.zshrc`) or system environment variables.
72
71
 
73
72
  ### 3. Usage
74
73
 
75
- **Trigger in conversation:**
74
+ **Trigger in Claude Code conversation:**
76
75
 
77
- - Explicit commands: `/felo-superagent`, "use felo super agent"
78
- - Describe intent: SuperAgent conversation, streaming conversation, LiveDoc conversation, continuous conversation
76
+ ```
77
+ /felo-superagent What is the latest news about AI?
78
+ /felo-superagent Tell me more
79
+ ```
79
80
 
80
- **Run script directly from command line:**
81
+ **Run script directly:**
81
82
 
82
83
  ```bash
83
- node felo-superAgent/scripts/run_superagent.mjs --query "What is the latest news about AI?"
84
+ node felo-superAgent/scripts/run_superagent.mjs --query "What is quantum computing?"
85
+ node felo-superAgent/scripts/run_superagent.mjs --query "Tell me more" --thread-id <thread_short_id>
84
86
  ```
85
87
 
86
- Output is the complete answer text after streaming aggregation. Add `--json` to get JSON including `thread_short_id` and `live_doc_short_id`.
87
-
88
- **CLI commands (after installation):**
88
+ **CLI commands (after `npm install -g felo-ai`):**
89
89
 
90
90
  ```bash
91
- # SuperAgent conversation
92
91
  felo superagent "What is the latest news about AI?"
93
-
94
- # Continue conversation
95
92
  felo superagent "Tell me more" --thread-id <thread_short_id>
96
-
97
- # List LiveDocs
98
93
  felo livedocs
99
- felo livedocs --page 2 --size 10
100
- felo livedocs --keyword AI
101
-
102
- # View resources in a specific LiveDoc
103
94
  felo livedoc-resources <livedoc-id>
95
+ felo style-library TWITTER --accept-language en
104
96
  ```
105
97
 
106
98
  ---
107
99
 
108
- ## Script Parameters
109
-
110
- ### superagent
111
-
112
- | Parameter | Description |
113
- | --------------------------------- | ----------------------------------------------------------------- |
114
- | `--query <text>` | User question (required, 1-2000 characters) |
115
- | `--thread-id <id>` | Existing thread ID for follow-up conversations |
116
- | `--live-doc-id <id>` | Reuse existing LiveDoc short_id (continuous conversation) |
117
- | `--skill-id <id>` | Skill ID (new conversations only) |
118
- | `--selected-resource-ids <ids>` | Comma-separated resource IDs (new conversations only) |
119
- | `--ext <json>` | Extra parameters as JSON, e.g., `'{"style_id":"xxx"}'` (new conversations only) |
120
- | `--accept-language <lang>` | Language preference, e.g., zh, en, ja, ko |
121
- | `--timeout <seconds>` | Request/stream timeout, default 60 |
122
- | `--json` | Output JSON (includes answer, thread_short_id, live_doc_short_id) |
123
- | `--verbose` | Log stream connection details to stderr |
124
-
125
- ### livedocs
126
-
127
- | Parameter | Description |
128
- | -------------------------- | ------------------------------- |
129
- | `-p, --page <number>` | Page number, default 1 |
130
- | `-s, --size <number>` | Items per page, default 20 |
131
- | `-k, --keyword <text>` | Keyword filter |
132
- | `-j, --json` | Output raw JSON |
133
- | `-t, --timeout <seconds>` | Request timeout, default 60 |
134
-
135
- ### livedoc-resources
136
-
137
- | Parameter | Description |
138
- | -------------------------- | ------------------------------- |
139
- | `<livedoc-id>` | LiveDoc short_id (required) |
140
- | `-j, --json` | Output raw JSON |
141
- | `-t, --timeout <seconds>` | Request timeout, default 60 |
100
+ ## Scripts
142
101
 
143
- ---
102
+ This skill provides two scripts:
144
103
 
145
- ## Output Format
104
+ | Script | Description |
105
+ |---|---|
106
+ | `run_superagent.mjs` | Create/continue a conversation and stream the answer |
107
+ | `run_style_library.mjs` | Fetch brand styles from the style library API |
146
108
 
147
- **Default (plain text):**
148
- Script stdout is the complete answer content (concatenated from SSE `message` events).
109
+ ### run_superagent.mjs parameters
149
110
 
150
- **`--json`:**
151
- Single-line JSON object, for example:
111
+ | Parameter | Description |
112
+ |---|---|
113
+ | `--query <text>` | User question (required, 1–2000 characters) |
114
+ | `--thread-id <id>` | Existing thread ID for follow-up conversations |
115
+ | `--live-doc-id <id>` | Reuse existing LiveDoc short_id |
116
+ | `--skill-id <id>` | Skill ID for new conversations (`twitter-writer`, `logo-and-branding`, `ecommerce-product-image`) |
117
+ | `--selected-resource-ids <ids>` | Comma-separated resource IDs (new conversations only) |
118
+ | `--ext <json>` | Extra parameters as JSON (new conversations only). Used for brand style — see below. |
119
+ | `--accept-language <lang>` | Language preference: `en`, `zh`, `ja`, `ko`, etc. |
120
+ | `--timeout <seconds>` | Request/stream timeout, default 60 |
121
+ | `--json` | Output JSON with `answer`, `thread_short_id`, `live_doc_short_id` |
122
+ | `--verbose` | Log stream connection details to stderr |
152
123
 
153
- ```json
154
- {
155
- "status": "ok",
156
- "data": {
157
- "answer": "Complete answer content...",
158
- "thread_short_id": "TvyKouzJirXjFdst4uKRK3",
159
- "live_doc_short_id": "PvyKouzJirXjFdst4uKRK3",
160
- "live_doc_url": "https://felo.ai/zh-Hans/livedoc/...",
161
- "image_urls": [{"url": "...", "title": "..."}],
162
- "discoveries": [{"title": "Research Report"}],
163
- "documents": [{"title": "Generated Document"}],
164
- "ppts": [{"title": "Presentation"}],
165
- "htmls": [{"title": "HTML Page"}],
166
- "search_x": [{"tweets": [...]}]
167
- }
168
- }
169
- ```
124
+ ### run_style_library.mjs parameters
170
125
 
171
- Use `thread_short_id` to call the "query conversation details" API, and `live_doc_short_id` can be passed to `felo-livedoc` to query related resources.
126
+ | Parameter | Description |
127
+ |---|---|
128
+ | `--category <category>` | Style category (required): `TWITTER`, `INSTAGRAM`, `LEMON8`, `NOTECOM`, `WEBSITE`, `IMAGE` |
129
+ | `--accept-language <lang>` | Language for labels/tags (e.g. `en`, `zh-Hans`, `ja`). Default: `en` |
130
+ | `--json` | Output raw JSON |
131
+ | `--timeout <seconds>` | Request timeout, default 60 |
172
132
 
173
133
  ---
174
134
 
175
- ## Complete Examples
135
+ ## Brand Style (`--ext`)
176
136
 
177
- ### Example 1: Simple question
137
+ When starting a new conversation with a skill ID, you can pass a brand style via `--ext` to guide the output. The style is fetched from the style library and serialized as a JSON string.
138
+
139
+ ### Fetch styles
178
140
 
179
141
  ```bash
180
- node felo-superAgent/scripts/run_superagent.mjs \
181
- --query "What is quantum computing?" \
182
- --accept-language en \
183
- --timeout 90
142
+ node felo-superAgent/scripts/run_style_library.mjs --category TWITTER --accept-language en
184
143
  ```
185
144
 
186
- **Output:**
145
+ Output (one block per style, blank line between):
146
+
187
147
  ```
188
- SuperAgent: creating conversation...
189
- Quantum computing is a revolutionary approach to computation that leverages...
190
- [complete streaming answer]
148
+ Style name: darioamodei
149
+ Style labels: Thoughtful long-form essays
150
+ Style DNA: # Dario Amodei (@DarioAmodei) Tweet Writing Style DNA
151
+ ...(full content)
152
+
153
+ Style name: My Bold Voice
154
+ Style labels: bold, provocative
155
+ Style DNA: # My Bold Voice Style DNA
156
+ ...(full content)
157
+ Cover file ID: file_abc123
191
158
  ```
192
159
 
193
- ### Example 2: Continue conversation on existing LiveDoc
160
+ Fields per entry:
194
161
 
195
- ```bash
196
- # First conversation
197
- node felo-superAgent/scripts/run_superagent.mjs \
198
- --query "Explain artificial intelligence" \
199
- --json
162
+ | Field | Source | Notes |
163
+ |---|---|---|
164
+ | `Style name` | `name` | Always present |
165
+ | `Style labels` | `content.labels[lang]` or `content.tags[lang]` | Language-aware, comma-separated; omitted if absent |
166
+ | `Style DNA` | `content.styleDna` | Full text (TWITTER type); omitted if absent |
167
+ | `Cover file ID` | `coverFileId` | Omitted if null |
200
168
 
201
- # Returns: {"data": {"live_doc_short_id": "PvyKouzJirXjFdst4uKRK3", ...}}
169
+ User-created styles appear before recommended styles.
202
170
 
203
- # Continue on same LiveDoc
204
- node felo-superAgent/scripts/run_superagent.mjs \
205
- --query "What are the main applications?" \
206
- --live-doc-id "PvyKouzJirXjFdst4uKRK3"
207
- ```
171
+ ### Pass style to SuperAgent
208
172
 
209
- ### Example 3: Follow-up question in thread
173
+ Take the full text block for the chosen style and serialize it into `brand_style_requirement`. Pass the value **completely — do NOT truncate `Style DNA`**:
210
174
 
211
175
  ```bash
212
- # First question
213
- node felo-superAgent/scripts/run_superagent.mjs \
214
- --query "What is machine learning?" \
215
- --json
216
-
217
- # Returns: {"data": {"thread_short_id": "TvyKouzJirXjFdst4uKRK3", ...}}
218
-
219
- # Follow-up question
220
176
  node felo-superAgent/scripts/run_superagent.mjs \
221
- --query "Can you elaborate on neural networks?" \
222
- --thread-id "TvyKouzJirXjFdst4uKRK3"
177
+ --query "Write a tweet about AI trends" \
178
+ --live-doc-id "LIVE_DOC_ID" \
179
+ --skill-id twitter-writer \
180
+ --ext '{"brand_style_requirement":"Style name: darioamodei\nStyle labels: Thoughtful long-form essays\nStyle DNA: # Dario Amodei (@DarioAmodei) Tweet Writing Style DNA\n\n## 风格速写\nDario writes like a serious intellectual...(full content)"}' \
181
+ --accept-language en
223
182
  ```
224
183
 
225
- ### Example 4: With verbose logging
184
+ Category mapping for skill IDs:
226
185
 
227
- ```bash
228
- node felo-superAgent/scripts/run_superagent.mjs \
229
- --query "Latest developments in AI" \
230
- --accept-language en \
231
- --verbose \
232
- --json
233
- ```
186
+ | Skill ID | Style category |
187
+ |---|---|
188
+ | `twitter-writer` | `TWITTER` |
189
+ | `logo-and-branding` | `IMAGE` |
190
+ | `ecommerce-product-image` | `IMAGE` |
234
191
 
235
- **Stderr output:**
236
- ```
237
- SuperAgent: creating conversation...
238
- Stream key: abc123...
239
- Thread ID: TvyKouzJirXjFdst4uKRK3
240
- LiveDoc ID: PvyKouzJirXjFdst4uKRK3
241
- [stream] event=message
242
- [stream] data={"content":"Recent AI developments..."}
243
- ```
192
+ `--ext` is only valid for new conversations. Never pass it in follow-up mode (`--thread-id`).
244
193
 
245
194
  ---
246
195
 
247
- ## Tool Support
196
+ ## Using with Claude Code
248
197
 
249
- SuperAgent may invoke tools during conversation. The script automatically extracts and displays:
198
+ ### Installation
250
199
 
251
- ### Image Generation
252
- - Tool: `generate_images`
253
- - Output: Image URLs and titles
254
- - Example: `[AI Generated Image](https://felo.ai/zh-Hans/livedoc/...)`
255
-
256
- ### Research & Discovery
257
- - Tool: `generate_discovery`
258
- - Output: Research report titles
259
- - Example: `[AI Research Report](https://felo.ai/zh-Hans/livedoc/...)`
260
-
261
- ### Document Generation
262
- - Tool: `generate_document`
263
- - Output: Document titles
264
- - Example: `[Generated Document](https://felo.ai/zh-Hans/livedoc/...)`
265
-
266
- ### Presentation Generation
267
- - Tool: `generate_ppt`
268
- - Output: PPT titles
269
- - Example: `[AI Presentation](https://felo.ai/zh-Hans/livedoc/...)`
270
-
271
- ### HTML Generation
272
- - Tool: `generate_html`
273
- - Output: HTML page titles
274
- - Example: `[HTML Page](https://felo.ai/zh-Hans/livedoc/...)`
275
-
276
- ### Twitter/X Search
277
- - Tool: `search_x`
278
- - Output: Tweet content, author info, metrics (likes, retweets, views)
279
- - Example:
280
- ```
281
- [Twitter Search Results] (5 tweets)
282
- Elon Musk (@elonmusk) [1.2K likes | 234 retweets | 45K views]
283
- AI is the future of humanity...
284
- https://twitter.com/...
285
- ```
200
+ ```bash
201
+ # Via ClawHub
202
+ clawhub install felo-superAgent
286
203
 
287
- ---
204
+ # Manual
205
+ cp -r felo-superAgent ~/.claude/skills/
206
+ ```
288
207
 
289
- ## Error Handling
208
+ ### Triggering the skill
290
209
 
291
- Common error codes (see [SuperAgent API documentation](https://openapi.felo.ai/docs/api-reference/v2/superagent.html)):
210
+ Claude Code automatically triggers this skill for SuperAgent conversations. Explicit commands:
292
211
 
293
- - `INVALID_API_KEY` (401): Key is invalid or revoked
294
- - `SUPER_AGENT_CONVERSATION_CREATE_FAILED` (502): Failed to create conversation
295
- - Other 502 errors: Downstream service issues, retry or contact support
212
+ ```
213
+ /felo-superagent What is the latest news about AI?
214
+ /felo-superagent Write a tweet about AI trends
215
+ /felo-superagent Create a logo for my coffee shop
216
+ ```
296
217
 
297
- If `FELO_API_KEY` is not configured, the script will error and show configuration instructions.
218
+ ### What Claude manages automatically
298
219
 
299
- ---
220
+ - **LiveDoc reuse** — reuses the same LiveDoc across the session; only fetches the list when no ID is available
221
+ - **Thread continuity** — passes `--thread-id` for all follow-up messages; only starts a new thread when the user explicitly requests it or a different skill ID is needed
222
+ - **Style selection** — for skill-based new conversations (`twitter-writer`, `logo-and-branding`, `ecommerce-product-image`), fetches the matching style library, presents options to the user, and passes the chosen style via `--ext`
223
+ - **State extraction** — after every call, extracts `thread_short_id` and `live_doc_short_id` from the stderr `[state]` line for use in the next call
300
224
 
301
- ## API Workflow
225
+ ### Example conversation
302
226
 
303
- The script handles this workflow automatically:
227
+ ```
228
+ You: Write a tweet about AI trends
304
229
 
305
- 1. **Create conversation:**
306
- - New: `POST /v2/conversations`
307
- - Follow-up: `POST /v2/conversations/{threadId}/follow_up`
308
- - Returns: `stream_key`, `thread_short_id`, `live_doc_short_id`
230
+ Claude: Here are the available Twitter writing styles — choosing one will make
231
+ the output more accurate:
309
232
 
310
- 2. **Consume SSE stream:**
311
- - `GET /v2/conversations/stream/{stream_key}`
312
- - Supports offset parameter for resuming: `?offset={lastOffset}`
313
- - Reconnects automatically if connection drops (2-second delay)
233
+ [Your styles]
234
+ 1. My Bold Voice
314
235
 
315
- 3. **Parse events:**
316
- - `message` — Direct text content
317
- - `stream` — Wrapped content with type information
318
- - `heartbeat` — Keep-alive signal
319
- - `done` / `completed` / `complete` — Stream finished
320
- - `error` — Error event (non-terminal, continues reading)
236
+ [Recommended styles]
237
+ 2. darioamodei
321
238
 
322
- 4. **Extract tool results:**
323
- - Automatically detects and formats tool outputs
324
- - Deduplicates results to avoid showing the same resource multiple times
239
+ 0. No preference — use default style
325
240
 
326
- Base URL: `https://openapi.felo.ai` (override with `FELO_API_BASE` if needed).
241
+ You: 2
327
242
 
328
- ---
243
+ Claude: [streams the tweet in darioamodei style in real time]
329
244
 
330
- ## Conversation Continuity
245
+ You: Make it shorter
331
246
 
332
- **Three modes of conversation:**
247
+ Claude: [follow-up no style re-selection, streams updated tweet]
248
+ ```
333
249
 
334
- 1. **New conversation:** No IDs provided — creates fresh thread and LiveDoc
335
- 2. **LiveDoc continuation:** Provide `--live-doc-id` — new thread, same knowledge base
336
- 3. **Thread follow-up:** Provide `--thread-id` — continue exact conversation
250
+ ---
337
251
 
338
- **When to use each mode:**
339
- - Use **new conversation** for unrelated questions
340
- - Use **LiveDoc continuation** to build knowledge on a topic across multiple threads
341
- - Use **thread follow-up** for clarifying questions or continuing the exact same discussion
252
+ ## Output Format
342
253
 
343
- ---
254
+ **Default (streaming plain text):**
255
+ Answer streams directly to stdout in real time. Do not summarize or re-output it.
344
256
 
345
- ## Troubleshooting
257
+ **`--json` (suppresses streaming):**
346
258
 
347
- ### API Key Not Set
259
+ ```json
260
+ {
261
+ "status": "ok",
262
+ "data": {
263
+ "answer": "Complete answer content...",
264
+ "thread_short_id": "TvyKouzJirXjFdst4uKRK3",
265
+ "live_doc_short_id": "PvyKouzJirXjFdst4uKRK3",
266
+ "live_doc_url": "https://felo.ai/livedoc/...",
267
+ "image_urls": [{"url": "...", "title": "..."}],
268
+ "discoveries": [{"title": "Research Report"}],
269
+ "documents": [{"title": "Generated Document"}],
270
+ "ppts": [{"title": "Presentation"}],
271
+ "htmls": [{"title": "HTML Page"}],
272
+ "search_x": [{"tweets": [...]}]
273
+ }
274
+ }
275
+ ```
276
+
277
+ **State line (stderr):**
348
278
 
349
- **Error:**
350
279
  ```
351
- ERROR: FELO_API_KEY not set
280
+ [state] thread_short_id=TvyKouzJirXjFdst4uKRK3 live_doc_short_id=PvyKouzJirXjFdst4uKRK3 live_doc_url=https://felo.ai/livedoc/...
352
281
  ```
353
282
 
354
- **Solution:**
355
- 1. Get your API key from https://felo.ai (Settings → API Keys)
356
- 2. Set the environment variable:
357
- ```bash
358
- export FELO_API_KEY="your-api-key-here"
359
- ```
360
- 3. Restart your terminal or reload the environment
283
+ Always extract `thread_short_id` and `live_doc_short_id` from this line for use in the next call.
361
284
 
362
- ### Invalid API Key
285
+ ---
363
286
 
364
- **Error:**
365
- ```
366
- HTTP 401: INVALID_API_KEY
287
+ ## Complete Examples
288
+
289
+ ### Example 1: Simple question
290
+
291
+ ```bash
292
+ node felo-superAgent/scripts/run_superagent.mjs \
293
+ --query "What is quantum computing?" \
294
+ --accept-language en
367
295
  ```
368
296
 
369
- **Solution:**
370
- - Check if your API key is correct
371
- - Verify the key hasn't been revoked at https://felo.ai
372
- - Generate a new key if needed
297
+ ### Example 2: Follow-up in thread
373
298
 
374
- ### Stream Timeout
299
+ ```bash
300
+ # First question — capture thread_short_id from stderr [state]
301
+ node felo-superAgent/scripts/run_superagent.mjs \
302
+ --query "What is machine learning?" \
303
+ --live-doc-id "PvyKouzJirXjFdst4uKRK3"
375
304
 
376
- **Error:**
377
- ```
378
- Stream idle timeout (no data for 7200s)
305
+ # Follow-up
306
+ node felo-superAgent/scripts/run_superagent.mjs \
307
+ --query "Can you elaborate on neural networks?" \
308
+ --thread-id "TvyKouzJirXjFdst4uKRK3" \
309
+ --live-doc-id "PvyKouzJirXjFdst4uKRK3"
379
310
  ```
380
311
 
381
- **Solution:**
382
- - The stream was idle for 2 hours with no data
383
- - This is normal for very long-running conversations
384
- - Retry the query or increase timeout with `--timeout 120`
385
-
386
- ### Connection Issues
312
+ ### Example 3: Tweet writing with brand style
387
313
 
388
- **Behavior:** Script shows "SuperAgent: creating conversation..." but hangs
314
+ ```bash
315
+ # Fetch styles
316
+ node felo-superAgent/scripts/run_style_library.mjs --category TWITTER --accept-language en
389
317
 
390
- **Solution:**
391
- - Check your internet connection
392
- - Verify `https://openapi.felo.ai` is accessible
393
- - Try with `--verbose` to see detailed connection logs
394
- - Check if a firewall is blocking SSE connections
318
+ # New conversation with chosen style
319
+ node felo-superAgent/scripts/run_superagent.mjs \
320
+ --query "Write a tweet about AI trends" \
321
+ --live-doc-id "PvyKouzJirXjFdst4uKRK3" \
322
+ --skill-id twitter-writer \
323
+ --ext '{"brand_style_requirement":"Style name: darioamodei\nStyle labels: Thoughtful long-form essays\nStyle DNA: ...(full content)"}' \
324
+ --accept-language en
325
+ ```
395
326
 
396
- ### Tool Results Not Showing
327
+ ### Example 4: Logo design with brand style
397
328
 
398
- **Behavior:** Answer appears but tool results (images, documents) are missing
329
+ ```bash
330
+ # Fetch IMAGE styles
331
+ node felo-superAgent/scripts/run_style_library.mjs --category IMAGE --accept-language en
399
332
 
400
- **Solution:**
401
- - Tool results appear inline during streaming
402
- - Use `--json` to see all tool results in structured format
403
- - Check if LiveDoc URL is accessible
333
+ # New conversation with chosen style
334
+ node felo-superAgent/scripts/run_superagent.mjs \
335
+ --query "Design a logo for my coffee shop called Bean & Brew" \
336
+ --live-doc-id "PvyKouzJirXjFdst4uKRK3" \
337
+ --skill-id logo-and-branding \
338
+ --ext '{"brand_style_requirement":"Style name: Minimalist Modern\nStyle labels: clean, monochrome\nStyle DNA: ...(full content)\nCover file ID: file_333"}' \
339
+ --accept-language en
340
+ ```
404
341
 
405
342
  ---
406
343
 
407
- ## Advanced Usage
344
+ ## Tool Support
408
345
 
409
- ### Custom API Base URL
346
+ SuperAgent may invoke tools during conversation. The script automatically extracts and displays:
410
347
 
411
- Override the API base URL:
348
+ | Tool | Output |
349
+ |---|---|
350
+ | `generate_images` | Image URLs and titles |
351
+ | `generate_discovery` | Research report titles |
352
+ | `generate_document` | Document titles |
353
+ | `generate_ppt` | PPT titles |
354
+ | `generate_html` | HTML page titles |
355
+ | `search_x` | Tweet content, author info, metrics |
412
356
 
413
- ```bash
414
- export FELO_API_BASE="https://custom-api.example.com"
415
- node felo-superAgent/scripts/run_superagent.mjs --query "test"
416
- ```
357
+ ---
417
358
 
418
- ### Custom Web Base URL
359
+ ## Error Handling
419
360
 
420
- Override the web base URL for LiveDoc links:
361
+ | Error | Cause | Solution |
362
+ |---|---|---|
363
+ | `FELO_API_KEY not set` | Missing API key | Set `FELO_API_KEY` env var |
364
+ | `HTTP 401: INVALID_API_KEY` | Invalid or revoked key | Generate a new key at felo.ai |
365
+ | `SUPER_AGENT_CONVERSATION_CREATE_FAILED` (502) | Upstream error | Retry; contact support if persistent |
366
+ | Stream idle timeout | No data for 2 hours | Retry the query |
367
+ | Connection hangs | Firewall blocking SSE | Try `--verbose`; check proxy settings |
421
368
 
422
- ```bash
423
- export FELO_WEB_BASE="https://custom-web.example.com"
424
- node felo-superAgent/scripts/run_superagent.mjs --query "test"
425
- ```
369
+ ---
426
370
 
427
- ### Extended Parameters
371
+ ## Advanced Usage
428
372
 
429
- Pass custom parameters to the API:
373
+ ### Custom API base URL
430
374
 
431
375
  ```bash
432
- node felo-superAgent/scripts/run_superagent.mjs \
433
- --query "Generate a report" \
434
- --ext '{"style_id":"professional","format":"detailed"}'
376
+ export FELO_API_BASE="https://custom-api.example.com"
377
+ node felo-superAgent/scripts/run_superagent.mjs --query "test"
435
378
  ```
436
379
 
437
- ### Resource Selection
438
-
439
- Select specific resources for the conversation:
380
+ ### Resource selection
440
381
 
441
382
  ```bash
442
383
  node felo-superAgent/scripts/run_superagent.mjs \
@@ -449,7 +390,9 @@ node felo-superAgent/scripts/run_superagent.mjs \
449
390
 
450
391
  ## References
451
392
 
393
+ - [SKILL.md](SKILL.md) — full agent instructions, decision logic, and style library format
452
394
  - [SuperAgent API Documentation](https://openapi.felo.ai/docs/api-reference/v2/superagent.html)
453
395
  - [Felo Open Platform](https://openapi.felo.ai/docs/)
454
396
  - [Get API Key](https://felo.ai) (Settings → API Keys)
455
397
  - [GitHub Repository](https://github.com/Felo-Inc/felo-skills)
398
+