@lovrabet/rabetbase-cli 2.3.7-beta.4 → 2.3.7

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 (245) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/dry-run.js +1 -1
  48. package/lib/commands/common/flags.js +1 -1
  49. package/lib/commands/common/local-file.js +1 -1
  50. package/lib/commands/common/validate.js +1 -1
  51. package/lib/commands/config/get.js +1 -1
  52. package/lib/commands/config/index.js +1 -1
  53. package/lib/commands/config/list.js +1 -1
  54. package/lib/commands/config/set.js +1 -1
  55. package/lib/commands/config/shared.js +1 -1
  56. package/lib/commands/data/filter.js +1 -1
  57. package/lib/commands/data/getOne.js +1 -1
  58. package/lib/commands/data/index.js +1 -1
  59. package/lib/commands/data/shared.js +1 -1
  60. package/lib/commands/dataset/business-group-update.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-update.js +1 -1
  66. package/lib/commands/dataset/generate.js +1 -1
  67. package/lib/commands/dataset/index.js +1 -1
  68. package/lib/commands/dataset/list.js +1 -1
  69. package/lib/commands/dataset/operations.js +1 -1
  70. package/lib/commands/dataset/relation-audit.js +1 -1
  71. package/lib/commands/dataset/relation-create.js +1 -1
  72. package/lib/commands/dataset/relation-delete.js +1 -1
  73. package/lib/commands/dataset/relation-shared.js +1 -1
  74. package/lib/commands/dataset/relation-update.js +1 -1
  75. package/lib/commands/dataset/relations.js +1 -1
  76. package/lib/commands/dataset/rename.js +1 -1
  77. package/lib/commands/dataset/restore.js +1 -1
  78. package/lib/commands/db/analysis-batching.js +1 -1
  79. package/lib/commands/db/analyze-batch-plan.js +1 -1
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff.js +1 -1
  87. package/lib/commands/db/index.js +1 -1
  88. package/lib/commands/db/list.js +1 -1
  89. package/lib/commands/db/shared.js +1 -1
  90. package/lib/commands/db/tables.js +1 -1
  91. package/lib/commands/db/test.js +1 -1
  92. package/lib/commands/db/update.js +1 -1
  93. package/lib/commands/doctor.js +1 -1
  94. package/lib/commands/file/index.js +1 -1
  95. package/lib/commands/init/index.js +1 -1
  96. package/lib/commands/issue/index.js +1 -1
  97. package/lib/commands/issue/nudge.js +1 -1
  98. package/lib/commands/issue/report.js +1 -1
  99. package/lib/commands/issue/shared.js +1 -1
  100. package/lib/commands/logs/index.js +1 -1
  101. package/lib/commands/menu/index.js +1 -1
  102. package/lib/commands/menu/list.js +1 -1
  103. package/lib/commands/menu/shared/compare-table.js +1 -1
  104. package/lib/commands/menu/shared/index.js +1 -1
  105. package/lib/commands/menu/shared/inquirer.js +1 -1
  106. package/lib/commands/menu/shared/local-pages.js +1 -1
  107. package/lib/commands/menu/shared/logic.js +1 -1
  108. package/lib/commands/menu/shared/service.js +1 -1
  109. package/lib/commands/menu/shared/sync-core.js +1 -1
  110. package/lib/commands/menu/shared/update-core.js +1 -1
  111. package/lib/commands/menu/shared/valid-url.js +1 -1
  112. package/lib/commands/menu/sync.js +1 -1
  113. package/lib/commands/menu/update.js +1 -1
  114. package/lib/commands/notification/config-list.js +1 -1
  115. package/lib/commands/notification/index.js +1 -1
  116. package/lib/commands/page/generate-start.js +1 -1
  117. package/lib/commands/page/generate-status.js +1 -1
  118. package/lib/commands/page/index.js +1 -1
  119. package/lib/commands/page/pull.js +1 -1
  120. package/lib/commands/page/push.js +1 -1
  121. package/lib/commands/page/relation-audit.js +1 -1
  122. package/lib/commands/page/shared.js +1 -1
  123. package/lib/commands/page/standard-page-status.js +1 -1
  124. package/lib/commands/page/sync.js +1 -1
  125. package/lib/commands/permit/index.js +1 -1
  126. package/lib/commands/permit/page-get.js +1 -1
  127. package/lib/commands/permit/page-set.js +1 -1
  128. package/lib/commands/permit/role-apis-set.js +1 -1
  129. package/lib/commands/permit/role-menus-set.js +1 -1
  130. package/lib/commands/permit/role-menus.js +1 -1
  131. package/lib/commands/permit/shared.js +1 -1
  132. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  133. package/lib/commands/project/create/format-elapsed.js +1 -1
  134. package/lib/commands/project/create/main.js +1 -1
  135. package/lib/commands/project/create/non-interactive.js +1 -1
  136. package/lib/commands/project/create/project-template-path.js +1 -1
  137. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  138. package/lib/commands/project/create/use-format-code.js +1 -1
  139. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  140. package/lib/commands/project/index.js +1 -1
  141. package/lib/commands/project/init.js +1 -1
  142. package/lib/commands/project/upgrade.js +1 -1
  143. package/lib/commands/registry.js +1 -1
  144. package/lib/commands/role/create.js +1 -1
  145. package/lib/commands/role/delete.js +1 -1
  146. package/lib/commands/role/detail.js +1 -1
  147. package/lib/commands/role/index.js +1 -1
  148. package/lib/commands/role/list.js +1 -1
  149. package/lib/commands/role/shared.js +1 -1
  150. package/lib/commands/role/update.js +1 -1
  151. package/lib/commands/role/user-add.js +1 -1
  152. package/lib/commands/role/user-remove.js +1 -1
  153. package/lib/commands/role/user-resolve.js +1 -1
  154. package/lib/commands/run/index.js +1 -1
  155. package/lib/commands/schema.js +1 -1
  156. package/lib/commands/sql/create.js +1 -1
  157. package/lib/commands/sql/delete.js +1 -1
  158. package/lib/commands/sql/detail.js +1 -1
  159. package/lib/commands/sql/exec.js +1 -1
  160. package/lib/commands/sql/index.js +1 -1
  161. package/lib/commands/sql/list.js +1 -1
  162. package/lib/commands/sql/pull.js +1 -1
  163. package/lib/commands/sql/push.js +1 -1
  164. package/lib/commands/sql/save.js +1 -1
  165. package/lib/commands/sql/shared.js +1 -1
  166. package/lib/commands/sql/status.js +1 -1
  167. package/lib/commands/sql/validate.js +1 -1
  168. package/lib/commands/workspace/add.js +1 -1
  169. package/lib/commands/workspace/index.js +1 -1
  170. package/lib/commands/workspace/remove.js +1 -1
  171. package/lib/config/schema.js +1 -1
  172. package/lib/constant/cdn.js +1 -1
  173. package/lib/constant/cli.js +1 -1
  174. package/lib/constant/defaults.js +1 -1
  175. package/lib/constant/domain.js +1 -1
  176. package/lib/constant/env.js +1 -1
  177. package/lib/constant/output.js +1 -1
  178. package/lib/constant/paths.js +1 -1
  179. package/lib/constant/risk.js +1 -1
  180. package/lib/context/app-resolver.js +1 -1
  181. package/lib/context/auth-resolver.js +1 -1
  182. package/lib/context/config-loader.js +1 -1
  183. package/lib/context.js +1 -1
  184. package/lib/core/alias-resolver.js +1 -1
  185. package/lib/core/api-client.js +1 -1
  186. package/lib/core/bff/config.js +1 -1
  187. package/lib/core/bff/file-system.js +1 -1
  188. package/lib/core/bff/hash.js +1 -1
  189. package/lib/core/bff/lock.js +1 -1
  190. package/lib/core/bff/utils.js +1 -1
  191. package/lib/core/db-resolver.js +1 -1
  192. package/lib/core/page/file-system.js +1 -1
  193. package/lib/core/page/hash.js +1 -1
  194. package/lib/core/page/lock.js +1 -1
  195. package/lib/core/sql-sync/config.js +1 -1
  196. package/lib/core/sql-sync/file-system.js +1 -1
  197. package/lib/core/sql-sync/hash.js +1 -1
  198. package/lib/core/sql-sync/lock.js +1 -1
  199. package/lib/core/sql-sync/utils.js +1 -1
  200. package/lib/core/sql-validator.js +1 -1
  201. package/lib/errors.js +1 -1
  202. package/lib/framework/build-all-flags.js +1 -1
  203. package/lib/framework/flags.js +1 -1
  204. package/lib/framework/help.js +1 -1
  205. package/lib/framework/index.js +1 -1
  206. package/lib/framework/output.js +1 -1
  207. package/lib/framework/response.js +1 -1
  208. package/lib/framework/runner-alias.js +1 -1
  209. package/lib/framework/runner.js +1 -1
  210. package/lib/framework/schema-export.js +1 -1
  211. package/lib/framework/types.js +1 -1
  212. package/lib/generated/build-info.js +1 -1
  213. package/lib/help.js +1 -1
  214. package/lib/skills/main.js +1 -1
  215. package/lib/skills/npx-skills-add.js +1 -1
  216. package/lib/telemetry/cli-command-trace.js +1 -1
  217. package/lib/telemetry/cli-help-trace.js +1 -1
  218. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  219. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  220. package/lib/telemetry/send-cli-trace-log.js +1 -1
  221. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  222. package/lib/utils/ai_config.js +1 -1
  223. package/lib/utils/apply-jq-filter.js +1 -1
  224. package/lib/utils/cdn-config.js +1 -1
  225. package/lib/utils/check-sdk-version.js +1 -1
  226. package/lib/utils/cli-version-check.js +1 -1
  227. package/lib/utils/cli-version-policy.js +1 -1
  228. package/lib/utils/config.js +1 -1
  229. package/lib/utils/copy-directory.js +1 -1
  230. package/lib/utils/entity-with-id.js +1 -1
  231. package/lib/utils/file-utils.js +1 -1
  232. package/lib/utils/guides-cdn.js +1 -1
  233. package/lib/utils/http-client.js +1 -1
  234. package/lib/utils/is-non-interactive.js +1 -1
  235. package/lib/utils/logger.js +1 -1
  236. package/lib/utils/params.js +1 -1
  237. package/lib/utils/platform.js +1 -1
  238. package/lib/utils/rules-cdn.js +1 -1
  239. package/lib/utils/sleep.js +1 -1
  240. package/lib/utils/template-replacer.js +1 -1
  241. package/lib/utils/update-notice.js +1 -1
  242. package/lib/utils/version.js +1 -1
  243. package/lib/utils/with-active-cookie.js +1 -1
  244. package/lib/utils/write-cli-side-channel.js +1 -1
  245. package/package.json +1 -1
