felo-ai 0.2.35 → 0.2.41
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/README.md +7 -0
- package/package.json +1 -1
- package/src/appleBuyAdvisor.js +17 -0
- package/src/cli.js +25 -0
- package/tests/cli.test.js +26 -0
package/README.md
CHANGED
|
@@ -113,6 +113,13 @@ felo livedoc retrieve SHORT_ID --query "search query"
|
|
|
113
113
|
|
|
114
114
|
**Apple Buy Advisor** — [full options →](./apple-buy-advisor/SKILL.md)
|
|
115
115
|
|
|
116
|
+
```bash
|
|
117
|
+
# Use as Felo CLI command
|
|
118
|
+
felo apple-buy-advisor "Should I buy MacBook Pro M4?"
|
|
119
|
+
felo apple-buy-advisor "Compare iPhone 17 vs iPhone 17e"
|
|
120
|
+
felo apple-buy-advisor "Is it worth upgrading to iPad Air 13?"
|
|
121
|
+
```
|
|
122
|
+
|
|
116
123
|
```bash
|
|
117
124
|
# Use as Claude Code skill
|
|
118
125
|
/apple-buy-advisor Should I buy MacBook Pro M4?
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "felo-ai",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.41",
|
|
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",
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { superAgent } from './superAgent.js';
|
|
2
|
+
|
|
3
|
+
function buildAppleBuyAdvisorPrompt(query) {
|
|
4
|
+
const trimmed = String(query || '').trim();
|
|
5
|
+
return [
|
|
6
|
+
`/apple-buy-advisor ${trimmed}`,
|
|
7
|
+
'',
|
|
8
|
+
'If slash-style skill routing is unavailable, still act as an Apple product buy advisor.',
|
|
9
|
+
'Use current information, compare relevant Apple models, summarize user and professional feedback when possible, and end with a clear buying recommendation.',
|
|
10
|
+
].join('\n');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export async function appleBuyAdvisor(query, options = {}) {
|
|
14
|
+
return superAgent(buildAppleBuyAdvisorPrompt(query), options);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { buildAppleBuyAdvisorPrompt };
|
package/src/cli.js
CHANGED
|
@@ -5,6 +5,7 @@ import { Command } from "commander";
|
|
|
5
5
|
import { search } from "./search.js";
|
|
6
6
|
import { slides, listPptThemes } from "./slides.js";
|
|
7
7
|
import { superAgent, listLiveDocs, listLiveDocResources } from "./superAgent.js";
|
|
8
|
+
import { appleBuyAdvisor } from "./appleBuyAdvisor.js";
|
|
8
9
|
import { webFetch } from "./webFetch.js";
|
|
9
10
|
import { youtubeSubtitling } from "./youtubeSubtitling.js";
|
|
10
11
|
import { contentToSlides } from "./contentToSlides.js";
|
|
@@ -176,6 +177,30 @@ program
|
|
|
176
177
|
flushStdioThenExit(code);
|
|
177
178
|
});
|
|
178
179
|
|
|
180
|
+
program
|
|
181
|
+
.command("apple-buy-advisor")
|
|
182
|
+
.description("Research and compare Apple products before you buy")
|
|
183
|
+
.argument("<query>", "Apple product buying or comparison question")
|
|
184
|
+
.option("-j, --json", "output JSON with answer, thread_short_id, live_doc_short_id")
|
|
185
|
+
.option("-v, --verbose", "log stream key, thread ID, LiveDoc ID to stderr")
|
|
186
|
+
.option("-t, --timeout <seconds>", "request/stream timeout in seconds", "60")
|
|
187
|
+
.option("--live-doc-id <id>", "reuse existing LiveDoc short_id for continuous conversation")
|
|
188
|
+
.option("--thread-id <id>", "existing thread/conversation ID for follow-up questions")
|
|
189
|
+
.option("--accept-language <lang>", "language preference (e.g. zh, en)")
|
|
190
|
+
.action(async (query, opts) => {
|
|
191
|
+
const timeoutMs = parseInt(opts.timeout, 10) * 1000;
|
|
192
|
+
const code = await appleBuyAdvisor(query, {
|
|
193
|
+
json: opts.json,
|
|
194
|
+
verbose: opts.verbose,
|
|
195
|
+
timeoutMs: Number.isNaN(timeoutMs) ? 60000 : timeoutMs,
|
|
196
|
+
liveDocId: opts.liveDocId || undefined,
|
|
197
|
+
threadId: opts.threadId || undefined,
|
|
198
|
+
acceptLanguage: opts.acceptLanguage || undefined,
|
|
199
|
+
});
|
|
200
|
+
process.exitCode = code;
|
|
201
|
+
flushStdioThenExit(code);
|
|
202
|
+
});
|
|
203
|
+
|
|
179
204
|
program
|
|
180
205
|
.command("livedocs")
|
|
181
206
|
.description("List LiveDocs with pagination and optional keyword filtering")
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { describe, it } from 'node:test';
|
|
2
|
+
import assert from 'node:assert';
|
|
3
|
+
import { spawnSync } from 'node:child_process';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
|
|
6
|
+
const cliPath = path.resolve('src/cli.js');
|
|
7
|
+
|
|
8
|
+
describe('CLI command registration', () => {
|
|
9
|
+
it('shows apple-buy-advisor in top-level help', () => {
|
|
10
|
+
const result = spawnSync(process.execPath, [cliPath, '--help'], {
|
|
11
|
+
encoding: 'utf8',
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
assert.strictEqual(result.status, 0);
|
|
15
|
+
assert.match(result.stdout, /apple-buy-advisor/);
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('shows help for apple-buy-advisor command', () => {
|
|
19
|
+
const result = spawnSync(process.execPath, [cliPath, 'apple-buy-advisor', '--help'], {
|
|
20
|
+
encoding: 'utf8',
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
assert.strictEqual(result.status, 0);
|
|
24
|
+
assert.match(result.stdout, /Research and compare Apple products before you buy/);
|
|
25
|
+
});
|
|
26
|
+
});
|