@optima-chat/optima-agent 0.8.49 → 0.8.51

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 (81) hide show
  1. package/.claude/settings.local.json +154 -0
  2. package/.claude/skills/browser/SKILL.md +1 -0
  3. package/.claude/skills/reddit/SKILL.md +288 -0
  4. package/dist/bin/bi-cli.js +0 -0
  5. package/dist/bin/comfy.d.ts +3 -0
  6. package/dist/bin/comfy.d.ts.map +1 -0
  7. package/dist/bin/comfy.js +3 -0
  8. package/dist/bin/comfy.js.map +1 -0
  9. package/dist/bin/commerce.js +0 -0
  10. package/dist/bin/google-ads.js +0 -0
  11. package/dist/bin/optima.js +0 -0
  12. package/dist/bin/scout.js +0 -0
  13. package/dist/src/agent.d.ts +1 -1
  14. package/dist/src/hooks-loader.d.ts +6 -0
  15. package/dist/src/hooks-loader.d.ts.map +1 -0
  16. package/dist/src/hooks-loader.js +215 -0
  17. package/dist/src/hooks-loader.js.map +1 -0
  18. package/dist/src/system-prompt.d.ts.map +1 -1
  19. package/dist/src/system-prompt.js +3 -0
  20. package/dist/src/system-prompt.js.map +1 -1
  21. package/dist/src/ui/App.d.ts +6 -0
  22. package/dist/src/ui/App.d.ts.map +1 -0
  23. package/dist/src/ui/App.js +164 -0
  24. package/dist/src/ui/App.js.map +1 -0
  25. package/dist/src/ui/components/Composer.d.ts +10 -0
  26. package/dist/src/ui/components/Composer.d.ts.map +1 -0
  27. package/dist/src/ui/components/Composer.js +13 -0
  28. package/dist/src/ui/components/Composer.js.map +1 -0
  29. package/dist/src/ui/components/Header.d.ts +7 -0
  30. package/dist/src/ui/components/Header.d.ts.map +1 -0
  31. package/dist/src/ui/components/Header.js +7 -0
  32. package/dist/src/ui/components/Header.js.map +1 -0
  33. package/dist/src/ui/components/Message.d.ts +12 -0
  34. package/dist/src/ui/components/Message.d.ts.map +1 -0
  35. package/dist/src/ui/components/Message.js +21 -0
  36. package/dist/src/ui/components/Message.js.map +1 -0
  37. package/dist/src/ui/components/MessageList.d.ts +9 -0
  38. package/dist/src/ui/components/MessageList.d.ts.map +1 -0
  39. package/dist/src/ui/components/MessageList.js +18 -0
  40. package/dist/src/ui/components/MessageList.js.map +1 -0
  41. package/dist/src/ui/components/Spinner.d.ts +6 -0
  42. package/dist/src/ui/components/Spinner.d.ts.map +1 -0
  43. package/dist/src/ui/components/Spinner.js +7 -0
  44. package/dist/src/ui/components/Spinner.js.map +1 -0
  45. package/dist/src/ui/components/StatusBar.d.ts +11 -0
  46. package/dist/src/ui/components/StatusBar.d.ts.map +1 -0
  47. package/dist/src/ui/components/StatusBar.js +7 -0
  48. package/dist/src/ui/components/StatusBar.js.map +1 -0
  49. package/dist/src/ui/components/index.d.ts +7 -0
  50. package/dist/src/ui/components/index.d.ts.map +1 -0
  51. package/dist/src/ui/components/index.js +7 -0
  52. package/dist/src/ui/components/index.js.map +1 -0
  53. package/dist/src/validation/error-formatter.d.ts +21 -0
  54. package/dist/src/validation/error-formatter.d.ts.map +1 -0
  55. package/dist/src/validation/error-formatter.js +98 -0
  56. package/dist/src/validation/error-formatter.js.map +1 -0
  57. package/dist/src/validation/index.d.ts +10 -0
  58. package/dist/src/validation/index.d.ts.map +1 -0
  59. package/dist/src/validation/index.js +10 -0
  60. package/dist/src/validation/index.js.map +1 -0
  61. package/dist/src/validation/json-validator.d.ts +25 -0
  62. package/dist/src/validation/json-validator.d.ts.map +1 -0
  63. package/dist/src/validation/json-validator.js +173 -0
  64. package/dist/src/validation/json-validator.js.map +1 -0
  65. package/dist/src/validation/schema.d.ts +353 -0
  66. package/dist/src/validation/schema.d.ts.map +1 -0
  67. package/dist/src/validation/schema.js +57 -0
  68. package/dist/src/validation/schema.js.map +1 -0
  69. package/dist/src/validation/suggestions.d.ts +25 -0
  70. package/dist/src/validation/suggestions.d.ts.map +1 -0
  71. package/dist/src/validation/suggestions.js +144 -0
  72. package/dist/src/validation/suggestions.js.map +1 -0
  73. package/dist/src/validation/types.d.ts +40 -0
  74. package/dist/src/validation/types.d.ts.map +1 -0
  75. package/dist/src/validation/types.js +5 -0
  76. package/dist/src/validation/types.js.map +1 -0
  77. package/dist/src/validation/yaml-validator.d.ts +25 -0
  78. package/dist/src/validation/yaml-validator.d.ts.map +1 -0
  79. package/dist/src/validation/yaml-validator.js +177 -0
  80. package/dist/src/validation/yaml-validator.js.map +1 -0
  81. package/package.json +1 -1
