@lovrabet/rabetbase-cli 2.3.16-beta.3 → 2.3.16-beta.5

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 (568) hide show
  1. package/lib/api/api-doc.d.ts +9 -0
  2. package/lib/api/api-doc.js +1 -1
  3. package/lib/api/fetch-model-list.d.ts +2 -0
  4. package/lib/api/fetch-model-list.js +1 -1
  5. package/lib/api/generate-api-file.d.ts +8 -0
  6. package/lib/api/generate-api-file.js +1 -1
  7. package/lib/auth/auth-server-ui.d.ts +13 -0
  8. package/lib/auth/auth-server-ui.js +1 -1
  9. package/lib/auth/auth-server.d.ts +25 -0
  10. package/lib/auth/auth-server.js +1 -1
  11. package/lib/auth/constant.d.ts +2 -0
  12. package/lib/auth/constant.js +1 -1
  13. package/lib/auth/get-cookie.d.ts +1 -0
  14. package/lib/auth/get-cookie.js +1 -1
  15. package/lib/auth/get-session-user.d.ts +51 -0
  16. package/lib/auth/get-session-user.js +1 -1
  17. package/lib/auth/is-session-valid.d.ts +1 -0
  18. package/lib/auth/is-session-valid.js +1 -1
  19. package/lib/auth/login-success-html.d.ts +5 -0
  20. package/lib/auth/login-success-html.js +1 -1
  21. package/lib/auth/logout.d.ts +1 -0
  22. package/lib/auth/logout.js +1 -1
  23. package/lib/cli-flags.d.ts +12 -0
  24. package/lib/cli-flags.js +1 -1
  25. package/lib/cli.d.ts +2 -0
  26. package/lib/cli.js +1 -1
  27. package/lib/commands/api/generate.d.ts +2 -0
  28. package/lib/commands/api/generate.js +1 -1
  29. package/lib/commands/api/index.d.ts +2 -0
  30. package/lib/commands/api/index.js +1 -1
  31. package/lib/commands/api/list.d.ts +2 -0
  32. package/lib/commands/api/list.js +1 -1
  33. package/lib/commands/api/pull.d.ts +2 -0
  34. package/lib/commands/api/pull.js +1 -1
  35. package/lib/commands/api/shared.d.ts +18 -0
  36. package/lib/commands/api/shared.js +1 -1
  37. package/lib/commands/app/index.d.ts +5 -0
  38. package/lib/commands/app/index.js +1 -1
  39. package/lib/commands/app/list.d.ts +10 -0
  40. package/lib/commands/app/list.js +1 -1
  41. package/lib/commands/app/members-list.d.ts +2 -0
  42. package/lib/commands/app/members-list.js +1 -1
  43. package/lib/commands/app/remote-directory.d.ts +11 -0
  44. package/lib/commands/app/remote-directory.js +1 -1
  45. package/lib/commands/app/shared.d.ts +46 -0
  46. package/lib/commands/app/shared.js +1 -1
  47. package/lib/commands/app-config/delete.d.ts +2 -0
  48. package/lib/commands/app-config/delete.js +1 -1
  49. package/lib/commands/app-config/get.d.ts +2 -0
  50. package/lib/commands/app-config/get.js +1 -1
  51. package/lib/commands/app-config/index.d.ts +2 -0
  52. package/lib/commands/app-config/index.js +1 -1
  53. package/lib/commands/app-config/list.d.ts +2 -0
  54. package/lib/commands/app-config/list.js +1 -1
  55. package/lib/commands/app-config/set.d.ts +2 -0
  56. package/lib/commands/app-config/set.js +1 -1
  57. package/lib/commands/app-config/shared.d.ts +105 -0
  58. package/lib/commands/app-config/shared.js +1 -1
  59. package/lib/commands/auth/index.d.ts +2 -0
  60. package/lib/commands/auth/index.js +1 -1
  61. package/lib/commands/bff/create.d.ts +4 -0
  62. package/lib/commands/bff/create.js +1 -1
  63. package/lib/commands/bff/delete.d.ts +2 -0
  64. package/lib/commands/bff/delete.js +1 -1
  65. package/lib/commands/bff/detail.d.ts +2 -0
  66. package/lib/commands/bff/detail.js +1 -1
  67. package/lib/commands/bff/index.d.ts +5 -0
  68. package/lib/commands/bff/index.js +1 -1
  69. package/lib/commands/bff/list.d.ts +2 -0
  70. package/lib/commands/bff/list.js +1 -1
  71. package/lib/commands/bff/pull.d.ts +2 -0
  72. package/lib/commands/bff/pull.js +1 -1
  73. package/lib/commands/bff/push.d.ts +2 -0
  74. package/lib/commands/bff/push.js +1 -1
  75. package/lib/commands/bff/status.d.ts +2 -0
  76. package/lib/commands/bff/status.js +1 -1
  77. package/lib/commands/cli-skill/index.d.ts +8 -0
  78. package/lib/commands/cli-skill/index.js +1 -1
  79. package/lib/commands/cli-update.d.ts +2 -0
  80. package/lib/commands/cli-update.js +1 -1
  81. package/lib/commands/codegen/index.d.ts +2 -0
  82. package/lib/commands/codegen/index.js +1 -1
  83. package/lib/commands/codegen/sdk.d.ts +2 -0
  84. package/lib/commands/codegen/sdk.js +1 -1
  85. package/lib/commands/codegen/sql.d.ts +2 -0
  86. package/lib/commands/codegen/sql.js +1 -1
  87. package/lib/commands/common/app-registry.d.ts +17 -0
  88. package/lib/commands/common/app-registry.js +1 -1
  89. package/lib/commands/common/app-selector.d.ts +17 -0
  90. package/lib/commands/common/app-selector.js +1 -1
  91. package/lib/commands/common/async-task.d.ts +11 -0
  92. package/lib/commands/common/async-task.js +1 -1
  93. package/lib/commands/common/dry-run.d.ts +12 -0
  94. package/lib/commands/common/dry-run.js +1 -1
  95. package/lib/commands/common/flags.d.ts +26 -0
  96. package/lib/commands/common/flags.js +1 -1
  97. package/lib/commands/common/local-file.d.ts +6 -0
  98. package/lib/commands/common/local-file.js +1 -1
  99. package/lib/commands/common/validate.d.ts +13 -0
  100. package/lib/commands/common/validate.js +1 -1
  101. package/lib/commands/config/get.d.ts +5 -0
  102. package/lib/commands/config/get.js +1 -1
  103. package/lib/commands/config/index.d.ts +5 -0
  104. package/lib/commands/config/index.js +1 -1
  105. package/lib/commands/config/list.d.ts +5 -0
  106. package/lib/commands/config/list.js +1 -1
  107. package/lib/commands/config/set.d.ts +5 -0
  108. package/lib/commands/config/set.js +1 -1
  109. package/lib/commands/config/shared.d.ts +16 -0
  110. package/lib/commands/config/shared.js +1 -1
  111. package/lib/commands/data/filter.d.ts +7 -0
  112. package/lib/commands/data/filter.js +1 -1
  113. package/lib/commands/data/getOne.d.ts +7 -0
  114. package/lib/commands/data/getOne.js +1 -1
  115. package/lib/commands/data/index.d.ts +8 -0
  116. package/lib/commands/data/index.js +1 -1
  117. package/lib/commands/data/shared.d.ts +33 -0
  118. package/lib/commands/data/shared.js +1 -1
  119. package/lib/commands/dataset/business-group-update.d.ts +18 -0
  120. package/lib/commands/dataset/business-group-update.js +1 -1
  121. package/lib/commands/dataset/capability.d.ts +11 -0
  122. package/lib/commands/dataset/capability.js +1 -1
  123. package/lib/commands/dataset/delete.d.ts +2 -0
  124. package/lib/commands/dataset/delete.js +1 -1
  125. package/lib/commands/dataset/detail.d.ts +2 -0
  126. package/lib/commands/dataset/detail.js +1 -1
  127. package/lib/commands/dataset/extend-update.d.ts +26 -0
  128. package/lib/commands/dataset/extend-update.js +1 -1
  129. package/lib/commands/dataset/field-update.d.ts +27 -0
  130. package/lib/commands/dataset/field-update.js +1 -1
  131. package/lib/commands/dataset/generate.d.ts +3 -0
  132. package/lib/commands/dataset/generate.js +1 -1
  133. package/lib/commands/dataset/index.d.ts +2 -0
  134. package/lib/commands/dataset/index.js +1 -1
  135. package/lib/commands/dataset/list.d.ts +2 -0
  136. package/lib/commands/dataset/list.js +1 -1
  137. package/lib/commands/dataset/operations.d.ts +2 -0
  138. package/lib/commands/dataset/operations.js +1 -1
  139. package/lib/commands/dataset/relation-audit.d.ts +2 -0
  140. package/lib/commands/dataset/relation-audit.js +1 -1
  141. package/lib/commands/dataset/relation-create.d.ts +2 -0
  142. package/lib/commands/dataset/relation-create.js +1 -1
  143. package/lib/commands/dataset/relation-delete.d.ts +2 -0
  144. package/lib/commands/dataset/relation-delete.js +1 -1
  145. package/lib/commands/dataset/relation-shared.d.ts +128 -0
  146. package/lib/commands/dataset/relation-shared.js +1 -1
  147. package/lib/commands/dataset/relation-update.d.ts +2 -0
  148. package/lib/commands/dataset/relation-update.js +1 -1
  149. package/lib/commands/dataset/relations.d.ts +53 -0
  150. package/lib/commands/dataset/relations.js +1 -1
  151. package/lib/commands/dataset/rename.d.ts +17 -0
  152. package/lib/commands/dataset/rename.js +1 -1
  153. package/lib/commands/dataset/restore.d.ts +2 -0
  154. package/lib/commands/dataset/restore.js +1 -1
  155. package/lib/commands/db/analysis-batching.d.ts +30 -0
  156. package/lib/commands/db/analysis-batching.js +1 -1
  157. package/lib/commands/db/analyze-batch-plan.d.ts +2 -0
  158. package/lib/commands/db/analyze-batch-plan.js +1 -1
  159. package/lib/commands/db/analyze-cancel.d.ts +2 -0
  160. package/lib/commands/db/analyze-cancel.js +1 -1
  161. package/lib/commands/db/analyze-start.d.ts +2 -0
  162. package/lib/commands/db/analyze-start.js +1 -1
  163. package/lib/commands/db/analyze-status.d.ts +2 -0
  164. package/lib/commands/db/analyze-status.js +1 -1
  165. package/lib/commands/db/create.d.ts +2 -0
  166. package/lib/commands/db/create.js +1 -1
  167. package/lib/commands/db/delete.d.ts +2 -0
  168. package/lib/commands/db/delete.js +1 -1
  169. package/lib/commands/db/detail.d.ts +2 -0
  170. package/lib/commands/db/detail.js +1 -1
  171. package/lib/commands/db/diff.d.ts +2 -0
  172. package/lib/commands/db/diff.js +1 -1
  173. package/lib/commands/db/index.d.ts +5 -0
  174. package/lib/commands/db/index.js +1 -1
  175. package/lib/commands/db/list.d.ts +2 -0
  176. package/lib/commands/db/list.js +1 -1
  177. package/lib/commands/db/shared.d.ts +15 -0
  178. package/lib/commands/db/shared.js +1 -1
  179. package/lib/commands/db/tables.d.ts +2 -0
  180. package/lib/commands/db/tables.js +1 -1
  181. package/lib/commands/db/test.d.ts +2 -0
  182. package/lib/commands/db/test.js +1 -1
  183. package/lib/commands/db/update.d.ts +2 -0
  184. package/lib/commands/db/update.js +1 -1
  185. package/lib/commands/doctor.d.ts +2 -0
  186. package/lib/commands/doctor.js +1 -1
  187. package/lib/commands/file/index.d.ts +2 -0
  188. package/lib/commands/file/index.js +1 -1
  189. package/lib/commands/init/index.d.ts +11 -0
  190. package/lib/commands/init/index.js +1 -1
  191. package/lib/commands/issue/index.d.ts +2 -0
  192. package/lib/commands/issue/index.js +1 -1
  193. package/lib/commands/issue/nudge.d.ts +23 -0
  194. package/lib/commands/issue/nudge.js +1 -1
  195. package/lib/commands/issue/report.d.ts +2 -0
  196. package/lib/commands/issue/report.js +1 -1
  197. package/lib/commands/issue/shared.d.ts +32 -0
  198. package/lib/commands/issue/shared.js +1 -1
  199. package/lib/commands/kb/create.d.ts +2 -0
  200. package/lib/commands/kb/create.js +1 -1
  201. package/lib/commands/kb/delete.d.ts +2 -0
  202. package/lib/commands/kb/delete.js +1 -1
  203. package/lib/commands/kb/detail.d.ts +2 -0
  204. package/lib/commands/kb/detail.js +1 -1
  205. package/lib/commands/kb/index.d.ts +2 -0
  206. package/lib/commands/kb/index.js +1 -1
  207. package/lib/commands/kb/list.d.ts +2 -0
  208. package/lib/commands/kb/list.js +1 -1
  209. package/lib/commands/kb/shared.d.ts +33 -0
  210. package/lib/commands/kb/shared.js +1 -1
  211. package/lib/commands/kb/update.d.ts +2 -0
  212. package/lib/commands/kb/update.js +1 -1
  213. package/lib/commands/logs/index.d.ts +5 -0
  214. package/lib/commands/logs/index.js +1 -1
  215. package/lib/commands/menu/asset-update.d.ts +2 -0
  216. package/lib/commands/menu/asset-update.js +1 -1
  217. package/lib/commands/menu/delete.d.ts +2 -0
  218. package/lib/commands/menu/delete.js +1 -1
  219. package/lib/commands/menu/external-link-create.d.ts +3 -0
  220. package/lib/commands/menu/external-link-create.js +1 -1
  221. package/lib/commands/menu/external-link-update.d.ts +2 -0
  222. package/lib/commands/menu/external-link-update.js +1 -1
  223. package/lib/commands/menu/group-create.d.ts +2 -0
  224. package/lib/commands/menu/group-create.js +1 -1
  225. package/lib/commands/menu/group-update.d.ts +2 -0
  226. package/lib/commands/menu/group-update.js +1 -1
  227. package/lib/commands/menu/index.d.ts +17 -0
  228. package/lib/commands/menu/index.js +1 -1
  229. package/lib/commands/menu/list.d.ts +2 -0
  230. package/lib/commands/menu/list.js +1 -1
  231. package/lib/commands/menu/move.d.ts +2 -0
  232. package/lib/commands/menu/move.js +1 -1
  233. package/lib/commands/menu/regroup-start.d.ts +2 -0
  234. package/lib/commands/menu/regroup-start.js +1 -1
  235. package/lib/commands/menu/rename.d.ts +2 -0
  236. package/lib/commands/menu/rename.js +1 -1
  237. package/lib/commands/menu/shared/compare-table.d.ts +27 -0
  238. package/lib/commands/menu/shared/compare-table.js +1 -1
  239. package/lib/commands/menu/shared/delete-plan.d.ts +51 -0
  240. package/lib/commands/menu/shared/delete-plan.js +1 -1
  241. package/lib/commands/menu/shared/facts.d.ts +12 -0
  242. package/lib/commands/menu/shared/facts.js +1 -1
  243. package/lib/commands/menu/shared/index.d.ts +12 -0
  244. package/lib/commands/menu/shared/index.js +1 -1
  245. package/lib/commands/menu/shared/inquirer.d.ts +10 -0
  246. package/lib/commands/menu/shared/inquirer.js +1 -1
  247. package/lib/commands/menu/shared/local-pages.d.ts +12 -0
  248. package/lib/commands/menu/shared/local-pages.js +1 -1
  249. package/lib/commands/menu/shared/logic.d.ts +28 -0
  250. package/lib/commands/menu/shared/logic.js +1 -1
  251. package/lib/commands/menu/shared/mutations.d.ts +69 -0
  252. package/lib/commands/menu/shared/mutations.js +1 -1
  253. package/lib/commands/menu/shared/service.d.ts +17 -0
  254. package/lib/commands/menu/shared/service.js +1 -1
  255. package/lib/commands/menu/shared/sync-core.d.ts +7 -0
  256. package/lib/commands/menu/shared/sync-core.js +1 -1
  257. package/lib/commands/menu/shared/types.d.ts +162 -0
  258. package/lib/commands/menu/shared/update-core.d.ts +11 -0
  259. package/lib/commands/menu/shared/update-core.js +1 -1
  260. package/lib/commands/menu/shared/valid-url.d.ts +6 -0
  261. package/lib/commands/menu/shared/valid-url.js +1 -1
  262. package/lib/commands/menu/sync.d.ts +2 -0
  263. package/lib/commands/menu/sync.js +1 -1
  264. package/lib/commands/notification/config-list.d.ts +2 -0
  265. package/lib/commands/notification/config-list.js +1 -1
  266. package/lib/commands/notification/index.d.ts +2 -0
  267. package/lib/commands/notification/index.js +1 -1
  268. package/lib/commands/ocr/index.d.ts +2 -0
  269. package/lib/commands/ocr/index.js +1 -1
  270. package/lib/commands/page/generate-start.d.ts +2 -0
  271. package/lib/commands/page/generate-start.js +1 -1
  272. package/lib/commands/page/generate-status.d.ts +2 -0
  273. package/lib/commands/page/generate-status.js +1 -1
  274. package/lib/commands/page/index.d.ts +2 -0
  275. package/lib/commands/page/index.js +1 -1
  276. package/lib/commands/page/pull.d.ts +2 -0
  277. package/lib/commands/page/pull.js +1 -1
  278. package/lib/commands/page/push.d.ts +2 -0
  279. package/lib/commands/page/push.js +1 -1
  280. package/lib/commands/page/relation-audit.d.ts +2 -0
  281. package/lib/commands/page/relation-audit.js +1 -1
  282. package/lib/commands/page/restore.d.ts +2 -0
  283. package/lib/commands/page/restore.js +1 -1
  284. package/lib/commands/page/shared.d.ts +105 -0
  285. package/lib/commands/page/shared.js +1 -1
  286. package/lib/commands/page/standard-page-status.d.ts +2 -0
  287. package/lib/commands/page/standard-page-status.js +1 -1
  288. package/lib/commands/page/sync.d.ts +2 -0
  289. package/lib/commands/page/sync.js +1 -1
  290. package/lib/commands/permit/index.d.ts +2 -0
  291. package/lib/commands/permit/index.js +1 -1
  292. package/lib/commands/permit/page-get.d.ts +2 -0
  293. package/lib/commands/permit/page-get.js +1 -1
  294. package/lib/commands/permit/page-set.d.ts +2 -0
  295. package/lib/commands/permit/page-set.js +1 -1
  296. package/lib/commands/permit/role-apis-set.d.ts +2 -0
  297. package/lib/commands/permit/role-apis-set.js +1 -1
  298. package/lib/commands/permit/role-menus-set.d.ts +2 -0
  299. package/lib/commands/permit/role-menus-set.js +1 -1
  300. package/lib/commands/permit/role-menus.d.ts +2 -0
  301. package/lib/commands/permit/role-menus.js +1 -1
  302. package/lib/commands/permit/shared.d.ts +74 -0
  303. package/lib/commands/permit/shared.js +1 -1
  304. package/lib/commands/project/create/enhanced-guided-create.d.ts +7 -0
  305. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  306. package/lib/commands/project/create/format-elapsed.d.ts +1 -0
  307. package/lib/commands/project/create/format-elapsed.js +1 -1
  308. package/lib/commands/project/create/main.d.ts +6 -0
  309. package/lib/commands/project/create/main.js +1 -1
  310. package/lib/commands/project/create/non-interactive.d.ts +9 -0
  311. package/lib/commands/project/create/non-interactive.js +1 -1
  312. package/lib/commands/project/create/project-template-path.d.ts +4 -0
  313. package/lib/commands/project/create/project-template-path.js +1 -1
  314. package/lib/commands/project/create/use-copy-project-template.d.ts +1 -0
  315. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  316. package/lib/commands/project/create/use-format-code.d.ts +1 -0
  317. package/lib/commands/project/create/use-format-code.js +1 -1
  318. package/lib/commands/project/create/use-install-dependencies.d.ts +1 -0
  319. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  320. package/lib/commands/project/index.d.ts +2 -0
  321. package/lib/commands/project/index.js +1 -1
  322. package/lib/commands/project/upgrade.d.ts +1 -0
  323. package/lib/commands/project/upgrade.js +1 -1
  324. package/lib/commands/registry.d.ts +66 -0
  325. package/lib/commands/registry.js +1 -1
  326. package/lib/commands/role/create.d.ts +2 -0
  327. package/lib/commands/role/create.js +1 -1
  328. package/lib/commands/role/delete.d.ts +2 -0
  329. package/lib/commands/role/delete.js +1 -1
  330. package/lib/commands/role/detail.d.ts +2 -0
  331. package/lib/commands/role/detail.js +1 -1
  332. package/lib/commands/role/index.d.ts +2 -0
  333. package/lib/commands/role/index.js +1 -1
  334. package/lib/commands/role/list.d.ts +2 -0
  335. package/lib/commands/role/list.js +1 -1
  336. package/lib/commands/role/shared.d.ts +107 -0
  337. package/lib/commands/role/shared.js +1 -1
  338. package/lib/commands/role/update.d.ts +2 -0
  339. package/lib/commands/role/update.js +1 -1
  340. package/lib/commands/role/user-add.d.ts +2 -0
  341. package/lib/commands/role/user-add.js +1 -1
  342. package/lib/commands/role/user-remove.d.ts +2 -0
  343. package/lib/commands/role/user-remove.js +1 -1
  344. package/lib/commands/role/user-resolve.d.ts +2 -0
  345. package/lib/commands/role/user-resolve.js +1 -1
  346. package/lib/commands/run/index.d.ts +2 -0
  347. package/lib/commands/run/index.js +1 -1
  348. package/lib/commands/schema.d.ts +5 -0
  349. package/lib/commands/schema.js +1 -1
  350. package/lib/commands/sql/create.d.ts +10 -0
  351. package/lib/commands/sql/create.js +1 -1
  352. package/lib/commands/sql/delete.d.ts +5 -0
  353. package/lib/commands/sql/delete.js +1 -1
  354. package/lib/commands/sql/detail.d.ts +2 -0
  355. package/lib/commands/sql/detail.js +1 -1
  356. package/lib/commands/sql/exec.d.ts +2 -0
  357. package/lib/commands/sql/exec.js +1 -1
  358. package/lib/commands/sql/index.d.ts +5 -0
  359. package/lib/commands/sql/index.js +1 -1
  360. package/lib/commands/sql/list.d.ts +2 -0
  361. package/lib/commands/sql/list.js +1 -1
  362. package/lib/commands/sql/pull.d.ts +5 -0
  363. package/lib/commands/sql/pull.js +1 -1
  364. package/lib/commands/sql/push.d.ts +5 -0
  365. package/lib/commands/sql/push.js +1 -1
  366. package/lib/commands/sql/shared.d.ts +23 -0
  367. package/lib/commands/sql/shared.js +1 -1
  368. package/lib/commands/sql/status.d.ts +5 -0
  369. package/lib/commands/sql/status.js +1 -1
  370. package/lib/commands/sql/validate.d.ts +2 -0
  371. package/lib/commands/sql/validate.js +1 -1
  372. package/lib/commands/task/index.d.ts +2 -0
  373. package/lib/commands/task/index.js +1 -1
  374. package/lib/commands/task/status.d.ts +2 -0
  375. package/lib/commands/task/status.js +1 -1
  376. package/lib/commands/tenant/index.d.ts +2 -0
  377. package/lib/commands/tenant/index.js +1 -1
  378. package/lib/commands/tenant/members-list.d.ts +2 -0
  379. package/lib/commands/tenant/members-list.js +1 -1
  380. package/lib/commands/tenant/shared.d.ts +10 -0
  381. package/lib/commands/tenant/shared.js +1 -1
  382. package/lib/commands/workspace/add.d.ts +6 -0
  383. package/lib/commands/workspace/add.js +1 -1
  384. package/lib/commands/workspace/index.d.ts +11 -0
  385. package/lib/commands/workspace/index.js +1 -1
  386. package/lib/commands/workspace/remove.d.ts +6 -0
  387. package/lib/commands/workspace/remove.js +1 -1
  388. package/lib/config/schema.d.ts +50 -0
  389. package/lib/config/schema.js +1 -1
  390. package/lib/constant/cdn.d.ts +1 -0
  391. package/lib/constant/cdn.js +1 -1
  392. package/lib/constant/cli.d.ts +34 -0
  393. package/lib/constant/cli.js +1 -1
  394. package/lib/constant/defaults.d.ts +10 -0
  395. package/lib/constant/defaults.js +1 -1
  396. package/lib/constant/domain.d.ts +14 -0
  397. package/lib/constant/domain.js +1 -1
  398. package/lib/constant/env.d.ts +11 -0
  399. package/lib/constant/env.js +1 -1
  400. package/lib/constant/output.d.ts +1 -0
  401. package/lib/constant/output.js +1 -1
  402. package/lib/constant/paths.d.ts +5 -0
  403. package/lib/constant/paths.js +1 -1
  404. package/lib/constant/risk.d.ts +1 -0
  405. package/lib/constant/risk.js +1 -1
  406. package/lib/context/app-resolver.d.ts +36 -0
  407. package/lib/context/app-resolver.js +1 -1
  408. package/lib/context/auth-resolver.d.ts +5 -0
  409. package/lib/context/auth-resolver.js +1 -1
  410. package/lib/context/config-loader.d.ts +61 -0
  411. package/lib/context/config-loader.js +1 -1
  412. package/lib/context.d.ts +102 -0
  413. package/lib/context.js +1 -1
  414. package/lib/core/alias-resolver.d.ts +31 -0
  415. package/lib/core/alias-resolver.js +1 -1
  416. package/lib/core/api-client.d.ts +1018 -0
  417. package/lib/core/api-client.js +1 -1
  418. package/lib/core/bff/config.d.ts +8 -0
  419. package/lib/core/bff/config.js +1 -1
  420. package/lib/core/bff/file-system.d.ts +28 -0
  421. package/lib/core/bff/file-system.js +1 -1
  422. package/lib/core/bff/hash.d.ts +7 -0
  423. package/lib/core/bff/hash.js +1 -1
  424. package/lib/core/bff/lock.d.ts +25 -0
  425. package/lib/core/bff/lock.js +1 -1
  426. package/lib/core/bff/types.d.ts +92 -0
  427. package/lib/core/bff/utils.d.ts +25 -0
  428. package/lib/core/bff/utils.js +1 -1
  429. package/lib/core/db-resolver.d.ts +43 -0
  430. package/lib/core/db-resolver.js +1 -1
  431. package/lib/core/page/file-system.d.ts +6 -0
  432. package/lib/core/page/file-system.js +1 -1
  433. package/lib/core/page/hash.d.ts +4 -0
  434. package/lib/core/page/hash.js +1 -1
  435. package/lib/core/page/lock.d.ts +8 -0
  436. package/lib/core/page/lock.js +1 -1
  437. package/lib/core/page/types.d.ts +22 -0
  438. package/lib/core/sql-index-auditor.d.ts +33 -0
  439. package/lib/core/sql-index-auditor.js +1 -1
  440. package/lib/core/sql-sync/config.d.ts +7 -0
  441. package/lib/core/sql-sync/config.js +1 -1
  442. package/lib/core/sql-sync/file-system.d.ts +7 -0
  443. package/lib/core/sql-sync/file-system.js +1 -1
  444. package/lib/core/sql-sync/hash.d.ts +5 -0
  445. package/lib/core/sql-sync/hash.js +1 -1
  446. package/lib/core/sql-sync/lock.d.ts +14 -0
  447. package/lib/core/sql-sync/lock.js +1 -1
  448. package/lib/core/sql-sync/types.d.ts +43 -0
  449. package/lib/core/sql-sync/utils.d.ts +10 -0
  450. package/lib/core/sql-sync/utils.js +1 -1
  451. package/lib/core/sql-validator.d.ts +34 -0
  452. package/lib/core/sql-validator.js +1 -1
  453. package/lib/errors.d.ts +3 -0
  454. package/lib/errors.js +1 -1
  455. package/lib/framework/build-all-flags.d.ts +2 -0
  456. package/lib/framework/build-all-flags.js +1 -1
  457. package/lib/framework/error-output.d.ts +9 -0
  458. package/lib/framework/error-output.js +1 -1
  459. package/lib/framework/explicit-yes.d.ts +3 -0
  460. package/lib/framework/explicit-yes.js +1 -1
  461. package/lib/framework/flags.d.ts +3 -0
  462. package/lib/framework/flags.js +1 -1
  463. package/lib/framework/help.d.ts +4 -0
  464. package/lib/framework/help.js +1 -1
  465. package/lib/framework/index.d.ts +11 -0
  466. package/lib/framework/index.js +1 -1
  467. package/lib/framework/output.d.ts +15 -0
  468. package/lib/framework/output.js +1 -1
  469. package/lib/framework/response.d.ts +2 -0
  470. package/lib/framework/response.js +1 -1
  471. package/lib/framework/runner-alias.d.ts +14 -0
  472. package/lib/framework/runner-alias.js +1 -1
  473. package/lib/framework/runner.d.ts +36 -0
  474. package/lib/framework/runner.js +1 -1
  475. package/lib/framework/schema-export.d.ts +3 -0
  476. package/lib/framework/schema-export.js +1 -1
  477. package/lib/framework/types.d.ts +63 -0
  478. package/lib/framework/types.js +1 -1
  479. package/lib/generated/build-info.d.ts +4 -0
  480. package/lib/generated/build-info.js +1 -1
  481. package/lib/help.d.ts +1 -0
  482. package/lib/help.js +1 -1
  483. package/lib/runtime/confirmation.d.ts +4 -0
  484. package/lib/runtime/confirmation.js +1 -0
  485. package/lib/runtime/event.d.ts +5 -0
  486. package/lib/runtime/event.js +1 -0
  487. package/lib/runtime/index.d.ts +7 -0
  488. package/lib/runtime/index.js +1 -0
  489. package/lib/runtime/queue.d.ts +5 -0
  490. package/lib/runtime/queue.js +1 -0
  491. package/lib/runtime/resolve.d.ts +8 -0
  492. package/lib/runtime/resolve.js +1 -0
  493. package/lib/runtime/types.d.ts +50 -0
  494. package/lib/runtime/types.js +1 -0
  495. package/lib/skills/main.d.ts +41 -0
  496. package/lib/skills/main.js +1 -1
  497. package/lib/skills/npx-skills-add.d.ts +99 -0
  498. package/lib/skills/npx-skills-add.js +1 -1
  499. package/lib/skills/skill-presence.d.ts +44 -0
  500. package/lib/skills/skill-presence.js +1 -1
  501. package/lib/telemetry/cli-command-trace.d.ts +12 -0
  502. package/lib/telemetry/cli-command-trace.js +1 -1
  503. package/lib/telemetry/cli-help-trace.d.ts +8 -0
  504. package/lib/telemetry/cli-help-trace.js +1 -1
  505. package/lib/telemetry/ensure-cli-otel-config.d.ts +6 -0
  506. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  507. package/lib/telemetry/register-otel-exit-shutdown.d.ts +3 -0
  508. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  509. package/lib/telemetry/send-cli-trace-log.d.ts +17 -0
  510. package/lib/telemetry/send-cli-trace-log.js +1 -1
  511. package/lib/telemetry/send-platform-issue-collect-log.d.ts +26 -0
  512. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  513. package/lib/types/index.d.ts +93 -0
  514. package/lib/utils/ai_config.d.ts +47 -0
  515. package/lib/utils/ai_config.js +1 -1
  516. package/lib/utils/apply-jq-filter.d.ts +1 -0
  517. package/lib/utils/apply-jq-filter.js +1 -1
  518. package/lib/utils/cdn-config.d.ts +42 -0
  519. package/lib/utils/cdn-config.js +1 -1
  520. package/lib/utils/check-sdk-version.d.ts +23 -0
  521. package/lib/utils/check-sdk-version.js +1 -1
  522. package/lib/utils/cli-version-check.d.ts +37 -0
  523. package/lib/utils/cli-version-check.js +1 -1
  524. package/lib/utils/cli-version-policy.d.ts +9 -0
  525. package/lib/utils/cli-version-policy.js +1 -1
  526. package/lib/utils/config.d.ts +42 -0
  527. package/lib/utils/config.js +1 -1
  528. package/lib/utils/copy-directory.d.ts +1 -0
  529. package/lib/utils/copy-directory.js +1 -1
  530. package/lib/utils/entity-with-id.d.ts +30 -0
  531. package/lib/utils/entity-with-id.js +1 -1
  532. package/lib/utils/file-utils.d.ts +25 -0
  533. package/lib/utils/file-utils.js +1 -1
  534. package/lib/utils/guides-cdn.d.ts +80 -0
  535. package/lib/utils/guides-cdn.js +1 -1
  536. package/lib/utils/http-client.d.ts +30 -0
  537. package/lib/utils/http-client.js +1 -1
  538. package/lib/utils/is-non-interactive.d.ts +7 -0
  539. package/lib/utils/is-non-interactive.js +1 -1
  540. package/lib/utils/logger.d.ts +62 -0
  541. package/lib/utils/logger.js +1 -1
  542. package/lib/utils/params.d.ts +15 -0
  543. package/lib/utils/params.js +1 -1
  544. package/lib/utils/platform.d.ts +21 -0
  545. package/lib/utils/platform.js +1 -1
  546. package/lib/utils/rules-cdn.d.ts +38 -0
  547. package/lib/utils/rules-cdn.js +1 -1
  548. package/lib/utils/sleep.d.ts +1 -0
  549. package/lib/utils/sleep.js +1 -1
  550. package/lib/utils/template-replacer.d.ts +55 -0
  551. package/lib/utils/template-replacer.js +1 -1
  552. package/lib/utils/update-notice.d.ts +10 -0
  553. package/lib/utils/update-notice.js +1 -1
  554. package/lib/utils/version.d.ts +1 -0
  555. package/lib/utils/version.js +1 -1
  556. package/lib/utils/with-active-cookie.d.ts +1 -0
  557. package/lib/utils/with-active-cookie.js +1 -1
  558. package/lib/utils/write-cli-side-channel.d.ts +6 -0
  559. package/lib/utils/write-cli-side-channel.js +1 -1
  560. package/package.json +9 -1
  561. package/lib/commands/page/react/create.js +0 -1
  562. package/lib/commands/page/react/detail.js +0 -1
  563. package/lib/commands/page/react/list.js +0 -1
  564. package/lib/commands/page/react/publish.js +0 -1
  565. package/lib/commands/page/react/shared.js +0 -1
  566. package/lib/commands/page/react/syntax.js +0 -1
  567. package/lib/commands/page/react/template.js +0 -1
  568. package/lib/commands/page/react/update.js +0 -1
