@creatoria/miniapp-mcp 0.1.3 → 0.2.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 (414) hide show
  1. package/README.md +131 -66
  2. package/dist/app/cli/index.d.ts +6 -0
  3. package/dist/app/cli/index.d.ts.map +1 -0
  4. package/dist/app/cli/index.js +6 -0
  5. package/dist/app/cli/index.js.map +1 -0
  6. package/dist/app/index.d.ts +6 -0
  7. package/dist/app/index.d.ts.map +1 -0
  8. package/dist/app/index.js +6 -0
  9. package/dist/app/index.js.map +1 -0
  10. package/dist/app/server/index.d.ts +7 -0
  11. package/dist/app/server/index.d.ts.map +1 -0
  12. package/dist/app/server/index.js +6 -0
  13. package/dist/app/server/index.js.map +1 -0
  14. package/dist/capabilities/assert/handlers/assert-handlers.d.ts +98 -0
  15. package/dist/capabilities/assert/handlers/assert-handlers.d.ts.map +1 -0
  16. package/dist/capabilities/assert/handlers/assert-handlers.js +179 -0
  17. package/dist/capabilities/assert/handlers/assert-handlers.js.map +1 -0
  18. package/dist/capabilities/assert/handlers/index.d.ts +7 -0
  19. package/dist/capabilities/assert/handlers/index.d.ts.map +1 -0
  20. package/dist/capabilities/assert/handlers/index.js +7 -0
  21. package/dist/capabilities/assert/handlers/index.js.map +1 -0
  22. package/dist/capabilities/assert/index.d.ts +15 -0
  23. package/dist/capabilities/assert/index.d.ts.map +1 -0
  24. package/dist/capabilities/assert/index.js +90 -0
  25. package/dist/capabilities/assert/index.js.map +1 -0
  26. package/dist/capabilities/assert/schemas/index.d.ts +101 -0
  27. package/dist/capabilities/assert/schemas/index.d.ts.map +1 -0
  28. package/dist/capabilities/assert/schemas/index.js +62 -0
  29. package/dist/capabilities/assert/schemas/index.js.map +1 -0
  30. package/dist/capabilities/automator/handlers/close.d.ts +18 -0
  31. package/dist/capabilities/automator/handlers/close.d.ts.map +1 -0
  32. package/dist/capabilities/automator/handlers/close.js +45 -0
  33. package/dist/capabilities/automator/handlers/close.js.map +1 -0
  34. package/dist/capabilities/automator/handlers/connect.d.ts +24 -0
  35. package/dist/capabilities/automator/handlers/connect.d.ts.map +1 -0
  36. package/dist/capabilities/automator/handlers/connect.js +51 -0
  37. package/dist/capabilities/automator/handlers/connect.js.map +1 -0
  38. package/dist/capabilities/automator/handlers/disconnect.d.ts +16 -0
  39. package/dist/capabilities/automator/handlers/disconnect.d.ts.map +1 -0
  40. package/dist/capabilities/automator/handlers/disconnect.js +44 -0
  41. package/dist/capabilities/automator/handlers/disconnect.js.map +1 -0
  42. package/dist/capabilities/automator/handlers/index.d.ts +8 -0
  43. package/dist/capabilities/automator/handlers/index.d.ts.map +1 -0
  44. package/dist/capabilities/automator/handlers/index.js +8 -0
  45. package/dist/capabilities/automator/handlers/index.js.map +1 -0
  46. package/dist/capabilities/automator/handlers/launch.d.ts +25 -0
  47. package/dist/capabilities/automator/handlers/launch.d.ts.map +1 -0
  48. package/dist/capabilities/automator/handlers/launch.js +61 -0
  49. package/dist/capabilities/automator/handlers/launch.js.map +1 -0
  50. package/dist/capabilities/automator/index.d.ts +15 -0
  51. package/dist/capabilities/automator/index.d.ts.map +1 -0
  52. package/dist/capabilities/automator/index.js +55 -0
  53. package/dist/capabilities/automator/index.js.map +1 -0
  54. package/dist/capabilities/automator/schemas/close.d.ts +5 -0
  55. package/dist/capabilities/automator/schemas/close.d.ts.map +1 -0
  56. package/dist/capabilities/automator/schemas/close.js +11 -0
  57. package/dist/capabilities/automator/schemas/close.js.map +1 -0
  58. package/dist/capabilities/automator/schemas/connect.d.ts +11 -0
  59. package/dist/capabilities/automator/schemas/connect.d.ts.map +1 -0
  60. package/dist/capabilities/automator/schemas/connect.js +19 -0
  61. package/dist/capabilities/automator/schemas/connect.js.map +1 -0
  62. package/dist/capabilities/automator/schemas/disconnect.d.ts +5 -0
  63. package/dist/capabilities/automator/schemas/disconnect.d.ts.map +1 -0
  64. package/dist/capabilities/automator/schemas/disconnect.js +11 -0
  65. package/dist/capabilities/automator/schemas/disconnect.js.map +1 -0
  66. package/dist/capabilities/automator/schemas/index.d.ts +9 -0
  67. package/dist/capabilities/automator/schemas/index.d.ts.map +1 -0
  68. package/dist/capabilities/automator/schemas/index.js +14 -0
  69. package/dist/capabilities/automator/schemas/index.js.map +1 -0
  70. package/dist/capabilities/automator/schemas/launch.d.ts +17 -0
  71. package/dist/capabilities/automator/schemas/launch.d.ts.map +1 -0
  72. package/dist/capabilities/automator/schemas/launch.js +26 -0
  73. package/dist/capabilities/automator/schemas/launch.js.map +1 -0
  74. package/dist/capabilities/element/handlers/element-handlers.d.ts +212 -0
  75. package/dist/capabilities/element/handlers/element-handlers.d.ts.map +1 -0
  76. package/dist/capabilities/element/handlers/element-handlers.js +383 -0
  77. package/dist/capabilities/element/handlers/element-handlers.js.map +1 -0
  78. package/dist/capabilities/element/handlers/index.d.ts +7 -0
  79. package/dist/capabilities/element/handlers/index.d.ts.map +1 -0
  80. package/dist/capabilities/element/handlers/index.js +27 -0
  81. package/dist/capabilities/element/handlers/index.js.map +1 -0
  82. package/dist/capabilities/element/index.d.ts +20 -0
  83. package/dist/capabilities/element/index.d.ts.map +1 -0
  84. package/dist/capabilities/element/index.js +199 -0
  85. package/dist/capabilities/element/index.js.map +1 -0
  86. package/dist/capabilities/element/schemas/index.d.ts +325 -0
  87. package/dist/capabilities/element/schemas/index.d.ts.map +1 -0
  88. package/dist/capabilities/element/schemas/index.js +168 -0
  89. package/dist/capabilities/element/schemas/index.js.map +1 -0
  90. package/dist/capabilities/index.d.ts +34 -0
  91. package/dist/capabilities/index.d.ts.map +1 -0
  92. package/dist/capabilities/index.js +40 -0
  93. package/dist/capabilities/index.js.map +1 -0
  94. package/dist/capabilities/loader.d.ts +61 -0
  95. package/dist/capabilities/loader.d.ts.map +1 -0
  96. package/dist/capabilities/loader.js +164 -0
  97. package/dist/capabilities/loader.js.map +1 -0
  98. package/dist/capabilities/miniprogram/handlers/call-wx.d.ts +24 -0
  99. package/dist/capabilities/miniprogram/handlers/call-wx.d.ts.map +1 -0
  100. package/dist/capabilities/miniprogram/handlers/call-wx.js +37 -0
  101. package/dist/capabilities/miniprogram/handlers/call-wx.js.map +1 -0
  102. package/dist/capabilities/miniprogram/handlers/evaluate.d.ts +32 -0
  103. package/dist/capabilities/miniprogram/handlers/evaluate.d.ts.map +1 -0
  104. package/dist/capabilities/miniprogram/handlers/evaluate.js +51 -0
  105. package/dist/capabilities/miniprogram/handlers/evaluate.js.map +1 -0
  106. package/dist/capabilities/miniprogram/handlers/index.d.ts +12 -0
  107. package/dist/capabilities/miniprogram/handlers/index.d.ts.map +1 -0
  108. package/dist/capabilities/miniprogram/handlers/index.js +12 -0
  109. package/dist/capabilities/miniprogram/handlers/index.js.map +1 -0
  110. package/dist/capabilities/miniprogram/handlers/navigate.d.ts +26 -0
  111. package/dist/capabilities/miniprogram/handlers/navigate.d.ts.map +1 -0
  112. package/dist/capabilities/miniprogram/handlers/navigate.js +56 -0
  113. package/dist/capabilities/miniprogram/handlers/navigate.js.map +1 -0
  114. package/dist/capabilities/miniprogram/handlers/page-stack.d.ts +20 -0
  115. package/dist/capabilities/miniprogram/handlers/page-stack.d.ts.map +1 -0
  116. package/dist/capabilities/miniprogram/handlers/page-stack.js +37 -0
  117. package/dist/capabilities/miniprogram/handlers/page-stack.js.map +1 -0
  118. package/dist/capabilities/miniprogram/handlers/screenshot.d.ts +33 -0
  119. package/dist/capabilities/miniprogram/handlers/screenshot.d.ts.map +1 -0
  120. package/dist/capabilities/miniprogram/handlers/screenshot.js +132 -0
  121. package/dist/capabilities/miniprogram/handlers/screenshot.js.map +1 -0
  122. package/dist/capabilities/miniprogram/handlers/system-info.d.ts +17 -0
  123. package/dist/capabilities/miniprogram/handlers/system-info.d.ts.map +1 -0
  124. package/dist/capabilities/miniprogram/handlers/system-info.js +31 -0
  125. package/dist/capabilities/miniprogram/handlers/system-info.js.map +1 -0
  126. package/dist/capabilities/miniprogram/index.d.ts +15 -0
  127. package/dist/capabilities/miniprogram/index.d.ts.map +1 -0
  128. package/dist/capabilities/miniprogram/index.js +69 -0
  129. package/dist/capabilities/miniprogram/index.js.map +1 -0
  130. package/dist/capabilities/miniprogram/schemas/call-wx.d.ts +15 -0
  131. package/dist/capabilities/miniprogram/schemas/call-wx.d.ts.map +1 -0
  132. package/dist/capabilities/miniprogram/schemas/call-wx.js +11 -0
  133. package/dist/capabilities/miniprogram/schemas/call-wx.js.map +1 -0
  134. package/dist/capabilities/miniprogram/schemas/evaluate.d.ts +15 -0
  135. package/dist/capabilities/miniprogram/schemas/evaluate.d.ts.map +1 -0
  136. package/dist/capabilities/miniprogram/schemas/evaluate.js +11 -0
  137. package/dist/capabilities/miniprogram/schemas/evaluate.js.map +1 -0
  138. package/dist/capabilities/miniprogram/schemas/index.d.ts +10 -0
  139. package/dist/capabilities/miniprogram/schemas/index.d.ts.map +1 -0
  140. package/dist/capabilities/miniprogram/schemas/index.js +10 -0
  141. package/dist/capabilities/miniprogram/schemas/index.js.map +1 -0
  142. package/dist/capabilities/miniprogram/schemas/navigate.d.ts +18 -0
  143. package/dist/capabilities/miniprogram/schemas/navigate.d.ts.map +1 -0
  144. package/dist/capabilities/miniprogram/schemas/navigate.js +22 -0
  145. package/dist/capabilities/miniprogram/schemas/navigate.js.map +1 -0
  146. package/dist/capabilities/miniprogram/schemas/page-stack.d.ts +6 -0
  147. package/dist/capabilities/miniprogram/schemas/page-stack.d.ts.map +1 -0
  148. package/dist/capabilities/miniprogram/schemas/page-stack.js +6 -0
  149. package/dist/capabilities/miniprogram/schemas/page-stack.js.map +1 -0
  150. package/dist/capabilities/miniprogram/schemas/screenshot.d.ts +18 -0
  151. package/dist/capabilities/miniprogram/schemas/screenshot.d.ts.map +1 -0
  152. package/dist/capabilities/miniprogram/schemas/screenshot.js +21 -0
  153. package/dist/capabilities/miniprogram/schemas/screenshot.js.map +1 -0
  154. package/dist/capabilities/miniprogram/schemas/system-info.d.ts +6 -0
  155. package/dist/capabilities/miniprogram/schemas/system-info.d.ts.map +1 -0
  156. package/dist/capabilities/miniprogram/schemas/system-info.js +6 -0
  157. package/dist/capabilities/miniprogram/schemas/system-info.js.map +1 -0
  158. package/dist/capabilities/network/handlers/index.d.ts +7 -0
  159. package/dist/capabilities/network/handlers/index.d.ts.map +1 -0
  160. package/dist/capabilities/network/handlers/index.js +7 -0
  161. package/dist/capabilities/network/handlers/index.js.map +1 -0
  162. package/dist/capabilities/network/handlers/network-handlers.d.ts +53 -0
  163. package/dist/capabilities/network/handlers/network-handlers.d.ts.map +1 -0
  164. package/dist/capabilities/network/handlers/network-handlers.js +127 -0
  165. package/dist/capabilities/network/handlers/network-handlers.js.map +1 -0
  166. package/dist/capabilities/network/index.d.ts +15 -0
  167. package/dist/capabilities/network/index.d.ts.map +1 -0
  168. package/dist/capabilities/network/index.js +69 -0
  169. package/dist/capabilities/network/index.js.map +1 -0
  170. package/dist/capabilities/network/schemas/index.d.ts +53 -0
  171. package/dist/capabilities/network/schemas/index.d.ts.map +1 -0
  172. package/dist/capabilities/network/schemas/index.js +33 -0
  173. package/dist/capabilities/network/schemas/index.js.map +1 -0
  174. package/dist/capabilities/page/handlers/index.d.ts +7 -0
  175. package/dist/capabilities/page/handlers/index.d.ts.map +1 -0
  176. package/dist/capabilities/page/handlers/index.js +7 -0
  177. package/dist/capabilities/page/handlers/index.js.map +1 -0
  178. package/dist/capabilities/page/handlers/page-handlers.d.ts +165 -0
  179. package/dist/capabilities/page/handlers/page-handlers.d.ts.map +1 -0
  180. package/dist/capabilities/page/handlers/page-handlers.js +258 -0
  181. package/dist/capabilities/page/handlers/page-handlers.js.map +1 -0
  182. package/dist/capabilities/page/index.d.ts +15 -0
  183. package/dist/capabilities/page/index.d.ts.map +1 -0
  184. package/dist/capabilities/page/index.js +83 -0
  185. package/dist/capabilities/page/index.js.map +1 -0
  186. package/dist/capabilities/page/schemas/index.d.ts +91 -0
  187. package/dist/capabilities/page/schemas/index.d.ts.map +1 -0
  188. package/dist/capabilities/page/schemas/index.js +55 -0
  189. package/dist/capabilities/page/schemas/index.js.map +1 -0
  190. package/dist/capabilities/record/handlers/index.d.ts +7 -0
  191. package/dist/capabilities/record/handlers/index.d.ts.map +1 -0
  192. package/dist/capabilities/record/handlers/index.js +7 -0
  193. package/dist/capabilities/record/handlers/index.js.map +1 -0
  194. package/dist/capabilities/record/handlers/record-handlers.d.ts +76 -0
  195. package/dist/capabilities/record/handlers/record-handlers.d.ts.map +1 -0
  196. package/dist/capabilities/record/handlers/record-handlers.js +255 -0
  197. package/dist/capabilities/record/handlers/record-handlers.js.map +1 -0
  198. package/dist/capabilities/record/index.d.ts +15 -0
  199. package/dist/capabilities/record/index.d.ts.map +1 -0
  200. package/dist/capabilities/record/index.js +69 -0
  201. package/dist/capabilities/record/index.js.map +1 -0
  202. package/dist/capabilities/record/schemas/index.d.ts +47 -0
  203. package/dist/capabilities/record/schemas/index.d.ts.map +1 -0
  204. package/dist/capabilities/record/schemas/index.js +33 -0
  205. package/dist/capabilities/record/schemas/index.js.map +1 -0
  206. package/dist/capabilities/registry.d.ts +138 -0
  207. package/dist/capabilities/registry.d.ts.map +1 -0
  208. package/dist/capabilities/registry.js +261 -0
  209. package/dist/capabilities/registry.js.map +1 -0
  210. package/dist/capabilities/schema-registry.d.ts +4 -0
  211. package/dist/capabilities/schema-registry.d.ts.map +1 -0
  212. package/dist/capabilities/schema-registry.js +18 -0
  213. package/dist/capabilities/schema-registry.js.map +1 -0
  214. package/dist/capabilities/schema-types.d.ts +22 -0
  215. package/dist/capabilities/schema-types.d.ts.map +1 -0
  216. package/dist/capabilities/schema-types.js +2 -0
  217. package/dist/capabilities/schema-types.js.map +1 -0
  218. package/dist/capabilities/snapshot/handlers/index.d.ts +7 -0
  219. package/dist/capabilities/snapshot/handlers/index.d.ts.map +1 -0
  220. package/dist/capabilities/snapshot/handlers/index.js +7 -0
  221. package/dist/capabilities/snapshot/handlers/index.js.map +1 -0
  222. package/dist/capabilities/snapshot/handlers/snapshot-handlers.d.ts +75 -0
  223. package/dist/capabilities/snapshot/handlers/snapshot-handlers.d.ts.map +1 -0
  224. package/dist/capabilities/snapshot/handlers/snapshot-handlers.js +201 -0
  225. package/dist/capabilities/snapshot/handlers/snapshot-handlers.js.map +1 -0
  226. package/dist/capabilities/snapshot/index.d.ts +15 -0
  227. package/dist/capabilities/snapshot/index.d.ts.map +1 -0
  228. package/dist/capabilities/snapshot/index.js +48 -0
  229. package/dist/capabilities/snapshot/index.js.map +1 -0
  230. package/dist/capabilities/snapshot/schemas/index.d.ts +47 -0
  231. package/dist/capabilities/snapshot/schemas/index.d.ts.map +1 -0
  232. package/dist/capabilities/snapshot/schemas/index.js +28 -0
  233. package/dist/capabilities/snapshot/schemas/index.js.map +1 -0
  234. package/dist/config/loader.js +1 -1
  235. package/dist/config/loader.js.map +1 -1
  236. package/dist/core/element-ref.d.ts +1 -43
  237. package/dist/core/element-ref.d.ts.map +1 -1
  238. package/dist/core/element-ref.js +1 -212
  239. package/dist/core/element-ref.js.map +1 -1
  240. package/dist/core/logger.d.ts +1 -54
  241. package/dist/core/logger.d.ts.map +1 -1
  242. package/dist/core/logger.js +1 -377
  243. package/dist/core/logger.js.map +1 -1
  244. package/dist/core/output.d.ts +1 -20
  245. package/dist/core/output.d.ts.map +1 -1
  246. package/dist/core/output.js +1 -55
  247. package/dist/core/output.js.map +1 -1
  248. package/dist/core/report-generator.d.ts +1 -23
  249. package/dist/core/report-generator.d.ts.map +1 -1
  250. package/dist/core/report-generator.js +1 -211
  251. package/dist/core/report-generator.js.map +1 -1
  252. package/dist/core/session.d.ts +2 -82
  253. package/dist/core/session.d.ts.map +1 -1
  254. package/dist/core/session.js +2 -305
  255. package/dist/core/session.js.map +1 -1
  256. package/dist/core/timeout.d.ts +1 -48
  257. package/dist/core/timeout.d.ts.map +1 -1
  258. package/dist/core/timeout.js +1 -66
  259. package/dist/core/timeout.js.map +1 -1
  260. package/dist/core/tool-logger.d.ts +1 -82
  261. package/dist/core/tool-logger.d.ts.map +1 -1
  262. package/dist/core/tool-logger.js +1 -452
  263. package/dist/core/tool-logger.js.map +1 -1
  264. package/dist/core/validation.d.ts +1 -38
  265. package/dist/core/validation.d.ts.map +1 -1
  266. package/dist/core/validation.js +1 -92
  267. package/dist/core/validation.js.map +1 -1
  268. package/dist/runtime/element/element-ref.d.ts +44 -0
  269. package/dist/runtime/element/element-ref.d.ts.map +1 -0
  270. package/dist/runtime/element/element-ref.js +214 -0
  271. package/dist/runtime/element/element-ref.js.map +1 -0
  272. package/dist/runtime/element/index.d.ts +2 -0
  273. package/dist/runtime/element/index.d.ts.map +1 -0
  274. package/dist/runtime/element/index.js +2 -0
  275. package/dist/runtime/element/index.js.map +1 -0
  276. package/dist/runtime/index.d.ts +11 -0
  277. package/dist/runtime/index.d.ts.map +1 -0
  278. package/dist/runtime/index.js +11 -0
  279. package/dist/runtime/index.js.map +1 -0
  280. package/dist/runtime/logging/index.d.ts +3 -0
  281. package/dist/runtime/logging/index.d.ts.map +1 -0
  282. package/dist/runtime/logging/index.js +3 -0
  283. package/dist/runtime/logging/index.js.map +1 -0
  284. package/dist/runtime/logging/logger.d.ts +55 -0
  285. package/dist/runtime/logging/logger.d.ts.map +1 -0
  286. package/dist/runtime/logging/logger.js +379 -0
  287. package/dist/runtime/logging/logger.js.map +1 -0
  288. package/dist/runtime/logging/tool-logger.d.ts +83 -0
  289. package/dist/runtime/logging/tool-logger.d.ts.map +1 -0
  290. package/dist/runtime/logging/tool-logger.js +454 -0
  291. package/dist/runtime/logging/tool-logger.js.map +1 -0
  292. package/dist/runtime/outputs/index.d.ts +3 -0
  293. package/dist/runtime/outputs/index.d.ts.map +1 -0
  294. package/dist/runtime/outputs/index.js +3 -0
  295. package/dist/runtime/outputs/index.js.map +1 -0
  296. package/dist/runtime/outputs/output-manager.d.ts +12 -0
  297. package/dist/runtime/outputs/output-manager.d.ts.map +1 -0
  298. package/dist/runtime/outputs/output-manager.js +39 -0
  299. package/dist/runtime/outputs/output-manager.js.map +1 -0
  300. package/dist/runtime/outputs/report-generator.d.ts +5 -0
  301. package/dist/runtime/outputs/report-generator.d.ts.map +1 -0
  302. package/dist/runtime/outputs/report-generator.js +175 -0
  303. package/dist/runtime/outputs/report-generator.js.map +1 -0
  304. package/dist/runtime/retry/index.d.ts +5 -0
  305. package/dist/runtime/retry/index.d.ts.map +1 -0
  306. package/dist/runtime/retry/index.js +5 -0
  307. package/dist/runtime/retry/index.js.map +1 -0
  308. package/dist/runtime/retry/retry.d.ts +61 -0
  309. package/dist/runtime/retry/retry.d.ts.map +1 -0
  310. package/dist/runtime/retry/retry.js +90 -0
  311. package/dist/runtime/retry/retry.js.map +1 -0
  312. package/dist/runtime/session/index.d.ts +3 -0
  313. package/dist/runtime/session/index.d.ts.map +1 -0
  314. package/dist/runtime/session/index.js +3 -0
  315. package/dist/runtime/session/index.js.map +1 -0
  316. package/dist/runtime/session/store.d.ts +28 -0
  317. package/dist/runtime/session/store.d.ts.map +1 -0
  318. package/dist/runtime/session/store.js +154 -0
  319. package/dist/runtime/session/store.js.map +1 -0
  320. package/dist/runtime/session/utils/cleanup.d.ts +3 -0
  321. package/dist/runtime/session/utils/cleanup.d.ts.map +1 -0
  322. package/dist/runtime/session/utils/cleanup.js +78 -0
  323. package/dist/runtime/session/utils/cleanup.js.map +1 -0
  324. package/dist/runtime/timeout/index.d.ts +2 -0
  325. package/dist/runtime/timeout/index.d.ts.map +1 -0
  326. package/dist/runtime/timeout/index.js +2 -0
  327. package/dist/runtime/timeout/index.js.map +1 -0
  328. package/dist/runtime/timeout/timeout.d.ts +59 -0
  329. package/dist/runtime/timeout/timeout.d.ts.map +1 -0
  330. package/dist/runtime/timeout/timeout.js +77 -0
  331. package/dist/runtime/timeout/timeout.js.map +1 -0
  332. package/dist/runtime/validation/index.d.ts +2 -0
  333. package/dist/runtime/validation/index.d.ts.map +1 -0
  334. package/dist/runtime/validation/index.js +2 -0
  335. package/dist/runtime/validation/index.js.map +1 -0
  336. package/dist/runtime/validation/validation.d.ts +39 -0
  337. package/dist/runtime/validation/validation.d.ts.map +1 -0
  338. package/dist/runtime/validation/validation.js +93 -0
  339. package/dist/runtime/validation/validation.js.map +1 -0
  340. package/dist/schemas/automator/miniprogram_close.json +12 -0
  341. package/dist/schemas/automator/miniprogram_connect.json +19 -0
  342. package/dist/schemas/automator/miniprogram_disconnect.json +12 -0
  343. package/dist/schemas/automator/miniprogram_launch.json +30 -0
  344. package/dist/server.js +5 -5
  345. package/dist/server.js.map +1 -1
  346. package/dist/tools/index.d.ts.map +1 -1
  347. package/dist/tools/index.js +8 -4
  348. package/dist/tools/index.js.map +1 -1
  349. package/dist/tools/miniprogram.d.ts +11 -2
  350. package/dist/tools/miniprogram.d.ts.map +1 -1
  351. package/dist/tools/miniprogram.js +111 -41
  352. package/dist/tools/miniprogram.js.map +1 -1
  353. package/dist/tools/page.js +2 -2
  354. package/dist/tools/page.js.map +1 -1
  355. package/docs/current/01-architecture-migration.md +337 -0
  356. package/docs/current/02-screenshot-timeout-fix.md +589 -0
  357. package/docs/current/README.md +226 -0
  358. package/docs/directory-structure-and-code-style-best-practices.md +91 -0
  359. package/docs/migration/README.md +34 -0
  360. package/docs/migration/TC-ALIGN-01-notes.md +35 -0
  361. package/docs/migration/runtime-skeleton.md +50 -0
  362. package/docs/migration/tool-schema-strategy.md +75 -0
  363. package/docs//345/256/214/346/225/264/345/256/236/347/216/260/346/226/271/346/241/210.md +14 -14
  364. package/docs//347/254/254/344/270/200/347/211/210/346/234/254/346/226/271/346/241/210.md +7 -7
  365. package/package.json +4 -2
  366. package/docs/SIMPLE_USAGE.md +0 -210
  367. package/docs/architecture.E-Docs.md +0 -1359
  368. package/docs/architecture.F1.md +0 -720
  369. package/docs/architecture.F2.md +0 -871
  370. package/docs/architecture.F3.md +0 -905
  371. package/docs/architecture.md +0 -90
  372. package/docs/charter.A1.align.yaml +0 -170
  373. package/docs/charter.A2.align.yaml +0 -199
  374. package/docs/charter.A3.align.yaml +0 -242
  375. package/docs/charter.A4.align.yaml +0 -227
  376. package/docs/charter.B1.align.yaml +0 -179
  377. package/docs/charter.B2.align.yaml +0 -200
  378. package/docs/charter.B3.align.yaml +0 -200
  379. package/docs/charter.B4.align.yaml +0 -188
  380. package/docs/charter.C1.align.yaml +0 -190
  381. package/docs/charter.C2.align.yaml +0 -202
  382. package/docs/charter.C3.align.yaml +0 -211
  383. package/docs/charter.C4.align.yaml +0 -263
  384. package/docs/charter.C5.align.yaml +0 -220
  385. package/docs/charter.D1.align.yaml +0 -190
  386. package/docs/charter.D2.align.yaml +0 -234
  387. package/docs/charter.D3.align.yaml +0 -206
  388. package/docs/charter.E-Docs.align.yaml +0 -294
  389. package/docs/charter.F1.align.yaml +0 -193
  390. package/docs/charter.F2.align.yaml +0 -248
  391. package/docs/charter.F3.align.yaml +0 -287
  392. package/docs/charter.G.align.yaml +0 -174
  393. package/docs/charter.align.yaml +0 -111
  394. package/docs/maintenance.md +0 -682
  395. package/docs/playwright-mcp/350/260/203/347/240/224.md +0 -53
  396. package/docs/setup-guide.md +0 -775
  397. package/docs/tasks.A1.atomize.md +0 -296
  398. package/docs/tasks.A2.atomize.md +0 -408
  399. package/docs/tasks.A3.atomize.md +0 -564
  400. package/docs/tasks.A4.atomize.md +0 -496
  401. package/docs/tasks.B1.atomize.md +0 -352
  402. package/docs/tasks.B2.atomize.md +0 -561
  403. package/docs/tasks.B3.atomize.md +0 -508
  404. package/docs/tasks.B4.atomize.md +0 -504
  405. package/docs/tasks.C1.atomize.md +0 -540
  406. package/docs/tasks.C2.atomize.md +0 -665
  407. package/docs/tasks.C3.atomize.md +0 -745
  408. package/docs/tasks.C4.atomize.md +0 -908
  409. package/docs/tasks.C5.atomize.md +0 -755
  410. package/docs/tasks.D1.atomize.md +0 -547
  411. package/docs/tasks.D2.atomize.md +0 -619
  412. package/docs/tasks.D3.atomize.md +0 -790
  413. package/docs/tasks.E-Docs.atomize.md +0 -1204
  414. package/docs/tasks.atomize.md +0 -189
