@lovrabet/rabetbase-cli 2.3.7-beta.2 → 2.3.7-beta.3

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 (243) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/index.js +1 -1
  21. package/lib/commands/app/list.js +1 -1
  22. package/lib/commands/app/remote-directory.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app-config/delete.js +1 -1
  26. package/lib/commands/app-config/get.js +1 -1
  27. package/lib/commands/app-config/index.js +1 -1
  28. package/lib/commands/app-config/list.js +1 -1
  29. package/lib/commands/app-config/set.js +1 -1
  30. package/lib/commands/app-config/shared.js +1 -1
  31. package/lib/commands/auth/index.js +1 -1
  32. package/lib/commands/bff/create.js +1 -1
  33. package/lib/commands/bff/delete.js +1 -1
  34. package/lib/commands/bff/detail.js +1 -1
  35. package/lib/commands/bff/index.js +1 -1
  36. package/lib/commands/bff/list.js +1 -1
  37. package/lib/commands/bff/pull.js +1 -1
  38. package/lib/commands/bff/push.js +1 -1
  39. package/lib/commands/bff/status.js +1 -1
  40. package/lib/commands/cli-skill/index.js +1 -1
  41. package/lib/commands/cli-update.js +1 -1
  42. package/lib/commands/codegen/index.js +1 -1
  43. package/lib/commands/codegen/sdk.js +1 -1
  44. package/lib/commands/codegen/sql.js +1 -1
  45. package/lib/commands/common/app-registry.js +1 -1
  46. package/lib/commands/common/app-selector.js +1 -1
  47. package/lib/commands/common/dry-run.js +1 -1
  48. package/lib/commands/common/flags.js +1 -1
  49. package/lib/commands/common/local-file.js +1 -1
  50. package/lib/commands/common/validate.js +1 -1
  51. package/lib/commands/config/get.js +1 -1
  52. package/lib/commands/config/index.js +1 -1
  53. package/lib/commands/config/list.js +1 -1
  54. package/lib/commands/config/set.js +1 -1
  55. package/lib/commands/config/shared.js +1 -1
  56. package/lib/commands/data/filter.js +1 -1
  57. package/lib/commands/data/getOne.js +1 -1
  58. package/lib/commands/data/index.js +1 -1
  59. package/lib/commands/data/shared.js +1 -1
  60. package/lib/commands/dataset/business-group-update.js +1 -1
  61. package/lib/commands/dataset/capability.js +1 -1
  62. package/lib/commands/dataset/delete.js +1 -1
  63. package/lib/commands/dataset/detail.js +1 -1
  64. package/lib/commands/dataset/extend-update.js +1 -1
  65. package/lib/commands/dataset/field-update.js +1 -1
  66. package/lib/commands/dataset/generate.js +1 -1
  67. package/lib/commands/dataset/index.js +1 -1
  68. package/lib/commands/dataset/list.js +1 -1
  69. package/lib/commands/dataset/operations.js +1 -1
  70. package/lib/commands/dataset/relation-audit.js +1 -1
  71. package/lib/commands/dataset/relation-create.js +1 -1
  72. package/lib/commands/dataset/relation-delete.js +1 -1
  73. package/lib/commands/dataset/relation-shared.js +1 -1
  74. package/lib/commands/dataset/relation-update.js +1 -1
  75. package/lib/commands/dataset/relations.js +1 -1
  76. package/lib/commands/dataset/rename.js +1 -1
  77. package/lib/commands/dataset/restore.js +1 -1
  78. package/lib/commands/db/analysis-batching.js +1 -1
  79. package/lib/commands/db/analyze-batch-plan.js +1 -1
  80. package/lib/commands/db/analyze-cancel.js +1 -1
  81. package/lib/commands/db/analyze-start.js +1 -1
  82. package/lib/commands/db/analyze-status.js +1 -1
  83. package/lib/commands/db/create.js +1 -1
  84. package/lib/commands/db/delete.js +1 -1
  85. package/lib/commands/db/detail.js +1 -1
  86. package/lib/commands/db/diff.js +1 -1
  87. package/lib/commands/db/index.js +1 -1
  88. package/lib/commands/db/list.js +1 -1
  89. package/lib/commands/db/shared.js +1 -1
  90. package/lib/commands/db/tables.js +1 -1
  91. package/lib/commands/db/test.js +1 -1
  92. package/lib/commands/db/update.js +1 -1
  93. package/lib/commands/doctor.js +1 -1
  94. package/lib/commands/file/index.js +1 -1
  95. package/lib/commands/init/index.js +1 -1
  96. package/lib/commands/issue/index.js +1 -1
  97. package/lib/commands/issue/nudge.js +1 -1
  98. package/lib/commands/issue/report.js +1 -1
  99. package/lib/commands/issue/shared.js +1 -1
  100. package/lib/commands/logs/index.js +1 -1
  101. package/lib/commands/menu/index.js +1 -1
  102. package/lib/commands/menu/list.js +1 -1
  103. package/lib/commands/menu/shared/compare-table.js +1 -1
  104. package/lib/commands/menu/shared/index.js +1 -1
  105. package/lib/commands/menu/shared/inquirer.js +1 -1
  106. package/lib/commands/menu/shared/local-pages.js +1 -1
  107. package/lib/commands/menu/shared/logic.js +1 -1
  108. package/lib/commands/menu/shared/service.js +1 -1
  109. package/lib/commands/menu/shared/sync-core.js +1 -1
  110. package/lib/commands/menu/shared/update-core.js +1 -1
  111. package/lib/commands/menu/shared/valid-url.js +1 -1
  112. package/lib/commands/menu/sync.js +1 -1
  113. package/lib/commands/menu/update.js +1 -1
  114. package/lib/commands/page/generate-start.js +1 -1
  115. package/lib/commands/page/generate-status.js +1 -1
  116. package/lib/commands/page/index.js +1 -1
  117. package/lib/commands/page/pull.js +1 -1
  118. package/lib/commands/page/push.js +1 -1
  119. package/lib/commands/page/relation-audit.js +1 -1
  120. package/lib/commands/page/shared.js +1 -1
  121. package/lib/commands/page/standard-page-status.js +1 -1
  122. package/lib/commands/page/sync.js +1 -1
  123. package/lib/commands/permit/index.js +1 -1
  124. package/lib/commands/permit/page-get.js +1 -1
  125. package/lib/commands/permit/page-set.js +1 -1
  126. package/lib/commands/permit/role-apis-set.js +1 -1
  127. package/lib/commands/permit/role-menus-set.js +1 -1
  128. package/lib/commands/permit/role-menus.js +1 -1
  129. package/lib/commands/permit/shared.js +1 -1
  130. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  131. package/lib/commands/project/create/format-elapsed.js +1 -1
  132. package/lib/commands/project/create/main.js +1 -1
  133. package/lib/commands/project/create/non-interactive.js +1 -1
  134. package/lib/commands/project/create/project-template-path.js +1 -1
  135. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  136. package/lib/commands/project/create/use-format-code.js +1 -1
  137. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  138. package/lib/commands/project/index.js +1 -1
  139. package/lib/commands/project/init.js +1 -1
  140. package/lib/commands/project/upgrade.js +1 -1
  141. package/lib/commands/registry.js +1 -1
  142. package/lib/commands/role/create.js +1 -1
  143. package/lib/commands/role/delete.js +1 -1
  144. package/lib/commands/role/detail.js +1 -1
  145. package/lib/commands/role/index.js +1 -1
  146. package/lib/commands/role/list.js +1 -1
  147. package/lib/commands/role/shared.js +1 -1
  148. package/lib/commands/role/update.js +1 -1
  149. package/lib/commands/role/user-add.js +1 -1
  150. package/lib/commands/role/user-remove.js +1 -1
  151. package/lib/commands/role/user-resolve.js +1 -1
  152. package/lib/commands/run/index.js +1 -1
  153. package/lib/commands/schema.js +1 -1
  154. package/lib/commands/sql/create.js +1 -1
  155. package/lib/commands/sql/delete.js +1 -1
  156. package/lib/commands/sql/detail.js +1 -1
  157. package/lib/commands/sql/exec.js +1 -1
  158. package/lib/commands/sql/index.js +1 -1
  159. package/lib/commands/sql/list.js +1 -1
  160. package/lib/commands/sql/pull.js +1 -1
  161. package/lib/commands/sql/push.js +1 -1
  162. package/lib/commands/sql/save.js +1 -1
  163. package/lib/commands/sql/shared.js +1 -1
  164. package/lib/commands/sql/status.js +1 -1
  165. package/lib/commands/sql/validate.js +1 -1
  166. package/lib/commands/workspace/add.js +1 -1
  167. package/lib/commands/workspace/index.js +1 -1
  168. package/lib/commands/workspace/remove.js +1 -1
  169. package/lib/config/schema.js +1 -1
  170. package/lib/constant/cdn.js +1 -1
  171. package/lib/constant/cli.js +1 -1
  172. package/lib/constant/defaults.js +1 -1
  173. package/lib/constant/domain.js +1 -1
  174. package/lib/constant/env.js +1 -1
  175. package/lib/constant/output.js +1 -1
  176. package/lib/constant/paths.js +1 -1
  177. package/lib/constant/risk.js +1 -1
  178. package/lib/context/app-resolver.js +1 -1
  179. package/lib/context/auth-resolver.js +1 -1
  180. package/lib/context/config-loader.js +1 -1
  181. package/lib/context.js +1 -1
  182. package/lib/core/alias-resolver.js +1 -1
  183. package/lib/core/api-client.js +1 -1
  184. package/lib/core/bff/config.js +1 -1
  185. package/lib/core/bff/file-system.js +1 -1
  186. package/lib/core/bff/hash.js +1 -1
  187. package/lib/core/bff/lock.js +1 -1
  188. package/lib/core/bff/utils.js +1 -1
  189. package/lib/core/db-resolver.js +1 -1
  190. package/lib/core/page/file-system.js +1 -1
  191. package/lib/core/page/hash.js +1 -1
  192. package/lib/core/page/lock.js +1 -1
  193. package/lib/core/sql-sync/config.js +1 -1
  194. package/lib/core/sql-sync/file-system.js +1 -1
  195. package/lib/core/sql-sync/hash.js +1 -1
  196. package/lib/core/sql-sync/lock.js +1 -1
  197. package/lib/core/sql-sync/utils.js +1 -1
  198. package/lib/core/sql-validator.js +1 -1
  199. package/lib/errors.js +1 -1
  200. package/lib/framework/build-all-flags.js +1 -1
  201. package/lib/framework/flags.js +1 -1
  202. package/lib/framework/help.js +1 -1
  203. package/lib/framework/index.js +1 -1
  204. package/lib/framework/output.js +1 -1
  205. package/lib/framework/response.js +1 -1
  206. package/lib/framework/runner-alias.js +1 -1
  207. package/lib/framework/runner.js +1 -1
  208. package/lib/framework/schema-export.js +1 -1
  209. package/lib/framework/types.js +1 -1
  210. package/lib/generated/build-info.js +1 -1
  211. package/lib/help.js +1 -1
  212. package/lib/skills/main.js +1 -1
  213. package/lib/skills/npx-skills-add.js +1 -1
  214. package/lib/telemetry/cli-command-trace.js +1 -1
  215. package/lib/telemetry/cli-help-trace.js +1 -1
  216. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  217. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  218. package/lib/telemetry/send-cli-trace-log.js +1 -1
  219. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  220. package/lib/utils/ai_config.js +1 -1
  221. package/lib/utils/apply-jq-filter.js +1 -1
  222. package/lib/utils/cdn-config.js +1 -1
  223. package/lib/utils/check-sdk-version.js +1 -1
  224. package/lib/utils/cli-version-check.js +1 -1
  225. package/lib/utils/cli-version-policy.js +1 -1
  226. package/lib/utils/config.js +1 -1
  227. package/lib/utils/copy-directory.js +1 -1
  228. package/lib/utils/entity-with-id.js +1 -1
  229. package/lib/utils/file-utils.js +1 -1
  230. package/lib/utils/guides-cdn.js +1 -1
  231. package/lib/utils/http-client.js +1 -1
  232. package/lib/utils/is-non-interactive.js +1 -1
  233. package/lib/utils/logger.js +1 -1
  234. package/lib/utils/params.js +1 -1
  235. package/lib/utils/platform.js +1 -1
  236. package/lib/utils/rules-cdn.js +1 -1
  237. package/lib/utils/sleep.js +1 -1
  238. package/lib/utils/template-replacer.js +1 -1
  239. package/lib/utils/update-notice.js +1 -1
  240. package/lib/utils/version.js +1 -1
  241. package/lib/utils/with-active-cookie.js +1 -1
  242. package/lib/utils/write-cli-side-channel.js +1 -1
  243. package/package.json +1 -1
