@lovrabet/rabetbase-cli 2.3.15-beta.1 → 2.3.15

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 (264) 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/async-task.js +1 -1
  48. package/lib/commands/common/dry-run.js +1 -1
  49. package/lib/commands/common/flags.js +1 -1
  50. package/lib/commands/common/local-file.js +1 -1
  51. package/lib/commands/common/validate.js +1 -1
  52. package/lib/commands/config/get.js +1 -1
  53. package/lib/commands/config/index.js +1 -1
  54. package/lib/commands/config/list.js +1 -1
  55. package/lib/commands/config/set.js +1 -1
  56. package/lib/commands/config/shared.js +1 -1
  57. package/lib/commands/data/filter.js +1 -1
  58. package/lib/commands/data/getOne.js +1 -1
  59. package/lib/commands/data/index.js +1 -1
  60. package/lib/commands/data/shared.js +1 -1
  61. package/lib/commands/dataset/business-group-update.js +1 -1
  62. package/lib/commands/dataset/capability.js +1 -1
  63. package/lib/commands/dataset/delete.js +1 -1
  64. package/lib/commands/dataset/detail.js +1 -1
  65. package/lib/commands/dataset/extend-update.js +1 -1
  66. package/lib/commands/dataset/field-update.js +1 -1
  67. package/lib/commands/dataset/generate.js +1 -1
  68. package/lib/commands/dataset/index.js +1 -1
  69. package/lib/commands/dataset/list.js +1 -1
  70. package/lib/commands/dataset/operations.js +1 -1
  71. package/lib/commands/dataset/relation-audit.js +1 -1
  72. package/lib/commands/dataset/relation-create.js +1 -1
  73. package/lib/commands/dataset/relation-delete.js +1 -1
  74. package/lib/commands/dataset/relation-shared.js +1 -1
  75. package/lib/commands/dataset/relation-update.js +1 -1
  76. package/lib/commands/dataset/relations.js +1 -1
  77. package/lib/commands/dataset/rename.js +1 -1
  78. package/lib/commands/dataset/restore.js +1 -1
  79. package/lib/commands/db/analysis-batching.js +1 -1
  80. package/lib/commands/db/analyze-batch-plan.js +1 -1
  81. package/lib/commands/db/analyze-cancel.js +1 -1
  82. package/lib/commands/db/analyze-start.js +1 -1
  83. package/lib/commands/db/analyze-status.js +1 -1
  84. package/lib/commands/db/create.js +1 -1
  85. package/lib/commands/db/delete.js +1 -1
  86. package/lib/commands/db/detail.js +1 -1
  87. package/lib/commands/db/diff.js +1 -1
  88. package/lib/commands/db/index.js +1 -1
  89. package/lib/commands/db/list.js +1 -1
  90. package/lib/commands/db/shared.js +1 -1
  91. package/lib/commands/db/tables.js +1 -1
  92. package/lib/commands/db/test.js +1 -1
  93. package/lib/commands/db/update.js +1 -1
  94. package/lib/commands/doctor.js +1 -1
  95. package/lib/commands/file/index.js +1 -1
  96. package/lib/commands/init/index.js +1 -1
  97. package/lib/commands/issue/index.js +1 -1
  98. package/lib/commands/issue/nudge.js +1 -1
  99. package/lib/commands/issue/report.js +1 -1
  100. package/lib/commands/issue/shared.js +1 -1
  101. package/lib/commands/logs/index.js +1 -1
  102. package/lib/commands/menu/asset-update.js +1 -1
  103. package/lib/commands/menu/delete.js +1 -1
  104. package/lib/commands/menu/external-link-create.js +1 -1
  105. package/lib/commands/menu/external-link-update.js +1 -1
  106. package/lib/commands/menu/group-create.js +1 -1
  107. package/lib/commands/menu/group-update.js +1 -1
  108. package/lib/commands/menu/index.js +1 -1
  109. package/lib/commands/menu/list.js +1 -1
  110. package/lib/commands/menu/move.js +1 -1
  111. package/lib/commands/menu/regroup-start.js +1 -1
  112. package/lib/commands/menu/rename.js +1 -0
  113. package/lib/commands/menu/shared/compare-table.js +1 -1
  114. package/lib/commands/menu/shared/delete-plan.js +1 -1
  115. package/lib/commands/menu/shared/facts.js +1 -1
  116. package/lib/commands/menu/shared/index.js +1 -1
  117. package/lib/commands/menu/shared/inquirer.js +1 -1
  118. package/lib/commands/menu/shared/local-pages.js +1 -1
  119. package/lib/commands/menu/shared/logic.js +1 -1
  120. package/lib/commands/menu/shared/mutations.js +1 -1
  121. package/lib/commands/menu/shared/service.js +1 -1
  122. package/lib/commands/menu/shared/sync-core.js +1 -1
  123. package/lib/commands/menu/shared/update-core.js +1 -1
  124. package/lib/commands/menu/shared/valid-url.js +1 -1
  125. package/lib/commands/menu/sync.js +1 -1
  126. package/lib/commands/notification/config-list.js +1 -1
  127. package/lib/commands/notification/index.js +1 -1
  128. package/lib/commands/ocr/index.js +1 -1
  129. package/lib/commands/page/generate-start.js +1 -1
  130. package/lib/commands/page/generate-status.js +1 -1
  131. package/lib/commands/page/index.js +1 -1
  132. package/lib/commands/page/pull.js +1 -1
  133. package/lib/commands/page/push.js +1 -1
  134. package/lib/commands/page/relation-audit.js +1 -1
  135. package/lib/commands/page/restore.js +1 -1
  136. package/lib/commands/page/shared.js +1 -1
  137. package/lib/commands/page/standard-page-status.js +1 -1
  138. package/lib/commands/page/sync.js +1 -1
  139. package/lib/commands/permit/index.js +1 -1
  140. package/lib/commands/permit/page-get.js +1 -1
  141. package/lib/commands/permit/page-set.js +1 -1
  142. package/lib/commands/permit/role-apis-set.js +1 -1
  143. package/lib/commands/permit/role-menus-set.js +1 -1
  144. package/lib/commands/permit/role-menus.js +1 -1
  145. package/lib/commands/permit/shared.js +1 -1
  146. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  147. package/lib/commands/project/create/format-elapsed.js +1 -1
  148. package/lib/commands/project/create/main.js +1 -1
  149. package/lib/commands/project/create/non-interactive.js +1 -1
  150. package/lib/commands/project/create/project-template-path.js +1 -1
  151. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  152. package/lib/commands/project/create/use-format-code.js +1 -1
  153. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  154. package/lib/commands/project/index.js +1 -1
  155. package/lib/commands/project/init.js +1 -1
  156. package/lib/commands/project/upgrade.js +1 -1
  157. package/lib/commands/registry.js +1 -1
  158. package/lib/commands/role/create.js +1 -1
  159. package/lib/commands/role/delete.js +1 -1
  160. package/lib/commands/role/detail.js +1 -1
  161. package/lib/commands/role/index.js +1 -1
  162. package/lib/commands/role/list.js +1 -1
  163. package/lib/commands/role/shared.js +1 -1
  164. package/lib/commands/role/update.js +1 -1
  165. package/lib/commands/role/user-add.js +1 -1
  166. package/lib/commands/role/user-remove.js +1 -1
  167. package/lib/commands/role/user-resolve.js +1 -1
  168. package/lib/commands/run/index.js +1 -1
  169. package/lib/commands/schema.js +1 -1
  170. package/lib/commands/sql/create.js +1 -1
  171. package/lib/commands/sql/delete.js +1 -1
  172. package/lib/commands/sql/detail.js +1 -1
  173. package/lib/commands/sql/exec.js +1 -1
  174. package/lib/commands/sql/index.js +1 -1
  175. package/lib/commands/sql/list.js +1 -1
  176. package/lib/commands/sql/pull.js +1 -1
  177. package/lib/commands/sql/push.js +1 -1
  178. package/lib/commands/sql/save.js +1 -1
  179. package/lib/commands/sql/shared.js +1 -1
  180. package/lib/commands/sql/status.js +1 -1
  181. package/lib/commands/sql/validate.js +1 -1
  182. package/lib/commands/task/index.js +1 -1
  183. package/lib/commands/task/status.js +1 -1
  184. package/lib/commands/workspace/add.js +1 -1
  185. package/lib/commands/workspace/index.js +1 -1
  186. package/lib/commands/workspace/remove.js +1 -1
  187. package/lib/config/schema.js +1 -1
  188. package/lib/constant/cdn.js +1 -1
  189. package/lib/constant/cli.js +1 -1
  190. package/lib/constant/defaults.js +1 -1
  191. package/lib/constant/domain.js +1 -1
  192. package/lib/constant/env.js +1 -1
  193. package/lib/constant/output.js +1 -1
  194. package/lib/constant/paths.js +1 -1
  195. package/lib/constant/risk.js +1 -1
  196. package/lib/context/app-resolver.js +1 -1
  197. package/lib/context/auth-resolver.js +1 -1
  198. package/lib/context/config-loader.js +1 -1
  199. package/lib/context.js +1 -1
  200. package/lib/core/alias-resolver.js +1 -1
  201. package/lib/core/api-client.js +1 -1
  202. package/lib/core/bff/config.js +1 -1
  203. package/lib/core/bff/file-system.js +1 -1
  204. package/lib/core/bff/hash.js +1 -1
  205. package/lib/core/bff/lock.js +1 -1
  206. package/lib/core/bff/utils.js +1 -1
  207. package/lib/core/db-resolver.js +1 -1
  208. package/lib/core/page/file-system.js +1 -1
  209. package/lib/core/page/hash.js +1 -1
  210. package/lib/core/page/lock.js +1 -1
  211. package/lib/core/sql-index-auditor.js +1 -1
  212. package/lib/core/sql-sync/config.js +1 -1
  213. package/lib/core/sql-sync/file-system.js +1 -1
  214. package/lib/core/sql-sync/hash.js +1 -1
  215. package/lib/core/sql-sync/lock.js +1 -1
  216. package/lib/core/sql-sync/utils.js +1 -1
  217. package/lib/core/sql-validator.js +1 -1
  218. package/lib/errors.js +1 -1
  219. package/lib/framework/build-all-flags.js +1 -1
  220. package/lib/framework/error-output.js +1 -1
  221. package/lib/framework/explicit-yes.js +1 -1
  222. package/lib/framework/flags.js +1 -1
  223. package/lib/framework/help.js +1 -1
  224. package/lib/framework/index.js +1 -1
  225. package/lib/framework/output.js +1 -1
  226. package/lib/framework/response.js +1 -1
  227. package/lib/framework/runner-alias.js +1 -1
  228. package/lib/framework/runner.js +1 -1
  229. package/lib/framework/schema-export.js +1 -1
  230. package/lib/framework/types.js +1 -1
  231. package/lib/generated/build-info.js +1 -1
  232. package/lib/help.js +1 -1
  233. package/lib/skills/main.js +1 -1
  234. package/lib/skills/npx-skills-add.js +1 -1
  235. package/lib/telemetry/cli-command-trace.js +1 -1
  236. package/lib/telemetry/cli-help-trace.js +1 -1
  237. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  238. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  239. package/lib/telemetry/send-cli-trace-log.js +1 -1
  240. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  241. package/lib/utils/ai_config.js +1 -1
  242. package/lib/utils/apply-jq-filter.js +1 -1
  243. package/lib/utils/cdn-config.js +1 -1
  244. package/lib/utils/check-sdk-version.js +1 -1
  245. package/lib/utils/cli-version-check.js +1 -1
  246. package/lib/utils/cli-version-policy.js +1 -1
  247. package/lib/utils/config.js +1 -1
  248. package/lib/utils/copy-directory.js +1 -1
  249. package/lib/utils/entity-with-id.js +1 -1
  250. package/lib/utils/file-utils.js +1 -1
  251. package/lib/utils/guides-cdn.js +1 -1
  252. package/lib/utils/http-client.js +1 -1
  253. package/lib/utils/is-non-interactive.js +1 -1
  254. package/lib/utils/logger.js +1 -1
  255. package/lib/utils/params.js +1 -1
  256. package/lib/utils/platform.js +1 -1
  257. package/lib/utils/rules-cdn.js +1 -1
  258. package/lib/utils/sleep.js +1 -1
  259. package/lib/utils/template-replacer.js +1 -1
  260. package/lib/utils/update-notice.js +1 -1
  261. package/lib/utils/version.js +1 -1
  262. package/lib/utils/with-active-cookie.js +1 -1
  263. package/lib/utils/write-cli-side-channel.js +1 -1
  264. package/package.json +1 -1
