felo-ai 0.2.16 → 0.2.18

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 CHANGED
@@ -5,6 +5,36 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.2.18] - 2026-03-14
9
+
10
+ ### Added
11
+
12
+ - **`felo livedoc route <id>`**: add `route` subcommand to CLI for routing relevant resource IDs by query; supports `--max-resources` flag
13
+ - **`felo livedoc retrieve` `--resource-ids`**: add `--resource-ids` option to search within specific resources (comma-separated)
14
+
15
+ ### Fixed
16
+
17
+ - Fix `retrieve` request body field from `content` to `query`
18
+
19
+ ---
20
+
21
+ ## [0.2.17] - 2026-03-14
22
+
23
+ ### Added
24
+
25
+ - **`felo livedoc route <id>`**: route relevant resource IDs by query for targeted retrieval; supports `--max-resources`
26
+ - **`felo livedoc retrieve` `--resource-ids`**: specify resource IDs to search within (comma-separated, max 50); auto-routes when omitted
27
+
28
+ ### Changed
29
+
30
+ - `felo livedoc retrieve`: renamed request field `content` to `query` to align with backend API
31
+
32
+ ### Fixed
33
+
34
+ - Fixed truncated README in `felo-livedoc` (was cut off at 53 lines)
35
+
36
+ ---
37
+
8
38
  ## [0.2.14] - 2026-03-13
9
39
 
10
40
  ### Added
@@ -55,7 +85,6 @@ Streamline the process and reduce the need for confirmation and selection.
55
85
 
56
86
  Earlier releases: search, slides, web fetch, youtube-subtitling features.
57
87
 
58
- [0.3.0]: https://github.com/Felo-Inc/felo-skills/compare/v0.2.10...v0.3.0
59
88
  [0.2.10]: https://github.com/Felo-Inc/felo-skills/compare/v0.2.9...v0.2.10
60
89
  [0.2.7]: https://github.com/Felo-Inc/felo-skills/compare/v0.2.6...v0.2.7
61
90
  [0.2.6]: https://github.com/Felo-Inc/felo-skills/releases/tag/v0.2.6
@@ -9,12 +9,14 @@ Manage knowledge bases (LiveDocs) and their resources via the Felo API.
9
9
  - Create, list, update, and delete knowledge bases (LiveDocs)
10
10
  - Add resources: text documents, URLs, file uploads
11
11
  - Semantic retrieval across knowledge base resources
12
+ - Route relevant resources by query for targeted retrieval
12
13
  - Full CRUD for resources within a LiveDoc
13
14
 
14
15
  **When to use:**
15
16
  - Building or managing a knowledge base
16
17
  - Uploading documents or URLs for AI-powered retrieval
17
18
  - Searching across your knowledge base with natural language
19
+ - Routing relevant resources before targeted retrieval
18
20
 
19
21
  **When NOT to use:**
20
22
  - General web search (use `felo-search`)
@@ -51,3 +53,45 @@ felo livedoc list
51
53
  ```bash
52
54
  # Create a knowledge base
53
55
  felo livedoc create --name "My KB" --description "Project docs"
56
+
57
+ # Add a URL resource
58
+ felo livedoc add-urls SHORT_ID --urls "https://example.com"
59
+
60
+ # Upload a file
61
+ felo livedoc upload SHORT_ID --file ./report.pdf
62
+
63
+ # Semantic retrieval across all resources (auto-routes)
64
+ felo livedoc retrieve SHORT_ID --query "latest AI research"
65
+
66
+ # Retrieve within specific resources
67
+ felo livedoc retrieve SHORT_ID --query "latest AI research" --resource-ids "id1,id2"
68
+
69
+ # Route relevant resources by query
70
+ felo livedoc route SHORT_ID --query "latest AI research"
71
+ felo livedoc route SHORT_ID --query "latest AI research" --max-resources 5
72
+ ```
73
+
74
+ ---
75
+
76
+ ## Commands
77
+
78
+ | Command | Description |
79
+ |---------|-------------|
80
+ | `create` | Create a new LiveDoc |
81
+ | `list` | List all LiveDocs |
82
+ | `update <short_id>` | Update a LiveDoc |
83
+ | `delete <short_id>` | Delete a LiveDoc |
84
+ | `resources <short_id>` | List resources in a LiveDoc |
85
+ | `resource <short_id> <resource_id>` | Get a single resource |
86
+ | `add-doc <short_id>` | Create a text document resource |
87
+ | `add-urls <short_id>` | Add URL resources (max 10) |
88
+ | `upload <short_id>` | Upload a file resource |
89
+ | `remove-resource <short_id> <resource_id>` | Delete a resource |
90
+ | `retrieve <short_id>` | Semantic retrieval (auto-routes if no `--resource-ids`) |
91
+ | `route <short_id>` | Route relevant resource IDs by query |
92
+
93
+ ---
94
+
95
+ ## License
96
+
97
+ MIT
@@ -12,10 +12,11 @@ Trigger this skill when users want to:
12
12
  - **Create/manage knowledge bases:** Create, list, update, or delete LiveDocs
