@lovrabet/rabetbase-cli 2.3.7 → 2.3.8

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_0x1e1df1=a131_0x3fc9;(function(_0x3d103c,_0x5aa0fa){const _0x2590c2=a131_0x3fc9,_0xacebd4=_0x3d103c();while(!![]){try{const _0x32e8ce=-parseInt(_0x2590c2(0xe0))/0x1*(-parseInt(_0x2590c2(0x116))/0x2)+-parseInt(_0x2590c2(0x11c))/0x3*(-parseInt(_0x2590c2(0x110))/0x4)+-parseInt(_0x2590c2(0x111))/0x5*(parseInt(_0x2590c2(0xed))/0x6)+parseInt(_0x2590c2(0xd7))/0x7+-parseInt(_0x2590c2(0x129))/0x8*(-parseInt(_0x2590c2(0xe3))/0x9)+-parseInt(_0x2590c2(0xfe))/0xa+-parseInt(_0x2590c2(0xda))/0xb*(-parseInt(_0x2590c2(0xfa))/0xc);if(_0x32e8ce===_0x5aa0fa)break;else _0xacebd4['push'](_0xacebd4['shift']());}catch(_0x15b67d){_0xacebd4['push'](_0xacebd4['shift']());}}}(a131_0x1003,0x3f3ae));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':'menu-id','type':'number','required':!![],'description':a131_0x1e1df1(0x124)};export const ROLE_REF_FLAG={'name':a131_0x1e1df1(0x119),'type':a131_0x1e1df1(0x10f),'required':!![],'description':a131_0x1e1df1(0x108)};export const GRANT_FLAG={'name':a131_0x1e1df1(0xe1),'type':'boolean','required':![],'description':'Grant\x20access\x20to\x20the\x20listed\x20resources'};export const REVOKE_FLAG={'name':a131_0x1e1df1(0x114),'type':a131_0x1e1df1(0x104),'required':![],'description':a131_0x1e1df1(0x11b)};export const MENUS_FLAG={'name':a131_0x1e1df1(0x11e),'type':a131_0x1e1df1(0x10f),'required':!![],'description':a131_0x1e1df1(0x11f)};export const DATASETS_FLAG={'name':a131_0x1e1df1(0xe9),'type':a131_0x1e1df1(0x10f),'required':!![],'description':'Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for'};export const PAGE_SLOT_SPECS=[{'flag':a131_0x1e1df1(0xd9),'key':a131_0x1e1df1(0xf4),'allowSelf':![],'label':'menu\x20visibility'},{'flag':a131_0x1e1df1(0x12c),'key':a131_0x1e1df1(0x107),'allowSelf':![],'label':a131_0x1e1df1(0xef)},{'flag':a131_0x1e1df1(0xf5),'key':a131_0x1e1df1(0xf6),'allowSelf':![],'label':'data\x20update'},{'flag':a131_0x1e1df1(0xdf),'key':'dataDelete','allowSelf':![],'label':a131_0x1e1df1(0xdd)},{'flag':a131_0x1e1df1(0xe5),'key':a131_0x1e1df1(0xf3),'allowSelf':![],'label':a131_0x1e1df1(0xe6)},{'flag':a131_0x1e1df1(0xdb),'key':a131_0x1e1df1(0xf8),'allowSelf':![],'label':'data\x20export'},{'flag':a131_0x1e1df1(0xfc),'key':a131_0x1e1df1(0xff),'allowSelf':!![],'label':a131_0x1e1df1(0x12a)}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a131_0x1e1df1(0xeb)](_0x2c0a59=>({'name':_0x2c0a59[a131_0x1e1df1(0x123)],'type':'string','required':![],'description':a131_0x1e1df1(0xd8)+_0x2c0a59[a131_0x1e1df1(0x126)]+a131_0x1e1df1(0xf1)+(_0x2c0a59['allowSelf']?';\x20SELF\x20=\x20only\x20own\x20rows':'')}));export function splitList(_0x25071c){const _0x4468c8=a131_0x1e1df1;return _0x25071c[_0x4468c8(0x125)](',')[_0x4468c8(0xeb)](_0x260902=>_0x260902[_0x4468c8(0xea)]())[_0x4468c8(0x115)](Boolean);}export function projectRoleRef(_0x39d02d){const _0x20e16b=a131_0x1e1df1;return{'id':_0x39d02d['id'],'roleName':_0x39d02d[_0x20e16b(0x12d)],'roleType':_0x39d02d[_0x20e16b(0x122)]};}export async function resolvePermitRoles(_0x4178e7,_0x477126,_0x2179e7){const _0x60d618=a131_0x1e1df1,_0x44edbb=await listPermitRoles(_0x4178e7,{'needSelf':!![],'needPublic':!![]}),_0x19c33d=[];for(const _0x189776 of _0x477126){const _0x32b221=resolveOnePermitRole(_0x44edbb,_0x189776);if(!_0x2179e7['allowSelf']&&_0x32b221[_0x60d618(0x122)]===_0x60d618(0xf0))throw CliErrors[_0x60d618(0x117)](_0x60d618(0x118)+_0x2179e7['label']+'.',_0x60d618(0x10e));if(!_0x19c33d[_0x60d618(0x11d)](_0x29eef2=>_0x29eef2['id']===_0x32b221['id']))_0x19c33d[_0x60d618(0x121)](_0x32b221);}return _0x19c33d;}function a131_0x1003(){const _0xcc6061=['Revoke\x20access\x20to\x20the\x20listed\x20resources','1017AIaZAF','some','menus','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.','push','roleType','flag','Menu\x20id\x20(from\x20`menu\x20list`)','split','label','get','Missing\x20action.','328400XouAMv','row\x20visibility','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','create-roles','roleName','678685YwIZHI','Roles\x20for\x20','menu-roles','11ZHjbhc','export-roles','\x22\x20not\x20found.','data\x20delete','Pass\x20--role\x20<id|name>.','delete-roles','1IiqTyT','grant','\x22\x20is\x20ambiguous\x20(ids:\x20','27EwxNja','allowedActions','detail-roles','data\x20detail','Role\x20\x22','Role\x20id\x20','datasets','trim','map','entries','40008GnyfuJ','\x20is\x20not\x20available\x20for\x20this\x20app.','data\x20create','SELF','\x20(comma-separated\x20SELF/ALL/id/name)','length','dataDetail','menuPermit','update-roles','dataUpdate','menuId','dataExport','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.','343356RieGAI','Run\x20`role\x20list`.','row-roles','datasetCode','3382440DsfuLk','dataPermit','find','bool','key','flagMissing','boolean','resourceName','apiList','dataCreate','Role\x20id\x20or\x20role\x20name','Disambiguate\x20with\x20an\x20id.','resourceCode','join','toUpperCase','str','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','string','5020xwBFcF','110lSoVBY','test','access','revoke','filter','139534kHPmyg','validation','SELF\x20is\x20not\x20allowed\x20for\x20','role','Special\x20role\x20'];a131_0x1003=function(){return _0xcc6061;};return a131_0x1003();}function resolveOnePermitRole(_0x611a8e,_0xb90aeb){const _0x23a036=a131_0x1e1df1,_0x21667d=_0xb90aeb['trim'](),_0x295e09=_0x21667d[_0x23a036(0x10c)]();if(_0x295e09==='SELF'||_0x295e09==='ALL'){const _0x4d017b=_0x611a8e[_0x23a036(0x100)](_0xc8047f=>_0xc8047f[_0x23a036(0x122)]===_0x295e09);if(!_0x4d017b)throw CliErrors['validation'](_0x23a036(0x11a)+_0x295e09+_0x23a036(0xee));return _0x4d017b;}if(/^-?\d+$/[_0x23a036(0x112)](_0x21667d)){const _0x502640=Number(_0x21667d),_0xaf271b=_0x611a8e[_0x23a036(0x100)](_0xe7e0ad=>_0xe7e0ad['id']===_0x502640);if(!_0xaf271b)throw CliErrors[_0x23a036(0x117)](_0x23a036(0xe8)+_0x502640+'\x20not\x20found.',_0x23a036(0xfb));return _0xaf271b;}const _0x262488=_0x611a8e[_0x23a036(0x115)](_0x23db9a=>_0x23db9a[_0x23a036(0x12d)]===_0x21667d);if(_0x262488['length']===0x0)throw CliErrors[_0x23a036(0x117)](_0x23a036(0xe7)+_0x21667d+_0x23a036(0xdc),_0x23a036(0x120));if(_0x262488[_0x23a036(0xf2)]>0x1)throw CliErrors['validation'](_0x23a036(0xe7)+_0x21667d+_0x23a036(0xe2)+_0x262488['map'](_0xaace2=>_0xaace2['id'])[_0x23a036(0x10b)](',\x20')+').',_0x23a036(0x109));return _0x262488[0x0];}function a131_0x3fc9(_0x111ea4,_0x2de28e){_0x111ea4=_0x111ea4-0xd7;const _0x1003f1=a131_0x1003();let _0x3fc9bb=_0x1003f1[_0x111ea4];return _0x3fc9bb;}export function projectPageSlot(_0x5d464b){const _0x3f3fe7=a131_0x1e1df1;if(!_0x5d464b)return null;return{'resourceCode':_0x5d464b[_0x3f3fe7(0x10a)],'roles':(_0x5d464b['rolePermit']??[])[_0x3f3fe7(0xeb)](projectRoleRef)};}export function projectPagePermit(_0x5038fb){const _0x396403=a131_0x1e1df1,_0x41f21b={'menuId':_0x5038fb[_0x396403(0xf7)],'appCode':_0x5038fb['appCode'],'menuPermit':projectPageSlot(_0x5038fb[_0x396403(0xf4)])};for(const _0x26b712 of PAGE_SLOT_SPECS){if(_0x26b712['key']===_0x396403(0xf4))continue;_0x41f21b[_0x26b712[_0x396403(0x102)]]=projectPageSlot(_0x5038fb[_0x26b712[_0x396403(0x102)]]);}return _0x41f21b;}export function flattenMenuResources(_0x35978d){const _0x54c110=new Map(),_0x394677=_0x5959fd=>{const _0x44e1d0=a131_0x3fc9;for(const _0x54e711 of _0x5959fd??[]){_0x54c110['set'](_0x54e711['resourceCode'],{'resourceCode':_0x54e711[_0x44e1d0(0x10a)],'resourceName':_0x54e711[_0x44e1d0(0x105)],'action':_0x54e711[_0x44e1d0(0xe4)]?.[0x0]??'0'});if(_0x54e711['pageNodeList'])_0x394677(_0x54e711['pageNodeList']);}};return _0x394677(_0x35978d),_0x54c110;}export function flattenApiResources(_0x3e1d60){const _0x554d11=a131_0x1e1df1,_0x50d4c7=new Map(),_0x235aaf=new Map();for(const _0x10644e of _0x3e1d60){const _0x55ce7f=_0x10644e[_0x554d11(0x106)]??{};for(const [_0x3b4bd6,_0xf9b85a]of Object[_0x554d11(0xec)](_0x55ce7f)){_0x50d4c7['set'](_0x3b4bd6,{'resourceCode':_0x3b4bd6,'resourceName':_0x10644e[_0x554d11(0x105)],'datasetCode':_0x10644e[_0x554d11(0xfd)],'action':_0xf9b85a?.[0x0]??'0'});const _0x36eafa=_0x235aaf['get'](_0x10644e[_0x554d11(0xfd)])??[];_0x36eafa['push'](_0x3b4bd6),_0x235aaf['set'](_0x10644e[_0x554d11(0xfd)],_0x36eafa);}}return{'byCode':_0x50d4c7,'byDataset':_0x235aaf};}export function buildPermits(_0x29ce92,_0x43568b){const _0x16d88d=a131_0x1e1df1,_0x58dc9f={};for(const [_0x243a86,_0x30ea9c]of _0x29ce92){const _0x4a720e=_0x43568b[_0x16d88d(0x127)](_0x243a86)??_0x30ea9c['action'];_0x58dc9f[_0x243a86]=[_0x4a720e];}return _0x58dc9f;}export function readRoleRef(_0x12388f){const _0x3ac794=a131_0x1e1df1,_0x2e245d=_0x12388f[_0x3ac794(0x10d)](_0x3ac794(0x119))[_0x3ac794(0xea)]();if(!_0x2e245d)throw CliErrors[_0x3ac794(0x103)]('role',_0x3ac794(0xde));return _0x2e245d;}export function readGrantRevoke(_0x4f240d){const _0x3a0897=a131_0x1e1df1,_0x4dd0e1=_0x4f240d['bool'](_0x3a0897(0xe1)),_0x41cc2a=_0x4f240d[_0x3a0897(0x101)](_0x3a0897(0x114));if(_0x4dd0e1&&_0x41cc2a)throw CliErrors[_0x3a0897(0x117)](_0x3a0897(0x12b));if(!_0x4dd0e1&&!_0x41cc2a)throw CliErrors[_0x3a0897(0x117)](_0x3a0897(0x128),_0x3a0897(0xf9));return _0x4dd0e1?_0x3a0897(0x113):'0';}
1
+ 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 +1 @@
1
- (function(_0xf8dc61,_0x30ffc8){const _0x24ba8b=a132_0x3133,_0x44dd8a=_0xf8dc61();while(!![]){try{const _0x5d84a8=-parseInt(_0x24ba8b(0xf8))/0x1+parseInt(_0x24ba8b(0x10a))/0x2*(-parseInt(_0x24ba8b(0x104))/0x3)+-parseInt(_0x24ba8b(0x10e))/0x4*(-parseInt(_0x24ba8b(0xfe))/0x5)+parseInt(_0x24ba8b(0x101))/0x6+-parseInt(_0x24ba8b(0x10f))/0x7*(-parseInt(_0x24ba8b(0xfd))/0x8)+-parseInt(_0x24ba8b(0x10b))/0x9*(-parseInt(_0x24ba8b(0xfc))/0xa)+-parseInt(_0x24ba8b(0x112))/0xb;if(_0x5d84a8===_0x30ffc8)break;else _0x44dd8a['push'](_0x44dd8a['shift']());}catch(_0x282828){_0x44dd8a['push'](_0x44dd8a['shift']());}}}(a132_0x2589,0x7fba3));function a132_0x2589(){const _0x120dd7=['No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','Directory\x20\x22','425548uQpObI','10377WRrCmi','√\x20Project\x20Name:\x20','my-app','456656eYMpxF','5945611IDcPYL','length','string','2654993jtClBq','cwd','log','√\x20App\x20Code:\x20','449313HfyUIm','env','Login\x20failed','Skipped','1760mcpyfM','8pZelwV','15VAwGqT','green','Logged\x20in','190968KEfYVj','cyan','production','3bwYWNW','\x22\x20already\x20exists','resolve','√\x20Login\x20status:\x20'];a132_0x2589=function(){return _0x120dd7;};return a132_0x2589();}import{existsSync}from'node:fs';import a132_0x3deb68 from'node:path';import a132_0x4692b5 from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';function a132_0x3133(_0x40e532,_0x943046){_0x40e532=_0x40e532-0xf8;const _0x25893e=a132_0x2589();let _0x313312=_0x25893e[_0x40e532];return _0x313312;}export async function guidedCreateProject(_0x42e587,_0x36e1e6,_0x312dcb){const _0x44cad3=a132_0x3133,_0x4b9a27=_0x44cad3(0x10d),_0x4b5369=readConfig(),_0x395075=typeof _0x4b5369[_0x44cad3(0xf9)]===_0x44cad3(0x111)?_0x4b5369[_0x44cad3(0xf9)]:undefined,_0x476bc1=await input({'message':'Project\x20name:','default':_0x4b9a27,'validate':_0x2ba5b5=>{const _0x4a418e=_0x44cad3,_0x3e4f78=_0x2ba5b5['trim']()||_0x4b9a27;if(_0x3e4f78[_0x4a418e(0x110)]>0x32)return'Project\x20name\x20cannot\x20exceed\x2050\x20characters';const _0x4fa8e2=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x3e4f78&&!_0x4fa8e2['test'](_0x3e4f78))return'Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_';const _0x281197=a132_0x3deb68[_0x4a418e(0x106)](process[_0x4a418e(0x113)](),_0x3e4f78);if(existsSync(_0x281197))return _0x4a418e(0x109)+_0x3e4f78+_0x4a418e(0x105);return!![];}});console[_0x44cad3(0x114)](a132_0x4692b5['green'](_0x44cad3(0x10c)+a132_0x4692b5[_0x44cad3(0x102)](_0x476bc1)));const _0xddca7e=await selectSingleAppcode(_0x312dcb);console['log'](a132_0x4692b5[_0x44cad3(0xff)](_0x44cad3(0x115)+a132_0x4692b5[_0x44cad3(0x102)](_0xddca7e||'Not\x20set')));if(_0xddca7e){const _0x3cc3ba=await getIsSessionValid();if(!_0x3cc3ba){const _0x23a634=await confirm({'message':_0x44cad3(0x108),'default':!![]});if(_0x23a634){const _0x39ac53=await authServer({'silent':!![]});console[_0x44cad3(0x114)](a132_0x4692b5[_0x44cad3(0xff)](_0x44cad3(0x107)+a132_0x4692b5[_0x44cad3(0x102)](_0x39ac53?_0x44cad3(0x100):_0x44cad3(0xfa))));}else console[_0x44cad3(0x114)](a132_0x4692b5[_0x44cad3(0xff)]('√\x20Login\x20status:\x20'+a132_0x4692b5[_0x44cad3(0x102)](_0x44cad3(0xfb))));}await _0x42e587({'projectName':_0x476bc1,'appCode':_0xddca7e,'env':_0x36e1e6||_0x395075||_0x44cad3(0x103)});}else await _0x42e587({'projectName':_0x476bc1,'env':_0x36e1e6||_0x395075||'production'});}
1
+ (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 +1 @@
1
- (function(_0x270850,_0x347f32){const _0x458f89=a133_0x2266,_0x30893c=_0x270850();while(!![]){try{const _0xcb5f7e=-parseInt(_0x458f89(0x116))/0x1*(-parseInt(_0x458f89(0x118))/0x2)+-parseInt(_0x458f89(0x11b))/0x3+-parseInt(_0x458f89(0x113))/0x4*(-parseInt(_0x458f89(0x114))/0x5)+-parseInt(_0x458f89(0x119))/0x6+parseInt(_0x458f89(0x11a))/0x7+-parseInt(_0x458f89(0x11d))/0x8*(parseInt(_0x458f89(0x112))/0x9)+parseInt(_0x458f89(0x115))/0xa;if(_0xcb5f7e===_0x347f32)break;else _0x30893c['push'](_0x30893c['shift']());}catch(_0x38921c){_0x30893c['push'](_0x30893c['shift']());}}}(a133_0x5d58,0x82720));export function formatElapsed(_0x31cb46){const _0x5a074d=a133_0x2266,_0xaedd0c=Date[_0x5a074d(0x11c)]()-_0x31cb46;if(_0xaedd0c<0x3e8)return _0xaedd0c+'ms';const _0x4291d8=(_0xaedd0c/0x3e8)[_0x5a074d(0x117)](0x2),_0x343a8a=_0x4291d8[_0x5a074d(0x111)](/\.?0+$/u,'');return _0x343a8a+'s';}function a133_0x2266(_0x333df1,_0x587d08){_0x333df1=_0x333df1-0x111;const _0x5d58a9=a133_0x5d58();let _0x2266b0=_0x5d58a9[_0x333df1];return _0x2266b0;}function a133_0x5d58(){const _0x5848e0=['6004710OXgWEt','1190847WvkQcr','2665929SSDVMt','now','23072DbVlIZ','replace','873aSlFCk','4ZeqLFM','2629315lVIqPs','15167820yQALbU','35051qOqzMq','toFixed','28xhQPAq'];a133_0x5d58=function(){return _0x5848e0;};return a133_0x5d58();}
1
+ 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 +1 @@
1
- (function(_0x36c689,_0x5422a9){const _0x49f766=a134_0x4de9,_0x6404b0=_0x36c689();while(!![]){try{const _0x12a701=-parseInt(_0x49f766(0x15f))/0x1+parseInt(_0x49f766(0x153))/0x2*(parseInt(_0x49f766(0x19e))/0x3)+parseInt(_0x49f766(0x17d))/0x4*(parseInt(_0x49f766(0x159))/0x5)+parseInt(_0x49f766(0x152))/0x6*(parseInt(_0x49f766(0x158))/0x7)+-parseInt(_0x49f766(0x179))/0x8*(parseInt(_0x49f766(0x1aa))/0x9)+-parseInt(_0x49f766(0x1a0))/0xa*(parseInt(_0x49f766(0x188))/0xb)+parseInt(_0x49f766(0x1a9))/0xc;if(_0x12a701===_0x5422a9)break;else _0x6404b0['push'](_0x6404b0['shift']());}catch(_0x332a67){_0x6404b0['push'](_0x6404b0['shift']());}}}(a134_0x28ca,0xd87c7));import a134_0x118326 from'path';import a134_0x281dbf from'fs';function a134_0x28ca(){const _0x14068f=['\x20√\x20','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','stableVersion','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','currentVersion','41997624dHQFAh','421182gylkMg','name','version','Copy\x20project\x20files','\x20model(s)','12LJDIDO','123778OaGdFS','appCode','√\x20package.json\x20updated:\x20name=','fail','\x20api\x20pull','831509ulARXg','55ctyErc','log','parse','配置应用AppCode:\x20','\x20|\x20Default:\x20','🚀\x20Next\x20Steps:','1127501RYMUSi','√\x20Pulled\x20','更新\x20package.json\x20失败','rmSync','chdir','defaultApp','配置应用AppCode失败','apps','warn','项目创建完成:\x20','gray','length','readFileSync','1.0.0','string','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','error','更新\x20package.json\x20name','API\x20配置拉取异常','production','\x20\x201.\x20Start\x20project:\x20','*\x20Configuring\x20AppCode\x20for\x20project\x20','√\x20Configuration\x20file\x20created,\x20Apps:\x20','stringify','utf8','cookie','232MAjiqS','toLocaleString','\x20|\x20AppCode:\x20','green','195236fQvdVH','CLI\x20版本检查','needsUpgrade','bold','constants','\x20dataset(s),\x20generated\x20','API\x20configuration\x20pulled:\x20','W_OK','项目创建失败:\x20','resolve','\x20run\x20start','1768789gytxPT','\x20&&\x20','cd\x20','Format\x20code','projectName','cyan','accessSync','Project\x20directory\x20','projectCode','repeat','info','test','join','message','belowMinimum','cwd','existsSync','env','\x20Generated\x20by\x20rabetbase\x20cli\x20','dirname','*\x20Pulling\x20API\x20configuration...','Install\x20dependencies','3gZSYfF','...','60BeQSfr','package.json','create','success'];a134_0x28ca=function(){return _0x14068f;};return a134_0x28ca();}import a134_0x12d61a from'chalk';import a134_0x3ff872 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';function a134_0x4de9(_0x13d26a,_0x391683){_0x13d26a=_0x13d26a-0x14f;const _0x28ca03=a134_0x28ca();let _0x4de96e=_0x28ca03[_0x13d26a];return _0x4de96e;}import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x102f69){const _0x4336be=a134_0x4de9,_0x2d7231=await checkCliVersion();(_0x2d7231['needsUpgrade']||_0x2d7231[_0x4336be(0x196)])&&(printCliUpgradeWarning(_0x2d7231),assertCliVersionSupported(_0x2d7231),logger[_0x4336be(0x192)](_0x4336be(0x1a2),_0x4336be(0x17e),{'currentVersion':_0x2d7231[_0x4336be(0x1a8)],'stableVersion':_0x2d7231[_0x4336be(0x1a6)],'minimumVersion':_0x2d7231['minimumVersion'],'needsUpgrade':_0x2d7231[_0x4336be(0x17f)],'belowMinimum':_0x2d7231[_0x4336be(0x196)]}));if(_0x102f69[_0x4336be(0x190)]&&_0x102f69[_0x4336be(0x154)])await runCreate({'projectName':_0x102f69[_0x4336be(0x190)],'appCode':_0x102f69[_0x4336be(0x154)],'env':_0x102f69['env']},_0x102f69);else{if(_0x102f69[_0x4336be(0x190)]){const _0x50940c=await selectSingleAppcode(_0x102f69[_0x4336be(0x178)]);await runCreate({'projectName':_0x102f69['projectCode'],'appCode':_0x50940c||undefined,'env':_0x102f69[_0x4336be(0x199)]},_0x102f69);}else await guidedCreateProject(_0x3577a0=>runCreate(_0x3577a0,_0x102f69),_0x102f69['env'],_0x102f69[_0x4336be(0x178)]);}}async function runCreate(_0x313812,_0x7543aa){const _0x159c64=a134_0x4de9;if(!_0x313812[_0x159c64(0x18c)]||_0x313812[_0x159c64(0x18c)]['trim']()==='')throw new Error('Project\x20name\x20cannot\x20be\x20empty');const _0x37ab2b=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x37ab2b[_0x159c64(0x193)](_0x313812['projectName']))throw new Error('Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters');if(_0x313812['projectName'][_0x159c64(0x16a)]>0x64)throw new Error('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters');const _0x16f6c7=a134_0x118326[_0x159c64(0x186)](process[_0x159c64(0x197)](),_0x313812[_0x159c64(0x18c)]);if(a134_0x281dbf[_0x159c64(0x198)](_0x16f6c7))throw new Error(_0x159c64(0x18f)+_0x313812[_0x159c64(0x18c)]+'\x20already\x20exists');try{a134_0x281dbf[_0x159c64(0x18e)](a134_0x118326[_0x159c64(0x19b)](_0x16f6c7),a134_0x281dbf[_0x159c64(0x181)][_0x159c64(0x184)]);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger['setLogPath'](_0x16f6c7),logger[_0x159c64(0x192)]('create','开始创建项目:\x20'+_0x313812['projectName'],{'projectDir':_0x16f6c7,'appCode':_0x313812[_0x159c64(0x154)]}),console['log'](),console[_0x159c64(0x15a)](a134_0x12d61a[_0x159c64(0x17c)]('\x20√\x20')+'Project\x20name:\x20'+a134_0x12d61a[_0x159c64(0x17c)](_0x313812['projectName'])+(_0x313812['appCode']?_0x159c64(0x17b)+a134_0x12d61a[_0x159c64(0x18d)](_0x313812['appCode']):''));try{await runTask(_0x159c64(0x150),()=>copyProjectTemplate(_0x313812['projectName'])),await updatePackageJsonName(_0x313812[_0x159c64(0x18c)]),await runTask(_0x159c64(0x19d),()=>installDependencies(_0x313812[_0x159c64(0x18c)])),await runTask(_0x159c64(0x18b),()=>formatProjectCode(_0x313812['projectName'])),await configureAppCode(_0x313812[_0x159c64(0x18c)],_0x313812[_0x159c64(0x154)]||'',_0x313812[_0x159c64(0x199)]);let _0x4e07a4=![];if(_0x313812[_0x159c64(0x154)]){console[_0x159c64(0x15a)](_0x159c64(0x19c));const _0x245e77=process['cwd']();try{process[_0x159c64(0x163)](_0x16f6c7);const _0x438cd4=_0x313812[_0x159c64(0x199)]||_0x159c64(0x172);initEnv(_0x438cd4);const {configArray:_0x1110d0}=await fetchModelList(_0x313812[_0x159c64(0x154)],_0x7543aa[_0x159c64(0x178)]||''),_0x584918=DEFAULT_API_DIR,_0x207f3d=await generateApiFile(_0x1110d0,'',_0x313812[_0x159c64(0x154)],!![],_0x438cd4,_0x584918);console[_0x159c64(0x15a)](_0x159c64(0x160)+_0x1110d0[_0x159c64(0x16a)]+_0x159c64(0x182)+_0x207f3d['modelCount']+_0x159c64(0x151)),logger[_0x159c64(0x192)](_0x159c64(0x1a2),_0x159c64(0x183)+_0x313812['appCode']);}catch(_0x19b741){_0x4e07a4=!![],console[_0x159c64(0x15a)](_0x159c64(0x16e)),logger[_0x159c64(0x167)]('create',_0x159c64(0x171),{'error':_0x19b741 instanceof Error?_0x19b741[_0x159c64(0x195)]:String(_0x19b741)});}finally{process[_0x159c64(0x163)](_0x245e77);}}logger[_0x159c64(0x1a3)](_0x159c64(0x1a2),_0x159c64(0x168)+_0x313812[_0x159c64(0x18c)]),console[_0x159c64(0x15a)](),console[_0x159c64(0x15a)](a134_0x12d61a[_0x159c64(0x17c)]('─'[_0x159c64(0x191)](0x3c))),console[_0x159c64(0x15a)](a134_0x12d61a['cyan']['bold'](_0x159c64(0x15e))),console[_0x159c64(0x15a)](),console['log'](_0x159c64(0x173)+a134_0x12d61a[_0x159c64(0x18d)][_0x159c64(0x180)](_0x159c64(0x18a)+_0x313812[_0x159c64(0x18c)]+_0x159c64(0x189)+CLI_BIN_NAME+_0x159c64(0x187))),_0x4e07a4&&console[_0x159c64(0x15a)]('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a134_0x12d61a[_0x159c64(0x18d)][_0x159c64(0x180)](CLI_BIN_NAME+_0x159c64(0x157))),console[_0x159c64(0x15a)](a134_0x12d61a['green']('─'[_0x159c64(0x191)](0x3c)));}catch(_0x2f8cc1){logger[_0x159c64(0x16f)](_0x159c64(0x1a2),_0x159c64(0x185)+_0x313812[_0x159c64(0x18c)],{'error':_0x2f8cc1 instanceof Error?_0x2f8cc1['message']:String(_0x2f8cc1)});try{a134_0x281dbf[_0x159c64(0x198)](_0x16f6c7)&&(console[_0x159c64(0x15a)](_0x159c64(0x1a7)+_0x16f6c7),a134_0x281dbf[_0x159c64(0x162)](_0x16f6c7,{'recursive':!![],'force':!![]}));}catch{logger['warn']('create','清理项目目录失败:\x20'+_0x16f6c7);}throw _0x2f8cc1;}}async function runTask(_0x2acfba,_0x5bb580){const _0x77bdcb=a134_0x4de9,_0x79240e=a134_0x3ff872(_0x2acfba+_0x77bdcb(0x19f))['start']();try{const _0x317047=await _0x5bb580();_0x79240e['stop'](),console[_0x77bdcb(0x15a)](''+a134_0x12d61a[_0x77bdcb(0x17c)](_0x77bdcb(0x1a4))+_0x2acfba+'\x20'+a134_0x12d61a[_0x77bdcb(0x169)]('['+_0x317047+']'));}catch(_0x528b92){_0x79240e[_0x77bdcb(0x156)](_0x2acfba);throw _0x528b92;}}async function updatePackageJsonName(_0xb0ffbd){const _0x228344=a134_0x4de9,_0x395f24=a134_0x118326['resolve'](process['cwd'](),_0xb0ffbd),_0x3cbd56=a134_0x118326[_0x228344(0x194)](_0x395f24,_0x228344(0x1a1));try{console[_0x228344(0x15a)]('*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields');const _0x5a5feb=getRabetbaseCliPackageRoot(),_0x3fcf1b=a134_0x118326['join'](_0x5a5feb,_0x228344(0x1a1));let _0x560969=_0x228344(0x16c);try{const _0x3d4fe4=JSON[_0x228344(0x15b)](a134_0x281dbf['readFileSync'](_0x3fcf1b,_0x228344(0x177)));_0x560969=_0x3d4fe4[_0x228344(0x14f)]||_0x228344(0x16c);}catch{}const _0x496cfe=a134_0x281dbf[_0x228344(0x16b)](_0x3cbd56,_0x228344(0x177)),_0x49ca3b=JSON[_0x228344(0x15b)](_0x496cfe);_0x49ca3b[_0x228344(0x1ab)]=_0xb0ffbd,_0x49ca3b['description']=_0xb0ffbd+_0x228344(0x19a)+_0x560969,a134_0x281dbf['writeFileSync'](_0x3cbd56,JSON[_0x228344(0x176)](_0x49ca3b,null,0x2)+'\x0a',_0x228344(0x177)),console[_0x228344(0x15a)](_0x228344(0x155)+_0xb0ffbd),logger[_0x228344(0x192)](_0x228344(0x1a2),_0x228344(0x170));}catch(_0x296c70){logger[_0x228344(0x16f)]('create',_0x228344(0x161));throw _0x296c70;}}async function configureAppCode(_0x4fcb3d,_0x3e17c6,_0x42ffd5){const _0x33649b=a134_0x4de9,_0x4ee821=a134_0x118326['resolve'](process[_0x33649b(0x197)](),_0x4fcb3d),_0x19772a=a134_0x118326[_0x33649b(0x194)](_0x4ee821,NEW_CONFIG_NAME);try{_0x3e17c6?console['log'](_0x33649b(0x174)+_0x4fcb3d+':\x20'+_0x3e17c6):console[_0x33649b(0x15a)](_0x33649b(0x1a5)+_0x4fcb3d);const _0xde7058=getRabetbaseCliPackageRoot(),_0x2ed98d=a134_0x118326[_0x33649b(0x194)](_0xde7058,_0x33649b(0x1a1));let _0x13c379=_0x33649b(0x16c);try{const _0x2d9a4c=JSON[_0x33649b(0x15b)](a134_0x281dbf[_0x33649b(0x16b)](_0x2ed98d,_0x33649b(0x177)));_0x13c379=_0x2d9a4c['version']||'1.0.0';}catch{}const _0x4490d8=readConfig(),_0x52b3d3=typeof _0x4490d8[_0x33649b(0x199)]===_0x33649b(0x16d)?_0x4490d8[_0x33649b(0x199)]:undefined,_0x3f8657={};for(const _0x38f1f4 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x4490d8[_0x38f1f4]!=null)_0x3f8657[_0x38f1f4]=_0x4490d8[_0x38f1f4];}const _0x3af927=buildCanonicalProjectConfig(_0x3f8657,{'appCodes':_0x3e17c6?[_0x3e17c6]:[],'env':_0x42ffd5||_0x52b3d3||_0x33649b(0x172),'metadata':{'createdAt':new Date()[_0x33649b(0x17a)](),'version':_0x13c379}});writeConfigFile(_0x19772a,_0x3af927),_0x3e17c6?console[_0x33649b(0x15a)](_0x33649b(0x175)+Object['keys'](_0x3af927[_0x33649b(0x166)]||{})[_0x33649b(0x194)](',\x20')+_0x33649b(0x15d)+_0x3af927[_0x33649b(0x164)]):console[_0x33649b(0x15a)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger[_0x33649b(0x192)](_0x33649b(0x1a2),_0x33649b(0x15c)+_0x3e17c6);}catch(_0x4ef851){logger['error'](_0x33649b(0x1a2),_0x33649b(0x165));}}
1
+ (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 +1 @@
1
- (function(_0x5a5eb2,_0x4ded90){const _0x39256f=a135_0x382d,_0x4e8969=_0x5a5eb2();while(!![]){try{const _0x436297=parseInt(_0x39256f(0xc9))/0x1*(parseInt(_0x39256f(0xb9))/0x2)+-parseInt(_0x39256f(0xad))/0x3*(parseInt(_0x39256f(0xa4))/0x4)+parseInt(_0x39256f(0xbf))/0x5+-parseInt(_0x39256f(0xa9))/0x6*(parseInt(_0x39256f(0xd3))/0x7)+parseInt(_0x39256f(0x9c))/0x8*(-parseInt(_0x39256f(0x9f))/0x9)+parseInt(_0x39256f(0xa2))/0xa+parseInt(_0x39256f(0xb8))/0xb;if(_0x436297===_0x4ded90)break;else _0x4e8969['push'](_0x4e8969['shift']());}catch(_0x236401){_0x4e8969['push'](_0x4e8969['shift']());}}}(a135_0x2cf4,0xdc5eb));import a135_0x5c2340 from'path';import a135_0x36dd3d from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';import{fetchModelList}from'../../../core/api-client.js';function a135_0x382d(_0x90196b,_0x124e0d){_0x90196b=_0x90196b-0x99;const _0x2cf4c9=a135_0x2cf4();let _0x382d91=_0x2cf4c9[_0x90196b];return _0x382d91;}import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x345e78,_0x49c11b,_0x7f6751,_0xacd5f4){const _0x4c26f5=a135_0x382d,_0x5078be=await checkCliVersion();(_0x5078be['needsUpgrade']||_0x5078be[_0x4c26f5(0xd2)])&&(printCliUpgradeWarning(_0x5078be),assertCliVersionSupported(_0x5078be));if(!_0x345e78||_0x345e78[_0x4c26f5(0xc5)]()==='')throw CliErrors[_0x4c26f5(0xba)](_0x4c26f5(0xc1));const _0x228fdb=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x228fdb[_0x4c26f5(0xbe)](_0x345e78))throw CliErrors[_0x4c26f5(0xba)](_0x4c26f5(0xcd),'Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters');if(_0x345e78[_0x4c26f5(0xb0)]>0x64)throw CliErrors[_0x4c26f5(0xba)]('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.');const _0x51c548=a135_0x5c2340[_0x4c26f5(0xc2)](process[_0x4c26f5(0x9d)](),_0x345e78);if(existsSync(_0x51c548))throw CliErrors['validation'](_0x4c26f5(0xaf)+_0x345e78+_0x4c26f5(0xa0),_0x4c26f5(0xc6));try{const _0x33ae0d=a135_0x5c2340[_0x4c26f5(0xa7)](_0x51c548);await a135_0x36dd3d[_0x4c26f5(0xbc)](_0x33ae0d,a135_0x36dd3d['constants'][_0x4c26f5(0xc0)]);}catch{throw CliErrors[_0x4c26f5(0xba)](_0x4c26f5(0x99),_0x4c26f5(0xbb));}try{console['log']('*\x20Creating\x20project\x20'+_0x345e78+_0x4c26f5(0xbd));const _0x8a3295=getSubAppReactDemoTemplateDir();await copyDirectory(_0x8a3295,_0x51c548),console['log'](_0x4c26f5(0xb2)),await updatePackageJsonName(_0x345e78),console[_0x4c26f5(0xb4)](_0x4c26f5(0x9e)),console['log'](_0x4c26f5(0xb6)),console['log'](_0x4c26f5(0xd0)),await formatCode(_0x51c548),console['log'](_0x4c26f5(0xca)),await configureProject(_0x345e78,_0x7f6751,_0x49c11b),console[_0x4c26f5(0xb4)](_0x4c26f5(0xa8)),_0x7f6751&&await pullApiConfig(_0x51c548,_0x7f6751,_0x49c11b,_0xacd5f4),console[_0x4c26f5(0xb4)](_0x4c26f5(0xcb)+_0x345e78+_0x4c26f5(0xb1)),console[_0x4c26f5(0xb4)](_0x4c26f5(0x9a)+_0x345e78),console[_0x4c26f5(0xb4)](_0x4c26f5(0xc4));}catch(_0xaace1){try{existsSync(_0x51c548)&&await a135_0x36dd3d['rm'](_0x51c548,{'recursive':!![],'force':!![]});}catch{}throw _0xaace1;}}async function updatePackageJsonName(_0x27488e){const _0x3bb44b=a135_0x382d,_0x1f88c5=a135_0x5c2340['resolve'](process[_0x3bb44b(0x9d)](),_0x27488e),_0x5e7da1=a135_0x5c2340[_0x3bb44b(0xa6)](_0x1f88c5,_0x3bb44b(0xac)),_0x5ef007=await a135_0x36dd3d[_0x3bb44b(0xcc)](_0x5e7da1,_0x3bb44b(0xb7)),_0x52e50d=JSON[_0x3bb44b(0xab)](_0x5ef007);_0x52e50d['name']=_0x27488e,_0x52e50d[_0x3bb44b(0x9b)]=_0x3bb44b(0xd1),await a135_0x36dd3d[_0x3bb44b(0xc8)](_0x5e7da1,JSON['stringify'](_0x52e50d,null,0x2)+'\x0a');}function detectPackageManager(){const _0x1b1a43=a135_0x382d;try{return execSync('bun\x20--version',{'stdio':_0x1b1a43(0xd4)}),_0x1b1a43(0xae);}catch{return'npm';}}async function formatCode(_0x2292f1){const _0x5974e8=a135_0x382d;try{await execAsync(_0x5974e8(0xa3),{'cwd':_0x2292f1});}catch{}}function a135_0x2cf4(){const _0x515ab4=['log','toLocaleString','\x20\x20Installing\x20dependencies...','utf-8','12677808NKJxAP','2491148XxKbvR','validation','Check\x20directory\x20permissions.','access','...','test','8291385xqgNZb','W_OK','Project\x20name\x20cannot\x20be\x20empty.','resolve','\x20api\x20pull`\x20manually\x20later.','\x20\x20rabetbase\x20run\x20start\x0a','trim','Use\x20a\x20different\x20project\x20name.','env','writeFile','1ztCmuK','\x20\x20√\x20Code\x20formatted','\x0a√\x20Project\x20','readFile','Project\x20name\x20contains\x20invalid\x20characters.','\x20dataset(s),\x20generated\x20','production','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','belowMinimum','459991fZAgkd','ignore','Cannot\x20create\x20project\x20in\x20current\x20directory.','\x0a\x20\x20cd\x20','description','72cVNtWN','cwd','\x20\x20√\x20package.json\x20updated','815661xclQoo','\x22\x20already\x20exists.','chdir','1722640ZMpuAA','bun\x20run\x20format','47228cSJZYc','\x20\x20Pulling\x20API\x20configuration...','join','dirname','\x20\x20√\x20Configuration\x20file\x20created','102BPoXRE','\x20model(s)','parse','package.json','354KGceew','bun','Project\x20directory\x20\x22','length','\x20created\x20successfully!','\x20\x20√\x20Project\x20template\x20created','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`'];a135_0x2cf4=function(){return _0x515ab4;};return a135_0x2cf4();}async function configureProject(_0x630aba,_0x28bc0b,_0x7d3723){const _0x13d2d7=a135_0x382d,_0x5c3977=a135_0x5c2340[_0x13d2d7(0xc2)](process[_0x13d2d7(0x9d)](),_0x630aba),_0x39db76=a135_0x5c2340['join'](_0x5c3977,NEW_CONFIG_NAME),_0x3e239a=readConfig(),_0x34ec8d=typeof _0x3e239a['env']==='string'?_0x3e239a[_0x13d2d7(0xc7)]:undefined,_0x3b7ff9={};for(const _0x500b7c of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x3e239a[_0x500b7c]!=null)_0x3b7ff9[_0x500b7c]=_0x3e239a[_0x500b7c];}const _0x28eb57=buildCanonicalProjectConfig(_0x3b7ff9,{'appCodes':_0x28bc0b?[_0x28bc0b]:[],'env':_0x7d3723||_0x34ec8d||_0x13d2d7(0xcf),'metadata':{'createdAt':new Date()[_0x13d2d7(0xb5)](),'version':getCliVersion()}});writeConfigFile(_0x39db76,_0x28eb57);}async function pullApiConfig(_0x2dc9e6,_0x5dd6d4,_0x424965,_0x24d61e){const _0xf6c422=a135_0x382d,_0x5d25aa=process[_0xf6c422(0x9d)]();try{process['chdir'](_0x2dc9e6);const _0x3764a5=_0x424965||_0xf6c422(0xcf);initEnv(_0x3764a5),console['log'](_0xf6c422(0xa5));const {configArray:_0x5a61e4}=await fetchModelList(_0x5dd6d4,_0x24d61e||''),_0x24ff66=await generateApiFile(_0x5a61e4,'',_0x5dd6d4,!![],_0x3764a5,DEFAULT_API_DIR);console[_0xf6c422(0xb4)]('\x20\x20√\x20Pulled\x20'+_0x5a61e4[_0xf6c422(0xb0)]+_0xf6c422(0xce)+_0x24ff66['modelCount']+_0xf6c422(0xaa));}catch(_0x1f15d6){console[_0xf6c422(0xb4)](_0xf6c422(0xb3)+CLI_BIN_NAME+_0xf6c422(0xc3));}finally{process[_0xf6c422(0xa1)](_0x5d25aa);}}
1
+ (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 +1 @@
1
- function a136_0x1c74(_0x49d062,_0x5c4fc2){_0x49d062=_0x49d062-0x101;const _0x2cc7a4=a136_0x2cc7();let _0x1c7426=_0x2cc7a4[_0x49d062];return _0x1c7426;}const a136_0x4b6fc8=a136_0x1c74;(function(_0x5a55fd,_0xfab83){const _0x51780d=a136_0x1c74,_0x52c2b1=_0x5a55fd();while(!![]){try{const _0x2434f7=parseInt(_0x51780d(0x105))/0x1+parseInt(_0x51780d(0x10d))/0x2+-parseInt(_0x51780d(0x10f))/0x3*(-parseInt(_0x51780d(0x108))/0x4)+parseInt(_0x51780d(0x10b))/0x5*(-parseInt(_0x51780d(0x104))/0x6)+parseInt(_0x51780d(0x102))/0x7+-parseInt(_0x51780d(0x10a))/0x8+-parseInt(_0x51780d(0x110))/0x9;if(_0x2434f7===_0xfab83)break;else _0x52c2b1['push'](_0x52c2b1['shift']());}catch(_0x37f896){_0x52c2b1['push'](_0x52c2b1['shift']());}}}(a136_0x2cc7,0xb801c));import a136_0xf2505f from'node:path';import{fileURLToPath}from'node:url';const __dirname=a136_0xf2505f[a136_0x4b6fc8(0x10c)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x349e6f=a136_0x4b6fc8;return a136_0xf2505f[_0x349e6f(0x106)](__dirname,_0x349e6f(0x10e));}export function getSubAppReactDemoTemplateDir(){const _0x52f3a4=a136_0x4b6fc8;return a136_0xf2505f[_0x52f3a4(0x103)](getRabetbaseCliPackageRoot(),_0x52f3a4(0x107),_0x52f3a4(0x109),_0x52f3a4(0x101));}function a136_0x2cc7(){const _0x13e38a=['join','6Zgoeyc','1422706NrWXUl','resolve','templates','20zsyjsG','projects','7481160nzyFKW','339550hWqbnV','dirname','484590RbErAx','../../../../','541881eYUAiO','19990206sEMGyQ','sub-app-react-demo','9868215xXuXRH'];a136_0x2cc7=function(){return _0x13e38a;};return a136_0x2cc7();}
1
+ 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 +1 @@
1
- (function(_0x84a9b6,_0x3de8dc){const _0x4ae4f3=a137_0x59d3,_0x22f101=_0x84a9b6();while(!![]){try{const _0x1712b2=parseInt(_0x4ae4f3(0xaa))/0x1*(-parseInt(_0x4ae4f3(0xa3))/0x2)+parseInt(_0x4ae4f3(0xa8))/0x3+-parseInt(_0x4ae4f3(0x9a))/0x4*(-parseInt(_0x4ae4f3(0x9d))/0x5)+parseInt(_0x4ae4f3(0xa4))/0x6*(-parseInt(_0x4ae4f3(0x9f))/0x7)+parseInt(_0x4ae4f3(0x9c))/0x8*(-parseInt(_0x4ae4f3(0x9b))/0x9)+parseInt(_0x4ae4f3(0xa0))/0xa+-parseInt(_0x4ae4f3(0xa2))/0xb*(-parseInt(_0x4ae4f3(0x9e))/0xc);if(_0x1712b2===_0x3de8dc)break;else _0x22f101['push'](_0x22f101['shift']());}catch(_0x157faf){_0x22f101['push'](_0x22f101['shift']());}}}(a137_0x4b1a,0x6db82));import a137_0x517d24 from'node:path';function a137_0x59d3(_0xb362ab,_0x9daf24){_0xb362ab=_0xb362ab-0x99;const _0x4b1a12=a137_0x4b1a();let _0x59d353=_0x4b1a12[_0xb362ab];return _0x59d353;}import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a137_0x4b1a(){const _0x38b223=['543635CiaKiJ','108uVDgoG','77YdvHcc','1055160nwwTgf','error','16621HNSelU','4SyZbUA','353196xmBCsk','success','info','copy','529623CDqJrL','now','13821yvfZlp','resolve','message','cwd','开始复制项目模板','项目模板复制完成','32BaqtfM','63QgWSND','46736UQIYuN'];a137_0x4b1a=function(){return _0x38b223;};return a137_0x4b1a();}import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x1d6562){const _0x3b959c=a137_0x59d3,_0x194b6=Date[_0x3b959c(0xa9)](),_0x45d509=a137_0x517d24[_0x3b959c(0xab)](process[_0x3b959c(0xad)](),_0x1d6562);try{logger[_0x3b959c(0xa6)]('copy',_0x3b959c(0xae),{'projectCode':_0x1d6562,'templateDir':templateDir}),await copyDirectory(templateDir,_0x45d509);const _0x10e617=Date[_0x3b959c(0xa9)]()-_0x194b6;logger[_0x3b959c(0xa5)](_0x3b959c(0xa7),_0x3b959c(0x99),_0x10e617,{'projectCode':_0x1d6562});}catch(_0x3d57f3){const _0x5aaf91=Date[_0x3b959c(0xa9)]()-_0x194b6;logger[_0x3b959c(0xa1)](_0x3b959c(0xa7),'项目模板复制失败',{'projectCode':_0x1d6562,'error':_0x3d57f3 instanceof Error?_0x3d57f3[_0x3b959c(0xac)]:String(_0x3d57f3),'duration':_0x5aaf91});throw _0x3d57f3;}return formatElapsed(_0x194b6);}
1
+ (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 +1 @@
1
- (function(_0x18969d,_0x1657e5){const _0x47c2f9=a138_0x40d5,_0x1b3eb8=_0x18969d();while(!![]){try{const _0x160bdb=parseInt(_0x47c2f9(0x9c))/0x1+parseInt(_0x47c2f9(0x90))/0x2*(parseInt(_0x47c2f9(0x98))/0x3)+-parseInt(_0x47c2f9(0x9d))/0x4*(-parseInt(_0x47c2f9(0x92))/0x5)+-parseInt(_0x47c2f9(0x91))/0x6*(parseInt(_0x47c2f9(0x8c))/0x7)+-parseInt(_0x47c2f9(0x93))/0x8+-parseInt(_0x47c2f9(0x9a))/0x9*(-parseInt(_0x47c2f9(0x96))/0xa)+-parseInt(_0x47c2f9(0xa0))/0xb;if(_0x160bdb===_0x1657e5)break;else _0x1b3eb8['push'](_0x1b3eb8['shift']());}catch(_0x7d389e){_0x1b3eb8['push'](_0x1b3eb8['shift']());}}}(a138_0x60c7,0xbe423));import a138_0x1979e5 from'node:path';function a138_0x60c7(){const _0x294468=['422407slNCFe','188564EYsTca','info','npx','3182223nVOzXV','cwd','5320588gSwVpM','resolve','format','代码格式化完成','906322ATaZBl','6RrlMyM','125JmpPsR','9625392SqToGf','--write','代码格式化失败','2622980IjWJDw','开始格式化代码','6EJwhdQ','prettier','18yFvaxV','message'];a138_0x60c7=function(){return _0x294468;};return a138_0x60c7();}import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';function a138_0x40d5(_0x5990f7,_0x5b0e88){_0x5990f7=_0x5990f7-0x8c;const _0x60c73c=a138_0x60c7();let _0x40d54a=_0x60c73c[_0x5990f7];return _0x40d54a;}export async function formatProjectCode(_0x216d4d){const _0x15d4f2=a138_0x40d5,_0x47477c=Date['now'](),_0x498ceb=a138_0x1979e5[_0x15d4f2(0x8d)](process[_0x15d4f2(0xa1)](),_0x216d4d);try{logger[_0x15d4f2(0x9e)](_0x15d4f2(0x8e),_0x15d4f2(0x97),{'projectCode':_0x216d4d}),await execa(resolveNpmBin(_0x15d4f2(0x9f)),[_0x15d4f2(0x99),_0x15d4f2(0x94),'.'],{'cwd':_0x498ceb});const _0x4bf212=Date['now']()-_0x47477c;logger['success'](_0x15d4f2(0x8e),_0x15d4f2(0x8f),_0x4bf212,{'projectCode':_0x216d4d});}catch(_0x51f316){const _0x4bf775=Date['now']()-_0x47477c;logger['error'](_0x15d4f2(0x8e),_0x15d4f2(0x95),{'projectCode':_0x216d4d,'error':_0x51f316 instanceof Error?_0x51f316[_0x15d4f2(0x9b)]:String(_0x51f316),'duration':_0x4bf775});throw _0x51f316;}return formatElapsed(_0x47477c);}
1
+ (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 +1 @@
1
- (function(_0x466cc4,_0x27fc39){const _0x5ef084=a139_0x4f9b,_0x34366e=_0x466cc4();while(!![]){try{const _0xc52ac9=-parseInt(_0x5ef084(0x1a7))/0x1*(parseInt(_0x5ef084(0x1a5))/0x2)+parseInt(_0x5ef084(0x1af))/0x3+parseInt(_0x5ef084(0x1ae))/0x4+-parseInt(_0x5ef084(0x1a4))/0x5+-parseInt(_0x5ef084(0x1b3))/0x6+parseInt(_0x5ef084(0x1ad))/0x7+-parseInt(_0x5ef084(0x1a8))/0x8*(-parseInt(_0x5ef084(0x1b2))/0x9);if(_0xc52ac9===_0x27fc39)break;else _0x34366e['push'](_0x34366e['shift']());}catch(_0x4b7661){_0x34366e['push'](_0x34366e['shift']());}}}(a139_0x4fd3,0x73f19));import a139_0x385e8b from'node:path';function a139_0x4f9b(_0x535c87,_0x376828){_0x535c87=_0x535c87-0x1a4;const _0x4fd332=a139_0x4fd3();let _0x4f9b07=_0x4fd332[_0x535c87];return _0x4f9b07;}import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';function a139_0x4fd3(){const _0x407bf5=['now','install','--registry','3098220EPthIS','150jrYXQm','info','6046HYTKAO','8BitujC','message','https://registry.npmmirror.com','依赖安装失败','cwd','1282792awykDx','1297092aizoZn','1252962YeGyRa','success','error','7018551sJsirU','942138qlkXsG'];a139_0x4fd3=function(){return _0x407bf5;};return a139_0x4fd3();}export async function installDependencies(_0x2f0cda){const _0x5d8552=a139_0x4f9b,_0x1d2d91=Date[_0x5d8552(0x1b4)](),_0x5d41cc=a139_0x385e8b['resolve'](process[_0x5d8552(0x1ac)](),_0x2f0cda);try{logger[_0x5d8552(0x1a6)]('install','开始安装依赖',{'projectCode':_0x2f0cda,'registry':_0x5d8552(0x1aa)}),await execa(resolveNpmBin('npm'),['install',_0x5d8552(0x1b6),_0x5d8552(0x1aa)],{'cwd':_0x5d41cc});const _0x1542d5=Date[_0x5d8552(0x1b4)]()-_0x1d2d91;logger[_0x5d8552(0x1b0)](_0x5d8552(0x1b5),'依赖安装完成',_0x1542d5,{'projectCode':_0x2f0cda});}catch(_0xdf9a03){const _0x3be0c6=Date[_0x5d8552(0x1b4)]()-_0x1d2d91;logger[_0x5d8552(0x1b1)](_0x5d8552(0x1b5),_0x5d8552(0x1ab),{'projectCode':_0x2f0cda,'error':_0xdf9a03 instanceof Error?_0xdf9a03[_0x5d8552(0x1a9)]:String(_0xdf9a03),'duration':_0x3be0c6});throw _0xdf9a03;}return formatElapsed(_0x1d2d91);}
1
+ (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 +1 @@
1
- const a140_0x586330=a140_0x2d1b;(function(_0x44cf20,_0x96fc1c){const _0x5f4bb1=a140_0x2d1b,_0x14e958=_0x44cf20();while(!![]){try{const _0x2d25d8=-parseInt(_0x5f4bb1(0x8b))/0x1+-parseInt(_0x5f4bb1(0x91))/0x2+-parseInt(_0x5f4bb1(0x82))/0x3*(-parseInt(_0x5f4bb1(0x9c))/0x4)+parseInt(_0x5f4bb1(0x80))/0x5+-parseInt(_0x5f4bb1(0x7e))/0x6+parseInt(_0x5f4bb1(0x98))/0x7+-parseInt(_0x5f4bb1(0x85))/0x8*(-parseInt(_0x5f4bb1(0x78))/0x9);if(_0x2d25d8===_0x96fc1c)break;else _0x14e958['push'](_0x14e958['shift']());}catch(_0x59a315){_0x14e958['push'](_0x14e958['shift']());}}}(a140_0x4901,0x7185a));function a140_0x4901(){const _0x5e4641=['name','791359XPZPCx','boolean','Skip\x20confirmation\x20prompt','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','\x20workspace\x20init','upgrade','973806ZRhHth','string','yes','trim','appcode','env','../../commands/project/create/main.js','318892vUjXVX','project','str','bool','4qvhorf','2026-07','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','423jrwKRn','Create\x20a\x20new\x20project','nonInteractive','Project\x20name','cookie','project-name','1155690UbPWcE','args','362650qvnvGD','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','1967529DWtNuE','Target\x20environment','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','197776hXYxiU','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','init','Auto-confirm\x20prompts','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)'];a140_0x4901=function(){return _0x5e4641;};return a140_0x4901();}function a140_0x2d1b(_0x401672,_0x34e080){_0x401672=_0x401672-0x76;const _0x490178=a140_0x4901();let _0x2d1b0c=_0x490178[_0x401672];return _0x2d1b0c;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';const initFlags=[{'name':a140_0x586330(0x95),'type':a140_0x586330(0x92),'description':'App\x20code\x20to\x20initialize'},{'name':a140_0x586330(0x96),'type':a140_0x586330(0x92),'description':a140_0x586330(0x83)},{'name':a140_0x586330(0x93),'type':a140_0x586330(0x8c),'description':a140_0x586330(0x88),'default':![]}],createFlags=[{'name':a140_0x586330(0x8a),'type':a140_0x586330(0x92),'description':a140_0x586330(0x7b)},{'name':a140_0x586330(0x96),'type':a140_0x586330(0x92),'description':a140_0x586330(0x83)},{'name':a140_0x586330(0x95),'type':a140_0x586330(0x92),'description':a140_0x586330(0x77)}],upgradeFlags=[{'name':a140_0x586330(0x93),'type':'boolean','description':a140_0x586330(0x8d),'default':![]}];export const projectDefinitions=[{'service':'project','command':a140_0x586330(0x87),'description':a140_0x586330(0x86),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a140_0x586330(0x8f),'since':a140_0x586330(0x76)},'flags':initFlags,async 'execute'(_0x328b4b){const _0x4610b3=a140_0x586330;return await initConfig({'appcode':_0x328b4b['str']('appcode')||undefined,'env':_0x328b4b[_0x4610b3(0x9a)](_0x4610b3(0x96))||undefined,'autoYes':_0x328b4b[_0x4610b3(0x9b)](_0x4610b3(0x93))}),{'ok':!![]};}},{'service':'project','command':'create','description':a140_0x586330(0x79),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a140_0x586330(0x7d),'description':a140_0x586330(0x89),'required':![]}],'flags':createFlags,async 'execute'(_0x4cc76f){const _0x266711=a140_0x586330,{createApp:_0x34e0c2}=await import(_0x266711(0x97)),{createProjectNonInteractive:_0x249053}=await import('../../commands/project/create/non-interactive.js'),_0x4d1f48=_0x4cc76f[_0x266711(0x9a)]('name')[_0x266711(0x94)]()||_0x4cc76f[_0x266711(0x7f)][0x0]?.[_0x266711(0x94)](),_0x4025e8=_0x4cc76f[_0x266711(0x9a)](_0x266711(0x96))||undefined,_0x4d7b34=_0x4cc76f['str'](_0x266711(0x95))||undefined;if(_0x4cc76f[_0x266711(0x7a)]){if(!_0x4d1f48)throw CliErrors['validation'](_0x266711(0x8e),'Usage:\x20'+CLI_BIN_NAME+_0x266711(0x84));await _0x249053(_0x4d1f48,_0x4025e8,_0x4d7b34,_0x4cc76f[_0x266711(0x7c)]);}else await _0x34e0c2({'projectCode':_0x4d1f48,'appCode':_0x4d7b34,'env':_0x4025e8,'cookie':_0x4cc76f[_0x266711(0x7c)]});return{'ok':!![]};}},{'service':a140_0x586330(0x99),'command':a140_0x586330(0x90),'description':a140_0x586330(0x81),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x1917e1){const _0x387859=a140_0x586330;return await upgradeApp(_0x1917e1['nonInteractive'],{'yes':_0x1917e1[_0x387859(0x9b)](_0x387859(0x93))}),{'ok':!![]};}}];
1
+ 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 +1 @@
1
- function a141_0x1bb0(_0x2b5edf,_0x30c851){_0x2b5edf=_0x2b5edf-0x153;const _0x3cd2ef=a141_0x3cd2();let _0x1bb0dd=_0x3cd2ef[_0x2b5edf];return _0x1bb0dd;}(function(_0x29d06e,_0x5f4c3f){const _0x529888=a141_0x1bb0,_0x2c695b=_0x29d06e();while(!![]){try{const _0x456c8c=-parseInt(_0x529888(0x159))/0x1*(-parseInt(_0x529888(0x162))/0x2)+-parseInt(_0x529888(0x184))/0x3*(parseInt(_0x529888(0x174))/0x4)+parseInt(_0x529888(0x16b))/0x5*(-parseInt(_0x529888(0x15a))/0x6)+-parseInt(_0x529888(0x15c))/0x7*(parseInt(_0x529888(0x15e))/0x8)+parseInt(_0x529888(0x15d))/0x9+-parseInt(_0x529888(0x17c))/0xa+-parseInt(_0x529888(0x180))/0xb*(-parseInt(_0x529888(0x183))/0xc);if(_0x456c8c===_0x5f4c3f)break;else _0x2c695b['push'](_0x2c695b['shift']());}catch(_0x274040){_0x2c695b['push'](_0x2c695b['shift']());}}}(a141_0x3cd2,0x92966));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a141_0x1ebee7 from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';function a141_0x3cd2(){const _0x2d9338=['apps','join','version','?\x20(Old\x20file\x20→\x20*.bak)','Invalid\x20App\x20Code','\x20api\x20generate\x27\x20and\x20\x27','40eDhyUL','yellow','\x20\x20Default:\x20','App\x20Code\x20cannot\x20be\x20empty','keys','Migration\x20cancelled.\x20Run\x20`','.rabetbase.json','\x20\x20Apps:\x20','7506710OOzQGY','log','utf8','\x20api\x20pull\x27','1221sAVGfH','setLogPath','✓\x20Upgraded\x20','211644LEbKLX','158973kUMqvF','toLocaleString','\x20→\x20.rabetbase.json','env','defaultApp','green','Please\x20enter\x20App\x20Code:','25469RZZrCT','54ivaxSm','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','630AhDnMA','8402544hGEMyo','99648eSPWaA','appcode','parse','.bak','14AqSzCr','app','cyan','string','bold','info','../..','1.0.0','package.json','37535XXDGMD','trim','init'];a141_0x3cd2=function(){return _0x2d9338;};return a141_0x3cd2();}export async function initConfig(_0x57b6ca){const _0x44a552=a141_0x1bb0,{appcode:_0x863a08,env:_0x1fe7d9,autoYes:_0x467b6b}=_0x57b6ca,_0x2d48a6=process['cwd']();if(getProjectConfigPath())throw new Error('.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.');let _0x1c6607;for(const _0x597abc of LEGACY_CONFIG_NAMES){const _0x564ec4=resolve(_0x2d48a6,_0x597abc);if(existsSync(_0x564ec4)){_0x1c6607=_0x564ec4;break;}}if(_0x1c6607){let _0x2825f5={};try{_0x2825f5=JSON[_0x44a552(0x160)](readFileSync(_0x1c6607,_0x44a552(0x17e)));}catch{}const _0xb9b0b2=basename(_0x1c6607),_0x402e27=_0x2825f5?.['appcode']||_0x2825f5?.['app'];let _0x2e1e07=_0x467b6b;!_0x467b6b&&(console[_0x44a552(0x17d)](a141_0x1ebee7[_0x44a552(0x175)](_0x44a552(0x15b)+a141_0x1ebee7[_0x44a552(0x166)](_0xb9b0b2))),_0x402e27&&console['log'](a141_0x1ebee7[_0x44a552(0x164)]('\x20\x20appcode:\x20'+_0x402e27)),_0x2e1e07=await confirm({'message':'Upgrade\x20it\x20to\x20'+a141_0x1ebee7[_0x44a552(0x166)](_0x44a552(0x17a))+_0x44a552(0x171),'default':!![]}));if(!_0x2e1e07){console[_0x44a552(0x17d)](_0x44a552(0x179)+CLI_BIN_NAME+'\x20workspace\x20init`\x20to\x20start\x20fresh.');return;}const _0x213cda=resolve(_0x2d48a6,NEW_CONFIG_NAME),_0x4f3097=getCliVersionFromPkg(),_0x133e77=readRawConfig(),_0x3bc1f6=_0x863a08||(typeof _0x2825f5?.[_0x44a552(0x15f)]===_0x44a552(0x165)?_0x2825f5['appcode']:undefined)||(typeof _0x2825f5?.[_0x44a552(0x163)]==='string'?_0x2825f5[_0x44a552(0x163)]:undefined)||await askAppcode(),_0x1a4ee1=typeof _0x2825f5?.[_0x44a552(0x155)]===_0x44a552(0x165)?_0x2825f5[_0x44a552(0x155)]:typeof _0x133e77[_0x44a552(0x155)]===_0x44a552(0x165)?_0x133e77[_0x44a552(0x155)]:'production',_0x33d673=buildCanonicalProjectConfig({..._0x133e77,..._0x2825f5},{'appCodes':[_0x3bc1f6],'env':_0x1a4ee1,'metadata':{'version':_0x4f3097,'migratedAt':new Date()[_0x44a552(0x153)](),'migratedFrom':_0x1c6607}});writeConfigFile(_0x213cda,_0x33d673);const _0x6a2fcb=_0x1c6607+'.bak';renameSync(_0x1c6607,_0x6a2fcb),logger[_0x44a552(0x181)](_0x2d48a6),logger['info'](_0x44a552(0x16d),'从旧配置文件升级成功',{'from':_0x1c6607,'to':_0x213cda,'appcode':_0x3bc1f6,'env':_0x33d673[_0x44a552(0x155)]}),console['log'](a141_0x1ebee7[_0x44a552(0x157)](_0x44a552(0x182)+_0xb9b0b2+_0x44a552(0x154))),console[_0x44a552(0x17d)](a141_0x1ebee7[_0x44a552(0x164)](_0x44a552(0x17b)+Object[_0x44a552(0x178)](_0x33d673[_0x44a552(0x16e)]||{})['join'](',\x20'))),console[_0x44a552(0x17d)](a141_0x1ebee7['cyan'](_0x44a552(0x176)+_0x33d673[_0x44a552(0x156)])),console[_0x44a552(0x17d)](a141_0x1ebee7['gray']('\x20\x20Old\x20file\x20backed\x20up\x20as\x20'+_0xb9b0b2+_0x44a552(0x161)));return;}const _0xdf08f0=_0x863a08||await askAppcode(),_0x5101cd=resolve(_0x2d48a6,NEW_CONFIG_NAME),_0x357e80=getCliVersionFromPkg(),_0x15a7ed=readRawConfig(),_0x4f237f=typeof _0x15a7ed['env']==='string'?_0x15a7ed['env']:undefined,_0x2ccd58=buildCanonicalProjectConfig({},{'appCodes':[_0xdf08f0],'env':_0x1fe7d9||_0x4f237f||'production','metadata':{'version':_0x357e80,'createdAt':new Date()[_0x44a552(0x153)]()}});writeConfigFile(_0x5101cd,_0x2ccd58),logger['setLogPath'](_0x2d48a6),logger[_0x44a552(0x167)](_0x44a552(0x16d),'初始化项目配置文件成功',{'appcode':_0xdf08f0,'env':_0x2ccd58['env'],'version':_0x2ccd58[_0x44a552(0x170)],'configPath':_0x5101cd}),console[_0x44a552(0x17d)](a141_0x1ebee7['green']('✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory')),console[_0x44a552(0x17d)](a141_0x1ebee7['cyan'](_0x44a552(0x17b)+Object[_0x44a552(0x178)](_0x2ccd58[_0x44a552(0x16e)]||{})[_0x44a552(0x16f)](',\x20'))),console[_0x44a552(0x17d)](a141_0x1ebee7[_0x44a552(0x164)](_0x44a552(0x176)+_0x2ccd58[_0x44a552(0x156)])),console[_0x44a552(0x17d)]('\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27'+CLI_BIN_NAME+_0x44a552(0x173)+CLI_BIN_NAME+_0x44a552(0x17f));}function askAppcode(){const _0x2fc920=a141_0x1bb0;return input({'message':_0x2fc920(0x158),'validate':_0x2259eb=>{const _0x2285c6=_0x2fc920;if(!_0x2259eb['trim']())return _0x2285c6(0x177);const {valid:_0x30eec6,message:_0x8e7378}=validateAppcode(_0x2259eb[_0x2285c6(0x16c)]());return _0x30eec6||_0x8e7378||_0x2285c6(0x172);}});}function getCliVersionFromPkg(){const _0x521e06=a141_0x1bb0;try{const _0x428ae0=fileURLToPath(import.meta.url),_0x34357e=resolve(dirname(_0x428ae0),_0x521e06(0x168)),_0x5ef1e7=JSON[_0x521e06(0x160)](readFileSync(resolve(_0x34357e,_0x521e06(0x16a)),'utf8'));return _0x5ef1e7['version']||_0x521e06(0x169);}catch{return _0x521e06(0x169);}}
1
+ (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 +1 @@
1
- const a142_0x572ac2=a142_0x4fa6;(function(_0x2b60e7,_0x1cc330){const _0x4e7f84=a142_0x4fa6,_0x47662a=_0x2b60e7();while(!![]){try{const _0x192ae4=parseInt(_0x4e7f84(0x215))/0x1+-parseInt(_0x4e7f84(0x223))/0x2+parseInt(_0x4e7f84(0x253))/0x3*(-parseInt(_0x4e7f84(0x225))/0x4)+-parseInt(_0x4e7f84(0x238))/0x5*(parseInt(_0x4e7f84(0x23b))/0x6)+parseInt(_0x4e7f84(0x240))/0x7+parseInt(_0x4e7f84(0x252))/0x8*(-parseInt(_0x4e7f84(0x232))/0x9)+parseInt(_0x4e7f84(0x207))/0xa;if(_0x192ae4===_0x1cc330)break;else _0x47662a['push'](_0x47662a['shift']());}catch(_0x424230){_0x47662a['push'](_0x47662a['shift']());}}}(a142_0x5cba,0xc1b73));function a142_0x4fa6(_0x111fef,_0xe28cb){_0x111fef=_0x111fef-0x1d1;const _0x5cba35=a142_0x5cba();let _0x4fa655=_0x5cba35[_0x111fef];return _0x4fa655;}import a142_0x36e0df from'chalk';import a142_0xd30bc5 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';function a142_0x5cba(){const _0x5e2b12=['dependencies','none\x20found','.bak','Step\x201/7:\x20Migrating\x20config...','length','\x20\x20#\x20or','Remove\x20old\x20skill','some','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','Step\x205/7:\x20Removing\x20old\x20skill...','object','@lovrabet/sdk','yes','undefined','error','done','hasNewConfig','log','.lovrabet','join','fail','19535050QOakUA','needed','Remove\x20legacy\x20artifacts','\x20\x20bun\x20install','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','start','bold','message','failed','parse','not\x20found\x20(will\x20create)','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','sdkUpgrade','package.json','1155834fopaao','\x20from\x20','includes','green','\x20\x20New\x20config\x20(.rabetbase.json):\x20','yellow','latest','status','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','stringify','cyan','Upgrade\x20completed\x20successfully!','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','configMigration','1793346VJoKjv','.claude/skills/lovrabet','4lcwAqA','filter','not\x20needed','isDirectory','red','string','no\x20legacy\x20config\x20found','.cursor/mcp.json','lovrabet/rabetbase','no\x20matching\x20entry\x20found','===\x20Upgrade\x20Summary\x20===','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','detail','9GKiXkl','keys','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','removed\x20','skipped\x20(no\x20legacy\x20config)','Proceed\x20with\x20upgrade?','5KjTjrZ','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','8042772mrlOor','.cursor/rules/lovrabet_rules.mdc','label','Upgrade\x20@lovrabet/sdk','needsSkillSwap','8085448AYIYTW','FAIL','info','step','\x20(backup:\x20','isArray','\x20removed\x20(','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','no\x20legacy\x20entry','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','skipped','Config\x20file:','Skill\x20swap:','MCP\x20config:','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','push','@lovrabet/sdk:','Step\x204/7:\x20Cleaning\x20MCP\x20config...','7438352pbmvkO','912045LkrLrU','entries','args','\x20\x20Current\x20version\x20in\x20','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','succeed','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','===\x20Upgrade\x20Analysis\x20===','oldPath','lovrabet/lovrabet-skill\x20removed','\x20\x20Fields\x20to\x20migrate:\x20','not\x20found\x20or\x20already\x20at\x20latest','[\x22@lovrabet/sdk\x22]:\x20','devDependencies','path','@lovrabet/dataset-mcp-server','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','inherit','Clean\x20MCP\x20config','Step\x201/7:\x20Config\x20migration\x20—\x20','utf8','\x20→\x20','mcpServers','gray','white','oldMcpConfig','Config\x20migration','\x20removed','exit\x20','lovrabet/rabetbase\x20installed\x20globally','FOUND','Upgrade\x20cancelled.','Legacy\x20artifacts:','CANCEL'];a142_0x5cba=function(){return _0x5e2b12;};return a142_0x5cba();}const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a142_0x572ac2(0x226)](_0x664310=>_0x664310!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x3ef03b){const _0xa6625=a142_0x572ac2,_0x55c4a3=[];for(const _0x609c67 of Object['values'](CORE_IDE_CONFIGS)){if(_0x609c67['files'])for(const _0x47a63f of _0x609c67['files']){_0x55c4a3['push'](resolve(_0x3ef03b,_0x47a63f[_0xa6625(0x1de)]));}}return _0x55c4a3;}function analyse(_0x1bc832){const _0x52c27a=a142_0x572ac2;let _0x52d122=null;const _0x1745ec=resolve(_0x1bc832,NEW_CONFIG_NAME),_0x330585=existsSync(_0x1745ec);for(const _0x29d3f7 of LEGACY_CONFIG_NAMES){const _0x3d84bd=resolve(_0x1bc832,_0x29d3f7);if(existsSync(_0x3d84bd)){const _0x2d3a46=readConfigFile(_0x3d84bd),_0x5c4e32=Object['keys'](_0x2d3a46)[_0x52c27a(0x226)](_0x3e838b=>typeof _0x2d3a46[_0x3e838b]!==_0x52c27a(0x1ff));_0x52d122={'oldPath':_0x3d84bd,'hasNewConfig':_0x330585,'fields':_0x5c4e32};break;}}const _0x21fded=[],_0x2537ee=resolve(_0x1bc832,_0x52c27a(0x204));if(existsSync(_0x2537ee))_0x21fded[_0x52c27a(0x24f)](_0x2537ee);const _0x2f3700=resolve(_0x1bc832,_0x52c27a(0x23c));if(existsSync(_0x2f3700))_0x21fded[_0x52c27a(0x24f)](_0x2f3700);const _0x1de4f3=resolve(_0x1bc832,_0x52c27a(0x224));if(existsSync(_0x1de4f3))_0x21fded[_0x52c27a(0x24f)](_0x1de4f3);for(const _0x577a69 of collectIdeSkillFiles(_0x1bc832)){if(existsSync(_0x577a69))_0x21fded[_0x52c27a(0x24f)](_0x577a69);}let _0x2a64a3=null;const _0x56bfd3=resolve(_0x1bc832,_0x52c27a(0x22c));if(existsSync(_0x56bfd3))try{const _0x1356f4=JSON[_0x52c27a(0x210)](readFileSync(_0x56bfd3,_0x52c27a(0x1e4)));if(_0x1356f4?.[_0x52c27a(0x1e6)]&&typeof _0x1356f4[_0x52c27a(0x1e6)]==='object'){const _0x5c5585=[];for(const [_0x4fb64f,_0x43f019]of Object[_0x52c27a(0x1d1)](_0x1356f4[_0x52c27a(0x1e6)])){const _0x2d4f4e=_0x43f019;_0x2d4f4e?.[_0x52c27a(0x1d2)]&&Array[_0x52c27a(0x245)](_0x2d4f4e[_0x52c27a(0x1d2)])&&_0x2d4f4e[_0x52c27a(0x1d2)][_0x52c27a(0x1f9)](_0xe17d1=>typeof _0xe17d1===_0x52c27a(0x22a)&&_0xe17d1[_0x52c27a(0x217)]('@lovrabet/dataset-mcp-server'))&&_0x5c5585[_0x52c27a(0x24f)](_0x4fb64f);}_0x5c5585[_0x52c27a(0x1f6)]>0x0&&(_0x2a64a3={'path':_0x56bfd3,'keys':_0x5c5585});}}catch{}const _0x2e173a=_0x21fded[_0x52c27a(0x1f6)]>0x0||_0x52d122!==null;let _0x45803e=null;const _0x38cad3=resolve(_0x1bc832,_0x52c27a(0x214));if(existsSync(_0x38cad3))try{const _0x1bf577=JSON[_0x52c27a(0x210)](readFileSync(_0x38cad3,'utf8'));for(const _0xd914d9 of[_0x52c27a(0x1f2),_0x52c27a(0x1dd)]){const _0x40deb5=_0x1bf577?.[_0xd914d9]?.[_0x52c27a(0x1fd)];if(typeof _0x40deb5===_0x52c27a(0x22a)){_0x40deb5!==_0x52c27a(0x21b)&&(_0x45803e={'pkgPath':_0x38cad3,'currentVersion':_0x40deb5,'field':_0xd914d9});break;}}}catch{}return{'configMigration':_0x52d122,'oldArtifacts':_0x21fded,'oldMcpConfig':_0x2a64a3,'needsSkillSwap':_0x2e173a,'sdkUpgrade':_0x45803e};}function printReport(_0x5ccae9){const _0x2b9716=a142_0x572ac2,{configMigration:_0x38b096,oldArtifacts:_0xd719e1,oldMcpConfig:_0x3c6129,needsSkillSwap:_0xdf3b64}=_0x5ccae9;console[_0x2b9716(0x203)](''),console[_0x2b9716(0x203)](a142_0x36e0df[_0x2b9716(0x20d)](_0x2b9716(0x1d7))),console[_0x2b9716(0x203)]('');_0x38b096?(console[_0x2b9716(0x203)](a142_0x36e0df[_0x2b9716(0x21f)]('Config\x20file:')+('\x20\x20'+a142_0x36e0df[_0x2b9716(0x21a)](_0x38b096[_0x2b9716(0x1d8)]))),console[_0x2b9716(0x203)](_0x2b9716(0x219)+(_0x38b096['hasNewConfig']?a142_0x36e0df[_0x2b9716(0x218)]('already\x20exists\x20(will\x20merge)'):a142_0x36e0df[_0x2b9716(0x1e7)](_0x2b9716(0x211)))),console[_0x2b9716(0x203)](_0x2b9716(0x1da)+_0x38b096['fields'][_0x2b9716(0x205)](',\x20')),console[_0x2b9716(0x203)](_0x2b9716(0x230))):console[_0x2b9716(0x203)](a142_0x36e0df[_0x2b9716(0x21f)](_0x2b9716(0x24b))+'\x20\x20'+a142_0x36e0df[_0x2b9716(0x1e7)](_0x2b9716(0x22b)));console[_0x2b9716(0x203)]('');if(_0xd719e1['length']>0x0){console[_0x2b9716(0x203)](a142_0x36e0df['cyan'](_0x2b9716(0x1f0)));for(const _0x5ccc5d of _0xd719e1){console[_0x2b9716(0x203)]('\x20\x20'+a142_0x36e0df[_0x2b9716(0x229)](_0x2b9716(0x1ee))+'\x20\x20'+_0x5ccc5d);}console['log']('\x20\x20Action:\x20delete');}else console[_0x2b9716(0x203)](a142_0x36e0df[_0x2b9716(0x21f)](_0x2b9716(0x1f0))+'\x20\x20'+a142_0x36e0df[_0x2b9716(0x1e7)](_0x2b9716(0x1f3)));console['log']('');_0x3c6129?(console[_0x2b9716(0x203)](a142_0x36e0df['cyan'](_0x2b9716(0x24d))+('\x20\x20'+a142_0x36e0df['yellow'](_0x3c6129[_0x2b9716(0x1de)])+'\x20→\x20keys:\x20'+_0x3c6129[_0x2b9716(0x233)]['join'](',\x20'))),console[_0x2b9716(0x203)](_0x2b9716(0x212))):console[_0x2b9716(0x203)](a142_0x36e0df['cyan'](_0x2b9716(0x24d))+'\x20\x20'+a142_0x36e0df[_0x2b9716(0x1e7)](_0x2b9716(0x248)));console[_0x2b9716(0x203)](''),console[_0x2b9716(0x203)](a142_0x36e0df['cyan'](_0x2b9716(0x24c))+('\x20\x20'+(_0xdf3b64?a142_0x36e0df['yellow'](_0x2b9716(0x208)):a142_0x36e0df[_0x2b9716(0x218)](_0x2b9716(0x227)))));_0xdf3b64&&console['log'](_0x2b9716(0x1d4)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x2b9716(0x203)]('');if(_0x5ccae9[_0x2b9716(0x213)]){const {currentVersion:_0x4bf27a,field:_0x2c09d6,pkgPath:_0x32c975}=_0x5ccae9[_0x2b9716(0x213)];console[_0x2b9716(0x203)](a142_0x36e0df[_0x2b9716(0x21f)]('@lovrabet/sdk:')+('\x20\x20'+a142_0x36e0df[_0x2b9716(0x21a)](_0x32c975))),console['log'](_0x2b9716(0x1d3)+_0x2c09d6+':\x20'+a142_0x36e0df[_0x2b9716(0x21a)](_0x4bf27a)+_0x2b9716(0x1e5)+a142_0x36e0df[_0x2b9716(0x218)](_0x2b9716(0x21b))),console[_0x2b9716(0x203)](_0x2b9716(0x20b));}else console[_0x2b9716(0x203)](a142_0x36e0df[_0x2b9716(0x21f)](_0x2b9716(0x250))+'\x20\x20'+a142_0x36e0df['gray'](_0x2b9716(0x1db)));console[_0x2b9716(0x203)]('');}function execConfigMigration(_0x342411,_0x2510f7){const _0x30f273=a142_0x572ac2,{configMigration:_0x5b2c8a}=_0x342411;if(!_0x5b2c8a?.['oldPath'])return{'step':0x1,'label':_0x30f273(0x1ea),'ok':!![],'detail':_0x30f273(0x236)};const _0x207ab1=readConfigFile(_0x5b2c8a[_0x30f273(0x1d8)]),_0x3b1123=resolve(_0x2510f7,NEW_CONFIG_NAME),_0x393de5=_0x5b2c8a[_0x30f273(0x202)]?readConfigFile(_0x3b1123):{};for(const [_0x3c89f7,_0x17efa0]of Object['entries'](_0x207ab1)){!(_0x3c89f7 in _0x393de5)&&(_0x393de5[_0x3c89f7]=_0x17efa0);}writeConfigFile(_0x3b1123,_0x393de5);const _0x4bf4b2=_0x5b2c8a['oldPath']+_0x30f273(0x1f4);return renameSync(_0x5b2c8a[_0x30f273(0x1d8)],_0x4bf4b2),{'step':0x1,'label':_0x30f273(0x1ea),'ok':!![],'detail':_0x5b2c8a['oldPath']+_0x30f273(0x1e5)+_0x3b1123+_0x30f273(0x244)+_0x4bf4b2+')'};}function execRemoveOldArtifacts(_0x4e3405){const _0x3c90cb=a142_0x572ac2,_0x4eb70e=[];for(const _0x24d31f of _0x4e3405){try{if(!existsSync(_0x24d31f))continue;const _0x484220=tryStat(_0x24d31f);_0x484220?.[_0x3c90cb(0x228)]()?rmSync(_0x24d31f,{'recursive':!![],'force':!![]}):unlinkSync(_0x24d31f);}catch(_0x47463d){_0x4eb70e[_0x3c90cb(0x24f)](_0x24d31f+':\x20'+_0x47463d['message']);}}return{'step':0x3,'label':_0x3c90cb(0x209),'ok':_0x4eb70e[_0x3c90cb(0x1f6)]===0x0,'detail':_0x4eb70e[_0x3c90cb(0x1f6)]>0x0?_0x4e3405['length']-_0x4eb70e[_0x3c90cb(0x1f6)]+'/'+_0x4e3405[_0x3c90cb(0x1f6)]+_0x3c90cb(0x246)+_0x4eb70e['join'](';\x20')+')':_0x4e3405[_0x3c90cb(0x1f6)]+_0x3c90cb(0x1eb)};}function execCleanMcp(_0x5d689c){const _0x4e12ee=a142_0x572ac2;if(!_0x5d689c['oldMcpConfig'])return{'step':0x4,'label':_0x4e12ee(0x1e2),'ok':!![],'detail':'skipped'};try{const _0x1d93b5=readFileSync(_0x5d689c[_0x4e12ee(0x1e9)][_0x4e12ee(0x1de)],_0x4e12ee(0x1e4)),_0xdd4637=JSON[_0x4e12ee(0x210)](_0x1d93b5);if(_0xdd4637?.[_0x4e12ee(0x1e6)]&&typeof _0xdd4637[_0x4e12ee(0x1e6)]===_0x4e12ee(0x1fc)){const _0x1e7d10=[];for(const [_0x2fad82,_0x3e49c5]of Object[_0x4e12ee(0x1d1)](_0xdd4637[_0x4e12ee(0x1e6)])){_0x3e49c5?.[_0x4e12ee(0x1d2)]&&Array[_0x4e12ee(0x245)](_0x3e49c5[_0x4e12ee(0x1d2)])&&_0x3e49c5[_0x4e12ee(0x1d2)]['some'](_0x623b20=>typeof _0x623b20===_0x4e12ee(0x22a)&&_0x623b20[_0x4e12ee(0x217)](_0x4e12ee(0x1df)))&&_0x1e7d10[_0x4e12ee(0x24f)](_0x2fad82);}for(const _0x5b481e of _0x1e7d10){delete _0xdd4637[_0x4e12ee(0x1e6)][_0x5b481e];}return _0x1e7d10[_0x4e12ee(0x1f6)]>0x0&&writeFileSync(_0x5d689c[_0x4e12ee(0x1e9)][_0x4e12ee(0x1de)],JSON['stringify'](_0xdd4637,null,0x2)+'\x0a',_0x4e12ee(0x1e4)),{'step':0x4,'label':_0x4e12ee(0x1e2),'ok':!![],'detail':_0x4e12ee(0x235)+_0x1e7d10[_0x4e12ee(0x205)](',\x20')+_0x4e12ee(0x216)+_0x5d689c[_0x4e12ee(0x1e9)][_0x4e12ee(0x1de)]};}return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x4e12ee(0x22e)};}catch(_0x22248b){return{'step':0x4,'label':_0x4e12ee(0x1e2),'ok':![],'detail':_0x22248b[_0x4e12ee(0x20e)]};}}function execSkillsRemove(_0x2e5150,_0x395756){const _0x213304=a142_0x572ac2,_0x5f1ce7=runNpxSkillsRemove(_0x2e5150,{'stdio':'inherit','yes':_0x395756});return{'step':0x5,'label':_0x213304(0x1f8),'ok':_0x5f1ce7['ok'],'detail':_0x5f1ce7['ok']?_0x213304(0x1d9):_0x5f1ce7[_0x213304(0x200)]??_0x213304(0x1ec)+_0x5f1ce7[_0x213304(0x21c)]};}function execSkillsAdd(_0x5981e1,_0x2a9c73){const _0x172bda=a142_0x572ac2,_0x22eeac=runNpxSkillsAddGlobal(_0x5981e1,_0x172bda(0x22d),{'stdio':_0x172bda(0x1e1),'yes':_0x2a9c73});return{'step':0x6,'label':'Install\x20new\x20skill','ok':_0x22eeac['ok'],'detail':_0x22eeac['ok']?_0x172bda(0x1ed):_0x22eeac['error']??_0x172bda(0x1ec)+_0x22eeac['status']};}function execUpgradeSdk(_0x263536){const _0x4f75c6=a142_0x572ac2;if(!_0x263536[_0x4f75c6(0x213)])return{'step':0x7,'label':_0x4f75c6(0x23e),'ok':!![],'detail':_0x4f75c6(0x247)};const {pkgPath:_0x1ca1af,currentVersion:_0x37990c,field:_0x40bd0e}=_0x263536[_0x4f75c6(0x213)];try{const _0x32cf75=readFileSync(_0x1ca1af,'utf8'),_0xd00559=JSON['parse'](_0x32cf75);return _0xd00559[_0x40bd0e][_0x4f75c6(0x1fd)]=_0x4f75c6(0x21b),writeFileSync(_0x1ca1af,JSON[_0x4f75c6(0x21e)](_0xd00559,null,0x2)+'\x0a',_0x4f75c6(0x1e4)),{'step':0x7,'label':_0x4f75c6(0x23e),'ok':!![],'detail':_0x40bd0e+_0x4f75c6(0x1dc)+_0x37990c+'\x20→\x20latest'};}catch(_0x58b877){return{'step':0x7,'label':_0x4f75c6(0x23e),'ok':![],'detail':_0x58b877['message']};}}function tryStat(_0x4b084a){try{return statSync(_0x4b084a);}catch{return undefined;}}function printSummary(_0x30402e){const _0x12a5b0=a142_0x572ac2;console[_0x12a5b0(0x203)](''),console[_0x12a5b0(0x203)](a142_0x36e0df['bold'](_0x12a5b0(0x22f))),console[_0x12a5b0(0x203)]('');for(const _0x1b18f2 of _0x30402e){const _0x276f3e=_0x1b18f2['ok']?a142_0x36e0df[_0x12a5b0(0x218)]('OK'):a142_0x36e0df[_0x12a5b0(0x229)](_0x12a5b0(0x241));console[_0x12a5b0(0x203)]('\x20\x20'+_0x276f3e+'\x20\x20Step\x20'+_0x1b18f2[_0x12a5b0(0x243)]+':\x20'+_0x1b18f2[_0x12a5b0(0x23d)]);if(_0x1b18f2[_0x12a5b0(0x231)])console[_0x12a5b0(0x203)]('\x20\x20\x20\x20\x20\x20\x20'+a142_0x36e0df[_0x12a5b0(0x1e7)](_0x1b18f2['detail']));}console[_0x12a5b0(0x203)]('');}export async function upgradeApp(_0x1299ba,_0x46a05b){const _0xe44ab8=a142_0x572ac2,_0x5183db=process['cwd'](),_0x1da033=analyse(_0x5183db),_0x3ec2ac=!_0x1da033[_0xe44ab8(0x222)]&&_0x1da033['oldArtifacts']['length']===0x0&&!_0x1da033[_0xe44ab8(0x1e9)]&&!_0x1da033[_0xe44ab8(0x23f)]&&!_0x1da033[_0xe44ab8(0x213)];if(_0x3ec2ac){console[_0xe44ab8(0x203)](a142_0x36e0df[_0xe44ab8(0x218)]('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0x1da033);const _0x49b97d=!!(_0x46a05b[_0xe44ab8(0x1fe)]||_0x46a05b['Y']||_0x1299ba);if(!_0x49b97d)try{const _0x2d23f8=await askConfirm(_0xe44ab8(0x237));if(!_0x2d23f8){console[_0xe44ab8(0x203)](a142_0x36e0df[_0xe44ab8(0x1e7)](_0xe44ab8(0x1ef)));return;}}catch(_0x3818de){if(_0x3818de?.[_0xe44ab8(0x20e)]===_0xe44ab8(0x1f1)){console['log'](a142_0x36e0df[_0xe44ab8(0x1e7)](_0xe44ab8(0x1ef)));return;}throw _0x3818de;}const _0x219b10=[],_0x4e4af9=a142_0xd30bc5({'text':_0xe44ab8(0x1f5),'color':_0xe44ab8(0x21f)})[_0xe44ab8(0x20c)](),_0xea10b1=execConfigMigration(_0x1da033,_0x5183db);_0x219b10[_0xe44ab8(0x24f)](_0xea10b1),_0x4e4af9[_0xea10b1['ok']?_0xe44ab8(0x1d5):'fail'](_0xe44ab8(0x1e3)+(_0xea10b1['detail']??(_0xea10b1['ok']?_0xe44ab8(0x201):_0xe44ab8(0x20f))));const _0x49df23=resolve(_0x5183db,'.lovrabet'),_0x43a070=a142_0xd30bc5({'text':'Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','color':_0xe44ab8(0x21f)})[_0xe44ab8(0x20c)]();if(existsSync(_0x49df23))try{rmSync(_0x49df23,{'recursive':!![],'force':!![]}),_0x43a070['succeed'](_0xe44ab8(0x1e0)),_0x219b10[_0xe44ab8(0x24f)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x28f5b0){_0x43a070['fail'](_0xe44ab8(0x239)+_0x28f5b0[_0xe44ab8(0x20e)]),_0x219b10[_0xe44ab8(0x24f)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':![],'detail':_0x28f5b0[_0xe44ab8(0x20e)]});}else _0x43a070[_0xe44ab8(0x242)](_0xe44ab8(0x1d6)),_0x219b10[_0xe44ab8(0x24f)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![],'detail':_0xe44ab8(0x24a)});const _0x5456a8=a142_0xd30bc5({'text':'Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':'cyan'})[_0xe44ab8(0x20c)](),_0x73afea=execRemoveOldArtifacts(_0x1da033['oldArtifacts']);_0x219b10[_0xe44ab8(0x24f)](_0x73afea),_0x5456a8[_0x73afea['ok']?'succeed':'fail'](_0xe44ab8(0x234)+(_0x73afea[_0xe44ab8(0x231)]??(_0x73afea['ok']?'done':'failed')));const _0x159239=a142_0xd30bc5({'text':_0xe44ab8(0x251),'color':_0xe44ab8(0x21f)})[_0xe44ab8(0x20c)](),_0x6bcceb=execCleanMcp(_0x1da033);_0x219b10[_0xe44ab8(0x24f)](_0x6bcceb),_0x159239[_0x6bcceb['ok']?'succeed':_0xe44ab8(0x206)]('Step\x204/7:\x20MCP\x20config\x20—\x20'+(_0x6bcceb[_0xe44ab8(0x231)]??(_0x6bcceb['ok']?'done':'failed')));const _0x443af7=a142_0xd30bc5({'text':_0xe44ab8(0x1fb),'color':_0xe44ab8(0x21f)})[_0xe44ab8(0x20c)](),_0xd839cd=execSkillsRemove(_0x5183db,_0x49b97d);_0x219b10[_0xe44ab8(0x24f)](_0xd839cd),_0x443af7[_0xd839cd['ok']?_0xe44ab8(0x1d5):_0xe44ab8(0x206)](_0xe44ab8(0x21d)+(_0xd839cd['detail']??(_0xd839cd['ok']?_0xe44ab8(0x201):_0xe44ab8(0x20f))));const _0x3dbbb8=a142_0xd30bc5({'text':'Step\x206/7:\x20Installing\x20new\x20skill...','color':_0xe44ab8(0x21f)})['start'](),_0x3a5bc4=execSkillsAdd(_0x5183db,_0x49b97d);_0x219b10[_0xe44ab8(0x24f)](_0x3a5bc4),_0x3dbbb8[_0x3a5bc4['ok']?_0xe44ab8(0x1d5):_0xe44ab8(0x206)](_0xe44ab8(0x1fa)+(_0x3a5bc4['detail']??(_0x3a5bc4['ok']?'done':_0xe44ab8(0x20f))));const _0x76040e=a142_0xd30bc5({'text':_0xe44ab8(0x23a),'color':_0xe44ab8(0x21f)})[_0xe44ab8(0x20c)](),_0x2abd21=execUpgradeSdk(_0x1da033);_0x219b10[_0xe44ab8(0x24f)](_0x2abd21),_0x76040e[_0x2abd21['ok']?_0xe44ab8(0x1d5):_0xe44ab8(0x206)]('Step\x207/7:\x20@lovrabet/sdk\x20—\x20'+(_0x2abd21[_0xe44ab8(0x231)]??(_0x2abd21['ok']?'done':_0xe44ab8(0x20f)))),printSummary(_0x219b10);const _0x204d40=_0x219b10[_0xe44ab8(0x1f9)](_0x4a9bda=>!_0x4a9bda['ok']);_0x204d40?console['log'](a142_0x36e0df[_0xe44ab8(0x21a)](_0xe44ab8(0x24e))):console[_0xe44ab8(0x203)](a142_0x36e0df[_0xe44ab8(0x218)](_0xe44ab8(0x220))),_0x2abd21['ok']&&_0x1da033[_0xe44ab8(0x213)]&&(console[_0xe44ab8(0x203)](''),console['log'](a142_0x36e0df[_0xe44ab8(0x20d)][_0xe44ab8(0x21f)](_0xe44ab8(0x249))),console[_0xe44ab8(0x203)](a142_0x36e0df[_0xe44ab8(0x21f)](_0xe44ab8(0x221))),console[_0xe44ab8(0x203)](''),console[_0xe44ab8(0x203)](a142_0x36e0df['white']('\x20\x20npm\x20install')),console[_0xe44ab8(0x203)](a142_0x36e0df[_0xe44ab8(0x1e8)](_0xe44ab8(0x1f7))),console[_0xe44ab8(0x203)](a142_0x36e0df[_0xe44ab8(0x1e8)](_0xe44ab8(0x20a))),console['log'](''));}
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)](''));}