@@ -1 +1 @@
1
- const a144_0x565bb6=a144_0x3aee;(function(_0x40cb43,_0x3b8d18){const _0x27888b=a144_0x3aee,_0x53cc7f=_0x40cb43();while(!![]){try{const _0x2396b0=parseInt(_0x27888b(0x11f))/0x1*(parseInt(_0x27888b(0x123))/0x2)+-parseInt(_0x27888b(0xed))/0x3*(-parseInt(_0x27888b(0x122))/0x4)+parseInt(_0x27888b(0x12a))/0x5+-parseInt(_0x27888b(0x131))/0x6+-parseInt(_0x27888b(0xf5))/0x7*(-parseInt(_0x27888b(0x121))/0x8)+-parseInt(_0x27888b(0xea))/0x9+parseInt(_0x27888b(0x109))/0xa;if(_0x2396b0===_0x3b8d18)break;else _0x53cc7f['push'](_0x53cc7f['shift']());}catch(_0x691b96){_0x53cc7f['push'](_0x53cc7f['shift']());}}}(a144_0x2b2c,0x93c2b));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a144_0x565bb6(0x112),'type':a144_0x565bb6(0x133),'required':!![],'description':a144_0x565bb6(0xf1)};function a144_0x3aee(_0x4ae8ff,_0x3489b1){_0x4ae8ff=_0x4ae8ff-0xe1;const _0x2b2cb4=a144_0x2b2c();let _0x3aeeaa=_0x2b2cb4[_0x4ae8ff];return _0x3aeeaa;}export const ROLE_REF_FLAG={'name':a144_0x565bb6(0x117),'type':'string','required':!![],'description':a144_0x565bb6(0x116)};export const GRANT_FLAG={'name':a144_0x565bb6(0xec),'type':'boolean','required':![],'description':a144_0x565bb6(0x132)};export const REVOKE_FLAG={'name':a144_0x565bb6(0x114),'type':a144_0x565bb6(0xe6),'required':![],'description':a144_0x565bb6(0x10a)};export const MENUS_FLAG={'name':a144_0x565bb6(0x11e),'type':a144_0x565bb6(0x111),'required':!![],'description':a144_0x565bb6(0x12c)};export const DATASETS_FLAG={'name':'datasets','type':a144_0x565bb6(0x111),'required':!![],'description':a144_0x565bb6(0x101)};export const PAGE_SLOT_SPECS=[{'flag':'menu-roles','key':a144_0x565bb6(0x100),'allowSelf':![],'label':a144_0x565bb6(0xf0)},{'flag':a144_0x565bb6(0x130),'key':a144_0x565bb6(0x11a),'allowSelf':![],'label':a144_0x565bb6(0xee)},{'flag':'update-roles','key':a144_0x565bb6(0x127),'allowSelf':![],'label':'data\x20update'},{'flag':a144_0x565bb6(0x11b),'key':a144_0x565bb6(0x12d),'allowSelf':![],'label':a144_0x565bb6(0x103)},{'flag':a144_0x565bb6(0xff),'key':'dataDetail','allowSelf':![],'label':a144_0x565bb6(0x12b)},{'flag':a144_0x565bb6(0x115),'key':a144_0x565bb6(0xf2),'allowSelf':![],'label':a144_0x565bb6(0x11d)},{'flag':'row-roles','key':a144_0x565bb6(0xeb),'allowSelf':!![],'label':a144_0x565bb6(0xe3)}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a144_0x565bb6(0xe1)](_0x187a34=>({'name':_0x187a34[a144_0x565bb6(0x10d)],'type':a144_0x565bb6(0x111),'required':![],'description':a144_0x565bb6(0xf8)+_0x187a34[a144_0x565bb6(0xf3)]+'\x20(comma-separated\x20SELF/ALL/id/name)'+(_0x187a34[a144_0x565bb6(0x105)]?';\x20SELF\x20=\x20only\x20own\x20rows':'')}));export function splitList(_0x71d3f1){const _0x1bc61a=a144_0x565bb6;return _0x71d3f1[_0x1bc61a(0xfa)](',')['map'](_0x37366c=>_0x37366c[_0x1bc61a(0x104)]())[_0x1bc61a(0x102)](Boolean);}export function projectRoleRef(_0xbfa074){const _0x16e2d0=a144_0x565bb6;return{'id':_0xbfa074['id'],'roleName':_0xbfa074[_0x16e2d0(0x110)],'roleType':_0xbfa074[_0x16e2d0(0xfd)]};}export async function resolvePermitRoles(_0x32a458,_0x2c32df,_0x14cd11){const _0x125efc=a144_0x565bb6,_0x6b63fa=await listPermitRoles(_0x32a458,{'needSelf':!![],'needPublic':!![]}),_0x14d6a3=[];for(const _0x4ef118 of _0x2c32df){const _0x581fd3=resolveOnePermitRole(_0x6b63fa,_0x4ef118);if(!_0x14cd11['allowSelf']&&_0x581fd3['roleType']===_0x125efc(0xf9))throw CliErrors[_0x125efc(0x113)](_0x125efc(0x12f)+_0x14cd11[_0x125efc(0xf3)]+'.',_0x125efc(0xe5));if(!_0x14d6a3['some'](_0x316884=>_0x316884['id']===_0x581fd3['id']))_0x14d6a3[_0x125efc(0x107)](_0x581fd3);}return _0x14d6a3;}function a144_0x2b2c(){const _0x20d3a2=['datasetCode','push','bool','76970IpgQmF','Revoke\x20access\x20to\x20the\x20listed\x20resources','join','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','flag','set','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.','roleName','string','menu-id','validation','revoke','export-roles','Role\x20id\x20or\x20role\x20name','role','str','access','dataCreate','delete-roles','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.','data\x20export','menus','4FrjRNt','test','8kePEqh','8hbSoCp','247738HhahzG','Disambiguate\x20with\x20an\x20id.','ALL','allowedActions','dataUpdate','apiList','resourceName','222440EppsTD','data\x20detail','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','dataDelete','Role\x20id\x20','SELF\x20is\x20not\x20allowed\x20for\x20','create-roles','1583490QsEcKY','Grant\x20access\x20to\x20the\x20listed\x20resources','number','map','flagMissing','row\x20visibility','length','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','boolean','entries','Missing\x20action.','get','10416960KaCgRJ','dataPermit','grant','1540338ZBoTQL','data\x20create','find','menu\x20visibility','Menu\x20id\x20(from\x20`menu\x20list`)','dataExport','label','key','3164203uHlkcF','\x22\x20is\x20ambiguous\x20(ids:\x20','menuId','Roles\x20for\x20','SELF','split','Role\x20\x22','resourceCode','roleType','\x20not\x20found.','detail-roles','menuPermit','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','filter','data\x20delete','trim','allowSelf'];a144_0x2b2c=function(){return _0x20d3a2;};return a144_0x2b2c();}function resolveOnePermitRole(_0x385c93,_0x9a0ab0){const _0x31f463=a144_0x565bb6,_0x50f362=_0x9a0ab0[_0x31f463(0x104)](),_0x4f135=_0x50f362['toUpperCase']();if(_0x4f135==='SELF'||_0x4f135===_0x31f463(0x125)){const _0x35b2c3=_0x385c93[_0x31f463(0xef)](_0x2922b4=>_0x2922b4['roleType']===_0x4f135);if(!_0x35b2c3)throw CliErrors[_0x31f463(0x113)]('Special\x20role\x20'+_0x4f135+'\x20is\x20not\x20available\x20for\x20this\x20app.');return _0x35b2c3;}if(/^-?\d+$/[_0x31f463(0x120)](_0x50f362)){const _0x27e051=Number(_0x50f362),_0x18bb0b=_0x385c93['find'](_0x55f4ad=>_0x55f4ad['id']===_0x27e051);if(!_0x18bb0b)throw CliErrors['validation'](_0x31f463(0x12e)+_0x27e051+_0x31f463(0xfe),'Run\x20`role\x20list`.');return _0x18bb0b;}const _0x4d1b00=_0x385c93[_0x31f463(0x102)](_0x305ae0=>_0x305ae0[_0x31f463(0x110)]===_0x50f362);if(_0x4d1b00[_0x31f463(0xe4)]===0x0)throw CliErrors[_0x31f463(0x113)](_0x31f463(0xfb)+_0x50f362+'\x22\x20not\x20found.',_0x31f463(0x11c));if(_0x4d1b00['length']>0x1)throw CliErrors['validation'](_0x31f463(0xfb)+_0x50f362+_0x31f463(0xf6)+_0x4d1b00['map'](_0x4501e9=>_0x4501e9['id'])[_0x31f463(0x10b)](',\x20')+').',_0x31f463(0x124));return _0x4d1b00[0x0];}export function projectPageSlot(_0x1aff14){const _0x18f9c5=a144_0x565bb6;if(!_0x1aff14)return null;return{'resourceCode':_0x1aff14[_0x18f9c5(0xfc)],'roles':(_0x1aff14['rolePermit']??[])['map'](projectRoleRef)};}export function projectPagePermit(_0x149218){const _0x147cbf=a144_0x565bb6,_0x687a74={'menuId':_0x149218[_0x147cbf(0xf7)],'appCode':_0x149218['appCode'],'menuPermit':projectPageSlot(_0x149218[_0x147cbf(0x100)])};for(const _0x7b378a of PAGE_SLOT_SPECS){if(_0x7b378a[_0x147cbf(0xf4)]===_0x147cbf(0x100))continue;_0x687a74[_0x7b378a[_0x147cbf(0xf4)]]=projectPageSlot(_0x149218[_0x7b378a[_0x147cbf(0xf4)]]);}return _0x687a74;}export function flattenMenuResources(_0x201045){const _0xea2c8d=new Map(),_0x190cec=_0x38ec36=>{const _0x2e23ba=a144_0x3aee;for(const _0x45588c of _0x38ec36??[]){_0xea2c8d[_0x2e23ba(0x10e)](_0x45588c[_0x2e23ba(0xfc)],{'resourceCode':_0x45588c['resourceCode'],'resourceName':_0x45588c[_0x2e23ba(0x129)],'action':_0x45588c[_0x2e23ba(0x126)]?.[0x0]??'0'});if(_0x45588c['pageNodeList'])_0x190cec(_0x45588c['pageNodeList']);}};return _0x190cec(_0x201045),_0xea2c8d;}export function flattenApiResources(_0x1bd7b9){const _0xdf5ac3=a144_0x565bb6,_0x237eb0=new Map(),_0x14c9b4=new Map();for(const _0x2972d4 of _0x1bd7b9){const _0x257292=_0x2972d4[_0xdf5ac3(0x128)]??{};for(const [_0x3b7896,_0x101afd]of Object[_0xdf5ac3(0xe7)](_0x257292)){_0x237eb0[_0xdf5ac3(0x10e)](_0x3b7896,{'resourceCode':_0x3b7896,'resourceName':_0x2972d4[_0xdf5ac3(0x129)],'datasetCode':_0x2972d4[_0xdf5ac3(0x106)],'action':_0x101afd?.[0x0]??'0'});const _0x48fcaa=_0x14c9b4['get'](_0x2972d4[_0xdf5ac3(0x106)])??[];_0x48fcaa[_0xdf5ac3(0x107)](_0x3b7896),_0x14c9b4[_0xdf5ac3(0x10e)](_0x2972d4[_0xdf5ac3(0x106)],_0x48fcaa);}}return{'byCode':_0x237eb0,'byDataset':_0x14c9b4};}export function buildPermits(_0x3f65f4,_0x229648){const _0x466899=a144_0x565bb6,_0x5da2e2={};for(const [_0x4bd7b1,_0x5803b5]of _0x3f65f4){const _0x404029=_0x229648[_0x466899(0xe9)](_0x4bd7b1)??_0x5803b5['action'];_0x5da2e2[_0x4bd7b1]=[_0x404029];}return _0x5da2e2;}export function readRoleRef(_0x317514){const _0x232991=a144_0x565bb6,_0x13ead4=_0x317514[_0x232991(0x118)](_0x232991(0x117))[_0x232991(0x104)]();if(!_0x13ead4)throw CliErrors[_0x232991(0xe2)](_0x232991(0x117),'Pass\x20--role\x20<id|name>.');return _0x13ead4;}export function readGrantRevoke(_0x4f8b31){const _0x1f72b1=a144_0x565bb6,_0x3d09d9=_0x4f8b31[_0x1f72b1(0x108)](_0x1f72b1(0xec)),_0x16d9c7=_0x4f8b31[_0x1f72b1(0x108)](_0x1f72b1(0x114));if(_0x3d09d9&&_0x16d9c7)throw CliErrors['validation'](_0x1f72b1(0x10c));if(!_0x3d09d9&&!_0x16d9c7)throw CliErrors[_0x1f72b1(0x113)](_0x1f72b1(0xe8),_0x1f72b1(0x10f));return _0x3d09d9?_0x1f72b1(0x119):'0';}
1
+ const a145_0x24f5f5=a145_0xed2e;(function(_0x4816d0,_0x29b115){const _0x1a9768=a145_0xed2e,_0x35f815=_0x4816d0();while(!![]){try{const _0x13ae6f=parseInt(_0x1a9768(0x1bf))/0x1+parseInt(_0x1a9768(0x199))/0x2*(parseInt(_0x1a9768(0x1cf))/0x3)+-parseInt(_0x1a9768(0x1ae))/0x4*(-parseInt(_0x1a9768(0x1d1))/0x5)+-parseInt(_0x1a9768(0x1a8))/0x6*(parseInt(_0x1a9768(0x1e3))/0x7)+-parseInt(_0x1a9768(0x1ab))/0x8*(parseInt(_0x1a9768(0x191))/0x9)+parseInt(_0x1a9768(0x1a2))/0xa+-parseInt(_0x1a9768(0x1c1))/0xb;if(_0x13ae6f===_0x29b115)break;else _0x35f815['push'](_0x35f815['shift']());}catch(_0x59d23f){_0x35f815['push'](_0x35f815['shift']());}}}(a145_0x1df7,0xe97b4));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':'menu-id','type':'number','required':!![],'description':'Menu\x20id\x20(from\x20`menu\x20list`)'};export const ROLE_REF_FLAG={'name':a145_0x24f5f5(0x1d5),'type':a145_0x24f5f5(0x1b6),'required':!![],'description':'Role\x20id\x20or\x20role\x20name'};function a145_0x1df7(){const _0x5db553=['validation','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.','export-roles','set','\x22\x20not\x20found.','\x20(comma-separated\x20SELF/ALL/id/name)','roleName','menu\x20visibility','pageNodeList','data\x20update','7HpnWGn','dataPermit','map','delete-roles','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.','\x20not\x20found.','find','2763xgZmGh','datasetCode','grant','data\x20delete','Grant\x20access\x20to\x20the\x20listed\x20resources','Missing\x20action.','test','access','2XwHRNe','filter','appCode','length','resourceName','Roles\x20for\x20','menuPermit','row-roles','data\x20detail','2174460bArykC','bool','data\x20create','flagMissing','menus','apiList','1885692sRtggo','ALL','detail-roles','680wGFTNl','dataExport','label','8772mAjaxj','create-roles','roleType','\x20is\x20not\x20available\x20for\x20this\x20app.','allowSelf','dataUpdate','revoke','Disambiguate\x20with\x20an\x20id.','string','rolePermit','boolean','datasets','entries','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','dataCreate','trim','Run\x20`role\x20list`.','795881rpwwne','dataDelete','4526247qJMOeK','Role\x20id\x20','dataDetail',';\x20SELF\x20=\x20only\x20own\x20rows','Pass\x20--role\x20<id|name>.','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','split','SELF\x20is\x20not\x20allowed\x20for\x20','get','flag','key','SELF','Revoke\x20access\x20to\x20the\x20listed\x20resources','1999074aHQNmx','push','65sMDumh','Role\x20\x22','\x22\x20is\x20ambiguous\x20(ids:\x20','str','role','action','resourceCode','some'];a145_0x1df7=function(){return _0x5db553;};return a145_0x1df7();}export const GRANT_FLAG={'name':a145_0x24f5f5(0x193),'type':a145_0x24f5f5(0x1b8),'required':![],'description':a145_0x24f5f5(0x195)};export const REVOKE_FLAG={'name':a145_0x24f5f5(0x1b4),'type':a145_0x24f5f5(0x1b8),'required':![],'description':a145_0x24f5f5(0x1ce)};function a145_0xed2e(_0x596348,_0x5d86c8){_0x596348=_0x596348-0x190;const _0x1df73c=a145_0x1df7();let _0xed2e09=_0x1df73c[_0x596348];return _0xed2e09;}export const MENUS_FLAG={'name':a145_0x24f5f5(0x1a6),'type':a145_0x24f5f5(0x1b6),'required':!![],'description':a145_0x24f5f5(0x1c6)};export const DATASETS_FLAG={'name':a145_0x24f5f5(0x1b9),'type':a145_0x24f5f5(0x1b6),'required':!![],'description':a145_0x24f5f5(0x1bb)};export const PAGE_SLOT_SPECS=[{'flag':'menu-roles','key':a145_0x24f5f5(0x19f),'allowSelf':![],'label':a145_0x24f5f5(0x1e0)},{'flag':a145_0x24f5f5(0x1af),'key':a145_0x24f5f5(0x1bc),'allowSelf':![],'label':a145_0x24f5f5(0x1a4)},{'flag':'update-roles','key':a145_0x24f5f5(0x1b3),'allowSelf':![],'label':a145_0x24f5f5(0x1e2)},{'flag':a145_0x24f5f5(0x1e6),'key':a145_0x24f5f5(0x1c0),'allowSelf':![],'label':a145_0x24f5f5(0x194)},{'flag':a145_0x24f5f5(0x1aa),'key':a145_0x24f5f5(0x1c3),'allowSelf':![],'label':a145_0x24f5f5(0x1a1)},{'flag':a145_0x24f5f5(0x1db),'key':a145_0x24f5f5(0x1ac),'allowSelf':![],'label':'data\x20export'},{'flag':a145_0x24f5f5(0x1a0),'key':a145_0x24f5f5(0x1e4),'allowSelf':!![],'label':'row\x20visibility'}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a145_0x24f5f5(0x1e5)](_0x623907=>({'name':_0x623907[a145_0x24f5f5(0x1cb)],'type':a145_0x24f5f5(0x1b6),'required':![],'description':a145_0x24f5f5(0x19e)+_0x623907[a145_0x24f5f5(0x1ad)]+a145_0x24f5f5(0x1de)+(_0x623907[a145_0x24f5f5(0x1b2)]?a145_0x24f5f5(0x1c4):'')}));export function splitList(_0x10eba6){const _0x475e80=a145_0x24f5f5;return _0x10eba6[_0x475e80(0x1c8)](',')[_0x475e80(0x1e5)](_0x1eebea=>_0x1eebea[_0x475e80(0x1bd)]())[_0x475e80(0x19a)](Boolean);}export function projectRoleRef(_0x5a595a){const _0x40c0c1=a145_0x24f5f5;return{'id':_0x5a595a['id'],'roleName':_0x5a595a[_0x40c0c1(0x1df)],'roleType':_0x5a595a[_0x40c0c1(0x1b0)]};}export async function resolvePermitRoles(_0x566bf2,_0x42597c,_0x249036){const _0x1958b7=a145_0x24f5f5,_0x41c9e4=await listPermitRoles(_0x566bf2,{'needSelf':!![],'needPublic':!![]}),_0x342201=[];for(const _0x57d14a of _0x42597c){const _0x20a03d=resolveOnePermitRole(_0x41c9e4,_0x57d14a);if(!_0x249036[_0x1958b7(0x1b2)]&&_0x20a03d[_0x1958b7(0x1b0)]==='SELF')throw CliErrors['validation'](_0x1958b7(0x1c9)+_0x249036['label']+'.','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.');if(!_0x342201[_0x1958b7(0x1d8)](_0x19cb59=>_0x19cb59['id']===_0x20a03d['id']))_0x342201[_0x1958b7(0x1d0)](_0x20a03d);}return _0x342201;}function resolveOnePermitRole(_0x6c6ee7,_0x4ccf81){const _0x2b222d=a145_0x24f5f5,_0x13d7ca=_0x4ccf81[_0x2b222d(0x1bd)](),_0x5bec35=_0x13d7ca['toUpperCase']();if(_0x5bec35===_0x2b222d(0x1cd)||_0x5bec35===_0x2b222d(0x1a9)){const _0x41efb6=_0x6c6ee7['find'](_0x243a3d=>_0x243a3d[_0x2b222d(0x1b0)]===_0x5bec35);if(!_0x41efb6)throw CliErrors[_0x2b222d(0x1d9)]('Special\x20role\x20'+_0x5bec35+_0x2b222d(0x1b1));return _0x41efb6;}if(/^-?\d+$/[_0x2b222d(0x197)](_0x13d7ca)){const _0x2f68df=Number(_0x13d7ca),_0x3bd019=_0x6c6ee7[_0x2b222d(0x190)](_0x39d64d=>_0x39d64d['id']===_0x2f68df);if(!_0x3bd019)throw CliErrors[_0x2b222d(0x1d9)](_0x2b222d(0x1c2)+_0x2f68df+_0x2b222d(0x1e8),_0x2b222d(0x1be));return _0x3bd019;}const _0x8ecbec=_0x6c6ee7['filter'](_0xbd46d=>_0xbd46d[_0x2b222d(0x1df)]===_0x13d7ca);if(_0x8ecbec[_0x2b222d(0x19c)]===0x0)throw CliErrors[_0x2b222d(0x1d9)]('Role\x20\x22'+_0x13d7ca+_0x2b222d(0x1dd),_0x2b222d(0x1e7));if(_0x8ecbec[_0x2b222d(0x19c)]>0x1)throw CliErrors[_0x2b222d(0x1d9)](_0x2b222d(0x1d2)+_0x13d7ca+_0x2b222d(0x1d3)+_0x8ecbec[_0x2b222d(0x1e5)](_0x1bc9a6=>_0x1bc9a6['id'])['join'](',\x20')+').',_0x2b222d(0x1b5));return _0x8ecbec[0x0];}export function projectPageSlot(_0x3ec261){const _0x11837e=a145_0x24f5f5;if(!_0x3ec261)return null;return{'resourceCode':_0x3ec261['resourceCode'],'roles':(_0x3ec261[_0x11837e(0x1b7)]??[])[_0x11837e(0x1e5)](projectRoleRef)};}export function projectPagePermit(_0x424851){const _0x327571=a145_0x24f5f5,_0x35ef75={'menuId':_0x424851['menuId'],'appCode':_0x424851[_0x327571(0x19b)],'menuPermit':projectPageSlot(_0x424851[_0x327571(0x19f)])};for(const _0xffe965 of PAGE_SLOT_SPECS){if(_0xffe965[_0x327571(0x1cc)]===_0x327571(0x19f))continue;_0x35ef75[_0xffe965[_0x327571(0x1cc)]]=projectPageSlot(_0x424851[_0xffe965[_0x327571(0x1cc)]]);}return _0x35ef75;}export function flattenMenuResources(_0x3b9186){const _0xb6e761=new Map(),_0x5f5dda=_0x4570c8=>{const _0x5f07c7=a145_0xed2e;for(const _0x366f55 of _0x4570c8??[]){_0xb6e761['set'](_0x366f55[_0x5f07c7(0x1d7)],{'resourceCode':_0x366f55[_0x5f07c7(0x1d7)],'resourceName':_0x366f55['resourceName'],'action':_0x366f55['allowedActions']?.[0x0]??'0'});if(_0x366f55[_0x5f07c7(0x1e1)])_0x5f5dda(_0x366f55[_0x5f07c7(0x1e1)]);}};return _0x5f5dda(_0x3b9186),_0xb6e761;}export function flattenApiResources(_0x3a20ec){const _0x8bccc2=a145_0x24f5f5,_0x3183b5=new Map(),_0x57f75f=new Map();for(const _0x1c6a35 of _0x3a20ec){const _0xbc13e1=_0x1c6a35[_0x8bccc2(0x1a7)]??{};for(const [_0x432722,_0x14d72f]of Object[_0x8bccc2(0x1ba)](_0xbc13e1)){_0x3183b5[_0x8bccc2(0x1dc)](_0x432722,{'resourceCode':_0x432722,'resourceName':_0x1c6a35[_0x8bccc2(0x19d)],'datasetCode':_0x1c6a35[_0x8bccc2(0x192)],'action':_0x14d72f?.[0x0]??'0'});const _0x1ed83c=_0x57f75f[_0x8bccc2(0x1ca)](_0x1c6a35['datasetCode'])??[];_0x1ed83c[_0x8bccc2(0x1d0)](_0x432722),_0x57f75f[_0x8bccc2(0x1dc)](_0x1c6a35['datasetCode'],_0x1ed83c);}}return{'byCode':_0x3183b5,'byDataset':_0x57f75f};}export function buildPermits(_0x39cd3f,_0x2ecf25){const _0x52d906=a145_0x24f5f5,_0x57b5dc={};for(const [_0x5bfc25,_0x5de5c3]of _0x39cd3f){const _0x11ddb8=_0x2ecf25[_0x52d906(0x1ca)](_0x5bfc25)??_0x5de5c3[_0x52d906(0x1d6)];_0x57b5dc[_0x5bfc25]=[_0x11ddb8];}return _0x57b5dc;}export function readRoleRef(_0x41cc57){const _0x4023e4=a145_0x24f5f5,_0x1deeaf=_0x41cc57[_0x4023e4(0x1d4)]('role')['trim']();if(!_0x1deeaf)throw CliErrors[_0x4023e4(0x1a5)](_0x4023e4(0x1d5),_0x4023e4(0x1c5));return _0x1deeaf;}export function readGrantRevoke(_0x280f28){const _0x322078=a145_0x24f5f5,_0x25b89b=_0x280f28['bool'](_0x322078(0x193)),_0x24d7af=_0x280f28[_0x322078(0x1a3)](_0x322078(0x1b4));if(_0x25b89b&&_0x24d7af)throw CliErrors[_0x322078(0x1d9)](_0x322078(0x1c7));if(!_0x25b89b&&!_0x24d7af)throw CliErrors[_0x322078(0x1d9)](_0x322078(0x196),_0x322078(0x1da));return _0x25b89b?_0x322078(0x198):'0';}
@@ -1 +1 @@
1
- (function(_0x3c0a07,_0x3b55e6){const _0x35bd37=a145_0x4b80,_0x2fce62=_0x3c0a07();while(!![]){try{const _0x299866=-parseInt(_0x35bd37(0x208))/0x1*(parseInt(_0x35bd37(0x202))/0x2)+-parseInt(_0x35bd37(0x1f1))/0x3+parseInt(_0x35bd37(0x209))/0x4*(parseInt(_0x35bd37(0x1f9))/0x5)+-parseInt(_0x35bd37(0x1f0))/0x6+parseInt(_0x35bd37(0x206))/0x7+parseInt(_0x35bd37(0x1ed))/0x8*(-parseInt(_0x35bd37(0x20b))/0x9)+-parseInt(_0x35bd37(0x1f6))/0xa*(-parseInt(_0x35bd37(0x1f4))/0xb);if(_0x299866===_0x3b55e6)break;else _0x2fce62['push'](_0x2fce62['shift']());}catch(_0x2c788c){_0x2fce62['push'](_0x2fce62['shift']());}}}(a145_0x2446,0x51a2d));import{existsSync}from'node:fs';import a145_0x1bb6a0 from'node:path';import a145_0xc3950b 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 a145_0x4b80(_0x23e347,_0x4da25c){_0x23e347=_0x23e347-0x1ed;const _0x244681=a145_0x2446();let _0x4b804f=_0x244681[_0x23e347];return _0x4b804f;}function a145_0x2446(){const _0x7fd9e0=['√\x20App\x20Code:\x20','2TEnGXE','string','resolve','trim','2948316gacjlt','my-app','133067TPHaKr','11792IOzoCR','√\x20Login\x20status:\x20','33714quLTLa','1096CppmOg','env','cwd','3160068ABWstD','898248SXmtBn','Directory\x20\x22','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','22bUEGwe','production','6279220JvpHtn','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','test','220SJgvDx','cyan','green','length','\x22\x20already\x20exists','Skipped','log','Logged\x20in'];a145_0x2446=function(){return _0x7fd9e0;};return a145_0x2446();}export async function guidedCreateProject(_0x11cee4,_0x3e491f,_0x363c72){const _0x1662cf=a145_0x4b80,_0x57ed4b=_0x1662cf(0x207),_0xb446af=readConfig(),_0x2d37fb=typeof _0xb446af['env']===_0x1662cf(0x203)?_0xb446af[_0x1662cf(0x1ee)]:undefined,_0x139c8e=await input({'message':'Project\x20name:','default':_0x57ed4b,'validate':_0xf7eaf5=>{const _0x3b83c4=_0x1662cf,_0x2c8df3=_0xf7eaf5[_0x3b83c4(0x205)]()||_0x57ed4b;if(_0x2c8df3[_0x3b83c4(0x1fc)]>0x32)return'Project\x20name\x20cannot\x20exceed\x2050\x20characters';const _0x4e8613=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x2c8df3&&!_0x4e8613[_0x3b83c4(0x1f8)](_0x2c8df3))return _0x3b83c4(0x1f7);const _0x2f061b=a145_0x1bb6a0[_0x3b83c4(0x204)](process[_0x3b83c4(0x1ef)](),_0x2c8df3);if(existsSync(_0x2f061b))return _0x3b83c4(0x1f2)+_0x2c8df3+_0x3b83c4(0x1fd);return!![];}});console[_0x1662cf(0x1ff)](a145_0xc3950b[_0x1662cf(0x1fb)]('√\x20Project\x20Name:\x20'+a145_0xc3950b[_0x1662cf(0x1fa)](_0x139c8e)));const _0x32d785=await selectSingleAppcode(_0x363c72);console['log'](a145_0xc3950b[_0x1662cf(0x1fb)](_0x1662cf(0x201)+a145_0xc3950b[_0x1662cf(0x1fa)](_0x32d785||'Not\x20set')));if(_0x32d785){const _0x37ea12=await getIsSessionValid();if(!_0x37ea12){const _0x9ef714=await confirm({'message':_0x1662cf(0x1f3),'default':!![]});if(_0x9ef714){const _0xb2e9d3=await authServer({'silent':!![]});console[_0x1662cf(0x1ff)](a145_0xc3950b[_0x1662cf(0x1fb)](_0x1662cf(0x20a)+a145_0xc3950b[_0x1662cf(0x1fa)](_0xb2e9d3?_0x1662cf(0x200):'Login\x20failed')));}else console['log'](a145_0xc3950b[_0x1662cf(0x1fb)](_0x1662cf(0x20a)+a145_0xc3950b['cyan'](_0x1662cf(0x1fe))));}await _0x11cee4({'projectName':_0x139c8e,'appCode':_0x32d785,'env':_0x3e491f||_0x2d37fb||_0x1662cf(0x1f5)});}else await _0x11cee4({'projectName':_0x139c8e,'env':_0x3e491f||_0x2d37fb||_0x1662cf(0x1f5)});}
1
+ function a146_0x1f67(){const _0x19dab7=['log','√\x20App\x20Code:\x20','green','5683005MGDClg','10KKgkTD','12aClIaW','5pKWqau','length','5726970XZfczg','cwd','env','my-app','735132gjGUYE','test','486232jIldrG','production','1299317DvLyjo','119GcthlF','Project\x20name:','cyan','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','1622995HAOdAm','string','Skipped','Login\x20failed','768464WYyfgG','√\x20Project\x20Name:\x20','6nOawod','Logged\x20in'];a146_0x1f67=function(){return _0x19dab7;};return a146_0x1f67();}(function(_0x31cf66,_0x22920c){const _0x186d3d=a146_0x527b,_0xe45e95=_0x31cf66();while(!![]){try{const _0x21d4d6=parseInt(_0x186d3d(0xec))/0x1+-parseInt(_0x186d3d(0xea))/0x2*(parseInt(_0x186d3d(0xda))/0x3)+-parseInt(_0x186d3d(0xe8))/0x4*(parseInt(_0x186d3d(0xe2))/0x5)+-parseInt(_0x186d3d(0xe4))/0x6+-parseInt(_0x186d3d(0xed))/0x7*(-parseInt(_0x186d3d(0xf5))/0x8)+parseInt(_0x186d3d(0xdf))/0x9*(-parseInt(_0x186d3d(0xe0))/0xa)+-parseInt(_0x186d3d(0xf1))/0xb*(-parseInt(_0x186d3d(0xe1))/0xc);if(_0x21d4d6===_0x22920c)break;else _0xe45e95['push'](_0xe45e95['shift']());}catch(_0x57f305){_0xe45e95['push'](_0xe45e95['shift']());}}}(a146_0x1f67,0xc9255));function a146_0x527b(_0x3a10f3,_0x2490d8){_0x3a10f3=_0x3a10f3-0xd9;const _0x1f674b=a146_0x1f67();let _0x527b20=_0x1f674b[_0x3a10f3];return _0x527b20;}import{existsSync}from'node:fs';import a146_0x3266c5 from'node:path';import a146_0x2f203d 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';export async function guidedCreateProject(_0x4b75b0,_0x27d11d,_0x304928){const _0x59c2ea=a146_0x527b,_0x541be7=_0x59c2ea(0xe7),_0x5e2291=readConfig(),_0x394e13=typeof _0x5e2291[_0x59c2ea(0xe6)]===_0x59c2ea(0xf2)?_0x5e2291['env']:undefined,_0x4b28e7=await input({'message':_0x59c2ea(0xee),'default':_0x541be7,'validate':_0x8c1c9c=>{const _0x5caffe=_0x59c2ea,_0x4f7152=_0x8c1c9c['trim']()||_0x541be7;if(_0x4f7152[_0x5caffe(0xe3)]>0x32)return'Project\x20name\x20cannot\x20exceed\x2050\x20characters';const _0x4ea3f6=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x4f7152&&!_0x4ea3f6[_0x5caffe(0xe9)](_0x4f7152))return'Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_';const _0x5ec0c4=a146_0x3266c5['resolve'](process[_0x5caffe(0xe5)](),_0x4f7152);if(existsSync(_0x5ec0c4))return'Directory\x20\x22'+_0x4f7152+'\x22\x20already\x20exists';return!![];}});console[_0x59c2ea(0xdc)](a146_0x2f203d['green'](_0x59c2ea(0xd9)+a146_0x2f203d[_0x59c2ea(0xef)](_0x4b28e7)));const _0x353227=await selectSingleAppcode(_0x304928);console[_0x59c2ea(0xdc)](a146_0x2f203d[_0x59c2ea(0xde)](_0x59c2ea(0xdd)+a146_0x2f203d['cyan'](_0x353227||'Not\x20set')));if(_0x353227){const _0xdf5f47=await getIsSessionValid();if(!_0xdf5f47){const _0x5859f6=await confirm({'message':_0x59c2ea(0xf0),'default':!![]});if(_0x5859f6){const _0x3bfd29=await authServer({'silent':!![]});console[_0x59c2ea(0xdc)](a146_0x2f203d[_0x59c2ea(0xde)]('√\x20Login\x20status:\x20'+a146_0x2f203d[_0x59c2ea(0xef)](_0x3bfd29?_0x59c2ea(0xdb):_0x59c2ea(0xf4))));}else console[_0x59c2ea(0xdc)](a146_0x2f203d[_0x59c2ea(0xde)]('√\x20Login\x20status:\x20'+a146_0x2f203d[_0x59c2ea(0xef)](_0x59c2ea(0xf3))));}await _0x4b75b0({'projectName':_0x4b28e7,'appCode':_0x353227,'env':_0x27d11d||_0x394e13||_0x59c2ea(0xeb)});}else await _0x4b75b0({'projectName':_0x4b28e7,'env':_0x27d11d||_0x394e13||'production'});}
@@ -1 +1 @@
1
- (function(_0x2dd4b6,_0x598ebb){const _0x6baf0f=a146_0x283b,_0x1064a1=_0x2dd4b6();while(!![]){try{const _0x587395=parseInt(_0x6baf0f(0xff))/0x1*(parseInt(_0x6baf0f(0x100))/0x2)+parseInt(_0x6baf0f(0xfa))/0x3*(-parseInt(_0x6baf0f(0xfe))/0x4)+parseInt(_0x6baf0f(0x101))/0x5+-parseInt(_0x6baf0f(0xfc))/0x6*(parseInt(_0x6baf0f(0x102))/0x7)+-parseInt(_0x6baf0f(0xfd))/0x8+parseInt(_0x6baf0f(0x103))/0x9+parseInt(_0x6baf0f(0x105))/0xa*(parseInt(_0x6baf0f(0xf9))/0xb);if(_0x587395===_0x598ebb)break;else _0x1064a1['push'](_0x1064a1['shift']());}catch(_0x1abc0c){_0x1064a1['push'](_0x1064a1['shift']());}}}(a146_0x23f6,0x70d8b));function a146_0x283b(_0x47da28,_0x23ee32){_0x47da28=_0x47da28-0xf9;const _0x23f629=a146_0x23f6();let _0x283b3e=_0x23f629[_0x47da28];return _0x283b3e;}function a146_0x23f6(){const _0x4982aa=['452664NsWksj','4PFRmiE','372609DcvXbJ','2foHOFG','531740lAKfuR','7kCjjoS','1589454pACadn','now','225690NjPveu','649RCxhzX','2563971LAWWzb','replace','3682050LrlqLG'];a146_0x23f6=function(){return _0x4982aa;};return a146_0x23f6();}export function formatElapsed(_0x2e4321){const _0x590d80=a146_0x283b,_0x3926cb=Date[_0x590d80(0x104)]()-_0x2e4321;if(_0x3926cb<0x3e8)return _0x3926cb+'ms';const _0x380fe=(_0x3926cb/0x3e8)['toFixed'](0x2),_0xe23dd9=_0x380fe[_0x590d80(0xfb)](/\.?0+$/u,'');return _0xe23dd9+'s';}
1
+ function a147_0x5018(){const _0x4a3272=['97572jOZzur','replace','730447FnNLTz','220098KFtlIH','toFixed','9ZCeBxD','595650JpSknv','14630024oYhMOi','2EqaTVV','225efQHSt','347289bjmdPa','16bcRJoy','11lbfRqD','11758103CwTJxr','8502gJvWwS'];a147_0x5018=function(){return _0x4a3272;};return a147_0x5018();}(function(_0x2192be,_0x2c5c07){const _0x5cc719=a147_0x29fc,_0x5a66ba=_0x2192be();while(!![]){try{const _0x363b45=parseInt(_0x5cc719(0x14f))/0x1*(parseInt(_0x5cc719(0x155))/0x2)+parseInt(_0x5cc719(0x157))/0x3*(parseInt(_0x5cc719(0x158))/0x4)+parseInt(_0x5cc719(0x156))/0x5*(parseInt(_0x5cc719(0x150))/0x6)+parseInt(_0x5cc719(0x15a))/0x7+parseInt(_0x5cc719(0x154))/0x8*(parseInt(_0x5cc719(0x152))/0x9)+-parseInt(_0x5cc719(0x153))/0xa*(parseInt(_0x5cc719(0x159))/0xb)+-parseInt(_0x5cc719(0x14d))/0xc*(parseInt(_0x5cc719(0x14c))/0xd);if(_0x363b45===_0x2c5c07)break;else _0x5a66ba['push'](_0x5a66ba['shift']());}catch(_0x5e3de5){_0x5a66ba['push'](_0x5a66ba['shift']());}}}(a147_0x5018,0xee275));function a147_0x29fc(_0x1d7f87,_0x2c35a3){_0x1d7f87=_0x1d7f87-0x14c;const _0x5018d9=a147_0x5018();let _0x29fcbb=_0x5018d9[_0x1d7f87];return _0x29fcbb;}export function formatElapsed(_0x214c58){const _0x2529d7=a147_0x29fc,_0x280c60=Date['now']()-_0x214c58;if(_0x280c60<0x3e8)return _0x280c60+'ms';const _0x421a6a=(_0x280c60/0x3e8)[_0x2529d7(0x151)](0x2),_0x12eecb=_0x421a6a[_0x2529d7(0x14e)](/\.?0+$/u,'');return _0x12eecb+'s';}
@@ -1 +1 @@
1
- (function(_0x2c54e3,_0xa4a6f){const _0x206148=a147_0x499e,_0x2e9a74=_0x2c54e3();while(!![]){try{const _0x411eab=-parseInt(_0x206148(0x1ee))/0x1*(-parseInt(_0x206148(0x1e6))/0x2)+parseInt(_0x206148(0x1fa))/0x3*(parseInt(_0x206148(0x1c6))/0x4)+-parseInt(_0x206148(0x1c2))/0x5*(-parseInt(_0x206148(0x1ef))/0x6)+parseInt(_0x206148(0x1ac))/0x7*(-parseInt(_0x206148(0x1dc))/0x8)+parseInt(_0x206148(0x1e0))/0x9+-parseInt(_0x206148(0x1d9))/0xa+parseInt(_0x206148(0x1e7))/0xb*(parseInt(_0x206148(0x1f8))/0xc);if(_0x411eab===_0xa4a6f)break;else _0x2e9a74['push'](_0x2e9a74['shift']());}catch(_0x580b40){_0x2e9a74['push'](_0x2e9a74['shift']());}}}(a147_0xaee7,0xeb4aa));import a147_0x400e25 from'path';import a147_0xcbfdfa from'fs';import a147_0x3d8c0f from'chalk';import a147_0x549739 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 a147_0x499e(_0x1fbf77,_0xa2e658){_0x1fbf77=_0x1fbf77-0x1a2;const _0xaee7a9=a147_0xaee7();let _0x499e5c=_0xaee7a9[_0x1fbf77];return _0x499e5c;}import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';function a147_0xaee7(){const _0x438ef2=['production','info','toLocaleString','error','writeFileSync','apps','更新\x20package.json\x20name','package.json','cookie','name','5191980vKdkRM','currentVersion','length','40OgFmZb','description','\x20\x201.\x20Start\x20project:\x20','log','8212437cDbFZZ','readFileSync','env','\x20dataset(s),\x20generated\x20','utf8','cwd','2714SCemJE','7403LKFbKO','√\x20Configuration\x20file\x20created,\x20Apps:\x20','belowMinimum','test','needsUpgrade','bold','existsSync','56cgrsKF','69672OjUWyo','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','\x20|\x20AppCode:\x20','success','...','\x20run\x20start','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','W_OK','*\x20Pulling\x20API\x20configuration...','20436oBXiEX','repeat','15213bcqaOA','1.0.0','\x20model(s)','🚀\x20Next\x20Steps:','stop','projectName','配置应用AppCode失败','version','API\x20配置拉取异常','√\x20package.json\x20updated:\x20name=','fail','resolve','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','message','gray','1388387oxGyDL','开始创建项目:\x20','defaultApp','\x20already\x20exists','chdir','项目创建完成:\x20','Project\x20name\x20cannot\x20be\x20empty','projectCode','rmSync','cyan','√\x20Pulled\x20','create','\x20|\x20Default:\x20','dirname','更新\x20package.json\x20失败','cd\x20','\x20\x202.\x20Pull\x20API\x20configuration:\x20','setLogPath','parse','join','\x20Generated\x20by\x20rabetbase\x20cli\x20','CLI\x20版本检查','70BnjWcI','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','warn','appCode','140mABpaD','green','Project\x20directory\x20','\x20√\x20','\x20api\x20pull','modelCount','Project\x20name:\x20','配置应用AppCode:\x20','start'];a147_0xaee7=function(){return _0x438ef2;};return a147_0xaee7();}export async function createApp(_0x3a2dae){const _0x5c2245=a147_0x499e,_0x283733=await checkCliVersion();(_0x283733[_0x5c2245(0x1eb)]||_0x283733[_0x5c2245(0x1e9)])&&(printCliUpgradeWarning(_0x283733),assertCliVersionSupported(_0x283733),logger[_0x5c2245(0x1d0)](_0x5c2245(0x1b7),_0x5c2245(0x1c1),{'currentVersion':_0x283733[_0x5c2245(0x1da)],'stableVersion':_0x283733['stableVersion'],'minimumVersion':_0x283733['minimumVersion'],'needsUpgrade':_0x283733[_0x5c2245(0x1eb)],'belowMinimum':_0x283733[_0x5c2245(0x1e9)]}));if(_0x3a2dae['projectCode']&&_0x3a2dae[_0x5c2245(0x1c5)])await runCreate({'projectName':_0x3a2dae[_0x5c2245(0x1b3)],'appCode':_0x3a2dae[_0x5c2245(0x1c5)],'env':_0x3a2dae['env']},_0x3a2dae);else{if(_0x3a2dae[_0x5c2245(0x1b3)]){const _0x4501dd=await selectSingleAppcode(_0x3a2dae[_0x5c2245(0x1d7)]);await runCreate({'projectName':_0x3a2dae['projectCode'],'appCode':_0x4501dd||undefined,'env':_0x3a2dae[_0x5c2245(0x1e2)]},_0x3a2dae);}else await guidedCreateProject(_0xa0fbc3=>runCreate(_0xa0fbc3,_0x3a2dae),_0x3a2dae[_0x5c2245(0x1e2)],_0x3a2dae[_0x5c2245(0x1d7)]);}}async function runCreate(_0x26b308,_0x45cf01){const _0x1a3882=a147_0x499e;if(!_0x26b308[_0x1a3882(0x1a2)]||_0x26b308[_0x1a3882(0x1a2)]['trim']()==='')throw new Error(_0x1a3882(0x1b2));const _0x46ad7f=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x46ad7f[_0x1a3882(0x1ea)](_0x26b308['projectName']))throw new Error('Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters');if(_0x26b308[_0x1a3882(0x1a2)]['length']>0x64)throw new Error(_0x1a3882(0x1f0));const _0xe5ef17=a147_0x400e25[_0x1a3882(0x1a8)](process[_0x1a3882(0x1e5)](),_0x26b308['projectName']);if(a147_0xcbfdfa['existsSync'](_0xe5ef17))throw new Error(_0x1a3882(0x1c8)+_0x26b308[_0x1a3882(0x1a2)]+_0x1a3882(0x1af));try{a147_0xcbfdfa['accessSync'](a147_0x400e25[_0x1a3882(0x1b9)](_0xe5ef17),a147_0xcbfdfa['constants'][_0x1a3882(0x1f6)]);}catch{throw new Error(_0x1a3882(0x1f5));}logger[_0x1a3882(0x1bd)](_0xe5ef17),logger[_0x1a3882(0x1d0)](_0x1a3882(0x1b7),_0x1a3882(0x1ad)+_0x26b308['projectName'],{'projectDir':_0xe5ef17,'appCode':_0x26b308[_0x1a3882(0x1c5)]}),console[_0x1a3882(0x1df)](),console[_0x1a3882(0x1df)](a147_0x3d8c0f[_0x1a3882(0x1c7)](_0x1a3882(0x1c9))+_0x1a3882(0x1cc)+a147_0x3d8c0f[_0x1a3882(0x1c7)](_0x26b308[_0x1a3882(0x1a2)])+(_0x26b308['appCode']?_0x1a3882(0x1f1)+a147_0x3d8c0f[_0x1a3882(0x1b5)](_0x26b308['appCode']):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x26b308[_0x1a3882(0x1a2)])),await updatePackageJsonName(_0x26b308[_0x1a3882(0x1a2)]),await runTask('Install\x20dependencies',()=>installDependencies(_0x26b308['projectName'])),await runTask('Format\x20code',()=>formatProjectCode(_0x26b308[_0x1a3882(0x1a2)])),await configureAppCode(_0x26b308['projectName'],_0x26b308['appCode']||'',_0x26b308[_0x1a3882(0x1e2)]);let _0x5384f0=![];if(_0x26b308[_0x1a3882(0x1c5)]){console[_0x1a3882(0x1df)](_0x1a3882(0x1f7));const _0x4e977e=process['cwd']();try{process['chdir'](_0xe5ef17);const _0x3b0618=_0x26b308[_0x1a3882(0x1e2)]||_0x1a3882(0x1cf);initEnv(_0x3b0618);const {configArray:_0x35f2f8}=await fetchModelList(_0x26b308['appCode'],_0x45cf01[_0x1a3882(0x1d7)]||''),_0x483b4f=DEFAULT_API_DIR,_0x206ab3=await generateApiFile(_0x35f2f8,'',_0x26b308[_0x1a3882(0x1c5)],!![],_0x3b0618,_0x483b4f);console['log'](_0x1a3882(0x1b6)+_0x35f2f8[_0x1a3882(0x1db)]+_0x1a3882(0x1e3)+_0x206ab3[_0x1a3882(0x1cb)]+_0x1a3882(0x1fc)),logger['info']('create','API\x20configuration\x20pulled:\x20'+_0x26b308[_0x1a3882(0x1c5)]);}catch(_0x454fc9){_0x5384f0=!![],console[_0x1a3882(0x1df)](_0x1a3882(0x1c3)),logger[_0x1a3882(0x1c4)](_0x1a3882(0x1b7),_0x1a3882(0x1a5),{'error':_0x454fc9 instanceof Error?_0x454fc9[_0x1a3882(0x1aa)]:String(_0x454fc9)});}finally{process[_0x1a3882(0x1b0)](_0x4e977e);}}logger[_0x1a3882(0x1f2)](_0x1a3882(0x1b7),_0x1a3882(0x1b1)+_0x26b308[_0x1a3882(0x1a2)]),console[_0x1a3882(0x1df)](),console[_0x1a3882(0x1df)](a147_0x3d8c0f[_0x1a3882(0x1c7)]('─'[_0x1a3882(0x1f9)](0x3c))),console['log'](a147_0x3d8c0f[_0x1a3882(0x1b5)]['bold'](_0x1a3882(0x1fd))),console[_0x1a3882(0x1df)](),console[_0x1a3882(0x1df)](_0x1a3882(0x1de)+a147_0x3d8c0f['cyan'][_0x1a3882(0x1ec)](_0x1a3882(0x1bb)+_0x26b308[_0x1a3882(0x1a2)]+'\x20&&\x20'+CLI_BIN_NAME+_0x1a3882(0x1f4))),_0x5384f0&&console['log'](_0x1a3882(0x1bc)+a147_0x3d8c0f[_0x1a3882(0x1b5)][_0x1a3882(0x1ec)](CLI_BIN_NAME+_0x1a3882(0x1ca))),console[_0x1a3882(0x1df)](a147_0x3d8c0f['green']('─'[_0x1a3882(0x1f9)](0x3c)));}catch(_0x373f43){logger[_0x1a3882(0x1d2)](_0x1a3882(0x1b7),'项目创建失败:\x20'+_0x26b308[_0x1a3882(0x1a2)],{'error':_0x373f43 instanceof Error?_0x373f43[_0x1a3882(0x1aa)]:String(_0x373f43)});try{a147_0xcbfdfa[_0x1a3882(0x1ed)](_0xe5ef17)&&(console[_0x1a3882(0x1df)](_0x1a3882(0x1a9)+_0xe5ef17),a147_0xcbfdfa[_0x1a3882(0x1b4)](_0xe5ef17,{'recursive':!![],'force':!![]}));}catch{logger[_0x1a3882(0x1c4)](_0x1a3882(0x1b7),'清理项目目录失败:\x20'+_0xe5ef17);}throw _0x373f43;}}async function runTask(_0x461691,_0x250e7b){const _0x47e489=a147_0x499e,_0x17e1b4=a147_0x549739(_0x461691+_0x47e489(0x1f3))[_0x47e489(0x1ce)]();try{const _0x5eac05=await _0x250e7b();_0x17e1b4[_0x47e489(0x1fe)](),console[_0x47e489(0x1df)](''+a147_0x3d8c0f[_0x47e489(0x1c7)](_0x47e489(0x1c9))+_0x461691+'\x20'+a147_0x3d8c0f[_0x47e489(0x1ab)]('['+_0x5eac05+']'));}catch(_0x16afb2){_0x17e1b4[_0x47e489(0x1a7)](_0x461691);throw _0x16afb2;}}async function updatePackageJsonName(_0x83e902){const _0x8de0a5=a147_0x499e,_0x2300e2=a147_0x400e25[_0x8de0a5(0x1a8)](process['cwd'](),_0x83e902),_0x38dc2f=a147_0x400e25[_0x8de0a5(0x1bf)](_0x2300e2,_0x8de0a5(0x1d6));try{console[_0x8de0a5(0x1df)]('*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields');const _0x355342=getRabetbaseCliPackageRoot(),_0x2a5a01=a147_0x400e25[_0x8de0a5(0x1bf)](_0x355342,_0x8de0a5(0x1d6));let _0x50bee6=_0x8de0a5(0x1fb);try{const _0x9f3932=JSON[_0x8de0a5(0x1be)](a147_0xcbfdfa[_0x8de0a5(0x1e1)](_0x2a5a01,_0x8de0a5(0x1e4)));_0x50bee6=_0x9f3932[_0x8de0a5(0x1a4)]||_0x8de0a5(0x1fb);}catch{}const _0x5114dd=a147_0xcbfdfa[_0x8de0a5(0x1e1)](_0x38dc2f,'utf8'),_0x25ef61=JSON[_0x8de0a5(0x1be)](_0x5114dd);_0x25ef61[_0x8de0a5(0x1d8)]=_0x83e902,_0x25ef61[_0x8de0a5(0x1dd)]=_0x83e902+_0x8de0a5(0x1c0)+_0x50bee6,a147_0xcbfdfa[_0x8de0a5(0x1d3)](_0x38dc2f,JSON['stringify'](_0x25ef61,null,0x2)+'\x0a',_0x8de0a5(0x1e4)),console[_0x8de0a5(0x1df)](_0x8de0a5(0x1a6)+_0x83e902),logger[_0x8de0a5(0x1d0)]('create',_0x8de0a5(0x1d5));}catch(_0x141803){logger['error']('create',_0x8de0a5(0x1ba));throw _0x141803;}}async function configureAppCode(_0x4bfeb8,_0x68fa49,_0x2c581b){const _0x35bad1=a147_0x499e,_0x4758a5=a147_0x400e25[_0x35bad1(0x1a8)](process[_0x35bad1(0x1e5)](),_0x4bfeb8),_0x2aec34=a147_0x400e25['join'](_0x4758a5,NEW_CONFIG_NAME);try{_0x68fa49?console[_0x35bad1(0x1df)]('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x4bfeb8+':\x20'+_0x68fa49):console['log']('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x4bfeb8);const _0xeb3944=getRabetbaseCliPackageRoot(),_0x43ebb0=a147_0x400e25[_0x35bad1(0x1bf)](_0xeb3944,'package.json');let _0x39dd5e=_0x35bad1(0x1fb);try{const _0x3d6e28=JSON[_0x35bad1(0x1be)](a147_0xcbfdfa['readFileSync'](_0x43ebb0,_0x35bad1(0x1e4)));_0x39dd5e=_0x3d6e28[_0x35bad1(0x1a4)]||_0x35bad1(0x1fb);}catch{}const _0x18ff66=readConfig(),_0x46d921=typeof _0x18ff66[_0x35bad1(0x1e2)]==='string'?_0x18ff66[_0x35bad1(0x1e2)]:undefined,_0x137e30={};for(const _0x41817d of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x18ff66[_0x41817d]!=null)_0x137e30[_0x41817d]=_0x18ff66[_0x41817d];}const _0x2bc191=buildCanonicalProjectConfig(_0x137e30,{'appCodes':_0x68fa49?[_0x68fa49]:[],'env':_0x2c581b||_0x46d921||_0x35bad1(0x1cf),'metadata':{'createdAt':new Date()[_0x35bad1(0x1d1)](),'version':_0x39dd5e}});writeConfigFile(_0x2aec34,_0x2bc191),_0x68fa49?console[_0x35bad1(0x1df)](_0x35bad1(0x1e8)+Object['keys'](_0x2bc191[_0x35bad1(0x1d4)]||{})[_0x35bad1(0x1bf)](',\x20')+_0x35bad1(0x1b8)+_0x2bc191[_0x35bad1(0x1ae)]):console[_0x35bad1(0x1df)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger['info'](_0x35bad1(0x1b7),_0x35bad1(0x1cd)+_0x68fa49);}catch(_0xa9b5c1){logger[_0x35bad1(0x1d2)](_0x35bad1(0x1b7),_0x35bad1(0x1a3));}}
1
+ (function(_0x286422,_0xef4a82){const _0xf046c7=a148_0x4bbc,_0x496423=_0x286422();while(!![]){try{const _0x59f4ad=-parseInt(_0xf046c7(0x17c))/0x1*(-parseInt(_0xf046c7(0x1a7))/0x2)+parseInt(_0xf046c7(0x166))/0x3*(parseInt(_0xf046c7(0x173))/0x4)+-parseInt(_0xf046c7(0x161))/0x5+parseInt(_0xf046c7(0x186))/0x6+-parseInt(_0xf046c7(0x15c))/0x7+parseInt(_0xf046c7(0x1a2))/0x8+-parseInt(_0xf046c7(0x183))/0x9;if(_0x59f4ad===_0xef4a82)break;else _0x496423['push'](_0x496423['shift']());}catch(_0x37d727){_0x496423['push'](_0x496423['shift']());}}}(a148_0xf3d2,0x4ece7));function a148_0x4bbc(_0x336c2a,_0xafa8e){_0x336c2a=_0x336c2a-0x157;const _0xf3d22b=a148_0xf3d2();let _0x4bbc5d=_0xf3d22b[_0x336c2a];return _0x4bbc5d;}import a148_0x351140 from'path';import a148_0x1da210 from'fs';import a148_0x4b999e from'chalk';import a148_0x2dcf84 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';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';function a148_0xf3d2(){const _0x3d0349=['readFileSync','needsUpgrade','stop','gray','appCode','resolve','currentVersion','项目创建失败:\x20','4370064gZBopX','info','constants','setLogPath','modelCount','10YVzewz','join','cwd','Install\x20dependencies','项目创建完成:\x20','\x20Generated\x20by\x20rabetbase\x20cli\x20','cookie','dirname','projectCode','package.json','√\x20Configuration\x20file\x20created,\x20Apps:\x20','W_OK','\x20run\x20start','3543295GfEXET','Copy\x20project\x20files','CLI\x20版本检查','env','repeat','817685LqmHwe','production','keys','parse','rmSync','1069083wqqUxM','utf8','stableVersion','配置应用AppCode失败','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','API\x20configuration\x20pulled:\x20','green','length','log','更新\x20package.json\x20name','bold','message','trim','4bqJDuJ','cyan','belowMinimum','√\x20package.json\x20updated:\x20name=','\x20already\x20exists','error','test','开始创建项目:\x20','warn','122212kdrWsH','name','🚀\x20Next\x20Steps:','cd\x20','apps','\x20√\x20','...','8157717CHphOe','version','accessSync','2311482FigSNs','create','\x20&&\x20','description','\x20model(s)','projectName','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','chdir','\x20dataset(s),\x20generated\x20','1.0.0','√\x20Pulled\x20','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','*\x20Configuring\x20AppCode\x20for\x20project\x20','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','API\x20配置拉取异常','清理项目目录失败:\x20','minimumVersion','\x20api\x20pull','\x20\x201.\x20Start\x20project:\x20','string'];a148_0xf3d2=function(){return _0x3d0349;};return a148_0xf3d2();}export async function createApp(_0xf2e3f9){const _0x5ee1c5=a148_0x4bbc,_0x23df30=await checkCliVersion();(_0x23df30['needsUpgrade']||_0x23df30['belowMinimum'])&&(printCliUpgradeWarning(_0x23df30),assertCliVersionSupported(_0x23df30),logger[_0x5ee1c5(0x1a3)](_0x5ee1c5(0x187),_0x5ee1c5(0x15e),{'currentVersion':_0x23df30[_0x5ee1c5(0x1a0)],'stableVersion':_0x23df30[_0x5ee1c5(0x168)],'minimumVersion':_0x23df30[_0x5ee1c5(0x196)],'needsUpgrade':_0x23df30[_0x5ee1c5(0x19b)],'belowMinimum':_0x23df30[_0x5ee1c5(0x175)]}));if(_0xf2e3f9[_0x5ee1c5(0x157)]&&_0xf2e3f9[_0x5ee1c5(0x19e)])await runCreate({'projectName':_0xf2e3f9[_0x5ee1c5(0x157)],'appCode':_0xf2e3f9[_0x5ee1c5(0x19e)],'env':_0xf2e3f9[_0x5ee1c5(0x15f)]},_0xf2e3f9);else{if(_0xf2e3f9[_0x5ee1c5(0x157)]){const _0x470a34=await selectSingleAppcode(_0xf2e3f9[_0x5ee1c5(0x1ad)]);await runCreate({'projectName':_0xf2e3f9['projectCode'],'appCode':_0x470a34||undefined,'env':_0xf2e3f9[_0x5ee1c5(0x15f)]},_0xf2e3f9);}else await guidedCreateProject(_0x16671d=>runCreate(_0x16671d,_0xf2e3f9),_0xf2e3f9[_0x5ee1c5(0x15f)],_0xf2e3f9[_0x5ee1c5(0x1ad)]);}}async function runCreate(_0x537035,_0x1203de){const _0x22424b=a148_0x4bbc;if(!_0x537035['projectName']||_0x537035[_0x22424b(0x18b)][_0x22424b(0x172)]()==='')throw new Error('Project\x20name\x20cannot\x20be\x20empty');const _0x5d4c9b=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x5d4c9b[_0x22424b(0x179)](_0x537035[_0x22424b(0x18b)]))throw new Error(_0x22424b(0x193));if(_0x537035[_0x22424b(0x18b)]['length']>0x64)throw new Error('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters');const _0x13a500=a148_0x351140[_0x22424b(0x19f)](process['cwd'](),_0x537035['projectName']);if(a148_0x1da210['existsSync'](_0x13a500))throw new Error('Project\x20directory\x20'+_0x537035['projectName']+_0x22424b(0x177));try{a148_0x1da210[_0x22424b(0x185)](a148_0x351140[_0x22424b(0x1ae)](_0x13a500),a148_0x1da210[_0x22424b(0x1a4)][_0x22424b(0x15a)]);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger[_0x22424b(0x1a5)](_0x13a500),logger[_0x22424b(0x1a3)]('create',_0x22424b(0x17a)+_0x537035[_0x22424b(0x18b)],{'projectDir':_0x13a500,'appCode':_0x537035[_0x22424b(0x19e)]}),console['log'](),console[_0x22424b(0x16e)](a148_0x4b999e['green'](_0x22424b(0x181))+'Project\x20name:\x20'+a148_0x4b999e[_0x22424b(0x16c)](_0x537035[_0x22424b(0x18b)])+(_0x537035[_0x22424b(0x19e)]?'\x20|\x20AppCode:\x20'+a148_0x4b999e['cyan'](_0x537035[_0x22424b(0x19e)]):''));try{await runTask(_0x22424b(0x15d),()=>copyProjectTemplate(_0x537035[_0x22424b(0x18b)])),await updatePackageJsonName(_0x537035[_0x22424b(0x18b)]),await runTask(_0x22424b(0x1aa),()=>installDependencies(_0x537035[_0x22424b(0x18b)])),await runTask('Format\x20code',()=>formatProjectCode(_0x537035[_0x22424b(0x18b)])),await configureAppCode(_0x537035[_0x22424b(0x18b)],_0x537035[_0x22424b(0x19e)]||'',_0x537035[_0x22424b(0x15f)]);let _0x235987=![];if(_0x537035[_0x22424b(0x19e)]){console[_0x22424b(0x16e)]('*\x20Pulling\x20API\x20configuration...');const _0x42f2b0=process[_0x22424b(0x1a9)]();try{process[_0x22424b(0x18d)](_0x13a500);const _0x1fb171=_0x537035[_0x22424b(0x15f)]||_0x22424b(0x162);initEnv(_0x1fb171);const {configArray:_0x54e180}=await fetchModelList(_0x537035[_0x22424b(0x19e)],_0x1203de[_0x22424b(0x1ad)]||''),_0x4f3b4b=DEFAULT_API_DIR,_0x50d5cb=await generateApiFile(_0x54e180,'',_0x537035[_0x22424b(0x19e)],!![],_0x1fb171,_0x4f3b4b);console[_0x22424b(0x16e)](_0x22424b(0x190)+_0x54e180[_0x22424b(0x16d)]+_0x22424b(0x18e)+_0x50d5cb[_0x22424b(0x1a6)]+_0x22424b(0x18a)),logger['info'](_0x22424b(0x187),_0x22424b(0x16b)+_0x537035[_0x22424b(0x19e)]);}catch(_0x520bbf){_0x235987=!![],console[_0x22424b(0x16e)]('!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull'),logger[_0x22424b(0x17b)](_0x22424b(0x187),_0x22424b(0x194),{'error':_0x520bbf instanceof Error?_0x520bbf[_0x22424b(0x171)]:String(_0x520bbf)});}finally{process[_0x22424b(0x18d)](_0x42f2b0);}}logger['success'](_0x22424b(0x187),_0x22424b(0x1ab)+_0x537035[_0x22424b(0x18b)]),console[_0x22424b(0x16e)](),console[_0x22424b(0x16e)](a148_0x4b999e['green']('─'[_0x22424b(0x160)](0x3c))),console['log'](a148_0x4b999e[_0x22424b(0x174)][_0x22424b(0x170)](_0x22424b(0x17e))),console[_0x22424b(0x16e)](),console[_0x22424b(0x16e)](_0x22424b(0x198)+a148_0x4b999e[_0x22424b(0x174)][_0x22424b(0x170)](_0x22424b(0x17f)+_0x537035[_0x22424b(0x18b)]+_0x22424b(0x188)+CLI_BIN_NAME+_0x22424b(0x15b))),_0x235987&&console[_0x22424b(0x16e)]('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a148_0x4b999e[_0x22424b(0x174)]['bold'](CLI_BIN_NAME+_0x22424b(0x197))),console[_0x22424b(0x16e)](a148_0x4b999e[_0x22424b(0x16c)]('─'['repeat'](0x3c)));}catch(_0x14f8d9){logger[_0x22424b(0x178)](_0x22424b(0x187),_0x22424b(0x1a1)+_0x537035[_0x22424b(0x18b)],{'error':_0x14f8d9 instanceof Error?_0x14f8d9['message']:String(_0x14f8d9)});try{a148_0x1da210['existsSync'](_0x13a500)&&(console[_0x22424b(0x16e)](_0x22424b(0x18c)+_0x13a500),a148_0x1da210[_0x22424b(0x165)](_0x13a500,{'recursive':!![],'force':!![]}));}catch{logger[_0x22424b(0x17b)]('create',_0x22424b(0x195)+_0x13a500);}throw _0x14f8d9;}}async function runTask(_0x3ae99b,_0x31b28c){const _0x5bace8=a148_0x4bbc,_0x2630e2=a148_0x2dcf84(_0x3ae99b+_0x5bace8(0x182))['start']();try{const _0x42b48b=await _0x31b28c();_0x2630e2[_0x5bace8(0x19c)](),console[_0x5bace8(0x16e)](''+a148_0x4b999e['green'](_0x5bace8(0x181))+_0x3ae99b+'\x20'+a148_0x4b999e[_0x5bace8(0x19d)]('['+_0x42b48b+']'));}catch(_0x5ce7b1){_0x2630e2['fail'](_0x3ae99b);throw _0x5ce7b1;}}async function updatePackageJsonName(_0x59c41b){const _0x4ba3f3=a148_0x4bbc,_0x1aa0f6=a148_0x351140[_0x4ba3f3(0x19f)](process[_0x4ba3f3(0x1a9)](),_0x59c41b),_0x34c42a=a148_0x351140['join'](_0x1aa0f6,_0x4ba3f3(0x158));try{console[_0x4ba3f3(0x16e)](_0x4ba3f3(0x16a));const _0x3abd97=getRabetbaseCliPackageRoot(),_0x44a0a1=a148_0x351140[_0x4ba3f3(0x1a8)](_0x3abd97,_0x4ba3f3(0x158));let _0x1b88ce=_0x4ba3f3(0x18f);try{const _0x2e5ce6=JSON[_0x4ba3f3(0x164)](a148_0x1da210[_0x4ba3f3(0x19a)](_0x44a0a1,_0x4ba3f3(0x167)));_0x1b88ce=_0x2e5ce6[_0x4ba3f3(0x184)]||'1.0.0';}catch{}const _0x4c70fc=a148_0x1da210[_0x4ba3f3(0x19a)](_0x34c42a,_0x4ba3f3(0x167)),_0x1351a7=JSON[_0x4ba3f3(0x164)](_0x4c70fc);_0x1351a7[_0x4ba3f3(0x17d)]=_0x59c41b,_0x1351a7[_0x4ba3f3(0x189)]=_0x59c41b+_0x4ba3f3(0x1ac)+_0x1b88ce,a148_0x1da210['writeFileSync'](_0x34c42a,JSON['stringify'](_0x1351a7,null,0x2)+'\x0a',_0x4ba3f3(0x167)),console[_0x4ba3f3(0x16e)](_0x4ba3f3(0x176)+_0x59c41b),logger['info'](_0x4ba3f3(0x187),_0x4ba3f3(0x16f));}catch(_0x18b6a0){logger[_0x4ba3f3(0x178)](_0x4ba3f3(0x187),'更新\x20package.json\x20失败');throw _0x18b6a0;}}async function configureAppCode(_0x4215da,_0x99508a,_0x58514c){const _0x5df488=a148_0x4bbc,_0x278e4a=a148_0x351140[_0x5df488(0x19f)](process['cwd'](),_0x4215da),_0x20c51f=a148_0x351140[_0x5df488(0x1a8)](_0x278e4a,NEW_CONFIG_NAME);try{_0x99508a?console['log'](_0x5df488(0x192)+_0x4215da+':\x20'+_0x99508a):console[_0x5df488(0x16e)](_0x5df488(0x191)+_0x4215da);const _0x3bbea2=getRabetbaseCliPackageRoot(),_0x38af51=a148_0x351140['join'](_0x3bbea2,_0x5df488(0x158));let _0x11d8fb=_0x5df488(0x18f);try{const _0x2577fc=JSON[_0x5df488(0x164)](a148_0x1da210[_0x5df488(0x19a)](_0x38af51,_0x5df488(0x167)));_0x11d8fb=_0x2577fc[_0x5df488(0x184)]||_0x5df488(0x18f);}catch{}const _0x4888a0=readConfig(),_0x16663e=typeof _0x4888a0[_0x5df488(0x15f)]===_0x5df488(0x199)?_0x4888a0[_0x5df488(0x15f)]:undefined,_0x5ec97b={};for(const _0x51574a of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x4888a0[_0x51574a]!=null)_0x5ec97b[_0x51574a]=_0x4888a0[_0x51574a];}const _0x58589b=buildCanonicalProjectConfig(_0x5ec97b,{'appCodes':_0x99508a?[_0x99508a]:[],'env':_0x58514c||_0x16663e||_0x5df488(0x162),'metadata':{'createdAt':new Date()['toLocaleString'](),'version':_0x11d8fb}});writeConfigFile(_0x20c51f,_0x58589b),_0x99508a?console['log'](_0x5df488(0x159)+Object[_0x5df488(0x163)](_0x58589b[_0x5df488(0x180)]||{})[_0x5df488(0x1a8)](',\x20')+'\x20|\x20Default:\x20'+_0x58589b['defaultApp']):console['log']('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger[_0x5df488(0x1a3)]('create','配置应用AppCode:\x20'+_0x99508a);}catch(_0x5cbc87){logger[_0x5df488(0x178)](_0x5df488(0x187),_0x5df488(0x169));}}
@@ -1 +1 @@
1
- (function(_0x9a324,_0x4617d4){const _0x2ba2be=a148_0x4b80,_0x4a24c5=_0x9a324();while(!![]){try{const _0x4da97a=-parseInt(_0x2ba2be(0x1c3))/0x1*(-parseInt(_0x2ba2be(0x1a2))/0x2)+-parseInt(_0x2ba2be(0x196))/0x3+parseInt(_0x2ba2be(0x19b))/0x4+-parseInt(_0x2ba2be(0x19a))/0x5*(parseInt(_0x2ba2be(0x1c2))/0x6)+-parseInt(_0x2ba2be(0x1b7))/0x7+parseInt(_0x2ba2be(0x1b5))/0x8*(parseInt(_0x2ba2be(0x191))/0x9)+-parseInt(_0x2ba2be(0x1a9))/0xa;if(_0x4da97a===_0x4617d4)break;else _0x4a24c5['push'](_0x4a24c5['shift']());}catch(_0x50e7e6){_0x4a24c5['push'](_0x4a24c5['shift']());}}}(a148_0xe6e9,0x66944));import a148_0x52f287 from'path';import a148_0x51c413 from'fs/promises';function a148_0xe6e9(){const _0x385da1=['log','801CeJwBw','bun\x20--version','ignore','constants','Check\x20directory\x20permissions.','405144KZxrGp','cwd','validation','resolve','14865xXRTHi','1511268ViMaLo','\x20created\x20successfully!','*\x20Creating\x20project\x20','name','\x20\x20rabetbase\x20run\x20start\x0a','\x20\x20Installing\x20dependencies...','\x20\x20Pulling\x20API\x20configuration...','2RjrPwx','stringify','chdir','length','Cannot\x20create\x20project\x20in\x20current\x20directory.','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','...','6157790zpmuVu','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','Use\x20a\x20different\x20project\x20name.','\x20\x20√\x20package.json\x20updated','join','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','env','production','toLocaleString','string','readFile','Project\x20directory\x20\x22','25048eVZwEu','\x20\x20√\x20Configuration\x20file\x20created','514346YykgPX','npm','\x0a\x20\x20cd\x20','\x22\x20already\x20exists.','belowMinimum','description','utf-8','\x20\x20√\x20Pulled\x20','\x20model(s)','parse','test','396DiWfNg','784211wcvdxC','Project\x20name\x20contains\x20invalid\x20characters.','modelCount','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','needsUpgrade'];a148_0xe6e9=function(){return _0x385da1;};return a148_0xe6e9();}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';function a148_0x4b80(_0x191d84,_0x4e6c6d){_0x191d84=_0x191d84-0x190;const _0xe6e90a=a148_0xe6e9();let _0x4b8069=_0xe6e90a[_0x191d84];return _0x4b8069;}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';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x1c1dec,_0x5a47f3,_0x29afae,_0x5e628b){const _0x52bed3=a148_0x4b80,_0x2de5a7=await checkCliVersion();(_0x2de5a7[_0x52bed3(0x1c7)]||_0x2de5a7[_0x52bed3(0x1bb)])&&(printCliUpgradeWarning(_0x2de5a7),assertCliVersionSupported(_0x2de5a7));if(!_0x1c1dec||_0x1c1dec['trim']()==='')throw CliErrors[_0x52bed3(0x198)]('Project\x20name\x20cannot\x20be\x20empty.');const _0xd923e3=/[<>:"|?*\x00-\x1f\x7f]/;if(_0xd923e3[_0x52bed3(0x1c1)](_0x1c1dec))throw CliErrors['validation'](_0x52bed3(0x1c4),_0x52bed3(0x1aa));if(_0x1c1dec[_0x52bed3(0x1a5)]>0x64)throw CliErrors[_0x52bed3(0x198)](_0x52bed3(0x1c6));const _0x5c5ed4=a148_0x52f287['resolve'](process[_0x52bed3(0x197)](),_0x1c1dec);if(existsSync(_0x5c5ed4))throw CliErrors[_0x52bed3(0x198)](_0x52bed3(0x1b4)+_0x1c1dec+_0x52bed3(0x1ba),_0x52bed3(0x1ab));try{const _0x5d41ce=a148_0x52f287['dirname'](_0x5c5ed4);await a148_0x51c413['access'](_0x5d41ce,a148_0x51c413[_0x52bed3(0x194)]['W_OK']);}catch{throw CliErrors[_0x52bed3(0x198)](_0x52bed3(0x1a6),_0x52bed3(0x195));}try{console[_0x52bed3(0x190)](_0x52bed3(0x19d)+_0x1c1dec+_0x52bed3(0x1a8));const _0x489ea3=getSubAppReactDemoTemplateDir();await copyDirectory(_0x489ea3,_0x5c5ed4),console[_0x52bed3(0x190)]('\x20\x20√\x20Project\x20template\x20created'),await updatePackageJsonName(_0x1c1dec),console[_0x52bed3(0x190)](_0x52bed3(0x1ac)),console[_0x52bed3(0x190)](_0x52bed3(0x1a0)),console[_0x52bed3(0x190)](_0x52bed3(0x1a7)),await formatCode(_0x5c5ed4),console['log']('\x20\x20√\x20Code\x20formatted'),await configureProject(_0x1c1dec,_0x29afae,_0x5a47f3),console[_0x52bed3(0x190)](_0x52bed3(0x1b6)),_0x29afae&&await pullApiConfig(_0x5c5ed4,_0x29afae,_0x5a47f3,_0x5e628b),console[_0x52bed3(0x190)]('\x0a√\x20Project\x20'+_0x1c1dec+_0x52bed3(0x19c)),console[_0x52bed3(0x190)](_0x52bed3(0x1b9)+_0x1c1dec),console[_0x52bed3(0x190)](_0x52bed3(0x19f));}catch(_0x29ad59){try{existsSync(_0x5c5ed4)&&await a148_0x51c413['rm'](_0x5c5ed4,{'recursive':!![],'force':!![]});}catch{}throw _0x29ad59;}}async function updatePackageJsonName(_0x1d33a8){const _0x2f32a9=a148_0x4b80,_0x4b79b0=a148_0x52f287[_0x2f32a9(0x199)](process[_0x2f32a9(0x197)](),_0x1d33a8),_0x58b9b7=a148_0x52f287[_0x2f32a9(0x1ad)](_0x4b79b0,'package.json'),_0x4bb1ee=await a148_0x51c413[_0x2f32a9(0x1b3)](_0x58b9b7,_0x2f32a9(0x1bd)),_0x1aa30b=JSON[_0x2f32a9(0x1c0)](_0x4bb1ee);_0x1aa30b[_0x2f32a9(0x19e)]=_0x1d33a8,_0x1aa30b[_0x2f32a9(0x1bc)]='A\x20project\x20created\x20with\x20Lovrabet\x20CLI',await a148_0x51c413['writeFile'](_0x58b9b7,JSON[_0x2f32a9(0x1a3)](_0x1aa30b,null,0x2)+'\x0a');}function detectPackageManager(){const _0x3d6f11=a148_0x4b80;try{return execSync(_0x3d6f11(0x192),{'stdio':_0x3d6f11(0x193)}),'bun';}catch{return _0x3d6f11(0x1b8);}}async function formatCode(_0x506ab9){try{await execAsync('bun\x20run\x20format',{'cwd':_0x506ab9});}catch{}}async function configureProject(_0x96b41b,_0x426c1d,_0x3c6fde){const _0xcaca9d=a148_0x4b80,_0x146373=a148_0x52f287['resolve'](process['cwd'](),_0x96b41b),_0x18fe35=a148_0x52f287[_0xcaca9d(0x1ad)](_0x146373,NEW_CONFIG_NAME),_0x3bb96f=readConfig(),_0x42263d=typeof _0x3bb96f[_0xcaca9d(0x1af)]===_0xcaca9d(0x1b2)?_0x3bb96f[_0xcaca9d(0x1af)]:undefined,_0x3271f3={};for(const _0x1ef2fe of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x3bb96f[_0x1ef2fe]!=null)_0x3271f3[_0x1ef2fe]=_0x3bb96f[_0x1ef2fe];}const _0x1c3f51=buildCanonicalProjectConfig(_0x3271f3,{'appCodes':_0x426c1d?[_0x426c1d]:[],'env':_0x3c6fde||_0x42263d||_0xcaca9d(0x1b0),'metadata':{'createdAt':new Date()[_0xcaca9d(0x1b1)](),'version':getCliVersion()}});writeConfigFile(_0x18fe35,_0x1c3f51);}async function pullApiConfig(_0x3d84ef,_0x5054f4,_0x37944c,_0x11629f){const _0x19579a=a148_0x4b80,_0x3d95e4=process['cwd']();try{process['chdir'](_0x3d84ef);const _0x499ecb=_0x37944c||'production';initEnv(_0x499ecb),console['log'](_0x19579a(0x1a1));const {configArray:_0x19dd47}=await fetchModelList(_0x5054f4,_0x11629f||''),_0x5b3d99=await generateApiFile(_0x19dd47,'',_0x5054f4,!![],_0x499ecb,DEFAULT_API_DIR);console['log'](_0x19579a(0x1be)+_0x19dd47['length']+'\x20dataset(s),\x20generated\x20'+_0x5b3d99[_0x19579a(0x1c5)]+_0x19579a(0x1bf));}catch(_0x475e3){console[_0x19579a(0x190)](_0x19579a(0x1ae)+CLI_BIN_NAME+'\x20api\x20pull`\x20manually\x20later.');}finally{process[_0x19579a(0x1a4)](_0x3d95e4);}}
1
+ (function(_0x243b37,_0x493557){const _0x43256a=a149_0x4d32,_0x5aa4b0=_0x243b37();while(!![]){try{const _0x3287cd=parseInt(_0x43256a(0x1de))/0x1+parseInt(_0x43256a(0x1d2))/0x2+-parseInt(_0x43256a(0x1e9))/0x3*(-parseInt(_0x43256a(0x1f2))/0x4)+parseInt(_0x43256a(0x1d1))/0x5+parseInt(_0x43256a(0x1f0))/0x6+parseInt(_0x43256a(0x1f9))/0x7+-parseInt(_0x43256a(0x200))/0x8;if(_0x3287cd===_0x493557)break;else _0x5aa4b0['push'](_0x5aa4b0['shift']());}catch(_0x4e3832){_0x5aa4b0['push'](_0x5aa4b0['shift']());}}}(a149_0x2be0,0xc22e5));import a149_0x5d13c3 from'path';import a149_0x3b582e 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';function a149_0x2be0(){const _0x231de4=['\x20\x20rabetbase\x20run\x20start\x0a','trim','933186GbcsLH','name','4bSNKAC','\x20api\x20pull`\x20manually\x20later.','\x20\x20√\x20Configuration\x20file\x20created','production','\x20created\x20successfully!','\x20\x20√\x20Pulled\x20','constants','8183371wLRqgR','W_OK','env','needsUpgrade','Check\x20directory\x20permissions.','test','belowMinimum','29282784YjWTbn','toLocaleString','log','bun\x20run\x20format','\x22\x20already\x20exists.','bun','\x20\x20Pulling\x20API\x20configuration...','\x20\x20√\x20Code\x20formatted','\x20\x20√\x20Project\x20template\x20created','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','6110320snqhZb','957726iDoOLU','stringify','modelCount','readFile','\x20\x20√\x20package.json\x20updated','*\x20Creating\x20project\x20','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','package.json','Project\x20name\x20cannot\x20be\x20empty.','dirname','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','\x20\x20Installing\x20dependencies...','393844GaNYIb','validation','Use\x20a\x20different\x20project\x20name.','utf-8','\x0a√\x20Project\x20','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','string','\x0a\x20\x20cd\x20','npm','ignore','Cannot\x20create\x20project\x20in\x20current\x20directory.','3109074aqHIDV','cwd','resolve','join','chdir'];a149_0x2be0=function(){return _0x231de4;};return a149_0x2be0();}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';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';function a149_0x4d32(_0xc85ef2,_0x1ed048){_0xc85ef2=_0xc85ef2-0x1c9;const _0x2be0ab=a149_0x2be0();let _0x4d32d9=_0x2be0ab[_0xc85ef2];return _0x4d32d9;}const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x1063e9,_0x559577,_0x72c409,_0xa741d6){const _0x131f49=a149_0x4d32,_0x5c0c89=await checkCliVersion();(_0x5c0c89[_0x131f49(0x1fc)]||_0x5c0c89[_0x131f49(0x1ff)])&&(printCliUpgradeWarning(_0x5c0c89),assertCliVersionSupported(_0x5c0c89));if(!_0x1063e9||_0x1063e9[_0x131f49(0x1ef)]()==='')throw CliErrors[_0x131f49(0x1df)](_0x131f49(0x1da));const _0x1a2a08=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1a2a08[_0x131f49(0x1fe)](_0x1063e9))throw CliErrors[_0x131f49(0x1df)]('Project\x20name\x20contains\x20invalid\x20characters.',_0x131f49(0x1e3));if(_0x1063e9['length']>0x64)throw CliErrors[_0x131f49(0x1df)](_0x131f49(0x1dc));const _0x1e7f62=a149_0x5d13c3[_0x131f49(0x1eb)](process[_0x131f49(0x1ea)](),_0x1063e9);if(existsSync(_0x1e7f62))throw CliErrors['validation']('Project\x20directory\x20\x22'+_0x1063e9+_0x131f49(0x1cb),_0x131f49(0x1e0));try{const _0x3489e3=a149_0x5d13c3[_0x131f49(0x1db)](_0x1e7f62);await a149_0x3b582e['access'](_0x3489e3,a149_0x3b582e[_0x131f49(0x1f8)][_0x131f49(0x1fa)]);}catch{throw CliErrors['validation'](_0x131f49(0x1e8),_0x131f49(0x1fd));}try{console['log'](_0x131f49(0x1d7)+_0x1063e9+'...');const _0xfae0da=getSubAppReactDemoTemplateDir();await copyDirectory(_0xfae0da,_0x1e7f62),console[_0x131f49(0x1c9)](_0x131f49(0x1cf)),await updatePackageJsonName(_0x1063e9),console[_0x131f49(0x1c9)](_0x131f49(0x1d6)),console['log'](_0x131f49(0x1dd)),console['log'](_0x131f49(0x1d0)),await formatCode(_0x1e7f62),console[_0x131f49(0x1c9)](_0x131f49(0x1ce)),await configureProject(_0x1063e9,_0x72c409,_0x559577),console['log'](_0x131f49(0x1f4)),_0x72c409&&await pullApiConfig(_0x1e7f62,_0x72c409,_0x559577,_0xa741d6),console[_0x131f49(0x1c9)](_0x131f49(0x1e2)+_0x1063e9+_0x131f49(0x1f6)),console[_0x131f49(0x1c9)](_0x131f49(0x1e5)+_0x1063e9),console[_0x131f49(0x1c9)](_0x131f49(0x1ee));}catch(_0x179462){try{existsSync(_0x1e7f62)&&await a149_0x3b582e['rm'](_0x1e7f62,{'recursive':!![],'force':!![]});}catch{}throw _0x179462;}}async function updatePackageJsonName(_0x58525d){const _0x18dbb5=a149_0x4d32,_0x4e7ef8=a149_0x5d13c3[_0x18dbb5(0x1eb)](process[_0x18dbb5(0x1ea)](),_0x58525d),_0x2f761e=a149_0x5d13c3[_0x18dbb5(0x1ec)](_0x4e7ef8,_0x18dbb5(0x1d9)),_0x52544a=await a149_0x3b582e[_0x18dbb5(0x1d5)](_0x2f761e,_0x18dbb5(0x1e1)),_0x2553ae=JSON['parse'](_0x52544a);_0x2553ae[_0x18dbb5(0x1f1)]=_0x58525d,_0x2553ae['description']='A\x20project\x20created\x20with\x20Lovrabet\x20CLI',await a149_0x3b582e['writeFile'](_0x2f761e,JSON[_0x18dbb5(0x1d3)](_0x2553ae,null,0x2)+'\x0a');}function detectPackageManager(){const _0x4bbebe=a149_0x4d32;try{return execSync('bun\x20--version',{'stdio':_0x4bbebe(0x1e7)}),_0x4bbebe(0x1cc);}catch{return _0x4bbebe(0x1e6);}}async function formatCode(_0x46ff68){const _0x58105e=a149_0x4d32;try{await execAsync(_0x58105e(0x1ca),{'cwd':_0x46ff68});}catch{}}async function configureProject(_0x2605ad,_0x8ec19e,_0x25a608){const _0x402499=a149_0x4d32,_0x1fef4b=a149_0x5d13c3['resolve'](process[_0x402499(0x1ea)](),_0x2605ad),_0x1fe183=a149_0x5d13c3[_0x402499(0x1ec)](_0x1fef4b,NEW_CONFIG_NAME),_0xd82628=readConfig(),_0x1b560d=typeof _0xd82628[_0x402499(0x1fb)]===_0x402499(0x1e4)?_0xd82628['env']:undefined,_0x1da4e4={};for(const _0x3bf738 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0xd82628[_0x3bf738]!=null)_0x1da4e4[_0x3bf738]=_0xd82628[_0x3bf738];}const _0x273a6b=buildCanonicalProjectConfig(_0x1da4e4,{'appCodes':_0x8ec19e?[_0x8ec19e]:[],'env':_0x25a608||_0x1b560d||_0x402499(0x1f5),'metadata':{'createdAt':new Date()[_0x402499(0x201)](),'version':getCliVersion()}});writeConfigFile(_0x1fe183,_0x273a6b);}async function pullApiConfig(_0x1afdad,_0xfbe8f6,_0x46b06e,_0x38417e){const _0x2b0efc=a149_0x4d32,_0x5cbd83=process[_0x2b0efc(0x1ea)]();try{process[_0x2b0efc(0x1ed)](_0x1afdad);const _0x2c4b14=_0x46b06e||'production';initEnv(_0x2c4b14),console['log'](_0x2b0efc(0x1cd));const {configArray:_0x1af588}=await fetchModelList(_0xfbe8f6,_0x38417e||''),_0x19b44c=await generateApiFile(_0x1af588,'',_0xfbe8f6,!![],_0x2c4b14,DEFAULT_API_DIR);console[_0x2b0efc(0x1c9)](_0x2b0efc(0x1f7)+_0x1af588['length']+'\x20dataset(s),\x20generated\x20'+_0x19b44c[_0x2b0efc(0x1d4)]+'\x20model(s)');}catch(_0x278ff2){console['log'](_0x2b0efc(0x1d8)+CLI_BIN_NAME+_0x2b0efc(0x1f3));}finally{process[_0x2b0efc(0x1ed)](_0x5cbd83);}}
@@ -1 +1 @@
1
- const a149_0x1f26a2=a149_0x9ec1;(function(_0x37c5d3,_0x38d075){const _0x3afa84=a149_0x9ec1,_0x186602=_0x37c5d3();while(!![]){try{const _0x4129e6=parseInt(_0x3afa84(0xb7))/0x1+-parseInt(_0x3afa84(0xb9))/0x2*(-parseInt(_0x3afa84(0xb6))/0x3)+parseInt(_0x3afa84(0xb3))/0x4+parseInt(_0x3afa84(0xb5))/0x5+-parseInt(_0x3afa84(0xae))/0x6+parseInt(_0x3afa84(0xb2))/0x7+-parseInt(_0x3afa84(0xb4))/0x8;if(_0x4129e6===_0x38d075)break;else _0x186602['push'](_0x186602['shift']());}catch(_0x58f2af){_0x186602['push'](_0x186602['shift']());}}}(a149_0x5bf2,0x92093));import a149_0x5ee18b from'node:path';import{fileURLToPath}from'node:url';function a149_0x9ec1(_0x1c04a2,_0x18b090){_0x1c04a2=_0x1c04a2-0xae;const _0x5bf2d5=a149_0x5bf2();let _0x9ec113=_0x5bf2d5[_0x1c04a2];return _0x9ec113;}function a149_0x5bf2(){const _0x31c813=['259806xQrLIB','dirname','projects','join','5218087UPWmeG','2545620zicZul','12413344ALdmJA','3257540usvCmK','3867DxliTl','127553vsLyWv','resolve','50uWPheF','../../../../','sub-app-react-demo'];a149_0x5bf2=function(){return _0x31c813;};return a149_0x5bf2();}const __dirname=a149_0x5ee18b[a149_0x1f26a2(0xaf)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x5424d6=a149_0x1f26a2;return a149_0x5ee18b[_0x5424d6(0xb8)](__dirname,_0x5424d6(0xba));}export function getSubAppReactDemoTemplateDir(){const _0x31316d=a149_0x1f26a2;return a149_0x5ee18b[_0x31316d(0xb1)](getRabetbaseCliPackageRoot(),'templates',_0x31316d(0xb0),_0x31316d(0xbb));}
1
+ const a150_0x3efeb5=a150_0xa533;(function(_0x3ece89,_0x4b5b48){const _0x1a038d=a150_0xa533,_0x351b73=_0x3ece89();while(!![]){try{const _0x3ec61c=-parseInt(_0x1a038d(0x14d))/0x1+-parseInt(_0x1a038d(0x145))/0x2*(-parseInt(_0x1a038d(0x146))/0x3)+parseInt(_0x1a038d(0x144))/0x4*(parseInt(_0x1a038d(0x14b))/0x5)+-parseInt(_0x1a038d(0x14c))/0x6+-parseInt(_0x1a038d(0x143))/0x7+-parseInt(_0x1a038d(0x14a))/0x8+parseInt(_0x1a038d(0x14e))/0x9;if(_0x3ec61c===_0x4b5b48)break;else _0x351b73['push'](_0x351b73['shift']());}catch(_0x2de09e){_0x351b73['push'](_0x351b73['shift']());}}}(a150_0x5525,0x53cae));function a150_0xa533(_0x5cb6aa,_0x5f5520){_0x5cb6aa=_0x5cb6aa-0x143;const _0x5525de=a150_0x5525();let _0xa53337=_0x5525de[_0x5cb6aa];return _0xa53337;}import a150_0x2f0c87 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a150_0x2f0c87[a150_0x3efeb5(0x14f)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x59d674=a150_0x3efeb5;return a150_0x2f0c87['resolve'](__dirname,_0x59d674(0x148));}function a150_0x5525(){const _0x16aa1d=['1775742Nmmcnz','258905KoFNhT','6073776ItMDme','dirname','2544388vRkCFG','92180dJyAJB','27876gTpbCa','69gsZThx','templates','../../../../','projects','3033104RHKwHD','140eUEkNd'];a150_0x5525=function(){return _0x16aa1d;};return a150_0x5525();}export function getSubAppReactDemoTemplateDir(){const _0x318d90=a150_0x3efeb5;return a150_0x2f0c87['join'](getRabetbaseCliPackageRoot(),_0x318d90(0x147),_0x318d90(0x149),'sub-app-react-demo');}
@@ -1 +1 @@
1
- (function(_0x127bf3,_0x322397){const _0x23db6e=a150_0x3b1e,_0x43f1d7=_0x127bf3();while(!![]){try{const _0x42b7e1=parseInt(_0x23db6e(0xfb))/0x1*(parseInt(_0x23db6e(0xf1))/0x2)+-parseInt(_0x23db6e(0xfc))/0x3+parseInt(_0x23db6e(0xf6))/0x4+-parseInt(_0x23db6e(0xf4))/0x5+parseInt(_0x23db6e(0xf2))/0x6*(-parseInt(_0x23db6e(0xf9))/0x7)+parseInt(_0x23db6e(0xee))/0x8+parseInt(_0x23db6e(0xf0))/0x9*(parseInt(_0x23db6e(0xeb))/0xa);if(_0x42b7e1===_0x322397)break;else _0x43f1d7['push'](_0x43f1d7['shift']());}catch(_0x216063){_0x43f1d7['push'](_0x43f1d7['shift']());}}}(a150_0x562e,0x65651));import a150_0x139c7b from'node:path';function a150_0x562e(){const _0xda44c7=['45zUjPBX','81572FOPaHZ','734244iirDKc','项目模板复制完成','3846195OwXovV','message','1693448aQyWjL','error','info','7OmUyLp','开始复制项目模板','10WqwNrx','933369sHzcvc','706110AecbWb','now','copy','3470176QSDhQI','success'];a150_0x562e=function(){return _0xda44c7;};return a150_0x562e();}import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a150_0x3b1e(_0x305dcd,_0x521f2f){_0x305dcd=_0x305dcd-0xeb;const _0x562e84=a150_0x562e();let _0x3b1eb4=_0x562e84[_0x305dcd];return _0x3b1eb4;}import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x493682){const _0x38cb31=a150_0x3b1e,_0x412ed5=Date[_0x38cb31(0xec)](),_0x4c9124=a150_0x139c7b['resolve'](process['cwd'](),_0x493682);try{logger[_0x38cb31(0xf8)](_0x38cb31(0xed),_0x38cb31(0xfa),{'projectCode':_0x493682,'templateDir':templateDir}),await copyDirectory(templateDir,_0x4c9124);const _0x5bb7f2=Date[_0x38cb31(0xec)]()-_0x412ed5;logger[_0x38cb31(0xef)](_0x38cb31(0xed),_0x38cb31(0xf3),_0x5bb7f2,{'projectCode':_0x493682});}catch(_0x24cb8f){const _0x155edd=Date['now']()-_0x412ed5;logger[_0x38cb31(0xf7)](_0x38cb31(0xed),'项目模板复制失败',{'projectCode':_0x493682,'error':_0x24cb8f instanceof Error?_0x24cb8f[_0x38cb31(0xf5)]:String(_0x24cb8f),'duration':_0x155edd});throw _0x24cb8f;}return formatElapsed(_0x412ed5);}
1
+ (function(_0x3712c5,_0x5334db){const _0x32f3e4=a151_0x13d2,_0x54bae6=_0x3712c5();while(!![]){try{const _0x4c1e81=-parseInt(_0x32f3e4(0x19e))/0x1+-parseInt(_0x32f3e4(0x19f))/0x2*(parseInt(_0x32f3e4(0x1ab))/0x3)+-parseInt(_0x32f3e4(0x1a4))/0x4+parseInt(_0x32f3e4(0x1a8))/0x5+-parseInt(_0x32f3e4(0x1a3))/0x6+-parseInt(_0x32f3e4(0x1a5))/0x7*(-parseInt(_0x32f3e4(0x1a6))/0x8)+parseInt(_0x32f3e4(0x1ac))/0x9;if(_0x4c1e81===_0x5334db)break;else _0x54bae6['push'](_0x54bae6['shift']());}catch(_0x4c199e){_0x54bae6['push'](_0x54bae6['shift']());}}}(a151_0x473a,0x52c1e));import a151_0x187a95 from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';function a151_0x473a(){const _0x5c4132=['413436rSclCp','16210512qUvILB','项目模板复制完成','success','开始复制项目模板','657171doUsrF','4zIVQSi','copy','resolve','cwd','2856570PbREgg','2006692dRRiXP','11256LlXblR','1360gPpQiu','message','875045PiqYCd','now','info'];a151_0x473a=function(){return _0x5c4132;};return a151_0x473a();}import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();function a151_0x13d2(_0x35491d,_0x277ab5){_0x35491d=_0x35491d-0x19c;const _0x473a0b=a151_0x473a();let _0x13d21f=_0x473a0b[_0x35491d];return _0x13d21f;}export async function copyProjectTemplate(_0x2586ca){const _0x23f059=a151_0x13d2,_0x1fd49d=Date[_0x23f059(0x1a9)](),_0x5cff3c=a151_0x187a95[_0x23f059(0x1a1)](process[_0x23f059(0x1a2)](),_0x2586ca);try{logger[_0x23f059(0x1aa)](_0x23f059(0x1a0),_0x23f059(0x19d),{'projectCode':_0x2586ca,'templateDir':templateDir}),await copyDirectory(templateDir,_0x5cff3c);const _0x3a67bc=Date['now']()-_0x1fd49d;logger[_0x23f059(0x19c)](_0x23f059(0x1a0),_0x23f059(0x1ad),_0x3a67bc,{'projectCode':_0x2586ca});}catch(_0x1d0b27){const _0x4292be=Date[_0x23f059(0x1a9)]()-_0x1fd49d;logger['error']('copy','项目模板复制失败',{'projectCode':_0x2586ca,'error':_0x1d0b27 instanceof Error?_0x1d0b27[_0x23f059(0x1a7)]:String(_0x1d0b27),'duration':_0x4292be});throw _0x1d0b27;}return formatElapsed(_0x1fd49d);}
@@ -1 +1 @@
1
- (function(_0x227205,_0x2d4802){const _0x28925a=a151_0x1380,_0x590465=_0x227205();while(!![]){try{const _0x353194=-parseInt(_0x28925a(0x15e))/0x1+-parseInt(_0x28925a(0x15a))/0x2+-parseInt(_0x28925a(0x155))/0x3*(parseInt(_0x28925a(0x150))/0x4)+parseInt(_0x28925a(0x157))/0x5*(parseInt(_0x28925a(0x153))/0x6)+parseInt(_0x28925a(0x15c))/0x7*(-parseInt(_0x28925a(0x15b))/0x8)+-parseInt(_0x28925a(0x15d))/0x9*(parseInt(_0x28925a(0x14f))/0xa)+parseInt(_0x28925a(0x152))/0xb;if(_0x353194===_0x2d4802)break;else _0x590465['push'](_0x590465['shift']());}catch(_0x3d4627){_0x590465['push'](_0x590465['shift']());}}}(a151_0xa8fc,0xc74e1));import a151_0x557c54 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a151_0x1380(_0xda13c8,_0x2c72ee){_0xda13c8=_0xda13c8-0x14a;const _0xa8fc88=a151_0xa8fc();let _0x1380fc=_0xa8fc88[_0xda13c8];return _0x1380fc;}import{logger}from'../../../utils/logger.js';function a151_0xa8fc(){const _0x1c5c40=['代码格式化失败','5pTEcsI','cwd','代码格式化完成','2873456EiGxZQ','13768yXMVQy','1477hvfilv','1240479xkbcwn','1243623aByUUm','prettier','info','now','error','resolve','success','10SmuSuK','40540OxExiE','format','39150683fpXtQF','7982358tWaSSq','npx','264wDeLQj'];a151_0xa8fc=function(){return _0x1c5c40;};return a151_0xa8fc();}import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x47d082){const _0x5d4c36=a151_0x1380,_0x5d7c34=Date[_0x5d4c36(0x14b)](),_0x51f0b0=a151_0x557c54[_0x5d4c36(0x14d)](process[_0x5d4c36(0x158)](),_0x47d082);try{logger[_0x5d4c36(0x14a)](_0x5d4c36(0x151),'开始格式化代码',{'projectCode':_0x47d082}),await execa(resolveNpmBin(_0x5d4c36(0x154)),[_0x5d4c36(0x15f),'--write','.'],{'cwd':_0x51f0b0});const _0x35cddf=Date[_0x5d4c36(0x14b)]()-_0x5d7c34;logger[_0x5d4c36(0x14e)]('format',_0x5d4c36(0x159),_0x35cddf,{'projectCode':_0x47d082});}catch(_0x57dc5f){const _0xa3cbb=Date['now']()-_0x5d7c34;logger[_0x5d4c36(0x14c)](_0x5d4c36(0x151),_0x5d4c36(0x156),{'projectCode':_0x47d082,'error':_0x57dc5f instanceof Error?_0x57dc5f['message']:String(_0x57dc5f),'duration':_0xa3cbb});throw _0x57dc5f;}return formatElapsed(_0x5d7c34);}
1
+ (function(_0x41c252,_0xdc246f){const _0x2c1450=a152_0x1eb9,_0x2ddf3e=_0x41c252();while(!![]){try{const _0x4e620b=parseInt(_0x2c1450(0x17d))/0x1*(-parseInt(_0x2c1450(0x185))/0x2)+parseInt(_0x2c1450(0x184))/0x3+-parseInt(_0x2c1450(0x181))/0x4+parseInt(_0x2c1450(0x17e))/0x5+-parseInt(_0x2c1450(0x187))/0x6+-parseInt(_0x2c1450(0x189))/0x7*(parseInt(_0x2c1450(0x18a))/0x8)+parseInt(_0x2c1450(0x17c))/0x9;if(_0x4e620b===_0xdc246f)break;else _0x2ddf3e['push'](_0x2ddf3e['shift']());}catch(_0x21a865){_0x2ddf3e['push'](_0x2ddf3e['shift']());}}}(a152_0x208b,0xaab02));function a152_0x208b(){const _0x4760a7=['now','success','prettier','error','info','message','14579577PfZPxp','4646dMnmie','22105FmjKOS','npx','代码格式化失败','998600FfQAtS','开始格式化代码','resolve','3290085rpVSHn','190nafsSu','cwd','726486jtMXwf','format','25130yZaRfO','2696OMLETN'];a152_0x208b=function(){return _0x4760a7;};return a152_0x208b();}function a152_0x1eb9(_0x39d2eb,_0x5174b9){_0x39d2eb=_0x39d2eb-0x17c;const _0x208b09=a152_0x208b();let _0x1eb9d5=_0x208b09[_0x39d2eb];return _0x1eb9d5;}import a152_0x167ae3 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x1140c9){const _0x22be03=a152_0x1eb9,_0xceced2=Date[_0x22be03(0x18b)](),_0x119b9c=a152_0x167ae3[_0x22be03(0x183)](process[_0x22be03(0x186)](),_0x1140c9);try{logger[_0x22be03(0x18f)](_0x22be03(0x188),_0x22be03(0x182),{'projectCode':_0x1140c9}),await execa(resolveNpmBin(_0x22be03(0x17f)),[_0x22be03(0x18d),'--write','.'],{'cwd':_0x119b9c});const _0x33e248=Date[_0x22be03(0x18b)]()-_0xceced2;logger[_0x22be03(0x18c)](_0x22be03(0x188),'代码格式化完成',_0x33e248,{'projectCode':_0x1140c9});}catch(_0x25bb86){const _0x314554=Date[_0x22be03(0x18b)]()-_0xceced2;logger[_0x22be03(0x18e)]('format',_0x22be03(0x180),{'projectCode':_0x1140c9,'error':_0x25bb86 instanceof Error?_0x25bb86[_0x22be03(0x190)]:String(_0x25bb86),'duration':_0x314554});throw _0x25bb86;}return formatElapsed(_0xceced2);}
@@ -1 +1 @@
1
- (function(_0x4e6a40,_0x19e6d1){const _0x31bf1c=a152_0x2b76,_0x549117=_0x4e6a40();while(!![]){try{const _0x2bdaec=-parseInt(_0x31bf1c(0x1c6))/0x1*(-parseInt(_0x31bf1c(0x1bd))/0x2)+-parseInt(_0x31bf1c(0x1b5))/0x3*(-parseInt(_0x31bf1c(0x1b4))/0x4)+parseInt(_0x31bf1c(0x1c3))/0x5+parseInt(_0x31bf1c(0x1c4))/0x6+parseInt(_0x31bf1c(0x1ba))/0x7*(parseInt(_0x31bf1c(0x1bf))/0x8)+parseInt(_0x31bf1c(0x1bc))/0x9+-parseInt(_0x31bf1c(0x1c0))/0xa;if(_0x2bdaec===_0x19e6d1)break;else _0x549117['push'](_0x549117['shift']());}catch(_0x332e15){_0x549117['push'](_0x549117['shift']());}}}(a152_0x23f3,0x4cafd));import a152_0x54fb7c from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a152_0x2b76(_0x5cf70b,_0x3fe678){_0x5cf70b=_0x5cf70b-0x1b4;const _0x23f33a=a152_0x23f3();let _0x2b769a=_0x23f33a[_0x5cf70b];return _0x2b769a;}import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x1238f7){const _0x32c0c5=a152_0x2b76,_0x819030=Date['now'](),_0x2c4333=a152_0x54fb7c[_0x32c0c5(0x1b7)](process['cwd'](),_0x1238f7);try{logger[_0x32c0c5(0x1be)]('install','开始安装依赖',{'projectCode':_0x1238f7,'registry':'https://registry.npmmirror.com'}),await execa(resolveNpmBin(_0x32c0c5(0x1bb)),[_0x32c0c5(0x1c2),'--registry',_0x32c0c5(0x1b6)],{'cwd':_0x2c4333});const _0x433127=Date[_0x32c0c5(0x1c5)]()-_0x819030;logger[_0x32c0c5(0x1b9)](_0x32c0c5(0x1c2),_0x32c0c5(0x1b8),_0x433127,{'projectCode':_0x1238f7});}catch(_0x34f02e){const _0x5dac68=Date[_0x32c0c5(0x1c5)]()-_0x819030;logger[_0x32c0c5(0x1c1)](_0x32c0c5(0x1c2),'依赖安装失败',{'projectCode':_0x1238f7,'error':_0x34f02e instanceof Error?_0x34f02e['message']:String(_0x34f02e),'duration':_0x5dac68});throw _0x34f02e;}return formatElapsed(_0x819030);}function a152_0x23f3(){const _0x2963c4=['1420209wlIWNh','208454oRYLNR','info','586072AOsuOd','19456340LMCwJS','error','install','2473345TEfiPk','2441616yVraAD','now','6twufZE','8mBoQqH','93243DHkAlN','https://registry.npmmirror.com','resolve','依赖安装完成','success','49jlwDXg','npm'];a152_0x23f3=function(){return _0x2963c4;};return a152_0x23f3();}
1
+ (function(_0x10baa4,_0x59723d){const _0x19548a=a153_0xd9ed,_0x8712f1=_0x10baa4();while(!![]){try{const _0x1b9c3d=-parseInt(_0x19548a(0xc7))/0x1+parseInt(_0x19548a(0xc9))/0x2+parseInt(_0x19548a(0xce))/0x3+-parseInt(_0x19548a(0xd3))/0x4+parseInt(_0x19548a(0xc2))/0x5+-parseInt(_0x19548a(0xcc))/0x6*(parseInt(_0x19548a(0xd1))/0x7)+parseInt(_0x19548a(0xd2))/0x8;if(_0x1b9c3d===_0x59723d)break;else _0x8712f1['push'](_0x8712f1['shift']());}catch(_0x275ab3){_0x8712f1['push'](_0x8712f1['shift']());}}}(a153_0x3493,0x9bb4a));import a153_0x5195de from'node:path';function a153_0x3493(){const _0x1be935=['resolve','now','error','412571VnJpwc','npm','1226032YMLebe','install','--registry','103506VYCKJi','依赖安装完成','737499gayhlL','https://registry.npmmirror.com','info','175JwCIra','8635184WLYHqJ','5077356gvzdYE','开始安装依赖','4063540hCAvbZ','cwd'];a153_0x3493=function(){return _0x1be935;};return a153_0x3493();}function a153_0xd9ed(_0x341461,_0x26ff66){_0x341461=_0x341461-0xc2;const _0x349346=a153_0x3493();let _0xd9eda0=_0x349346[_0x341461];return _0xd9eda0;}import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x146029){const _0x4712cc=a153_0xd9ed,_0x34c498=Date['now'](),_0x5fb5a7=a153_0x5195de[_0x4712cc(0xc4)](process[_0x4712cc(0xc3)](),_0x146029);try{logger[_0x4712cc(0xd0)](_0x4712cc(0xca),_0x4712cc(0xd4),{'projectCode':_0x146029,'registry':'https://registry.npmmirror.com'}),await execa(resolveNpmBin(_0x4712cc(0xc8)),[_0x4712cc(0xca),_0x4712cc(0xcb),_0x4712cc(0xcf)],{'cwd':_0x5fb5a7});const _0x2d3569=Date['now']()-_0x34c498;logger['success'](_0x4712cc(0xca),_0x4712cc(0xcd),_0x2d3569,{'projectCode':_0x146029});}catch(_0x5af51b){const _0x35dc42=Date[_0x4712cc(0xc5)]()-_0x34c498;logger[_0x4712cc(0xc6)](_0x4712cc(0xca),'依赖安装失败',{'projectCode':_0x146029,'error':_0x5af51b instanceof Error?_0x5af51b['message']:String(_0x5af51b),'duration':_0x35dc42});throw _0x5af51b;}return formatElapsed(_0x34c498);}
@@ -1 +1 @@
1
- const a153_0x98ef71=a153_0x45f8;function a153_0x4fc1(){const _0x281d90=['trim','186696bwKeSZ','35NFDewO','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','string','yes','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','upgrade','init','validation','cookie','project','../../commands/project/create/main.js','App\x20code\x20to\x20initialize','Usage:\x20','boolean','write','args','294696KUplem','263192VgasyS','315978nuQItI','36AEwAVs','16962pjLAFv','\x20workspace\x20init','str','appcode','env','Project\x20name','Auto-confirm\x20prompts','../../commands/project/create/non-interactive.js','672HpCgDT','project-name','Create\x20a\x20new\x20project','176851rVseFE','Target\x20environment','nonInteractive','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','create','2026-07','name','2768490LXgWfW'];a153_0x4fc1=function(){return _0x281d90;};return a153_0x4fc1();}(function(_0xdb352c,_0x57179c){const _0x5d7be1=a153_0x45f8,_0x1269a8=_0xdb352c();while(!![]){try{const _0x38d0f0=parseInt(_0x5d7be1(0x118))/0x1+-parseInt(_0x5d7be1(0x10a))/0x2+parseInt(_0x5d7be1(0x10b))/0x3+parseInt(_0x5d7be1(0x121))/0x4*(-parseInt(_0x5d7be1(0x122))/0x5)+parseInt(_0x5d7be1(0x10d))/0x6*(parseInt(_0x5d7be1(0x115))/0x7)+-parseInt(_0x5d7be1(0x109))/0x8*(parseInt(_0x5d7be1(0x10c))/0x9)+parseInt(_0x5d7be1(0x11f))/0xa;if(_0x38d0f0===_0x57179c)break;else _0x1269a8['push'](_0x1269a8['shift']());}catch(_0x5aaeee){_0x1269a8['push'](_0x1269a8['shift']());}}}(a153_0x4fc1,0x36df4));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':a153_0x98ef71(0x110),'type':a153_0x98ef71(0x124),'description':a153_0x98ef71(0x104)},{'name':'env','type':'string','description':'Target\x20environment'},{'name':a153_0x98ef71(0x125),'type':a153_0x98ef71(0x106),'description':a153_0x98ef71(0x113),'default':![]}],createFlags=[{'name':'name','type':a153_0x98ef71(0x124),'description':a153_0x98ef71(0x112)},{'name':a153_0x98ef71(0x111),'type':a153_0x98ef71(0x124),'description':a153_0x98ef71(0x119)},{'name':a153_0x98ef71(0x110),'type':a153_0x98ef71(0x124),'description':a153_0x98ef71(0x11b)}],upgradeFlags=[{'name':'yes','type':'boolean','description':'Skip\x20confirmation\x20prompt','default':![]}];function a153_0x45f8(_0x40a4d0,_0xd4e949){_0x40a4d0=_0x40a4d0-0xfd;const _0x4fc1e4=a153_0x4fc1();let _0x45f877=_0x4fc1e4[_0x40a4d0];return _0x45f877;}export const projectDefinitions=[{'service':a153_0x98ef71(0x102),'command':a153_0x98ef71(0xff),'description':'Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','risk':a153_0x98ef71(0x107),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a153_0x98ef71(0x10e),'since':a153_0x98ef71(0x11d)},'flags':initFlags,async 'execute'(_0x41f132){const _0x14440b=a153_0x98ef71;return await initConfig({'appcode':_0x41f132[_0x14440b(0x10f)](_0x14440b(0x110))||undefined,'env':_0x41f132[_0x14440b(0x10f)](_0x14440b(0x111))||undefined,'autoYes':_0x41f132['bool'](_0x14440b(0x125))}),{'ok':!![]};}},{'service':a153_0x98ef71(0x102),'command':a153_0x98ef71(0x11c),'description':a153_0x98ef71(0x117),'risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a153_0x98ef71(0x116),'description':a153_0x98ef71(0x123),'required':![]}],'flags':createFlags,async 'execute'(_0x5e762d){const _0x3d9f69=a153_0x98ef71,{createApp:_0x37e265}=await import(_0x3d9f69(0x103)),{createProjectNonInteractive:_0x26218d}=await import(_0x3d9f69(0x114)),_0x263002=_0x5e762d[_0x3d9f69(0x10f)](_0x3d9f69(0x11e))[_0x3d9f69(0x120)]()||_0x5e762d[_0x3d9f69(0x108)][0x0]?.[_0x3d9f69(0x120)](),_0x58229d=_0x5e762d['str'](_0x3d9f69(0x111))||undefined,_0x6f542c=_0x5e762d['str'](_0x3d9f69(0x110))||undefined;if(_0x5e762d[_0x3d9f69(0x11a)]){if(!_0x263002)throw CliErrors[_0x3d9f69(0x100)](_0x3d9f69(0xfd),_0x3d9f69(0x105)+CLI_BIN_NAME+'\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]');await _0x26218d(_0x263002,_0x58229d,_0x6f542c,_0x5e762d[_0x3d9f69(0x101)]);}else await _0x37e265({'projectCode':_0x263002,'appCode':_0x6f542c,'env':_0x58229d,'cookie':_0x5e762d[_0x3d9f69(0x101)]});return{'ok':!![]};}},{'service':a153_0x98ef71(0x102),'command':a153_0x98ef71(0xfe),'description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','risk':a153_0x98ef71(0x107),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x281d3e){const _0x763c07=a153_0x98ef71;return await upgradeApp(_0x281d3e['nonInteractive'],{'yes':_0x281d3e['bool'](_0x763c07(0x125))}),{'ok':!![]};}}];
1
+ const a154_0x5e56bc=a154_0x4a3a;(function(_0x4a204b,_0x2a347d){const _0x3adc41=a154_0x4a3a,_0xd7540a=_0x4a204b();while(!![]){try{const _0x2b4885=parseInt(_0x3adc41(0x10f))/0x1+parseInt(_0x3adc41(0x10e))/0x2*(parseInt(_0x3adc41(0xf1))/0x3)+-parseInt(_0x3adc41(0x108))/0x4*(parseInt(_0x3adc41(0xf6))/0x5)+-parseInt(_0x3adc41(0x103))/0x6+-parseInt(_0x3adc41(0x113))/0x7+-parseInt(_0x3adc41(0x104))/0x8*(-parseInt(_0x3adc41(0x106))/0x9)+parseInt(_0x3adc41(0xf2))/0xa*(parseInt(_0x3adc41(0x110))/0xb);if(_0x2b4885===_0x2a347d)break;else _0xd7540a['push'](_0xd7540a['shift']());}catch(_0x8dd4c7){_0xd7540a['push'](_0xd7540a['shift']());}}}(a154_0xc4dc,0xbe14c));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';function a154_0xc4dc(){const _0x21465b=['boolean','5fHgtMR','appcode','Skip\x20confirmation\x20prompt','nonInteractive','Usage:\x20','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','App\x20code\x20to\x20initialize','trim','str','Auto-confirm\x20prompts','bool','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','project','4345680vkTIAx','1039160XYWbOU','string','99YSnvXK','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','1315012dNBBUx','upgrade','args','yes','Create\x20a\x20new\x20project','write','318298Kdgrrq','202271UqlSNn','69487hKEvLX','create','cookie','6255032RKBkmE','name','validation','Target\x20environment','2026-07','3VZMNLx','1480NAhStl','project-name','env'];a154_0xc4dc=function(){return _0x21465b;};return a154_0xc4dc();}function a154_0x4a3a(_0x35fbd1,_0x24360c){_0x35fbd1=_0x35fbd1-0xf1;const _0xc4dce7=a154_0xc4dc();let _0x4a3ab5=_0xc4dce7[_0x35fbd1];return _0x4a3ab5;}import{upgradeApp}from'../../commands/project/upgrade.js';const initFlags=[{'name':a154_0x5e56bc(0xf7),'type':'string','description':a154_0x5e56bc(0xfc)},{'name':a154_0x5e56bc(0xf4),'type':a154_0x5e56bc(0x105),'description':a154_0x5e56bc(0x116)},{'name':a154_0x5e56bc(0x10b),'type':'boolean','description':a154_0x5e56bc(0xff),'default':![]}],createFlags=[{'name':a154_0x5e56bc(0x114),'type':a154_0x5e56bc(0x105),'description':'Project\x20name'},{'name':a154_0x5e56bc(0xf4),'type':'string','description':a154_0x5e56bc(0x116)},{'name':'appcode','type':'string','description':a154_0x5e56bc(0xfb)}],upgradeFlags=[{'name':a154_0x5e56bc(0x10b),'type':a154_0x5e56bc(0xf5),'description':a154_0x5e56bc(0xf8),'default':![]}];export const projectDefinitions=[{'service':a154_0x5e56bc(0x102),'command':'init','description':'Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','risk':a154_0x5e56bc(0x10d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+'\x20workspace\x20init','since':a154_0x5e56bc(0x117)},'flags':initFlags,async 'execute'(_0x3f21b3){const _0x3702b7=a154_0x5e56bc;return await initConfig({'appcode':_0x3f21b3['str'](_0x3702b7(0xf7))||undefined,'env':_0x3f21b3[_0x3702b7(0xfe)]('env')||undefined,'autoYes':_0x3f21b3[_0x3702b7(0x100)](_0x3702b7(0x10b))}),{'ok':!![]};}},{'service':a154_0x5e56bc(0x102),'command':a154_0x5e56bc(0x111),'description':a154_0x5e56bc(0x10c),'risk':a154_0x5e56bc(0x10d),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a154_0x5e56bc(0xf3),'description':'Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','required':![]}],'flags':createFlags,async 'execute'(_0x4e1580){const _0x57231d=a154_0x5e56bc,{createApp:_0x4732bb}=await import('../../commands/project/create/main.js'),{createProjectNonInteractive:_0x4b441f}=await import('../../commands/project/create/non-interactive.js'),_0x3743e6=_0x4e1580[_0x57231d(0xfe)](_0x57231d(0x114))['trim']()||_0x4e1580[_0x57231d(0x10a)][0x0]?.[_0x57231d(0xfd)](),_0x27ef56=_0x4e1580[_0x57231d(0xfe)](_0x57231d(0xf4))||undefined,_0x5b5f54=_0x4e1580[_0x57231d(0xfe)](_0x57231d(0xf7))||undefined;if(_0x4e1580[_0x57231d(0xf9)]){if(!_0x3743e6)throw CliErrors[_0x57231d(0x115)]('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.',_0x57231d(0xfa)+CLI_BIN_NAME+_0x57231d(0x101));await _0x4b441f(_0x3743e6,_0x27ef56,_0x5b5f54,_0x4e1580[_0x57231d(0x112)]);}else await _0x4732bb({'projectCode':_0x3743e6,'appCode':_0x5b5f54,'env':_0x27ef56,'cookie':_0x4e1580['cookie']});return{'ok':!![]};}},{'service':'project','command':a154_0x5e56bc(0x109),'description':a154_0x5e56bc(0x107),'risk':a154_0x5e56bc(0x10d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x3658f3){const _0x41800c=a154_0x5e56bc;return await upgradeApp(_0x3658f3['nonInteractive'],{'yes':_0x3658f3[_0x41800c(0x100)]('yes')}),{'ok':!![]};}}];
@@ -1 +1 @@
1
- (function(_0x73c781,_0x44b721){const _0xaea2aa=a154_0x5b55,_0x184950=_0x73c781();while(!![]){try{const _0xb68631=-parseInt(_0xaea2aa(0x138))/0x1*(parseInt(_0xaea2aa(0x13b))/0x2)+-parseInt(_0xaea2aa(0x143))/0x3*(-parseInt(_0xaea2aa(0x13e))/0x4)+-parseInt(_0xaea2aa(0x131))/0x5+-parseInt(_0xaea2aa(0x130))/0x6+-parseInt(_0xaea2aa(0x124))/0x7*(parseInt(_0xaea2aa(0x12a))/0x8)+parseInt(_0xaea2aa(0x13a))/0x9+parseInt(_0xaea2aa(0x155))/0xa;if(_0xb68631===_0x44b721)break;else _0x184950['push'](_0x184950['shift']());}catch(_0x348ff0){_0x184950['push'](_0x184950['shift']());}}}(a154_0x27e1,0xcc8e8));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';function a154_0x27e1(){const _0x32bfc7=['package.json','parse','cyan','app','../..','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','53195690pYVbEx','env','production','\x20\x20appcode:\x20','keys','21WqgHFJ','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','Please\x20enter\x20App\x20Code:','\x20api\x20pull\x27','utf8','version','4424744tgAzUU','1.0.0','appcode','string','join','\x20workspace\x20init`\x20to\x20start\x20fresh.','5711208YXZIed','7152565DevUYy','\x20api\x20generate\x27\x20and\x20\x27','defaultApp','.bak','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory','apps','gray','308026oPynWz','从旧配置文件升级成功','7246926jjrzKC','10TiQWrG','cwd','✓\x20Upgraded\x20','1179484lwVvqz','bold','\x20\x20Apps:\x20','App\x20Code\x20cannot\x20be\x20empty','init','3ijnRcd','Invalid\x20App\x20Code','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','toLocaleString','setLogPath','log','green','info','\x20\x20Default:\x20','trim','?\x20(Old\x20file\x20→\x20*.bak)','\x20→\x20.rabetbase.json'];a154_0x27e1=function(){return _0x32bfc7;};return a154_0x27e1();}import{fileURLToPath}from'node:url';import a154_0x349f9f from'chalk';import{input,confirm}from'@inquirer/prompts';function a154_0x5b55(_0x2dfd8e,_0x152cdd){_0x2dfd8e=_0x2dfd8e-0x123;const _0x27e132=a154_0x27e1();let _0x5b553d=_0x27e132[_0x2dfd8e];return _0x5b553d;}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(_0x2d923d){const _0x415899=a154_0x5b55,{appcode:_0x3bbe6b,env:_0x9ccc0d,autoYes:_0x58ac36}=_0x2d923d,_0xf144d=process[_0x415899(0x13c)]();if(getProjectConfigPath())throw new Error(_0x415899(0x154));let _0x594fd6;for(const _0x3d100c of LEGACY_CONFIG_NAMES){const _0x19b6fa=resolve(_0xf144d,_0x3d100c);if(existsSync(_0x19b6fa)){_0x594fd6=_0x19b6fa;break;}}if(_0x594fd6){let _0x5d7894={};try{_0x5d7894=JSON[_0x415899(0x150)](readFileSync(_0x594fd6,_0x415899(0x128)));}catch{}const _0x2f6ba5=basename(_0x594fd6),_0x41808c=_0x5d7894?.[_0x415899(0x12c)]||_0x5d7894?.['app'];let _0x41d7cd=_0x58ac36;!_0x58ac36&&(console['log'](a154_0x349f9f['yellow']('⚠\x20Found\x20legacy\x20configuration\x20file:\x20'+a154_0x349f9f[_0x415899(0x13f)](_0x2f6ba5))),_0x41808c&&console[_0x415899(0x148)](a154_0x349f9f['cyan'](_0x415899(0x158)+_0x41808c)),_0x41d7cd=await confirm({'message':'Upgrade\x20it\x20to\x20'+a154_0x349f9f['bold']('.rabetbase.json')+_0x415899(0x14d),'default':!![]}));if(!_0x41d7cd){console[_0x415899(0x148)]('Migration\x20cancelled.\x20Run\x20`'+CLI_BIN_NAME+_0x415899(0x12f));return;}const _0x54ccc9=resolve(_0xf144d,NEW_CONFIG_NAME),_0x1106ac=getCliVersionFromPkg(),_0x2d3cb1=readRawConfig(),_0x2a7e60=_0x3bbe6b||(typeof _0x5d7894?.[_0x415899(0x12c)]===_0x415899(0x12d)?_0x5d7894[_0x415899(0x12c)]:undefined)||(typeof _0x5d7894?.[_0x415899(0x152)]===_0x415899(0x12d)?_0x5d7894[_0x415899(0x152)]:undefined)||await askAppcode(),_0x146cbf=typeof _0x5d7894?.[_0x415899(0x156)]===_0x415899(0x12d)?_0x5d7894[_0x415899(0x156)]:typeof _0x2d3cb1['env']===_0x415899(0x12d)?_0x2d3cb1[_0x415899(0x156)]:_0x415899(0x157),_0xb8a442=buildCanonicalProjectConfig({..._0x2d3cb1,..._0x5d7894},{'appCodes':[_0x2a7e60],'env':_0x146cbf,'metadata':{'version':_0x1106ac,'migratedAt':new Date()[_0x415899(0x146)](),'migratedFrom':_0x594fd6}});writeConfigFile(_0x54ccc9,_0xb8a442);const _0x5c4043=_0x594fd6+_0x415899(0x134);renameSync(_0x594fd6,_0x5c4043),logger[_0x415899(0x147)](_0xf144d),logger[_0x415899(0x14a)](_0x415899(0x142),_0x415899(0x139),{'from':_0x594fd6,'to':_0x54ccc9,'appcode':_0x2a7e60,'env':_0xb8a442['env']}),console['log'](a154_0x349f9f[_0x415899(0x149)](_0x415899(0x13d)+_0x2f6ba5+_0x415899(0x14e))),console[_0x415899(0x148)](a154_0x349f9f[_0x415899(0x151)](_0x415899(0x140)+Object[_0x415899(0x123)](_0xb8a442[_0x415899(0x136)]||{})[_0x415899(0x12e)](',\x20'))),console[_0x415899(0x148)](a154_0x349f9f['cyan']('\x20\x20Default:\x20'+_0xb8a442['defaultApp'])),console[_0x415899(0x148)](a154_0x349f9f[_0x415899(0x137)](_0x415899(0x125)+_0x2f6ba5+_0x415899(0x134)));return;}const _0x53cddf=_0x3bbe6b||await askAppcode(),_0x2d81d2=resolve(_0xf144d,NEW_CONFIG_NAME),_0x22ecd0=getCliVersionFromPkg(),_0x27aad0=readRawConfig(),_0x518447=typeof _0x27aad0[_0x415899(0x156)]===_0x415899(0x12d)?_0x27aad0[_0x415899(0x156)]:undefined,_0x332cfd=buildCanonicalProjectConfig({},{'appCodes':[_0x53cddf],'env':_0x9ccc0d||_0x518447||_0x415899(0x157),'metadata':{'version':_0x22ecd0,'createdAt':new Date()[_0x415899(0x146)]()}});writeConfigFile(_0x2d81d2,_0x332cfd),logger[_0x415899(0x147)](_0xf144d),logger['info']('init','初始化项目配置文件成功',{'appcode':_0x53cddf,'env':_0x332cfd[_0x415899(0x156)],'version':_0x332cfd[_0x415899(0x129)],'configPath':_0x2d81d2}),console[_0x415899(0x148)](a154_0x349f9f['green'](_0x415899(0x135))),console[_0x415899(0x148)](a154_0x349f9f['cyan']('\x20\x20Apps:\x20'+Object['keys'](_0x332cfd['apps']||{})[_0x415899(0x12e)](',\x20'))),console['log'](a154_0x349f9f[_0x415899(0x151)](_0x415899(0x14b)+_0x332cfd[_0x415899(0x133)])),console['log'](_0x415899(0x145)+CLI_BIN_NAME+_0x415899(0x132)+CLI_BIN_NAME+_0x415899(0x127));}function askAppcode(){const _0x5776ac=a154_0x5b55;return input({'message':_0x5776ac(0x126),'validate':_0xb8fd5a=>{const _0x4d259c=_0x5776ac;if(!_0xb8fd5a[_0x4d259c(0x14c)]())return _0x4d259c(0x141);const {valid:_0x472668,message:_0x2e3206}=validateAppcode(_0xb8fd5a['trim']());return _0x472668||_0x2e3206||_0x4d259c(0x144);}});}function getCliVersionFromPkg(){const _0xaabcc6=a154_0x5b55;try{const _0xf7aa76=fileURLToPath(import.meta.url),_0x1700f7=resolve(dirname(_0xf7aa76),_0xaabcc6(0x153)),_0x2013b3=JSON['parse'](readFileSync(resolve(_0x1700f7,_0xaabcc6(0x14f)),_0xaabcc6(0x128)));return _0x2013b3[_0xaabcc6(0x129)]||_0xaabcc6(0x12b);}catch{return _0xaabcc6(0x12b);}}
1
+ (function(_0x589c03,_0x4edddb){const _0x343252=a155_0x5ee0,_0x319fae=_0x589c03();while(!![]){try{const _0x45ba50=-parseInt(_0x343252(0x98))/0x1*(parseInt(_0x343252(0xb0))/0x2)+parseInt(_0x343252(0x9f))/0x3+-parseInt(_0x343252(0x99))/0x4*(-parseInt(_0x343252(0xb8))/0x5)+-parseInt(_0x343252(0xaf))/0x6*(parseInt(_0x343252(0x9d))/0x7)+parseInt(_0x343252(0x9b))/0x8*(-parseInt(_0x343252(0x8a))/0x9)+parseInt(_0x343252(0x8e))/0xa*(parseInt(_0x343252(0x8c))/0xb)+-parseInt(_0x343252(0xae))/0xc*(-parseInt(_0x343252(0xb5))/0xd);if(_0x45ba50===_0x4edddb)break;else _0x319fae['push'](_0x319fae['shift']());}catch(_0x5aea62){_0x319fae['push'](_0x319fae['shift']());}}}(a155_0xb8d6,0xb49ed));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a155_0x2260df from'chalk';function a155_0x5ee0(_0x300587,_0x58ceae){_0x300587=_0x300587-0x84;const _0xb8d64a=a155_0xb8d6();let _0x5ee0e6=_0xb8d64a[_0x300587];return _0x5ee0e6;}import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';function a155_0xb8d6(){const _0x21df82=['log','?\x20(Old\x20file\x20→\x20*.bak)','Invalid\x20App\x20Code','\x20\x20appcode:\x20','keys','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','gray','utf8','defaultApp','170355BzcvCs','172ChnIFE','app','32fYpaJt','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory','109438dLUeOt','trim','1681242GfztKm','version','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','info','cyan','\x20\x20Default:\x20','\x20\x20Apps:\x20','.bak','\x20api\x20pull\x27','env','Migration\x20cancelled.\x20Run\x20`','join','✓\x20Upgraded\x20','toLocaleString','setLogPath','53052QaLlBe','498fwHrpv','6QrDouo','production','yellow','\x20workspace\x20init`\x20to\x20start\x20fresh.','green','3159KVhzRQ','App\x20Code\x20cannot\x20be\x20empty','string','103015IKHqED','parse','Upgrade\x20it\x20to\x20','init','../..','bold','apps','初始化项目配置文件成功','package.json','83844XzCBbz','appcode','11gSRqZQ','1.0.0','651260tVsMSp'];a155_0xb8d6=function(){return _0x21df82;};return a155_0xb8d6();}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(_0xdfacbe){const _0x3e4e98=a155_0x5ee0,{appcode:_0x83fa6b,env:_0x548466,autoYes:_0x1ab3c2}=_0xdfacbe,_0x3ff06d=process['cwd']();if(getProjectConfigPath())throw new Error(_0x3e4e98(0xa1));let _0x32f8e2;for(const _0xf8fa62 of LEGACY_CONFIG_NAMES){const _0x99905e=resolve(_0x3ff06d,_0xf8fa62);if(existsSync(_0x99905e)){_0x32f8e2=_0x99905e;break;}}if(_0x32f8e2){let _0x2da640={};try{_0x2da640=JSON['parse'](readFileSync(_0x32f8e2,'utf8'));}catch{}const _0x3e9fc3=basename(_0x32f8e2),_0x1ea61d=_0x2da640?.['appcode']||_0x2da640?.[_0x3e4e98(0x9a)];let _0x1e6ca2=_0x1ab3c2;!_0x1ab3c2&&(console[_0x3e4e98(0x8f)](a155_0x2260df[_0x3e4e98(0xb2)]('⚠\x20Found\x20legacy\x20configuration\x20file:\x20'+a155_0x2260df[_0x3e4e98(0x86)](_0x3e9fc3))),_0x1ea61d&&console['log'](a155_0x2260df['cyan'](_0x3e4e98(0x92)+_0x1ea61d)),_0x1e6ca2=await confirm({'message':_0x3e4e98(0xba)+a155_0x2260df[_0x3e4e98(0x86)]('.rabetbase.json')+_0x3e4e98(0x90),'default':!![]}));if(!_0x1e6ca2){console[_0x3e4e98(0x8f)](_0x3e4e98(0xa9)+CLI_BIN_NAME+_0x3e4e98(0xb3));return;}const _0x90349b=resolve(_0x3ff06d,NEW_CONFIG_NAME),_0x27577c=getCliVersionFromPkg(),_0x19e066=readRawConfig(),_0x13525c=_0x83fa6b||(typeof _0x2da640?.[_0x3e4e98(0x8b)]==='string'?_0x2da640[_0x3e4e98(0x8b)]:undefined)||(typeof _0x2da640?.['app']==='string'?_0x2da640[_0x3e4e98(0x9a)]:undefined)||await askAppcode(),_0x5996c3=typeof _0x2da640?.[_0x3e4e98(0xa8)]===_0x3e4e98(0xb7)?_0x2da640[_0x3e4e98(0xa8)]:typeof _0x19e066[_0x3e4e98(0xa8)]==='string'?_0x19e066[_0x3e4e98(0xa8)]:_0x3e4e98(0xb1),_0x3fe207=buildCanonicalProjectConfig({..._0x19e066,..._0x2da640},{'appCodes':[_0x13525c],'env':_0x5996c3,'metadata':{'version':_0x27577c,'migratedAt':new Date()[_0x3e4e98(0xac)](),'migratedFrom':_0x32f8e2}});writeConfigFile(_0x90349b,_0x3fe207);const _0x125303=_0x32f8e2+_0x3e4e98(0xa6);renameSync(_0x32f8e2,_0x125303),logger[_0x3e4e98(0xad)](_0x3ff06d),logger[_0x3e4e98(0xa2)](_0x3e4e98(0x84),'从旧配置文件升级成功',{'from':_0x32f8e2,'to':_0x90349b,'appcode':_0x13525c,'env':_0x3fe207[_0x3e4e98(0xa8)]}),console['log'](a155_0x2260df[_0x3e4e98(0xb4)](_0x3e4e98(0xab)+_0x3e9fc3+'\x20→\x20.rabetbase.json')),console[_0x3e4e98(0x8f)](a155_0x2260df[_0x3e4e98(0xa3)](_0x3e4e98(0xa5)+Object[_0x3e4e98(0x93)](_0x3fe207[_0x3e4e98(0x87)]||{})[_0x3e4e98(0xaa)](',\x20'))),console[_0x3e4e98(0x8f)](a155_0x2260df['cyan'](_0x3e4e98(0xa4)+_0x3fe207[_0x3e4e98(0x97)])),console[_0x3e4e98(0x8f)](a155_0x2260df[_0x3e4e98(0x95)]('\x20\x20Old\x20file\x20backed\x20up\x20as\x20'+_0x3e9fc3+_0x3e4e98(0xa6)));return;}const _0x277d44=_0x83fa6b||await askAppcode(),_0x28a973=resolve(_0x3ff06d,NEW_CONFIG_NAME),_0x26fe98=getCliVersionFromPkg(),_0x38eec0=readRawConfig(),_0x56b283=typeof _0x38eec0['env']===_0x3e4e98(0xb7)?_0x38eec0[_0x3e4e98(0xa8)]:undefined,_0x243688=buildCanonicalProjectConfig({},{'appCodes':[_0x277d44],'env':_0x548466||_0x56b283||_0x3e4e98(0xb1),'metadata':{'version':_0x26fe98,'createdAt':new Date()[_0x3e4e98(0xac)]()}});writeConfigFile(_0x28a973,_0x243688),logger[_0x3e4e98(0xad)](_0x3ff06d),logger[_0x3e4e98(0xa2)](_0x3e4e98(0x84),_0x3e4e98(0x88),{'appcode':_0x277d44,'env':_0x243688[_0x3e4e98(0xa8)],'version':_0x243688[_0x3e4e98(0xa0)],'configPath':_0x28a973}),console[_0x3e4e98(0x8f)](a155_0x2260df['green'](_0x3e4e98(0x9c))),console[_0x3e4e98(0x8f)](a155_0x2260df[_0x3e4e98(0xa3)](_0x3e4e98(0xa5)+Object[_0x3e4e98(0x93)](_0x243688[_0x3e4e98(0x87)]||{})['join'](',\x20'))),console[_0x3e4e98(0x8f)](a155_0x2260df[_0x3e4e98(0xa3)](_0x3e4e98(0xa4)+_0x243688[_0x3e4e98(0x97)])),console[_0x3e4e98(0x8f)](_0x3e4e98(0x94)+CLI_BIN_NAME+'\x20api\x20generate\x27\x20and\x20\x27'+CLI_BIN_NAME+_0x3e4e98(0xa7));}function askAppcode(){return input({'message':'Please\x20enter\x20App\x20Code:','validate':_0x56dbd6=>{const _0x3e4248=a155_0x5ee0;if(!_0x56dbd6[_0x3e4248(0x9e)]())return _0x3e4248(0xb6);const {valid:_0x4f252d,message:_0x1f11bb}=validateAppcode(_0x56dbd6[_0x3e4248(0x9e)]());return _0x4f252d||_0x1f11bb||_0x3e4248(0x91);}});}function getCliVersionFromPkg(){const _0xbf005e=a155_0x5ee0;try{const _0x17799b=fileURLToPath(import.meta.url),_0x3cd7e5=resolve(dirname(_0x17799b),_0xbf005e(0x85)),_0x3c4b2f=JSON[_0xbf005e(0xb9)](readFileSync(resolve(_0x3cd7e5,_0xbf005e(0x89)),_0xbf005e(0x96)));return _0x3c4b2f[_0xbf005e(0xa0)]||_0xbf005e(0x8d);}catch{return _0xbf005e(0x8d);}}
@@ -1 +1 @@
1
- const a155_0x1c0b2e=a155_0x1321;(function(_0x37c82a,_0x40add0){const _0x24fba5=a155_0x1321,_0x174b0c=_0x37c82a();while(!![]){try{const _0x526ff4=-parseInt(_0x24fba5(0xcc))/0x1*(-parseInt(_0x24fba5(0xfa))/0x2)+-parseInt(_0x24fba5(0x100))/0x3+parseInt(_0x24fba5(0xb6))/0x4+-parseInt(_0x24fba5(0xbc))/0x5+-parseInt(_0x24fba5(0xd4))/0x6+-parseInt(_0x24fba5(0x12a))/0x7*(parseInt(_0x24fba5(0xdc))/0x8)+parseInt(_0x24fba5(0xd5))/0x9;if(_0x526ff4===_0x40add0)break;else _0x174b0c['push'](_0x174b0c['shift']());}catch(_0x51cd8c){_0x174b0c['push'](_0x174b0c['shift']());}}}(a155_0x16f6,0xb720e));import a155_0x580ef9 from'chalk';import a155_0x9c4165 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';function a155_0x16f6(){const _0xc3c93=['gray','Step\x201/7:\x20Config\x20migration\x20—\x20','some','Upgrade\x20@lovrabet/sdk','\x20removed\x20(','Proceed\x20with\x20upgrade?','2674rtaEFx','Config\x20migration','needed','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','failed','detail','\x20\x20Action:\x20delete','configMigration','263112jCIxxC','13187070wAGPGe','join','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','isDirectory','.lovrabet','label','.claude/skills/lovrabet','659544cKckHB','no\x20legacy\x20config\x20found','@lovrabet/sdk:','isArray','Step\x204/7:\x20Cleaning\x20MCP\x20config...','lovrabet/lovrabet-skill\x20removed','FAIL','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','start','undefined','sdkUpgrade','package.json','\x20\x20#\x20or','FOUND','not\x20found\x20or\x20already\x20at\x20latest','Remove\x20.lovrabet/','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','not\x20needed','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','\x20\x20Fields\x20to\x20migrate:\x20','fail','yellow','done','Remove\x20legacy\x20artifacts','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','string','\x20\x20bun\x20install','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','keys','\x20\x20\x20\x20\x20\x20\x20','546Gtbjtu','Step\x205/7:\x20Removing\x20old\x20skill...','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','utf8','cwd','bold','2552076QryQfQ','oldMcpConfig','status','Step\x201/7:\x20Migrating\x20config...','.cursor/mcp.json','stringify','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','Config\x20file:','log','yes','entries','Install\x20new\x20skill','args','Remove\x20old\x20skill','===\x20Upgrade\x20Analysis\x20===','exit\x20','.cursor/rules/lovrabet_rules.mdc','files','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','info','message','dependencies','Legacy\x20artifacts:','devDependencies','oldPath','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','includes','cyan','mcpServers','\x20from\x20','Upgrade\x20cancelled.','\x20→\x20latest','path','push','\x20\x20Step\x20','hasNewConfig','.bak','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','length','lovrabet/rabetbase\x20installed\x20globally','\x20removed','fields','28spUbty','[\x22@lovrabet/sdk\x22]:\x20','MCP\x20config:','@lovrabet/dataset-mcp-server','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','parse','Clean\x20MCP\x20config','Upgrade\x20completed\x20successfully!','latest','inherit','green','skipped','white','error','269104OPMdwx','filter','===\x20Upgrade\x20Summary\x20===','Step\x204/7:\x20MCP\x20config\x20—\x20','removed\x20','@lovrabet/sdk','1440490AdNBxl','needsSkillSwap','object','\x20\x20npm\x20install','\x20→\x20','succeed','step','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','red','\x20\x20New\x20config\x20(.rabetbase.json):\x20'];a155_0x16f6=function(){return _0xc3c93;};return a155_0x16f6();}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[a155_0x1c0b2e(0xb7)](_0x27cd1a=>_0x27cd1a!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x3c172e){const _0x13a261=a155_0x1c0b2e,_0x233b17=[];for(const _0x210650 of Object['values'](CORE_IDE_CONFIGS)){if(_0x210650[_0x13a261(0x111)])for(const _0x4bf521 of _0x210650[_0x13a261(0x111)]){_0x233b17[_0x13a261(0x121)](resolve(_0x3c172e,_0x4bf521[_0x13a261(0x120)]));}}return _0x233b17;}function analyse(_0x1ae51e){const _0x5e6b1d=a155_0x1c0b2e;let _0x30e276=null;const _0x9a989e=resolve(_0x1ae51e,NEW_CONFIG_NAME),_0x277b33=existsSync(_0x9a989e);for(const _0x9a4320 of LEGACY_CONFIG_NAMES){const _0x7f4c64=resolve(_0x1ae51e,_0x9a4320);if(existsSync(_0x7f4c64)){const _0x161b9b=readConfigFile(_0x7f4c64),_0xe46b1d=Object[_0x5e6b1d(0xf8)](_0x161b9b)['filter'](_0x26a791=>typeof _0x161b9b[_0x26a791]!==_0x5e6b1d(0xe5));_0x30e276={'oldPath':_0x7f4c64,'hasNewConfig':_0x277b33,'fields':_0xe46b1d};break;}}const _0x286dad=[],_0x34e672=resolve(_0x1ae51e,_0x5e6b1d(0xd9));if(existsSync(_0x34e672))_0x286dad[_0x5e6b1d(0x121)](_0x34e672);const _0x312356=resolve(_0x1ae51e,_0x5e6b1d(0x110));if(existsSync(_0x312356))_0x286dad[_0x5e6b1d(0x121)](_0x312356);const _0x340893=resolve(_0x1ae51e,_0x5e6b1d(0xdb));if(existsSync(_0x340893))_0x286dad[_0x5e6b1d(0x121)](_0x340893);for(const _0x4ca771 of collectIdeSkillFiles(_0x1ae51e)){if(existsSync(_0x4ca771))_0x286dad[_0x5e6b1d(0x121)](_0x4ca771);}let _0x4b2edd=null;const _0x2b16e9=resolve(_0x1ae51e,_0x5e6b1d(0x104));if(existsSync(_0x2b16e9))try{const _0x509f60=JSON['parse'](readFileSync(_0x2b16e9,_0x5e6b1d(0xfd)));if(_0x509f60?.[_0x5e6b1d(0x11c)]&&typeof _0x509f60['mcpServers']===_0x5e6b1d(0xbe)){const _0x268296=[];for(const [_0x153fdf,_0xaed6c]of Object[_0x5e6b1d(0x10a)](_0x509f60[_0x5e6b1d(0x11c)])){const _0x46d927=_0xaed6c;_0x46d927?.[_0x5e6b1d(0x10c)]&&Array[_0x5e6b1d(0xdf)](_0x46d927[_0x5e6b1d(0x10c)])&&_0x46d927[_0x5e6b1d(0x10c)]['some'](_0x4bbc84=>typeof _0x4bbc84===_0x5e6b1d(0xf5)&&_0x4bbc84[_0x5e6b1d(0x11a)]('@lovrabet/dataset-mcp-server'))&&_0x268296[_0x5e6b1d(0x121)](_0x153fdf);}_0x268296[_0x5e6b1d(0x126)]>0x0&&(_0x4b2edd={'path':_0x2b16e9,'keys':_0x268296});}}catch{}const _0x34f61d=_0x286dad[_0x5e6b1d(0x126)]>0x0||_0x30e276!==null;let _0x14c10a=null;const _0x2df59e=resolve(_0x1ae51e,_0x5e6b1d(0xe7));if(existsSync(_0x2df59e))try{const _0x46274d=JSON[_0x5e6b1d(0x12f)](readFileSync(_0x2df59e,_0x5e6b1d(0xfd)));for(const _0x39c46c of[_0x5e6b1d(0x115),_0x5e6b1d(0x117)]){const _0x87becc=_0x46274d?.[_0x39c46c]?.[_0x5e6b1d(0xbb)];if(typeof _0x87becc===_0x5e6b1d(0xf5)){_0x87becc!==_0x5e6b1d(0x132)&&(_0x14c10a={'pkgPath':_0x2df59e,'currentVersion':_0x87becc,'field':_0x39c46c});break;}}}catch{}return{'configMigration':_0x30e276,'oldArtifacts':_0x286dad,'oldMcpConfig':_0x4b2edd,'needsSkillSwap':_0x34f61d,'sdkUpgrade':_0x14c10a};}function printReport(_0x37b3f9){const _0x54a466=a155_0x1c0b2e,{configMigration:_0x3cc43d,oldArtifacts:_0x4e2567,oldMcpConfig:_0x35c264,needsSkillSwap:_0x2437a8}=_0x37b3f9;console[_0x54a466(0x108)](''),console['log'](a155_0x580ef9[_0x54a466(0xff)](_0x54a466(0x10e))),console[_0x54a466(0x108)]('');_0x3cc43d?(console[_0x54a466(0x108)](a155_0x580ef9[_0x54a466(0x11b)](_0x54a466(0x107))+('\x20\x20'+a155_0x580ef9['yellow'](_0x3cc43d['oldPath']))),console['log'](_0x54a466(0xc5)+(_0x3cc43d[_0x54a466(0x123)]?a155_0x580ef9['green']('already\x20exists\x20(will\x20merge)'):a155_0x580ef9[_0x54a466(0xc6)]('not\x20found\x20(will\x20create)'))),console['log'](_0x54a466(0xef)+_0x3cc43d[_0x54a466(0x129)][_0x54a466(0xd6)](',\x20')),console[_0x54a466(0x108)]('\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak')):console[_0x54a466(0x108)](a155_0x580ef9['cyan']('Config\x20file:')+'\x20\x20'+a155_0x580ef9[_0x54a466(0xc6)](_0x54a466(0xdd)));console[_0x54a466(0x108)]('');if(_0x4e2567[_0x54a466(0x126)]>0x0){console[_0x54a466(0x108)](a155_0x580ef9[_0x54a466(0x11b)](_0x54a466(0x116)));for(const _0x1039a1 of _0x4e2567){console[_0x54a466(0x108)]('\x20\x20'+a155_0x580ef9[_0x54a466(0xc4)](_0x54a466(0xe9))+'\x20\x20'+_0x1039a1);}console['log'](_0x54a466(0xd2));}else console[_0x54a466(0x108)](a155_0x580ef9[_0x54a466(0x11b)](_0x54a466(0x116))+'\x20\x20'+a155_0x580ef9['gray']('none\x20found'));console[_0x54a466(0x108)]('');_0x35c264?(console[_0x54a466(0x108)](a155_0x580ef9[_0x54a466(0x11b)](_0x54a466(0x12c))+('\x20\x20'+a155_0x580ef9['yellow'](_0x35c264['path'])+'\x20→\x20keys:\x20'+_0x35c264[_0x54a466(0xf8)][_0x54a466(0xd6)](',\x20'))),console[_0x54a466(0x108)](_0x54a466(0x119))):console[_0x54a466(0x108)](a155_0x580ef9[_0x54a466(0x11b)](_0x54a466(0x12c))+'\x20\x20'+a155_0x580ef9[_0x54a466(0xc6)]('no\x20legacy\x20entry'));console[_0x54a466(0x108)](''),console[_0x54a466(0x108)](a155_0x580ef9['cyan']('Skill\x20swap:')+('\x20\x20'+(_0x2437a8?a155_0x580ef9[_0x54a466(0xf1)](_0x54a466(0xce)):a155_0x580ef9[_0x54a466(0x134)](_0x54a466(0xed)))));_0x2437a8&&console['log'](_0x54a466(0xee)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console['log']('');if(_0x37b3f9[_0x54a466(0xe6)]){const {currentVersion:_0x36f413,field:_0x130262,pkgPath:_0x159131}=_0x37b3f9[_0x54a466(0xe6)];console[_0x54a466(0x108)](a155_0x580ef9[_0x54a466(0x11b)](_0x54a466(0xde))+('\x20\x20'+a155_0x580ef9[_0x54a466(0xf1)](_0x159131))),console[_0x54a466(0x108)]('\x20\x20Current\x20version\x20in\x20'+_0x130262+':\x20'+a155_0x580ef9[_0x54a466(0xf1)](_0x36f413)+_0x54a466(0xc0)+a155_0x580ef9[_0x54a466(0x134)](_0x54a466(0x132))),console[_0x54a466(0x108)](_0x54a466(0xcf));}else console[_0x54a466(0x108)](a155_0x580ef9[_0x54a466(0x11b)](_0x54a466(0xde))+'\x20\x20'+a155_0x580ef9[_0x54a466(0xc6)](_0x54a466(0xea)));console[_0x54a466(0x108)]('');}function execConfigMigration(_0x1ff9f8,_0x33014a){const _0x2ef45c=a155_0x1c0b2e,{configMigration:_0x271073}=_0x1ff9f8;if(!_0x271073?.[_0x2ef45c(0x118)])return{'step':0x1,'label':_0x2ef45c(0xcd),'ok':!![],'detail':'skipped\x20(no\x20legacy\x20config)'};const _0x2cc713=readConfigFile(_0x271073[_0x2ef45c(0x118)]),_0x5e60ce=resolve(_0x33014a,NEW_CONFIG_NAME),_0x46cb6f=_0x271073['hasNewConfig']?readConfigFile(_0x5e60ce):{};for(const [_0x167b78,_0x159dca]of Object['entries'](_0x2cc713)){!(_0x167b78 in _0x46cb6f)&&(_0x46cb6f[_0x167b78]=_0x159dca);}writeConfigFile(_0x5e60ce,_0x46cb6f);const _0x41d184=_0x271073[_0x2ef45c(0x118)]+_0x2ef45c(0x124);return renameSync(_0x271073[_0x2ef45c(0x118)],_0x41d184),{'step':0x1,'label':_0x2ef45c(0xcd),'ok':!![],'detail':_0x271073[_0x2ef45c(0x118)]+_0x2ef45c(0xc0)+_0x5e60ce+'\x20(backup:\x20'+_0x41d184+')'};}function execRemoveOldArtifacts(_0x174d03){const _0x472f45=a155_0x1c0b2e,_0x348cb8=[];for(const _0x13ee74 of _0x174d03){try{if(!existsSync(_0x13ee74))continue;const _0xbe38db=tryStat(_0x13ee74);_0xbe38db?.[_0x472f45(0xd8)]()?rmSync(_0x13ee74,{'recursive':!![],'force':!![]}):unlinkSync(_0x13ee74);}catch(_0x6cc61b){_0x348cb8[_0x472f45(0x121)](_0x13ee74+':\x20'+_0x6cc61b[_0x472f45(0x114)]);}}return{'step':0x3,'label':_0x472f45(0xf3),'ok':_0x348cb8[_0x472f45(0x126)]===0x0,'detail':_0x348cb8[_0x472f45(0x126)]>0x0?_0x174d03[_0x472f45(0x126)]-_0x348cb8[_0x472f45(0x126)]+'/'+_0x174d03[_0x472f45(0x126)]+_0x472f45(0xca)+_0x348cb8[_0x472f45(0xd6)](';\x20')+')':_0x174d03[_0x472f45(0x126)]+_0x472f45(0x128)};}function execCleanMcp(_0x9f90b7){const _0x54cb15=a155_0x1c0b2e;if(!_0x9f90b7['oldMcpConfig'])return{'step':0x4,'label':_0x54cb15(0x130),'ok':!![],'detail':_0x54cb15(0x135)};try{const _0x7eda97=readFileSync(_0x9f90b7[_0x54cb15(0x101)][_0x54cb15(0x120)],'utf8'),_0x2a7441=JSON['parse'](_0x7eda97);if(_0x2a7441?.['mcpServers']&&typeof _0x2a7441['mcpServers']===_0x54cb15(0xbe)){const _0x5a0a44=[];for(const [_0x5ecdee,_0xdf9c0e]of Object[_0x54cb15(0x10a)](_0x2a7441[_0x54cb15(0x11c)])){_0xdf9c0e?.[_0x54cb15(0x10c)]&&Array['isArray'](_0xdf9c0e[_0x54cb15(0x10c)])&&_0xdf9c0e['args'][_0x54cb15(0xc8)](_0x5e8ce7=>typeof _0x5e8ce7===_0x54cb15(0xf5)&&_0x5e8ce7[_0x54cb15(0x11a)](_0x54cb15(0x12d)))&&_0x5a0a44[_0x54cb15(0x121)](_0x5ecdee);}for(const _0x164f06 of _0x5a0a44){delete _0x2a7441[_0x54cb15(0x11c)][_0x164f06];}return _0x5a0a44[_0x54cb15(0x126)]>0x0&&writeFileSync(_0x9f90b7['oldMcpConfig'][_0x54cb15(0x120)],JSON[_0x54cb15(0x105)](_0x2a7441,null,0x2)+'\x0a',_0x54cb15(0xfd)),{'step':0x4,'label':_0x54cb15(0x130),'ok':!![],'detail':_0x54cb15(0xba)+_0x5a0a44[_0x54cb15(0xd6)](',\x20')+_0x54cb15(0x11d)+_0x9f90b7[_0x54cb15(0x101)]['path']};}return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':'no\x20matching\x20entry\x20found'};}catch(_0xff4082){return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':![],'detail':_0xff4082[_0x54cb15(0x114)]};}}function execSkillsRemove(_0x57456e,_0x516d4e){const _0x178b86=a155_0x1c0b2e,_0x3c15f1=runNpxSkillsRemove(_0x57456e,{'stdio':_0x178b86(0x133),'yes':_0x516d4e});return{'step':0x5,'label':_0x178b86(0x10d),'ok':_0x3c15f1['ok'],'detail':_0x3c15f1['ok']?_0x178b86(0xe1):_0x3c15f1[_0x178b86(0x137)]??_0x178b86(0x10f)+_0x3c15f1[_0x178b86(0x102)]};}function execSkillsAdd(_0x14a2c8,_0x4c5dbe){const _0x3d4dc5=a155_0x1c0b2e,_0x8183cc=runNpxSkillsAddGlobal(_0x14a2c8,'lovrabet/rabetbase',{'stdio':_0x3d4dc5(0x133),'yes':_0x4c5dbe});return{'step':0x6,'label':_0x3d4dc5(0x10b),'ok':_0x8183cc['ok'],'detail':_0x8183cc['ok']?_0x3d4dc5(0x127):_0x8183cc[_0x3d4dc5(0x137)]??'exit\x20'+_0x8183cc[_0x3d4dc5(0x102)]};}function execUpgradeSdk(_0xf386ef){const _0xdcef49=a155_0x1c0b2e;if(!_0xf386ef['sdkUpgrade'])return{'step':0x7,'label':_0xdcef49(0xc9),'ok':!![],'detail':_0xdcef49(0x106)};const {pkgPath:_0xe7dd14,currentVersion:_0xa7ffdd,field:_0x25831f}=_0xf386ef[_0xdcef49(0xe6)];try{const _0x51a5d1=readFileSync(_0xe7dd14,_0xdcef49(0xfd)),_0x6817cc=JSON[_0xdcef49(0x12f)](_0x51a5d1);return _0x6817cc[_0x25831f][_0xdcef49(0xbb)]=_0xdcef49(0x132),writeFileSync(_0xe7dd14,JSON[_0xdcef49(0x105)](_0x6817cc,null,0x2)+'\x0a',_0xdcef49(0xfd)),{'step':0x7,'label':_0xdcef49(0xc9),'ok':!![],'detail':_0x25831f+_0xdcef49(0x12b)+_0xa7ffdd+_0xdcef49(0x11f)};}catch(_0x1cce5b){return{'step':0x7,'label':_0xdcef49(0xc9),'ok':![],'detail':_0x1cce5b['message']};}}function tryStat(_0x21f1e2){try{return statSync(_0x21f1e2);}catch{return undefined;}}function a155_0x1321(_0x5d24b9,_0x427e1d){_0x5d24b9=_0x5d24b9-0xb6;const _0x16f6e2=a155_0x16f6();let _0x1321c9=_0x16f6e2[_0x5d24b9];return _0x1321c9;}function printSummary(_0x455e65){const _0x2e34f9=a155_0x1c0b2e;console[_0x2e34f9(0x108)](''),console[_0x2e34f9(0x108)](a155_0x580ef9[_0x2e34f9(0xff)](_0x2e34f9(0xb8))),console['log']('');for(const _0x49d64b of _0x455e65){const _0x744ff1=_0x49d64b['ok']?a155_0x580ef9[_0x2e34f9(0x134)]('OK'):a155_0x580ef9['red'](_0x2e34f9(0xe2));console[_0x2e34f9(0x108)]('\x20\x20'+_0x744ff1+_0x2e34f9(0x122)+_0x49d64b[_0x2e34f9(0xc2)]+':\x20'+_0x49d64b[_0x2e34f9(0xda)]);if(_0x49d64b[_0x2e34f9(0xd1)])console[_0x2e34f9(0x108)](_0x2e34f9(0xf9)+a155_0x580ef9[_0x2e34f9(0xc6)](_0x49d64b['detail']));}console[_0x2e34f9(0x108)]('');}export async function upgradeApp(_0x32029f,_0x18c7ce){const _0x96aa42=a155_0x1c0b2e,_0x35c18c=process[_0x96aa42(0xfe)](),_0x5500e7=analyse(_0x35c18c),_0x4ebcd2=!_0x5500e7[_0x96aa42(0xd3)]&&_0x5500e7['oldArtifacts'][_0x96aa42(0x126)]===0x0&&!_0x5500e7[_0x96aa42(0x101)]&&!_0x5500e7[_0x96aa42(0xbd)]&&!_0x5500e7[_0x96aa42(0xe6)];if(_0x4ebcd2){console[_0x96aa42(0x108)](a155_0x580ef9[_0x96aa42(0x134)](_0x96aa42(0x125)));return;}printReport(_0x5500e7);const _0x81872a=!!(_0x18c7ce[_0x96aa42(0x109)]||_0x18c7ce['Y']||_0x32029f);if(!_0x81872a)try{const _0x20e951=await askConfirm(_0x96aa42(0xcb));if(!_0x20e951){console[_0x96aa42(0x108)](a155_0x580ef9[_0x96aa42(0xc6)](_0x96aa42(0x11e)));return;}}catch(_0x393fb8){if(_0x393fb8?.[_0x96aa42(0x114)]==='CANCEL'){console[_0x96aa42(0x108)](a155_0x580ef9[_0x96aa42(0xc6)]('Upgrade\x20cancelled.'));return;}throw _0x393fb8;}const _0x4556be=[],_0x25b6a8=a155_0x9c4165({'text':_0x96aa42(0x103),'color':_0x96aa42(0x11b)})['start'](),_0x48232c=execConfigMigration(_0x5500e7,_0x35c18c);_0x4556be['push'](_0x48232c),_0x25b6a8[_0x48232c['ok']?'succeed':'fail'](_0x96aa42(0xc7)+(_0x48232c[_0x96aa42(0xd1)]??(_0x48232c['ok']?'done':'failed')));const _0x195aea=resolve(_0x35c18c,_0x96aa42(0xd9)),_0x3f5a76=a155_0x9c4165({'text':'Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','color':_0x96aa42(0x11b)})['start']();if(existsSync(_0x195aea))try{rmSync(_0x195aea,{'recursive':!![],'force':!![]}),_0x3f5a76[_0x96aa42(0xc1)](_0x96aa42(0xf7)),_0x4556be[_0x96aa42(0x121)]({'step':0x2,'label':_0x96aa42(0xeb),'ok':!![]});}catch(_0x3a6cbc){_0x3f5a76[_0x96aa42(0xf0)](_0x96aa42(0xfc)+_0x3a6cbc[_0x96aa42(0x114)]),_0x4556be[_0x96aa42(0x121)]({'step':0x2,'label':_0x96aa42(0xeb),'ok':![],'detail':_0x3a6cbc[_0x96aa42(0x114)]});}else _0x3f5a76[_0x96aa42(0x113)](_0x96aa42(0x112)),_0x4556be['push']({'step':0x2,'label':_0x96aa42(0xeb),'ok':!![],'detail':_0x96aa42(0x135)});const _0x4167c3=a155_0x9c4165({'text':_0x96aa42(0xf4),'color':_0x96aa42(0x11b)})[_0x96aa42(0xe4)](),_0xa34fe1=execRemoveOldArtifacts(_0x5500e7['oldArtifacts']);_0x4556be[_0x96aa42(0x121)](_0xa34fe1),_0x4167c3[_0xa34fe1['ok']?_0x96aa42(0xc1):_0x96aa42(0xf0)](_0x96aa42(0xc3)+(_0xa34fe1[_0x96aa42(0xd1)]??(_0xa34fe1['ok']?_0x96aa42(0xf2):'failed')));const _0x2f8e0a=a155_0x9c4165({'text':_0x96aa42(0xe0),'color':_0x96aa42(0x11b)})['start'](),_0x558c90=execCleanMcp(_0x5500e7);_0x4556be[_0x96aa42(0x121)](_0x558c90),_0x2f8e0a[_0x558c90['ok']?_0x96aa42(0xc1):_0x96aa42(0xf0)](_0x96aa42(0xb9)+(_0x558c90[_0x96aa42(0xd1)]??(_0x558c90['ok']?_0x96aa42(0xf2):_0x96aa42(0xd0))));const _0x4300c6=a155_0x9c4165({'text':_0x96aa42(0xfb),'color':_0x96aa42(0x11b)})[_0x96aa42(0xe4)](),_0x4c3ee7=execSkillsRemove(_0x35c18c,_0x81872a);_0x4556be[_0x96aa42(0x121)](_0x4c3ee7),_0x4300c6[_0x4c3ee7['ok']?_0x96aa42(0xc1):'fail']('Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20'+(_0x4c3ee7[_0x96aa42(0xd1)]??(_0x4c3ee7['ok']?'done':_0x96aa42(0xd0))));const _0x4b4363=a155_0x9c4165({'text':'Step\x206/7:\x20Installing\x20new\x20skill...','color':_0x96aa42(0x11b)})['start'](),_0xed61f2=execSkillsAdd(_0x35c18c,_0x81872a);_0x4556be[_0x96aa42(0x121)](_0xed61f2),_0x4b4363[_0xed61f2['ok']?_0x96aa42(0xc1):'fail'](_0x96aa42(0xd7)+(_0xed61f2[_0x96aa42(0xd1)]??(_0xed61f2['ok']?_0x96aa42(0xf2):_0x96aa42(0xd0))));const _0x43402f=a155_0x9c4165({'text':_0x96aa42(0x12e),'color':_0x96aa42(0x11b)})['start'](),_0x336249=execUpgradeSdk(_0x5500e7);_0x4556be[_0x96aa42(0x121)](_0x336249),_0x43402f[_0x336249['ok']?_0x96aa42(0xc1):_0x96aa42(0xf0)]('Step\x207/7:\x20@lovrabet/sdk\x20—\x20'+(_0x336249[_0x96aa42(0xd1)]??(_0x336249['ok']?_0x96aa42(0xf2):_0x96aa42(0xd0)))),printSummary(_0x4556be);const _0x25dbe2=_0x4556be[_0x96aa42(0xc8)](_0x4add7d=>!_0x4add7d['ok']);_0x25dbe2?console['log'](a155_0x580ef9['yellow'](_0x96aa42(0xe3))):console[_0x96aa42(0x108)](a155_0x580ef9[_0x96aa42(0x134)](_0x96aa42(0x131))),_0x336249['ok']&&_0x5500e7[_0x96aa42(0xe6)]&&(console[_0x96aa42(0x108)](''),console[_0x96aa42(0x108)](a155_0x580ef9[_0x96aa42(0xff)][_0x96aa42(0x11b)](_0x96aa42(0xec))),console['log'](a155_0x580ef9[_0x96aa42(0x11b)]('Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:')),console[_0x96aa42(0x108)](''),console[_0x96aa42(0x108)](a155_0x580ef9[_0x96aa42(0x136)](_0x96aa42(0xbf))),console['log'](a155_0x580ef9[_0x96aa42(0x136)](_0x96aa42(0xe8))),console[_0x96aa42(0x108)](a155_0x580ef9[_0x96aa42(0x136)](_0x96aa42(0xf6))),console[_0x96aa42(0x108)](''));}
1
+ const a156_0x3f57d2=a156_0x3f5b;(function(_0x5d9e1a,_0x3b6fb2){const _0x52b687=a156_0x3f5b,_0x277d7b=_0x5d9e1a();while(!![]){try{const _0x5605ff=parseInt(_0x52b687(0x163))/0x1*(-parseInt(_0x52b687(0x164))/0x2)+parseInt(_0x52b687(0x19e))/0x3+parseInt(_0x52b687(0x16a))/0x4+-parseInt(_0x52b687(0x1be))/0x5*(-parseInt(_0x52b687(0x157))/0x6)+-parseInt(_0x52b687(0x15d))/0x7*(parseInt(_0x52b687(0x1b6))/0x8)+-parseInt(_0x52b687(0x1b5))/0x9*(-parseInt(_0x52b687(0x177))/0xa)+parseInt(_0x52b687(0x1cc))/0xb*(-parseInt(_0x52b687(0x16b))/0xc);if(_0x5605ff===_0x3b6fb2)break;else _0x277d7b['push'](_0x277d7b['shift']());}catch(_0x105e8c){_0x277d7b['push'](_0x277d7b['shift']());}}}(a156_0x2e5e,0x95bbc));import a156_0xc020fa from'chalk';import a156_0x3db68e 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[a156_0x3f57d2(0x1d2)](_0x5544a1=>_0x5544a1!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x5ddc11){const _0x393582=a156_0x3f57d2,_0x3881ce=[];for(const _0x4f7fb8 of Object[_0x393582(0x19c)](CORE_IDE_CONFIGS)){if(_0x4f7fb8[_0x393582(0x159)])for(const _0x1a271a of _0x4f7fb8['files']){_0x3881ce['push'](resolve(_0x5ddc11,_0x1a271a[_0x393582(0x195)]));}}return _0x3881ce;}function analyse(_0x39dff0){const _0x28b98d=a156_0x3f57d2;let _0x56fcd9=null;const _0x468d15=resolve(_0x39dff0,NEW_CONFIG_NAME),_0x307773=existsSync(_0x468d15);for(const _0x3b60b9 of LEGACY_CONFIG_NAMES){const _0x488b47=resolve(_0x39dff0,_0x3b60b9);if(existsSync(_0x488b47)){const _0x738cb2=readConfigFile(_0x488b47),_0x175c05=Object[_0x28b98d(0x184)](_0x738cb2)[_0x28b98d(0x1d2)](_0x68e81c=>typeof _0x738cb2[_0x68e81c]!==_0x28b98d(0x1bf));_0x56fcd9={'oldPath':_0x488b47,'hasNewConfig':_0x307773,'fields':_0x175c05};break;}}const _0x591952=[],_0x303056=resolve(_0x39dff0,_0x28b98d(0x170));if(existsSync(_0x303056))_0x591952['push'](_0x303056);const _0x4793c5=resolve(_0x39dff0,_0x28b98d(0x1b1));if(existsSync(_0x4793c5))_0x591952[_0x28b98d(0x1b4)](_0x4793c5);const _0x48b203=resolve(_0x39dff0,_0x28b98d(0x15c));if(existsSync(_0x48b203))_0x591952['push'](_0x48b203);for(const _0x3c6b00 of collectIdeSkillFiles(_0x39dff0)){if(existsSync(_0x3c6b00))_0x591952[_0x28b98d(0x1b4)](_0x3c6b00);}let _0x5db8ee=null;const _0x1fa32e=resolve(_0x39dff0,_0x28b98d(0x1a9));if(existsSync(_0x1fa32e))try{const _0xba6a57=JSON[_0x28b98d(0x186)](readFileSync(_0x1fa32e,'utf8'));if(_0xba6a57?.[_0x28b98d(0x188)]&&typeof _0xba6a57[_0x28b98d(0x188)]===_0x28b98d(0x173)){const _0x29a800=[];for(const [_0x4b1942,_0xf7e945]of Object['entries'](_0xba6a57[_0x28b98d(0x188)])){const _0x23938f=_0xf7e945;_0x23938f?.[_0x28b98d(0x189)]&&Array[_0x28b98d(0x1aa)](_0x23938f[_0x28b98d(0x189)])&&_0x23938f[_0x28b98d(0x189)][_0x28b98d(0x171)](_0x1b9890=>typeof _0x1b9890===_0x28b98d(0x1b3)&&_0x1b9890['includes'](_0x28b98d(0x194)))&&_0x29a800['push'](_0x4b1942);}_0x29a800['length']>0x0&&(_0x5db8ee={'path':_0x1fa32e,'keys':_0x29a800});}}catch{}const _0x5e60c9=_0x591952[_0x28b98d(0x15b)]>0x0||_0x56fcd9!==null;let _0x597bcd=null;const _0x2befb4=resolve(_0x39dff0,'package.json');if(existsSync(_0x2befb4))try{const _0x4e71a3=JSON[_0x28b98d(0x186)](readFileSync(_0x2befb4,_0x28b98d(0x1de)));for(const _0x571813 of['dependencies',_0x28b98d(0x1cf)]){const _0xe9d49=_0x4e71a3?.[_0x571813]?.[_0x28b98d(0x174)];if(typeof _0xe9d49===_0x28b98d(0x1b3)){_0xe9d49!==_0x28b98d(0x1bd)&&(_0x597bcd={'pkgPath':_0x2befb4,'currentVersion':_0xe9d49,'field':_0x571813});break;}}}catch{}return{'configMigration':_0x56fcd9,'oldArtifacts':_0x591952,'oldMcpConfig':_0x5db8ee,'needsSkillSwap':_0x5e60c9,'sdkUpgrade':_0x597bcd};}function printReport(_0x2fd213){const _0x2640b9=a156_0x3f57d2,{configMigration:_0x50cbf6,oldArtifacts:_0x14074e,oldMcpConfig:_0x3b8c24,needsSkillSwap:_0x326c0b}=_0x2fd213;console[_0x2640b9(0x1c5)](''),console[_0x2640b9(0x1c5)](a156_0xc020fa['bold'](_0x2640b9(0x1dc))),console[_0x2640b9(0x1c5)]('');_0x50cbf6?(console[_0x2640b9(0x1c5)](a156_0xc020fa[_0x2640b9(0x1ba)]('Config\x20file:')+('\x20\x20'+a156_0xc020fa[_0x2640b9(0x167)](_0x50cbf6[_0x2640b9(0x172)]))),console[_0x2640b9(0x1c5)](_0x2640b9(0x15e)+(_0x50cbf6[_0x2640b9(0x1da)]?a156_0xc020fa[_0x2640b9(0x1af)](_0x2640b9(0x18c)):a156_0xc020fa[_0x2640b9(0x199)](_0x2640b9(0x169)))),console[_0x2640b9(0x1c5)](_0x2640b9(0x1a1)+_0x50cbf6[_0x2640b9(0x1a4)][_0x2640b9(0x1c1)](',\x20')),console['log'](_0x2640b9(0x1a5))):console['log'](a156_0xc020fa[_0x2640b9(0x1ba)]('Config\x20file:')+'\x20\x20'+a156_0xc020fa[_0x2640b9(0x199)](_0x2640b9(0x1a0)));console['log']('');if(_0x14074e['length']>0x0){console['log'](a156_0xc020fa[_0x2640b9(0x1ba)](_0x2640b9(0x1c8)));for(const _0x47e4d4 of _0x14074e){console[_0x2640b9(0x1c5)]('\x20\x20'+a156_0xc020fa[_0x2640b9(0x158)]('FOUND')+'\x20\x20'+_0x47e4d4);}console[_0x2640b9(0x1c5)]('\x20\x20Action:\x20delete');}else console[_0x2640b9(0x1c5)](a156_0xc020fa[_0x2640b9(0x1ba)](_0x2640b9(0x1c8))+'\x20\x20'+a156_0xc020fa[_0x2640b9(0x199)](_0x2640b9(0x1d7)));console[_0x2640b9(0x1c5)]('');_0x3b8c24?(console[_0x2640b9(0x1c5)](a156_0xc020fa[_0x2640b9(0x1ba)](_0x2640b9(0x192))+('\x20\x20'+a156_0xc020fa[_0x2640b9(0x167)](_0x3b8c24['path'])+_0x2640b9(0x1c4)+_0x3b8c24[_0x2640b9(0x184)][_0x2640b9(0x1c1)](',\x20'))),console[_0x2640b9(0x1c5)](_0x2640b9(0x1ab))):console[_0x2640b9(0x1c5)](a156_0xc020fa[_0x2640b9(0x1ba)](_0x2640b9(0x192))+'\x20\x20'+a156_0xc020fa[_0x2640b9(0x199)](_0x2640b9(0x193)));console[_0x2640b9(0x1c5)](''),console['log'](a156_0xc020fa[_0x2640b9(0x1ba)]('Skill\x20swap:')+('\x20\x20'+(_0x326c0b?a156_0xc020fa[_0x2640b9(0x167)](_0x2640b9(0x162)):a156_0xc020fa[_0x2640b9(0x1af)](_0x2640b9(0x1cd)))));_0x326c0b&&console[_0x2640b9(0x1c5)](_0x2640b9(0x1a6)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x2640b9(0x1c5)]('');if(_0x2fd213[_0x2640b9(0x1a8)]){const {currentVersion:_0x222580,field:_0x430aa6,pkgPath:_0x300aa0}=_0x2fd213[_0x2640b9(0x1a8)];console['log'](a156_0xc020fa[_0x2640b9(0x1ba)](_0x2640b9(0x1c6))+('\x20\x20'+a156_0xc020fa[_0x2640b9(0x167)](_0x300aa0))),console['log'](_0x2640b9(0x161)+_0x430aa6+':\x20'+a156_0xc020fa['yellow'](_0x222580)+'\x20→\x20'+a156_0xc020fa['green']('latest')),console[_0x2640b9(0x1c5)](_0x2640b9(0x178));}else console[_0x2640b9(0x1c5)](a156_0xc020fa['cyan'](_0x2640b9(0x1c6))+'\x20\x20'+a156_0xc020fa[_0x2640b9(0x199)](_0x2640b9(0x180)));console[_0x2640b9(0x1c5)]('');}function execConfigMigration(_0x4ff54d,_0x488872){const _0x3bdb08=a156_0x3f57d2,{configMigration:_0x547dc3}=_0x4ff54d;if(!_0x547dc3?.[_0x3bdb08(0x172)])return{'step':0x1,'label':_0x3bdb08(0x1a2),'ok':!![],'detail':_0x3bdb08(0x191)};const _0x41eb12=readConfigFile(_0x547dc3[_0x3bdb08(0x172)]),_0x88f372=resolve(_0x488872,NEW_CONFIG_NAME),_0x1a6da3=_0x547dc3['hasNewConfig']?readConfigFile(_0x88f372):{};for(const [_0x2721de,_0x23ffe8]of Object[_0x3bdb08(0x187)](_0x41eb12)){!(_0x2721de in _0x1a6da3)&&(_0x1a6da3[_0x2721de]=_0x23ffe8);}writeConfigFile(_0x88f372,_0x1a6da3);const _0x1a6fa4=_0x547dc3[_0x3bdb08(0x172)]+_0x3bdb08(0x1b0);return renameSync(_0x547dc3[_0x3bdb08(0x172)],_0x1a6fa4),{'step':0x1,'label':_0x3bdb08(0x1a2),'ok':!![],'detail':_0x547dc3['oldPath']+_0x3bdb08(0x19b)+_0x88f372+_0x3bdb08(0x17a)+_0x1a6fa4+')'};}function a156_0x2e5e(){const _0x24b65c=['No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','stringify','CANCEL','gray','oldMcpConfig','\x20→\x20','values','isDirectory','999921wMgkLJ','oldArtifacts','no\x20legacy\x20config\x20found','\x20\x20Fields\x20to\x20migrate:\x20','Config\x20migration','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','fields','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','Step\x204/7:\x20Cleaning\x20MCP\x20config...','sdkUpgrade','.cursor/mcp.json','isArray','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','yes','\x20\x20#\x20or','done','green','.bak','.cursor/rules/lovrabet_rules.mdc','inherit','string','push','9MiBVVa','464AkNLlL','\x20\x20bun\x20install','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','Remove\x20old\x20skill','cyan','lovrabet/rabetbase\x20installed\x20globally','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','latest','5xFzqJX','undefined','white','join','Upgrade\x20completed\x20successfully!','lovrabet/rabetbase','\x20→\x20keys:\x20','log','@lovrabet/sdk:','\x20removed','Legacy\x20artifacts:','\x20→\x20latest','\x20\x20\x20\x20\x20\x20\x20','no\x20matching\x20entry\x20found','11QFIiDV','not\x20needed','===\x20Upgrade\x20Summary\x20===','devDependencies','detail','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','filter','start','\x20removed\x20(','\x20from\x20','error','none\x20found','status','Remove\x20.lovrabet/','hasNewConfig','skipped','===\x20Upgrade\x20Analysis\x20===','includes','utf8','5088522fwJSqC','red','files','Clean\x20MCP\x20config','length','.claude/skills/lovrabet','46564ELkhbq','\x20\x20New\x20config\x20(.rabetbase.json):\x20','Upgrade\x20cancelled.','message','\x20\x20Current\x20version\x20in\x20','needed','255770ESxxHv','6LxTkdN','fail','Step\x205/7:\x20Removing\x20old\x20skill...','yellow','exit\x20','not\x20found\x20(will\x20create)','983668raYPsp','5978436wtvRXy','succeed','Step\x206/7:\x20Installing\x20new\x20skill...','Upgrade\x20@lovrabet/sdk','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','.lovrabet','some','oldPath','object','@lovrabet/sdk','Step\x201/7:\x20Migrating\x20config...','FAIL','8373260fPHuml','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','failed','\x20(backup:\x20','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','[\x22@lovrabet/sdk\x22]:\x20','Proceed\x20with\x20upgrade?','label','Install\x20new\x20skill','not\x20found\x20or\x20already\x20at\x20latest','bold','Step\x204/7:\x20MCP\x20config\x20—\x20','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','keys','step','parse','entries','mcpServers','args','needsSkillSwap','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','already\x20exists\x20(will\x20merge)','Step\x201/7:\x20Config\x20migration\x20—\x20','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','configMigration','skipped\x20(no\x20legacy\x20config)','MCP\x20config:','no\x20legacy\x20entry','@lovrabet/dataset-mcp-server','path'];a156_0x2e5e=function(){return _0x24b65c;};return a156_0x2e5e();}function execRemoveOldArtifacts(_0x2b3201){const _0x10bd53=a156_0x3f57d2,_0x9fe870=[];for(const _0x40e9f3 of _0x2b3201){try{if(!existsSync(_0x40e9f3))continue;const _0x1b978b=tryStat(_0x40e9f3);_0x1b978b?.[_0x10bd53(0x19d)]()?rmSync(_0x40e9f3,{'recursive':!![],'force':!![]}):unlinkSync(_0x40e9f3);}catch(_0x18f857){_0x9fe870[_0x10bd53(0x1b4)](_0x40e9f3+':\x20'+_0x18f857[_0x10bd53(0x160)]);}}return{'step':0x3,'label':'Remove\x20legacy\x20artifacts','ok':_0x9fe870[_0x10bd53(0x15b)]===0x0,'detail':_0x9fe870['length']>0x0?_0x2b3201[_0x10bd53(0x15b)]-_0x9fe870[_0x10bd53(0x15b)]+'/'+_0x2b3201[_0x10bd53(0x15b)]+_0x10bd53(0x1d4)+_0x9fe870[_0x10bd53(0x1c1)](';\x20')+')':_0x2b3201['length']+_0x10bd53(0x1c7)};}function execCleanMcp(_0x334ae3){const _0x59c11b=a156_0x3f57d2;if(!_0x334ae3['oldMcpConfig'])return{'step':0x4,'label':_0x59c11b(0x15a),'ok':!![],'detail':'skipped'};try{const _0x1effdf=readFileSync(_0x334ae3[_0x59c11b(0x19a)][_0x59c11b(0x195)],_0x59c11b(0x1de)),_0x1de3ce=JSON[_0x59c11b(0x186)](_0x1effdf);if(_0x1de3ce?.[_0x59c11b(0x188)]&&typeof _0x1de3ce[_0x59c11b(0x188)]===_0x59c11b(0x173)){const _0x591985=[];for(const [_0x169c97,_0x4b0ee5]of Object['entries'](_0x1de3ce['mcpServers'])){_0x4b0ee5?.[_0x59c11b(0x189)]&&Array[_0x59c11b(0x1aa)](_0x4b0ee5[_0x59c11b(0x189)])&&_0x4b0ee5[_0x59c11b(0x189)]['some'](_0x40017a=>typeof _0x40017a===_0x59c11b(0x1b3)&&_0x40017a[_0x59c11b(0x1dd)](_0x59c11b(0x194)))&&_0x591985[_0x59c11b(0x1b4)](_0x169c97);}for(const _0x4e4e45 of _0x591985){delete _0x1de3ce['mcpServers'][_0x4e4e45];}return _0x591985[_0x59c11b(0x15b)]>0x0&&writeFileSync(_0x334ae3['oldMcpConfig'][_0x59c11b(0x195)],JSON[_0x59c11b(0x197)](_0x1de3ce,null,0x2)+'\x0a',_0x59c11b(0x1de)),{'step':0x4,'label':_0x59c11b(0x15a),'ok':!![],'detail':'removed\x20'+_0x591985[_0x59c11b(0x1c1)](',\x20')+_0x59c11b(0x1d5)+_0x334ae3[_0x59c11b(0x19a)][_0x59c11b(0x195)]};}return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x59c11b(0x1cb)};}catch(_0x2f366a){return{'step':0x4,'label':_0x59c11b(0x15a),'ok':![],'detail':_0x2f366a[_0x59c11b(0x160)]};}}function execSkillsRemove(_0x1ac766,_0x3a75a3){const _0x2033a0=a156_0x3f57d2,_0x2a57de=runNpxSkillsRemove(_0x1ac766,{'stdio':_0x2033a0(0x1b2),'yes':_0x3a75a3});return{'step':0x5,'label':_0x2033a0(0x1b9),'ok':_0x2a57de['ok'],'detail':_0x2a57de['ok']?'lovrabet/lovrabet-skill\x20removed':_0x2a57de[_0x2033a0(0x1d6)]??_0x2033a0(0x168)+_0x2a57de[_0x2033a0(0x1d8)]};}function execSkillsAdd(_0x260e83,_0x4f5336){const _0x260487=a156_0x3f57d2,_0x3ecaae=runNpxSkillsAddGlobal(_0x260e83,_0x260487(0x1c3),{'stdio':'inherit','yes':_0x4f5336});return{'step':0x6,'label':_0x260487(0x17f),'ok':_0x3ecaae['ok'],'detail':_0x3ecaae['ok']?_0x260487(0x1bb):_0x3ecaae[_0x260487(0x1d6)]??'exit\x20'+_0x3ecaae[_0x260487(0x1d8)]};}function a156_0x3f5b(_0x1c5f3a,_0x217c47){_0x1c5f3a=_0x1c5f3a-0x157;const _0x2e5e30=a156_0x2e5e();let _0x3f5b1b=_0x2e5e30[_0x1c5f3a];return _0x3f5b1b;}function execUpgradeSdk(_0x192583){const _0x2acc65=a156_0x3f57d2;if(!_0x192583[_0x2acc65(0x1a8)])return{'step':0x7,'label':_0x2acc65(0x16e),'ok':!![],'detail':_0x2acc65(0x18e)};const {pkgPath:_0x273d77,currentVersion:_0x5505a5,field:_0xbf7bf1}=_0x192583['sdkUpgrade'];try{const _0x181eff=readFileSync(_0x273d77,'utf8'),_0x9fd791=JSON[_0x2acc65(0x186)](_0x181eff);return _0x9fd791[_0xbf7bf1][_0x2acc65(0x174)]=_0x2acc65(0x1bd),writeFileSync(_0x273d77,JSON[_0x2acc65(0x197)](_0x9fd791,null,0x2)+'\x0a',_0x2acc65(0x1de)),{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0xbf7bf1+_0x2acc65(0x17c)+_0x5505a5+_0x2acc65(0x1c9)};}catch(_0x513afb){return{'step':0x7,'label':_0x2acc65(0x16e),'ok':![],'detail':_0x513afb[_0x2acc65(0x160)]};}}function tryStat(_0x29188e){try{return statSync(_0x29188e);}catch{return undefined;}}function printSummary(_0x3a769b){const _0x27a836=a156_0x3f57d2;console['log'](''),console[_0x27a836(0x1c5)](a156_0xc020fa[_0x27a836(0x181)](_0x27a836(0x1ce))),console[_0x27a836(0x1c5)]('');for(const _0x3531a1 of _0x3a769b){const _0x59c03f=_0x3531a1['ok']?a156_0xc020fa[_0x27a836(0x1af)]('OK'):a156_0xc020fa[_0x27a836(0x158)](_0x27a836(0x176));console['log']('\x20\x20'+_0x59c03f+'\x20\x20Step\x20'+_0x3531a1[_0x27a836(0x185)]+':\x20'+_0x3531a1[_0x27a836(0x17e)]);if(_0x3531a1[_0x27a836(0x1d0)])console['log'](_0x27a836(0x1ca)+a156_0xc020fa[_0x27a836(0x199)](_0x3531a1[_0x27a836(0x1d0)]));}console[_0x27a836(0x1c5)]('');}export async function upgradeApp(_0x1fb839,_0x4b75d3){const _0x5b17fa=a156_0x3f57d2,_0x50b859=process['cwd'](),_0x5d290d=analyse(_0x50b859),_0x3ab4dc=!_0x5d290d[_0x5b17fa(0x190)]&&_0x5d290d[_0x5b17fa(0x19f)]['length']===0x0&&!_0x5d290d[_0x5b17fa(0x19a)]&&!_0x5d290d[_0x5b17fa(0x18a)]&&!_0x5d290d['sdkUpgrade'];if(_0x3ab4dc){console[_0x5b17fa(0x1c5)](a156_0xc020fa[_0x5b17fa(0x1af)](_0x5b17fa(0x196)));return;}printReport(_0x5d290d);const _0x11dfc0=!!(_0x4b75d3[_0x5b17fa(0x1ac)]||_0x4b75d3['Y']||_0x1fb839);if(!_0x11dfc0)try{const _0x3e0eed=await askConfirm(_0x5b17fa(0x17d));if(!_0x3e0eed){console[_0x5b17fa(0x1c5)](a156_0xc020fa[_0x5b17fa(0x199)](_0x5b17fa(0x15f)));return;}}catch(_0x4d291b){if(_0x4d291b?.[_0x5b17fa(0x160)]===_0x5b17fa(0x198)){console[_0x5b17fa(0x1c5)](a156_0xc020fa[_0x5b17fa(0x199)](_0x5b17fa(0x15f)));return;}throw _0x4d291b;}const _0x420368=[],_0x1c9f96=a156_0x3db68e({'text':_0x5b17fa(0x175),'color':_0x5b17fa(0x1ba)})[_0x5b17fa(0x1d3)](),_0x40ac17=execConfigMigration(_0x5d290d,_0x50b859);_0x420368[_0x5b17fa(0x1b4)](_0x40ac17),_0x1c9f96[_0x40ac17['ok']?_0x5b17fa(0x16c):_0x5b17fa(0x165)](_0x5b17fa(0x18d)+(_0x40ac17[_0x5b17fa(0x1d0)]??(_0x40ac17['ok']?_0x5b17fa(0x1ae):_0x5b17fa(0x179))));const _0x3ab631=resolve(_0x50b859,_0x5b17fa(0x170)),_0x19546c=a156_0x3db68e({'text':_0x5b17fa(0x16f),'color':'cyan'})[_0x5b17fa(0x1d3)]();if(existsSync(_0x3ab631))try{rmSync(_0x3ab631,{'recursive':!![],'force':!![]}),_0x19546c[_0x5b17fa(0x16c)]('Step\x202/7:\x20.lovrabet/\x20directory\x20removed'),_0x420368[_0x5b17fa(0x1b4)]({'step':0x2,'label':_0x5b17fa(0x1d9),'ok':!![]});}catch(_0x8a2b58){_0x19546c[_0x5b17fa(0x165)](_0x5b17fa(0x183)+_0x8a2b58[_0x5b17fa(0x160)]),_0x420368['push']({'step':0x2,'label':_0x5b17fa(0x1d9),'ok':![],'detail':_0x8a2b58[_0x5b17fa(0x160)]});}else _0x19546c['info']('Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped'),_0x420368[_0x5b17fa(0x1b4)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![],'detail':_0x5b17fa(0x1db)});const _0x85483a=a156_0x3db68e({'text':'Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':_0x5b17fa(0x1ba)})['start'](),_0x2bc713=execRemoveOldArtifacts(_0x5d290d[_0x5b17fa(0x19f)]);_0x420368['push'](_0x2bc713),_0x85483a[_0x2bc713['ok']?_0x5b17fa(0x16c):'fail'](_0x5b17fa(0x1b8)+(_0x2bc713[_0x5b17fa(0x1d0)]??(_0x2bc713['ok']?'done':'failed')));const _0x2e2b7c=a156_0x3db68e({'text':_0x5b17fa(0x1a7),'color':_0x5b17fa(0x1ba)})[_0x5b17fa(0x1d3)](),_0x47184b=execCleanMcp(_0x5d290d);_0x420368[_0x5b17fa(0x1b4)](_0x47184b),_0x2e2b7c[_0x47184b['ok']?'succeed':_0x5b17fa(0x165)](_0x5b17fa(0x182)+(_0x47184b[_0x5b17fa(0x1d0)]??(_0x47184b['ok']?_0x5b17fa(0x1ae):_0x5b17fa(0x179))));const _0x4e4a51=a156_0x3db68e({'text':_0x5b17fa(0x166),'color':_0x5b17fa(0x1ba)})[_0x5b17fa(0x1d3)](),_0x53f237=execSkillsRemove(_0x50b859,_0x11dfc0);_0x420368[_0x5b17fa(0x1b4)](_0x53f237),_0x4e4a51[_0x53f237['ok']?_0x5b17fa(0x16c):'fail'](_0x5b17fa(0x18b)+(_0x53f237['detail']??(_0x53f237['ok']?_0x5b17fa(0x1ae):'failed')));const _0x748ca=a156_0x3db68e({'text':_0x5b17fa(0x16d),'color':_0x5b17fa(0x1ba)})[_0x5b17fa(0x1d3)](),_0x1cc22c=execSkillsAdd(_0x50b859,_0x11dfc0);_0x420368['push'](_0x1cc22c),_0x748ca[_0x1cc22c['ok']?_0x5b17fa(0x16c):'fail']('Step\x206/7:\x20Install\x20new\x20skill\x20—\x20'+(_0x1cc22c[_0x5b17fa(0x1d0)]??(_0x1cc22c['ok']?_0x5b17fa(0x1ae):'failed')));const _0x3c3fd1=a156_0x3db68e({'text':_0x5b17fa(0x17b),'color':'cyan'})[_0x5b17fa(0x1d3)](),_0x24bcb3=execUpgradeSdk(_0x5d290d);_0x420368[_0x5b17fa(0x1b4)](_0x24bcb3),_0x3c3fd1[_0x24bcb3['ok']?_0x5b17fa(0x16c):'fail'](_0x5b17fa(0x1d1)+(_0x24bcb3[_0x5b17fa(0x1d0)]??(_0x24bcb3['ok']?'done':'failed'))),printSummary(_0x420368);const _0x5f153b=_0x420368[_0x5b17fa(0x171)](_0x2205bf=>!_0x2205bf['ok']);_0x5f153b?console[_0x5b17fa(0x1c5)](a156_0xc020fa[_0x5b17fa(0x167)](_0x5b17fa(0x1a3))):console[_0x5b17fa(0x1c5)](a156_0xc020fa['green'](_0x5b17fa(0x1c2))),_0x24bcb3['ok']&&_0x5d290d[_0x5b17fa(0x1a8)]&&(console[_0x5b17fa(0x1c5)](''),console[_0x5b17fa(0x1c5)](a156_0xc020fa[_0x5b17fa(0x181)][_0x5b17fa(0x1ba)](_0x5b17fa(0x18f))),console[_0x5b17fa(0x1c5)](a156_0xc020fa[_0x5b17fa(0x1ba)](_0x5b17fa(0x1bc))),console[_0x5b17fa(0x1c5)](''),console[_0x5b17fa(0x1c5)](a156_0xc020fa['white']('\x20\x20npm\x20install')),console['log'](a156_0xc020fa[_0x5b17fa(0x1c0)](_0x5b17fa(0x1ad))),console[_0x5b17fa(0x1c5)](a156_0xc020fa['white'](_0x5b17fa(0x1b7))),console[_0x5b17fa(0x1c5)](''));}