13
13
  - **Add resources:** Upload documents, add URLs, or create text documents in a LiveDoc
14
14
  - **Semantic retrieval:** Search across knowledge base resources using natural language queries
15
+ - **Route resources:** Find relevant resource IDs by query for targeted retrieval
15
16
  - **Resource management:** List, view, or delete resources within a LiveDoc
16
17
 
17
18
  **Trigger words:**
18
- - English: knowledge base, livedoc, live doc, upload document, add URL, semantic search, retrieve, knowledge retrieval
19
+ - English: knowledge base, livedoc, live doc, upload document, add URL, semantic search, retrieve, knowledge retrieval, route resources
19
20
  - 简体中文: 知识库, 文档库, 上传文档, 添加链接, 语义检索, 知识检索
20
21
 
21
22
  **Explicit commands:** `/felo-livedoc`, "livedoc", "felo livedoc"
@@ -110,10 +111,21 @@ node ~/.agents/skills/felo-livedoc/scripts/run_livedoc.mjs remove-resource SHORT
110
111
 
111
112
  ### Semantic Retrieval
112
113
 
113
- **Search across resources:**
114
+ **Route relevant resources by query:**
115
+ ```bash
116
+ node ~/.agents/skills/felo-livedoc/scripts/run_livedoc.mjs route SHORT_ID --query "your search query"
117
+ node ~/.agents/skills/felo-livedoc/scripts/run_livedoc.mjs route SHORT_ID --query "your search query" --max-resources 5
118
+ ```
119
+
120
+ **Search across all resources (auto-routes):**
114
121
  ```bash
115
122
  node ~/.agents/skills/felo-livedoc/scripts/run_livedoc.mjs retrieve SHORT_ID --query "your search query"
116
123
  ```
124
+
125
+ **Search within specific resources:**
126
+ ```bash
127
+ node ~/.agents/skills/felo-livedoc/scripts/run_livedoc.mjs retrieve SHORT_ID --query "your search query" --resource-ids "id1,id2,id3"
128
+ ```
117
129
  ### Options
118
130
 
119
131
  All commands support:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "felo-ai",
3
- "version": "0.2.16",
3
+ "version": "0.2.18",
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",
package/src/cli.js CHANGED
@@ -640,12 +640,33 @@ livedocCmd
640
640
  .command("retrieve <short_id>")
641
641
  .description("Semantic search across resources")
642
642
  .requiredOption("--query <query>", "search query")
643
+ .option("--resource-ids <ids>", "comma-separated resource IDs to search within")
643
644
  .option("-j, --json", "output raw JSON")
644
645
  .option("-t, --timeout <seconds>", "request timeout in seconds", "60")
