@jackwener/opencli 1.6.0 → 1.6.2

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 (390) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/CONTRIBUTING.md +1 -1
  3. package/README.md +27 -45
  4. package/README.zh-CN.md +32 -34
  5. package/autoresearch/browse-tasks.json +18 -20
  6. package/autoresearch/commands/debug.ts +163 -0
  7. package/autoresearch/commands/fix.ts +145 -0
  8. package/autoresearch/commands/plan.ts +88 -0
  9. package/autoresearch/commands/run.ts +138 -0
  10. package/autoresearch/config.ts +82 -0
  11. package/autoresearch/engine.ts +359 -0
  12. package/autoresearch/eval-all.ts +127 -0
  13. package/autoresearch/eval-browse.ts +1 -1
  14. package/autoresearch/eval-publish.ts +238 -0
  15. package/autoresearch/eval-save.ts +249 -0
  16. package/autoresearch/eval-skill.ts +14 -8
  17. package/autoresearch/eval-v2ex.ts +220 -0
  18. package/autoresearch/eval-zhihu.ts +230 -0
  19. package/autoresearch/logger.ts +69 -0
  20. package/autoresearch/presets/combined-reliability.ts +27 -0
  21. package/autoresearch/presets/index.ts +23 -0
  22. package/autoresearch/presets/operate-reliability.ts +24 -0
  23. package/autoresearch/presets/save-reliability.ts +26 -0
  24. package/autoresearch/presets/skill-quality.ts +20 -0
  25. package/autoresearch/presets/v2ex-reliability.ts +24 -0
  26. package/autoresearch/presets/zhihu-reliability.ts +25 -0
  27. package/autoresearch/publish-tasks.json +345 -0
  28. package/autoresearch/run-save.sh +11 -0
  29. package/autoresearch/save-adapters/xhs-explore-deep.ts +64 -0
  30. package/autoresearch/save-adapters/xhs-note-comments.ts +61 -0
  31. package/autoresearch/save-adapters/xhs-search-full.ts +62 -0
  32. package/autoresearch/save-adapters/zhihu-hot-detail.ts +52 -0
  33. package/autoresearch/save-adapters/zhihu-question-full.ts +57 -0
  34. package/autoresearch/save-adapters/zhihu-search-detail.ts +53 -0
  35. package/autoresearch/save-tasks.json +281 -0
  36. package/autoresearch/v2ex-tasks.json +899 -0
  37. package/autoresearch/zhihu-tasks.json +848 -0
  38. package/bun.lock +615 -0
  39. package/dist/browser/base-page.d.ts +4 -2
  40. package/dist/browser/base-page.js +37 -4
  41. package/dist/browser/bridge.js +10 -8
  42. package/dist/browser/cdp.js +2 -6
  43. package/dist/browser/daemon-client.d.ts +11 -1
  44. package/dist/browser/daemon-client.js +3 -0
  45. package/dist/browser/dom-helpers.d.ts +4 -2
  46. package/dist/browser/dom-helpers.js +42 -31
  47. package/dist/browser/dom-snapshot.js +23 -1
  48. package/dist/browser/page.d.ts +7 -2
  49. package/dist/browser/page.js +112 -30
  50. package/dist/browser.test.js +1 -1
  51. package/dist/build-manifest.d.ts +1 -0
  52. package/dist/build-manifest.js +1 -0
  53. package/dist/cli-manifest.json +1133 -182
  54. package/dist/cli.d.ts +2 -0
  55. package/dist/cli.js +48 -7
  56. package/dist/cli.test.d.ts +1 -0
  57. package/dist/cli.test.js +88 -0
  58. package/dist/clis/1688/item.d.ts +70 -0
  59. package/dist/clis/1688/item.js +187 -0
  60. package/dist/clis/1688/item.test.d.ts +1 -0
  61. package/dist/clis/1688/item.test.js +67 -0
  62. package/dist/clis/1688/search.d.ts +56 -0
  63. package/dist/clis/1688/search.js +309 -0
  64. package/dist/clis/1688/search.test.d.ts +1 -0
  65. package/dist/clis/1688/search.test.js +75 -0
  66. package/dist/clis/1688/shared.d.ts +112 -0
  67. package/dist/clis/1688/shared.js +514 -0
  68. package/dist/clis/1688/shared.test.d.ts +1 -0
  69. package/dist/clis/1688/shared.test.js +57 -0
  70. package/dist/clis/1688/store.d.ts +45 -0
  71. package/dist/clis/1688/store.js +226 -0
  72. package/dist/clis/1688/store.test.d.ts +1 -0
  73. package/dist/clis/1688/store.test.js +62 -0
  74. package/dist/clis/amazon/bestsellers.d.ts +0 -20
  75. package/dist/clis/amazon/bestsellers.js +6 -129
  76. package/dist/clis/amazon/bestsellers.test.js +12 -3
  77. package/dist/clis/amazon/movers-shakers.d.ts +1 -0
  78. package/dist/clis/amazon/movers-shakers.js +7 -0
  79. package/dist/clis/amazon/new-releases.d.ts +1 -0
  80. package/dist/clis/amazon/new-releases.js +7 -0
  81. package/dist/clis/amazon/rankings.d.ts +59 -0
  82. package/dist/clis/amazon/rankings.js +226 -0
  83. package/dist/clis/amazon/rankings.test.d.ts +1 -0
  84. package/dist/clis/amazon/rankings.test.js +41 -0
  85. package/dist/clis/amazon/shared.d.ts +11 -0
  86. package/dist/clis/amazon/shared.js +121 -11
  87. package/dist/clis/amazon/shared.test.js +11 -0
  88. package/dist/clis/bilibili/comments.js +2 -2
  89. package/dist/clis/bilibili/comments.test.js +3 -2
  90. package/dist/clis/bilibili/download.js +2 -1
  91. package/dist/clis/bilibili/subtitle.js +4 -3
  92. package/dist/clis/bilibili/subtitle.test.js +2 -1
  93. package/dist/clis/bilibili/utils.d.ts +5 -0
  94. package/dist/clis/bilibili/utils.js +30 -0
  95. package/dist/clis/bilibili/utils.test.d.ts +1 -0
  96. package/dist/clis/bilibili/utils.test.js +17 -0
  97. package/dist/clis/douban/marks.js +1 -1
  98. package/dist/clis/douban/subject.yaml +50 -19
  99. package/dist/clis/doubao/utils.js +32 -12
  100. package/dist/clis/douyin/_shared/browser-fetch.test.js +0 -1
  101. package/dist/clis/douyin/_shared/transcode.test.js +0 -2
  102. package/dist/clis/douyin/draft.test.js +0 -2
  103. package/dist/clis/facebook/search.test.js +0 -2
  104. package/dist/clis/gemini/ask.js +9 -3
  105. package/dist/clis/gemini/ask.test.d.ts +1 -0
  106. package/dist/clis/gemini/ask.test.js +100 -0
  107. package/dist/clis/gemini/reply-state.test.d.ts +1 -0
  108. package/dist/clis/gemini/reply-state.test.js +641 -0
  109. package/dist/clis/gemini/utils.d.ts +44 -1
  110. package/dist/clis/gemini/utils.js +528 -61
  111. package/dist/clis/gemini/utils.test.js +149 -2
  112. package/dist/clis/hupu/detail.d.ts +1 -0
  113. package/dist/clis/hupu/detail.js +72 -0
  114. package/dist/clis/hupu/hot.yaml +43 -0
  115. package/dist/clis/hupu/like.d.ts +1 -0
  116. package/dist/clis/hupu/like.js +75 -0
  117. package/dist/clis/hupu/reply.d.ts +1 -0
  118. package/dist/clis/hupu/reply.js +71 -0
  119. package/dist/clis/hupu/search.d.ts +1 -0
  120. package/dist/clis/hupu/search.js +59 -0
  121. package/dist/clis/hupu/unlike.d.ts +1 -0
  122. package/dist/clis/hupu/unlike.js +75 -0
  123. package/dist/clis/hupu/utils.d.ts +20 -0
  124. package/dist/clis/hupu/utils.js +319 -0
  125. package/dist/clis/instagram/_shared/private-publish.d.ts +138 -0
  126. package/dist/clis/instagram/_shared/private-publish.js +1030 -0
  127. package/dist/clis/instagram/_shared/private-publish.test.d.ts +1 -0
  128. package/dist/clis/instagram/_shared/private-publish.test.js +705 -0
  129. package/dist/clis/instagram/_shared/protocol-capture.d.ts +26 -0
  130. package/dist/clis/instagram/_shared/protocol-capture.js +282 -0
  131. package/dist/clis/instagram/_shared/protocol-capture.test.d.ts +1 -0
  132. package/dist/clis/instagram/_shared/protocol-capture.test.js +114 -0
  133. package/dist/clis/instagram/_shared/runtime-info.d.ts +9 -0
  134. package/dist/clis/instagram/_shared/runtime-info.js +81 -0
  135. package/dist/clis/instagram/note.d.ts +1 -0
  136. package/dist/clis/instagram/note.js +222 -0
  137. package/dist/clis/instagram/note.test.d.ts +1 -0
  138. package/dist/clis/instagram/note.test.js +81 -0
  139. package/dist/clis/instagram/post.d.ts +4 -0
  140. package/dist/clis/instagram/post.js +1496 -0
  141. package/dist/clis/instagram/post.test.d.ts +1 -0
  142. package/dist/clis/instagram/post.test.js +1647 -0
  143. package/dist/clis/instagram/reel.d.ts +1 -0
  144. package/dist/clis/instagram/reel.js +826 -0
  145. package/dist/clis/instagram/reel.test.d.ts +1 -0
  146. package/dist/clis/instagram/reel.test.js +167 -0
  147. package/dist/clis/instagram/story.d.ts +1 -0
  148. package/dist/clis/instagram/story.js +115 -0
  149. package/dist/clis/instagram/story.test.d.ts +1 -0
  150. package/dist/clis/instagram/story.test.js +167 -0
  151. package/dist/clis/sinafinance/stock-rank.d.ts +4 -0
  152. package/dist/clis/sinafinance/stock-rank.js +65 -0
  153. package/dist/clis/substack/utils.test.js +0 -2
  154. package/dist/clis/twitter/post.js +72 -45
  155. package/dist/clis/twitter/post.test.d.ts +1 -0
  156. package/dist/clis/twitter/post.test.js +116 -0
  157. package/dist/clis/twitter/reply.d.ts +12 -0
  158. package/dist/clis/twitter/reply.js +257 -35
  159. package/dist/clis/twitter/reply.test.d.ts +1 -0
  160. package/dist/clis/twitter/reply.test.js +151 -0
  161. package/dist/clis/twitter/search.js +67 -5
  162. package/dist/clis/twitter/search.test.js +83 -5
  163. package/dist/clis/xianyu/chat.d.ts +7 -0
  164. package/dist/clis/xianyu/chat.js +146 -0
  165. package/dist/clis/xianyu/chat.test.d.ts +1 -0
  166. package/dist/clis/xianyu/chat.test.js +15 -0
  167. package/dist/clis/xianyu/item.d.ts +7 -0
  168. package/dist/clis/xianyu/item.js +152 -0
  169. package/dist/clis/xianyu/item.test.d.ts +1 -0
  170. package/dist/clis/xianyu/item.test.js +56 -0
  171. package/dist/clis/xianyu/search.d.ts +10 -0
  172. package/dist/clis/xianyu/search.js +134 -0
  173. package/dist/clis/xianyu/search.test.d.ts +1 -0
  174. package/dist/clis/xianyu/search.test.js +17 -0
  175. package/dist/clis/xianyu/utils.d.ts +1 -0
  176. package/dist/clis/xianyu/utils.js +8 -0
  177. package/dist/clis/xiaoe/catalog.yaml +129 -0
  178. package/dist/clis/xiaoe/content.yaml +43 -0
  179. package/dist/clis/xiaoe/courses.yaml +73 -0
  180. package/dist/clis/xiaoe/detail.yaml +39 -0
  181. package/dist/clis/xiaoe/play-url.yaml +124 -0
  182. package/dist/clis/xiaohongshu/comments.test.js +0 -2
  183. package/dist/clis/xiaohongshu/creator-note-detail.test.js +0 -2
  184. package/dist/clis/xiaohongshu/creator-notes.test.js +0 -2
  185. package/dist/clis/xiaohongshu/download.test.js +0 -2
  186. package/dist/clis/xiaohongshu/note.test.js +0 -2
  187. package/dist/clis/xiaohongshu/publish.test.js +0 -2
  188. package/dist/clis/xiaohongshu/search.js +29 -20
  189. package/dist/clis/xiaohongshu/search.test.js +56 -48
  190. package/dist/clis/yuanbao/ask.d.ts +21 -0
  191. package/dist/clis/yuanbao/ask.js +427 -0
  192. package/dist/clis/yuanbao/ask.test.d.ts +1 -0
  193. package/dist/clis/yuanbao/ask.test.js +124 -0
  194. package/dist/clis/yuanbao/new.d.ts +1 -0
  195. package/dist/clis/yuanbao/new.js +70 -0
  196. package/dist/clis/yuanbao/new.test.d.ts +1 -0
  197. package/dist/clis/yuanbao/new.test.js +30 -0
  198. package/dist/clis/yuanbao/shared.d.ts +13 -0
  199. package/dist/clis/yuanbao/shared.js +49 -0
  200. package/dist/clis/zhihu/question.js +30 -19
  201. package/dist/clis/zhihu/question.test.js +34 -16
  202. package/dist/commanderAdapter.js +8 -4
  203. package/dist/commanderAdapter.test.js +42 -0
  204. package/dist/completion.js +3 -1
  205. package/dist/completion.test.d.ts +1 -0
  206. package/dist/completion.test.js +23 -0
  207. package/dist/doctor.js +1 -1
  208. package/dist/electron-apps.d.ts +2 -0
  209. package/dist/electron-apps.js +7 -1
  210. package/dist/errors.js +1 -1
  211. package/dist/execution.js +25 -35
  212. package/dist/explore.js +1 -1
  213. package/dist/launcher.d.ts +4 -0
  214. package/dist/launcher.js +64 -8
  215. package/dist/launcher.test.js +88 -7
  216. package/dist/output.d.ts +2 -0
  217. package/dist/output.js +10 -1
  218. package/dist/output.test.d.ts +0 -3
  219. package/dist/output.test.js +59 -92
  220. package/dist/pipeline/executor.test.js +0 -2
  221. package/dist/pipeline/steps/download.test.js +0 -2
  222. package/dist/registry.d.ts +2 -0
  223. package/dist/serialization.d.ts +1 -0
  224. package/dist/serialization.js +1 -0
  225. package/dist/types.d.ts +9 -2
  226. package/docs/.vitepress/config.mts +4 -0
  227. package/docs/adapters/browser/1688.md +52 -0
  228. package/docs/adapters/browser/36kr.md +2 -1
  229. package/docs/adapters/browser/doubao.md +5 -1
  230. package/docs/adapters/browser/hupu.md +53 -0
  231. package/docs/adapters/browser/sinafinance.md +32 -2
  232. package/docs/adapters/browser/weibo.md +6 -1
  233. package/docs/adapters/browser/wikipedia.md +2 -0
  234. package/docs/adapters/browser/xianyu.md +42 -0
  235. package/docs/adapters/browser/xiaoe.md +44 -0
  236. package/docs/adapters/browser/yuanbao.md +64 -0
  237. package/docs/adapters/index.md +14 -5
  238. package/docs/comparison.md +1 -1
  239. package/docs/developer/ai-workflow.md +2 -2
  240. package/docs/developer/contributing.md +1 -1
  241. package/docs/developer/testing.md +2 -0
  242. package/docs/guide/plugins.md +1 -0
  243. package/docs/guide/troubleshooting.md +11 -0
  244. package/docs/superpowers/specs/2026-04-03-v2ex-autoresearch-design.md +41 -0
  245. package/docs/zh/guide/plugins.md +1 -0
  246. package/extension/dist/background.js +1127 -0
  247. package/extension/src/background.test.ts +39 -0
  248. package/extension/src/background.ts +223 -34
  249. package/extension/src/cdp.ts +194 -4
  250. package/extension/src/protocol.ts +22 -1
  251. package/package.json +3 -2
  252. package/scripts/postinstall.js +1 -1
  253. package/skills/opencli-explorer/SKILL.md +1 -1
  254. package/skills/opencli-oneshot/SKILL.md +2 -2
  255. package/skills/opencli-operate/SKILL.md +120 -27
  256. package/skills/opencli-usage/SKILL.md +31 -20
  257. package/skills/opencli-usage/browser.md +114 -16
  258. package/skills/opencli-usage/public-api.md +32 -3
  259. package/skills/smart-search/SKILL.md +156 -0
  260. package/skills/smart-search/references/sources-ai.md +74 -0
  261. package/skills/smart-search/references/sources-info.md +43 -0
  262. package/skills/smart-search/references/sources-media.md +50 -0
  263. package/skills/smart-search/references/sources-other.md +42 -0
  264. package/skills/smart-search/references/sources-shopping.md +31 -0
  265. package/skills/smart-search/references/sources-social.md +51 -0
  266. package/skills/smart-search/references/sources-tech.md +42 -0
  267. package/skills/smart-search/references/sources-travel.md +20 -0
  268. package/src/browser/base-page.ts +41 -6
  269. package/src/browser/bridge.ts +11 -8
  270. package/src/browser/cdp.ts +1 -8
  271. package/src/browser/daemon-client.ts +11 -1
  272. package/src/browser/dom-helpers.ts +43 -31
  273. package/src/browser/dom-snapshot.ts +23 -1
  274. package/src/browser/page.ts +115 -31
  275. package/src/browser.test.ts +1 -1
  276. package/src/build-manifest.ts +2 -0
  277. package/src/cli.test.ts +133 -0
  278. package/src/cli.ts +73 -11
  279. package/src/clis/1688/item.test.ts +69 -0
  280. package/src/clis/1688/item.ts +282 -0
  281. package/src/clis/1688/search.test.ts +81 -0
  282. package/src/clis/1688/search.ts +402 -0
  283. package/src/clis/1688/shared.test.ts +75 -0
  284. package/src/clis/1688/shared.ts +623 -0
  285. package/src/clis/1688/store.test.ts +69 -0
  286. package/src/clis/1688/store.ts +300 -0
  287. package/src/clis/amazon/bestsellers.test.ts +12 -3
  288. package/src/clis/amazon/bestsellers.ts +6 -178
  289. package/src/clis/amazon/movers-shakers.ts +8 -0
  290. package/src/clis/amazon/new-releases.ts +8 -0
  291. package/src/clis/amazon/rankings.test.ts +47 -0
  292. package/src/clis/amazon/rankings.ts +312 -0
  293. package/src/clis/amazon/shared.test.ts +16 -0
  294. package/src/clis/amazon/shared.ts +134 -12
  295. package/src/clis/bilibili/comments.test.ts +4 -3
  296. package/src/clis/bilibili/comments.ts +2 -2
  297. package/src/clis/bilibili/download.ts +2 -1
  298. package/src/clis/bilibili/subtitle.test.ts +2 -1
  299. package/src/clis/bilibili/subtitle.ts +4 -3
  300. package/src/clis/bilibili/utils.test.ts +21 -0
  301. package/src/clis/bilibili/utils.ts +27 -0
  302. package/src/clis/douban/marks.ts +1 -1
  303. package/src/clis/douban/subject.yaml +50 -19
  304. package/src/clis/doubao/utils.ts +32 -12
  305. package/src/clis/douyin/_shared/browser-fetch.test.ts +0 -1
  306. package/src/clis/douyin/_shared/transcode.test.ts +0 -2
  307. package/src/clis/douyin/draft.test.ts +0 -2
  308. package/src/clis/facebook/search.test.ts +0 -2
  309. package/src/clis/gemini/ask.test.ts +116 -0
  310. package/src/clis/gemini/ask.ts +10 -3
  311. package/src/clis/gemini/reply-state.test.ts +708 -0
  312. package/src/clis/gemini/utils.test.ts +184 -2
  313. package/src/clis/gemini/utils.ts +588 -60
  314. package/src/clis/hupu/detail.ts +126 -0
  315. package/src/clis/hupu/hot.yaml +43 -0
  316. package/src/clis/hupu/like.ts +76 -0
  317. package/src/clis/hupu/reply.ts +76 -0
  318. package/src/clis/hupu/search.ts +95 -0
  319. package/src/clis/hupu/unlike.ts +76 -0
  320. package/src/clis/hupu/utils.ts +381 -0
  321. package/src/clis/instagram/_shared/private-publish.test.ts +827 -0
  322. package/src/clis/instagram/_shared/private-publish.ts +1303 -0
  323. package/src/clis/instagram/_shared/protocol-capture.test.ts +148 -0
  324. package/src/clis/instagram/_shared/protocol-capture.ts +321 -0
  325. package/src/clis/instagram/_shared/runtime-info.ts +91 -0
  326. package/src/clis/instagram/note.test.ts +96 -0
  327. package/src/clis/instagram/note.ts +254 -0
  328. package/src/clis/instagram/post.test.ts +1716 -0
  329. package/src/clis/instagram/post.ts +1620 -0
  330. package/src/clis/instagram/reel.test.ts +191 -0
  331. package/src/clis/instagram/reel.ts +886 -0
  332. package/src/clis/instagram/story.test.ts +191 -0
  333. package/src/clis/instagram/story.ts +151 -0
  334. package/src/clis/sinafinance/stock-rank.ts +68 -0
  335. package/src/clis/substack/utils.test.ts +0 -2
  336. package/src/clis/twitter/post.test.ts +157 -0
  337. package/src/clis/twitter/post.ts +82 -48
  338. package/src/clis/twitter/reply.test.ts +177 -0
  339. package/src/clis/twitter/reply.ts +285 -39
  340. package/src/clis/twitter/search.test.ts +88 -5
  341. package/src/clis/twitter/search.ts +68 -5
  342. package/src/clis/xianyu/chat.test.ts +20 -0
  343. package/src/clis/xianyu/chat.ts +175 -0
  344. package/src/clis/xianyu/item.test.ts +67 -0
  345. package/src/clis/xianyu/item.ts +172 -0
  346. package/src/clis/xianyu/search.test.ts +22 -0
  347. package/src/clis/xianyu/search.ts +151 -0
  348. package/src/clis/xianyu/utils.ts +9 -0
  349. package/src/clis/xiaoe/catalog.yaml +129 -0
  350. package/src/clis/xiaoe/content.yaml +43 -0
  351. package/src/clis/xiaoe/courses.yaml +73 -0
  352. package/src/clis/xiaoe/detail.yaml +39 -0
  353. package/src/clis/xiaoe/play-url.yaml +124 -0
  354. package/src/clis/xiaohongshu/comments.test.ts +0 -2
  355. package/src/clis/xiaohongshu/creator-note-detail.test.ts +0 -2
  356. package/src/clis/xiaohongshu/creator-notes.test.ts +0 -2
  357. package/src/clis/xiaohongshu/download.test.ts +0 -2
  358. package/src/clis/xiaohongshu/note.test.ts +0 -2
  359. package/src/clis/xiaohongshu/publish.test.ts +0 -2
  360. package/src/clis/xiaohongshu/search.test.ts +59 -48
  361. package/src/clis/xiaohongshu/search.ts +31 -21
  362. package/src/clis/yuanbao/ask.test.ts +156 -0
  363. package/src/clis/yuanbao/ask.ts +522 -0
  364. package/src/clis/yuanbao/new.test.ts +36 -0
  365. package/src/clis/yuanbao/new.ts +81 -0
  366. package/src/clis/yuanbao/shared.ts +57 -0
  367. package/src/clis/zhihu/question.test.ts +42 -17
  368. package/src/clis/zhihu/question.ts +31 -26
  369. package/src/commanderAdapter.test.ts +51 -0
  370. package/src/commanderAdapter.ts +8 -4
  371. package/src/completion.test.ts +30 -0
  372. package/src/completion.ts +3 -1
  373. package/src/doctor.ts +1 -1
  374. package/src/electron-apps.ts +9 -1
  375. package/src/errors.ts +1 -1
  376. package/src/execution.ts +26 -30
  377. package/src/explore.ts +1 -1
  378. package/src/launcher.test.ts +121 -7
  379. package/src/launcher.ts +87 -9
  380. package/src/output.test.ts +50 -90
  381. package/src/output.ts +10 -1
  382. package/src/pipeline/executor.test.ts +0 -2
  383. package/src/pipeline/steps/download.test.ts +0 -2
  384. package/src/registry.ts +2 -0
  385. package/src/serialization.ts +2 -0
  386. package/src/types.ts +9 -2
  387. package/tests/e2e/browser-auth.test.ts +9 -0
  388. package/CLI-EXPLORER.md +0 -724
  389. package/CLI-ONESHOT.md +0 -216
  390. package/SKILL.md +0 -59