@@ -1 +1 @@
1
- function a268_0x5c96(){const _0xefe483=['65ZxHbQB','36060KBMgHP','8xogjkC','631752PRaojD','error','join','105GlrwSj','4654704JXKHQM','copyFileSync','926676crfkob','name','1244tuLBJt','7IDUWvT','复制目录时出错:','4678731nWvNuY','2833650zpmIdn','isDirectory','329QpxWav','110wVMbti'];a268_0x5c96=function(){return _0xefe483;};return a268_0x5c96();}(function(_0x266f3e,_0x2803ad){const _0xfc3427=a268_0xd5e1,_0x163126=_0x266f3e();while(!![]){try{const _0x3b8317=-parseInt(_0xfc3427(0x19d))/0x1*(-parseInt(_0xfc3427(0x1aa))/0x2)+-parseInt(_0xfc3427(0x1a8))/0x3+-parseInt(_0xfc3427(0x1a0))/0x4*(-parseInt(_0xfc3427(0x1a5))/0x5)+-parseInt(_0xfc3427(0x19b))/0x6*(parseInt(_0xfc3427(0x1ab))/0x7)+-parseInt(_0xfc3427(0x1a1))/0x8*(parseInt(_0xfc3427(0x1ad))/0x9)+parseInt(_0xfc3427(0x19e))/0xa*(-parseInt(_0xfc3427(0x1a2))/0xb)+parseInt(_0xfc3427(0x1a6))/0xc*(parseInt(_0xfc3427(0x19f))/0xd);if(_0x3b8317===_0x2803ad)break;else _0x163126['push'](_0x163126['shift']());}catch(_0x321b90){_0x163126['push'](_0x163126['shift']());}}}(a268_0x5c96,0x61cfb));import a268_0x11c2fc from'node:path';function a268_0xd5e1(_0x773ea4,_0x1bdb93){_0x773ea4=_0x773ea4-0x19b;const _0x5c960b=a268_0x5c96();let _0xd5e185=_0x5c960b[_0x773ea4];return _0xd5e185;}import a268_0x46cb77 from'node:fs';export async function copyDirectory(_0x374000,_0x59ee3a){const _0x2c1662=a268_0xd5e1;try{const _0x49cb6a=a268_0x46cb77['readdirSync'](_0x374000,{'withFileTypes':!![]});a268_0x46cb77['mkdirSync'](_0x59ee3a,{'recursive':!![]});for(const _0x36a985 of _0x49cb6a){const _0x586922=a268_0x11c2fc['join'](_0x374000,_0x36a985[_0x2c1662(0x1a9)]),_0x2e8eae=a268_0x11c2fc[_0x2c1662(0x1a4)](_0x59ee3a,_0x36a985[_0x2c1662(0x1a9)]);_0x36a985[_0x2c1662(0x19c)]()?await copyDirectory(_0x586922,_0x2e8eae):a268_0x46cb77[_0x2c1662(0x1a7)](_0x586922,_0x2e8eae);}}catch(_0x218769){console[_0x2c1662(0x1a3)](_0x2c1662(0x1ac),_0x218769);}}
1
+ function a266_0xccb3(_0x452cbc,_0x54c76b){_0x452cbc=_0x452cbc-0x1c5;const _0x274163=a266_0x2741();let _0xccb3d4=_0x274163[_0x452cbc];return _0xccb3d4;}function a266_0x2741(){const _0x136e4f=['error','isDirectory','readdirSync','8abJHqO','copyFileSync','1130166PhWWnv','669490yCQAFX','66uzlVIv','50501649SKNzXJ','232826uyFxuj','name','2180968YuBLow','895500SOPnvR','1296634SWDoEV','join','100SUVsax','21tXrPWl'];a266_0x2741=function(){return _0x136e4f;};return a266_0x2741();}(function(_0x12b85d,_0x4bb09a){const _0x4a641f=a266_0xccb3,_0x163edd=_0x12b85d();while(!![]){try{const _0x428958=-parseInt(_0x4a641f(0x1cb))/0x1+parseInt(_0x4a641f(0x1cf))/0x2+parseInt(_0x4a641f(0x1c7))/0x3*(-parseInt(_0x4a641f(0x1c5))/0x4)+-parseInt(_0x4a641f(0x1c8))/0x5*(parseInt(_0x4a641f(0x1c9))/0x6)+parseInt(_0x4a641f(0x1d2))/0x7*(-parseInt(_0x4a641f(0x1cd))/0x8)+-parseInt(_0x4a641f(0x1ce))/0x9*(parseInt(_0x4a641f(0x1d1))/0xa)+parseInt(_0x4a641f(0x1ca))/0xb;if(_0x428958===_0x4bb09a)break;else _0x163edd['push'](_0x163edd['shift']());}catch(_0x16a628){_0x163edd['push'](_0x163edd['shift']());}}}(a266_0x2741,0xec2c5));import a266_0x1a9091 from'node:path';import a266_0x35c6fb from'node:fs';export async function copyDirectory(_0x254716,_0x3bea9e){const _0x5dd130=a266_0xccb3;try{const _0x5dd1b6=a266_0x35c6fb[_0x5dd130(0x1d5)](_0x254716,{'withFileTypes':!![]});a266_0x35c6fb['mkdirSync'](_0x3bea9e,{'recursive':!![]});for(const _0x39f7b8 of _0x5dd1b6){const _0x366eaa=a266_0x1a9091[_0x5dd130(0x1d0)](_0x254716,_0x39f7b8['name']),_0x10ceb3=a266_0x1a9091[_0x5dd130(0x1d0)](_0x3bea9e,_0x39f7b8[_0x5dd130(0x1cc)]);_0x39f7b8[_0x5dd130(0x1d4)]()?await copyDirectory(_0x366eaa,_0x10ceb3):a266_0x35c6fb[_0x5dd130(0x1c6)](_0x366eaa,_0x10ceb3);}}catch(_0x21afe6){console[_0x5dd130(0x1d3)]('复制目录时出错:',_0x21afe6);}}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Normalized shape for create/update responses that should contain an entity id.
3
+ *
4
+ * Why:
5
+ * backend endpoints are being migrated gradually and may return either:
6
+ * - primitive id (legacy): `data: 1070` or `data: "1070"`
7
+ * - full object (new): `data: { id: 1070, ... }`
8
+ *
9
+ * This unified shape allows command handlers to consume one contract and avoid
10
+ * false negatives like "created but no id", which can trigger duplicate retries.
11
+ */
12
+ export interface NormalizedEntityWithId<T extends object = Record<string, unknown>> {
13
+ id: number | undefined;
14
+ entity: T;
15
+ }
16
+ /**
17
+ * Normalize API response data into a stable `{ id, entity }` shape.
18
+ *
19
+ * Problem solved:
20
+ * multiple endpoints are in a compatibility window where response `data`
21
+ * may be primitive id or object payload. This helper centralizes parsing
22
+ * so command code does not duplicate branching logic and can evolve safely
23
+ * while server contracts are transitioning.
24
+ *
25
+ * @param raw Raw response `data` from API.
26
+ * @typeParam T Expected entity object shape when the backend returns a full object.
27
+ * @param raw Raw response `data` from API.
28
+ * @returns Normalized id and entity object for downstream command flow.
29
+ */
30
+ export declare function normalizeEntityWithIdResponse<T extends object = Record<string, unknown>>(raw: unknown): NormalizedEntityWithId<T>;
@@ -1 +1 @@
1
- (function(_0x7e0ec5,_0x314f1e){const _0x4a5b03=a269_0x5528,_0x24f5b5=_0x7e0ec5();while(!![]){try{const _0x5101a0=parseInt(_0x4a5b03(0x14a))/0x1*(-parseInt(_0x4a5b03(0x14e))/0x2)+-parseInt(_0x4a5b03(0x14d))/0x3+parseInt(_0x4a5b03(0x153))/0x4*(-parseInt(_0x4a5b03(0x14b))/0x5)+-parseInt(_0x4a5b03(0x154))/0x6*(-parseInt(_0x4a5b03(0x155))/0x7)+-parseInt(_0x4a5b03(0x14c))/0x8*(-parseInt(_0x4a5b03(0x151))/0x9)+parseInt(_0x4a5b03(0x148))/0xa*(parseInt(_0x4a5b03(0x152))/0xb)+parseInt(_0x4a5b03(0x147))/0xc;if(_0x5101a0===_0x314f1e)break;else _0x24f5b5['push'](_0x24f5b5['shift']());}catch(_0x3f5547){_0x24f5b5['push'](_0x24f5b5['shift']());}}}(a269_0x2e1c,0x5fb46));function a269_0x5528(_0x263d84,_0x2b3f0f){_0x263d84=_0x263d84-0x146;const _0x2e1cbc=a269_0x2e1c();let _0x5528c3=_0x2e1cbc[_0x263d84];return _0x5528c3;}function toFiniteNumber(_0xfaa9a1){const _0x248947=a269_0x5528;if(typeof _0xfaa9a1===_0x248947(0x14f)&&Number[_0x248947(0x150)](_0xfaa9a1))return _0xfaa9a1;if(typeof _0xfaa9a1===_0x248947(0x146)){const _0x1f426c=_0xfaa9a1[_0x248947(0x149)]();if(!_0x1f426c)return undefined;const _0x134817=Number(_0x1f426c);if(Number[_0x248947(0x150)](_0x134817))return _0x134817;}return undefined;}export function normalizeEntityWithIdResponse(_0x583ead){const _0x2c9f5b=toFiniteNumber(_0x583ead);if(_0x2c9f5b!==undefined)return{'id':_0x2c9f5b,'entity':{'id':_0x2c9f5b}};if(!_0x583ead||typeof _0x583ead!=='object')return{'id':undefined,'entity':{}};const _0x54d59e={..._0x583ead},_0x3e3e4a=toFiniteNumber(_0x54d59e['id']);return _0x3e3e4a!==undefined&&(_0x54d59e['id']=_0x3e3e4a),{'id':_0x3e3e4a,'entity':_0x54d59e};}function a269_0x2e1c(){const _0x2f5ebf=['number','isFinite','3684159TbqqMJ','22owaHoM','10596FmjcLZ','27528EqkEKP','315GEZIVR','string','5602896ewiHCh','2359830LQmrao','trim','4Btxwqd','130tUQSyz','8bdFaiT','2227623hbyuPT','175632kUEkIZ'];a269_0x2e1c=function(){return _0x2f5ebf;};return a269_0x2e1c();}
1
+ function a267_0x4556(_0x4b7fa1,_0x7d5bb4){_0x4b7fa1=_0x4b7fa1-0xee;const _0x4b5608=a267_0x4b56();let _0x455636=_0x4b5608[_0x4b7fa1];return _0x455636;}(function(_0x5ea89d,_0x306d4b){const _0xcf1e36=a267_0x4556,_0x16842a=_0x5ea89d();while(!![]){try{const _0x2514af=-parseInt(_0xcf1e36(0xf1))/0x1+-parseInt(_0xcf1e36(0xf7))/0x2+parseInt(_0xcf1e36(0xf6))/0x3+parseInt(_0xcf1e36(0xf2))/0x4*(-parseInt(_0xcf1e36(0xef))/0x5)+parseInt(_0xcf1e36(0xf3))/0x6+-parseInt(_0xcf1e36(0xee))/0x7*(parseInt(_0xcf1e36(0xf0))/0x8)+parseInt(_0xcf1e36(0xf4))/0x9;if(_0x2514af===_0x306d4b)break;else _0x16842a['push'](_0x16842a['shift']());}catch(_0x45863d){_0x16842a['push'](_0x16842a['shift']());}}}(a267_0x4b56,0xa3f6a));function toFiniteNumber(_0x200b2e){const _0x1a62bc=a267_0x4556;if(typeof _0x200b2e===_0x1a62bc(0xf5)&&Number[_0x1a62bc(0xfa)](_0x200b2e))return _0x200b2e;if(typeof _0x200b2e===_0x1a62bc(0xf8)){const _0x41a78a=_0x200b2e[_0x1a62bc(0xf9)]();if(!_0x41a78a)return undefined;const _0xf6dbe1=Number(_0x41a78a);if(Number['isFinite'](_0xf6dbe1))return _0xf6dbe1;}return undefined;}export function normalizeEntityWithIdResponse(_0x4aabe4){const _0x42c01c=toFiniteNumber(_0x4aabe4);if(_0x42c01c!==undefined)return{'id':_0x42c01c,'entity':{'id':_0x42c01c}};if(!_0x4aabe4||typeof _0x4aabe4!=='object')return{'id':undefined,'entity':{}};const _0x1229d6={..._0x4aabe4},_0x3a807c=toFiniteNumber(_0x1229d6['id']);return _0x3a807c!==undefined&&(_0x1229d6['id']=_0x3a807c),{'id':_0x3a807c,'entity':_0x1229d6};}function a267_0x4b56(){const _0x28410e=['1255883vOvrcb','16WYZaiV','5157966yPfLNj','1769814NxKjIb','number','3991086LXYDCa','448356Mglfmi','string','trim','isFinite','24710HOxAiQ','218755nGkevk','136DEWysP'];a267_0x4b56=function(){return _0x28410e;};return a267_0x4b56();}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * 文件操作工具函数
3
+ *
4
+ * 提供跨模块共享的文件操作逻辑
5
+ */
6
+ /**
7
+ * 递归复制目录
8
+ *
9
+ * @param src 源目录路径
10
+ * @param dest 目标目录路径
11
+ */
12
+ export declare function copyDir(src: string, dest: string): Promise<void>;
13
+ /**
14
+ * 确保目录存在,如不存在则创建
15
+ *
16
+ * @param dir 目录路径
17
+ */
18
+ export declare function ensureDir(dir: string): void;
19
+ /**
20
+ * 检查文件或目录是否存在
21
+ *
22
+ * @param path 文件或目录路径
23
+ * @returns 是否存在
24
+ */
25
+ export declare function pathExists(path: string): boolean;
@@ -1 +1 @@
1
- (function(_0x267fb7,_0x10d75b){const _0x37c7e3=a270_0x2722,_0x211632=_0x267fb7();while(!![]){try{const _0x54f4f6=-parseInt(_0x37c7e3(0x1bb))/0x1+parseInt(_0x37c7e3(0x1c0))/0x2*(-parseInt(_0x37c7e3(0x1c2))/0x3)+-parseInt(_0x37c7e3(0x1bd))/0x4+-parseInt(_0x37c7e3(0x1bc))/0x5+parseInt(_0x37c7e3(0x1b9))/0x6*(parseInt(_0x37c7e3(0x1b8))/0x7)+-parseInt(_0x37c7e3(0x1be))/0x8*(parseInt(_0x37c7e3(0x1c1))/0x9)+-parseInt(_0x37c7e3(0x1bf))/0xa*(-parseInt(_0x37c7e3(0x1ba))/0xb);if(_0x54f4f6===_0x10d75b)break;else _0x211632['push'](_0x211632['shift']());}catch(_0x3aa6cd){_0x211632['push'](_0x211632['shift']());}}}(a270_0x123b,0x61b60));import{existsSync,mkdirSync,copyFileSync,readdirSync,statSync}from'node:fs';import{join}from'node:path';function a270_0x2722(_0x2ddf71,_0x3eb958){_0x2ddf71=_0x2ddf71-0x1b8;const _0x123b57=a270_0x123b();let _0x27228a=_0x123b57[_0x2ddf71];return _0x27228a;}function a270_0x123b(){const _0x2057e8=['463707HnjOZi','1947786oUyWOR','41545TbZdFG','294TrizRh','23744941JGVOwL','621242dmMukl','3405880mAiuZe','184076CwLBCJ','8jFhpAb','10nhZdVc','2hIcQjN'];a270_0x123b=function(){return _0x2057e8;};return a270_0x123b();}export async function copyDir(_0x329bd1,_0x59998f){const _0x5103d0=statSync(_0x329bd1);if(_0x5103d0['isDirectory']()){!existsSync(_0x59998f)&&mkdirSync(_0x59998f,{'recursive':!![]});const _0x8e25ca=readdirSync(_0x329bd1);for(const _0x3de24c of _0x8e25ca){await copyDir(join(_0x329bd1,_0x3de24c),join(_0x59998f,_0x3de24c));}}else copyFileSync(_0x329bd1,_0x59998f);}export function ensureDir(_0x306bbd){!existsSync(_0x306bbd)&&mkdirSync(_0x306bbd,{'recursive':!![]});}export function pathExists(_0xf895bf){return existsSync(_0xf895bf);}
1
+ function a268_0x2543(_0x38e955,_0x439b74){_0x38e955=_0x38e955-0x10b;const _0x51edb6=a268_0x51ed();let _0x2543f2=_0x51edb6[_0x38e955];return _0x2543f2;}(function(_0x372fb5,_0x393b03){const _0x4e0639=a268_0x2543,_0x1b3818=_0x372fb5();while(!![]){try{const _0x499c39=parseInt(_0x4e0639(0x10f))/0x1*(-parseInt(_0x4e0639(0x10e))/0x2)+-parseInt(_0x4e0639(0x114))/0x3*(-parseInt(_0x4e0639(0x112))/0x4)+-parseInt(_0x4e0639(0x111))/0x5+parseInt(_0x4e0639(0x115))/0x6*(parseInt(_0x4e0639(0x116))/0x7)+parseInt(_0x4e0639(0x10b))/0x8+parseInt(_0x4e0639(0x10d))/0x9*(-parseInt(_0x4e0639(0x10c))/0xa)+parseInt(_0x4e0639(0x110))/0xb;if(_0x499c39===_0x393b03)break;else _0x1b3818['push'](_0x1b3818['shift']());}catch(_0x4ca2b3){_0x1b3818['push'](_0x1b3818['shift']());}}}(a268_0x51ed,0x5c448));import{existsSync,mkdirSync,copyFileSync,readdirSync,statSync}from'node:fs';import{join}from'node:path';export async function copyDir(_0x520ef5,_0x54f8d5){const _0x2bab32=a268_0x2543,_0x2bb586=statSync(_0x520ef5);if(_0x2bb586[_0x2bab32(0x113)]()){!existsSync(_0x54f8d5)&&mkdirSync(_0x54f8d5,{'recursive':!![]});const _0x2fd1a2=readdirSync(_0x520ef5);for(const _0x1645a8 of _0x2fd1a2){await copyDir(join(_0x520ef5,_0x1645a8),join(_0x54f8d5,_0x1645a8));}}else copyFileSync(_0x520ef5,_0x54f8d5);}export function ensureDir(_0x19c1ca){!existsSync(_0x19c1ca)&&mkdirSync(_0x19c1ca,{'recursive':!![]});}export function pathExists(_0x2efaa0){return existsSync(_0x2efaa0);}function a268_0x51ed(){const _0x839faf=['104BWFuaC','isDirectory','1380MaTpXH','3108zsfDck','4298uRqmAO','3075176EBDqhB','3020TQkgTZ','21492efWJRy','397060ppqtid','2qIBquO','15382092gvzcfV','3083085mqsOGE'];a268_0x51ed=function(){return _0x839faf;};return a268_0x51ed();}
@@ -0,0 +1,80 @@
1
+ /**
2
+ * Guides CDN 工具
3
+ *
4
+ * 从 CDN 拉取 skill guides 数据,并写入到用户项目
5
+ *
6
+ * 优先级:本地 dist 文件(开发模式) > CDN(生产模式)
7
+ */
8
+ /**
9
+ * Guides 数据结构
10
+ */
11
+ export interface GuidesData {
12
+ version: string;
13
+ buildTime: string;
14
+ skillTemplate: {
15
+ content: string;
16
+ lastUpdated?: string;
17
+ };
18
+ guides: Record<string, {
19
+ title: string;
20
+ path: string;
21
+ content: string;
22
+ lastUpdated?: string;
23
+ requireFlags?: string[];
24
+ extendContent?: string;
25
+ extendLastUpdated?: string;
26
+ }>;
27
+ }
28
+ /**
29
+ * 从 CDN 拉取 guides 数据(单一 guides.json,已含全部指南)
30
+ */
31
+ export declare function fetchGuidesFromCDN(): Promise<GuidesData>;
32
+ /**
33
+ * 将 guides 数据写入到项目目录
34
+ *
35
+ * @param guidesData - guides 数据
36
+ * @param projectRoot - 项目根目录
37
+ * @param basePath - 目标基础路径
38
+ * @param _providedFlags 保留参数以兼容旧调用方;指南已全量安装,不再按 flag 过滤
39
+ */
40
+ export declare function writeGuidesToProject(guidesData: GuidesData, projectRoot: string, basePath?: string, _providedFlags?: string[]): void;
41
+ /**
42
+ * 追加更新时间到内容末尾(通用方法)
43
+ */
44
+ export declare function appendUpdateTime(content: string, lastUpdated: string): string;
45
+ /**
46
+ * 获取 SKILL.md 模板内容(用于替换 {{IDE_NAME}})
47
+ */
48
+ export declare function getSkillTemplate(guidesData: GuidesData): string;
49
+ /**
50
+ * 追加符合条件的 extendContent 到 SKILL.md
51
+ *
52
+ * @param content - 当前 SKILL.md 内容
53
+ * @param guidesData - guides 数据
54
+ * @param _providedFlags 保留兼容;extend 全量追加(requireFlags 仅作元数据,见各指南正文)
55
+ * @returns 追加 extendContent 后的内容
56
+ */
57
+ export declare function appendExtendContents(content: string, guidesData: GuidesData, _providedFlags?: string[]): string;
58
+ /**
59
+ * 写入 SKILL.md 到目标路径(替换 {{IDE_NAME}} 占位符)
60
+ *
61
+ * @param guidesData - guides 数据
62
+ * @param destPath - 目标文件路径
63
+ * @param ideDisplayName - IDE 显示名称(替换 {{IDE_NAME}})
64
+ */
65
+ export declare function writeSkillFile(guidesData: GuidesData, destPath: string, ideDisplayName: string): void;
66
+ /**
67
+ * 安装 guides(从 CDN 拉取并写入项目)
68
+ *
69
+ * @param projectRoot 项目根目录
70
+ * @returns 写入的 guides 数量
71
+ */
72
+ export declare function installGuides(projectRoot: string): Promise<number>;
73
+ /**
74
+ * 获取 guides 摘要(用于显示)
75
+ */
76
+ export declare function getGuidesSummary(guidesData: GuidesData): Array<{
77
+ key: string;
78
+ title: string;
79
+ path: string;
80
+ }>;
@@ -1 +1 @@
1
- const a271_0x294bf0=a271_0x3e2e;(function(_0x99478a,_0x510bad){const _0x551682=a271_0x3e2e,_0x493dd5=_0x99478a();while(!![]){try{const _0x5c1949=parseInt(_0x551682(0x1fa))/0x1+-parseInt(_0x551682(0x1eb))/0x2+-parseInt(_0x551682(0x1f5))/0x3*(parseInt(_0x551682(0x1ef))/0x4)+parseInt(_0x551682(0x1f0))/0x5+-parseInt(_0x551682(0x1fe))/0x6+-parseInt(_0x551682(0x205))/0x7+-parseInt(_0x551682(0x1ee))/0x8*(-parseInt(_0x551682(0x1f2))/0x9);if(_0x5c1949===_0x510bad)break;else _0x493dd5['push'](_0x493dd5['shift']());}catch(_0x4cf271){_0x493dd5['push'](_0x493dd5['shift']());}}}(a271_0x5ca7,0xe2bc8));import{mkdirSync,writeFileSync}from'node:fs';function a271_0x3e2e(_0x5495fe,_0x2d0893){_0x5495fe=_0x5495fe-0x1e8;const _0x5ca761=a271_0x5ca7();let _0x3e2e39=_0x5ca761[_0x5495fe];return _0x3e2e39;}import{dirname,join}from'node:path';import{homedir}from'node:os';import{getTemplateBaseUrl}from'../utils/config.js';function getGuidesCdnUrl(){const _0x48a6a3=a271_0x3e2e,_0x26eceb=getTemplateBaseUrl();return _0x26eceb+_0x48a6a3(0x1f9);}const CACHE_DIR=join(homedir(),a271_0x294bf0(0x200),'cache');function a271_0x5ca7(){const _0x3d7699=['6rqMQzj','replace','skillTemplate','CDN\x20请求失败:\x20','/skills/guides.json','280671EEFdcg','path','trimEnd','.md','10698252TcmLzU','object','.lovrabet','map','content','push','.lovrabet/skill/guides','6099464PuCQSo','statusText','CDN\x20数据中缺少\x20skillTemplate','CDN\x20返回数据格式错误','lastUpdated','2936462zMfTmG','extendContent','length','400NwTCGb','2321324hbgJfO','5650640mGEErM','utf-8','864216VjZcqs','entries','guides'];a271_0x5ca7=function(){return _0x3d7699;};return a271_0x5ca7();}export async function fetchGuidesFromCDN(){const _0x579d32=a271_0x294bf0,_0x30eeb0=getGuidesCdnUrl(),_0x1a33b3=await fetch(_0x30eeb0,{'headers':{'Accept':'application/json'}});if(!_0x1a33b3['ok'])throw new Error(_0x579d32(0x1f8)+_0x1a33b3['status']+'\x20'+_0x1a33b3[_0x579d32(0x206)]);const _0x541a85=await _0x1a33b3['json']();if(!_0x541a85['guides']||typeof _0x541a85[_0x579d32(0x1f4)]!==_0x579d32(0x1ff))throw new Error(_0x579d32(0x1e9));return _0x541a85;}export function writeGuidesToProject(_0x377f43,_0xddd0e5,_0x509ebc=a271_0x294bf0(0x204),_0x3b6cdf){const _0x7ac19d=a271_0x294bf0,_0x25b5c1=join(_0xddd0e5,_0x509ebc);mkdirSync(_0x25b5c1,{'recursive':!![]});for(const [_0x3f0d29,_0x17a1ab]of Object['entries'](_0x377f43[_0x7ac19d(0x1f4)])){let _0x125d47=_0x17a1ab[_0x7ac19d(0x202)];_0x17a1ab[_0x7ac19d(0x1ea)]&&(_0x125d47=appendUpdateTime(_0x125d47,_0x17a1ab['lastUpdated'])),writeFileSync(join(_0x25b5c1,_0x3f0d29+_0x7ac19d(0x1fd)),_0x125d47,_0x7ac19d(0x1f1));}}export function appendUpdateTime(_0x2cafe3,_0x13d756){const _0xa1e76a=a271_0x294bf0;return _0x2cafe3=_0x2cafe3[_0xa1e76a(0x1f6)](/\n*>更新时间:.*$/m,''),_0x2cafe3['trimEnd']()+('\x0a\x0a>更新时间:'+_0x13d756);}export function getSkillTemplate(_0x52908b){const _0x4e3d54=a271_0x294bf0;return _0x52908b['skillTemplate']?.[_0x4e3d54(0x202)]||'';}export function appendExtendContents(_0x2bed36,_0x240c16,_0xcab8e2){const _0x163c85=a271_0x294bf0,_0x1a7a8a=[];for(const [,_0x417845]of Object[_0x163c85(0x1f3)](_0x240c16[_0x163c85(0x1f4)])){_0x417845[_0x163c85(0x1ec)]&&_0x1a7a8a[_0x163c85(0x203)](_0x417845['extendContent']['trimEnd']());}if(_0x1a7a8a[_0x163c85(0x1ed)]===0x0)return _0x2bed36;return _0x2bed36[_0x163c85(0x1fc)]()+'\x0a\x0a'+_0x1a7a8a['join']('\x0a\x0a')+'\x0a';}export function writeSkillFile(_0x49aa14,_0x335496,_0x5a925a){const _0x25c3eb=a271_0x294bf0,_0x3c7840=getSkillTemplate(_0x49aa14);if(!_0x3c7840)throw new Error(_0x25c3eb(0x1e8));const _0x3a571d=dirname(_0x335496);mkdirSync(_0x3a571d,{'recursive':!![]});let _0x2d1209=_0x3c7840['replace'](/\{\{IDE_NAME\}\}/g,_0x5a925a);_0x2d1209=appendExtendContents(_0x2d1209,_0x49aa14),_0x49aa14[_0x25c3eb(0x1f7)]['lastUpdated']&&(_0x2d1209=appendUpdateTime(_0x2d1209,_0x49aa14[_0x25c3eb(0x1f7)]['lastUpdated'])),writeFileSync(_0x335496,_0x2d1209,_0x25c3eb(0x1f1));}export async function installGuides(_0x355e68){const _0x52c455=a271_0x294bf0,_0x5ed514=await fetchGuidesFromCDN();return writeGuidesToProject(_0x5ed514,_0x355e68),Object['keys'](_0x5ed514[_0x52c455(0x1f4)])[_0x52c455(0x1ed)];}export function getGuidesSummary(_0xb02db0){const _0x2cade0=a271_0x294bf0;return Object[_0x2cade0(0x1f3)](_0xb02db0[_0x2cade0(0x1f4)])[_0x2cade0(0x201)](([_0x3921d2,_0x298a12])=>({'key':_0x3921d2,'title':_0x298a12['title'],'path':_0x298a12[_0x2cade0(0x1fb)]}));}
1
+ const a269_0x534f7f=a269_0x2168;(function(_0x5c3c2b,_0x6e07a0){const _0x3a9cba=a269_0x2168,_0x3c7be1=_0x5c3c2b();while(!![]){try{const _0x4f7b81=parseInt(_0x3a9cba(0x1cd))/0x1+-parseInt(_0x3a9cba(0x1c3))/0x2+-parseInt(_0x3a9cba(0x1c5))/0x3*(-parseInt(_0x3a9cba(0x1ce))/0x4)+parseInt(_0x3a9cba(0x1c0))/0x5*(-parseInt(_0x3a9cba(0x1c9))/0x6)+-parseInt(_0x3a9cba(0x1e2))/0x7+parseInt(_0x3a9cba(0x1d9))/0x8*(-parseInt(_0x3a9cba(0x1e0))/0x9)+parseInt(_0x3a9cba(0x1d7))/0xa;if(_0x4f7b81===_0x6e07a0)break;else _0x3c7be1['push'](_0x3c7be1['shift']());}catch(_0x5d7106){_0x3c7be1['push'](_0x3c7be1['shift']());}}}(a269_0x2cc1,0x31155));import{mkdirSync,writeFileSync}from'node:fs';import{dirname,join}from'node:path';import{homedir}from'node:os';import{getTemplateBaseUrl}from'../utils/config.js';function getGuidesCdnUrl(){const _0x5d6674=getTemplateBaseUrl();return _0x5d6674+'/skills/guides.json';}function a269_0x2168(_0x2da06d,_0x6c366b){_0x2da06d=_0x2da06d-0x1bf;const _0x2cc196=a269_0x2cc1();let _0x2168a6=_0x2cc196[_0x2da06d];return _0x2168a6;}const CACHE_DIR=join(homedir(),a269_0x534f7f(0x1de),a269_0x534f7f(0x1cf));export async function fetchGuidesFromCDN(){const _0x4e7e90=a269_0x534f7f,_0x4758f0=getGuidesCdnUrl(),_0xfe8607=await fetch(_0x4758f0,{'headers':{'Accept':_0x4e7e90(0x1e1)}});if(!_0xfe8607['ok'])throw new Error(_0x4e7e90(0x1dc)+_0xfe8607[_0x4e7e90(0x1c6)]+'\x20'+_0xfe8607[_0x4e7e90(0x1d3)]);const _0x487237=await _0xfe8607['json']();if(!_0x487237[_0x4e7e90(0x1da)]||typeof _0x487237[_0x4e7e90(0x1da)]!==_0x4e7e90(0x1c1))throw new Error(_0x4e7e90(0x1db));return _0x487237;}export function writeGuidesToProject(_0x8afd22,_0x34edcf,_0x410eb4='.lovrabet/skill/guides',_0x57a2f7){const _0x25f322=a269_0x534f7f,_0x4a21e9=join(_0x34edcf,_0x410eb4);mkdirSync(_0x4a21e9,{'recursive':!![]});for(const [_0x398b10,_0xd1ef08]of Object['entries'](_0x8afd22[_0x25f322(0x1da)])){let _0x5c1d79=_0xd1ef08[_0x25f322(0x1d8)];_0xd1ef08[_0x25f322(0x1d0)]&&(_0x5c1d79=appendUpdateTime(_0x5c1d79,_0xd1ef08[_0x25f322(0x1d0)])),writeFileSync(join(_0x4a21e9,_0x398b10+_0x25f322(0x1ca)),_0x5c1d79,_0x25f322(0x1d1));}}export function appendUpdateTime(_0x216110,_0x1b6ad6){const _0x53b1dc=a269_0x534f7f;return _0x216110=_0x216110[_0x53b1dc(0x1c8)](/\n*>更新时间:.*$/m,''),_0x216110[_0x53b1dc(0x1c2)]()+(_0x53b1dc(0x1d6)+_0x1b6ad6);}function a269_0x2cc1(){const _0x3fc1c5=['length','468246FncPBF','status','map','replace','1259166YnCHes','.md','skillTemplate','CDN\x20数据中缺少\x20skillTemplate','386553FFqjUh','4QqeyOO','cache','lastUpdated','utf-8','push','statusText','title','keys','\x0a\x0a>更新时间:','6092900wzyCWk','content','12984lvXzEq','guides','CDN\x20返回数据格式错误','CDN\x20请求失败:\x20','extendContent','.lovrabet','entries','477ZciiWN','application/json','2476425PYPXeQ','join','5xkDJag','object','trimEnd','602450cNFVeV'];a269_0x2cc1=function(){return _0x3fc1c5;};return a269_0x2cc1();}export function getSkillTemplate(_0x368f1d){const _0x460f4e=a269_0x534f7f;return _0x368f1d[_0x460f4e(0x1cb)]?.[_0x460f4e(0x1d8)]||'';}export function appendExtendContents(_0x34e05d,_0x2512b3,_0x512019){const _0x1c11fb=a269_0x534f7f,_0x184f71=[];for(const [,_0x2dfe78]of Object[_0x1c11fb(0x1df)](_0x2512b3[_0x1c11fb(0x1da)])){_0x2dfe78[_0x1c11fb(0x1dd)]&&_0x184f71[_0x1c11fb(0x1d2)](_0x2dfe78['extendContent'][_0x1c11fb(0x1c2)]());}if(_0x184f71['length']===0x0)return _0x34e05d;return _0x34e05d[_0x1c11fb(0x1c2)]()+'\x0a\x0a'+_0x184f71[_0x1c11fb(0x1bf)]('\x0a\x0a')+'\x0a';}export function writeSkillFile(_0x385da2,_0x4c68fa,_0xa95871){const _0x8c8bec=a269_0x534f7f,_0x425419=getSkillTemplate(_0x385da2);if(!_0x425419)throw new Error(_0x8c8bec(0x1cc));const _0x338d87=dirname(_0x4c68fa);mkdirSync(_0x338d87,{'recursive':!![]});let _0x5e8b2d=_0x425419[_0x8c8bec(0x1c8)](/\{\{IDE_NAME\}\}/g,_0xa95871);_0x5e8b2d=appendExtendContents(_0x5e8b2d,_0x385da2),_0x385da2[_0x8c8bec(0x1cb)][_0x8c8bec(0x1d0)]&&(_0x5e8b2d=appendUpdateTime(_0x5e8b2d,_0x385da2[_0x8c8bec(0x1cb)][_0x8c8bec(0x1d0)])),writeFileSync(_0x4c68fa,_0x5e8b2d,_0x8c8bec(0x1d1));}export async function installGuides(_0xbb62bc){const _0x5ed474=a269_0x534f7f,_0x58c434=await fetchGuidesFromCDN();return writeGuidesToProject(_0x58c434,_0xbb62bc),Object[_0x5ed474(0x1d5)](_0x58c434[_0x5ed474(0x1da)])[_0x5ed474(0x1c4)];}export function getGuidesSummary(_0x9f62b1){const _0x5acfc3=a269_0x534f7f;return Object[_0x5acfc3(0x1df)](_0x9f62b1[_0x5acfc3(0x1da)])[_0x5acfc3(0x1c7)](([_0x14768d,_0x22e8a6])=>({'key':_0x14768d,'title':_0x22e8a6[_0x5acfc3(0x1d4)],'path':_0x22e8a6['path']}));}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * HTTP 客户端工具,提供健壮的网络请求功能
3
+ */
4
+ export interface RequestOptions {
5
+ /** 请求超时时间(毫秒),默认 30 秒 */
6
+ timeout?: number;
7
+ /** 重试次数,默认 3 次 */
8
+ retries?: number;
9
+ /** 重试间隔(毫秒),默认 1 秒 */
10
+ retryDelay?: number;
11
+ /** 请求头 */
12
+ headers?: Record<string, string>;
13
+ }
14
+ export interface HttpResponse<T = any> {
15
+ ok: boolean;
16
+ status: number;
17
+ statusText: string;
18
+ data: T;
19
+ headers: Headers;
20
+ url: string;
21
+ text(): Promise<string>;
22
+ }
23
+ /**
24
+ * 可重试的 HTTP 请求
25
+ */
26
+ export declare function httpRequest<T = any>(url: string, options?: RequestOptions): Promise<HttpResponse<T>>;
27
+ /**
28
+ * 验证 URL 格式
29
+ */
30
+ export declare function validateUrl(url: string): boolean;
@@ -1 +1 @@
1
- function a272_0x3b63(){const _0x8b0ae0=['TypeError','222FmXRNx','Request\x20failed','2909578VdIZee','44224020qmWDBO','json','1448212LWLpQP','fetch','ms\x20后进行第\x20','AbortError','name','\x20次重试...','1340863cGqOKt','*\x20请求失败,','abort','log','5153795QqpJkL','includes','ECONNRESET','content-type','24Ghcpgd','headers','message','49896JOdAPB','application/json','url','text','statusText','status','2652880ZTiMvh'];a272_0x3b63=function(){return _0x8b0ae0;};return a272_0x3b63();}(function(_0xf9d5ac,_0x30832b){const _0x5bdf9e=a272_0x80e4,_0x11c817=_0xf9d5ac();while(!![]){try{const _0x31a67e=parseInt(_0x5bdf9e(0x92))/0x1+-parseInt(_0x5bdf9e(0x9d))/0x2*(-parseInt(_0x5bdf9e(0xa5))/0x3)+parseInt(_0x5bdf9e(0xaa))/0x4+parseInt(_0x5bdf9e(0x96))/0x5+-parseInt(_0x5bdf9e(0x9a))/0x6*(-parseInt(_0x5bdf9e(0xa7))/0x7)+-parseInt(_0x5bdf9e(0xa3))/0x8+-parseInt(_0x5bdf9e(0xa8))/0x9;if(_0x31a67e===_0x30832b)break;else _0x11c817['push'](_0x11c817['shift']());}catch(_0x441aec){_0x11c817['push'](_0x11c817['shift']());}}}(a272_0x3b63,0xf36bd));export async function httpRequest(_0x556a84,_0x4501db={}){const _0x1e5057=a272_0x80e4,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x4501db;let _0x3da6cd=null;for(let _0x94fa3=0x0;_0x94fa3<=retries;_0x94fa3++){try{const _0x107257=new AbortController(),_0x264706=setTimeout(()=>_0x107257[_0x1e5057(0x94)](),timeout),_0x3f6033=await fetch(_0x556a84,{'headers':headers,'signal':_0x107257['signal']});clearTimeout(_0x264706);let _0x4641be;const _0x23d2e2=_0x3f6033[_0x1e5057(0x9b)]['get'](_0x1e5057(0x99));return _0x23d2e2?.[_0x1e5057(0x97)](_0x1e5057(0x9e))?_0x4641be=await _0x3f6033[_0x1e5057(0xa9)]():_0x4641be=await _0x3f6033[_0x1e5057(0xa0)](),{'ok':_0x3f6033['ok'],'status':_0x3f6033[_0x1e5057(0xa2)],'statusText':_0x3f6033[_0x1e5057(0xa1)],'data':_0x4641be,'headers':_0x3f6033[_0x1e5057(0x9b)],'url':_0x3f6033[_0x1e5057(0x9f)],'text':()=>_0x3f6033[_0x1e5057(0xa0)]()};}catch(_0x107799){_0x3da6cd=_0x107799 instanceof Error?_0x107799:new Error(String(_0x107799));if(_0x94fa3===retries)break;if(shouldRetry(_0x107799)){console[_0x1e5057(0x95)](_0x1e5057(0x93)+retryDelay+_0x1e5057(0x8e)+(_0x94fa3+0x1)+_0x1e5057(0x91)),await sleep(retryDelay);continue;}else break;}}throw _0x3da6cd||new Error(_0x1e5057(0xa6));}function shouldRetry(_0x56bf6d){const _0x32dec5=a272_0x80e4;if(_0x56bf6d instanceof Error){if(_0x56bf6d[_0x32dec5(0x90)]===_0x32dec5(0x8f))return![];if(_0x56bf6d[_0x32dec5(0x90)]===_0x32dec5(0xa4)&&_0x56bf6d[_0x32dec5(0x9c)]['includes'](_0x32dec5(0x8d)))return!![];if(_0x56bf6d[_0x32dec5(0x9c)][_0x32dec5(0x97)](_0x32dec5(0x98)))return!![];if(_0x56bf6d['message'][_0x32dec5(0x97)]('ENOTFOUND'))return![];}return![];}function a272_0x80e4(_0x52a80d,_0x1b15b6){_0x52a80d=_0x52a80d-0x8d;const _0x3b63bb=a272_0x3b63();let _0x80e46=_0x3b63bb[_0x52a80d];return _0x80e46;}function sleep(_0x139bee){return new Promise(_0x47135a=>setTimeout(_0x47135a,_0x139bee));}export function validateUrl(_0xa8e4f4){try{return new URL(_0xa8e4f4),!![];}catch{return![];}}
1
+ function a270_0x3882(_0x186d21,_0x4664e8){_0x186d21=_0x186d21-0x18f;const _0x1465e9=a270_0x1465();let _0x3882e3=_0x1465e9[_0x186d21];return _0x3882e3;}(function(_0x4ef4c8,_0x15fb52){const _0x39e73c=a270_0x3882,_0x4ecaee=_0x4ef4c8();while(!![]){try{const _0x5b6085=-parseInt(_0x39e73c(0x19d))/0x1+parseInt(_0x39e73c(0x1a1))/0x2*(parseInt(_0x39e73c(0x1ad))/0x3)+parseInt(_0x39e73c(0x1a7))/0x4*(-parseInt(_0x39e73c(0x1a9))/0x5)+parseInt(_0x39e73c(0x195))/0x6+parseInt(_0x39e73c(0x1a5))/0x7+-parseInt(_0x39e73c(0x1aa))/0x8*(-parseInt(_0x39e73c(0x1a3))/0x9)+parseInt(_0x39e73c(0x1ac))/0xa*(-parseInt(_0x39e73c(0x1a6))/0xb);if(_0x5b6085===_0x15fb52)break;else _0x4ecaee['push'](_0x4ecaee['shift']());}catch(_0x4bbc69){_0x4ecaee['push'](_0x4ecaee['shift']());}}}(a270_0x1465,0xae4e3));function a270_0x1465(){const _0x4c1e13=['headers','35686GYkLTZ','includes','99qTesNK','text','5621742ueGdER','77JsHmLM','765956DuYyGn','log','15hUWnin','437432YQABQV','*\x20请求失败,','1149570hFwhrN','204pIsewC','TypeError','ECONNRESET','ms\x20后进行第\x20','\x20次重试...','message','Request\x20failed','get','789534iaZbiQ','ENOTFOUND','AbortError','json','name','abort','statusText','url','656367hAzJhM','content-type','status'];a270_0x1465=function(){return _0x4c1e13;};return a270_0x1465();}export async function httpRequest(_0x5e182c,_0x534f6f={}){const _0xbe7639=a270_0x3882,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x534f6f;let _0x4f3796=null;for(let _0x2c0698=0x0;_0x2c0698<=retries;_0x2c0698++){try{const _0x3d4cee=new AbortController(),_0x38f259=setTimeout(()=>_0x3d4cee[_0xbe7639(0x19a)](),timeout),_0x190516=await fetch(_0x5e182c,{'headers':headers,'signal':_0x3d4cee['signal']});clearTimeout(_0x38f259);let _0x14813e;const _0x259b10=_0x190516[_0xbe7639(0x1a0)][_0xbe7639(0x194)](_0xbe7639(0x19e));return _0x259b10?.[_0xbe7639(0x1a2)]('application/json')?_0x14813e=await _0x190516[_0xbe7639(0x198)]():_0x14813e=await _0x190516[_0xbe7639(0x1a4)](),{'ok':_0x190516['ok'],'status':_0x190516[_0xbe7639(0x19f)],'statusText':_0x190516[_0xbe7639(0x19b)],'data':_0x14813e,'headers':_0x190516['headers'],'url':_0x190516[_0xbe7639(0x19c)],'text':()=>_0x190516[_0xbe7639(0x1a4)]()};}catch(_0x493ada){_0x4f3796=_0x493ada instanceof Error?_0x493ada:new Error(String(_0x493ada));if(_0x2c0698===retries)break;if(shouldRetry(_0x493ada)){console[_0xbe7639(0x1a8)](_0xbe7639(0x1ab)+retryDelay+_0xbe7639(0x190)+(_0x2c0698+0x1)+_0xbe7639(0x191)),await sleep(retryDelay);continue;}else break;}}throw _0x4f3796||new Error(_0xbe7639(0x193));}function shouldRetry(_0x136148){const _0x5b8435=a270_0x3882;if(_0x136148 instanceof Error){if(_0x136148[_0x5b8435(0x199)]===_0x5b8435(0x197))return![];if(_0x136148[_0x5b8435(0x199)]===_0x5b8435(0x1ae)&&_0x136148[_0x5b8435(0x192)]['includes']('fetch'))return!![];if(_0x136148['message'][_0x5b8435(0x1a2)](_0x5b8435(0x18f)))return!![];if(_0x136148[_0x5b8435(0x192)][_0x5b8435(0x1a2)](_0x5b8435(0x196)))return![];}return![];}function sleep(_0x40d1cb){return new Promise(_0x36c74c=>setTimeout(_0x36c74c,_0x40d1cb));}export function validateUrl(_0x1f2f4d){try{return new URL(_0x1f2f4d),!![];}catch{return![];}}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 统一的非交互模式检测
3
+ *
4
+ * 唯一入口,context.ts 和 cli.tsx 均引用此函数,
5
+ * 避免两处实现产生不一致行为。
6
+ */
7
+ export declare function isNonInteractive(flags: Record<string, any>): boolean;
@@ -1 +1 @@
1
- (function(_0x230176,_0x3b21e6){const _0x3460aa=a273_0x1da1,_0x515666=_0x230176();while(!![]){try{const _0x3770c1=parseInt(_0x3460aa(0x90))/0x1+-parseInt(_0x3460aa(0x95))/0x2+-parseInt(_0x3460aa(0x94))/0x3*(-parseInt(_0x3460aa(0x91))/0x4)+parseInt(_0x3460aa(0x8d))/0x5*(parseInt(_0x3460aa(0x88))/0x6)+-parseInt(_0x3460aa(0x98))/0x7+-parseInt(_0x3460aa(0x92))/0x8*(parseInt(_0x3460aa(0x97))/0x9)+parseInt(_0x3460aa(0x96))/0xa*(parseInt(_0x3460aa(0x8a))/0xb);if(_0x3770c1===_0x3b21e6)break;else _0x515666['push'](_0x515666['shift']());}catch(_0x48cfd5){_0x515666['push'](_0x515666['shift']());}}}(a273_0x3edb,0x8b4d3));function a273_0x1da1(_0x1b2350,_0x26af48){_0x1b2350=_0x1b2350-0x88;const _0x3edb33=a273_0x3edb();let _0x1da1e1=_0x3edb33[_0x1b2350];return _0x1da1e1;}function a273_0x3edb(){const _0x5ea8ce=['stdout','isTTY','375ibYdXs','setRawMode','true','365332VRhvJl','7628DZwbJY','27000qExeyH','isRaw','321RZjDrh','781248OgHXbl','10zBgdEA','396xLAMyq','122654nTAIGY','24684YxncjK','stdin','2742234psNcDl'];a273_0x3edb=function(){return _0x5ea8ce;};return a273_0x3edb();}function env(_0x4ac5ef){return process.env[`RABETBASE_${_0x4ac5ef}`]||process.env[`LOVRABET_${_0x4ac5ef}`]||undefined;}export function isNonInteractive(_0x2591b2){const _0x542415=a273_0x1da1;return!!(_0x2591b2['nonInteractive']||_0x2591b2['ci']||env('CI')==='true'||process.env.CI===_0x542415(0x8f)||!process[_0x542415(0x8b)][_0x542415(0x8c)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x4ec373=a273_0x1da1;if(!process[_0x4ec373(0x89)]['isTTY'])return![];try{const _0x583f0=process[_0x4ec373(0x89)][_0x4ec373(0x93)];return process[_0x4ec373(0x89)][_0x4ec373(0x8e)](!![]),process['stdin'][_0x4ec373(0x8e)](_0x583f0??![]),!![];}catch{return![];}}
1
+ (function(_0x333cce,_0x3d9b1e){const _0x270941=a271_0x568d,_0x2c446c=_0x333cce();while(!![]){try{const _0x10724d=-parseInt(_0x270941(0x159))/0x1*(parseInt(_0x270941(0x156))/0x2)+parseInt(_0x270941(0x154))/0x3*(-parseInt(_0x270941(0x150))/0x4)+parseInt(_0x270941(0x15b))/0x5*(parseInt(_0x270941(0x14c))/0x6)+-parseInt(_0x270941(0x15a))/0x7*(-parseInt(_0x270941(0x149))/0x8)+-parseInt(_0x270941(0x14a))/0x9*(parseInt(_0x270941(0x152))/0xa)+parseInt(_0x270941(0x14f))/0xb*(-parseInt(_0x270941(0x157))/0xc)+-parseInt(_0x270941(0x14e))/0xd*(-parseInt(_0x270941(0x155))/0xe);if(_0x10724d===_0x3d9b1e)break;else _0x2c446c['push'](_0x2c446c['shift']());}catch(_0xf843f3){_0x2c446c['push'](_0x2c446c['shift']());}}}(a271_0x663e,0xcc793));function env(_0x1f0353){return process.env[`RABETBASE_${_0x1f0353}`]||process.env[`LOVRABET_${_0x1f0353}`]||undefined;}function a271_0x568d(_0x46c1b2,_0x1aed4f){_0x46c1b2=_0x46c1b2-0x149;const _0x663e3e=a271_0x663e();let _0x568d98=_0x663e3e[_0x46c1b2];return _0x568d98;}export function isNonInteractive(_0x1d5cf8){const _0x6e3e4e=a271_0x568d;return!!(_0x1d5cf8['nonInteractive']||_0x1d5cf8['ci']||env('CI')===_0x6e3e4e(0x158)||process.env.CI===_0x6e3e4e(0x158)||!process[_0x6e3e4e(0x14d)][_0x6e3e4e(0x153)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x2ee95b=a271_0x568d;if(!process[_0x2ee95b(0x14b)][_0x2ee95b(0x153)])return![];try{const _0xed2b82=process[_0x2ee95b(0x14b)]['isRaw'];return process['stdin'][_0x2ee95b(0x151)](!![]),process[_0x2ee95b(0x14b)][_0x2ee95b(0x151)](_0xed2b82??![]),!![];}catch{return![];}}function a271_0x663e(){const _0x446937=['26514kVBaos','stdin','2766AQCULB','stdout','38596337kvcmSz','11nyqVzL','4ZEGMhI','setRawMode','4090ysapJk','isTTY','1750983cusbcw','14krNKsW','7662mLcqZO','9140232SiQtgR','true','234FGQrlw','1071413bHCPNb','985pEoxZG','64mFczvW'];a271_0x663e=function(){return _0x446937;};return a271_0x663e();}
@@ -0,0 +1,62 @@
1
+ import winston from "winston";
2
+ export interface LogEntry {
3
+ timestamp: string;
4
+ level: "info" | "success" | "error" | "warn";
5
+ command: string;
6
+ rawCommand?: string;
7
+ message: string;
8
+ duration?: number;
9
+ details?: any;
10
+ }
11
+ declare class Logger {
12
+ private winstonLogger;
13
+ private logFilePath;
14
+ private currentRawCommand;
15
+ constructor();
16
+ /**
17
+ * 设置当前执行的原始命令
18
+ */
19
+ setRawCommand(rawCommand: string): void;
20
+ /**
21
+ * 初始化 Winston Logger
22
+ */
23
+ private initWinstonLogger;
24
+ /**
25
+ * 设置日志文件路径
26
+ */
27
+ setLogPath(projectPath: string): void;
28
+ /**
29
+ * 记录信息日志
30
+ */
31
+ info(command: string, message: string, details?: any): void;
32
+ /**
33
+ * 记录成功日志
34
+ */
35
+ success(command: string, message: string, duration?: number, details?: any): void;
36
+ /**
37
+ * 记录错误日志
38
+ */
39
+ error(command: string, message: string, details?: any): void;
40
+ /**
41
+ * 记录警告日志
42
+ */
43
+ warn(command: string, message: string, details?: any): void;
44
+ /**
45
+ * 记录带执行时间的任务
46
+ */
47
+ logTask<T>(command: string, taskName: string, task: () => Promise<T>): Promise<T>;
48
+ /**
49
+ * 读取日志文件内容
50
+ */
51
+ readLogs(): LogEntry[];
52
+ /**
53
+ * 清空日志文件
54
+ */
55
+ clearLogs(): void;
56
+ /**
57
+ * 获取 Winston Logger 实例 (用于高级用法)
58
+ */
59
+ getWinstonInstance(): winston.Logger;
60
+ }
61
+ export declare const logger: Logger;
62
+ export {};
@@ -1 +1 @@
1
- const a274_0x5e12fb=a274_0x5200;(function(_0xc08667,_0x2be717){const _0x3e8323=a274_0x5200,_0x4514ad=_0xc08667();while(!![]){try{const _0x404eae=-parseInt(_0x3e8323(0x12a))/0x1+-parseInt(_0x3e8323(0x12b))/0x2*(-parseInt(_0x3e8323(0x130))/0x3)+-parseInt(_0x3e8323(0x157))/0x4*(-parseInt(_0x3e8323(0x12e))/0x5)+-parseInt(_0x3e8323(0x14d))/0x6*(-parseInt(_0x3e8323(0x151))/0x7)+parseInt(_0x3e8323(0x141))/0x8+parseInt(_0x3e8323(0x135))/0x9*(parseInt(_0x3e8323(0x150))/0xa)+parseInt(_0x3e8323(0x155))/0xb*(-parseInt(_0x3e8323(0x131))/0xc);if(_0x404eae===_0x2be717)break;else _0x4514ad['push'](_0x4514ad['shift']());}catch(_0x5a544c){_0x4514ad['push'](_0x4514ad['shift']());}}}(a274_0x532b,0x610c0));import a274_0x3ac139 from'winston';import a274_0x2738ad from'node:fs';import a274_0x2e11c4 from'node:path';function a274_0x532b(){const _0x5ea08f=['yellow','warn','2046144WmqRMw','writeFileSync','Failed\x20to\x20clear\x20logs:','message','完成:\x20','red','level','error','parse','toISOString','green','getWinstonInstance','546fBChww','Failed\x20to\x20read\x20logs:','readFileSync','71560LjTUGZ','30044nxlOms','info','unknown','now','7260oiUOee','setRawCommand','4jrvzJT','stringify','map','readLogs','format','logFilePath','utf8','clearLogs','setLogPath','rawCommand','duration','command','失败:\x20','436661wjKCEN','32576GsSPRM','File','winstonLogger','1493025Enfrah','initWinstonLogger','93EHdqer','12756bDAxIj','blue','currentRawCommand','existsSync','108PSIsnh','log','.lovrabet.log','details','printf','trim','addColors','success','timestamp','split'];a274_0x532b=function(){return _0x5ea08f;};return a274_0x532b();}function a274_0x5200(_0x5e449c,_0x2c4137){_0x5e449c=_0x5e449c-0x126;const _0x532b19=a274_0x532b();let _0x520061=_0x532b19[_0x5e449c];return _0x520061;}class Logger{[a274_0x5e12fb(0x12d)];[a274_0x5e12fb(0x15c)];[a274_0x5e12fb(0x133)]='';constructor(){const _0x3cda7d=a274_0x5e12fb;this[_0x3cda7d(0x15c)]='';}[a274_0x5e12fb(0x156)](_0x2df498){const _0x1697d3=a274_0x5e12fb;this[_0x1697d3(0x133)]=_0x2df498;}[a274_0x5e12fb(0x12f)](){const _0x210f46=a274_0x5e12fb,_0xd90cc7=a274_0x2e11c4['dirname'](this[_0x210f46(0x15c)]);!a274_0x2738ad[_0x210f46(0x134)](_0xd90cc7)&&a274_0x2738ad['mkdirSync'](_0xd90cc7,{'recursive':!![]});const _0x42ad99=a274_0x3ac139[_0x210f46(0x15b)]['combine'](a274_0x3ac139[_0x210f46(0x15b)]['timestamp'](),a274_0x3ac139[_0x210f46(0x15b)]['errors']({'stack':!![]}),a274_0x3ac139[_0x210f46(0x15b)][_0x210f46(0x139)](_0x5f1ec2=>{const _0x5a8e50=_0x210f46,_0x4d3b00={'timestamp':_0x5f1ec2[_0x5a8e50(0x13d)]||new Date()[_0x5a8e50(0x14a)](),'level':_0x5f1ec2[_0x5a8e50(0x147)]||_0x5a8e50(0x152),'command':_0x5f1ec2[_0x5a8e50(0x128)]||_0x5a8e50(0x153),'rawCommand':_0x5f1ec2[_0x5a8e50(0x126)]||this[_0x5a8e50(0x133)]||undefined,'message':_0x5f1ec2[_0x5a8e50(0x144)]||'','duration':_0x5f1ec2[_0x5a8e50(0x127)]||undefined,'details':_0x5f1ec2[_0x5a8e50(0x138)]||undefined};return JSON[_0x5a8e50(0x158)](_0x4d3b00);}));this[_0x210f46(0x12d)]=a274_0x3ac139['createLogger']({'level':_0x210f46(0x152),'format':_0x42ad99,'transports':[new a274_0x3ac139['transports'][(_0x210f46(0x12c))]({'filename':this[_0x210f46(0x15c)],'level':_0x210f46(0x152)})],'silent':![]}),a274_0x3ac139[_0x210f46(0x13b)]({'success':_0x210f46(0x14b),'error':_0x210f46(0x146),'warn':_0x210f46(0x13f),'info':_0x210f46(0x132)});}[a274_0x5e12fb(0x15f)](_0x1ad070){const _0x3736c7=a274_0x5e12fb;this[_0x3736c7(0x15c)]=a274_0x2e11c4['join'](_0x1ad070,_0x3736c7(0x137)),this[_0x3736c7(0x12d)]&&this['winstonLogger']['clear'](),this[_0x3736c7(0x12f)]();}[a274_0x5e12fb(0x152)](_0x36bb84,_0xd8583d,_0xe52566){const _0x1bea35=a274_0x5e12fb;if(!this[_0x1bea35(0x15c)]||!this[_0x1bea35(0x12d)])return;this[_0x1bea35(0x12d)][_0x1bea35(0x152)](_0xd8583d,{'command':_0x36bb84,'details':_0xe52566});}[a274_0x5e12fb(0x13c)](_0x4277d5,_0x2a9605,_0x16880c,_0x3a324b){const _0x1baa77=a274_0x5e12fb;if(!this[_0x1baa77(0x15c)]||!this[_0x1baa77(0x12d)])return;this[_0x1baa77(0x12d)][_0x1baa77(0x136)](_0x1baa77(0x152),_0x2a9605,{'level':'success','command':_0x4277d5,'duration':_0x16880c,'details':_0x3a324b});}['error'](_0x40f25e,_0x151e68,_0x2de7e3){const _0x702f51=a274_0x5e12fb;if(!this[_0x702f51(0x15c)]||!this['winstonLogger'])return;this[_0x702f51(0x12d)]['error'](_0x151e68,{'command':_0x40f25e,'details':_0x2de7e3});}[a274_0x5e12fb(0x140)](_0x277c65,_0x36e67d,_0x4e4c33){const _0x4cf843=a274_0x5e12fb;if(!this[_0x4cf843(0x15c)]||!this[_0x4cf843(0x12d)])return;this[_0x4cf843(0x12d)]['warn'](_0x36e67d,{'command':_0x277c65,'details':_0x4e4c33});}async['logTask'](_0x16d27b,_0x253c9e,_0x394585){const _0x3b165b=a274_0x5e12fb,_0x5704bc=Date[_0x3b165b(0x154)]();this['info'](_0x16d27b,'开始执行:\x20'+_0x253c9e);try{const _0x38eb2e=await _0x394585(),_0x347e60=Date[_0x3b165b(0x154)]()-_0x5704bc;return this[_0x3b165b(0x13c)](_0x16d27b,_0x3b165b(0x145)+_0x253c9e,_0x347e60),_0x38eb2e;}catch(_0x2c312c){const _0x6fb3d8=Date[_0x3b165b(0x154)]()-_0x5704bc;this[_0x3b165b(0x148)](_0x16d27b,_0x3b165b(0x129)+_0x253c9e,{'error':_0x2c312c instanceof Error?_0x2c312c[_0x3b165b(0x144)]:String(_0x2c312c),'duration':_0x6fb3d8});throw _0x2c312c;}}[a274_0x5e12fb(0x15a)](){const _0x14f50a=a274_0x5e12fb;try{if(!a274_0x2738ad[_0x14f50a(0x134)](this[_0x14f50a(0x15c)]))return[];const _0x20d434=a274_0x2738ad[_0x14f50a(0x14f)](this[_0x14f50a(0x15c)],_0x14f50a(0x15d));return _0x20d434[_0x14f50a(0x13e)]('\x0a')['filter'](_0x1bea4a=>_0x1bea4a[_0x14f50a(0x13a)]())[_0x14f50a(0x159)](_0x1c08a4=>JSON[_0x14f50a(0x149)](_0x1c08a4));}catch(_0xd8d860){return console[_0x14f50a(0x140)](_0x14f50a(0x14e),_0xd8d860),[];}}[a274_0x5e12fb(0x15e)](){const _0x4237e0=a274_0x5e12fb;try{a274_0x2738ad[_0x4237e0(0x134)](this[_0x4237e0(0x15c)])&&a274_0x2738ad[_0x4237e0(0x142)](this[_0x4237e0(0x15c)],'',_0x4237e0(0x15d));}catch(_0x554b0a){console['warn'](_0x4237e0(0x143),_0x554b0a);}}[a274_0x5e12fb(0x14c)](){return this['winstonLogger'];}}export const logger=new Logger();
1
+ const a272_0x2b852a=a272_0xcf91;function a272_0xcf91(_0x4366ff,_0x388c97){_0x4366ff=_0x4366ff-0xe8;const _0x426833=a272_0x4268();let _0xcf9193=_0x426833[_0x4366ff];return _0xcf9193;}(function(_0x431d5a,_0x2a6971){const _0x2b5492=a272_0xcf91,_0x54d516=_0x431d5a();while(!![]){try{const _0x4dcf14=parseInt(_0x2b5492(0x10e))/0x1+parseInt(_0x2b5492(0x108))/0x2+parseInt(_0x2b5492(0x11c))/0x3*(-parseInt(_0x2b5492(0x11e))/0x4)+-parseInt(_0x2b5492(0xef))/0x5*(-parseInt(_0x2b5492(0xf3))/0x6)+-parseInt(_0x2b5492(0x107))/0x7+-parseInt(_0x2b5492(0xf0))/0x8*(parseInt(_0x2b5492(0x109))/0x9)+parseInt(_0x2b5492(0xeb))/0xa*(-parseInt(_0x2b5492(0x114))/0xb);if(_0x4dcf14===_0x2a6971)break;else _0x54d516['push'](_0x54d516['shift']());}catch(_0x29bf6f){_0x54d516['push'](_0x54d516['shift']());}}}(a272_0x4268,0x3f5fc));import a272_0x40fd6c from'winston';import a272_0x337f91 from'node:fs';import a272_0x1265f1 from'node:path';class Logger{[a272_0x2b852a(0x116)];['logFilePath'];['currentRawCommand']='';constructor(){const _0x321971=a272_0x2b852a;this[_0x321971(0x100)]='';}[a272_0x2b852a(0x10f)](_0x424dec){const _0xc9fc2c=a272_0x2b852a;this[_0xc9fc2c(0xf7)]=_0x424dec;}['initWinstonLogger'](){const _0x352ef5=a272_0x2b852a,_0x1105da=a272_0x1265f1[_0x352ef5(0xe9)](this[_0x352ef5(0x100)]);!a272_0x337f91[_0x352ef5(0x11a)](_0x1105da)&&a272_0x337f91['mkdirSync'](_0x1105da,{'recursive':!![]});const _0x1dd986=a272_0x40fd6c[_0x352ef5(0x11b)][_0x352ef5(0x104)](a272_0x40fd6c[_0x352ef5(0x11b)][_0x352ef5(0x111)](),a272_0x40fd6c[_0x352ef5(0x11b)]['errors']({'stack':!![]}),a272_0x40fd6c[_0x352ef5(0x11b)][_0x352ef5(0xee)](_0x548804=>{const _0x2b278f=_0x352ef5,_0x32383e={'timestamp':_0x548804[_0x2b278f(0x111)]||new Date()[_0x2b278f(0x101)](),'level':_0x548804[_0x2b278f(0x10b)]||_0x2b278f(0xfa),'command':_0x548804['command']||_0x2b278f(0xf8),'rawCommand':_0x548804[_0x2b278f(0x105)]||this['currentRawCommand']||undefined,'message':_0x548804[_0x2b278f(0x118)]||'','duration':_0x548804[_0x2b278f(0x112)]||undefined,'details':_0x548804[_0x2b278f(0x11f)]||undefined};return JSON[_0x2b278f(0x115)](_0x32383e);}));this[_0x352ef5(0x116)]=a272_0x40fd6c[_0x352ef5(0xec)]({'level':_0x352ef5(0xfa),'format':_0x1dd986,'transports':[new a272_0x40fd6c[(_0x352ef5(0x119))]['File']({'filename':this[_0x352ef5(0x100)],'level':'info'})],'silent':![]}),a272_0x40fd6c[_0x352ef5(0x11d)]({'success':'green','error':_0x352ef5(0xfd),'warn':_0x352ef5(0xfc),'info':_0x352ef5(0x10c)});}['setLogPath'](_0x134f29){const _0x229a9f=a272_0x2b852a;this['logFilePath']=a272_0x1265f1[_0x229a9f(0x10a)](_0x134f29,_0x229a9f(0xf5)),this[_0x229a9f(0x116)]&&this[_0x229a9f(0x116)][_0x229a9f(0xf4)](),this[_0x229a9f(0xf1)]();}['info'](_0x2abd9c,_0x3e2269,_0x47f892){const _0x99daf2=a272_0x2b852a;if(!this[_0x99daf2(0x100)]||!this[_0x99daf2(0x116)])return;this['winstonLogger'][_0x99daf2(0xfa)](_0x3e2269,{'command':_0x2abd9c,'details':_0x47f892});}['success'](_0x24690d,_0x30e5d7,_0x53df8c,_0x1e16b0){const _0x33d476=a272_0x2b852a;if(!this[_0x33d476(0x100)]||!this[_0x33d476(0x116)])return;this[_0x33d476(0x116)]['log'](_0x33d476(0xfa),_0x30e5d7,{'level':_0x33d476(0x10d),'command':_0x24690d,'duration':_0x53df8c,'details':_0x1e16b0});}['error'](_0x520b83,_0x257778,_0x403676){const _0x4ed527=a272_0x2b852a;if(!this[_0x4ed527(0x100)]||!this[_0x4ed527(0x116)])return;this[_0x4ed527(0x116)][_0x4ed527(0x102)](_0x257778,{'command':_0x520b83,'details':_0x403676});}[a272_0x2b852a(0xf9)](_0x4dba1c,_0x5a17c1,_0x32a326){const _0x579749=a272_0x2b852a;if(!this['logFilePath']||!this['winstonLogger'])return;this[_0x579749(0x116)][_0x579749(0xf9)](_0x5a17c1,{'command':_0x4dba1c,'details':_0x32a326});}async[a272_0x2b852a(0x117)](_0x3c8c18,_0xda953a,_0x36b331){const _0x4a8345=a272_0x2b852a,_0x427100=Date['now']();this[_0x4a8345(0xfa)](_0x3c8c18,_0x4a8345(0x106)+_0xda953a);try{const _0x35dccb=await _0x36b331(),_0x1b90fa=Date[_0x4a8345(0x103)]()-_0x427100;return this[_0x4a8345(0x10d)](_0x3c8c18,'完成:\x20'+_0xda953a,_0x1b90fa),_0x35dccb;}catch(_0x27a4d4){const _0x5c6c1a=Date[_0x4a8345(0x103)]()-_0x427100;this[_0x4a8345(0x102)](_0x3c8c18,_0x4a8345(0xff)+_0xda953a,{'error':_0x27a4d4 instanceof Error?_0x27a4d4['message']:String(_0x27a4d4),'duration':_0x5c6c1a});throw _0x27a4d4;}}[a272_0x2b852a(0x120)](){const _0x2f1549=a272_0x2b852a;try{if(!a272_0x337f91[_0x2f1549(0x11a)](this[_0x2f1549(0x100)]))return[];const _0x1f9ada=a272_0x337f91[_0x2f1549(0xea)](this[_0x2f1549(0x100)],_0x2f1549(0xf2));return _0x1f9ada[_0x2f1549(0xfe)]('\x0a')[_0x2f1549(0xed)](_0x38d4d6=>_0x38d4d6[_0x2f1549(0xe8)]())['map'](_0x400ebe=>JSON[_0x2f1549(0xfb)](_0x400ebe));}catch(_0x544c01){return console[_0x2f1549(0xf9)](_0x2f1549(0x121),_0x544c01),[];}}[a272_0x2b852a(0xf6)](){const _0x8173ea=a272_0x2b852a;try{a272_0x337f91['existsSync'](this['logFilePath'])&&a272_0x337f91['writeFileSync'](this[_0x8173ea(0x100)],'',_0x8173ea(0xf2));}catch(_0x8a3da1){console['warn'](_0x8173ea(0x110),_0x8a3da1);}}[a272_0x2b852a(0x113)](){const _0x40c57e=a272_0x2b852a;return this[_0x40c57e(0x116)];}}function a272_0x4268(){const _0x56b2fe=['clearLogs','currentRawCommand','unknown','warn','info','parse','yellow','red','split','失败:\x20','logFilePath','toISOString','error','now','combine','rawCommand','开始执行:\x20','339976kYadve','990018PYKpdL','9iscUAq','join','level','blue','success','324917oMmCem','setRawCommand','Failed\x20to\x20clear\x20logs:','timestamp','duration','getWinstonInstance','699281EogYhy','stringify','winstonLogger','logTask','message','transports','existsSync','format','956919RILKeu','addColors','4ZwlYua','details','readLogs','Failed\x20to\x20read\x20logs:','trim','dirname','readFileSync','10uVHnlx','createLogger','filter','printf','102215urgzPO','1197416gkoyDD','initWinstonLogger','utf8','6FJsKJv','clear','.lovrabet.log'];a272_0x4268=function(){return _0x56b2fe;};return a272_0x4268();}export const logger=new Logger();
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @fileoverview Shared JSON parsing helpers for `--params`.
3
+ *
4
+ * These helpers keep parameter parsing consistent across commands that accept
5
+ * structured JSON input. The current callers all require an object payload,
6
+ * so arrays and primitives are rejected with a validation error.
7
+ */
8
+ /**
9
+ * Parses `--params` as a JSON object.
10
+ *
11
+ * @param paramsStr - Raw `--params` flag value.
12
+ * @returns Parsed object, or `undefined` when the flag is not provided.
13
+ * @throws CliError When the value is not valid JSON or is not a JSON object.
14
+ */
15
+ export declare function parseJsonParams(paramsStr: string | undefined): Record<string, any> | undefined;
@@ -1 +1 @@
1
- (function(_0x4d2313,_0xe25b80){const _0x50026e=a275_0x5e24,_0x555624=_0x4d2313();while(!![]){try{const _0x2a611b=parseInt(_0x50026e(0x1e0))/0x1*(-parseInt(_0x50026e(0x1ee))/0x2)+parseInt(_0x50026e(0x1ea))/0x3+-parseInt(_0x50026e(0x1e8))/0x4*(parseInt(_0x50026e(0x1eb))/0x5)+parseInt(_0x50026e(0x1e1))/0x6*(parseInt(_0x50026e(0x1ef))/0x7)+parseInt(_0x50026e(0x1e9))/0x8*(parseInt(_0x50026e(0x1e6))/0x9)+-parseInt(_0x50026e(0x1e4))/0xa*(parseInt(_0x50026e(0x1e2))/0xb)+parseInt(_0x50026e(0x1ed))/0xc;if(_0x2a611b===_0xe25b80)break;else _0x555624['push'](_0x555624['shift']());}catch(_0x24fa5e){_0x555624['push'](_0x555624['shift']());}}}(a275_0x4fd1,0x66762));function a275_0x5e24(_0x57cf31,_0x158e69){_0x57cf31=_0x57cf31-0x1df;const _0x4fd197=a275_0x4fd1();let _0x5e2471=_0x4fd197[_0x57cf31];return _0x5e2471;}function a275_0x4fd1(){const _0x1612ea=['16216tLyXVU','2294064PndjoT','26245vbhCKT','--params\x20must\x20be\x20a\x20JSON\x20object','1951860qNFaWC','1649506hgwaXp','95543cUfqoB','Invalid\x20JSON\x20for\x20--params:\x20','parse','1eMDtHd','348RRmPzB','184514nCsjVb','validation','230PTJevR','Example:\x20--params\x20\x27{\x22id\x22:123}\x27','981ZnZFKZ','object','236yADary'];a275_0x4fd1=function(){return _0x1612ea;};return a275_0x4fd1();}import{CliErrors}from'../errors.js';export function parseJsonParams(_0x19243b){const _0x58b334=a275_0x5e24;if(!_0x19243b)return undefined;let _0x3b14c8;try{_0x3b14c8=JSON[_0x58b334(0x1df)](_0x19243b);}catch{throw CliErrors['validation'](_0x58b334(0x1f0)+_0x19243b);}if(!_0x3b14c8||typeof _0x3b14c8!==_0x58b334(0x1e7)||Array['isArray'](_0x3b14c8))throw CliErrors[_0x58b334(0x1e3)](_0x58b334(0x1ec),_0x58b334(0x1e5));return _0x3b14c8;}
1
+ (function(_0x18f119,_0x486c83){const _0x174eac=a273_0x3025,_0x517b07=_0x18f119();while(!![]){try{const _0x5bef0e=-parseInt(_0x174eac(0x69))/0x1*(-parseInt(_0x174eac(0x6d))/0x2)+parseInt(_0x174eac(0x72))/0x3+-parseInt(_0x174eac(0x6b))/0x4*(parseInt(_0x174eac(0x76))/0x5)+parseInt(_0x174eac(0x70))/0x6+-parseInt(_0x174eac(0x78))/0x7*(parseInt(_0x174eac(0x71))/0x8)+parseInt(_0x174eac(0x6c))/0x9+-parseInt(_0x174eac(0x6f))/0xa;if(_0x5bef0e===_0x486c83)break;else _0x517b07['push'](_0x517b07['shift']());}catch(_0x3b794a){_0x517b07['push'](_0x517b07['shift']());}}}(a273_0x4d33,0x28d22));function a273_0x3025(_0x423f43,_0xd18ae2){_0x423f43=_0x423f43-0x69;const _0x4d3390=a273_0x4d33();let _0x302518=_0x4d3390[_0x423f43];return _0x302518;}import{CliErrors}from'../errors.js';function a273_0x4d33(){const _0x553434=['--params\x20must\x20be\x20a\x20JSON\x20object','isArray','parse','325865DKRXeD','Invalid\x20JSON\x20for\x20--params:\x20','652939NHjESf','121sKaMJH','Example:\x20--params\x20\x27{\x22id\x22:123}\x27','12gsOVAY','1462518CTdAVM','2322VlGliC','validation','1472830psboRw','1594680PtRPBw','8KJZypH','103554nIoiKS'];a273_0x4d33=function(){return _0x553434;};return a273_0x4d33();}export function parseJsonParams(_0x3e09d4){const _0x90fe6e=a273_0x3025;if(!_0x3e09d4)return undefined;let _0x6a942d;try{_0x6a942d=JSON[_0x90fe6e(0x75)](_0x3e09d4);}catch{throw CliErrors[_0x90fe6e(0x6e)](_0x90fe6e(0x77)+_0x3e09d4);}if(!_0x6a942d||typeof _0x6a942d!=='object'||Array[_0x90fe6e(0x74)](_0x6a942d))throw CliErrors['validation'](_0x90fe6e(0x73),_0x90fe6e(0x6a));return _0x6a942d;}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Platform-specific utilities for cross-platform CLI execution.
3
+ *
4
+ * On Windows, npm-installed CLIs (npm, npx, pnpm, yarn) are .cmd batch
5
+ * wrappers. Node's spawn/spawnSync without `shell: true` cannot locate them
6
+ * without the explicit .cmd extension. execa (via cross-spawn) handles this
7
+ * automatically, but for spawn/spawnSync callers use resolveNpmBin explicitly.
8
+ *
9
+ * NOTE: Native executables like bun.exe do NOT need this treatment.
10
+ * Only use resolveNpmBin for npm-ecosystem batch wrappers.
11
+ */
12
+ export declare const isWindows: boolean;
13
+ /**
14
+ * Resolve the correct executable name for npm-ecosystem batch wrappers on Windows.
15
+ * Use this whenever calling spawn/spawnSync (without shell: true) with npm, npx, etc.
16
+ *
17
+ * @example
18
+ * resolveNpmBin("npx") // "npx" on macOS/Linux, "npx.cmd" on Windows
19
+ * resolveNpmBin("npm") // "npm" on macOS/Linux, "npm.cmd" on Windows
20
+ */
21
+ export declare function resolveNpmBin(cmd: string): string;
@@ -1 +1 @@
1
- const a276_0x5e2be2=a276_0x1125;function a276_0x1125(_0x347bd0,_0x3c3511){_0x347bd0=_0x347bd0-0x15e;const _0x47442f=a276_0x4744();let _0x11252e=_0x47442f[_0x347bd0];return _0x11252e;}(function(_0x283b90,_0x32b612){const _0x4d6025=a276_0x1125,_0x21e3b9=_0x283b90();while(!![]){try{const _0xeddb63=parseInt(_0x4d6025(0x165))/0x1+-parseInt(_0x4d6025(0x168))/0x2+parseInt(_0x4d6025(0x15e))/0x3+parseInt(_0x4d6025(0x161))/0x4+parseInt(_0x4d6025(0x15f))/0x5+-parseInt(_0x4d6025(0x166))/0x6*(parseInt(_0x4d6025(0x162))/0x7)+-parseInt(_0x4d6025(0x167))/0x8;if(_0xeddb63===_0x32b612)break;else _0x21e3b9['push'](_0x21e3b9['shift']());}catch(_0x8feca6){_0x21e3b9['push'](_0x21e3b9['shift']());}}}(a276_0x4744,0x8eed9));function a276_0x4744(){const _0x2d2f2e=['272517cuVvTB','platform','.cmd','868525vHntrP','6yJkaVQ','13266656YJkiNt','1324058owfttO','1779768YsvcQO','2684535kIVhGC','win32','3784148NlRezQ'];a276_0x4744=function(){return _0x2d2f2e;};return a276_0x4744();}export const isWindows=process[a276_0x5e2be2(0x163)]===a276_0x5e2be2(0x160);export function resolveNpmBin(_0x289978){const _0x1bc2ef=a276_0x5e2be2;return isWindows?_0x289978+_0x1bc2ef(0x164):_0x289978;}
1
+ const a274_0x2b43dd=a274_0x471f;(function(_0x26f4d4,_0x318a45){const _0x5ea323=a274_0x471f,_0x14a786=_0x26f4d4();while(!![]){try{const _0x470942=-parseInt(_0x5ea323(0x172))/0x1*(parseInt(_0x5ea323(0x16d))/0x2)+-parseInt(_0x5ea323(0x175))/0x3*(-parseInt(_0x5ea323(0x177))/0x4)+-parseInt(_0x5ea323(0x171))/0x5*(-parseInt(_0x5ea323(0x176))/0x6)+-parseInt(_0x5ea323(0x16b))/0x7+-parseInt(_0x5ea323(0x169))/0x8*(-parseInt(_0x5ea323(0x174))/0x9)+parseInt(_0x5ea323(0x16e))/0xa+-parseInt(_0x5ea323(0x170))/0xb*(-parseInt(_0x5ea323(0x16f))/0xc);if(_0x470942===_0x318a45)break;else _0x14a786['push'](_0x14a786['shift']());}catch(_0x3e1d8f){_0x14a786['push'](_0x14a786['shift']());}}}(a274_0x2104,0xd9c1b));export const isWindows=process[a274_0x2b43dd(0x173)]===a274_0x2b43dd(0x16a);function a274_0x2104(){const _0x4fd14d=['win32','10399396DeqBnt','.cmd','2cKbtOn','16170540wDLtMj','5811024mvLlEo','22HYMosV','60PNyQlM','1213678jVFxtv','platform','9KZXgFi','1611717pqlExo','139758HZKAEs','4PtjZHE','1511392LiGyOM'];a274_0x2104=function(){return _0x4fd14d;};return a274_0x2104();}function a274_0x471f(_0xc15166,_0x553a25){_0xc15166=_0xc15166-0x169;const _0x21048a=a274_0x2104();let _0x471f06=_0x21048a[_0xc15166];return _0x471f06;}export function resolveNpmBin(_0x3111a0){const _0x215894=a274_0x2b43dd;return isWindows?_0x3111a0+_0x215894(0x16c):_0x3111a0;}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Rules CDN 工具
3
+ *
4
+ * 从 CDN 拉取 rules 数据,并写入到用户项目
5
+ */
6
+ /**
7
+ * Rules 数据结构
8
+ */
9
+ export interface RulesData {
10
+ version: string;
11
+ buildTime: string;
12
+ content: string;
13
+ lastUpdated?: string;
14
+ }
15
+ /**
16
+ * 从 CDN 拉取 rules 数据
17
+ */
18
+ export declare function fetchRulesFromCDN(): Promise<RulesData>;
19
+ /**
20
+ * 获取 rules 内容(优先 CDN,降级本地)
21
+ */
22
+ export declare function getRulesContent(): Promise<string>;
23
+ /**
24
+ * 读取本地模板文件
25
+ */
26
+ export declare function readLocalTemplate(): string;
27
+ /**
28
+ * 写入 rules 文件到目标路径
29
+ */
30
+ export declare function writeRulesFile(destPath: string): Promise<void>;
31
+ /**
32
+ * 复制 rules 到 Cursor rules 目录
33
+ */
34
+ export declare function copyRulesToCursor(projectRoot: string): Promise<boolean>;
35
+ /**
36
+ * 复制 rules 到 agents.md(用于 Claude Code)
37
+ */
38
+ export declare function copyRulesToAgentsMd(projectRoot: string): Promise<boolean>;
@@ -1 +1 @@
1
- function a277_0x3fe2(_0x24b5c2,_0x696547){_0x24b5c2=_0x24b5c2-0x76;const _0x11771a=a277_0x1177();let _0x3fe28b=_0x11771a[_0x24b5c2];return _0x3fe28b;}(function(_0x2648b9,_0xe63a35){const _0x2dc0d3=a277_0x3fe2,_0x5dac37=_0x2648b9();while(!![]){try{const _0x3a12fe=-parseInt(_0x2dc0d3(0x85))/0x1+-parseInt(_0x2dc0d3(0x80))/0x2*(-parseInt(_0x2dc0d3(0x77))/0x3)+-parseInt(_0x2dc0d3(0x7b))/0x4+-parseInt(_0x2dc0d3(0x87))/0x5*(-parseInt(_0x2dc0d3(0x76))/0x6)+-parseInt(_0x2dc0d3(0x7f))/0x7*(-parseInt(_0x2dc0d3(0x79))/0x8)+parseInt(_0x2dc0d3(0x81))/0x9+-parseInt(_0x2dc0d3(0x86))/0xa;if(_0x3a12fe===_0xe63a35)break;else _0x5dac37['push'](_0x5dac37['shift']());}catch(_0x354473){_0x5dac37['push'](_0x5dac37['shift']());}}}(a277_0x1177,0x8816e));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import{dirname,join,resolve}from'node:path';import{fileURLToPath}from'node:url';import{getTemplateBaseUrl}from'../utils/config.js';import{appendUpdateTime}from'../utils/guides-cdn.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function getRulesCdnUrl(){const _0x2e93cc=a277_0x3fe2,_0x4d8d06=getTemplateBaseUrl();return _0x4d8d06+_0x2e93cc(0x84);}const LOCAL_TEMPLATE_PATH=resolve(__dirname,'../../templates/rules/lovrabet_rules.mdc.tpl');export async function fetchRulesFromCDN(){const _0x3c4e8d=a277_0x3fe2,_0x2327e4=getRulesCdnUrl(),_0x3462e6=await fetch(_0x2327e4,{'headers':{'Accept':'application/json'}});if(!_0x3462e6['ok'])throw new Error(_0x3c4e8d(0x78)+_0x3462e6['status']+'\x20'+_0x3462e6['statusText']);const _0x4f6fd0=await _0x3462e6[_0x3c4e8d(0x89)]();if(!_0x4f6fd0[_0x3c4e8d(0x7a)]||typeof _0x4f6fd0['content']!=='string')throw new Error('CDN\x20返回数据格式错误');return _0x4f6fd0;}export async function getRulesContent(){const _0x1990e8=a277_0x3fe2;try{const _0xa27e76=await fetchRulesFromCDN();return _0xa27e76[_0x1990e8(0x7a)];}catch{return readLocalTemplate();}}export function readLocalTemplate(){const _0x34453f=a277_0x3fe2;if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,_0x34453f(0x82));throw new Error(_0x34453f(0x83)+LOCAL_TEMPLATE_PATH);}export async function writeRulesFile(_0x4e1687){const _0x100f52=a277_0x3fe2,_0x5e77bc=await fetchRulesFromCDN()[_0x100f52(0x7e)](()=>null);let _0x9bfe40;_0x5e77bc?(_0x9bfe40=_0x5e77bc[_0x100f52(0x7a)],_0x5e77bc[_0x100f52(0x88)]&&(_0x9bfe40=appendUpdateTime(_0x9bfe40,_0x5e77bc[_0x100f52(0x88)]))):_0x9bfe40=readLocalTemplate();const _0x2efd99=dirname(_0x4e1687);!existsSync(_0x2efd99)&&mkdirSync(_0x2efd99,{'recursive':!![]}),writeFileSync(_0x4e1687,_0x9bfe40,'utf-8');}export async function copyRulesToCursor(_0x135788){const _0x15bc13=a277_0x3fe2,_0xf366c0=join(_0x135788,_0x15bc13(0x7c)),_0xcd910d=join(_0xf366c0,_0x15bc13(0x7d));if(existsSync(_0xcd910d))return![];return await writeRulesFile(_0xcd910d),!![];}function a277_0x1177(){const _0x37d87d=['1551360lHKoGD','130jiVkTN','lastUpdated','json','12972mcvxTG','6036yltKAo','CDN\x20请求失败:\x20','6866536wcIGLZ','content','3488480oQvHYw','.cursor/rules','lovrabet_rules.mdc','catch','7lHXKba','956IjoJFv','7366257UfBPBi','utf-8','本地模板文件不存在:\x20','/rules/rules.json','1110060zqkrsK'];a277_0x1177=function(){return _0x37d87d;};return a277_0x1177();}export async function copyRulesToAgentsMd(_0xc160c1){const _0x3ff2a6=join(_0xc160c1,'agents.md');if(existsSync(_0x3ff2a6))return![];return await writeRulesFile(_0x3ff2a6),!![];}
1
+ (function(_0x20f7d0,_0x3d873d){const _0x2a85eb=a275_0x147b,_0x2b3b39=_0x20f7d0();while(!![]){try{const _0x21b89d=-parseInt(_0x2a85eb(0x11d))/0x1*(parseInt(_0x2a85eb(0x11f))/0x2)+parseInt(_0x2a85eb(0x116))/0x3+-parseInt(_0x2a85eb(0x12c))/0x4*(-parseInt(_0x2a85eb(0x123))/0x5)+parseInt(_0x2a85eb(0x115))/0x6*(parseInt(_0x2a85eb(0x128))/0x7)+-parseInt(_0x2a85eb(0x11b))/0x8*(parseInt(_0x2a85eb(0x124))/0x9)+parseInt(_0x2a85eb(0x12d))/0xa+-parseInt(_0x2a85eb(0x129))/0xb;if(_0x21b89d===_0x3d873d)break;else _0x2b3b39['push'](_0x2b3b39['shift']());}catch(_0x411ea1){_0x2b3b39['push'](_0x2b3b39['shift']());}}}(a275_0x4890,0x99b03));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import{dirname,join,resolve}from'node:path';import{fileURLToPath}from'node:url';import{getTemplateBaseUrl}from'../utils/config.js';import{appendUpdateTime}from'../utils/guides-cdn.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function a275_0x147b(_0x565cdb,_0x59e70d){_0x565cdb=_0x565cdb-0x115;const _0x4890ef=a275_0x4890();let _0x147bd6=_0x4890ef[_0x565cdb];return _0x147bd6;}function getRulesCdnUrl(){const _0x24a38d=a275_0x147b,_0x39dff7=getTemplateBaseUrl();return _0x39dff7+_0x24a38d(0x117);}const LOCAL_TEMPLATE_PATH=resolve(__dirname,'../../templates/rules/lovrabet_rules.mdc.tpl');function a275_0x4890(){const _0x6e26aa=['1018UpBSzg','lastUpdated','statusText','content','10PpUQLT','99HKqrMV','agents.md','lovrabet_rules.mdc','utf-8','7042QRxpOk','32490370GVLzJW','status','application/json','2455328UOTIAY','11247570hmxAqH','7146VArpzo','3456450zPyBkm','/rules/rules.json','json','CDN\x20返回数据格式错误','catch','796072EKDSJm','.cursor/rules','49sXtFAS','string'];a275_0x4890=function(){return _0x6e26aa;};return a275_0x4890();}export async function fetchRulesFromCDN(){const _0x552b81=a275_0x147b,_0x2c7ce4=getRulesCdnUrl(),_0x2060ee=await fetch(_0x2c7ce4,{'headers':{'Accept':_0x552b81(0x12b)}});if(!_0x2060ee['ok'])throw new Error('CDN\x20请求失败:\x20'+_0x2060ee[_0x552b81(0x12a)]+'\x20'+_0x2060ee[_0x552b81(0x121)]);const _0x4b139f=await _0x2060ee[_0x552b81(0x118)]();if(!_0x4b139f[_0x552b81(0x122)]||typeof _0x4b139f[_0x552b81(0x122)]!==_0x552b81(0x11e))throw new Error(_0x552b81(0x119));return _0x4b139f;}export async function getRulesContent(){const _0x2cf756=a275_0x147b;try{const _0xdcd68=await fetchRulesFromCDN();return _0xdcd68[_0x2cf756(0x122)];}catch{return readLocalTemplate();}}export function readLocalTemplate(){const _0x251328=a275_0x147b;if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,_0x251328(0x127));throw new Error('本地模板文件不存在:\x20'+LOCAL_TEMPLATE_PATH);}export async function writeRulesFile(_0x5825ef){const _0x2248e7=a275_0x147b,_0x71b429=await fetchRulesFromCDN()[_0x2248e7(0x11a)](()=>null);let _0x3cdba3;_0x71b429?(_0x3cdba3=_0x71b429[_0x2248e7(0x122)],_0x71b429[_0x2248e7(0x120)]&&(_0x3cdba3=appendUpdateTime(_0x3cdba3,_0x71b429[_0x2248e7(0x120)]))):_0x3cdba3=readLocalTemplate();const _0x2f7ea3=dirname(_0x5825ef);!existsSync(_0x2f7ea3)&&mkdirSync(_0x2f7ea3,{'recursive':!![]}),writeFileSync(_0x5825ef,_0x3cdba3,_0x2248e7(0x127));}export async function copyRulesToCursor(_0x526895){const _0x45973f=a275_0x147b,_0x11fd8e=join(_0x526895,_0x45973f(0x11c)),_0x256734=join(_0x11fd8e,_0x45973f(0x126));if(existsSync(_0x256734))return![];return await writeRulesFile(_0x256734),!![];}export async function copyRulesToAgentsMd(_0x546496){const _0xd20dd8=a275_0x147b,_0x355b43=join(_0x546496,_0xd20dd8(0x125));if(existsSync(_0x355b43))return![];return await writeRulesFile(_0x355b43),!![];}
@@ -0,0 +1 @@
1
+ export declare function sleep(ms: number): Promise<unknown>;
@@ -1 +1 @@
1
- export function sleep(_0x5ec9ee){return new Promise(_0x421ab1=>setTimeout(_0x421ab1,_0x5ec9ee));}
1
+ export function sleep(_0x104f86){return new Promise(_0x3f6314=>setTimeout(_0x3f6314,_0x104f86));}
@@ -0,0 +1,55 @@
1
+ import type { RegisterModelConfig } from "../types/index.js";
2
+ /**
3
+ * 模板内容替换器 - 将模板中的占位符替换为实际值
4
+ */
5
+ export declare class TemplateReplacer {
6
+ private static pad;
7
+ private static formatLocalTimestamp;
8
+ /**
9
+ * 将页面路径转换为组件名称 (PascalCase)
10
+ * 只使用路径的最后一段
11
+ */
12
+ static toComponentName(pageName: string): string;
13
+ /**
14
+ * 将页面路径转换为显示标题
15
+ * 只使用路径的最后一段
16
+ */
17
+ static toDisplayTitle(pageName: string): string;
18
+ /**
19
+ * 替换文件内容中的占位符
20
+ * 支持的标签:
21
+ * - {CliVersion}: CLI 版本号 (如 1.2.5-beta.2)
22
+ * - {ComponentName}: PascalCase 组件名 (如 UserProfile)
23
+ * - {DisplayTitle}: 显示标题 (如 User Profile)
24
+ * - {PageName}: 原始页面名 (如 user-profile)
25
+ * - {TemplateName}: 模板名称 (如 blank)
26
+ * - {CreatedAt}: 本地时间格式 (如 2024-09-14 15:30:45)
27
+ * - {CreatedDate}: 创建日期 (如 2024-09-14)
28
+ * - {CreatedTime}: 创建时间 (如 15:30:45)
29
+ */
30
+ static replaceContent(content: string, pageName: string, templateName: string): string;
31
+ /**
32
+ * 替换 API 生成模板中的占位符
33
+ * 支持的标签:
34
+ * - {AppCode}: 应用AppCode
35
+ * - {ModelConfigs}: 模型配置数组 JSON 字符串
36
+ * - {ExampleModelName}: 示例模型名称(用于注释中的示例)
37
+ * - {ApiFileName}: API 配置文件名(不含扩展名)
38
+ * - {ConfigName}: 注册配置名称
39
+ * - {ClientConfigParam}: createClient 的参数
40
+ * - {CreatedAt}: ISO 时间戳格式
41
+ */
42
+ static replaceApiContent(content: string, appCode: string, modelConfigs: RegisterModelConfig[], exampleModelName?: string, apiFileName?: string, configName?: string, clientConfigParam?: string, varPrefix?: string): string;
43
+ /**
44
+ * 处理整个模板目录,复制并替换内容
45
+ */
46
+ static processTemplate(templatePath: string, targetPath: string, pageName: string, templateName: string, enableLogging?: boolean): Promise<void>;
47
+ /**
48
+ * 递归处理目录中的文件
49
+ */
50
+ private static processDirectory;
51
+ /**
52
+ * 处理单个文件
53
+ */
54
+ private static processFile;
55
+ }