@@ -1 +1 @@
1
- const a131_0x22f41b=a131_0x2338;(function(_0x50d0bf,_0x2a9003){const _0x5e9b88=a131_0x2338,_0x3b04d9=_0x50d0bf();while(!![]){try{const _0x2e2b04=parseInt(_0x5e9b88(0x128))/0x1*(-parseInt(_0x5e9b88(0x14a))/0x2)+-parseInt(_0x5e9b88(0x140))/0x3*(-parseInt(_0x5e9b88(0x129))/0x4)+parseInt(_0x5e9b88(0x141))/0x5+parseInt(_0x5e9b88(0x115))/0x6*(-parseInt(_0x5e9b88(0x126))/0x7)+-parseInt(_0x5e9b88(0xfb))/0x8*(parseInt(_0x5e9b88(0x136))/0x9)+parseInt(_0x5e9b88(0xff))/0xa*(-parseInt(_0x5e9b88(0x12b))/0xb)+parseInt(_0x5e9b88(0x130))/0xc;if(_0x2e2b04===_0x2a9003)break;else _0x3b04d9['push'](_0x3b04d9['shift']());}catch(_0x2752e3){_0x3b04d9['push'](_0x3b04d9['shift']());}}}(a131_0x1927,0xd7341));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a131_0x22f41b(0x147),'type':a131_0x22f41b(0x113),'required':!![],'description':'Menu\x20id\x20(from\x20`menu\x20list`)'};export const ROLE_REF_FLAG={'name':a131_0x22f41b(0xf6),'type':'string','required':!![],'description':a131_0x22f41b(0x106)};export const GRANT_FLAG={'name':a131_0x22f41b(0x110),'type':a131_0x22f41b(0x125),'required':![],'description':a131_0x22f41b(0x13a)};export const REVOKE_FLAG={'name':a131_0x22f41b(0x124),'type':a131_0x22f41b(0x125),'required':![],'description':a131_0x22f41b(0x14b)};function a131_0x1927(){const _0x3eb3ff=['bool','string','Special\x20role\x20',';\x20SELF\x20=\x20only\x20own\x20rows','54693432YGJdgb','delete-roles','trim','datasetCode','SELF','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','134433ZjkOEq','split','validation','menu\x20visibility','Grant\x20access\x20to\x20the\x20listed\x20resources','data\x20export','resourceName','test','get','set','3mwBXnh','1608975uyWrIS','map','rolePermit','SELF\x20is\x20not\x20allowed\x20for\x20','export-roles','update-roles','menu-id','data\x20update','create-roles','157222dyjvzK','Revoke\x20access\x20to\x20the\x20listed\x20resources','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','role','action','data\x20create','flagMissing','appCode','920zXauWA','find','menuId','key','208060iqNgNf','\x20not\x20found.','Pass\x20--role\x20<id|name>.','length','some','dataCreate','row-roles','Role\x20id\x20or\x20role\x20name','filter','Missing\x20action.','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.','apiList','label','Disambiguate\x20with\x20an\x20id.','Roles\x20for\x20','Run\x20`role\x20list`.','grant','allowSelf','entries','number','pageNodeList','6qTIcGH','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','access','flag','roleName','\x22\x20not\x20found.','toUpperCase','Role\x20\x22','dataUpdate','allowedActions','\x20(comma-separated\x20SELF/ALL/id/name)','datasets','roleType','join','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.','revoke','boolean','9124787tEoDll','menuPermit','13ILKhnG','4591396MiYRAe','resourceCode','583FYcqxz'];a131_0x1927=function(){return _0x3eb3ff;};return a131_0x1927();}export const MENUS_FLAG={'name':'menus','type':a131_0x22f41b(0x12d),'required':!![],'description':a131_0x22f41b(0x135)};export const DATASETS_FLAG={'name':a131_0x22f41b(0x120),'type':a131_0x22f41b(0x12d),'required':!![],'description':a131_0x22f41b(0x116)};export const PAGE_SLOT_SPECS=[{'flag':'menu-roles','key':a131_0x22f41b(0x127),'allowSelf':![],'label':a131_0x22f41b(0x139)},{'flag':a131_0x22f41b(0x149),'key':a131_0x22f41b(0x104),'allowSelf':![],'label':a131_0x22f41b(0xf8)},{'flag':a131_0x22f41b(0x146),'key':a131_0x22f41b(0x11d),'allowSelf':![],'label':a131_0x22f41b(0x148)},{'flag':a131_0x22f41b(0x131),'key':'dataDelete','allowSelf':![],'label':'data\x20delete'},{'flag':'detail-roles','key':'dataDetail','allowSelf':![],'label':'data\x20detail'},{'flag':a131_0x22f41b(0x145),'key':'dataExport','allowSelf':![],'label':a131_0x22f41b(0x13b)},{'flag':a131_0x22f41b(0x105),'key':'dataPermit','allowSelf':!![],'label':'row\x20visibility'}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a131_0x22f41b(0x142)](_0x59811f=>({'name':_0x59811f[a131_0x22f41b(0x118)],'type':a131_0x22f41b(0x12d),'required':![],'description':a131_0x22f41b(0x10e)+_0x59811f[a131_0x22f41b(0x10c)]+a131_0x22f41b(0x11f)+(_0x59811f[a131_0x22f41b(0x111)]?a131_0x22f41b(0x12f):'')}));export function splitList(_0x23bd1e){const _0x3de1ec=a131_0x22f41b;return _0x23bd1e[_0x3de1ec(0x137)](',')['map'](_0x37aaba=>_0x37aaba[_0x3de1ec(0x132)]())[_0x3de1ec(0x107)](Boolean);}export function projectRoleRef(_0x18c7dd){const _0x4349e6=a131_0x22f41b;return{'id':_0x18c7dd['id'],'roleName':_0x18c7dd[_0x4349e6(0x119)],'roleType':_0x18c7dd[_0x4349e6(0x121)]};}export async function resolvePermitRoles(_0x49f608,_0x5d61cf,_0x315e2d){const _0x3c7454=a131_0x22f41b,_0x4654f1=await listPermitRoles(_0x49f608,{'needSelf':!![],'needPublic':!![]}),_0xf3660d=[];for(const _0x168082 of _0x5d61cf){const _0x445564=resolveOnePermitRole(_0x4654f1,_0x168082);if(!_0x315e2d[_0x3c7454(0x111)]&&_0x445564[_0x3c7454(0x121)]===_0x3c7454(0x134))throw CliErrors[_0x3c7454(0x138)](_0x3c7454(0x144)+_0x315e2d[_0x3c7454(0x10c)]+'.',_0x3c7454(0x109));if(!_0xf3660d[_0x3c7454(0x103)](_0x296e96=>_0x296e96['id']===_0x445564['id']))_0xf3660d['push'](_0x445564);}return _0xf3660d;}function resolveOnePermitRole(_0x352b64,_0x5922ec){const _0x557903=a131_0x22f41b,_0x3d2445=_0x5922ec[_0x557903(0x132)](),_0x536f99=_0x3d2445[_0x557903(0x11b)]();if(_0x536f99===_0x557903(0x134)||_0x536f99==='ALL'){const _0x405c0a=_0x352b64[_0x557903(0xfc)](_0x223eef=>_0x223eef[_0x557903(0x121)]===_0x536f99);if(!_0x405c0a)throw CliErrors[_0x557903(0x138)](_0x557903(0x12e)+_0x536f99+'\x20is\x20not\x20available\x20for\x20this\x20app.');return _0x405c0a;}if(/^-?\d+$/[_0x557903(0x13d)](_0x3d2445)){const _0xcd1c6e=Number(_0x3d2445),_0x30b39c=_0x352b64['find'](_0x352f35=>_0x352f35['id']===_0xcd1c6e);if(!_0x30b39c)throw CliErrors[_0x557903(0x138)]('Role\x20id\x20'+_0xcd1c6e+_0x557903(0x100),_0x557903(0x10f));return _0x30b39c;}const _0x467e41=_0x352b64['filter'](_0x53aef2=>_0x53aef2['roleName']===_0x3d2445);if(_0x467e41[_0x557903(0x102)]===0x0)throw CliErrors[_0x557903(0x138)](_0x557903(0x11c)+_0x3d2445+_0x557903(0x11a),_0x557903(0x10a));if(_0x467e41[_0x557903(0x102)]>0x1)throw CliErrors['validation']('Role\x20\x22'+_0x3d2445+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x467e41[_0x557903(0x142)](_0x3a8093=>_0x3a8093['id'])[_0x557903(0x122)](',\x20')+').',_0x557903(0x10d));return _0x467e41[0x0];}export function projectPageSlot(_0x161df0){const _0x31f556=a131_0x22f41b;if(!_0x161df0)return null;return{'resourceCode':_0x161df0[_0x31f556(0x12a)],'roles':(_0x161df0[_0x31f556(0x143)]??[])[_0x31f556(0x142)](projectRoleRef)};}export function projectPagePermit(_0x24bef7){const _0x160cf2=a131_0x22f41b,_0x4f5ec9={'menuId':_0x24bef7[_0x160cf2(0xfd)],'appCode':_0x24bef7[_0x160cf2(0xfa)],'menuPermit':projectPageSlot(_0x24bef7[_0x160cf2(0x127)])};for(const _0x2473f8 of PAGE_SLOT_SPECS){if(_0x2473f8[_0x160cf2(0xfe)]===_0x160cf2(0x127))continue;_0x4f5ec9[_0x2473f8['key']]=projectPageSlot(_0x24bef7[_0x2473f8['key']]);}return _0x4f5ec9;}export function flattenMenuResources(_0xba1f7b){const _0x4cbd48=new Map(),_0x313d65=_0x196518=>{const _0x451369=a131_0x2338;for(const _0x4e03bc of _0x196518??[]){_0x4cbd48['set'](_0x4e03bc[_0x451369(0x12a)],{'resourceCode':_0x4e03bc[_0x451369(0x12a)],'resourceName':_0x4e03bc[_0x451369(0x13c)],'action':_0x4e03bc[_0x451369(0x11e)]?.[0x0]??'0'});if(_0x4e03bc[_0x451369(0x114)])_0x313d65(_0x4e03bc[_0x451369(0x114)]);}};return _0x313d65(_0xba1f7b),_0x4cbd48;}export function flattenApiResources(_0x2c07a3){const _0x2829a4=a131_0x22f41b,_0x547e1b=new Map(),_0x56b5bf=new Map();for(const _0xb98da6 of _0x2c07a3){const _0x34504b=_0xb98da6[_0x2829a4(0x10b)]??{};for(const [_0x4c95f3,_0x53752b]of Object[_0x2829a4(0x112)](_0x34504b)){_0x547e1b['set'](_0x4c95f3,{'resourceCode':_0x4c95f3,'resourceName':_0xb98da6[_0x2829a4(0x13c)],'datasetCode':_0xb98da6[_0x2829a4(0x133)],'action':_0x53752b?.[0x0]??'0'});const _0x1d6e8e=_0x56b5bf[_0x2829a4(0x13e)](_0xb98da6[_0x2829a4(0x133)])??[];_0x1d6e8e['push'](_0x4c95f3),_0x56b5bf[_0x2829a4(0x13f)](_0xb98da6[_0x2829a4(0x133)],_0x1d6e8e);}}return{'byCode':_0x547e1b,'byDataset':_0x56b5bf};}export function buildPermits(_0x5e2b21,_0x211d54){const _0x23e4ab=a131_0x22f41b,_0x1c0099={};for(const [_0x20914d,_0x505128]of _0x5e2b21){const _0x5e6b61=_0x211d54[_0x23e4ab(0x13e)](_0x20914d)??_0x505128[_0x23e4ab(0xf7)];_0x1c0099[_0x20914d]=[_0x5e6b61];}return _0x1c0099;}export function readRoleRef(_0x1c4516){const _0x52c08f=a131_0x22f41b,_0x4074cf=_0x1c4516['str']('role')[_0x52c08f(0x132)]();if(!_0x4074cf)throw CliErrors[_0x52c08f(0xf9)](_0x52c08f(0xf6),_0x52c08f(0x101));return _0x4074cf;}function a131_0x2338(_0x1c35bc,_0x2e0b9d){_0x1c35bc=_0x1c35bc-0xf5;const _0x192743=a131_0x1927();let _0x2338fa=_0x192743[_0x1c35bc];return _0x2338fa;}export function readGrantRevoke(_0x4a9a7e){const _0x46a065=a131_0x22f41b,_0x5047e1=_0x4a9a7e[_0x46a065(0x12c)](_0x46a065(0x110)),_0x1ba341=_0x4a9a7e['bool']('revoke');if(_0x5047e1&&_0x1ba341)throw CliErrors['validation'](_0x46a065(0xf5));if(!_0x5047e1&&!_0x1ba341)throw CliErrors['validation'](_0x46a065(0x108),_0x46a065(0x123));return _0x5047e1?_0x46a065(0x117):'0';}
1
+ const a131_0x1e1df1=a131_0x3fc9;(function(_0x3d103c,_0x5aa0fa){const _0x2590c2=a131_0x3fc9,_0xacebd4=_0x3d103c();while(!![]){try{const _0x32e8ce=-parseInt(_0x2590c2(0xe0))/0x1*(-parseInt(_0x2590c2(0x116))/0x2)+-parseInt(_0x2590c2(0x11c))/0x3*(-parseInt(_0x2590c2(0x110))/0x4)+-parseInt(_0x2590c2(0x111))/0x5*(parseInt(_0x2590c2(0xed))/0x6)+parseInt(_0x2590c2(0xd7))/0x7+-parseInt(_0x2590c2(0x129))/0x8*(-parseInt(_0x2590c2(0xe3))/0x9)+-parseInt(_0x2590c2(0xfe))/0xa+-parseInt(_0x2590c2(0xda))/0xb*(-parseInt(_0x2590c2(0xfa))/0xc);if(_0x32e8ce===_0x5aa0fa)break;else _0xacebd4['push'](_0xacebd4['shift']());}catch(_0x15b67d){_0xacebd4['push'](_0xacebd4['shift']());}}}(a131_0x1003,0x3f3ae));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':'menu-id','type':'number','required':!![],'description':a131_0x1e1df1(0x124)};export const ROLE_REF_FLAG={'name':a131_0x1e1df1(0x119),'type':a131_0x1e1df1(0x10f),'required':!![],'description':a131_0x1e1df1(0x108)};export const GRANT_FLAG={'name':a131_0x1e1df1(0xe1),'type':'boolean','required':![],'description':'Grant\x20access\x20to\x20the\x20listed\x20resources'};export const REVOKE_FLAG={'name':a131_0x1e1df1(0x114),'type':a131_0x1e1df1(0x104),'required':![],'description':a131_0x1e1df1(0x11b)};export const MENUS_FLAG={'name':a131_0x1e1df1(0x11e),'type':a131_0x1e1df1(0x10f),'required':!![],'description':a131_0x1e1df1(0x11f)};export const DATASETS_FLAG={'name':a131_0x1e1df1(0xe9),'type':a131_0x1e1df1(0x10f),'required':!![],'description':'Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for'};export const PAGE_SLOT_SPECS=[{'flag':a131_0x1e1df1(0xd9),'key':a131_0x1e1df1(0xf4),'allowSelf':![],'label':'menu\x20visibility'},{'flag':a131_0x1e1df1(0x12c),'key':a131_0x1e1df1(0x107),'allowSelf':![],'label':a131_0x1e1df1(0xef)},{'flag':a131_0x1e1df1(0xf5),'key':a131_0x1e1df1(0xf6),'allowSelf':![],'label':'data\x20update'},{'flag':a131_0x1e1df1(0xdf),'key':'dataDelete','allowSelf':![],'label':a131_0x1e1df1(0xdd)},{'flag':a131_0x1e1df1(0xe5),'key':a131_0x1e1df1(0xf3),'allowSelf':![],'label':a131_0x1e1df1(0xe6)},{'flag':a131_0x1e1df1(0xdb),'key':a131_0x1e1df1(0xf8),'allowSelf':![],'label':'data\x20export'},{'flag':a131_0x1e1df1(0xfc),'key':a131_0x1e1df1(0xff),'allowSelf':!![],'label':a131_0x1e1df1(0x12a)}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a131_0x1e1df1(0xeb)](_0x2c0a59=>({'name':_0x2c0a59[a131_0x1e1df1(0x123)],'type':'string','required':![],'description':a131_0x1e1df1(0xd8)+_0x2c0a59[a131_0x1e1df1(0x126)]+a131_0x1e1df1(0xf1)+(_0x2c0a59['allowSelf']?';\x20SELF\x20=\x20only\x20own\x20rows':'')}));export function splitList(_0x25071c){const _0x4468c8=a131_0x1e1df1;return _0x25071c[_0x4468c8(0x125)](',')[_0x4468c8(0xeb)](_0x260902=>_0x260902[_0x4468c8(0xea)]())[_0x4468c8(0x115)](Boolean);}export function projectRoleRef(_0x39d02d){const _0x20e16b=a131_0x1e1df1;return{'id':_0x39d02d['id'],'roleName':_0x39d02d[_0x20e16b(0x12d)],'roleType':_0x39d02d[_0x20e16b(0x122)]};}export async function resolvePermitRoles(_0x4178e7,_0x477126,_0x2179e7){const _0x60d618=a131_0x1e1df1,_0x44edbb=await listPermitRoles(_0x4178e7,{'needSelf':!![],'needPublic':!![]}),_0x19c33d=[];for(const _0x189776 of _0x477126){const _0x32b221=resolveOnePermitRole(_0x44edbb,_0x189776);if(!_0x2179e7['allowSelf']&&_0x32b221[_0x60d618(0x122)]===_0x60d618(0xf0))throw CliErrors[_0x60d618(0x117)](_0x60d618(0x118)+_0x2179e7['label']+'.',_0x60d618(0x10e));if(!_0x19c33d[_0x60d618(0x11d)](_0x29eef2=>_0x29eef2['id']===_0x32b221['id']))_0x19c33d[_0x60d618(0x121)](_0x32b221);}return _0x19c33d;}function a131_0x1003(){const _0xcc6061=['Revoke\x20access\x20to\x20the\x20listed\x20resources','1017AIaZAF','some','menus','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.','push','roleType','flag','Menu\x20id\x20(from\x20`menu\x20list`)','split','label','get','Missing\x20action.','328400XouAMv','row\x20visibility','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','create-roles','roleName','678685YwIZHI','Roles\x20for\x20','menu-roles','11ZHjbhc','export-roles','\x22\x20not\x20found.','data\x20delete','Pass\x20--role\x20<id|name>.','delete-roles','1IiqTyT','grant','\x22\x20is\x20ambiguous\x20(ids:\x20','27EwxNja','allowedActions','detail-roles','data\x20detail','Role\x20\x22','Role\x20id\x20','datasets','trim','map','entries','40008GnyfuJ','\x20is\x20not\x20available\x20for\x20this\x20app.','data\x20create','SELF','\x20(comma-separated\x20SELF/ALL/id/name)','length','dataDetail','menuPermit','update-roles','dataUpdate','menuId','dataExport','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.','343356RieGAI','Run\x20`role\x20list`.','row-roles','datasetCode','3382440DsfuLk','dataPermit','find','bool','key','flagMissing','boolean','resourceName','apiList','dataCreate','Role\x20id\x20or\x20role\x20name','Disambiguate\x20with\x20an\x20id.','resourceCode','join','toUpperCase','str','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','string','5020xwBFcF','110lSoVBY','test','access','revoke','filter','139534kHPmyg','validation','SELF\x20is\x20not\x20allowed\x20for\x20','role','Special\x20role\x20'];a131_0x1003=function(){return _0xcc6061;};return a131_0x1003();}function resolveOnePermitRole(_0x611a8e,_0xb90aeb){const _0x23a036=a131_0x1e1df1,_0x21667d=_0xb90aeb['trim'](),_0x295e09=_0x21667d[_0x23a036(0x10c)]();if(_0x295e09==='SELF'||_0x295e09==='ALL'){const _0x4d017b=_0x611a8e[_0x23a036(0x100)](_0xc8047f=>_0xc8047f[_0x23a036(0x122)]===_0x295e09);if(!_0x4d017b)throw CliErrors['validation'](_0x23a036(0x11a)+_0x295e09+_0x23a036(0xee));return _0x4d017b;}if(/^-?\d+$/[_0x23a036(0x112)](_0x21667d)){const _0x502640=Number(_0x21667d),_0xaf271b=_0x611a8e[_0x23a036(0x100)](_0xe7e0ad=>_0xe7e0ad['id']===_0x502640);if(!_0xaf271b)throw CliErrors[_0x23a036(0x117)](_0x23a036(0xe8)+_0x502640+'\x20not\x20found.',_0x23a036(0xfb));return _0xaf271b;}const _0x262488=_0x611a8e[_0x23a036(0x115)](_0x23db9a=>_0x23db9a[_0x23a036(0x12d)]===_0x21667d);if(_0x262488['length']===0x0)throw CliErrors[_0x23a036(0x117)](_0x23a036(0xe7)+_0x21667d+_0x23a036(0xdc),_0x23a036(0x120));if(_0x262488[_0x23a036(0xf2)]>0x1)throw CliErrors['validation'](_0x23a036(0xe7)+_0x21667d+_0x23a036(0xe2)+_0x262488['map'](_0xaace2=>_0xaace2['id'])[_0x23a036(0x10b)](',\x20')+').',_0x23a036(0x109));return _0x262488[0x0];}function a131_0x3fc9(_0x111ea4,_0x2de28e){_0x111ea4=_0x111ea4-0xd7;const _0x1003f1=a131_0x1003();let _0x3fc9bb=_0x1003f1[_0x111ea4];return _0x3fc9bb;}export function projectPageSlot(_0x5d464b){const _0x3f3fe7=a131_0x1e1df1;if(!_0x5d464b)return null;return{'resourceCode':_0x5d464b[_0x3f3fe7(0x10a)],'roles':(_0x5d464b['rolePermit']??[])[_0x3f3fe7(0xeb)](projectRoleRef)};}export function projectPagePermit(_0x5038fb){const _0x396403=a131_0x1e1df1,_0x41f21b={'menuId':_0x5038fb[_0x396403(0xf7)],'appCode':_0x5038fb['appCode'],'menuPermit':projectPageSlot(_0x5038fb[_0x396403(0xf4)])};for(const _0x26b712 of PAGE_SLOT_SPECS){if(_0x26b712['key']===_0x396403(0xf4))continue;_0x41f21b[_0x26b712[_0x396403(0x102)]]=projectPageSlot(_0x5038fb[_0x26b712[_0x396403(0x102)]]);}return _0x41f21b;}export function flattenMenuResources(_0x35978d){const _0x54c110=new Map(),_0x394677=_0x5959fd=>{const _0x44e1d0=a131_0x3fc9;for(const _0x54e711 of _0x5959fd??[]){_0x54c110['set'](_0x54e711['resourceCode'],{'resourceCode':_0x54e711[_0x44e1d0(0x10a)],'resourceName':_0x54e711[_0x44e1d0(0x105)],'action':_0x54e711[_0x44e1d0(0xe4)]?.[0x0]??'0'});if(_0x54e711['pageNodeList'])_0x394677(_0x54e711['pageNodeList']);}};return _0x394677(_0x35978d),_0x54c110;}export function flattenApiResources(_0x3e1d60){const _0x554d11=a131_0x1e1df1,_0x50d4c7=new Map(),_0x235aaf=new Map();for(const _0x10644e of _0x3e1d60){const _0x55ce7f=_0x10644e[_0x554d11(0x106)]??{};for(const [_0x3b4bd6,_0xf9b85a]of Object[_0x554d11(0xec)](_0x55ce7f)){_0x50d4c7['set'](_0x3b4bd6,{'resourceCode':_0x3b4bd6,'resourceName':_0x10644e[_0x554d11(0x105)],'datasetCode':_0x10644e[_0x554d11(0xfd)],'action':_0xf9b85a?.[0x0]??'0'});const _0x36eafa=_0x235aaf['get'](_0x10644e[_0x554d11(0xfd)])??[];_0x36eafa['push'](_0x3b4bd6),_0x235aaf['set'](_0x10644e[_0x554d11(0xfd)],_0x36eafa);}}return{'byCode':_0x50d4c7,'byDataset':_0x235aaf};}export function buildPermits(_0x29ce92,_0x43568b){const _0x16d88d=a131_0x1e1df1,_0x58dc9f={};for(const [_0x243a86,_0x30ea9c]of _0x29ce92){const _0x4a720e=_0x43568b[_0x16d88d(0x127)](_0x243a86)??_0x30ea9c['action'];_0x58dc9f[_0x243a86]=[_0x4a720e];}return _0x58dc9f;}export function readRoleRef(_0x12388f){const _0x3ac794=a131_0x1e1df1,_0x2e245d=_0x12388f[_0x3ac794(0x10d)](_0x3ac794(0x119))[_0x3ac794(0xea)]();if(!_0x2e245d)throw CliErrors[_0x3ac794(0x103)]('role',_0x3ac794(0xde));return _0x2e245d;}export function readGrantRevoke(_0x4f240d){const _0x3a0897=a131_0x1e1df1,_0x4dd0e1=_0x4f240d['bool'](_0x3a0897(0xe1)),_0x41cc2a=_0x4f240d[_0x3a0897(0x101)](_0x3a0897(0x114));if(_0x4dd0e1&&_0x41cc2a)throw CliErrors[_0x3a0897(0x117)](_0x3a0897(0x12b));if(!_0x4dd0e1&&!_0x41cc2a)throw CliErrors[_0x3a0897(0x117)](_0x3a0897(0x128),_0x3a0897(0xf9));return _0x4dd0e1?_0x3a0897(0x113):'0';}
@@ -1 +1 @@
1
- (function(_0x2ac728,_0x3784f6){const _0x54d6e3=a132_0x3154,_0x195e2a=_0x2ac728();while(!![]){try{const _0x180495=-parseInt(_0x54d6e3(0x99))/0x1+parseInt(_0x54d6e3(0x96))/0x2+parseInt(_0x54d6e3(0xaa))/0x3+parseInt(_0x54d6e3(0xa6))/0x4+parseInt(_0x54d6e3(0xae))/0x5+-parseInt(_0x54d6e3(0xa1))/0x6+parseInt(_0x54d6e3(0x9d))/0x7*(-parseInt(_0x54d6e3(0xa5))/0x8);if(_0x180495===_0x3784f6)break;else _0x195e2a['push'](_0x195e2a['shift']());}catch(_0x14e907){_0x195e2a['push'](_0x195e2a['shift']());}}}(a132_0x8695,0x6c711));import{existsSync}from'node:fs';function a132_0x8695(){const _0x30724e=['my-app','1364872rQTicA','Project\x20name:','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','56389PtRArv','log','length','cyan','21bggMfD','resolve','production','Not\x20set','1164726ZVgEik','test','Project\x20name\x20cannot\x20exceed\x2050\x20characters','Logged\x20in','4510472oxaIgE','2172160merybZ','env','\x22\x20already\x20exists','trim','993441ynwxgP','green','string','Skipped','4147455bvJNgn','Directory\x20\x22','Login\x20failed','√\x20Login\x20status:\x20'];a132_0x8695=function(){return _0x30724e;};return a132_0x8695();}import a132_0x1ee66b from'node:path';import a132_0x5c4f1f from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';function a132_0x3154(_0x2d2820,_0x3fd01f){_0x2d2820=_0x2d2820-0x94;const _0x869554=a132_0x8695();let _0x315465=_0x869554[_0x2d2820];return _0x315465;}import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x167134,_0x3c44f2,_0x5e0dd3){const _0xa94226=a132_0x3154,_0x25e189=_0xa94226(0x95),_0x28cdee=readConfig(),_0x4f7128=typeof _0x28cdee[_0xa94226(0xa7)]===_0xa94226(0xac)?_0x28cdee['env']:undefined,_0x320bfd=await input({'message':_0xa94226(0x97),'default':_0x25e189,'validate':_0x36eb69=>{const _0x39277f=_0xa94226,_0x54f948=_0x36eb69[_0x39277f(0xa9)]()||_0x25e189;if(_0x54f948[_0x39277f(0x9b)]>0x32)return _0x39277f(0xa3);const _0x1d7364=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x54f948&&!_0x1d7364[_0x39277f(0xa2)](_0x54f948))return'Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_';const _0x367992=a132_0x1ee66b[_0x39277f(0x9e)](process['cwd'](),_0x54f948);if(existsSync(_0x367992))return _0x39277f(0xaf)+_0x54f948+_0x39277f(0xa8);return!![];}});console[_0xa94226(0x9a)](a132_0x5c4f1f[_0xa94226(0xab)]('√\x20Project\x20Name:\x20'+a132_0x5c4f1f[_0xa94226(0x9c)](_0x320bfd)));const _0x4a9c0f=await selectSingleAppcode(_0x5e0dd3);console[_0xa94226(0x9a)](a132_0x5c4f1f[_0xa94226(0xab)]('√\x20App\x20Code:\x20'+a132_0x5c4f1f[_0xa94226(0x9c)](_0x4a9c0f||_0xa94226(0xa0))));if(_0x4a9c0f){const _0x4bdc44=await getIsSessionValid();if(!_0x4bdc44){const _0x1a8c30=await confirm({'message':_0xa94226(0x98),'default':!![]});if(_0x1a8c30){const _0x3d3c59=await authServer({'silent':!![]});console[_0xa94226(0x9a)](a132_0x5c4f1f[_0xa94226(0xab)](_0xa94226(0x94)+a132_0x5c4f1f['cyan'](_0x3d3c59?_0xa94226(0xa4):_0xa94226(0xb0))));}else console[_0xa94226(0x9a)](a132_0x5c4f1f[_0xa94226(0xab)](_0xa94226(0x94)+a132_0x5c4f1f[_0xa94226(0x9c)](_0xa94226(0xad))));}await _0x167134({'projectName':_0x320bfd,'appCode':_0x4a9c0f,'env':_0x3c44f2||_0x4f7128||'production'});}else await _0x167134({'projectName':_0x320bfd,'env':_0x3c44f2||_0x4f7128||_0xa94226(0x9f)});}
1
+ (function(_0xf8dc61,_0x30ffc8){const _0x24ba8b=a132_0x3133,_0x44dd8a=_0xf8dc61();while(!![]){try{const _0x5d84a8=-parseInt(_0x24ba8b(0xf8))/0x1+parseInt(_0x24ba8b(0x10a))/0x2*(-parseInt(_0x24ba8b(0x104))/0x3)+-parseInt(_0x24ba8b(0x10e))/0x4*(-parseInt(_0x24ba8b(0xfe))/0x5)+parseInt(_0x24ba8b(0x101))/0x6+-parseInt(_0x24ba8b(0x10f))/0x7*(-parseInt(_0x24ba8b(0xfd))/0x8)+-parseInt(_0x24ba8b(0x10b))/0x9*(-parseInt(_0x24ba8b(0xfc))/0xa)+-parseInt(_0x24ba8b(0x112))/0xb;if(_0x5d84a8===_0x30ffc8)break;else _0x44dd8a['push'](_0x44dd8a['shift']());}catch(_0x282828){_0x44dd8a['push'](_0x44dd8a['shift']());}}}(a132_0x2589,0x7fba3));function a132_0x2589(){const _0x120dd7=['No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','Directory\x20\x22','425548uQpObI','10377WRrCmi','√\x20Project\x20Name:\x20','my-app','456656eYMpxF','5945611IDcPYL','length','string','2654993jtClBq','cwd','log','√\x20App\x20Code:\x20','449313HfyUIm','env','Login\x20failed','Skipped','1760mcpyfM','8pZelwV','15VAwGqT','green','Logged\x20in','190968KEfYVj','cyan','production','3bwYWNW','\x22\x20already\x20exists','resolve','√\x20Login\x20status:\x20'];a132_0x2589=function(){return _0x120dd7;};return a132_0x2589();}import{existsSync}from'node:fs';import a132_0x3deb68 from'node:path';import a132_0x4692b5 from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';function a132_0x3133(_0x40e532,_0x943046){_0x40e532=_0x40e532-0xf8;const _0x25893e=a132_0x2589();let _0x313312=_0x25893e[_0x40e532];return _0x313312;}export async function guidedCreateProject(_0x42e587,_0x36e1e6,_0x312dcb){const _0x44cad3=a132_0x3133,_0x4b9a27=_0x44cad3(0x10d),_0x4b5369=readConfig(),_0x395075=typeof _0x4b5369[_0x44cad3(0xf9)]===_0x44cad3(0x111)?_0x4b5369[_0x44cad3(0xf9)]:undefined,_0x476bc1=await input({'message':'Project\x20name:','default':_0x4b9a27,'validate':_0x2ba5b5=>{const _0x4a418e=_0x44cad3,_0x3e4f78=_0x2ba5b5['trim']()||_0x4b9a27;if(_0x3e4f78[_0x4a418e(0x110)]>0x32)return'Project\x20name\x20cannot\x20exceed\x2050\x20characters';const _0x4fa8e2=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x3e4f78&&!_0x4fa8e2['test'](_0x3e4f78))return'Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_';const _0x281197=a132_0x3deb68[_0x4a418e(0x106)](process[_0x4a418e(0x113)](),_0x3e4f78);if(existsSync(_0x281197))return _0x4a418e(0x109)+_0x3e4f78+_0x4a418e(0x105);return!![];}});console[_0x44cad3(0x114)](a132_0x4692b5['green'](_0x44cad3(0x10c)+a132_0x4692b5[_0x44cad3(0x102)](_0x476bc1)));const _0xddca7e=await selectSingleAppcode(_0x312dcb);console['log'](a132_0x4692b5[_0x44cad3(0xff)](_0x44cad3(0x115)+a132_0x4692b5[_0x44cad3(0x102)](_0xddca7e||'Not\x20set')));if(_0xddca7e){const _0x3cc3ba=await getIsSessionValid();if(!_0x3cc3ba){const _0x23a634=await confirm({'message':_0x44cad3(0x108),'default':!![]});if(_0x23a634){const _0x39ac53=await authServer({'silent':!![]});console[_0x44cad3(0x114)](a132_0x4692b5[_0x44cad3(0xff)](_0x44cad3(0x107)+a132_0x4692b5[_0x44cad3(0x102)](_0x39ac53?_0x44cad3(0x100):_0x44cad3(0xfa))));}else console[_0x44cad3(0x114)](a132_0x4692b5[_0x44cad3(0xff)]('√\x20Login\x20status:\x20'+a132_0x4692b5[_0x44cad3(0x102)](_0x44cad3(0xfb))));}await _0x42e587({'projectName':_0x476bc1,'appCode':_0xddca7e,'env':_0x36e1e6||_0x395075||_0x44cad3(0x103)});}else await _0x42e587({'projectName':_0x476bc1,'env':_0x36e1e6||_0x395075||'production'});}
@@ -1 +1 @@
1
- (function(_0x49330e,_0x2baeb6){const _0x470c50=a133_0x86f3,_0x3145be=_0x49330e();while(!![]){try{const _0x31e24d=parseInt(_0x470c50(0x77))/0x1+-parseInt(_0x470c50(0x72))/0x2+parseInt(_0x470c50(0x71))/0x3*(parseInt(_0x470c50(0x75))/0x4)+parseInt(_0x470c50(0x7a))/0x5+parseInt(_0x470c50(0x78))/0x6+parseInt(_0x470c50(0x79))/0x7+parseInt(_0x470c50(0x7b))/0x8*(-parseInt(_0x470c50(0x74))/0x9);if(_0x31e24d===_0x2baeb6)break;else _0x3145be['push'](_0x3145be['shift']());}catch(_0x98a957){_0x3145be['push'](_0x3145be['shift']());}}}(a133_0x5dec,0x668ed));function a133_0x86f3(_0x4c553a,_0x156e0d){_0x4c553a=_0x4c553a-0x71;const _0x5dec8b=a133_0x5dec();let _0x86f30d=_0x5dec8b[_0x4c553a];return _0x86f30d;}export function formatElapsed(_0x4f2024){const _0x5e50fc=a133_0x86f3,_0x5ddc26=Date[_0x5e50fc(0x73)]()-_0x4f2024;if(_0x5ddc26<0x3e8)return _0x5ddc26+'ms';const _0x4a430d=(_0x5ddc26/0x3e8)['toFixed'](0x2),_0x41934e=_0x4a430d[_0x5e50fc(0x76)](/\.?0+$/u,'');return _0x41934e+'s';}function a133_0x5dec(){const _0x3321f1=['now','214893MUqblZ','4panYrc','replace','438587SMMJsS','969750fruwOf','732732kPysMi','1755330vFOBMa','152EGDone','691554mdjBxg','825464VMhBUp'];a133_0x5dec=function(){return _0x3321f1;};return a133_0x5dec();}
1
+ (function(_0x270850,_0x347f32){const _0x458f89=a133_0x2266,_0x30893c=_0x270850();while(!![]){try{const _0xcb5f7e=-parseInt(_0x458f89(0x116))/0x1*(-parseInt(_0x458f89(0x118))/0x2)+-parseInt(_0x458f89(0x11b))/0x3+-parseInt(_0x458f89(0x113))/0x4*(-parseInt(_0x458f89(0x114))/0x5)+-parseInt(_0x458f89(0x119))/0x6+parseInt(_0x458f89(0x11a))/0x7+-parseInt(_0x458f89(0x11d))/0x8*(parseInt(_0x458f89(0x112))/0x9)+parseInt(_0x458f89(0x115))/0xa;if(_0xcb5f7e===_0x347f32)break;else _0x30893c['push'](_0x30893c['shift']());}catch(_0x38921c){_0x30893c['push'](_0x30893c['shift']());}}}(a133_0x5d58,0x82720));export function formatElapsed(_0x31cb46){const _0x5a074d=a133_0x2266,_0xaedd0c=Date[_0x5a074d(0x11c)]()-_0x31cb46;if(_0xaedd0c<0x3e8)return _0xaedd0c+'ms';const _0x4291d8=(_0xaedd0c/0x3e8)[_0x5a074d(0x117)](0x2),_0x343a8a=_0x4291d8[_0x5a074d(0x111)](/\.?0+$/u,'');return _0x343a8a+'s';}function a133_0x2266(_0x333df1,_0x587d08){_0x333df1=_0x333df1-0x111;const _0x5d58a9=a133_0x5d58();let _0x2266b0=_0x5d58a9[_0x333df1];return _0x2266b0;}function a133_0x5d58(){const _0x5848e0=['6004710OXgWEt','1190847WvkQcr','2665929SSDVMt','now','23072DbVlIZ','replace','873aSlFCk','4ZeqLFM','2629315lVIqPs','15167820yQALbU','35051qOqzMq','toFixed','28xhQPAq'];a133_0x5d58=function(){return _0x5848e0;};return a133_0x5d58();}
@@ -1 +1 @@
1
- (function(_0x1feee6,_0x56ac02){const _0x2a7016=a134_0x5c3d,_0x4f21ee=_0x1feee6();while(!![]){try{const _0x1ca756=-parseInt(_0x2a7016(0x170))/0x1*(-parseInt(_0x2a7016(0x15a))/0x2)+parseInt(_0x2a7016(0x161))/0x3+-parseInt(_0x2a7016(0x13e))/0x4+-parseInt(_0x2a7016(0x13c))/0x5+-parseInt(_0x2a7016(0x175))/0x6+-parseInt(_0x2a7016(0x15d))/0x7*(-parseInt(_0x2a7016(0x130))/0x8)+parseInt(_0x2a7016(0x12f))/0x9;if(_0x1ca756===_0x56ac02)break;else _0x4f21ee['push'](_0x4f21ee['shift']());}catch(_0x5c1c86){_0x4f21ee['push'](_0x4f21ee['shift']());}}}(a134_0x37d7,0xe3e44));import a134_0x422514 from'path';import a134_0x4f7fc4 from'fs';import a134_0x360d0e from'chalk';function a134_0x5c3d(_0x47b0da,_0x4aef78){_0x47b0da=_0x47b0da-0x11c;const _0x37d789=a134_0x37d7();let _0x5c3d23=_0x37d789[_0x47b0da];return _0x5c3d23;}import a134_0x605785 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';function a134_0x37d7(){const _0x52144f=['\x20dataset(s),\x20generated\x20','fail','message','dirname','项目创建完成:\x20','appCode','constants','defaultApp','√\x20Pulled\x20','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','toLocaleString','green','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','196618djowOU','needsUpgrade','resolve','1.0.0','package.json','11091762ZuNPib','create','readFileSync','belowMinimum','error','env','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','\x20\x201.\x20Start\x20project:\x20','项目创建失败:\x20','Install\x20dependencies','开始创建项目:\x20','stop','utf8','\x20already\x20exists','modelCount','更新\x20package.json\x20name','\x20run\x20start','bold','cookie','gray','21587409dteGAF','40kUHhzc','配置应用AppCode失败','minimumVersion','repeat','√\x20package.json\x20updated:\x20name=','Project\x20directory\x20','existsSync','cwd','join','name','更新\x20package.json\x20失败','string','2034525xeCGth','API\x20configuration\x20pulled:\x20','4467604shntNe','rmSync','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','Copy\x20project\x20files','projectCode','\x20|\x20AppCode:\x20','info','清理项目目录失败:\x20','version','test','chdir','API\x20配置拉取异常','\x20&&\x20','currentVersion','*\x20Configuring\x20AppCode\x20for\x20project\x20','accessSync','warn','🚀\x20Next\x20Steps:','Project\x20name:\x20','parse','cyan','CLI\x20版本检查','√\x20Configuration\x20file\x20created,\x20Apps:\x20','\x20model(s)','projectName','setLogPath','length','apps','2dPHvbx','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','\x20api\x20pull','1531859KlacCU','start','writeFileSync','log','1849419KTTgRF','production'];a134_0x37d7=function(){return _0x52144f;};return a134_0x37d7();}import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x1a0bf9){const _0x588d54=a134_0x5c3d,_0xc13ec4=await checkCliVersion();(_0xc13ec4[_0x588d54(0x171)]||_0xc13ec4['belowMinimum'])&&(printCliUpgradeWarning(_0xc13ec4),assertCliVersionSupported(_0xc13ec4),logger[_0x588d54(0x144)]('create',_0x588d54(0x153),{'currentVersion':_0xc13ec4[_0x588d54(0x14b)],'stableVersion':_0xc13ec4['stableVersion'],'minimumVersion':_0xc13ec4[_0x588d54(0x132)],'needsUpgrade':_0xc13ec4[_0x588d54(0x171)],'belowMinimum':_0xc13ec4[_0x588d54(0x11e)]}));if(_0x1a0bf9[_0x588d54(0x142)]&&_0x1a0bf9['appCode'])await runCreate({'projectName':_0x1a0bf9[_0x588d54(0x142)],'appCode':_0x1a0bf9[_0x588d54(0x168)],'env':_0x1a0bf9[_0x588d54(0x120)]},_0x1a0bf9);else{if(_0x1a0bf9[_0x588d54(0x142)]){const _0x9bb992=await selectSingleAppcode(_0x1a0bf9[_0x588d54(0x12d)]);await runCreate({'projectName':_0x1a0bf9['projectCode'],'appCode':_0x9bb992||undefined,'env':_0x1a0bf9[_0x588d54(0x120)]},_0x1a0bf9);}else await guidedCreateProject(_0x4bb638=>runCreate(_0x4bb638,_0x1a0bf9),_0x1a0bf9['env'],_0x1a0bf9[_0x588d54(0x12d)]);}}async function runCreate(_0x468ee9,_0x3b5226){const _0x128fdd=a134_0x5c3d;if(!_0x468ee9[_0x128fdd(0x156)]||_0x468ee9[_0x128fdd(0x156)]['trim']()==='')throw new Error('Project\x20name\x20cannot\x20be\x20empty');const _0x37a0dd=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x37a0dd[_0x128fdd(0x147)](_0x468ee9['projectName']))throw new Error(_0x128fdd(0x140));if(_0x468ee9['projectName'][_0x128fdd(0x158)]>0x64)throw new Error('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters');const _0x18aaf2=a134_0x422514[_0x128fdd(0x172)](process['cwd'](),_0x468ee9['projectName']);if(a134_0x4f7fc4[_0x128fdd(0x136)](_0x18aaf2))throw new Error(_0x128fdd(0x135)+_0x468ee9[_0x128fdd(0x156)]+_0x128fdd(0x128));try{a134_0x4f7fc4[_0x128fdd(0x14d)](a134_0x422514[_0x128fdd(0x166)](_0x18aaf2),a134_0x4f7fc4[_0x128fdd(0x169)]['W_OK']);}catch{throw new Error(_0x128fdd(0x121));}logger[_0x128fdd(0x157)](_0x18aaf2),logger['info']('create',_0x128fdd(0x125)+_0x468ee9[_0x128fdd(0x156)],{'projectDir':_0x18aaf2,'appCode':_0x468ee9['appCode']}),console[_0x128fdd(0x160)](),console['log'](a134_0x360d0e[_0x128fdd(0x16e)]('\x20√\x20')+_0x128fdd(0x150)+a134_0x360d0e[_0x128fdd(0x16e)](_0x468ee9[_0x128fdd(0x156)])+(_0x468ee9[_0x128fdd(0x168)]?_0x128fdd(0x143)+a134_0x360d0e[_0x128fdd(0x152)](_0x468ee9[_0x128fdd(0x168)]):''));try{await runTask(_0x128fdd(0x141),()=>copyProjectTemplate(_0x468ee9[_0x128fdd(0x156)])),await updatePackageJsonName(_0x468ee9[_0x128fdd(0x156)]),await runTask(_0x128fdd(0x124),()=>installDependencies(_0x468ee9['projectName'])),await runTask('Format\x20code',()=>formatProjectCode(_0x468ee9[_0x128fdd(0x156)])),await configureAppCode(_0x468ee9['projectName'],_0x468ee9[_0x128fdd(0x168)]||'',_0x468ee9[_0x128fdd(0x120)]);let _0x36ce4c=![];if(_0x468ee9[_0x128fdd(0x168)]){console[_0x128fdd(0x160)]('*\x20Pulling\x20API\x20configuration...');const _0x5e38f5=process[_0x128fdd(0x137)]();try{process[_0x128fdd(0x148)](_0x18aaf2);const _0x234efc=_0x468ee9[_0x128fdd(0x120)]||_0x128fdd(0x162);initEnv(_0x234efc);const {configArray:_0x429b98}=await fetchModelList(_0x468ee9['appCode'],_0x3b5226[_0x128fdd(0x12d)]||''),_0x214624=DEFAULT_API_DIR,_0x228eee=await generateApiFile(_0x429b98,'',_0x468ee9[_0x128fdd(0x168)],!![],_0x234efc,_0x214624);console['log'](_0x128fdd(0x16b)+_0x429b98[_0x128fdd(0x158)]+_0x128fdd(0x163)+_0x228eee[_0x128fdd(0x129)]+_0x128fdd(0x155)),logger[_0x128fdd(0x144)](_0x128fdd(0x11c),_0x128fdd(0x13d)+_0x468ee9[_0x128fdd(0x168)]);}catch(_0x390b73){_0x36ce4c=!![],console[_0x128fdd(0x160)](_0x128fdd(0x15b)),logger[_0x128fdd(0x14e)](_0x128fdd(0x11c),_0x128fdd(0x149),{'error':_0x390b73 instanceof Error?_0x390b73[_0x128fdd(0x165)]:String(_0x390b73)});}finally{process[_0x128fdd(0x148)](_0x5e38f5);}}logger['success'](_0x128fdd(0x11c),_0x128fdd(0x167)+_0x468ee9[_0x128fdd(0x156)]),console[_0x128fdd(0x160)](),console[_0x128fdd(0x160)](a134_0x360d0e['green']('─'[_0x128fdd(0x133)](0x3c))),console[_0x128fdd(0x160)](a134_0x360d0e[_0x128fdd(0x152)][_0x128fdd(0x12c)](_0x128fdd(0x14f))),console[_0x128fdd(0x160)](),console[_0x128fdd(0x160)](_0x128fdd(0x122)+a134_0x360d0e[_0x128fdd(0x152)]['bold']('cd\x20'+_0x468ee9[_0x128fdd(0x156)]+_0x128fdd(0x14a)+CLI_BIN_NAME+_0x128fdd(0x12b))),_0x36ce4c&&console[_0x128fdd(0x160)]('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a134_0x360d0e[_0x128fdd(0x152)][_0x128fdd(0x12c)](CLI_BIN_NAME+_0x128fdd(0x15c))),console[_0x128fdd(0x160)](a134_0x360d0e['green']('─'[_0x128fdd(0x133)](0x3c)));}catch(_0x1cb933){logger['error'](_0x128fdd(0x11c),_0x128fdd(0x123)+_0x468ee9['projectName'],{'error':_0x1cb933 instanceof Error?_0x1cb933['message']:String(_0x1cb933)});try{a134_0x4f7fc4['existsSync'](_0x18aaf2)&&(console[_0x128fdd(0x160)](_0x128fdd(0x16f)+_0x18aaf2),a134_0x4f7fc4[_0x128fdd(0x13f)](_0x18aaf2,{'recursive':!![],'force':!![]}));}catch{logger[_0x128fdd(0x14e)](_0x128fdd(0x11c),_0x128fdd(0x145)+_0x18aaf2);}throw _0x1cb933;}}async function runTask(_0x11fd49,_0x19e645){const _0x93f174=a134_0x5c3d,_0x4f9299=a134_0x605785(_0x11fd49+'...')[_0x93f174(0x15e)]();try{const _0x35e79c=await _0x19e645();_0x4f9299[_0x93f174(0x126)](),console[_0x93f174(0x160)](''+a134_0x360d0e['green']('\x20√\x20')+_0x11fd49+'\x20'+a134_0x360d0e[_0x93f174(0x12e)]('['+_0x35e79c+']'));}catch(_0x54855f){_0x4f9299[_0x93f174(0x164)](_0x11fd49);throw _0x54855f;}}async function updatePackageJsonName(_0x452dad){const _0x3b2238=a134_0x5c3d,_0x1d55db=a134_0x422514['resolve'](process[_0x3b2238(0x137)](),_0x452dad),_0x57393f=a134_0x422514[_0x3b2238(0x138)](_0x1d55db,_0x3b2238(0x174));try{console[_0x3b2238(0x160)](_0x3b2238(0x16c));const _0x883b8b=getRabetbaseCliPackageRoot(),_0xf15788=a134_0x422514['join'](_0x883b8b,_0x3b2238(0x174));let _0x5dfb7f='1.0.0';try{const _0x3a3844=JSON[_0x3b2238(0x151)](a134_0x4f7fc4[_0x3b2238(0x11d)](_0xf15788,_0x3b2238(0x127)));_0x5dfb7f=_0x3a3844[_0x3b2238(0x146)]||_0x3b2238(0x173);}catch{}const _0x5b13eb=a134_0x4f7fc4['readFileSync'](_0x57393f,_0x3b2238(0x127)),_0x11568b=JSON[_0x3b2238(0x151)](_0x5b13eb);_0x11568b[_0x3b2238(0x139)]=_0x452dad,_0x11568b['description']=_0x452dad+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x5dfb7f,a134_0x4f7fc4[_0x3b2238(0x15f)](_0x57393f,JSON['stringify'](_0x11568b,null,0x2)+'\x0a',_0x3b2238(0x127)),console[_0x3b2238(0x160)](_0x3b2238(0x134)+_0x452dad),logger[_0x3b2238(0x144)]('create',_0x3b2238(0x12a));}catch(_0xd3743b){logger[_0x3b2238(0x11f)](_0x3b2238(0x11c),_0x3b2238(0x13a));throw _0xd3743b;}}async function configureAppCode(_0x3a03d7,_0x165704,_0x3a4979){const _0x207d09=a134_0x5c3d,_0xf474cd=a134_0x422514['resolve'](process['cwd'](),_0x3a03d7),_0x431b73=a134_0x422514[_0x207d09(0x138)](_0xf474cd,NEW_CONFIG_NAME);try{_0x165704?console[_0x207d09(0x160)](_0x207d09(0x14c)+_0x3a03d7+':\x20'+_0x165704):console[_0x207d09(0x160)]('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x3a03d7);const _0x1547a6=getRabetbaseCliPackageRoot(),_0x3c4a1f=a134_0x422514[_0x207d09(0x138)](_0x1547a6,_0x207d09(0x174));let _0x4471c8=_0x207d09(0x173);try{const _0x598c9e=JSON['parse'](a134_0x4f7fc4['readFileSync'](_0x3c4a1f,_0x207d09(0x127)));_0x4471c8=_0x598c9e['version']||_0x207d09(0x173);}catch{}const _0x113b4a=readConfig(),_0x2e75b6=typeof _0x113b4a[_0x207d09(0x120)]===_0x207d09(0x13b)?_0x113b4a['env']:undefined,_0x20f622={};for(const _0x50bd57 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x113b4a[_0x50bd57]!=null)_0x20f622[_0x50bd57]=_0x113b4a[_0x50bd57];}const _0x5c7682=buildCanonicalProjectConfig(_0x20f622,{'appCodes':_0x165704?[_0x165704]:[],'env':_0x3a4979||_0x2e75b6||_0x207d09(0x162),'metadata':{'createdAt':new Date()[_0x207d09(0x16d)](),'version':_0x4471c8}});writeConfigFile(_0x431b73,_0x5c7682),_0x165704?console[_0x207d09(0x160)](_0x207d09(0x154)+Object['keys'](_0x5c7682[_0x207d09(0x159)]||{})['join'](',\x20')+'\x20|\x20Default:\x20'+_0x5c7682[_0x207d09(0x16a)]):console[_0x207d09(0x160)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger[_0x207d09(0x144)](_0x207d09(0x11c),'配置应用AppCode:\x20'+_0x165704);}catch(_0x25b9ac){logger[_0x207d09(0x11f)](_0x207d09(0x11c),_0x207d09(0x131));}}
1
+ (function(_0x36c689,_0x5422a9){const _0x49f766=a134_0x4de9,_0x6404b0=_0x36c689();while(!![]){try{const _0x12a701=-parseInt(_0x49f766(0x15f))/0x1+parseInt(_0x49f766(0x153))/0x2*(parseInt(_0x49f766(0x19e))/0x3)+parseInt(_0x49f766(0x17d))/0x4*(parseInt(_0x49f766(0x159))/0x5)+parseInt(_0x49f766(0x152))/0x6*(parseInt(_0x49f766(0x158))/0x7)+-parseInt(_0x49f766(0x179))/0x8*(parseInt(_0x49f766(0x1aa))/0x9)+-parseInt(_0x49f766(0x1a0))/0xa*(parseInt(_0x49f766(0x188))/0xb)+parseInt(_0x49f766(0x1a9))/0xc;if(_0x12a701===_0x5422a9)break;else _0x6404b0['push'](_0x6404b0['shift']());}catch(_0x332a67){_0x6404b0['push'](_0x6404b0['shift']());}}}(a134_0x28ca,0xd87c7));import a134_0x118326 from'path';import a134_0x281dbf from'fs';function a134_0x28ca(){const _0x14068f=['\x20√\x20','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','stableVersion','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','currentVersion','41997624dHQFAh','421182gylkMg','name','version','Copy\x20project\x20files','\x20model(s)','12LJDIDO','123778OaGdFS','appCode','√\x20package.json\x20updated:\x20name=','fail','\x20api\x20pull','831509ulARXg','55ctyErc','log','parse','配置应用AppCode:\x20','\x20|\x20Default:\x20','🚀\x20Next\x20Steps:','1127501RYMUSi','√\x20Pulled\x20','更新\x20package.json\x20失败','rmSync','chdir','defaultApp','配置应用AppCode失败','apps','warn','项目创建完成:\x20','gray','length','readFileSync','1.0.0','string','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','error','更新\x20package.json\x20name','API\x20配置拉取异常','production','\x20\x201.\x20Start\x20project:\x20','*\x20Configuring\x20AppCode\x20for\x20project\x20','√\x20Configuration\x20file\x20created,\x20Apps:\x20','stringify','utf8','cookie','232MAjiqS','toLocaleString','\x20|\x20AppCode:\x20','green','195236fQvdVH','CLI\x20版本检查','needsUpgrade','bold','constants','\x20dataset(s),\x20generated\x20','API\x20configuration\x20pulled:\x20','W_OK','项目创建失败:\x20','resolve','\x20run\x20start','1768789gytxPT','\x20&&\x20','cd\x20','Format\x20code','projectName','cyan','accessSync','Project\x20directory\x20','projectCode','repeat','info','test','join','message','belowMinimum','cwd','existsSync','env','\x20Generated\x20by\x20rabetbase\x20cli\x20','dirname','*\x20Pulling\x20API\x20configuration...','Install\x20dependencies','3gZSYfF','...','60BeQSfr','package.json','create','success'];a134_0x28ca=function(){return _0x14068f;};return a134_0x28ca();}import a134_0x12d61a from'chalk';import a134_0x3ff872 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';function a134_0x4de9(_0x13d26a,_0x391683){_0x13d26a=_0x13d26a-0x14f;const _0x28ca03=a134_0x28ca();let _0x4de96e=_0x28ca03[_0x13d26a];return _0x4de96e;}import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x102f69){const _0x4336be=a134_0x4de9,_0x2d7231=await checkCliVersion();(_0x2d7231['needsUpgrade']||_0x2d7231[_0x4336be(0x196)])&&(printCliUpgradeWarning(_0x2d7231),assertCliVersionSupported(_0x2d7231),logger[_0x4336be(0x192)](_0x4336be(0x1a2),_0x4336be(0x17e),{'currentVersion':_0x2d7231[_0x4336be(0x1a8)],'stableVersion':_0x2d7231[_0x4336be(0x1a6)],'minimumVersion':_0x2d7231['minimumVersion'],'needsUpgrade':_0x2d7231[_0x4336be(0x17f)],'belowMinimum':_0x2d7231[_0x4336be(0x196)]}));if(_0x102f69[_0x4336be(0x190)]&&_0x102f69[_0x4336be(0x154)])await runCreate({'projectName':_0x102f69[_0x4336be(0x190)],'appCode':_0x102f69[_0x4336be(0x154)],'env':_0x102f69['env']},_0x102f69);else{if(_0x102f69[_0x4336be(0x190)]){const _0x50940c=await selectSingleAppcode(_0x102f69[_0x4336be(0x178)]);await runCreate({'projectName':_0x102f69['projectCode'],'appCode':_0x50940c||undefined,'env':_0x102f69[_0x4336be(0x199)]},_0x102f69);}else await guidedCreateProject(_0x3577a0=>runCreate(_0x3577a0,_0x102f69),_0x102f69['env'],_0x102f69[_0x4336be(0x178)]);}}async function runCreate(_0x313812,_0x7543aa){const _0x159c64=a134_0x4de9;if(!_0x313812[_0x159c64(0x18c)]||_0x313812[_0x159c64(0x18c)]['trim']()==='')throw new Error('Project\x20name\x20cannot\x20be\x20empty');const _0x37ab2b=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x37ab2b[_0x159c64(0x193)](_0x313812['projectName']))throw new Error('Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters');if(_0x313812['projectName'][_0x159c64(0x16a)]>0x64)throw new Error('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters');const _0x16f6c7=a134_0x118326[_0x159c64(0x186)](process[_0x159c64(0x197)](),_0x313812[_0x159c64(0x18c)]);if(a134_0x281dbf[_0x159c64(0x198)](_0x16f6c7))throw new Error(_0x159c64(0x18f)+_0x313812[_0x159c64(0x18c)]+'\x20already\x20exists');try{a134_0x281dbf[_0x159c64(0x18e)](a134_0x118326[_0x159c64(0x19b)](_0x16f6c7),a134_0x281dbf[_0x159c64(0x181)][_0x159c64(0x184)]);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger['setLogPath'](_0x16f6c7),logger[_0x159c64(0x192)]('create','开始创建项目:\x20'+_0x313812['projectName'],{'projectDir':_0x16f6c7,'appCode':_0x313812[_0x159c64(0x154)]}),console['log'](),console[_0x159c64(0x15a)](a134_0x12d61a[_0x159c64(0x17c)]('\x20√\x20')+'Project\x20name:\x20'+a134_0x12d61a[_0x159c64(0x17c)](_0x313812['projectName'])+(_0x313812['appCode']?_0x159c64(0x17b)+a134_0x12d61a[_0x159c64(0x18d)](_0x313812['appCode']):''));try{await runTask(_0x159c64(0x150),()=>copyProjectTemplate(_0x313812['projectName'])),await updatePackageJsonName(_0x313812[_0x159c64(0x18c)]),await runTask(_0x159c64(0x19d),()=>installDependencies(_0x313812[_0x159c64(0x18c)])),await runTask(_0x159c64(0x18b),()=>formatProjectCode(_0x313812['projectName'])),await configureAppCode(_0x313812[_0x159c64(0x18c)],_0x313812[_0x159c64(0x154)]||'',_0x313812[_0x159c64(0x199)]);let _0x4e07a4=![];if(_0x313812[_0x159c64(0x154)]){console[_0x159c64(0x15a)](_0x159c64(0x19c));const _0x245e77=process['cwd']();try{process[_0x159c64(0x163)](_0x16f6c7);const _0x438cd4=_0x313812[_0x159c64(0x199)]||_0x159c64(0x172);initEnv(_0x438cd4);const {configArray:_0x1110d0}=await fetchModelList(_0x313812[_0x159c64(0x154)],_0x7543aa[_0x159c64(0x178)]||''),_0x584918=DEFAULT_API_DIR,_0x207f3d=await generateApiFile(_0x1110d0,'',_0x313812[_0x159c64(0x154)],!![],_0x438cd4,_0x584918);console[_0x159c64(0x15a)](_0x159c64(0x160)+_0x1110d0[_0x159c64(0x16a)]+_0x159c64(0x182)+_0x207f3d['modelCount']+_0x159c64(0x151)),logger[_0x159c64(0x192)](_0x159c64(0x1a2),_0x159c64(0x183)+_0x313812['appCode']);}catch(_0x19b741){_0x4e07a4=!![],console[_0x159c64(0x15a)](_0x159c64(0x16e)),logger[_0x159c64(0x167)]('create',_0x159c64(0x171),{'error':_0x19b741 instanceof Error?_0x19b741[_0x159c64(0x195)]:String(_0x19b741)});}finally{process[_0x159c64(0x163)](_0x245e77);}}logger[_0x159c64(0x1a3)](_0x159c64(0x1a2),_0x159c64(0x168)+_0x313812[_0x159c64(0x18c)]),console[_0x159c64(0x15a)](),console[_0x159c64(0x15a)](a134_0x12d61a[_0x159c64(0x17c)]('─'[_0x159c64(0x191)](0x3c))),console[_0x159c64(0x15a)](a134_0x12d61a['cyan']['bold'](_0x159c64(0x15e))),console[_0x159c64(0x15a)](),console['log'](_0x159c64(0x173)+a134_0x12d61a[_0x159c64(0x18d)][_0x159c64(0x180)](_0x159c64(0x18a)+_0x313812[_0x159c64(0x18c)]+_0x159c64(0x189)+CLI_BIN_NAME+_0x159c64(0x187))),_0x4e07a4&&console[_0x159c64(0x15a)]('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a134_0x12d61a[_0x159c64(0x18d)][_0x159c64(0x180)](CLI_BIN_NAME+_0x159c64(0x157))),console[_0x159c64(0x15a)](a134_0x12d61a['green']('─'[_0x159c64(0x191)](0x3c)));}catch(_0x2f8cc1){logger[_0x159c64(0x16f)](_0x159c64(0x1a2),_0x159c64(0x185)+_0x313812[_0x159c64(0x18c)],{'error':_0x2f8cc1 instanceof Error?_0x2f8cc1['message']:String(_0x2f8cc1)});try{a134_0x281dbf[_0x159c64(0x198)](_0x16f6c7)&&(console[_0x159c64(0x15a)](_0x159c64(0x1a7)+_0x16f6c7),a134_0x281dbf[_0x159c64(0x162)](_0x16f6c7,{'recursive':!![],'force':!![]}));}catch{logger['warn']('create','清理项目目录失败:\x20'+_0x16f6c7);}throw _0x2f8cc1;}}async function runTask(_0x2acfba,_0x5bb580){const _0x77bdcb=a134_0x4de9,_0x79240e=a134_0x3ff872(_0x2acfba+_0x77bdcb(0x19f))['start']();try{const _0x317047=await _0x5bb580();_0x79240e['stop'](),console[_0x77bdcb(0x15a)](''+a134_0x12d61a[_0x77bdcb(0x17c)](_0x77bdcb(0x1a4))+_0x2acfba+'\x20'+a134_0x12d61a[_0x77bdcb(0x169)]('['+_0x317047+']'));}catch(_0x528b92){_0x79240e[_0x77bdcb(0x156)](_0x2acfba);throw _0x528b92;}}async function updatePackageJsonName(_0xb0ffbd){const _0x228344=a134_0x4de9,_0x395f24=a134_0x118326['resolve'](process['cwd'](),_0xb0ffbd),_0x3cbd56=a134_0x118326[_0x228344(0x194)](_0x395f24,_0x228344(0x1a1));try{console[_0x228344(0x15a)]('*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields');const _0x5a5feb=getRabetbaseCliPackageRoot(),_0x3fcf1b=a134_0x118326['join'](_0x5a5feb,_0x228344(0x1a1));let _0x560969=_0x228344(0x16c);try{const _0x3d4fe4=JSON[_0x228344(0x15b)](a134_0x281dbf['readFileSync'](_0x3fcf1b,_0x228344(0x177)));_0x560969=_0x3d4fe4[_0x228344(0x14f)]||_0x228344(0x16c);}catch{}const _0x496cfe=a134_0x281dbf[_0x228344(0x16b)](_0x3cbd56,_0x228344(0x177)),_0x49ca3b=JSON[_0x228344(0x15b)](_0x496cfe);_0x49ca3b[_0x228344(0x1ab)]=_0xb0ffbd,_0x49ca3b['description']=_0xb0ffbd+_0x228344(0x19a)+_0x560969,a134_0x281dbf['writeFileSync'](_0x3cbd56,JSON[_0x228344(0x176)](_0x49ca3b,null,0x2)+'\x0a',_0x228344(0x177)),console[_0x228344(0x15a)](_0x228344(0x155)+_0xb0ffbd),logger[_0x228344(0x192)](_0x228344(0x1a2),_0x228344(0x170));}catch(_0x296c70){logger[_0x228344(0x16f)]('create',_0x228344(0x161));throw _0x296c70;}}async function configureAppCode(_0x4fcb3d,_0x3e17c6,_0x42ffd5){const _0x33649b=a134_0x4de9,_0x4ee821=a134_0x118326['resolve'](process[_0x33649b(0x197)](),_0x4fcb3d),_0x19772a=a134_0x118326[_0x33649b(0x194)](_0x4ee821,NEW_CONFIG_NAME);try{_0x3e17c6?console['log'](_0x33649b(0x174)+_0x4fcb3d+':\x20'+_0x3e17c6):console[_0x33649b(0x15a)](_0x33649b(0x1a5)+_0x4fcb3d);const _0xde7058=getRabetbaseCliPackageRoot(),_0x2ed98d=a134_0x118326[_0x33649b(0x194)](_0xde7058,_0x33649b(0x1a1));let _0x13c379=_0x33649b(0x16c);try{const _0x2d9a4c=JSON[_0x33649b(0x15b)](a134_0x281dbf[_0x33649b(0x16b)](_0x2ed98d,_0x33649b(0x177)));_0x13c379=_0x2d9a4c['version']||'1.0.0';}catch{}const _0x4490d8=readConfig(),_0x52b3d3=typeof _0x4490d8[_0x33649b(0x199)]===_0x33649b(0x16d)?_0x4490d8[_0x33649b(0x199)]:undefined,_0x3f8657={};for(const _0x38f1f4 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x4490d8[_0x38f1f4]!=null)_0x3f8657[_0x38f1f4]=_0x4490d8[_0x38f1f4];}const _0x3af927=buildCanonicalProjectConfig(_0x3f8657,{'appCodes':_0x3e17c6?[_0x3e17c6]:[],'env':_0x42ffd5||_0x52b3d3||_0x33649b(0x172),'metadata':{'createdAt':new Date()[_0x33649b(0x17a)](),'version':_0x13c379}});writeConfigFile(_0x19772a,_0x3af927),_0x3e17c6?console[_0x33649b(0x15a)](_0x33649b(0x175)+Object['keys'](_0x3af927[_0x33649b(0x166)]||{})[_0x33649b(0x194)](',\x20')+_0x33649b(0x15d)+_0x3af927[_0x33649b(0x164)]):console[_0x33649b(0x15a)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger[_0x33649b(0x192)](_0x33649b(0x1a2),_0x33649b(0x15c)+_0x3e17c6);}catch(_0x4ef851){logger['error'](_0x33649b(0x1a2),_0x33649b(0x165));}}
@@ -1 +1 @@
1
- (function(_0x4ac796,_0x5c9575){const _0x277387=a135_0x4ebc,_0x22eb26=_0x4ac796();while(!![]){try{const _0x4bf5a5=parseInt(_0x277387(0x200))/0x1*(-parseInt(_0x277387(0x1f1))/0x2)+-parseInt(_0x277387(0x1fe))/0x3+-parseInt(_0x277387(0x210))/0x4*(-parseInt(_0x277387(0x1ef))/0x5)+-parseInt(_0x277387(0x1f8))/0x6+-parseInt(_0x277387(0x204))/0x7+parseInt(_0x277387(0x20e))/0x8*(parseInt(_0x277387(0x1fb))/0x9)+-parseInt(_0x277387(0x1fc))/0xa*(-parseInt(_0x277387(0x21e))/0xb);if(_0x4bf5a5===_0x5c9575)break;else _0x22eb26['push'](_0x22eb26['shift']());}catch(_0x11bf6e){_0x22eb26['push'](_0x22eb26['shift']());}}}(a135_0x1262,0x2e73b));import a135_0xe8dbb1 from'path';import a135_0x5e5b1c from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';function a135_0x4ebc(_0x55e739,_0x4733d4){_0x55e739=_0x55e739-0x1ea;const _0x1262a5=a135_0x1262();let _0x4ebc28=_0x1262a5[_0x55e739];return _0x4ebc28;}function a135_0x1262(){const _0x26104d=['validation','trim','needsUpgrade','\x20\x20√\x20Pulled\x20','770622QdwbMJ','cwd','Project\x20name\x20cannot\x20be\x20empty.','45dpwMWD','20qCIlNh','\x20\x20√\x20package.json\x20updated','311835QJuniD','\x20created\x20successfully!','1JgnxUu','*\x20Creating\x20project\x20','ignore','\x0a√\x20Project\x20','1058246qpmvSk','Project\x20directory\x20\x22','production','bun\x20--version','string','length','package.json','\x20api\x20pull`\x20manually\x20later.','Use\x20a\x20different\x20project\x20name.','npm','201560TFRzBT','\x20model(s)','66684bjxyqD','\x0a\x20\x20cd\x20','chdir','bun','join','resolve','log','access','env','bun\x20run\x20format','writeFile','\x20\x20√\x20Configuration\x20file\x20created','belowMinimum','\x20\x20Pulling\x20API\x20configuration...','2529164bEDKbS','...','\x20\x20√\x20Project\x20template\x20created','Cannot\x20create\x20project\x20in\x20current\x20directory.','dirname','\x20\x20√\x20Code\x20formatted','description','W_OK','\x22\x20already\x20exists.','name','25bESojd','\x20dataset(s),\x20generated\x20','190702peJxJr','constants','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.'];a135_0x1262=function(){return _0x26104d;};return a135_0x1262();}import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x1fee81,_0x396f8a,_0x527f7c,_0x5056ec){const _0x141098=a135_0x4ebc,_0xd1c2e0=await checkCliVersion();(_0xd1c2e0[_0x141098(0x1f6)]||_0xd1c2e0[_0x141098(0x21c)])&&(printCliUpgradeWarning(_0xd1c2e0),assertCliVersionSupported(_0xd1c2e0));if(!_0x1fee81||_0x1fee81[_0x141098(0x1f5)]()==='')throw CliErrors[_0x141098(0x1f4)](_0x141098(0x1fa));const _0x1bb677=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1bb677['test'](_0x1fee81))throw CliErrors['validation']('Project\x20name\x20contains\x20invalid\x20characters.','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters');if(_0x1fee81[_0x141098(0x209)]>0x64)throw CliErrors[_0x141098(0x1f4)](_0x141098(0x1f3));const _0x46ddf6=a135_0xe8dbb1['resolve'](process[_0x141098(0x1f9)](),_0x1fee81);if(existsSync(_0x46ddf6))throw CliErrors[_0x141098(0x1f4)](_0x141098(0x205)+_0x1fee81+_0x141098(0x1ed),_0x141098(0x20c));try{const _0x2b7780=a135_0xe8dbb1[_0x141098(0x222)](_0x46ddf6);await a135_0x5e5b1c[_0x141098(0x217)](_0x2b7780,a135_0x5e5b1c[_0x141098(0x1f2)][_0x141098(0x1ec)]);}catch{throw CliErrors[_0x141098(0x1f4)](_0x141098(0x221),'Check\x20directory\x20permissions.');}try{console[_0x141098(0x216)](_0x141098(0x201)+_0x1fee81+_0x141098(0x21f));const _0x224e82=getSubAppReactDemoTemplateDir();await copyDirectory(_0x224e82,_0x46ddf6),console[_0x141098(0x216)](_0x141098(0x220)),await updatePackageJsonName(_0x1fee81),console[_0x141098(0x216)](_0x141098(0x1fd)),console[_0x141098(0x216)]('\x20\x20Installing\x20dependencies...'),console[_0x141098(0x216)]('\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)'),await formatCode(_0x46ddf6),console[_0x141098(0x216)](_0x141098(0x1ea)),await configureProject(_0x1fee81,_0x527f7c,_0x396f8a),console['log'](_0x141098(0x21b)),_0x527f7c&&await pullApiConfig(_0x46ddf6,_0x527f7c,_0x396f8a,_0x5056ec),console[_0x141098(0x216)](_0x141098(0x203)+_0x1fee81+_0x141098(0x1ff)),console['log'](_0x141098(0x211)+_0x1fee81),console[_0x141098(0x216)]('\x20\x20rabetbase\x20run\x20start\x0a');}catch(_0x166f77){try{existsSync(_0x46ddf6)&&await a135_0x5e5b1c['rm'](_0x46ddf6,{'recursive':!![],'force':!![]});}catch{}throw _0x166f77;}}async function updatePackageJsonName(_0x4ee0fa){const _0x619046=a135_0x4ebc,_0x4a7a04=a135_0xe8dbb1[_0x619046(0x215)](process['cwd'](),_0x4ee0fa),_0x2f5a93=a135_0xe8dbb1[_0x619046(0x214)](_0x4a7a04,_0x619046(0x20a)),_0x30bdf6=await a135_0x5e5b1c['readFile'](_0x2f5a93,'utf-8'),_0x36b316=JSON['parse'](_0x30bdf6);_0x36b316[_0x619046(0x1ee)]=_0x4ee0fa,_0x36b316[_0x619046(0x1eb)]='A\x20project\x20created\x20with\x20Lovrabet\x20CLI',await a135_0x5e5b1c[_0x619046(0x21a)](_0x2f5a93,JSON['stringify'](_0x36b316,null,0x2)+'\x0a');}function detectPackageManager(){const _0x1cd8a9=a135_0x4ebc;try{return execSync(_0x1cd8a9(0x207),{'stdio':_0x1cd8a9(0x202)}),_0x1cd8a9(0x213);}catch{return _0x1cd8a9(0x20d);}}async function formatCode(_0x17c8cb){const _0x14e874=a135_0x4ebc;try{await execAsync(_0x14e874(0x219),{'cwd':_0x17c8cb});}catch{}}async function configureProject(_0x2d8ea7,_0x386229,_0x276e41){const _0x5ee13a=a135_0x4ebc,_0x546ad6=a135_0xe8dbb1[_0x5ee13a(0x215)](process['cwd'](),_0x2d8ea7),_0x1ca978=a135_0xe8dbb1[_0x5ee13a(0x214)](_0x546ad6,NEW_CONFIG_NAME),_0xc7d596=readConfig(),_0x7bc0ac=typeof _0xc7d596[_0x5ee13a(0x218)]===_0x5ee13a(0x208)?_0xc7d596[_0x5ee13a(0x218)]:undefined,_0x44ad19={};for(const _0x1853ea of PROJECT_CREATE_INHERITABLE_KEYS){if(_0xc7d596[_0x1853ea]!=null)_0x44ad19[_0x1853ea]=_0xc7d596[_0x1853ea];}const _0x26edd5=buildCanonicalProjectConfig(_0x44ad19,{'appCodes':_0x386229?[_0x386229]:[],'env':_0x276e41||_0x7bc0ac||_0x5ee13a(0x206),'metadata':{'createdAt':new Date()['toLocaleString'](),'version':getCliVersion()}});writeConfigFile(_0x1ca978,_0x26edd5);}async function pullApiConfig(_0x333e06,_0xf11c2b,_0x24ac83,_0x19b8fe){const _0x55781f=a135_0x4ebc,_0x3d0930=process['cwd']();try{process[_0x55781f(0x212)](_0x333e06);const _0x26b3a9=_0x24ac83||_0x55781f(0x206);initEnv(_0x26b3a9),console[_0x55781f(0x216)](_0x55781f(0x21d));const {configArray:_0x18522c}=await fetchModelList(_0xf11c2b,_0x19b8fe||''),_0x4c11f4=await generateApiFile(_0x18522c,'',_0xf11c2b,!![],_0x26b3a9,DEFAULT_API_DIR);console[_0x55781f(0x216)](_0x55781f(0x1f7)+_0x18522c[_0x55781f(0x209)]+_0x55781f(0x1f0)+_0x4c11f4['modelCount']+_0x55781f(0x20f));}catch(_0x3b239e){console[_0x55781f(0x216)]('\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`'+CLI_BIN_NAME+_0x55781f(0x20b));}finally{process['chdir'](_0x3d0930);}}
1
+ (function(_0x5a5eb2,_0x4ded90){const _0x39256f=a135_0x382d,_0x4e8969=_0x5a5eb2();while(!![]){try{const _0x436297=parseInt(_0x39256f(0xc9))/0x1*(parseInt(_0x39256f(0xb9))/0x2)+-parseInt(_0x39256f(0xad))/0x3*(parseInt(_0x39256f(0xa4))/0x4)+parseInt(_0x39256f(0xbf))/0x5+-parseInt(_0x39256f(0xa9))/0x6*(parseInt(_0x39256f(0xd3))/0x7)+parseInt(_0x39256f(0x9c))/0x8*(-parseInt(_0x39256f(0x9f))/0x9)+parseInt(_0x39256f(0xa2))/0xa+parseInt(_0x39256f(0xb8))/0xb;if(_0x436297===_0x4ded90)break;else _0x4e8969['push'](_0x4e8969['shift']());}catch(_0x236401){_0x4e8969['push'](_0x4e8969['shift']());}}}(a135_0x2cf4,0xdc5eb));import a135_0x5c2340 from'path';import a135_0x36dd3d from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';import{fetchModelList}from'../../../core/api-client.js';function a135_0x382d(_0x90196b,_0x124e0d){_0x90196b=_0x90196b-0x99;const _0x2cf4c9=a135_0x2cf4();let _0x382d91=_0x2cf4c9[_0x90196b];return _0x382d91;}import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x345e78,_0x49c11b,_0x7f6751,_0xacd5f4){const _0x4c26f5=a135_0x382d,_0x5078be=await checkCliVersion();(_0x5078be['needsUpgrade']||_0x5078be[_0x4c26f5(0xd2)])&&(printCliUpgradeWarning(_0x5078be),assertCliVersionSupported(_0x5078be));if(!_0x345e78||_0x345e78[_0x4c26f5(0xc5)]()==='')throw CliErrors[_0x4c26f5(0xba)](_0x4c26f5(0xc1));const _0x228fdb=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x228fdb[_0x4c26f5(0xbe)](_0x345e78))throw CliErrors[_0x4c26f5(0xba)](_0x4c26f5(0xcd),'Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters');if(_0x345e78[_0x4c26f5(0xb0)]>0x64)throw CliErrors[_0x4c26f5(0xba)]('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.');const _0x51c548=a135_0x5c2340[_0x4c26f5(0xc2)](process[_0x4c26f5(0x9d)](),_0x345e78);if(existsSync(_0x51c548))throw CliErrors['validation'](_0x4c26f5(0xaf)+_0x345e78+_0x4c26f5(0xa0),_0x4c26f5(0xc6));try{const _0x33ae0d=a135_0x5c2340[_0x4c26f5(0xa7)](_0x51c548);await a135_0x36dd3d[_0x4c26f5(0xbc)](_0x33ae0d,a135_0x36dd3d['constants'][_0x4c26f5(0xc0)]);}catch{throw CliErrors[_0x4c26f5(0xba)](_0x4c26f5(0x99),_0x4c26f5(0xbb));}try{console['log']('*\x20Creating\x20project\x20'+_0x345e78+_0x4c26f5(0xbd));const _0x8a3295=getSubAppReactDemoTemplateDir();await copyDirectory(_0x8a3295,_0x51c548),console['log'](_0x4c26f5(0xb2)),await updatePackageJsonName(_0x345e78),console[_0x4c26f5(0xb4)](_0x4c26f5(0x9e)),console['log'](_0x4c26f5(0xb6)),console['log'](_0x4c26f5(0xd0)),await formatCode(_0x51c548),console['log'](_0x4c26f5(0xca)),await configureProject(_0x345e78,_0x7f6751,_0x49c11b),console[_0x4c26f5(0xb4)](_0x4c26f5(0xa8)),_0x7f6751&&await pullApiConfig(_0x51c548,_0x7f6751,_0x49c11b,_0xacd5f4),console[_0x4c26f5(0xb4)](_0x4c26f5(0xcb)+_0x345e78+_0x4c26f5(0xb1)),console[_0x4c26f5(0xb4)](_0x4c26f5(0x9a)+_0x345e78),console[_0x4c26f5(0xb4)](_0x4c26f5(0xc4));}catch(_0xaace1){try{existsSync(_0x51c548)&&await a135_0x36dd3d['rm'](_0x51c548,{'recursive':!![],'force':!![]});}catch{}throw _0xaace1;}}async function updatePackageJsonName(_0x27488e){const _0x3bb44b=a135_0x382d,_0x1f88c5=a135_0x5c2340['resolve'](process[_0x3bb44b(0x9d)](),_0x27488e),_0x5e7da1=a135_0x5c2340[_0x3bb44b(0xa6)](_0x1f88c5,_0x3bb44b(0xac)),_0x5ef007=await a135_0x36dd3d[_0x3bb44b(0xcc)](_0x5e7da1,_0x3bb44b(0xb7)),_0x52e50d=JSON[_0x3bb44b(0xab)](_0x5ef007);_0x52e50d['name']=_0x27488e,_0x52e50d[_0x3bb44b(0x9b)]=_0x3bb44b(0xd1),await a135_0x36dd3d[_0x3bb44b(0xc8)](_0x5e7da1,JSON['stringify'](_0x52e50d,null,0x2)+'\x0a');}function detectPackageManager(){const _0x1b1a43=a135_0x382d;try{return execSync('bun\x20--version',{'stdio':_0x1b1a43(0xd4)}),_0x1b1a43(0xae);}catch{return'npm';}}async function formatCode(_0x2292f1){const _0x5974e8=a135_0x382d;try{await execAsync(_0x5974e8(0xa3),{'cwd':_0x2292f1});}catch{}}function a135_0x2cf4(){const _0x515ab4=['log','toLocaleString','\x20\x20Installing\x20dependencies...','utf-8','12677808NKJxAP','2491148XxKbvR','validation','Check\x20directory\x20permissions.','access','...','test','8291385xqgNZb','W_OK','Project\x20name\x20cannot\x20be\x20empty.','resolve','\x20api\x20pull`\x20manually\x20later.','\x20\x20rabetbase\x20run\x20start\x0a','trim','Use\x20a\x20different\x20project\x20name.','env','writeFile','1ztCmuK','\x20\x20√\x20Code\x20formatted','\x0a√\x20Project\x20','readFile','Project\x20name\x20contains\x20invalid\x20characters.','\x20dataset(s),\x20generated\x20','production','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','belowMinimum','459991fZAgkd','ignore','Cannot\x20create\x20project\x20in\x20current\x20directory.','\x0a\x20\x20cd\x20','description','72cVNtWN','cwd','\x20\x20√\x20package.json\x20updated','815661xclQoo','\x22\x20already\x20exists.','chdir','1722640ZMpuAA','bun\x20run\x20format','47228cSJZYc','\x20\x20Pulling\x20API\x20configuration...','join','dirname','\x20\x20√\x20Configuration\x20file\x20created','102BPoXRE','\x20model(s)','parse','package.json','354KGceew','bun','Project\x20directory\x20\x22','length','\x20created\x20successfully!','\x20\x20√\x20Project\x20template\x20created','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`'];a135_0x2cf4=function(){return _0x515ab4;};return a135_0x2cf4();}async function configureProject(_0x630aba,_0x28bc0b,_0x7d3723){const _0x13d2d7=a135_0x382d,_0x5c3977=a135_0x5c2340[_0x13d2d7(0xc2)](process[_0x13d2d7(0x9d)](),_0x630aba),_0x39db76=a135_0x5c2340['join'](_0x5c3977,NEW_CONFIG_NAME),_0x3e239a=readConfig(),_0x34ec8d=typeof _0x3e239a['env']==='string'?_0x3e239a[_0x13d2d7(0xc7)]:undefined,_0x3b7ff9={};for(const _0x500b7c of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x3e239a[_0x500b7c]!=null)_0x3b7ff9[_0x500b7c]=_0x3e239a[_0x500b7c];}const _0x28eb57=buildCanonicalProjectConfig(_0x3b7ff9,{'appCodes':_0x28bc0b?[_0x28bc0b]:[],'env':_0x7d3723||_0x34ec8d||_0x13d2d7(0xcf),'metadata':{'createdAt':new Date()[_0x13d2d7(0xb5)](),'version':getCliVersion()}});writeConfigFile(_0x39db76,_0x28eb57);}async function pullApiConfig(_0x2dc9e6,_0x5dd6d4,_0x424965,_0x24d61e){const _0xf6c422=a135_0x382d,_0x5d25aa=process[_0xf6c422(0x9d)]();try{process['chdir'](_0x2dc9e6);const _0x3764a5=_0x424965||_0xf6c422(0xcf);initEnv(_0x3764a5),console['log'](_0xf6c422(0xa5));const {configArray:_0x5a61e4}=await fetchModelList(_0x5dd6d4,_0x24d61e||''),_0x24ff66=await generateApiFile(_0x5a61e4,'',_0x5dd6d4,!![],_0x3764a5,DEFAULT_API_DIR);console[_0xf6c422(0xb4)]('\x20\x20√\x20Pulled\x20'+_0x5a61e4[_0xf6c422(0xb0)]+_0xf6c422(0xce)+_0x24ff66['modelCount']+_0xf6c422(0xaa));}catch(_0x1f15d6){console[_0xf6c422(0xb4)](_0xf6c422(0xb3)+CLI_BIN_NAME+_0xf6c422(0xc3));}finally{process[_0xf6c422(0xa1)](_0x5d25aa);}}
@@ -1 +1 @@
1
- const a136_0xacde18=a136_0x3a70;(function(_0x535bcb,_0x150eb6){const _0x4d320e=a136_0x3a70,_0x2f7bbc=_0x535bcb();while(!![]){try{const _0xb4bcd=parseInt(_0x4d320e(0x9b))/0x1+parseInt(_0x4d320e(0x9f))/0x2+parseInt(_0x4d320e(0x9e))/0x3*(parseInt(_0x4d320e(0x9c))/0x4)+-parseInt(_0x4d320e(0x9a))/0x5*(-parseInt(_0x4d320e(0xa3))/0x6)+parseInt(_0x4d320e(0x99))/0x7*(-parseInt(_0x4d320e(0xa4))/0x8)+-parseInt(_0x4d320e(0xa0))/0x9*(parseInt(_0x4d320e(0x9d))/0xa)+parseInt(_0x4d320e(0xa5))/0xb*(-parseInt(_0x4d320e(0xa7))/0xc);if(_0xb4bcd===_0x150eb6)break;else _0x2f7bbc['push'](_0x2f7bbc['shift']());}catch(_0x4bc0a8){_0x2f7bbc['push'](_0x2f7bbc['shift']());}}}(a136_0x24b2,0x7823b));import a136_0x1238e0 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a136_0x1238e0[a136_0xacde18(0xa1)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){return a136_0x1238e0['resolve'](__dirname,'../../../../');}export function getSubAppReactDemoTemplateDir(){const _0x45b24c=a136_0xacde18;return a136_0x1238e0['join'](getRabetbaseCliPackageRoot(),'templates',_0x45b24c(0xa2),_0x45b24c(0xa6));}function a136_0x3a70(_0x2ea756,_0x652fc3){_0x2ea756=_0x2ea756-0x99;const _0x24b242=a136_0x24b2();let _0x3a707c=_0x24b242[_0x2ea756];return _0x3a707c;}function a136_0x24b2(){const _0x43516c=['projects','4765158NqCmrs','467912eCutwQ','8453577kLOjrb','sub-app-react-demo','12UOOYeE','70UWptCV','5jJOgSt','80088BGYyhO','2892324fuxgbP','30MKaFaw','3ZXIYyk','511396nvvRZp','22716RhSJGw','dirname'];a136_0x24b2=function(){return _0x43516c;};return a136_0x24b2();}
1
+ function a136_0x1c74(_0x49d062,_0x5c4fc2){_0x49d062=_0x49d062-0x101;const _0x2cc7a4=a136_0x2cc7();let _0x1c7426=_0x2cc7a4[_0x49d062];return _0x1c7426;}const a136_0x4b6fc8=a136_0x1c74;(function(_0x5a55fd,_0xfab83){const _0x51780d=a136_0x1c74,_0x52c2b1=_0x5a55fd();while(!![]){try{const _0x2434f7=parseInt(_0x51780d(0x105))/0x1+parseInt(_0x51780d(0x10d))/0x2+-parseInt(_0x51780d(0x10f))/0x3*(-parseInt(_0x51780d(0x108))/0x4)+parseInt(_0x51780d(0x10b))/0x5*(-parseInt(_0x51780d(0x104))/0x6)+parseInt(_0x51780d(0x102))/0x7+-parseInt(_0x51780d(0x10a))/0x8+-parseInt(_0x51780d(0x110))/0x9;if(_0x2434f7===_0xfab83)break;else _0x52c2b1['push'](_0x52c2b1['shift']());}catch(_0x37f896){_0x52c2b1['push'](_0x52c2b1['shift']());}}}(a136_0x2cc7,0xb801c));import a136_0xf2505f from'node:path';import{fileURLToPath}from'node:url';const __dirname=a136_0xf2505f[a136_0x4b6fc8(0x10c)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x349e6f=a136_0x4b6fc8;return a136_0xf2505f[_0x349e6f(0x106)](__dirname,_0x349e6f(0x10e));}export function getSubAppReactDemoTemplateDir(){const _0x52f3a4=a136_0x4b6fc8;return a136_0xf2505f[_0x52f3a4(0x103)](getRabetbaseCliPackageRoot(),_0x52f3a4(0x107),_0x52f3a4(0x109),_0x52f3a4(0x101));}function a136_0x2cc7(){const _0x13e38a=['join','6Zgoeyc','1422706NrWXUl','resolve','templates','20zsyjsG','projects','7481160nzyFKW','339550hWqbnV','dirname','484590RbErAx','../../../../','541881eYUAiO','19990206sEMGyQ','sub-app-react-demo','9868215xXuXRH'];a136_0x2cc7=function(){return _0x13e38a;};return a136_0x2cc7();}
@@ -1 +1 @@
1
- function a137_0x49c0(_0x5dfbd0,_0x3d24d2){_0x5dfbd0=_0x5dfbd0-0x1f1;const _0x4afb32=a137_0x4afb();let _0x49c0e3=_0x4afb32[_0x5dfbd0];return _0x49c0e3;}(function(_0x1c3b78,_0x1ebef0){const _0x48dd41=a137_0x49c0,_0x1f5291=_0x1c3b78();while(!![]){try{const _0x4bdd4f=-parseInt(_0x48dd41(0x201))/0x1*(-parseInt(_0x48dd41(0x1f2))/0x2)+-parseInt(_0x48dd41(0x202))/0x3*(parseInt(_0x48dd41(0x1f9))/0x4)+-parseInt(_0x48dd41(0x1fa))/0x5+parseInt(_0x48dd41(0x1f8))/0x6+-parseInt(_0x48dd41(0x200))/0x7+parseInt(_0x48dd41(0x1fe))/0x8+-parseInt(_0x48dd41(0x1f4))/0x9;if(_0x4bdd4f===_0x1ebef0)break;else _0x1f5291['push'](_0x1f5291['shift']());}catch(_0x1224e9){_0x1f5291['push'](_0x1f5291['shift']());}}}(a137_0x4afb,0xc6efc));import a137_0x50fc32 from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();function a137_0x4afb(){const _0x2182ba=['info','copy','6781926nvvVCb','92620JsILiU','2352265OqSgdO','cwd','message','项目模板复制完成','12184432ZxWjMo','now','4774427CVnydz','579085ccEMhn','12OiAmRc','resolve','2YFUuaK','success','10552338leHIYj','项目模板复制失败'];a137_0x4afb=function(){return _0x2182ba;};return a137_0x4afb();}export async function copyProjectTemplate(_0x317e37){const _0x573451=a137_0x49c0,_0x5378b3=Date[_0x573451(0x1ff)](),_0x26059d=a137_0x50fc32[_0x573451(0x1f1)](process[_0x573451(0x1fb)](),_0x317e37);try{logger[_0x573451(0x1f6)](_0x573451(0x1f7),'开始复制项目模板',{'projectCode':_0x317e37,'templateDir':templateDir}),await copyDirectory(templateDir,_0x26059d);const _0x52499d=Date['now']()-_0x5378b3;logger[_0x573451(0x1f3)](_0x573451(0x1f7),_0x573451(0x1fd),_0x52499d,{'projectCode':_0x317e37});}catch(_0x2f3f77){const _0x434c0d=Date['now']()-_0x5378b3;logger['error'](_0x573451(0x1f7),_0x573451(0x1f5),{'projectCode':_0x317e37,'error':_0x2f3f77 instanceof Error?_0x2f3f77[_0x573451(0x1fc)]:String(_0x2f3f77),'duration':_0x434c0d});throw _0x2f3f77;}return formatElapsed(_0x5378b3);}
1
+ (function(_0x84a9b6,_0x3de8dc){const _0x4ae4f3=a137_0x59d3,_0x22f101=_0x84a9b6();while(!![]){try{const _0x1712b2=parseInt(_0x4ae4f3(0xaa))/0x1*(-parseInt(_0x4ae4f3(0xa3))/0x2)+parseInt(_0x4ae4f3(0xa8))/0x3+-parseInt(_0x4ae4f3(0x9a))/0x4*(-parseInt(_0x4ae4f3(0x9d))/0x5)+parseInt(_0x4ae4f3(0xa4))/0x6*(-parseInt(_0x4ae4f3(0x9f))/0x7)+parseInt(_0x4ae4f3(0x9c))/0x8*(-parseInt(_0x4ae4f3(0x9b))/0x9)+parseInt(_0x4ae4f3(0xa0))/0xa+-parseInt(_0x4ae4f3(0xa2))/0xb*(-parseInt(_0x4ae4f3(0x9e))/0xc);if(_0x1712b2===_0x3de8dc)break;else _0x22f101['push'](_0x22f101['shift']());}catch(_0x157faf){_0x22f101['push'](_0x22f101['shift']());}}}(a137_0x4b1a,0x6db82));import a137_0x517d24 from'node:path';function a137_0x59d3(_0xb362ab,_0x9daf24){_0xb362ab=_0xb362ab-0x99;const _0x4b1a12=a137_0x4b1a();let _0x59d353=_0x4b1a12[_0xb362ab];return _0x59d353;}import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a137_0x4b1a(){const _0x38b223=['543635CiaKiJ','108uVDgoG','77YdvHcc','1055160nwwTgf','error','16621HNSelU','4SyZbUA','353196xmBCsk','success','info','copy','529623CDqJrL','now','13821yvfZlp','resolve','message','cwd','开始复制项目模板','项目模板复制完成','32BaqtfM','63QgWSND','46736UQIYuN'];a137_0x4b1a=function(){return _0x38b223;};return a137_0x4b1a();}import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x1d6562){const _0x3b959c=a137_0x59d3,_0x194b6=Date[_0x3b959c(0xa9)](),_0x45d509=a137_0x517d24[_0x3b959c(0xab)](process[_0x3b959c(0xad)](),_0x1d6562);try{logger[_0x3b959c(0xa6)]('copy',_0x3b959c(0xae),{'projectCode':_0x1d6562,'templateDir':templateDir}),await copyDirectory(templateDir,_0x45d509);const _0x10e617=Date[_0x3b959c(0xa9)]()-_0x194b6;logger[_0x3b959c(0xa5)](_0x3b959c(0xa7),_0x3b959c(0x99),_0x10e617,{'projectCode':_0x1d6562});}catch(_0x3d57f3){const _0x5aaf91=Date[_0x3b959c(0xa9)]()-_0x194b6;logger[_0x3b959c(0xa1)](_0x3b959c(0xa7),'项目模板复制失败',{'projectCode':_0x1d6562,'error':_0x3d57f3 instanceof Error?_0x3d57f3[_0x3b959c(0xac)]:String(_0x3d57f3),'duration':_0x5aaf91});throw _0x3d57f3;}return formatElapsed(_0x194b6);}
@@ -1 +1 @@
1
- (function(_0x55c8ab,_0x566169){const _0x4b2c90=a138_0x456f,_0x40e2fb=_0x55c8ab();while(!![]){try{const _0x284b20=-parseInt(_0x4b2c90(0x15b))/0x1*(parseInt(_0x4b2c90(0x150))/0x2)+-parseInt(_0x4b2c90(0x15f))/0x3*(parseInt(_0x4b2c90(0x156))/0x4)+-parseInt(_0x4b2c90(0x152))/0x5+-parseInt(_0x4b2c90(0x158))/0x6+parseInt(_0x4b2c90(0x151))/0x7*(-parseInt(_0x4b2c90(0x161))/0x8)+-parseInt(_0x4b2c90(0x15a))/0x9*(parseInt(_0x4b2c90(0x155))/0xa)+-parseInt(_0x4b2c90(0x14c))/0xb*(-parseInt(_0x4b2c90(0x160))/0xc);if(_0x284b20===_0x566169)break;else _0x40e2fb['push'](_0x40e2fb['shift']());}catch(_0xd36116){_0x40e2fb['push'](_0x40e2fb['shift']());}}}(a138_0x10d5,0x2a2ad));function a138_0x10d5(){const _0x34a64d=['format','--write','开始格式化代码','2OhQSNj','301574souWGj','17925pVPfbb','cwd','代码格式化完成','1702430SroIHF','64FMhtGU','npx','984780Gnirpk','now','18cbWMjN','328003uFtRyi','info','success','message','33585GuLsvL','801972BleZMe','40AjQfnr','231zWAEXX'];a138_0x10d5=function(){return _0x34a64d;};return a138_0x10d5();}import a138_0x1325e1 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a138_0x456f(_0x36259c,_0x5edfca){_0x36259c=_0x36259c-0x14c;const _0x10d550=a138_0x10d5();let _0x456fb4=_0x10d550[_0x36259c];return _0x456fb4;}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x1ee6ce){const _0x377780=a138_0x456f,_0x25a1e2=Date[_0x377780(0x159)](),_0x2afe7e=a138_0x1325e1['resolve'](process[_0x377780(0x153)](),_0x1ee6ce);try{logger[_0x377780(0x15c)](_0x377780(0x14d),_0x377780(0x14f),{'projectCode':_0x1ee6ce}),await execa(resolveNpmBin(_0x377780(0x157)),['prettier',_0x377780(0x14e),'.'],{'cwd':_0x2afe7e});const _0x13717a=Date[_0x377780(0x159)]()-_0x25a1e2;logger[_0x377780(0x15d)]('format',_0x377780(0x154),_0x13717a,{'projectCode':_0x1ee6ce});}catch(_0x13ae36){const _0x1e4f5f=Date[_0x377780(0x159)]()-_0x25a1e2;logger['error'](_0x377780(0x14d),'代码格式化失败',{'projectCode':_0x1ee6ce,'error':_0x13ae36 instanceof Error?_0x13ae36[_0x377780(0x15e)]:String(_0x13ae36),'duration':_0x1e4f5f});throw _0x13ae36;}return formatElapsed(_0x25a1e2);}
1
+ (function(_0x18969d,_0x1657e5){const _0x47c2f9=a138_0x40d5,_0x1b3eb8=_0x18969d();while(!![]){try{const _0x160bdb=parseInt(_0x47c2f9(0x9c))/0x1+parseInt(_0x47c2f9(0x90))/0x2*(parseInt(_0x47c2f9(0x98))/0x3)+-parseInt(_0x47c2f9(0x9d))/0x4*(-parseInt(_0x47c2f9(0x92))/0x5)+-parseInt(_0x47c2f9(0x91))/0x6*(parseInt(_0x47c2f9(0x8c))/0x7)+-parseInt(_0x47c2f9(0x93))/0x8+-parseInt(_0x47c2f9(0x9a))/0x9*(-parseInt(_0x47c2f9(0x96))/0xa)+-parseInt(_0x47c2f9(0xa0))/0xb;if(_0x160bdb===_0x1657e5)break;else _0x1b3eb8['push'](_0x1b3eb8['shift']());}catch(_0x7d389e){_0x1b3eb8['push'](_0x1b3eb8['shift']());}}}(a138_0x60c7,0xbe423));import a138_0x1979e5 from'node:path';function a138_0x60c7(){const _0x294468=['422407slNCFe','188564EYsTca','info','npx','3182223nVOzXV','cwd','5320588gSwVpM','resolve','format','代码格式化完成','906322ATaZBl','6RrlMyM','125JmpPsR','9625392SqToGf','--write','代码格式化失败','2622980IjWJDw','开始格式化代码','6EJwhdQ','prettier','18yFvaxV','message'];a138_0x60c7=function(){return _0x294468;};return a138_0x60c7();}import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';function a138_0x40d5(_0x5990f7,_0x5b0e88){_0x5990f7=_0x5990f7-0x8c;const _0x60c73c=a138_0x60c7();let _0x40d54a=_0x60c73c[_0x5990f7];return _0x40d54a;}export async function formatProjectCode(_0x216d4d){const _0x15d4f2=a138_0x40d5,_0x47477c=Date['now'](),_0x498ceb=a138_0x1979e5[_0x15d4f2(0x8d)](process[_0x15d4f2(0xa1)](),_0x216d4d);try{logger[_0x15d4f2(0x9e)](_0x15d4f2(0x8e),_0x15d4f2(0x97),{'projectCode':_0x216d4d}),await execa(resolveNpmBin(_0x15d4f2(0x9f)),[_0x15d4f2(0x99),_0x15d4f2(0x94),'.'],{'cwd':_0x498ceb});const _0x4bf212=Date['now']()-_0x47477c;logger['success'](_0x15d4f2(0x8e),_0x15d4f2(0x8f),_0x4bf212,{'projectCode':_0x216d4d});}catch(_0x51f316){const _0x4bf775=Date['now']()-_0x47477c;logger['error'](_0x15d4f2(0x8e),_0x15d4f2(0x95),{'projectCode':_0x216d4d,'error':_0x51f316 instanceof Error?_0x51f316[_0x15d4f2(0x9b)]:String(_0x51f316),'duration':_0x4bf775});throw _0x51f316;}return formatElapsed(_0x47477c);}
@@ -1 +1 @@
1
- function a139_0x7c6d(){const _0x377258=['install','19173xthqpk','8140099PsczsR','142SabJjq','https://registry.npmmirror.com','3TcwCGZ','cwd','依赖安装完成','1302okmxVh','开始安装依赖','info','7138390OpFekk','8304575bbDYkc','5917640SQQZDx','12lbSIwm','423UZKRSG','13588UGGFop','71992UEGBRw','--registry','now'];a139_0x7c6d=function(){return _0x377258;};return a139_0x7c6d();}function a139_0x28aa(_0x79f79a,_0x20a476){_0x79f79a=_0x79f79a-0x179;const _0x7c6d35=a139_0x7c6d();let _0x28aaa3=_0x7c6d35[_0x79f79a];return _0x28aaa3;}(function(_0x390e5f,_0x1c22bf){const _0x3e33a0=a139_0x28aa,_0x1745c6=_0x390e5f();while(!![]){try{const _0x30a157=parseInt(_0x3e33a0(0x181))/0x1*(-parseInt(_0x3e33a0(0x188))/0x2)+parseInt(_0x3e33a0(0x18a))/0x3*(parseInt(_0x3e33a0(0x17e))/0x4)+parseInt(_0x3e33a0(0x17d))/0x5+parseInt(_0x3e33a0(0x179))/0x6*(parseInt(_0x3e33a0(0x186))/0x7)+-parseInt(_0x3e33a0(0x182))/0x8*(parseInt(_0x3e33a0(0x180))/0x9)+-parseInt(_0x3e33a0(0x17c))/0xa+-parseInt(_0x3e33a0(0x187))/0xb*(parseInt(_0x3e33a0(0x17f))/0xc);if(_0x30a157===_0x1c22bf)break;else _0x1745c6['push'](_0x1745c6['shift']());}catch(_0x54ab27){_0x1745c6['push'](_0x1745c6['shift']());}}}(a139_0x7c6d,0xda0d3));import a139_0x1c348b from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x161126){const _0x221798=a139_0x28aa,_0x3b4409=Date[_0x221798(0x184)](),_0x453756=a139_0x1c348b['resolve'](process[_0x221798(0x18b)](),_0x161126);try{logger[_0x221798(0x17b)](_0x221798(0x185),_0x221798(0x17a),{'projectCode':_0x161126,'registry':_0x221798(0x189)}),await execa(resolveNpmBin('npm'),[_0x221798(0x185),_0x221798(0x183),_0x221798(0x189)],{'cwd':_0x453756});const _0x4337bb=Date[_0x221798(0x184)]()-_0x3b4409;logger['success']('install',_0x221798(0x18c),_0x4337bb,{'projectCode':_0x161126});}catch(_0x6b4829){const _0x1f49c5=Date['now']()-_0x3b4409;logger['error'](_0x221798(0x185),'依赖安装失败',{'projectCode':_0x161126,'error':_0x6b4829 instanceof Error?_0x6b4829['message']:String(_0x6b4829),'duration':_0x1f49c5});throw _0x6b4829;}return formatElapsed(_0x3b4409);}
1
+ (function(_0x466cc4,_0x27fc39){const _0x5ef084=a139_0x4f9b,_0x34366e=_0x466cc4();while(!![]){try{const _0xc52ac9=-parseInt(_0x5ef084(0x1a7))/0x1*(parseInt(_0x5ef084(0x1a5))/0x2)+parseInt(_0x5ef084(0x1af))/0x3+parseInt(_0x5ef084(0x1ae))/0x4+-parseInt(_0x5ef084(0x1a4))/0x5+-parseInt(_0x5ef084(0x1b3))/0x6+parseInt(_0x5ef084(0x1ad))/0x7+-parseInt(_0x5ef084(0x1a8))/0x8*(-parseInt(_0x5ef084(0x1b2))/0x9);if(_0xc52ac9===_0x27fc39)break;else _0x34366e['push'](_0x34366e['shift']());}catch(_0x4b7661){_0x34366e['push'](_0x34366e['shift']());}}}(a139_0x4fd3,0x73f19));import a139_0x385e8b from'node:path';function a139_0x4f9b(_0x535c87,_0x376828){_0x535c87=_0x535c87-0x1a4;const _0x4fd332=a139_0x4fd3();let _0x4f9b07=_0x4fd332[_0x535c87];return _0x4f9b07;}import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';function a139_0x4fd3(){const _0x407bf5=['now','install','--registry','3098220EPthIS','150jrYXQm','info','6046HYTKAO','8BitujC','message','https://registry.npmmirror.com','依赖安装失败','cwd','1282792awykDx','1297092aizoZn','1252962YeGyRa','success','error','7018551sJsirU','942138qlkXsG'];a139_0x4fd3=function(){return _0x407bf5;};return a139_0x4fd3();}export async function installDependencies(_0x2f0cda){const _0x5d8552=a139_0x4f9b,_0x1d2d91=Date[_0x5d8552(0x1b4)](),_0x5d41cc=a139_0x385e8b['resolve'](process[_0x5d8552(0x1ac)](),_0x2f0cda);try{logger[_0x5d8552(0x1a6)]('install','开始安装依赖',{'projectCode':_0x2f0cda,'registry':_0x5d8552(0x1aa)}),await execa(resolveNpmBin('npm'),['install',_0x5d8552(0x1b6),_0x5d8552(0x1aa)],{'cwd':_0x5d41cc});const _0x1542d5=Date[_0x5d8552(0x1b4)]()-_0x1d2d91;logger[_0x5d8552(0x1b0)](_0x5d8552(0x1b5),'依赖安装完成',_0x1542d5,{'projectCode':_0x2f0cda});}catch(_0xdf9a03){const _0x3be0c6=Date[_0x5d8552(0x1b4)]()-_0x1d2d91;logger[_0x5d8552(0x1b1)](_0x5d8552(0x1b5),_0x5d8552(0x1ab),{'projectCode':_0x2f0cda,'error':_0xdf9a03 instanceof Error?_0xdf9a03[_0x5d8552(0x1a9)]:String(_0xdf9a03),'duration':_0x3be0c6});throw _0xdf9a03;}return formatElapsed(_0x1d2d91);}
@@ -1 +1 @@
1
- const a140_0x1eb753=a140_0x1da1;(function(_0x40a6c6,_0x56e5b9){const _0x3d1839=a140_0x1da1,_0x386e73=_0x40a6c6();while(!![]){try{const _0x512034=parseInt(_0x3d1839(0x152))/0x1+parseInt(_0x3d1839(0x155))/0x2+parseInt(_0x3d1839(0x143))/0x3+parseInt(_0x3d1839(0x15a))/0x4*(-parseInt(_0x3d1839(0x162))/0x5)+-parseInt(_0x3d1839(0x13f))/0x6+-parseInt(_0x3d1839(0x163))/0x7*(-parseInt(_0x3d1839(0x156))/0x8)+-parseInt(_0x3d1839(0x160))/0x9*(-parseInt(_0x3d1839(0x145))/0xa);if(_0x512034===_0x56e5b9)break;else _0x386e73['push'](_0x386e73['shift']());}catch(_0x5f405a){_0x386e73['push'](_0x386e73['shift']());}}}(a140_0x2e4f,0x9c55c));function a140_0x1da1(_0x40644f,_0x55591c){_0x40644f=_0x40644f-0x13e;const _0x2e4f92=a140_0x2e4f();let _0x1da166=_0x2e4f92[_0x40644f];return _0x1da166;}function a140_0x2e4f(){const _0x2d9b5d=['trim','../../commands/project/create/main.js','create','87801rLndxL','boolean','Target\x20environment','940TBVKAT','176584hapEBU','project-name','project','cookie','5408SzTqGe','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','Project\x20name','\x20workspace\x20init','str','name','885375HkDIqn','nonInteractive','3640ChxnXK','77pZEQHE','args','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','5169630cOpqCK','2026-07','Skip\x20confirmation\x20prompt','App\x20code\x20to\x20initialize','2923905zuRQDg','env','120ExzYKk','string','appcode','Usage:\x20','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','write','bool','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','Auto-confirm\x20prompts','yes'];a140_0x2e4f=function(){return _0x2d9b5d;};return a140_0x2e4f();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';const initFlags=[{'name':'appcode','type':a140_0x1eb753(0x146),'description':a140_0x1eb753(0x142)},{'name':'env','type':a140_0x1eb753(0x146),'description':a140_0x1eb753(0x154)},{'name':a140_0x1eb753(0x14e),'type':a140_0x1eb753(0x153),'description':a140_0x1eb753(0x14d),'default':![]}],createFlags=[{'name':a140_0x1eb753(0x15f),'type':a140_0x1eb753(0x146),'description':a140_0x1eb753(0x15c)},{'name':a140_0x1eb753(0x144),'type':'string','description':a140_0x1eb753(0x154)},{'name':a140_0x1eb753(0x147),'type':a140_0x1eb753(0x146),'description':a140_0x1eb753(0x15b)}],upgradeFlags=[{'name':a140_0x1eb753(0x14e),'type':a140_0x1eb753(0x153),'description':a140_0x1eb753(0x141),'default':![]}];export const projectDefinitions=[{'service':'project','command':'init','description':a140_0x1eb753(0x13e),'risk':a140_0x1eb753(0x14a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a140_0x1eb753(0x15d),'since':a140_0x1eb753(0x140)},'flags':initFlags,async 'execute'(_0x3df17d){const _0x47b24c=a140_0x1eb753;return await initConfig({'appcode':_0x3df17d[_0x47b24c(0x15e)](_0x47b24c(0x147))||undefined,'env':_0x3df17d[_0x47b24c(0x15e)](_0x47b24c(0x144))||undefined,'autoYes':_0x3df17d[_0x47b24c(0x14b)](_0x47b24c(0x14e))}),{'ok':!![]};}},{'service':a140_0x1eb753(0x158),'command':a140_0x1eb753(0x151),'description':'Create\x20a\x20new\x20project','risk':a140_0x1eb753(0x14a),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a140_0x1eb753(0x157),'description':a140_0x1eb753(0x149),'required':![]}],'flags':createFlags,async 'execute'(_0x59183c){const _0x479984=a140_0x1eb753,{createApp:_0x75d615}=await import(_0x479984(0x150)),{createProjectNonInteractive:_0x12c9f0}=await import('../../commands/project/create/non-interactive.js'),_0x35d2a4=_0x59183c['str'](_0x479984(0x15f))[_0x479984(0x14f)]()||_0x59183c[_0x479984(0x164)][0x0]?.['trim'](),_0x5c3645=_0x59183c[_0x479984(0x15e)](_0x479984(0x144))||undefined,_0x1c5540=_0x59183c['str'](_0x479984(0x147))||undefined;if(_0x59183c[_0x479984(0x161)]){if(!_0x35d2a4)throw CliErrors['validation']('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.',_0x479984(0x148)+CLI_BIN_NAME+'\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]');await _0x12c9f0(_0x35d2a4,_0x5c3645,_0x1c5540,_0x59183c['cookie']);}else await _0x75d615({'projectCode':_0x35d2a4,'appCode':_0x1c5540,'env':_0x5c3645,'cookie':_0x59183c[_0x479984(0x159)]});return{'ok':!![]};}},{'service':a140_0x1eb753(0x158),'command':'upgrade','description':a140_0x1eb753(0x14c),'risk':a140_0x1eb753(0x14a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x3752b2){const _0x17ac64=a140_0x1eb753;return await upgradeApp(_0x3752b2[_0x17ac64(0x161)],{'yes':_0x3752b2['bool'](_0x17ac64(0x14e))}),{'ok':!![]};}}];
1
+ const a140_0x586330=a140_0x2d1b;(function(_0x44cf20,_0x96fc1c){const _0x5f4bb1=a140_0x2d1b,_0x14e958=_0x44cf20();while(!![]){try{const _0x2d25d8=-parseInt(_0x5f4bb1(0x8b))/0x1+-parseInt(_0x5f4bb1(0x91))/0x2+-parseInt(_0x5f4bb1(0x82))/0x3*(-parseInt(_0x5f4bb1(0x9c))/0x4)+parseInt(_0x5f4bb1(0x80))/0x5+-parseInt(_0x5f4bb1(0x7e))/0x6+parseInt(_0x5f4bb1(0x98))/0x7+-parseInt(_0x5f4bb1(0x85))/0x8*(-parseInt(_0x5f4bb1(0x78))/0x9);if(_0x2d25d8===_0x96fc1c)break;else _0x14e958['push'](_0x14e958['shift']());}catch(_0x59a315){_0x14e958['push'](_0x14e958['shift']());}}}(a140_0x4901,0x7185a));function a140_0x4901(){const _0x5e4641=['name','791359XPZPCx','boolean','Skip\x20confirmation\x20prompt','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','\x20workspace\x20init','upgrade','973806ZRhHth','string','yes','trim','appcode','env','../../commands/project/create/main.js','318892vUjXVX','project','str','bool','4qvhorf','2026-07','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','423jrwKRn','Create\x20a\x20new\x20project','nonInteractive','Project\x20name','cookie','project-name','1155690UbPWcE','args','362650qvnvGD','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','1967529DWtNuE','Target\x20environment','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','197776hXYxiU','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','init','Auto-confirm\x20prompts','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)'];a140_0x4901=function(){return _0x5e4641;};return a140_0x4901();}function a140_0x2d1b(_0x401672,_0x34e080){_0x401672=_0x401672-0x76;const _0x490178=a140_0x4901();let _0x2d1b0c=_0x490178[_0x401672];return _0x2d1b0c;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';const initFlags=[{'name':a140_0x586330(0x95),'type':a140_0x586330(0x92),'description':'App\x20code\x20to\x20initialize'},{'name':a140_0x586330(0x96),'type':a140_0x586330(0x92),'description':a140_0x586330(0x83)},{'name':a140_0x586330(0x93),'type':a140_0x586330(0x8c),'description':a140_0x586330(0x88),'default':![]}],createFlags=[{'name':a140_0x586330(0x8a),'type':a140_0x586330(0x92),'description':a140_0x586330(0x7b)},{'name':a140_0x586330(0x96),'type':a140_0x586330(0x92),'description':a140_0x586330(0x83)},{'name':a140_0x586330(0x95),'type':a140_0x586330(0x92),'description':a140_0x586330(0x77)}],upgradeFlags=[{'name':a140_0x586330(0x93),'type':'boolean','description':a140_0x586330(0x8d),'default':![]}];export const projectDefinitions=[{'service':'project','command':a140_0x586330(0x87),'description':a140_0x586330(0x86),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a140_0x586330(0x8f),'since':a140_0x586330(0x76)},'flags':initFlags,async 'execute'(_0x328b4b){const _0x4610b3=a140_0x586330;return await initConfig({'appcode':_0x328b4b['str']('appcode')||undefined,'env':_0x328b4b[_0x4610b3(0x9a)](_0x4610b3(0x96))||undefined,'autoYes':_0x328b4b[_0x4610b3(0x9b)](_0x4610b3(0x93))}),{'ok':!![]};}},{'service':'project','command':'create','description':a140_0x586330(0x79),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a140_0x586330(0x7d),'description':a140_0x586330(0x89),'required':![]}],'flags':createFlags,async 'execute'(_0x4cc76f){const _0x266711=a140_0x586330,{createApp:_0x34e0c2}=await import(_0x266711(0x97)),{createProjectNonInteractive:_0x249053}=await import('../../commands/project/create/non-interactive.js'),_0x4d1f48=_0x4cc76f[_0x266711(0x9a)]('name')[_0x266711(0x94)]()||_0x4cc76f[_0x266711(0x7f)][0x0]?.[_0x266711(0x94)](),_0x4025e8=_0x4cc76f[_0x266711(0x9a)](_0x266711(0x96))||undefined,_0x4d7b34=_0x4cc76f['str'](_0x266711(0x95))||undefined;if(_0x4cc76f[_0x266711(0x7a)]){if(!_0x4d1f48)throw CliErrors['validation'](_0x266711(0x8e),'Usage:\x20'+CLI_BIN_NAME+_0x266711(0x84));await _0x249053(_0x4d1f48,_0x4025e8,_0x4d7b34,_0x4cc76f[_0x266711(0x7c)]);}else await _0x34e0c2({'projectCode':_0x4d1f48,'appCode':_0x4d7b34,'env':_0x4025e8,'cookie':_0x4cc76f[_0x266711(0x7c)]});return{'ok':!![]};}},{'service':a140_0x586330(0x99),'command':a140_0x586330(0x90),'description':a140_0x586330(0x81),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x1917e1){const _0x387859=a140_0x586330;return await upgradeApp(_0x1917e1['nonInteractive'],{'yes':_0x1917e1[_0x387859(0x9b)](_0x387859(0x93))}),{'ok':!![]};}}];
@@ -1 +1 @@
1
- (function(_0x23c2cf,_0x218d55){const _0x235e6e=a141_0x58a0,_0x39fb52=_0x23c2cf();while(!![]){try{const _0x352f4b=-parseInt(_0x235e6e(0x12f))/0x1+-parseInt(_0x235e6e(0x144))/0x2*(parseInt(_0x235e6e(0x127))/0x3)+parseInt(_0x235e6e(0x118))/0x4*(parseInt(_0x235e6e(0x11c))/0x5)+-parseInt(_0x235e6e(0x11f))/0x6+-parseInt(_0x235e6e(0x11b))/0x7*(parseInt(_0x235e6e(0x112))/0x8)+parseInt(_0x235e6e(0x117))/0x9+parseInt(_0x235e6e(0x141))/0xa;if(_0x352f4b===_0x218d55)break;else _0x39fb52['push'](_0x39fb52['shift']());}catch(_0xf9308b){_0x39fb52['push'](_0x39fb52['shift']());}}}(a141_0x3298,0x60aca));import{readFileSync,existsSync,renameSync}from'node:fs';function a141_0x58a0(_0x32e072,_0xfb1660){_0x32e072=_0x32e072-0x111;const _0x32982f=a141_0x3298();let _0x58a062=_0x32982f[_0x32e072];return _0x58a062;}function a141_0x3298(){const _0x117fac=['trim','appcode','info','\x20api\x20generate\x27\x20and\x20\x27','21AJkEuL','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','toLocaleString','\x20→\x20.rabetbase.json','yellow','log','setLogPath','../..','260688wqdMOM','gray','parse','\x20\x20appcode:\x20','cwd','apps','Invalid\x20App\x20Code','keys','Migration\x20cancelled.\x20Run\x20`','green','✓\x20Upgraded\x20','bold','defaultApp','1.0.0','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','init','\x20api\x20pull\x27','join','9843370gdNjNv','Please\x20enter\x20App\x20Code:','\x20\x20Apps:\x20','61596akGXoz','从旧配置文件升级成功','632ITAwRW','version','Upgrade\x20it\x20to\x20','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','.bak','4352274sWHzPJ','12252CZJLdO','production','\x20\x20Default:\x20','52367sVXwcI','110LMGHtf','env','utf8','432348RXEBHO','cyan','string','app'];a141_0x3298=function(){return _0x117fac;};return a141_0x3298();}import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a141_0x162db1 from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x464843){const _0x5bd512=a141_0x58a0,{appcode:_0x2385db,env:_0xd642e9,autoYes:_0xb0edf4}=_0x464843,_0xd5cebe=process[_0x5bd512(0x133)]();if(getProjectConfigPath())throw new Error(_0x5bd512(0x13d));let _0xda2fcf;for(const _0x434d2f of LEGACY_CONFIG_NAMES){const _0x44bf9a=resolve(_0xd5cebe,_0x434d2f);if(existsSync(_0x44bf9a)){_0xda2fcf=_0x44bf9a;break;}}if(_0xda2fcf){let _0x2d34f8={};try{_0x2d34f8=JSON['parse'](readFileSync(_0xda2fcf,_0x5bd512(0x11e)));}catch{}const _0x42d16b=basename(_0xda2fcf),_0x53fe5c=_0x2d34f8?.[_0x5bd512(0x124)]||_0x2d34f8?.['app'];let _0x3c0e3e=_0xb0edf4;!_0xb0edf4&&(console[_0x5bd512(0x12c)](a141_0x162db1[_0x5bd512(0x12b)](_0x5bd512(0x128)+a141_0x162db1[_0x5bd512(0x13a)](_0x42d16b))),_0x53fe5c&&console[_0x5bd512(0x12c)](a141_0x162db1[_0x5bd512(0x120)](_0x5bd512(0x132)+_0x53fe5c)),_0x3c0e3e=await confirm({'message':_0x5bd512(0x114)+a141_0x162db1['bold']('.rabetbase.json')+'?\x20(Old\x20file\x20→\x20*.bak)','default':!![]}));if(!_0x3c0e3e){console['log'](_0x5bd512(0x137)+CLI_BIN_NAME+'\x20workspace\x20init`\x20to\x20start\x20fresh.');return;}const _0x55f872=resolve(_0xd5cebe,NEW_CONFIG_NAME),_0x30aa65=getCliVersionFromPkg(),_0xda2b44=readRawConfig(),_0xee15ce=_0x2385db||(typeof _0x2d34f8?.[_0x5bd512(0x124)]===_0x5bd512(0x121)?_0x2d34f8[_0x5bd512(0x124)]:undefined)||(typeof _0x2d34f8?.['app']==='string'?_0x2d34f8[_0x5bd512(0x122)]:undefined)||await askAppcode(),_0x43cbc2=typeof _0x2d34f8?.['env']===_0x5bd512(0x121)?_0x2d34f8[_0x5bd512(0x11d)]:typeof _0xda2b44['env']===_0x5bd512(0x121)?_0xda2b44[_0x5bd512(0x11d)]:_0x5bd512(0x119),_0x11b8f2=buildCanonicalProjectConfig({..._0xda2b44,..._0x2d34f8},{'appCodes':[_0xee15ce],'env':_0x43cbc2,'metadata':{'version':_0x30aa65,'migratedAt':new Date()['toLocaleString'](),'migratedFrom':_0xda2fcf}});writeConfigFile(_0x55f872,_0x11b8f2);const _0x11e3aa=_0xda2fcf+_0x5bd512(0x116);renameSync(_0xda2fcf,_0x11e3aa),logger[_0x5bd512(0x12d)](_0xd5cebe),logger[_0x5bd512(0x125)](_0x5bd512(0x13e),_0x5bd512(0x111),{'from':_0xda2fcf,'to':_0x55f872,'appcode':_0xee15ce,'env':_0x11b8f2[_0x5bd512(0x11d)]}),console[_0x5bd512(0x12c)](a141_0x162db1['green'](_0x5bd512(0x139)+_0x42d16b+_0x5bd512(0x12a))),console[_0x5bd512(0x12c)](a141_0x162db1[_0x5bd512(0x120)]('\x20\x20Apps:\x20'+Object['keys'](_0x11b8f2[_0x5bd512(0x134)]||{})[_0x5bd512(0x140)](',\x20'))),console['log'](a141_0x162db1[_0x5bd512(0x120)](_0x5bd512(0x11a)+_0x11b8f2[_0x5bd512(0x13b)])),console[_0x5bd512(0x12c)](a141_0x162db1[_0x5bd512(0x130)]('\x20\x20Old\x20file\x20backed\x20up\x20as\x20'+_0x42d16b+_0x5bd512(0x116)));return;}const _0x264da2=_0x2385db||await askAppcode(),_0x2583fa=resolve(_0xd5cebe,NEW_CONFIG_NAME),_0x732d0b=getCliVersionFromPkg(),_0x402921=readRawConfig(),_0x2a8775=typeof _0x402921[_0x5bd512(0x11d)]==='string'?_0x402921[_0x5bd512(0x11d)]:undefined,_0x5df00a=buildCanonicalProjectConfig({},{'appCodes':[_0x264da2],'env':_0xd642e9||_0x2a8775||_0x5bd512(0x119),'metadata':{'version':_0x732d0b,'createdAt':new Date()[_0x5bd512(0x129)]()}});writeConfigFile(_0x2583fa,_0x5df00a),logger[_0x5bd512(0x12d)](_0xd5cebe),logger[_0x5bd512(0x125)]('init','初始化项目配置文件成功',{'appcode':_0x264da2,'env':_0x5df00a['env'],'version':_0x5df00a[_0x5bd512(0x113)],'configPath':_0x2583fa}),console['log'](a141_0x162db1[_0x5bd512(0x138)]('✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory')),console['log'](a141_0x162db1[_0x5bd512(0x120)](_0x5bd512(0x143)+Object[_0x5bd512(0x136)](_0x5df00a['apps']||{})[_0x5bd512(0x140)](',\x20'))),console[_0x5bd512(0x12c)](a141_0x162db1['cyan'](_0x5bd512(0x11a)+_0x5df00a['defaultApp'])),console[_0x5bd512(0x12c)](_0x5bd512(0x115)+CLI_BIN_NAME+_0x5bd512(0x126)+CLI_BIN_NAME+_0x5bd512(0x13f));}function askAppcode(){const _0x279d10=a141_0x58a0;return input({'message':_0x279d10(0x142),'validate':_0x2eeb93=>{const _0x503fa0=_0x279d10;if(!_0x2eeb93[_0x503fa0(0x123)]())return'App\x20Code\x20cannot\x20be\x20empty';const {valid:_0x1af7c2,message:_0x906cf3}=validateAppcode(_0x2eeb93[_0x503fa0(0x123)]());return _0x1af7c2||_0x906cf3||_0x503fa0(0x135);}});}function getCliVersionFromPkg(){const _0x942aad=a141_0x58a0;try{const _0x2d15b9=fileURLToPath(import.meta.url),_0x4f46ad=resolve(dirname(_0x2d15b9),_0x942aad(0x12e)),_0x5c8ffc=JSON[_0x942aad(0x131)](readFileSync(resolve(_0x4f46ad,'package.json'),_0x942aad(0x11e)));return _0x5c8ffc[_0x942aad(0x113)]||_0x942aad(0x13c);}catch{return'1.0.0';}}
1
+ function a141_0x1bb0(_0x2b5edf,_0x30c851){_0x2b5edf=_0x2b5edf-0x153;const _0x3cd2ef=a141_0x3cd2();let _0x1bb0dd=_0x3cd2ef[_0x2b5edf];return _0x1bb0dd;}(function(_0x29d06e,_0x5f4c3f){const _0x529888=a141_0x1bb0,_0x2c695b=_0x29d06e();while(!![]){try{const _0x456c8c=-parseInt(_0x529888(0x159))/0x1*(-parseInt(_0x529888(0x162))/0x2)+-parseInt(_0x529888(0x184))/0x3*(parseInt(_0x529888(0x174))/0x4)+parseInt(_0x529888(0x16b))/0x5*(-parseInt(_0x529888(0x15a))/0x6)+-parseInt(_0x529888(0x15c))/0x7*(parseInt(_0x529888(0x15e))/0x8)+parseInt(_0x529888(0x15d))/0x9+-parseInt(_0x529888(0x17c))/0xa+-parseInt(_0x529888(0x180))/0xb*(-parseInt(_0x529888(0x183))/0xc);if(_0x456c8c===_0x5f4c3f)break;else _0x2c695b['push'](_0x2c695b['shift']());}catch(_0x274040){_0x2c695b['push'](_0x2c695b['shift']());}}}(a141_0x3cd2,0x92966));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a141_0x1ebee7 from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';function a141_0x3cd2(){const _0x2d9338=['apps','join','version','?\x20(Old\x20file\x20→\x20*.bak)','Invalid\x20App\x20Code','\x20api\x20generate\x27\x20and\x20\x27','40eDhyUL','yellow','\x20\x20Default:\x20','App\x20Code\x20cannot\x20be\x20empty','keys','Migration\x20cancelled.\x20Run\x20`','.rabetbase.json','\x20\x20Apps:\x20','7506710OOzQGY','log','utf8','\x20api\x20pull\x27','1221sAVGfH','setLogPath','✓\x20Upgraded\x20','211644LEbKLX','158973kUMqvF','toLocaleString','\x20→\x20.rabetbase.json','env','defaultApp','green','Please\x20enter\x20App\x20Code:','25469RZZrCT','54ivaxSm','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','630AhDnMA','8402544hGEMyo','99648eSPWaA','appcode','parse','.bak','14AqSzCr','app','cyan','string','bold','info','../..','1.0.0','package.json','37535XXDGMD','trim','init'];a141_0x3cd2=function(){return _0x2d9338;};return a141_0x3cd2();}export async function initConfig(_0x57b6ca){const _0x44a552=a141_0x1bb0,{appcode:_0x863a08,env:_0x1fe7d9,autoYes:_0x467b6b}=_0x57b6ca,_0x2d48a6=process['cwd']();if(getProjectConfigPath())throw new Error('.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.');let _0x1c6607;for(const _0x597abc of LEGACY_CONFIG_NAMES){const _0x564ec4=resolve(_0x2d48a6,_0x597abc);if(existsSync(_0x564ec4)){_0x1c6607=_0x564ec4;break;}}if(_0x1c6607){let _0x2825f5={};try{_0x2825f5=JSON[_0x44a552(0x160)](readFileSync(_0x1c6607,_0x44a552(0x17e)));}catch{}const _0xb9b0b2=basename(_0x1c6607),_0x402e27=_0x2825f5?.['appcode']||_0x2825f5?.['app'];let _0x2e1e07=_0x467b6b;!_0x467b6b&&(console[_0x44a552(0x17d)](a141_0x1ebee7[_0x44a552(0x175)](_0x44a552(0x15b)+a141_0x1ebee7[_0x44a552(0x166)](_0xb9b0b2))),_0x402e27&&console['log'](a141_0x1ebee7[_0x44a552(0x164)]('\x20\x20appcode:\x20'+_0x402e27)),_0x2e1e07=await confirm({'message':'Upgrade\x20it\x20to\x20'+a141_0x1ebee7[_0x44a552(0x166)](_0x44a552(0x17a))+_0x44a552(0x171),'default':!![]}));if(!_0x2e1e07){console[_0x44a552(0x17d)](_0x44a552(0x179)+CLI_BIN_NAME+'\x20workspace\x20init`\x20to\x20start\x20fresh.');return;}const _0x213cda=resolve(_0x2d48a6,NEW_CONFIG_NAME),_0x4f3097=getCliVersionFromPkg(),_0x133e77=readRawConfig(),_0x3bc1f6=_0x863a08||(typeof _0x2825f5?.[_0x44a552(0x15f)]===_0x44a552(0x165)?_0x2825f5['appcode']:undefined)||(typeof _0x2825f5?.[_0x44a552(0x163)]==='string'?_0x2825f5[_0x44a552(0x163)]:undefined)||await askAppcode(),_0x1a4ee1=typeof _0x2825f5?.[_0x44a552(0x155)]===_0x44a552(0x165)?_0x2825f5[_0x44a552(0x155)]:typeof _0x133e77[_0x44a552(0x155)]===_0x44a552(0x165)?_0x133e77[_0x44a552(0x155)]:'production',_0x33d673=buildCanonicalProjectConfig({..._0x133e77,..._0x2825f5},{'appCodes':[_0x3bc1f6],'env':_0x1a4ee1,'metadata':{'version':_0x4f3097,'migratedAt':new Date()[_0x44a552(0x153)](),'migratedFrom':_0x1c6607}});writeConfigFile(_0x213cda,_0x33d673);const _0x6a2fcb=_0x1c6607+'.bak';renameSync(_0x1c6607,_0x6a2fcb),logger[_0x44a552(0x181)](_0x2d48a6),logger['info'](_0x44a552(0x16d),'从旧配置文件升级成功',{'from':_0x1c6607,'to':_0x213cda,'appcode':_0x3bc1f6,'env':_0x33d673[_0x44a552(0x155)]}),console['log'](a141_0x1ebee7[_0x44a552(0x157)](_0x44a552(0x182)+_0xb9b0b2+_0x44a552(0x154))),console[_0x44a552(0x17d)](a141_0x1ebee7[_0x44a552(0x164)](_0x44a552(0x17b)+Object[_0x44a552(0x178)](_0x33d673[_0x44a552(0x16e)]||{})['join'](',\x20'))),console[_0x44a552(0x17d)](a141_0x1ebee7['cyan'](_0x44a552(0x176)+_0x33d673[_0x44a552(0x156)])),console[_0x44a552(0x17d)](a141_0x1ebee7['gray']('\x20\x20Old\x20file\x20backed\x20up\x20as\x20'+_0xb9b0b2+_0x44a552(0x161)));return;}const _0xdf08f0=_0x863a08||await askAppcode(),_0x5101cd=resolve(_0x2d48a6,NEW_CONFIG_NAME),_0x357e80=getCliVersionFromPkg(),_0x15a7ed=readRawConfig(),_0x4f237f=typeof _0x15a7ed['env']==='string'?_0x15a7ed['env']:undefined,_0x2ccd58=buildCanonicalProjectConfig({},{'appCodes':[_0xdf08f0],'env':_0x1fe7d9||_0x4f237f||'production','metadata':{'version':_0x357e80,'createdAt':new Date()[_0x44a552(0x153)]()}});writeConfigFile(_0x5101cd,_0x2ccd58),logger['setLogPath'](_0x2d48a6),logger[_0x44a552(0x167)](_0x44a552(0x16d),'初始化项目配置文件成功',{'appcode':_0xdf08f0,'env':_0x2ccd58['env'],'version':_0x2ccd58[_0x44a552(0x170)],'configPath':_0x5101cd}),console[_0x44a552(0x17d)](a141_0x1ebee7['green']('✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory')),console[_0x44a552(0x17d)](a141_0x1ebee7['cyan'](_0x44a552(0x17b)+Object[_0x44a552(0x178)](_0x2ccd58[_0x44a552(0x16e)]||{})[_0x44a552(0x16f)](',\x20'))),console[_0x44a552(0x17d)](a141_0x1ebee7[_0x44a552(0x164)](_0x44a552(0x176)+_0x2ccd58[_0x44a552(0x156)])),console[_0x44a552(0x17d)]('\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27'+CLI_BIN_NAME+_0x44a552(0x173)+CLI_BIN_NAME+_0x44a552(0x17f));}function askAppcode(){const _0x2fc920=a141_0x1bb0;return input({'message':_0x2fc920(0x158),'validate':_0x2259eb=>{const _0x2285c6=_0x2fc920;if(!_0x2259eb['trim']())return _0x2285c6(0x177);const {valid:_0x30eec6,message:_0x8e7378}=validateAppcode(_0x2259eb[_0x2285c6(0x16c)]());return _0x30eec6||_0x8e7378||_0x2285c6(0x172);}});}function getCliVersionFromPkg(){const _0x521e06=a141_0x1bb0;try{const _0x428ae0=fileURLToPath(import.meta.url),_0x34357e=resolve(dirname(_0x428ae0),_0x521e06(0x168)),_0x5ef1e7=JSON[_0x521e06(0x160)](readFileSync(resolve(_0x34357e,_0x521e06(0x16a)),'utf8'));return _0x5ef1e7['version']||_0x521e06(0x169);}catch{return _0x521e06(0x169);}}
@@ -1 +1 @@
1
- const a142_0x405afc=a142_0x35af;(function(_0x1d6532,_0x2d79f4){const _0x5bd7ee=a142_0x35af,_0x3482f2=_0x1d6532();while(!![]){try{const _0x186420=parseInt(_0x5bd7ee(0x204))/0x1+-parseInt(_0x5bd7ee(0x241))/0x2*(parseInt(_0x5bd7ee(0x208))/0x3)+parseInt(_0x5bd7ee(0x206))/0x4+parseInt(_0x5bd7ee(0x21a))/0x5+parseInt(_0x5bd7ee(0x226))/0x6+parseInt(_0x5bd7ee(0x22b))/0x7+parseInt(_0x5bd7ee(0x247))/0x8*(-parseInt(_0x5bd7ee(0x1d8))/0x9);if(_0x186420===_0x2d79f4)break;else _0x3482f2['push'](_0x3482f2['shift']());}catch(_0x190f54){_0x3482f2['push'](_0x3482f2['shift']());}}}(a142_0x51eb,0x1984d));import a142_0x4fbda6 from'chalk';import a142_0x595cd0 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';function a142_0x35af(_0x579a90,_0x2e4ac6){_0x579a90=_0x579a90-0x1c9;const _0x51eb7e=a142_0x51eb();let _0x35aff8=_0x51eb7e[_0x579a90];return _0x35aff8;}import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a142_0x405afc(0x217)](_0x533758=>_0x533758!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x2e42dd){const _0x39d73c=a142_0x405afc,_0xb75f28=[];for(const _0x4373a7 of Object[_0x39d73c(0x1c9)](CORE_IDE_CONFIGS)){if(_0x4373a7[_0x39d73c(0x203)])for(const _0x1eb8f6 of _0x4373a7['files']){_0xb75f28[_0x39d73c(0x22a)](resolve(_0x2e42dd,_0x1eb8f6[_0x39d73c(0x230)]));}}return _0xb75f28;}function analyse(_0x2c1411){const _0x161f5e=a142_0x405afc;let _0x2ff929=null;const _0x529f51=resolve(_0x2c1411,NEW_CONFIG_NAME),_0x102ecb=existsSync(_0x529f51);for(const _0x8d76dd of LEGACY_CONFIG_NAMES){const _0x2b5e32=resolve(_0x2c1411,_0x8d76dd);if(existsSync(_0x2b5e32)){const _0x35935a=readConfigFile(_0x2b5e32),_0x57c32e=Object[_0x161f5e(0x1fa)](_0x35935a)[_0x161f5e(0x217)](_0x1d0ae8=>typeof _0x35935a[_0x1d0ae8]!==_0x161f5e(0x1e9));_0x2ff929={'oldPath':_0x2b5e32,'hasNewConfig':_0x102ecb,'fields':_0x57c32e};break;}}const _0x43a4bb=[],_0x4c5224=resolve(_0x2c1411,_0x161f5e(0x22f));if(existsSync(_0x4c5224))_0x43a4bb['push'](_0x4c5224);const _0x362132=resolve(_0x2c1411,_0x161f5e(0x1ce));if(existsSync(_0x362132))_0x43a4bb[_0x161f5e(0x22a)](_0x362132);const _0x409383=resolve(_0x2c1411,_0x161f5e(0x1d1));if(existsSync(_0x409383))_0x43a4bb[_0x161f5e(0x22a)](_0x409383);for(const _0x583700 of collectIdeSkillFiles(_0x2c1411)){if(existsSync(_0x583700))_0x43a4bb[_0x161f5e(0x22a)](_0x583700);}let _0x434285=null;const _0x304ae3=resolve(_0x2c1411,'.cursor/mcp.json');if(existsSync(_0x304ae3))try{const _0x1e5c78=JSON['parse'](readFileSync(_0x304ae3,_0x161f5e(0x1cb)));if(_0x1e5c78?.[_0x161f5e(0x1cf)]&&typeof _0x1e5c78[_0x161f5e(0x1cf)]==='object'){const _0x1f7af4=[];for(const [_0x3e7d5e,_0x5663d7]of Object['entries'](_0x1e5c78[_0x161f5e(0x1cf)])){const _0x1974d9=_0x5663d7;_0x1974d9?.['args']&&Array['isArray'](_0x1974d9['args'])&&_0x1974d9[_0x161f5e(0x233)][_0x161f5e(0x200)](_0x5a50f1=>typeof _0x5a50f1===_0x161f5e(0x1dd)&&_0x5a50f1[_0x161f5e(0x1f7)](_0x161f5e(0x225)))&&_0x1f7af4[_0x161f5e(0x22a)](_0x3e7d5e);}_0x1f7af4['length']>0x0&&(_0x434285={'path':_0x304ae3,'keys':_0x1f7af4});}}catch{}const _0x140b63=_0x43a4bb['length']>0x0||_0x2ff929!==null;let _0x6581c0=null;const _0x337720=resolve(_0x2c1411,_0x161f5e(0x1e8));if(existsSync(_0x337720))try{const _0xbb29e7=JSON[_0x161f5e(0x1f6)](readFileSync(_0x337720,_0x161f5e(0x1cb)));for(const _0x13a01c of[_0x161f5e(0x223),_0x161f5e(0x237)]){const _0xd8f86=_0xbb29e7?.[_0x13a01c]?.[_0x161f5e(0x1ff)];if(typeof _0xd8f86===_0x161f5e(0x1dd)){_0xd8f86!==_0x161f5e(0x227)&&(_0x6581c0={'pkgPath':_0x337720,'currentVersion':_0xd8f86,'field':_0x13a01c});break;}}}catch{}return{'configMigration':_0x2ff929,'oldArtifacts':_0x43a4bb,'oldMcpConfig':_0x434285,'needsSkillSwap':_0x140b63,'sdkUpgrade':_0x6581c0};}function printReport(_0xa00886){const _0x2fe460=a142_0x405afc,{configMigration:_0x26051e,oldArtifacts:_0x1ebc11,oldMcpConfig:_0x793bb1,needsSkillSwap:_0x1d4339}=_0xa00886;console[_0x2fe460(0x22d)](''),console['log'](a142_0x4fbda6[_0x2fe460(0x1fb)](_0x2fe460(0x21c))),console[_0x2fe460(0x22d)]('');_0x26051e?(console['log'](a142_0x4fbda6[_0x2fe460(0x1f2)](_0x2fe460(0x215))+('\x20\x20'+a142_0x4fbda6[_0x2fe460(0x1f4)](_0x26051e[_0x2fe460(0x243)]))),console[_0x2fe460(0x22d)](_0x2fe460(0x1fd)+(_0x26051e[_0x2fe460(0x1d3)]?a142_0x4fbda6['green'](_0x2fe460(0x211)):a142_0x4fbda6['gray'](_0x2fe460(0x1cc)))),console[_0x2fe460(0x22d)](_0x2fe460(0x216)+_0x26051e[_0x2fe460(0x22e)]['join'](',\x20')),console[_0x2fe460(0x22d)](_0x2fe460(0x236))):console[_0x2fe460(0x22d)](a142_0x4fbda6[_0x2fe460(0x1f2)](_0x2fe460(0x215))+'\x20\x20'+a142_0x4fbda6[_0x2fe460(0x1db)]('no\x20legacy\x20config\x20found'));console[_0x2fe460(0x22d)]('');if(_0x1ebc11[_0x2fe460(0x1de)]>0x0){console[_0x2fe460(0x22d)](a142_0x4fbda6['cyan']('Legacy\x20artifacts:'));for(const _0x1d076b of _0x1ebc11){console[_0x2fe460(0x22d)]('\x20\x20'+a142_0x4fbda6[_0x2fe460(0x207)]('FOUND')+'\x20\x20'+_0x1d076b);}console['log'](_0x2fe460(0x20e));}else console['log'](a142_0x4fbda6[_0x2fe460(0x1f2)](_0x2fe460(0x1eb))+'\x20\x20'+a142_0x4fbda6[_0x2fe460(0x1db)]('none\x20found'));console[_0x2fe460(0x22d)]('');_0x793bb1?(console['log'](a142_0x4fbda6[_0x2fe460(0x1f2)](_0x2fe460(0x1f5))+('\x20\x20'+a142_0x4fbda6[_0x2fe460(0x1f4)](_0x793bb1[_0x2fe460(0x230)])+_0x2fe460(0x1d6)+_0x793bb1[_0x2fe460(0x1fa)][_0x2fe460(0x212)](',\x20'))),console['log'](_0x2fe460(0x1ca))):console[_0x2fe460(0x22d)](a142_0x4fbda6[_0x2fe460(0x1f2)](_0x2fe460(0x1f5))+'\x20\x20'+a142_0x4fbda6[_0x2fe460(0x1db)]('no\x20legacy\x20entry'));console['log'](''),console[_0x2fe460(0x22d)](a142_0x4fbda6['cyan']('Skill\x20swap:')+('\x20\x20'+(_0x1d4339?a142_0x4fbda6[_0x2fe460(0x1f4)](_0x2fe460(0x1f3)):a142_0x4fbda6['green'](_0x2fe460(0x222)))));_0x1d4339&&console[_0x2fe460(0x22d)]('\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`'+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x2fe460(0x22d)]('');if(_0xa00886['sdkUpgrade']){const {currentVersion:_0x4f17a8,field:_0x2dda42,pkgPath:_0xb220d0}=_0xa00886[_0x2fe460(0x232)];console[_0x2fe460(0x22d)](a142_0x4fbda6[_0x2fe460(0x1f2)](_0x2fe460(0x1da))+('\x20\x20'+a142_0x4fbda6[_0x2fe460(0x1f4)](_0xb220d0))),console[_0x2fe460(0x22d)](_0x2fe460(0x23e)+_0x2dda42+':\x20'+a142_0x4fbda6[_0x2fe460(0x1f4)](_0x4f17a8)+_0x2fe460(0x234)+a142_0x4fbda6[_0x2fe460(0x21d)](_0x2fe460(0x227))),console['log'](_0x2fe460(0x245));}else console[_0x2fe460(0x22d)](a142_0x4fbda6[_0x2fe460(0x1f2)](_0x2fe460(0x1da))+'\x20\x20'+a142_0x4fbda6[_0x2fe460(0x1db)](_0x2fe460(0x214)));console['log']('');}function execConfigMigration(_0x3bb7cd,_0xb0d8cd){const _0x493057=a142_0x405afc,{configMigration:_0x1de91b}=_0x3bb7cd;if(!_0x1de91b?.[_0x493057(0x243)])return{'step':0x1,'label':_0x493057(0x240),'ok':!![],'detail':_0x493057(0x1ef)};const _0x2cb85e=readConfigFile(_0x1de91b[_0x493057(0x243)]),_0x4290de=resolve(_0xb0d8cd,NEW_CONFIG_NAME),_0x1f7c14=_0x1de91b['hasNewConfig']?readConfigFile(_0x4290de):{};for(const [_0x4cf743,_0x35b4a7]of Object[_0x493057(0x1ec)](_0x2cb85e)){!(_0x4cf743 in _0x1f7c14)&&(_0x1f7c14[_0x4cf743]=_0x35b4a7);}writeConfigFile(_0x4290de,_0x1f7c14);const _0x27b62d=_0x1de91b[_0x493057(0x243)]+_0x493057(0x229);return renameSync(_0x1de91b[_0x493057(0x243)],_0x27b62d),{'step':0x1,'label':_0x493057(0x240),'ok':!![],'detail':_0x1de91b[_0x493057(0x243)]+'\x20→\x20'+_0x4290de+_0x493057(0x1e4)+_0x27b62d+')'};}function execRemoveOldArtifacts(_0x3d9776){const _0x85a65=a142_0x405afc,_0x5a99a2=[];for(const _0x33b928 of _0x3d9776){try{if(!existsSync(_0x33b928))continue;const _0x1a2629=tryStat(_0x33b928);_0x1a2629?.['isDirectory']()?rmSync(_0x33b928,{'recursive':!![],'force':!![]}):unlinkSync(_0x33b928);}catch(_0x21af0c){_0x5a99a2['push'](_0x33b928+':\x20'+_0x21af0c['message']);}}return{'step':0x3,'label':'Remove\x20legacy\x20artifacts','ok':_0x5a99a2['length']===0x0,'detail':_0x5a99a2[_0x85a65(0x1de)]>0x0?_0x3d9776[_0x85a65(0x1de)]-_0x5a99a2['length']+'/'+_0x3d9776['length']+_0x85a65(0x21e)+_0x5a99a2['join'](';\x20')+')':_0x3d9776[_0x85a65(0x1de)]+'\x20removed'};}function execCleanMcp(_0x1343dc){const _0x1f6e7d=a142_0x405afc;if(!_0x1343dc['oldMcpConfig'])return{'step':0x4,'label':_0x1f6e7d(0x221),'ok':!![],'detail':_0x1f6e7d(0x20b)};try{const _0x512dc0=readFileSync(_0x1343dc['oldMcpConfig'][_0x1f6e7d(0x230)],'utf8'),_0x55b545=JSON['parse'](_0x512dc0);if(_0x55b545?.[_0x1f6e7d(0x1cf)]&&typeof _0x55b545[_0x1f6e7d(0x1cf)]==='object'){const _0x27f666=[];for(const [_0x407472,_0x473067]of Object['entries'](_0x55b545[_0x1f6e7d(0x1cf)])){_0x473067?.[_0x1f6e7d(0x233)]&&Array[_0x1f6e7d(0x242)](_0x473067[_0x1f6e7d(0x233)])&&_0x473067[_0x1f6e7d(0x233)][_0x1f6e7d(0x200)](_0xfdd573=>typeof _0xfdd573==='string'&&_0xfdd573[_0x1f6e7d(0x1f7)](_0x1f6e7d(0x225)))&&_0x27f666[_0x1f6e7d(0x22a)](_0x407472);}for(const _0x554dc8 of _0x27f666){delete _0x55b545['mcpServers'][_0x554dc8];}return _0x27f666['length']>0x0&&writeFileSync(_0x1343dc['oldMcpConfig'][_0x1f6e7d(0x230)],JSON[_0x1f6e7d(0x244)](_0x55b545,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':_0x1f6e7d(0x221),'ok':!![],'detail':_0x1f6e7d(0x20f)+_0x27f666['join'](',\x20')+_0x1f6e7d(0x21f)+_0x1343dc[_0x1f6e7d(0x213)]['path']};}return{'step':0x4,'label':_0x1f6e7d(0x221),'ok':!![],'detail':_0x1f6e7d(0x1f9)};}catch(_0x3e4fc3){return{'step':0x4,'label':_0x1f6e7d(0x221),'ok':![],'detail':_0x3e4fc3[_0x1f6e7d(0x1d5)]};}}function execSkillsRemove(_0x177a17,_0x504605){const _0x5d6ea8=a142_0x405afc,_0x5b3b02=runNpxSkillsRemove(_0x177a17,{'stdio':'inherit','yes':_0x504605});return{'step':0x5,'label':_0x5d6ea8(0x231),'ok':_0x5b3b02['ok'],'detail':_0x5b3b02['ok']?'lovrabet/lovrabet-skill\x20removed':_0x5b3b02['error']??_0x5d6ea8(0x23b)+_0x5b3b02[_0x5d6ea8(0x239)]};}function execSkillsAdd(_0xbbb813,_0x46425a){const _0x1628a0=a142_0x405afc,_0x472a1a=runNpxSkillsAddGlobal(_0xbbb813,_0x1628a0(0x1d4),{'stdio':_0x1628a0(0x228),'yes':_0x46425a});return{'step':0x6,'label':_0x1628a0(0x1d9),'ok':_0x472a1a['ok'],'detail':_0x472a1a['ok']?_0x1628a0(0x1f8):_0x472a1a[_0x1628a0(0x1ee)]??_0x1628a0(0x23b)+_0x472a1a[_0x1628a0(0x239)]};}function execUpgradeSdk(_0x200297){const _0x2502ca=a142_0x405afc;if(!_0x200297[_0x2502ca(0x232)])return{'step':0x7,'label':_0x2502ca(0x1df),'ok':!![],'detail':_0x2502ca(0x220)};const {pkgPath:_0x522b44,currentVersion:_0x40e3c9,field:_0x3b3d16}=_0x200297['sdkUpgrade'];try{const _0x50ed6c=readFileSync(_0x522b44,_0x2502ca(0x1cb)),_0x267961=JSON[_0x2502ca(0x1f6)](_0x50ed6c);return _0x267961[_0x3b3d16][_0x2502ca(0x1ff)]='latest',writeFileSync(_0x522b44,JSON['stringify'](_0x267961,null,0x2)+'\x0a',_0x2502ca(0x1cb)),{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x3b3d16+_0x2502ca(0x1e0)+_0x40e3c9+_0x2502ca(0x1e1)};}catch(_0x20dd2b){return{'step':0x7,'label':_0x2502ca(0x1df),'ok':![],'detail':_0x20dd2b[_0x2502ca(0x1d5)]};}}function tryStat(_0x4a620a){try{return statSync(_0x4a620a);}catch{return undefined;}}function a142_0x51eb(){const _0x1121f3=['skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','Clean\x20MCP\x20config','not\x20needed','dependencies','configMigration','@lovrabet/dataset-mcp-server','831984pAHpye','latest','inherit','.bak','push','353479XobPrx','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','log','fields','.lovrabet','path','Remove\x20old\x20skill','sdkUpgrade','args','\x20→\x20','Step\x204/7:\x20Cleaning\x20MCP\x20config...','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','devDependencies','failed','status','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','exit\x20','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','\x20\x20bun\x20install','\x20\x20Current\x20version\x20in\x20','fail','Config\x20migration','223422gPymKF','isArray','oldPath','stringify','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','\x20\x20\x20\x20\x20\x20\x20','288CLIJZF','label','values','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','utf8','not\x20found\x20(will\x20create)','\x20\x20#\x20or','.cursor/rules/lovrabet_rules.mdc','mcpServers','===\x20Upgrade\x20Summary\x20===','.claude/skills/lovrabet','needsSkillSwap','hasNewConfig','lovrabet/rabetbase','message','\x20→\x20keys:\x20','\x20\x20npm\x20install','85680GsxkUR','Install\x20new\x20skill','@lovrabet/sdk:','gray','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','string','length','Upgrade\x20@lovrabet/sdk','[\x22@lovrabet/sdk\x22]:\x20','\x20→\x20latest','succeed','yes','\x20(backup:\x20','step','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','Upgrade\x20cancelled.','package.json','undefined','white','Legacy\x20artifacts:','entries','Proceed\x20with\x20upgrade?','error','skipped\x20(no\x20legacy\x20config)','info','Upgrade\x20completed\x20successfully!','cyan','needed','yellow','MCP\x20config:','parse','includes','lovrabet/rabetbase\x20installed\x20globally','no\x20matching\x20entry\x20found','keys','bold','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','\x20\x20New\x20config\x20(.rabetbase.json):\x20','Remove\x20.lovrabet/','@lovrabet/sdk','some','done','cwd','files','142125zWEoAr','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','554540nBzpNy','red','3AIpAiv','detail','\x20\x20Step\x20','skipped','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','FAIL','\x20\x20Action:\x20delete','removed\x20','oldArtifacts','already\x20exists\x20(will\x20merge)','join','oldMcpConfig','not\x20found\x20or\x20already\x20at\x20latest','Config\x20file:','\x20\x20Fields\x20to\x20migrate:\x20','filter','Step\x206/7:\x20Installing\x20new\x20skill...','start','445175aYQTHP','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','===\x20Upgrade\x20Analysis\x20===','green','\x20removed\x20(','\x20from\x20'];a142_0x51eb=function(){return _0x1121f3;};return a142_0x51eb();}function printSummary(_0x3bbf96){const _0x2e6bc7=a142_0x405afc;console['log'](''),console[_0x2e6bc7(0x22d)](a142_0x4fbda6[_0x2e6bc7(0x1fb)](_0x2e6bc7(0x1d0))),console[_0x2e6bc7(0x22d)]('');for(const _0x219d0a of _0x3bbf96){const _0x1d7c32=_0x219d0a['ok']?a142_0x4fbda6['green']('OK'):a142_0x4fbda6[_0x2e6bc7(0x207)](_0x2e6bc7(0x20d));console[_0x2e6bc7(0x22d)]('\x20\x20'+_0x1d7c32+_0x2e6bc7(0x20a)+_0x219d0a[_0x2e6bc7(0x1e5)]+':\x20'+_0x219d0a[_0x2e6bc7(0x248)]);if(_0x219d0a[_0x2e6bc7(0x209)])console[_0x2e6bc7(0x22d)](_0x2e6bc7(0x246)+a142_0x4fbda6[_0x2e6bc7(0x1db)](_0x219d0a[_0x2e6bc7(0x209)]));}console[_0x2e6bc7(0x22d)]('');}export async function upgradeApp(_0x30f277,_0x17f0bd){const _0x31e53d=a142_0x405afc,_0x3b05c8=process[_0x31e53d(0x202)](),_0x2b9cbe=analyse(_0x3b05c8),_0x3be0e5=!_0x2b9cbe[_0x31e53d(0x224)]&&_0x2b9cbe['oldArtifacts'][_0x31e53d(0x1de)]===0x0&&!_0x2b9cbe['oldMcpConfig']&&!_0x2b9cbe[_0x31e53d(0x1d2)]&&!_0x2b9cbe['sdkUpgrade'];if(_0x3be0e5){console[_0x31e53d(0x22d)](a142_0x4fbda6[_0x31e53d(0x21d)]('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0x2b9cbe);const _0x26a412=!!(_0x17f0bd[_0x31e53d(0x1e3)]||_0x17f0bd['Y']||_0x30f277);if(!_0x26a412)try{const _0x10b9ba=await askConfirm(_0x31e53d(0x1ed));if(!_0x10b9ba){console[_0x31e53d(0x22d)](a142_0x4fbda6[_0x31e53d(0x1db)](_0x31e53d(0x1e7)));return;}}catch(_0x1561cb){if(_0x1561cb?.['message']==='CANCEL'){console['log'](a142_0x4fbda6[_0x31e53d(0x1db)](_0x31e53d(0x1e7)));return;}throw _0x1561cb;}const _0x1b3997=[],_0x3644e9=a142_0x595cd0({'text':'Step\x201/7:\x20Migrating\x20config...','color':_0x31e53d(0x1f2)})['start'](),_0x2eb7e6=execConfigMigration(_0x2b9cbe,_0x3b05c8);_0x1b3997['push'](_0x2eb7e6),_0x3644e9[_0x2eb7e6['ok']?_0x31e53d(0x1e2):_0x31e53d(0x23f)]('Step\x201/7:\x20Config\x20migration\x20—\x20'+(_0x2eb7e6[_0x31e53d(0x209)]??(_0x2eb7e6['ok']?'done':_0x31e53d(0x238))));const _0x1ba61d=resolve(_0x3b05c8,_0x31e53d(0x22f)),_0x15553a=a142_0x595cd0({'text':_0x31e53d(0x205),'color':_0x31e53d(0x1f2)})[_0x31e53d(0x219)]();if(existsSync(_0x1ba61d))try{rmSync(_0x1ba61d,{'recursive':!![],'force':!![]}),_0x15553a[_0x31e53d(0x1e2)](_0x31e53d(0x1fc)),_0x1b3997[_0x31e53d(0x22a)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x4e2c75){_0x15553a[_0x31e53d(0x23f)]('Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20'+_0x4e2c75[_0x31e53d(0x1d5)]),_0x1b3997[_0x31e53d(0x22a)]({'step':0x2,'label':_0x31e53d(0x1fe),'ok':![],'detail':_0x4e2c75[_0x31e53d(0x1d5)]});}else _0x15553a[_0x31e53d(0x1f0)](_0x31e53d(0x22c)),_0x1b3997[_0x31e53d(0x22a)]({'step':0x2,'label':_0x31e53d(0x1fe),'ok':!![],'detail':'skipped'});const _0x3a95c3=a142_0x595cd0({'text':_0x31e53d(0x21b),'color':_0x31e53d(0x1f2)})[_0x31e53d(0x219)](),_0x3c1222=execRemoveOldArtifacts(_0x2b9cbe[_0x31e53d(0x210)]);_0x1b3997[_0x31e53d(0x22a)](_0x3c1222),_0x3a95c3[_0x3c1222['ok']?_0x31e53d(0x1e2):_0x31e53d(0x23f)](_0x31e53d(0x23a)+(_0x3c1222['detail']??(_0x3c1222['ok']?_0x31e53d(0x201):_0x31e53d(0x238))));const _0x170c58=a142_0x595cd0({'text':_0x31e53d(0x235),'color':_0x31e53d(0x1f2)})[_0x31e53d(0x219)](),_0xb70c16=execCleanMcp(_0x2b9cbe);_0x1b3997[_0x31e53d(0x22a)](_0xb70c16),_0x170c58[_0xb70c16['ok']?'succeed':'fail']('Step\x204/7:\x20MCP\x20config\x20—\x20'+(_0xb70c16[_0x31e53d(0x209)]??(_0xb70c16['ok']?_0x31e53d(0x201):_0x31e53d(0x238))));const _0x17d714=a142_0x595cd0({'text':'Step\x205/7:\x20Removing\x20old\x20skill...','color':_0x31e53d(0x1f2)})[_0x31e53d(0x219)](),_0x97f252=execSkillsRemove(_0x3b05c8,_0x26a412);_0x1b3997['push'](_0x97f252),_0x17d714[_0x97f252['ok']?_0x31e53d(0x1e2):'fail'](_0x31e53d(0x1e6)+(_0x97f252[_0x31e53d(0x209)]??(_0x97f252['ok']?_0x31e53d(0x201):_0x31e53d(0x238))));const _0x4611ff=a142_0x595cd0({'text':_0x31e53d(0x218),'color':'cyan'})[_0x31e53d(0x219)](),_0x136191=execSkillsAdd(_0x3b05c8,_0x26a412);_0x1b3997[_0x31e53d(0x22a)](_0x136191),_0x4611ff[_0x136191['ok']?_0x31e53d(0x1e2):_0x31e53d(0x23f)]('Step\x206/7:\x20Install\x20new\x20skill\x20—\x20'+(_0x136191[_0x31e53d(0x209)]??(_0x136191['ok']?_0x31e53d(0x201):_0x31e53d(0x238))));const _0x2f1ff3=a142_0x595cd0({'text':_0x31e53d(0x23c),'color':_0x31e53d(0x1f2)})['start'](),_0x5f3aa2=execUpgradeSdk(_0x2b9cbe);_0x1b3997['push'](_0x5f3aa2),_0x2f1ff3[_0x5f3aa2['ok']?_0x31e53d(0x1e2):'fail']('Step\x207/7:\x20@lovrabet/sdk\x20—\x20'+(_0x5f3aa2[_0x31e53d(0x209)]??(_0x5f3aa2['ok']?_0x31e53d(0x201):_0x31e53d(0x238)))),printSummary(_0x1b3997);const _0x14bd87=_0x1b3997['some'](_0x4a9070=>!_0x4a9070['ok']);_0x14bd87?console['log'](a142_0x4fbda6['yellow'](_0x31e53d(0x1dc))):console['log'](a142_0x4fbda6['green'](_0x31e53d(0x1f1))),_0x5f3aa2['ok']&&_0x2b9cbe[_0x31e53d(0x232)]&&(console[_0x31e53d(0x22d)](''),console[_0x31e53d(0x22d)](a142_0x4fbda6['bold'][_0x31e53d(0x1f2)](_0x31e53d(0x20c))),console[_0x31e53d(0x22d)](a142_0x4fbda6[_0x31e53d(0x1f2)]('Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:')),console['log'](''),console[_0x31e53d(0x22d)](a142_0x4fbda6[_0x31e53d(0x1ea)](_0x31e53d(0x1d7))),console[_0x31e53d(0x22d)](a142_0x4fbda6[_0x31e53d(0x1ea)](_0x31e53d(0x1cd))),console[_0x31e53d(0x22d)](a142_0x4fbda6[_0x31e53d(0x1ea)](_0x31e53d(0x23d))),console[_0x31e53d(0x22d)](''));}
1
+ const a142_0x572ac2=a142_0x4fa6;(function(_0x2b60e7,_0x1cc330){const _0x4e7f84=a142_0x4fa6,_0x47662a=_0x2b60e7();while(!![]){try{const _0x192ae4=parseInt(_0x4e7f84(0x215))/0x1+-parseInt(_0x4e7f84(0x223))/0x2+parseInt(_0x4e7f84(0x253))/0x3*(-parseInt(_0x4e7f84(0x225))/0x4)+-parseInt(_0x4e7f84(0x238))/0x5*(parseInt(_0x4e7f84(0x23b))/0x6)+parseInt(_0x4e7f84(0x240))/0x7+parseInt(_0x4e7f84(0x252))/0x8*(-parseInt(_0x4e7f84(0x232))/0x9)+parseInt(_0x4e7f84(0x207))/0xa;if(_0x192ae4===_0x1cc330)break;else _0x47662a['push'](_0x47662a['shift']());}catch(_0x424230){_0x47662a['push'](_0x47662a['shift']());}}}(a142_0x5cba,0xc1b73));function a142_0x4fa6(_0x111fef,_0xe28cb){_0x111fef=_0x111fef-0x1d1;const _0x5cba35=a142_0x5cba();let _0x4fa655=_0x5cba35[_0x111fef];return _0x4fa655;}import a142_0x36e0df from'chalk';import a142_0xd30bc5 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';function a142_0x5cba(){const _0x5e2b12=['dependencies','none\x20found','.bak','Step\x201/7:\x20Migrating\x20config...','length','\x20\x20#\x20or','Remove\x20old\x20skill','some','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','Step\x205/7:\x20Removing\x20old\x20skill...','object','@lovrabet/sdk','yes','undefined','error','done','hasNewConfig','log','.lovrabet','join','fail','19535050QOakUA','needed','Remove\x20legacy\x20artifacts','\x20\x20bun\x20install','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','start','bold','message','failed','parse','not\x20found\x20(will\x20create)','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','sdkUpgrade','package.json','1155834fopaao','\x20from\x20','includes','green','\x20\x20New\x20config\x20(.rabetbase.json):\x20','yellow','latest','status','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','stringify','cyan','Upgrade\x20completed\x20successfully!','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','configMigration','1793346VJoKjv','.claude/skills/lovrabet','4lcwAqA','filter','not\x20needed','isDirectory','red','string','no\x20legacy\x20config\x20found','.cursor/mcp.json','lovrabet/rabetbase','no\x20matching\x20entry\x20found','===\x20Upgrade\x20Summary\x20===','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','detail','9GKiXkl','keys','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','removed\x20','skipped\x20(no\x20legacy\x20config)','Proceed\x20with\x20upgrade?','5KjTjrZ','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','8042772mrlOor','.cursor/rules/lovrabet_rules.mdc','label','Upgrade\x20@lovrabet/sdk','needsSkillSwap','8085448AYIYTW','FAIL','info','step','\x20(backup:\x20','isArray','\x20removed\x20(','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','no\x20legacy\x20entry','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','skipped','Config\x20file:','Skill\x20swap:','MCP\x20config:','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','push','@lovrabet/sdk:','Step\x204/7:\x20Cleaning\x20MCP\x20config...','7438352pbmvkO','912045LkrLrU','entries','args','\x20\x20Current\x20version\x20in\x20','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','succeed','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','===\x20Upgrade\x20Analysis\x20===','oldPath','lovrabet/lovrabet-skill\x20removed','\x20\x20Fields\x20to\x20migrate:\x20','not\x20found\x20or\x20already\x20at\x20latest','[\x22@lovrabet/sdk\x22]:\x20','devDependencies','path','@lovrabet/dataset-mcp-server','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','inherit','Clean\x20MCP\x20config','Step\x201/7:\x20Config\x20migration\x20—\x20','utf8','\x20→\x20','mcpServers','gray','white','oldMcpConfig','Config\x20migration','\x20removed','exit\x20','lovrabet/rabetbase\x20installed\x20globally','FOUND','Upgrade\x20cancelled.','Legacy\x20artifacts:','CANCEL'];a142_0x5cba=function(){return _0x5e2b12;};return a142_0x5cba();}const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a142_0x572ac2(0x226)](_0x664310=>_0x664310!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x3ef03b){const _0xa6625=a142_0x572ac2,_0x55c4a3=[];for(const _0x609c67 of Object['values'](CORE_IDE_CONFIGS)){if(_0x609c67['files'])for(const _0x47a63f of _0x609c67['files']){_0x55c4a3['push'](resolve(_0x3ef03b,_0x47a63f[_0xa6625(0x1de)]));}}return _0x55c4a3;}function analyse(_0x1bc832){const _0x52c27a=a142_0x572ac2;let _0x52d122=null;const _0x1745ec=resolve(_0x1bc832,NEW_CONFIG_NAME),_0x330585=existsSync(_0x1745ec);for(const _0x29d3f7 of LEGACY_CONFIG_NAMES){const _0x3d84bd=resolve(_0x1bc832,_0x29d3f7);if(existsSync(_0x3d84bd)){const _0x2d3a46=readConfigFile(_0x3d84bd),_0x5c4e32=Object['keys'](_0x2d3a46)[_0x52c27a(0x226)](_0x3e838b=>typeof _0x2d3a46[_0x3e838b]!==_0x52c27a(0x1ff));_0x52d122={'oldPath':_0x3d84bd,'hasNewConfig':_0x330585,'fields':_0x5c4e32};break;}}const _0x21fded=[],_0x2537ee=resolve(_0x1bc832,_0x52c27a(0x204));if(existsSync(_0x2537ee))_0x21fded[_0x52c27a(0x24f)](_0x2537ee);const _0x2f3700=resolve(_0x1bc832,_0x52c27a(0x23c));if(existsSync(_0x2f3700))_0x21fded[_0x52c27a(0x24f)](_0x2f3700);const _0x1de4f3=resolve(_0x1bc832,_0x52c27a(0x224));if(existsSync(_0x1de4f3))_0x21fded[_0x52c27a(0x24f)](_0x1de4f3);for(const _0x577a69 of collectIdeSkillFiles(_0x1bc832)){if(existsSync(_0x577a69))_0x21fded[_0x52c27a(0x24f)](_0x577a69);}let _0x2a64a3=null;const _0x56bfd3=resolve(_0x1bc832,_0x52c27a(0x22c));if(existsSync(_0x56bfd3))try{const _0x1356f4=JSON[_0x52c27a(0x210)](readFileSync(_0x56bfd3,_0x52c27a(0x1e4)));if(_0x1356f4?.[_0x52c27a(0x1e6)]&&typeof _0x1356f4[_0x52c27a(0x1e6)]==='object'){const _0x5c5585=[];for(const [_0x4fb64f,_0x43f019]of Object[_0x52c27a(0x1d1)](_0x1356f4[_0x52c27a(0x1e6)])){const _0x2d4f4e=_0x43f019;_0x2d4f4e?.[_0x52c27a(0x1d2)]&&Array[_0x52c27a(0x245)](_0x2d4f4e[_0x52c27a(0x1d2)])&&_0x2d4f4e[_0x52c27a(0x1d2)][_0x52c27a(0x1f9)](_0xe17d1=>typeof _0xe17d1===_0x52c27a(0x22a)&&_0xe17d1[_0x52c27a(0x217)]('@lovrabet/dataset-mcp-server'))&&_0x5c5585[_0x52c27a(0x24f)](_0x4fb64f);}_0x5c5585[_0x52c27a(0x1f6)]>0x0&&(_0x2a64a3={'path':_0x56bfd3,'keys':_0x5c5585});}}catch{}const _0x2e173a=_0x21fded[_0x52c27a(0x1f6)]>0x0||_0x52d122!==null;let _0x45803e=null;const _0x38cad3=resolve(_0x1bc832,_0x52c27a(0x214));if(existsSync(_0x38cad3))try{const _0x1bf577=JSON[_0x52c27a(0x210)](readFileSync(_0x38cad3,'utf8'));for(const _0xd914d9 of[_0x52c27a(0x1f2),_0x52c27a(0x1dd)]){const _0x40deb5=_0x1bf577?.[_0xd914d9]?.[_0x52c27a(0x1fd)];if(typeof _0x40deb5===_0x52c27a(0x22a)){_0x40deb5!==_0x52c27a(0x21b)&&(_0x45803e={'pkgPath':_0x38cad3,'currentVersion':_0x40deb5,'field':_0xd914d9});break;}}}catch{}return{'configMigration':_0x52d122,'oldArtifacts':_0x21fded,'oldMcpConfig':_0x2a64a3,'needsSkillSwap':_0x2e173a,'sdkUpgrade':_0x45803e};}function printReport(_0x5ccae9){const _0x2b9716=a142_0x572ac2,{configMigration:_0x38b096,oldArtifacts:_0xd719e1,oldMcpConfig:_0x3c6129,needsSkillSwap:_0xdf3b64}=_0x5ccae9;console[_0x2b9716(0x203)](''),console[_0x2b9716(0x203)](a142_0x36e0df[_0x2b9716(0x20d)](_0x2b9716(0x1d7))),console[_0x2b9716(0x203)]('');_0x38b096?(console[_0x2b9716(0x203)](a142_0x36e0df[_0x2b9716(0x21f)]('Config\x20file:')+('\x20\x20'+a142_0x36e0df[_0x2b9716(0x21a)](_0x38b096[_0x2b9716(0x1d8)]))),console[_0x2b9716(0x203)](_0x2b9716(0x219)+(_0x38b096['hasNewConfig']?a142_0x36e0df[_0x2b9716(0x218)]('already\x20exists\x20(will\x20merge)'):a142_0x36e0df[_0x2b9716(0x1e7)](_0x2b9716(0x211)))),console[_0x2b9716(0x203)](_0x2b9716(0x1da)+_0x38b096['fields'][_0x2b9716(0x205)](',\x20')),console[_0x2b9716(0x203)](_0x2b9716(0x230))):console[_0x2b9716(0x203)](a142_0x36e0df[_0x2b9716(0x21f)](_0x2b9716(0x24b))+'\x20\x20'+a142_0x36e0df[_0x2b9716(0x1e7)](_0x2b9716(0x22b)));console[_0x2b9716(0x203)]('');if(_0xd719e1['length']>0x0){console[_0x2b9716(0x203)](a142_0x36e0df['cyan'](_0x2b9716(0x1f0)));for(const _0x5ccc5d of _0xd719e1){console[_0x2b9716(0x203)]('\x20\x20'+a142_0x36e0df[_0x2b9716(0x229)](_0x2b9716(0x1ee))+'\x20\x20'+_0x5ccc5d);}console['log']('\x20\x20Action:\x20delete');}else console[_0x2b9716(0x203)](a142_0x36e0df[_0x2b9716(0x21f)](_0x2b9716(0x1f0))+'\x20\x20'+a142_0x36e0df[_0x2b9716(0x1e7)](_0x2b9716(0x1f3)));console['log']('');_0x3c6129?(console[_0x2b9716(0x203)](a142_0x36e0df['cyan'](_0x2b9716(0x24d))+('\x20\x20'+a142_0x36e0df['yellow'](_0x3c6129[_0x2b9716(0x1de)])+'\x20→\x20keys:\x20'+_0x3c6129[_0x2b9716(0x233)]['join'](',\x20'))),console[_0x2b9716(0x203)](_0x2b9716(0x212))):console[_0x2b9716(0x203)](a142_0x36e0df['cyan'](_0x2b9716(0x24d))+'\x20\x20'+a142_0x36e0df[_0x2b9716(0x1e7)](_0x2b9716(0x248)));console[_0x2b9716(0x203)](''),console[_0x2b9716(0x203)](a142_0x36e0df['cyan'](_0x2b9716(0x24c))+('\x20\x20'+(_0xdf3b64?a142_0x36e0df['yellow'](_0x2b9716(0x208)):a142_0x36e0df[_0x2b9716(0x218)](_0x2b9716(0x227)))));_0xdf3b64&&console['log'](_0x2b9716(0x1d4)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x2b9716(0x203)]('');if(_0x5ccae9[_0x2b9716(0x213)]){const {currentVersion:_0x4bf27a,field:_0x2c09d6,pkgPath:_0x32c975}=_0x5ccae9[_0x2b9716(0x213)];console[_0x2b9716(0x203)](a142_0x36e0df[_0x2b9716(0x21f)]('@lovrabet/sdk:')+('\x20\x20'+a142_0x36e0df[_0x2b9716(0x21a)](_0x32c975))),console['log'](_0x2b9716(0x1d3)+_0x2c09d6+':\x20'+a142_0x36e0df[_0x2b9716(0x21a)](_0x4bf27a)+_0x2b9716(0x1e5)+a142_0x36e0df[_0x2b9716(0x218)](_0x2b9716(0x21b))),console[_0x2b9716(0x203)](_0x2b9716(0x20b));}else console[_0x2b9716(0x203)](a142_0x36e0df[_0x2b9716(0x21f)](_0x2b9716(0x250))+'\x20\x20'+a142_0x36e0df['gray'](_0x2b9716(0x1db)));console[_0x2b9716(0x203)]('');}function execConfigMigration(_0x342411,_0x2510f7){const _0x30f273=a142_0x572ac2,{configMigration:_0x5b2c8a}=_0x342411;if(!_0x5b2c8a?.['oldPath'])return{'step':0x1,'label':_0x30f273(0x1ea),'ok':!![],'detail':_0x30f273(0x236)};const _0x207ab1=readConfigFile(_0x5b2c8a[_0x30f273(0x1d8)]),_0x3b1123=resolve(_0x2510f7,NEW_CONFIG_NAME),_0x393de5=_0x5b2c8a[_0x30f273(0x202)]?readConfigFile(_0x3b1123):{};for(const [_0x3c89f7,_0x17efa0]of Object['entries'](_0x207ab1)){!(_0x3c89f7 in _0x393de5)&&(_0x393de5[_0x3c89f7]=_0x17efa0);}writeConfigFile(_0x3b1123,_0x393de5);const _0x4bf4b2=_0x5b2c8a['oldPath']+_0x30f273(0x1f4);return renameSync(_0x5b2c8a[_0x30f273(0x1d8)],_0x4bf4b2),{'step':0x1,'label':_0x30f273(0x1ea),'ok':!![],'detail':_0x5b2c8a['oldPath']+_0x30f273(0x1e5)+_0x3b1123+_0x30f273(0x244)+_0x4bf4b2+')'};}function execRemoveOldArtifacts(_0x4e3405){const _0x3c90cb=a142_0x572ac2,_0x4eb70e=[];for(const _0x24d31f of _0x4e3405){try{if(!existsSync(_0x24d31f))continue;const _0x484220=tryStat(_0x24d31f);_0x484220?.[_0x3c90cb(0x228)]()?rmSync(_0x24d31f,{'recursive':!![],'force':!![]}):unlinkSync(_0x24d31f);}catch(_0x47463d){_0x4eb70e[_0x3c90cb(0x24f)](_0x24d31f+':\x20'+_0x47463d['message']);}}return{'step':0x3,'label':_0x3c90cb(0x209),'ok':_0x4eb70e[_0x3c90cb(0x1f6)]===0x0,'detail':_0x4eb70e[_0x3c90cb(0x1f6)]>0x0?_0x4e3405['length']-_0x4eb70e[_0x3c90cb(0x1f6)]+'/'+_0x4e3405[_0x3c90cb(0x1f6)]+_0x3c90cb(0x246)+_0x4eb70e['join'](';\x20')+')':_0x4e3405[_0x3c90cb(0x1f6)]+_0x3c90cb(0x1eb)};}function execCleanMcp(_0x5d689c){const _0x4e12ee=a142_0x572ac2;if(!_0x5d689c['oldMcpConfig'])return{'step':0x4,'label':_0x4e12ee(0x1e2),'ok':!![],'detail':'skipped'};try{const _0x1d93b5=readFileSync(_0x5d689c[_0x4e12ee(0x1e9)][_0x4e12ee(0x1de)],_0x4e12ee(0x1e4)),_0xdd4637=JSON[_0x4e12ee(0x210)](_0x1d93b5);if(_0xdd4637?.[_0x4e12ee(0x1e6)]&&typeof _0xdd4637[_0x4e12ee(0x1e6)]===_0x4e12ee(0x1fc)){const _0x1e7d10=[];for(const [_0x2fad82,_0x3e49c5]of Object[_0x4e12ee(0x1d1)](_0xdd4637[_0x4e12ee(0x1e6)])){_0x3e49c5?.[_0x4e12ee(0x1d2)]&&Array[_0x4e12ee(0x245)](_0x3e49c5[_0x4e12ee(0x1d2)])&&_0x3e49c5[_0x4e12ee(0x1d2)]['some'](_0x623b20=>typeof _0x623b20===_0x4e12ee(0x22a)&&_0x623b20[_0x4e12ee(0x217)](_0x4e12ee(0x1df)))&&_0x1e7d10[_0x4e12ee(0x24f)](_0x2fad82);}for(const _0x5b481e of _0x1e7d10){delete _0xdd4637[_0x4e12ee(0x1e6)][_0x5b481e];}return _0x1e7d10[_0x4e12ee(0x1f6)]>0x0&&writeFileSync(_0x5d689c[_0x4e12ee(0x1e9)][_0x4e12ee(0x1de)],JSON['stringify'](_0xdd4637,null,0x2)+'\x0a',_0x4e12ee(0x1e4)),{'step':0x4,'label':_0x4e12ee(0x1e2),'ok':!![],'detail':_0x4e12ee(0x235)+_0x1e7d10[_0x4e12ee(0x205)](',\x20')+_0x4e12ee(0x216)+_0x5d689c[_0x4e12ee(0x1e9)][_0x4e12ee(0x1de)]};}return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x4e12ee(0x22e)};}catch(_0x22248b){return{'step':0x4,'label':_0x4e12ee(0x1e2),'ok':![],'detail':_0x22248b[_0x4e12ee(0x20e)]};}}function execSkillsRemove(_0x2e5150,_0x395756){const _0x213304=a142_0x572ac2,_0x5f1ce7=runNpxSkillsRemove(_0x2e5150,{'stdio':'inherit','yes':_0x395756});return{'step':0x5,'label':_0x213304(0x1f8),'ok':_0x5f1ce7['ok'],'detail':_0x5f1ce7['ok']?_0x213304(0x1d9):_0x5f1ce7[_0x213304(0x200)]??_0x213304(0x1ec)+_0x5f1ce7[_0x213304(0x21c)]};}function execSkillsAdd(_0x5981e1,_0x2a9c73){const _0x172bda=a142_0x572ac2,_0x22eeac=runNpxSkillsAddGlobal(_0x5981e1,_0x172bda(0x22d),{'stdio':_0x172bda(0x1e1),'yes':_0x2a9c73});return{'step':0x6,'label':'Install\x20new\x20skill','ok':_0x22eeac['ok'],'detail':_0x22eeac['ok']?_0x172bda(0x1ed):_0x22eeac['error']??_0x172bda(0x1ec)+_0x22eeac['status']};}function execUpgradeSdk(_0x263536){const _0x4f75c6=a142_0x572ac2;if(!_0x263536[_0x4f75c6(0x213)])return{'step':0x7,'label':_0x4f75c6(0x23e),'ok':!![],'detail':_0x4f75c6(0x247)};const {pkgPath:_0x1ca1af,currentVersion:_0x37990c,field:_0x40bd0e}=_0x263536[_0x4f75c6(0x213)];try{const _0x32cf75=readFileSync(_0x1ca1af,'utf8'),_0xd00559=JSON['parse'](_0x32cf75);return _0xd00559[_0x40bd0e][_0x4f75c6(0x1fd)]=_0x4f75c6(0x21b),writeFileSync(_0x1ca1af,JSON[_0x4f75c6(0x21e)](_0xd00559,null,0x2)+'\x0a',_0x4f75c6(0x1e4)),{'step':0x7,'label':_0x4f75c6(0x23e),'ok':!![],'detail':_0x40bd0e+_0x4f75c6(0x1dc)+_0x37990c+'\x20→\x20latest'};}catch(_0x58b877){return{'step':0x7,'label':_0x4f75c6(0x23e),'ok':![],'detail':_0x58b877['message']};}}function tryStat(_0x4b084a){try{return statSync(_0x4b084a);}catch{return undefined;}}function printSummary(_0x30402e){const _0x12a5b0=a142_0x572ac2;console[_0x12a5b0(0x203)](''),console[_0x12a5b0(0x203)](a142_0x36e0df['bold'](_0x12a5b0(0x22f))),console[_0x12a5b0(0x203)]('');for(const _0x1b18f2 of _0x30402e){const _0x276f3e=_0x1b18f2['ok']?a142_0x36e0df[_0x12a5b0(0x218)]('OK'):a142_0x36e0df[_0x12a5b0(0x229)](_0x12a5b0(0x241));console[_0x12a5b0(0x203)]('\x20\x20'+_0x276f3e+'\x20\x20Step\x20'+_0x1b18f2[_0x12a5b0(0x243)]+':\x20'+_0x1b18f2[_0x12a5b0(0x23d)]);if(_0x1b18f2[_0x12a5b0(0x231)])console[_0x12a5b0(0x203)]('\x20\x20\x20\x20\x20\x20\x20'+a142_0x36e0df[_0x12a5b0(0x1e7)](_0x1b18f2['detail']));}console[_0x12a5b0(0x203)]('');}export async function upgradeApp(_0x1299ba,_0x46a05b){const _0xe44ab8=a142_0x572ac2,_0x5183db=process['cwd'](),_0x1da033=analyse(_0x5183db),_0x3ec2ac=!_0x1da033[_0xe44ab8(0x222)]&&_0x1da033['oldArtifacts']['length']===0x0&&!_0x1da033[_0xe44ab8(0x1e9)]&&!_0x1da033[_0xe44ab8(0x23f)]&&!_0x1da033[_0xe44ab8(0x213)];if(_0x3ec2ac){console[_0xe44ab8(0x203)](a142_0x36e0df[_0xe44ab8(0x218)]('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0x1da033);const _0x49b97d=!!(_0x46a05b[_0xe44ab8(0x1fe)]||_0x46a05b['Y']||_0x1299ba);if(!_0x49b97d)try{const _0x2d23f8=await askConfirm(_0xe44ab8(0x237));if(!_0x2d23f8){console[_0xe44ab8(0x203)](a142_0x36e0df[_0xe44ab8(0x1e7)](_0xe44ab8(0x1ef)));return;}}catch(_0x3818de){if(_0x3818de?.[_0xe44ab8(0x20e)]===_0xe44ab8(0x1f1)){console['log'](a142_0x36e0df[_0xe44ab8(0x1e7)](_0xe44ab8(0x1ef)));return;}throw _0x3818de;}const _0x219b10=[],_0x4e4af9=a142_0xd30bc5({'text':_0xe44ab8(0x1f5),'color':_0xe44ab8(0x21f)})[_0xe44ab8(0x20c)](),_0xea10b1=execConfigMigration(_0x1da033,_0x5183db);_0x219b10[_0xe44ab8(0x24f)](_0xea10b1),_0x4e4af9[_0xea10b1['ok']?_0xe44ab8(0x1d5):'fail'](_0xe44ab8(0x1e3)+(_0xea10b1['detail']??(_0xea10b1['ok']?_0xe44ab8(0x201):_0xe44ab8(0x20f))));const _0x49df23=resolve(_0x5183db,'.lovrabet'),_0x43a070=a142_0xd30bc5({'text':'Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','color':_0xe44ab8(0x21f)})[_0xe44ab8(0x20c)]();if(existsSync(_0x49df23))try{rmSync(_0x49df23,{'recursive':!![],'force':!![]}),_0x43a070['succeed'](_0xe44ab8(0x1e0)),_0x219b10[_0xe44ab8(0x24f)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x28f5b0){_0x43a070['fail'](_0xe44ab8(0x239)+_0x28f5b0[_0xe44ab8(0x20e)]),_0x219b10[_0xe44ab8(0x24f)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':![],'detail':_0x28f5b0[_0xe44ab8(0x20e)]});}else _0x43a070[_0xe44ab8(0x242)](_0xe44ab8(0x1d6)),_0x219b10[_0xe44ab8(0x24f)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![],'detail':_0xe44ab8(0x24a)});const _0x5456a8=a142_0xd30bc5({'text':'Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':'cyan'})[_0xe44ab8(0x20c)](),_0x73afea=execRemoveOldArtifacts(_0x1da033['oldArtifacts']);_0x219b10[_0xe44ab8(0x24f)](_0x73afea),_0x5456a8[_0x73afea['ok']?'succeed':'fail'](_0xe44ab8(0x234)+(_0x73afea[_0xe44ab8(0x231)]??(_0x73afea['ok']?'done':'failed')));const _0x159239=a142_0xd30bc5({'text':_0xe44ab8(0x251),'color':_0xe44ab8(0x21f)})[_0xe44ab8(0x20c)](),_0x6bcceb=execCleanMcp(_0x1da033);_0x219b10[_0xe44ab8(0x24f)](_0x6bcceb),_0x159239[_0x6bcceb['ok']?'succeed':_0xe44ab8(0x206)]('Step\x204/7:\x20MCP\x20config\x20—\x20'+(_0x6bcceb[_0xe44ab8(0x231)]??(_0x6bcceb['ok']?'done':'failed')));const _0x443af7=a142_0xd30bc5({'text':_0xe44ab8(0x1fb),'color':_0xe44ab8(0x21f)})[_0xe44ab8(0x20c)](),_0xd839cd=execSkillsRemove(_0x5183db,_0x49b97d);_0x219b10[_0xe44ab8(0x24f)](_0xd839cd),_0x443af7[_0xd839cd['ok']?_0xe44ab8(0x1d5):_0xe44ab8(0x206)](_0xe44ab8(0x21d)+(_0xd839cd['detail']??(_0xd839cd['ok']?_0xe44ab8(0x201):_0xe44ab8(0x20f))));const _0x3dbbb8=a142_0xd30bc5({'text':'Step\x206/7:\x20Installing\x20new\x20skill...','color':_0xe44ab8(0x21f)})['start'](),_0x3a5bc4=execSkillsAdd(_0x5183db,_0x49b97d);_0x219b10[_0xe44ab8(0x24f)](_0x3a5bc4),_0x3dbbb8[_0x3a5bc4['ok']?_0xe44ab8(0x1d5):_0xe44ab8(0x206)](_0xe44ab8(0x1fa)+(_0x3a5bc4['detail']??(_0x3a5bc4['ok']?'done':_0xe44ab8(0x20f))));const _0x76040e=a142_0xd30bc5({'text':_0xe44ab8(0x23a),'color':_0xe44ab8(0x21f)})[_0xe44ab8(0x20c)](),_0x2abd21=execUpgradeSdk(_0x1da033);_0x219b10[_0xe44ab8(0x24f)](_0x2abd21),_0x76040e[_0x2abd21['ok']?_0xe44ab8(0x1d5):_0xe44ab8(0x206)]('Step\x207/7:\x20@lovrabet/sdk\x20—\x20'+(_0x2abd21[_0xe44ab8(0x231)]??(_0x2abd21['ok']?'done':_0xe44ab8(0x20f)))),printSummary(_0x219b10);const _0x204d40=_0x219b10[_0xe44ab8(0x1f9)](_0x4a9bda=>!_0x4a9bda['ok']);_0x204d40?console['log'](a142_0x36e0df[_0xe44ab8(0x21a)](_0xe44ab8(0x24e))):console[_0xe44ab8(0x203)](a142_0x36e0df[_0xe44ab8(0x218)](_0xe44ab8(0x220))),_0x2abd21['ok']&&_0x1da033[_0xe44ab8(0x213)]&&(console[_0xe44ab8(0x203)](''),console['log'](a142_0x36e0df[_0xe44ab8(0x20d)][_0xe44ab8(0x21f)](_0xe44ab8(0x249))),console[_0xe44ab8(0x203)](a142_0x36e0df[_0xe44ab8(0x21f)](_0xe44ab8(0x221))),console[_0xe44ab8(0x203)](''),console[_0xe44ab8(0x203)](a142_0x36e0df['white']('\x20\x20npm\x20install')),console[_0xe44ab8(0x203)](a142_0x36e0df[_0xe44ab8(0x1e8)](_0xe44ab8(0x1f7))),console[_0xe44ab8(0x203)](a142_0x36e0df[_0xe44ab8(0x1e8)](_0xe44ab8(0x20a))),console['log'](''));}