@@ -0,0 +1,899 @@
1
+ [
2
+ {
3
+ "_comment": "=== Layer 1: Atomic Operations (10 tasks) ==="
4
+ },
5
+ {
6
+ "name": "v2ex-open-home",
7
+ "steps": [
8
+ "opencli operate open https://v2ex.com/"
9
+ ],
10
+ "judge": {
11
+ "type": "contains",
12
+ "value": "Navigated to"
13
+ }
14
+ },
15
+ {
16
+ "name": "v2ex-state-home",
17
+ "steps": [
18
+ "opencli operate open https://v2ex.com/",
19
+ "opencli operate state"
20
+ ],
21
+ "judge": {
22
+ "type": "matchesPattern",
23
+ "pattern": "\\[\\d+\\]"
24
+ }
25
+ },
26
+ {
27
+ "name": "v2ex-get-title",
28
+ "steps": [
29
+ "opencli operate open https://v2ex.com/",
30
+ "opencli operate eval \"document.title\""
31
+ ],
32
+ "judge": {
33
+ "type": "contains",
34
+ "value": "V2EX"
35
+ }
36
+ },
37
+ {
38
+ "name": "v2ex-click-tab",
39
+ "steps": [
40
+ "opencli operate open https://v2ex.com/",
41
+ "opencli operate eval \"(() => { const a = document.querySelector('a[href=\\\"/?tab=tech\\\"]'); if(a){a.click(); return 'clicked';} return 'not found'; })()\""
42
+ ],
43
+ "judge": {
44
+ "type": "contains",
45
+ "value": "clicked"
46
+ }
47
+ },
48
+ {
49
+ "name": "v2ex-scroll-down",
50
+ "steps": [
51
+ "opencli operate open https://v2ex.com/",
52
+ "opencli operate scroll down --amount 500",
53
+ "opencli operate eval \"window.scrollY > 100 ? 'scrolled' : 'not scrolled'\""
54
+ ],
55
+ "judge": {
56
+ "type": "contains",
57
+ "value": "scrolled"
58
+ }
59
+ },
60
+ {
61
+ "name": "v2ex-get-first-topic-text",
62
+ "steps": [
63
+ "opencli operate open https://v2ex.com/",
64
+ "opencli operate eval \"document.querySelector('a[href^=\\\"/t/\\\"]')?.textContent?.trim()\""
65
+ ],
66
+ "judge": {
67
+ "type": "nonEmpty"
68
+ }
69
+ },
70
+ {
71
+ "name": "v2ex-eval-extract-titles",
72
+ "steps": [
73
+ "opencli operate open https://v2ex.com/",
74
+ "opencli operate eval \"JSON.stringify([...document.querySelectorAll('a[href^=\\\"/t/\\\"]')].slice(0,5).map(a=>a.textContent.trim()).filter(t=>t.length>2))\""
75
+ ],
76
+ "judge": {
77
+ "type": "arrayMinLength",
78
+ "minLength": 3
79
+ }
80
+ },
81
+ {
82
+ "name": "v2ex-get-url",
83
+ "steps": [
84
+ "opencli operate open https://v2ex.com/",
85
+ "opencli operate get url"
86
+ ],
87
+ "judge": {
88
+ "type": "contains",
89
+ "value": "v2ex.com"
90
+ }
91
+ },
92
+ {
93
+ "name": "v2ex-back-navigation",
94
+ "steps": [
95
+ "opencli operate open https://v2ex.com/",
96
+ "opencli operate open https://v2ex.com/go/programmer",
97
+ "opencli operate back",
98
+ "opencli operate get url"
99
+ ],
100
+ "judge": {
101
+ "type": "matchesPattern",
102
+ "pattern": "v2ex\\.com/?$"
103
+ }
104
+ },
105
+ {
106
+ "name": "v2ex-wait-page-load",
107
+ "steps": [
108
+ "opencli operate open https://v2ex.com/",
109
+ "opencli operate wait selector \"a[href^='/t/']\"",
110
+ "opencli operate eval \"document.querySelectorAll('a[href^=\\\"/t/\\\"]').length > 0 ? 'loaded' : 'empty'\""
111
+ ],
112
+ "judge": {
113
+ "type": "contains",
114
+ "value": "loaded"
115
+ }
116
+ },
117
+ {
118
+ "_comment": "=== Layer 2: Single Page Tasks (10 tasks) ==="
119
+ },
120
+ {
121
+ "name": "v2ex-hot-topics",
122
+ "steps": [
123
+ "opencli operate open https://v2ex.com/?tab=hot",
124
+ "opencli operate eval \"JSON.stringify([...document.querySelectorAll('a[href^=\\\"/t/\\\"]')].slice(0,10).map(a=>({title:a.textContent.trim(),url:a.href})).filter(t=>t.title.length>2))\""
125
+ ],
126
+ "judge": {
127
+ "type": "arrayMinLength",
128
+ "minLength": 5
129
+ }
130
+ },
131
+ {
132
+ "name": "v2ex-node-list",
133
+ "steps": [
134
+ "opencli operate open https://v2ex.com/",
135
+ "opencli operate eval \"JSON.stringify([...document.querySelectorAll('a[href^=\\\"/go/\\\"]')].map(a=>a.textContent.trim()).filter(t=>t.length>0))\""
136
+ ],
137
+ "judge": {
138
+ "type": "arrayMinLength",
139
+ "minLength": 10
140
+ }
141
+ },
142
+ {
143
+ "name": "v2ex-topic-meta",
144
+ "steps": [
145
+ "opencli operate open https://v2ex.com/go/programmer",
146
+ "opencli operate eval \"(()=>{const a=document.querySelector('a[href^=\\\"/t/\\\"]');const href=a?.href;return href||'';})()\"",
147
+ "opencli operate eval \"(()=>{const links=[...document.querySelectorAll('a[href^=\\\"/t/\\\"]')];const first=links[0];if(!first)return JSON.stringify({error:'no topic'});const title=first.textContent.trim();const row=first.closest('tr')||first.parentElement;const author=row?.querySelector('a[href^=\\\"/member/\\\"]')?.textContent?.trim()||'';return JSON.stringify({title,author});})()\" "
148
+ ],
149
+ "judge": {
150
+ "type": "matchesPattern",
151
+ "pattern": "\"title\":"
152
+ }
153
+ },
154
+ {
155
+ "name": "v2ex-node-topics",
156
+ "steps": [
157
+ "opencli operate open https://v2ex.com/go/python",
158
+ "opencli operate eval \"JSON.stringify([...document.querySelectorAll('a[href^=\\\"/t/\\\"]')].slice(0,5).map(a=>a.textContent.trim()).filter(t=>t.length>2))\""
159
+ ],
160
+ "judge": {
161
+ "type": "arrayMinLength",
162
+ "minLength": 3
163
+ }
164
+ },
165
+ {
166
+ "name": "v2ex-node-pagination-info",
167
+ "steps": [
168
+ "opencli operate open https://v2ex.com/go/programmer",
169
+ "opencli operate eval \"(()=>{const pages=[...document.querySelectorAll('a[href*=\\\"?p=\\\"]')];if(pages.length===0)return'no pagination';const nums=pages.map(a=>{const m=a.href.match(/p=(\\d+)/);return m?parseInt(m[1]):0}).filter(n=>n>0);return JSON.stringify({pages:nums.length,max:Math.max(...nums)});})()\" "
170
+ ],
171
+ "judge": {
172
+ "type": "matchesPattern",
173
+ "pattern": "\"max\":\\d+"
174
+ }
175
+ },
176
+ {
177
+ "name": "v2ex-tab-content",
178
+ "steps": [
179
+ "opencli operate open https://v2ex.com/?tab=jobs",
180
+ "opencli operate eval \"JSON.stringify([...document.querySelectorAll('a[href^=\\\"/t/\\\"]')].slice(0,5).map(a=>a.textContent.trim()).filter(t=>t.length>2))\""
181
+ ],
182
+ "judge": {
183
+ "type": "arrayMinLength",
184
+ "minLength": 3
185
+ }
186
+ },
187
+ {
188
+ "name": "v2ex-topic-replies-extract",
189
+ "steps": [
190
+ "opencli operate open https://v2ex.com/go/programmer",
191
+ "opencli operate eval \"(()=>{const link=document.querySelector('a[href^=\\\"/t/\\\"]');if(!link)return'';return link.href;})()\"",
192
+ "opencli operate eval \"(()=>{const link=document.querySelector('a[href^=\\\"/t/\\\"]');if(link)window.location.href=link.href;return'navigating';})()\"",
193
+ "opencli operate wait time 2",
194
+ "opencli operate eval \"JSON.stringify([...document.querySelectorAll('.reply_content')].slice(0,5).map(el=>el.textContent.trim().slice(0,100)))\""
195
+ ],
196
+ "judge": {
197
+ "type": "nonEmpty"
198
+ }
199
+ },
200
+ {
201
+ "name": "v2ex-topic-reply-count",
202
+ "steps": [
203
+ "opencli operate open https://v2ex.com/?tab=hot",
204
+ "opencli operate eval \"(()=>{const counts=[...document.querySelectorAll('a[class*=\\\"count\\\"]')].map(a=>parseInt(a.textContent)).filter(n=>!isNaN(n));return JSON.stringify(counts.slice(0,10));})()\" "
205
+ ],
206
+ "judge": {
207
+ "type": "arrayMinLength",
208
+ "minLength": 3
209
+ }
210
+ },
211
+ {
212
+ "name": "v2ex-member-info",
213
+ "steps": [
214
+ "opencli operate open https://v2ex.com/member/Livid",
215
+ "opencli operate eval \"(()=>{const name=document.querySelector('h1')?.textContent?.trim();const bio=document.querySelector('.bigger')?.textContent?.trim()||'';return JSON.stringify({name,bio});})()\" "
216
+ ],
217
+ "judge": {
218
+ "type": "contains",
219
+ "value": "Livid"
220
+ }
221
+ },
222
+ {
223
+ "name": "v2ex-search-results",
224
+ "steps": [
225
+ "opencli operate open https://www.google.com/search?q=site:v2ex.com+TypeScript",
226
+ "opencli operate eval \"JSON.stringify([...document.querySelectorAll('h3')].slice(0,5).map(h=>h.textContent.trim()))\""
227
+ ],
228
+ "judge": {
229
+ "type": "arrayMinLength",
230
+ "minLength": 2
231
+ }
232
+ },
233
+ {
234
+ "_comment": "=== Layer 3: Multi-Step (10 tasks) ==="
235
+ },
236
+ {
237
+ "name": "v2ex-click-topic-read",
238
+ "steps": [
239
+ "opencli operate open https://v2ex.com/?tab=hot",
240
+ "opencli operate state",
241
+ "opencli operate eval \"(()=>{const a=document.querySelector('a[href^=\\\"/t/\\\"]');if(a){a.click();return 'clicked '+a.textContent.trim().slice(0,30);}return 'not found';})()\"",
242
+ "opencli operate wait time 2",
243
+ "opencli operate eval \"document.querySelector('.topic_content,.markdown_body')?.textContent?.trim()?.slice(0,200)||document.title\""
244
+ ],
245
+ "judge": {
246
+ "type": "nonEmpty"
247
+ }
248
+ },
249
+ {
250
+ "name": "v2ex-click-author-profile",
251
+ "steps": [
252
+ "opencli operate open https://v2ex.com/?tab=hot",
253
+ "opencli operate eval \"(()=>{const a=document.querySelector('a[href^=\\\"/member/\\\"]');if(a){const name=a.textContent.trim();a.click();return name;}return'not found';})()\"",
254
+ "opencli operate wait time 2",
255
+ "opencli operate eval \"(()=>{const h1=document.querySelector('h1');const joined=document.querySelector('.gray')?.textContent||'';return JSON.stringify({name:h1?.textContent?.trim(),info:joined.slice(0,100)});})()\" "
256
+ ],
257
+ "judge": {
258
+ "type": "matchesPattern",
259
+ "pattern": "\"name\":"
260
+ }
261
+ },
262
+ {
263
+ "name": "v2ex-navigate-node-from-home",
264
+ "steps": [
265
+ "opencli operate open https://v2ex.com/",
266
+ "opencli operate eval \"(()=>{const a=document.querySelector('a[href=\\\"/go/programmer\\\"]')||document.querySelector('a[href^=\\\"/go/\\\"]');if(a){a.click();return 'clicked '+a.textContent.trim();}return'not found';})()\"",
267
+ "opencli operate wait time 2",
268
+ "opencli operate eval \"JSON.stringify([...document.querySelectorAll('a[href^=\\\"/t/\\\"]')].slice(0,5).map(a=>a.textContent.trim()).filter(t=>t.length>2))\""
269
+ ],
270
+ "judge": {
271
+ "type": "arrayMinLength",
272
+ "minLength": 3
273
+ }
274
+ },
275
+ {
276
+ "name": "v2ex-pagination-page2",
277
+ "steps": [
278
+ "opencli operate open https://v2ex.com/go/programmer",
279
+ "opencli operate eval \"(()=>{const a=document.querySelector('a[href*=\\\"?p=2\\\"]');if(a){a.click();return'navigating to page 2';}return'no page 2 link';})()\"",
280
+ "opencli operate wait time 2",
281
+ "opencli operate eval \"JSON.stringify({url:location.href,topics:[...document.querySelectorAll('a[href^=\\\"/t/\\\"]')].slice(0,5).map(a=>a.textContent.trim()).filter(t=>t.length>2)})\""
282
+ ],
283
+ "judge": {
284
+ "type": "matchesPattern",
285
+ "pattern": "p=2"
286
+ }
287
+ },
288
+ {
289
+ "name": "v2ex-topic-and-back",
290
+ "steps": [
291
+ "opencli operate open https://v2ex.com/",
292
+ "opencli operate eval \"(()=>{const a=document.querySelector('a[href^=\\\"/t/\\\"]');if(a){a.click();return'clicked';}return'not found';})()\"",
293
+ "opencli operate wait time 2",
294
+ "opencli operate back",
295
+ "opencli operate wait time 1",
296
+ "opencli operate get url"
297
+ ],
298
+ "judge": {
299
+ "type": "matchesPattern",
300
+ "pattern": "v2ex\\.com/?$"
301
+ }
302
+ },
303
+ {
304
+ "name": "v2ex-tab-then-topic",
305
+ "steps": [
306
+ "opencli operate open https://v2ex.com/?tab=creative",
307
+ "opencli operate eval \"(()=>{const a=document.querySelector('a[href^=\\\"/t/\\\"]');if(a){const t=a.textContent.trim();a.click();return t;}return'not found';})()\"",
308
+ "opencli operate wait time 2",
309
+ "opencli operate eval \"document.title\""
310
+ ],
311
+ "judge": {
312
+ "type": "nonEmpty"
313
+ }
314
+ },
315
+ {
316
+ "name": "v2ex-scroll-find-more",
317
+ "steps": [
318
+ "opencli operate open https://v2ex.com/",
319
+ "opencli operate eval \"document.querySelectorAll('a[href^=\\\"/t/\\\"]').length\"",
320
+ "opencli operate scroll down --amount 1000",
321
+ "opencli operate scroll down --amount 1000",
322
+ "opencli operate eval \"document.querySelectorAll('a[href^=\\\"/t/\\\"]').length\""
323
+ ],
324
+ "judge": {
325
+ "type": "matchesPattern",
326
+ "pattern": "\\d+"
327
+ }
328
+ },
329
+ {
330
+ "name": "v2ex-node-to-topic-content",
331
+ "steps": [
332
+ "opencli operate open https://v2ex.com/go/python",
333
+ "opencli operate eval \"(()=>{const a=document.querySelector('a[href^=\\\"/t/\\\"]');if(a){a.click();return'clicked';}return'not found';})()\"",
334
+ "opencli operate wait time 2",
335
+ "opencli operate eval \"(()=>{const title=document.querySelector('h1')?.textContent?.trim()||document.title;const content=document.querySelector('.topic_content,.markdown_body')?.textContent?.trim()?.slice(0,200)||'';return JSON.stringify({title,content});})()\" "
336
+ ],
337
+ "judge": {
338
+ "type": "matchesPattern",
339
+ "pattern": "\"title\":"
340
+ }
341
+ },
342
+ {
343
+ "name": "v2ex-multi-tab-compare",
344
+ "steps": [
345
+ "opencli operate open https://v2ex.com/?tab=tech",
346
+ "opencli operate eval \"JSON.stringify([...document.querySelectorAll('a[href^=\\\"/t/\\\"]')].slice(0,3).map(a=>a.textContent.trim()))\"",
347
+ "opencli operate open https://v2ex.com/?tab=creative",
348
+ "opencli operate eval \"JSON.stringify([...document.querySelectorAll('a[href^=\\\"/t/\\\"]')].slice(0,3).map(a=>a.textContent.trim()))\""
349
+ ],
350
+ "judge": {
351
+ "type": "arrayMinLength",
352
+ "minLength": 2
353
+ }
354
+ },
355
+ {
356
+ "name": "v2ex-topic-reply-to-author",
357
+ "steps": [
358
+ "opencli operate open https://v2ex.com/?tab=hot",
359
+ "opencli operate eval \"(()=>{const a=document.querySelector('a[href^=\\\"/t/\\\"]');if(a){a.click();return'clicked';}return'not found';})()\"",
360
+ "opencli operate wait time 2",
361
+ "opencli operate eval \"(()=>{const replies=document.querySelectorAll('.reply_content');const authors=[...document.querySelectorAll('a[href^=\\\"/member/\\\"]')];if(replies.length>0){const authorLink=document.querySelector('.cell a[href^=\\\"/member/\\\"]');if(authorLink){authorLink.click();return'clicked author';}};return'no replies found';})()\"",
362
+ "opencli operate wait time 2",
363
+ "opencli operate eval \"document.querySelector('h1')?.textContent?.trim()||document.title\""
364
+ ],
365
+ "judge": {
366
+ "type": "nonEmpty"
367
+ }
368
+ },
369
+ {
370
+ "_comment": "=== Layer 4: Write Operations (5 tasks, requires login) ==="
371
+ },
372
+ {
373
+ "name": "v2ex-reply-type-text",
374
+ "steps": [
375
+ "opencli operate open https://v2ex.com/?tab=hot",
376
+ "opencli operate eval \"(()=>{const links=[...document.querySelectorAll('a[href^=\\\"/t/\\\"]')];const link=links.find(a=>a.closest('tr')?.querySelector('a[class*=\\\"count\\\"]'));if(link){link.click();return'clicked';}if(links[0]){links[0].click();return'clicked first';}return'no topic';})()\"",
377
+ "opencli operate wait time 2",
378
+ "opencli operate eval \"(()=>{const ta=document.querySelector('textarea#reply_content,textarea[name=\\\"content\\\"]');if(ta){ta.focus();ta.value='AutoResearch test reply - please ignore';ta.dispatchEvent(new Event('input',{bubbles:true}));return ta.value;}return'no textarea';})()\" "
379
+ ],
380
+ "judge": {
381
+ "type": "contains",
382
+ "value": "AutoResearch test reply"
383
+ },
384
+ "note": "Types into reply box but does NOT submit"
385
+ },
386
+ {
387
+ "name": "v2ex-favorite-topic",
388
+ "steps": [
389
+ "opencli operate open https://v2ex.com/?tab=hot",
390
+ "opencli operate eval \"(()=>{const a=document.querySelector('a[href^=\\\"/t/\\\"]');if(a){a.click();return'clicked';}return'not found';})()\"",
391
+ "opencli operate wait time 2",
392
+ "opencli operate eval \"(()=>{const favLink=[...document.querySelectorAll('a')].find(a=>a.textContent.includes('加入收藏')||a.textContent.includes('Favorite'));return favLink?favLink.href:'no fav link';})()\" "
393
+ ],
394
+ "judge": {
395
+ "type": "matchesPattern",
396
+ "pattern": "favorite|收藏"
397
+ },
398
+ "note": "Finds favorite link but does NOT click it"
399
+ },
400
+ {
401
+ "name": "v2ex-thank-reply-find",
402
+ "steps": [
403
+ "opencli operate open https://v2ex.com/?tab=hot",
404
+ "opencli operate eval \"(()=>{const a=document.querySelector('a[href^=\\\"/t/\\\"]');if(a){a.click();return'clicked';}return'not found';})()\"",
405
+ "opencli operate wait time 2",
406
+ "opencli operate eval \"(()=>{const thankBtns=document.querySelectorAll('.thank_area,a[onclick*=\\\"thank\\\"],.thank');return JSON.stringify({found:thankBtns.length});})()\" "
407
+ ],
408
+ "judge": {
409
+ "type": "matchesPattern",
410
+ "pattern": "\"found\":\\d+"
411
+ },
412
+ "note": "Finds thank buttons but does NOT click"
413
+ },
414
+ {
415
+ "name": "v2ex-reply-form-detect",
416
+ "steps": [
417
+ "opencli operate open https://v2ex.com/?tab=hot",
418
+ "opencli operate eval \"(()=>{const a=document.querySelector('a[href^=\\\"/t/\\\"]');if(a){a.click();return'clicked';}return'not found';})()\"",
419
+ "opencli operate wait time 2",
420
+ "opencli operate eval \"(()=>{const ta=document.querySelector('textarea#reply_content,textarea[name=\\\"content\\\"]');const btn=document.querySelector('input[type=\\\"submit\\\"],button[type=\\\"submit\\\"]');const once=document.querySelector('input[name=\\\"once\\\"]');return JSON.stringify({textarea:!!ta,submitBtn:!!btn,csrfToken:!!once});})()\" "
421
+ ],
422
+ "judge": {
423
+ "type": "contains",
424
+ "value": "\"textarea\":"
425
+ }
426
+ },
427
+ {
428
+ "name": "v2ex-create-topic-form-detect",
429
+ "steps": [
430
+ "opencli operate open https://v2ex.com/new",
431
+ "opencli operate wait time 2",
432
+ "opencli operate eval \"(()=>{const title=document.querySelector('input[name=\\\"title\\\"],#topic_title');const content=document.querySelector('textarea[name=\\\"content\\\"],#topic_content,textarea#editor');const nodeSelect=document.querySelector('select[name=\\\"node_name\\\"],#node-select');return JSON.stringify({titleInput:!!title,contentArea:!!content,nodeSelect:!!nodeSelect,url:location.href});})()\" "
433
+ ],
434
+ "judge": {
435
+ "type": "nonEmpty"
436
+ },
437
+ "note": "Detects create topic form elements, does NOT submit"
438
+ },
439
+ {
440
+ "_comment": "=== Layer 5: Complex Chain (5 tasks) ==="
441
+ },
442
+ {
443
+ "name": "v2ex-collect-hot-authors",
444
+ "steps": [
445
+ "opencli operate open https://v2ex.com/?tab=hot",
446
+ "opencli operate eval \"JSON.stringify([...new Set([...document.querySelectorAll('a')].filter(a=>a.pathname&&a.pathname.startsWith('/member/')).map(a=>a.textContent.trim()).filter(n=>n.length>1))].slice(0,5))\""
447
+ ],
448
+ "judge": {
449
+ "type": "arrayMinLength",
450
+ "minLength": 2
451
+ }
452
+ },
453
+ {
454
+ "name": "v2ex-multi-node-compare",
455
+ "steps": [
456
+ "opencli operate open https://v2ex.com/go/python",
457
+ "opencli operate eval \"JSON.stringify([...document.querySelectorAll('a[href^=\\\"/t/\\\"]')].slice(0,3).map(a=>a.textContent.trim()).filter(t=>t.length>2))\"",
458
+ "opencli operate open https://v2ex.com/go/go",
459
+ "opencli operate eval \"JSON.stringify([...document.querySelectorAll('a[href^=\\\"/t/\\\"]')].slice(0,3).map(a=>a.textContent.trim()).filter(t=>t.length>2))\""
460
+ ],
461
+ "judge": {
462
+ "type": "arrayMinLength",
463
+ "minLength": 2
464
+ }
465
+ },
466
+ {
467
+ "name": "v2ex-topic-deep-read",
468
+ "steps": [
469
+ "opencli operate open https://v2ex.com/?tab=hot",
470
+ "opencli operate eval \"(()=>{const a=document.querySelector('a[href^=\\\"/t/\\\"]');if(a){a.click();return'clicked';}return'not found';})()\"",
471
+ "opencli operate wait time 2",
472
+ "opencli operate eval \"(()=>{const title=document.querySelector('h1')?.textContent?.trim()||document.title;const author=document.querySelector('.header a[href^=\\\"/member/\\\"]')?.textContent?.trim()||'';const content=document.querySelector('.topic_content,.markdown_body')?.textContent?.trim()?.slice(0,300)||'';const replyCount=document.querySelectorAll('.reply_content').length;return JSON.stringify({title,author,content,replyCount});})()\" "
473
+ ],
474
+ "judge": {
475
+ "type": "matchesPattern",
476
+ "pattern": "\"title\":.+\"author\":"
477
+ }
478
+ },
479
+ {
480
+ "name": "v2ex-cross-page-data-collect",
481
+ "steps": [
482
+ "opencli operate open https://v2ex.com/go/programmer",
483
+ "opencli operate eval \"(()=>{const titles=[...document.querySelectorAll('a[href^=\\\"/t/\\\"]')].slice(0,3).map(a=>a.textContent.trim());window.__collected=titles;return JSON.stringify(titles);})()\"",
484
+ "opencli operate open https://v2ex.com/go/programmer?p=2",
485
+ "opencli operate eval \"JSON.stringify([...document.querySelectorAll('a[href^=\\\"/t/\\\"]')].slice(0,3).map(a=>a.textContent.trim()).filter(t=>t.length>2))\""
486
+ ],
487
+ "judge": {
488
+ "type": "arrayMinLength",
489
+ "minLength": 2
490
+ }
491
+ },
492
+ {
493
+ "name": "v2ex-full-workflow",
494
+ "steps": [
495
+ "opencli operate open https://v2ex.com/?tab=hot",
496
+ "opencli operate eval \"(()=>{const topics=[...document.querySelectorAll('a[href^=\\\"/t/\\\"]')].slice(0,3).map(a=>({title:a.textContent.trim(),href:a.href}));return JSON.stringify(topics);})()\"",
497
+ "opencli operate eval \"(()=>{const a=document.querySelector('a[href^=\\\"/t/\\\"]');if(a){a.click();return 'clicked: '+a.textContent.trim().slice(0,30);}return'not found';})()\"",
498
+ "opencli operate wait time 2",
499
+ "opencli operate eval \"(()=>{const title=document.querySelector('h1')?.textContent?.trim()||document.title;const replies=[...document.querySelectorAll('.reply_content')].slice(0,3).map(el=>el.textContent.trim().slice(0,80));const author=document.querySelector('.header a[href^=\\\"/member/\\\"]')?.textContent?.trim()||'';return JSON.stringify({title,author,replies,replyCount:replies.length});})()\" "
500
+ ],
501
+ "judge": {
502
+ "type": "matchesPattern",
503
+ "pattern": "\"title\":.+\"author\":"
504
+ }
505
+ },
506
+ {
507
+ "_comment": "=== Layer 6: State + Click Interaction (10 tasks) ==="
508
+ },
509
+ {
510
+ "name": "v2ex-state-click-topic",
511
+ "steps": [
512
+ "opencli operate open https://v2ex.com/?tab=hot",
513
+ "opencli operate state",
514
+ "opencli operate click 1"
515
+ ],
516
+ "judge": {
517
+ "type": "contains",
518
+ "value": "Clicked"
519
+ }
520
+ },
521
+ {
522
+ "name": "v2ex-state-click-tab-tech",
523
+ "steps": [
524
+ "opencli operate open https://v2ex.com/",
525
+ "opencli operate state",
526
+ "opencli operate eval \"(function(){var links=[...document.querySelectorAll('a')];var tab=links.find(a=>a.href&&a.href.includes('tab=tech'));if(tab){var ref=tab.getAttribute('data-opencli-ref');return ref||'no-ref';}return 'not-found';})()\""
527
+ ],
528
+ "judge": {
529
+ "type": "matchesPattern",
530
+ "pattern": "\\d+|no-ref"
531
+ }
532
+ },
533
+ {
534
+ "name": "v2ex-state-count-interactive",
535
+ "steps": [
536
+ "opencli operate open https://v2ex.com/",
537
+ "opencli operate state"
538
+ ],
539
+ "judge": {
540
+ "type": "matchesPattern",
541
+ "pattern": "interactive: \\d+"
542
+ }
543
+ },
544
+ {
545
+ "name": "v2ex-state-scroll-state",
546
+ "steps": [
547
+ "opencli operate open https://v2ex.com/go/programmer",
548
+ "opencli operate scroll down --amount 500",
549
+ "opencli operate state"
550
+ ],
551
+ "judge": {
552
+ "type": "matchesPattern",
553
+ "pattern": "\\[\\d+\\]"
554
+ }
555
+ },
556
+ {
557
+ "name": "v2ex-type-search-box",
558
+ "steps": [
559
+ "opencli operate open https://v2ex.com/",
560
+ "opencli operate state",
561
+ "opencli operate eval \"(function(){var input=document.querySelector('input[type=\\\"text\\\"]');if(input){input.focus();input.value='TypeScript';input.dispatchEvent(new Event('input',{bubbles:true}));return input.value;}return 'no-input';})()\""
562
+ ],
563
+ "judge": {
564
+ "type": "contains",
565
+ "value": "TypeScript"
566
+ }
567
+ },
568
+ {
569
+ "name": "v2ex-get-value-after-type",
570
+ "steps": [
571
+ "opencli operate open https://v2ex.com/?tab=hot",
572
+ "opencli operate eval \"(function(){var a=document.querySelector('a[href^=\\\"/t/\\\"]');if(a)a.click();return 'clicked';})()\"",
573
+ "opencli operate wait time 2",
574
+ "opencli operate eval \"(function(){var ta=document.querySelector('textarea#reply_content,textarea[name=\\\"content\\\"]');if(ta){ta.focus();ta.value='test message 12345';ta.dispatchEvent(new Event('input',{bubbles:true}));return ta.value;}return 'no-textarea';})()\""
575
+ ],
576
+ "judge": {
577
+ "type": "nonEmpty"
578
+ }
579
+ },
580
+ {
581
+ "name": "v2ex-screenshot-exists",
582
+ "steps": [
583
+ "opencli operate open https://v2ex.com/",
584
+ "opencli operate screenshot /tmp/v2ex-test-screenshot.png"
585
+ ],
586
+ "judge": {
587
+ "type": "nonEmpty"
588
+ }
589
+ },
590
+ {
591
+ "name": "v2ex-get-html-selector",
592
+ "steps": [
593
+ "opencli operate open https://v2ex.com/",
594
+ "opencli operate get html --selector h1"
595
+ ],
596
+ "judge": {
597
+ "type": "nonEmpty"
598
+ }
599
+ },
600
+ {
601
+ "name": "v2ex-keys-escape",
602
+ "steps": [
603
+ "opencli operate open https://v2ex.com/",
604
+ "opencli operate keys Escape"
605
+ ],
606
+ "judge": {
607
+ "type": "contains",
608
+ "value": "pressed"
609
+ }
610
+ },
611
+ {
612
+ "name": "v2ex-wait-text",
613
+ "steps": [
614
+ "opencli operate open https://v2ex.com/",
615
+ "opencli operate wait text V2EX"
616
+ ],
617
+ "judge": {
618
+ "type": "matchesPattern",
619
+ "pattern": "found|appeared"
620
+ }
621
+ },
622
+ {
623
+ "_comment": "=== Layer 7: Long Chain Workflows (10 tasks) ==="
624
+ },
625
+ {
626
+ "name": "v2ex-chain-3-pages",
627
+ "steps": [
628
+ "opencli operate open https://v2ex.com/",
629
+ "opencli operate eval \"document.title\"",
630
+ "opencli operate open https://v2ex.com/go/programmer",
631
+ "opencli operate eval \"document.title\"",
632
+ "opencli operate open https://v2ex.com/go/python",
633
+ "opencli operate eval \"document.title\""
634
+ ],
635
+ "judge": {
636
+ "type": "nonEmpty"
637
+ }
638
+ },
639
+ {
640
+ "name": "v2ex-chain-navigate-extract-back",
641
+ "steps": [
642
+ "opencli operate open https://v2ex.com/?tab=hot",
643
+ "opencli operate eval \"(function(){var a=document.querySelector('a[href^=\\\"/t/\\\"]');if(a){var t=a.textContent.trim();a.click();return t;}return 'none';})()\"",
644
+ "opencli operate wait time 2",
645
+ "opencli operate eval \"document.querySelector('h1')?.textContent?.trim()||document.title\"",
646
+ "opencli operate back",
647
+ "opencli operate wait time 1",
648
+ "opencli operate eval \"document.title\""
649
+ ],
650
+ "judge": {
651
+ "type": "contains",
652
+ "value": "V2EX"
653
+ }
654
+ },
655
+ {
656
+ "name": "v2ex-chain-multi-node-scroll",
657
+ "steps": [
658
+ "opencli operate open https://v2ex.com/go/python",
659
+ "opencli operate scroll down --amount 500",
660
+ "opencli operate eval \"document.querySelectorAll('a[href^=\\\"/t/\\\"]').length\"",
661
+ "opencli operate open https://v2ex.com/go/go",
662
+ "opencli operate scroll down --amount 500",
663
+ "opencli operate eval \"document.querySelectorAll('a[href^=\\\"/t/\\\"]').length\""
664
+ ],
665
+ "judge": {
666
+ "type": "matchesPattern",
667
+ "pattern": "\\d+"
668
+ }
669
+ },
670
+ {
671
+ "name": "v2ex-chain-topic-replies-pagination",
672
+ "steps": [
673
+ "opencli operate open https://v2ex.com/?tab=hot",
674
+ "opencli operate eval \"(function(){var links=document.querySelectorAll('a[href^=\\\"/t/\\\"]');for(var i=0;i<links.length;i++){var row=links[i].closest('tr')||links[i].parentElement;var count=row?.querySelector('a[class*=\\\"count\\\"]');if(count&&parseInt(count.textContent)>5){links[i].click();return 'clicked topic with '+count.textContent+' replies';}}return 'no high-reply topic';})()\"",
675
+ "opencli operate wait time 2",
676
+ "opencli operate eval \"document.querySelectorAll('.reply_content').length\""
677
+ ],
678
+ "judge": {
679
+ "type": "matchesPattern",
680
+ "pattern": "\\d+"
681
+ }
682
+ },
683
+ {
684
+ "name": "v2ex-chain-member-topics",
685
+ "steps": [
686
+ "opencli operate open https://v2ex.com/member/Livid",
687
+ "opencli operate eval \"document.querySelector('h1')?.textContent?.trim()\"",
688
+ "opencli operate eval \"JSON.stringify([...document.querySelectorAll('a[href^=\\\"/t/\\\"]')].slice(0,3).map(a=>a.textContent.trim()))\""
689
+ ],
690
+ "judge": {
691
+ "type": "nonEmpty"
692
+ }
693
+ },
694
+ {
695
+ "name": "v2ex-chain-search-navigate-extract",
696
+ "steps": [
697
+ "opencli operate open https://www.google.com/search?q=site:v2ex.com+Python",
698
+ "opencli operate wait time 2",
699
+ "opencli operate eval \"(function(){var links=[...document.querySelectorAll('a')];var v2exLink=links.find(a=>a.href&&a.href.includes('v2ex.com/t/'));if(v2exLink){v2exLink.click();return 'clicked';}return 'no v2ex link found';})()\"",
700
+ "opencli operate wait time 3",
701
+ "opencli operate eval \"document.title\""
702
+ ],
703
+ "judge": {
704
+ "type": "nonEmpty"
705
+ }
706
+ },
707
+ {
708
+ "name": "v2ex-chain-tab-topic-author",
709
+ "steps": [
710
+ "opencli operate open https://v2ex.com/?tab=tech",
711
+ "opencli operate eval \"(function(){var a=document.querySelector('a[href^=\\\"/t/\\\"]');if(a){a.click();return 'clicked';}return 'none';})()\"",
712
+ "opencli operate wait time 2",
713
+ "opencli operate eval \"(function(){var author=document.querySelector('.header a[href^=\\\"/member/\\\"]');if(author){var name=author.textContent.trim();author.click();return name;}return 'no author';})()\"",
714
+ "opencli operate wait time 2",
715
+ "opencli operate eval \"document.querySelector('h1')?.textContent?.trim()||'no h1'\""
716
+ ],
717
+ "judge": {
718
+ "type": "nonEmpty"
719
+ }
720
+ },
721
+ {
722
+ "name": "v2ex-chain-node-page2-extract",
723
+ "steps": [
724
+ "opencli operate open https://v2ex.com/go/programmer",
725
+ "opencli operate eval \"JSON.stringify([...document.querySelectorAll('a[href^=\\\"/t/\\\"]')].slice(0,2).map(a=>a.textContent.trim()))\"",
726
+ "opencli operate open https://v2ex.com/go/programmer?p=2",
727
+ "opencli operate eval \"JSON.stringify([...document.querySelectorAll('a[href^=\\\"/t/\\\"]')].slice(0,2).map(a=>a.textContent.trim()))\"",
728
+ "opencli operate open https://v2ex.com/go/programmer?p=3",
729
+ "opencli operate eval \"JSON.stringify([...document.querySelectorAll('a[href^=\\\"/t/\\\"]')].slice(0,2).map(a=>a.textContent.trim()))\""
730
+ ],
731
+ "judge": {
732
+ "type": "arrayMinLength",
733
+ "minLength": 1
734
+ }
735
+ },
736
+ {
737
+ "name": "v2ex-chain-full-interaction",
738
+ "steps": [
739
+ "opencli operate open https://v2ex.com/?tab=hot",
740
+ "opencli operate state",
741
+ "opencli operate eval \"(function(){var a=document.querySelector('a[href^=\\\"/t/\\\"]');if(a){a.click();return 'clicked';}return 'none';})()\"",
742
+ "opencli operate wait time 2",
743
+ "opencli operate state",
744
+ "opencli operate eval \"(function(){var ta=document.querySelector('textarea#reply_content');if(ta)return 'reply form found';return 'no reply form';})()\"",
745
+ "opencli operate eval \"JSON.stringify({title:document.querySelector('h1')?.textContent?.trim()||document.title,replies:document.querySelectorAll('.reply_content').length})\""
746
+ ],
747
+ "judge": {
748
+ "type": "matchesPattern",
749
+ "pattern": "\"title\":"
750
+ }
751
+ },
752
+ {
753
+ "name": "v2ex-chain-deep-5-step",
754
+ "steps": [
755
+ "opencli operate open https://v2ex.com/",
756
+ "opencli operate eval \"document.querySelectorAll('a[href^=\\\"/go/\\\"]').length\"",
757
+ "opencli operate open https://v2ex.com/go/programmer",
758
+ "opencli operate eval \"document.querySelectorAll('a[href^=\\\"/t/\\\"]').length\"",
759
+ "opencli operate eval \"(function(){var a=document.querySelector('a[href^=\\\"/t/\\\"]');if(a){a.click();return 'clicked';}return 'none';})()\"",
760
+ "opencli operate wait time 2",
761
+ "opencli operate eval \"document.querySelectorAll('.reply_content').length\"",
762
+ "opencli operate back",
763
+ "opencli operate eval \"document.querySelectorAll('a[href^=\\\"/t/\\\"]').length\""
764
+ ],
765
+ "judge": {
766
+ "type": "matchesPattern",
767
+ "pattern": "\\d+"
768
+ }
769
+ },
770
+ {
771
+ "_comment": "=== Edge Cases: SPA navigation, timing, dynamic content ==="
772
+ },
773
+ {
774
+ "name": "v2ex-rapid-navigate",
775
+ "steps": [
776
+ "opencli operate open https://v2ex.com/",
777
+ "opencli operate open https://v2ex.com/go/programmer",
778
+ "opencli operate open https://v2ex.com/go/python",
779
+ "opencli operate eval \"location.pathname\""
780
+ ],
781
+ "judge": {
782
+ "type": "contains",
783
+ "value": "/go/python"
784
+ }
785
+ },
786
+ {
787
+ "name": "v2ex-eval-after-click",
788
+ "steps": [
789
+ "opencli operate open https://v2ex.com/?tab=hot",
790
+ "opencli operate eval \"(function(){var a=document.querySelector('a[href^=\\\"/t/\\\"]');if(a){a.click();return 'clicked';}return 'none';})()\"",
791
+ "opencli operate wait time 1",
792
+ "opencli operate eval \"location.pathname.startsWith('/t/') ? 'on topic page' : 'wrong page: '+location.pathname\""
793
+ ],
794
+ "judge": {
795
+ "type": "contains",
796
+ "value": "on topic page"
797
+ }
798
+ },
799
+ {
800
+ "name": "v2ex-scroll-and-extract",
801
+ "steps": [
802
+ "opencli operate open https://v2ex.com/go/programmer",
803
+ "opencli operate scroll down --amount 2000",
804
+ "opencli operate wait time 1",
805
+ "opencli operate eval \"JSON.stringify([...document.querySelectorAll('a[href^=\\\"/t/\\\"]')].slice(-3).map(a=>a.textContent.trim().slice(0,30)))\""
806
+ ],
807
+ "judge": {
808
+ "type": "arrayMinLength",
809
+ "minLength": 2
810
+ }
811
+ },
812
+ {
813
+ "name": "v2ex-concurrent-eval",
814
+ "steps": [
815
+ "opencli operate open https://v2ex.com/",
816
+ "opencli operate eval \"JSON.stringify({title:document.title,url:location.href,links:document.querySelectorAll('a').length})\""
817
+ ],
818
+ "judge": {
819
+ "type": "matchesPattern",
820
+ "pattern": "\"title\":.*\"url\":.*\"links\":"
821
+ }
822
+ },
823
+ {
824
+ "name": "v2ex-unicode-content",
825
+ "steps": [
826
+ "opencli operate open https://v2ex.com/?tab=hot",
827
+ "opencli operate eval \"(function(){var a=document.querySelector('a[href^=\\\"/t/\\\"]');return a?a.textContent.trim():'none';})()\""
828
+ ],
829
+ "judge": {
830
+ "type": "nonEmpty"
831
+ }
832
+ },
833
+ {
834
+ "_comment": "=== Agent-Style: state + click + type (no eval for interaction) ==="
835
+ },
836
+ {
837
+ "name": "v2ex-agent-click-first-topic",
838
+ "steps": [
839
+ "opencli operate open https://v2ex.com/?tab=hot",
840
+ "opencli operate state",
841
+ "opencli operate eval \"(function(){var links=document.querySelectorAll('[data-opencli-ref]');for(var i=0;i<links.length;i++){if(links[i].pathname&&links[i].pathname.startsWith('/t/'))return links[i].getAttribute('data-opencli-ref');}return 'none';})()\""
842
+ ],
843
+ "judge": {
844
+ "type": "matchesPattern",
845
+ "pattern": "\\d+"
846
+ },
847
+ "note": "Finds the index of first topic link via data-opencli-ref"
848
+ },
849
+ {
850
+ "name": "v2ex-agent-type-search",
851
+ "steps": [
852
+ "opencli operate open https://v2ex.com/",
853
+ "opencli operate state",
854
+ "opencli operate type 3 TypeScript",
855
+ "opencli operate get value 3"
856
+ ],
857
+ "judge": {
858
+ "type": "contains",
859
+ "value": "TypeScript"
860
+ },
861
+ "note": "Types into search box using state index"
862
+ },
863
+ {
864
+ "name": "v2ex-agent-click-navigate-back",
865
+ "steps": [
866
+ "opencli operate open https://v2ex.com/?tab=hot",
867
+ "opencli operate state",
868
+ "opencli operate eval \"(function(){var links=document.querySelectorAll('[data-opencli-ref]');for(var i=0;i<links.length;i++){if(links[i].pathname&&links[i].pathname.startsWith('/t/')){var ref=links[i].getAttribute('data-opencli-ref');document.querySelector('[data-opencli-ref=\\\"'+ref+'\\\"]').click();return 'clicked '+ref;}}return 'none';})()\"",
869
+ "opencli operate wait time 2",
870
+ "opencli operate eval \"document.title\""
871
+ ],
872
+ "judge": {
873
+ "type": "nonEmpty"
874
+ }
875
+ },
876
+ {
877
+ "name": "v2ex-agent-state-has-interactive",
878
+ "steps": [
879
+ "opencli operate open https://v2ex.com/",
880
+ "opencli operate state"
881
+ ],
882
+ "judge": {
883
+ "type": "matchesPattern",
884
+ "pattern": "interactive: \\d+"
885
+ }
886
+ },
887
+ {
888
+ "name": "v2ex-agent-state-after-scroll",
889
+ "steps": [
890
+ "opencli operate open https://v2ex.com/go/programmer",
891
+ "opencli operate scroll down --amount 800",
892
+ "opencli operate state"
893
+ ],
894
+ "judge": {
895
+ "type": "matchesPattern",
896
+ "pattern": "page_scroll: [\\d.]+↑"
897
+ }
898
+ }
899
+ ]