@lovrabet/rabetbase-cli 2.3.8 → 2.3.9-beta.1

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_0x4a94b9=a131_0x5391;(function(_0x2a64ee,_0x2224fe){const _0x17911f=a131_0x5391,_0x35e255=_0x2a64ee();while(!![]){try{const _0x346d79=-parseInt(_0x17911f(0x20b))/0x1*(parseInt(_0x17911f(0x1f4))/0x2)+parseInt(_0x17911f(0x1e4))/0x3+-parseInt(_0x17911f(0x204))/0x4*(-parseInt(_0x17911f(0x202))/0x5)+parseInt(_0x17911f(0x1f1))/0x6*(-parseInt(_0x17911f(0x21f))/0x7)+-parseInt(_0x17911f(0x1ee))/0x8*(-parseInt(_0x17911f(0x212))/0x9)+-parseInt(_0x17911f(0x203))/0xa*(parseInt(_0x17911f(0x20f))/0xb)+-parseInt(_0x17911f(0x222))/0xc*(-parseInt(_0x17911f(0x227))/0xd);if(_0x346d79===_0x2224fe)break;else _0x35e255['push'](_0x35e255['shift']());}catch(_0x293857){_0x35e255['push'](_0x35e255['shift']());}}}(a131_0x3973,0x4d647));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':'menu-id','type':a131_0x4a94b9(0x21b),'required':!![],'description':a131_0x4a94b9(0x201)};function a131_0x5391(_0x473b9d,_0x3467ea){_0x473b9d=_0x473b9d-0x1e0;const _0x3973a3=a131_0x3973();let _0x5391ab=_0x3973a3[_0x473b9d];return _0x5391ab;}export const ROLE_REF_FLAG={'name':a131_0x4a94b9(0x1e8),'type':a131_0x4a94b9(0x1ff),'required':!![],'description':'Role\x20id\x20or\x20role\x20name'};export const GRANT_FLAG={'name':'grant','type':'boolean','required':![],'description':a131_0x4a94b9(0x205)};export const REVOKE_FLAG={'name':a131_0x4a94b9(0x22f),'type':a131_0x4a94b9(0x1e6),'required':![],'description':a131_0x4a94b9(0x1f7)};export const MENUS_FLAG={'name':a131_0x4a94b9(0x214),'type':a131_0x4a94b9(0x1ff),'required':!![],'description':a131_0x4a94b9(0x1ed)};export const DATASETS_FLAG={'name':a131_0x4a94b9(0x1fc),'type':a131_0x4a94b9(0x1ff),'required':!![],'description':a131_0x4a94b9(0x20d)};export const PAGE_SLOT_SPECS=[{'flag':a131_0x4a94b9(0x1ec),'key':'menuPermit','allowSelf':![],'label':'menu\x20visibility'},{'flag':'create-roles','key':'dataCreate','allowSelf':![],'label':'data\x20create'},{'flag':a131_0x4a94b9(0x22a),'key':a131_0x4a94b9(0x22e),'allowSelf':![],'label':a131_0x4a94b9(0x21e)},{'flag':'delete-roles','key':'dataDelete','allowSelf':![],'label':a131_0x4a94b9(0x1ea)},{'flag':'detail-roles','key':a131_0x4a94b9(0x224),'allowSelf':![],'label':'data\x20detail'},{'flag':a131_0x4a94b9(0x1f2),'key':a131_0x4a94b9(0x1f3),'allowSelf':![],'label':a131_0x4a94b9(0x1e5)},{'flag':a131_0x4a94b9(0x231),'key':a131_0x4a94b9(0x226),'allowSelf':!![],'label':a131_0x4a94b9(0x1ef)}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a131_0x4a94b9(0x22d)](_0x17a9cf=>({'name':_0x17a9cf[a131_0x4a94b9(0x223)],'type':a131_0x4a94b9(0x1ff),'required':![],'description':a131_0x4a94b9(0x217)+_0x17a9cf[a131_0x4a94b9(0x1e0)]+a131_0x4a94b9(0x225)+(_0x17a9cf[a131_0x4a94b9(0x1f5)]?';\x20SELF\x20=\x20only\x20own\x20rows':'')}));export function splitList(_0x8c2e4e){const _0xaa6576=a131_0x4a94b9;return _0x8c2e4e['split'](',')['map'](_0x486932=>_0x486932['trim']())[_0xaa6576(0x220)](Boolean);}export function projectRoleRef(_0x3e7661){const _0x4276a8=a131_0x4a94b9;return{'id':_0x3e7661['id'],'roleName':_0x3e7661[_0x4276a8(0x1fe)],'roleType':_0x3e7661[_0x4276a8(0x213)]};}export async function resolvePermitRoles(_0x17500b,_0xf49332,_0x498133){const _0x2878eb=a131_0x4a94b9,_0x1bc3a1=await listPermitRoles(_0x17500b,{'needSelf':!![],'needPublic':!![]}),_0x21eecc=[];for(const _0x18da8b of _0xf49332){const _0x206aef=resolveOnePermitRole(_0x1bc3a1,_0x18da8b);if(!_0x498133['allowSelf']&&_0x206aef['roleType']===_0x2878eb(0x233))throw CliErrors[_0x2878eb(0x1f9)](_0x2878eb(0x229)+_0x498133['label']+'.',_0x2878eb(0x218));if(!_0x21eecc['some'](_0x356021=>_0x356021['id']===_0x206aef['id']))_0x21eecc[_0x2878eb(0x1e2)](_0x206aef);}return _0x21eecc;}function resolveOnePermitRole(_0x344e5a,_0x41ef6a){const _0x15171e=a131_0x4a94b9,_0x47537e=_0x41ef6a[_0x15171e(0x1f8)](),_0x1e6280=_0x47537e[_0x15171e(0x207)]();if(_0x1e6280===_0x15171e(0x233)||_0x1e6280==='ALL'){const _0x25b412=_0x344e5a[_0x15171e(0x22b)](_0x422fea=>_0x422fea[_0x15171e(0x213)]===_0x1e6280);if(!_0x25b412)throw CliErrors[_0x15171e(0x1f9)]('Special\x20role\x20'+_0x1e6280+_0x15171e(0x20c));return _0x25b412;}if(/^-?\d+$/[_0x15171e(0x209)](_0x47537e)){const _0x2fbcae=Number(_0x47537e),_0xf332f0=_0x344e5a['find'](_0x475247=>_0x475247['id']===_0x2fbcae);if(!_0xf332f0)throw CliErrors[_0x15171e(0x1f9)](_0x15171e(0x206)+_0x2fbcae+_0x15171e(0x21d),'Run\x20`role\x20list`.');return _0xf332f0;}const _0x35179e=_0x344e5a['filter'](_0x4aa4b5=>_0x4aa4b5[_0x15171e(0x1fe)]===_0x47537e);if(_0x35179e[_0x15171e(0x219)]===0x0)throw CliErrors[_0x15171e(0x1f9)]('Role\x20\x22'+_0x47537e+_0x15171e(0x1f6),'Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.');if(_0x35179e[_0x15171e(0x219)]>0x1)throw CliErrors[_0x15171e(0x1f9)](_0x15171e(0x1e7)+_0x47537e+_0x15171e(0x210)+_0x35179e['map'](_0x572055=>_0x572055['id'])[_0x15171e(0x230)](',\x20')+').','Disambiguate\x20with\x20an\x20id.');return _0x35179e[0x0];}export function projectPageSlot(_0xb18f74){const _0x285c72=a131_0x4a94b9;if(!_0xb18f74)return null;return{'resourceCode':_0xb18f74[_0x285c72(0x1eb)],'roles':(_0xb18f74[_0x285c72(0x21a)]??[])[_0x285c72(0x22d)](projectRoleRef)};}export function projectPagePermit(_0x20f5a6){const _0x1964ef=a131_0x4a94b9,_0x3b665a={'menuId':_0x20f5a6['menuId'],'appCode':_0x20f5a6[_0x1964ef(0x221)],'menuPermit':projectPageSlot(_0x20f5a6['menuPermit'])};for(const _0x4c3be0 of PAGE_SLOT_SPECS){if(_0x4c3be0[_0x1964ef(0x21c)]===_0x1964ef(0x216))continue;_0x3b665a[_0x4c3be0[_0x1964ef(0x21c)]]=projectPageSlot(_0x20f5a6[_0x4c3be0['key']]);}return _0x3b665a;}export function flattenMenuResources(_0x35ad53){const _0x6b8f71=new Map(),_0x576962=_0x178d82=>{const _0x44fd71=a131_0x5391;for(const _0x1f8cbf of _0x178d82??[]){_0x6b8f71[_0x44fd71(0x20e)](_0x1f8cbf[_0x44fd71(0x1eb)],{'resourceCode':_0x1f8cbf[_0x44fd71(0x1eb)],'resourceName':_0x1f8cbf[_0x44fd71(0x228)],'action':_0x1f8cbf[_0x44fd71(0x1fb)]?.[0x0]??'0'});if(_0x1f8cbf[_0x44fd71(0x208)])_0x576962(_0x1f8cbf[_0x44fd71(0x208)]);}};return _0x576962(_0x35ad53),_0x6b8f71;}export function flattenApiResources(_0x2996ee){const _0x252c29=a131_0x4a94b9,_0x314452=new Map(),_0x32617c=new Map();for(const _0x22fd1e of _0x2996ee){const _0x2b5155=_0x22fd1e[_0x252c29(0x1e3)]??{};for(const [_0x319bde,_0x19a97b]of Object[_0x252c29(0x1e1)](_0x2b5155)){_0x314452[_0x252c29(0x20e)](_0x319bde,{'resourceCode':_0x319bde,'resourceName':_0x22fd1e[_0x252c29(0x228)],'datasetCode':_0x22fd1e[_0x252c29(0x200)],'action':_0x19a97b?.[0x0]??'0'});const _0x4ad3c0=_0x32617c['get'](_0x22fd1e[_0x252c29(0x200)])??[];_0x4ad3c0[_0x252c29(0x1e2)](_0x319bde),_0x32617c['set'](_0x22fd1e['datasetCode'],_0x4ad3c0);}}return{'byCode':_0x314452,'byDataset':_0x32617c};}export function buildPermits(_0x13bc83,_0x188e92){const _0xbe510f=a131_0x4a94b9,_0x4f6172={};for(const [_0x3be027,_0x154640]of _0x13bc83){const _0x330dc0=_0x188e92[_0xbe510f(0x1f0)](_0x3be027)??_0x154640[_0xbe510f(0x215)];_0x4f6172[_0x3be027]=[_0x330dc0];}return _0x4f6172;}export function readRoleRef(_0x52298c){const _0x48d628=a131_0x4a94b9,_0x3b0a37=_0x52298c[_0x48d628(0x1fa)](_0x48d628(0x1e8))['trim']();if(!_0x3b0a37)throw CliErrors[_0x48d628(0x1fd)]('role',_0x48d628(0x211));return _0x3b0a37;}function a131_0x3973(){const _0x90f7d4=['Pass\x20--role\x20<id|name>.','28386IsHtRw','roleType','menus','action','menuPermit','Roles\x20for\x20','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','length','rolePermit','number','key','\x20not\x20found.','data\x20update','1757FuRzRp','filter','appCode','684khAhHf','flag','dataDetail','\x20(comma-separated\x20SELF/ALL/id/name)','dataPermit','56771sOJVZM','resourceName','SELF\x20is\x20not\x20allowed\x20for\x20','update-roles','find','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.','map','dataUpdate','revoke','join','row-roles','grant','SELF','access','label','entries','push','apiList','1093449zLsMro','data\x20export','boolean','Role\x20\x22','role','bool','data\x20delete','resourceCode','menu-roles','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','856PjScxI','row\x20visibility','get','1002vlVtlO','export-roles','dataExport','2252xGNmPC','allowSelf','\x22\x20not\x20found.','Revoke\x20access\x20to\x20the\x20listed\x20resources','trim','validation','str','allowedActions','datasets','flagMissing','roleName','string','datasetCode','Menu\x20id\x20(from\x20`menu\x20list`)','1135KUcLto','1610hvYzqf','956rIjYlL','Grant\x20access\x20to\x20the\x20listed\x20resources','Role\x20id\x20','toUpperCase','pageNodeList','test','Missing\x20action.','37fBZhJz','\x20is\x20not\x20available\x20for\x20this\x20app.','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','set','41305WWzivY','\x22\x20is\x20ambiguous\x20(ids:\x20'];a131_0x3973=function(){return _0x90f7d4;};return a131_0x3973();}export function readGrantRevoke(_0x48a3b4){const _0x4efd01=a131_0x4a94b9,_0x43676a=_0x48a3b4[_0x4efd01(0x1e9)](_0x4efd01(0x232)),_0x13c0d3=_0x48a3b4[_0x4efd01(0x1e9)]('revoke');if(_0x43676a&&_0x13c0d3)throw CliErrors['validation']('--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.');if(!_0x43676a&&!_0x13c0d3)throw CliErrors['validation'](_0x4efd01(0x20a),_0x4efd01(0x22c));return _0x43676a?_0x4efd01(0x234):'0';}
1
+ const a131_0x40ab0e=a131_0x2b72;(function(_0x253896,_0x31417d){const _0x11a91e=a131_0x2b72,_0x4420c6=_0x253896();while(!![]){try{const _0x23f656=-parseInt(_0x11a91e(0x134))/0x1+-parseInt(_0x11a91e(0x11d))/0x2*(parseInt(_0x11a91e(0x11e))/0x3)+-parseInt(_0x11a91e(0x116))/0x4*(-parseInt(_0x11a91e(0x104))/0x5)+parseInt(_0x11a91e(0x127))/0x6*(-parseInt(_0x11a91e(0x139))/0x7)+parseInt(_0x11a91e(0x115))/0x8*(-parseInt(_0x11a91e(0x13d))/0x9)+-parseInt(_0x11a91e(0xf8))/0xa*(parseInt(_0x11a91e(0xfe))/0xb)+parseInt(_0x11a91e(0x121))/0xc*(parseInt(_0x11a91e(0x10f))/0xd);if(_0x23f656===_0x31417d)break;else _0x4420c6['push'](_0x4420c6['shift']());}catch(_0x34cac7){_0x4420c6['push'](_0x4420c6['shift']());}}}(a131_0x3fab,0x3c57a));import{listPermitRoles}from'../../core/api-client.js';function a131_0x3fab(){const _0x26999c=['allowSelf','892TBWqSb','321XaEUst','access','set','12KIDswq','\x22\x20is\x20ambiguous\x20(ids:\x20','SELF','datasetCode','row-roles','\x22\x20not\x20found.','966JTMyqW','action','menuPermit','some','Role\x20\x22','data\x20detail','rolePermit','Menu\x20id\x20(from\x20`menu\x20list`)','Revoke\x20access\x20to\x20the\x20listed\x20resources','key','data\x20create','dataDelete','Role\x20id\x20or\x20role\x20name','363008pdsizL','menu\x20visibility','length','appCode','data\x20export','19502jabBoX','str','dataUpdate','Role\x20id\x20','3314583MPlTBg','create-roles','row\x20visibility','Roles\x20for\x20','data\x20update','validation','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.','dataCreate','join','pageNodeList','roleName','string','Pass\x20--role\x20<id|name>.','update-roles','test','roleType','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','\x20(comma-separated\x20SELF/ALL/id/name)','allowedActions','SELF\x20is\x20not\x20allowed\x20for\x20','apiList','export-roles','label','10MdjdGb','delete-roles','dataExport','filter','Run\x20`role\x20list`.','toUpperCase','1986402zyTJDx','menu-id','bool','get','push','ALL','115ibVNkl','find','resourceCode','datasets','flag','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','revoke',';\x20SELF\x20=\x20only\x20own\x20rows','split','grant','role','20600164PyFLjS','Disambiguate\x20with\x20an\x20id.','boolean','Missing\x20action.','\x20is\x20not\x20available\x20for\x20this\x20app.','resourceName','8rAyRcH','12292zYwiwO','entries','map','trim','detail-roles','flagMissing'];a131_0x3fab=function(){return _0x26999c;};return a131_0x3fab();}import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a131_0x40ab0e(0xff),'type':'number','required':!![],'description':a131_0x40ab0e(0x12e)};export const ROLE_REF_FLAG={'name':'role','type':a131_0x40ab0e(0x148),'required':!![],'description':a131_0x40ab0e(0x133)};export const GRANT_FLAG={'name':'grant','type':a131_0x40ab0e(0x111),'required':![],'description':'Grant\x20access\x20to\x20the\x20listed\x20resources'};export const REVOKE_FLAG={'name':a131_0x40ab0e(0x10a),'type':a131_0x40ab0e(0x111),'required':![],'description':a131_0x40ab0e(0x12f)};export const MENUS_FLAG={'name':'menus','type':'string','required':!![],'description':a131_0x40ab0e(0x109)};export const DATASETS_FLAG={'name':a131_0x40ab0e(0x107),'type':'string','required':!![],'description':'Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for'};function a131_0x2b72(_0x19eccc,_0x5921c2){_0x19eccc=_0x19eccc-0xee;const _0x3fab80=a131_0x3fab();let _0x2b72e1=_0x3fab80[_0x19eccc];return _0x2b72e1;}export const PAGE_SLOT_SPECS=[{'flag':'menu-roles','key':'menuPermit','allowSelf':![],'label':a131_0x40ab0e(0x135)},{'flag':a131_0x40ab0e(0x13e),'key':a131_0x40ab0e(0x144),'allowSelf':![],'label':a131_0x40ab0e(0x131)},{'flag':a131_0x40ab0e(0xee),'key':a131_0x40ab0e(0x13b),'allowSelf':![],'label':a131_0x40ab0e(0x141)},{'flag':a131_0x40ab0e(0xf9),'key':a131_0x40ab0e(0x132),'allowSelf':![],'label':'data\x20delete'},{'flag':a131_0x40ab0e(0x11a),'key':'dataDetail','allowSelf':![],'label':a131_0x40ab0e(0x12c)},{'flag':a131_0x40ab0e(0xf6),'key':a131_0x40ab0e(0xfa),'allowSelf':![],'label':a131_0x40ab0e(0x138)},{'flag':a131_0x40ab0e(0x125),'key':'dataPermit','allowSelf':!![],'label':a131_0x40ab0e(0x13f)}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a131_0x40ab0e(0x118)](_0x2380a7=>({'name':_0x2380a7[a131_0x40ab0e(0x108)],'type':a131_0x40ab0e(0x148),'required':![],'description':a131_0x40ab0e(0x140)+_0x2380a7[a131_0x40ab0e(0xf7)]+a131_0x40ab0e(0xf2)+(_0x2380a7[a131_0x40ab0e(0x11c)]?a131_0x40ab0e(0x10b):'')}));export function splitList(_0x48fb16){const _0x29085c=a131_0x40ab0e;return _0x48fb16[_0x29085c(0x10c)](',')[_0x29085c(0x118)](_0x19cb12=>_0x19cb12[_0x29085c(0x119)]())[_0x29085c(0xfb)](Boolean);}export function projectRoleRef(_0x23f187){const _0x582ab2=a131_0x40ab0e;return{'id':_0x23f187['id'],'roleName':_0x23f187[_0x582ab2(0x147)],'roleType':_0x23f187['roleType']};}export async function resolvePermitRoles(_0x17f574,_0x1f05cd,_0x43c9cd){const _0x1d6f42=a131_0x40ab0e,_0x21587d=await listPermitRoles(_0x17f574,{'needSelf':!![],'needPublic':!![]}),_0x26132d=[];for(const _0x5dc8e7 of _0x1f05cd){const _0x1aceac=resolveOnePermitRole(_0x21587d,_0x5dc8e7);if(!_0x43c9cd[_0x1d6f42(0x11c)]&&_0x1aceac['roleType']===_0x1d6f42(0x123))throw CliErrors[_0x1d6f42(0x142)](_0x1d6f42(0xf4)+_0x43c9cd[_0x1d6f42(0xf7)]+'.',_0x1d6f42(0xf1));if(!_0x26132d[_0x1d6f42(0x12a)](_0x291a67=>_0x291a67['id']===_0x1aceac['id']))_0x26132d[_0x1d6f42(0x102)](_0x1aceac);}return _0x26132d;}function resolveOnePermitRole(_0x51cb94,_0x46c3ac){const _0x281c61=a131_0x40ab0e,_0xc353a2=_0x46c3ac[_0x281c61(0x119)](),_0x55efbe=_0xc353a2[_0x281c61(0xfd)]();if(_0x55efbe===_0x281c61(0x123)||_0x55efbe===_0x281c61(0x103)){const _0x12a711=_0x51cb94[_0x281c61(0x105)](_0x3f316e=>_0x3f316e[_0x281c61(0xf0)]===_0x55efbe);if(!_0x12a711)throw CliErrors[_0x281c61(0x142)]('Special\x20role\x20'+_0x55efbe+_0x281c61(0x113));return _0x12a711;}if(/^-?\d+$/[_0x281c61(0xef)](_0xc353a2)){const _0x2be3aa=Number(_0xc353a2),_0x3ee75b=_0x51cb94[_0x281c61(0x105)](_0x40d75d=>_0x40d75d['id']===_0x2be3aa);if(!_0x3ee75b)throw CliErrors[_0x281c61(0x142)](_0x281c61(0x13c)+_0x2be3aa+'\x20not\x20found.',_0x281c61(0xfc));return _0x3ee75b;}const _0x399324=_0x51cb94[_0x281c61(0xfb)](_0x59bd23=>_0x59bd23['roleName']===_0xc353a2);if(_0x399324[_0x281c61(0x136)]===0x0)throw CliErrors[_0x281c61(0x142)](_0x281c61(0x12b)+_0xc353a2+_0x281c61(0x126),_0x281c61(0x143));if(_0x399324[_0x281c61(0x136)]>0x1)throw CliErrors[_0x281c61(0x142)](_0x281c61(0x12b)+_0xc353a2+_0x281c61(0x122)+_0x399324[_0x281c61(0x118)](_0x1953ce=>_0x1953ce['id'])[_0x281c61(0x145)](',\x20')+').',_0x281c61(0x110));return _0x399324[0x0];}export function projectPageSlot(_0x37379f){const _0x515b1a=a131_0x40ab0e;if(!_0x37379f)return null;return{'resourceCode':_0x37379f['resourceCode'],'roles':(_0x37379f[_0x515b1a(0x12d)]??[])[_0x515b1a(0x118)](projectRoleRef)};}export function projectPagePermit(_0x16e779){const _0x12df44=a131_0x40ab0e,_0xaeee97={'menuId':_0x16e779['menuId'],'appCode':_0x16e779[_0x12df44(0x137)],'menuPermit':projectPageSlot(_0x16e779[_0x12df44(0x129)])};for(const _0x2c56c3 of PAGE_SLOT_SPECS){if(_0x2c56c3[_0x12df44(0x130)]===_0x12df44(0x129))continue;_0xaeee97[_0x2c56c3[_0x12df44(0x130)]]=projectPageSlot(_0x16e779[_0x2c56c3[_0x12df44(0x130)]]);}return _0xaeee97;}export function flattenMenuResources(_0x57aeff){const _0x3fbfa5=new Map(),_0xdd1a3d=_0x48e0c9=>{const _0x158ab9=a131_0x2b72;for(const _0x59dcf1 of _0x48e0c9??[]){_0x3fbfa5[_0x158ab9(0x120)](_0x59dcf1[_0x158ab9(0x106)],{'resourceCode':_0x59dcf1[_0x158ab9(0x106)],'resourceName':_0x59dcf1[_0x158ab9(0x114)],'action':_0x59dcf1[_0x158ab9(0xf3)]?.[0x0]??'0'});if(_0x59dcf1[_0x158ab9(0x146)])_0xdd1a3d(_0x59dcf1[_0x158ab9(0x146)]);}};return _0xdd1a3d(_0x57aeff),_0x3fbfa5;}export function flattenApiResources(_0x212a9c){const _0x90d358=a131_0x40ab0e,_0xd272a3=new Map(),_0x2983cc=new Map();for(const _0x508c92 of _0x212a9c){const _0x1167bf=_0x508c92[_0x90d358(0xf5)]??{};for(const [_0x4cfbf5,_0x5c0d83]of Object[_0x90d358(0x117)](_0x1167bf)){_0xd272a3[_0x90d358(0x120)](_0x4cfbf5,{'resourceCode':_0x4cfbf5,'resourceName':_0x508c92[_0x90d358(0x114)],'datasetCode':_0x508c92[_0x90d358(0x124)],'action':_0x5c0d83?.[0x0]??'0'});const _0x4a61d3=_0x2983cc[_0x90d358(0x101)](_0x508c92[_0x90d358(0x124)])??[];_0x4a61d3['push'](_0x4cfbf5),_0x2983cc[_0x90d358(0x120)](_0x508c92[_0x90d358(0x124)],_0x4a61d3);}}return{'byCode':_0xd272a3,'byDataset':_0x2983cc};}export function buildPermits(_0xc2abc8,_0x235a54){const _0x3ade52=a131_0x40ab0e,_0x4f95f2={};for(const [_0x69e2b2,_0x477012]of _0xc2abc8){const _0x2303ed=_0x235a54['get'](_0x69e2b2)??_0x477012[_0x3ade52(0x128)];_0x4f95f2[_0x69e2b2]=[_0x2303ed];}return _0x4f95f2;}export function readRoleRef(_0x55d282){const _0x1ce608=a131_0x40ab0e,_0x48ef77=_0x55d282[_0x1ce608(0x13a)]('role')[_0x1ce608(0x119)]();if(!_0x48ef77)throw CliErrors[_0x1ce608(0x11b)](_0x1ce608(0x10e),_0x1ce608(0x149));return _0x48ef77;}export function readGrantRevoke(_0x59c8be){const _0x2db4d3=a131_0x40ab0e,_0x52a019=_0x59c8be['bool'](_0x2db4d3(0x10d)),_0x3386da=_0x59c8be[_0x2db4d3(0x100)](_0x2db4d3(0x10a));if(_0x52a019&&_0x3386da)throw CliErrors[_0x2db4d3(0x142)]('--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.');if(!_0x52a019&&!_0x3386da)throw CliErrors[_0x2db4d3(0x142)](_0x2db4d3(0x112),'Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.');return _0x52a019?_0x2db4d3(0x11f):'0';}
@@ -1 +1 @@
1
- (function(_0x47eb09,_0x216956){const _0x29f36e=a132_0x1e95,_0x52ad1c=_0x47eb09();while(!![]){try{const _0xd711d2=parseInt(_0x29f36e(0xd9))/0x1+parseInt(_0x29f36e(0xe8))/0x2+parseInt(_0x29f36e(0xec))/0x3+parseInt(_0x29f36e(0xf3))/0x4*(parseInt(_0x29f36e(0xea))/0x5)+parseInt(_0x29f36e(0xeb))/0x6*(parseInt(_0x29f36e(0xda))/0x7)+parseInt(_0x29f36e(0xe0))/0x8*(parseInt(_0x29f36e(0xdc))/0x9)+parseInt(_0x29f36e(0xed))/0xa*(-parseInt(_0x29f36e(0xf2))/0xb);if(_0xd711d2===_0x216956)break;else _0x52ad1c['push'](_0x52ad1c['shift']());}catch(_0xfb4d90){_0x52ad1c['push'](_0x52ad1c['shift']());}}}(a132_0x3804,0x6b522));import{existsSync}from'node:fs';function a132_0x1e95(_0x2e79ae,_0x404d3a){_0x2e79ae=_0x2e79ae-0xd9;const _0x3804ab=a132_0x3804();let _0x1e95ba=_0x3804ab[_0x2e79ae];return _0x1e95ba;}import a132_0x143d6b from'node:path';import a132_0x14d8a3 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_0x3804(){const _0x157741=['Project\x20name:','length','string','my-app','production','Logged\x20in','45600OhGNQz','env','3339455nMosjw','392148DrrqfI','2076912AMDtaU','10lLrmoN','cwd','√\x20Login\x20status:\x20','green','test','17044621OnmTgE','4aNQBQV','321217jpTZQA','7HMnuXb','trim','179613oyqhra','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','cyan','Not\x20set','88NwshJD','log'];a132_0x3804=function(){return _0x157741;};return a132_0x3804();}export async function guidedCreateProject(_0x17f3e0,_0x5402e1,_0x4b8bb9){const _0x4e9b1c=a132_0x1e95,_0x551090=_0x4e9b1c(0xe5),_0x236dfd=readConfig(),_0x54cc62=typeof _0x236dfd[_0x4e9b1c(0xe9)]===_0x4e9b1c(0xe4)?_0x236dfd[_0x4e9b1c(0xe9)]:undefined,_0x6f988a=await input({'message':_0x4e9b1c(0xe2),'default':_0x551090,'validate':_0x1a0d2c=>{const _0x1344b0=_0x4e9b1c,_0x5177aa=_0x1a0d2c[_0x1344b0(0xdb)]()||_0x551090;if(_0x5177aa[_0x1344b0(0xe3)]>0x32)return'Project\x20name\x20cannot\x20exceed\x2050\x20characters';const _0x696f98=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x5177aa&&!_0x696f98[_0x1344b0(0xf1)](_0x5177aa))return'Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_';const _0x282db7=a132_0x143d6b['resolve'](process[_0x1344b0(0xee)](),_0x5177aa);if(existsSync(_0x282db7))return'Directory\x20\x22'+_0x5177aa+'\x22\x20already\x20exists';return!![];}});console[_0x4e9b1c(0xe1)](a132_0x14d8a3[_0x4e9b1c(0xf0)]('√\x20Project\x20Name:\x20'+a132_0x14d8a3[_0x4e9b1c(0xde)](_0x6f988a)));const _0x47ddec=await selectSingleAppcode(_0x4b8bb9);console['log'](a132_0x14d8a3[_0x4e9b1c(0xf0)]('√\x20App\x20Code:\x20'+a132_0x14d8a3[_0x4e9b1c(0xde)](_0x47ddec||_0x4e9b1c(0xdf))));if(_0x47ddec){const _0x2d9d7d=await getIsSessionValid();if(!_0x2d9d7d){const _0x4d370d=await confirm({'message':_0x4e9b1c(0xdd),'default':!![]});if(_0x4d370d){const _0x344899=await authServer({'silent':!![]});console['log'](a132_0x14d8a3[_0x4e9b1c(0xf0)]('√\x20Login\x20status:\x20'+a132_0x14d8a3[_0x4e9b1c(0xde)](_0x344899?_0x4e9b1c(0xe7):'Login\x20failed')));}else console[_0x4e9b1c(0xe1)](a132_0x14d8a3['green'](_0x4e9b1c(0xef)+a132_0x14d8a3[_0x4e9b1c(0xde)]('Skipped')));}await _0x17f3e0({'projectName':_0x6f988a,'appCode':_0x47ddec,'env':_0x5402e1||_0x54cc62||_0x4e9b1c(0xe6)});}else await _0x17f3e0({'projectName':_0x6f988a,'env':_0x5402e1||_0x54cc62||_0x4e9b1c(0xe6)});}
1
+ (function(_0x22ebba,_0xe9d9d0){const _0x2cd232=a132_0x4af4,_0x46721d=_0x22ebba();while(!![]){try{const _0x54bca7=-parseInt(_0x2cd232(0x203))/0x1+parseInt(_0x2cd232(0x1f5))/0x2*(parseInt(_0x2cd232(0x1f8))/0x3)+-parseInt(_0x2cd232(0x207))/0x4+-parseInt(_0x2cd232(0x1f0))/0x5+parseInt(_0x2cd232(0x200))/0x6+-parseInt(_0x2cd232(0x1fb))/0x7*(-parseInt(_0x2cd232(0x1ef))/0x8)+parseInt(_0x2cd232(0x1fe))/0x9;if(_0x54bca7===_0xe9d9d0)break;else _0x46721d['push'](_0x46721d['shift']());}catch(_0x20df7e){_0x46721d['push'](_0x46721d['shift']());}}}(a132_0x4fca,0x917c5));import{existsSync}from'node:fs';import a132_0x1937a2 from'node:path';import a132_0xc4b68d from'chalk';import{input,confirm}from'@inquirer/prompts';function a132_0x4af4(_0x3a6ccb,_0x42dfc0){_0x3a6ccb=_0x3a6ccb-0x1ee;const _0x4fcac6=a132_0x4fca();let _0x4af4de=_0x4fcac6[_0x3a6ccb];return _0x4af4de;}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_0x4fca(){const _0x2d1b8e=['trim','log','green','3986300yPmbxd','√\x20App\x20Code:\x20','√\x20Login\x20status:\x20','resolve','Directory\x20\x22','Not\x20set','16XhhHJU','1929540EevUyV','string','env','cwd','√\x20Project\x20Name:\x20','2OUxMgI','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','cyan','2116218tUjjfs','production','test','1208284PWTzKE','Login\x20failed','Project\x20name:','16992171xOOBQJ','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','286224FpxNAV','Logged\x20in','Skipped','1007961Xvqxqe'];a132_0x4fca=function(){return _0x2d1b8e;};return a132_0x4fca();}export async function guidedCreateProject(_0x1385ea,_0x543b83,_0x59f92a){const _0x29d91b=a132_0x4af4,_0x2026fd='my-app',_0x3d7813=readConfig(),_0x57a99e=typeof _0x3d7813[_0x29d91b(0x1f2)]===_0x29d91b(0x1f1)?_0x3d7813['env']:undefined,_0x3d2c97=await input({'message':_0x29d91b(0x1fd),'default':_0x2026fd,'validate':_0x196af8=>{const _0x5e20ce=_0x29d91b,_0xae7f3f=_0x196af8[_0x5e20ce(0x204)]()||_0x2026fd;if(_0xae7f3f['length']>0x32)return'Project\x20name\x20cannot\x20exceed\x2050\x20characters';const _0x49618a=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0xae7f3f&&!_0x49618a[_0x5e20ce(0x1fa)](_0xae7f3f))return _0x5e20ce(0x1ff);const _0x1cec31=a132_0x1937a2[_0x5e20ce(0x20a)](process[_0x5e20ce(0x1f3)](),_0xae7f3f);if(existsSync(_0x1cec31))return _0x5e20ce(0x20b)+_0xae7f3f+'\x22\x20already\x20exists';return!![];}});console['log'](a132_0xc4b68d[_0x29d91b(0x206)](_0x29d91b(0x1f4)+a132_0xc4b68d[_0x29d91b(0x1f7)](_0x3d2c97)));const _0x16aebb=await selectSingleAppcode(_0x59f92a);console[_0x29d91b(0x205)](a132_0xc4b68d['green'](_0x29d91b(0x208)+a132_0xc4b68d[_0x29d91b(0x1f7)](_0x16aebb||_0x29d91b(0x1ee))));if(_0x16aebb){const _0x381d68=await getIsSessionValid();if(!_0x381d68){const _0x2519fe=await confirm({'message':_0x29d91b(0x1f6),'default':!![]});if(_0x2519fe){const _0x245672=await authServer({'silent':!![]});console[_0x29d91b(0x205)](a132_0xc4b68d[_0x29d91b(0x206)]('√\x20Login\x20status:\x20'+a132_0xc4b68d['cyan'](_0x245672?_0x29d91b(0x201):_0x29d91b(0x1fc))));}else console[_0x29d91b(0x205)](a132_0xc4b68d[_0x29d91b(0x206)](_0x29d91b(0x209)+a132_0xc4b68d[_0x29d91b(0x1f7)](_0x29d91b(0x202))));}await _0x1385ea({'projectName':_0x3d2c97,'appCode':_0x16aebb,'env':_0x543b83||_0x57a99e||_0x29d91b(0x1f9)});}else await _0x1385ea({'projectName':_0x3d2c97,'env':_0x543b83||_0x57a99e||'production'});}
@@ -1 +1 @@
1
- function a133_0x1f61(_0x273da0,_0x585ff5){_0x273da0=_0x273da0-0xda;const _0x28f81c=a133_0x28f8();let _0x1f61e4=_0x28f81c[_0x273da0];return _0x1f61e4;}(function(_0x1a6fda,_0x5cfb4f){const _0x1b6d05=a133_0x1f61,_0x58f83f=_0x1a6fda();while(!![]){try{const _0x5a9f25=parseInt(_0x1b6d05(0xdd))/0x1+parseInt(_0x1b6d05(0xe2))/0x2*(-parseInt(_0x1b6d05(0xdb))/0x3)+parseInt(_0x1b6d05(0xe4))/0x4*(parseInt(_0x1b6d05(0xe6))/0x5)+parseInt(_0x1b6d05(0xe5))/0x6+-parseInt(_0x1b6d05(0xe3))/0x7+-parseInt(_0x1b6d05(0xdf))/0x8*(parseInt(_0x1b6d05(0xe0))/0x9)+parseInt(_0x1b6d05(0xdc))/0xa*(parseInt(_0x1b6d05(0xde))/0xb);if(_0x5a9f25===_0x5cfb4f)break;else _0x58f83f['push'](_0x58f83f['shift']());}catch(_0x135499){_0x58f83f['push'](_0x58f83f['shift']());}}}(a133_0x28f8,0x54ba3));export function formatElapsed(_0x75f67b){const _0x5b9c1e=a133_0x1f61,_0xeaea89=Date[_0x5b9c1e(0xe1)]()-_0x75f67b;if(_0xeaea89<0x3e8)return _0xeaea89+'ms';const _0x2d623c=(_0xeaea89/0x3e8)[_0x5b9c1e(0xda)](0x2),_0x2d83eb=_0x2d623c['replace'](/\.?0+$/u,'');return _0x2d83eb+'s';}function a133_0x28f8(){const _0x27dd53=['213126TFfSLQ','499935XFJJAR','toFixed','6GMCqcE','459140jzJPMJ','181849RbGVnh','209Yunuml','5488448nDFycj','9rHfhBc','now','292286CfETqj','450184Bxdljb','12nftGSU'];a133_0x28f8=function(){return _0x27dd53;};return a133_0x28f8();}
1
+ function a133_0x17bd(_0x48f2fb,_0x12f683){_0x48f2fb=_0x48f2fb-0x133;const _0x17cbfd=a133_0x17cb();let _0x17bd75=_0x17cbfd[_0x48f2fb];return _0x17bd75;}(function(_0xdab117,_0xb6999b){const _0x529e18=a133_0x17bd,_0x5609ec=_0xdab117();while(!![]){try{const _0x2670cf=parseInt(_0x529e18(0x136))/0x1*(-parseInt(_0x529e18(0x133))/0x2)+parseInt(_0x529e18(0x137))/0x3*(parseInt(_0x529e18(0x13d))/0x4)+-parseInt(_0x529e18(0x13b))/0x5*(-parseInt(_0x529e18(0x134))/0x6)+-parseInt(_0x529e18(0x13c))/0x7+-parseInt(_0x529e18(0x138))/0x8+parseInt(_0x529e18(0x13a))/0x9*(-parseInt(_0x529e18(0x139))/0xa)+-parseInt(_0x529e18(0x140))/0xb*(-parseInt(_0x529e18(0x135))/0xc);if(_0x2670cf===_0xb6999b)break;else _0x5609ec['push'](_0x5609ec['shift']());}catch(_0x27e44f){_0x5609ec['push'](_0x5609ec['shift']());}}}(a133_0x17cb,0xd3331));export function formatElapsed(_0x4fc480){const _0x294a02=a133_0x17bd,_0x3c43d1=Date['now']()-_0x4fc480;if(_0x3c43d1<0x3e8)return _0x3c43d1+'ms';const _0x179ca8=(_0x3c43d1/0x3e8)[_0x294a02(0x13e)](0x2),_0x1f1c04=_0x179ca8[_0x294a02(0x13f)](/\.?0+$/u,'');return _0x1f1c04+'s';}function a133_0x17cb(){const _0x10a8dd=['toFixed','replace','1969YIODJH','2SxgPMT','6bkmkFn','169284euLuCj','684949TWLpwR','94923ooMhir','12932128wLKAnf','40KgwNFg','1851327fUhxeM','4673785pILmBF','280686sKBLjU','72gMwUuN'];a133_0x17cb=function(){return _0x10a8dd;};return a133_0x17cb();}
@@ -1 +1 @@
1
- (function(_0x120a50,_0xa6a7b1){const _0x3c607b=a134_0x4c76,_0x35c158=_0x120a50();while(!![]){try{const _0x4c1cee=parseInt(_0x3c607b(0x1c1))/0x1*(parseInt(_0x3c607b(0x1ad))/0x2)+-parseInt(_0x3c607b(0x183))/0x3+parseInt(_0x3c607b(0x18f))/0x4*(parseInt(_0x3c607b(0x197))/0x5)+-parseInt(_0x3c607b(0x195))/0x6+-parseInt(_0x3c607b(0x1d1))/0x7*(parseInt(_0x3c607b(0x186))/0x8)+parseInt(_0x3c607b(0x1ab))/0x9*(-parseInt(_0x3c607b(0x1cc))/0xa)+parseInt(_0x3c607b(0x1c8))/0xb;if(_0x4c1cee===_0xa6a7b1)break;else _0x35c158['push'](_0x35c158['shift']());}catch(_0x267417){_0x35c158['push'](_0x35c158['shift']());}}}(a134_0xb8b6,0x73221));import a134_0x26dc1b from'path';import a134_0xa3a209 from'fs';import a134_0x23f772 from'chalk';import a134_0x3c4a37 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';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';function a134_0x4c76(_0x39e66d,_0x3456a0){_0x39e66d=_0x39e66d-0x182;const _0xb8b663=a134_0xb8b6();let _0x4c76f7=_0xb8b663[_0x39e66d];return _0x4c76f7;}import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x5995b3){const _0x3ccec8=a134_0x4c76,_0x280519=await checkCliVersion();(_0x280519['needsUpgrade']||_0x280519[_0x3ccec8(0x1b0)])&&(printCliUpgradeWarning(_0x280519),assertCliVersionSupported(_0x280519),logger[_0x3ccec8(0x1d2)](_0x3ccec8(0x1a3),_0x3ccec8(0x193),{'currentVersion':_0x280519[_0x3ccec8(0x192)],'stableVersion':_0x280519[_0x3ccec8(0x18a)],'minimumVersion':_0x280519[_0x3ccec8(0x182)],'needsUpgrade':_0x280519['needsUpgrade'],'belowMinimum':_0x280519[_0x3ccec8(0x1b0)]}));if(_0x5995b3[_0x3ccec8(0x1a2)]&&_0x5995b3[_0x3ccec8(0x1a7)])await runCreate({'projectName':_0x5995b3['projectCode'],'appCode':_0x5995b3[_0x3ccec8(0x1a7)],'env':_0x5995b3[_0x3ccec8(0x1d0)]},_0x5995b3);else{if(_0x5995b3[_0x3ccec8(0x1a2)]){const _0x167d95=await selectSingleAppcode(_0x5995b3['cookie']);await runCreate({'projectName':_0x5995b3[_0x3ccec8(0x1a2)],'appCode':_0x167d95||undefined,'env':_0x5995b3[_0x3ccec8(0x1d0)]},_0x5995b3);}else await guidedCreateProject(_0x24b13d=>runCreate(_0x24b13d,_0x5995b3),_0x5995b3[_0x3ccec8(0x1d0)],_0x5995b3[_0x3ccec8(0x1b8)]);}}async function runCreate(_0x50fac6,_0x1617bf){const _0x4862fb=a134_0x4c76;if(!_0x50fac6[_0x4862fb(0x1a8)]||_0x50fac6[_0x4862fb(0x1a8)][_0x4862fb(0x1bd)]()==='')throw new Error('Project\x20name\x20cannot\x20be\x20empty');const _0x173ea5=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x173ea5['test'](_0x50fac6[_0x4862fb(0x1a8)]))throw new Error(_0x4862fb(0x19c));if(_0x50fac6['projectName'][_0x4862fb(0x1db)]>0x64)throw new Error('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters');const _0x43305c=a134_0x26dc1b[_0x4862fb(0x198)](process['cwd'](),_0x50fac6[_0x4862fb(0x1a8)]);if(a134_0xa3a209[_0x4862fb(0x1af)](_0x43305c))throw new Error(_0x4862fb(0x1b7)+_0x50fac6[_0x4862fb(0x1a8)]+_0x4862fb(0x1d4));try{a134_0xa3a209[_0x4862fb(0x1bc)](a134_0x26dc1b[_0x4862fb(0x1d5)](_0x43305c),a134_0xa3a209[_0x4862fb(0x1bf)][_0x4862fb(0x1c3)]);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger[_0x4862fb(0x1ae)](_0x43305c),logger['info'](_0x4862fb(0x1a3),_0x4862fb(0x1da)+_0x50fac6[_0x4862fb(0x1a8)],{'projectDir':_0x43305c,'appCode':_0x50fac6['appCode']}),console[_0x4862fb(0x199)](),console[_0x4862fb(0x199)](a134_0x23f772[_0x4862fb(0x1c4)](_0x4862fb(0x1cd))+'Project\x20name:\x20'+a134_0x23f772[_0x4862fb(0x1c4)](_0x50fac6[_0x4862fb(0x1a8)])+(_0x50fac6[_0x4862fb(0x1a7)]?_0x4862fb(0x1c5)+a134_0x23f772[_0x4862fb(0x19f)](_0x50fac6[_0x4862fb(0x1a7)]):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x50fac6[_0x4862fb(0x1a8)])),await updatePackageJsonName(_0x50fac6[_0x4862fb(0x1a8)]),await runTask(_0x4862fb(0x1c9),()=>installDependencies(_0x50fac6[_0x4862fb(0x1a8)])),await runTask(_0x4862fb(0x1a1),()=>formatProjectCode(_0x50fac6[_0x4862fb(0x1a8)])),await configureAppCode(_0x50fac6[_0x4862fb(0x1a8)],_0x50fac6[_0x4862fb(0x1a7)]||'',_0x50fac6[_0x4862fb(0x1d0)]);let _0x24b07a=![];if(_0x50fac6[_0x4862fb(0x1a7)]){console[_0x4862fb(0x199)](_0x4862fb(0x1ce));const _0x46f2d3=process[_0x4862fb(0x1d3)]();try{process['chdir'](_0x43305c);const _0xb9efaa=_0x50fac6[_0x4862fb(0x1d0)]||'production';initEnv(_0xb9efaa);const {configArray:_0x1ed31c}=await fetchModelList(_0x50fac6[_0x4862fb(0x1a7)],_0x1617bf[_0x4862fb(0x1b8)]||''),_0x43ef56=DEFAULT_API_DIR,_0xfe9907=await generateApiFile(_0x1ed31c,'',_0x50fac6['appCode'],!![],_0xb9efaa,_0x43ef56);console[_0x4862fb(0x199)]('√\x20Pulled\x20'+_0x1ed31c[_0x4862fb(0x1db)]+_0x4862fb(0x18d)+_0xfe9907['modelCount']+_0x4862fb(0x1a4)),logger[_0x4862fb(0x1d2)]('create',_0x4862fb(0x1c7)+_0x50fac6[_0x4862fb(0x1a7)]);}catch(_0x34cb5b){_0x24b07a=!![],console[_0x4862fb(0x199)](_0x4862fb(0x1b2)),logger[_0x4862fb(0x1b3)](_0x4862fb(0x1a3),_0x4862fb(0x1cb),{'error':_0x34cb5b instanceof Error?_0x34cb5b['message']:String(_0x34cb5b)});}finally{process[_0x4862fb(0x19a)](_0x46f2d3);}}logger[_0x4862fb(0x1d8)](_0x4862fb(0x1a3),_0x4862fb(0x1c2)+_0x50fac6['projectName']),console[_0x4862fb(0x199)](),console[_0x4862fb(0x199)](a134_0x23f772[_0x4862fb(0x1c4)]('─'[_0x4862fb(0x189)](0x3c))),console[_0x4862fb(0x199)](a134_0x23f772['cyan'][_0x4862fb(0x184)](_0x4862fb(0x1b1))),console['log'](),console[_0x4862fb(0x199)]('\x20\x201.\x20Start\x20project:\x20'+a134_0x23f772[_0x4862fb(0x19f)]['bold'](_0x4862fb(0x18c)+_0x50fac6[_0x4862fb(0x1a8)]+_0x4862fb(0x194)+CLI_BIN_NAME+'\x20run\x20start')),_0x24b07a&&console[_0x4862fb(0x199)](_0x4862fb(0x1bb)+a134_0x23f772[_0x4862fb(0x19f)][_0x4862fb(0x184)](CLI_BIN_NAME+'\x20api\x20pull')),console[_0x4862fb(0x199)](a134_0x23f772[_0x4862fb(0x1c4)]('─'[_0x4862fb(0x189)](0x3c)));}catch(_0xcd2546){logger[_0x4862fb(0x19e)](_0x4862fb(0x1a3),_0x4862fb(0x1cf)+_0x50fac6['projectName'],{'error':_0xcd2546 instanceof Error?_0xcd2546[_0x4862fb(0x191)]:String(_0xcd2546)});try{a134_0xa3a209[_0x4862fb(0x1af)](_0x43305c)&&(console[_0x4862fb(0x199)]('*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20'+_0x43305c),a134_0xa3a209[_0x4862fb(0x18b)](_0x43305c,{'recursive':!![],'force':!![]}));}catch{logger['warn']('create',_0x4862fb(0x1ac)+_0x43305c);}throw _0xcd2546;}}function a134_0xb8b6(){const _0x3ffac7=['belowMinimum','🚀\x20Next\x20Steps:','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','warn','fail','*\x20Configuring\x20AppCode\x20for\x20project\x20','defaultApp','Project\x20directory\x20','cookie','parse','toLocaleString','\x20\x202.\x20Pull\x20API\x20configuration:\x20','accessSync','trim','1.0.0','constants','更新\x20package.json\x20失败','360619GNUcbY','项目创建完成:\x20','W_OK','green','\x20|\x20AppCode:\x20','apps','API\x20configuration\x20pulled:\x20','12782506kfytUl','Install\x20dependencies','\x20config\x20set\x20appcode\x20<app-code>\x27','API\x20配置拉取异常','1510180FdeYtr','\x20√\x20','*\x20Pulling\x20API\x20configuration...','项目创建失败:\x20','env','182OKvBRf','info','cwd','\x20already\x20exists','dirname','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','description','success','配置应用AppCode失败','开始创建项目:\x20','length','name','minimumVersion','838200KiEndt','bold','utf8','197368wCvWfo','√\x20package.json\x20updated:\x20name=','√\x20Configuration\x20file\x20created,\x20Apps:\x20','repeat','stableVersion','rmSync','cd\x20','\x20dataset(s),\x20generated\x20','package.json','2692276ruRRlx','version','message','currentVersion','CLI\x20版本检查','\x20&&\x20','3007602hNlVBv','start','5gaOnQO','resolve','log','chdir','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','配置应用AppCode:\x20','error','cyan','\x20Generated\x20by\x20rabetbase\x20cli\x20','Format\x20code','projectCode','create','\x20model(s)','更新\x20package.json\x20name','keys','appCode','projectName','join','readFileSync','18GeLjYy','清理项目目录失败:\x20','2nHUNHF','setLogPath','existsSync'];a134_0xb8b6=function(){return _0x3ffac7;};return a134_0xb8b6();}async function runTask(_0x2c0c80,_0x38137a){const _0x52d726=a134_0x4c76,_0x5a3057=a134_0x3c4a37(_0x2c0c80+'...')[_0x52d726(0x196)]();try{const _0x4becc2=await _0x38137a();_0x5a3057['stop'](),console[_0x52d726(0x199)](''+a134_0x23f772['green']('\x20√\x20')+_0x2c0c80+'\x20'+a134_0x23f772['gray']('['+_0x4becc2+']'));}catch(_0x22e33d){_0x5a3057[_0x52d726(0x1b4)](_0x2c0c80);throw _0x22e33d;}}async function updatePackageJsonName(_0x48270a){const _0xf6b509=a134_0x4c76,_0xbefbe3=a134_0x26dc1b[_0xf6b509(0x198)](process[_0xf6b509(0x1d3)](),_0x48270a),_0x4912a0=a134_0x26dc1b[_0xf6b509(0x1a9)](_0xbefbe3,'package.json');try{console['log']('*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields');const _0x11783a=getRabetbaseCliPackageRoot(),_0x203766=a134_0x26dc1b['join'](_0x11783a,_0xf6b509(0x18e));let _0x2b398a=_0xf6b509(0x1be);try{const _0x1fbc64=JSON['parse'](a134_0xa3a209['readFileSync'](_0x203766,_0xf6b509(0x185)));_0x2b398a=_0x1fbc64[_0xf6b509(0x190)]||_0xf6b509(0x1be);}catch{}const _0xe0c6ef=a134_0xa3a209[_0xf6b509(0x1aa)](_0x4912a0,_0xf6b509(0x185)),_0x4ce2b1=JSON[_0xf6b509(0x1b9)](_0xe0c6ef);_0x4ce2b1[_0xf6b509(0x1dc)]=_0x48270a,_0x4ce2b1[_0xf6b509(0x1d7)]=_0x48270a+_0xf6b509(0x1a0)+_0x2b398a,a134_0xa3a209['writeFileSync'](_0x4912a0,JSON['stringify'](_0x4ce2b1,null,0x2)+'\x0a',_0xf6b509(0x185)),console[_0xf6b509(0x199)](_0xf6b509(0x187)+_0x48270a),logger[_0xf6b509(0x1d2)](_0xf6b509(0x1a3),_0xf6b509(0x1a5));}catch(_0x3f732a){logger['error']('create',_0xf6b509(0x1c0));throw _0x3f732a;}}async function configureAppCode(_0x444c63,_0x311475,_0x4ff7d9){const _0x43e051=a134_0x4c76,_0xaad8c0=a134_0x26dc1b['resolve'](process[_0x43e051(0x1d3)](),_0x444c63),_0x193af9=a134_0x26dc1b[_0x43e051(0x1a9)](_0xaad8c0,NEW_CONFIG_NAME);try{_0x311475?console[_0x43e051(0x199)](_0x43e051(0x1b5)+_0x444c63+':\x20'+_0x311475):console[_0x43e051(0x199)](_0x43e051(0x1d6)+_0x444c63);const _0x21619d=getRabetbaseCliPackageRoot(),_0xc040fa=a134_0x26dc1b['join'](_0x21619d,'package.json');let _0x406c26=_0x43e051(0x1be);try{const _0x3bff10=JSON[_0x43e051(0x1b9)](a134_0xa3a209[_0x43e051(0x1aa)](_0xc040fa,_0x43e051(0x185)));_0x406c26=_0x3bff10[_0x43e051(0x190)]||_0x43e051(0x1be);}catch{}const _0xff41f=readConfig(),_0x139c7f=typeof _0xff41f[_0x43e051(0x1d0)]==='string'?_0xff41f[_0x43e051(0x1d0)]:undefined,_0x4bc9ac={};for(const _0x5c6894 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0xff41f[_0x5c6894]!=null)_0x4bc9ac[_0x5c6894]=_0xff41f[_0x5c6894];}const _0x2e2974=buildCanonicalProjectConfig(_0x4bc9ac,{'appCodes':_0x311475?[_0x311475]:[],'env':_0x4ff7d9||_0x139c7f||'production','metadata':{'createdAt':new Date()[_0x43e051(0x1ba)](),'version':_0x406c26}});writeConfigFile(_0x193af9,_0x2e2974),_0x311475?console['log'](_0x43e051(0x188)+Object[_0x43e051(0x1a6)](_0x2e2974[_0x43e051(0x1c6)]||{})['join'](',\x20')+'\x20|\x20Default:\x20'+_0x2e2974[_0x43e051(0x1b6)]):console['log'](_0x43e051(0x19b)+CLI_BIN_NAME+_0x43e051(0x1ca)),logger[_0x43e051(0x1d2)](_0x43e051(0x1a3),_0x43e051(0x19d)+_0x311475);}catch(_0x382d33){logger['error']('create',_0x43e051(0x1d9));}}
1
+ (function(_0x1e63aa,_0x230dec){const _0x760249=a134_0x4f73,_0x345a21=_0x1e63aa();while(!![]){try{const _0x166d79=parseInt(_0x760249(0x1e2))/0x1+parseInt(_0x760249(0x1eb))/0x2+-parseInt(_0x760249(0x1ef))/0x3+-parseInt(_0x760249(0x200))/0x4+-parseInt(_0x760249(0x1fe))/0x5+parseInt(_0x760249(0x1c9))/0x6*(-parseInt(_0x760249(0x203))/0x7)+-parseInt(_0x760249(0x1f8))/0x8*(-parseInt(_0x760249(0x204))/0x9);if(_0x166d79===_0x230dec)break;else _0x345a21['push'](_0x345a21['shift']());}catch(_0x5299b3){_0x345a21['push'](_0x345a21['shift']());}}}(a134_0x324a,0xe6410));import a134_0x4402ff from'path';import a134_0x50c2dd from'fs';import a134_0x14392f from'chalk';import a134_0x4535e4 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';function a134_0x324a(){const _0x513f60=['7TNWKHr','9CWpMBY','accessSync','resolve','gray','√\x20Pulled\x20','parse','start','Project\x20name\x20cannot\x20be\x20empty','*\x20Pulling\x20API\x20configuration...','\x20√\x20','dirname','repeat','\x20&&\x20','string','name','Project\x20directory\x20','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','cyan','更新\x20package.json\x20name','1.0.0','更新\x20package.json\x20失败','配置应用AppCode失败','create','needsUpgrade','info','chdir','stop','...','utf8','W_OK','√\x20Configuration\x20file\x20created,\x20Apps:\x20','\x20config\x20set\x20appcode\x20<app-code>\x27','🚀\x20Next\x20Steps:','package.json','\x20already\x20exists','cd\x20','projectCode','*\x20Configuring\x20AppCode\x20for\x20project\x20','apps','11089380OGvfOJ','log','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','join','√\x20package.json\x20updated:\x20name=','writeFileSync','stableVersion','message','production','\x20|\x20AppCode:\x20','\x20model(s)','green','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','cwd','\x20api\x20pull','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','cookie','Install\x20dependencies','error','appCode','constants','清理项目目录失败:\x20','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','CLI\x20版本检查','API\x20配置拉取异常','1727297COjWLI','keys','belowMinimum','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','minimumVersion','test','warn','API\x20configuration\x20pulled:\x20','项目创建完成:\x20','272746WYlWPZ','setLogPath','项目创建失败:\x20','\x20\x202.\x20Pull\x20API\x20configuration:\x20','1476570Oozbea','配置应用AppCode:\x20','env','fail','bold','\x20run\x20start','toLocaleString','length','Format\x20code','21313864AzdMDQ','readFileSync','projectName','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','modelCount','\x20|\x20Default:\x20','5686905URAuNo','existsSync','427928zoKpXz','defaultApp','\x20Generated\x20by\x20rabetbase\x20cli\x20'];a134_0x324a=function(){return _0x513f60;};return a134_0x324a();}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';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';function a134_0x4f73(_0x48bb16,_0x536e6c){_0x48bb16=_0x48bb16-0x1b2;const _0x324a53=a134_0x324a();let _0x4f730d=_0x324a53[_0x48bb16];return _0x4f730d;}export async function createApp(_0x23eb63){const _0x3b6e44=a134_0x4f73,_0x319bb7=await checkCliVersion();(_0x319bb7[_0x3b6e44(0x1b9)]||_0x319bb7[_0x3b6e44(0x1e4)])&&(printCliUpgradeWarning(_0x319bb7),assertCliVersionSupported(_0x319bb7),logger[_0x3b6e44(0x1ba)](_0x3b6e44(0x1b8),_0x3b6e44(0x1e0),{'currentVersion':_0x319bb7['currentVersion'],'stableVersion':_0x319bb7[_0x3b6e44(0x1cf)],'minimumVersion':_0x319bb7[_0x3b6e44(0x1e6)],'needsUpgrade':_0x319bb7['needsUpgrade'],'belowMinimum':_0x319bb7[_0x3b6e44(0x1e4)]}));if(_0x23eb63[_0x3b6e44(0x1c6)]&&_0x23eb63['appCode'])await runCreate({'projectName':_0x23eb63[_0x3b6e44(0x1c6)],'appCode':_0x23eb63[_0x3b6e44(0x1dc)],'env':_0x23eb63[_0x3b6e44(0x1f1)]},_0x23eb63);else{if(_0x23eb63['projectCode']){const _0x24207d=await selectSingleAppcode(_0x23eb63[_0x3b6e44(0x1d9)]);await runCreate({'projectName':_0x23eb63[_0x3b6e44(0x1c6)],'appCode':_0x24207d||undefined,'env':_0x23eb63[_0x3b6e44(0x1f1)]},_0x23eb63);}else await guidedCreateProject(_0x46b81d=>runCreate(_0x46b81d,_0x23eb63),_0x23eb63['env'],_0x23eb63['cookie']);}}async function runCreate(_0x271fe2,_0x2e9ffd){const _0x26ca93=a134_0x4f73;if(!_0x271fe2[_0x26ca93(0x1fa)]||_0x271fe2[_0x26ca93(0x1fa)]['trim']()==='')throw new Error(_0x26ca93(0x20b));const _0x1970f9=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1970f9[_0x26ca93(0x1e7)](_0x271fe2['projectName']))throw new Error(_0x26ca93(0x1df));if(_0x271fe2[_0x26ca93(0x1fa)][_0x26ca93(0x1f6)]>0x64)throw new Error(_0x26ca93(0x1cb));const _0x4479d9=a134_0x4402ff[_0x26ca93(0x206)](process[_0x26ca93(0x1d6)](),_0x271fe2[_0x26ca93(0x1fa)]);if(a134_0x50c2dd['existsSync'](_0x4479d9))throw new Error(_0x26ca93(0x213)+_0x271fe2[_0x26ca93(0x1fa)]+_0x26ca93(0x1c4));try{a134_0x50c2dd[_0x26ca93(0x205)](a134_0x4402ff[_0x26ca93(0x20e)](_0x4479d9),a134_0x50c2dd[_0x26ca93(0x1dd)][_0x26ca93(0x1bf)]);}catch{throw new Error(_0x26ca93(0x1e5));}logger[_0x26ca93(0x1ec)](_0x4479d9),logger[_0x26ca93(0x1ba)](_0x26ca93(0x1b8),'开始创建项目:\x20'+_0x271fe2['projectName'],{'projectDir':_0x4479d9,'appCode':_0x271fe2[_0x26ca93(0x1dc)]}),console[_0x26ca93(0x1ca)](),console['log'](a134_0x14392f[_0x26ca93(0x1d4)]('\x20√\x20')+'Project\x20name:\x20'+a134_0x14392f[_0x26ca93(0x1d4)](_0x271fe2[_0x26ca93(0x1fa)])+(_0x271fe2[_0x26ca93(0x1dc)]?_0x26ca93(0x1d2)+a134_0x14392f[_0x26ca93(0x1b3)](_0x271fe2['appCode']):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x271fe2[_0x26ca93(0x1fa)])),await updatePackageJsonName(_0x271fe2['projectName']),await runTask(_0x26ca93(0x1da),()=>installDependencies(_0x271fe2[_0x26ca93(0x1fa)])),await runTask(_0x26ca93(0x1f7),()=>formatProjectCode(_0x271fe2[_0x26ca93(0x1fa)])),await configureAppCode(_0x271fe2[_0x26ca93(0x1fa)],_0x271fe2['appCode']||'',_0x271fe2['env']);let _0x26b55f=![];if(_0x271fe2[_0x26ca93(0x1dc)]){console[_0x26ca93(0x1ca)](_0x26ca93(0x20c));const _0x1806e0=process['cwd']();try{process[_0x26ca93(0x1bb)](_0x4479d9);const _0x29abc0=_0x271fe2['env']||_0x26ca93(0x1d1);initEnv(_0x29abc0);const {configArray:_0x22b684}=await fetchModelList(_0x271fe2['appCode'],_0x2e9ffd['cookie']||''),_0x3b8c59=DEFAULT_API_DIR,_0x4091de=await generateApiFile(_0x22b684,'',_0x271fe2[_0x26ca93(0x1dc)],!![],_0x29abc0,_0x3b8c59);console[_0x26ca93(0x1ca)](_0x26ca93(0x208)+_0x22b684[_0x26ca93(0x1f6)]+'\x20dataset(s),\x20generated\x20'+_0x4091de[_0x26ca93(0x1fc)]+_0x26ca93(0x1d3)),logger['info'](_0x26ca93(0x1b8),_0x26ca93(0x1e9)+_0x271fe2[_0x26ca93(0x1dc)]);}catch(_0x3e5dfd){_0x26b55f=!![],console[_0x26ca93(0x1ca)](_0x26ca93(0x1d8)),logger[_0x26ca93(0x1e8)](_0x26ca93(0x1b8),_0x26ca93(0x1e1),{'error':_0x3e5dfd instanceof Error?_0x3e5dfd[_0x26ca93(0x1d0)]:String(_0x3e5dfd)});}finally{process['chdir'](_0x1806e0);}}logger['success'](_0x26ca93(0x1b8),_0x26ca93(0x1ea)+_0x271fe2[_0x26ca93(0x1fa)]),console[_0x26ca93(0x1ca)](),console[_0x26ca93(0x1ca)](a134_0x14392f[_0x26ca93(0x1d4)]('─'[_0x26ca93(0x20f)](0x3c))),console['log'](a134_0x14392f[_0x26ca93(0x1b3)][_0x26ca93(0x1f3)](_0x26ca93(0x1c2))),console[_0x26ca93(0x1ca)](),console[_0x26ca93(0x1ca)]('\x20\x201.\x20Start\x20project:\x20'+a134_0x14392f[_0x26ca93(0x1b3)]['bold'](_0x26ca93(0x1c5)+_0x271fe2[_0x26ca93(0x1fa)]+_0x26ca93(0x210)+CLI_BIN_NAME+_0x26ca93(0x1f4))),_0x26b55f&&console[_0x26ca93(0x1ca)](_0x26ca93(0x1ee)+a134_0x14392f[_0x26ca93(0x1b3)]['bold'](CLI_BIN_NAME+_0x26ca93(0x1d7))),console[_0x26ca93(0x1ca)](a134_0x14392f[_0x26ca93(0x1d4)]('─'[_0x26ca93(0x20f)](0x3c)));}catch(_0x490991){logger['error'](_0x26ca93(0x1b8),_0x26ca93(0x1ed)+_0x271fe2['projectName'],{'error':_0x490991 instanceof Error?_0x490991['message']:String(_0x490991)});try{a134_0x50c2dd[_0x26ca93(0x1ff)](_0x4479d9)&&(console['log'](_0x26ca93(0x1b2)+_0x4479d9),a134_0x50c2dd['rmSync'](_0x4479d9,{'recursive':!![],'force':!![]}));}catch{logger['warn'](_0x26ca93(0x1b8),_0x26ca93(0x1de)+_0x4479d9);}throw _0x490991;}}async function runTask(_0x3b8063,_0x175c40){const _0x4a0229=a134_0x4f73,_0x314e8f=a134_0x4535e4(_0x3b8063+_0x4a0229(0x1bd))[_0x4a0229(0x20a)]();try{const _0x5262a5=await _0x175c40();_0x314e8f[_0x4a0229(0x1bc)](),console[_0x4a0229(0x1ca)](''+a134_0x14392f[_0x4a0229(0x1d4)](_0x4a0229(0x20d))+_0x3b8063+'\x20'+a134_0x14392f[_0x4a0229(0x207)]('['+_0x5262a5+']'));}catch(_0x240545){_0x314e8f[_0x4a0229(0x1f2)](_0x3b8063);throw _0x240545;}}async function updatePackageJsonName(_0x2f890a){const _0x5cd6ad=a134_0x4f73,_0x418c28=a134_0x4402ff[_0x5cd6ad(0x206)](process[_0x5cd6ad(0x1d6)](),_0x2f890a),_0x5a3e04=a134_0x4402ff[_0x5cd6ad(0x1cc)](_0x418c28,_0x5cd6ad(0x1c3));try{console[_0x5cd6ad(0x1ca)](_0x5cd6ad(0x1fb));const _0x4487d8=getRabetbaseCliPackageRoot(),_0xb3a8ca=a134_0x4402ff[_0x5cd6ad(0x1cc)](_0x4487d8,'package.json');let _0x186c13=_0x5cd6ad(0x1b5);try{const _0x4a8ad0=JSON['parse'](a134_0x50c2dd[_0x5cd6ad(0x1f9)](_0xb3a8ca,_0x5cd6ad(0x1be)));_0x186c13=_0x4a8ad0['version']||_0x5cd6ad(0x1b5);}catch{}const _0x4e8dc7=a134_0x50c2dd[_0x5cd6ad(0x1f9)](_0x5a3e04,_0x5cd6ad(0x1be)),_0x4783e1=JSON[_0x5cd6ad(0x209)](_0x4e8dc7);_0x4783e1[_0x5cd6ad(0x212)]=_0x2f890a,_0x4783e1['description']=_0x2f890a+_0x5cd6ad(0x202)+_0x186c13,a134_0x50c2dd[_0x5cd6ad(0x1ce)](_0x5a3e04,JSON['stringify'](_0x4783e1,null,0x2)+'\x0a','utf8'),console[_0x5cd6ad(0x1ca)](_0x5cd6ad(0x1cd)+_0x2f890a),logger[_0x5cd6ad(0x1ba)]('create',_0x5cd6ad(0x1b4));}catch(_0x1827e7){logger[_0x5cd6ad(0x1db)](_0x5cd6ad(0x1b8),_0x5cd6ad(0x1b6));throw _0x1827e7;}}async function configureAppCode(_0x3ee036,_0x155c10,_0x10c45a){const _0x581fc1=a134_0x4f73,_0x16741f=a134_0x4402ff[_0x581fc1(0x206)](process['cwd'](),_0x3ee036),_0x503499=a134_0x4402ff[_0x581fc1(0x1cc)](_0x16741f,NEW_CONFIG_NAME);try{_0x155c10?console[_0x581fc1(0x1ca)](_0x581fc1(0x1c7)+_0x3ee036+':\x20'+_0x155c10):console[_0x581fc1(0x1ca)]('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x3ee036);const _0x21477e=getRabetbaseCliPackageRoot(),_0x45c17c=a134_0x4402ff[_0x581fc1(0x1cc)](_0x21477e,_0x581fc1(0x1c3));let _0x5e78fa=_0x581fc1(0x1b5);try{const _0x2a0926=JSON[_0x581fc1(0x209)](a134_0x50c2dd[_0x581fc1(0x1f9)](_0x45c17c,_0x581fc1(0x1be)));_0x5e78fa=_0x2a0926['version']||'1.0.0';}catch{}const _0x146858=readConfig(),_0xeaaf81=typeof _0x146858[_0x581fc1(0x1f1)]===_0x581fc1(0x211)?_0x146858['env']:undefined,_0x55d686={};for(const _0xfbac1d of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x146858[_0xfbac1d]!=null)_0x55d686[_0xfbac1d]=_0x146858[_0xfbac1d];}const _0x50f154=buildCanonicalProjectConfig(_0x55d686,{'appCodes':_0x155c10?[_0x155c10]:[],'env':_0x10c45a||_0xeaaf81||_0x581fc1(0x1d1),'metadata':{'createdAt':new Date()[_0x581fc1(0x1f5)](),'version':_0x5e78fa}});writeConfigFile(_0x503499,_0x50f154),_0x155c10?console[_0x581fc1(0x1ca)](_0x581fc1(0x1c0)+Object[_0x581fc1(0x1e3)](_0x50f154[_0x581fc1(0x1c8)]||{})['join'](',\x20')+_0x581fc1(0x1fd)+_0x50f154[_0x581fc1(0x201)]):console[_0x581fc1(0x1ca)](_0x581fc1(0x1d5)+CLI_BIN_NAME+_0x581fc1(0x1c1)),logger[_0x581fc1(0x1ba)](_0x581fc1(0x1b8),_0x581fc1(0x1f0)+_0x155c10);}catch(_0x3d1aad){logger[_0x581fc1(0x1db)](_0x581fc1(0x1b8),_0x581fc1(0x1b7));}}
@@ -1 +1 @@
1
- (function(_0x332320,_0x5d5007){const _0x56112e=a135_0x4111,_0x309c0f=_0x332320();while(!![]){try{const _0x54c4f6=parseInt(_0x56112e(0x145))/0x1+-parseInt(_0x56112e(0x15e))/0x2*(parseInt(_0x56112e(0x181))/0x3)+parseInt(_0x56112e(0x164))/0x4+parseInt(_0x56112e(0x176))/0x5*(-parseInt(_0x56112e(0x155))/0x6)+parseInt(_0x56112e(0x159))/0x7*(parseInt(_0x56112e(0x16a))/0x8)+-parseInt(_0x56112e(0x14b))/0x9*(-parseInt(_0x56112e(0x16b))/0xa)+-parseInt(_0x56112e(0x15f))/0xb*(-parseInt(_0x56112e(0x170))/0xc);if(_0x54c4f6===_0x5d5007)break;else _0x309c0f['push'](_0x309c0f['shift']());}catch(_0x23ff67){_0x309c0f['push'](_0x309c0f['shift']());}}}(a135_0x566e,0x209b3));import a135_0x488640 from'path';import a135_0x8f152b 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';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';function a135_0x566e(){const _0xbe7f3a=['\x20\x20rabetbase\x20run\x20start\x0a','\x0a√\x20Project\x20','npm','56728ZjWrwZ','toLocaleString','utf-8','\x20\x20Installing\x20dependencies...','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','bun\x20--version','1394991KnjImt','\x20\x20Pulling\x20API\x20configuration...','cwd','\x20dataset(s),\x20generated\x20','ignore','string','log','length','parse','bun\x20run\x20format','911406ebklLP','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','chdir','test','35APQwRq','...','Project\x20name\x20contains\x20invalid\x20characters.','needsUpgrade','\x20\x20√\x20package.json\x20updated','363634dofFpR','176033IjvPan','stringify','\x20\x20√\x20Pulled\x20','production','\x20model(s)','531172edHdbY','\x20api\x20pull`\x20manually\x20later.','Use\x20a\x20different\x20project\x20name.','\x0a\x20\x20cd\x20','constants','\x20\x20√\x20Code\x20formatted','42776lJvcpc','10yiQiEk','\x20created\x20successfully!','belowMinimum','modelCount','join','72kDzQPJ','writeFile','Project\x20name\x20cannot\x20be\x20empty.','Project\x20directory\x20\x22','\x20\x20√\x20Project\x20template\x20created','\x22\x20already\x20exists.','5Xbsikw','W_OK','*\x20Creating\x20project\x20','validation','access','package.json','name','Check\x20directory\x20permissions.','resolve','bun','description','3XXhKWJ','env','trim','dirname'];a135_0x566e=function(){return _0xbe7f3a;};return a135_0x566e();}import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';function a135_0x4111(_0x3b4c7d,_0xbb4d61){_0x3b4c7d=_0x3b4c7d-0x13f;const _0x566e42=a135_0x566e();let _0x411156=_0x566e42[_0x3b4c7d];return _0x411156;}const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x194b6a,_0xa039bc,_0x5104e4,_0x5ba303){const _0x238fe7=a135_0x4111,_0x44a6d1=await checkCliVersion();(_0x44a6d1[_0x238fe7(0x15c)]||_0x44a6d1[_0x238fe7(0x16d)])&&(printCliUpgradeWarning(_0x44a6d1),assertCliVersionSupported(_0x44a6d1));if(!_0x194b6a||_0x194b6a[_0x238fe7(0x140)]()==='')throw CliErrors['validation'](_0x238fe7(0x172));const _0x337141=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x337141[_0x238fe7(0x158)](_0x194b6a))throw CliErrors[_0x238fe7(0x179)](_0x238fe7(0x15b),_0x238fe7(0x149));if(_0x194b6a[_0x238fe7(0x152)]>0x64)throw CliErrors[_0x238fe7(0x179)](_0x238fe7(0x156));const _0x467c74=a135_0x488640[_0x238fe7(0x17e)](process['cwd'](),_0x194b6a);if(existsSync(_0x467c74))throw CliErrors['validation'](_0x238fe7(0x173)+_0x194b6a+_0x238fe7(0x175),_0x238fe7(0x166));try{const _0x1c2228=a135_0x488640[_0x238fe7(0x141)](_0x467c74);await a135_0x8f152b[_0x238fe7(0x17a)](_0x1c2228,a135_0x8f152b[_0x238fe7(0x168)][_0x238fe7(0x177)]);}catch{throw CliErrors[_0x238fe7(0x179)]('Cannot\x20create\x20project\x20in\x20current\x20directory.',_0x238fe7(0x17d));}try{console['log'](_0x238fe7(0x178)+_0x194b6a+_0x238fe7(0x15a));const _0x11f39a=getSubAppReactDemoTemplateDir();await copyDirectory(_0x11f39a,_0x467c74),console[_0x238fe7(0x151)](_0x238fe7(0x174)),await updatePackageJsonName(_0x194b6a),console[_0x238fe7(0x151)](_0x238fe7(0x15d)),console[_0x238fe7(0x151)](_0x238fe7(0x148)),console[_0x238fe7(0x151)]('\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)'),await formatCode(_0x467c74),console[_0x238fe7(0x151)](_0x238fe7(0x169)),await configureProject(_0x194b6a,_0x5104e4,_0xa039bc),console['log']('\x20\x20√\x20Configuration\x20file\x20created'),_0x5104e4&&await pullApiConfig(_0x467c74,_0x5104e4,_0xa039bc,_0x5ba303),console[_0x238fe7(0x151)](_0x238fe7(0x143)+_0x194b6a+_0x238fe7(0x16c)),console[_0x238fe7(0x151)](_0x238fe7(0x167)+_0x194b6a),console['log'](_0x238fe7(0x142));}catch(_0x351c86){try{existsSync(_0x467c74)&&await a135_0x8f152b['rm'](_0x467c74,{'recursive':!![],'force':!![]});}catch{}throw _0x351c86;}}async function updatePackageJsonName(_0x1f61ae){const _0x3b000e=a135_0x4111,_0x329885=a135_0x488640[_0x3b000e(0x17e)](process['cwd'](),_0x1f61ae),_0x54d2d8=a135_0x488640[_0x3b000e(0x16f)](_0x329885,_0x3b000e(0x17b)),_0x532a90=await a135_0x8f152b['readFile'](_0x54d2d8,_0x3b000e(0x147)),_0x2910d0=JSON[_0x3b000e(0x153)](_0x532a90);_0x2910d0[_0x3b000e(0x17c)]=_0x1f61ae,_0x2910d0[_0x3b000e(0x180)]='A\x20project\x20created\x20with\x20Lovrabet\x20CLI',await a135_0x8f152b[_0x3b000e(0x171)](_0x54d2d8,JSON[_0x3b000e(0x160)](_0x2910d0,null,0x2)+'\x0a');}function detectPackageManager(){const _0x394cc0=a135_0x4111;try{return execSync(_0x394cc0(0x14a),{'stdio':_0x394cc0(0x14f)}),_0x394cc0(0x17f);}catch{return _0x394cc0(0x144);}}async function formatCode(_0x2dfa2d){const _0x50b17c=a135_0x4111;try{await execAsync(_0x50b17c(0x154),{'cwd':_0x2dfa2d});}catch{}}async function configureProject(_0x135cc6,_0x53fa9b,_0x4bcfa1){const _0x6dca1b=a135_0x4111,_0x51163f=a135_0x488640[_0x6dca1b(0x17e)](process[_0x6dca1b(0x14d)](),_0x135cc6),_0xf7bd08=a135_0x488640[_0x6dca1b(0x16f)](_0x51163f,NEW_CONFIG_NAME),_0x17231e=readConfig(),_0x2a4366=typeof _0x17231e[_0x6dca1b(0x13f)]===_0x6dca1b(0x150)?_0x17231e['env']:undefined,_0x49fc76={};for(const _0x1e9499 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x17231e[_0x1e9499]!=null)_0x49fc76[_0x1e9499]=_0x17231e[_0x1e9499];}const _0x14a4cb=buildCanonicalProjectConfig(_0x49fc76,{'appCodes':_0x53fa9b?[_0x53fa9b]:[],'env':_0x4bcfa1||_0x2a4366||_0x6dca1b(0x162),'metadata':{'createdAt':new Date()[_0x6dca1b(0x146)](),'version':getCliVersion()}});writeConfigFile(_0xf7bd08,_0x14a4cb);}async function pullApiConfig(_0x5d49f2,_0x5e97b,_0x24f7d3,_0x51daf1){const _0x5f1a11=a135_0x4111,_0xb2ca51=process[_0x5f1a11(0x14d)]();try{process[_0x5f1a11(0x157)](_0x5d49f2);const _0x15ee91=_0x24f7d3||'production';initEnv(_0x15ee91),console[_0x5f1a11(0x151)](_0x5f1a11(0x14c));const {configArray:_0x5e5b46}=await fetchModelList(_0x5e97b,_0x51daf1||''),_0x4b3097=await generateApiFile(_0x5e5b46,'',_0x5e97b,!![],_0x15ee91,DEFAULT_API_DIR);console[_0x5f1a11(0x151)](_0x5f1a11(0x161)+_0x5e5b46['length']+_0x5f1a11(0x14e)+_0x4b3097[_0x5f1a11(0x16e)]+_0x5f1a11(0x163));}catch(_0x28b164){console['log']('\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`'+CLI_BIN_NAME+_0x5f1a11(0x165));}finally{process[_0x5f1a11(0x157)](_0xb2ca51);}}
1
+ (function(_0x5a85f4,_0x4cc981){const _0xb07cb5=a135_0x51a9,_0x2c6c2c=_0x5a85f4();while(!![]){try{const _0x550341=parseInt(_0xb07cb5(0x7f))/0x1*(-parseInt(_0xb07cb5(0x97))/0x2)+-parseInt(_0xb07cb5(0x83))/0x3+parseInt(_0xb07cb5(0x9c))/0x4+parseInt(_0xb07cb5(0x90))/0x5*(parseInt(_0xb07cb5(0x73))/0x6)+parseInt(_0xb07cb5(0xa3))/0x7*(-parseInt(_0xb07cb5(0x92))/0x8)+parseInt(_0xb07cb5(0x8a))/0x9*(-parseInt(_0xb07cb5(0x7d))/0xa)+parseInt(_0xb07cb5(0x6f))/0xb;if(_0x550341===_0x4cc981)break;else _0x2c6c2c['push'](_0x2c6c2c['shift']());}catch(_0x5a4a96){_0x2c6c2c['push'](_0x2c6c2c['shift']());}}}(a135_0x5ede,0xf1cd7));import a135_0xb2b7dd from'path';import a135_0x2ff2d7 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';function a135_0x51a9(_0x5a09dc,_0x108302){_0x5a09dc=_0x5a09dc-0x69;const _0x5ede1e=a135_0x5ede();let _0x51a9a1=_0x5ede1e[_0x5a09dc];return _0x51a9a1;}import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';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(_0xb5201a,_0x241a02,_0x5b35a1,_0x5d829a){const _0x55060a=a135_0x51a9,_0x1f07a6=await checkCliVersion();(_0x1f07a6[_0x55060a(0xa4)]||_0x1f07a6[_0x55060a(0x8c)])&&(printCliUpgradeWarning(_0x1f07a6),assertCliVersionSupported(_0x1f07a6));if(!_0xb5201a||_0xb5201a[_0x55060a(0x76)]()==='')throw CliErrors['validation']('Project\x20name\x20cannot\x20be\x20empty.');const _0x39b28a=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x39b28a[_0x55060a(0x85)](_0xb5201a))throw CliErrors[_0x55060a(0x81)](_0x55060a(0x74),_0x55060a(0x96));if(_0xb5201a[_0x55060a(0x75)]>0x64)throw CliErrors[_0x55060a(0x81)]('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.');const _0x1a41b6=a135_0xb2b7dd[_0x55060a(0x9b)](process[_0x55060a(0x8f)](),_0xb5201a);if(existsSync(_0x1a41b6))throw CliErrors[_0x55060a(0x81)](_0x55060a(0x7a)+_0xb5201a+'\x22\x20already\x20exists.','Use\x20a\x20different\x20project\x20name.');try{const _0x27bb24=a135_0xb2b7dd[_0x55060a(0x95)](_0x1a41b6);await a135_0x2ff2d7[_0x55060a(0x80)](_0x27bb24,a135_0x2ff2d7[_0x55060a(0x6c)]['W_OK']);}catch{throw CliErrors[_0x55060a(0x81)](_0x55060a(0x71),_0x55060a(0x99));}try{console[_0x55060a(0x78)](_0x55060a(0x91)+_0xb5201a+_0x55060a(0x98));const _0x2f1610=getSubAppReactDemoTemplateDir();await copyDirectory(_0x2f1610,_0x1a41b6),console[_0x55060a(0x78)](_0x55060a(0x9d)),await updatePackageJsonName(_0xb5201a),console['log']('\x20\x20√\x20package.json\x20updated'),console[_0x55060a(0x78)](_0x55060a(0x8e)),console[_0x55060a(0x78)](_0x55060a(0x69)),await formatCode(_0x1a41b6),console[_0x55060a(0x78)]('\x20\x20√\x20Code\x20formatted'),await configureProject(_0xb5201a,_0x5b35a1,_0x241a02),console['log']('\x20\x20√\x20Configuration\x20file\x20created'),_0x5b35a1&&await pullApiConfig(_0x1a41b6,_0x5b35a1,_0x241a02,_0x5d829a),console[_0x55060a(0x78)](_0x55060a(0x6d)+_0xb5201a+_0x55060a(0x7c)),console[_0x55060a(0x78)](_0x55060a(0xa2)+_0xb5201a),console[_0x55060a(0x78)](_0x55060a(0x93));}catch(_0x219252){try{existsSync(_0x1a41b6)&&await a135_0x2ff2d7['rm'](_0x1a41b6,{'recursive':!![],'force':!![]});}catch{}throw _0x219252;}}async function updatePackageJsonName(_0x1ba2b4){const _0x123755=a135_0x51a9,_0x54323d=a135_0xb2b7dd['resolve'](process[_0x123755(0x8f)](),_0x1ba2b4),_0x16d52e=a135_0xb2b7dd[_0x123755(0x7b)](_0x54323d,_0x123755(0x9a)),_0x5ae4aa=await a135_0x2ff2d7[_0x123755(0x86)](_0x16d52e,_0x123755(0x88)),_0x314407=JSON[_0x123755(0x87)](_0x5ae4aa);_0x314407['name']=_0x1ba2b4,_0x314407[_0x123755(0x6b)]=_0x123755(0xa1),await a135_0x2ff2d7[_0x123755(0xa0)](_0x16d52e,JSON[_0x123755(0x8d)](_0x314407,null,0x2)+'\x0a');}function detectPackageManager(){const _0x7baa63=a135_0x51a9;try{return execSync('bun\x20--version',{'stdio':_0x7baa63(0x89)}),_0x7baa63(0x94);}catch{return _0x7baa63(0x84);}}async function formatCode(_0x36e647){const _0x31251a=a135_0x51a9;try{await execAsync(_0x31251a(0x70),{'cwd':_0x36e647});}catch{}}async function configureProject(_0x5d150d,_0x5f4856,_0x5d3037){const _0x531e8c=a135_0x51a9,_0x47398b=a135_0xb2b7dd[_0x531e8c(0x9b)](process[_0x531e8c(0x8f)](),_0x5d150d),_0x40752f=a135_0xb2b7dd[_0x531e8c(0x7b)](_0x47398b,NEW_CONFIG_NAME),_0x51b143=readConfig(),_0x26cae6=typeof _0x51b143['env']===_0x531e8c(0x8b)?_0x51b143['env']:undefined,_0x5492c0={};for(const _0x5b5131 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x51b143[_0x5b5131]!=null)_0x5492c0[_0x5b5131]=_0x51b143[_0x5b5131];}const _0x4abc22=buildCanonicalProjectConfig(_0x5492c0,{'appCodes':_0x5f4856?[_0x5f4856]:[],'env':_0x5d3037||_0x26cae6||_0x531e8c(0x6e),'metadata':{'createdAt':new Date()[_0x531e8c(0x9f)](),'version':getCliVersion()}});writeConfigFile(_0x40752f,_0x4abc22);}async function pullApiConfig(_0x295d08,_0x508ff2,_0x2086f9,_0x14948d){const _0x1659ac=a135_0x51a9,_0x4472ae=process[_0x1659ac(0x8f)]();try{process[_0x1659ac(0x79)](_0x295d08);const _0x3e0ae4=_0x2086f9||_0x1659ac(0x6e);initEnv(_0x3e0ae4),console[_0x1659ac(0x78)](_0x1659ac(0x82));const {configArray:_0x54f1e9}=await fetchModelList(_0x508ff2,_0x14948d||''),_0x177403=await generateApiFile(_0x54f1e9,'',_0x508ff2,!![],_0x3e0ae4,DEFAULT_API_DIR);console[_0x1659ac(0x78)](_0x1659ac(0x6a)+_0x54f1e9[_0x1659ac(0x75)]+_0x1659ac(0x7e)+_0x177403[_0x1659ac(0x9e)]+_0x1659ac(0x72));}catch(_0x4a184c){console[_0x1659ac(0x78)]('\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`'+CLI_BIN_NAME+_0x1659ac(0x77));}finally{process[_0x1659ac(0x79)](_0x4472ae);}}function a135_0x5ede(){const _0x3be552=['log','chdir','Project\x20directory\x20\x22','join','\x20created\x20successfully!','410TuVptN','\x20dataset(s),\x20generated\x20','1186306gpGXtN','access','validation','\x20\x20Pulling\x20API\x20configuration...','4683552WvaPTg','npm','test','readFile','parse','utf-8','ignore','10575jMJofV','string','belowMinimum','stringify','\x20\x20Installing\x20dependencies...','cwd','20WQYqcl','*\x20Creating\x20project\x20','109624pejyMg','\x20\x20rabetbase\x20run\x20start\x0a','bun','dirname','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','2RXMAfS','...','Check\x20directory\x20permissions.','package.json','resolve','921776asFdim','\x20\x20√\x20Project\x20template\x20created','modelCount','toLocaleString','writeFile','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','\x0a\x20\x20cd\x20','511rWBzvJ','needsUpgrade','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','\x20\x20√\x20Pulled\x20','description','constants','\x0a√\x20Project\x20','production','41620997yAYjhY','bun\x20run\x20format','Cannot\x20create\x20project\x20in\x20current\x20directory.','\x20model(s)','1158354MJuRpw','Project\x20name\x20contains\x20invalid\x20characters.','length','trim','\x20api\x20pull`\x20manually\x20later.'];a135_0x5ede=function(){return _0x3be552;};return a135_0x5ede();}
@@ -1 +1 @@
1
- const a136_0x47e418=a136_0x3f12;(function(_0x48b3d3,_0x5338bc){const _0x3b974f=a136_0x3f12,_0x1677d5=_0x48b3d3();while(!![]){try{const _0x10534e=-parseInt(_0x3b974f(0xff))/0x1*(parseInt(_0x3b974f(0xfe))/0x2)+-parseInt(_0x3b974f(0xfd))/0x3*(parseInt(_0x3b974f(0x100))/0x4)+parseInt(_0x3b974f(0xf9))/0x5+-parseInt(_0x3b974f(0xfa))/0x6+-parseInt(_0x3b974f(0xfc))/0x7*(-parseInt(_0x3b974f(0x101))/0x8)+-parseInt(_0x3b974f(0xf8))/0x9+parseInt(_0x3b974f(0xf5))/0xa;if(_0x10534e===_0x5338bc)break;else _0x1677d5['push'](_0x1677d5['shift']());}catch(_0x4d50a2){_0x1677d5['push'](_0x1677d5['shift']());}}}(a136_0x2507,0xe6984));import a136_0x251d2f from'node:path';function a136_0x2507(){const _0x147f3c=['284SVFyca','7457144oimHxS','resolve','projects','36871110yEXWcv','join','sub-app-react-demo','14619204usoNOs','9156425uiJCpa','3125676eXBBnG','dirname','7tgxMaV','63519ISBjnE','36svdfYH','103191fZwUyN'];a136_0x2507=function(){return _0x147f3c;};return a136_0x2507();}import{fileURLToPath}from'node:url';function a136_0x3f12(_0x1b54b1,_0x1b1aa4){_0x1b54b1=_0x1b54b1-0xf4;const _0x2507a9=a136_0x2507();let _0x3f1263=_0x2507a9[_0x1b54b1];return _0x3f1263;}const __dirname=a136_0x251d2f[a136_0x47e418(0xfb)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x99b268=a136_0x47e418;return a136_0x251d2f[_0x99b268(0x102)](__dirname,'../../../../');}export function getSubAppReactDemoTemplateDir(){const _0x51c99e=a136_0x47e418;return a136_0x251d2f[_0x51c99e(0xf6)](getRabetbaseCliPackageRoot(),'templates',_0x51c99e(0xf4),_0x51c99e(0xf7));}
1
+ (function(_0x284c11,_0x556219){const _0x1d3468=a136_0x1915,_0x4cdccf=_0x284c11();while(!![]){try{const _0x573d98=-parseInt(_0x1d3468(0xb4))/0x1+parseInt(_0x1d3468(0xbf))/0x2*(parseInt(_0x1d3468(0xbd))/0x3)+parseInt(_0x1d3468(0xc0))/0x4+-parseInt(_0x1d3468(0xb6))/0x5*(parseInt(_0x1d3468(0xb9))/0x6)+-parseInt(_0x1d3468(0xbe))/0x7+-parseInt(_0x1d3468(0xbb))/0x8+parseInt(_0x1d3468(0xba))/0x9*(parseInt(_0x1d3468(0xb7))/0xa);if(_0x573d98===_0x556219)break;else _0x4cdccf['push'](_0x4cdccf['shift']());}catch(_0x152f03){_0x4cdccf['push'](_0x4cdccf['shift']());}}}(a136_0x1827,0x4214c));import a136_0x46ffc3 from'node:path';function a136_0x1915(_0x105bce,_0x555dc1){_0x105bce=_0x105bce-0xb3;const _0x1827f9=a136_0x1827();let _0x191556=_0x1827f9[_0x105bce];return _0x191556;}import{fileURLToPath}from'node:url';const __dirname=a136_0x46ffc3['dirname'](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x3d654a=a136_0x1915;return a136_0x46ffc3[_0x3d654a(0xbc)](__dirname,_0x3d654a(0xc1));}export function getSubAppReactDemoTemplateDir(){const _0x2a44ae=a136_0x1915;return a136_0x46ffc3['join'](getRabetbaseCliPackageRoot(),_0x2a44ae(0xb3),_0x2a44ae(0xb5),_0x2a44ae(0xb8));}function a136_0x1827(){const _0x1b7ec1=['projects','10nPPUuS','13880ZyPeOB','sub-app-react-demo','758832tDdQMQ','1647dDeGxI','1438888PLJMZG','resolve','212631otkuip','1572361kiIBnh','14JqhTHu','1609724FkwsdU','../../../../','templates','224478ZzMXly'];a136_0x1827=function(){return _0x1b7ec1;};return a136_0x1827();}
@@ -1 +1 @@
1
- (function(_0x2493d8,_0x1da9c3){const _0x3665fc=a137_0x6d9e,_0x4628a0=_0x2493d8();while(!![]){try{const _0x5b01c0=parseInt(_0x3665fc(0x190))/0x1*(parseInt(_0x3665fc(0x19d))/0x2)+-parseInt(_0x3665fc(0x191))/0x3*(-parseInt(_0x3665fc(0x197))/0x4)+parseInt(_0x3665fc(0x193))/0x5*(-parseInt(_0x3665fc(0x18f))/0x6)+-parseInt(_0x3665fc(0x19a))/0x7+parseInt(_0x3665fc(0x18d))/0x8+-parseInt(_0x3665fc(0x19c))/0x9+parseInt(_0x3665fc(0x194))/0xa;if(_0x5b01c0===_0x1da9c3)break;else _0x4628a0['push'](_0x4628a0['shift']());}catch(_0xdb8014){_0x4628a0['push'](_0x4628a0['shift']());}}}(a137_0xac87,0xabc65));function a137_0xac87(){const _0x33800b=['6545720MYLWgB','项目模板复制失败','info','24vYkixU','message','cwd','6310864gySuRW','项目模板复制完成','11158110ihIUZg','369154YFxQAH','resolve','copy','8657688ZzhxYv','now','18jOSMlg','1WeyAMP','486561bFJBqf','开始复制项目模板','82585XmUkNI'];a137_0xac87=function(){return _0x33800b;};return a137_0xac87();}import a137_0x1f3155 from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a137_0x6d9e(_0x47635c,_0x24cbe7){_0x47635c=_0x47635c-0x18b;const _0xac8733=a137_0xac87();let _0x6d9e8d=_0xac8733[_0x47635c];return _0x6d9e8d;}import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x2bfa70){const _0x160351=a137_0x6d9e,_0x560da9=Date[_0x160351(0x18e)](),_0x31e2dc=a137_0x1f3155[_0x160351(0x18b)](process[_0x160351(0x199)](),_0x2bfa70);try{logger[_0x160351(0x196)](_0x160351(0x18c),_0x160351(0x192),{'projectCode':_0x2bfa70,'templateDir':templateDir}),await copyDirectory(templateDir,_0x31e2dc);const _0x24deee=Date[_0x160351(0x18e)]()-_0x560da9;logger['success'](_0x160351(0x18c),_0x160351(0x19b),_0x24deee,{'projectCode':_0x2bfa70});}catch(_0x1b58b5){const _0x551ea6=Date[_0x160351(0x18e)]()-_0x560da9;logger['error'](_0x160351(0x18c),_0x160351(0x195),{'projectCode':_0x2bfa70,'error':_0x1b58b5 instanceof Error?_0x1b58b5[_0x160351(0x198)]:String(_0x1b58b5),'duration':_0x551ea6});throw _0x1b58b5;}return formatElapsed(_0x560da9);}
1
+ (function(_0x1d59e3,_0x41767a){const _0x3c05d8=a137_0x2b01,_0x46e5c1=_0x1d59e3();while(!![]){try{const _0xdea3af=parseInt(_0x3c05d8(0xa4))/0x1*(-parseInt(_0x3c05d8(0xab))/0x2)+-parseInt(_0x3c05d8(0xa9))/0x3+parseInt(_0x3c05d8(0xa1))/0x4+parseInt(_0x3c05d8(0xa5))/0x5+-parseInt(_0x3c05d8(0xad))/0x6*(parseInt(_0x3c05d8(0xb0))/0x7)+-parseInt(_0x3c05d8(0xa7))/0x8+parseInt(_0x3c05d8(0xaa))/0x9*(parseInt(_0x3c05d8(0xa6))/0xa);if(_0xdea3af===_0x41767a)break;else _0x46e5c1['push'](_0x46e5c1['shift']());}catch(_0x18b026){_0x46e5c1['push'](_0x46e5c1['shift']());}}}(a137_0x45c1,0xd739e));import a137_0x17453c 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';function a137_0x45c1(){const _0x4590d9=['resolve','3709956CWERZY','info','项目模板复制完成','2435ymNZcA','3130010ZbxEJu','26015770kvAyeT','10081384UvlyOp','error','2748531cNJRqh','9TGhGSv','668LjvWbj','now','12KdjBTP','项目模板复制失败','copy','993517GMIgbU'];a137_0x45c1=function(){return _0x4590d9;};return a137_0x45c1();}import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';function a137_0x2b01(_0x1534be,_0x200115){_0x1534be=_0x1534be-0xa1;const _0x45c176=a137_0x45c1();let _0x2b019e=_0x45c176[_0x1534be];return _0x2b019e;}const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0xb2482b){const _0x1cb8a4=a137_0x2b01,_0x192c39=Date['now'](),_0x557304=a137_0x17453c[_0x1cb8a4(0xb1)](process['cwd'](),_0xb2482b);try{logger[_0x1cb8a4(0xa2)](_0x1cb8a4(0xaf),'开始复制项目模板',{'projectCode':_0xb2482b,'templateDir':templateDir}),await copyDirectory(templateDir,_0x557304);const _0x1d4dd3=Date[_0x1cb8a4(0xac)]()-_0x192c39;logger['success'](_0x1cb8a4(0xaf),_0x1cb8a4(0xa3),_0x1d4dd3,{'projectCode':_0xb2482b});}catch(_0x472359){const _0x1e84fb=Date[_0x1cb8a4(0xac)]()-_0x192c39;logger[_0x1cb8a4(0xa8)](_0x1cb8a4(0xaf),_0x1cb8a4(0xae),{'projectCode':_0xb2482b,'error':_0x472359 instanceof Error?_0x472359['message']:String(_0x472359),'duration':_0x1e84fb});throw _0x472359;}return formatElapsed(_0x192c39);}
@@ -1 +1 @@
1
- (function(_0x4ff3b5,_0x475036){const _0x2b9f63=a138_0x4811,_0x3e771c=_0x4ff3b5();while(!![]){try{const _0xa9c732=parseInt(_0x2b9f63(0x14b))/0x1+parseInt(_0x2b9f63(0x152))/0x2*(-parseInt(_0x2b9f63(0x150))/0x3)+-parseInt(_0x2b9f63(0x14c))/0x4*(parseInt(_0x2b9f63(0x14f))/0x5)+-parseInt(_0x2b9f63(0x147))/0x6+-parseInt(_0x2b9f63(0x13c))/0x7+parseInt(_0x2b9f63(0x13f))/0x8*(-parseInt(_0x2b9f63(0x143))/0x9)+parseInt(_0x2b9f63(0x144))/0xa;if(_0xa9c732===_0x475036)break;else _0x3e771c['push'](_0x3e771c['shift']());}catch(_0x58485c){_0x3e771c['push'](_0x3e771c['shift']());}}}(a138_0x37eb,0x746e3));import a138_0x5ce025 from'node:path';function a138_0x4811(_0x4cbac6,_0x44ac8a){_0x4cbac6=_0x4cbac6-0x13c;const _0x37ebb6=a138_0x37eb();let _0x4811d5=_0x37ebb6[_0x4cbac6];return _0x4811d5;}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 formatProjectCode(_0x12524b){const _0x342e52=a138_0x4811,_0x178c0d=Date[_0x342e52(0x145)](),_0x1a62bc=a138_0x5ce025[_0x342e52(0x148)](process['cwd'](),_0x12524b);try{logger[_0x342e52(0x14a)](_0x342e52(0x13e),_0x342e52(0x151),{'projectCode':_0x12524b}),await execa(resolveNpmBin(_0x342e52(0x13d)),[_0x342e52(0x14d),_0x342e52(0x142),'.'],{'cwd':_0x1a62bc});const _0x3476a8=Date[_0x342e52(0x145)]()-_0x178c0d;logger[_0x342e52(0x146)](_0x342e52(0x13e),_0x342e52(0x149),_0x3476a8,{'projectCode':_0x12524b});}catch(_0x569bc9){const _0x3e510f=Date[_0x342e52(0x145)]()-_0x178c0d;logger[_0x342e52(0x140)](_0x342e52(0x13e),_0x342e52(0x14e),{'projectCode':_0x12524b,'error':_0x569bc9 instanceof Error?_0x569bc9[_0x342e52(0x141)]:String(_0x569bc9),'duration':_0x3e510f});throw _0x569bc9;}return formatElapsed(_0x178c0d);}function a138_0x37eb(){const _0xea57cc=['99nxuzQx','20465130nxGEka','now','success','3401982OWrjYj','resolve','代码格式化完成','info','854661eiJkbx','636312SrAyjT','prettier','代码格式化失败','15pNhqXA','3btBrjH','开始格式化代码','1888630nLYzAI','2094764mMXmsD','npx','format','99256OrWzHZ','error','message','--write'];a138_0x37eb=function(){return _0xea57cc;};return a138_0x37eb();}
1
+ (function(_0x2610b8,_0x29ae55){const _0x2a8a4d=a138_0x3a5a,_0x1a51d1=_0x2610b8();while(!![]){try{const _0x5707ef=parseInt(_0x2a8a4d(0xad))/0x1+-parseInt(_0x2a8a4d(0xa9))/0x2+-parseInt(_0x2a8a4d(0xa4))/0x3+parseInt(_0x2a8a4d(0xac))/0x4*(-parseInt(_0x2a8a4d(0x9e))/0x5)+parseInt(_0x2a8a4d(0xaa))/0x6+-parseInt(_0x2a8a4d(0xa8))/0x7+-parseInt(_0x2a8a4d(0xb1))/0x8*(-parseInt(_0x2a8a4d(0xa2))/0x9);if(_0x5707ef===_0x29ae55)break;else _0x1a51d1['push'](_0x1a51d1['shift']());}catch(_0x3b3bf2){_0x1a51d1['push'](_0x1a51d1['shift']());}}}(a138_0x1e06,0x20112));import a138_0x40a252 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a138_0x1e06(){const _0x11f607=['prettier','526167oUbRjs','resolve','代码格式化完成','message','586915WEFBlZ','326330pYZuQd','1468722cSOmrJ','error','2616ZdENYu','6896FlzokZ','cwd','now','npx','41848tWxDYV','代码格式化失败','1130DBtpzv','--write','success','format','774UrbugA'];a138_0x1e06=function(){return _0x11f607;};return a138_0x1e06();}import{logger}from'../../../utils/logger.js';function a138_0x3a5a(_0x141240,_0x27df49){_0x141240=_0x141240-0x9d;const _0x1e061f=a138_0x1e06();let _0x3a5afd=_0x1e061f[_0x141240];return _0x3a5afd;}import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0xc4d9fd){const _0x37d993=a138_0x3a5a,_0x331022=Date[_0x37d993(0xaf)](),_0x37d35a=a138_0x40a252[_0x37d993(0xa5)](process[_0x37d993(0xae)](),_0xc4d9fd);try{logger['info'](_0x37d993(0xa1),'开始格式化代码',{'projectCode':_0xc4d9fd}),await execa(resolveNpmBin(_0x37d993(0xb0)),[_0x37d993(0xa3),_0x37d993(0x9f),'.'],{'cwd':_0x37d35a});const _0x24daaf=Date['now']()-_0x331022;logger[_0x37d993(0xa0)](_0x37d993(0xa1),_0x37d993(0xa6),_0x24daaf,{'projectCode':_0xc4d9fd});}catch(_0xe1e485){const _0x5f0fa6=Date[_0x37d993(0xaf)]()-_0x331022;logger[_0x37d993(0xab)](_0x37d993(0xa1),_0x37d993(0x9d),{'projectCode':_0xc4d9fd,'error':_0xe1e485 instanceof Error?_0xe1e485[_0x37d993(0xa7)]:String(_0xe1e485),'duration':_0x5f0fa6});throw _0xe1e485;}return formatElapsed(_0x331022);}
@@ -1 +1 @@
1
- (function(_0x16dd91,_0x2b91f0){const _0x4df9b1=a139_0x4fc7,_0x546fbe=_0x16dd91();while(!![]){try{const _0x49e37c=parseInt(_0x4df9b1(0x8c))/0x1+parseInt(_0x4df9b1(0x93))/0x2*(parseInt(_0x4df9b1(0x8d))/0x3)+-parseInt(_0x4df9b1(0x97))/0x4*(-parseInt(_0x4df9b1(0x8e))/0x5)+parseInt(_0x4df9b1(0xa1))/0x6+-parseInt(_0x4df9b1(0x92))/0x7+-parseInt(_0x4df9b1(0xa0))/0x8*(-parseInt(_0x4df9b1(0x8f))/0x9)+-parseInt(_0x4df9b1(0x9d))/0xa;if(_0x49e37c===_0x2b91f0)break;else _0x546fbe['push'](_0x546fbe['shift']());}catch(_0x371985){_0x546fbe['push'](_0x546fbe['shift']());}}}(a139_0x51bb,0xb78d6));import a139_0x552dc9 from'node:path';import{execa}from'execa';function a139_0x4fc7(_0x16d4b0,_0x4a9bb5){_0x16d4b0=_0x16d4b0-0x8c;const _0x51bb0c=a139_0x51bb();let _0x4fc736=_0x51bb0c[_0x16d4b0];return _0x4fc736;}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(_0x2a9956){const _0x1945a7=a139_0x4fc7,_0x220edd=Date[_0x1945a7(0x90)](),_0x1fdf08=a139_0x552dc9[_0x1945a7(0x98)](process[_0x1945a7(0x95)](),_0x2a9956);try{logger['info'](_0x1945a7(0x9a),_0x1945a7(0x99),{'projectCode':_0x2a9956,'registry':_0x1945a7(0x91)}),await execa(resolveNpmBin('npm'),[_0x1945a7(0x9a),_0x1945a7(0x9f),_0x1945a7(0x91)],{'cwd':_0x1fdf08});const _0x4bde68=Date['now']()-_0x220edd;logger[_0x1945a7(0x9c)](_0x1945a7(0x9a),_0x1945a7(0x9b),_0x4bde68,{'projectCode':_0x2a9956});}catch(_0x4d9955){const _0x10e265=Date[_0x1945a7(0x90)]()-_0x220edd;logger[_0x1945a7(0x96)](_0x1945a7(0x9a),_0x1945a7(0x94),{'projectCode':_0x2a9956,'error':_0x4d9955 instanceof Error?_0x4d9955[_0x1945a7(0x9e)]:String(_0x4d9955),'duration':_0x10e265});throw _0x4d9955;}return formatElapsed(_0x220edd);}function a139_0x51bb(){const _0x1b8f0d=['140229IEbIin','now','https://registry.npmmirror.com','6298208QvZKfB','5006zUIkrF','依赖安装失败','cwd','error','12DbtTYj','resolve','开始安装依赖','install','依赖安装完成','success','3379930QFhrZf','message','--registry','248zDfWTw','1269924SbSmvE','57139TTzmwI','249fpfaWE','1716690lpTuWG'];a139_0x51bb=function(){return _0x1b8f0d;};return a139_0x51bb();}
1
+ (function(_0x5acc7f,_0x4bc2b5){const _0x37de99=a139_0x2161,_0x525229=_0x5acc7f();while(!![]){try{const _0x35833e=-parseInt(_0x37de99(0x18b))/0x1*(parseInt(_0x37de99(0x191))/0x2)+-parseInt(_0x37de99(0x183))/0x3+parseInt(_0x37de99(0x182))/0x4*(-parseInt(_0x37de99(0x18e))/0x5)+parseInt(_0x37de99(0x186))/0x6+-parseInt(_0x37de99(0x187))/0x7+parseInt(_0x37de99(0x188))/0x8+parseInt(_0x37de99(0x17f))/0x9*(parseInt(_0x37de99(0x18a))/0xa);if(_0x35833e===_0x4bc2b5)break;else _0x525229['push'](_0x525229['shift']());}catch(_0x3adddf){_0x525229['push'](_0x525229['shift']());}}}(a139_0x2512,0x6092f));import a139_0x126af9 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a139_0x2161(_0x44bd7b,_0x16be3b){_0x44bd7b=_0x44bd7b-0x17f;const _0x2512a8=a139_0x2512();let _0x2161d9=_0x2512a8[_0x44bd7b];return _0x2161d9;}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';function a139_0x2512(){const _0x50a451=['4DaKTzd','开始安装依赖','install','115sJsMRf','https://registry.npmmirror.com','resolve','78602MGhpbn','6849LUngbc','依赖安装失败','依赖安装完成','122428ELiERk','673296uxFvZG','npm','now','2700222zsRXDH','1523627DMTPUB','499112yCSgOw','message','15590xswDKe'];a139_0x2512=function(){return _0x50a451;};return a139_0x2512();}export async function installDependencies(_0x13ab32){const _0xfcc9d1=a139_0x2161,_0x19b89f=Date[_0xfcc9d1(0x185)](),_0x34606e=a139_0x126af9[_0xfcc9d1(0x190)](process['cwd'](),_0x13ab32);try{logger['info'](_0xfcc9d1(0x18d),_0xfcc9d1(0x18c),{'projectCode':_0x13ab32,'registry':_0xfcc9d1(0x18f)}),await execa(resolveNpmBin(_0xfcc9d1(0x184)),['install','--registry',_0xfcc9d1(0x18f)],{'cwd':_0x34606e});const _0x41a330=Date[_0xfcc9d1(0x185)]()-_0x19b89f;logger['success'](_0xfcc9d1(0x18d),_0xfcc9d1(0x181),_0x41a330,{'projectCode':_0x13ab32});}catch(_0x4a0592){const _0x485fcb=Date[_0xfcc9d1(0x185)]()-_0x19b89f;logger['error'](_0xfcc9d1(0x18d),_0xfcc9d1(0x180),{'projectCode':_0x13ab32,'error':_0x4a0592 instanceof Error?_0x4a0592[_0xfcc9d1(0x189)]:String(_0x4a0592),'duration':_0x485fcb});throw _0x4a0592;}return formatElapsed(_0x19b89f);}
@@ -1 +1 @@
1
- const a140_0xe120b=a140_0x2462;function a140_0x436e(){const _0x4cdb42=['upgrade','nonInteractive','Create\x20a\x20new\x20project','env','bool','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','boolean','275BTlIPg','project','251380yXcFiV','2026-07','name','args','Project\x20name','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','24xPbWLc','str','24sqKfGP','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','18IoCOCs','yes','3576yyyfjl','160486irBupd','Target\x20environment','write','5gEQtJS','appcode','cookie','10097451BLuIQO','1434468qEEoTd','\x20workspace\x20init','Auto-confirm\x20prompts','8224050nPpzvW','init','trim','string','1383FaTNLy','create','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','Skip\x20confirmation\x20prompt','2931273pliMDR','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)'];a140_0x436e=function(){return _0x4cdb42;};return a140_0x436e();}(function(_0x45edc6,_0x55bf05){const _0x855f20=a140_0x2462,_0x100571=_0x45edc6();while(!![]){try{const _0x110cbf=-parseInt(_0x855f20(0x17a))/0x1*(-parseInt(_0x855f20(0x177))/0x2)+parseInt(_0x855f20(0x188))/0x3*(parseInt(_0x855f20(0x179))/0x4)+-parseInt(_0x855f20(0x17d))/0x5*(parseInt(_0x855f20(0x184))/0x6)+parseInt(_0x855f20(0x181))/0x7+-parseInt(_0x855f20(0x173))/0x8*(-parseInt(_0x855f20(0x161))/0x9)+parseInt(_0x855f20(0x16d))/0xa*(parseInt(_0x855f20(0x16b))/0xb)+-parseInt(_0x855f20(0x175))/0xc*(parseInt(_0x855f20(0x180))/0xd);if(_0x110cbf===_0x55bf05)break;else _0x100571['push'](_0x100571['shift']());}catch(_0x3d6cb){_0x100571['push'](_0x100571['shift']());}}}(a140_0x436e,0xb55bc));function a140_0x2462(_0x1baec6,_0x42b880){_0x1baec6=_0x1baec6-0x161;const _0x436eb5=a140_0x436e();let _0x246286=_0x436eb5[_0x1baec6];return _0x246286;}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_0xe120b(0x187),'description':'App\x20code\x20to\x20initialize'},{'name':a140_0xe120b(0x167),'type':a140_0xe120b(0x187),'description':a140_0xe120b(0x17b)},{'name':a140_0xe120b(0x178),'type':a140_0xe120b(0x16a),'description':a140_0xe120b(0x183),'default':![]}],createFlags=[{'name':a140_0xe120b(0x16f),'type':a140_0xe120b(0x187),'description':a140_0xe120b(0x171)},{'name':a140_0xe120b(0x167),'type':'string','description':a140_0xe120b(0x17b)},{'name':a140_0xe120b(0x17e),'type':a140_0xe120b(0x187),'description':a140_0xe120b(0x163)}],upgradeFlags=[{'name':a140_0xe120b(0x178),'type':a140_0xe120b(0x16a),'description':a140_0xe120b(0x18b),'default':![]}];export const projectDefinitions=[{'service':'project','command':a140_0xe120b(0x185),'description':a140_0xe120b(0x172),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a140_0xe120b(0x182),'since':a140_0xe120b(0x16e)},'flags':initFlags,async 'execute'(_0x2c2ed1){const _0x163737=a140_0xe120b;return await initConfig({'appcode':_0x2c2ed1[_0x163737(0x174)]('appcode')||undefined,'env':_0x2c2ed1[_0x163737(0x174)]('env')||undefined,'autoYes':_0x2c2ed1[_0x163737(0x168)](_0x163737(0x178))}),{'ok':!![]};}},{'service':a140_0xe120b(0x16c),'command':a140_0xe120b(0x189),'description':a140_0xe120b(0x166),'risk':a140_0xe120b(0x17c),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'project-name','description':a140_0xe120b(0x18a),'required':![]}],'flags':createFlags,async 'execute'(_0x7fda8c){const _0x4ae1dc=a140_0xe120b,{createApp:_0x28d2d6}=await import('../../commands/project/create/main.js'),{createProjectNonInteractive:_0x114aba}=await import('../../commands/project/create/non-interactive.js'),_0x7bdacf=_0x7fda8c['str']('name')[_0x4ae1dc(0x186)]()||_0x7fda8c[_0x4ae1dc(0x170)][0x0]?.[_0x4ae1dc(0x186)](),_0x14d5ba=_0x7fda8c[_0x4ae1dc(0x174)](_0x4ae1dc(0x167))||undefined,_0x4e55fb=_0x7fda8c[_0x4ae1dc(0x174)](_0x4ae1dc(0x17e))||undefined;if(_0x7fda8c[_0x4ae1dc(0x165)]){if(!_0x7bdacf)throw CliErrors['validation'](_0x4ae1dc(0x176),'Usage:\x20'+CLI_BIN_NAME+_0x4ae1dc(0x169));await _0x114aba(_0x7bdacf,_0x14d5ba,_0x4e55fb,_0x7fda8c[_0x4ae1dc(0x17f)]);}else await _0x28d2d6({'projectCode':_0x7bdacf,'appCode':_0x4e55fb,'env':_0x14d5ba,'cookie':_0x7fda8c[_0x4ae1dc(0x17f)]});return{'ok':!![]};}},{'service':'project','command':a140_0xe120b(0x164),'description':a140_0xe120b(0x162),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0xdbef41){const _0x2af4ad=a140_0xe120b;return await upgradeApp(_0xdbef41[_0x2af4ad(0x165)],{'yes':_0xdbef41[_0x2af4ad(0x168)](_0x2af4ad(0x178))}),{'ok':!![]};}}];
1
+ const a140_0x28e16a=a140_0x31ff;(function(_0x3d8f3e,_0x890f3a){const _0x1288f2=a140_0x31ff,_0x5514ad=_0x3d8f3e();while(!![]){try{const _0x124c4c=parseInt(_0x1288f2(0x1cc))/0x1+parseInt(_0x1288f2(0x1c6))/0x2+-parseInt(_0x1288f2(0x1c7))/0x3+-parseInt(_0x1288f2(0x1ce))/0x4*(parseInt(_0x1288f2(0x1d4))/0x5)+-parseInt(_0x1288f2(0x1ca))/0x6*(parseInt(_0x1288f2(0x1df))/0x7)+parseInt(_0x1288f2(0x1d5))/0x8*(parseInt(_0x1288f2(0x1d0))/0x9)+parseInt(_0x1288f2(0x1c9))/0xa;if(_0x124c4c===_0x890f3a)break;else _0x5514ad['push'](_0x5514ad['shift']());}catch(_0x7eb43){_0x5514ad['push'](_0x5514ad['shift']());}}}(a140_0x5cbc,0x1bf4d));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';function a140_0x5cbc(){const _0x216867=['Project\x20name','421570uOIAuH','18XFBrJz','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','63126nyGRJZ','write','34212iRiAXN','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','16236HCfTMl','\x20workspace\x20init','bool','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','65VTFEBm','824meWPhN','cookie','yes','name','str','upgrade','appcode','trim','Auto-confirm\x20prompts','project','529732VyugAw','string','Skip\x20confirmation\x20prompt','create','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','project-name','2026-07','Target\x20environment','nonInteractive','init','env','../../commands/project/create/main.js','args','boolean','407280YJOOdn','126027FErzuX'];a140_0x5cbc=function(){return _0x216867;};return a140_0x5cbc();}function a140_0x31ff(_0x57819a,_0x4016b1){_0x57819a=_0x57819a-0x1ba;const _0x5cbcd6=a140_0x5cbc();let _0x31ff8f=_0x5cbcd6[_0x57819a];return _0x31ff8f;}const initFlags=[{'name':a140_0x28e16a(0x1db),'type':a140_0x28e16a(0x1e0),'description':'App\x20code\x20to\x20initialize'},{'name':a140_0x28e16a(0x1c2),'type':a140_0x28e16a(0x1e0),'description':a140_0x28e16a(0x1bf)},{'name':a140_0x28e16a(0x1d7),'type':a140_0x28e16a(0x1c5),'description':a140_0x28e16a(0x1dd),'default':![]}],createFlags=[{'name':a140_0x28e16a(0x1d8),'type':a140_0x28e16a(0x1e0),'description':a140_0x28e16a(0x1c8)},{'name':'env','type':a140_0x28e16a(0x1e0),'description':a140_0x28e16a(0x1bf)},{'name':a140_0x28e16a(0x1db),'type':a140_0x28e16a(0x1e0),'description':'App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)'}],upgradeFlags=[{'name':'yes','type':'boolean','description':a140_0x28e16a(0x1ba),'default':![]}];export const projectDefinitions=[{'service':'project','command':a140_0x28e16a(0x1c1),'description':a140_0x28e16a(0x1cb),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a140_0x28e16a(0x1d1),'since':a140_0x28e16a(0x1be)},'flags':initFlags,async 'execute'(_0x5c4c98){const _0xb47db4=a140_0x28e16a;return await initConfig({'appcode':_0x5c4c98['str'](_0xb47db4(0x1db))||undefined,'env':_0x5c4c98[_0xb47db4(0x1d9)](_0xb47db4(0x1c2))||undefined,'autoYes':_0x5c4c98[_0xb47db4(0x1d2)](_0xb47db4(0x1d7))}),{'ok':!![]};}},{'service':a140_0x28e16a(0x1de),'command':a140_0x28e16a(0x1bb),'description':'Create\x20a\x20new\x20project','risk':a140_0x28e16a(0x1cd),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a140_0x28e16a(0x1bd),'description':a140_0x28e16a(0x1cf),'required':![]}],'flags':createFlags,async 'execute'(_0x266861){const _0x37ee27=a140_0x28e16a,{createApp:_0x32cf99}=await import(_0x37ee27(0x1c3)),{createProjectNonInteractive:_0x3a77b3}=await import('../../commands/project/create/non-interactive.js'),_0x7d2cb0=_0x266861[_0x37ee27(0x1d9)](_0x37ee27(0x1d8))[_0x37ee27(0x1dc)]()||_0x266861[_0x37ee27(0x1c4)][0x0]?.[_0x37ee27(0x1dc)](),_0x46d2c4=_0x266861['str'](_0x37ee27(0x1c2))||undefined,_0x378996=_0x266861['str']('appcode')||undefined;if(_0x266861['nonInteractive']){if(!_0x7d2cb0)throw CliErrors['validation']('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','Usage:\x20'+CLI_BIN_NAME+_0x37ee27(0x1d3));await _0x3a77b3(_0x7d2cb0,_0x46d2c4,_0x378996,_0x266861[_0x37ee27(0x1d6)]);}else await _0x32cf99({'projectCode':_0x7d2cb0,'appCode':_0x378996,'env':_0x46d2c4,'cookie':_0x266861[_0x37ee27(0x1d6)]});return{'ok':!![]};}},{'service':a140_0x28e16a(0x1de),'command':a140_0x28e16a(0x1da),'description':a140_0x28e16a(0x1bc),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x4d5c60){const _0x362e68=a140_0x28e16a;return await upgradeApp(_0x4d5c60[_0x362e68(0x1c0)],{'yes':_0x4d5c60[_0x362e68(0x1d2)](_0x362e68(0x1d7))}),{'ok':!![]};}}];
@@ -1 +1 @@
1
- (function(_0x428709,_0x5a38f8){const _0x5f4477=a141_0x5d76,_0x41ee2f=_0x428709();while(!![]){try{const _0x4321d2=-parseInt(_0x5f4477(0xa6))/0x1*(-parseInt(_0x5f4477(0x81))/0x2)+parseInt(_0x5f4477(0x93))/0x3+parseInt(_0x5f4477(0x8b))/0x4+parseInt(_0x5f4477(0xa0))/0x5*(-parseInt(_0x5f4477(0x7d))/0x6)+-parseInt(_0x5f4477(0x9b))/0x7*(-parseInt(_0x5f4477(0x7e))/0x8)+parseInt(_0x5f4477(0xa2))/0x9*(parseInt(_0x5f4477(0x77))/0xa)+-parseInt(_0x5f4477(0x90))/0xb;if(_0x4321d2===_0x5a38f8)break;else _0x41ee2f['push'](_0x41ee2f['shift']());}catch(_0xe4ae42){_0x41ee2f['push'](_0x41ee2f['shift']());}}}(a141_0x25d9,0x74ef3));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a141_0x58dd9f 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(_0x1686a2){const _0x12f22f=a141_0x5d76,{appcode:_0x34c837,env:_0x1eaed3,autoYes:_0x3600d6}=_0x1686a2,_0x1fa104=process['cwd']();if(getProjectConfigPath())throw new Error('.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.');let _0x51b73b;for(const _0x4fe68d of LEGACY_CONFIG_NAMES){const _0x51d509=resolve(_0x1fa104,_0x4fe68d);if(existsSync(_0x51d509)){_0x51b73b=_0x51d509;break;}}if(_0x51b73b){let _0x6971ea={};try{_0x6971ea=JSON[_0x12f22f(0xa7)](readFileSync(_0x51b73b,_0x12f22f(0xa3)));}catch{}const _0xf19b10=basename(_0x51b73b),_0x3bf687=_0x6971ea?.[_0x12f22f(0x99)]||_0x6971ea?.[_0x12f22f(0x96)];let _0x4f0fb8=_0x3600d6;!_0x3600d6&&(console[_0x12f22f(0x8c)](a141_0x58dd9f[_0x12f22f(0x84)](_0x12f22f(0x94)+a141_0x58dd9f[_0x12f22f(0x7c)](_0xf19b10))),_0x3bf687&&console[_0x12f22f(0x8c)](a141_0x58dd9f[_0x12f22f(0x9c)](_0x12f22f(0x7f)+_0x3bf687)),_0x4f0fb8=await confirm({'message':_0x12f22f(0x88)+a141_0x58dd9f['bold']('.rabetbase.json')+'?\x20(Old\x20file\x20→\x20*.bak)','default':!![]}));if(!_0x4f0fb8){console[_0x12f22f(0x8c)](_0x12f22f(0x98)+CLI_BIN_NAME+_0x12f22f(0x80));return;}const _0x3cd9e7=resolve(_0x1fa104,NEW_CONFIG_NAME),_0x2b20a2=getCliVersionFromPkg(),_0x4ba47c=readRawConfig(),_0x2b51aa=_0x34c837||(typeof _0x6971ea?.[_0x12f22f(0x99)]===_0x12f22f(0x9d)?_0x6971ea[_0x12f22f(0x99)]:undefined)||(typeof _0x6971ea?.[_0x12f22f(0x96)]===_0x12f22f(0x9d)?_0x6971ea['app']:undefined)||await askAppcode(),_0x59e102=typeof _0x6971ea?.[_0x12f22f(0x95)]===_0x12f22f(0x9d)?_0x6971ea[_0x12f22f(0x95)]:typeof _0x4ba47c[_0x12f22f(0x95)]===_0x12f22f(0x9d)?_0x4ba47c[_0x12f22f(0x95)]:'production',_0xf776cd=buildCanonicalProjectConfig({..._0x4ba47c,..._0x6971ea},{'appCodes':[_0x2b51aa],'env':_0x59e102,'metadata':{'version':_0x2b20a2,'migratedAt':new Date()['toLocaleString'](),'migratedFrom':_0x51b73b}});writeConfigFile(_0x3cd9e7,_0xf776cd);const _0x34dd13=_0x51b73b+_0x12f22f(0x9f);renameSync(_0x51b73b,_0x34dd13),logger[_0x12f22f(0x8f)](_0x1fa104),logger['info'](_0x12f22f(0x82),_0x12f22f(0x83),{'from':_0x51b73b,'to':_0x3cd9e7,'appcode':_0x2b51aa,'env':_0xf776cd['env']}),console[_0x12f22f(0x8c)](a141_0x58dd9f[_0x12f22f(0x87)](_0x12f22f(0x76)+_0xf19b10+_0x12f22f(0x78))),console[_0x12f22f(0x8c)](a141_0x58dd9f['cyan'](_0x12f22f(0x92)+Object[_0x12f22f(0x7a)](_0xf776cd[_0x12f22f(0x86)]||{})['join'](',\x20'))),console[_0x12f22f(0x8c)](a141_0x58dd9f[_0x12f22f(0x9c)](_0x12f22f(0x9a)+_0xf776cd[_0x12f22f(0x91)])),console[_0x12f22f(0x8c)](a141_0x58dd9f['gray']('\x20\x20Old\x20file\x20backed\x20up\x20as\x20'+_0xf19b10+_0x12f22f(0x9f)));return;}const _0x335424=_0x34c837||await askAppcode(),_0x2bb120=resolve(_0x1fa104,NEW_CONFIG_NAME),_0x12f08d=getCliVersionFromPkg(),_0xa68f29=readRawConfig(),_0x52df8b=typeof _0xa68f29[_0x12f22f(0x95)]===_0x12f22f(0x9d)?_0xa68f29[_0x12f22f(0x95)]:undefined,_0x33863e=buildCanonicalProjectConfig({},{'appCodes':[_0x335424],'env':_0x1eaed3||_0x52df8b||_0x12f22f(0x7b),'metadata':{'version':_0x12f08d,'createdAt':new Date()[_0x12f22f(0x79)]()}});writeConfigFile(_0x2bb120,_0x33863e),logger[_0x12f22f(0x8f)](_0x1fa104),logger['info'](_0x12f22f(0x82),'初始化项目配置文件成功',{'appcode':_0x335424,'env':_0x33863e[_0x12f22f(0x95)],'version':_0x33863e[_0x12f22f(0x85)],'configPath':_0x2bb120}),console[_0x12f22f(0x8c)](a141_0x58dd9f[_0x12f22f(0x87)]('✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory')),console['log'](a141_0x58dd9f[_0x12f22f(0x9c)]('\x20\x20Apps:\x20'+Object['keys'](_0x33863e[_0x12f22f(0x86)]||{})[_0x12f22f(0x8d)](',\x20'))),console['log'](a141_0x58dd9f['cyan'](_0x12f22f(0x9a)+_0x33863e[_0x12f22f(0x91)])),console[_0x12f22f(0x8c)](_0x12f22f(0x8a)+CLI_BIN_NAME+_0x12f22f(0xa8)+CLI_BIN_NAME+_0x12f22f(0x8e));}function a141_0x5d76(_0x13c0ec,_0x41f0d8){_0x13c0ec=_0x13c0ec-0x76;const _0x25d9ec=a141_0x25d9();let _0x5d76d0=_0x25d9ec[_0x13c0ec];return _0x5d76d0;}function askAppcode(){const _0x1913ef=a141_0x5d76;return input({'message':_0x1913ef(0xa1),'validate':_0xa87414=>{const _0x167904=_0x1913ef;if(!_0xa87414[_0x167904(0x97)]())return _0x167904(0xa4);const {valid:_0x46dff8,message:_0x5caf8b}=validateAppcode(_0xa87414[_0x167904(0x97)]());return _0x46dff8||_0x5caf8b||'Invalid\x20App\x20Code';}});}function getCliVersionFromPkg(){const _0x14771b=a141_0x5d76;try{const _0x492014=fileURLToPath(import.meta.url),_0x1f2ec=resolve(dirname(_0x492014),_0x14771b(0x89)),_0x1a814c=JSON[_0x14771b(0xa7)](readFileSync(resolve(_0x1f2ec,_0x14771b(0xa5)),'utf8'));return _0x1a814c[_0x14771b(0x85)]||_0x14771b(0x9e);}catch{return _0x14771b(0x9e);}}function a141_0x25d9(){const _0x309d51=['appcode','\x20\x20Default:\x20','480214qIfBWB','cyan','string','1.0.0','.bak','10HtAGDE','Please\x20enter\x20App\x20Code:','271287TqlhpC','utf8','App\x20Code\x20cannot\x20be\x20empty','package.json','13dLybPR','parse','\x20api\x20generate\x27\x20and\x20\x27','✓\x20Upgraded\x20','290aBYsXX','\x20→\x20.rabetbase.json','toLocaleString','keys','production','bold','2860878ajFjJu','8CZqAhw','\x20\x20appcode:\x20','\x20workspace\x20init`\x20to\x20start\x20fresh.','72484qFcxmB','init','从旧配置文件升级成功','yellow','version','apps','green','Upgrade\x20it\x20to\x20','../..','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','1650748yPHiOf','log','join','\x20api\x20pull\x27','setLogPath','14509968WBYSDa','defaultApp','\x20\x20Apps:\x20','2775285OssDWg','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','env','app','trim','Migration\x20cancelled.\x20Run\x20`'];a141_0x25d9=function(){return _0x309d51;};return a141_0x25d9();}
1
+ (function(_0x2ebb01,_0x794ea8){const _0x169594=a141_0x2ba2,_0x470c68=_0x2ebb01();while(!![]){try{const _0x3fa4e5=parseInt(_0x169594(0x9e))/0x1+-parseInt(_0x169594(0x9f))/0x2*(-parseInt(_0x169594(0xb8))/0x3)+parseInt(_0x169594(0xbb))/0x4+parseInt(_0x169594(0xa0))/0x5*(-parseInt(_0x169594(0xbc))/0x6)+parseInt(_0x169594(0xc5))/0x7+parseInt(_0x169594(0xad))/0x8+parseInt(_0x169594(0xb2))/0x9*(-parseInt(_0x169594(0xb7))/0xa);if(_0x3fa4e5===_0x794ea8)break;else _0x470c68['push'](_0x470c68['shift']());}catch(_0x3d7c4c){_0x470c68['push'](_0x470c68['shift']());}}}(a141_0x27d8,0xf0d27));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a141_0x3e480a from'chalk';function a141_0x27d8(){const _0x505f29=['trim','yellow','cyan','defaultApp','.bak','\x20\x20Default:\x20','\x20api\x20generate\x27\x20and\x20\x27','package.json','1634953DtXHRJ','14zvVQOz','337475XjPkeO','\x20workspace\x20init`\x20to\x20start\x20fresh.','keys','appcode','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','gray','join','version','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','apps','Invalid\x20App\x20Code','从旧配置文件升级成功','\x20\x20appcode:\x20','6540576JSlyOa','cwd','bold','\x20api\x20pull\x27','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory','132237eirkQf','env','production','\x20→\x20.rabetbase.json','?\x20(Old\x20file\x20→\x20*.bak)','1260HVpjQq','146739JBbDUi','green','info','640220rRHozm','126gXcKYO','.rabetbase.json','App\x20Code\x20cannot\x20be\x20empty','utf8','string','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','setLogPath','../..','9101043ATrHCq','toLocaleString','\x20\x20Apps:\x20','log','init','app'];a141_0x27d8=function(){return _0x505f29;};return a141_0x27d8();}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(_0x51d4e9){const _0x32322e=a141_0x2ba2,{appcode:_0x352e9c,env:_0x40b446,autoYes:_0x16c2de}=_0x51d4e9,_0xfca136=process[_0x32322e(0xae)]();if(getProjectConfigPath())throw new Error(_0x32322e(0xa8));let _0x356b53;for(const _0x475865 of LEGACY_CONFIG_NAMES){const _0x5e7485=resolve(_0xfca136,_0x475865);if(existsSync(_0x5e7485)){_0x356b53=_0x5e7485;break;}}if(_0x356b53){let _0x396193={};try{_0x396193=JSON['parse'](readFileSync(_0x356b53,_0x32322e(0xbf)));}catch{}const _0x521841=basename(_0x356b53),_0x30eeb6=_0x396193?.['appcode']||_0x396193?.[_0x32322e(0x95)];let _0x2891d5=_0x16c2de;!_0x16c2de&&(console[_0x32322e(0x93)](a141_0x3e480a[_0x32322e(0x97)](_0x32322e(0xa4)+a141_0x3e480a[_0x32322e(0xaf)](_0x521841))),_0x30eeb6&&console[_0x32322e(0x93)](a141_0x3e480a[_0x32322e(0x98)](_0x32322e(0xac)+_0x30eeb6)),_0x2891d5=await confirm({'message':'Upgrade\x20it\x20to\x20'+a141_0x3e480a[_0x32322e(0xaf)](_0x32322e(0xbd))+_0x32322e(0xb6),'default':!![]}));if(!_0x2891d5){console['log']('Migration\x20cancelled.\x20Run\x20`'+CLI_BIN_NAME+_0x32322e(0xa1));return;}const _0x218628=resolve(_0xfca136,NEW_CONFIG_NAME),_0x1c61de=getCliVersionFromPkg(),_0x50843b=readRawConfig(),_0x49edda=_0x352e9c||(typeof _0x396193?.[_0x32322e(0xa3)]===_0x32322e(0xc0)?_0x396193[_0x32322e(0xa3)]:undefined)||(typeof _0x396193?.[_0x32322e(0x95)]===_0x32322e(0xc0)?_0x396193[_0x32322e(0x95)]:undefined)||await askAppcode(),_0x234435=typeof _0x396193?.['env']===_0x32322e(0xc0)?_0x396193[_0x32322e(0xb3)]:typeof _0x50843b[_0x32322e(0xb3)]===_0x32322e(0xc0)?_0x50843b['env']:_0x32322e(0xb4),_0x349a43=buildCanonicalProjectConfig({..._0x50843b,..._0x396193},{'appCodes':[_0x49edda],'env':_0x234435,'metadata':{'version':_0x1c61de,'migratedAt':new Date()['toLocaleString'](),'migratedFrom':_0x356b53}});writeConfigFile(_0x218628,_0x349a43);const _0x967408=_0x356b53+_0x32322e(0x9a);renameSync(_0x356b53,_0x967408),logger[_0x32322e(0xc3)](_0xfca136),logger['info']('init',_0x32322e(0xab),{'from':_0x356b53,'to':_0x218628,'appcode':_0x49edda,'env':_0x349a43[_0x32322e(0xb3)]}),console[_0x32322e(0x93)](a141_0x3e480a[_0x32322e(0xb9)]('✓\x20Upgraded\x20'+_0x521841+_0x32322e(0xb5))),console[_0x32322e(0x93)](a141_0x3e480a[_0x32322e(0x98)]('\x20\x20Apps:\x20'+Object[_0x32322e(0xa2)](_0x349a43[_0x32322e(0xa9)]||{})[_0x32322e(0xa6)](',\x20'))),console[_0x32322e(0x93)](a141_0x3e480a[_0x32322e(0x98)]('\x20\x20Default:\x20'+_0x349a43[_0x32322e(0x99)])),console[_0x32322e(0x93)](a141_0x3e480a[_0x32322e(0xa5)](_0x32322e(0xc2)+_0x521841+_0x32322e(0x9a)));return;}const _0x3d4614=_0x352e9c||await askAppcode(),_0x182f06=resolve(_0xfca136,NEW_CONFIG_NAME),_0x3a512f=getCliVersionFromPkg(),_0x4aeef8=readRawConfig(),_0x5747ff=typeof _0x4aeef8['env']==='string'?_0x4aeef8[_0x32322e(0xb3)]:undefined,_0x415581=buildCanonicalProjectConfig({},{'appCodes':[_0x3d4614],'env':_0x40b446||_0x5747ff||'production','metadata':{'version':_0x3a512f,'createdAt':new Date()[_0x32322e(0xc6)]()}});writeConfigFile(_0x182f06,_0x415581),logger[_0x32322e(0xc3)](_0xfca136),logger[_0x32322e(0xba)](_0x32322e(0x94),'初始化项目配置文件成功',{'appcode':_0x3d4614,'env':_0x415581['env'],'version':_0x415581[_0x32322e(0xa7)],'configPath':_0x182f06}),console['log'](a141_0x3e480a[_0x32322e(0xb9)](_0x32322e(0xb1))),console[_0x32322e(0x93)](a141_0x3e480a[_0x32322e(0x98)](_0x32322e(0xc7)+Object['keys'](_0x415581['apps']||{})[_0x32322e(0xa6)](',\x20'))),console[_0x32322e(0x93)](a141_0x3e480a[_0x32322e(0x98)](_0x32322e(0x9b)+_0x415581[_0x32322e(0x99)])),console[_0x32322e(0x93)](_0x32322e(0xc1)+CLI_BIN_NAME+_0x32322e(0x9c)+CLI_BIN_NAME+_0x32322e(0xb0));}function a141_0x2ba2(_0xe9f2a8,_0xe03db7){_0xe9f2a8=_0xe9f2a8-0x93;const _0x27d8ea=a141_0x27d8();let _0x2ba27c=_0x27d8ea[_0xe9f2a8];return _0x2ba27c;}function askAppcode(){return input({'message':'Please\x20enter\x20App\x20Code:','validate':_0x5d1883=>{const _0x3382ec=a141_0x2ba2;if(!_0x5d1883[_0x3382ec(0x96)]())return _0x3382ec(0xbe);const {valid:_0x373649,message:_0x543669}=validateAppcode(_0x5d1883[_0x3382ec(0x96)]());return _0x373649||_0x543669||_0x3382ec(0xaa);}});}function getCliVersionFromPkg(){const _0x580db1=a141_0x2ba2;try{const _0x3497a9=fileURLToPath(import.meta.url),_0xe909a2=resolve(dirname(_0x3497a9),_0x580db1(0xc4)),_0x5d53c6=JSON['parse'](readFileSync(resolve(_0xe909a2,_0x580db1(0x9d)),_0x580db1(0xbf)));return _0x5d53c6[_0x580db1(0xa7)]||'1.0.0';}catch{return'1.0.0';}}
@@ -1 +1 @@
1
- const a142_0x48c266=a142_0x43b0;(function(_0xe2735a,_0x446713){const _0x59c3ad=a142_0x43b0,_0x10f2d6=_0xe2735a();while(!![]){try{const _0x5e5586=parseInt(_0x59c3ad(0x1ff))/0x1+-parseInt(_0x59c3ad(0x211))/0x2+parseInt(_0x59c3ad(0x1f2))/0x3+-parseInt(_0x59c3ad(0x22c))/0x4*(parseInt(_0x59c3ad(0x226))/0x5)+-parseInt(_0x59c3ad(0x224))/0x6+parseInt(_0x59c3ad(0x1fc))/0x7+-parseInt(_0x59c3ad(0x1b2))/0x8*(-parseInt(_0x59c3ad(0x1bc))/0x9);if(_0x5e5586===_0x446713)break;else _0x10f2d6['push'](_0x10f2d6['shift']());}catch(_0x8f9834){_0x10f2d6['push'](_0x10f2d6['shift']());}}}(a142_0x3800,0x19133));import a142_0x1c66f9 from'chalk';import a142_0xd00850 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';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a142_0x48c266(0x1bd)](_0x42391f=>_0x42391f!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x7dc893){const _0x385c06=a142_0x48c266,_0x5ed69e=[];for(const _0x2cdf48 of Object[_0x385c06(0x1d8)](CORE_IDE_CONFIGS)){if(_0x2cdf48['files'])for(const _0x4d121f of _0x2cdf48[_0x385c06(0x1ba)]){_0x5ed69e[_0x385c06(0x1d5)](resolve(_0x7dc893,_0x4d121f[_0x385c06(0x1f3)]));}}return _0x5ed69e;}function a142_0x3800(){const _0x48ffec=['.bak','args','files','white','187101DCXEYJ','filter','no\x20legacy\x20entry','===\x20Upgrade\x20Analysis\x20===','\x20→\x20keys:\x20','red','status','step','Step\x204/7:\x20MCP\x20config\x20—\x20','Config\x20file:','oldArtifacts','log','[\x22@lovrabet/sdk\x22]:\x20','message','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','not\x20found\x20or\x20already\x20at\x20latest','hasNewConfig','Step\x201/7:\x20Migrating\x20config...','no\x20legacy\x20config\x20found','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','\x20\x20Action:\x20delete','dependencies','.cursor/rules/lovrabet_rules.mdc','info','push','latest','join','values','\x20\x20npm\x20install','done','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','detail','.cursor/mcp.json','needsSkillSwap','includes','stringify','Upgrade\x20@lovrabet/sdk','Remove\x20old\x20skill','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','.lovrabet','Proceed\x20with\x20upgrade?','MCP\x20config:','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','length','Remove\x20.lovrabet/','object','removed\x20','bold','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','skipped','no\x20matching\x20entry\x20found','\x20\x20\x20\x20\x20\x20\x20','devDependencies','270000NgKuOm','path','some','FAIL','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','===\x20Upgrade\x20Summary\x20===','string','Step\x206/7:\x20Installing\x20new\x20skill...','oldMcpConfig','yes','6146DeCNIG','@lovrabet/sdk','Step\x205/7:\x20Removing\x20old\x20skill...','188498DNaEGf','isDirectory','\x20→\x20latest','not\x20found\x20(will\x20create)','sdkUpgrade','yellow','Install\x20new\x20skill','package.json','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','failed','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','label','FOUND','\x20\x20New\x20config\x20(.rabetbase.json):\x20','inherit','\x20removed','fail','green','224510GiMchv','not\x20needed','isArray','cyan','undefined','utf8','Step\x201/7:\x20Config\x20migration\x20—\x20','Skill\x20swap:','\x20from\x20','\x20\x20bun\x20install','keys','gray','\x20\x20Step\x20','exit\x20','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','\x20(backup:\x20','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','.claude/skills/lovrabet','\x20\x20#\x20or','814020TUyqbg','Legacy\x20artifacts:','74255JTGZAQ','\x20→\x20','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','Upgrade\x20cancelled.','entries','Step\x204/7:\x20Cleaning\x20MCP\x20config...','48IURIgn','mcpServers','@lovrabet/dataset-mcp-server','parse','Config\x20migration','96xhWxLk','Clean\x20MCP\x20config','@lovrabet/sdk:','start','oldPath','succeed'];a142_0x3800=function(){return _0x48ffec;};return a142_0x3800();}function analyse(_0x4594f9){const _0x3c4522=a142_0x48c266;let _0x18f327=null;const _0x546f21=resolve(_0x4594f9,NEW_CONFIG_NAME),_0x4ae739=existsSync(_0x546f21);for(const _0x5078fc of LEGACY_CONFIG_NAMES){const _0xc2d0f6=resolve(_0x4594f9,_0x5078fc);if(existsSync(_0xc2d0f6)){const _0xf6f080=readConfigFile(_0xc2d0f6),_0x150118=Object[_0x3c4522(0x21b)](_0xf6f080)[_0x3c4522(0x1bd)](_0x50645c=>typeof _0xf6f080[_0x50645c]!==_0x3c4522(0x215));_0x18f327={'oldPath':_0xc2d0f6,'hasNewConfig':_0x4ae739,'fields':_0x150118};break;}}const _0xcf7269=[],_0x4d8e4a=resolve(_0x4594f9,_0x3c4522(0x1e4));if(existsSync(_0x4d8e4a))_0xcf7269['push'](_0x4d8e4a);const _0x330091=resolve(_0x4594f9,_0x3c4522(0x1d3));if(existsSync(_0x330091))_0xcf7269[_0x3c4522(0x1d5)](_0x330091);const _0x4a6012=resolve(_0x4594f9,_0x3c4522(0x222));if(existsSync(_0x4a6012))_0xcf7269[_0x3c4522(0x1d5)](_0x4a6012);for(const _0x44c8e3 of collectIdeSkillFiles(_0x4594f9)){if(existsSync(_0x44c8e3))_0xcf7269[_0x3c4522(0x1d5)](_0x44c8e3);}let _0x5b8f25=null;const _0x1638b7=resolve(_0x4594f9,_0x3c4522(0x1dd));if(existsSync(_0x1638b7))try{const _0x24850f=JSON['parse'](readFileSync(_0x1638b7,_0x3c4522(0x216)));if(_0x24850f?.['mcpServers']&&typeof _0x24850f[_0x3c4522(0x22d)]===_0x3c4522(0x1ea)){const _0x54b5e8=[];for(const [_0x17090c,_0x1b19af]of Object['entries'](_0x24850f['mcpServers'])){const _0xd0583f=_0x1b19af;_0xd0583f?.['args']&&Array[_0x3c4522(0x213)](_0xd0583f[_0x3c4522(0x1b9)])&&_0xd0583f[_0x3c4522(0x1b9)][_0x3c4522(0x1f4)](_0x2277de=>typeof _0x2277de==='string'&&_0x2277de['includes']('@lovrabet/dataset-mcp-server'))&&_0x54b5e8[_0x3c4522(0x1d5)](_0x17090c);}_0x54b5e8['length']>0x0&&(_0x5b8f25={'path':_0x1638b7,'keys':_0x54b5e8});}}catch{}const _0x2de0bc=_0xcf7269[_0x3c4522(0x1e8)]>0x0||_0x18f327!==null;let _0x66c402=null;const _0x48fecd=resolve(_0x4594f9,_0x3c4522(0x206));if(existsSync(_0x48fecd))try{const _0x162d2d=JSON[_0x3c4522(0x22f)](readFileSync(_0x48fecd,_0x3c4522(0x216)));for(const _0x456daa of[_0x3c4522(0x1d2),_0x3c4522(0x1f1)]){const _0x3f90fd=_0x162d2d?.[_0x456daa]?.[_0x3c4522(0x1fd)];if(typeof _0x3f90fd==='string'){_0x3f90fd!=='latest'&&(_0x66c402={'pkgPath':_0x48fecd,'currentVersion':_0x3f90fd,'field':_0x456daa});break;}}}catch{}return{'configMigration':_0x18f327,'oldArtifacts':_0xcf7269,'oldMcpConfig':_0x5b8f25,'needsSkillSwap':_0x2de0bc,'sdkUpgrade':_0x66c402};}function printReport(_0x51f44b){const _0x47dd17=a142_0x48c266,{configMigration:_0x16a340,oldArtifacts:_0x46b2a7,oldMcpConfig:_0x1e4e48,needsSkillSwap:_0x1e8cd2}=_0x51f44b;console[_0x47dd17(0x1c7)](''),console[_0x47dd17(0x1c7)](a142_0x1c66f9['bold'](_0x47dd17(0x1bf))),console[_0x47dd17(0x1c7)]('');_0x16a340?(console['log'](a142_0x1c66f9[_0x47dd17(0x214)]('Config\x20file:')+('\x20\x20'+a142_0x1c66f9['yellow'](_0x16a340[_0x47dd17(0x1b6)]))),console['log'](_0x47dd17(0x20c)+(_0x16a340[_0x47dd17(0x1cc)]?a142_0x1c66f9[_0x47dd17(0x210)]('already\x20exists\x20(will\x20merge)'):a142_0x1c66f9[_0x47dd17(0x21c)](_0x47dd17(0x202)))),console['log']('\x20\x20Fields\x20to\x20migrate:\x20'+_0x16a340['fields'][_0x47dd17(0x1d7)](',\x20')),console['log'](_0x47dd17(0x207))):console[_0x47dd17(0x1c7)](a142_0x1c66f9[_0x47dd17(0x214)](_0x47dd17(0x1c5))+'\x20\x20'+a142_0x1c66f9[_0x47dd17(0x21c)](_0x47dd17(0x1ce)));console['log']('');if(_0x46b2a7[_0x47dd17(0x1e8)]>0x0){console['log'](a142_0x1c66f9[_0x47dd17(0x214)](_0x47dd17(0x225)));for(const _0x5cdec5 of _0x46b2a7){console[_0x47dd17(0x1c7)]('\x20\x20'+a142_0x1c66f9[_0x47dd17(0x1c1)](_0x47dd17(0x20b))+'\x20\x20'+_0x5cdec5);}console[_0x47dd17(0x1c7)](_0x47dd17(0x1d1));}else console['log'](a142_0x1c66f9[_0x47dd17(0x214)](_0x47dd17(0x225))+'\x20\x20'+a142_0x1c66f9[_0x47dd17(0x21c)]('none\x20found'));console[_0x47dd17(0x1c7)]('');_0x1e4e48?(console['log'](a142_0x1c66f9[_0x47dd17(0x214)](_0x47dd17(0x1e6))+('\x20\x20'+a142_0x1c66f9[_0x47dd17(0x204)](_0x1e4e48['path'])+_0x47dd17(0x1c0)+_0x1e4e48['keys'][_0x47dd17(0x1d7)](',\x20'))),console[_0x47dd17(0x1c7)]('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console[_0x47dd17(0x1c7)](a142_0x1c66f9[_0x47dd17(0x214)](_0x47dd17(0x1e6))+'\x20\x20'+a142_0x1c66f9['gray'](_0x47dd17(0x1be)));console[_0x47dd17(0x1c7)](''),console[_0x47dd17(0x1c7)](a142_0x1c66f9[_0x47dd17(0x214)](_0x47dd17(0x218))+('\x20\x20'+(_0x1e8cd2?a142_0x1c66f9['yellow']('needed'):a142_0x1c66f9[_0x47dd17(0x210)](_0x47dd17(0x212)))));_0x1e8cd2&&console[_0x47dd17(0x1c7)](_0x47dd17(0x1e7)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x47dd17(0x1c7)]('');if(_0x51f44b[_0x47dd17(0x203)]){const {currentVersion:_0x20e57c,field:_0x47bf36,pkgPath:_0xdfae46}=_0x51f44b[_0x47dd17(0x203)];console[_0x47dd17(0x1c7)](a142_0x1c66f9[_0x47dd17(0x214)](_0x47dd17(0x1b4))+('\x20\x20'+a142_0x1c66f9[_0x47dd17(0x204)](_0xdfae46))),console[_0x47dd17(0x1c7)]('\x20\x20Current\x20version\x20in\x20'+_0x47bf36+':\x20'+a142_0x1c66f9['yellow'](_0x20e57c)+_0x47dd17(0x227)+a142_0x1c66f9[_0x47dd17(0x210)](_0x47dd17(0x1d6))),console[_0x47dd17(0x1c7)](_0x47dd17(0x221));}else console[_0x47dd17(0x1c7)](a142_0x1c66f9[_0x47dd17(0x214)](_0x47dd17(0x1b4))+'\x20\x20'+a142_0x1c66f9[_0x47dd17(0x21c)](_0x47dd17(0x1cb)));console[_0x47dd17(0x1c7)]('');}function execConfigMigration(_0x25be8c,_0x274fc0){const _0x40c593=a142_0x48c266,{configMigration:_0xca11ae}=_0x25be8c;if(!_0xca11ae?.[_0x40c593(0x1b6)])return{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':'skipped\x20(no\x20legacy\x20config)'};const _0x5b5293=readConfigFile(_0xca11ae[_0x40c593(0x1b6)]),_0x12004b=resolve(_0x274fc0,NEW_CONFIG_NAME),_0x5828ff=_0xca11ae[_0x40c593(0x1cc)]?readConfigFile(_0x12004b):{};for(const [_0x30c052,_0x17dd4d]of Object[_0x40c593(0x22a)](_0x5b5293)){!(_0x30c052 in _0x5828ff)&&(_0x5828ff[_0x30c052]=_0x17dd4d);}writeConfigFile(_0x12004b,_0x5828ff);const _0x3c12c2=_0xca11ae[_0x40c593(0x1b6)]+_0x40c593(0x1b8);return renameSync(_0xca11ae[_0x40c593(0x1b6)],_0x3c12c2),{'step':0x1,'label':_0x40c593(0x1b1),'ok':!![],'detail':_0xca11ae[_0x40c593(0x1b6)]+_0x40c593(0x227)+_0x12004b+_0x40c593(0x220)+_0x3c12c2+')'};}function execRemoveOldArtifacts(_0x365e5f){const _0x97cff4=a142_0x48c266,_0x5ed93c=[];for(const _0x2a9fa of _0x365e5f){try{if(!existsSync(_0x2a9fa))continue;const _0x501dae=tryStat(_0x2a9fa);_0x501dae?.[_0x97cff4(0x200)]()?rmSync(_0x2a9fa,{'recursive':!![],'force':!![]}):unlinkSync(_0x2a9fa);}catch(_0x435c23){_0x5ed93c[_0x97cff4(0x1d5)](_0x2a9fa+':\x20'+_0x435c23['message']);}}return{'step':0x3,'label':'Remove\x20legacy\x20artifacts','ok':_0x5ed93c[_0x97cff4(0x1e8)]===0x0,'detail':_0x5ed93c[_0x97cff4(0x1e8)]>0x0?_0x365e5f[_0x97cff4(0x1e8)]-_0x5ed93c[_0x97cff4(0x1e8)]+'/'+_0x365e5f['length']+'\x20removed\x20('+_0x5ed93c[_0x97cff4(0x1d7)](';\x20')+')':_0x365e5f[_0x97cff4(0x1e8)]+_0x97cff4(0x20e)};}function execCleanMcp(_0xa7f3ca){const _0xfcccd0=a142_0x48c266;if(!_0xa7f3ca[_0xfcccd0(0x1fa)])return{'step':0x4,'label':_0xfcccd0(0x1b3),'ok':!![],'detail':_0xfcccd0(0x1ee)};try{const _0x8d0e22=readFileSync(_0xa7f3ca[_0xfcccd0(0x1fa)][_0xfcccd0(0x1f3)],_0xfcccd0(0x216)),_0x533592=JSON['parse'](_0x8d0e22);if(_0x533592?.[_0xfcccd0(0x22d)]&&typeof _0x533592[_0xfcccd0(0x22d)]===_0xfcccd0(0x1ea)){const _0x195c7f=[];for(const [_0x376dee,_0x274292]of Object['entries'](_0x533592[_0xfcccd0(0x22d)])){_0x274292?.[_0xfcccd0(0x1b9)]&&Array[_0xfcccd0(0x213)](_0x274292[_0xfcccd0(0x1b9)])&&_0x274292[_0xfcccd0(0x1b9)][_0xfcccd0(0x1f4)](_0x37d13c=>typeof _0x37d13c===_0xfcccd0(0x1f8)&&_0x37d13c[_0xfcccd0(0x1df)](_0xfcccd0(0x22e)))&&_0x195c7f[_0xfcccd0(0x1d5)](_0x376dee);}for(const _0x11eb19 of _0x195c7f){delete _0x533592[_0xfcccd0(0x22d)][_0x11eb19];}return _0x195c7f[_0xfcccd0(0x1e8)]>0x0&&writeFileSync(_0xa7f3ca[_0xfcccd0(0x1fa)][_0xfcccd0(0x1f3)],JSON[_0xfcccd0(0x1e0)](_0x533592,null,0x2)+'\x0a',_0xfcccd0(0x216)),{'step':0x4,'label':_0xfcccd0(0x1b3),'ok':!![],'detail':_0xfcccd0(0x1eb)+_0x195c7f[_0xfcccd0(0x1d7)](',\x20')+_0xfcccd0(0x219)+_0xa7f3ca[_0xfcccd0(0x1fa)][_0xfcccd0(0x1f3)]};}return{'step':0x4,'label':_0xfcccd0(0x1b3),'ok':!![],'detail':_0xfcccd0(0x1ef)};}catch(_0x1231a9){return{'step':0x4,'label':_0xfcccd0(0x1b3),'ok':![],'detail':_0x1231a9['message']};}}function execSkillsRemove(_0x193187,_0x2a0b89){const _0x1f6567=a142_0x48c266,_0x13bfc8=runNpxSkillsRemove(_0x193187,{'stdio':_0x1f6567(0x20d),'yes':_0x2a0b89});return{'step':0x5,'label':_0x1f6567(0x1e2),'ok':_0x13bfc8['ok'],'detail':_0x13bfc8['ok']?'lovrabet/lovrabet-skill\x20removed':_0x13bfc8['error']??'exit\x20'+_0x13bfc8[_0x1f6567(0x1c2)]};}function execSkillsAdd(_0x2c122f,_0x463394){const _0x5de4bf=a142_0x48c266,_0x5bfe77=runNpxSkillsAddGlobal(_0x2c122f,'lovrabet/rabetbase',{'stdio':'inherit','yes':_0x463394});return{'step':0x6,'label':_0x5de4bf(0x205),'ok':_0x5bfe77['ok'],'detail':_0x5bfe77['ok']?'lovrabet/rabetbase\x20installed\x20globally':_0x5bfe77['error']??_0x5de4bf(0x21e)+_0x5bfe77[_0x5de4bf(0x1c2)]};}function execUpgradeSdk(_0x2fc0b6){const _0x364bb7=a142_0x48c266;if(!_0x2fc0b6[_0x364bb7(0x203)])return{'step':0x7,'label':_0x364bb7(0x1e1),'ok':!![],'detail':_0x364bb7(0x1db)};const {pkgPath:_0x4f7dbc,currentVersion:_0x31ef41,field:_0x2ba491}=_0x2fc0b6[_0x364bb7(0x203)];try{const _0x4ffc69=readFileSync(_0x4f7dbc,'utf8'),_0x5048c6=JSON[_0x364bb7(0x22f)](_0x4ffc69);return _0x5048c6[_0x2ba491][_0x364bb7(0x1fd)]=_0x364bb7(0x1d6),writeFileSync(_0x4f7dbc,JSON[_0x364bb7(0x1e0)](_0x5048c6,null,0x2)+'\x0a','utf8'),{'step':0x7,'label':_0x364bb7(0x1e1),'ok':!![],'detail':_0x2ba491+_0x364bb7(0x1c8)+_0x31ef41+_0x364bb7(0x201)};}catch(_0x4a1220){return{'step':0x7,'label':_0x364bb7(0x1e1),'ok':![],'detail':_0x4a1220['message']};}}function tryStat(_0x5bcc5c){try{return statSync(_0x5bcc5c);}catch{return undefined;}}function a142_0x43b0(_0xd24dc6,_0x5d59f3){_0xd24dc6=_0xd24dc6-0x1b1;const _0x38004c=a142_0x3800();let _0x43b02f=_0x38004c[_0xd24dc6];return _0x43b02f;}function printSummary(_0x47d0bf){const _0x424974=a142_0x48c266;console['log'](''),console['log'](a142_0x1c66f9[_0x424974(0x1ec)](_0x424974(0x1f7))),console[_0x424974(0x1c7)]('');for(const _0x236e3e of _0x47d0bf){const _0x49b56c=_0x236e3e['ok']?a142_0x1c66f9['green']('OK'):a142_0x1c66f9[_0x424974(0x1c1)](_0x424974(0x1f5));console[_0x424974(0x1c7)]('\x20\x20'+_0x49b56c+_0x424974(0x21d)+_0x236e3e[_0x424974(0x1c3)]+':\x20'+_0x236e3e[_0x424974(0x20a)]);if(_0x236e3e[_0x424974(0x1dc)])console[_0x424974(0x1c7)](_0x424974(0x1f0)+a142_0x1c66f9[_0x424974(0x21c)](_0x236e3e[_0x424974(0x1dc)]));}console[_0x424974(0x1c7)]('');}export async function upgradeApp(_0x412fde,_0x4dead3){const _0x58e319=a142_0x48c266,_0x50f6bf=process['cwd'](),_0x3c6af1=analyse(_0x50f6bf),_0x18433b=!_0x3c6af1['configMigration']&&_0x3c6af1['oldArtifacts'][_0x58e319(0x1e8)]===0x0&&!_0x3c6af1['oldMcpConfig']&&!_0x3c6af1[_0x58e319(0x1de)]&&!_0x3c6af1['sdkUpgrade'];if(_0x18433b){console['log'](a142_0x1c66f9[_0x58e319(0x210)](_0x58e319(0x1e3)));return;}printReport(_0x3c6af1);const _0x4f3e65=!!(_0x4dead3[_0x58e319(0x1fb)]||_0x4dead3['Y']||_0x412fde);if(!_0x4f3e65)try{const _0x32b136=await askConfirm(_0x58e319(0x1e5));if(!_0x32b136){console[_0x58e319(0x1c7)](a142_0x1c66f9[_0x58e319(0x21c)](_0x58e319(0x229)));return;}}catch(_0x952319){if(_0x952319?.[_0x58e319(0x1c9)]==='CANCEL'){console[_0x58e319(0x1c7)](a142_0x1c66f9[_0x58e319(0x21c)](_0x58e319(0x229)));return;}throw _0x952319;}const _0x195850=[],_0x25ca60=a142_0xd00850({'text':_0x58e319(0x1cd),'color':_0x58e319(0x214)})[_0x58e319(0x1b5)](),_0x51a6cf=execConfigMigration(_0x3c6af1,_0x50f6bf);_0x195850[_0x58e319(0x1d5)](_0x51a6cf),_0x25ca60[_0x51a6cf['ok']?_0x58e319(0x1b7):'fail'](_0x58e319(0x217)+(_0x51a6cf[_0x58e319(0x1dc)]??(_0x51a6cf['ok']?'done':_0x58e319(0x208))));const _0x4f2275=resolve(_0x50f6bf,_0x58e319(0x1e4)),_0x109e28=a142_0xd00850({'text':_0x58e319(0x209),'color':_0x58e319(0x214)})[_0x58e319(0x1b5)]();if(existsSync(_0x4f2275))try{rmSync(_0x4f2275,{'recursive':!![],'force':!![]}),_0x109e28['succeed'](_0x58e319(0x1d0)),_0x195850[_0x58e319(0x1d5)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x1629e0){_0x109e28['fail']('Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20'+_0x1629e0[_0x58e319(0x1c9)]),_0x195850[_0x58e319(0x1d5)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':![],'detail':_0x1629e0['message']});}else _0x109e28[_0x58e319(0x1d4)](_0x58e319(0x1ed)),_0x195850[_0x58e319(0x1d5)]({'step':0x2,'label':_0x58e319(0x1e9),'ok':!![],'detail':_0x58e319(0x1ee)});const _0x108c78=a142_0xd00850({'text':'Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':_0x58e319(0x214)})[_0x58e319(0x1b5)](),_0x1079b2=execRemoveOldArtifacts(_0x3c6af1[_0x58e319(0x1c6)]);_0x195850[_0x58e319(0x1d5)](_0x1079b2),_0x108c78[_0x1079b2['ok']?'succeed':'fail']('Step\x203/7:\x20Legacy\x20artifacts\x20—\x20'+(_0x1079b2[_0x58e319(0x1dc)]??(_0x1079b2['ok']?_0x58e319(0x1da):_0x58e319(0x208))));const _0x26bc36=a142_0xd00850({'text':_0x58e319(0x22b),'color':_0x58e319(0x214)})['start'](),_0x491639=execCleanMcp(_0x3c6af1);_0x195850['push'](_0x491639),_0x26bc36[_0x491639['ok']?_0x58e319(0x1b7):_0x58e319(0x20f)](_0x58e319(0x1c4)+(_0x491639[_0x58e319(0x1dc)]??(_0x491639['ok']?_0x58e319(0x1da):_0x58e319(0x208))));const _0xf4a1af=a142_0xd00850({'text':_0x58e319(0x1fe),'color':_0x58e319(0x214)})[_0x58e319(0x1b5)](),_0x3bc705=execSkillsRemove(_0x50f6bf,_0x4f3e65);_0x195850['push'](_0x3bc705),_0xf4a1af[_0x3bc705['ok']?'succeed':_0x58e319(0x20f)]('Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20'+(_0x3bc705['detail']??(_0x3bc705['ok']?_0x58e319(0x1da):_0x58e319(0x208))));const _0x5a1d3b=a142_0xd00850({'text':_0x58e319(0x1f9),'color':_0x58e319(0x214)})['start'](),_0x1f97b4=execSkillsAdd(_0x50f6bf,_0x4f3e65);_0x195850[_0x58e319(0x1d5)](_0x1f97b4),_0x5a1d3b[_0x1f97b4['ok']?_0x58e319(0x1b7):_0x58e319(0x20f)](_0x58e319(0x1f6)+(_0x1f97b4[_0x58e319(0x1dc)]??(_0x1f97b4['ok']?_0x58e319(0x1da):'failed')));const _0x3689aa=a142_0xd00850({'text':_0x58e319(0x1ca),'color':_0x58e319(0x214)})[_0x58e319(0x1b5)](),_0x22de7f=execUpgradeSdk(_0x3c6af1);_0x195850['push'](_0x22de7f),_0x3689aa[_0x22de7f['ok']?'succeed':_0x58e319(0x20f)](_0x58e319(0x1cf)+(_0x22de7f[_0x58e319(0x1dc)]??(_0x22de7f['ok']?_0x58e319(0x1da):_0x58e319(0x208)))),printSummary(_0x195850);const _0x2bff0a=_0x195850[_0x58e319(0x1f4)](_0x44fd4f=>!_0x44fd4f['ok']);_0x2bff0a?console[_0x58e319(0x1c7)](a142_0x1c66f9[_0x58e319(0x204)]('Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.')):console[_0x58e319(0x1c7)](a142_0x1c66f9[_0x58e319(0x210)]('Upgrade\x20completed\x20successfully!')),_0x22de7f['ok']&&_0x3c6af1[_0x58e319(0x203)]&&(console[_0x58e319(0x1c7)](''),console[_0x58e319(0x1c7)](a142_0x1c66f9[_0x58e319(0x1ec)][_0x58e319(0x214)](_0x58e319(0x228))),console['log'](a142_0x1c66f9[_0x58e319(0x214)](_0x58e319(0x21f))),console[_0x58e319(0x1c7)](''),console[_0x58e319(0x1c7)](a142_0x1c66f9[_0x58e319(0x1bb)](_0x58e319(0x1d9))),console[_0x58e319(0x1c7)](a142_0x1c66f9[_0x58e319(0x1bb)](_0x58e319(0x223))),console[_0x58e319(0x1c7)](a142_0x1c66f9[_0x58e319(0x1bb)](_0x58e319(0x21a))),console[_0x58e319(0x1c7)](''));}
1
+ const a142_0xae79f2=a142_0x3277;(function(_0x1e9c0c,_0x305aee){const _0x157a5f=a142_0x3277,_0x5a492f=_0x1e9c0c();while(!![]){try{const _0x746bea=-parseInt(_0x157a5f(0x135))/0x1*(-parseInt(_0x157a5f(0x144))/0x2)+parseInt(_0x157a5f(0x14f))/0x3+parseInt(_0x157a5f(0x118))/0x4*(parseInt(_0x157a5f(0xe9))/0x5)+parseInt(_0x157a5f(0xe3))/0x6*(parseInt(_0x157a5f(0x149))/0x7)+-parseInt(_0x157a5f(0x147))/0x8+parseInt(_0x157a5f(0x12a))/0x9*(parseInt(_0x157a5f(0xe2))/0xa)+parseInt(_0x157a5f(0x153))/0xb*(-parseInt(_0x157a5f(0x15c))/0xc);if(_0x746bea===_0x305aee)break;else _0x5a492f['push'](_0x5a492f['shift']());}catch(_0x4a90b7){_0x5a492f['push'](_0x5a492f['shift']());}}}(a142_0x48ee,0x8af08));import a142_0x116a12 from'chalk';import a142_0x3eaf3b from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';function a142_0x48ee(){const _0x2c6b03=['step','no\x20matching\x20entry\x20found','not\x20found\x20or\x20already\x20at\x20latest','detail','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','push','\x20\x20Action:\x20delete','\x20→\x20latest','white','red','stringify','lovrabet/rabetbase','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','length','bold','oldMcpConfig','message','FOUND','not\x20needed','files','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','mcpServers','cwd','Step\x206/7:\x20Installing\x20new\x20skill...','log','Remove\x20.lovrabet/','object','Step\x201/7:\x20Migrating\x20config...','no\x20legacy\x20config\x20found','Step\x205/7:\x20Removing\x20old\x20skill...','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','gray','\x20(backup:\x20','devDependencies','@lovrabet/sdk:','sdkUpgrade','cyan','isDirectory','62012RwhJLX','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','\x20\x20\x20\x20\x20\x20\x20','failed','succeed','Config\x20file:','MCP\x20config:','start','fail','Step\x201/7:\x20Config\x20migration\x20—\x20','Clean\x20MCP\x20config','fields','\x20\x20Step\x20','yes','Upgrade\x20cancelled.','@lovrabet/sdk','includes','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','2277jKbTIX','args','utf8','already\x20exists\x20(will\x20merge)','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','values','Upgrade\x20completed\x20successfully!','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','skipped','Step\x204/7:\x20Cleaning\x20MCP\x20config...','Install\x20new\x20skill','371698vdZDhR','hasNewConfig','\x20→\x20keys:\x20','oldArtifacts','.claude/skills/lovrabet','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','\x20removed\x20(','exit\x20','done','needed','string','error','path','skipped\x20(no\x20legacy\x20config)','\x20\x20Current\x20version\x20in\x20','4dxFZGn','\x20\x20#\x20or','.cursor/mcp.json','4784616SviQPL','.lovrabet','42xRqJWE','inherit','Remove\x20old\x20skill','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','status','.cursor/rules/lovrabet_rules.mdc','67272bIUCPo','green','\x20→\x20','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','11sVqooW','Upgrade\x20@lovrabet/sdk','configMigration','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','\x20\x20npm\x20install','\x20\x20Fields\x20to\x20migrate:\x20','Proceed\x20with\x20upgrade?','oldPath','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','18908508gEfMBS','not\x20found\x20(will\x20create)','filter','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','some','CANCEL','===\x20Upgrade\x20Summary\x20===','@lovrabet/dataset-mcp-server','Step\x204/7:\x20MCP\x20config\x20—\x20','latest','needsSkillSwap','28450uTYrDE','900708PsmUoR','join','yellow','entries','no\x20legacy\x20entry','isArray','115BhzzeQ','\x20\x20New\x20config\x20(.rabetbase.json):\x20','none\x20found','keys','parse','Legacy\x20artifacts:','[\x22@lovrabet/sdk\x22]:\x20','===\x20Upgrade\x20Analysis\x20==='];a142_0x48ee=function(){return _0x2c6b03;};return a142_0x48ee();}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';function a142_0x3277(_0x50ab47,_0x3e4a72){_0x50ab47=_0x50ab47-0xd9;const _0x48ee3d=a142_0x48ee();let _0x3277ba=_0x48ee3d[_0x50ab47];return _0x3277ba;}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_0xae79f2(0xd9)](_0x5eb716=>_0x5eb716!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x2e55ed){const _0x5d0710=a142_0xae79f2,_0x6c097d=[];for(const _0x4b6bbd of Object[_0x5d0710(0x12f)](CORE_IDE_CONFIGS)){if(_0x4b6bbd[_0x5d0710(0x105)])for(const _0xd2c31 of _0x4b6bbd[_0x5d0710(0x105)]){_0x6c097d['push'](resolve(_0x2e55ed,_0xd2c31['path']));}}return _0x6c097d;}function analyse(_0x5ef5a0){const _0x392eab=a142_0xae79f2;let _0x5a628f=null;const _0x4ef856=resolve(_0x5ef5a0,NEW_CONFIG_NAME),_0x3138ee=existsSync(_0x4ef856);for(const _0x1a8692 of LEGACY_CONFIG_NAMES){const _0x36cd09=resolve(_0x5ef5a0,_0x1a8692);if(existsSync(_0x36cd09)){const _0x29de36=readConfigFile(_0x36cd09),_0x168b23=Object['keys'](_0x29de36)[_0x392eab(0xd9)](_0x1d5a30=>typeof _0x29de36[_0x1d5a30]!=='undefined');_0x5a628f={'oldPath':_0x36cd09,'hasNewConfig':_0x3138ee,'fields':_0x168b23};break;}}const _0x3ba9dc=[],_0x5ad8c6=resolve(_0x5ef5a0,_0x392eab(0x148));if(existsSync(_0x5ad8c6))_0x3ba9dc[_0x392eab(0xf6)](_0x5ad8c6);const _0x580ba2=resolve(_0x5ef5a0,_0x392eab(0x14e));if(existsSync(_0x580ba2))_0x3ba9dc['push'](_0x580ba2);const _0x5b5143=resolve(_0x5ef5a0,_0x392eab(0x139));if(existsSync(_0x5b5143))_0x3ba9dc[_0x392eab(0xf6)](_0x5b5143);for(const _0x32c176 of collectIdeSkillFiles(_0x5ef5a0)){if(existsSync(_0x32c176))_0x3ba9dc[_0x392eab(0xf6)](_0x32c176);}let _0x5e1dc3=null;const _0x4eadef=resolve(_0x5ef5a0,_0x392eab(0x146));if(existsSync(_0x4eadef))try{const _0x5a77a0=JSON['parse'](readFileSync(_0x4eadef,_0x392eab(0x12c)));if(_0x5a77a0?.[_0x392eab(0x107)]&&typeof _0x5a77a0[_0x392eab(0x107)]===_0x392eab(0x10c)){const _0x3bc8b9=[];for(const [_0x5e1a17,_0x47c0d7]of Object[_0x392eab(0xe6)](_0x5a77a0['mcpServers'])){const _0x164bb8=_0x47c0d7;_0x164bb8?.['args']&&Array[_0x392eab(0xe8)](_0x164bb8[_0x392eab(0x12b)])&&_0x164bb8[_0x392eab(0x12b)][_0x392eab(0xdb)](_0x4932b0=>typeof _0x4932b0===_0x392eab(0x13f)&&_0x4932b0[_0x392eab(0x128)](_0x392eab(0xde)))&&_0x3bc8b9[_0x392eab(0xf6)](_0x5e1a17);}_0x3bc8b9[_0x392eab(0xff)]>0x0&&(_0x5e1dc3={'path':_0x4eadef,'keys':_0x3bc8b9});}}catch{}const _0x2a544d=_0x3ba9dc[_0x392eab(0xff)]>0x0||_0x5a628f!==null;let _0x3dbb02=null;const _0x39b464=resolve(_0x5ef5a0,'package.json');if(existsSync(_0x39b464))try{const _0xff879=JSON[_0x392eab(0xed)](readFileSync(_0x39b464,_0x392eab(0x12c)));for(const _0x3f2aba of['dependencies',_0x392eab(0x113)]){const _0x759dbc=_0xff879?.[_0x3f2aba]?.[_0x392eab(0x127)];if(typeof _0x759dbc==='string'){_0x759dbc!=='latest'&&(_0x3dbb02={'pkgPath':_0x39b464,'currentVersion':_0x759dbc,'field':_0x3f2aba});break;}}}catch{}return{'configMigration':_0x5a628f,'oldArtifacts':_0x3ba9dc,'oldMcpConfig':_0x5e1dc3,'needsSkillSwap':_0x2a544d,'sdkUpgrade':_0x3dbb02};}function printReport(_0x312930){const _0x474e85=a142_0xae79f2,{configMigration:_0x4599b1,oldArtifacts:_0x58bc00,oldMcpConfig:_0x4c9a6f,needsSkillSwap:_0x3b0703}=_0x312930;console[_0x474e85(0x10a)](''),console['log'](a142_0x116a12[_0x474e85(0x100)](_0x474e85(0xf0))),console[_0x474e85(0x10a)]('');_0x4599b1?(console['log'](a142_0x116a12[_0x474e85(0x116)](_0x474e85(0x11d))+('\x20\x20'+a142_0x116a12[_0x474e85(0xe5)](_0x4599b1[_0x474e85(0x15a)]))),console['log'](_0x474e85(0xea)+(_0x4599b1['hasNewConfig']?a142_0x116a12['green'](_0x474e85(0x12d)):a142_0x116a12[_0x474e85(0x111)](_0x474e85(0x15d)))),console[_0x474e85(0x10a)](_0x474e85(0x158)+_0x4599b1[_0x474e85(0x123)][_0x474e85(0xe4)](',\x20')),console['log'](_0x474e85(0x13a))):console['log'](a142_0x116a12['cyan']('Config\x20file:')+'\x20\x20'+a142_0x116a12['gray'](_0x474e85(0x10e)));console[_0x474e85(0x10a)]('');if(_0x58bc00[_0x474e85(0xff)]>0x0){console[_0x474e85(0x10a)](a142_0x116a12['cyan'](_0x474e85(0xee)));for(const _0x97a87 of _0x58bc00){console[_0x474e85(0x10a)]('\x20\x20'+a142_0x116a12[_0x474e85(0xfa)](_0x474e85(0x103))+'\x20\x20'+_0x97a87);}console[_0x474e85(0x10a)](_0x474e85(0xf7));}else console[_0x474e85(0x10a)](a142_0x116a12[_0x474e85(0x116)](_0x474e85(0xee))+'\x20\x20'+a142_0x116a12[_0x474e85(0x111)](_0x474e85(0xeb)));console[_0x474e85(0x10a)]('');_0x4c9a6f?(console['log'](a142_0x116a12[_0x474e85(0x116)](_0x474e85(0x11e))+('\x20\x20'+a142_0x116a12[_0x474e85(0xe5)](_0x4c9a6f[_0x474e85(0x141)])+_0x474e85(0x137)+_0x4c9a6f[_0x474e85(0xec)][_0x474e85(0xe4)](',\x20'))),console[_0x474e85(0x10a)]('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console['log'](a142_0x116a12['cyan'](_0x474e85(0x11e))+'\x20\x20'+a142_0x116a12[_0x474e85(0x111)](_0x474e85(0xe7)));console[_0x474e85(0x10a)](''),console[_0x474e85(0x10a)](a142_0x116a12[_0x474e85(0x116)]('Skill\x20swap:')+('\x20\x20'+(_0x3b0703?a142_0x116a12[_0x474e85(0xe5)](_0x474e85(0x13e)):a142_0x116a12[_0x474e85(0x150)](_0x474e85(0x104)))));_0x3b0703&&console['log'](_0x474e85(0x106)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x474e85(0x10a)]('');if(_0x312930[_0x474e85(0x115)]){const {currentVersion:_0x52891c,field:_0xcbd13c,pkgPath:_0x3eec72}=_0x312930['sdkUpgrade'];console[_0x474e85(0x10a)](a142_0x116a12[_0x474e85(0x116)](_0x474e85(0x114))+('\x20\x20'+a142_0x116a12[_0x474e85(0xe5)](_0x3eec72))),console[_0x474e85(0x10a)](_0x474e85(0x143)+_0xcbd13c+':\x20'+a142_0x116a12['yellow'](_0x52891c)+'\x20→\x20'+a142_0x116a12[_0x474e85(0x150)](_0x474e85(0xe0))),console[_0x474e85(0x10a)](_0x474e85(0x15b));}else console[_0x474e85(0x10a)](a142_0x116a12[_0x474e85(0x116)](_0x474e85(0x114))+'\x20\x20'+a142_0x116a12['gray'](_0x474e85(0xf3)));console[_0x474e85(0x10a)]('');}function execConfigMigration(_0x1f41b8,_0x32ae42){const _0x1b5066=a142_0xae79f2,{configMigration:_0x120bec}=_0x1f41b8;if(!_0x120bec?.[_0x1b5066(0x15a)])return{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x1b5066(0x142)};const _0x94b702=readConfigFile(_0x120bec['oldPath']),_0x2c6f50=resolve(_0x32ae42,NEW_CONFIG_NAME),_0x8d90b0=_0x120bec[_0x1b5066(0x136)]?readConfigFile(_0x2c6f50):{};for(const [_0x1c449a,_0x340ae6]of Object[_0x1b5066(0xe6)](_0x94b702)){!(_0x1c449a in _0x8d90b0)&&(_0x8d90b0[_0x1c449a]=_0x340ae6);}writeConfigFile(_0x2c6f50,_0x8d90b0);const _0x5ca1a0=_0x120bec[_0x1b5066(0x15a)]+'.bak';return renameSync(_0x120bec[_0x1b5066(0x15a)],_0x5ca1a0),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x120bec['oldPath']+_0x1b5066(0x151)+_0x2c6f50+_0x1b5066(0x112)+_0x5ca1a0+')'};}function execRemoveOldArtifacts(_0x129494){const _0x1bd905=a142_0xae79f2,_0x2e9ff6=[];for(const _0x5a5160 of _0x129494){try{if(!existsSync(_0x5a5160))continue;const _0x5adb8e=tryStat(_0x5a5160);_0x5adb8e?.[_0x1bd905(0x117)]()?rmSync(_0x5a5160,{'recursive':!![],'force':!![]}):unlinkSync(_0x5a5160);}catch(_0x1b0ac8){_0x2e9ff6[_0x1bd905(0xf6)](_0x5a5160+':\x20'+_0x1b0ac8[_0x1bd905(0x102)]);}}return{'step':0x3,'label':'Remove\x20legacy\x20artifacts','ok':_0x2e9ff6[_0x1bd905(0xff)]===0x0,'detail':_0x2e9ff6[_0x1bd905(0xff)]>0x0?_0x129494[_0x1bd905(0xff)]-_0x2e9ff6[_0x1bd905(0xff)]+'/'+_0x129494[_0x1bd905(0xff)]+_0x1bd905(0x13b)+_0x2e9ff6['join'](';\x20')+')':_0x129494[_0x1bd905(0xff)]+'\x20removed'};}function execCleanMcp(_0xc80354){const _0x1f6fcb=a142_0xae79f2;if(!_0xc80354[_0x1f6fcb(0x101)])return{'step':0x4,'label':_0x1f6fcb(0x122),'ok':!![],'detail':_0x1f6fcb(0x132)};try{const _0x284b05=readFileSync(_0xc80354[_0x1f6fcb(0x101)][_0x1f6fcb(0x141)],_0x1f6fcb(0x12c)),_0x490e81=JSON[_0x1f6fcb(0xed)](_0x284b05);if(_0x490e81?.['mcpServers']&&typeof _0x490e81['mcpServers']===_0x1f6fcb(0x10c)){const _0x4fd367=[];for(const [_0x29e765,_0x48b067]of Object[_0x1f6fcb(0xe6)](_0x490e81[_0x1f6fcb(0x107)])){_0x48b067?.[_0x1f6fcb(0x12b)]&&Array[_0x1f6fcb(0xe8)](_0x48b067[_0x1f6fcb(0x12b)])&&_0x48b067[_0x1f6fcb(0x12b)][_0x1f6fcb(0xdb)](_0xe40a29=>typeof _0xe40a29===_0x1f6fcb(0x13f)&&_0xe40a29[_0x1f6fcb(0x128)](_0x1f6fcb(0xde)))&&_0x4fd367['push'](_0x29e765);}for(const _0x5c3a2a of _0x4fd367){delete _0x490e81[_0x1f6fcb(0x107)][_0x5c3a2a];}return _0x4fd367['length']>0x0&&writeFileSync(_0xc80354[_0x1f6fcb(0x101)][_0x1f6fcb(0x141)],JSON[_0x1f6fcb(0xfb)](_0x490e81,null,0x2)+'\x0a',_0x1f6fcb(0x12c)),{'step':0x4,'label':_0x1f6fcb(0x122),'ok':!![],'detail':'removed\x20'+_0x4fd367[_0x1f6fcb(0xe4)](',\x20')+'\x20from\x20'+_0xc80354[_0x1f6fcb(0x101)][_0x1f6fcb(0x141)]};}return{'step':0x4,'label':_0x1f6fcb(0x122),'ok':!![],'detail':_0x1f6fcb(0xf2)};}catch(_0x84ed71){return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':![],'detail':_0x84ed71[_0x1f6fcb(0x102)]};}}function execSkillsRemove(_0x1eada2,_0x246ad0){const _0x5e82cd=a142_0xae79f2,_0x3acb1f=runNpxSkillsRemove(_0x1eada2,{'stdio':_0x5e82cd(0x14a),'yes':_0x246ad0});return{'step':0x5,'label':_0x5e82cd(0x14b),'ok':_0x3acb1f['ok'],'detail':_0x3acb1f['ok']?'lovrabet/lovrabet-skill\x20removed':_0x3acb1f[_0x5e82cd(0x140)]??_0x5e82cd(0x13c)+_0x3acb1f[_0x5e82cd(0x14d)]};}function execSkillsAdd(_0x1d0a51,_0x5b96f7){const _0x3d72f3=a142_0xae79f2,_0x41bc6c=runNpxSkillsAddGlobal(_0x1d0a51,_0x3d72f3(0xfc),{'stdio':_0x3d72f3(0x14a),'yes':_0x5b96f7});return{'step':0x6,'label':_0x3d72f3(0x134),'ok':_0x41bc6c['ok'],'detail':_0x41bc6c['ok']?'lovrabet/rabetbase\x20installed\x20globally':_0x41bc6c['error']??'exit\x20'+_0x41bc6c[_0x3d72f3(0x14d)]};}function execUpgradeSdk(_0x5e3b0c){const _0x2b7663=a142_0xae79f2;if(!_0x5e3b0c[_0x2b7663(0x115)])return{'step':0x7,'label':_0x2b7663(0x154),'ok':!![],'detail':'skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)'};const {pkgPath:_0x4c323d,currentVersion:_0x553d73,field:_0x7ce1fe}=_0x5e3b0c[_0x2b7663(0x115)];try{const _0xdb1b1c=readFileSync(_0x4c323d,_0x2b7663(0x12c)),_0x4eea60=JSON[_0x2b7663(0xed)](_0xdb1b1c);return _0x4eea60[_0x7ce1fe][_0x2b7663(0x127)]=_0x2b7663(0xe0),writeFileSync(_0x4c323d,JSON['stringify'](_0x4eea60,null,0x2)+'\x0a',_0x2b7663(0x12c)),{'step':0x7,'label':_0x2b7663(0x154),'ok':!![],'detail':_0x7ce1fe+_0x2b7663(0xef)+_0x553d73+_0x2b7663(0xf8)};}catch(_0x4fb148){return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':![],'detail':_0x4fb148[_0x2b7663(0x102)]};}}function tryStat(_0x3dd95f){try{return statSync(_0x3dd95f);}catch{return undefined;}}function printSummary(_0xb46211){const _0x49e4aa=a142_0xae79f2;console[_0x49e4aa(0x10a)](''),console[_0x49e4aa(0x10a)](a142_0x116a12[_0x49e4aa(0x100)](_0x49e4aa(0xdd))),console[_0x49e4aa(0x10a)]('');for(const _0x57d148 of _0xb46211){const _0x425c01=_0x57d148['ok']?a142_0x116a12['green']('OK'):a142_0x116a12['red']('FAIL');console[_0x49e4aa(0x10a)]('\x20\x20'+_0x425c01+_0x49e4aa(0x124)+_0x57d148[_0x49e4aa(0xf1)]+':\x20'+_0x57d148['label']);if(_0x57d148[_0x49e4aa(0xf4)])console[_0x49e4aa(0x10a)](_0x49e4aa(0x11a)+a142_0x116a12['gray'](_0x57d148[_0x49e4aa(0xf4)]));}console['log']('');}export async function upgradeApp(_0x22d7b6,_0x5c55f3){const _0x4cf303=a142_0xae79f2,_0x11a73a=process[_0x4cf303(0x108)](),_0x4735ce=analyse(_0x11a73a),_0x2ced81=!_0x4735ce[_0x4cf303(0x155)]&&_0x4735ce[_0x4cf303(0x138)]['length']===0x0&&!_0x4735ce['oldMcpConfig']&&!_0x4735ce[_0x4cf303(0xe1)]&&!_0x4735ce[_0x4cf303(0x115)];if(_0x2ced81){console[_0x4cf303(0x10a)](a142_0x116a12['green'](_0x4cf303(0x119)));return;}printReport(_0x4735ce);const _0x2d63ed=!!(_0x5c55f3[_0x4cf303(0x125)]||_0x5c55f3['Y']||_0x22d7b6);if(!_0x2d63ed)try{const _0x2e771f=await askConfirm(_0x4cf303(0x159));if(!_0x2e771f){console[_0x4cf303(0x10a)](a142_0x116a12[_0x4cf303(0x111)](_0x4cf303(0x126)));return;}}catch(_0x36f753){if(_0x36f753?.[_0x4cf303(0x102)]===_0x4cf303(0xdc)){console[_0x4cf303(0x10a)](a142_0x116a12[_0x4cf303(0x111)]('Upgrade\x20cancelled.'));return;}throw _0x36f753;}const _0x2a0306=[],_0x20dbf8=a142_0x3eaf3b({'text':_0x4cf303(0x10d),'color':_0x4cf303(0x116)})[_0x4cf303(0x11f)](),_0x5c88fa=execConfigMigration(_0x4735ce,_0x11a73a);_0x2a0306['push'](_0x5c88fa),_0x20dbf8[_0x5c88fa['ok']?_0x4cf303(0x11c):_0x4cf303(0x120)](_0x4cf303(0x121)+(_0x5c88fa[_0x4cf303(0xf4)]??(_0x5c88fa['ok']?'done':_0x4cf303(0x11b))));const _0x950c27=resolve(_0x11a73a,_0x4cf303(0x148)),_0x2f531e=a142_0x3eaf3b({'text':_0x4cf303(0x12e),'color':_0x4cf303(0x116)})['start']();if(existsSync(_0x950c27))try{rmSync(_0x950c27,{'recursive':!![],'force':!![]}),_0x2f531e[_0x4cf303(0x11c)](_0x4cf303(0x110)),_0x2a0306[_0x4cf303(0xf6)]({'step':0x2,'label':_0x4cf303(0x10b),'ok':!![]});}catch(_0x52192a){_0x2f531e[_0x4cf303(0x120)]('Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20'+_0x52192a[_0x4cf303(0x102)]),_0x2a0306[_0x4cf303(0xf6)]({'step':0x2,'label':_0x4cf303(0x10b),'ok':![],'detail':_0x52192a[_0x4cf303(0x102)]});}else _0x2f531e['info'](_0x4cf303(0x156)),_0x2a0306['push']({'step':0x2,'label':_0x4cf303(0x10b),'ok':!![],'detail':_0x4cf303(0x132)});const _0x2c601a=a142_0x3eaf3b({'text':_0x4cf303(0x152),'color':'cyan'})['start'](),_0x3a13e0=execRemoveOldArtifacts(_0x4735ce[_0x4cf303(0x138)]);_0x2a0306['push'](_0x3a13e0),_0x2c601a[_0x3a13e0['ok']?_0x4cf303(0x11c):'fail'](_0x4cf303(0x129)+(_0x3a13e0[_0x4cf303(0xf4)]??(_0x3a13e0['ok']?_0x4cf303(0x13d):_0x4cf303(0x11b))));const _0x32be18=a142_0x3eaf3b({'text':_0x4cf303(0x133),'color':_0x4cf303(0x116)})[_0x4cf303(0x11f)](),_0x44f227=execCleanMcp(_0x4735ce);_0x2a0306['push'](_0x44f227),_0x32be18[_0x44f227['ok']?_0x4cf303(0x11c):_0x4cf303(0x120)](_0x4cf303(0xdf)+(_0x44f227[_0x4cf303(0xf4)]??(_0x44f227['ok']?_0x4cf303(0x13d):'failed')));const _0x5e29d9=a142_0x3eaf3b({'text':_0x4cf303(0x10f),'color':'cyan'})['start'](),_0x383d75=execSkillsRemove(_0x11a73a,_0x2d63ed);_0x2a0306[_0x4cf303(0xf6)](_0x383d75),_0x5e29d9[_0x383d75['ok']?'succeed':_0x4cf303(0x120)](_0x4cf303(0xfe)+(_0x383d75[_0x4cf303(0xf4)]??(_0x383d75['ok']?_0x4cf303(0x13d):_0x4cf303(0x11b))));const _0x1eb2bb=a142_0x3eaf3b({'text':_0x4cf303(0x109),'color':'cyan'})[_0x4cf303(0x11f)](),_0x4c48eb=execSkillsAdd(_0x11a73a,_0x2d63ed);_0x2a0306['push'](_0x4c48eb),_0x1eb2bb[_0x4c48eb['ok']?_0x4cf303(0x11c):_0x4cf303(0x120)](_0x4cf303(0xda)+(_0x4c48eb[_0x4cf303(0xf4)]??(_0x4c48eb['ok']?'done':_0x4cf303(0x11b))));const _0xeca112=a142_0x3eaf3b({'text':_0x4cf303(0xf5),'color':_0x4cf303(0x116)})[_0x4cf303(0x11f)](),_0x39ab6d=execUpgradeSdk(_0x4735ce);_0x2a0306[_0x4cf303(0xf6)](_0x39ab6d),_0xeca112[_0x39ab6d['ok']?_0x4cf303(0x11c):_0x4cf303(0x120)](_0x4cf303(0x131)+(_0x39ab6d['detail']??(_0x39ab6d['ok']?'done':_0x4cf303(0x11b)))),printSummary(_0x2a0306);const _0x4017a9=_0x2a0306['some'](_0x481fa7=>!_0x481fa7['ok']);_0x4017a9?console[_0x4cf303(0x10a)](a142_0x116a12[_0x4cf303(0xe5)](_0x4cf303(0xfd))):console['log'](a142_0x116a12[_0x4cf303(0x150)](_0x4cf303(0x130))),_0x39ab6d['ok']&&_0x4735ce[_0x4cf303(0x115)]&&(console[_0x4cf303(0x10a)](''),console[_0x4cf303(0x10a)](a142_0x116a12[_0x4cf303(0x100)]['cyan']('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console[_0x4cf303(0x10a)](a142_0x116a12[_0x4cf303(0x116)](_0x4cf303(0x14c))),console[_0x4cf303(0x10a)](''),console[_0x4cf303(0x10a)](a142_0x116a12[_0x4cf303(0xf9)](_0x4cf303(0x157))),console[_0x4cf303(0x10a)](a142_0x116a12[_0x4cf303(0xf9)](_0x4cf303(0x145))),console['log'](a142_0x116a12['white']('\x20\x20bun\x20install')),console[_0x4cf303(0x10a)](''));}