645
646
  .action(async (shortId, opts) => {
646
647
  const timeoutMs = parseInt(opts.timeout, 10) * 1000;
647
648
  const code = await livedoc.retrieve(shortId, {
648
649
  query: opts.query,
650
+ resourceIds: opts.resourceIds,
651
+ json: opts.json,
652
+ timeoutMs: Number.isNaN(timeoutMs) ? 60000 : timeoutMs,
653
+ });
654
+ process.exitCode = code;
655
+ flushStdioThenExit(code);
656
+ });
657
+
658
+ livedocCmd
659
+ .command("route <short_id>")
660
+ .description("Route relevant resource IDs by query")
661
+ .requiredOption("--query <query>", "routing query")
662
+ .option("--max-resources <n>", "max resources to return")
663
+ .option("-j, --json", "output raw JSON")
664
+ .option("-t, --timeout <seconds>", "request timeout in seconds", "60")
665
+ .action(async (shortId, opts) => {
666
+ const timeoutMs = parseInt(opts.timeout, 10) * 1000;
667
+ const code = await livedoc.route(shortId, {
668
+ query: opts.query,
669
+ maxResources: opts.maxResources,
649
670
  json: opts.json,
650
671
  timeoutMs: Number.isNaN(timeoutMs) ? 60000 : timeoutMs,
651
672
  });
package/src/livedoc.js CHANGED
@@ -374,6 +374,36 @@ export async function removeResource(shortId, resourceId, opts = {}) {
374
374
  } finally { stopSpinner(spinnerId); }
375
375
  }
376
376
 
377
+ export async function route(shortId, opts = {}) {
378
+ const apiKey = await getApiKey();
379
+ if (!apiKey) { console.error(NO_KEY_MESSAGE.trim()); return 1; }
380
+ if (!shortId) { process.stderr.write('ERROR: short_id is required.\n'); return 1; }
381
+ if (!opts.query) { process.stderr.write('ERROR: --query is required.\n'); return 1; }
382
+
383
+ const apiBase = await getApiBase();
384
+ const timeoutMs = opts.timeoutMs || DEFAULT_TIMEOUT_MS;
385
+ const spinnerId = startSpinner('Routing relevant resources');
386
+
387
+ try {
388
+ const body = { query: opts.query };
389
+ if (opts.maxResources) {
390
+ const n = parseInt(opts.maxResources, 10);
391
+ if (Number.isFinite(n) && n > 0) body.max_resources = n;
392
+ }
393
+ const payload = await apiRequest('POST', `/livedocs/${shortId}/resources/route`, body, apiKey, apiBase, timeoutMs);
394
+ if (opts.json) { console.log(JSON.stringify(payload, null, 2)); return 0; }
395
+
396
+ const resourceIds = payload?.data || [];
397
+ if (!resourceIds.length) { process.stderr.write('No relevant resources found.\n'); return 0; }
398
+ process.stdout.write(`Found ${resourceIds.length} relevant resource(s):\n\n`);
399
+ for (const id of resourceIds) process.stdout.write(`- ${id}\n`);
400
+ return 0;
401
+ } catch (err) {
402
+ process.stderr.write(`Failed to route resources: ${err?.message || err}\n`);
403
+ return 1;
404
+ } finally { stopSpinner(spinnerId); }
405
+ }
406
+
377
407
  export async function retrieve(shortId, opts = {}) {
378
408
  const apiKey = await getApiKey();
379
409
  if (!apiKey) { console.error(NO_KEY_MESSAGE.trim()); return 1; }
@@ -385,7 +415,10 @@ export async function retrieve(shortId, opts = {}) {
385
415
  const spinnerId = startSpinner('Retrieving from knowledge base');
386
416
 
387
417
  try {
388
- const body = { content: opts.query };
418
+ const body = { query: opts.query };
419
+ if (opts.resourceIds) {
420
+ body.resource_ids = opts.resourceIds.split(',').map(id => id.trim()).filter(Boolean);
421
+ }
389
422
  const payload = await apiRequest('POST', `/livedocs/${shortId}/resources/retrieve`, body, apiKey, apiBase, timeoutMs);
390
423
  if (opts.json) { console.log(JSON.stringify(payload, null, 2)); return 0; }
391
424