felo-ai 0.2.19 → 0.2.23
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/felo-superAgent/SKILL.md
CHANGED
|
@@ -9,26 +9,36 @@ description: "Felo SuperAgent API: AI conversation with real-time SSE streaming
|
|
|
9
9
|
|
|
10
10
|
These rules are mandatory. Violating any of them will produce incorrect behavior.
|
|
11
11
|
|
|
12
|
-
1.
|
|
12
|
+
1. **NEVER use `--json` flag.** The script MUST run in default (streaming) mode so that SuperAgent's answer is printed directly to stdout in real time. The `--json` flag suppresses all streaming output and is forbidden. State IDs are extracted from the `[state]` line in stderr instead.
|
|
13
13
|
|
|
14
|
-
2. **
|
|
14
|
+
2. **NEVER summarize, rewrite, or re-output the script's stdout.** The script already streams the full answer and tool results directly to the user. After the script finishes, do NOT repeat, paraphrase, or summarize the answer. Only output supplementary information (LiveDoc URL, session state notes) if needed.
|
|
15
15
|
|
|
16
|
-
3.
|
|
16
|
+
3. **`--live-doc-id` is REQUIRED when creating a conversation.** Never call `run_superagent.mjs` without `--live-doc-id`. If you do not have one yet, obtain it first (see Step 2 below).
|
|
17
17
|
|
|
18
|
-
4. **
|
|
18
|
+
4. **Reuse `live_doc_id` from ANY source.** If you already have a `live_doc_id` from any previous operation in this session — whether from a prior SuperAgent call, a `felo-livedoc` skill operation, user-provided input, or any other skill — use it directly. Do NOT request the LiveDoc list again. Only fetch the list when no `live_doc_id` is available from any source. (Note: `live_doc_id` corresponds to the API field `live_doc_short_id` and the `[state]` output key `live_doc_short_id`.)
|
|
19
19
|
|
|
20
|
-
5. **
|
|
20
|
+
5. **One LiveDoc per session.** All conversations within a session MUST use the same `--live-doc-id`. Do NOT create a new LiveDoc unless the user explicitly asks to "open a new canvas" / "start a new LiveDoc" / "create a new workspace".
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
| Create a logo or brand design | `logo-and-branding` |
|
|
26
|
-
| Generate e-commerce / product images | `ecommerce-product-image` |
|
|
27
|
-
| All other conversations | Do NOT pass `--skill-id` |
|
|
22
|
+
6. **Default behavior is follow-up, not new conversation.** After the first question, every subsequent user message is a follow-up. You MUST pass `--thread-id` from the previous response. Only omit `--thread-id` (to start a new thread on the same LiveDoc) when:
|
|
23
|
+
- The user explicitly says "new topic" / "change subject" / "start over"
|
|
24
|
+
- The user's intent requires a specific `--skill-id` (e.g., tweet writing, logo design, product image) and the current thread was not created with that skill — because `--skill-id` only takes effect in new conversations
|
|
28
25
|
|
|
29
|
-
|
|
26
|
+
7. **Always persist state.** After every call, extract `thread_short_id` and `live_doc_id` from the stderr `[state]` line (where `live_doc_id` is output as `live_doc_short_id`). Use them in the next call. Losing these IDs breaks conversation continuity.
|
|
30
27
|
|
|
31
|
-
|
|
28
|
+
8. **Skill ID selection (New Conversations Only).** When creating a new conversation (no `--thread-id`), analyze the user's intent and determine if it matches one of the supported skill IDs:
|
|
29
|
+
|
|
30
|
+
**Available skill IDs:**
|
|
31
|
+
- `twitter-writer` — For composing, drafting, or posting tweets/X posts
|
|
32
|
+
- `logo-and-branding` — For creating logos, brand designs, or visual identity
|
|
33
|
+
- `ecommerce-product-image` — For generating product images for e-commerce use
|
|
34
|
+
|
|
35
|
+
**Selection logic:**
|
|
36
|
+
- If the user explicitly requests a specific skill-id, use their specified value
|
|
37
|
+
- If the user's intent clearly matches one of the above, pass `--skill-id` with that value
|
|
38
|
+
- If none of the above match, do NOT pass `--skill-id` (general conversation mode)
|
|
39
|
+
- `--skill-id` is only effective when creating a new conversation. It is ignored in follow-up mode (`--thread-id`).
|
|
40
|
+
|
|
41
|
+
9. **Never create a new LiveDoc casually.** Reuse the existing one. The only exception is an explicit user request for a new canvas/workspace.
|
|
32
42
|
|
|
33
43
|
## When to Use
|
|
34
44
|
|
|
@@ -109,20 +119,20 @@ fi
|
|
|
109
119
|
|
|
110
120
|
If not set, stop and show the user the setup instructions above.
|
|
111
121
|
|
|
112
|
-
### Step 2: Obtain `
|
|
122
|
+
### Step 2: Obtain `live_doc_id`
|
|
113
123
|
|
|
114
|
-
This step ensures you always have a valid `--live-doc-id` before creating any conversation.
|
|
124
|
+
This step ensures you always have a valid `--live-doc-id` before creating any conversation. (Note: `live_doc_id` corresponds to the API field `live_doc_short_id`.)
|
|
115
125
|
|
|
116
|
-
**2a. If you already have a `
|
|
117
|
-
Skip to Step 3. Reuse the same ID.
|
|
126
|
+
**2a. If you already have a `live_doc_id` from ANY source in this session:**
|
|
127
|
+
Skip to Step 3. Reuse the same ID. Sources include: a previous SuperAgent call's `[state]` output (the `live_doc_short_id` field), a `felo-livedoc` skill operation (create, list, etc.), user-provided input, or any other skill that returned a LiveDoc ID.
|
|
118
128
|
|
|
119
|
-
**2b. If
|
|
129
|
+
**2b. If no `live_doc_id` is available from any source — fetch the LiveDoc list:**
|
|
120
130
|
|
|
121
131
|
```bash
|
|
122
132
|
node felo-livedoc/scripts/run_livedoc.mjs list --json
|
|
123
133
|
```
|
|
124
134
|
|
|
125
|
-
Parse the JSON output. The response contains `data.items` — an array of LiveDoc objects sorted by modification time. Pick the first item's `short_id` as your `
|
|
135
|
+
Parse the JSON output. The response contains `data.items` — an array of LiveDoc objects sorted by modification time. Pick the first item's `short_id` as your `live_doc_id`.
|
|
126
136
|
|
|
127
137
|
Example response:
|
|
128
138
|
```json
|
|
@@ -138,7 +148,7 @@ Example response:
|
|
|
138
148
|
}
|
|
139
149
|
```
|
|
140
150
|
|
|
141
|
-
Use: `
|
|
151
|
+
Use: `live_doc_id = items[0].short_id`
|
|
142
152
|
|
|
143
153
|
**2c. If the list is empty (no LiveDocs exist) — create one:**
|
|
144
154
|
|
|
@@ -146,7 +156,7 @@ Use: `live_doc_short_id = items[0].short_id`
|
|
|
146
156
|
node felo-livedoc/scripts/run_livedoc.mjs create --name "SuperAgent Workspace" --json
|
|
147
157
|
```
|
|
148
158
|
|
|
149
|
-
Parse the JSON output and extract `data.short_id` as your `
|
|
159
|
+
Parse the JSON output and extract `data.short_id` as your `live_doc_id`.
|
|
150
160
|
|
|
151
161
|
Example response:
|
|
152
162
|
```json
|
|
@@ -162,7 +172,7 @@ Example response:
|
|
|
162
172
|
|
|
163
173
|
**2d. If the user explicitly requests a new canvas/workspace:**
|
|
164
174
|
|
|
165
|
-
Create a new LiveDoc (same as 2c), then use the new ID for all subsequent calls. Discard the old `
|
|
175
|
+
Create a new LiveDoc (same as 2c), then use the new ID for all subsequent calls. Discard the old `live_doc_id`.
|
|
166
176
|
|
|
167
177
|
### Step 3: Determine Conversation Mode
|
|
168
178
|
|
|
@@ -173,44 +183,65 @@ Decide whether this is a **new conversation** or a **follow-up**:
|
|
|
173
183
|
| First question in session (no `thread_short_id` yet) | New conversation | `--live-doc-id` only |
|
|
174
184
|
| User asks a follow-up / continues the topic (DEFAULT) | Follow-up | `--thread-id` AND `--live-doc-id` |
|
|
175
185
|
| User explicitly says "new topic" / "change subject" | New conversation | `--live-doc-id` only (same LiveDoc) |
|
|
186
|
+
| User's intent requires a `--skill-id` not matching current thread | New conversation | `--live-doc-id` + `--skill-id` (same LiveDoc) |
|
|
176
187
|
| User explicitly says "new canvas" / "new LiveDoc" | New conversation | New `--live-doc-id` from Step 2d |
|
|
177
188
|
|
|
178
189
|
**IMPORTANT:** The default for any user message after the first one is ALWAYS follow-up. Only treat it as a new conversation if the user explicitly requests it.
|
|
179
190
|
|
|
180
|
-
### Step 4:
|
|
191
|
+
### Step 4: Determine Skill ID (New Conversations Only)
|
|
192
|
+
|
|
193
|
+
If this is a new conversation (no `--thread-id`), analyze the user's intent:
|
|
181
194
|
|
|
182
|
-
|
|
195
|
+
**Available skill IDs:**
|
|
196
|
+
- `twitter-writer` — For composing, drafting, or posting tweets/X posts
|
|
197
|
+
- `logo-and-branding` — For creating logos, brand designs, or visual identity
|
|
198
|
+
- `ecommerce-product-image` — For generating product images for e-commerce use
|
|
183
199
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
200
|
+
**How to decide:**
|
|
201
|
+
1. If the user explicitly specifies a skill-id, use that value
|
|
202
|
+
2. Otherwise, analyze the user's request and determine if it matches one of the above
|
|
203
|
+
3. If none match, do NOT pass `--skill-id`
|
|
188
204
|
|
|
189
205
|
If this is a follow-up (`--thread-id` is set), skip this step entirely. `--skill-id` is ignored in follow-up mode.
|
|
190
206
|
|
|
191
207
|
### Step 5: Run the Script
|
|
192
208
|
|
|
193
|
-
Construct and execute the command.
|
|
209
|
+
Construct and execute the command. **NEVER use `--json`** — the script must run in default streaming mode so the answer is printed directly to the user in real time.
|
|
210
|
+
|
|
211
|
+
**IMPORTANT:** The SSE stream may take a long time (especially for image generation, research reports, etc.). You MUST set the Bash tool timeout to at least 600000ms (10 minutes) when executing the script to prevent premature termination.
|
|
212
|
+
|
|
213
|
+
**`--accept-language` selection:** Default is `en`. Match the user's language — if the user writes in Chinese use `zh`, Japanese use `ja`, Korean use `ko`, etc.
|
|
214
|
+
|
|
215
|
+
**`--query` construction:** Do NOT simply pass the user's raw input as-is. You should enrich and refine the query to make it more complete and effective for SuperAgent:
|
|
216
|
+
|
|
217
|
+
- **Add context:** If the conversation has prior context (e.g., the user previously discussed a topic), incorporate relevant details so SuperAgent understands the full picture.
|
|
218
|
+
- **Clarify vague requests:** If the user says something brief like "continue" or "go on", expand it to describe what should be continued (e.g., "Please continue the previous analysis and provide more details").
|
|
219
|
+
- **Supplement missing details:** If the user's request implies information they mentioned earlier (e.g., brand name, product type, style preference), include those details in the query.
|
|
220
|
+
- **Preserve user intent:** Never change the user's core intent. Only add context and clarity — do not inject opinions or redirect the topic.
|
|
221
|
+
- **Keep it concise:** The query has a 2000-character limit. Enrich the content but stay focused and avoid unnecessary padding.
|
|
222
|
+
|
|
223
|
+
Examples:
|
|
224
|
+
- User says "继续" → `--query "请继续上面关于量子计算的分析,进一步展开实际应用场景"`
|
|
225
|
+
- User says "再来一张" → `--query "请再生成一张类似风格的无线耳机产品图,白色背景"`
|
|
226
|
+
- User says "帮我改改" → `--query "请修改上面生成的推文,语气更轻松一些,加一些emoji"`
|
|
194
227
|
|
|
195
228
|
**New conversation (first question):**
|
|
196
229
|
```bash
|
|
197
230
|
node felo-superAgent/scripts/run_superagent.mjs \
|
|
198
231
|
--query "USER_QUERY_HERE" \
|
|
199
|
-
--live-doc-id "
|
|
232
|
+
--live-doc-id "LIVE_DOC_ID" \
|
|
200
233
|
--accept-language en \
|
|
201
|
-
--timeout
|
|
202
|
-
--json
|
|
234
|
+
--timeout 3600
|
|
203
235
|
```
|
|
204
236
|
|
|
205
237
|
**New conversation with skill ID (e.g., tweet writing):**
|
|
206
238
|
```bash
|
|
207
239
|
node felo-superAgent/scripts/run_superagent.mjs \
|
|
208
240
|
--query "Write a tweet about the latest AI trends" \
|
|
209
|
-
--live-doc-id "
|
|
241
|
+
--live-doc-id "LIVE_DOC_ID" \
|
|
210
242
|
--skill-id twitter-writer \
|
|
211
243
|
--accept-language en \
|
|
212
|
-
--timeout
|
|
213
|
-
--json
|
|
244
|
+
--timeout 3600
|
|
214
245
|
```
|
|
215
246
|
|
|
216
247
|
**Follow-up question (DEFAULT for 2nd+ messages):**
|
|
@@ -218,57 +249,24 @@ node felo-superAgent/scripts/run_superagent.mjs \
|
|
|
218
249
|
node felo-superAgent/scripts/run_superagent.mjs \
|
|
219
250
|
--query "USER_FOLLOW_UP_QUERY" \
|
|
220
251
|
--thread-id "THREAD_SHORT_ID_FROM_PREVIOUS" \
|
|
221
|
-
--live-doc-id "
|
|
222
|
-
--timeout
|
|
223
|
-
--json
|
|
252
|
+
--live-doc-id "LIVE_DOC_ID" \
|
|
253
|
+
--timeout 3600
|
|
224
254
|
```
|
|
225
255
|
|
|
226
|
-
### Step 6:
|
|
256
|
+
### Step 6: Extract State from stderr (Do NOT Re-output the Answer)
|
|
227
257
|
|
|
228
|
-
|
|
258
|
+
The script has already streamed the full answer and tool results directly to stdout. **Do NOT repeat, summarize, or rewrite any of that content.**
|
|
229
259
|
|
|
230
|
-
|
|
231
|
-
2. **Present** the answer to the user.
|
|
260
|
+
After the script finishes, look for the `[state]` line in stderr output:
|
|
232
261
|
|
|
233
|
-
JSON response structure:
|
|
234
|
-
```json
|
|
235
|
-
{
|
|
236
|
-
"status": "ok",
|
|
237
|
-
"data": {
|
|
238
|
-
"answer": "complete answer text",
|
|
239
|
-
"thread_short_id": "CmYpuGwBgCnrUdDx5ZtmxA",
|
|
240
|
-
"live_doc_short_id": "QPetunwpGnkKuZHStP7gwt",
|
|
241
|
-
"live_doc_url": "https://felo.ai/livedoc/QPetunwpGnkKuZHStP7gwt",
|
|
242
|
-
"image_urls": [{"url": "...", "title": "..."}],
|
|
243
|
-
"discoveries": [{"title": "Research Report"}],
|
|
244
|
-
"documents": [{"title": "Generated Document"}],
|
|
245
|
-
"ppts": [{"title": "Presentation"}],
|
|
246
|
-
"htmls": [{"title": "HTML Page"}],
|
|
247
|
-
"search_x": [{"tweets": [...]}]
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
262
|
```
|
|
251
|
-
|
|
252
|
-
Present to the user:
|
|
253
|
-
|
|
254
|
-
```markdown
|
|
255
|
-
## SuperAgent Answer
|
|
256
|
-
|
|
257
|
-
[Full answer text from the "answer" field]
|
|
258
|
-
|
|
259
|
-
## Generated Resources (if any)
|
|
260
|
-
|
|
261
|
-
- Images: [list image titles and URLs]
|
|
262
|
-
- Documents: [list document titles]
|
|
263
|
-
- Presentations: [list PPT titles]
|
|
264
|
-
- Twitter Results: [summarize tweets]
|
|
265
|
-
|
|
266
|
-
## Session Info
|
|
267
|
-
|
|
268
|
-
- LiveDoc: [live_doc_url]
|
|
263
|
+
[state] thread_short_id=CmYpuGwBgCnrUdDx5ZtmxA live_doc_short_id=QPetunwpGnkKuZHStP7gwt live_doc_url=https://felo.ai/livedoc/QPetunwpGnkKuZHStP7gwt
|
|
269
264
|
```
|
|
270
265
|
|
|
271
|
-
|
|
266
|
+
1. **Extract and save** `thread_short_id` and `live_doc_id` (from the `live_doc_short_id` field in the `[state]` line) — you MUST use these in the next call.
|
|
267
|
+
2. **Optionally show** the `live_doc_url` link to the user so they can view the LiveDoc canvas in a browser.
|
|
268
|
+
|
|
269
|
+
Do NOT show `thread_short_id` or `live_doc_id` to the user unless they ask for it. These are internal state for the skill to manage.
|
|
272
270
|
|
|
273
271
|
## Complete Workflow Examples
|
|
274
272
|
|
|
@@ -278,7 +276,7 @@ Do NOT show `thread_short_id` or `live_doc_short_id` to the user unless they ask
|
|
|
278
276
|
User: "What is quantum computing?"
|
|
279
277
|
```
|
|
280
278
|
|
|
281
|
-
**Step 2b:** Fetch LiveDoc list → get `
|
|
279
|
+
**Step 2b:** Fetch LiveDoc list → get `live_doc_id = "QPetunwpGnkKuZHStP7gwt"`
|
|
282
280
|
**Step 3:** First question → New conversation
|
|
283
281
|
**Step 4:** No special skill → no `--skill-id`
|
|
284
282
|
**Step 5:**
|
|
@@ -286,15 +284,15 @@ User: "What is quantum computing?"
|
|
|
286
284
|
node felo-superAgent/scripts/run_superagent.mjs \
|
|
287
285
|
--query "What is quantum computing?" \
|
|
288
286
|
--live-doc-id "QPetunwpGnkKuZHStP7gwt" \
|
|
289
|
-
--accept-language en --timeout
|
|
287
|
+
--accept-language en --timeout 3600
|
|
290
288
|
```
|
|
291
|
-
**Step 6:**
|
|
289
|
+
**Step 6:** The answer is already streamed to the user. Extract from stderr `[state]` line: `thread_short_id = "CmYpuGwBgCnrUdDx5ZtmxA"`, `live_doc_id = "QPetunwpGnkKuZHStP7gwt"`. Do NOT repeat the answer.
|
|
292
290
|
|
|
293
291
|
```
|
|
294
292
|
User: "What are its practical applications?"
|
|
295
293
|
```
|
|
296
294
|
|
|
297
|
-
**Step 2a:** Already have `
|
|
295
|
+
**Step 2a:** Already have `live_doc_id` → skip
|
|
298
296
|
**Step 3:** Follow-up (default) → use saved `thread_short_id`
|
|
299
297
|
**Step 5:**
|
|
300
298
|
```bash
|
|
@@ -302,9 +300,9 @@ node felo-superAgent/scripts/run_superagent.mjs \
|
|
|
302
300
|
--query "What are its practical applications?" \
|
|
303
301
|
--thread-id "CmYpuGwBgCnrUdDx5ZtmxA" \
|
|
304
302
|
--live-doc-id "QPetunwpGnkKuZHStP7gwt" \
|
|
305
|
-
--timeout
|
|
303
|
+
--timeout 3600
|
|
306
304
|
```
|
|
307
|
-
**Step 6:**
|
|
305
|
+
**Step 6:** Answer already streamed. Extract updated `thread_short_id` from stderr `[state]` line (may be the same), keep `live_doc_id`.
|
|
308
306
|
|
|
309
307
|
```
|
|
310
308
|
User: "Tell me more about quantum error correction"
|
|
@@ -319,18 +317,18 @@ User: "Tell me more about quantum error correction"
|
|
|
319
317
|
User: "Help me write a tweet about AI trends"
|
|
320
318
|
```
|
|
321
319
|
|
|
322
|
-
**Step 2a:** Already have `
|
|
323
|
-
**Step 3:** New conversation
|
|
324
|
-
**Step 4:**
|
|
320
|
+
**Step 2a:** Already have `live_doc_id` → reuse
|
|
321
|
+
**Step 3:** New conversation — `--skill-id twitter-writer` is required, which only takes effect in new conversations
|
|
322
|
+
**Step 4:** User intent matches "write a tweet" → `--skill-id twitter-writer`
|
|
325
323
|
**Step 5:**
|
|
326
324
|
```bash
|
|
327
325
|
node felo-superAgent/scripts/run_superagent.mjs \
|
|
328
326
|
--query "Help me write a tweet about AI trends" \
|
|
329
327
|
--live-doc-id "QPetunwpGnkKuZHStP7gwt" \
|
|
330
328
|
--skill-id twitter-writer \
|
|
331
|
-
--accept-language en --timeout
|
|
329
|
+
--accept-language en --timeout 3600
|
|
332
330
|
```
|
|
333
|
-
**Step 6:**
|
|
331
|
+
**Step 6:** Answer already streamed. Extract new `thread_short_id` from stderr `[state]` line, keep same `live_doc_id`.
|
|
334
332
|
|
|
335
333
|
```
|
|
336
334
|
User: "Make it more casual and add some emojis"
|
|
@@ -343,7 +341,7 @@ node felo-superAgent/scripts/run_superagent.mjs \
|
|
|
343
341
|
--query "Make it more casual and add some emojis" \
|
|
344
342
|
--thread-id "NEW_THREAD_FROM_TWEET" \
|
|
345
343
|
--live-doc-id "QPetunwpGnkKuZHStP7gwt" \
|
|
346
|
-
--timeout
|
|
344
|
+
--timeout 3600
|
|
347
345
|
```
|
|
348
346
|
|
|
349
347
|
### Example C: Logo Design
|
|
@@ -359,7 +357,7 @@ node felo-superAgent/scripts/run_superagent.mjs \
|
|
|
359
357
|
--query "Design a logo for my coffee shop called Bean & Brew" \
|
|
360
358
|
--live-doc-id "QPetunwpGnkKuZHStP7gwt" \
|
|
361
359
|
--skill-id logo-and-branding \
|
|
362
|
-
--accept-language en --timeout
|
|
360
|
+
--accept-language en --timeout 3600
|
|
363
361
|
```
|
|
364
362
|
|
|
365
363
|
### Example D: E-commerce Product Image
|
|
@@ -375,7 +373,7 @@ node felo-superAgent/scripts/run_superagent.mjs \
|
|
|
375
373
|
--query "Generate a product image for a wireless headphone on white background" \
|
|
376
374
|
--live-doc-id "QPetunwpGnkKuZHStP7gwt" \
|
|
377
375
|
--skill-id ecommerce-product-image \
|
|
378
|
-
--accept-language en --timeout
|
|
376
|
+
--accept-language en --timeout 3600
|
|
379
377
|
```
|
|
380
378
|
|
|
381
379
|
### Example E: User Requests a New Canvas
|
|
@@ -388,25 +386,25 @@ User: "Open a new canvas for a different project"
|
|
|
388
386
|
```bash
|
|
389
387
|
node felo-livedoc/scripts/run_livedoc.mjs create --name "New Project" --json
|
|
390
388
|
```
|
|
391
|
-
Extract new `
|
|
389
|
+
Extract new `live_doc_id`. Discard the old one. All subsequent calls use the new ID.
|
|
392
390
|
|
|
393
391
|
## Available Script Options
|
|
394
392
|
|
|
395
393
|
**Core parameters:**
|
|
396
394
|
- `--query <text>` (REQUIRED) — User question, 1-2000 characters
|
|
397
|
-
- `--live-doc-id <id>` (REQUIRED for new conversations) — LiveDoc
|
|
395
|
+
- `--live-doc-id <id>` (REQUIRED for new conversations) — LiveDoc ID (`live_doc_id`) to associate with
|
|
398
396
|
- `--thread-id <id>` — Thread ID from previous response, for follow-up conversations
|
|
399
|
-
- `--timeout <seconds>` — Request/stream timeout, default
|
|
397
|
+
- `--timeout <seconds>` — Request/stream timeout, default 3600 seconds
|
|
400
398
|
|
|
401
399
|
**Skill parameters (new conversations only, ignored in follow-up):**
|
|
402
|
-
- `--skill-id <id>` — Skill ID (see
|
|
400
|
+
- `--skill-id <id>` — Skill ID (see Constraint #8 for available skill IDs)
|
|
403
401
|
- `--selected-resource-ids <ids>` — Comma-separated resource IDs to include
|
|
404
402
|
- `--ext <json>` — Extra parameters as JSON object
|
|
405
403
|
|
|
406
404
|
**Output control:**
|
|
407
|
-
- `--json` / `-j` — Output JSON format with full metadata (
|
|
408
|
-
- `--verbose` / `-v` — Log stream connection details to stderr
|
|
409
|
-
- `--accept-language <lang>` — Language preference (e.g.,
|
|
405
|
+
- `--json` / `-j` — Output JSON format with full metadata (DO NOT use in this skill — it suppresses streaming output)
|
|
406
|
+
- `--verbose` / `-v` — Log stream connection details to stderr (for debugging only, not needed for normal use)
|
|
407
|
+
- `--accept-language <lang>` — Language preference (e.g., en, ja, ko)
|
|
410
408
|
|
|
411
409
|
## API Workflow (Reference)
|
|
412
410
|
|
|
@@ -507,19 +505,21 @@ To use this skill, you need to set up your Felo API Key:
|
|
|
507
505
|
|
|
508
506
|
### Timeout Handling
|
|
509
507
|
|
|
510
|
-
- Default timeout:
|
|
508
|
+
- Default timeout: 3600 seconds (recommended for all SuperAgent calls due to SSE streaming)
|
|
511
509
|
- Idle timeout: 2 hours (no data received)
|
|
512
|
-
-
|
|
510
|
+
- **Bash tool timeout:** MUST be set to at least 600000ms (10 minutes) when executing the script
|
|
513
511
|
|
|
514
512
|
## Important Notes
|
|
515
513
|
|
|
516
514
|
- Execute this skill immediately using the Bash tool — do not just describe what you would do
|
|
515
|
+
- **NEVER use `--json`** — it suppresses all streaming output. State IDs come from the `[state]` line in stderr
|
|
516
|
+
- **NEVER summarize or re-output the answer** — the script already streams it directly to the user
|
|
517
517
|
- After create, the script connects to the stream **immediately** — the `stream_key` has a limited validity period
|
|
518
518
|
- Use the bundled Node script to consume SSE; do not assume `jq` or other tools for parsing SSE
|
|
519
519
|
- Same API key as other Felo skills (`FELO_API_KEY`)
|
|
520
520
|
- The script handles reconnection automatically if the stream drops
|
|
521
521
|
- Tool results are deduplicated to avoid showing the same resource multiple times
|
|
522
|
-
-
|
|
522
|
+
- If `live_doc_id` is already known from any source (other skills, user input, previous calls), use it directly — do NOT fetch the LiveDoc list again
|
|
523
523
|
- Multi-language support: Fully supports Simplified Chinese, Traditional Chinese, Japanese, and English
|
|
524
524
|
- The API returns results in the same language as the query when possible
|
|
525
525
|
|
|
@@ -529,26 +529,31 @@ To use this skill, you need to set up your Felo API Key:
|
|
|
529
529
|
User sends a message
|
|
530
530
|
|
|
|
531
531
|
v
|
|
532
|
-
Have
|
|
532
|
+
Have live_doc_id from ANY source?
|
|
533
533
|
NO --> Step 2b: fetch list --> got items?
|
|
534
|
-
YES --> use items[0].short_id
|
|
534
|
+
YES --> use items[0].short_id as live_doc_id
|
|
535
535
|
NO --> Step 2c: create new LiveDoc
|
|
536
|
-
YES --> continue
|
|
536
|
+
YES --> continue (reuse it, do NOT fetch list)
|
|
537
537
|
|
|
|
538
538
|
v
|
|
539
539
|
Have thread_short_id from previous call?
|
|
540
540
|
NO --> This is a NEW conversation
|
|
541
|
-
--> Step 4:
|
|
541
|
+
--> Step 4: determine skill-id by analyzing user intent
|
|
542
542
|
--> Step 5: run WITHOUT --thread-id
|
|
543
|
-
YES -->
|
|
544
|
-
YES --> NEW conversation (same live-doc-id,
|
|
545
|
-
NO -->
|
|
543
|
+
YES --> Does user's intent require a skill-id not matching current thread?
|
|
544
|
+
YES --> NEW conversation (same live-doc-id, with --skill-id)
|
|
545
|
+
NO --> Is user explicitly starting a new topic?
|
|
546
|
+
YES --> NEW conversation (same live-doc-id, no --thread-id)
|
|
547
|
+
NO --> FOLLOW-UP (pass --thread-id)
|
|
548
|
+
|
|
|
549
|
+
v
|
|
550
|
+
Run script (NO --json, Bash timeout >= 600000ms) --> answer streams directly to user
|
|
546
551
|
|
|
|
547
552
|
v
|
|
548
|
-
|
|
553
|
+
Extract thread_short_id + live_doc_id from stderr [state] line
|
|
549
554
|
|
|
|
550
555
|
v
|
|
551
|
-
|
|
556
|
+
Do NOT repeat or summarize the answer (already shown)
|
|
552
557
|
```
|
|
553
558
|
|
|
554
559
|
## References
|
|
@@ -559,6 +559,7 @@ async function main() {
|
|
|
559
559
|
} else {
|
|
560
560
|
if (answer) console.log('');
|
|
561
561
|
if (!answer && toolResults.length === 0) console.log('(No content in stream)');
|
|
562
|
+
process.stderr.write(`\n[state] thread_short_id=${thread_short_id || ''} live_doc_short_id=${live_doc_short_id || ''} live_doc_url=${liveDocUrl || ''}\n`);
|
|
562
563
|
}
|
|
563
564
|
}
|
|
564
565
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "felo-ai",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.23",
|
|
4
4
|
"description": "Felo AI CLI - real-time search, PPT generation, SuperAgent conversation, LiveDoc management, web fetch, YouTube subtitles, LiveDoc knowledge base, and X (Twitter) search from the terminal",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/cli.js",
|