@@ -0,0 +1,154 @@
1
+ {
2
+ "permissions": {
3
+ "allow": [
4
+ "Bash(gh api:*)",
5
+ "WebFetch(domain:platform.claude.com)",
6
+ "Bash(git init:*)",
7
+ "Bash(mkdir:*)",
8
+ "Bash(npm run typecheck:*)",
9
+ "Bash(npm view:*)",
10
+ "WebSearch",
11
+ "Bash(commerce --help)",
12
+ "Bash(done)",
13
+ "Bash(commerce product:*)",
14
+ "Bash(commerce order:*)",
15
+ "Bash(commerce i18n:*)",
16
+ "Bash(google-ads:*)",
17
+ "Bash(scout --help:*)",
18
+ "Bash(tree:*)",
19
+ "Bash(cloc:*)",
20
+ "Bash(npm run build:*)",
21
+ "Bash(git restore:*)",
22
+ "Bash(gh repo view:*)",
23
+ "Bash(mv:*)",
24
+ "Bash(rmdir:*)",
25
+ "Bash(git add:*)",
26
+ "Bash(git commit:*)",
27
+ "Bash(git push)",
28
+ "Bash(timeout 5 npm run optima:*)",
29
+ "Bash(npm install:*)",
30
+ "Bash(cat:*)",
31
+ "Bash(gh issue create:*)",
32
+ "Bash(npx tsx:*)",
33
+ "Bash(timeout 30 npx tsx:*)",
34
+ "Bash(git push origin feature/ask-user-question)",
35
+ "Bash(node:*)",
36
+ "Bash(npm version:*)",
37
+ "Bash(git push:*)",
38
+ "Bash(npm publish:*)",
39
+ "Bash(pkill:*)",
40
+ "Bash(git -C /Users/verypro/optima-agent log --oneline --all -- \".claude/\")",
41
+ "Bash(wc:*)",
42
+ "Bash(grep:*)",
43
+ "Bash(find:*)",
44
+ "Bash(commerce collection --help:*)",
45
+ "Bash(commerce collection update --help:*)",
46
+ "Bash(commerce collection set-cover:*)",
47
+ "Bash(commerce collection get --help:*)",
48
+ "Bash(commerce collection list --help:*)",
49
+ "Bash(commerce collection create --help:*)",
50
+ "Bash(commerce collection remove-products:*)",
51
+ "Bash(commerce collection list-products:*)",
52
+ "Bash(commerce --version:*)",
53
+ "Bash(bi-cli --version:*)",
54
+ "Bash(commerce homepage create --help:*)",
55
+ "Bash(commerce homepage reorder --help:*)",
56
+ "Bash(commerce homepage delete --help:*)",
57
+ "Bash(commerce homepage update-images:*)",
58
+ "Bash(commerce homepage update-collections:*)",
59
+ "Bash(commerce homepage update-target:*)",
60
+ "Bash(commerce homepage switch-template:*)",
61
+ "Bash(commerce inventory:*)",
62
+ "Bash(commerce merchant:*)",
63
+ "Bash(commerce review:*)",
64
+ "Bash(commerce product-page:*)",
65
+ "Bash(bi-cli:*)",
66
+ "Bash(comfy:*)",
67
+ "Bash(scout search:*)",
68
+ "Bash(scout product:*)",
69
+ "Bash(commerce homepage create-collections:*)",
70
+ "Bash(commerce homepage create-featured:*)",
71
+ "Bash(commerce homepage create-collection-products:*)",
72
+ "Bash(commerce homepage create-banner:*)",
73
+ "Bash(xargs -I {} sh -c 'echo \"\"\"\"=== {} ===\"\"\"\"; head -3 /Users/verypro/optima-agent/.claude/skills/{}/SKILL.md | grep \"\"\"\"name:\"\"\"\"')",
74
+ "Bash(ls:*)",
75
+ "Bash(gh issue view:*)",
76
+ "Bash(npx markdownlint-cli:*)",
77
+ "Bash(chmod:*)",
78
+ "Bash(npm whoami:*)",
79
+ "Bash(tsx test-scripts/test-headless-progress.ts:*)",
80
+ "Bash(DEBUG_STREAM=1 node dist/bin/optima.js:*)",
81
+ "Bash(git describe:*)",
82
+ "WebFetch(domain:github.com)",
83
+ "Bash(./scripts/test-headless.sh:*)",
84
+ "Bash(./scripts/test-headless-simple.sh:*)",
85
+ "Bash(env)",
86
+ "Bash(gh pr list:*)",
87
+ "Bash(gh pr view:*)",
88
+ "Bash(gh pr diff:*)",
89
+ "Bash(optima --version:*)",
90
+ "Bash(optima agent headless:*)",
91
+ "Bash(optima headless:*)",
92
+ "Bash(/Users/verypro/optima-agent/scripts/test-headless.sh:*)",
93
+ "Bash(/Users/verypro/optima-agent/scripts/test-headless-simple.sh:*)",
94
+ "Bash(tee:*)",
95
+ "Bash(CONV_ID=\"conv-1\":*)",
96
+ "Bash(echo:*)",
97
+ "Bash(scout tiktok trending --help:*)",
98
+ "Bash(scout tiktok trending:*)",
99
+ "Bash(git checkout:*)",
100
+ "Bash(npm test:*)",
101
+ "Bash(git tag:*)",
102
+ "Bash(/private/tmp/claude/-Users-verypro-optima-agent/68a9ac2c-def2-44e1-b42b-e53bd9022ab6/scratchpad/test-canUseTool.sh)",
103
+ "Bash(optima --help:*)",
104
+ "Bash(npx @optima-chat/ads-cli:*)",
105
+ "Bash(head:*)",
106
+ "Bash(git pull:*)",
107
+ "Bash(pnpm build:*)",
108
+ "Skill(read-code)",
109
+ "Bash(npm run cli:*)",
110
+ "Bash(scout:*)",
111
+ "WebFetch(domain:docs.scrapecreators.com)",
112
+ "WebFetch(domain:scrapecreators.com)",
113
+ "Bash(gh auth status:*)",
114
+ "Bash(optima-agent:*)",
115
+ "Bash(python3:*)",
116
+ "Bash(python3 -c \" import sys content = sys.stdin.read\\(\\) # Find flushMessageQueueSync idx = content.find\\(''flushMessageQueueSync''\\) # Get context around it lines = content.split\\(''\\\\n''\\) for i, line in enumerate\\(lines\\): if ''flushMessageQueueSync'' in line and ''private'' in line: for j in range\\(i, min\\(i+20, len\\(lines\\)\\)\\): print\\(f''{j+1}: {lines[j]}''\\) break \")",
117
+ "Bash(optima:*)",
118
+ "WebFetch(domain:www.npmjs.com)",
119
+ "WebFetch(domain:registry.npmjs.org)",
120
+ "WebFetch(domain:zod.dev)",
121
+ "Bash(npm ls:*)",
122
+ "Bash(NODE_DEBUG=child_process npx tsx:*)",
123
+ "Bash(DEBUG_CLAUDE_AGENT_SDK=1 npx tsx:*)",
124
+ "Bash(CLAUDECODE= npx tsx:*)",
125
+ "Bash(env:*)",
126
+ "Bash(gh release:*)",
127
+ "Bash(npm info:*)",
128
+ "Bash(gh run:*)",
129
+ "Bash(gtimeout 90:*)",
130
+ "Bash(sentinel:*)",
131
+ "Bash(gh pr:*)",
132
+ "Bash(git fetch:*)",
133
+ "Bash(git log:*)",
134
+ "Bash(npm bin:*)",
135
+ "Bash(git status:*)",
136
+ "Bash(browser-cli --version && browser-cli --help)",
137
+ "Bash(browser-cli status:*)",
138
+ "Bash(browser-cli launch:*)",
139
+ "Bash(browser-cli screenshot:*)",
140
+ "Bash(browser-cli --version)",
141
+ "Bash(browser-cli close:*)",
142
+ "Bash(npm update:*)",
143
+ "Bash(node -e \"console.log\\(require\\('./node_modules/@optima-chat/browser-cli/package.json'\\).version\\)\")",
144
+ "WebFetch(domain:raw.githubusercontent.com)",
145
+ "Bash(aws ecs:*)",
146
+ "Bash(aws ecr:*)",
147
+ "Bash(gh search:*)",
148
+ "Bash(npx tsc:*)",
149
+ "Bash(find /Users/verypro/optima-agent -path */node_modules -prune -o -type f \\\\\\(-name *comfy* -o -name *gen* \\\\\\) -print)"
150
+ ],
151
+ "deny": [],
152
+ "ask": []
153
+ }
154
+ }
@@ -414,4 +414,5 @@ if target_idx is None:
414
414
  - **登录自动保持**:登录一次后自动持久化,无需重复登录