@@ -1,665 +0,0 @@
1
- # Task Card: [C2] MiniProgram 工具
2
-
3
- **Task ID**: C2
4
- **Task Name**: MiniProgram 工具实现
5
- **Charter**: `docs/charter.C2.align.yaml`
6
- **Stage**: C (Tool Implementation)
7
- **Status**: ✅ COMPLETED (Retrospective)
8
- **Estimated**: 3-4 hours
9
- **Actual**: ~4 hours
10
- **Completed**: 2025-10-02
11
-
12
- ---
13
-
14
- ## 目标 (Goal)
15
-
16
- 实现 MiniProgram 级别的 6 个 MCP 工具,封装小程序导航、WX API 调用、代码执行、截图和系统信息获取功能。
17
-
18
- **交付物**:
19
- - ✅ `src/tools/miniprogram.ts` (330 lines)
20
- - ✅ `tests/unit/miniprogram.test.ts` (403 lines, 25 tests)
21
- - ✅ 6 个工具: navigate, callWx, evaluate, screenshot, getPageStack, getSystemInfo
22
-
23
- ---
24
-
25
- ## 前置条件 (Prerequisites)
26
-
27
- - ✅ C1: Automator 工具已完成(获取 MiniProgram 实例)
28
- - ✅ B2: SessionStore 已实现
29
- - ✅ 了解微信小程序导航机制
30
- - ✅ 了解微信小程序 API (wx.*)
31
-
32
- ---
33
-
34
- ## 实现步骤 (Steps)
35
-
36
- ### 1. 定义工具 Schema ✅
37
-
38
- **文件**: `src/tools/miniprogram.ts`
39
-
40
- **步骤**:
41
- ```typescript
42
- import { z } from 'zod'
43
-
44
- // 导航方法枚举
45
- const NavigateMethod = z.enum([
46
- 'navigateTo',
47
- 'redirectTo',
48
- 'navigateBack',
49
- 'switchTab',
50
- 'reLaunch',
51
- ])
52
-
53
- // navigate 工具 Schema
54
- const navigateSchema = z.object({
55
- sessionId: z.string(),
56
- method: NavigateMethod,
57
- url: z.string().optional(),
58
- delta: z.number().optional(),
59
- })
60
-
61
- // callWx 工具 Schema
62
- const callWxSchema = z.object({
63
- sessionId: z.string(),
64
- method: z.string().describe('wx API 方法名,如 showToast'),
65
- args: z.record(z.any()).optional(),
66
- })
67
-
68
- // evaluate 工具 Schema
69
- const evaluateSchema = z.object({
70
- sessionId: z.string(),
71
- code: z.string().describe('要执行的 JavaScript 代码'),
72
- })
73
-
74
- // screenshot 工具 Schema
75
- const screenshotSchema = z.object({
76
- sessionId: z.string(),
77
- path: z.string().optional().describe('截图保存路径'),
78
- })
79
-
80
- // 会话 Schema(用于 getPageStack, getSystemInfo)
81
- const sessionSchema = z.object({
82
- sessionId: z.string(),
83
- })
84
- ```
85
-
86
- **验证**: TypeScript 编译通过,Schema 类型正确
87
-
88
- ---
89
-
90
- ### 2. 实现 navigate 工具 ✅
91
-
92
- **功能**: 支持 5 种小程序导航方法
93
-
94
- **代码**:
95
- ```typescript
96
- async function handleNavigate(args: NavigateArgs, context: ToolContext) {
97
- const { sessionId, method, url, delta } = args
98
- const session = context.getSession(sessionId)
99
-
100
- if (!session.miniProgram) {
101
- throw new Error('MiniProgram not connected')
102
- }
103
-
104
- let result
105
- switch (method) {
106
- case 'navigateTo':
107
- result = await session.miniProgram.navigateTo(url!)
108
- break
109
- case 'redirectTo':
110
- result = await session.miniProgram.redirectTo(url!)
111
- break
112
- case 'navigateBack':
113
- result = await session.miniProgram.navigateBack({ delta })
114
- break
115
- case 'switchTab':
116
- result = await session.miniProgram.switchTab(url!)
117
- break
118
- case 'reLaunch':
119
- result = await session.miniProgram.reLaunch(url!)
120
- break
121
- }
122
-
123
- return {
124
- content: [
125
- {
126
- type: 'text',
127
- text: JSON.stringify({
128
- method,
129
- url,
130
- delta,
131
- status: 'success',
132
- }, null, 2),
133
- },
134
- ],
135
- }
136
- }
137
- ```
138
-
139
- **验证**:
140
- - ✅ 支持 5 种导航方法
141
- - ✅ navigateBack 使用 delta 参数
142
- - ✅ 其他方法使用 url 参数
143
-
144
- ---
145
-
146
- ### 3. 实现 callWx 工具 ✅
147
-
148
- **功能**: 调用微信小程序 API
149
-
150
- **代码**:
151
- ```typescript
152
- async function handleCallWx(args: CallWxArgs, context: ToolContext) {
153
- const { sessionId, method, args: wxArgs = {} } = args
154
- const session = context.getSession(sessionId)
155
-
156
- if (!session.miniProgram) {
157
- throw new Error('MiniProgram not connected')
158
- }
159
-
160
- const result = await session.miniProgram.callWxMethod(method, wxArgs)
161
-
162
- return {
163
- content: [
164
- {
165
- type: 'text',
166
- text: JSON.stringify({
167
- method,
168
- result,
169
- }, null, 2),
170
- },
171
- ],
172
- }
173
- }
174
- ```
175
-
176
- **验证**:
177
- - ✅ 调用 wx.* API
178
- - ✅ 传递参数
179
- - ✅ 返回结果
180
-
181
- **示例**:
182
- ```javascript
183
- // 调用 wx.showToast
184
- {
185
- "method": "showToast",
186
- "args": {
187
- "title": "操作成功",
188
- "icon": "success"
189
- }
190
- }
191
- ```
192
-
193
- ---
194
-
195
- ### 4. 实现 evaluate 工具 ✅
196
-
197
- **功能**: 在小程序环境中执行 JavaScript 代码
198
-
199
- **代码**:
200
- ```typescript
201
- async function handleEvaluate(args: EvaluateArgs, context: ToolContext) {
202
- const { sessionId, code } = args
203
- const session = context.getSession(sessionId)
204
-
205
- if (!session.miniProgram) {
206
- throw new Error('MiniProgram not connected')
207
- }
208
-
209
- const result = await session.miniProgram.evaluate(() => {
210
- return eval(code)
211
- })
212
-
213
- return {
214
- content: [
215
- {
216
- type: 'text',
217
- text: JSON.stringify({
218
- code,
219
- result,
220
- }, null, 2),
221
- },
222
- ],
223
- }
224
- }
225
- ```
226
-
227
- **验证**:
228
- - ✅ 执行 JS 代码
229
- - ✅ 返回执行结果
230
- - ✅ 错误捕获
231
-
232
- ---
233
-
234
- ### 5. 实现 screenshot 工具 ✅
235
-
236
- **功能**: 截取当前页面截图
237
-
238
- **代码**:
239
- ```typescript
240
- async function handleScreenshot(args: ScreenshotArgs, context: ToolContext) {
241
- const { sessionId, path } = args
242
- const session = context.getSession(sessionId)
243
-
244
- if (!session.miniProgram) {
245
- throw new Error('MiniProgram not connected')
246
- }
247
-
248
- const timestamp = Date.now()
249
- const filename = path || `screenshot-${timestamp}.png`
250
- const fullPath = join(session.outputDir, 'screenshots', filename)
251
-
252
- // 确保目录存在
253
- await fs.mkdir(dirname(fullPath), { recursive: true })
254
-
255
- await session.miniProgram.screenshot({
256
- path: fullPath,
257
- })
258
-
259
- return {
260
- content: [
261
- {
262
- type: 'text',
263
- text: JSON.stringify({
264
- path: fullPath,
265
- timestamp,
266
- }, null, 2),
267
- },
268
- ],
269
- }
270
- }
271
- ```
272
-
273
- **验证**:
274
- - ✅ 生成截图文件
275
- - ✅ 自动创建目录
276
- - ✅ 返回文件路径
277
-
278
- ---
279
-
280
- ### 6. 实现 getPageStack 工具 ✅
281
-
282
- **功能**: 获取当前页面栈信息
283
-
284
- **代码**:
285
- ```typescript
286
- async function handleGetPageStack(args: SessionArgs, context: ToolContext) {
287
- const { sessionId } = args
288
- const session = context.getSession(sessionId)
289
-
290
- if (!session.miniProgram) {
291
- throw new Error('MiniProgram not connected')
292
- }
293
-
294
- const pages = await session.miniProgram.pageStack()
295
-
296
- return {
297
- content: [
298
- {
299
- type: 'text',
300
- text: JSON.stringify({
301
- pages,
302
- count: pages.length,
303
- }, null, 2),
304
- },
305
- ],
306
- }
307
- }
308
- ```
309
-
310
- **验证**:
311
- - ✅ 返回所有页面路径
312
- - ✅ 包含页面数量
313
-
314
- ---
315
-
316
- ### 7. 实现 getSystemInfo 工具 ✅
317
-
318
- **功能**: 获取设备系统信息
319
-
320
- **代码**:
321
- ```typescript
322
- async function handleGetSystemInfo(args: SessionArgs, context: ToolContext) {
323
- const { sessionId } = args
324
- const session = context.getSession(sessionId)
325
-
326
- if (!session.miniProgram) {
327
- throw new Error('MiniProgram not connected')
328
- }
329
-
330
- const systemInfo = await session.miniProgram.systemInfo()
331
-
332
- return {
333
- content: [
334
- {
335
- type: 'text',
336
- text: JSON.stringify(systemInfo, null, 2),
337
- },
338
- ],
339
- }
340
- }
341
- ```
342
-
343
- **验证**:
344
- - ✅ 返回系统信息对象
345
- - ✅ 包含平台、版本、屏幕等信息
346
-
347
- ---
348
-
349
- ### 8. 编写单元测试 ✅
350
-
351
- **文件**: `tests/unit/miniprogram.test.ts`
352
-
353
- **测试用例** (25 个):
354
- ```typescript
355
- describe('MiniProgram Tools', () => {
356
- describe('navigate', () => {
357
- it('should navigateTo with url', async () => {})
358
- it('should redirectTo with url', async () => {})
359
- it('should navigateBack with delta', async () => {})
360
- it('should switchTab to tabBar page', async () => {})
361
- it('should reLaunch with url', async () => {})
362
- it('should throw error if MiniProgram not connected', async () => {})
363
- it('should handle navigation failure', async () => {})
364
- })
365
-
366
- describe('callWx', () => {
367
- it('should call wx method with args', async () => {})
368
- it('should call wx method without args', async () => {})
369
- it('should return wx method result', async () => {})
370
- it('should handle wx method error', async () => {})
371
- })
372
-
373
- describe('evaluate', () => {
374
- it('should evaluate simple code', async () => {})
375
- it('should evaluate with return value', async () => {})
376
- it('should handle evaluate error', async () => {})
377
- it('should support async code', async () => {})
378
- })
379
-
380
- describe('screenshot', () => {
381
- it('should take screenshot with custom path', async () => {})
382
- it('should take screenshot with auto-generated name', async () => {})
383
- it('should create screenshot directory', async () => {})
384
- it('should handle screenshot failure', async () => {})
385
- })
386
-
387
- describe('getPageStack', () => {
388
- it('should return page stack', async () => {})
389
- it('should return page count', async () => {})
390
- it('should handle empty stack', async () => {})
391
- })
392
-
393
- describe('getSystemInfo', () => {
394
- it('should return system info', async () => {})
395
- it('should include platform', async () => {})
396
- it('should include screen size', async () => {})
397
- })
398
- })
399
- ```
400
-
401
- **验证**:
402
- - ✅ 25 个测试全部通过
403
- - ✅ Mock MiniProgram 实例
404
- - ✅ 覆盖成功和失败场景
405
-
406
- ---
407
-
408
- ## 完成标准 (Definition of Done)
409
-
410
- ### 功能完成 ✅
411
-
412
- - [x] navigate 支持 5 种导航方法
413
- - [x] callWx 调用微信 API 成功
414
- - [x] evaluate 执行 JS 代码
415
- - [x] screenshot 生成截图文件
416
- - [x] getPageStack 返回页面栈
417
- - [x] getSystemInfo 返回系统信息
418
-
419
- ### 代码质量 ✅
420
-
421
- - [x] TypeScript 编译 0 错误
422
- - [x] 无 ESLint 错误
423
- - [x] 代码行数 330 行(合理范围)
424
- - [x] JSDoc 注释完整
425
- - [x] 符合 ESM 规范(.js 后缀)
426
-
427
- ### 测试 ✅
428
-
429
- - [x] 单元测试 403 行
430
- - [x] 25 个测试用例全部通过
431
- - [x] 覆盖所有导航方法
432
- - [x] Mock 外部依赖
433
-
434
- ### 文档 ⏳
435
-
436
- - [x] 代码注释完整
437
- - [x] Schema 描述清晰
438
- - ⏳ charter.C2.align.yaml (追溯)
439
- - ⏳ tasks.C2.atomize.md (本文档)
440
-
441
- ---
442
-
443
- ## 实现结果 (Implementation)
444
-
445
- ### 文件清单
446
-
447
- | 文件 | 行数 | 说明 |
448
- |------|------|------|
449
- | `src/tools/miniprogram.ts` | 330 | 6 个 MiniProgram 工具实现 |
450
- | `tests/unit/miniprogram.test.ts` | 403 | 25 个单元测试 |
451
-
452
- ### 工具列表
453
-
454
- | 工具名 | 功能 | 输入 | 输出 |
455
- |--------|------|------|------|
456
- | `miniapp_miniprogram_navigate` | 页面导航 | sessionId, method, url?, delta? | status |
457
- | `miniapp_miniprogram_callWx` | 调用 wx API | sessionId, method, args? | result |
458
- | `miniapp_miniprogram_evaluate` | 执行 JS 代码 | sessionId, code | result |
459
- | `miniapp_miniprogram_screenshot` | 截取页面截图 | sessionId, path? | path, timestamp |
460
- | `miniapp_miniprogram_getPageStack` | 获取页面栈 | sessionId | pages, count |
461
- | `miniapp_miniprogram_getSystemInfo` | 获取系统信息 | sessionId | systemInfo |
462
-
463
- ### 导航方法
464
-
465
- | 方法 | 说明 | 参数 | 限制 |
466
- |------|------|------|------|
467
- | `navigateTo` | 跳转到新页面 | url | 最多 10 层 |
468
- | `redirectTo` | 重定向页面 | url | 关闭当前页面 |
469
- | `navigateBack` | 返回上一页 | delta | 不能超过当前层级 |
470
- | `switchTab` | 切换 tabBar | url | 仅限 tabBar 页面 |
471
- | `reLaunch` | 重启到页面 | url | 关闭所有页面 |
472
-
473
- ### 设计决策
474
-
475
- 1. **导航方法枚举**
476
- - 使用 zod.enum 定义 5 种方法
477
- - 理由:类型安全,自动校验
478
-
479
- 2. **截图路径管理**
480
- - 默认路径: `{outputDir}/screenshots/`
481
- - 文件名: `screenshot-{timestamp}.png`
482
- - 理由:避免文件冲突,便于管理
483
-
484
- 3. **evaluate 安全性**
485
- - 在小程序环境中执行
486
- - 理由:隔离安全风险
487
-
488
- 4. **错误处理**
489
- - 明确检查 MiniProgram 实例
490
- - 理由:防止空指针错误
491
-
492
- ---
493
-
494
- ## 测试证据 (Test Evidence)
495
-
496
- ### 单元测试结果
497
-
498
- ```bash
499
- $ pnpm test miniprogram.test.ts
500
-
501
- PASS tests/unit/miniprogram.test.ts
502
- MiniProgram Tools
503
- navigate
504
- ✓ should navigateTo with url (12ms)
505
- ✓ should redirectTo with url (8ms)
506
- ✓ should navigateBack with delta (9ms)
507
- ✓ should switchTab to tabBar page (7ms)
508
- ✓ should reLaunch with url (8ms)
509
- ✓ should throw error if MiniProgram not connected (5ms)
510
- ✓ should handle navigation failure (6ms)
511
- callWx
512
- ✓ should call wx method with args (10ms)
513
- ✓ should call wx method without args (7ms)
514
- ✓ should return wx method result (8ms)
515
- ✓ should handle wx method error (6ms)
516
- evaluate
517
- ✓ should evaluate simple code (11ms)
518
- ✓ should evaluate with return value (9ms)
519
- ✓ should handle evaluate error (7ms)
520
- ✓ should support async code (10ms)
521
- screenshot
522
- ✓ should take screenshot with custom path (13ms)
523
- ✓ should take screenshot with auto-generated name (12ms)
524
- ✓ should create screenshot directory (9ms)
525
- ✓ should handle screenshot failure (7ms)
526
- getPageStack
527
- ✓ should return page stack (8ms)
528
- ✓ should return page count (7ms)
529
- ✓ should handle empty stack (6ms)
530
- getSystemInfo
531
- ✓ should return system info (9ms)
532
- ✓ should include platform (7ms)
533
- ✓ should include screen size (8ms)
534
-
535
- Test Suites: 1 passed, 1 total
536
- Tests: 25 passed, 25 total
537
- Time: 3.125s
538
- ```
539
-
540
- ### 手动测试
541
-
542
- **导航到新页面**:
543
- ```bash
544
- # 通过 MCP 调用 navigate
545
- {
546
- "sessionId": "xxx",
547
- "method": "navigateTo",
548
- "url": "/pages/detail/detail"
549
- }
550
-
551
- # 返回
552
- {
553
- "method": "navigateTo",
554
- "url": "/pages/detail/detail",
555
- "status": "success"
556
- }
557
- ```
558
-
559
- **调用微信 API**:
560
- ```bash
561
- # 通过 MCP 调用 callWx
562
- {
563
- "sessionId": "xxx",
564
- "method": "showToast",
565
- "args": {
566
- "title": "操作成功",
567
- "icon": "success"
568
- }
569
- }
570
-
571
- # 返回
572
- {
573
- "method": "showToast",
574
- "result": { "errMsg": "showToast:ok" }
575
- }
576
- ```
577
-
578
- **截取页面截图**:
579
- ```bash
580
- # 通过 MCP 调用 screenshot
581
- {
582
- "sessionId": "xxx"
583
- }
584
-
585
- # 返回
586
- {
587
- "path": "/path/to/output/screenshots/screenshot-1696234567890.png",
588
- "timestamp": 1696234567890
589
- }
590
- ```
591
-
592
- ---
593
-
594
- ## 已知问题 (Known Issues)
595
-
596
- ### 技术债务
597
-
598
- 1. **截图文件管理** - 🟢 低优先级
599
- - 原因:未实现自动清理机制
600
- - 影响:长期运行可能占用大量磁盘
601
- - 计划:用户自行管理或添加清理工具
602
-
603
- 2. **evaluate 安全性** - 🟡 中优先级
604
- - 原因:可执行任意代码
605
- - 影响:潜在安全风险
606
- - 计划:添加代码沙箱或白名单
607
-
608
- ### 风险
609
-
610
- 1. **导航时序** - 🟡 中风险
611
- - 缓解:使用 await 等待导航完成
612
- - 监控:测试中验证页面加载状态
613
-
614
- ---
615
-
616
- ## 参考资料 (References)
617
-
618
- ### 文档
619
-
620
- - `docs/charter.C2.align.yaml` - 任务对齐文档
621
- - `docs/微信小程序自动化完整操作手册.md` - MiniProgram API 参考
622
- - 微信小程序官方文档 - 导航 API
623
-
624
- ### 代码
625
-
626
- - `src/tools/automator.ts` - Automator 工具(C1)
627
- - `src/core/session.ts` - Session 管理
628
- - `src/tools/index.ts` - 工具注册器(C5)
629
-
630
- ### 外部资源
631
-
632
- - [miniprogram-automator MiniProgram API](https://developers.weixin.qq.com/miniprogram/dev/devtools/auto/miniprogram.html)
633
- - [微信小程序导航 API](https://developers.weixin.qq.com/miniprogram/dev/api/route/wx.navigateTo.html)
634
-
635
- ---
636
-
637
- ## 后续任务 (Next Steps)
638
-
639
- ### 依赖此任务的后续任务
640
-
641
- - ✅ C3: Page 工具(需要先导航到页面)
642
- - ✅ C4: Element 工具(需要 Page 实例)
643
- - ✅ C5: 工具注册器(集成 MiniProgram 工具)
644
-
645
- ### 改进建议
646
-
647
- 1. **导航历史管理**
648
- - 记录导航历史
649
- - 支持前进/后退
650
-
651
- 2. **截图增强**
652
- - 支持元素截图
653
- - 支持多种格式(JPEG, WebP)
654
- - 支持压缩和质量调节
655
-
656
- 3. **evaluate 增强**
657
- - 添加代码沙箱
658
- - 支持 TypeScript
659
- - 提供代码提示
660
-
661
- ---
662
-
663
- **任务状态**: ✅ COMPLETED
664
- **代码提交**: ✅ 已提交(Stage C 提交)
665
- **文档状态**: ⏳ RETROSPECTIVE (追溯补齐中)