@@ -1 +1 @@
1
- const a129_0x456314=a129_0x2c7d;(function(_0x5c9e18,_0x3236ea){const _0x284b84=a129_0x2c7d,_0x35c937=_0x5c9e18();while(!![]){try{const _0x2df80e=-parseInt(_0x284b84(0x1f8))/0x1+-parseInt(_0x284b84(0x1e3))/0x2+-parseInt(_0x284b84(0x1e7))/0x3+parseInt(_0x284b84(0x1cb))/0x4*(parseInt(_0x284b84(0x1ee))/0x5)+parseInt(_0x284b84(0x1d1))/0x6*(parseInt(_0x284b84(0x1f7))/0x7)+parseInt(_0x284b84(0x1dd))/0x8+-parseInt(_0x284b84(0x1bd))/0x9*(-parseInt(_0x284b84(0x1dc))/0xa);if(_0x2df80e===_0x3236ea)break;else _0x35c937['push'](_0x35c937['shift']());}catch(_0x15c081){_0x35c937['push'](_0x35c937['shift']());}}}(a129_0x4d59,0x3a8db));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a129_0x456314(0x1f3),'type':a129_0x456314(0x1e8),'required':!![],'description':a129_0x456314(0x1cf)};export const ROLE_REF_FLAG={'name':a129_0x456314(0x1df),'type':'string','required':!![],'description':a129_0x456314(0x1c7)};export const GRANT_FLAG={'name':a129_0x456314(0x1fe),'type':a129_0x456314(0x1da),'required':![],'description':a129_0x456314(0x200)};export const REVOKE_FLAG={'name':a129_0x456314(0x1c8),'type':a129_0x456314(0x1da),'required':![],'description':a129_0x456314(0x1c4)};export const MENUS_FLAG={'name':a129_0x456314(0x203),'type':a129_0x456314(0x202),'required':!![],'description':a129_0x456314(0x1cd)};export const DATASETS_FLAG={'name':'datasets','type':a129_0x456314(0x202),'required':!![],'description':'Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for'};function a129_0x4d59(){const _0x5bdc86=['menuId','appCode','grant','data\x20update','Grant\x20access\x20to\x20the\x20listed\x20resources','toUpperCase','string','menus','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','filter','label','row-roles','datasetCode','find','detail-roles',';\x20SELF\x20=\x20only\x20own\x20rows','105903uxzwKC','resourceName','test','resourceCode','Disambiguate\x20with\x20an\x20id.','Role\x20\x22','length','Revoke\x20access\x20to\x20the\x20listed\x20resources','validation','Roles\x20for\x20','Role\x20id\x20or\x20role\x20name','revoke','key','update-roles','6520cGRvSj','allowedActions','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','data\x20export','Menu\x20id\x20(from\x20`menu\x20list`)','Pass\x20--role\x20<id|name>.','18qCYBcC','\x20is\x20not\x20available\x20for\x20this\x20app.','export-roles','trim','\x22\x20not\x20found.','flag','pageNodeList','access','dataPermit','boolean','create-roles','170CsqcQU','3769440OABxoi','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.','role','delete-roles','dataDelete','Special\x20role\x20','101910AzEkxV','menu-roles','bool','map','1316499Qawocv','number','menuPermit','allowSelf','some','\x22\x20is\x20ambiguous\x20(ids:\x20','split','355RyfCZY','data\x20detail','roleType','SELF\x20is\x20not\x20allowed\x20for\x20','Missing\x20action.','menu-id','dataUpdate','dataDetail','apiList','921851hsyJhQ','452405rUNLtk','set','push','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.'];a129_0x4d59=function(){return _0x5bdc86;};return a129_0x4d59();}export const PAGE_SLOT_SPECS=[{'flag':a129_0x456314(0x1e4),'key':a129_0x456314(0x1e9),'allowSelf':![],'label':'menu\x20visibility'},{'flag':a129_0x456314(0x1db),'key':'dataCreate','allowSelf':![],'label':'data\x20create'},{'flag':a129_0x456314(0x1ca),'key':a129_0x456314(0x1f4),'allowSelf':![],'label':a129_0x456314(0x1ff)},{'flag':a129_0x456314(0x1e0),'key':a129_0x456314(0x1e1),'allowSelf':![],'label':'data\x20delete'},{'flag':a129_0x456314(0x20a),'key':a129_0x456314(0x1f5),'allowSelf':![],'label':a129_0x456314(0x1ef)},{'flag':a129_0x456314(0x1d3),'key':'dataExport','allowSelf':![],'label':a129_0x456314(0x1ce)},{'flag':a129_0x456314(0x207),'key':a129_0x456314(0x1d9),'allowSelf':!![],'label':'row\x20visibility'}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a129_0x456314(0x1e6)](_0x5c3e18=>({'name':_0x5c3e18[a129_0x456314(0x1d6)],'type':a129_0x456314(0x202),'required':![],'description':a129_0x456314(0x1c6)+_0x5c3e18[a129_0x456314(0x206)]+'\x20(comma-separated\x20SELF/ALL/id/name)'+(_0x5c3e18[a129_0x456314(0x1ea)]?a129_0x456314(0x20b):'')}));export function splitList(_0x3967b1){const _0x481269=a129_0x456314;return _0x3967b1[_0x481269(0x1ed)](',')['map'](_0x55b71d=>_0x55b71d[_0x481269(0x1d4)]())[_0x481269(0x205)](Boolean);}function a129_0x2c7d(_0x33e153,_0x1da72b){_0x33e153=_0x33e153-0x1bd;const _0x4d5933=a129_0x4d59();let _0x2c7dcd=_0x4d5933[_0x33e153];return _0x2c7dcd;}export function projectRoleRef(_0x5783ad){return{'id':_0x5783ad['id'],'roleName':_0x5783ad['roleName'],'roleType':_0x5783ad['roleType']};}export async function resolvePermitRoles(_0x382c1c,_0xbe2d0e,_0x384007){const _0x37827d=a129_0x456314,_0x369639=await listPermitRoles(_0x382c1c,{'needSelf':!![],'needPublic':!![]}),_0x16ba85=[];for(const _0x2f5a99 of _0xbe2d0e){const _0x2a7083=resolveOnePermitRole(_0x369639,_0x2f5a99);if(!_0x384007[_0x37827d(0x1ea)]&&_0x2a7083[_0x37827d(0x1f0)]==='SELF')throw CliErrors[_0x37827d(0x1c5)](_0x37827d(0x1f1)+_0x384007[_0x37827d(0x206)]+'.','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.');if(!_0x16ba85[_0x37827d(0x1eb)](_0x304d49=>_0x304d49['id']===_0x2a7083['id']))_0x16ba85[_0x37827d(0x1fa)](_0x2a7083);}return _0x16ba85;}function resolveOnePermitRole(_0x21aff2,_0x3aa671){const _0x1ac238=a129_0x456314,_0x46f217=_0x3aa671[_0x1ac238(0x1d4)](),_0x57e301=_0x46f217[_0x1ac238(0x201)]();if(_0x57e301==='SELF'||_0x57e301==='ALL'){const _0x3e4087=_0x21aff2['find'](_0x4aea65=>_0x4aea65['roleType']===_0x57e301);if(!_0x3e4087)throw CliErrors[_0x1ac238(0x1c5)](_0x1ac238(0x1e2)+_0x57e301+_0x1ac238(0x1d2));return _0x3e4087;}if(/^-?\d+$/[_0x1ac238(0x1bf)](_0x46f217)){const _0x52b35c=Number(_0x46f217),_0x4da6cc=_0x21aff2[_0x1ac238(0x209)](_0x409b71=>_0x409b71['id']===_0x52b35c);if(!_0x4da6cc)throw CliErrors['validation']('Role\x20id\x20'+_0x52b35c+'\x20not\x20found.','Run\x20`role\x20list`.');return _0x4da6cc;}const _0x13be1e=_0x21aff2[_0x1ac238(0x205)](_0x3b52a9=>_0x3b52a9['roleName']===_0x46f217);if(_0x13be1e['length']===0x0)throw CliErrors[_0x1ac238(0x1c5)](_0x1ac238(0x1c2)+_0x46f217+_0x1ac238(0x1d5),_0x1ac238(0x1de));if(_0x13be1e[_0x1ac238(0x1c3)]>0x1)throw CliErrors[_0x1ac238(0x1c5)](_0x1ac238(0x1c2)+_0x46f217+_0x1ac238(0x1ec)+_0x13be1e[_0x1ac238(0x1e6)](_0x54b6f7=>_0x54b6f7['id'])['join'](',\x20')+').',_0x1ac238(0x1c1));return _0x13be1e[0x0];}export function projectPageSlot(_0x2c2d){const _0x3c2a36=a129_0x456314;if(!_0x2c2d)return null;return{'resourceCode':_0x2c2d[_0x3c2a36(0x1c0)],'roles':(_0x2c2d['rolePermit']??[])['map'](projectRoleRef)};}export function projectPagePermit(_0x2810a6){const _0x30c815=a129_0x456314,_0x1c04d7={'menuId':_0x2810a6[_0x30c815(0x1fc)],'appCode':_0x2810a6[_0x30c815(0x1fd)],'menuPermit':projectPageSlot(_0x2810a6[_0x30c815(0x1e9)])};for(const _0xd3f927 of PAGE_SLOT_SPECS){if(_0xd3f927[_0x30c815(0x1c9)]==='menuPermit')continue;_0x1c04d7[_0xd3f927[_0x30c815(0x1c9)]]=projectPageSlot(_0x2810a6[_0xd3f927[_0x30c815(0x1c9)]]);}return _0x1c04d7;}export function flattenMenuResources(_0x5ebd39){const _0x348679=new Map(),_0x454b5e=_0x29943b=>{const _0x47657a=a129_0x2c7d;for(const _0x55426b of _0x29943b??[]){_0x348679[_0x47657a(0x1f9)](_0x55426b[_0x47657a(0x1c0)],{'resourceCode':_0x55426b['resourceCode'],'resourceName':_0x55426b[_0x47657a(0x1be)],'action':_0x55426b[_0x47657a(0x1cc)]?.[0x0]??'0'});if(_0x55426b[_0x47657a(0x1d7)])_0x454b5e(_0x55426b[_0x47657a(0x1d7)]);}};return _0x454b5e(_0x5ebd39),_0x348679;}export function flattenApiResources(_0x504abc){const _0x4a836d=a129_0x456314,_0x103360=new Map(),_0x59bea4=new Map();for(const _0x2a0333 of _0x504abc){const _0x23f77e=_0x2a0333[_0x4a836d(0x1f6)]??{};for(const [_0x517ef0,_0x55a329]of Object['entries'](_0x23f77e)){_0x103360[_0x4a836d(0x1f9)](_0x517ef0,{'resourceCode':_0x517ef0,'resourceName':_0x2a0333['resourceName'],'datasetCode':_0x2a0333[_0x4a836d(0x208)],'action':_0x55a329?.[0x0]??'0'});const _0x2d463b=_0x59bea4['get'](_0x2a0333[_0x4a836d(0x208)])??[];_0x2d463b[_0x4a836d(0x1fa)](_0x517ef0),_0x59bea4['set'](_0x2a0333['datasetCode'],_0x2d463b);}}return{'byCode':_0x103360,'byDataset':_0x59bea4};}export function buildPermits(_0x1f3ea4,_0x2744ab){const _0x3d29c3={};for(const [_0x3de89d,_0x1fb78a]of _0x1f3ea4){const _0x403e67=_0x2744ab['get'](_0x3de89d)??_0x1fb78a['action'];_0x3d29c3[_0x3de89d]=[_0x403e67];}return _0x3d29c3;}export function readRoleRef(_0x12ad88){const _0x950aae=a129_0x456314,_0x344fa5=_0x12ad88['str']('role')[_0x950aae(0x1d4)]();if(!_0x344fa5)throw CliErrors['flagMissing'](_0x950aae(0x1df),_0x950aae(0x1d0));return _0x344fa5;}export function readGrantRevoke(_0x39a526){const _0x1bb0d9=a129_0x456314,_0xe8d348=_0x39a526[_0x1bb0d9(0x1e5)](_0x1bb0d9(0x1fe)),_0x17cb50=_0x39a526[_0x1bb0d9(0x1e5)](_0x1bb0d9(0x1c8));if(_0xe8d348&&_0x17cb50)throw CliErrors[_0x1bb0d9(0x1c5)](_0x1bb0d9(0x204));if(!_0xe8d348&&!_0x17cb50)throw CliErrors[_0x1bb0d9(0x1c5)](_0x1bb0d9(0x1f2),_0x1bb0d9(0x1fb));return _0xe8d348?_0x1bb0d9(0x1d8):'0';}
1
+ const a129_0x5ba26f=a129_0xa381;(function(_0x39ede9,_0x16dd3a){const _0x43aaa3=a129_0xa381,_0xae9bf8=_0x39ede9();while(!![]){try{const _0x479ddf=-parseInt(_0x43aaa3(0xb8))/0x1+-parseInt(_0x43aaa3(0xc3))/0x2+-parseInt(_0x43aaa3(0xe4))/0x3*(parseInt(_0x43aaa3(0xc0))/0x4)+-parseInt(_0x43aaa3(0xe6))/0x5+parseInt(_0x43aaa3(0xb1))/0x6*(parseInt(_0x43aaa3(0xd8))/0x7)+-parseInt(_0x43aaa3(0xa6))/0x8+parseInt(_0x43aaa3(0xac))/0x9;if(_0x479ddf===_0x16dd3a)break;else _0xae9bf8['push'](_0xae9bf8['shift']());}catch(_0x12cb30){_0xae9bf8['push'](_0xae9bf8['shift']());}}}(a129_0x221a,0x64abb));import{listPermitRoles}from'../../core/api-client.js';function a129_0xa381(_0x23e19f,_0x4a1c55){_0x23e19f=_0x23e19f-0xa4;const _0x221a25=a129_0x221a();let _0xa3810d=_0x221a25[_0x23e19f];return _0xa3810d;}import{CliErrors}from'../../errors.js';function a129_0x221a(){const _0x1aefb5=['key','number','flag','Missing\x20action.','dataExport','2059014lfybvn','\x20not\x20found.','1626010WlOPxK','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','push','dataDetail','\x20(comma-separated\x20SELF/ALL/id/name)','menus','find','Roles\x20for\x20','Role\x20id\x20or\x20role\x20name','data\x20export','dataUpdate','pageNodeList','join','row\x20visibility','roleType','data\x20update','Role\x20\x22','roleName','2128768UqGqfO','row-roles','Run\x20`role\x20list`.','set','data\x20create','appCode','24187473RTtWQB','dataPermit','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','resourceName','some','1992smgXrg','Menu\x20id\x20(from\x20`menu\x20list`)','validation','Pass\x20--role\x20<id|name>.','length','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','action','351880GBUeal',';\x20SELF\x20=\x20only\x20own\x20rows','\x22\x20is\x20ambiguous\x20(ids:\x20','Disambiguate\x20with\x20an\x20id.','menuId','menu\x20visibility','label','rolePermit','4OmCwbT','map','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.','1307868AdjGgw','toUpperCase','grant','menuPermit','Grant\x20access\x20to\x20the\x20listed\x20resources','trim','data\x20delete','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.','apiList','access','string','filter','Role\x20id\x20','allowSelf','datasets','revoke','datasetCode','role','detail-roles','SELF','resourceCode','175syMxSE','boolean','\x20is\x20not\x20available\x20for\x20this\x20app.','test','get','export-roles','\x22\x20not\x20found.'];a129_0x221a=function(){return _0x1aefb5;};return a129_0x221a();}export const MENU_ID_FLAG={'name':'menu-id','type':a129_0x5ba26f(0xe0),'required':!![],'description':a129_0x5ba26f(0xb2)};export const ROLE_REF_FLAG={'name':a129_0x5ba26f(0xd4),'type':a129_0x5ba26f(0xcd),'required':!![],'description':a129_0x5ba26f(0xee)};export const GRANT_FLAG={'name':a129_0x5ba26f(0xc5),'type':a129_0x5ba26f(0xd9),'required':![],'description':a129_0x5ba26f(0xc7)};export const REVOKE_FLAG={'name':'revoke','type':a129_0x5ba26f(0xd9),'required':![],'description':'Revoke\x20access\x20to\x20the\x20listed\x20resources'};export const MENUS_FLAG={'name':a129_0x5ba26f(0xeb),'type':a129_0x5ba26f(0xcd),'required':!![],'description':'Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke'};export const DATASETS_FLAG={'name':a129_0x5ba26f(0xd1),'type':a129_0x5ba26f(0xcd),'required':!![],'description':a129_0x5ba26f(0xae)};export const PAGE_SLOT_SPECS=[{'flag':'menu-roles','key':a129_0x5ba26f(0xc6),'allowSelf':![],'label':a129_0x5ba26f(0xbd)},{'flag':'create-roles','key':'dataCreate','allowSelf':![],'label':a129_0x5ba26f(0xaa)},{'flag':'update-roles','key':a129_0x5ba26f(0xf0),'allowSelf':![],'label':a129_0x5ba26f(0xf5)},{'flag':'delete-roles','key':'dataDelete','allowSelf':![],'label':a129_0x5ba26f(0xc9)},{'flag':a129_0x5ba26f(0xd5),'key':a129_0x5ba26f(0xe9),'allowSelf':![],'label':'data\x20detail'},{'flag':a129_0x5ba26f(0xdd),'key':a129_0x5ba26f(0xe3),'allowSelf':![],'label':a129_0x5ba26f(0xef)},{'flag':a129_0x5ba26f(0xa7),'key':a129_0x5ba26f(0xad),'allowSelf':!![],'label':a129_0x5ba26f(0xf3)}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS['map'](_0x2dfa59=>({'name':_0x2dfa59[a129_0x5ba26f(0xe1)],'type':a129_0x5ba26f(0xcd),'required':![],'description':a129_0x5ba26f(0xed)+_0x2dfa59[a129_0x5ba26f(0xbe)]+a129_0x5ba26f(0xea)+(_0x2dfa59[a129_0x5ba26f(0xd0)]?a129_0x5ba26f(0xb9):'')}));export function splitList(_0x5b0508){const _0x401224=a129_0x5ba26f;return _0x5b0508['split'](',')[_0x401224(0xc1)](_0x287310=>_0x287310[_0x401224(0xc8)]())[_0x401224(0xce)](Boolean);}export function projectRoleRef(_0x48ac00){const _0x25856f=a129_0x5ba26f;return{'id':_0x48ac00['id'],'roleName':_0x48ac00['roleName'],'roleType':_0x48ac00[_0x25856f(0xf4)]};}export async function resolvePermitRoles(_0x380704,_0xbd286a,_0x3b1dd9){const _0x271078=a129_0x5ba26f,_0x3f59c1=await listPermitRoles(_0x380704,{'needSelf':!![],'needPublic':!![]}),_0x53ddd5=[];for(const _0x46fdd7 of _0xbd286a){const _0x31b459=resolveOnePermitRole(_0x3f59c1,_0x46fdd7);if(!_0x3b1dd9[_0x271078(0xd0)]&&_0x31b459['roleType']===_0x271078(0xd6))throw CliErrors['validation']('SELF\x20is\x20not\x20allowed\x20for\x20'+_0x3b1dd9[_0x271078(0xbe)]+'.',_0x271078(0xe7));if(!_0x53ddd5[_0x271078(0xb0)](_0x9902c7=>_0x9902c7['id']===_0x31b459['id']))_0x53ddd5[_0x271078(0xe8)](_0x31b459);}return _0x53ddd5;}function resolveOnePermitRole(_0xf669c1,_0x2501af){const _0x27bf47=a129_0x5ba26f,_0x4ef259=_0x2501af['trim'](),_0x2ce0f5=_0x4ef259[_0x27bf47(0xc4)]();if(_0x2ce0f5===_0x27bf47(0xd6)||_0x2ce0f5==='ALL'){const _0x142872=_0xf669c1[_0x27bf47(0xec)](_0x4c126f=>_0x4c126f[_0x27bf47(0xf4)]===_0x2ce0f5);if(!_0x142872)throw CliErrors['validation']('Special\x20role\x20'+_0x2ce0f5+_0x27bf47(0xda));return _0x142872;}if(/^-?\d+$/[_0x27bf47(0xdb)](_0x4ef259)){const _0x80fa5d=Number(_0x4ef259),_0x38c7b3=_0xf669c1['find'](_0x2903ce=>_0x2903ce['id']===_0x80fa5d);if(!_0x38c7b3)throw CliErrors[_0x27bf47(0xb3)](_0x27bf47(0xcf)+_0x80fa5d+_0x27bf47(0xe5),_0x27bf47(0xa8));return _0x38c7b3;}const _0x40031b=_0xf669c1[_0x27bf47(0xce)](_0x349ccf=>_0x349ccf[_0x27bf47(0xa5)]===_0x4ef259);if(_0x40031b[_0x27bf47(0xb5)]===0x0)throw CliErrors[_0x27bf47(0xb3)](_0x27bf47(0xa4)+_0x4ef259+_0x27bf47(0xde),_0x27bf47(0xc2));if(_0x40031b[_0x27bf47(0xb5)]>0x1)throw CliErrors[_0x27bf47(0xb3)](_0x27bf47(0xa4)+_0x4ef259+_0x27bf47(0xba)+_0x40031b[_0x27bf47(0xc1)](_0x2afb2e=>_0x2afb2e['id'])[_0x27bf47(0xf2)](',\x20')+').',_0x27bf47(0xbb));return _0x40031b[0x0];}export function projectPageSlot(_0x41d6b5){const _0x56e6d1=a129_0x5ba26f;if(!_0x41d6b5)return null;return{'resourceCode':_0x41d6b5[_0x56e6d1(0xd7)],'roles':(_0x41d6b5[_0x56e6d1(0xbf)]??[])[_0x56e6d1(0xc1)](projectRoleRef)};}export function projectPagePermit(_0x42e13c){const _0x1b841a=a129_0x5ba26f,_0x492fd2={'menuId':_0x42e13c[_0x1b841a(0xbc)],'appCode':_0x42e13c[_0x1b841a(0xab)],'menuPermit':projectPageSlot(_0x42e13c['menuPermit'])};for(const _0x1bbb0 of PAGE_SLOT_SPECS){if(_0x1bbb0[_0x1b841a(0xdf)]===_0x1b841a(0xc6))continue;_0x492fd2[_0x1bbb0[_0x1b841a(0xdf)]]=projectPageSlot(_0x42e13c[_0x1bbb0[_0x1b841a(0xdf)]]);}return _0x492fd2;}export function flattenMenuResources(_0x566a38){const _0x174a4b=new Map(),_0x2fc6c0=_0x291903=>{const _0x446d8e=a129_0xa381;for(const _0x356d86 of _0x291903??[]){_0x174a4b[_0x446d8e(0xa9)](_0x356d86[_0x446d8e(0xd7)],{'resourceCode':_0x356d86[_0x446d8e(0xd7)],'resourceName':_0x356d86[_0x446d8e(0xaf)],'action':_0x356d86['allowedActions']?.[0x0]??'0'});if(_0x356d86[_0x446d8e(0xf1)])_0x2fc6c0(_0x356d86[_0x446d8e(0xf1)]);}};return _0x2fc6c0(_0x566a38),_0x174a4b;}export function flattenApiResources(_0x381103){const _0x49f5eb=a129_0x5ba26f,_0x521f02=new Map(),_0x457bff=new Map();for(const _0x3836d2 of _0x381103){const _0x67cef7=_0x3836d2[_0x49f5eb(0xcb)]??{};for(const [_0x924678,_0x17b047]of Object['entries'](_0x67cef7)){_0x521f02[_0x49f5eb(0xa9)](_0x924678,{'resourceCode':_0x924678,'resourceName':_0x3836d2[_0x49f5eb(0xaf)],'datasetCode':_0x3836d2[_0x49f5eb(0xd3)],'action':_0x17b047?.[0x0]??'0'});const _0x179d33=_0x457bff[_0x49f5eb(0xdc)](_0x3836d2[_0x49f5eb(0xd3)])??[];_0x179d33['push'](_0x924678),_0x457bff[_0x49f5eb(0xa9)](_0x3836d2[_0x49f5eb(0xd3)],_0x179d33);}}return{'byCode':_0x521f02,'byDataset':_0x457bff};}export function buildPermits(_0x13bb8f,_0x26a656){const _0x33a74d=a129_0x5ba26f,_0x3624f5={};for(const [_0x2db19c,_0x801017]of _0x13bb8f){const _0x492ac4=_0x26a656[_0x33a74d(0xdc)](_0x2db19c)??_0x801017[_0x33a74d(0xb7)];_0x3624f5[_0x2db19c]=[_0x492ac4];}return _0x3624f5;}export function readRoleRef(_0x4932ae){const _0x2b6a44=a129_0x5ba26f,_0x324157=_0x4932ae['str'](_0x2b6a44(0xd4))[_0x2b6a44(0xc8)]();if(!_0x324157)throw CliErrors['flagMissing']('role',_0x2b6a44(0xb4));return _0x324157;}export function readGrantRevoke(_0x214c77){const _0x5042c5=a129_0x5ba26f,_0x5df202=_0x214c77['bool'](_0x5042c5(0xc5)),_0x2318f3=_0x214c77['bool'](_0x5042c5(0xd2));if(_0x5df202&&_0x2318f3)throw CliErrors['validation'](_0x5042c5(0xb6));if(!_0x5df202&&!_0x2318f3)throw CliErrors[_0x5042c5(0xb3)](_0x5042c5(0xe2),_0x5042c5(0xca));return _0x5df202?_0x5042c5(0xcc):'0';}
@@ -1 +1 @@
1
- (function(_0x30f5a0,_0xebcbfa){const _0x2c341c=a130_0x2bb1,_0x315185=_0x30f5a0();while(!![]){try{const _0x4b14bb=parseInt(_0x2c341c(0x88))/0x1+-parseInt(_0x2c341c(0x9f))/0x2*(-parseInt(_0x2c341c(0x91))/0x3)+parseInt(_0x2c341c(0x9d))/0x4*(parseInt(_0x2c341c(0x82))/0x5)+-parseInt(_0x2c341c(0x9c))/0x6*(parseInt(_0x2c341c(0x85))/0x7)+parseInt(_0x2c341c(0x96))/0x8+-parseInt(_0x2c341c(0x90))/0x9*(parseInt(_0x2c341c(0x8b))/0xa)+-parseInt(_0x2c341c(0x8e))/0xb*(-parseInt(_0x2c341c(0x80))/0xc);if(_0x4b14bb===_0xebcbfa)break;else _0x315185['push'](_0x315185['shift']());}catch(_0x49cc11){_0x315185['push'](_0x315185['shift']());}}}(a130_0x13db,0x80683));import{existsSync}from'node:fs';import a130_0x4d2261 from'node:path';import a130_0x20ac4e from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';function a130_0x13db(){const _0x2b4b92=['952RITghG','cwd','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','384062BKjRJv','trim','Not\x20set','397690UYfYVo','Skipped','cyan','2420FBnMFu','length','162BczZam','3XTtCFG','test','my-app','log','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','3399856WOKsAV','green','√\x20Login\x20status:\x20','√\x20App\x20Code:\x20','Login\x20failed','string','42618aqIhFH','2932yTtXnk','Project\x20name\x20cannot\x20exceed\x2050\x20characters','978096indPJr','env','24792JXqHyw','production','3105uyrHsX','\x22\x20already\x20exists','√\x20Project\x20Name:\x20'];a130_0x13db=function(){return _0x2b4b92;};return a130_0x13db();}function a130_0x2bb1(_0x244125,_0x53d5e){_0x244125=_0x244125-0x80;const _0x13db68=a130_0x13db();let _0x2bb157=_0x13db68[_0x244125];return _0x2bb157;}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(_0x175488,_0x149ff3,_0x833be1){const _0x5d7594=a130_0x2bb1,_0x328935=_0x5d7594(0x93),_0x16acfd=readConfig(),_0x5db0f3=typeof _0x16acfd[_0x5d7594(0xa0)]===_0x5d7594(0x9b)?_0x16acfd[_0x5d7594(0xa0)]:undefined,_0x41d4b0=await input({'message':'Project\x20name:','default':_0x328935,'validate':_0x6f1583=>{const _0x248b20=_0x5d7594,_0x487979=_0x6f1583[_0x248b20(0x89)]()||_0x328935;if(_0x487979[_0x248b20(0x8f)]>0x32)return _0x248b20(0x9e);const _0x318f48=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x487979&&!_0x318f48[_0x248b20(0x92)](_0x487979))return _0x248b20(0x95);const _0x5776c4=a130_0x4d2261['resolve'](process[_0x248b20(0x86)](),_0x487979);if(existsSync(_0x5776c4))return'Directory\x20\x22'+_0x487979+_0x248b20(0x83);return!![];}});console[_0x5d7594(0x94)](a130_0x20ac4e['green'](_0x5d7594(0x84)+a130_0x20ac4e[_0x5d7594(0x8d)](_0x41d4b0)));const _0x3fb0ec=await selectSingleAppcode(_0x833be1);console[_0x5d7594(0x94)](a130_0x20ac4e[_0x5d7594(0x97)](_0x5d7594(0x99)+a130_0x20ac4e[_0x5d7594(0x8d)](_0x3fb0ec||_0x5d7594(0x8a))));if(_0x3fb0ec){const _0x46dce4=await getIsSessionValid();if(!_0x46dce4){const _0x23c21f=await confirm({'message':_0x5d7594(0x87),'default':!![]});if(_0x23c21f){const _0x539572=await authServer({'silent':!![]});console[_0x5d7594(0x94)](a130_0x20ac4e['green'](_0x5d7594(0x98)+a130_0x20ac4e[_0x5d7594(0x8d)](_0x539572?'Logged\x20in':_0x5d7594(0x9a))));}else console[_0x5d7594(0x94)](a130_0x20ac4e[_0x5d7594(0x97)](_0x5d7594(0x98)+a130_0x20ac4e[_0x5d7594(0x8d)](_0x5d7594(0x8c))));}await _0x175488({'projectName':_0x41d4b0,'appCode':_0x3fb0ec,'env':_0x149ff3||_0x5db0f3||_0x5d7594(0x81)});}else await _0x175488({'projectName':_0x41d4b0,'env':_0x149ff3||_0x5db0f3||_0x5d7594(0x81)});}
1
+ function a130_0x82e1(){const _0x5390ce=['124148sqgRKR','green','log','test','cyan','string','Project\x20name:','1431972yddBeY','Logged\x20in','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','3092AZqXtk','Not\x20set','env','30ruYkFp','length','production','249sDWNnx','√\x20App\x20Code:\x20','1000824AOADFv','153155nwhzmg','√\x20Login\x20status:\x20','3152OezSps','603207sIGsWq','70fhxQBz','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','\x22\x20already\x20exists','trim','Login\x20failed','4935trYbty','5RAOwCa'];a130_0x82e1=function(){return _0x5390ce;};return a130_0x82e1();}(function(_0x11aa67,_0x50ac52){const _0x395b91=a130_0x56db,_0x16dfb3=_0x11aa67();while(!![]){try{const _0x3d24bd=-parseInt(_0x395b91(0xb1))/0x1*(-parseInt(_0x395b91(0xb2))/0x2)+-parseInt(_0x395b91(0xc2))/0x3*(parseInt(_0x395b91(0xbc))/0x4)+-parseInt(_0x395b91(0xc5))/0x5*(-parseInt(_0x395b91(0xbf))/0x6)+-parseInt(_0x395b91(0xb0))/0x7*(-parseInt(_0x395b91(0xa9))/0x8)+-parseInt(_0x395b91(0xb9))/0x9+-parseInt(_0x395b91(0xab))/0xa*(parseInt(_0x395b91(0xaa))/0xb)+parseInt(_0x395b91(0xc4))/0xc;if(_0x3d24bd===_0x50ac52)break;else _0x16dfb3['push'](_0x16dfb3['shift']());}catch(_0x57bcb5){_0x16dfb3['push'](_0x16dfb3['shift']());}}}(a130_0x82e1,0x351e3));import{existsSync}from'node:fs';import a130_0x382000 from'node:path';import a130_0x4630b0 from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';function a130_0x56db(_0x1b59bb,_0xd0ecc5){_0x1b59bb=_0x1b59bb-0xa9;const _0x82e12e=a130_0x82e1();let _0x56dbce=_0x82e12e[_0x1b59bb];return _0x56dbce;}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(_0x90ef3c,_0x480aa6,_0x45afd2){const _0xe3f298=a130_0x56db,_0x4df270='my-app',_0x598503=readConfig(),_0x2b87bc=typeof _0x598503[_0xe3f298(0xbe)]===_0xe3f298(0xb7)?_0x598503['env']:undefined,_0x12daac=await input({'message':_0xe3f298(0xb8),'default':_0x4df270,'validate':_0x735dbe=>{const _0x1f0fe=_0xe3f298,_0x5e2621=_0x735dbe[_0x1f0fe(0xae)]()||_0x4df270;if(_0x5e2621[_0x1f0fe(0xc0)]>0x32)return'Project\x20name\x20cannot\x20exceed\x2050\x20characters';const _0x2851e7=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x5e2621&&!_0x2851e7[_0x1f0fe(0xb5)](_0x5e2621))return _0x1f0fe(0xbb);const _0x3e2209=a130_0x382000['resolve'](process['cwd'](),_0x5e2621);if(existsSync(_0x3e2209))return'Directory\x20\x22'+_0x5e2621+_0x1f0fe(0xad);return!![];}});console[_0xe3f298(0xb4)](a130_0x4630b0[_0xe3f298(0xb3)]('√\x20Project\x20Name:\x20'+a130_0x4630b0[_0xe3f298(0xb6)](_0x12daac)));const _0x1e1a33=await selectSingleAppcode(_0x45afd2);console[_0xe3f298(0xb4)](a130_0x4630b0['green'](_0xe3f298(0xc3)+a130_0x4630b0['cyan'](_0x1e1a33||_0xe3f298(0xbd))));if(_0x1e1a33){const _0x58c504=await getIsSessionValid();if(!_0x58c504){const _0x4a5c29=await confirm({'message':_0xe3f298(0xac),'default':!![]});if(_0x4a5c29){const _0x1345a6=await authServer({'silent':!![]});console[_0xe3f298(0xb4)](a130_0x4630b0[_0xe3f298(0xb3)](_0xe3f298(0xc6)+a130_0x4630b0[_0xe3f298(0xb6)](_0x1345a6?_0xe3f298(0xba):_0xe3f298(0xaf))));}else console['log'](a130_0x4630b0[_0xe3f298(0xb3)](_0xe3f298(0xc6)+a130_0x4630b0['cyan']('Skipped')));}await _0x90ef3c({'projectName':_0x12daac,'appCode':_0x1e1a33,'env':_0x480aa6||_0x2b87bc||_0xe3f298(0xc1)});}else await _0x90ef3c({'projectName':_0x12daac,'env':_0x480aa6||_0x2b87bc||_0xe3f298(0xc1)});}
@@ -1 +1 @@
1
- function a131_0x4d3c(_0x2a400e,_0x573987){_0x2a400e=_0x2a400e-0x95;const _0x53a645=a131_0x53a6();let _0x4d3c93=_0x53a645[_0x2a400e];return _0x4d3c93;}(function(_0x2ba656,_0x7e6864){const _0x4036fe=a131_0x4d3c,_0x40427c=_0x2ba656();while(!![]){try{const _0x19c74a=parseInt(_0x4036fe(0xa0))/0x1+parseInt(_0x4036fe(0x9f))/0x2+-parseInt(_0x4036fe(0x9d))/0x3+parseInt(_0x4036fe(0x9e))/0x4*(parseInt(_0x4036fe(0x99))/0x5)+-parseInt(_0x4036fe(0x96))/0x6*(parseInt(_0x4036fe(0x97))/0x7)+parseInt(_0x4036fe(0x9c))/0x8*(parseInt(_0x4036fe(0x9b))/0x9)+-parseInt(_0x4036fe(0x98))/0xa*(parseInt(_0x4036fe(0x95))/0xb);if(_0x19c74a===_0x7e6864)break;else _0x40427c['push'](_0x40427c['shift']());}catch(_0x2750eb){_0x40427c['push'](_0x40427c['shift']());}}}(a131_0x53a6,0xd5f70));function a131_0x53a6(){const _0x3ecb1c=['11paHHHM','56184FIvhmi','448OjULXy','5577100NZHprd','147750ZuxELn','now','108TSyxKm','1082728XdwtVR','3659286VpoWxo','188pdOzhS','270378jThcQY','105037aTnJaZ','toFixed'];a131_0x53a6=function(){return _0x3ecb1c;};return a131_0x53a6();}export function formatElapsed(_0x3df795){const _0x491551=a131_0x4d3c,_0x261d1e=Date[_0x491551(0x9a)]()-_0x3df795;if(_0x261d1e<0x3e8)return _0x261d1e+'ms';const _0xfbeb0e=(_0x261d1e/0x3e8)[_0x491551(0xa1)](0x2),_0xeb908d=_0xfbeb0e['replace'](/\.?0+$/u,'');return _0xeb908d+'s';}
1
+ (function(_0x47c7c0,_0x99f26c){const _0x2819f1=a131_0x5913,_0x502738=_0x47c7c0();while(!![]){try{const _0x26cdf0=-parseInt(_0x2819f1(0x186))/0x1+parseInt(_0x2819f1(0x18c))/0x2*(-parseInt(_0x2819f1(0x18e))/0x3)+parseInt(_0x2819f1(0x18d))/0x4+-parseInt(_0x2819f1(0x18a))/0x5*(parseInt(_0x2819f1(0x189))/0x6)+parseInt(_0x2819f1(0x190))/0x7+parseInt(_0x2819f1(0x18f))/0x8+parseInt(_0x2819f1(0x18b))/0x9;if(_0x26cdf0===_0x99f26c)break;else _0x502738['push'](_0x502738['shift']());}catch(_0x1d4581){_0x502738['push'](_0x502738['shift']());}}}(a131_0x203f,0xda1fc));export function formatElapsed(_0x1b57a3){const _0x5bed6a=a131_0x5913,_0x46f3da=Date[_0x5bed6a(0x191)]()-_0x1b57a3;if(_0x46f3da<0x3e8)return _0x46f3da+'ms';const _0xbea6d7=(_0x46f3da/0x3e8)[_0x5bed6a(0x188)](0x2),_0x1e0ddb=_0xbea6d7[_0x5bed6a(0x187)](/\.?0+$/u,'');return _0x1e0ddb+'s';}function a131_0x5913(_0x48f99e,_0x21d899){_0x48f99e=_0x48f99e-0x186;const _0x203f29=a131_0x203f();let _0x591379=_0x203f29[_0x48f99e];return _0x591379;}function a131_0x203f(){const _0x104d7d=['2070JcaGSJ','16770TkKlyn','8538003ubQdfQ','334wGtDSj','5348548fTpORf','16221nMayTc','1939200qKTGDQ','10727738rsJaXq','now','1107203dvmxwt','replace','toFixed'];a131_0x203f=function(){return _0x104d7d;};return a131_0x203f();}
@@ -1 +1 @@
1
- function a132_0x198b(){const _0x1035fd=['\x20\x202.\x20Pull\x20API\x20configuration:\x20','🚀\x20Next\x20Steps:','704pfkBlr','join','rmSync','needsUpgrade','开始创建项目:\x20','cd\x20','\x20config\x20set\x20appcode\x20<app-code>\x27','cwd','cookie','159672SHRHTI','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','2WHrxpB','cyan','name','appCode','Project\x20name:\x20','CLI\x20版本检查','\x20run\x20start','*\x20Pulling\x20API\x20configuration...','W_OK','4205205UbSdyg','log','stringify','√\x20package.json\x20updated:\x20name=','2905377vrCDkO','dirname','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','fail','889970QoJnNB','warn','error','utf8','keys','production','98bLUqGU','modelCount','stop','\x20already\x20exists','stableVersion','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','Format\x20code','readFileSync','belowMinimum','√\x20Pulled\x20','test','清理项目目录失败:\x20','26584162uTFhDZ','resolve','\x20&&\x20','√\x20Configuration\x20file\x20created,\x20Apps:\x20','parse','项目创建失败:\x20','projectName','info','projectCode','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','65133JOVaJZ','constants','toLocaleString','\x20\x201.\x20Start\x20project:\x20','gray','setLogPath','start','Install\x20dependencies','\x20√\x20','更新\x20package.json\x20name','create','env','配置应用AppCode:\x20','length','message','1.0.0','repeat','chdir','4YVNZYP','string','bold','12xZwjBf','existsSync','currentVersion','更新\x20package.json\x20失败','version','15994030XgVKRF','Project\x20name\x20cannot\x20be\x20empty','green','package.json','minimumVersion','*\x20Creating\x20configuration\x20file\x20for\x20project\x20'];a132_0x198b=function(){return _0x1035fd;};return a132_0x198b();}(function(_0x40c3f8,_0x50eef6){const _0x47c96d=a132_0x40ae,_0x469ece=_0x40c3f8();while(!![]){try{const _0x2dfbd1=parseInt(_0x47c96d(0x1cc))/0x1+parseInt(_0x47c96d(0x1bb))/0x2*(-parseInt(_0x47c96d(0x1c8))/0x3)+-parseInt(_0x47c96d(0x1fa))/0x4*(parseInt(_0x47c96d(0x1c4))/0x5)+-parseInt(_0x47c96d(0x1b9))/0x6*(-parseInt(_0x47c96d(0x1d2))/0x7)+parseInt(_0x47c96d(0x20a))/0x8*(parseInt(_0x47c96d(0x1e8))/0x9)+-parseInt(_0x47c96d(0x202))/0xa+-parseInt(_0x47c96d(0x1de))/0xb*(-parseInt(_0x47c96d(0x1fd))/0xc);if(_0x2dfbd1===_0x50eef6)break;else _0x469ece['push'](_0x469ece['shift']());}catch(_0x567038){_0x469ece['push'](_0x469ece['shift']());}}}(a132_0x198b,0xdd7e1));import a132_0xc81316 from'path';import a132_0x6da26d from'fs';import a132_0x1de3c4 from'chalk';import a132_0x6937ca 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';function a132_0x40ae(_0x3ce9cb,_0x5b1bff){_0x3ce9cb=_0x3ce9cb-0x1b9;const _0x198bd9=a132_0x198b();let _0x40ae97=_0x198bd9[_0x3ce9cb];return _0x40ae97;}import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x150d50){const _0x1e083c=a132_0x40ae,_0x2b4969=await checkCliVersion();(_0x2b4969[_0x1e083c(0x20d)]||_0x2b4969[_0x1e083c(0x1da)])&&(printCliUpgradeWarning(_0x2b4969),assertCliVersionSupported(_0x2b4969),logger['info']('create',_0x1e083c(0x1c0),{'currentVersion':_0x2b4969[_0x1e083c(0x1ff)],'stableVersion':_0x2b4969[_0x1e083c(0x1d6)],'minimumVersion':_0x2b4969[_0x1e083c(0x206)],'needsUpgrade':_0x2b4969[_0x1e083c(0x20d)],'belowMinimum':_0x2b4969[_0x1e083c(0x1da)]}));if(_0x150d50[_0x1e083c(0x1e6)]&&_0x150d50[_0x1e083c(0x1be)])await runCreate({'projectName':_0x150d50[_0x1e083c(0x1e6)],'appCode':_0x150d50[_0x1e083c(0x1be)],'env':_0x150d50[_0x1e083c(0x1f3)]},_0x150d50);else{if(_0x150d50[_0x1e083c(0x1e6)]){const _0x537d9a=await selectSingleAppcode(_0x150d50['cookie']);await runCreate({'projectName':_0x150d50[_0x1e083c(0x1e6)],'appCode':_0x537d9a||undefined,'env':_0x150d50[_0x1e083c(0x1f3)]},_0x150d50);}else await guidedCreateProject(_0x26e919=>runCreate(_0x26e919,_0x150d50),_0x150d50[_0x1e083c(0x1f3)],_0x150d50[_0x1e083c(0x212)]);}}async function runCreate(_0x426e5a,_0x54873e){const _0x5e1602=a132_0x40ae;if(!_0x426e5a['projectName']||_0x426e5a[_0x5e1602(0x1e4)]['trim']()==='')throw new Error(_0x5e1602(0x203));const _0x4485cf=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x4485cf[_0x5e1602(0x1dc)](_0x426e5a['projectName']))throw new Error(_0x5e1602(0x1e7));if(_0x426e5a[_0x5e1602(0x1e4)][_0x5e1602(0x1f5)]>0x64)throw new Error('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters');const _0x289b56=a132_0xc81316['resolve'](process[_0x5e1602(0x211)](),_0x426e5a[_0x5e1602(0x1e4)]);if(a132_0x6da26d[_0x5e1602(0x1fe)](_0x289b56))throw new Error('Project\x20directory\x20'+_0x426e5a['projectName']+_0x5e1602(0x1d5));try{a132_0x6da26d['accessSync'](a132_0xc81316[_0x5e1602(0x1c9)](_0x289b56),a132_0x6da26d[_0x5e1602(0x1e9)][_0x5e1602(0x1c3)]);}catch{throw new Error(_0x5e1602(0x1d7));}logger[_0x5e1602(0x1ed)](_0x289b56),logger['info']('create',_0x5e1602(0x20e)+_0x426e5a[_0x5e1602(0x1e4)],{'projectDir':_0x289b56,'appCode':_0x426e5a[_0x5e1602(0x1be)]}),console[_0x5e1602(0x1c5)](),console['log'](a132_0x1de3c4[_0x5e1602(0x204)]('\x20√\x20')+_0x5e1602(0x1bf)+a132_0x1de3c4[_0x5e1602(0x204)](_0x426e5a[_0x5e1602(0x1e4)])+(_0x426e5a[_0x5e1602(0x1be)]?'\x20|\x20AppCode:\x20'+a132_0x1de3c4['cyan'](_0x426e5a[_0x5e1602(0x1be)]):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x426e5a['projectName'])),await updatePackageJsonName(_0x426e5a[_0x5e1602(0x1e4)]),await runTask(_0x5e1602(0x1ef),()=>installDependencies(_0x426e5a[_0x5e1602(0x1e4)])),await runTask(_0x5e1602(0x1d8),()=>formatProjectCode(_0x426e5a['projectName'])),await configureAppCode(_0x426e5a[_0x5e1602(0x1e4)],_0x426e5a[_0x5e1602(0x1be)]||'',_0x426e5a['env']);let _0x53889c=![];if(_0x426e5a['appCode']){console['log'](_0x5e1602(0x1c2));const _0x255046=process[_0x5e1602(0x211)]();try{process[_0x5e1602(0x1f9)](_0x289b56);const _0x44de75=_0x426e5a[_0x5e1602(0x1f3)]||_0x5e1602(0x1d1);initEnv(_0x44de75);const {configArray:_0x49bfe3}=await fetchModelList(_0x426e5a[_0x5e1602(0x1be)],_0x54873e['cookie']||''),_0x1b99ef=DEFAULT_API_DIR,_0x3d2dce=await generateApiFile(_0x49bfe3,'',_0x426e5a[_0x5e1602(0x1be)],!![],_0x44de75,_0x1b99ef);console[_0x5e1602(0x1c5)](_0x5e1602(0x1db)+_0x49bfe3[_0x5e1602(0x1f5)]+'\x20dataset(s),\x20generated\x20'+_0x3d2dce[_0x5e1602(0x1d3)]+'\x20model(s)'),logger[_0x5e1602(0x1e5)](_0x5e1602(0x1f2),'API\x20configuration\x20pulled:\x20'+_0x426e5a[_0x5e1602(0x1be)]);}catch(_0x38e67f){_0x53889c=!![],console['log']('!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull'),logger['warn'](_0x5e1602(0x1f2),'API\x20配置拉取异常',{'error':_0x38e67f instanceof Error?_0x38e67f[_0x5e1602(0x1f6)]:String(_0x38e67f)});}finally{process[_0x5e1602(0x1f9)](_0x255046);}}logger['success'](_0x5e1602(0x1f2),'项目创建完成:\x20'+_0x426e5a[_0x5e1602(0x1e4)]),console[_0x5e1602(0x1c5)](),console[_0x5e1602(0x1c5)](a132_0x1de3c4[_0x5e1602(0x204)]('─'['repeat'](0x3c))),console[_0x5e1602(0x1c5)](a132_0x1de3c4['cyan'][_0x5e1602(0x1fc)](_0x5e1602(0x209))),console[_0x5e1602(0x1c5)](),console[_0x5e1602(0x1c5)](_0x5e1602(0x1eb)+a132_0x1de3c4[_0x5e1602(0x1bc)][_0x5e1602(0x1fc)](_0x5e1602(0x20f)+_0x426e5a['projectName']+_0x5e1602(0x1e0)+CLI_BIN_NAME+_0x5e1602(0x1c1))),_0x53889c&&console['log'](_0x5e1602(0x208)+a132_0x1de3c4[_0x5e1602(0x1bc)][_0x5e1602(0x1fc)](CLI_BIN_NAME+'\x20api\x20pull')),console[_0x5e1602(0x1c5)](a132_0x1de3c4[_0x5e1602(0x204)]('─'[_0x5e1602(0x1f8)](0x3c)));}catch(_0x14e3dc){logger[_0x5e1602(0x1ce)](_0x5e1602(0x1f2),_0x5e1602(0x1e3)+_0x426e5a[_0x5e1602(0x1e4)],{'error':_0x14e3dc instanceof Error?_0x14e3dc[_0x5e1602(0x1f6)]:String(_0x14e3dc)});try{a132_0x6da26d['existsSync'](_0x289b56)&&(console[_0x5e1602(0x1c5)](_0x5e1602(0x1ca)+_0x289b56),a132_0x6da26d[_0x5e1602(0x20c)](_0x289b56,{'recursive':!![],'force':!![]}));}catch{logger[_0x5e1602(0x1cd)](_0x5e1602(0x1f2),_0x5e1602(0x1dd)+_0x289b56);}throw _0x14e3dc;}}async function runTask(_0x415d30,_0x45f638){const _0x321694=a132_0x40ae,_0x2df4f0=a132_0x6937ca(_0x415d30+'...')[_0x321694(0x1ee)]();try{const _0x4aa72b=await _0x45f638();_0x2df4f0[_0x321694(0x1d4)](),console[_0x321694(0x1c5)](''+a132_0x1de3c4['green'](_0x321694(0x1f0))+_0x415d30+'\x20'+a132_0x1de3c4[_0x321694(0x1ec)]('['+_0x4aa72b+']'));}catch(_0x3323b3){_0x2df4f0[_0x321694(0x1cb)](_0x415d30);throw _0x3323b3;}}async function updatePackageJsonName(_0x362369){const _0x1da5a9=a132_0x40ae,_0x2bcf6e=a132_0xc81316[_0x1da5a9(0x1df)](process[_0x1da5a9(0x211)](),_0x362369),_0x194580=a132_0xc81316['join'](_0x2bcf6e,_0x1da5a9(0x205));try{console['log']('*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields');const _0x2dfc96=getRabetbaseCliPackageRoot(),_0x2dfcea=a132_0xc81316[_0x1da5a9(0x20b)](_0x2dfc96,_0x1da5a9(0x205));let _0x3df566=_0x1da5a9(0x1f7);try{const _0x525234=JSON[_0x1da5a9(0x1e2)](a132_0x6da26d[_0x1da5a9(0x1d9)](_0x2dfcea,_0x1da5a9(0x1cf)));_0x3df566=_0x525234[_0x1da5a9(0x201)]||_0x1da5a9(0x1f7);}catch{}const _0x33d57b=a132_0x6da26d[_0x1da5a9(0x1d9)](_0x194580,_0x1da5a9(0x1cf)),_0x16272f=JSON[_0x1da5a9(0x1e2)](_0x33d57b);_0x16272f[_0x1da5a9(0x1bd)]=_0x362369,_0x16272f['description']=_0x362369+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x3df566,a132_0x6da26d['writeFileSync'](_0x194580,JSON[_0x1da5a9(0x1c6)](_0x16272f,null,0x2)+'\x0a',_0x1da5a9(0x1cf)),console[_0x1da5a9(0x1c5)](_0x1da5a9(0x1c7)+_0x362369),logger['info']('create',_0x1da5a9(0x1f1));}catch(_0x2d8a0e){logger['error'](_0x1da5a9(0x1f2),_0x1da5a9(0x200));throw _0x2d8a0e;}}async function configureAppCode(_0x1382ca,_0x8ab7b0,_0x136dfe){const _0x32082c=a132_0x40ae,_0x3f9be3=a132_0xc81316[_0x32082c(0x1df)](process[_0x32082c(0x211)](),_0x1382ca),_0x119513=a132_0xc81316[_0x32082c(0x20b)](_0x3f9be3,NEW_CONFIG_NAME);try{_0x8ab7b0?console[_0x32082c(0x1c5)]('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x1382ca+':\x20'+_0x8ab7b0):console['log'](_0x32082c(0x207)+_0x1382ca);const _0x46c62e=getRabetbaseCliPackageRoot(),_0x1573f8=a132_0xc81316[_0x32082c(0x20b)](_0x46c62e,_0x32082c(0x205));let _0x260ad8=_0x32082c(0x1f7);try{const _0x35df99=JSON['parse'](a132_0x6da26d[_0x32082c(0x1d9)](_0x1573f8,_0x32082c(0x1cf)));_0x260ad8=_0x35df99['version']||'1.0.0';}catch{}const _0x2de526=readConfig(),_0x5bb507=typeof _0x2de526[_0x32082c(0x1f3)]===_0x32082c(0x1fb)?_0x2de526[_0x32082c(0x1f3)]:undefined,_0x55208f={};for(const _0x5e1f41 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x2de526[_0x5e1f41]!=null)_0x55208f[_0x5e1f41]=_0x2de526[_0x5e1f41];}const _0x33159d=buildCanonicalProjectConfig(_0x55208f,{'appCodes':_0x8ab7b0?[_0x8ab7b0]:[],'env':_0x136dfe||_0x5bb507||'production','metadata':{'createdAt':new Date()[_0x32082c(0x1ea)](),'version':_0x260ad8}});writeConfigFile(_0x119513,_0x33159d),_0x8ab7b0?console['log'](_0x32082c(0x1e1)+Object[_0x32082c(0x1d0)](_0x33159d['apps']||{})[_0x32082c(0x20b)](',\x20')+'\x20|\x20Default:\x20'+_0x33159d['defaultApp']):console['log'](_0x32082c(0x1ba)+CLI_BIN_NAME+_0x32082c(0x210)),logger['info'](_0x32082c(0x1f2),_0x32082c(0x1f4)+_0x8ab7b0);}catch(_0x36073a){logger['error'](_0x32082c(0x1f2),'配置应用AppCode失败');}}
1
+ (function(_0x28d0c2,_0x2e1284){const _0x3b8849=a132_0x17e8,_0x2c9222=_0x28d0c2();while(!![]){try{const _0x3655ef=-parseInt(_0x3b8849(0x230))/0x1*(parseInt(_0x3b8849(0x1f4))/0x2)+parseInt(_0x3b8849(0x1ee))/0x3*(-parseInt(_0x3b8849(0x22d))/0x4)+parseInt(_0x3b8849(0x235))/0x5*(parseInt(_0x3b8849(0x204))/0x6)+parseInt(_0x3b8849(0x224))/0x7*(parseInt(_0x3b8849(0x246))/0x8)+-parseInt(_0x3b8849(0x22b))/0x9*(-parseInt(_0x3b8849(0x1ed))/0xa)+parseInt(_0x3b8849(0x1fe))/0xb+-parseInt(_0x3b8849(0x221))/0xc*(parseInt(_0x3b8849(0x219))/0xd);if(_0x3655ef===_0x2e1284)break;else _0x2c9222['push'](_0x2c9222['shift']());}catch(_0x5b5d75){_0x2c9222['push'](_0x2c9222['shift']());}}}(a132_0xdee6,0xb26fa));import a132_0x2a4603 from'path';import a132_0x44202b from'fs';function a132_0xdee6(){const _0x46d526=['cd\x20','*\x20Configuring\x20AppCode\x20for\x20project\x20','appCode','\x20config\x20set\x20appcode\x20<app-code>\x27','配置应用AppCode:\x20','green','\x20already\x20exists','182RGpUQH','needsUpgrade','CLI\x20版本检查','string','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','version','stableVersion','API\x20配置拉取异常','1961412onnxzT','Project\x20directory\x20','projectName','917FVqafT','existsSync','trim','fail','env','Project\x20name\x20cannot\x20be\x20empty','chdir','63VBFMmf','join','5392lYNrnE','error','开始创建项目:\x20','74823fQurpz','\x20run\x20start','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','description','info','1690vUWUrB','配置应用AppCode失败','项目创建完成:\x20','message','更新\x20package.json\x20失败','√\x20Configuration\x20file\x20created,\x20Apps:\x20','项目创建失败:\x20','repeat','更新\x20package.json\x20name','package.json','\x20api\x20pull','resolve','production','apps','stringify','清理项目目录失败:\x20','keys','83488dbaDvO','1.0.0','bold','cyan','1515170oJiDyh','1464vSSUXB','W_OK','readFileSync','minimumVersion','modelCount','test','8ookefF','name','cookie','cwd','warn','belowMinimum','√\x20Pulled\x20','🚀\x20Next\x20Steps:','Install\x20dependencies','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','9085175koSkzy','√\x20package.json\x20updated:\x20name=','projectCode','constants','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','log','12828WttHMT','parse','\x20\x202.\x20Pull\x20API\x20configuration:\x20','*\x20Pulling\x20API\x20configuration...','\x20|\x20Default:\x20','create','defaultApp','length','\x20|\x20AppCode:\x20','stop','dirname','\x20\x201.\x20Start\x20project:\x20','\x20√\x20','utf8'];a132_0xdee6=function(){return _0x46d526;};return a132_0xdee6();}import a132_0x42a02e from'chalk';import a132_0x1a8790 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';function a132_0x17e8(_0x5542ed,_0x2bb7fe){_0x5542ed=_0x5542ed-0x1eb;const _0xdee643=a132_0xdee6();let _0x17e8ce=_0xdee643[_0x5542ed];return _0x17e8ce;}import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x51a381){const _0x5c780f=a132_0x17e8,_0x20162e=await checkCliVersion();(_0x20162e[_0x5c780f(0x21a)]||_0x20162e[_0x5c780f(0x1f9)])&&(printCliUpgradeWarning(_0x20162e),assertCliVersionSupported(_0x20162e),logger[_0x5c780f(0x234)](_0x5c780f(0x209),_0x5c780f(0x21b),{'currentVersion':_0x20162e['currentVersion'],'stableVersion':_0x20162e[_0x5c780f(0x21f)],'minimumVersion':_0x20162e[_0x5c780f(0x1f1)],'needsUpgrade':_0x20162e[_0x5c780f(0x21a)],'belowMinimum':_0x20162e['belowMinimum']}));if(_0x51a381[_0x5c780f(0x200)]&&_0x51a381[_0x5c780f(0x214)])await runCreate({'projectName':_0x51a381['projectCode'],'appCode':_0x51a381[_0x5c780f(0x214)],'env':_0x51a381[_0x5c780f(0x228)]},_0x51a381);else{if(_0x51a381[_0x5c780f(0x200)]){const _0x1476b3=await selectSingleAppcode(_0x51a381['cookie']);await runCreate({'projectName':_0x51a381['projectCode'],'appCode':_0x1476b3||undefined,'env':_0x51a381[_0x5c780f(0x228)]},_0x51a381);}else await guidedCreateProject(_0x39ba04=>runCreate(_0x39ba04,_0x51a381),_0x51a381[_0x5c780f(0x228)],_0x51a381[_0x5c780f(0x1f6)]);}}async function runCreate(_0x31cf9c,_0x22bad5){const _0xd3c84e=a132_0x17e8;if(!_0x31cf9c[_0xd3c84e(0x223)]||_0x31cf9c[_0xd3c84e(0x223)][_0xd3c84e(0x226)]()==='')throw new Error(_0xd3c84e(0x229));const _0x131ab1=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x131ab1[_0xd3c84e(0x1f3)](_0x31cf9c['projectName']))throw new Error('Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters');if(_0x31cf9c['projectName'][_0xd3c84e(0x20b)]>0x64)throw new Error(_0xd3c84e(0x1fd));const _0x57cfc7=a132_0x2a4603['resolve'](process['cwd'](),_0x31cf9c[_0xd3c84e(0x223)]);if(a132_0x44202b[_0xd3c84e(0x225)](_0x57cfc7))throw new Error(_0xd3c84e(0x222)+_0x31cf9c[_0xd3c84e(0x223)]+_0xd3c84e(0x218));try{a132_0x44202b['accessSync'](a132_0x2a4603[_0xd3c84e(0x20e)](_0x57cfc7),a132_0x44202b[_0xd3c84e(0x201)][_0xd3c84e(0x1ef)]);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger['setLogPath'](_0x57cfc7),logger[_0xd3c84e(0x234)](_0xd3c84e(0x209),_0xd3c84e(0x22f)+_0x31cf9c[_0xd3c84e(0x223)],{'projectDir':_0x57cfc7,'appCode':_0x31cf9c[_0xd3c84e(0x214)]}),console['log'](),console[_0xd3c84e(0x203)](a132_0x42a02e['green'](_0xd3c84e(0x210))+'Project\x20name:\x20'+a132_0x42a02e[_0xd3c84e(0x217)](_0x31cf9c['projectName'])+(_0x31cf9c['appCode']?_0xd3c84e(0x20c)+a132_0x42a02e[_0xd3c84e(0x1ec)](_0x31cf9c['appCode']):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x31cf9c[_0xd3c84e(0x223)])),await updatePackageJsonName(_0x31cf9c['projectName']),await runTask(_0xd3c84e(0x1fc),()=>installDependencies(_0x31cf9c[_0xd3c84e(0x223)])),await runTask('Format\x20code',()=>formatProjectCode(_0x31cf9c[_0xd3c84e(0x223)])),await configureAppCode(_0x31cf9c[_0xd3c84e(0x223)],_0x31cf9c[_0xd3c84e(0x214)]||'',_0x31cf9c[_0xd3c84e(0x228)]);let _0xa9adaa=![];if(_0x31cf9c[_0xd3c84e(0x214)]){console[_0xd3c84e(0x203)](_0xd3c84e(0x207));const _0x3a9fad=process[_0xd3c84e(0x1f7)]();try{process[_0xd3c84e(0x22a)](_0x57cfc7);const _0x482a82=_0x31cf9c[_0xd3c84e(0x228)]||_0xd3c84e(0x241);initEnv(_0x482a82);const {configArray:_0x2ff0b9}=await fetchModelList(_0x31cf9c[_0xd3c84e(0x214)],_0x22bad5[_0xd3c84e(0x1f6)]||''),_0x588723=DEFAULT_API_DIR,_0x240158=await generateApiFile(_0x2ff0b9,'',_0x31cf9c[_0xd3c84e(0x214)],!![],_0x482a82,_0x588723);console['log'](_0xd3c84e(0x1fa)+_0x2ff0b9['length']+'\x20dataset(s),\x20generated\x20'+_0x240158[_0xd3c84e(0x1f2)]+'\x20model(s)'),logger['info'](_0xd3c84e(0x209),'API\x20configuration\x20pulled:\x20'+_0x31cf9c['appCode']);}catch(_0x1dc68d){_0xa9adaa=!![],console[_0xd3c84e(0x203)](_0xd3c84e(0x232)),logger[_0xd3c84e(0x1f8)]('create',_0xd3c84e(0x220),{'error':_0x1dc68d instanceof Error?_0x1dc68d[_0xd3c84e(0x238)]:String(_0x1dc68d)});}finally{process[_0xd3c84e(0x22a)](_0x3a9fad);}}logger['success'](_0xd3c84e(0x209),_0xd3c84e(0x237)+_0x31cf9c[_0xd3c84e(0x223)]),console[_0xd3c84e(0x203)](),console['log'](a132_0x42a02e['green']('─'['repeat'](0x3c))),console[_0xd3c84e(0x203)](a132_0x42a02e[_0xd3c84e(0x1ec)][_0xd3c84e(0x1eb)](_0xd3c84e(0x1fb))),console[_0xd3c84e(0x203)](),console['log'](_0xd3c84e(0x20f)+a132_0x42a02e['cyan'][_0xd3c84e(0x1eb)](_0xd3c84e(0x212)+_0x31cf9c[_0xd3c84e(0x223)]+'\x20&&\x20'+CLI_BIN_NAME+_0xd3c84e(0x231))),_0xa9adaa&&console[_0xd3c84e(0x203)](_0xd3c84e(0x206)+a132_0x42a02e[_0xd3c84e(0x1ec)][_0xd3c84e(0x1eb)](CLI_BIN_NAME+_0xd3c84e(0x23f))),console['log'](a132_0x42a02e[_0xd3c84e(0x217)]('─'[_0xd3c84e(0x23c)](0x3c)));}catch(_0x2519ae){logger[_0xd3c84e(0x22e)]('create',_0xd3c84e(0x23b)+_0x31cf9c[_0xd3c84e(0x223)],{'error':_0x2519ae instanceof Error?_0x2519ae[_0xd3c84e(0x238)]:String(_0x2519ae)});try{a132_0x44202b[_0xd3c84e(0x225)](_0x57cfc7)&&(console[_0xd3c84e(0x203)]('*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20'+_0x57cfc7),a132_0x44202b['rmSync'](_0x57cfc7,{'recursive':!![],'force':!![]}));}catch{logger[_0xd3c84e(0x1f8)](_0xd3c84e(0x209),_0xd3c84e(0x244)+_0x57cfc7);}throw _0x2519ae;}}async function runTask(_0x3b527a,_0x5bd27b){const _0x109ce3=a132_0x17e8,_0x44956c=a132_0x1a8790(_0x3b527a+'...')['start']();try{const _0x2e14e5=await _0x5bd27b();_0x44956c[_0x109ce3(0x20d)](),console[_0x109ce3(0x203)](''+a132_0x42a02e[_0x109ce3(0x217)]('\x20√\x20')+_0x3b527a+'\x20'+a132_0x42a02e['gray']('['+_0x2e14e5+']'));}catch(_0x8b5ee8){_0x44956c[_0x109ce3(0x227)](_0x3b527a);throw _0x8b5ee8;}}async function updatePackageJsonName(_0x5ecf86){const _0x51a9fe=a132_0x17e8,_0x4bed27=a132_0x2a4603[_0x51a9fe(0x240)](process[_0x51a9fe(0x1f7)](),_0x5ecf86),_0x4c566e=a132_0x2a4603['join'](_0x4bed27,_0x51a9fe(0x23e));try{console[_0x51a9fe(0x203)](_0x51a9fe(0x202));const _0x73f5c7=getRabetbaseCliPackageRoot(),_0x32be24=a132_0x2a4603[_0x51a9fe(0x22c)](_0x73f5c7,'package.json');let _0x510009=_0x51a9fe(0x247);try{const _0x2e8429=JSON[_0x51a9fe(0x205)](a132_0x44202b[_0x51a9fe(0x1f0)](_0x32be24,_0x51a9fe(0x211)));_0x510009=_0x2e8429[_0x51a9fe(0x21e)]||_0x51a9fe(0x247);}catch{}const _0x45623a=a132_0x44202b['readFileSync'](_0x4c566e,_0x51a9fe(0x211)),_0x95488a=JSON[_0x51a9fe(0x205)](_0x45623a);_0x95488a[_0x51a9fe(0x1f5)]=_0x5ecf86,_0x95488a[_0x51a9fe(0x233)]=_0x5ecf86+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x510009,a132_0x44202b['writeFileSync'](_0x4c566e,JSON[_0x51a9fe(0x243)](_0x95488a,null,0x2)+'\x0a','utf8'),console['log'](_0x51a9fe(0x1ff)+_0x5ecf86),logger[_0x51a9fe(0x234)](_0x51a9fe(0x209),_0x51a9fe(0x23d));}catch(_0x41c004){logger[_0x51a9fe(0x22e)](_0x51a9fe(0x209),_0x51a9fe(0x239));throw _0x41c004;}}async function configureAppCode(_0x4e79b5,_0xe22034,_0x268fcf){const _0x1a1115=a132_0x17e8,_0x14ed38=a132_0x2a4603[_0x1a1115(0x240)](process[_0x1a1115(0x1f7)](),_0x4e79b5),_0x3affba=a132_0x2a4603[_0x1a1115(0x22c)](_0x14ed38,NEW_CONFIG_NAME);try{_0xe22034?console[_0x1a1115(0x203)](_0x1a1115(0x213)+_0x4e79b5+':\x20'+_0xe22034):console[_0x1a1115(0x203)](_0x1a1115(0x21d)+_0x4e79b5);const _0x5aadcc=getRabetbaseCliPackageRoot(),_0x326dea=a132_0x2a4603[_0x1a1115(0x22c)](_0x5aadcc,_0x1a1115(0x23e));let _0x5e4f49=_0x1a1115(0x247);try{const _0x2508ea=JSON['parse'](a132_0x44202b[_0x1a1115(0x1f0)](_0x326dea,_0x1a1115(0x211)));_0x5e4f49=_0x2508ea[_0x1a1115(0x21e)]||_0x1a1115(0x247);}catch{}const _0x45bbc0=readConfig(),_0x41da24=typeof _0x45bbc0[_0x1a1115(0x228)]===_0x1a1115(0x21c)?_0x45bbc0['env']:undefined,_0x5e116c={};for(const _0x212594 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x45bbc0[_0x212594]!=null)_0x5e116c[_0x212594]=_0x45bbc0[_0x212594];}const _0xc9fde8=buildCanonicalProjectConfig(_0x5e116c,{'appCodes':_0xe22034?[_0xe22034]:[],'env':_0x268fcf||_0x41da24||'production','metadata':{'createdAt':new Date()['toLocaleString'](),'version':_0x5e4f49}});writeConfigFile(_0x3affba,_0xc9fde8),_0xe22034?console[_0x1a1115(0x203)](_0x1a1115(0x23a)+Object[_0x1a1115(0x245)](_0xc9fde8[_0x1a1115(0x242)]||{})[_0x1a1115(0x22c)](',\x20')+_0x1a1115(0x208)+_0xc9fde8[_0x1a1115(0x20a)]):console['log']('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+_0x1a1115(0x215)),logger['info'](_0x1a1115(0x209),_0x1a1115(0x216)+_0xe22034);}catch(_0x229747){logger[_0x1a1115(0x22e)](_0x1a1115(0x209),_0x1a1115(0x236));}}
@@ -1 +1 @@
1
- (function(_0x47206d,_0x6f8a66){const _0x30ddb0=a133_0x2f11,_0x43e6ef=_0x47206d();while(!![]){try{const _0x5b55be=-parseInt(_0x30ddb0(0xa5))/0x1+parseInt(_0x30ddb0(0x9f))/0x2*(parseInt(_0x30ddb0(0x95))/0x3)+-parseInt(_0x30ddb0(0xa6))/0x4*(parseInt(_0x30ddb0(0xa0))/0x5)+-parseInt(_0x30ddb0(0x93))/0x6+parseInt(_0x30ddb0(0x97))/0x7*(parseInt(_0x30ddb0(0x88))/0x8)+-parseInt(_0x30ddb0(0xb3))/0x9*(parseInt(_0x30ddb0(0xb4))/0xa)+parseInt(_0x30ddb0(0xa1))/0xb;if(_0x5b55be===_0x6f8a66)break;else _0x43e6ef['push'](_0x43e6ef['shift']());}catch(_0x4ecdcb){_0x43e6ef['push'](_0x43e6ef['shift']());}}}(a133_0x194d,0xa1b9c));import a133_0x4d2333 from'path';import a133_0x4bac61 from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';function a133_0x194d(){const _0x244eac=['production','belowMinimum','modelCount','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','bun\x20--version','9XFujMA','11155700eXPFYu','Project\x20directory\x20\x22','join','validation','stringify','name','parse','\x20\x20√\x20Project\x20template\x20created','\x22\x20already\x20exists.','\x0a√\x20Project\x20','description','Check\x20directory\x20permissions.','*\x20Creating\x20project\x20','trim','env','\x20dataset(s),\x20generated\x20','Project\x20name\x20contains\x20invalid\x20characters.','resolve','Project\x20name\x20cannot\x20be\x20empty.','6453560TZmnCN','\x20\x20√\x20Configuration\x20file\x20created','\x20\x20√\x20Pulled\x20','cwd','utf-8','W_OK','Use\x20a\x20different\x20project\x20name.','ignore','\x20\x20Pulling\x20API\x20configuration...','\x20created\x20successfully!','constants','6882228vzdyLY','...','31137yQLvjK','package.json','7ZLDzRr','\x20\x20√\x20package.json\x20updated','bun\x20run\x20format','needsUpgrade','\x0a\x20\x20cd\x20','\x20api\x20pull`\x20manually\x20later.','\x20model(s)','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','174ziDROv','18390SHPadU','26985585cZcJom','chdir','\x20\x20Installing\x20dependencies...','writeFile','38839rZvqqC','1304fZYGVp','log','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','\x20\x20rabetbase\x20run\x20start\x0a','bun','toLocaleString','string','readFile'];a133_0x194d=function(){return _0x244eac;};return a133_0x194d();}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(_0x36e98e,_0x16ea50,_0x4180b6,_0x502987){const _0x5b8f83=a133_0x2f11,_0x348e02=await checkCliVersion();(_0x348e02[_0x5b8f83(0x9a)]||_0x348e02[_0x5b8f83(0xaf)])&&(printCliUpgradeWarning(_0x348e02),assertCliVersionSupported(_0x348e02));if(!_0x36e98e||_0x36e98e[_0x5b8f83(0xc1)]()==='')throw CliErrors[_0x5b8f83(0xb7)](_0x5b8f83(0x87));const _0x4e69e0=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x4e69e0['test'](_0x36e98e))throw CliErrors[_0x5b8f83(0xb7)](_0x5b8f83(0x85),_0x5b8f83(0x9e));if(_0x36e98e['length']>0x64)throw CliErrors['validation']('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.');const _0x38f084=a133_0x4d2333[_0x5b8f83(0x86)](process['cwd'](),_0x36e98e);if(existsSync(_0x38f084))throw CliErrors['validation'](_0x5b8f83(0xb5)+_0x36e98e+_0x5b8f83(0xbc),_0x5b8f83(0x8e));try{const _0xe07866=a133_0x4d2333['dirname'](_0x38f084);await a133_0x4bac61['access'](_0xe07866,a133_0x4bac61[_0x5b8f83(0x92)][_0x5b8f83(0x8d)]);}catch{throw CliErrors[_0x5b8f83(0xb7)]('Cannot\x20create\x20project\x20in\x20current\x20directory.',_0x5b8f83(0xbf));}try{console[_0x5b8f83(0xa7)](_0x5b8f83(0xc0)+_0x36e98e+_0x5b8f83(0x94));const _0x31d7b1=getSubAppReactDemoTemplateDir();await copyDirectory(_0x31d7b1,_0x38f084),console[_0x5b8f83(0xa7)](_0x5b8f83(0xbb)),await updatePackageJsonName(_0x36e98e),console['log'](_0x5b8f83(0x98)),console[_0x5b8f83(0xa7)](_0x5b8f83(0xa3)),console[_0x5b8f83(0xa7)]('\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)'),await formatCode(_0x38f084),console[_0x5b8f83(0xa7)]('\x20\x20√\x20Code\x20formatted'),await configureProject(_0x36e98e,_0x4180b6,_0x16ea50),console['log'](_0x5b8f83(0x89)),_0x4180b6&&await pullApiConfig(_0x38f084,_0x4180b6,_0x16ea50,_0x502987),console['log'](_0x5b8f83(0xbd)+_0x36e98e+_0x5b8f83(0x91)),console[_0x5b8f83(0xa7)](_0x5b8f83(0x9b)+_0x36e98e),console['log'](_0x5b8f83(0xa9));}catch(_0x11bd65){try{existsSync(_0x38f084)&&await a133_0x4bac61['rm'](_0x38f084,{'recursive':!![],'force':!![]});}catch{}throw _0x11bd65;}}function a133_0x2f11(_0x1a8436,_0x2b6bb5){_0x1a8436=_0x1a8436-0x83;const _0x194dd3=a133_0x194d();let _0x2f117d=_0x194dd3[_0x1a8436];return _0x2f117d;}async function updatePackageJsonName(_0x1768f0){const _0x47cb81=a133_0x2f11,_0xc10ccd=a133_0x4d2333[_0x47cb81(0x86)](process[_0x47cb81(0x8b)](),_0x1768f0),_0x40f306=a133_0x4d2333[_0x47cb81(0xb6)](_0xc10ccd,_0x47cb81(0x96)),_0x671173=await a133_0x4bac61[_0x47cb81(0xad)](_0x40f306,_0x47cb81(0x8c)),_0x3ace2a=JSON[_0x47cb81(0xba)](_0x671173);_0x3ace2a[_0x47cb81(0xb9)]=_0x1768f0,_0x3ace2a[_0x47cb81(0xbe)]=_0x47cb81(0xa8),await a133_0x4bac61[_0x47cb81(0xa4)](_0x40f306,JSON[_0x47cb81(0xb8)](_0x3ace2a,null,0x2)+'\x0a');}function detectPackageManager(){const _0x317104=a133_0x2f11;try{return execSync(_0x317104(0xb2),{'stdio':_0x317104(0x8f)}),_0x317104(0xaa);}catch{return'npm';}}async function formatCode(_0x13606a){const _0x26dd3d=a133_0x2f11;try{await execAsync(_0x26dd3d(0x99),{'cwd':_0x13606a});}catch{}}async function configureProject(_0x36c91d,_0x52a9f9,_0x2943eb){const _0x3cf2a2=a133_0x2f11,_0x599b16=a133_0x4d2333[_0x3cf2a2(0x86)](process['cwd'](),_0x36c91d),_0x50f63e=a133_0x4d2333['join'](_0x599b16,NEW_CONFIG_NAME),_0x3adcef=readConfig(),_0x5b3cfd=typeof _0x3adcef[_0x3cf2a2(0x83)]===_0x3cf2a2(0xac)?_0x3adcef[_0x3cf2a2(0x83)]:undefined,_0x4ef8f4={};for(const _0x3c889d of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x3adcef[_0x3c889d]!=null)_0x4ef8f4[_0x3c889d]=_0x3adcef[_0x3c889d];}const _0x352553=buildCanonicalProjectConfig(_0x4ef8f4,{'appCodes':_0x52a9f9?[_0x52a9f9]:[],'env':_0x2943eb||_0x5b3cfd||'production','metadata':{'createdAt':new Date()[_0x3cf2a2(0xab)](),'version':getCliVersion()}});writeConfigFile(_0x50f63e,_0x352553);}async function pullApiConfig(_0x51b87b,_0x456ed1,_0x4e114d,_0x5ad4b1){const _0x5bf65b=a133_0x2f11,_0x57728a=process[_0x5bf65b(0x8b)]();try{process[_0x5bf65b(0xa2)](_0x51b87b);const _0x212ec2=_0x4e114d||_0x5bf65b(0xae);initEnv(_0x212ec2),console[_0x5bf65b(0xa7)](_0x5bf65b(0x90));const {configArray:_0x22644d}=await fetchModelList(_0x456ed1,_0x5ad4b1||''),_0x2f4b57=await generateApiFile(_0x22644d,'',_0x456ed1,!![],_0x212ec2,DEFAULT_API_DIR);console[_0x5bf65b(0xa7)](_0x5bf65b(0x8a)+_0x22644d['length']+_0x5bf65b(0x84)+_0x2f4b57[_0x5bf65b(0xb0)]+_0x5bf65b(0x9d));}catch(_0x27dc41){console[_0x5bf65b(0xa7)](_0x5bf65b(0xb1)+CLI_BIN_NAME+_0x5bf65b(0x9c));}finally{process[_0x5bf65b(0xa2)](_0x57728a);}}
1
+ (function(_0x26fd33,_0x30e166){const _0x376213=a133_0x3f4f,_0x506cf0=_0x26fd33();while(!![]){try{const _0x211640=-parseInt(_0x376213(0xdd))/0x1+-parseInt(_0x376213(0xc0))/0x2*(-parseInt(_0x376213(0xbe))/0x3)+-parseInt(_0x376213(0xc1))/0x4*(-parseInt(_0x376213(0xaf))/0x5)+-parseInt(_0x376213(0xc4))/0x6*(parseInt(_0x376213(0xd7))/0x7)+-parseInt(_0x376213(0xb6))/0x8+parseInt(_0x376213(0xca))/0x9*(-parseInt(_0x376213(0xd0))/0xa)+parseInt(_0x376213(0xc3))/0xb;if(_0x211640===_0x30e166)break;else _0x506cf0['push'](_0x506cf0['shift']());}catch(_0x5de31f){_0x506cf0['push'](_0x506cf0['shift']());}}}(a133_0x6ba8,0x4c97b));function a133_0x3f4f(_0x41ce23,_0x313e0c){_0x41ce23=_0x41ce23-0xa2;const _0x6ba8ff=a133_0x6ba8();let _0x3f4f37=_0x6ba8ff[_0x41ce23];return _0x3f4f37;}import a133_0x1bfb1b from'path';import a133_0x3810c2 from'fs/promises';import{existsSync}from'fs';function a133_0x6ba8(){const _0x223633=['package.json','7UBXrER','bun','chdir','\x20\x20√\x20Pulled\x20','\x20\x20Pulling\x20API\x20configuration...','Project\x20name\x20cannot\x20be\x20empty.','346186gjTEEq','\x20\x20rabetbase\x20run\x20start\x0a','\x20\x20√\x20Code\x20formatted','\x20\x20√\x20Configuration\x20file\x20created','\x20dataset(s),\x20generated\x20','resolve','parse','\x20\x20Installing\x20dependencies...','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','\x20\x20√\x20Project\x20template\x20created','join','validation','Project\x20name\x20contains\x20invalid\x20characters.','\x0a\x20\x20cd\x20','65LPomft','npm','env','trim','cwd','production','access','3499504fMsLRu','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','constants','\x20created\x20successfully!','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','needsUpgrade','modelCount','readFile','3GCvdSS','*\x20Creating\x20project\x20','1240948zxRtTZ','2548Fbotyi','length','12927915bdfVUP','3181182ktNmJI','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','description','log','belowMinimum','ignore','9IcaLjO','dirname','name','W_OK','Use\x20a\x20different\x20project\x20name.','\x22\x20already\x20exists.','1764760PZkUJx','Cannot\x20create\x20project\x20in\x20current\x20directory.','bun\x20run\x20format','toLocaleString','\x20api\x20pull`\x20manually\x20later.','...'];a133_0x6ba8=function(){return _0x223633;};return a133_0x6ba8();}import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x4c3746,_0x4faf09,_0x5f531e,_0x599bc5){const _0x4f0f77=a133_0x3f4f,_0x284e8e=await checkCliVersion();(_0x284e8e[_0x4f0f77(0xbb)]||_0x284e8e[_0x4f0f77(0xc8)])&&(printCliUpgradeWarning(_0x284e8e),assertCliVersionSupported(_0x284e8e));if(!_0x4c3746||_0x4c3746[_0x4f0f77(0xb2)]()==='')throw CliErrors['validation'](_0x4f0f77(0xdc));const _0xaab121=/[<>:"|?*\x00-\x1f\x7f]/;if(_0xaab121['test'](_0x4c3746))throw CliErrors['validation'](_0x4f0f77(0xad),_0x4f0f77(0xa9));if(_0x4c3746[_0x4f0f77(0xc2)]>0x64)throw CliErrors['validation'](_0x4f0f77(0xba));const _0x3fd37f=a133_0x1bfb1b['resolve'](process['cwd'](),_0x4c3746);if(existsSync(_0x3fd37f))throw CliErrors[_0x4f0f77(0xac)]('Project\x20directory\x20\x22'+_0x4c3746+_0x4f0f77(0xcf),_0x4f0f77(0xce));try{const _0x4465de=a133_0x1bfb1b[_0x4f0f77(0xcb)](_0x3fd37f);await a133_0x3810c2[_0x4f0f77(0xb5)](_0x4465de,a133_0x3810c2[_0x4f0f77(0xb8)][_0x4f0f77(0xcd)]);}catch{throw CliErrors[_0x4f0f77(0xac)](_0x4f0f77(0xd1),'Check\x20directory\x20permissions.');}try{console[_0x4f0f77(0xc7)](_0x4f0f77(0xbf)+_0x4c3746+_0x4f0f77(0xd5));const _0x3b2070=getSubAppReactDemoTemplateDir();await copyDirectory(_0x3b2070,_0x3fd37f),console[_0x4f0f77(0xc7)](_0x4f0f77(0xaa)),await updatePackageJsonName(_0x4c3746),console[_0x4f0f77(0xc7)]('\x20\x20√\x20package.json\x20updated'),console[_0x4f0f77(0xc7)](_0x4f0f77(0xa8)),console[_0x4f0f77(0xc7)](_0x4f0f77(0xb7)),await formatCode(_0x3fd37f),console['log'](_0x4f0f77(0xa3)),await configureProject(_0x4c3746,_0x5f531e,_0x4faf09),console[_0x4f0f77(0xc7)](_0x4f0f77(0xa4)),_0x5f531e&&await pullApiConfig(_0x3fd37f,_0x5f531e,_0x4faf09,_0x599bc5),console[_0x4f0f77(0xc7)]('\x0a√\x20Project\x20'+_0x4c3746+_0x4f0f77(0xb9)),console['log'](_0x4f0f77(0xae)+_0x4c3746),console[_0x4f0f77(0xc7)](_0x4f0f77(0xa2));}catch(_0x2ff150){try{existsSync(_0x3fd37f)&&await a133_0x3810c2['rm'](_0x3fd37f,{'recursive':!![],'force':!![]});}catch{}throw _0x2ff150;}}async function updatePackageJsonName(_0x16428d){const _0x3d7f8e=a133_0x3f4f,_0x37bf98=a133_0x1bfb1b['resolve'](process[_0x3d7f8e(0xb3)](),_0x16428d),_0x1c9634=a133_0x1bfb1b[_0x3d7f8e(0xab)](_0x37bf98,_0x3d7f8e(0xd6)),_0x3b91d0=await a133_0x3810c2[_0x3d7f8e(0xbd)](_0x1c9634,'utf-8'),_0x1ba108=JSON[_0x3d7f8e(0xa7)](_0x3b91d0);_0x1ba108[_0x3d7f8e(0xcc)]=_0x16428d,_0x1ba108[_0x3d7f8e(0xc6)]='A\x20project\x20created\x20with\x20Lovrabet\x20CLI',await a133_0x3810c2['writeFile'](_0x1c9634,JSON['stringify'](_0x1ba108,null,0x2)+'\x0a');}function detectPackageManager(){const _0x27af98=a133_0x3f4f;try{return execSync('bun\x20--version',{'stdio':_0x27af98(0xc9)}),_0x27af98(0xd8);}catch{return _0x27af98(0xb0);}}async function formatCode(_0x1cf6dd){const _0x2d2b36=a133_0x3f4f;try{await execAsync(_0x2d2b36(0xd2),{'cwd':_0x1cf6dd});}catch{}}async function configureProject(_0x2e054d,_0x9861a1,_0x26f9f3){const _0x52de99=a133_0x3f4f,_0x357680=a133_0x1bfb1b[_0x52de99(0xa6)](process[_0x52de99(0xb3)](),_0x2e054d),_0x402874=a133_0x1bfb1b[_0x52de99(0xab)](_0x357680,NEW_CONFIG_NAME),_0x1ecf94=readConfig(),_0x56340b=typeof _0x1ecf94[_0x52de99(0xb1)]==='string'?_0x1ecf94[_0x52de99(0xb1)]:undefined,_0x1e6550={};for(const _0x58e667 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x1ecf94[_0x58e667]!=null)_0x1e6550[_0x58e667]=_0x1ecf94[_0x58e667];}const _0x3e4f50=buildCanonicalProjectConfig(_0x1e6550,{'appCodes':_0x9861a1?[_0x9861a1]:[],'env':_0x26f9f3||_0x56340b||_0x52de99(0xb4),'metadata':{'createdAt':new Date()[_0x52de99(0xd3)](),'version':getCliVersion()}});writeConfigFile(_0x402874,_0x3e4f50);}async function pullApiConfig(_0x1ece04,_0x10ae3d,_0x295e44,_0x531b1b){const _0xc14839=a133_0x3f4f,_0x2c2a06=process[_0xc14839(0xb3)]();try{process[_0xc14839(0xd9)](_0x1ece04);const _0x41fef5=_0x295e44||'production';initEnv(_0x41fef5),console['log'](_0xc14839(0xdb));const {configArray:_0x495646}=await fetchModelList(_0x10ae3d,_0x531b1b||''),_0x185934=await generateApiFile(_0x495646,'',_0x10ae3d,!![],_0x41fef5,DEFAULT_API_DIR);console[_0xc14839(0xc7)](_0xc14839(0xda)+_0x495646['length']+_0xc14839(0xa5)+_0x185934[_0xc14839(0xbc)]+'\x20model(s)');}catch(_0x355144){console[_0xc14839(0xc7)](_0xc14839(0xc5)+CLI_BIN_NAME+_0xc14839(0xd4));}finally{process[_0xc14839(0xd9)](_0x2c2a06);}}
@@ -1 +1 @@
1
- function a134_0x25ad(_0x378dce,_0x13b572){_0x378dce=_0x378dce-0xea;const _0x3e12ff=a134_0x3e12();let _0x25ad34=_0x3e12ff[_0x378dce];return _0x25ad34;}(function(_0xb55550,_0x4b0ba1){const _0x3f5141=a134_0x25ad,_0x5aad66=_0xb55550();while(!![]){try{const _0x3e7b9e=parseInt(_0x3f5141(0xf7))/0x1+-parseInt(_0x3f5141(0xf3))/0x2+-parseInt(_0x3f5141(0xed))/0x3+-parseInt(_0x3f5141(0xf0))/0x4*(parseInt(_0x3f5141(0xf5))/0x5)+parseInt(_0x3f5141(0xf4))/0x6+parseInt(_0x3f5141(0xeb))/0x7+-parseInt(_0x3f5141(0xf6))/0x8*(-parseInt(_0x3f5141(0xea))/0x9);if(_0x3e7b9e===_0x4b0ba1)break;else _0x5aad66['push'](_0x5aad66['shift']());}catch(_0x3d6e8d){_0x5aad66['push'](_0x5aad66['shift']());}}}(a134_0x3e12,0x34d68));import a134_0x41054b from'node:path';import{fileURLToPath}from'node:url';function a134_0x3e12(){const _0x5aaaea=['171436rjABgz','resolve','../../../../','521694VMfFXa','2262210dnhyQf','15pbTJIl','2815024ODZfCV','38739tNpeNy','9OGURQq','154637tQInjS','templates','551685svXLYN','sub-app-react-demo','join'];a134_0x3e12=function(){return _0x5aaaea;};return a134_0x3e12();}const __dirname=a134_0x41054b['dirname'](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x1ccf9b=a134_0x25ad;return a134_0x41054b[_0x1ccf9b(0xf1)](__dirname,_0x1ccf9b(0xf2));}export function getSubAppReactDemoTemplateDir(){const _0x1bd36d=a134_0x25ad;return a134_0x41054b[_0x1bd36d(0xef)](getRabetbaseCliPackageRoot(),_0x1bd36d(0xec),'projects',_0x1bd36d(0xee));}
1
+ const a134_0xd1b1b8=a134_0x18f9;(function(_0x580ecf,_0x3314d8){const _0x334f74=a134_0x18f9,_0x269d62=_0x580ecf();while(!![]){try{const _0x2f25c0=-parseInt(_0x334f74(0xd4))/0x1+-parseInt(_0x334f74(0xdb))/0x2*(-parseInt(_0x334f74(0xdf))/0x3)+-parseInt(_0x334f74(0xd9))/0x4+-parseInt(_0x334f74(0xd3))/0x5+-parseInt(_0x334f74(0xd8))/0x6*(-parseInt(_0x334f74(0xdc))/0x7)+-parseInt(_0x334f74(0xda))/0x8*(-parseInt(_0x334f74(0xd1))/0x9)+parseInt(_0x334f74(0xd7))/0xa;if(_0x2f25c0===_0x3314d8)break;else _0x269d62['push'](_0x269d62['shift']());}catch(_0x34323b){_0x269d62['push'](_0x269d62['shift']());}}}(a134_0x347f,0x1f096));import a134_0x4ead92 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a134_0x4ead92[a134_0xd1b1b8(0xde)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x5c243f=a134_0xd1b1b8;return a134_0x4ead92[_0x5c243f(0xd6)](__dirname,_0x5c243f(0xd5));}function a134_0x18f9(_0x9f7b72,_0x3bf32f){_0x9f7b72=_0x9f7b72-0xd1;const _0x347ff8=a134_0x347f();let _0x18f9f9=_0x347ff8[_0x9f7b72];return _0x18f9f9;}export function getSubAppReactDemoTemplateDir(){const _0x33d0bb=a134_0xd1b1b8;return a134_0x4ead92[_0x33d0bb(0xdd)](getRabetbaseCliPackageRoot(),_0x33d0bb(0xd2),'projects','sub-app-react-demo');}function a134_0x347f(){const _0x401eb4=['1086930MhLaIO','1419846NXrwCe','53304hdtYyS','4576qNPxbW','204gtbYqZ','7RYjxxK','join','dirname','3081acsUxe','927zIZScZ','templates','1189735wlTCBI','130605YDXqse','../../../../','resolve'];a134_0x347f=function(){return _0x401eb4;};return a134_0x347f();}
@@ -1 +1 @@
1
- (function(_0x3d1a3f,_0x2c73e2){const _0x474229=a135_0x29b6,_0x11651b=_0x3d1a3f();while(!![]){try{const _0x431341=parseInt(_0x474229(0x1b4))/0x1+parseInt(_0x474229(0x1a6))/0x2*(-parseInt(_0x474229(0x1ad))/0x3)+-parseInt(_0x474229(0x1b5))/0x4+parseInt(_0x474229(0x1b0))/0x5*(parseInt(_0x474229(0x1af))/0x6)+-parseInt(_0x474229(0x1ab))/0x7+parseInt(_0x474229(0x1b3))/0x8*(parseInt(_0x474229(0x1b1))/0x9)+parseInt(_0x474229(0x1a8))/0xa;if(_0x431341===_0x2c73e2)break;else _0x11651b['push'](_0x11651b['shift']());}catch(_0x180621){_0x11651b['push'](_0x11651b['shift']());}}}(a135_0x4dc7,0x3ba80));import a135_0x369fd6 from'node:path';function a135_0x4dc7(){const _0x2c9076=['108ULstKL','info','272896QPgLUg','440768EsdKZZ','985584FtpbUS','项目模板复制完成','1004YGwNJW','copy','2459500wWmUWC','cwd','now','3042270ECPJWh','项目模板复制失败','2334EjoTql','message','558oVNmzl','11820PEydds'];a135_0x4dc7=function(){return _0x2c9076;};return a135_0x4dc7();}import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a135_0x29b6(_0x39b3f7,_0x31f11f){_0x39b3f7=_0x39b3f7-0x1a5;const _0x4dc731=a135_0x4dc7();let _0x29b64a=_0x4dc731[_0x39b3f7];return _0x29b64a;}import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x47745a){const _0x19e50c=a135_0x29b6,_0x18035d=Date[_0x19e50c(0x1aa)](),_0x5baa3f=a135_0x369fd6['resolve'](process[_0x19e50c(0x1a9)](),_0x47745a);try{logger[_0x19e50c(0x1b2)](_0x19e50c(0x1a7),'开始复制项目模板',{'projectCode':_0x47745a,'templateDir':templateDir}),await copyDirectory(templateDir,_0x5baa3f);const _0x4517f1=Date[_0x19e50c(0x1aa)]()-_0x18035d;logger['success']('copy',_0x19e50c(0x1a5),_0x4517f1,{'projectCode':_0x47745a});}catch(_0x187188){const _0x90c204=Date[_0x19e50c(0x1aa)]()-_0x18035d;logger['error'](_0x19e50c(0x1a7),_0x19e50c(0x1ac),{'projectCode':_0x47745a,'error':_0x187188 instanceof Error?_0x187188[_0x19e50c(0x1ae)]:String(_0x187188),'duration':_0x90c204});throw _0x187188;}return formatElapsed(_0x18035d);}
1
+ (function(_0x162d7f,_0x24ed55){const _0x1163eb=a135_0x305b,_0x1f56df=_0x162d7f();while(!![]){try{const _0x2f41d9=parseInt(_0x1163eb(0xb3))/0x1+parseInt(_0x1163eb(0xb4))/0x2+parseInt(_0x1163eb(0xb0))/0x3*(parseInt(_0x1163eb(0xad))/0x4)+parseInt(_0x1163eb(0xb2))/0x5+-parseInt(_0x1163eb(0xaf))/0x6*(-parseInt(_0x1163eb(0xa6))/0x7)+parseInt(_0x1163eb(0xac))/0x8+parseInt(_0x1163eb(0xaa))/0x9*(-parseInt(_0x1163eb(0xae))/0xa);if(_0x2f41d9===_0x24ed55)break;else _0x1f56df['push'](_0x1f56df['shift']());}catch(_0x1cfb4a){_0x1f56df['push'](_0x1f56df['shift']());}}}(a135_0x5861,0xd8354));function a135_0x305b(_0x4d95ec,_0x2b2b7e){_0x4d95ec=_0x4d95ec-0xa6;const _0x586139=a135_0x5861();let _0x305b39=_0x586139[_0x4d95ec];return _0x305b39;}import a135_0xf826a4 from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x5232fb){const _0x432488=a135_0x305b,_0x1f605b=Date[_0x432488(0xb1)](),_0x1b46f6=a135_0xf826a4['resolve'](process['cwd'](),_0x5232fb);try{logger[_0x432488(0xa7)]('copy',_0x432488(0xa9),{'projectCode':_0x5232fb,'templateDir':templateDir}),await copyDirectory(templateDir,_0x1b46f6);const _0x11da3b=Date[_0x432488(0xb1)]()-_0x1f605b;logger[_0x432488(0xab)](_0x432488(0xa8),'项目模板复制完成',_0x11da3b,{'projectCode':_0x5232fb});}catch(_0x42c35c){const _0x4639c0=Date[_0x432488(0xb1)]()-_0x1f605b;logger['error'](_0x432488(0xa8),'项目模板复制失败',{'projectCode':_0x5232fb,'error':_0x42c35c instanceof Error?_0x42c35c['message']:String(_0x42c35c),'duration':_0x4639c0});throw _0x42c35c;}return formatElapsed(_0x1f605b);}function a135_0x5861(){const _0x4d7100=['success','2058112EHRGqE','4rbmKts','10rFhHBA','3984ycXDsN','2005773AcYHKR','now','8834040jdMlMr','1236051aTlnQQ','436742vVbNAB','4438ELXvpb','info','copy','开始复制项目模板','33142257staPam'];a135_0x5861=function(){return _0x4d7100;};return a135_0x5861();}
@@ -1 +1 @@
1
- function a136_0x533d(_0x538208,_0x1e4e0c){_0x538208=_0x538208-0xc5;const _0x1ad051=a136_0x1ad0();let _0x533d04=_0x1ad051[_0x538208];return _0x533d04;}(function(_0x1fde84,_0x273a4e){const _0x2491fb=a136_0x533d,_0x4717ee=_0x1fde84();while(!![]){try{const _0x1f570f=parseInt(_0x2491fb(0xcb))/0x1+-parseInt(_0x2491fb(0xd8))/0x2*(parseInt(_0x2491fb(0xc8))/0x3)+parseInt(_0x2491fb(0xc6))/0x4*(parseInt(_0x2491fb(0xd9))/0x5)+parseInt(_0x2491fb(0xd4))/0x6+-parseInt(_0x2491fb(0xc7))/0x7+-parseInt(_0x2491fb(0xcc))/0x8*(-parseInt(_0x2491fb(0xd7))/0x9)+parseInt(_0x2491fb(0xd3))/0xa;if(_0x1f570f===_0x273a4e)break;else _0x4717ee['push'](_0x4717ee['shift']());}catch(_0x165f3b){_0x4717ee['push'](_0x4717ee['shift']());}}}(a136_0x1ad0,0x1e62c));import a136_0x34684e from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a136_0x1ad0(){const _0x4fadfa=['format','376HcByJg','1311709SliyQQ','288TUcehB','prettier','info','33381YWUIxL','1154792JrRisD','resolve','npx','message','开始格式化代码','代码格式化完成','--write','1271970KgPDpq','233304edekdE','error','now','9MlMmaJ','1320mnhCSr','1670RrRBCj','代码格式化失败'];a136_0x1ad0=function(){return _0x4fadfa;};return a136_0x1ad0();}import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x1e136c){const _0x5b1329=a136_0x533d,_0x40cc3a=Date['now'](),_0x215dba=a136_0x34684e[_0x5b1329(0xcd)](process['cwd'](),_0x1e136c);try{logger[_0x5b1329(0xca)](_0x5b1329(0xc5),_0x5b1329(0xd0),{'projectCode':_0x1e136c}),await execa(resolveNpmBin(_0x5b1329(0xce)),[_0x5b1329(0xc9),_0x5b1329(0xd2),'.'],{'cwd':_0x215dba});const _0x21f30e=Date[_0x5b1329(0xd6)]()-_0x40cc3a;logger['success'](_0x5b1329(0xc5),_0x5b1329(0xd1),_0x21f30e,{'projectCode':_0x1e136c});}catch(_0x116074){const _0x24cbe0=Date[_0x5b1329(0xd6)]()-_0x40cc3a;logger[_0x5b1329(0xd5)](_0x5b1329(0xc5),_0x5b1329(0xda),{'projectCode':_0x1e136c,'error':_0x116074 instanceof Error?_0x116074[_0x5b1329(0xcf)]:String(_0x116074),'duration':_0x24cbe0});throw _0x116074;}return formatElapsed(_0x40cc3a);}
1
+ function a136_0xbc8f(_0x5422c3,_0x32978e){_0x5422c3=_0x5422c3-0x94;const _0x8e02a0=a136_0x8e02();let _0xbc8fc4=_0x8e02a0[_0x5422c3];return _0xbc8fc4;}(function(_0x273263,_0x16be47){const _0x1f0976=a136_0xbc8f,_0x94662b=_0x273263();while(!![]){try{const _0x19ccb2=parseInt(_0x1f0976(0xa8))/0x1*(-parseInt(_0x1f0976(0x9c))/0x2)+parseInt(_0x1f0976(0x97))/0x3+-parseInt(_0x1f0976(0x9b))/0x4+-parseInt(_0x1f0976(0xa3))/0x5*(parseInt(_0x1f0976(0x9f))/0x6)+-parseInt(_0x1f0976(0xa2))/0x7+-parseInt(_0x1f0976(0xa6))/0x8+parseInt(_0x1f0976(0x95))/0x9*(parseInt(_0x1f0976(0x96))/0xa);if(_0x19ccb2===_0x16be47)break;else _0x94662b['push'](_0x94662b['shift']());}catch(_0x9de56d){_0x94662b['push'](_0x94662b['shift']());}}}(a136_0x8e02,0x722a6));import a136_0x1aea16 from'node:path';function a136_0x8e02(){const _0xa0b64=['6288415lEQBVk','335gQbMMj','代码格式化完成','error','5789952mcubJb','npx','55992xHDSNF','cwd','1323uNvinJ','195290osaXzJ','447759ybDkni','now','format','开始格式化代码','246144EOArQg','2vBLHCT','prettier','info','72786SfcOuZ','resolve','success'];a136_0x8e02=function(){return _0xa0b64;};return a136_0x8e02();}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(_0x316cea){const _0x39b0b5=a136_0xbc8f,_0x1edd1d=Date['now'](),_0x2dacc2=a136_0x1aea16[_0x39b0b5(0xa0)](process[_0x39b0b5(0x94)](),_0x316cea);try{logger[_0x39b0b5(0x9e)](_0x39b0b5(0x99),_0x39b0b5(0x9a),{'projectCode':_0x316cea}),await execa(resolveNpmBin(_0x39b0b5(0xa7)),[_0x39b0b5(0x9d),'--write','.'],{'cwd':_0x2dacc2});const _0x34e81b=Date[_0x39b0b5(0x98)]()-_0x1edd1d;logger[_0x39b0b5(0xa1)](_0x39b0b5(0x99),_0x39b0b5(0xa4),_0x34e81b,{'projectCode':_0x316cea});}catch(_0xae984e){const _0x35d9ca=Date['now']()-_0x1edd1d;logger[_0x39b0b5(0xa5)](_0x39b0b5(0x99),'代码格式化失败',{'projectCode':_0x316cea,'error':_0xae984e instanceof Error?_0xae984e['message']:String(_0xae984e),'duration':_0x35d9ca});throw _0xae984e;}return formatElapsed(_0x1edd1d);}
@@ -1 +1 @@
1
- (function(_0x1240b7,_0x2738b4){const _0x231c0d=a137_0x5a70,_0x4a7eeb=_0x1240b7();while(!![]){try{const _0x26cbb8=-parseInt(_0x231c0d(0x92))/0x1*(-parseInt(_0x231c0d(0x90))/0x2)+-parseInt(_0x231c0d(0xa1))/0x3*(parseInt(_0x231c0d(0x96))/0x4)+-parseInt(_0x231c0d(0xa2))/0x5+parseInt(_0x231c0d(0xa3))/0x6*(-parseInt(_0x231c0d(0x99))/0x7)+parseInt(_0x231c0d(0x94))/0x8*(parseInt(_0x231c0d(0x8a))/0x9)+-parseInt(_0x231c0d(0x8e))/0xa*(parseInt(_0x231c0d(0x93))/0xb)+-parseInt(_0x231c0d(0x97))/0xc*(-parseInt(_0x231c0d(0x91))/0xd);if(_0x26cbb8===_0x2738b4)break;else _0x4a7eeb['push'](_0x4a7eeb['shift']());}catch(_0xbbf8db){_0x4a7eeb['push'](_0x4a7eeb['shift']());}}}(a137_0x58b6,0xe79f9));import a137_0x5753a8 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';function a137_0x5a70(_0x5636a5,_0x324b7b){_0x5636a5=_0x5636a5-0x8a;const _0x58b688=a137_0x58b6();let _0x5a7067=_0x58b688[_0x5636a5];return _0x5a7067;}export async function installDependencies(_0xf3ed6f){const _0x176d2b=a137_0x5a70,_0x143bc7=Date[_0x176d2b(0x9d)](),_0x35f101=a137_0x5753a8[_0x176d2b(0x98)](process['cwd'](),_0xf3ed6f);try{logger[_0x176d2b(0x8b)](_0x176d2b(0x9b),_0x176d2b(0x8d),{'projectCode':_0xf3ed6f,'registry':_0x176d2b(0xa0)}),await execa(resolveNpmBin(_0x176d2b(0x9c)),[_0x176d2b(0x9b),_0x176d2b(0x8f),'https://registry.npmmirror.com'],{'cwd':_0x35f101});const _0x59d9c7=Date[_0x176d2b(0x9d)]()-_0x143bc7;logger[_0x176d2b(0x9a)](_0x176d2b(0x9b),_0x176d2b(0x8c),_0x59d9c7,{'projectCode':_0xf3ed6f});}catch(_0x286c3d){const _0x109a38=Date[_0x176d2b(0x9d)]()-_0x143bc7;logger[_0x176d2b(0x9f)]('install',_0x176d2b(0x95),{'projectCode':_0xf3ed6f,'error':_0x286c3d instanceof Error?_0x286c3d[_0x176d2b(0x9e)]:String(_0x286c3d),'duration':_0x109a38});throw _0x286c3d;}return formatElapsed(_0x143bc7);}function a137_0x58b6(){const _0x5daf70=['--registry','1972084TwRZKY','25854530BIHSrT','1MwbXAm','1210mgXuat','400GyKyiP','依赖安装失败','1300028yTzxPk','12NQbbYu','resolve','259ZQrViz','success','install','npm','now','message','error','https://registry.npmmirror.com','3dExSHQ','151750gaLreU','227508WBzQft','1395faVsOb','info','依赖安装完成','开始安装依赖','25050UryPrT'];a137_0x58b6=function(){return _0x5daf70;};return a137_0x58b6();}
1
+ (function(_0x3b9c79,_0x4b2d2a){const _0xc0ab59=a137_0x29e6,_0x5b60b2=_0x3b9c79();while(!![]){try{const _0x3db034=-parseInt(_0xc0ab59(0x1c6))/0x1+-parseInt(_0xc0ab59(0x1ce))/0x2*(-parseInt(_0xc0ab59(0x1c2))/0x3)+parseInt(_0xc0ab59(0x1cd))/0x4*(parseInt(_0xc0ab59(0x1c8))/0x5)+parseInt(_0xc0ab59(0x1d1))/0x6+parseInt(_0xc0ab59(0x1c7))/0x7*(-parseInt(_0xc0ab59(0x1d3))/0x8)+-parseInt(_0xc0ab59(0x1c1))/0x9*(parseInt(_0xc0ab59(0x1d2))/0xa)+parseInt(_0xc0ab59(0x1bf))/0xb;if(_0x3db034===_0x4b2d2a)break;else _0x5b60b2['push'](_0x5b60b2['shift']());}catch(_0xfbe53c){_0x5b60b2['push'](_0x5b60b2['shift']());}}}(a137_0x5831,0xd2c51));import a137_0x2e113b 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';function a137_0x29e6(_0x1211d4,_0x559608){_0x1211d4=_0x1211d4-0x1bf;const _0x583175=a137_0x5831();let _0x29e6fd=_0x583175[_0x1211d4];return _0x29e6fd;}export async function installDependencies(_0x3fb5e8){const _0x42bb1c=a137_0x29e6,_0x1a1271=Date[_0x42bb1c(0x1d0)](),_0x2ba7c0=a137_0x2e113b['resolve'](process[_0x42bb1c(0x1cf)](),_0x3fb5e8);try{logger[_0x42bb1c(0x1cb)](_0x42bb1c(0x1ca),_0x42bb1c(0x1c9),{'projectCode':_0x3fb5e8,'registry':'https://registry.npmmirror.com'}),await execa(resolveNpmBin(_0x42bb1c(0x1c3)),['install',_0x42bb1c(0x1c5),_0x42bb1c(0x1c0)],{'cwd':_0x2ba7c0});const _0x5ea192=Date['now']()-_0x1a1271;logger[_0x42bb1c(0x1cc)](_0x42bb1c(0x1ca),'依赖安装完成',_0x5ea192,{'projectCode':_0x3fb5e8});}catch(_0x1b9690){const _0x230706=Date['now']()-_0x1a1271;logger['error'](_0x42bb1c(0x1ca),_0x42bb1c(0x1c4),{'projectCode':_0x3fb5e8,'error':_0x1b9690 instanceof Error?_0x1b9690[_0x42bb1c(0x1d4)]:String(_0x1b9690),'duration':_0x230706});throw _0x1b9690;}return formatElapsed(_0x1a1271);}function a137_0x5831(){const _0x172c98=['npm','依赖安装失败','--registry','181348doIRxY','5537NadCcg','5Sytgym','开始安装依赖','install','info','success','1107880FgdiGt','3201788uDCNwt','cwd','now','5593680MonYCW','10ISIGNX','12784ucRAQK','message','7884943zYIoBS','https://registry.npmmirror.com','10964502XmVYhk','3VAYuqO'];a137_0x5831=function(){return _0x172c98;};return a137_0x5831();}
@@ -1 +1 @@
1
- const a138_0x25c155=a138_0x1c29;(function(_0x3d4ecb,_0x1de016){const _0x2d17b7=a138_0x1c29,_0x137694=_0x3d4ecb();while(!![]){try{const _0x74b5=parseInt(_0x2d17b7(0x1e7))/0x1+-parseInt(_0x2d17b7(0x1cf))/0x2+-parseInt(_0x2d17b7(0x1e3))/0x3*(-parseInt(_0x2d17b7(0x1ce))/0x4)+-parseInt(_0x2d17b7(0x1e4))/0x5*(-parseInt(_0x2d17b7(0x1c9))/0x6)+parseInt(_0x2d17b7(0x1d6))/0x7*(-parseInt(_0x2d17b7(0x1c6))/0x8)+parseInt(_0x2d17b7(0x1e6))/0x9+-parseInt(_0x2d17b7(0x1d9))/0xa;if(_0x74b5===_0x1de016)break;else _0x137694['push'](_0x137694['shift']());}catch(_0x412834){_0x137694['push'](_0x137694['shift']());}}}(a138_0x2688,0xe3e30));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';function a138_0x2688(){const _0x2bb6d5=['App\x20code\x20to\x20initialize','cookie','string','\x20workspace\x20init','name','7dUIhDi','yes','boolean','15186910EuRcfo','create','args','str','bool','2026-07','appcode','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','../../commands/project/create/non-interactive.js','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','527079mTbrKG','2873330okUvwc','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','4244130SbUjtK','1593679fmNoMh','Project\x20name','upgrade','Auto-confirm\x20prompts','validation','6651128oYACMy','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','Skip\x20confirmation\x20prompt','18mzGgdY','write','nonInteractive','env','project','4kClshI','1362868FCeoMT','project-name'];a138_0x2688=function(){return _0x2bb6d5;};return a138_0x2688();}function a138_0x1c29(_0x503242,_0x1a4fd1){_0x503242=_0x503242-0x1c5;const _0x26882b=a138_0x2688();let _0x1c2955=_0x26882b[_0x503242];return _0x1c2955;}import{upgradeApp}from'../../commands/project/upgrade.js';const initFlags=[{'name':a138_0x25c155(0x1df),'type':a138_0x25c155(0x1d3),'description':a138_0x25c155(0x1d1)},{'name':a138_0x25c155(0x1cc),'type':'string','description':'Target\x20environment'},{'name':a138_0x25c155(0x1d7),'type':'boolean','description':a138_0x25c155(0x1ea),'default':![]}],createFlags=[{'name':a138_0x25c155(0x1d5),'type':'string','description':a138_0x25c155(0x1e8)},{'name':'env','type':a138_0x25c155(0x1d3),'description':'Target\x20environment'},{'name':a138_0x25c155(0x1df),'type':a138_0x25c155(0x1d3),'description':a138_0x25c155(0x1c7)}],upgradeFlags=[{'name':a138_0x25c155(0x1d7),'type':a138_0x25c155(0x1d8),'description':a138_0x25c155(0x1c8),'default':![]}];export const projectDefinitions=[{'service':'project','command':'init','description':a138_0x25c155(0x1e5),'risk':a138_0x25c155(0x1ca),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a138_0x25c155(0x1d4),'since':a138_0x25c155(0x1de)},'flags':initFlags,async 'execute'(_0x3c83c7){const _0x1fdc9a=a138_0x25c155;return await initConfig({'appcode':_0x3c83c7[_0x1fdc9a(0x1dc)](_0x1fdc9a(0x1df))||undefined,'env':_0x3c83c7['str'](_0x1fdc9a(0x1cc))||undefined,'autoYes':_0x3c83c7[_0x1fdc9a(0x1dd)]('yes')}),{'ok':!![]};}},{'service':a138_0x25c155(0x1cd),'command':a138_0x25c155(0x1da),'description':'Create\x20a\x20new\x20project','risk':a138_0x25c155(0x1ca),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a138_0x25c155(0x1d0),'description':a138_0x25c155(0x1e2),'required':![]}],'flags':createFlags,async 'execute'(_0x54b7c6){const _0x115bc1=a138_0x25c155,{createApp:_0x25057b}=await import('../../commands/project/create/main.js'),{createProjectNonInteractive:_0x3d5070}=await import(_0x115bc1(0x1e1)),_0x3e30f9=_0x54b7c6['str'](_0x115bc1(0x1d5))['trim']()||_0x54b7c6[_0x115bc1(0x1db)][0x0]?.['trim'](),_0x1a47ac=_0x54b7c6[_0x115bc1(0x1dc)](_0x115bc1(0x1cc))||undefined,_0x52574a=_0x54b7c6[_0x115bc1(0x1dc)](_0x115bc1(0x1df))||undefined;if(_0x54b7c6[_0x115bc1(0x1cb)]){if(!_0x3e30f9)throw CliErrors[_0x115bc1(0x1c5)](_0x115bc1(0x1e0),'Usage:\x20'+CLI_BIN_NAME+'\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]');await _0x3d5070(_0x3e30f9,_0x1a47ac,_0x52574a,_0x54b7c6[_0x115bc1(0x1d2)]);}else await _0x25057b({'projectCode':_0x3e30f9,'appCode':_0x52574a,'env':_0x1a47ac,'cookie':_0x54b7c6[_0x115bc1(0x1d2)]});return{'ok':!![]};}},{'service':'project','command':a138_0x25c155(0x1e9),'description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','risk':a138_0x25c155(0x1ca),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x52a974){const _0x10b733=a138_0x25c155;return await upgradeApp(_0x52a974['nonInteractive'],{'yes':_0x52a974['bool'](_0x10b733(0x1d7))}),{'ok':!![]};}}];
1
+ const a138_0x2e350d=a138_0x3611;(function(_0x985b0f,_0xcf87d3){const _0xc6acc2=a138_0x3611,_0x1a359e=_0x985b0f();while(!![]){try{const _0x1ec5fd=-parseInt(_0xc6acc2(0x6f))/0x1*(-parseInt(_0xc6acc2(0x7a))/0x2)+-parseInt(_0xc6acc2(0x80))/0x3+parseInt(_0xc6acc2(0x83))/0x4+-parseInt(_0xc6acc2(0x70))/0x5*(-parseInt(_0xc6acc2(0x73))/0x6)+-parseInt(_0xc6acc2(0x87))/0x7*(-parseInt(_0xc6acc2(0x89))/0x8)+parseInt(_0xc6acc2(0x71))/0x9+-parseInt(_0xc6acc2(0x75))/0xa;if(_0x1ec5fd===_0xcf87d3)break;else _0x1a359e['push'](_0x1a359e['shift']());}catch(_0x1316f6){_0x1a359e['push'](_0x1a359e['shift']());}}}(a138_0x3ab6,0xd72c2));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a138_0x3611(_0x24b46f,_0x2a0ad7){_0x24b46f=_0x24b46f-0x6a;const _0x3ab60d=a138_0x3ab6();let _0x361161=_0x3ab60d[_0x24b46f];return _0x361161;}import{initConfig}from'../../commands/project/init.js';function a138_0x3ab6(){const _0x3a40fd=['App\x20code\x20to\x20initialize','boolean','2XOSHjP','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','project','env','init','Target\x20environment','1651758maZJSG','cookie','nonInteractive','4562080aqKiOM','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','2026-07','yes','469dMMltY','\x20workspace\x20init','198040aOoKPH','../../commands/project/create/main.js','bool','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','trim','validation','str','Project\x20name','write','1272135wVnOIg','3635jcpfdS','6700221QWCcZo','string','13242BCgseJ','Usage:\x20','49882660TCFSDE','appcode','project-name'];a138_0x3ab6=function(){return _0x3a40fd;};return a138_0x3ab6();}import{upgradeApp}from'../../commands/project/upgrade.js';const initFlags=[{'name':a138_0x2e350d(0x76),'type':a138_0x2e350d(0x72),'description':a138_0x2e350d(0x78)},{'name':a138_0x2e350d(0x7d),'type':'string','description':a138_0x2e350d(0x7f)},{'name':a138_0x2e350d(0x86),'type':a138_0x2e350d(0x79),'description':'Auto-confirm\x20prompts','default':![]}],createFlags=[{'name':'name','type':a138_0x2e350d(0x72),'description':a138_0x2e350d(0x6d)},{'name':a138_0x2e350d(0x7d),'type':'string','description':'Target\x20environment'},{'name':a138_0x2e350d(0x76),'type':'string','description':a138_0x2e350d(0x7b)}],upgradeFlags=[{'name':a138_0x2e350d(0x86),'type':a138_0x2e350d(0x79),'description':'Skip\x20confirmation\x20prompt','default':![]}];export const projectDefinitions=[{'service':a138_0x2e350d(0x7c),'command':a138_0x2e350d(0x7e),'description':a138_0x2e350d(0x84),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a138_0x2e350d(0x88),'since':a138_0x2e350d(0x85)},'flags':initFlags,async 'execute'(_0x5702a9){const _0xe0f9d5=a138_0x2e350d;return await initConfig({'appcode':_0x5702a9[_0xe0f9d5(0x6c)]('appcode')||undefined,'env':_0x5702a9[_0xe0f9d5(0x6c)](_0xe0f9d5(0x7d))||undefined,'autoYes':_0x5702a9[_0xe0f9d5(0x8b)](_0xe0f9d5(0x86))}),{'ok':!![]};}},{'service':'project','command':'create','description':'Create\x20a\x20new\x20project','risk':a138_0x2e350d(0x6e),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a138_0x2e350d(0x77),'description':'Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','required':![]}],'flags':createFlags,async 'execute'(_0xc2c0e0){const _0x396702=a138_0x2e350d,{createApp:_0x164d05}=await import(_0x396702(0x8a)),{createProjectNonInteractive:_0x1e62fb}=await import('../../commands/project/create/non-interactive.js'),_0x55f93b=_0xc2c0e0['str']('name')[_0x396702(0x6a)]()||_0xc2c0e0['args'][0x0]?.['trim'](),_0x3d01b5=_0xc2c0e0[_0x396702(0x6c)](_0x396702(0x7d))||undefined,_0x1866a9=_0xc2c0e0[_0x396702(0x6c)]('appcode')||undefined;if(_0xc2c0e0[_0x396702(0x82)]){if(!_0x55f93b)throw CliErrors[_0x396702(0x6b)]('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.',_0x396702(0x74)+CLI_BIN_NAME+_0x396702(0x8c));await _0x1e62fb(_0x55f93b,_0x3d01b5,_0x1866a9,_0xc2c0e0['cookie']);}else await _0x164d05({'projectCode':_0x55f93b,'appCode':_0x1866a9,'env':_0x3d01b5,'cookie':_0xc2c0e0[_0x396702(0x81)]});return{'ok':!![]};}},{'service':a138_0x2e350d(0x7c),'command':'upgrade','description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x4598de){const _0x14c5ee=a138_0x2e350d;return await upgradeApp(_0x4598de['nonInteractive'],{'yes':_0x4598de[_0x14c5ee(0x8b)]('yes')}),{'ok':!![]};}}];
@@ -1 +1 @@
1
- (function(_0x343b9c,_0x29b6f9){const _0x23034d=a139_0x31c9,_0x354e71=_0x343b9c();while(!![]){try{const _0x2f862d=parseInt(_0x23034d(0x99))/0x1*(parseInt(_0x23034d(0x78))/0x2)+-parseInt(_0x23034d(0x86))/0x3+-parseInt(_0x23034d(0x9a))/0x4*(-parseInt(_0x23034d(0x9f))/0x5)+parseInt(_0x23034d(0xa1))/0x6*(parseInt(_0x23034d(0xa2))/0x7)+-parseInt(_0x23034d(0x9c))/0x8+-parseInt(_0x23034d(0x95))/0x9*(-parseInt(_0x23034d(0x8a))/0xa)+-parseInt(_0x23034d(0x90))/0xb*(parseInt(_0x23034d(0x9e))/0xc);if(_0x2f862d===_0x29b6f9)break;else _0x354e71['push'](_0x354e71['shift']());}catch(_0x1ea246){_0x354e71['push'](_0x354e71['shift']());}}}(a139_0x5213,0x5c5ca));import{readFileSync,existsSync,renameSync}from'node:fs';function a139_0x5213(){const _0x25042a=['cyan','1451496aQEFrv','1865squEPJ','?\x20(Old\x20file\x20→\x20*.bak)','916278PuAdJQ','21eLzStf','parse','初始化项目配置文件成功','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','\x20workspace\x20init`\x20to\x20start\x20fresh.','app','production','Invalid\x20App\x20Code','keys','\x20\x20Default:\x20','log','34614cOioOy','cwd','setLogPath','defaultApp','Migration\x20cancelled.\x20Run\x20`','.rabetbase.json','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory','从旧配置文件升级成功','utf8','string','green','gray','env','.bak','865965IiUQrn','info','toLocaleString','bold','114310yGhwAk','\x20→\x20.rabetbase.json','\x20\x20Apps:\x20','\x20api\x20pull\x27','\x20api\x20generate\x27\x20and\x20\x27','Please\x20enter\x20App\x20Code:','55jxnexW','appcode','\x20\x20appcode:\x20','1.0.0','apps','243Sjaide','init','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','version','19OJlFOC','4144JBjmsO','join','1682224NUiPeA'];a139_0x5213=function(){return _0x25042a;};return a139_0x5213();}import{resolve,dirname,basename}from'node:path';function a139_0x31c9(_0x378013,_0x4b6a8f){_0x378013=_0x378013-0x74;const _0x52138b=a139_0x5213();let _0x31c9a2=_0x52138b[_0x378013];return _0x31c9a2;}import{fileURLToPath}from'node:url';import a139_0x5cd4a4 from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x29e326){const _0x3987c4=a139_0x31c9,{appcode:_0x3cfa3b,env:_0x1dd656,autoYes:_0xa465fd}=_0x29e326,_0x4bedb7=process[_0x3987c4(0x79)]();if(getProjectConfigPath())throw new Error('.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.');let _0x5bbeea;for(const _0x4f541a of LEGACY_CONFIG_NAMES){const _0x26ce5b=resolve(_0x4bedb7,_0x4f541a);if(existsSync(_0x26ce5b)){_0x5bbeea=_0x26ce5b;break;}}if(_0x5bbeea){let _0x44ad50={};try{_0x44ad50=JSON['parse'](readFileSync(_0x5bbeea,'utf8'));}catch{}const _0x8816ec=basename(_0x5bbeea),_0x27ae23=_0x44ad50?.[_0x3987c4(0x91)]||_0x44ad50?.[_0x3987c4(0xa7)];let _0xae067e=_0xa465fd;!_0xa465fd&&(console[_0x3987c4(0x77)](a139_0x5cd4a4['yellow'](_0x3987c4(0xa5)+a139_0x5cd4a4[_0x3987c4(0x89)](_0x8816ec))),_0x27ae23&&console[_0x3987c4(0x77)](a139_0x5cd4a4['cyan'](_0x3987c4(0x92)+_0x27ae23)),_0xae067e=await confirm({'message':'Upgrade\x20it\x20to\x20'+a139_0x5cd4a4['bold'](_0x3987c4(0x7d))+_0x3987c4(0xa0),'default':!![]}));if(!_0xae067e){console['log'](_0x3987c4(0x7c)+CLI_BIN_NAME+_0x3987c4(0xa6));return;}const _0x4df2cc=resolve(_0x4bedb7,NEW_CONFIG_NAME),_0x1f4287=getCliVersionFromPkg(),_0x96cf56=readRawConfig(),_0x3edc1c=_0x3cfa3b||(typeof _0x44ad50?.[_0x3987c4(0x91)]===_0x3987c4(0x81)?_0x44ad50[_0x3987c4(0x91)]:undefined)||(typeof _0x44ad50?.[_0x3987c4(0xa7)]==='string'?_0x44ad50['app']:undefined)||await askAppcode(),_0x93e33d=typeof _0x44ad50?.[_0x3987c4(0x84)]===_0x3987c4(0x81)?_0x44ad50[_0x3987c4(0x84)]:typeof _0x96cf56[_0x3987c4(0x84)]===_0x3987c4(0x81)?_0x96cf56['env']:_0x3987c4(0xa8),_0xdd65c0=buildCanonicalProjectConfig({..._0x96cf56,..._0x44ad50},{'appCodes':[_0x3edc1c],'env':_0x93e33d,'metadata':{'version':_0x1f4287,'migratedAt':new Date()[_0x3987c4(0x88)](),'migratedFrom':_0x5bbeea}});writeConfigFile(_0x4df2cc,_0xdd65c0);const _0x40dd56=_0x5bbeea+_0x3987c4(0x85);renameSync(_0x5bbeea,_0x40dd56),logger[_0x3987c4(0x7a)](_0x4bedb7),logger[_0x3987c4(0x87)](_0x3987c4(0x96),_0x3987c4(0x7f),{'from':_0x5bbeea,'to':_0x4df2cc,'appcode':_0x3edc1c,'env':_0xdd65c0[_0x3987c4(0x84)]}),console[_0x3987c4(0x77)](a139_0x5cd4a4['green']('✓\x20Upgraded\x20'+_0x8816ec+_0x3987c4(0x8b))),console[_0x3987c4(0x77)](a139_0x5cd4a4['cyan'](_0x3987c4(0x8c)+Object['keys'](_0xdd65c0[_0x3987c4(0x94)]||{})[_0x3987c4(0x9b)](',\x20'))),console[_0x3987c4(0x77)](a139_0x5cd4a4[_0x3987c4(0x9d)](_0x3987c4(0x76)+_0xdd65c0[_0x3987c4(0x7b)])),console[_0x3987c4(0x77)](a139_0x5cd4a4[_0x3987c4(0x83)](_0x3987c4(0x97)+_0x8816ec+'.bak'));return;}const _0x312098=_0x3cfa3b||await askAppcode(),_0x8b9a8=resolve(_0x4bedb7,NEW_CONFIG_NAME),_0x49ffde=getCliVersionFromPkg(),_0x2c1099=readRawConfig(),_0x2f2d73=typeof _0x2c1099[_0x3987c4(0x84)]===_0x3987c4(0x81)?_0x2c1099[_0x3987c4(0x84)]:undefined,_0x57b74b=buildCanonicalProjectConfig({},{'appCodes':[_0x312098],'env':_0x1dd656||_0x2f2d73||_0x3987c4(0xa8),'metadata':{'version':_0x49ffde,'createdAt':new Date()['toLocaleString']()}});writeConfigFile(_0x8b9a8,_0x57b74b),logger['setLogPath'](_0x4bedb7),logger['info'](_0x3987c4(0x96),_0x3987c4(0xa4),{'appcode':_0x312098,'env':_0x57b74b[_0x3987c4(0x84)],'version':_0x57b74b[_0x3987c4(0x98)],'configPath':_0x8b9a8}),console['log'](a139_0x5cd4a4[_0x3987c4(0x82)](_0x3987c4(0x7e))),console['log'](a139_0x5cd4a4[_0x3987c4(0x9d)](_0x3987c4(0x8c)+Object[_0x3987c4(0x75)](_0x57b74b[_0x3987c4(0x94)]||{})['join'](',\x20'))),console[_0x3987c4(0x77)](a139_0x5cd4a4[_0x3987c4(0x9d)](_0x3987c4(0x76)+_0x57b74b[_0x3987c4(0x7b)])),console['log']('\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27'+CLI_BIN_NAME+_0x3987c4(0x8e)+CLI_BIN_NAME+_0x3987c4(0x8d));}function askAppcode(){const _0x1e9fed=a139_0x31c9;return input({'message':_0x1e9fed(0x8f),'validate':_0x3e1afc=>{const _0x402b33=_0x1e9fed;if(!_0x3e1afc['trim']())return'App\x20Code\x20cannot\x20be\x20empty';const {valid:_0x5c3b7a,message:_0x4e6702}=validateAppcode(_0x3e1afc['trim']());return _0x5c3b7a||_0x4e6702||_0x402b33(0x74);}});}function getCliVersionFromPkg(){const _0x4ce858=a139_0x31c9;try{const _0x146b9d=fileURLToPath(import.meta.url),_0x15ee0c=resolve(dirname(_0x146b9d),'../..'),_0x583301=JSON[_0x4ce858(0xa3)](readFileSync(resolve(_0x15ee0c,'package.json'),_0x4ce858(0x80)));return _0x583301[_0x4ce858(0x98)]||_0x4ce858(0x93);}catch{return _0x4ce858(0x93);}}
1
+ (function(_0x23c265,_0x457a0c){const _0x4c698f=a139_0x2d3b,_0x4bfe5f=_0x23c265();while(!![]){try{const _0xb0c55f=-parseInt(_0x4c698f(0x1e9))/0x1+-parseInt(_0x4c698f(0x1ce))/0x2*(-parseInt(_0x4c698f(0x1d7))/0x3)+parseInt(_0x4c698f(0x1e5))/0x4+-parseInt(_0x4c698f(0x1c8))/0x5+-parseInt(_0x4c698f(0x1d1))/0x6+-parseInt(_0x4c698f(0x1f2))/0x7*(parseInt(_0x4c698f(0x1c3))/0x8)+parseInt(_0x4c698f(0x1ec))/0x9;if(_0xb0c55f===_0x457a0c)break;else _0x4bfe5f['push'](_0x4bfe5f['shift']());}catch(_0x206f8f){_0x4bfe5f['push'](_0x4bfe5f['shift']());}}}(a139_0x4631,0xdf81b));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';function a139_0x2d3b(_0x23c7f7,_0x18eff4){_0x23c7f7=_0x23c7f7-0x1c1;const _0x463154=a139_0x4631();let _0x2d3bde=_0x463154[_0x23c7f7];return _0x2d3bde;}import{fileURLToPath}from'node:url';import a139_0xca6636 from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';function a139_0x4631(){const _0x54129f=['\x20\x20Default:\x20','\x20api\x20generate\x27\x20and\x20\x27','Migration\x20cancelled.\x20Run\x20`','6342615LSyTTk','env','green','production','初始化项目配置文件成功','setLogPath','320wrVWPc','log','init','9281352VBkzhG','package.json','\x20workspace\x20init`\x20to\x20start\x20fresh.','yellow','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','\x20\x20Apps:\x20','18702kpxVSE','?\x20(Old\x20file\x20→\x20*.bak)','trim','parse','✓\x20Upgraded\x20','cyan','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory','utf8','\x20api\x20pull\x27','keys','string','App\x20Code\x20cannot\x20be\x20empty','.bak','join','7038180eIiwQH','app','bold','1.0.0','1767574VURnkx','appcode','apps','35921259hHukrx','defaultApp','Invalid\x20App\x20Code','version','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','../..','84tPWtEX','toLocaleString','cwd','从旧配置文件升级成功','\x20\x20appcode:\x20','gray','833176hVIDVW','Upgrade\x20it\x20to\x20'];a139_0x4631=function(){return _0x54129f;};return a139_0x4631();}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(_0x1b1b8e){const _0x5a7b77=a139_0x2d3b,{appcode:_0x446bc4,env:_0x28354c,autoYes:_0x57e154}=_0x1b1b8e,_0x2c7ffe=process[_0x5a7b77(0x1f4)]();if(getProjectConfigPath())throw new Error(_0x5a7b77(0x1d5));let _0x3d5044;for(const _0x53e5e9 of LEGACY_CONFIG_NAMES){const _0x1d8483=resolve(_0x2c7ffe,_0x53e5e9);if(existsSync(_0x1d8483)){_0x3d5044=_0x1d8483;break;}}if(_0x3d5044){let _0x532d7b={};try{_0x532d7b=JSON[_0x5a7b77(0x1da)](readFileSync(_0x3d5044,'utf8'));}catch{}const _0x4449c7=basename(_0x3d5044),_0x4ded9e=_0x532d7b?.['appcode']||_0x532d7b?.['app'];let _0x1772cc=_0x57e154;!_0x57e154&&(console[_0x5a7b77(0x1cf)](a139_0xca6636[_0x5a7b77(0x1d4)]('⚠\x20Found\x20legacy\x20configuration\x20file:\x20'+a139_0xca6636[_0x5a7b77(0x1e7)](_0x4449c7))),_0x4ded9e&&console[_0x5a7b77(0x1cf)](a139_0xca6636[_0x5a7b77(0x1dc)](_0x5a7b77(0x1c1)+_0x4ded9e)),_0x1772cc=await confirm({'message':_0x5a7b77(0x1c4)+a139_0xca6636[_0x5a7b77(0x1e7)]('.rabetbase.json')+_0x5a7b77(0x1d8),'default':!![]}));if(!_0x1772cc){console[_0x5a7b77(0x1cf)](_0x5a7b77(0x1c7)+CLI_BIN_NAME+_0x5a7b77(0x1d3));return;}const _0x415afc=resolve(_0x2c7ffe,NEW_CONFIG_NAME),_0x326c0c=getCliVersionFromPkg(),_0x2dac65=readRawConfig(),_0x20f32f=_0x446bc4||(typeof _0x532d7b?.[_0x5a7b77(0x1ea)]===_0x5a7b77(0x1e1)?_0x532d7b[_0x5a7b77(0x1ea)]:undefined)||(typeof _0x532d7b?.['app']==='string'?_0x532d7b[_0x5a7b77(0x1e6)]:undefined)||await askAppcode(),_0x143033=typeof _0x532d7b?.[_0x5a7b77(0x1c9)]===_0x5a7b77(0x1e1)?_0x532d7b[_0x5a7b77(0x1c9)]:typeof _0x2dac65[_0x5a7b77(0x1c9)]===_0x5a7b77(0x1e1)?_0x2dac65[_0x5a7b77(0x1c9)]:'production',_0x283ab0=buildCanonicalProjectConfig({..._0x2dac65,..._0x532d7b},{'appCodes':[_0x20f32f],'env':_0x143033,'metadata':{'version':_0x326c0c,'migratedAt':new Date()['toLocaleString'](),'migratedFrom':_0x3d5044}});writeConfigFile(_0x415afc,_0x283ab0);const _0x475b60=_0x3d5044+_0x5a7b77(0x1e3);renameSync(_0x3d5044,_0x475b60),logger[_0x5a7b77(0x1cd)](_0x2c7ffe),logger['info']('init',_0x5a7b77(0x1f5),{'from':_0x3d5044,'to':_0x415afc,'appcode':_0x20f32f,'env':_0x283ab0[_0x5a7b77(0x1c9)]}),console[_0x5a7b77(0x1cf)](a139_0xca6636[_0x5a7b77(0x1ca)](_0x5a7b77(0x1db)+_0x4449c7+'\x20→\x20.rabetbase.json')),console[_0x5a7b77(0x1cf)](a139_0xca6636['cyan'](_0x5a7b77(0x1d6)+Object[_0x5a7b77(0x1e0)](_0x283ab0[_0x5a7b77(0x1eb)]||{})[_0x5a7b77(0x1e4)](',\x20'))),console['log'](a139_0xca6636[_0x5a7b77(0x1dc)](_0x5a7b77(0x1c5)+_0x283ab0['defaultApp'])),console[_0x5a7b77(0x1cf)](a139_0xca6636[_0x5a7b77(0x1c2)]('\x20\x20Old\x20file\x20backed\x20up\x20as\x20'+_0x4449c7+_0x5a7b77(0x1e3)));return;}const _0x1b484b=_0x446bc4||await askAppcode(),_0xe78ea6=resolve(_0x2c7ffe,NEW_CONFIG_NAME),_0x392d47=getCliVersionFromPkg(),_0x3add15=readRawConfig(),_0x253168=typeof _0x3add15[_0x5a7b77(0x1c9)]===_0x5a7b77(0x1e1)?_0x3add15[_0x5a7b77(0x1c9)]:undefined,_0x2c8a54=buildCanonicalProjectConfig({},{'appCodes':[_0x1b484b],'env':_0x28354c||_0x253168||_0x5a7b77(0x1cb),'metadata':{'version':_0x392d47,'createdAt':new Date()[_0x5a7b77(0x1f3)]()}});writeConfigFile(_0xe78ea6,_0x2c8a54),logger[_0x5a7b77(0x1cd)](_0x2c7ffe),logger['info'](_0x5a7b77(0x1d0),_0x5a7b77(0x1cc),{'appcode':_0x1b484b,'env':_0x2c8a54[_0x5a7b77(0x1c9)],'version':_0x2c8a54[_0x5a7b77(0x1ef)],'configPath':_0xe78ea6}),console[_0x5a7b77(0x1cf)](a139_0xca6636[_0x5a7b77(0x1ca)](_0x5a7b77(0x1dd))),console['log'](a139_0xca6636[_0x5a7b77(0x1dc)](_0x5a7b77(0x1d6)+Object['keys'](_0x2c8a54[_0x5a7b77(0x1eb)]||{})[_0x5a7b77(0x1e4)](',\x20'))),console['log'](a139_0xca6636[_0x5a7b77(0x1dc)]('\x20\x20Default:\x20'+_0x2c8a54[_0x5a7b77(0x1ed)])),console[_0x5a7b77(0x1cf)](_0x5a7b77(0x1f0)+CLI_BIN_NAME+_0x5a7b77(0x1c6)+CLI_BIN_NAME+_0x5a7b77(0x1df));}function askAppcode(){return input({'message':'Please\x20enter\x20App\x20Code:','validate':_0x5a61a9=>{const _0x116fd5=a139_0x2d3b;if(!_0x5a61a9[_0x116fd5(0x1d9)]())return _0x116fd5(0x1e2);const {valid:_0x4dd0e1,message:_0x904c48}=validateAppcode(_0x5a61a9[_0x116fd5(0x1d9)]());return _0x4dd0e1||_0x904c48||_0x116fd5(0x1ee);}});}function getCliVersionFromPkg(){const _0x1bc9ae=a139_0x2d3b;try{const _0x3282d2=fileURLToPath(import.meta.url),_0x38edc6=resolve(dirname(_0x3282d2),_0x1bc9ae(0x1f1)),_0x4261ff=JSON['parse'](readFileSync(resolve(_0x38edc6,_0x1bc9ae(0x1d2)),_0x1bc9ae(0x1de)));return _0x4261ff[_0x1bc9ae(0x1ef)]||_0x1bc9ae(0x1e8);}catch{return'1.0.0';}}
@@ -1 +1 @@
1
- const a140_0x5aeff0=a140_0x1f14;(function(_0x2d8ca5,_0x279048){const _0x5cd184=a140_0x1f14,_0x457ad1=_0x2d8ca5();while(!![]){try{const _0x17afce=-parseInt(_0x5cd184(0x192))/0x1*(-parseInt(_0x5cd184(0x1c3))/0x2)+parseInt(_0x5cd184(0x1ad))/0x3+-parseInt(_0x5cd184(0x196))/0x4+parseInt(_0x5cd184(0x165))/0x5+parseInt(_0x5cd184(0x19b))/0x6+-parseInt(_0x5cd184(0x1bd))/0x7*(-parseInt(_0x5cd184(0x1d6))/0x8)+parseInt(_0x5cd184(0x1e4))/0x9;if(_0x17afce===_0x279048)break;else _0x457ad1['push'](_0x457ad1['shift']());}catch(_0x102e0c){_0x457ad1['push'](_0x457ad1['shift']());}}}(a140_0x118a,0xeb101));import a140_0x28b79e from'chalk';function a140_0x1f14(_0x5614dd,_0x37c2ab){_0x5614dd=_0x5614dd-0x164;const _0x118a7d=a140_0x118a();let _0x1f1426=_0x118a7d[_0x5614dd];return _0x1f1426;}import a140_0x17babd 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[a140_0x5aeff0(0x1af)](_0x536535=>_0x536535!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x442103){const _0x3b79f2=a140_0x5aeff0,_0x165214=[];for(const _0x2ba53f of Object[_0x3b79f2(0x1da)](CORE_IDE_CONFIGS)){if(_0x2ba53f[_0x3b79f2(0x18f)])for(const _0x4da879 of _0x2ba53f[_0x3b79f2(0x18f)]){_0x165214[_0x3b79f2(0x1e1)](resolve(_0x442103,_0x4da879[_0x3b79f2(0x1b5)]));}}return _0x165214;}function analyse(_0x31b317){const _0x36afe8=a140_0x5aeff0;let _0x1f2a14=null;const _0x3054d2=resolve(_0x31b317,NEW_CONFIG_NAME),_0xf92526=existsSync(_0x3054d2);for(const _0x2f2fe5 of LEGACY_CONFIG_NAMES){const _0x3eb1ea=resolve(_0x31b317,_0x2f2fe5);if(existsSync(_0x3eb1ea)){const _0x4f2bcb=readConfigFile(_0x3eb1ea),_0x5e4910=Object['keys'](_0x4f2bcb)['filter'](_0x332c5c=>typeof _0x4f2bcb[_0x332c5c]!==_0x36afe8(0x190));_0x1f2a14={'oldPath':_0x3eb1ea,'hasNewConfig':_0xf92526,'fields':_0x5e4910};break;}}const _0x4bbde7=[],_0x1a0d0e=resolve(_0x31b317,'.lovrabet');if(existsSync(_0x1a0d0e))_0x4bbde7[_0x36afe8(0x1e1)](_0x1a0d0e);const _0x53cd28=resolve(_0x31b317,_0x36afe8(0x16e));if(existsSync(_0x53cd28))_0x4bbde7[_0x36afe8(0x1e1)](_0x53cd28);const _0x5d7bdf=resolve(_0x31b317,_0x36afe8(0x1c5));if(existsSync(_0x5d7bdf))_0x4bbde7[_0x36afe8(0x1e1)](_0x5d7bdf);for(const _0x1aa38c of collectIdeSkillFiles(_0x31b317)){if(existsSync(_0x1aa38c))_0x4bbde7[_0x36afe8(0x1e1)](_0x1aa38c);}let _0x1057cf=null;const _0x1a5683=resolve(_0x31b317,_0x36afe8(0x1a3));if(existsSync(_0x1a5683))try{const _0x4b8ed5=JSON[_0x36afe8(0x19c)](readFileSync(_0x1a5683,_0x36afe8(0x1bb)));if(_0x4b8ed5?.[_0x36afe8(0x1e3)]&&typeof _0x4b8ed5[_0x36afe8(0x1e3)]===_0x36afe8(0x1ac)){const _0x5e835a=[];for(const [_0x2a37d7,_0x37350e]of Object[_0x36afe8(0x18c)](_0x4b8ed5[_0x36afe8(0x1e3)])){const _0x3c1296=_0x37350e;_0x3c1296?.['args']&&Array[_0x36afe8(0x175)](_0x3c1296[_0x36afe8(0x1ae)])&&_0x3c1296[_0x36afe8(0x1ae)][_0x36afe8(0x17c)](_0x4319db=>typeof _0x4319db===_0x36afe8(0x1ce)&&_0x4319db[_0x36afe8(0x1b0)]('@lovrabet/dataset-mcp-server'))&&_0x5e835a[_0x36afe8(0x1e1)](_0x2a37d7);}_0x5e835a['length']>0x0&&(_0x1057cf={'path':_0x1a5683,'keys':_0x5e835a});}}catch{}const _0x371291=_0x4bbde7[_0x36afe8(0x179)]>0x0||_0x1f2a14!==null;let _0x435483=null;const _0x28492e=resolve(_0x31b317,'package.json');if(existsSync(_0x28492e))try{const _0x35a7e4=JSON[_0x36afe8(0x19c)](readFileSync(_0x28492e,_0x36afe8(0x1bb)));for(const _0x55f496 of['dependencies',_0x36afe8(0x178)]){const _0x6ef759=_0x35a7e4?.[_0x55f496]?.['@lovrabet/sdk'];if(typeof _0x6ef759==='string'){_0x6ef759!=='latest'&&(_0x435483={'pkgPath':_0x28492e,'currentVersion':_0x6ef759,'field':_0x55f496});break;}}}catch{}return{'configMigration':_0x1f2a14,'oldArtifacts':_0x4bbde7,'oldMcpConfig':_0x1057cf,'needsSkillSwap':_0x371291,'sdkUpgrade':_0x435483};}function printReport(_0x3deda1){const _0x1ff49f=a140_0x5aeff0,{configMigration:_0x439f50,oldArtifacts:_0x42db20,oldMcpConfig:_0x3bef23,needsSkillSwap:_0x3b64f2}=_0x3deda1;console[_0x1ff49f(0x16b)](''),console[_0x1ff49f(0x16b)](a140_0x28b79e[_0x1ff49f(0x1aa)]('===\x20Upgrade\x20Analysis\x20===')),console[_0x1ff49f(0x16b)]('');_0x439f50?(console[_0x1ff49f(0x16b)](a140_0x28b79e['cyan'](_0x1ff49f(0x18a))+('\x20\x20'+a140_0x28b79e[_0x1ff49f(0x1df)](_0x439f50[_0x1ff49f(0x1d8)]))),console[_0x1ff49f(0x16b)](_0x1ff49f(0x1d2)+(_0x439f50[_0x1ff49f(0x1cb)]?a140_0x28b79e['green'](_0x1ff49f(0x18b)):a140_0x28b79e[_0x1ff49f(0x1a5)](_0x1ff49f(0x1a4)))),console[_0x1ff49f(0x16b)](_0x1ff49f(0x184)+_0x439f50[_0x1ff49f(0x17a)][_0x1ff49f(0x1b4)](',\x20')),console['log'](_0x1ff49f(0x164))):console[_0x1ff49f(0x16b)](a140_0x28b79e[_0x1ff49f(0x1bc)](_0x1ff49f(0x18a))+'\x20\x20'+a140_0x28b79e[_0x1ff49f(0x1a5)](_0x1ff49f(0x1d0)));console[_0x1ff49f(0x16b)]('');if(_0x42db20[_0x1ff49f(0x179)]>0x0){console[_0x1ff49f(0x16b)](a140_0x28b79e[_0x1ff49f(0x1bc)]('Legacy\x20artifacts:'));for(const _0x2e8c8d of _0x42db20){console[_0x1ff49f(0x16b)]('\x20\x20'+a140_0x28b79e[_0x1ff49f(0x18d)](_0x1ff49f(0x180))+'\x20\x20'+_0x2e8c8d);}console[_0x1ff49f(0x16b)](_0x1ff49f(0x170));}else console[_0x1ff49f(0x16b)](a140_0x28b79e[_0x1ff49f(0x1bc)](_0x1ff49f(0x16d))+'\x20\x20'+a140_0x28b79e['gray']('none\x20found'));console['log']('');_0x3bef23?(console['log'](a140_0x28b79e[_0x1ff49f(0x1bc)]('MCP\x20config:')+('\x20\x20'+a140_0x28b79e[_0x1ff49f(0x1df)](_0x3bef23[_0x1ff49f(0x1b5)])+_0x1ff49f(0x19d)+_0x3bef23[_0x1ff49f(0x1ca)][_0x1ff49f(0x1b4)](',\x20'))),console[_0x1ff49f(0x16b)](_0x1ff49f(0x1cc))):console[_0x1ff49f(0x16b)](a140_0x28b79e[_0x1ff49f(0x1bc)](_0x1ff49f(0x191))+'\x20\x20'+a140_0x28b79e[_0x1ff49f(0x1a5)](_0x1ff49f(0x16f)));console[_0x1ff49f(0x16b)](''),console[_0x1ff49f(0x16b)](a140_0x28b79e['cyan'](_0x1ff49f(0x1d9))+('\x20\x20'+(_0x3b64f2?a140_0x28b79e['yellow'](_0x1ff49f(0x195)):a140_0x28b79e[_0x1ff49f(0x197)]('not\x20needed'))));_0x3b64f2&&console[_0x1ff49f(0x16b)](_0x1ff49f(0x169)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x1ff49f(0x16b)]('');if(_0x3deda1[_0x1ff49f(0x1a7)]){const {currentVersion:_0x1b9c55,field:_0x1e1651,pkgPath:_0x379226}=_0x3deda1['sdkUpgrade'];console[_0x1ff49f(0x16b)](a140_0x28b79e[_0x1ff49f(0x1bc)](_0x1ff49f(0x181))+('\x20\x20'+a140_0x28b79e[_0x1ff49f(0x1df)](_0x379226))),console['log']('\x20\x20Current\x20version\x20in\x20'+_0x1e1651+':\x20'+a140_0x28b79e['yellow'](_0x1b9c55)+_0x1ff49f(0x188)+a140_0x28b79e['green'](_0x1ff49f(0x1c2))),console[_0x1ff49f(0x16b)](_0x1ff49f(0x187));}else console['log'](a140_0x28b79e[_0x1ff49f(0x1bc)]('@lovrabet/sdk:')+'\x20\x20'+a140_0x28b79e[_0x1ff49f(0x1a5)]('not\x20found\x20or\x20already\x20at\x20latest'));console[_0x1ff49f(0x16b)]('');}function execConfigMigration(_0x3b8276,_0x51c58f){const _0x355a97=a140_0x5aeff0,{configMigration:_0x49cc29}=_0x3b8276;if(!_0x49cc29?.['oldPath'])return{'step':0x1,'label':_0x355a97(0x1c9),'ok':!![],'detail':_0x355a97(0x1a2)};const _0xbf0cdf=readConfigFile(_0x49cc29[_0x355a97(0x1d8)]),_0x2086da=resolve(_0x51c58f,NEW_CONFIG_NAME),_0x165bf9=_0x49cc29['hasNewConfig']?readConfigFile(_0x2086da):{};for(const [_0x4c875e,_0x124361]of Object[_0x355a97(0x18c)](_0xbf0cdf)){!(_0x4c875e in _0x165bf9)&&(_0x165bf9[_0x4c875e]=_0x124361);}writeConfigFile(_0x2086da,_0x165bf9);const _0x419c33=_0x49cc29['oldPath']+_0x355a97(0x19f);return renameSync(_0x49cc29['oldPath'],_0x419c33),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x49cc29['oldPath']+_0x355a97(0x188)+_0x2086da+'\x20(backup:\x20'+_0x419c33+')'};}function execRemoveOldArtifacts(_0x156958){const _0x2556e3=a140_0x5aeff0,_0x2fa7b8=[];for(const _0x4be492 of _0x156958){try{if(!existsSync(_0x4be492))continue;const _0x32ba31=tryStat(_0x4be492);_0x32ba31?.['isDirectory']()?rmSync(_0x4be492,{'recursive':!![],'force':!![]}):unlinkSync(_0x4be492);}catch(_0x492d1d){_0x2fa7b8[_0x2556e3(0x1e1)](_0x4be492+':\x20'+_0x492d1d[_0x2556e3(0x1c7)]);}}return{'step':0x3,'label':_0x2556e3(0x1c0),'ok':_0x2fa7b8[_0x2556e3(0x179)]===0x0,'detail':_0x2fa7b8[_0x2556e3(0x179)]>0x0?_0x156958[_0x2556e3(0x179)]-_0x2fa7b8[_0x2556e3(0x179)]+'/'+_0x156958[_0x2556e3(0x179)]+_0x2556e3(0x16c)+_0x2fa7b8[_0x2556e3(0x1b4)](';\x20')+')':_0x156958[_0x2556e3(0x179)]+_0x2556e3(0x1cf)};}function execCleanMcp(_0x1926f7){const _0x35b28a=a140_0x5aeff0;if(!_0x1926f7[_0x35b28a(0x1a0)])return{'step':0x4,'label':_0x35b28a(0x186),'ok':!![],'detail':_0x35b28a(0x171)};try{const _0x30046b=readFileSync(_0x1926f7[_0x35b28a(0x1a0)][_0x35b28a(0x1b5)],'utf8'),_0x47aa27=JSON[_0x35b28a(0x19c)](_0x30046b);if(_0x47aa27?.[_0x35b28a(0x1e3)]&&typeof _0x47aa27[_0x35b28a(0x1e3)]===_0x35b28a(0x1ac)){const _0x1ca15a=[];for(const [_0x1fbd8d,_0x49ee8d]of Object[_0x35b28a(0x18c)](_0x47aa27['mcpServers'])){_0x49ee8d?.[_0x35b28a(0x1ae)]&&Array['isArray'](_0x49ee8d['args'])&&_0x49ee8d[_0x35b28a(0x1ae)][_0x35b28a(0x17c)](_0x96d403=>typeof _0x96d403===_0x35b28a(0x1ce)&&_0x96d403['includes']('@lovrabet/dataset-mcp-server'))&&_0x1ca15a[_0x35b28a(0x1e1)](_0x1fbd8d);}for(const _0x3e41fd of _0x1ca15a){delete _0x47aa27[_0x35b28a(0x1e3)][_0x3e41fd];}return _0x1ca15a['length']>0x0&&writeFileSync(_0x1926f7[_0x35b28a(0x1a0)][_0x35b28a(0x1b5)],JSON[_0x35b28a(0x1dc)](_0x47aa27,null,0x2)+'\x0a',_0x35b28a(0x1bb)),{'step':0x4,'label':_0x35b28a(0x186),'ok':!![],'detail':_0x35b28a(0x1cd)+_0x1ca15a[_0x35b28a(0x1b4)](',\x20')+_0x35b28a(0x1d3)+_0x1926f7[_0x35b28a(0x1a0)][_0x35b28a(0x1b5)]};}return{'step':0x4,'label':_0x35b28a(0x186),'ok':!![],'detail':_0x35b28a(0x198)};}catch(_0x2b238d){return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':![],'detail':_0x2b238d[_0x35b28a(0x1c7)]};}}function a140_0x118a(){const _0x3e3324=['removed\x20','string','\x20removed','no\x20legacy\x20config\x20found','===\x20Upgrade\x20Summary\x20===','\x20\x20New\x20config\x20(.rabetbase.json):\x20','\x20from\x20','lovrabet/rabetbase','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','1176SOkQVB','[\x22@lovrabet/sdk\x22]:\x20','oldPath','Skill\x20swap:','values','configMigration','stringify','status','Install\x20new\x20skill','yellow','Step\x201/7:\x20Migrating\x20config...','push','CANCEL','mcpServers','1026486qBskox','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','1109060bakCgs','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','Step\x204/7:\x20MCP\x20config\x20—\x20','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','failed','log','\x20removed\x20(','Legacy\x20artifacts:','.cursor/rules/lovrabet_rules.mdc','no\x20legacy\x20entry','\x20\x20Action:\x20delete','skipped','detail','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','isArray','fail','lovrabet/rabetbase\x20installed\x20globally','devDependencies','length','fields','\x20→\x20latest','some','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','FAIL','Step\x206/7:\x20Installing\x20new\x20skill...','FOUND','@lovrabet/sdk:','needsSkillSwap','Step\x201/7:\x20Config\x20migration\x20—\x20','\x20\x20Fields\x20to\x20migrate:\x20','inherit','Clean\x20MCP\x20config','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','\x20→\x20','@lovrabet/sdk','Config\x20file:','already\x20exists\x20(will\x20merge)','entries','red','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','files','undefined','MCP\x20config:','1EmGwmX','Upgrade\x20cancelled.','Remove\x20old\x20skill','needed','6432888HxppFM','green','no\x20matching\x20entry\x20found','error','\x20\x20Step\x20','2859468PqJeMx','parse','\x20→\x20keys:\x20','Remove\x20.lovrabet/','.bak','oldMcpConfig','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','skipped\x20(no\x20legacy\x20config)','.cursor/mcp.json','not\x20found\x20(will\x20create)','gray','Upgrade\x20@lovrabet/sdk','sdkUpgrade','done','\x20\x20\x20\x20\x20\x20\x20','bold','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','object','1350762ihBOsZ','args','filter','includes','\x20\x20#\x20or','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','label','join','path','start','exit\x20','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','white','\x20\x20bun\x20install','utf8','cyan','10367gxsheK','oldArtifacts','step','Remove\x20legacy\x20artifacts','cwd','latest','2181268bDyToh','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','.claude/skills/lovrabet','succeed','message','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','Config\x20migration','keys','hasNewConfig','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server'];a140_0x118a=function(){return _0x3e3324;};return a140_0x118a();}function execSkillsRemove(_0x14b745,_0x4de5f6){const _0x40b339=a140_0x5aeff0,_0x4037d7=runNpxSkillsRemove(_0x14b745,{'stdio':_0x40b339(0x185),'yes':_0x4de5f6});return{'step':0x5,'label':_0x40b339(0x194),'ok':_0x4037d7['ok'],'detail':_0x4037d7['ok']?'lovrabet/lovrabet-skill\x20removed':_0x4037d7[_0x40b339(0x199)]??_0x40b339(0x1b7)+_0x4037d7[_0x40b339(0x1dd)]};}function execSkillsAdd(_0x1d9f7f,_0x3569ea){const _0x7a6620=a140_0x5aeff0,_0x51c842=runNpxSkillsAddGlobal(_0x1d9f7f,_0x7a6620(0x1d4),{'stdio':_0x7a6620(0x185),'yes':_0x3569ea});return{'step':0x6,'label':_0x7a6620(0x1de),'ok':_0x51c842['ok'],'detail':_0x51c842['ok']?_0x7a6620(0x177):_0x51c842[_0x7a6620(0x199)]??_0x7a6620(0x1b7)+_0x51c842[_0x7a6620(0x1dd)]};}function execUpgradeSdk(_0x5143d4){const _0x1d9c9c=a140_0x5aeff0;if(!_0x5143d4[_0x1d9c9c(0x1a7)])return{'step':0x7,'label':_0x1d9c9c(0x1a6),'ok':!![],'detail':_0x1d9c9c(0x173)};const {pkgPath:_0x116737,currentVersion:_0x5a1f29,field:_0x208e09}=_0x5143d4[_0x1d9c9c(0x1a7)];try{const _0x47f517=readFileSync(_0x116737,_0x1d9c9c(0x1bb)),_0x4d86f7=JSON[_0x1d9c9c(0x19c)](_0x47f517);return _0x4d86f7[_0x208e09][_0x1d9c9c(0x189)]=_0x1d9c9c(0x1c2),writeFileSync(_0x116737,JSON['stringify'](_0x4d86f7,null,0x2)+'\x0a','utf8'),{'step':0x7,'label':_0x1d9c9c(0x1a6),'ok':!![],'detail':_0x208e09+_0x1d9c9c(0x1d7)+_0x5a1f29+_0x1d9c9c(0x17b)};}catch(_0x198941){return{'step':0x7,'label':_0x1d9c9c(0x1a6),'ok':![],'detail':_0x198941['message']};}}function tryStat(_0x2c9f8c){try{return statSync(_0x2c9f8c);}catch{return undefined;}}function printSummary(_0xa5d213){const _0x117f02=a140_0x5aeff0;console[_0x117f02(0x16b)](''),console['log'](a140_0x28b79e[_0x117f02(0x1aa)](_0x117f02(0x1d1))),console['log']('');for(const _0x2ab65d of _0xa5d213){const _0x3fa695=_0x2ab65d['ok']?a140_0x28b79e[_0x117f02(0x197)]('OK'):a140_0x28b79e[_0x117f02(0x18d)](_0x117f02(0x17e));console[_0x117f02(0x16b)]('\x20\x20'+_0x3fa695+_0x117f02(0x19a)+_0x2ab65d[_0x117f02(0x1bf)]+':\x20'+_0x2ab65d[_0x117f02(0x1b3)]);if(_0x2ab65d['detail'])console[_0x117f02(0x16b)](_0x117f02(0x1a9)+a140_0x28b79e[_0x117f02(0x1a5)](_0x2ab65d['detail']));}console[_0x117f02(0x16b)]('');}export async function upgradeApp(_0x50043c,_0x25c346){const _0x459b10=a140_0x5aeff0,_0x46360a=process[_0x459b10(0x1c1)](),_0x36dc38=analyse(_0x46360a),_0x4cbacf=!_0x36dc38[_0x459b10(0x1db)]&&_0x36dc38[_0x459b10(0x1be)][_0x459b10(0x179)]===0x0&&!_0x36dc38[_0x459b10(0x1a0)]&&!_0x36dc38[_0x459b10(0x182)]&&!_0x36dc38[_0x459b10(0x1a7)];if(_0x4cbacf){console[_0x459b10(0x16b)](a140_0x28b79e[_0x459b10(0x197)](_0x459b10(0x1c4)));return;}printReport(_0x36dc38);const _0x596d45=!!(_0x25c346['yes']||_0x25c346['Y']||_0x50043c);if(!_0x596d45)try{const _0x202814=await askConfirm('Proceed\x20with\x20upgrade?');if(!_0x202814){console['log'](a140_0x28b79e[_0x459b10(0x1a5)](_0x459b10(0x193)));return;}}catch(_0x53c1c4){if(_0x53c1c4?.['message']===_0x459b10(0x1e2)){console[_0x459b10(0x16b)](a140_0x28b79e[_0x459b10(0x1a5)](_0x459b10(0x193)));return;}throw _0x53c1c4;}const _0x29d2aa=[],_0x43ac9b=a140_0x17babd({'text':_0x459b10(0x1e0),'color':'cyan'})['start'](),_0x327e4e=execConfigMigration(_0x36dc38,_0x46360a);_0x29d2aa['push'](_0x327e4e),_0x43ac9b[_0x327e4e['ok']?_0x459b10(0x1c6):_0x459b10(0x176)](_0x459b10(0x183)+(_0x327e4e[_0x459b10(0x172)]??(_0x327e4e['ok']?'done':_0x459b10(0x16a))));const _0x1f75a9=resolve(_0x46360a,'.lovrabet'),_0x215ad0=a140_0x17babd({'text':_0x459b10(0x1b8),'color':_0x459b10(0x1bc)})[_0x459b10(0x1b6)]();if(existsSync(_0x1f75a9))try{rmSync(_0x1f75a9,{'recursive':!![],'force':!![]}),_0x215ad0[_0x459b10(0x1c6)]('Step\x202/7:\x20.lovrabet/\x20directory\x20removed'),_0x29d2aa[_0x459b10(0x1e1)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x2e42e9){_0x215ad0[_0x459b10(0x176)](_0x459b10(0x1d5)+_0x2e42e9[_0x459b10(0x1c7)]),_0x29d2aa[_0x459b10(0x1e1)]({'step':0x2,'label':_0x459b10(0x19e),'ok':![],'detail':_0x2e42e9[_0x459b10(0x1c7)]});}else _0x215ad0['info'](_0x459b10(0x18e)),_0x29d2aa[_0x459b10(0x1e1)]({'step':0x2,'label':_0x459b10(0x19e),'ok':!![],'detail':_0x459b10(0x171)});const _0x4063bb=a140_0x17babd({'text':'Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':_0x459b10(0x1bc)})[_0x459b10(0x1b6)](),_0x457e11=execRemoveOldArtifacts(_0x36dc38[_0x459b10(0x1be)]);_0x29d2aa[_0x459b10(0x1e1)](_0x457e11),_0x4063bb[_0x457e11['ok']?'succeed':'fail'](_0x459b10(0x1a1)+(_0x457e11[_0x459b10(0x172)]??(_0x457e11['ok']?_0x459b10(0x1a8):_0x459b10(0x16a))));const _0x49e206=a140_0x17babd({'text':'Step\x204/7:\x20Cleaning\x20MCP\x20config...','color':'cyan'})[_0x459b10(0x1b6)](),_0x3c057a=execCleanMcp(_0x36dc38);_0x29d2aa['push'](_0x3c057a),_0x49e206[_0x3c057a['ok']?_0x459b10(0x1c6):_0x459b10(0x176)](_0x459b10(0x167)+(_0x3c057a[_0x459b10(0x172)]??(_0x3c057a['ok']?'done':_0x459b10(0x16a))));const _0x1c04b0=a140_0x17babd({'text':'Step\x205/7:\x20Removing\x20old\x20skill...','color':_0x459b10(0x1bc)})[_0x459b10(0x1b6)](),_0x513bd3=execSkillsRemove(_0x46360a,_0x596d45);_0x29d2aa[_0x459b10(0x1e1)](_0x513bd3),_0x1c04b0[_0x513bd3['ok']?_0x459b10(0x1c6):_0x459b10(0x176)](_0x459b10(0x1c8)+(_0x513bd3['detail']??(_0x513bd3['ok']?_0x459b10(0x1a8):_0x459b10(0x16a))));const _0x58195f=a140_0x17babd({'text':_0x459b10(0x17f),'color':_0x459b10(0x1bc)})[_0x459b10(0x1b6)](),_0x32bbd9=execSkillsAdd(_0x46360a,_0x596d45);_0x29d2aa[_0x459b10(0x1e1)](_0x32bbd9),_0x58195f[_0x32bbd9['ok']?_0x459b10(0x1c6):'fail'](_0x459b10(0x166)+(_0x32bbd9[_0x459b10(0x172)]??(_0x32bbd9['ok']?_0x459b10(0x1a8):_0x459b10(0x16a))));const _0x83a4bc=a140_0x17babd({'text':_0x459b10(0x17d),'color':_0x459b10(0x1bc)})['start'](),_0x3c6754=execUpgradeSdk(_0x36dc38);_0x29d2aa['push'](_0x3c6754),_0x83a4bc[_0x3c6754['ok']?_0x459b10(0x1c6):_0x459b10(0x176)](_0x459b10(0x1ab)+(_0x3c6754['detail']??(_0x3c6754['ok']?_0x459b10(0x1a8):_0x459b10(0x16a)))),printSummary(_0x29d2aa);const _0x58e8b0=_0x29d2aa[_0x459b10(0x17c)](_0x5c61ea=>!_0x5c61ea['ok']);_0x58e8b0?console[_0x459b10(0x16b)](a140_0x28b79e['yellow'](_0x459b10(0x168))):console['log'](a140_0x28b79e[_0x459b10(0x197)]('Upgrade\x20completed\x20successfully!')),_0x3c6754['ok']&&_0x36dc38[_0x459b10(0x1a7)]&&(console['log'](''),console[_0x459b10(0x16b)](a140_0x28b79e['bold'][_0x459b10(0x1bc)](_0x459b10(0x174))),console[_0x459b10(0x16b)](a140_0x28b79e[_0x459b10(0x1bc)](_0x459b10(0x1b2))),console[_0x459b10(0x16b)](''),console[_0x459b10(0x16b)](a140_0x28b79e[_0x459b10(0x1b9)]('\x20\x20npm\x20install')),console['log'](a140_0x28b79e[_0x459b10(0x1b9)](_0x459b10(0x1b1))),console[_0x459b10(0x16b)](a140_0x28b79e[_0x459b10(0x1b9)](_0x459b10(0x1ba))),console[_0x459b10(0x16b)](''));}
1
+ (function(_0x33016d,_0x50c198){const _0x2c24d2=a140_0x23e8,_0x3fd575=_0x33016d();while(!![]){try{const _0xdf38c7=parseInt(_0x2c24d2(0x249))/0x1+-parseInt(_0x2c24d2(0x219))/0x2*(parseInt(_0x2c24d2(0x224))/0x3)+-parseInt(_0x2c24d2(0x1d0))/0x4*(-parseInt(_0x2c24d2(0x1d7))/0x5)+parseInt(_0x2c24d2(0x244))/0x6*(-parseInt(_0x2c24d2(0x24c))/0x7)+-parseInt(_0x2c24d2(0x1cd))/0x8*(parseInt(_0x2c24d2(0x24a))/0x9)+parseInt(_0x2c24d2(0x1d5))/0xa+-parseInt(_0x2c24d2(0x237))/0xb;if(_0xdf38c7===_0x50c198)break;else _0x3fd575['push'](_0x3fd575['shift']());}catch(_0x54a45d){_0x3fd575['push'](_0x3fd575['shift']());}}}(a140_0x7fb3,0xb0100));import a140_0x19e11d from'chalk';import a140_0x41f9d9 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';function a140_0x23e8(_0x7c36a7,_0x174bda){_0x7c36a7=_0x7c36a7-0x1cb;const _0x7fb318=a140_0x7fb3();let _0x23e81d=_0x7fb318[_0x7c36a7];return _0x23e81d;}import{resolve}from'node:path';import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';function a140_0x7fb3(){const _0x3c5d6d=['red','.cursor/rules/lovrabet_rules.mdc','===\x20Upgrade\x20Analysis\x20===','\x20\x20New\x20config\x20(.rabetbase.json):\x20','yellow','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','Remove\x20legacy\x20artifacts','Clean\x20MCP\x20config','1469061GOUMgJ','dependencies','args','green','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','\x20\x20bun\x20install','CANCEL','.claude/skills/lovrabet','Config\x20migration','message','\x20from\x20','isDirectory','detail','66GUhMqU','Skill\x20swap:','utf8','succeed','fail','690668APMnpT','3807774NliDTu','removed\x20','453467khVniC','undefined','isArray','8lxCEZX','Upgrade\x20@lovrabet/sdk','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','1348eZBRxz','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','push','Proceed\x20with\x20upgrade?','package.json','5607490sdbhXa','done','14390VBzBbI','object','white','@lovrabet/sdk','.lovrabet','skipped','no\x20legacy\x20config\x20found','\x20→\x20latest','sdkUpgrade','no\x20matching\x20entry\x20found','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','hasNewConfig','stringify','Upgrade\x20cancelled.','lovrabet/rabetbase','@lovrabet/dataset-mcp-server','oldPath','[\x22@lovrabet/sdk\x22]:\x20','Step\x206/7:\x20Installing\x20new\x20skill...','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','entries','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','yes','devDependencies','Upgrade\x20completed\x20successfully!','join','step','.cursor/mcp.json','Config\x20file:','.bak','path','exit\x20','Step\x201/7:\x20Migrating\x20config...','fields','\x20\x20Fields\x20to\x20migrate:\x20','cwd','files','Legacy\x20artifacts:','log','oldArtifacts','\x20→\x20keys:\x20','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','Step\x201/7:\x20Config\x20migration\x20—\x20','string','Step\x205/7:\x20Removing\x20old\x20skill...','MCP\x20config:','length','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','\x20\x20\x20\x20\x20\x20\x20','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','Step\x204/7:\x20Cleaning\x20MCP\x20config...','FAIL','latest','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','mcpServers','already\x20exists\x20(will\x20merge)','\x20→\x20','FOUND','parse','not\x20found\x20(will\x20create)','cyan','\x20\x20Step\x20','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','skipped\x20(no\x20legacy\x20config)','bold','values','22atIjfC','includes','gray','\x20(backup:\x20','not\x20needed','not\x20found\x20or\x20already\x20at\x20latest','start','inherit','Remove\x20.lovrabet/','configMigration','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','62979rHOCSF','keys','some','error','no\x20legacy\x20entry','status','filter','failed','oldMcpConfig','@lovrabet/sdk:','\x20removed'];a140_0x7fb3=function(){return _0x3c5d6d;};return a140_0x7fb3();}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['filter'](_0x4ded2e=>_0x4ded2e!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x146b43){const _0x3b1055=a140_0x23e8,_0x419c78=[];for(const _0x5b1ffc of Object[_0x3b1055(0x218)](CORE_IDE_CONFIGS)){if(_0x5b1ffc['files'])for(const _0xb7f45e of _0x5b1ffc[_0x3b1055(0x1fb)]){_0x419c78['push'](resolve(_0x146b43,_0xb7f45e[_0x3b1055(0x1f5)]));}}return _0x419c78;}function analyse(_0x4c8582){const _0xd9fad3=a140_0x23e8;let _0x13eecc=null;const _0x4919fd=resolve(_0x4c8582,NEW_CONFIG_NAME),_0x594446=existsSync(_0x4919fd);for(const _0x710718 of LEGACY_CONFIG_NAMES){const _0x389059=resolve(_0x4c8582,_0x710718);if(existsSync(_0x389059)){const _0x4b1299=readConfigFile(_0x389059),_0x16b73f=Object[_0xd9fad3(0x225)](_0x4b1299)[_0xd9fad3(0x22a)](_0x141db0=>typeof _0x4b1299[_0x141db0]!==_0xd9fad3(0x1cb));_0x13eecc={'oldPath':_0x389059,'hasNewConfig':_0x594446,'fields':_0x16b73f};break;}}const _0x57a321=[],_0xafe141=resolve(_0x4c8582,_0xd9fad3(0x1db));if(existsSync(_0xafe141))_0x57a321[_0xd9fad3(0x1d2)](_0xafe141);const _0x39198a=resolve(_0x4c8582,_0xd9fad3(0x230));if(existsSync(_0x39198a))_0x57a321['push'](_0x39198a);const _0x4642ca=resolve(_0x4c8582,_0xd9fad3(0x23e));if(existsSync(_0x4642ca))_0x57a321[_0xd9fad3(0x1d2)](_0x4642ca);for(const _0x560d35 of collectIdeSkillFiles(_0x4c8582)){if(existsSync(_0x560d35))_0x57a321[_0xd9fad3(0x1d2)](_0x560d35);}let _0xf12f41=null;const _0x3886ee=resolve(_0x4c8582,_0xd9fad3(0x1f2));if(existsSync(_0x3886ee))try{const _0x166800=JSON[_0xd9fad3(0x211)](readFileSync(_0x3886ee,'utf8'));if(_0x166800?.[_0xd9fad3(0x20d)]&&typeof _0x166800[_0xd9fad3(0x20d)]==='object'){const _0x2871fd=[];for(const [_0x43f840,_0xba7180]of Object['entries'](_0x166800[_0xd9fad3(0x20d)])){const _0x20b205=_0xba7180;_0x20b205?.[_0xd9fad3(0x239)]&&Array['isArray'](_0x20b205['args'])&&_0x20b205[_0xd9fad3(0x239)][_0xd9fad3(0x226)](_0x12daff=>typeof _0x12daff==='string'&&_0x12daff[_0xd9fad3(0x21a)](_0xd9fad3(0x1e6)))&&_0x2871fd[_0xd9fad3(0x1d2)](_0x43f840);}_0x2871fd[_0xd9fad3(0x205)]>0x0&&(_0xf12f41={'path':_0x3886ee,'keys':_0x2871fd});}}catch{}const _0x4fbb2b=_0x57a321[_0xd9fad3(0x205)]>0x0||_0x13eecc!==null;let _0x4148b2=null;const _0x3e148c=resolve(_0x4c8582,_0xd9fad3(0x1d4));if(existsSync(_0x3e148c))try{const _0x5c8d09=JSON[_0xd9fad3(0x211)](readFileSync(_0x3e148c,_0xd9fad3(0x246)));for(const _0x25e000 of[_0xd9fad3(0x238),_0xd9fad3(0x1ee)]){const _0x5564cf=_0x5c8d09?.[_0x25e000]?.[_0xd9fad3(0x1da)];if(typeof _0x5564cf===_0xd9fad3(0x202)){_0x5564cf!=='latest'&&(_0x4148b2={'pkgPath':_0x3e148c,'currentVersion':_0x5564cf,'field':_0x25e000});break;}}}catch{}return{'configMigration':_0x13eecc,'oldArtifacts':_0x57a321,'oldMcpConfig':_0xf12f41,'needsSkillSwap':_0x4fbb2b,'sdkUpgrade':_0x4148b2};}function printReport(_0x2a7465){const _0x3e03d9=a140_0x23e8,{configMigration:_0x51c56e,oldArtifacts:_0x584bba,oldMcpConfig:_0x32dce5,needsSkillSwap:_0xa1099}=_0x2a7465;console['log'](''),console[_0x3e03d9(0x1fd)](a140_0x19e11d[_0x3e03d9(0x217)](_0x3e03d9(0x231))),console[_0x3e03d9(0x1fd)]('');_0x51c56e?(console[_0x3e03d9(0x1fd)](a140_0x19e11d[_0x3e03d9(0x213)](_0x3e03d9(0x1f3))+('\x20\x20'+a140_0x19e11d[_0x3e03d9(0x233)](_0x51c56e[_0x3e03d9(0x1e7)]))),console[_0x3e03d9(0x1fd)](_0x3e03d9(0x232)+(_0x51c56e['hasNewConfig']?a140_0x19e11d[_0x3e03d9(0x23a)](_0x3e03d9(0x20e)):a140_0x19e11d[_0x3e03d9(0x21b)](_0x3e03d9(0x212)))),console[_0x3e03d9(0x1fd)](_0x3e03d9(0x1f9)+_0x51c56e[_0x3e03d9(0x1f8)]['join'](',\x20')),console[_0x3e03d9(0x1fd)](_0x3e03d9(0x208))):console[_0x3e03d9(0x1fd)](a140_0x19e11d[_0x3e03d9(0x213)]('Config\x20file:')+'\x20\x20'+a140_0x19e11d[_0x3e03d9(0x21b)](_0x3e03d9(0x1dd)));console[_0x3e03d9(0x1fd)]('');if(_0x584bba[_0x3e03d9(0x205)]>0x0){console[_0x3e03d9(0x1fd)](a140_0x19e11d[_0x3e03d9(0x213)](_0x3e03d9(0x1fc)));for(const _0x5cfba7 of _0x584bba){console[_0x3e03d9(0x1fd)]('\x20\x20'+a140_0x19e11d[_0x3e03d9(0x22f)](_0x3e03d9(0x210))+'\x20\x20'+_0x5cfba7);}console[_0x3e03d9(0x1fd)]('\x20\x20Action:\x20delete');}else console[_0x3e03d9(0x1fd)](a140_0x19e11d[_0x3e03d9(0x213)]('Legacy\x20artifacts:')+'\x20\x20'+a140_0x19e11d[_0x3e03d9(0x21b)]('none\x20found'));console['log']('');_0x32dce5?(console[_0x3e03d9(0x1fd)](a140_0x19e11d[_0x3e03d9(0x213)](_0x3e03d9(0x204))+('\x20\x20'+a140_0x19e11d[_0x3e03d9(0x233)](_0x32dce5['path'])+_0x3e03d9(0x1ff)+_0x32dce5['keys']['join'](',\x20'))),console['log']('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console[_0x3e03d9(0x1fd)](a140_0x19e11d['cyan'](_0x3e03d9(0x204))+'\x20\x20'+a140_0x19e11d[_0x3e03d9(0x21b)](_0x3e03d9(0x228)));console[_0x3e03d9(0x1fd)](''),console[_0x3e03d9(0x1fd)](a140_0x19e11d[_0x3e03d9(0x213)](_0x3e03d9(0x245))+('\x20\x20'+(_0xa1099?a140_0x19e11d[_0x3e03d9(0x233)]('needed'):a140_0x19e11d['green'](_0x3e03d9(0x21d)))));_0xa1099&&console['log'](_0x3e03d9(0x20c)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x3e03d9(0x1fd)]('');if(_0x2a7465[_0x3e03d9(0x1df)]){const {currentVersion:_0x310597,field:_0x1cc4ce,pkgPath:_0x1d3aec}=_0x2a7465[_0x3e03d9(0x1df)];console[_0x3e03d9(0x1fd)](a140_0x19e11d['cyan'](_0x3e03d9(0x22d))+('\x20\x20'+a140_0x19e11d[_0x3e03d9(0x233)](_0x1d3aec))),console[_0x3e03d9(0x1fd)]('\x20\x20Current\x20version\x20in\x20'+_0x1cc4ce+':\x20'+a140_0x19e11d['yellow'](_0x310597)+_0x3e03d9(0x20f)+a140_0x19e11d[_0x3e03d9(0x23a)](_0x3e03d9(0x20b))),console['log'](_0x3e03d9(0x23b));}else console[_0x3e03d9(0x1fd)](a140_0x19e11d[_0x3e03d9(0x213)](_0x3e03d9(0x22d))+'\x20\x20'+a140_0x19e11d[_0x3e03d9(0x21b)](_0x3e03d9(0x21e)));console[_0x3e03d9(0x1fd)]('');}function execConfigMigration(_0x3bc306,_0x496cc4){const _0x2cf3ef=a140_0x23e8,{configMigration:_0x2a4537}=_0x3bc306;if(!_0x2a4537?.['oldPath'])return{'step':0x1,'label':_0x2cf3ef(0x23f),'ok':!![],'detail':_0x2cf3ef(0x216)};const _0x836a65=readConfigFile(_0x2a4537[_0x2cf3ef(0x1e7)]),_0x5e2fee=resolve(_0x496cc4,NEW_CONFIG_NAME),_0x1ad41d=_0x2a4537[_0x2cf3ef(0x1e2)]?readConfigFile(_0x5e2fee):{};for(const [_0x5a4f80,_0x5ae6e7]of Object[_0x2cf3ef(0x1eb)](_0x836a65)){!(_0x5a4f80 in _0x1ad41d)&&(_0x1ad41d[_0x5a4f80]=_0x5ae6e7);}writeConfigFile(_0x5e2fee,_0x1ad41d);const _0x95899a=_0x2a4537[_0x2cf3ef(0x1e7)]+_0x2cf3ef(0x1f4);return renameSync(_0x2a4537['oldPath'],_0x95899a),{'step':0x1,'label':_0x2cf3ef(0x23f),'ok':!![],'detail':_0x2a4537['oldPath']+_0x2cf3ef(0x20f)+_0x5e2fee+_0x2cf3ef(0x21c)+_0x95899a+')'};}function execRemoveOldArtifacts(_0x431f74){const _0x2b4e48=a140_0x23e8,_0xcfb92c=[];for(const _0x187c9f of _0x431f74){try{if(!existsSync(_0x187c9f))continue;const _0x49143d=tryStat(_0x187c9f);_0x49143d?.[_0x2b4e48(0x242)]()?rmSync(_0x187c9f,{'recursive':!![],'force':!![]}):unlinkSync(_0x187c9f);}catch(_0x57d1b9){_0xcfb92c[_0x2b4e48(0x1d2)](_0x187c9f+':\x20'+_0x57d1b9['message']);}}return{'step':0x3,'label':_0x2b4e48(0x235),'ok':_0xcfb92c[_0x2b4e48(0x205)]===0x0,'detail':_0xcfb92c['length']>0x0?_0x431f74[_0x2b4e48(0x205)]-_0xcfb92c[_0x2b4e48(0x205)]+'/'+_0x431f74[_0x2b4e48(0x205)]+'\x20removed\x20('+_0xcfb92c[_0x2b4e48(0x1f0)](';\x20')+')':_0x431f74['length']+_0x2b4e48(0x22e)};}function execCleanMcp(_0x4c92fa){const _0x5cd3b1=a140_0x23e8;if(!_0x4c92fa[_0x5cd3b1(0x22c)])return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x5cd3b1(0x1dc)};try{const _0x4a6720=readFileSync(_0x4c92fa[_0x5cd3b1(0x22c)][_0x5cd3b1(0x1f5)],_0x5cd3b1(0x246)),_0x509245=JSON['parse'](_0x4a6720);if(_0x509245?.[_0x5cd3b1(0x20d)]&&typeof _0x509245['mcpServers']===_0x5cd3b1(0x1d8)){const _0x14358a=[];for(const [_0x55867a,_0x163ee2]of Object[_0x5cd3b1(0x1eb)](_0x509245[_0x5cd3b1(0x20d)])){_0x163ee2?.['args']&&Array[_0x5cd3b1(0x1cc)](_0x163ee2[_0x5cd3b1(0x239)])&&_0x163ee2[_0x5cd3b1(0x239)]['some'](_0xb51449=>typeof _0xb51449==='string'&&_0xb51449[_0x5cd3b1(0x21a)]('@lovrabet/dataset-mcp-server'))&&_0x14358a[_0x5cd3b1(0x1d2)](_0x55867a);}for(const _0x1ec4f6 of _0x14358a){delete _0x509245[_0x5cd3b1(0x20d)][_0x1ec4f6];}return _0x14358a['length']>0x0&&writeFileSync(_0x4c92fa['oldMcpConfig'][_0x5cd3b1(0x1f5)],JSON[_0x5cd3b1(0x1e3)](_0x509245,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x5cd3b1(0x24b)+_0x14358a[_0x5cd3b1(0x1f0)](',\x20')+_0x5cd3b1(0x241)+_0x4c92fa[_0x5cd3b1(0x22c)][_0x5cd3b1(0x1f5)]};}return{'step':0x4,'label':_0x5cd3b1(0x236),'ok':!![],'detail':_0x5cd3b1(0x1e0)};}catch(_0x2f0f52){return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':![],'detail':_0x2f0f52[_0x5cd3b1(0x240)]};}}function execSkillsRemove(_0x1ae4ae,_0x371603){const _0x248b80=a140_0x23e8,_0x1dd2b2=runNpxSkillsRemove(_0x1ae4ae,{'stdio':_0x248b80(0x220),'yes':_0x371603});return{'step':0x5,'label':'Remove\x20old\x20skill','ok':_0x1dd2b2['ok'],'detail':_0x1dd2b2['ok']?'lovrabet/lovrabet-skill\x20removed':_0x1dd2b2[_0x248b80(0x227)]??_0x248b80(0x1f6)+_0x1dd2b2[_0x248b80(0x229)]};}function execSkillsAdd(_0x3aaf58,_0x5223f8){const _0x26e9f2=a140_0x23e8,_0x2826eb=runNpxSkillsAddGlobal(_0x3aaf58,_0x26e9f2(0x1e5),{'stdio':_0x26e9f2(0x220),'yes':_0x5223f8});return{'step':0x6,'label':'Install\x20new\x20skill','ok':_0x2826eb['ok'],'detail':_0x2826eb['ok']?'lovrabet/rabetbase\x20installed\x20globally':_0x2826eb[_0x26e9f2(0x227)]??_0x26e9f2(0x1f6)+_0x2826eb[_0x26e9f2(0x229)]};}function execUpgradeSdk(_0x41602e){const _0x3702c6=a140_0x23e8;if(!_0x41602e[_0x3702c6(0x1df)])return{'step':0x7,'label':_0x3702c6(0x1ce),'ok':!![],'detail':_0x3702c6(0x1ec)};const {pkgPath:_0x19552e,currentVersion:_0xfe9d86,field:_0xb54a66}=_0x41602e[_0x3702c6(0x1df)];try{const _0x24ce78=readFileSync(_0x19552e,_0x3702c6(0x246)),_0x42efc4=JSON['parse'](_0x24ce78);return _0x42efc4[_0xb54a66][_0x3702c6(0x1da)]=_0x3702c6(0x20b),writeFileSync(_0x19552e,JSON[_0x3702c6(0x1e3)](_0x42efc4,null,0x2)+'\x0a',_0x3702c6(0x246)),{'step':0x7,'label':_0x3702c6(0x1ce),'ok':!![],'detail':_0xb54a66+_0x3702c6(0x1e8)+_0xfe9d86+_0x3702c6(0x1de)};}catch(_0x398f7e){return{'step':0x7,'label':_0x3702c6(0x1ce),'ok':![],'detail':_0x398f7e[_0x3702c6(0x240)]};}}function tryStat(_0x35f0fa){try{return statSync(_0x35f0fa);}catch{return undefined;}}function printSummary(_0x15ab1a){const _0x27110f=a140_0x23e8;console[_0x27110f(0x1fd)](''),console[_0x27110f(0x1fd)](a140_0x19e11d[_0x27110f(0x217)]('===\x20Upgrade\x20Summary\x20===')),console['log']('');for(const _0x252be8 of _0x15ab1a){const _0x4add7c=_0x252be8['ok']?a140_0x19e11d[_0x27110f(0x23a)]('OK'):a140_0x19e11d[_0x27110f(0x22f)](_0x27110f(0x20a));console[_0x27110f(0x1fd)]('\x20\x20'+_0x4add7c+_0x27110f(0x214)+_0x252be8[_0x27110f(0x1f1)]+':\x20'+_0x252be8['label']);if(_0x252be8[_0x27110f(0x243)])console[_0x27110f(0x1fd)](_0x27110f(0x207)+a140_0x19e11d[_0x27110f(0x21b)](_0x252be8[_0x27110f(0x243)]));}console[_0x27110f(0x1fd)]('');}export async function upgradeApp(_0x506b5f,_0x410882){const _0x44cb40=a140_0x23e8,_0xfe0cc=process[_0x44cb40(0x1fa)](),_0x3b9cf6=analyse(_0xfe0cc),_0x537e51=!_0x3b9cf6[_0x44cb40(0x222)]&&_0x3b9cf6[_0x44cb40(0x1fe)][_0x44cb40(0x205)]===0x0&&!_0x3b9cf6[_0x44cb40(0x22c)]&&!_0x3b9cf6['needsSkillSwap']&&!_0x3b9cf6[_0x44cb40(0x1df)];if(_0x537e51){console[_0x44cb40(0x1fd)](a140_0x19e11d[_0x44cb40(0x23a)](_0x44cb40(0x1ea)));return;}printReport(_0x3b9cf6);const _0x26e395=!!(_0x410882[_0x44cb40(0x1ed)]||_0x410882['Y']||_0x506b5f);if(!_0x26e395)try{const _0x503bf7=await askConfirm(_0x44cb40(0x1d3));if(!_0x503bf7){console[_0x44cb40(0x1fd)](a140_0x19e11d[_0x44cb40(0x21b)](_0x44cb40(0x1e4)));return;}}catch(_0x5d9dcd){if(_0x5d9dcd?.[_0x44cb40(0x240)]===_0x44cb40(0x23d)){console[_0x44cb40(0x1fd)](a140_0x19e11d[_0x44cb40(0x21b)](_0x44cb40(0x1e4)));return;}throw _0x5d9dcd;}const _0x19a918=[],_0x298a11=a140_0x41f9d9({'text':_0x44cb40(0x1f7),'color':_0x44cb40(0x213)})['start'](),_0xc64fb0=execConfigMigration(_0x3b9cf6,_0xfe0cc);_0x19a918[_0x44cb40(0x1d2)](_0xc64fb0),_0x298a11[_0xc64fb0['ok']?_0x44cb40(0x247):_0x44cb40(0x248)](_0x44cb40(0x201)+(_0xc64fb0[_0x44cb40(0x243)]??(_0xc64fb0['ok']?'done':_0x44cb40(0x22b))));const _0x2e5cbe=resolve(_0xfe0cc,_0x44cb40(0x1db)),_0x190463=a140_0x41f9d9({'text':'Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','color':'cyan'})['start']();if(existsSync(_0x2e5cbe))try{rmSync(_0x2e5cbe,{'recursive':!![],'force':!![]}),_0x190463['succeed'](_0x44cb40(0x234)),_0x19a918[_0x44cb40(0x1d2)]({'step':0x2,'label':_0x44cb40(0x221),'ok':!![]});}catch(_0x15f58b){_0x190463['fail'](_0x44cb40(0x1cf)+_0x15f58b[_0x44cb40(0x240)]),_0x19a918[_0x44cb40(0x1d2)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':![],'detail':_0x15f58b[_0x44cb40(0x240)]});}else _0x190463['info'](_0x44cb40(0x1e1)),_0x19a918[_0x44cb40(0x1d2)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![],'detail':_0x44cb40(0x1dc)});const _0xb1b021=a140_0x41f9d9({'text':'Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':_0x44cb40(0x213)})[_0x44cb40(0x21f)](),_0x5ab34f=execRemoveOldArtifacts(_0x3b9cf6[_0x44cb40(0x1fe)]);_0x19a918[_0x44cb40(0x1d2)](_0x5ab34f),_0xb1b021[_0x5ab34f['ok']?_0x44cb40(0x247):_0x44cb40(0x248)](_0x44cb40(0x215)+(_0x5ab34f['detail']??(_0x5ab34f['ok']?'done':_0x44cb40(0x22b))));const _0x2e424f=a140_0x41f9d9({'text':_0x44cb40(0x209),'color':_0x44cb40(0x213)})[_0x44cb40(0x21f)](),_0x4b7d9c=execCleanMcp(_0x3b9cf6);_0x19a918['push'](_0x4b7d9c),_0x2e424f[_0x4b7d9c['ok']?_0x44cb40(0x247):_0x44cb40(0x248)]('Step\x204/7:\x20MCP\x20config\x20—\x20'+(_0x4b7d9c['detail']??(_0x4b7d9c['ok']?_0x44cb40(0x1d6):_0x44cb40(0x22b))));const _0xbb9ebd=a140_0x41f9d9({'text':_0x44cb40(0x203),'color':_0x44cb40(0x213)})[_0x44cb40(0x21f)](),_0x347482=execSkillsRemove(_0xfe0cc,_0x26e395);_0x19a918['push'](_0x347482),_0xbb9ebd[_0x347482['ok']?'succeed':_0x44cb40(0x248)]('Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20'+(_0x347482[_0x44cb40(0x243)]??(_0x347482['ok']?'done':_0x44cb40(0x22b))));const _0x281278=a140_0x41f9d9({'text':_0x44cb40(0x1e9),'color':_0x44cb40(0x213)})[_0x44cb40(0x21f)](),_0x533115=execSkillsAdd(_0xfe0cc,_0x26e395);_0x19a918[_0x44cb40(0x1d2)](_0x533115),_0x281278[_0x533115['ok']?'succeed':_0x44cb40(0x248)](_0x44cb40(0x200)+(_0x533115[_0x44cb40(0x243)]??(_0x533115['ok']?_0x44cb40(0x1d6):'failed')));const _0x176fd7=a140_0x41f9d9({'text':_0x44cb40(0x1d1),'color':'cyan'})[_0x44cb40(0x21f)](),_0x57398c=execUpgradeSdk(_0x3b9cf6);_0x19a918[_0x44cb40(0x1d2)](_0x57398c),_0x176fd7[_0x57398c['ok']?'succeed':'fail'](_0x44cb40(0x223)+(_0x57398c[_0x44cb40(0x243)]??(_0x57398c['ok']?_0x44cb40(0x1d6):'failed'))),printSummary(_0x19a918);const _0x192b9d=_0x19a918['some'](_0x44ac00=>!_0x44ac00['ok']);_0x192b9d?console[_0x44cb40(0x1fd)](a140_0x19e11d[_0x44cb40(0x233)](_0x44cb40(0x206))):console[_0x44cb40(0x1fd)](a140_0x19e11d['green'](_0x44cb40(0x1ef))),_0x57398c['ok']&&_0x3b9cf6[_0x44cb40(0x1df)]&&(console[_0x44cb40(0x1fd)](''),console[_0x44cb40(0x1fd)](a140_0x19e11d[_0x44cb40(0x217)][_0x44cb40(0x213)]('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console[_0x44cb40(0x1fd)](a140_0x19e11d['cyan']('Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:')),console[_0x44cb40(0x1fd)](''),console['log'](a140_0x19e11d['white']('\x20\x20npm\x20install')),console[_0x44cb40(0x1fd)](a140_0x19e11d['white']('\x20\x20#\x20or')),console['log'](a140_0x19e11d[_0x44cb40(0x1d9)](_0x44cb40(0x23c))),console['log'](''));}