415
415
  - **文件路径自动转换**:直接传你看到的路径(~/xxx),后端自动处理
416
416
  - **务必关闭**:操作完成后运行 `browser-cli close` 释放资源
417
+ - **login_required 处理**:如果 runscript 返回 `login_required` 错误,说明该平台未登录。先 `browser-cli launch --url <平台URL>` 手动登录(问用户要验证码),登录后 `browser-cli close` 保存登录态,再重新 `runscript`
417
418
  - **Fallback 后更新脚本**:如果脚本频繁失败,重新生成并 submit-script 覆盖
@@ -0,0 +1,288 @@
1
+ ---
2
+ name: reddit
3
+ description: "Reddit 趋势发现和商机预判。当用户需要从 Reddit 发现趋势(Reddit趋势/Reddit热门/Reddit话题)、搜索 Reddit 帖子(Reddit搜索/搜Reddit)、查看 subreddit 版块(版块/社区/subreddit)、分析 Reddit 评论(Reddit评论/帖子评论)、查看 Reddit 广告(Reddit广告/竞品广告)、或预判商机(趋势预判/商机发现/市场信号)时使用此技能。"
4
+ ---
5
+
6
+ # Reddit - 趋势发现与商机预判
7
+
8
+ 所有命令使用 `scout reddit` 前缀。
9
+
10
+ ---
11
+
12
+ ## 快速选择:我该用哪个命令?
13
+
14
+ | 你的目标 | 最佳命令 | 补充命令 | 组合逻辑 |
15
+ |---------|---------|---------|---------|
16
+ | **发现商机趋势** | `trends "关键词"` | — | 一键聚合全站热帖+多版块分析 |
17
+ | **搜索 Reddit 话题** | `search "关键词"` | `comments` | 全站搜索→深入看评论 |
18
+ | **监控特定版块** | `subreddit <名称>` | `subreddit-info` | 看热帖+版块数据 |
19
+ | **版块内精准搜索** | 通过 API: `/subreddit/:name/search` | — | 在特定版块搜关键词 |
20
+ | **分析帖子讨论** | `comments <url>` | — | 看用户真实反馈和痛点 |
21
+ | **竞品广告情报** | `ads "关键词"` | — | 看竞品在 Reddit 投了什么广告 |
22
+
23
+ ---
24
+
25
+ ## 典型场景
26
+
27
+ 当用户说:
28
+ - "Reddit 上什么火" / "Reddit 趋势" → `scout reddit trends "关键词"`
29
+ - "搜一下 Reddit 上关于XX的讨论" → `scout reddit search "XX"`
30
+ - "看看 r/BuyItForLife" → `scout reddit subreddit BuyItForLife`
31
+ - "这个版块有多少人" → `scout reddit subreddit-info BuyItForLife`
32
+ - "看看这个帖子的评论" + Reddit URL → `scout reddit comments "<url>"`
33
+ - "竞品在 Reddit 打了什么广告" → `scout reddit ads "产品关键词" -i RETAIL_AND_ECOMMERCE`
34
+ - "这个品类有没有商机" / "市场趋势" → `scout reddit trends "品类关键词"`
35
+
36
+ ---
37
+
38
+ ## URL 解析 - Reddit 链接处理
39
+
40
+ 用户可能直接贴 Reddit 链接,按以下规则处理:
41
+
42
+ | URL 特征 | 提取内容 | 调用命令 |
43
+ |----------|---------|---------|
44
+ | `reddit.com/r/名称/comments/...` | 完整帖子 URL | `scout reddit comments "<url>"` |
45
+ | `reddit.com/r/名称` | subreddit 名称 | `scout reddit subreddit <名称>` |
46
+ | `redd.it/短链接` | 完整 URL | `scout reddit comments "https://redd.it/..."` |
47
+
48
+ **示例**:
49
+ ```bash
50
+ # 帖子链接 → 获取评论
51
+ scout reddit comments "https://www.reddit.com/r/BuyItForLife/comments/1s6eg5r/best_backpack/"
52
+
53
+ # 版块链接 → 获取热帖
54
+ # https://www.reddit.com/r/Entrepreneur
55
+ scout reddit subreddit Entrepreneur
56
+ ```
57
+
58
+ ---
59
+
60
+ ## 核心命令
61
+
62
+ ### 🔥 第一层:趋势发现
63
+
64
+ #### 1. 趋势发现(旗舰命令) - `scout reddit trends`
65
+
66
+ 一键聚合全站搜索 + 多版块热帖分析,用于预判商机。
67
+
68
+ ```bash
69
+ scout reddit trends "wireless earbuds"
70
+ scout reddit trends "portable blender" --format text
71
+ scout reddit trends "home office" --subreddits "BuyItForLife,Entrepreneur,smallbusiness" -t month
72
+ ```
73
+
74
+ **参数**:
75
+ - `<query>`:搜索关键词(必填)
76
+ - `--subreddits`:逗号分隔的版块名(默认: BuyItForLife,shutupandtakemymoney,Entrepreneur,smallbusiness)
77
+ - `-t, --timeframe`:时间范围 `all|day|week|month|year`(默认: week)
78
+ - `-f, --format`:输出格式 `json|text`(默认: json)
79
+
80
+ **返回数据**:
81
+ - `globalResults`:全站 Top 帖子(sort=top,找历史表现最好的讨论)
82
+ - `subredditResults`:每个版块的热帖(sort=hot,找当前势头)+ 版块信息(订阅者数、分类)
83
+
84
+ **分析重点**:
85
+ 1. 全站 Top 帖 = 已验证的用户兴趣(高 score = 广泛共鸣)
86
+ 2. 版块热帖 = 正在发酵的需求(hot = 当前势头)
87
+ 3. 评论数高 = 话题争议性/参与度强
88
+ 4. 跨版块重复出现的话题 = 强趋势信号
89
+
90
+ #### 2. 全站搜索 - `scout reddit search`
91
+
92
+ 按关键词搜索全 Reddit。
93
+
94
+ ```bash
95
+ scout reddit search "coffee maker" --format text
96
+ scout reddit search "standing desk" -s top -t month
97
+ scout reddit search "protein powder" -s comment_count -t week
98
+ ```
99
+
100
+ **参数**:
101
+ - `-s, --sort`:排序 `relevance|new|top|comment_count`(默认: top)
102
+ - `-t, --timeframe`:时间范围 `all|day|week|month|year`(默认: week)
103
+ - `-f, --format`:输出格式 `json|text`
104
+
105
+ **返回数据**:帖子列表,含 `title`、`subreddit`、`author`、`score`、`numComments`、`permalink`
106
+
107
+ ---
108
+
109
+ ### 📊 第二层:版块分析
110
+
111
+ #### 3. 版块热帖 - `scout reddit subreddit`
112
+
113
+ 获取特定版块的帖子列表。
114
+
115
+ ```bash
116
+ scout reddit subreddit BuyItForLife --format text
117
+ scout reddit subreddit Entrepreneur --sort top --timeframe week
118
+ scout reddit subreddit smallbusiness --sort rising
119
+ ```
120
+
121
+ **参数**:
122
+ - `<name>`:版块名(不加 r/)
123
+ - `-s, --sort`:排序 `best|hot|new|top|rising`(默认: hot)
124
+ - `-t, --timeframe`:时间范围(**仅 sort=top 时有效**,其他 sort 值会被忽略)
125
+ - `-f, --format`:输出格式
126
+
127
+ **推荐版块**(商机发现):
128
+
129
+ | 版块 | 订阅者 | 方向 |
130
+ |------|--------|------|
131
+ | r/BuyItForLife | 3.6M | 耐用消费品需求 |
132
+ | r/shutupandtakemymoney | 496K | 冲动消费/新奇产品 |
133
+ | r/Entrepreneur | 5.1M | 创业趋势/商业模式 |
134
+ | r/smallbusiness | 2.4M | 中小企业需求/痛点 |
135
+ | r/ProductHunting | — | 产品发现 |
136
+ | r/Gadgets | — | 科技产品趋势 |
137
+ | r/cooltools | — | 工具和装备 |
138
+
139
+ #### 4. 版块信息 - `scout reddit subreddit-info`
140
+
141
+ 查看版块的订阅者数、分类、描述等。
142
+
143
+ ```bash
144
+ scout reddit subreddit-info BuyItForLife --format text
145
+ scout reddit subreddit-info Entrepreneur
146
+ ```
147
+
148
+ **返回数据**:`name`、`subscribers`、`advertiserCategory`、`description`、`createdAt`
149
+
150
+ **注意**:`weeklyActiveUsers` 和 `weeklyContributions` 可能为 null(API 限制)。
151
+
152
+ ---
153
+
154
+ ### 💬 第三层:深度分析
155
+
156
+ #### 5. 帖子评论 - `scout reddit comments`
157
+
158
+ 获取帖子的评论列表,用于分析用户真实反馈。
159
+
160
+ ```bash
161
+ scout reddit comments "https://www.reddit.com/r/BuyItForLife/comments/1s6eg5r/..." --format text
162
+ ```
163
+
164
+ **返回数据**:`post`(帖子详情)+ `comments`(评论列表,含 author、body、score)+ `hasMore`
165
+
166
+ **分析重点**:
167
+ 1. 高 score 评论 = 社区共识
168
+ 2. 产品推荐评论 = 真实用户口碑
169
+ 3. 抱怨/吐槽评论 = 未满足的需求(商机)
170
+ 4. "I wish..." / "Why doesn't..." = 产品创意来源
171
+
172
+ ---
173
+
174
+ ### 📢 第四层:竞品广告情报
175
+
176
+ #### 6. 广告搜索 - `scout reddit ads`
177
+
178
+ 搜索 Reddit 上的广告投放,了解竞品营销策略。
179
+
180
+ ```bash
181
+ scout reddit ads "earbuds" --format text
182
+ scout reddit ads "coffee" -i RETAIL_AND_ECOMMERCE
183
+ ```
184
+
185
+ **参数**:
186
+ - `<query>`:搜索关键词
187
+ - `-i, --industries`:行业筛选(可选)
188
+ - `-f, --format`:输出格式
189
+
190
+ **行业选项**:`RETAIL_AND_ECOMMERCE`, `TECH_B2B`, `TECH_B2C`, `GAMING`, `HEALTH_AND_BEAUTY`, `CONSUMER_PACKAGED_GOODS`, `FINANCIAL_SERVICES`, `EDUCATION`, `ENTERTAINMENT`, `EMPLOYMENT`, `AUTO`, `TRAVEL`, `REAL_ESTATE`
191
+
192
+ **返回数据**:广告列表(最多 30 条),含 `headline`、`body`、`industry`、`budgetCategory`(LOW/MEDIUM/HIGH)、`objective`、`profileName`
193
+
194
+ **分析重点**:
195
+ 1. HIGH 预算广告 = 该品类有大玩家在投入
196
+ 2. 多个广告主同一品类 = 市场竞争激烈
197
+ 3. 广告文案中的卖点 = 市场验证过的 USP
198
+ 4. CONVERSIONS 目标 = 直接带货型广告
199
+
200
+ ---
201
+
202
+ ## 典型工作流
203
+
204
+ ### 趋势预判:从 Reddit 话题到商机
205
+
206
+ ```bash
207
+ # 1. 一键发现趋势(全站 + 多版块聚合)
208
+ scout reddit trends "portable blender" --format text
209
+
210
+ # 2. 看到感兴趣的帖子,深入分析评论
211
+ scout reddit comments "https://www.reddit.com/r/..."
212
+
213
+ # 3. 看竞品在 Reddit 的广告投放
214
+ scout reddit ads "portable blender" -i RETAIL_AND_ECOMMERCE
215
+
216
+ # 4. 跨平台验证
217
+ scout search "portable blender" --limit 10 # Amazon 市场验证
218
+ scout supplier-search "便携式榨汁机" --limit 10 # 1688 供应商
219
+ ```
220
+
221
+ ### 版块深耕:监控特定社区
222
+
223
+ ```bash
224
+ # 1. 了解版块基本情况
225
+ scout reddit subreddit-info BuyItForLife --format text
226
+
227
+ # 2. 看当前热帖
228
+ scout reddit subreddit BuyItForLife --sort hot --format text
229
+
230
+ # 3. 搜索特定品类讨论
231
+ scout reddit search "backpack" -s top -t month --format text
232
+
233
+ # 4. 分析高互动帖子评论
234
+ scout reddit comments "<帖子URL>"
235
+ ```
236
+
237
+ ### 竞品广告分析
238
+
239
+ ```bash
240
+ # 1. 搜索品类广告
241
+ scout reddit ads "wireless earbuds" -i RETAIL_AND_ECOMMERCE --format text
242
+
243
+ # 2. 分析广告文案卖点 → 提炼差异化方向
244
+ # 3. 结合 Reddit 用户讨论发现未满足需求
245
+ scout reddit search "wireless earbuds problem" -s top -t month
246
+ ```
247
+
248
+ ---
249
+
250
+ ## 数据解读参考
251
+
252
+ ### 帖子热度判断
253
+
254
+ | 指标 | 高关注 | 中等 | 低关注 |
255
+ |------|--------|------|--------|
256
+ | Score | >500 | 50-500 | <50 |
257
+ | 评论数 | >100 | 20-100 | <20 |
258
+ | Upvote Ratio | >0.90 | 0.70-0.90 | <0.70 |
259
+
260
+ ### 版块活跃度判断
261
+
262
+ | 订阅者数 | 规模 |
263
+ |----------|------|
264
+ | >1M | 超大社区,趋势信号强 |
265
+ | 100K-1M | 活跃社区,垂直价值高 |
266
+ | 10K-100K | 小众社区,精准需求 |
267
+ | <10K | 新兴/冷门社区 |
268
+
269
+ ### 商机信号识别
270
+
271
+ | Reddit 信号 | 含义 | 下一步 |
272
+ |------------|------|--------|
273
+ | 多帖问 "best X for Y" | 品类有需求但用户迷茫 | Amazon 选品验证 |
274
+ | 高 score 吐槽帖 | 现有产品痛点明确 | 差异化产品机会 |
275
+ | "I wish..." 高频出现 | 未被满足的需求 | 产品创新方向 |
276
+ | 版块 rising 帖子暴涨 | 新兴趋势正在形成 | 快速入场窗口 |
277
+ | 竞品广告 HIGH 预算 | 品类利润空间大 | 成本分析 + 供应商 |
278
+
279
+ ---
280
+
281
+ ## 重要提醒
282
+
283
+ 1. **timeframe 限制**:`subreddit` 命令的 `--timeframe` 只在 `--sort top` 时有效,其他排序方式传 timeframe 会被自动忽略
284
+ 2. **广告数量上限**:`ads` 命令最多返回 30 条广告,无分页
285
+ 3. **评论分页**:单次最多返回 ~95 条评论,`hasMore=true` 表示还有更多
286
+ 4. **trends 命令成本**:每次调用消耗多个 API credit(1 + 2×版块数),默认 4 个版块 = 9 credits
287
+ 5. **版块名大小写敏感**:使用正确的大小写(如 `BuyItForLife` 而非 `buyitforlife`)
288
+ 6. **跨 Skill 联动**:Reddit 发现趋势 → scout search Amazon 验证 → scout supplier-search 找供应商 → TikTok/抖音验证社媒热度
File without changes
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import "@optima-chat/comfy-cli";
3
+ //# sourceMappingURL=comfy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comfy.d.ts","sourceRoot":"","sources":["../../bin/comfy.ts"],"names":[],"mappings":";AACA,OAAO,wBAAwB,CAAC"}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import "@optima-chat/comfy-cli";
3
+ //# sourceMappingURL=comfy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comfy.js","sourceRoot":"","sources":["../../bin/comfy.ts"],"names":[],"mappings":";AACA,OAAO,wBAAwB,CAAC"}
File without changes
File without changes
File without changes
package/dist/bin/scout.js CHANGED
File without changes
@@ -11,7 +11,7 @@ export declare class OptimaAgent {
11
11
  * @param prompt 用户输入
12
12
  * @param chatOptions 选项,包括 streamFormat: 'delta' | 'content'
13
13
  */
14
- chat(prompt: string, chatOptions?: ChatOptions): AsyncGenerator<import("@anthropic-ai/claude-agent-sdk").SDKUserMessage | import("@anthropic-ai/claude-agent-sdk").SDKAssistantMessage | import("@anthropic-ai/claude-agent-sdk").SDKResultSuccess | import("@anthropic-ai/claude-agent-sdk").SDKResultError | import("@anthropic-ai/claude-agent-sdk").SDKSystemMessage | import("@anthropic-ai/claude-agent-sdk").SDKPartialAssistantMessage | import("@anthropic-ai/claude-agent-sdk").SDKCompactBoundaryMessage | import("@anthropic-ai/claude-agent-sdk").SDKStatusMessage | import("@anthropic-ai/claude-agent-sdk").SDKLocalCommandOutputMessage | import("@anthropic-ai/claude-agent-sdk").SDKHookStartedMessage | import("@anthropic-ai/claude-agent-sdk").SDKHookProgressMessage | import("@anthropic-ai/claude-agent-sdk").SDKHookResponseMessage | import("@anthropic-ai/claude-agent-sdk").SDKToolProgressMessage | import("@anthropic-ai/claude-agent-sdk").SDKAuthStatusMessage | import("@anthropic-ai/claude-agent-sdk").SDKTaskNotificationMessage | import("@anthropic-ai/claude-agent-sdk").SDKTaskStartedMessage | import("@anthropic-ai/claude-agent-sdk").SDKTaskProgressMessage | import("@anthropic-ai/claude-agent-sdk").SDKFilesPersistedEvent | import("@anthropic-ai/claude-agent-sdk").SDKToolUseSummaryMessage | import("@anthropic-ai/claude-agent-sdk").SDKRateLimitEvent | import("@anthropic-ai/claude-agent-sdk").SDKElicitationCompleteMessage | import("@anthropic-ai/claude-agent-sdk").SDKPromptSuggestionMessage | {
14
+ chat(prompt: string, chatOptions?: ChatOptions): AsyncGenerator<import("@anthropic-ai/claude-agent-sdk").SDKUserMessage | import("@anthropic-ai/claude-agent-sdk").SDKAssistantMessage | import("@anthropic-ai/claude-agent-sdk").SDKResultSuccess | import("@anthropic-ai/claude-agent-sdk").SDKResultError | import("@anthropic-ai/claude-agent-sdk").SDKSystemMessage | import("@anthropic-ai/claude-agent-sdk").SDKPartialAssistantMessage | import("@anthropic-ai/claude-agent-sdk").SDKCompactBoundaryMessage | import("@anthropic-ai/claude-agent-sdk").SDKStatusMessage | import("@anthropic-ai/claude-agent-sdk").SDKAPIRetryMessage | import("@anthropic-ai/claude-agent-sdk").SDKLocalCommandOutputMessage | import("@anthropic-ai/claude-agent-sdk").SDKHookStartedMessage | import("@anthropic-ai/claude-agent-sdk").SDKHookProgressMessage | import("@anthropic-ai/claude-agent-sdk").SDKHookResponseMessage | import("@anthropic-ai/claude-agent-sdk").SDKToolProgressMessage | import("@anthropic-ai/claude-agent-sdk").SDKAuthStatusMessage | import("@anthropic-ai/claude-agent-sdk").SDKTaskNotificationMessage | import("@anthropic-ai/claude-agent-sdk").SDKTaskStartedMessage | import("@anthropic-ai/claude-agent-sdk").SDKTaskProgressMessage | import("@anthropic-ai/claude-agent-sdk").SDKFilesPersistedEvent | import("@anthropic-ai/claude-agent-sdk").SDKToolUseSummaryMessage | import("@anthropic-ai/claude-agent-sdk").SDKRateLimitEvent | import("@anthropic-ai/claude-agent-sdk").SDKElicitationCompleteMessage | import("@anthropic-ai/claude-agent-sdk").SDKPromptSuggestionMessage | {
15
15
  type: "text_delta";
16
16
  delta: {
17
17
  text: string;
@@ -0,0 +1,6 @@
1
+ import type { HooksConfig } from "./types.js";
2
+ /**
3
+ * 从 skills 目录加载所有 skill 的 hooks
4
+ */
5
+ export declare function loadSkillHooks(skillsDir: string, cwd: string, getSessionId: () => string | undefined): HooksConfig;
6
+ //# sourceMappingURL=hooks-loader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hooks-loader.d.ts","sourceRoot":"","sources":["../../src/hooks-loader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAgB,MAAM,YAAY,CAAC;AAwL5D;;GAEG;AACH,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EACjB,GAAG,EAAE,MAAM,EACX,YAAY,EAAE,MAAM,MAAM,GAAG,SAAS,GACrC,WAAW,CAiFb"}