@lovrabet/rabetbase-cli 2.0.6 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) 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/logout.js +1 -1
  11. package/lib/cli-flags.js +1 -1
  12. package/lib/cli.js +1 -1
  13. package/lib/commands/api/doc.js +1 -1
  14. package/lib/commands/api/index.js +1 -1
  15. package/lib/commands/api/list.js +1 -1
  16. package/lib/commands/api/pull.js +1 -1
  17. package/lib/commands/api/shared.js +1 -1
  18. package/lib/commands/app/add.js +1 -1
  19. package/lib/commands/app/index.js +1 -1
  20. package/lib/commands/app/list.js +1 -1
  21. package/lib/commands/app/remote.js +1 -1
  22. package/lib/commands/app/remove.js +1 -1
  23. package/lib/commands/app/shared.js +1 -1
  24. package/lib/commands/app/use.js +1 -1
  25. package/lib/commands/auth/index.js +1 -1
  26. package/lib/commands/bff/delete.js +1 -1
  27. package/lib/commands/bff/detail.js +1 -1
  28. package/lib/commands/bff/index.js +1 -1
  29. package/lib/commands/bff/list.js +1 -1
  30. package/lib/commands/bff/new.js +1 -1
  31. package/lib/commands/bff/pull.js +1 -1
  32. package/lib/commands/bff/push.js +1 -1
  33. package/lib/commands/bff/status.js +1 -1
  34. package/lib/commands/cli-update.js +1 -1
  35. package/lib/commands/codegen/index.js +1 -1
  36. package/lib/commands/codegen/sdk.js +1 -1
  37. package/lib/commands/codegen/sql.js +1 -1
  38. package/lib/commands/common/app-selector.js +1 -1
  39. package/lib/commands/common/flags.js +1 -1
  40. package/lib/commands/common/validate.js +1 -1
  41. package/lib/commands/config/get.js +1 -1
  42. package/lib/commands/config/index.js +1 -1
  43. package/lib/commands/config/list.js +1 -1
  44. package/lib/commands/config/set.js +1 -1
  45. package/lib/commands/config/shared.js +1 -1
  46. package/lib/commands/dataset/detail.js +1 -1
  47. package/lib/commands/dataset/index.js +1 -1
  48. package/lib/commands/dataset/links.js +1 -1
  49. package/lib/commands/dataset/list.js +1 -1
  50. package/lib/commands/dataset/operations.js +1 -1
  51. package/lib/commands/doctor.js +1 -1
  52. package/lib/commands/init/index.js +1 -1
  53. package/lib/commands/logs/index.js +1 -1
  54. package/lib/commands/menu/index.js +1 -1
  55. package/lib/commands/menu/shared/compare-table.js +1 -1
  56. package/lib/commands/menu/shared/index.js +1 -1
  57. package/lib/commands/menu/shared/inquirer.js +1 -1
  58. package/lib/commands/menu/shared/local-pages.js +1 -1
  59. package/lib/commands/menu/shared/logic.js +1 -1
  60. package/lib/commands/menu/shared/service.js +1 -1
  61. package/lib/commands/menu/shared/sync-core.js +1 -1
  62. package/lib/commands/menu/shared/update-core.js +1 -1
  63. package/lib/commands/menu/shared/valid-url.js +1 -1
  64. package/lib/commands/menu/sync.js +1 -1
  65. package/lib/commands/menu/update.js +1 -1
  66. package/lib/commands/project/create/enhanced-guided-create.js +1 -0
  67. package/lib/commands/project/create/format-elapsed.js +1 -0
  68. package/lib/commands/project/create/main.js +1 -0
  69. package/lib/commands/project/create/non-interactive.js +1 -0
  70. package/lib/commands/project/create/project-template-path.js +1 -0
  71. package/lib/commands/project/create/use-copy-project-template.js +1 -0
  72. package/lib/commands/project/create/use-format-code.js +1 -0
  73. package/lib/commands/project/create/use-install-dependencies.js +1 -0
  74. package/lib/commands/project/index.js +1 -1
  75. package/lib/commands/project/init.js +1 -0
  76. package/lib/commands/project/upgrade.js +1 -0
  77. package/lib/commands/registry.js +1 -1
  78. package/lib/commands/run/index.js +1 -1
  79. package/lib/commands/skill/index.js +1 -1
  80. package/lib/commands/sql/detail.js +1 -1
  81. package/lib/commands/sql/exec.js +1 -1
  82. package/lib/commands/sql/index.js +1 -1
  83. package/lib/commands/sql/list.js +1 -1
  84. package/lib/commands/sql/save.js +1 -1
  85. package/lib/commands/sql/validate.js +1 -1
  86. package/lib/constant/cli.js +1 -1
  87. package/lib/constant/domain.js +1 -1
  88. package/lib/constant/env.js +1 -1
  89. package/lib/context.js +1 -1
  90. package/lib/core/alias-resolver.js +1 -1
  91. package/lib/core/api-client.js +1 -1
  92. package/lib/core/bff/config.js +1 -1
  93. package/lib/core/bff/file-system.js +1 -1
  94. package/lib/core/bff/hash.js +1 -1
  95. package/lib/core/bff/lock.js +1 -1
  96. package/lib/core/bff/utils.js +1 -1
  97. package/lib/core/db-resolver.js +1 -1
  98. package/lib/core/sql-validator.js +1 -1
  99. package/lib/errors.js +1 -1
  100. package/lib/framework/flags.js +1 -1
  101. package/lib/framework/help.js +1 -1
  102. package/lib/framework/index.js +1 -1
  103. package/lib/framework/output.js +1 -1
  104. package/lib/framework/response.js +1 -1
  105. package/lib/framework/runner.js +1 -1
  106. package/lib/framework/types.js +1 -1
  107. package/lib/generated/build-info.js +1 -1
  108. package/lib/help.js +1 -1
  109. package/lib/skills/main.js +1 -1
  110. package/lib/skills/npx-skills-add.js +1 -1
  111. package/lib/telemetry/cli-command-trace.js +1 -1
  112. package/lib/telemetry/cli-help-trace.js +1 -1
  113. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  114. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  115. package/lib/telemetry/send-cli-trace-log.js +1 -1
  116. package/lib/utils/ai_config.js +1 -1
  117. package/lib/utils/cdn-config.js +1 -1
  118. package/lib/utils/check-sdk-version.js +1 -1
  119. package/lib/utils/cli-version-check.js +1 -1
  120. package/lib/utils/config.js +1 -1
  121. package/lib/utils/copy-directory.js +1 -1
  122. package/lib/utils/file-utils.js +1 -1
  123. package/lib/utils/guides-cdn.js +1 -1
  124. package/lib/utils/http-client.js +1 -1
  125. package/lib/utils/is-non-interactive.js +1 -1
  126. package/lib/utils/logger.js +1 -1
  127. package/lib/utils/platform.js +1 -1
  128. package/lib/utils/rules-cdn.js +1 -1
  129. package/lib/utils/sleep.js +1 -1
  130. package/lib/utils/template-replacer.js +1 -1
  131. package/lib/utils/version.js +1 -1
  132. package/lib/utils/with-active-cookie.js +1 -1
  133. package/package.json +1 -1
  134. package/lib/commands/build.js +0 -1
  135. package/lib/commands/preview.js +0 -1
  136. package/lib/commands/project-upgrade.js +0 -1
  137. package/lib/commands/start.js +0 -1
  138. package/lib/create-app/enhanced-guided-create.js +0 -1
  139. package/lib/create-app/format-elapsed.js +0 -1
  140. package/lib/create-app/main.js +0 -1
  141. package/lib/create-app/non-interactive.js +0 -1
  142. package/lib/create-app/use-copy-project-template.js +0 -1
  143. package/lib/create-app/use-format-code.js +0 -1
  144. package/lib/create-app/use-install-dependencies.js +0 -1
  145. package/lib/init/main.js +0 -1
@@ -1 +1 @@
1
- const a127_0x262dc7=a127_0x3747;function a127_0x1bfc(){const _0x1a5614=['replace','.lovrabet','utf-8','CDN\x20请求失败:\x20','.lovrabet/skill/guides','lastUpdated','trimEnd','11850363mSnpal','cache','8793xRtjvl','7887948rcoyWw','status','142itjXac','path','.md','CDN\x20数据中缺少\x20skillTemplate','object','guides','skillTemplate','entries','length','3761175iCgECs','25FFGjYV','879676zrzpQd','content','7586610XsUCXm','3672PlsRMC','join','/skills/guides.json','10537XVaBOC','extendContent','CDN\x20返回数据格式错误','map'];a127_0x1bfc=function(){return _0x1a5614;};return a127_0x1bfc();}(function(_0x216722,_0x585080){const _0x508f31=a127_0x3747,_0xfdbf7f=_0x216722();while(!![]){try{const _0x8641a6=parseInt(_0x508f31(0x1e8))/0x1*(-parseInt(_0x508f31(0x1f8))/0x2)+-parseInt(_0x508f31(0x201))/0x3+-parseInt(_0x508f31(0x1e2))/0x4*(-parseInt(_0x508f31(0x1e1))/0x5)+parseInt(_0x508f31(0x1f6))/0x6+parseInt(_0x508f31(0x1f3))/0x7+-parseInt(_0x508f31(0x1e5))/0x8*(parseInt(_0x508f31(0x1f5))/0x9)+-parseInt(_0x508f31(0x1e4))/0xa;if(_0x8641a6===_0x585080)break;else _0xfdbf7f['push'](_0xfdbf7f['shift']());}catch(_0x528972){_0xfdbf7f['push'](_0xfdbf7f['shift']());}}}(a127_0x1bfc,0xdb49e));import{mkdirSync,writeFileSync}from'node:fs';import{dirname,join}from'node:path';import{homedir}from'node:os';import{getTemplateBaseUrl}from'./config.js';function getGuidesCdnUrl(){const _0x377dc5=a127_0x3747,_0x3f1eac=getTemplateBaseUrl();return _0x3f1eac+_0x377dc5(0x1e7);}const CACHE_DIR=join(homedir(),a127_0x262dc7(0x1ed),a127_0x262dc7(0x1f4));function a127_0x3747(_0x7a4278,_0x288a64){_0x7a4278=_0x7a4278-0x1e1;const _0x1bfc52=a127_0x1bfc();let _0x3747b9=_0x1bfc52[_0x7a4278];return _0x3747b9;}export async function fetchGuidesFromCDN(){const _0x3e6e5c=a127_0x262dc7,_0x597f25=getGuidesCdnUrl(),_0x4eebcd=await fetch(_0x597f25,{'headers':{'Accept':'application/json'}});if(!_0x4eebcd['ok'])throw new Error(_0x3e6e5c(0x1ef)+_0x4eebcd[_0x3e6e5c(0x1f7)]+'\x20'+_0x4eebcd['statusText']);const _0x184258=await _0x4eebcd['json']();if(!_0x184258[_0x3e6e5c(0x1fd)]||typeof _0x184258[_0x3e6e5c(0x1fd)]!==_0x3e6e5c(0x1fc))throw new Error(_0x3e6e5c(0x1ea));return _0x184258;}export function writeGuidesToProject(_0x143ad8,_0x52df70,_0x519ccf=a127_0x262dc7(0x1f0),_0x584988){const _0x5c1e5a=a127_0x262dc7,_0x29d3ab=join(_0x52df70,_0x519ccf);mkdirSync(_0x29d3ab,{'recursive':!![]});for(const [_0x447406,_0x8cc671]of Object['entries'](_0x143ad8[_0x5c1e5a(0x1fd)])){let _0x376a4a=_0x8cc671[_0x5c1e5a(0x1e3)];_0x8cc671[_0x5c1e5a(0x1f1)]&&(_0x376a4a=appendUpdateTime(_0x376a4a,_0x8cc671['lastUpdated'])),writeFileSync(join(_0x29d3ab,_0x447406+_0x5c1e5a(0x1fa)),_0x376a4a,_0x5c1e5a(0x1ee));}}export function appendUpdateTime(_0x92c2af,_0xb8039b){const _0xe90ec9=a127_0x262dc7;return _0x92c2af=_0x92c2af[_0xe90ec9(0x1ec)](/\n*>更新时间:.*$/m,''),_0x92c2af[_0xe90ec9(0x1f2)]()+('\x0a\x0a>更新时间:'+_0xb8039b);}export function getSkillTemplate(_0x3ffb71){const _0x2da1dd=a127_0x262dc7;return _0x3ffb71[_0x2da1dd(0x1fe)]?.[_0x2da1dd(0x1e3)]||'';}export function appendExtendContents(_0x5edebe,_0x3e9f44,_0x10c4e8){const _0x567edd=a127_0x262dc7,_0x1219c9=[];for(const [,_0xadc5f0]of Object['entries'](_0x3e9f44[_0x567edd(0x1fd)])){_0xadc5f0['extendContent']&&_0x1219c9['push'](_0xadc5f0[_0x567edd(0x1e9)][_0x567edd(0x1f2)]());}if(_0x1219c9[_0x567edd(0x200)]===0x0)return _0x5edebe;return _0x5edebe[_0x567edd(0x1f2)]()+'\x0a\x0a'+_0x1219c9[_0x567edd(0x1e6)]('\x0a\x0a')+'\x0a';}export function writeSkillFile(_0x3a553f,_0x4f8666,_0x36c9de){const _0x1800c4=a127_0x262dc7,_0x3059f3=getSkillTemplate(_0x3a553f);if(!_0x3059f3)throw new Error(_0x1800c4(0x1fb));const _0x5e94f7=dirname(_0x4f8666);mkdirSync(_0x5e94f7,{'recursive':!![]});let _0x2c49f2=_0x3059f3[_0x1800c4(0x1ec)](/\{\{IDE_NAME\}\}/g,_0x36c9de);_0x2c49f2=appendExtendContents(_0x2c49f2,_0x3a553f),_0x3a553f[_0x1800c4(0x1fe)][_0x1800c4(0x1f1)]&&(_0x2c49f2=appendUpdateTime(_0x2c49f2,_0x3a553f[_0x1800c4(0x1fe)]['lastUpdated'])),writeFileSync(_0x4f8666,_0x2c49f2,_0x1800c4(0x1ee));}export async function installGuides(_0x591d7f){const _0x18e4ef=a127_0x262dc7,_0x11e5ee=await fetchGuidesFromCDN();return writeGuidesToProject(_0x11e5ee,_0x591d7f),Object['keys'](_0x11e5ee[_0x18e4ef(0x1fd)])[_0x18e4ef(0x200)];}export function getGuidesSummary(_0x222fe8){const _0x4b3170=a127_0x262dc7;return Object[_0x4b3170(0x1ff)](_0x222fe8[_0x4b3170(0x1fd)])[_0x4b3170(0x1eb)](([_0x33a3ff,_0x235e2a])=>({'key':_0x33a3ff,'title':_0x235e2a['title'],'path':_0x235e2a[_0x4b3170(0x1f9)]}));}
1
+ const a125_0x5f8407=a125_0x208a;(function(_0x346435,_0x1ea359){const _0x319954=a125_0x208a,_0x568560=_0x346435();while(!![]){try{const _0x1b049e=parseInt(_0x319954(0x10e))/0x1*(parseInt(_0x319954(0x102))/0x2)+parseInt(_0x319954(0x115))/0x3*(parseInt(_0x319954(0x120))/0x4)+parseInt(_0x319954(0x10d))/0x5*(parseInt(_0x319954(0x10a))/0x6)+-parseInt(_0x319954(0x11a))/0x7+parseInt(_0x319954(0x103))/0x8+-parseInt(_0x319954(0x124))/0x9*(parseInt(_0x319954(0x122))/0xa)+-parseInt(_0x319954(0x109))/0xb*(parseInt(_0x319954(0x126))/0xc);if(_0x1b049e===_0x1ea359)break;else _0x568560['push'](_0x568560['shift']());}catch(_0x10f5af){_0x568560['push'](_0x568560['shift']());}}}(a125_0x36c8,0x2e1e2));import{mkdirSync,writeFileSync}from'node:fs';import{dirname,join}from'node:path';import{homedir}from'node:os';function a125_0x208a(_0x5d26e8,_0x28d8a0){_0x5d26e8=_0x5d26e8-0x102;const _0x36c80b=a125_0x36c8();let _0x208a21=_0x36c80b[_0x5d26e8];return _0x208a21;}import{getTemplateBaseUrl}from'./config.js';function getGuidesCdnUrl(){const _0x3f591e=a125_0x208a,_0x1559ab=getTemplateBaseUrl();return _0x1559ab+_0x3f591e(0x116);}const CACHE_DIR=join(homedir(),'.lovrabet',a125_0x5f8407(0x10b));export async function fetchGuidesFromCDN(){const _0x55bc66=a125_0x5f8407,_0x566e7b=getGuidesCdnUrl(),_0x43f587=await fetch(_0x566e7b,{'headers':{'Accept':'application/json'}});if(!_0x43f587['ok'])throw new Error(_0x55bc66(0x106)+_0x43f587[_0x55bc66(0x104)]+'\x20'+_0x43f587[_0x55bc66(0x11c)]);const _0x3b7647=await _0x43f587[_0x55bc66(0x105)]();if(!_0x3b7647[_0x55bc66(0x125)]||typeof _0x3b7647['guides']!==_0x55bc66(0x119))throw new Error(_0x55bc66(0x110));return _0x3b7647;}export function writeGuidesToProject(_0x45f2ce,_0x14b9d9,_0x2a5b76=a125_0x5f8407(0x121),_0x3f9b10){const _0x2d1699=a125_0x5f8407,_0x226d68=join(_0x14b9d9,_0x2a5b76);mkdirSync(_0x226d68,{'recursive':!![]});for(const [_0x49ce1f,_0x401ae8]of Object[_0x2d1699(0x108)](_0x45f2ce[_0x2d1699(0x125)])){let _0x3b6b23=_0x401ae8[_0x2d1699(0x11e)];_0x401ae8[_0x2d1699(0x10c)]&&(_0x3b6b23=appendUpdateTime(_0x3b6b23,_0x401ae8['lastUpdated'])),writeFileSync(join(_0x226d68,_0x49ce1f+_0x2d1699(0x11b)),_0x3b6b23,_0x2d1699(0x117));}}export function appendUpdateTime(_0x4b9067,_0x186c3f){const _0x325a7f=a125_0x5f8407;return _0x4b9067=_0x4b9067[_0x325a7f(0x114)](/\n*>更新时间:.*$/m,''),_0x4b9067['trimEnd']()+('\x0a\x0a>更新时间:'+_0x186c3f);}export function getSkillTemplate(_0x259f8f){const _0x161150=a125_0x5f8407;return _0x259f8f[_0x161150(0x123)]?.[_0x161150(0x11e)]||'';}export function appendExtendContents(_0x4a1224,_0x6afdb6,_0x212631){const _0x2e0b5f=a125_0x5f8407,_0x564129=[];for(const [,_0x1b2189]of Object[_0x2e0b5f(0x108)](_0x6afdb6[_0x2e0b5f(0x125)])){_0x1b2189[_0x2e0b5f(0x112)]&&_0x564129[_0x2e0b5f(0x111)](_0x1b2189[_0x2e0b5f(0x112)][_0x2e0b5f(0x118)]());}if(_0x564129[_0x2e0b5f(0x11f)]===0x0)return _0x4a1224;return _0x4a1224[_0x2e0b5f(0x118)]()+'\x0a\x0a'+_0x564129['join']('\x0a\x0a')+'\x0a';}export function writeSkillFile(_0x16c3ce,_0x3cb72b,_0x512c9d){const _0xe85514=a125_0x5f8407,_0x2b008d=getSkillTemplate(_0x16c3ce);if(!_0x2b008d)throw new Error(_0xe85514(0x11d));const _0xd04c20=dirname(_0x3cb72b);mkdirSync(_0xd04c20,{'recursive':!![]});let _0x2536bf=_0x2b008d[_0xe85514(0x114)](/\{\{IDE_NAME\}\}/g,_0x512c9d);_0x2536bf=appendExtendContents(_0x2536bf,_0x16c3ce),_0x16c3ce[_0xe85514(0x123)][_0xe85514(0x10c)]&&(_0x2536bf=appendUpdateTime(_0x2536bf,_0x16c3ce['skillTemplate'][_0xe85514(0x10c)])),writeFileSync(_0x3cb72b,_0x2536bf,_0xe85514(0x117));}export async function installGuides(_0x27311c){const _0x38e969=a125_0x5f8407,_0x3d40b6=await fetchGuidesFromCDN();return writeGuidesToProject(_0x3d40b6,_0x27311c),Object[_0x38e969(0x113)](_0x3d40b6[_0x38e969(0x125)])[_0x38e969(0x11f)];}function a125_0x36c8(){const _0x10f545=['5nQVmcE','8864AjpOfZ','path','CDN\x20返回数据格式错误','push','extendContent','keys','replace','47163oBRSMC','/skills/guides.json','utf-8','trimEnd','object','1012256ZfESGl','.md','statusText','CDN\x20数据中缺少\x20skillTemplate','content','length','4yocLTD','.lovrabet/skill/guides','20JuYfMh','skillTemplate','478809ZCNGPi','guides','18996mAfFQc','76lCTeGv','2582088XGPEYW','status','json','CDN\x20请求失败:\x20','map','entries','3531EwKJOu','1636422fGNTQN','cache','lastUpdated'];a125_0x36c8=function(){return _0x10f545;};return a125_0x36c8();}export function getGuidesSummary(_0x576213){const _0x2855ac=a125_0x5f8407;return Object[_0x2855ac(0x108)](_0x576213['guides'])[_0x2855ac(0x107)](([_0x41dde0,_0x113fa0])=>({'key':_0x41dde0,'title':_0x113fa0['title'],'path':_0x113fa0[_0x2855ac(0x10f)]}));}
@@ -1 +1 @@
1
- function a128_0x3f6e(_0x3b7d79,_0x32e7a6){_0x3b7d79=_0x3b7d79-0x14e;const _0x4b0fc3=a128_0x4b0f();let _0x3f6e6d=_0x4b0fc3[_0x3b7d79];return _0x3f6e6d;}(function(_0x12cf18,_0x3a8ac0){const _0x4d65ec=a128_0x3f6e,_0x40f623=_0x12cf18();while(!![]){try{const _0x228bc8=parseInt(_0x4d65ec(0x165))/0x1+-parseInt(_0x4d65ec(0x161))/0x2+parseInt(_0x4d65ec(0x166))/0x3+-parseInt(_0x4d65ec(0x15c))/0x4*(parseInt(_0x4d65ec(0x151))/0x5)+-parseInt(_0x4d65ec(0x15f))/0x6+-parseInt(_0x4d65ec(0x154))/0x7+parseInt(_0x4d65ec(0x158))/0x8;if(_0x228bc8===_0x3a8ac0)break;else _0x40f623['push'](_0x40f623['shift']());}catch(_0x17118f){_0x40f623['push'](_0x40f623['shift']());}}}(a128_0x4b0f,0xb3a46));export async function httpRequest(_0xaf3db4,_0x3c4f7e={}){const _0x5a45d0=a128_0x3f6e,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x3c4f7e;let _0x4c4bd0=null;for(let _0x5d9808=0x0;_0x5d9808<=retries;_0x5d9808++){try{const _0x521500=new AbortController(),_0x6eeb27=setTimeout(()=>_0x521500[_0x5a45d0(0x150)](),timeout),_0x47545d=await fetch(_0xaf3db4,{'headers':headers,'signal':_0x521500[_0x5a45d0(0x14e)]});clearTimeout(_0x6eeb27);let _0x15dc08;const _0x735da5=_0x47545d[_0x5a45d0(0x167)][_0x5a45d0(0x153)]('content-type');return _0x735da5?.[_0x5a45d0(0x15e)](_0x5a45d0(0x15d))?_0x15dc08=await _0x47545d['json']():_0x15dc08=await _0x47545d[_0x5a45d0(0x163)](),{'ok':_0x47545d['ok'],'status':_0x47545d['status'],'statusText':_0x47545d[_0x5a45d0(0x164)],'data':_0x15dc08,'headers':_0x47545d[_0x5a45d0(0x167)],'url':_0x47545d[_0x5a45d0(0x157)],'text':()=>_0x47545d['text']()};}catch(_0x315676){_0x4c4bd0=_0x315676 instanceof Error?_0x315676:new Error(String(_0x315676));if(_0x5d9808===retries)break;if(shouldRetry(_0x315676)){console[_0x5a45d0(0x15b)]('*\x20请求失败,'+retryDelay+_0x5a45d0(0x156)+(_0x5d9808+0x1)+_0x5a45d0(0x159)),await sleep(retryDelay);continue;}else break;}}throw _0x4c4bd0||new Error(_0x5a45d0(0x155));}function shouldRetry(_0x29a11b){const _0x388afe=a128_0x3f6e;if(_0x29a11b instanceof Error){if(_0x29a11b[_0x388afe(0x15a)]==='AbortError')return![];if(_0x29a11b['name']===_0x388afe(0x160)&&_0x29a11b[_0x388afe(0x152)][_0x388afe(0x15e)]('fetch'))return!![];if(_0x29a11b['message'][_0x388afe(0x15e)](_0x388afe(0x162)))return!![];if(_0x29a11b[_0x388afe(0x152)][_0x388afe(0x15e)](_0x388afe(0x14f)))return![];}return![];}function a128_0x4b0f(){const _0x29c973=['headers','signal','ENOTFOUND','abort','2045VAZNVQ','message','get','1684340XOGbqL','Request\x20failed','ms\x20后进行第\x20','url','8258776Jmjmnj','\x20次重试...','name','log','9788ogLvjN','application/json','includes','3655236gYxxfT','TypeError','1537530QhXaAH','ECONNRESET','text','statusText','1375422cejlqK','2842377XBqBav'];a128_0x4b0f=function(){return _0x29c973;};return a128_0x4b0f();}function sleep(_0x2b26c8){return new Promise(_0x3106e5=>setTimeout(_0x3106e5,_0x2b26c8));}export function validateUrl(_0x6a88b9){try{return new URL(_0x6a88b9),!![];}catch{return![];}}
1
+ (function(_0x1006bd,_0x573f9d){const _0x5efa85=a126_0x654c,_0x320f8e=_0x1006bd();while(!![]){try{const _0x52c881=-parseInt(_0x5efa85(0x147))/0x1+-parseInt(_0x5efa85(0x14e))/0x2+-parseInt(_0x5efa85(0x15b))/0x3+-parseInt(_0x5efa85(0x159))/0x4+parseInt(_0x5efa85(0x153))/0x5+-parseInt(_0x5efa85(0x152))/0x6+-parseInt(_0x5efa85(0x15a))/0x7*(-parseInt(_0x5efa85(0x15d))/0x8);if(_0x52c881===_0x573f9d)break;else _0x320f8e['push'](_0x320f8e['shift']());}catch(_0x53bd5f){_0x320f8e['push'](_0x320f8e['shift']());}}}(a126_0x23a9,0xe9944));export async function httpRequest(_0x2fef9f,_0x19cc7d={}){const _0x1d425a=a126_0x654c,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x19cc7d;let _0x894258=null;for(let _0x315aeb=0x0;_0x315aeb<=retries;_0x315aeb++){try{const _0x456ba9=new AbortController(),_0x48d8b5=setTimeout(()=>_0x456ba9['abort'](),timeout),_0x288836=await fetch(_0x2fef9f,{'headers':headers,'signal':_0x456ba9[_0x1d425a(0x150)]});clearTimeout(_0x48d8b5);let _0xf7bab;const _0x4e0668=_0x288836[_0x1d425a(0x143)][_0x1d425a(0x157)](_0x1d425a(0x15e));return _0x4e0668?.[_0x1d425a(0x146)](_0x1d425a(0x155))?_0xf7bab=await _0x288836[_0x1d425a(0x14a)]():_0xf7bab=await _0x288836['text'](),{'ok':_0x288836['ok'],'status':_0x288836[_0x1d425a(0x158)],'statusText':_0x288836[_0x1d425a(0x14c)],'data':_0xf7bab,'headers':_0x288836[_0x1d425a(0x143)],'url':_0x288836[_0x1d425a(0x148)],'text':()=>_0x288836[_0x1d425a(0x149)]()};}catch(_0x38497e){_0x894258=_0x38497e instanceof Error?_0x38497e:new Error(String(_0x38497e));if(_0x315aeb===retries)break;if(shouldRetry(_0x38497e)){console[_0x1d425a(0x14f)](_0x1d425a(0x15c)+retryDelay+_0x1d425a(0x156)+(_0x315aeb+0x1)+_0x1d425a(0x14d)),await sleep(retryDelay);continue;}else break;}}throw _0x894258||new Error('Request\x20failed');}function a126_0x23a9(){const _0x408582=['1820370SNJPjR','message','application/json','ms\x20后进行第\x20','get','status','7156900xTIfDK','35WjSKCY','371220UhkoEa','*\x20请求失败,','9864632FDDPaR','content-type','name','headers','TypeError','ENOTFOUND','includes','517783oOJZFT','url','text','json','fetch','statusText','\x20次重试...','3103652zVoKRI','log','signal','AbortError','9540930gHgMPs'];a126_0x23a9=function(){return _0x408582;};return a126_0x23a9();}function shouldRetry(_0x4e0251){const _0x52833d=a126_0x654c;if(_0x4e0251 instanceof Error){if(_0x4e0251[_0x52833d(0x15f)]===_0x52833d(0x151))return![];if(_0x4e0251[_0x52833d(0x15f)]===_0x52833d(0x144)&&_0x4e0251[_0x52833d(0x154)][_0x52833d(0x146)](_0x52833d(0x14b)))return!![];if(_0x4e0251[_0x52833d(0x154)][_0x52833d(0x146)]('ECONNRESET'))return!![];if(_0x4e0251[_0x52833d(0x154)][_0x52833d(0x146)](_0x52833d(0x145)))return![];}return![];}function a126_0x654c(_0xc8b5c,_0x292b1a){_0xc8b5c=_0xc8b5c-0x143;const _0x23a9a8=a126_0x23a9();let _0x654c7f=_0x23a9a8[_0xc8b5c];return _0x654c7f;}function sleep(_0x35c62c){return new Promise(_0x5c945b=>setTimeout(_0x5c945b,_0x35c62c));}export function validateUrl(_0x56eeb9){try{return new URL(_0x56eeb9),!![];}catch{return![];}}
@@ -1 +1 @@
1
- function a129_0x95ac(_0x36ba21,_0x347f0f){_0x36ba21=_0x36ba21-0xd8;const _0x13dd26=a129_0x13dd();let _0x95acc5=_0x13dd26[_0x36ba21];return _0x95acc5;}(function(_0x271462,_0x40ac31){const _0x55274d=a129_0x95ac,_0x59e859=_0x271462();while(!![]){try{const _0x12d648=parseInt(_0x55274d(0xe3))/0x1*(parseInt(_0x55274d(0xdb))/0x2)+-parseInt(_0x55274d(0xe0))/0x3+parseInt(_0x55274d(0xe5))/0x4+parseInt(_0x55274d(0xe1))/0x5+-parseInt(_0x55274d(0xd9))/0x6+-parseInt(_0x55274d(0xe2))/0x7*(-parseInt(_0x55274d(0xda))/0x8)+-parseInt(_0x55274d(0xd8))/0x9;if(_0x12d648===_0x40ac31)break;else _0x59e859['push'](_0x59e859['shift']());}catch(_0x2a2937){_0x59e859['push'](_0x59e859['shift']());}}}(a129_0x13dd,0xd9c5c));function env(_0x3a701a){return process.env[`RABETBASE_${_0x3a701a}`]||process.env[`LOVRABET_${_0x3a701a}`]||undefined;}export function isNonInteractive(_0x4068ab){const _0x4e81c7=a129_0x95ac;return!!(_0x4068ab[_0x4e81c7(0xe6)]||_0x4068ab['ci']||env('CI')===_0x4e81c7(0xdc)||process.env.CI===_0x4e81c7(0xdc)||!process['stdout']['isTTY']||!isStdinRawModeSupported());}function a129_0x13dd(){const _0x35d212=['1948984JsWnQP','24982PRTZAG','true','setRawMode','isRaw','isTTY','1247490fwJOdb','6213800SKrxva','49WjjeRo','101SeJGbM','stdin','3256164OZzZRl','nonInteractive','19922499eNGycw','9013896pHXNFf'];a129_0x13dd=function(){return _0x35d212;};return a129_0x13dd();}function isStdinRawModeSupported(){const _0x22461f=a129_0x95ac;if(!process[_0x22461f(0xe4)][_0x22461f(0xdf)])return![];try{const _0xb233ee=process[_0x22461f(0xe4)][_0x22461f(0xde)];return process[_0x22461f(0xe4)][_0x22461f(0xdd)](!![]),process[_0x22461f(0xe4)][_0x22461f(0xdd)](_0xb233ee??![]),!![];}catch{return![];}}
1
+ (function(_0x9a2df4,_0x560548){const _0x4934f9=a127_0xc47d,_0x3bd283=_0x9a2df4();while(!![]){try{const _0x226019=parseInt(_0x4934f9(0x1a5))/0x1*(parseInt(_0x4934f9(0x1a3))/0x2)+parseInt(_0x4934f9(0x1a1))/0x3+-parseInt(_0x4934f9(0x19f))/0x4+-parseInt(_0x4934f9(0x1a4))/0x5+-parseInt(_0x4934f9(0x1aa))/0x6*(parseInt(_0x4934f9(0x1af))/0x7)+parseInt(_0x4934f9(0x1a2))/0x8*(-parseInt(_0x4934f9(0x1a8))/0x9)+-parseInt(_0x4934f9(0x1ad))/0xa*(-parseInt(_0x4934f9(0x1a6))/0xb);if(_0x226019===_0x560548)break;else _0x3bd283['push'](_0x3bd283['shift']());}catch(_0x51d7e9){_0x3bd283['push'](_0x3bd283['shift']());}}}(a127_0x5414,0x51319));function a127_0xc47d(_0x5e63c0,_0x231ceb){_0x5e63c0=_0x5e63c0-0x19f;const _0x5414df=a127_0x5414();let _0xc47d92=_0x5414df[_0x5e63c0];return _0xc47d92;}function env(_0x12ce88){return process.env[`RABETBASE_${_0x12ce88}`]||process.env[`LOVRABET_${_0x12ce88}`]||undefined;}function a127_0x5414(){const _0xca7b31=['94fXWxOY','2737025nfiLUw','3369STGLnX','8729875heBlcS','stdout','81nHmxdm','stdin','6RKnZcN','nonInteractive','true','20WqdeMZ','setRawMode','1001749NbcdzA','isRaw','2096756xFNYCs','isTTY','488028ejDXct','320888vXfSXQ'];a127_0x5414=function(){return _0xca7b31;};return a127_0x5414();}export function isNonInteractive(_0x51cedb){const _0x11e827=a127_0xc47d;return!!(_0x51cedb[_0x11e827(0x1ab)]||_0x51cedb['ci']||env('CI')===_0x11e827(0x1ac)||process.env.CI==='true'||!process[_0x11e827(0x1a7)][_0x11e827(0x1a0)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x126bd9=a127_0xc47d;if(!process[_0x126bd9(0x1a9)][_0x126bd9(0x1a0)])return![];try{const _0x30153c=process[_0x126bd9(0x1a9)][_0x126bd9(0x1b0)];return process[_0x126bd9(0x1a9)][_0x126bd9(0x1ae)](!![]),process[_0x126bd9(0x1a9)]['setRawMode'](_0x30153c??![]),!![];}catch{return![];}}
@@ -1 +1 @@
1
- const a130_0x239a89=a130_0x5068;(function(_0xf3ec2d,_0x59a6b5){const _0x3cfcfb=a130_0x5068,_0x355058=_0xf3ec2d();while(!![]){try{const _0x20b174=-parseInt(_0x3cfcfb(0xdf))/0x1+parseInt(_0x3cfcfb(0xf6))/0x2*(-parseInt(_0x3cfcfb(0xe4))/0x3)+-parseInt(_0x3cfcfb(0xe9))/0x4*(parseInt(_0x3cfcfb(0xf9))/0x5)+-parseInt(_0x3cfcfb(0xe5))/0x6*(parseInt(_0x3cfcfb(0xea))/0x7)+parseInt(_0x3cfcfb(0x107))/0x8*(-parseInt(_0x3cfcfb(0xf1))/0x9)+-parseInt(_0x3cfcfb(0x10b))/0xa+parseInt(_0x3cfcfb(0xf4))/0xb*(parseInt(_0x3cfcfb(0xf2))/0xc);if(_0x20b174===_0x59a6b5)break;else _0x355058['push'](_0x355058['shift']());}catch(_0x2571a2){_0x355058['push'](_0x355058['shift']());}}}(a130_0x3a30,0x2af16));import a130_0x13be7d from'winston';function a130_0x5068(_0x5bb719,_0x270122){_0x5bb719=_0x5bb719-0xda;const _0x3a302e=a130_0x3a30();let _0x5068de=_0x3a302e[_0x5bb719];return _0x5068de;}import a130_0x14b9ea from'node:fs';import a130_0x4e6d1c from'node:path';class Logger{['winstonLogger'];[a130_0x239a89(0x10c)];[a130_0x239a89(0xec)]='';constructor(){this['logFilePath']='';}['setRawCommand'](_0x4c4843){const _0x44e2bf=a130_0x239a89;this[_0x44e2bf(0xec)]=_0x4c4843;}[a130_0x239a89(0xfb)](){const _0x165322=a130_0x239a89,_0x5c5cc6=a130_0x4e6d1c[_0x165322(0xed)](this[_0x165322(0x10c)]);!a130_0x14b9ea['existsSync'](_0x5c5cc6)&&a130_0x14b9ea[_0x165322(0xe6)](_0x5c5cc6,{'recursive':!![]});const _0x17b6fc=a130_0x13be7d[_0x165322(0x10a)][_0x165322(0x103)](a130_0x13be7d['format'][_0x165322(0xee)](),a130_0x13be7d[_0x165322(0x10a)]['errors']({'stack':!![]}),a130_0x13be7d[_0x165322(0x10a)][_0x165322(0xe3)](_0x41c91e=>{const _0x5f1dd5=_0x165322,_0x1d4881={'timestamp':_0x41c91e[_0x5f1dd5(0xee)]||new Date()[_0x5f1dd5(0xe0)](),'level':_0x41c91e['level']||'info','command':_0x41c91e[_0x5f1dd5(0xde)]||'unknown','rawCommand':_0x41c91e['rawCommand']||this[_0x5f1dd5(0xec)]||undefined,'message':_0x41c91e['message']||'','duration':_0x41c91e['duration']||undefined,'details':_0x41c91e[_0x5f1dd5(0xfd)]||undefined};return JSON['stringify'](_0x1d4881);}));this[_0x165322(0xfa)]=a130_0x13be7d[_0x165322(0xe1)]({'level':'info','format':_0x17b6fc,'transports':[new a130_0x13be7d[(_0x165322(0x108))]['File']({'filename':this[_0x165322(0x10c)],'level':_0x165322(0x106)})],'silent':![]}),a130_0x13be7d[_0x165322(0xf7)]({'success':_0x165322(0xf0),'error':'red','warn':_0x165322(0xda),'info':_0x165322(0xf8)});}[a130_0x239a89(0x100)](_0x28b63b){const _0x4fccb9=a130_0x239a89;this[_0x4fccb9(0x10c)]=a130_0x4e6d1c[_0x4fccb9(0x101)](_0x28b63b,_0x4fccb9(0xe8)),this['winstonLogger']&&this[_0x4fccb9(0xfa)][_0x4fccb9(0xe2)](),this[_0x4fccb9(0xfb)]();}[a130_0x239a89(0x106)](_0xf04f2e,_0x3da89f,_0x5c9db5){const _0x3c4851=a130_0x239a89;if(!this[_0x3c4851(0x10c)]||!this[_0x3c4851(0xfa)])return;this[_0x3c4851(0xfa)][_0x3c4851(0x106)](_0x3da89f,{'command':_0xf04f2e,'details':_0x5c9db5});}[a130_0x239a89(0x104)](_0x2b5363,_0x3d8c1f,_0x483516,_0x4f658f){const _0x566d8f=a130_0x239a89;if(!this[_0x566d8f(0x10c)]||!this['winstonLogger'])return;this[_0x566d8f(0xfa)][_0x566d8f(0xff)](_0x566d8f(0x106),_0x3d8c1f,{'level':_0x566d8f(0x104),'command':_0x2b5363,'duration':_0x483516,'details':_0x4f658f});}[a130_0x239a89(0xdd)](_0x245462,_0x3e426c,_0x10c839){const _0x5ba7f9=a130_0x239a89;if(!this[_0x5ba7f9(0x10c)]||!this[_0x5ba7f9(0xfa)])return;this[_0x5ba7f9(0xfa)][_0x5ba7f9(0xdd)](_0x3e426c,{'command':_0x245462,'details':_0x10c839});}[a130_0x239a89(0xfc)](_0x534913,_0x253788,_0x2a3164){const _0xbd17e=a130_0x239a89;if(!this['logFilePath']||!this[_0xbd17e(0xfa)])return;this[_0xbd17e(0xfa)][_0xbd17e(0xfc)](_0x253788,{'command':_0x534913,'details':_0x2a3164});}async[a130_0x239a89(0xf3)](_0x236285,_0x10b2a3,_0x4b7f4f){const _0x10cd5a=a130_0x239a89,_0x129afa=Date[_0x10cd5a(0x109)]();this['info'](_0x236285,_0x10cd5a(0xf5)+_0x10b2a3);try{const _0x3f4b80=await _0x4b7f4f(),_0x477d08=Date[_0x10cd5a(0x109)]()-_0x129afa;return this[_0x10cd5a(0x104)](_0x236285,'完成:\x20'+_0x10b2a3,_0x477d08),_0x3f4b80;}catch(_0x10bf4b){const _0x192a39=Date[_0x10cd5a(0x109)]()-_0x129afa;this[_0x10cd5a(0xdd)](_0x236285,'失败:\x20'+_0x10b2a3,{'error':_0x10bf4b instanceof Error?_0x10bf4b[_0x10cd5a(0xdc)]:String(_0x10bf4b),'duration':_0x192a39});throw _0x10bf4b;}}['readLogs'](){const _0x2b660d=a130_0x239a89;try{if(!a130_0x14b9ea[_0x2b660d(0x102)](this[_0x2b660d(0x10c)]))return[];const _0xa2fa1a=a130_0x14b9ea[_0x2b660d(0xeb)](this[_0x2b660d(0x10c)],'utf8');return _0xa2fa1a['split']('\x0a')['filter'](_0x294a8=>_0x294a8['trim']())[_0x2b660d(0xdb)](_0x3a7a39=>JSON[_0x2b660d(0x105)](_0x3a7a39));}catch(_0x3b5e80){return console[_0x2b660d(0xfc)]('Failed\x20to\x20read\x20logs:',_0x3b5e80),[];}}['clearLogs'](){const _0x1bafc0=a130_0x239a89;try{a130_0x14b9ea[_0x1bafc0(0x102)](this[_0x1bafc0(0x10c)])&&a130_0x14b9ea[_0x1bafc0(0xef)](this[_0x1bafc0(0x10c)],'',_0x1bafc0(0xfe));}catch(_0xde588a){console[_0x1bafc0(0xfc)](_0x1bafc0(0xe7),_0xde588a);}}['getWinstonInstance'](){return this['winstonLogger'];}}function a130_0x3a30(){const _0x94bb51=['error','command','72294BLzFpU','toISOString','createLogger','clear','printf','9939QJlEGQ','6kPpTyy','mkdirSync','Failed\x20to\x20clear\x20logs:','.lovrabet.log','56852PFutDl','1439711uCSuzB','readFileSync','currentRawCommand','dirname','timestamp','writeFileSync','green','9WvKxny','15011148xrKfAT','logTask','11YDMjUh','开始执行:\x20','166ZiOrDA','addColors','blue','15ILfSzv','winstonLogger','initWinstonLogger','warn','details','utf8','log','setLogPath','join','existsSync','combine','success','parse','info','1061176cuoRcF','transports','now','format','3468030jKOTAE','logFilePath','yellow','map','message'];a130_0x3a30=function(){return _0x94bb51;};return a130_0x3a30();}export const logger=new Logger();
1
+ const a128_0x40c987=a128_0x48a6;(function(_0x12ffea,_0x26a007){const _0x3f514e=a128_0x48a6,_0x3b9867=_0x12ffea();while(!![]){try{const _0x42b730=parseInt(_0x3f514e(0x9a))/0x1+parseInt(_0x3f514e(0xb6))/0x2+parseInt(_0x3f514e(0xad))/0x3+-parseInt(_0x3f514e(0xb3))/0x4+parseInt(_0x3f514e(0xb1))/0x5*(parseInt(_0x3f514e(0x95))/0x6)+-parseInt(_0x3f514e(0xbb))/0x7*(-parseInt(_0x3f514e(0xa4))/0x8)+-parseInt(_0x3f514e(0xac))/0x9;if(_0x42b730===_0x26a007)break;else _0x3b9867['push'](_0x3b9867['shift']());}catch(_0xf1ff80){_0x3b9867['push'](_0x3b9867['shift']());}}}(a128_0x2b20,0x74003));import a128_0x542c10 from'winston';import a128_0x781118 from'node:fs';import a128_0x1c397e from'node:path';function a128_0x2b20(){const _0x41e7ef=['errors','1310456XCRnHP','combine','clearLogs','605124cuHRnf','printf','warn','setLogPath','message','7lrdDDV','existsSync','winstonLogger','filter','timestamp','info','blue','Failed\x20to\x20read\x20logs:','toISOString','red','success','currentRawCommand','204xbmGIA','initWinstonLogger','level','完成:\x20','transports','816091HFtdRK','format','dirname','addColors','logFilePath','error','utf8','logTask','trim','green','2990424cMvSxX','Failed\x20to\x20clear\x20logs:','yellow','stringify','clear','writeFileSync','command','createLogger','14012901EnZDqq','368058jacfZX','parse','rawCommand','now','109500CzePLX'];a128_0x2b20=function(){return _0x41e7ef;};return a128_0x2b20();}class Logger{[a128_0x40c987(0xbd)];['logFilePath'];['currentRawCommand']='';constructor(){this['logFilePath']='';}['setRawCommand'](_0x211587){this['currentRawCommand']=_0x211587;}['initWinstonLogger'](){const _0x4e9f98=a128_0x40c987,_0x1c3851=a128_0x1c397e[_0x4e9f98(0x9c)](this[_0x4e9f98(0x9e)]);!a128_0x781118['existsSync'](_0x1c3851)&&a128_0x781118['mkdirSync'](_0x1c3851,{'recursive':!![]});const _0x40c632=a128_0x542c10[_0x4e9f98(0x9b)][_0x4e9f98(0xb4)](a128_0x542c10['format'][_0x4e9f98(0x8d)](),a128_0x542c10[_0x4e9f98(0x9b)][_0x4e9f98(0xb2)]({'stack':!![]}),a128_0x542c10[_0x4e9f98(0x9b)][_0x4e9f98(0xb7)](_0x49098e=>{const _0x23972b=_0x4e9f98,_0x3031db={'timestamp':_0x49098e[_0x23972b(0x8d)]||new Date()[_0x23972b(0x91)](),'level':_0x49098e[_0x23972b(0x97)]||_0x23972b(0x8e),'command':_0x49098e[_0x23972b(0xaa)]||'unknown','rawCommand':_0x49098e[_0x23972b(0xaf)]||this[_0x23972b(0x94)]||undefined,'message':_0x49098e[_0x23972b(0xba)]||'','duration':_0x49098e['duration']||undefined,'details':_0x49098e['details']||undefined};return JSON[_0x23972b(0xa7)](_0x3031db);}));this[_0x4e9f98(0xbd)]=a128_0x542c10[_0x4e9f98(0xab)]({'level':_0x4e9f98(0x8e),'format':_0x40c632,'transports':[new a128_0x542c10[(_0x4e9f98(0x99))]['File']({'filename':this[_0x4e9f98(0x9e)],'level':_0x4e9f98(0x8e)})],'silent':![]}),a128_0x542c10[_0x4e9f98(0x9d)]({'success':_0x4e9f98(0xa3),'error':_0x4e9f98(0x92),'warn':_0x4e9f98(0xa6),'info':_0x4e9f98(0x8f)});}[a128_0x40c987(0xb9)](_0x2ae8f4){const _0x5107fd=a128_0x40c987;this[_0x5107fd(0x9e)]=a128_0x1c397e['join'](_0x2ae8f4,'.lovrabet.log'),this[_0x5107fd(0xbd)]&&this[_0x5107fd(0xbd)][_0x5107fd(0xa8)](),this[_0x5107fd(0x96)]();}[a128_0x40c987(0x8e)](_0x357b6e,_0x3b4590,_0x3ddb59){const _0x10ba73=a128_0x40c987;if(!this['logFilePath']||!this[_0x10ba73(0xbd)])return;this[_0x10ba73(0xbd)]['info'](_0x3b4590,{'command':_0x357b6e,'details':_0x3ddb59});}[a128_0x40c987(0x93)](_0x5c2250,_0xd3e503,_0x4e70fb,_0xb53820){const _0x4aa22b=a128_0x40c987;if(!this[_0x4aa22b(0x9e)]||!this[_0x4aa22b(0xbd)])return;this[_0x4aa22b(0xbd)]['log'](_0x4aa22b(0x8e),_0xd3e503,{'level':'success','command':_0x5c2250,'duration':_0x4e70fb,'details':_0xb53820});}['error'](_0x5817dc,_0x28aa91,_0x2960da){const _0x1590a4=a128_0x40c987;if(!this[_0x1590a4(0x9e)]||!this[_0x1590a4(0xbd)])return;this['winstonLogger']['error'](_0x28aa91,{'command':_0x5817dc,'details':_0x2960da});}[a128_0x40c987(0xb8)](_0x265509,_0x324017,_0x2a0d6d){const _0x433421=a128_0x40c987;if(!this[_0x433421(0x9e)]||!this['winstonLogger'])return;this[_0x433421(0xbd)][_0x433421(0xb8)](_0x324017,{'command':_0x265509,'details':_0x2a0d6d});}async[a128_0x40c987(0xa1)](_0x247c48,_0x2e4435,_0x36d0b4){const _0x20ddc8=a128_0x40c987,_0x15653b=Date[_0x20ddc8(0xb0)]();this[_0x20ddc8(0x8e)](_0x247c48,'开始执行:\x20'+_0x2e4435);try{const _0x3c9d54=await _0x36d0b4(),_0x2ea450=Date['now']()-_0x15653b;return this[_0x20ddc8(0x93)](_0x247c48,_0x20ddc8(0x98)+_0x2e4435,_0x2ea450),_0x3c9d54;}catch(_0x10755e){const _0x386b64=Date['now']()-_0x15653b;this[_0x20ddc8(0x9f)](_0x247c48,'失败:\x20'+_0x2e4435,{'error':_0x10755e instanceof Error?_0x10755e['message']:String(_0x10755e),'duration':_0x386b64});throw _0x10755e;}}['readLogs'](){const _0x1b82ac=a128_0x40c987;try{if(!a128_0x781118[_0x1b82ac(0xbc)](this['logFilePath']))return[];const _0x47b7e8=a128_0x781118['readFileSync'](this[_0x1b82ac(0x9e)],_0x1b82ac(0xa0));return _0x47b7e8['split']('\x0a')[_0x1b82ac(0xbe)](_0x4e1d1c=>_0x4e1d1c[_0x1b82ac(0xa2)]())['map'](_0x564d62=>JSON[_0x1b82ac(0xae)](_0x564d62));}catch(_0x2add6f){return console[_0x1b82ac(0xb8)](_0x1b82ac(0x90),_0x2add6f),[];}}[a128_0x40c987(0xb5)](){const _0x3aa6c0=a128_0x40c987;try{a128_0x781118[_0x3aa6c0(0xbc)](this[_0x3aa6c0(0x9e)])&&a128_0x781118[_0x3aa6c0(0xa9)](this[_0x3aa6c0(0x9e)],'',_0x3aa6c0(0xa0));}catch(_0x32e1b5){console[_0x3aa6c0(0xb8)](_0x3aa6c0(0xa5),_0x32e1b5);}}['getWinstonInstance'](){const _0x50a47e=a128_0x40c987;return this[_0x50a47e(0xbd)];}}function a128_0x48a6(_0x8a03,_0x55181f){_0x8a03=_0x8a03-0x8d;const _0x2b2018=a128_0x2b20();let _0x48a646=_0x2b2018[_0x8a03];return _0x48a646;}export const logger=new Logger();
@@ -1 +1 @@
1
- function a131_0x38c4(_0x2aca59,_0x17e6d1){_0x2aca59=_0x2aca59-0xde;const _0x5c30c7=a131_0x5c30();let _0x38c43f=_0x5c30c7[_0x2aca59];return _0x38c43f;}const a131_0x1fd270=a131_0x38c4;(function(_0x113a1f,_0x18d20b){const _0xeec04b=a131_0x38c4,_0x75d508=_0x113a1f();while(!![]){try{const _0x162323=parseInt(_0xeec04b(0xe9))/0x1*(-parseInt(_0xeec04b(0xe4))/0x2)+parseInt(_0xeec04b(0xe7))/0x3+parseInt(_0xeec04b(0xe1))/0x4+parseInt(_0xeec04b(0xe0))/0x5*(-parseInt(_0xeec04b(0xe5))/0x6)+-parseInt(_0xeec04b(0xde))/0x7*(-parseInt(_0xeec04b(0xe8))/0x8)+-parseInt(_0xeec04b(0xe2))/0x9*(parseInt(_0xeec04b(0xdf))/0xa)+-parseInt(_0xeec04b(0xe3))/0xb;if(_0x162323===_0x18d20b)break;else _0x75d508['push'](_0x75d508['shift']());}catch(_0x56bd37){_0x75d508['push'](_0x75d508['shift']());}}}(a131_0x5c30,0x64d5a));export const isWindows=process['platform']===a131_0x1fd270(0xe6);function a131_0x5c30(){const _0x77409f=['15032IOAjiq','3UnnyCS','2779EMlzpH','885780OWXMri','855370nkOiki','1684788WyzMbi','27QPmkKo','6023435AEXhNW','224914UWCiUK','12QtWEUK','win32','2216088JIEfOy'];a131_0x5c30=function(){return _0x77409f;};return a131_0x5c30();}export function resolveNpmBin(_0x397246){return isWindows?_0x397246+'.cmd':_0x397246;}
1
+ const a129_0x120c85=a129_0x2ef2;function a129_0x2ef2(_0xf07c92,_0x35f673){_0xf07c92=_0xf07c92-0x1b3;const _0x398545=a129_0x3985();let _0x2ef2cb=_0x398545[_0xf07c92];return _0x2ef2cb;}(function(_0x211449,_0x3b9f2c){const _0x5a4cb1=a129_0x2ef2,_0x90abf6=_0x211449();while(!![]){try{const _0x212305=parseInt(_0x5a4cb1(0x1b3))/0x1*(-parseInt(_0x5a4cb1(0x1b4))/0x2)+-parseInt(_0x5a4cb1(0x1b7))/0x3*(-parseInt(_0x5a4cb1(0x1b8))/0x4)+-parseInt(_0x5a4cb1(0x1b5))/0x5+-parseInt(_0x5a4cb1(0x1ba))/0x6+-parseInt(_0x5a4cb1(0x1b6))/0x7*(-parseInt(_0x5a4cb1(0x1b9))/0x8)+-parseInt(_0x5a4cb1(0x1be))/0x9+parseInt(_0x5a4cb1(0x1bc))/0xa;if(_0x212305===_0x3b9f2c)break;else _0x90abf6['push'](_0x90abf6['shift']());}catch(_0x29b51b){_0x90abf6['push'](_0x90abf6['shift']());}}}(a129_0x3985,0x851fb));export const isWindows=process['platform']===a129_0x120c85(0x1bd);export function resolveNpmBin(_0x49dcb9){const _0x381add=a129_0x120c85;return isWindows?_0x49dcb9+_0x381add(0x1bb):_0x49dcb9;}function a129_0x3985(){const _0x32a8af=['4173UQGNWK','1844qmKQCx','58472BLQjws','2238384nKgiZA','.cmd','19384050asHhqt','win32','6130638XsmLCv','1MRKMsz','1954642ShVzHa','708425nfepUC','133FEefnN'];a129_0x3985=function(){return _0x32a8af;};return a129_0x3985();}
@@ -1 +1 @@
1
- const a132_0x2c7d22=a132_0x3140;(function(_0x168f28,_0xee2e26){const _0x58723a=a132_0x3140,_0x3b4a28=_0x168f28();while(!![]){try{const _0x3ce885=-parseInt(_0x58723a(0xd9))/0x1*(parseInt(_0x58723a(0xdb))/0x2)+-parseInt(_0x58723a(0xcc))/0x3+parseInt(_0x58723a(0xd2))/0x4*(parseInt(_0x58723a(0xde))/0x5)+parseInt(_0x58723a(0xcf))/0x6+parseInt(_0x58723a(0xda))/0x7*(parseInt(_0x58723a(0xdd))/0x8)+parseInt(_0x58723a(0xcd))/0x9+-parseInt(_0x58723a(0xe1))/0xa;if(_0x3ce885===_0xee2e26)break;else _0x3b4a28['push'](_0x3b4a28['shift']());}catch(_0x3e93b2){_0x3b4a28['push'](_0x3b4a28['shift']());}}}(a132_0x3a21,0x310ab));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import{dirname,join,resolve}from'node:path';import{fileURLToPath}from'node:url';import{getTemplateBaseUrl}from'./config.js';import{appendUpdateTime}from'./guides-cdn.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function a132_0x3140(_0x2127e4,_0x2fef26){_0x2127e4=_0x2127e4-0xc9;const _0x3a21b9=a132_0x3a21();let _0x31401c=_0x3a21b9[_0x2127e4];return _0x31401c;}function getRulesCdnUrl(){const _0xde5c65=a132_0x3140,_0x5817cf=getTemplateBaseUrl();return _0x5817cf+_0xde5c65(0xe2);}const LOCAL_TEMPLATE_PATH=resolve(__dirname,a132_0x2c7d22(0xcb));export async function fetchRulesFromCDN(){const _0x416829=a132_0x2c7d22,_0x3bb83e=getRulesCdnUrl(),_0x36f392=await fetch(_0x3bb83e,{'headers':{'Accept':_0x416829(0xd5)}});if(!_0x36f392['ok'])throw new Error(_0x416829(0xd6)+_0x36f392[_0x416829(0xd1)]+'\x20'+_0x36f392[_0x416829(0xc9)]);const _0x4016dd=await _0x36f392[_0x416829(0xdc)]();if(!_0x4016dd[_0x416829(0xd8)]||typeof _0x4016dd[_0x416829(0xd8)]!==_0x416829(0xdf))throw new Error(_0x416829(0xca));return _0x4016dd;}export async function getRulesContent(){const _0x5f3369=a132_0x2c7d22;try{const _0x134bee=await fetchRulesFromCDN();return _0x134bee[_0x5f3369(0xd8)];}catch{return readLocalTemplate();}}export function readLocalTemplate(){const _0x5cbba8=a132_0x2c7d22;if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,_0x5cbba8(0xd0));throw new Error(_0x5cbba8(0xd3)+LOCAL_TEMPLATE_PATH);}function a132_0x3a21(){const _0x85714c=['39361aYoGIY','3714CZEBIF','json','568TKXMvM','55zayVss','string','catch','1685830kimDEL','/rules/rules.json','statusText','CDN\x20返回数据格式错误','../../templates/rules/lovrabet_rules.mdc.tpl','864444fHTNlL','2042190qzmIMb','.cursor/rules','67608nRwdPN','utf-8','status','85000CXBuub','本地模板文件不存在:\x20','lastUpdated','application/json','CDN\x20请求失败:\x20','agents.md','content','115jAcrKG'];a132_0x3a21=function(){return _0x85714c;};return a132_0x3a21();}export async function writeRulesFile(_0xa49da9){const _0x1168b9=a132_0x2c7d22,_0x2404f7=await fetchRulesFromCDN()[_0x1168b9(0xe0)](()=>null);let _0x485e82;_0x2404f7?(_0x485e82=_0x2404f7[_0x1168b9(0xd8)],_0x2404f7['lastUpdated']&&(_0x485e82=appendUpdateTime(_0x485e82,_0x2404f7[_0x1168b9(0xd4)]))):_0x485e82=readLocalTemplate();const _0xf3c1d3=dirname(_0xa49da9);!existsSync(_0xf3c1d3)&&mkdirSync(_0xf3c1d3,{'recursive':!![]}),writeFileSync(_0xa49da9,_0x485e82,_0x1168b9(0xd0));}export async function copyRulesToCursor(_0xae3937){const _0x2afafa=a132_0x2c7d22,_0x28f960=join(_0xae3937,_0x2afafa(0xce)),_0x53a88a=join(_0x28f960,'lovrabet_rules.mdc');if(existsSync(_0x53a88a))return![];return await writeRulesFile(_0x53a88a),!![];}export async function copyRulesToAgentsMd(_0x35414d){const _0x26b8da=a132_0x2c7d22,_0x4d8e48=join(_0x35414d,_0x26b8da(0xd7));if(existsSync(_0x4d8e48))return![];return await writeRulesFile(_0x4d8e48),!![];}
1
+ function a130_0x1c37(_0x3d8eda,_0x25b848){_0x3d8eda=_0x3d8eda-0x1cc;const _0xe67abf=a130_0xe67a();let _0x1c370b=_0xe67abf[_0x3d8eda];return _0x1c370b;}const a130_0x13d191=a130_0x1c37;(function(_0x3c659f,_0x1cd929){const _0x24f526=a130_0x1c37,_0xdde557=_0x3c659f();while(!![]){try{const _0x552654=parseInt(_0x24f526(0x1e3))/0x1*(parseInt(_0x24f526(0x1d1))/0x2)+parseInt(_0x24f526(0x1d6))/0x3*(parseInt(_0x24f526(0x1d8))/0x4)+-parseInt(_0x24f526(0x1d9))/0x5*(parseInt(_0x24f526(0x1dc))/0x6)+-parseInt(_0x24f526(0x1de))/0x7+-parseInt(_0x24f526(0x1e5))/0x8+parseInt(_0x24f526(0x1cd))/0x9*(-parseInt(_0x24f526(0x1e4))/0xa)+parseInt(_0x24f526(0x1d2))/0xb*(parseInt(_0x24f526(0x1d7))/0xc);if(_0x552654===_0x1cd929)break;else _0xdde557['push'](_0xdde557['shift']());}catch(_0x37a6d3){_0xdde557['push'](_0xdde557['shift']());}}}(a130_0xe67a,0x37dbf));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import{dirname,join,resolve}from'node:path';import{fileURLToPath}from'node:url';import{getTemplateBaseUrl}from'./config.js';import{appendUpdateTime}from'./guides-cdn.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function getRulesCdnUrl(){const _0x4a9a22=a130_0x1c37,_0x194dc4=getTemplateBaseUrl();return _0x194dc4+_0x4a9a22(0x1df);}const LOCAL_TEMPLATE_PATH=resolve(__dirname,a130_0x13d191(0x1e0));export async function fetchRulesFromCDN(){const _0x21b6ac=a130_0x13d191,_0x2374e6=getRulesCdnUrl(),_0x57d2f2=await fetch(_0x2374e6,{'headers':{'Accept':_0x21b6ac(0x1cf)}});if(!_0x57d2f2['ok'])throw new Error(_0x21b6ac(0x1ce)+_0x57d2f2[_0x21b6ac(0x1d3)]+'\x20'+_0x57d2f2['statusText']);const _0x48e245=await _0x57d2f2[_0x21b6ac(0x1cc)]();if(!_0x48e245[_0x21b6ac(0x1d0)]||typeof _0x48e245[_0x21b6ac(0x1d0)]!==_0x21b6ac(0x1d5))throw new Error(_0x21b6ac(0x1d4));return _0x48e245;}export async function getRulesContent(){const _0x44cb74=a130_0x13d191;try{const _0x508e0e=await fetchRulesFromCDN();return _0x508e0e[_0x44cb74(0x1d0)];}catch{return readLocalTemplate();}}export function readLocalTemplate(){const _0x1eec81=a130_0x13d191;if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,_0x1eec81(0x1e2));throw new Error('本地模板文件不存在:\x20'+LOCAL_TEMPLATE_PATH);}function a130_0xe67a(){const _0x46150b=['utf-8','16Lfdhmw','2819480HZqlIx','3318712GMKrIe','json','9XiDCqE','CDN\x20请求失败:\x20','application/json','content','54110pFXpRr','4909982HpQtAl','status','CDN\x20返回数据格式错误','string','69DSRylV','24qpIQIt','60444qFReMg','2235505BRDtDu','lastUpdated','agents.md','6FjcUMl','catch','2103290FvIESM','/rules/rules.json','../../templates/rules/lovrabet_rules.mdc.tpl','.cursor/rules'];a130_0xe67a=function(){return _0x46150b;};return a130_0xe67a();}export async function writeRulesFile(_0x464245){const _0xa3064b=a130_0x13d191,_0x4eab5a=await fetchRulesFromCDN()[_0xa3064b(0x1dd)](()=>null);let _0x1bb40a;_0x4eab5a?(_0x1bb40a=_0x4eab5a[_0xa3064b(0x1d0)],_0x4eab5a['lastUpdated']&&(_0x1bb40a=appendUpdateTime(_0x1bb40a,_0x4eab5a[_0xa3064b(0x1da)]))):_0x1bb40a=readLocalTemplate();const _0x607509=dirname(_0x464245);!existsSync(_0x607509)&&mkdirSync(_0x607509,{'recursive':!![]}),writeFileSync(_0x464245,_0x1bb40a,_0xa3064b(0x1e2));}export async function copyRulesToCursor(_0x229cb7){const _0x48f749=a130_0x13d191,_0x5a467d=join(_0x229cb7,_0x48f749(0x1e1)),_0x2ace9d=join(_0x5a467d,'lovrabet_rules.mdc');if(existsSync(_0x2ace9d))return![];return await writeRulesFile(_0x2ace9d),!![];}export async function copyRulesToAgentsMd(_0x4ac75e){const _0x570f89=a130_0x13d191,_0x37c744=join(_0x4ac75e,_0x570f89(0x1db));if(existsSync(_0x37c744))return![];return await writeRulesFile(_0x37c744),!![];}
@@ -1 +1 @@
1
- export function sleep(_0x54a7d4){return new Promise(_0x57a5c1=>setTimeout(_0x57a5c1,_0x54a7d4));}
1
+ export function sleep(_0x30b7b6){return new Promise(_0x257ca6=>setTimeout(_0x257ca6,_0x30b7b6));}
@@ -1 +1 @@
1
- const a134_0x35ed66=a134_0x3a0e;(function(_0x3e7f40,_0x537493){const _0x28c24d=a134_0x3a0e,_0x862481=_0x3e7f40();while(!![]){try{const _0x1b5a1d=-parseInt(_0x28c24d(0x1ab))/0x1+-parseInt(_0x28c24d(0x18a))/0x2+-parseInt(_0x28c24d(0x18b))/0x3+parseInt(_0x28c24d(0x1aa))/0x4+-parseInt(_0x28c24d(0x187))/0x5*(-parseInt(_0x28c24d(0x1a6))/0x6)+-parseInt(_0x28c24d(0x19c))/0x7+parseInt(_0x28c24d(0x185))/0x8*(parseInt(_0x28c24d(0x1a2))/0x9);if(_0x1b5a1d===_0x537493)break;else _0x862481['push'](_0x862481['shift']());}catch(_0x2a2539){_0x862481['push'](_0x862481['shift']());}}}(a134_0x2ebb,0x2d367));function a134_0x2ebb(){const _0xc4f488=['toISOString','success','2058363iCMGsC','split','toLocaleTimeString','replaceApiContent','72216SKqtTQ','replace','error','pop','1314504tEQKNw','295316zlJhdw','tableName','.json','writeFile','toLocaleDateString','endsWith','toLocaleString','\x20},','.jsx','utf8','readdir','datasetCode:\x20\x22','promises','numeric','push','name','processFile','now','readFile','2-digit','charAt','toUpperCase','mkdir','api','YourModel','开始处理模板内容替换','message','.css','slice','模板内容替换完成','16FZJNih','copyFile','85UVRUPf','processDirectory','toDisplayTitle','374084urTAdf','683094ABYsNs','isFile','LOVRABET','toComponentName','template','\x0a\x20\x20\x20\x20{\x20','includes','.scss','map','.md','.tpl','datasetCode','toLowerCase','.tsx','replaceContent','processTemplate','.js','667835NJLGFl','tableName:\x20\x22','alias','join'];a134_0x2ebb=function(){return _0xc4f488;};return a134_0x2ebb();}import a134_0xfa34ad from'node:fs';import a134_0x4b9670 from'node:path';function a134_0x3a0e(_0x2b6679,_0x5bda3f){_0x2b6679=_0x2b6679-0x16b;const _0x2ebb07=a134_0x2ebb();let _0x3a0ec6=_0x2ebb07[_0x2b6679];return _0x3a0ec6;}import{logger}from'./logger.js';import{getCliVersion}from'./version.js';const CLI_VERSION=getCliVersion();export class TemplateReplacer{static[a134_0x35ed66(0x18e)](_0x21cd7b){const _0x12e7d2=a134_0x35ed66,_0x144fd0=_0x21cd7b[_0x12e7d2(0x1a3)]('/')[_0x12e7d2(0x1a9)]()||_0x21cd7b;return _0x144fd0[_0x12e7d2(0x1a3)]('-')[_0x12e7d2(0x193)](_0x3489dd=>_0x3489dd[_0x12e7d2(0x17b)](0x0)['toUpperCase']()+_0x3489dd[_0x12e7d2(0x183)](0x1)['toLowerCase']())[_0x12e7d2(0x19f)]('');}static[a134_0x35ed66(0x189)](_0x3b5b1f){const _0x3036c9=a134_0x35ed66,_0x14a822=_0x3b5b1f[_0x3036c9(0x1a3)]('/')[_0x3036c9(0x1a9)]()||_0x3b5b1f;return _0x14a822[_0x3036c9(0x1a3)]('-')[_0x3036c9(0x193)](_0x551f3d=>_0x551f3d[_0x3036c9(0x17b)](0x0)[_0x3036c9(0x17c)]()+_0x551f3d[_0x3036c9(0x183)](0x1)[_0x3036c9(0x197)]())['join']('\x20');}static[a134_0x35ed66(0x199)](_0x41c2b1,_0x1ba6e0,_0x3716e0){const _0x149c33=a134_0x35ed66,_0x5c2cef=this[_0x149c33(0x18e)](_0x1ba6e0),_0x1d37c7=this[_0x149c33(0x189)](_0x1ba6e0),_0x4ba153=new Date(),_0x1f4a95=_0x4ba153[_0x149c33(0x16d)](undefined,{'year':_0x149c33(0x174),'month':_0x149c33(0x17a),'day':'2-digit','hour':_0x149c33(0x17a),'minute':'2-digit','second':_0x149c33(0x17a),'hour12':![]})['replace'](/\//g,'-'),_0x39dbcf=_0x4ba153[_0x149c33(0x16b)](undefined,{'year':_0x149c33(0x174),'month':_0x149c33(0x17a),'day':'2-digit'})['replace'](/\//g,'-'),_0x5a81c6=_0x4ba153[_0x149c33(0x1a4)](undefined,{'hour12':![]});let _0x11ea3a=_0x41c2b1[_0x149c33(0x1a7)](/\{CliVersion\}/g,CLI_VERSION)['replace'](/\{ComponentName\}/g,_0x5c2cef)[_0x149c33(0x1a7)](/\{DisplayTitle\}/g,_0x1d37c7)[_0x149c33(0x1a7)](/\{PageName\}/g,_0x1ba6e0)[_0x149c33(0x1a7)](/\{TemplateName\}/g,_0x3716e0)[_0x149c33(0x1a7)](/\{CreatedAt\}/g,_0x1f4a95)[_0x149c33(0x1a7)](/\{CreatedDate\}/g,_0x39dbcf)[_0x149c33(0x1a7)](/\{CreatedTime\}/g,_0x5a81c6);return _0x11ea3a;}static[a134_0x35ed66(0x1a5)](_0x501561,_0x4350b8,_0x4ba98c,_0x509184,_0x1b992d,_0x35c70c,_0x52d36d,_0x76032b){const _0x39b036=a134_0x35ed66,_0x41aea6=new Date(),_0x4ee418=_0x41aea6[_0x39b036(0x1a0)](),_0x434dc7=_0x4ba98c[_0x39b036(0x193)](_0x37c813=>{const _0x4acc97=_0x39b036,_0xd59083=[_0x4acc97(0x172)+_0x37c813[_0x4acc97(0x196)]+'\x22',_0x4acc97(0x19d)+_0x37c813[_0x4acc97(0x1ac)]+'\x22','name:\x20\x22'+_0x37c813['name']+'\x22'];return _0x37c813[_0x4acc97(0x19e)]&&_0xd59083[_0x4acc97(0x175)]('alias:\x20\x22'+_0x37c813[_0x4acc97(0x19e)]+'\x22'),_0x4acc97(0x190)+_0xd59083[_0x4acc97(0x19f)](',\x20')+_0x4acc97(0x16e);})[_0x39b036(0x19f)](''),_0x90913b=_0x509184||_0x4ba98c[0x0]?.[_0x39b036(0x19e)]||_0x39b036(0x17f);let _0x3926db=_0x501561[_0x39b036(0x1a7)](/\{AppCode\}/g,_0x4350b8)['replace'](/\{ModelConfigs\}/g,_0x434dc7)[_0x39b036(0x1a7)](/\{ExampleModelName\}/g,_0x90913b)[_0x39b036(0x1a7)](/\{ApiFileName\}/g,_0x1b992d||_0x39b036(0x17e))['replace'](/\{ConfigName\}/g,_0x35c70c||'default')[_0x39b036(0x1a7)](/\{ClientConfigParam\}/g,_0x52d36d||'')[_0x39b036(0x1a7)](/\{VarPrefix\}/g,_0x76032b||_0x39b036(0x18d))['replace'](/\{CreatedAt\}/g,_0x4ee418);return _0x3926db;}static async[a134_0x35ed66(0x19a)](_0x3f0b34,_0x35fddd,_0x4b11b2,_0xbddc3,_0x2ea13f=!![]){const _0x3e8879=a134_0x35ed66,_0x21e3d1=Date[_0x3e8879(0x178)]();try{_0x2ea13f&&logger['info']('template',_0x3e8879(0x180),{'templatePath':_0x3f0b34,'targetPath':_0x35fddd,'pageName':_0x4b11b2,'templateName':_0xbddc3});await a134_0xfa34ad[_0x3e8879(0x173)][_0x3e8879(0x17d)](_0x35fddd,{'recursive':!![]}),await this['processDirectory'](_0x3f0b34,_0x35fddd,_0x4b11b2,_0xbddc3);if(_0x2ea13f){const _0x4d517f=Date['now']()-_0x21e3d1;logger[_0x3e8879(0x1a1)](_0x3e8879(0x18f),_0x3e8879(0x184),_0x4d517f,{'pageName':_0x4b11b2,'templateName':_0xbddc3});}}catch(_0xf22747){if(_0x2ea13f){const _0x25d4dc=Date[_0x3e8879(0x178)]()-_0x21e3d1;logger[_0x3e8879(0x1a8)](_0x3e8879(0x18f),'模板内容替换失败',{'templatePath':_0x3f0b34,'targetPath':_0x35fddd,'pageName':_0x4b11b2,'templateName':_0xbddc3,'error':_0xf22747 instanceof Error?_0xf22747[_0x3e8879(0x181)]:String(_0xf22747),'duration':_0x25d4dc});}throw _0xf22747;}}static async[a134_0x35ed66(0x188)](_0x82b3d,_0x3d6fd9,_0x3d9fbc,_0x2b395b){const _0x1be4f6=a134_0x35ed66,_0x3333b1=await a134_0xfa34ad[_0x1be4f6(0x173)][_0x1be4f6(0x171)](_0x82b3d,{'withFileTypes':!![]});for(const _0xcd2057 of _0x3333b1){const _0x4ea76e=a134_0x4b9670[_0x1be4f6(0x19f)](_0x82b3d,_0xcd2057[_0x1be4f6(0x176)]);let _0x17b801=a134_0x4b9670[_0x1be4f6(0x19f)](_0x3d6fd9,_0xcd2057[_0x1be4f6(0x176)]);_0xcd2057[_0x1be4f6(0x176)][_0x1be4f6(0x16c)]('.tpl')&&(_0x17b801=a134_0x4b9670[_0x1be4f6(0x19f)](_0x3d6fd9,_0xcd2057[_0x1be4f6(0x176)][_0x1be4f6(0x1a7)](/\.tpl$/,'')));if(_0xcd2057['isDirectory']())await a134_0xfa34ad[_0x1be4f6(0x173)][_0x1be4f6(0x17d)](_0x17b801,{'recursive':!![]}),await this[_0x1be4f6(0x188)](_0x4ea76e,_0x17b801,_0x3d9fbc,_0x2b395b);else _0xcd2057[_0x1be4f6(0x18c)]()&&await this[_0x1be4f6(0x177)](_0x4ea76e,_0x17b801,_0x3d9fbc,_0x2b395b);}}static async[a134_0x35ed66(0x177)](_0x325cdf,_0x4c78fa,_0x156d07,_0x8a385d){const _0x1f615d=a134_0x35ed66,_0x42540f=a134_0x4b9670['extname'](_0x325cdf)[_0x1f615d(0x197)]();_0x325cdf['endsWith']('.tpl')&&(_0x4c78fa=_0x4c78fa[_0x1f615d(0x1a7)](/\.tpl$/,''));const _0x1e1202=[_0x1f615d(0x198),'.ts',_0x1f615d(0x16f),_0x1f615d(0x19b),_0x1f615d(0x1ad),_0x1f615d(0x194),_0x1f615d(0x182),_0x1f615d(0x192),_0x1f615d(0x195)];if(_0x1e1202[_0x1f615d(0x191)](_0x42540f)||_0x325cdf[_0x1f615d(0x16c)](_0x1f615d(0x195))){const _0x3cc683=await a134_0xfa34ad[_0x1f615d(0x173)][_0x1f615d(0x179)](_0x325cdf,'utf8'),_0x5582be=this[_0x1f615d(0x199)](_0x3cc683,_0x156d07,_0x8a385d);await a134_0xfa34ad['promises'][_0x1f615d(0x1ae)](_0x4c78fa,_0x5582be,_0x1f615d(0x170));}else await a134_0xfa34ad['promises'][_0x1f615d(0x186)](_0x325cdf,_0x4c78fa);}}
1
+ const a132_0x3d4cf4=a132_0x5c53;(function(_0x2a37b2,_0x495c26){const _0x34e0d4=a132_0x5c53,_0x413e3d=_0x2a37b2();while(!![]){try{const _0x1ae413=-parseInt(_0x34e0d4(0x94))/0x1*(-parseInt(_0x34e0d4(0x68))/0x2)+parseInt(_0x34e0d4(0xa6))/0x3+-parseInt(_0x34e0d4(0x8d))/0x4+parseInt(_0x34e0d4(0x67))/0x5+-parseInt(_0x34e0d4(0x91))/0x6*(-parseInt(_0x34e0d4(0xa1))/0x7)+parseInt(_0x34e0d4(0x90))/0x8*(-parseInt(_0x34e0d4(0x7e))/0x9)+parseInt(_0x34e0d4(0x81))/0xa*(-parseInt(_0x34e0d4(0x86))/0xb);if(_0x1ae413===_0x495c26)break;else _0x413e3d['push'](_0x413e3d['shift']());}catch(_0x31861b){_0x413e3d['push'](_0x413e3d['shift']());}}}(a132_0x1a65,0x56522));import a132_0x545e31 from'node:fs';import a132_0x7bbee5 from'node:path';function a132_0x5c53(_0x3e3b59,_0x26e266){_0x3e3b59=_0x3e3b59-0x66;const _0x1a650c=a132_0x1a65();let _0x5c53c2=_0x1a650c[_0x3e3b59];return _0x5c53c2;}import{logger}from'./logger.js';import{getCliVersion}from'./version.js';const CLI_VERSION=getCliVersion();export class TemplateReplacer{static[a132_0x3d4cf4(0x95)](_0x141144){const _0x2be606=a132_0x3d4cf4,_0x172242=_0x141144['split']('/')[_0x2be606(0x80)]()||_0x141144;return _0x172242[_0x2be606(0x89)]('-')[_0x2be606(0x84)](_0x573f0f=>_0x573f0f[_0x2be606(0x74)](0x0)[_0x2be606(0x7d)]()+_0x573f0f[_0x2be606(0x88)](0x1)[_0x2be606(0x83)]())[_0x2be606(0x8b)]('');}static['toDisplayTitle'](_0x41031f){const _0x3afd0e=a132_0x3d4cf4,_0x3edb07=_0x41031f['split']('/')['pop']()||_0x41031f;return _0x3edb07[_0x3afd0e(0x89)]('-')['map'](_0x3b74d3=>_0x3b74d3[_0x3afd0e(0x74)](0x0)['toUpperCase']()+_0x3b74d3[_0x3afd0e(0x88)](0x1)[_0x3afd0e(0x83)]())['join']('\x20');}static[a132_0x3d4cf4(0x6f)](_0x20812d,_0x1f3111,_0x548405){const _0x584b3e=a132_0x3d4cf4,_0x194038=this[_0x584b3e(0x95)](_0x1f3111),_0x4d124b=this['toDisplayTitle'](_0x1f3111),_0x267149=new Date(),_0x2e1149=_0x267149[_0x584b3e(0x79)](undefined,{'year':_0x584b3e(0xa7),'month':_0x584b3e(0x8c),'day':_0x584b3e(0x8c),'hour':'2-digit','minute':_0x584b3e(0x8c),'second':'2-digit','hour12':![]})[_0x584b3e(0x70)](/\//g,'-'),_0x2409fe=_0x267149[_0x584b3e(0x66)](undefined,{'year':_0x584b3e(0xa7),'month':'2-digit','day':'2-digit'})[_0x584b3e(0x70)](/\//g,'-'),_0x1ea8ed=_0x267149[_0x584b3e(0x75)](undefined,{'hour12':![]});let _0x2a84e7=_0x20812d[_0x584b3e(0x70)](/\{CliVersion\}/g,CLI_VERSION)['replace'](/\{ComponentName\}/g,_0x194038)[_0x584b3e(0x70)](/\{DisplayTitle\}/g,_0x4d124b)[_0x584b3e(0x70)](/\{PageName\}/g,_0x1f3111)[_0x584b3e(0x70)](/\{TemplateName\}/g,_0x548405)[_0x584b3e(0x70)](/\{CreatedAt\}/g,_0x2e1149)['replace'](/\{CreatedDate\}/g,_0x2409fe)[_0x584b3e(0x70)](/\{CreatedTime\}/g,_0x1ea8ed);return _0x2a84e7;}static[a132_0x3d4cf4(0x69)](_0x19f5b2,_0x50a57c,_0x91e5a6,_0x44238c,_0x57566e,_0xdb6960,_0x5d9762,_0x7b9a44){const _0x278bae=a132_0x3d4cf4,_0x1e2c88=new Date(),_0x7d99ce=_0x1e2c88[_0x278bae(0xa8)](),_0x12348e=_0x91e5a6[_0x278bae(0x84)](_0x78c509=>{const _0x110b1b=_0x278bae,_0x579793=[_0x110b1b(0x7c)+_0x78c509['datasetCode']+'\x22','tableName:\x20\x22'+_0x78c509[_0x110b1b(0x82)]+'\x22',_0x110b1b(0x6d)+_0x78c509[_0x110b1b(0x92)]+'\x22'];return _0x78c509['alias']&&_0x579793[_0x110b1b(0x7f)]('alias:\x20\x22'+_0x78c509[_0x110b1b(0x9c)]+'\x22'),_0x110b1b(0x99)+_0x579793[_0x110b1b(0x8b)](',\x20')+_0x110b1b(0x6e);})[_0x278bae(0x8b)](''),_0x405a32=_0x44238c||_0x91e5a6[0x0]?.['alias']||_0x278bae(0x8a);let _0x484d23=_0x19f5b2[_0x278bae(0x70)](/\{AppCode\}/g,_0x50a57c)['replace'](/\{ModelConfigs\}/g,_0x12348e)[_0x278bae(0x70)](/\{ExampleModelName\}/g,_0x405a32)[_0x278bae(0x70)](/\{ApiFileName\}/g,_0x57566e||_0x278bae(0x98))[_0x278bae(0x70)](/\{ConfigName\}/g,_0xdb6960||_0x278bae(0x72))['replace'](/\{ClientConfigParam\}/g,_0x5d9762||'')[_0x278bae(0x70)](/\{VarPrefix\}/g,_0x7b9a44||_0x278bae(0x9a))[_0x278bae(0x70)](/\{CreatedAt\}/g,_0x7d99ce);return _0x484d23;}static async['processTemplate'](_0x1b9ac7,_0xf8b44c,_0x2c03ce,_0x2a2378,_0x17c745=!![]){const _0x57bb93=a132_0x3d4cf4,_0x9ee78=Date['now']();try{_0x17c745&&logger[_0x57bb93(0x7b)](_0x57bb93(0xa0),_0x57bb93(0x8f),{'templatePath':_0x1b9ac7,'targetPath':_0xf8b44c,'pageName':_0x2c03ce,'templateName':_0x2a2378});await a132_0x545e31[_0x57bb93(0x77)][_0x57bb93(0x76)](_0xf8b44c,{'recursive':!![]}),await this[_0x57bb93(0x85)](_0x1b9ac7,_0xf8b44c,_0x2c03ce,_0x2a2378);if(_0x17c745){const _0xd664f4=Date[_0x57bb93(0x78)]()-_0x9ee78;logger['success'](_0x57bb93(0xa0),_0x57bb93(0x97),_0xd664f4,{'pageName':_0x2c03ce,'templateName':_0x2a2378});}}catch(_0x7df323){if(_0x17c745){const _0x427635=Date[_0x57bb93(0x78)]()-_0x9ee78;logger[_0x57bb93(0x71)](_0x57bb93(0xa0),_0x57bb93(0xa5),{'templatePath':_0x1b9ac7,'targetPath':_0xf8b44c,'pageName':_0x2c03ce,'templateName':_0x2a2378,'error':_0x7df323 instanceof Error?_0x7df323[_0x57bb93(0x93)]:String(_0x7df323),'duration':_0x427635});}throw _0x7df323;}}static async[a132_0x3d4cf4(0x85)](_0x24d753,_0x195181,_0x40ccaa,_0x37b0dd){const _0x1deec3=a132_0x3d4cf4,_0x3a5338=await a132_0x545e31[_0x1deec3(0x77)]['readdir'](_0x24d753,{'withFileTypes':!![]});for(const _0x435e2b of _0x3a5338){const _0x45bfb3=a132_0x7bbee5['join'](_0x24d753,_0x435e2b['name']);let _0x30c367=a132_0x7bbee5['join'](_0x195181,_0x435e2b['name']);_0x435e2b[_0x1deec3(0x92)][_0x1deec3(0x96)](_0x1deec3(0x6c))&&(_0x30c367=a132_0x7bbee5[_0x1deec3(0x8b)](_0x195181,_0x435e2b['name'][_0x1deec3(0x70)](/\.tpl$/,'')));if(_0x435e2b[_0x1deec3(0x6a)]())await a132_0x545e31[_0x1deec3(0x77)][_0x1deec3(0x76)](_0x30c367,{'recursive':!![]}),await this[_0x1deec3(0x85)](_0x45bfb3,_0x30c367,_0x40ccaa,_0x37b0dd);else _0x435e2b[_0x1deec3(0xa3)]()&&await this[_0x1deec3(0x8e)](_0x45bfb3,_0x30c367,_0x40ccaa,_0x37b0dd);}}static async['processFile'](_0x215c56,_0x270c69,_0x154b66,_0x4e8bb1){const _0x5b1125=a132_0x3d4cf4,_0x3f7938=a132_0x7bbee5[_0x5b1125(0x9e)](_0x215c56)['toLowerCase']();_0x215c56[_0x5b1125(0x96)](_0x5b1125(0x6c))&&(_0x270c69=_0x270c69[_0x5b1125(0x70)](/\.tpl$/,''));const _0x3d56b3=[_0x5b1125(0xa2),_0x5b1125(0xa4),'.jsx',_0x5b1125(0x9f),'.json',_0x5b1125(0x9d),_0x5b1125(0x6b),_0x5b1125(0x7a),_0x5b1125(0x6c)];if(_0x3d56b3['includes'](_0x3f7938)||_0x215c56[_0x5b1125(0x96)](_0x5b1125(0x6c))){const _0x323d92=await a132_0x545e31['promises'][_0x5b1125(0x73)](_0x215c56,'utf8'),_0x57b830=this[_0x5b1125(0x6f)](_0x323d92,_0x154b66,_0x4e8bb1);await a132_0x545e31[_0x5b1125(0x77)][_0x5b1125(0x87)](_0x270c69,_0x57b830,'utf8');}else await a132_0x545e31['promises'][_0x5b1125(0x9b)](_0x215c56,_0x270c69);}}function a132_0x1a65(){const _0x591dbe=['replaceApiContent','isDirectory','.css','.tpl','name:\x20\x22','\x20},','replaceContent','replace','error','default','readFile','charAt','toLocaleTimeString','mkdir','promises','now','toLocaleString','.scss','info','datasetCode:\x20\x22','toUpperCase','422037YBkTUR','push','pop','446570SOPiWz','tableName','toLowerCase','map','processDirectory','187iJJOEQ','writeFile','slice','split','YourModel','join','2-digit','326660XvXBXE','processFile','开始处理模板内容替换','16jdDAjl','182424GsBcBd','name','message','20pYrSXO','toComponentName','endsWith','模板内容替换完成','api','\x0a\x20\x20\x20\x20{\x20','LOVRABET','copyFile','alias','.md','extname','.js','template','161YKpHBu','.tsx','isFile','.ts','模板内容替换失败','26433HUOwil','numeric','toISOString','toLocaleDateString','1048435SyGudq','37040xbpFJN'];a132_0x1a65=function(){return _0x591dbe;};return a132_0x1a65();}
@@ -1 +1 @@
1
- function a135_0x5082(_0x25e265,_0x4fb69e){_0x25e265=_0x25e265-0xc5;var _0x42bd91=a135_0x42bd();var _0x50822c=_0x42bd91[_0x25e265];return _0x50822c;}(function(_0x416215,_0x26a32d){var _0x1519f5=a135_0x5082,_0x8d8a06=_0x416215();while(!![]){try{var _0x19e16b=parseInt(_0x1519f5(0xc7))/0x1+-parseInt(_0x1519f5(0xc8))/0x2*(parseInt(_0x1519f5(0xca))/0x3)+parseInt(_0x1519f5(0xcc))/0x4*(-parseInt(_0x1519f5(0xcf))/0x5)+-parseInt(_0x1519f5(0xce))/0x6+-parseInt(_0x1519f5(0xc9))/0x7*(parseInt(_0x1519f5(0xc5))/0x8)+parseInt(_0x1519f5(0xcb))/0x9*(parseInt(_0x1519f5(0xcd))/0xa)+parseInt(_0x1519f5(0xc6))/0xb;if(_0x19e16b===_0x26a32d)break;else _0x8d8a06['push'](_0x8d8a06['shift']());}catch(_0x85bc6){_0x8d8a06['push'](_0x8d8a06['shift']());}}}(a135_0x42bd,0x7a119));function a135_0x42bd(){var _0x4d7ddd=['11981wuVgpe','14BUWDER','25928WyDpoO','312789MhzVCi','821025IzirGg','12ijfmxc','10bCuPEI','3568092hbrTiY','1284345uavXDu','1560gTWwBC','35356167DhQIdp'];a135_0x42bd=function(){return _0x4d7ddd;};return a135_0x42bd();}import{VERSION}from'../generated/build-info.js';export function getCliVersion(){return VERSION;}
1
+ (function(_0x59044c,_0xe6aeb0){var _0x5b985f=a133_0x2a1d,_0x3abb5b=_0x59044c();while(!![]){try{var _0x4a2242=parseInt(_0x5b985f(0xa9))/0x1*(parseInt(_0x5b985f(0xa2))/0x2)+parseInt(_0x5b985f(0xa8))/0x3+parseInt(_0x5b985f(0xa6))/0x4+parseInt(_0x5b985f(0xaa))/0x5*(-parseInt(_0x5b985f(0xa1))/0x6)+parseInt(_0x5b985f(0xa5))/0x7+parseInt(_0x5b985f(0xa7))/0x8*(-parseInt(_0x5b985f(0xa3))/0x9)+-parseInt(_0x5b985f(0xab))/0xa*(-parseInt(_0x5b985f(0xa4))/0xb);if(_0x4a2242===_0xe6aeb0)break;else _0x3abb5b['push'](_0x3abb5b['shift']());}catch(_0x12279c){_0x3abb5b['push'](_0x3abb5b['shift']());}}}(a133_0x16c9,0x30dd0));function a133_0x16c9(){var _0x4237b8=['192358HJwEDS','3289329VGIubH','10219oCwdCC','2533006OqxiNH','1574368blUFFK','8XCVHTy','238725GfxyoC','1JOvmYp','30710KuenYg','230uUzINU','378HYLwQI'];a133_0x16c9=function(){return _0x4237b8;};return a133_0x16c9();}function a133_0x2a1d(_0x51fd9b,_0xfe01bb){_0x51fd9b=_0x51fd9b-0xa1;var _0x16c9b2=a133_0x16c9();var _0x2a1d7e=_0x16c9b2[_0x51fd9b];return _0x2a1d7e;}import{VERSION}from'../generated/build-info.js';export function getCliVersion(){return VERSION;}
@@ -1 +1 @@
1
- (function(_0x6efd7d,_0x45aace){var _0xb1c40a=a136_0x1153,_0x3bf02f=_0x6efd7d();while(!![]){try{var _0x458bde=parseInt(_0xb1c40a(0x14f))/0x1+-parseInt(_0xb1c40a(0x156))/0x2*(parseInt(_0xb1c40a(0x152))/0x3)+-parseInt(_0xb1c40a(0x157))/0x4*(-parseInt(_0xb1c40a(0x158))/0x5)+-parseInt(_0xb1c40a(0x154))/0x6*(-parseInt(_0xb1c40a(0x151))/0x7)+-parseInt(_0xb1c40a(0x150))/0x8+parseInt(_0xb1c40a(0x159))/0x9*(-parseInt(_0xb1c40a(0x155))/0xa)+parseInt(_0xb1c40a(0x153))/0xb;if(_0x458bde===_0x45aace)break;else _0x3bf02f['push'](_0x3bf02f['shift']());}catch(_0x18fdeb){_0x3bf02f['push'](_0x3bf02f['shift']());}}}(a136_0x4b93,0xc343f));import{setActiveCookie,clearActiveCookie}from'../core/api-client.js';function a136_0x4b93(){var _0x337155=['12742994VNJMpM','516198rzLIIO','391680QEryhY','12BCrBSB','29904ygqjkp','450vRiOiL','18enFJIS','243650YnJShK','9249632AOKZru','49crKguP','321414CuVSMb'];a136_0x4b93=function(){return _0x337155;};return a136_0x4b93();}function a136_0x1153(_0x22d2a9,_0x5448f0){_0x22d2a9=_0x22d2a9-0x14f;var _0x4b93f9=a136_0x4b93();var _0x115324=_0x4b93f9[_0x22d2a9];return _0x115324;}export async function withActiveCookie(_0x3e6c7a,_0x1c28bb){setActiveCookie(_0x3e6c7a);try{return await _0x1c28bb();}finally{clearActiveCookie();}}
1
+ function a134_0x5627(){var _0x28dca9=['110139XRNxcM','1669997RKKzGM','10ODVZKu','457301ApitGb','12pxNfDj','3568OvfCGV','23409mTFtSc','2134562eHKzCp','23189630tSHddy','807642FAaTvn'];a134_0x5627=function(){return _0x28dca9;};return a134_0x5627();}(function(_0x4684f2,_0x1a688b){var _0x2a9b9a=a134_0x1aae,_0x42f370=_0x4684f2();while(!![]){try{var _0x3dfb4e=parseInt(_0x2a9b9a(0x14b))/0x1+-parseInt(_0x2a9b9a(0x14f))/0x2+parseInt(_0x2a9b9a(0x148))/0x3*(parseInt(_0x2a9b9a(0x14c))/0x4)+parseInt(_0x2a9b9a(0x14a))/0x5*(-parseInt(_0x2a9b9a(0x147))/0x6)+parseInt(_0x2a9b9a(0x149))/0x7+parseInt(_0x2a9b9a(0x14d))/0x8*(-parseInt(_0x2a9b9a(0x14e))/0x9)+parseInt(_0x2a9b9a(0x150))/0xa;if(_0x3dfb4e===_0x1a688b)break;else _0x42f370['push'](_0x42f370['shift']());}catch(_0x4764d9){_0x42f370['push'](_0x42f370['shift']());}}}(a134_0x5627,0x996d1));import{setActiveCookie,clearActiveCookie}from'../core/api-client.js';function a134_0x1aae(_0xfe496b,_0x5760a2){_0xfe496b=_0xfe496b-0x147;var _0x5627a2=a134_0x5627();var _0x1aae64=_0x5627a2[_0xfe496b];return _0x1aae64;}export async function withActiveCookie(_0x4b4079,_0xf8d1f9){setActiveCookie(_0x4b4079);try{return await _0xf8d1f9();}finally{clearActiveCookie();}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lovrabet/rabetbase-cli",
3
- "version": "2.0.6",
3
+ "version": "2.0.7",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1 +0,0 @@
1
- function a33_0x65ca(_0x257354,_0x4aaf62){_0x257354=_0x257354-0x1a8;const _0x21a07b=a33_0x21a0();let _0x65ca8a=_0x21a07b[_0x257354];return _0x65ca8a;}const a33_0x547156=a33_0x65ca;(function(_0x1e3c54,_0xbbf850){const _0xaa7b05=a33_0x65ca,_0xfc3871=_0x1e3c54();while(!![]){try{const _0x540680=-parseInt(_0xaa7b05(0x1af))/0x1*(parseInt(_0xaa7b05(0x1a8))/0x2)+parseInt(_0xaa7b05(0x1ac))/0x3*(parseInt(_0xaa7b05(0x1bf))/0x4)+-parseInt(_0xaa7b05(0x1bc))/0x5*(-parseInt(_0xaa7b05(0x1ab))/0x6)+-parseInt(_0xaa7b05(0x1ba))/0x7+parseInt(_0xaa7b05(0x1b8))/0x8*(parseInt(_0xaa7b05(0x1bb))/0x9)+parseInt(_0xaa7b05(0x1ae))/0xa+-parseInt(_0xaa7b05(0x1bd))/0xb;if(_0x540680===_0xbbf850)break;else _0xfc3871['push'](_0xfc3871['shift']());}catch(_0x4471b0){_0xfc3871['push'](_0xfc3871['shift']());}}}(a33_0x21a0,0xcadb1));function a33_0x21a0(){const _0x260ace=['84FcngPY','项目构建成功','8340300fgBOls','241UqBZFT','logger','cwd','stderr','node_modules','npm\x20run\x20build','error','now','info','504ylOAKd','.bin','4611908KllUCC','145188kfKcWu','630335VIPLue','10489017MNkSGp','开始构建项目','135588FyZgSw','toString','trim','Build\x20project','message','build','inherit','close','run','4002lrNhwY','npm','npm\x20run\x20build\x20exited\x20with\x20code\x20','6KeZlNX'];a33_0x21a0=function(){return _0x260ace;};return a33_0x21a0();}import{delimiter,join}from'node:path';import{spawn}from'node:child_process';function runBuild(_0x4dcaed){return new Promise((_0x5d2dd5,_0x4c04f4)=>{const _0xf9937e=a33_0x65ca,_0x424f19=Date[_0xf9937e(0x1b6)]();_0x4dcaed['logger'][_0xf9937e(0x1b7)](_0xf9937e(0x1c4),_0xf9937e(0x1be),{'command':_0xf9937e(0x1b4)});let _0x479507='';const _0x86a9c7=spawn(_0xf9937e(0x1a9),[_0xf9937e(0x1c7),_0xf9937e(0x1c4)],{'stdio':[_0xf9937e(0x1c5),_0xf9937e(0x1c5),'pipe'],'shell':!![],'env':{...process.env,'PATH':''+join(process[_0xf9937e(0x1b1)](),_0xf9937e(0x1b3),_0xf9937e(0x1b9))+delimiter+process.env.PATH}});_0x86a9c7[_0xf9937e(0x1b2)]?.['on']('data',_0x21a148=>{const _0x384983=_0xf9937e;_0x479507+=_0x21a148[_0x384983(0x1c0)]();}),_0x86a9c7['on'](_0xf9937e(0x1c6),_0x3ca3ea=>{const _0x4558f9=_0xf9937e,_0x484bb7=Date['now']()-_0x424f19;if(_0x3ca3ea===0x0||_0x3ca3ea===null)_0x4dcaed[_0x4558f9(0x1b0)]['success'](_0x4558f9(0x1c4),_0x4558f9(0x1ad),_0x484bb7),_0x5d2dd5();else{const _0x496629={'exitCode':_0x3ca3ea,'duration':_0x484bb7,'command':'npm\x20run\x20build','cwd':process[_0x4558f9(0x1b1)]()};_0x479507[_0x4558f9(0x1c1)]()&&(_0x496629[_0x4558f9(0x1b2)]=_0x479507[_0x4558f9(0x1c1)]()),_0x4dcaed[_0x4558f9(0x1b0)][_0x4558f9(0x1b5)]('build','项目构建失败',_0x496629),_0x4c04f4(new Error(_0x4558f9(0x1aa)+_0x3ca3ea));}}),_0x86a9c7['on'](_0xf9937e(0x1b5),_0x1aea3a=>{const _0x33127f=_0xf9937e,_0x3edd11=Date[_0x33127f(0x1b6)]()-_0x424f19;_0x4dcaed[_0x33127f(0x1b0)][_0x33127f(0x1b5)](_0x33127f(0x1c4),'项目构建出错',{'error':_0x1aea3a[_0x33127f(0x1c3)],'duration':_0x3edd11,'stderr':_0x479507[_0x33127f(0x1c1)]()||undefined}),_0x4c04f4(_0x1aea3a);});});}export const buildCommand={'name':a33_0x547156(0x1c4),'description':a33_0x547156(0x1c2),async 'run'(_0x1ddaa9,_0x58cfa5,_0xfda4eb){await runBuild(_0x1ddaa9);}};
@@ -1 +0,0 @@
1
- const a67_0x36576f=a67_0x522f;(function(_0x33988a,_0x4cc689){const _0x27e379=a67_0x522f,_0x4aed2e=_0x33988a();while(!![]){try{const _0x1b9c9a=parseInt(_0x27e379(0xb0))/0x1+-parseInt(_0x27e379(0xb5))/0x2*(parseInt(_0x27e379(0xaf))/0x3)+-parseInt(_0x27e379(0xad))/0x4+parseInt(_0x27e379(0xc5))/0x5+-parseInt(_0x27e379(0xb7))/0x6*(-parseInt(_0x27e379(0xac))/0x7)+-parseInt(_0x27e379(0xba))/0x8+parseInt(_0x27e379(0xc4))/0x9*(parseInt(_0x27e379(0xa6))/0xa);if(_0x1b9c9a===_0x4cc689)break;else _0x4aed2e['push'](_0x4aed2e['shift']());}catch(_0x1a3633){_0x4aed2e['push'](_0x4aed2e['shift']());}}}(a67_0x48f9,0xd71da));import{delimiter,join}from'node:path';function a67_0x522f(_0x5bee15,_0x5af10e){_0x5bee15=_0x5bee15-0xa3;const _0x48f927=a67_0x48f9();let _0x522fa1=_0x48f927[_0x5bee15];return _0x522fa1;}function a67_0x48f9(){const _0x4ce4df=['inherit','vite\x20preview\x20exited\x20with\x20code\x20','watch','vite','执行预览命令','trim','预览服务器启动成功','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','979812NczbIq','2734195EfiSIn','stderr','toString','预览服务器启动失败','message','\x20(监听模式)','--watch','close','160yzWwhw','info','success','all','cwd','preview','14147XacxNA','350548lKCsAE','error','1500EKoeRf','1136847Fkbmmh','build','logger','.bin','data','3992RsYeVk','预览服务器启动出错','84OHOCIX','now','vite\x20preview','11896936BpRgPg','node_modules'];a67_0x48f9=function(){return _0x4ce4df;};return a67_0x48f9();}import{spawn}from'node:child_process';function runPreview(_0x509d2e){return new Promise((_0x312b08,_0x1de08e)=>{const _0x2d704d=a67_0x522f,_0x3efc3b=Date[_0x2d704d(0xb8)]();_0x509d2e[_0x2d704d(0xb2)][_0x2d704d(0xa7)](_0x2d704d(0xab),'启动预览服务器',{'command':'vite\x20preview'});let _0x160ea3='';const _0x30569c=spawn(_0x2d704d(0xbf),[_0x2d704d(0xab)],{'stdio':[_0x2d704d(0xbc),'inherit','pipe'],'shell':!![],'env':{...process.env,'PATH':''+join(process[_0x2d704d(0xaa)](),_0x2d704d(0xbb),_0x2d704d(0xb3))+delimiter+process.env.PATH}});_0x30569c['stderr']?.['on'](_0x2d704d(0xb4),_0x5eb003=>{const _0x20b342=_0x2d704d;_0x160ea3+=_0x5eb003[_0x20b342(0xc7)]();}),_0x30569c['on'](_0x2d704d(0xa5),_0x46c13a=>{const _0x1d4b4e=_0x2d704d,_0x245379=Date[_0x1d4b4e(0xb8)]()-_0x3efc3b;if(_0x46c13a===0x0||_0x46c13a===null)_0x509d2e['logger'][_0x1d4b4e(0xa8)](_0x1d4b4e(0xab),_0x1d4b4e(0xc2),_0x245379),_0x312b08();else{const _0x4f1c61={'exitCode':_0x46c13a,'duration':_0x245379,'command':_0x1d4b4e(0xb9),'cwd':process[_0x1d4b4e(0xaa)]()};_0x160ea3[_0x1d4b4e(0xc1)]()&&(_0x4f1c61[_0x1d4b4e(0xc6)]=_0x160ea3[_0x1d4b4e(0xc1)]()),_0x509d2e[_0x1d4b4e(0xb2)][_0x1d4b4e(0xae)]('preview',_0x1d4b4e(0xc8),_0x4f1c61),_0x1de08e(new Error(_0x1d4b4e(0xbd)+_0x46c13a));}}),_0x30569c['on'](_0x2d704d(0xae),_0x158ee3=>{const _0x1bb63f=_0x2d704d,_0x302973=Date[_0x1bb63f(0xb8)]()-_0x3efc3b;_0x509d2e[_0x1bb63f(0xb2)][_0x1bb63f(0xae)]('preview',_0x1bb63f(0xb6),{'error':_0x158ee3[_0x1bb63f(0xc9)],'duration':_0x302973,'stderr':_0x160ea3[_0x1bb63f(0xc1)]()||undefined}),_0x1de08e(_0x158ee3);});});}function runBuildWatch(){return new Promise((_0x1993fe,_0xf49607)=>{const _0x3d70bb=a67_0x522f,_0x5caf11=spawn(_0x3d70bb(0xbf),[_0x3d70bb(0xb1),_0x3d70bb(0xa4)],{'stdio':_0x3d70bb(0xbc),'shell':!![],'env':{...process.env,'PATH':''+join(process[_0x3d70bb(0xaa)](),_0x3d70bb(0xbb),'.bin')+delimiter+process.env.PATH}});_0x5caf11['on'](_0x3d70bb(0xa5),_0x26785c=>{const _0x5d3add=_0x3d70bb;if(_0x26785c===0x0||_0x26785c===null)_0x1993fe();else _0xf49607(new Error(_0x5d3add(0xc3)+_0x26785c));}),_0x5caf11['on']('error',_0xf49607);});}export const previewCommand={'name':a67_0x36576f(0xab),'description':'Preview\x20project',async 'run'(_0x3a4bfc,_0x52951e,_0x435ebe){const _0x514218=a67_0x36576f,_0x2cfe3d=_0x435ebe[_0x514218(0xbe)];_0x3a4bfc['logger'][_0x514218(0xa7)]('preview',_0x514218(0xc0)+(_0x2cfe3d?_0x514218(0xa3):'')),_0x2cfe3d?await Promise[_0x514218(0xa9)]([runBuildWatch(),runPreview(_0x3a4bfc)]):await runPreview(_0x3a4bfc);}};
@@ -1 +0,0 @@
1
- (function(_0x220217,_0x156954){const _0x38c2fa=a69_0x25aa,_0x5665de=_0x220217();while(!![]){try{const _0x37a706=-parseInt(_0x38c2fa(0x13f))/0x1+parseInt(_0x38c2fa(0x134))/0x2*(-parseInt(_0x38c2fa(0x16e))/0x3)+-parseInt(_0x38c2fa(0x12e))/0x4+-parseInt(_0x38c2fa(0x145))/0x5+-parseInt(_0x38c2fa(0x160))/0x6+parseInt(_0x38c2fa(0x111))/0x7*(parseInt(_0x38c2fa(0x13b))/0x8)+parseInt(_0x38c2fa(0x11c))/0x9*(parseInt(_0x38c2fa(0x153))/0xa);if(_0x37a706===_0x156954)break;else _0x5665de['push'](_0x5665de['shift']());}catch(_0x264456){_0x5665de['push'](_0x5665de['shift']());}}}(a69_0x347c,0xcb3c4));import a69_0x5c2f83 from'chalk';function a69_0x25aa(_0x1d8d7c,_0xa5c4b){_0x1d8d7c=_0x1d8d7c-0x10a;const _0x347c49=a69_0x347c();let _0x25aacb=_0x347c49[_0x1d8d7c];return _0x25aacb;}import a69_0x398037 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';function a69_0x347c(){const _0x399f77=['899360JYuHFn','inherit','lovrabet/rabetbase\x20installed\x20globally','\x20removed\x20(','@lovrabet/dataset-mcp-server','no\x20legacy\x20config\x20found','error','info','push','cwd','isArray','Step\x202/6:\x20.lovrabet/\x20removal\x20failed\x20—\x20','keys','Step\x201/6:\x20Config\x20migration\x20—\x20','280wzsdzQ','detail','label','yellow','no\x20legacy\x20entry','Remove\x20.lovrabet/','FOUND','needed','failed','Upgrade\x20completed\x20successfully!','CANCEL','status','oldPath','1626522oOfxJE','.cursor/mcp.json','.claude/skills/lovrabet','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','utf8','skipped\x20(no\x20legacy\x20config)','cyan','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20lovrabet/rabetbase\x20--global','.lovrabet','Install\x20new\x20skill','includes','filter','green','log','3VgMmdY','.cursor/rules/lovrabet_rules.mdc','bold','skipped','oldArtifacts','Step\x204/6:\x20MCP\x20config\x20—\x20','Config\x20migration','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','fields','join','\x20\x20Fields\x20to\x20migrate:\x20','yes','Clean\x20MCP\x20config','configMigration','Step\x202/6:\x20.lovrabet/\x20not\x20found,\x20skipped','Legacy\x20artifacts:','Step\x206/6:\x20Installing\x20new\x20skill...','Step\x202/6:\x20.lovrabet/\x20directory\x20removed','35KygIAl','mcpServers','Step\x204/6:\x20Cleaning\x20MCP\x20config...','Step\x203/6:\x20Legacy\x20artifacts\x20—\x20','\x20from\x20','Step\x202/6:\x20Removing\x20.lovrabet/\x20directory...','object','files','Step\x205/6:\x20Removing\x20old\x20skill...','start','Upgrade\x20cancelled.','911871BzNVSy','not\x20needed','Proceed\x20with\x20upgrade?','some','undefined','hasNewConfig','oldMcpConfig','\x20\x20Step\x20','exit\x20','Config\x20file:','entries','args','lovrabet/rabetbase','step','done','gray','\x20\x20New\x20config\x20(.rabetbase.json):\x20','message','148912ECiOsE','succeed','path','length','===\x20Upgrade\x20Summary\x20===','\x20→\x20keys:\x20','2736596zkKYhz','MCP\x20config:','string','removed\x20','no\x20matching\x20entry\x20found','\x20removed','red','618456LAEAXS','isDirectory','===\x20Upgrade\x20Analysis\x20===','stringify','534530qdWWKb','Step\x201/6:\x20Migrating\x20config...','Remove\x20old\x20skill','fail','\x20(backup:\x20','values'];a69_0x347c=function(){return _0x399f77;};return a69_0x347c();}import{runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../skills/npx-skills-add.js';import{askConfirm}from'./menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES['filter'](_0x115396=>_0x115396!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x2b85bd){const _0xa291b7=a69_0x25aa,_0x321b35=[];for(const _0x496fb1 of Object[_0xa291b7(0x144)](CORE_IDE_CONFIGS)){if(_0x496fb1[_0xa291b7(0x118)])for(const _0xa20ff5 of _0x496fb1[_0xa291b7(0x118)]){_0x321b35[_0xa291b7(0x14d)](resolve(_0x2b85bd,_0xa20ff5[_0xa291b7(0x130)]));}}return _0x321b35;}function analyse(_0x3aca8a){const _0x297df2=a69_0x25aa;let _0x271091=null;const _0x450a3b=resolve(_0x3aca8a,NEW_CONFIG_NAME),_0x265e88=existsSync(_0x450a3b);for(const _0x12ccb5 of LEGACY_CONFIG_NAMES){const _0x5c2646=resolve(_0x3aca8a,_0x12ccb5);if(existsSync(_0x5c2646)){const _0x18fb1d=readConfigFile(_0x5c2646),_0x56dfc2=Object[_0x297df2(0x151)](_0x18fb1d)[_0x297df2(0x16b)](_0x253599=>typeof _0x18fb1d[_0x253599]!==_0x297df2(0x120));_0x271091={'oldPath':_0x5c2646,'hasNewConfig':_0x265e88,'fields':_0x56dfc2};break;}}const _0xcca5da=[],_0x17f0ba=resolve(_0x3aca8a,_0x297df2(0x168));if(existsSync(_0x17f0ba))_0xcca5da[_0x297df2(0x14d)](_0x17f0ba);const _0x1282c4=resolve(_0x3aca8a,_0x297df2(0x16f));if(existsSync(_0x1282c4))_0xcca5da[_0x297df2(0x14d)](_0x1282c4);const _0x1acb00=resolve(_0x3aca8a,_0x297df2(0x162));if(existsSync(_0x1acb00))_0xcca5da['push'](_0x1acb00);for(const _0x11cc2c of collectIdeSkillFiles(_0x3aca8a)){if(existsSync(_0x11cc2c))_0xcca5da[_0x297df2(0x14d)](_0x11cc2c);}let _0x2fa2e1=null;const _0x285e78=resolve(_0x3aca8a,_0x297df2(0x161));if(existsSync(_0x285e78))try{const _0x5ac336=JSON['parse'](readFileSync(_0x285e78,_0x297df2(0x164)));if(_0x5ac336?.['mcpServers']&&typeof _0x5ac336['mcpServers']===_0x297df2(0x117)){const _0x142d92=[];for(const [_0xe37773,_0x3fcbc2]of Object[_0x297df2(0x126)](_0x5ac336[_0x297df2(0x112)])){const _0x2cb5f1=_0x3fcbc2;_0x2cb5f1?.[_0x297df2(0x127)]&&Array[_0x297df2(0x14f)](_0x2cb5f1['args'])&&_0x2cb5f1[_0x297df2(0x127)][_0x297df2(0x11f)](_0x1b99d8=>typeof _0x1b99d8===_0x297df2(0x136)&&_0x1b99d8['includes'](_0x297df2(0x149)))&&_0x142d92[_0x297df2(0x14d)](_0xe37773);}_0x142d92[_0x297df2(0x131)]>0x0&&(_0x2fa2e1={'path':_0x285e78,'keys':_0x142d92});}}catch{}const _0x3da1c4=_0xcca5da[_0x297df2(0x131)]>0x0||_0x271091!==null;return{'configMigration':_0x271091,'oldArtifacts':_0xcca5da,'oldMcpConfig':_0x2fa2e1,'needsSkillSwap':_0x3da1c4};}function printReport(_0x55bfce){const _0x525d15=a69_0x25aa,{configMigration:_0x51dd8f,oldArtifacts:_0x54502e,oldMcpConfig:_0x1705fb,needsSkillSwap:_0x1b7308}=_0x55bfce;console[_0x525d15(0x16d)](''),console[_0x525d15(0x16d)](a69_0x5c2f83[_0x525d15(0x170)](_0x525d15(0x13d))),console[_0x525d15(0x16d)]('');_0x51dd8f?(console['log'](a69_0x5c2f83[_0x525d15(0x166)]('Config\x20file:')+('\x20\x20'+a69_0x5c2f83[_0x525d15(0x156)](_0x51dd8f[_0x525d15(0x15f)]))),console[_0x525d15(0x16d)](_0x525d15(0x12c)+(_0x51dd8f['hasNewConfig']?a69_0x5c2f83[_0x525d15(0x16c)]('already\x20exists\x20(will\x20merge)'):a69_0x5c2f83['gray']('not\x20found\x20(will\x20create)'))),console[_0x525d15(0x16d)](_0x525d15(0x178)+_0x51dd8f[_0x525d15(0x176)]['join'](',\x20')),console[_0x525d15(0x16d)](_0x525d15(0x175))):console['log'](a69_0x5c2f83[_0x525d15(0x166)](_0x525d15(0x125))+'\x20\x20'+a69_0x5c2f83[_0x525d15(0x12b)](_0x525d15(0x14a)));console['log']('');if(_0x54502e['length']>0x0){console[_0x525d15(0x16d)](a69_0x5c2f83['cyan'](_0x525d15(0x10e)));for(const _0x1b0e81 of _0x54502e){console[_0x525d15(0x16d)]('\x20\x20'+a69_0x5c2f83['red'](_0x525d15(0x159))+'\x20\x20'+_0x1b0e81);}console['log']('\x20\x20Action:\x20delete');}else console[_0x525d15(0x16d)](a69_0x5c2f83[_0x525d15(0x166)](_0x525d15(0x10e))+'\x20\x20'+a69_0x5c2f83[_0x525d15(0x12b)]('none\x20found'));console[_0x525d15(0x16d)](''),_0x1705fb?(console['log'](a69_0x5c2f83[_0x525d15(0x166)](_0x525d15(0x135))+('\x20\x20'+a69_0x5c2f83['yellow'](_0x1705fb[_0x525d15(0x130)])+_0x525d15(0x133)+_0x1705fb[_0x525d15(0x151)][_0x525d15(0x177)](',\x20'))),console[_0x525d15(0x16d)]('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console[_0x525d15(0x16d)](a69_0x5c2f83[_0x525d15(0x166)](_0x525d15(0x135))+'\x20\x20'+a69_0x5c2f83[_0x525d15(0x12b)](_0x525d15(0x157))),console[_0x525d15(0x16d)](''),console['log'](a69_0x5c2f83['cyan']('Skill\x20swap:')+('\x20\x20'+(_0x1b7308?a69_0x5c2f83[_0x525d15(0x156)](_0x525d15(0x15a)):a69_0x5c2f83[_0x525d15(0x16c)](_0x525d15(0x11d))))),_0x1b7308&&console[_0x525d15(0x16d)](_0x525d15(0x167)),console[_0x525d15(0x16d)]('');}function execConfigMigration(_0x848988,_0x53d6f8){const _0x2502f9=a69_0x25aa,{configMigration:_0x1d1618}=_0x848988;if(!_0x1d1618?.['oldPath'])return{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x2502f9(0x165)};const _0x598269=readConfigFile(_0x1d1618[_0x2502f9(0x15f)]),_0x11c907=resolve(_0x53d6f8,NEW_CONFIG_NAME),_0x3be9d8=_0x1d1618[_0x2502f9(0x121)]?readConfigFile(_0x11c907):{};for(const [_0x42ef80,_0x254905]of Object['entries'](_0x598269)){!(_0x42ef80 in _0x3be9d8)&&(_0x3be9d8[_0x42ef80]=_0x254905);}writeConfigFile(_0x11c907,_0x3be9d8);const _0x138486=_0x1d1618['oldPath']+'.bak';return renameSync(_0x1d1618['oldPath'],_0x138486),{'step':0x1,'label':_0x2502f9(0x174),'ok':!![],'detail':_0x1d1618[_0x2502f9(0x15f)]+'\x20→\x20'+_0x11c907+_0x2502f9(0x143)+_0x138486+')'};}function execRemoveOldArtifacts(_0x27dc57){const _0x5cf947=a69_0x25aa,_0x536e81=[];for(const _0xa105bc of _0x27dc57){try{if(!existsSync(_0xa105bc))continue;const _0x517ee3=tryStat(_0xa105bc);_0x517ee3?.[_0x5cf947(0x13c)]()?rmSync(_0xa105bc,{'recursive':!![],'force':!![]}):unlinkSync(_0xa105bc);}catch(_0x32f274){_0x536e81[_0x5cf947(0x14d)](_0xa105bc+':\x20'+_0x32f274[_0x5cf947(0x12d)]);}}return{'step':0x3,'label':'Remove\x20legacy\x20artifacts','ok':_0x536e81['length']===0x0,'detail':_0x536e81[_0x5cf947(0x131)]>0x0?_0x27dc57[_0x5cf947(0x131)]-_0x536e81['length']+'/'+_0x27dc57[_0x5cf947(0x131)]+_0x5cf947(0x148)+_0x536e81[_0x5cf947(0x177)](';\x20')+')':_0x27dc57[_0x5cf947(0x131)]+_0x5cf947(0x139)};}function execCleanMcp(_0x586836){const _0x57278f=a69_0x25aa;if(!_0x586836['oldMcpConfig'])return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':'skipped'};try{const _0x54c6eb=readFileSync(_0x586836['oldMcpConfig'][_0x57278f(0x130)],_0x57278f(0x164)),_0x30918a=JSON['parse'](_0x54c6eb);if(_0x30918a?.[_0x57278f(0x112)]&&typeof _0x30918a[_0x57278f(0x112)]===_0x57278f(0x117)){const _0xe1a246=[];for(const [_0x4b8e0d,_0x570c5f]of Object[_0x57278f(0x126)](_0x30918a[_0x57278f(0x112)])){_0x570c5f?.[_0x57278f(0x127)]&&Array[_0x57278f(0x14f)](_0x570c5f['args'])&&_0x570c5f[_0x57278f(0x127)][_0x57278f(0x11f)](_0xdd7c93=>typeof _0xdd7c93===_0x57278f(0x136)&&_0xdd7c93[_0x57278f(0x16a)](_0x57278f(0x149)))&&_0xe1a246['push'](_0x4b8e0d);}for(const _0x33abcc of _0xe1a246){delete _0x30918a[_0x57278f(0x112)][_0x33abcc];}return _0xe1a246[_0x57278f(0x131)]>0x0&&writeFileSync(_0x586836[_0x57278f(0x122)]['path'],JSON[_0x57278f(0x13e)](_0x30918a,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x57278f(0x137)+_0xe1a246[_0x57278f(0x177)](',\x20')+_0x57278f(0x115)+_0x586836['oldMcpConfig'][_0x57278f(0x130)]};}return{'step':0x4,'label':_0x57278f(0x10b),'ok':!![],'detail':_0x57278f(0x138)};}catch(_0x3ea7db){return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':![],'detail':_0x3ea7db['message']};}}function execSkillsRemove(_0xe5a441){const _0x4220af=a69_0x25aa,_0x532cd2=runNpxSkillsRemove(_0xe5a441,{'stdio':_0x4220af(0x146)});return{'step':0x5,'label':_0x4220af(0x141),'ok':_0x532cd2['ok'],'detail':_0x532cd2['ok']?'lovrabet/lovrabet-skill\x20removed':_0x532cd2['error']??_0x4220af(0x124)+_0x532cd2[_0x4220af(0x15e)]};}function execSkillsAdd(_0x5e5a4b){const _0x67e23b=a69_0x25aa,_0x1cffd4=runNpxSkillsAddGlobal(_0x5e5a4b,_0x67e23b(0x128),{'stdio':_0x67e23b(0x146)});return{'step':0x6,'label':_0x67e23b(0x169),'ok':_0x1cffd4['ok'],'detail':_0x1cffd4['ok']?_0x67e23b(0x147):_0x1cffd4[_0x67e23b(0x14b)]??'exit\x20'+_0x1cffd4[_0x67e23b(0x15e)]};}function tryStat(_0xafa015){try{return statSync(_0xafa015);}catch{return undefined;}}function printSummary(_0x320183){const _0x196c89=a69_0x25aa;console['log'](''),console[_0x196c89(0x16d)](a69_0x5c2f83[_0x196c89(0x170)](_0x196c89(0x132))),console[_0x196c89(0x16d)]('');for(const _0x1fe6b6 of _0x320183){const _0x2d55b1=_0x1fe6b6['ok']?a69_0x5c2f83[_0x196c89(0x16c)]('OK'):a69_0x5c2f83[_0x196c89(0x13a)]('FAIL');console[_0x196c89(0x16d)]('\x20\x20'+_0x2d55b1+_0x196c89(0x123)+_0x1fe6b6[_0x196c89(0x129)]+':\x20'+_0x1fe6b6[_0x196c89(0x155)]);if(_0x1fe6b6[_0x196c89(0x154)])console[_0x196c89(0x16d)]('\x20\x20\x20\x20\x20\x20\x20'+a69_0x5c2f83[_0x196c89(0x12b)](_0x1fe6b6[_0x196c89(0x154)]));}console[_0x196c89(0x16d)]('');}export async function upgradeApp(_0x4fba8c,_0x35beca){const _0x5ea400=a69_0x25aa,_0x8a2664=process[_0x5ea400(0x14e)](),_0x474f77=analyse(_0x8a2664),_0x917e67=!_0x474f77[_0x5ea400(0x10c)]&&_0x474f77[_0x5ea400(0x172)][_0x5ea400(0x131)]===0x0&&!_0x474f77[_0x5ea400(0x122)]&&!_0x474f77['needsSkillSwap'];if(_0x917e67){console[_0x5ea400(0x16d)](a69_0x5c2f83[_0x5ea400(0x16c)]('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0x474f77);const _0x3cbba8=_0x35beca[_0x5ea400(0x10a)]||_0x35beca['Y']||_0x4fba8c;if(!_0x3cbba8)try{const _0x242d0a=await askConfirm(_0x5ea400(0x11e));if(!_0x242d0a){console[_0x5ea400(0x16d)](a69_0x5c2f83[_0x5ea400(0x12b)](_0x5ea400(0x11b)));return;}}catch(_0x5cbb38){if(_0x5cbb38?.[_0x5ea400(0x12d)]===_0x5ea400(0x15d)){console['log'](a69_0x5c2f83[_0x5ea400(0x12b)](_0x5ea400(0x11b)));return;}throw _0x5cbb38;}const _0xbaa6f8=[],_0x1d1b60=a69_0x398037({'text':_0x5ea400(0x140),'color':_0x5ea400(0x166)})[_0x5ea400(0x11a)](),_0xd2615b=execConfigMigration(_0x474f77,_0x8a2664);_0xbaa6f8[_0x5ea400(0x14d)](_0xd2615b),_0x1d1b60[_0xd2615b['ok']?_0x5ea400(0x12f):_0x5ea400(0x142)](_0x5ea400(0x152)+(_0xd2615b[_0x5ea400(0x154)]??(_0xd2615b['ok']?_0x5ea400(0x12a):'failed')));const _0x29e6dc=resolve(_0x8a2664,'.lovrabet'),_0x7d3530=a69_0x398037({'text':_0x5ea400(0x116),'color':_0x5ea400(0x166)})[_0x5ea400(0x11a)]();if(existsSync(_0x29e6dc))try{rmSync(_0x29e6dc,{'recursive':!![],'force':!![]}),_0x7d3530[_0x5ea400(0x12f)](_0x5ea400(0x110)),_0xbaa6f8[_0x5ea400(0x14d)]({'step':0x2,'label':_0x5ea400(0x158),'ok':!![]});}catch(_0x5a4277){_0x7d3530[_0x5ea400(0x142)](_0x5ea400(0x150)+_0x5a4277[_0x5ea400(0x12d)]),_0xbaa6f8['push']({'step':0x2,'label':_0x5ea400(0x158),'ok':![],'detail':_0x5a4277['message']});}else _0x7d3530[_0x5ea400(0x14c)](_0x5ea400(0x10d)),_0xbaa6f8[_0x5ea400(0x14d)]({'step':0x2,'label':_0x5ea400(0x158),'ok':!![],'detail':_0x5ea400(0x171)});const _0x4dcb71=a69_0x398037({'text':'Step\x203/6:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':_0x5ea400(0x166)})[_0x5ea400(0x11a)](),_0x2b5b0d=execRemoveOldArtifacts(_0x474f77['oldArtifacts']);_0xbaa6f8[_0x5ea400(0x14d)](_0x2b5b0d),_0x4dcb71[_0x2b5b0d['ok']?'succeed':_0x5ea400(0x142)](_0x5ea400(0x114)+(_0x2b5b0d[_0x5ea400(0x154)]??(_0x2b5b0d['ok']?_0x5ea400(0x12a):_0x5ea400(0x15b))));const _0x2a5cd8=a69_0x398037({'text':_0x5ea400(0x113),'color':_0x5ea400(0x166)})[_0x5ea400(0x11a)](),_0x55ad84=execCleanMcp(_0x474f77);_0xbaa6f8[_0x5ea400(0x14d)](_0x55ad84),_0x2a5cd8[_0x55ad84['ok']?_0x5ea400(0x12f):_0x5ea400(0x142)](_0x5ea400(0x173)+(_0x55ad84[_0x5ea400(0x154)]??(_0x55ad84['ok']?'done':_0x5ea400(0x15b))));const _0x311712=a69_0x398037({'text':_0x5ea400(0x119),'color':_0x5ea400(0x166)})[_0x5ea400(0x11a)](),_0x5e9a64=execSkillsRemove(_0x8a2664);_0xbaa6f8[_0x5ea400(0x14d)](_0x5e9a64),_0x311712[_0x5e9a64['ok']?_0x5ea400(0x12f):_0x5ea400(0x142)]('Step\x205/6:\x20Remove\x20old\x20skill\x20—\x20'+(_0x5e9a64[_0x5ea400(0x154)]??(_0x5e9a64['ok']?'done':_0x5ea400(0x15b))));const _0x1bfe30=a69_0x398037({'text':_0x5ea400(0x10f),'color':_0x5ea400(0x166)})[_0x5ea400(0x11a)](),_0xf39563=execSkillsAdd(_0x8a2664);_0xbaa6f8[_0x5ea400(0x14d)](_0xf39563),_0x1bfe30[_0xf39563['ok']?_0x5ea400(0x12f):_0x5ea400(0x142)]('Step\x206/6:\x20Install\x20new\x20skill\x20—\x20'+(_0xf39563['detail']??(_0xf39563['ok']?_0x5ea400(0x12a):_0x5ea400(0x15b)))),printSummary(_0xbaa6f8);const _0x21b410=_0xbaa6f8[_0x5ea400(0x11f)](_0x2ff72c=>!_0x2ff72c['ok']);_0x21b410?console['log'](a69_0x5c2f83[_0x5ea400(0x156)](_0x5ea400(0x163))):console[_0x5ea400(0x16d)](a69_0x5c2f83['green'](_0x5ea400(0x15c)));}
@@ -1 +0,0 @@
1
- const a79_0x4b9c68=a79_0x1666;(function(_0x1402e2,_0xf8c9ea){const _0x4ca7b0=a79_0x1666,_0x25e94e=_0x1402e2();while(!![]){try{const _0x4d8f13=-parseInt(_0x4ca7b0(0x112))/0x1*(-parseInt(_0x4ca7b0(0x115))/0x2)+parseInt(_0x4ca7b0(0x122))/0x3*(-parseInt(_0x4ca7b0(0x123))/0x4)+parseInt(_0x4ca7b0(0x120))/0x5+parseInt(_0x4ca7b0(0x11a))/0x6*(parseInt(_0x4ca7b0(0x11c))/0x7)+-parseInt(_0x4ca7b0(0x11b))/0x8*(parseInt(_0x4ca7b0(0x11e))/0x9)+parseInt(_0x4ca7b0(0x114))/0xa*(-parseInt(_0x4ca7b0(0x117))/0xb)+parseInt(_0x4ca7b0(0x119))/0xc;if(_0x4d8f13===_0xf8c9ea)break;else _0x25e94e['push'](_0x25e94e['shift']());}catch(_0x47ffd8){_0x25e94e['push'](_0x25e94e['shift']());}}}(a79_0x34fb,0xc22c0));import{execa}from'execa';function a79_0x1666(_0x37ca9c,_0x136fc2){_0x37ca9c=_0x37ca9c-0x112;const _0x34fbc1=a79_0x34fb();let _0x166644=_0x34fbc1[_0x37ca9c];return _0x166644;}import{checkSdkVersion,printSdkUpgradeWarning}from'../utils/check-sdk-version.js';function a79_0x34fb(){const _0x4aedac=['3kqnddY','532484spSyLW','19797HkWHxS','vite','5465040IeeuSy','126hcYKwE','cwd','11SKwhsX','Start\x20development\x20server','12014592CQGJFJ','331050GGNjbU','19016emmzZO','56eVyTtN','启动开发服务器','4887eMzkch','needsUpgrade','379185ZUcQkS','now'];a79_0x34fb=function(){return _0x4aedac;};return a79_0x34fb();}import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';export async function runStart(_0x12f3f1){const _0x1db11b=a79_0x1666,_0x41f86e=Date[_0x1db11b(0x121)](),_0x1baeeb=_0x12f3f1||process[_0x1db11b(0x116)](),_0x48d954=await checkCliVersion();_0x48d954[_0x1db11b(0x11f)]&&printCliUpgradeWarning(_0x48d954);const _0x29ebee=await checkSdkVersion(_0x1baeeb);_0x29ebee[_0x1db11b(0x11f)]&&printSdkUpgradeWarning(_0x29ebee);try{await execa(_0x1db11b(0x113),[],{'cwd':_0x1baeeb,'stdio':'inherit','preferLocal':!![],'localDir':_0x1baeeb,'env':{...process.env}});const _0x1cc796=Date['now']()-_0x41f86e;void _0x1cc796;}catch(_0x271b11){throw _0x271b11;}}export const startCommand={'name':'start','description':a79_0x4b9c68(0x118),async 'run'(_0x538aa8,_0x1c5cbe,_0x2f422a){const _0x5a2ff6=a79_0x4b9c68;_0x538aa8['logger']['info']('start',_0x5a2ff6(0x11d)),await runStart();}};
@@ -1 +0,0 @@
1
- (function(_0x268754,_0x54eefb){const _0x336795=a94_0x3d7c,_0x27e751=_0x268754();while(!![]){try{const _0x401919=-parseInt(_0x336795(0xd7))/0x1*(parseInt(_0x336795(0xd8))/0x2)+parseInt(_0x336795(0xdd))/0x3*(parseInt(_0x336795(0xe8))/0x4)+parseInt(_0x336795(0xe3))/0x5*(-parseInt(_0x336795(0xde))/0x6)+-parseInt(_0x336795(0xe0))/0x7+-parseInt(_0x336795(0xd5))/0x8+parseInt(_0x336795(0xed))/0x9*(parseInt(_0x336795(0xe1))/0xa)+parseInt(_0x336795(0xe2))/0xb;if(_0x401919===_0x54eefb)break;else _0x27e751['push'](_0x27e751['shift']());}catch(_0x4d638b){_0x27e751['push'](_0x27e751['shift']());}}}(a94_0x1ee1,0x574a0));import{existsSync}from'node:fs';import a94_0x11f310 from'node:path';import a94_0x48e8e1 from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../auth/is-session-valid.js';function a94_0x3d7c(_0x10a715,_0x1d1c90){_0x10a715=_0x10a715-0xd4;const _0x1ee1e2=a94_0x1ee1();let _0x3d7c8e=_0x1ee1e2[_0x10a715];return _0x3d7c8e;}import{authServer}from'../auth/auth-server.js';function a94_0x1ee1(){const _0x23f645=['3044810gCAtYj','4881679KCmzjt','681850nezmSa','log','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','green','trim','4TXOpXY','cyan','length','Project\x20name\x20cannot\x20exceed\x2050\x20characters','Skipped','9scQuNl','cwd','Login\x20failed','Logged\x20in','√\x20Login\x20status:\x20','2293288IVbobT','string','214487KCGehx','4rDVnLr','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','resolve','env','production','1658697ebnBfz','6NyNtwY','Project\x20name:','641396JGyZTH'];a94_0x1ee1=function(){return _0x23f645;};return a94_0x1ee1();}import{readConfig}from'../utils/config.js';import{selectSingleAppcode}from'../commands/common/app-selector.js';export async function guidedCreateProject(_0x10f8e8,_0x19d0a1,_0x12de68){const _0x2e8150=a94_0x3d7c,_0xee7062='my-app',_0x168d6d=readConfig(),_0xd8b635=typeof _0x168d6d[_0x2e8150(0xdb)]===_0x2e8150(0xd6)?_0x168d6d[_0x2e8150(0xdb)]:undefined,_0x479c82=await input({'message':_0x2e8150(0xdf),'default':_0xee7062,'validate':_0x3b0182=>{const _0x5c207d=_0x2e8150,_0x4906b5=_0x3b0182[_0x5c207d(0xe7)]()||_0xee7062;if(_0x4906b5[_0x5c207d(0xea)]>0x32)return _0x5c207d(0xeb);const _0x529449=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x4906b5&&!_0x529449['test'](_0x4906b5))return _0x5c207d(0xe5);const _0x24198b=a94_0x11f310[_0x5c207d(0xda)](process[_0x5c207d(0xee)](),_0x4906b5);if(existsSync(_0x24198b))return'Directory\x20\x22'+_0x4906b5+'\x22\x20already\x20exists';return!![];}});console['log'](a94_0x48e8e1[_0x2e8150(0xe6)]('√\x20Project\x20Name:\x20'+a94_0x48e8e1['cyan'](_0x479c82)));const _0x334beb=await selectSingleAppcode(_0x12de68);console[_0x2e8150(0xe4)](a94_0x48e8e1[_0x2e8150(0xe6)]('√\x20App\x20Code:\x20'+a94_0x48e8e1[_0x2e8150(0xe9)](_0x334beb||'Not\x20set')));if(_0x334beb){const _0x11dac2=await getIsSessionValid();if(!_0x11dac2){const _0x4521ab=await confirm({'message':_0x2e8150(0xd9),'default':!![]});if(_0x4521ab){const _0x4a7826=await authServer({'silent':!![]});console['log'](a94_0x48e8e1[_0x2e8150(0xe6)](_0x2e8150(0xd4)+a94_0x48e8e1[_0x2e8150(0xe9)](_0x4a7826?_0x2e8150(0xf0):_0x2e8150(0xef))));}else console[_0x2e8150(0xe4)](a94_0x48e8e1[_0x2e8150(0xe6)](_0x2e8150(0xd4)+a94_0x48e8e1[_0x2e8150(0xe9)](_0x2e8150(0xec))));}await _0x10f8e8({'projectName':_0x479c82,'appCode':_0x334beb,'env':_0x19d0a1||_0xd8b635||_0x2e8150(0xdc)});}else await _0x10f8e8({'projectName':_0x479c82,'env':_0x19d0a1||_0xd8b635||'production'});}
@@ -1 +0,0 @@
1
- function a95_0x4764(_0x41f1c9,_0x36ff4f){_0x41f1c9=_0x41f1c9-0x19a;const _0x3ce9d4=a95_0x3ce9();let _0x47644e=_0x3ce9d4[_0x41f1c9];return _0x47644e;}function a95_0x3ce9(){const _0x59e570=['34180yyErNJ','732018IlEwAV','2099544nSaMCQ','70oFUpGJ','7SWpvff','67724JMevdi','168882ihDaVY','now','1136520oMnlAi','toFixed','318771jUstFz','3QZcKQk'];a95_0x3ce9=function(){return _0x59e570;};return a95_0x3ce9();}(function(_0x18ac37,_0x29825b){const _0x29b4bf=a95_0x4764,_0x17dff5=_0x18ac37();while(!![]){try{const _0x102908=-parseInt(_0x29b4bf(0x19d))/0x1+-parseInt(_0x29b4bf(0x19c))/0x2*(parseInt(_0x29b4bf(0x1a2))/0x3)+parseInt(_0x29b4bf(0x1a3))/0x4+parseInt(_0x29b4bf(0x19f))/0x5+parseInt(_0x29b4bf(0x1a4))/0x6+parseInt(_0x29b4bf(0x19b))/0x7*(parseInt(_0x29b4bf(0x1a5))/0x8)+parseInt(_0x29b4bf(0x1a1))/0x9*(-parseInt(_0x29b4bf(0x19a))/0xa);if(_0x102908===_0x29825b)break;else _0x17dff5['push'](_0x17dff5['shift']());}catch(_0x480a84){_0x17dff5['push'](_0x17dff5['shift']());}}}(a95_0x3ce9,0x29692));export function formatElapsed(_0x3b1d71){const _0x48baad=a95_0x4764,_0x5d794d=Date[_0x48baad(0x19e)]()-_0x3b1d71;if(_0x5d794d<0x3e8)return _0x5d794d+'ms';const _0x5b1bae=(_0x5d794d/0x3e8)[_0x48baad(0x1a0)](0x2),_0x293b36=_0x5b1bae['replace'](/\.?0+$/u,'');return _0x293b36+'s';}
@@ -1 +0,0 @@
1
- (function(_0x37340d,_0xcb193d){const _0x3a3fb3=a96_0x5f3f,_0x4c8ed6=_0x37340d();while(!![]){try{const _0x521896=-parseInt(_0x3a3fb3(0x19a))/0x1*(parseInt(_0x3a3fb3(0x1d3))/0x2)+parseInt(_0x3a3fb3(0x17c))/0x3*(parseInt(_0x3a3fb3(0x1cb))/0x4)+-parseInt(_0x3a3fb3(0x187))/0x5+parseInt(_0x3a3fb3(0x1a5))/0x6*(parseInt(_0x3a3fb3(0x18b))/0x7)+parseInt(_0x3a3fb3(0x1ba))/0x8*(parseInt(_0x3a3fb3(0x1c9))/0x9)+-parseInt(_0x3a3fb3(0x1c7))/0xa*(-parseInt(_0x3a3fb3(0x1a6))/0xb)+-parseInt(_0x3a3fb3(0x192))/0xc;if(_0x521896===_0xcb193d)break;else _0x4c8ed6['push'](_0x4c8ed6['shift']());}catch(_0x936602){_0x4c8ed6['push'](_0x4c8ed6['shift']());}}}(a96_0x35cc,0x755eb));import a96_0x50f553 from'path';import a96_0x1a401b from'fs';function a96_0x35cc(){const _0xb34021=['!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','fail','chdir','\x20\x201.\x20Start\x20project:\x20','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','\x20config\x20set\x20appcode\x20<app-code>\x27','success','bold','√\x20Pulled\x20','stop','create','repeat','\x20run\x20start','../..','Project\x20name\x20cannot\x20be\x20empty','\x20√\x20','message','Project\x20directory\x20','stringify','16XNaIxZ','appCode','√\x20Configuration\x20file\x20created,\x20AppCode:\x20','cwd','toLocaleString','constants','readFileSync','API\x20configuration\x20pulled:\x20','package.json','\x20&&\x20','项目创建失败:\x20','\x20already\x20exists','*\x20Pulling\x20API\x20configuration...','500GbFkcm','\x20api\x20pull','3845673HiwXor','name','16664buZUSP','join','🚀\x20Next\x20Steps:','modelCount','string','description','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','projectCode','69240TbZSST','env','√\x20package.json\x20updated:\x20name=','更新\x20package.json\x20失败','dirname','./src/api/','384dLVWQB','...','\x20|\x20AppCode:\x20','cookie','cd\x20','resolve','info','更新\x20package.json\x20name','rmSync','length','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','1634950XtXZbO','test','配置应用AppCode失败','projectName','6064135ewToiy','needsUpgrade','writeFileSync','\x20\x202.\x20Pull\x20API\x20configuration:\x20','cyan','W_OK','1.0.0','14794800elBPEe','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','配置应用AppCode:\x20','CLI\x20版本检查','warn','*\x20Configuring\x20AppCode\x20for\x20project\x20','currentVersion','parse','23HYAYnJ','version','log','existsSync','Install\x20dependencies','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','utf8','production','green','start','6ksIZQw','128205yPamaJ'];a96_0x35cc=function(){return _0xb34021;};return a96_0x35cc();}import{fileURLToPath}from'node:url';import a96_0xb26750 from'chalk';import a96_0x50843b from'ora';import{guidedCreateProject}from'./enhanced-guided-create.js';function a96_0x5f3f(_0x230c99,_0x5966ff){_0x230c99=_0x230c99-0x17b;const _0x35cc93=a96_0x35cc();let _0x5f3f6e=_0x35cc93[_0x230c99];return _0x5f3f6e;}import{fetchModelList}from'../api/fetch-model-list.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{writeConfigFile,NEW_CONFIG_NAME}from'../context.js';import{copyProjectTemplate}from'./use-copy-project-template.js';import{installDependencies}from'./use-install-dependencies.js';import{formatProjectCode}from'./use-format-code.js';import{logger}from'../utils/logger.js';import{checkCliVersion,printCliUpgradeWarning}from'../utils/cli-version-check.js';import{selectSingleAppcode}from'../commands/common/app-selector.js';export async function createApp(_0x4d5893){const _0x5e5790=a96_0x5f3f,_0x2fa5bb=await checkCliVersion();_0x2fa5bb[_0x5e5790(0x18c)]&&(printCliUpgradeWarning(_0x2fa5bb),logger[_0x5e5790(0x182)](_0x5e5790(0x1b1),_0x5e5790(0x195),{'currentVersion':_0x2fa5bb[_0x5e5790(0x198)],'stableVersion':_0x2fa5bb['stableVersion'],'needsUpgrade':_0x2fa5bb[_0x5e5790(0x18c)]}));if(_0x4d5893['projectCode']&&_0x4d5893['appCode'])await runCreate({'projectName':_0x4d5893[_0x5e5790(0x1d2)],'appCode':_0x4d5893['appCode'],'env':_0x4d5893[_0x5e5790(0x1d4)]},_0x4d5893);else{if(_0x4d5893[_0x5e5790(0x1d2)]){const _0x169647=await selectSingleAppcode(_0x4d5893[_0x5e5790(0x17f)]);await runCreate({'projectName':_0x4d5893[_0x5e5790(0x1d2)],'appCode':_0x169647||undefined,'env':_0x4d5893[_0x5e5790(0x1d4)]},_0x4d5893);}else await guidedCreateProject(_0x5912f5=>runCreate(_0x5912f5,_0x4d5893),_0x4d5893['env'],_0x4d5893[_0x5e5790(0x17f)]);}}async function runCreate(_0x4195e9,_0x2e238e){const _0x2f07b8=a96_0x5f3f;if(!_0x4195e9[_0x2f07b8(0x18a)]||_0x4195e9[_0x2f07b8(0x18a)]['trim']()==='')throw new Error(_0x2f07b8(0x1b5));const _0x386fbb=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x386fbb[_0x2f07b8(0x188)](_0x4195e9[_0x2f07b8(0x18a)]))throw new Error(_0x2f07b8(0x1d1));if(_0x4195e9['projectName'][_0x2f07b8(0x185)]>0x64)throw new Error(_0x2f07b8(0x1ab));const _0x595d09=a96_0x50f553[_0x2f07b8(0x181)](process[_0x2f07b8(0x1bd)](),_0x4195e9[_0x2f07b8(0x18a)]);if(a96_0x1a401b[_0x2f07b8(0x19d)](_0x595d09))throw new Error(_0x2f07b8(0x1b8)+_0x4195e9[_0x2f07b8(0x18a)]+_0x2f07b8(0x1c5));try{a96_0x1a401b['accessSync'](a96_0x50f553[_0x2f07b8(0x1d7)](_0x595d09),a96_0x1a401b[_0x2f07b8(0x1bf)][_0x2f07b8(0x190)]);}catch{throw new Error(_0x2f07b8(0x19f));}logger['setLogPath'](_0x595d09),logger[_0x2f07b8(0x182)](_0x2f07b8(0x1b1),'开始创建项目:\x20'+_0x4195e9[_0x2f07b8(0x18a)],{'projectDir':_0x595d09,'appCode':_0x4195e9[_0x2f07b8(0x1bb)]}),console[_0x2f07b8(0x19c)](),console['log'](a96_0xb26750[_0x2f07b8(0x1a3)](_0x2f07b8(0x1b6))+'Project\x20name:\x20'+a96_0xb26750[_0x2f07b8(0x1a3)](_0x4195e9['projectName'])+(_0x4195e9['appCode']?_0x2f07b8(0x17e)+a96_0xb26750[_0x2f07b8(0x18f)](_0x4195e9[_0x2f07b8(0x1bb)]):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x4195e9[_0x2f07b8(0x18a)])),await updatePackageJsonName(_0x4195e9[_0x2f07b8(0x18a)]),await runTask(_0x2f07b8(0x19e),()=>installDependencies(_0x4195e9[_0x2f07b8(0x18a)])),await runTask('Format\x20code',()=>formatProjectCode(_0x4195e9[_0x2f07b8(0x18a)])),await configureAppCode(_0x4195e9[_0x2f07b8(0x18a)],_0x4195e9[_0x2f07b8(0x1bb)]||'',_0x4195e9[_0x2f07b8(0x1d4)]);let _0x38abd9=![];if(_0x4195e9['appCode']){console['log'](_0x2f07b8(0x1c6));const _0xba2eae=process['cwd']();try{process['chdir'](_0x595d09);const _0x39eade=_0x4195e9[_0x2f07b8(0x1d4)]||_0x2f07b8(0x1a2);initEnv(_0x39eade);const {configArray:_0x2133f6}=await fetchModelList(_0x4195e9[_0x2f07b8(0x1bb)],_0x2e238e[_0x2f07b8(0x17f)]||''),_0x58bd18=_0x2f07b8(0x17b),_0x393245=await generateApiFile(_0x2133f6,'',_0x4195e9[_0x2f07b8(0x1bb)],!![],_0x39eade,_0x58bd18);console['log'](_0x2f07b8(0x1af)+_0x2133f6[_0x2f07b8(0x185)]+'\x20dataset(s),\x20generated\x20'+_0x393245[_0x2f07b8(0x1ce)]+'\x20model(s)'),logger[_0x2f07b8(0x182)](_0x2f07b8(0x1b1),_0x2f07b8(0x1c1)+_0x4195e9[_0x2f07b8(0x1bb)]);}catch(_0x272069){_0x38abd9=!![],console[_0x2f07b8(0x19c)](_0x2f07b8(0x1a7)),logger[_0x2f07b8(0x196)](_0x2f07b8(0x1b1),'API\x20配置拉取异常',{'error':_0x272069 instanceof Error?_0x272069[_0x2f07b8(0x1b7)]:String(_0x272069)});}finally{process[_0x2f07b8(0x1a9)](_0xba2eae);}}logger[_0x2f07b8(0x1ad)](_0x2f07b8(0x1b1),'项目创建完成:\x20'+_0x4195e9[_0x2f07b8(0x18a)]),console[_0x2f07b8(0x19c)](),console[_0x2f07b8(0x19c)](a96_0xb26750[_0x2f07b8(0x1a3)]('─'[_0x2f07b8(0x1b2)](0x3c))),console[_0x2f07b8(0x19c)](a96_0xb26750[_0x2f07b8(0x18f)][_0x2f07b8(0x1ae)](_0x2f07b8(0x1cd))),console[_0x2f07b8(0x19c)](),console[_0x2f07b8(0x19c)](_0x2f07b8(0x1aa)+a96_0xb26750[_0x2f07b8(0x18f)][_0x2f07b8(0x1ae)](_0x2f07b8(0x180)+_0x4195e9[_0x2f07b8(0x18a)]+_0x2f07b8(0x1c3)+CLI_BIN_NAME+_0x2f07b8(0x1b3))),_0x38abd9&&console[_0x2f07b8(0x19c)](_0x2f07b8(0x18e)+a96_0xb26750['cyan'][_0x2f07b8(0x1ae)](CLI_BIN_NAME+_0x2f07b8(0x1c8))),console[_0x2f07b8(0x19c)](a96_0xb26750[_0x2f07b8(0x1a3)]('─'[_0x2f07b8(0x1b2)](0x3c)));}catch(_0xfbcc4c){logger['error'](_0x2f07b8(0x1b1),_0x2f07b8(0x1c4)+_0x4195e9[_0x2f07b8(0x18a)],{'error':_0xfbcc4c instanceof Error?_0xfbcc4c[_0x2f07b8(0x1b7)]:String(_0xfbcc4c)});try{a96_0x1a401b[_0x2f07b8(0x19d)](_0x595d09)&&(console[_0x2f07b8(0x19c)]('*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20'+_0x595d09),a96_0x1a401b[_0x2f07b8(0x184)](_0x595d09,{'recursive':!![],'force':!![]}));}catch{logger[_0x2f07b8(0x196)](_0x2f07b8(0x1b1),'清理项目目录失败:\x20'+_0x595d09);}throw _0xfbcc4c;}}async function runTask(_0x3f29b7,_0x4b076e){const _0x2d5a2e=a96_0x5f3f,_0x37b838=a96_0x50843b(_0x3f29b7+_0x2d5a2e(0x17d))[_0x2d5a2e(0x1a4)]();try{const _0x2a3ed1=await _0x4b076e();_0x37b838[_0x2d5a2e(0x1b0)](),console[_0x2d5a2e(0x19c)](''+a96_0xb26750[_0x2d5a2e(0x1a3)](_0x2d5a2e(0x1b6))+_0x3f29b7+'\x20'+a96_0xb26750['gray']('['+_0x2a3ed1+']'));}catch(_0x502a6){_0x37b838[_0x2d5a2e(0x1a8)](_0x3f29b7);throw _0x502a6;}}async function updatePackageJsonName(_0x2e865b){const _0x1b813f=a96_0x5f3f,_0x541581=a96_0x50f553[_0x1b813f(0x181)](process[_0x1b813f(0x1bd)](),_0x2e865b),_0x469c2a=a96_0x50f553['join'](_0x541581,_0x1b813f(0x1c2));try{console['log'](_0x1b813f(0x186));const _0x2195a5=fileURLToPath(import.meta.url),_0xe42ec9=a96_0x50f553[_0x1b813f(0x181)](a96_0x50f553['dirname'](_0x2195a5),_0x1b813f(0x1b4)),_0x38de8e=a96_0x50f553[_0x1b813f(0x1cc)](_0xe42ec9,_0x1b813f(0x1c2));let _0x551879=_0x1b813f(0x191);try{const _0x5be00c=JSON[_0x1b813f(0x199)](a96_0x1a401b['readFileSync'](_0x38de8e,_0x1b813f(0x1a1)));_0x551879=_0x5be00c[_0x1b813f(0x19b)]||'1.0.0';}catch{}const _0x5de9da=a96_0x1a401b[_0x1b813f(0x1c0)](_0x469c2a,_0x1b813f(0x1a1)),_0x6401f7=JSON['parse'](_0x5de9da);_0x6401f7[_0x1b813f(0x1ca)]=_0x2e865b,_0x6401f7[_0x1b813f(0x1d0)]=_0x2e865b+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x551879,a96_0x1a401b[_0x1b813f(0x18d)](_0x469c2a,JSON[_0x1b813f(0x1b9)](_0x6401f7,null,0x2)+'\x0a',_0x1b813f(0x1a1)),console[_0x1b813f(0x19c)](_0x1b813f(0x1d5)+_0x2e865b),logger['info'](_0x1b813f(0x1b1),_0x1b813f(0x183));}catch(_0x4aa7fa){logger['error'](_0x1b813f(0x1b1),_0x1b813f(0x1d6));throw _0x4aa7fa;}}async function configureAppCode(_0x458565,_0x3f64d5,_0x2af81f){const _0x399b98=a96_0x5f3f,_0x4b04ed=a96_0x50f553[_0x399b98(0x181)](process[_0x399b98(0x1bd)](),_0x458565),_0x56876b=a96_0x50f553[_0x399b98(0x1cc)](_0x4b04ed,NEW_CONFIG_NAME);try{_0x3f64d5?console['log'](_0x399b98(0x197)+_0x458565+':\x20'+_0x3f64d5):console['log'](_0x399b98(0x1a0)+_0x458565);const _0x359c0f=fileURLToPath(import.meta.url),_0x4ad81e=a96_0x50f553[_0x399b98(0x181)](a96_0x50f553[_0x399b98(0x1d7)](_0x359c0f),_0x399b98(0x1b4)),_0x124d62=a96_0x50f553[_0x399b98(0x1cc)](_0x4ad81e,_0x399b98(0x1c2));let _0x3873f4=_0x399b98(0x191);try{const _0x1f3651=JSON[_0x399b98(0x199)](a96_0x1a401b[_0x399b98(0x1c0)](_0x124d62,_0x399b98(0x1a1)));_0x3873f4=_0x1f3651[_0x399b98(0x19b)]||'1.0.0';}catch{}const _0xa5780f=readConfig(),_0xf272fd=typeof _0xa5780f[_0x399b98(0x1d4)]===_0x399b98(0x1cf)?_0xa5780f[_0x399b98(0x1d4)]:undefined,{app:_0x308fdf,appcode:_0x3a9a89,..._0x285dd2}=_0xa5780f,_0x315328={..._0x285dd2,'appcode':_0x3f64d5||'','env':_0x2af81f||_0xf272fd||_0x399b98(0x1a2),'createdAt':new Date()[_0x399b98(0x1be)](),'version':_0x3873f4};writeConfigFile(_0x56876b,_0x315328),_0x3f64d5?console[_0x399b98(0x19c)](_0x399b98(0x1bc)+_0x3f64d5):console[_0x399b98(0x19c)](_0x399b98(0x193)+CLI_BIN_NAME+_0x399b98(0x1ac)),logger['info'](_0x399b98(0x1b1),_0x399b98(0x194)+_0x3f64d5);}catch(_0x6b4a7e){logger['error'](_0x399b98(0x1b1),_0x399b98(0x189));}}
@@ -1 +0,0 @@
1
- (function(_0x38a640,_0x2dd765){const _0x1b31bb=a97_0x155c,_0x47e7a3=_0x38a640();while(!![]){try{const _0x1a9ca6=-parseInt(_0x1b31bb(0x92))/0x1*(parseInt(_0x1b31bb(0x9a))/0x2)+parseInt(_0x1b31bb(0x84))/0x3*(parseInt(_0x1b31bb(0xa8))/0x4)+parseInt(_0x1b31bb(0x93))/0x5*(parseInt(_0x1b31bb(0x7c))/0x6)+-parseInt(_0x1b31bb(0x76))/0x7+parseInt(_0x1b31bb(0x82))/0x8*(-parseInt(_0x1b31bb(0x7d))/0x9)+-parseInt(_0x1b31bb(0x99))/0xa*(-parseInt(_0x1b31bb(0x9f))/0xb)+-parseInt(_0x1b31bb(0x86))/0xc*(-parseInt(_0x1b31bb(0x9d))/0xd);if(_0x1a9ca6===_0x2dd765)break;else _0x47e7a3['push'](_0x47e7a3['shift']());}catch(_0x57348e){_0x47e7a3['push'](_0x47e7a3['shift']());}}}(a97_0x5b00,0x6fb55));import a97_0x2e5433 from'path';import{fileURLToPath}from'url';function a97_0x155c(_0xc26126,_0x1f1c32){_0xc26126=_0xc26126-0x71;const _0x5b0091=a97_0x5b00();let _0x155c13=_0x5b0091[_0xc26126];return _0x155c13;}import a97_0xf4b8cd from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../constant/cli.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../utils/copy-directory.js';import{promisify}from'util';import{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'../api/fetch-model-list.js';import{generateApiFile}from'../api/generate-api-file.js';import{initEnv}from'../constant/env.js';const execAsync=promisify(exec);function getTemplateDir(){const _0x7ec231=a97_0x155c,_0x54e5f3=fileURLToPath(import.meta.url),_0x4190b1=a97_0x2e5433[_0x7ec231(0x8c)](_0x54e5f3);return a97_0x2e5433[_0x7ec231(0xa1)](_0x4190b1,_0x7ec231(0x81));}export async function createProjectNonInteractive(_0x20649c,_0x5d2c67,_0x3508e9,_0x1a4823){const _0x5ecaa0=a97_0x155c,_0x71435d=await checkCliVersion();_0x71435d[_0x5ecaa0(0x7b)]&&printCliUpgradeWarning(_0x71435d);if(!_0x20649c||_0x20649c[_0x5ecaa0(0x79)]()==='')throw CliErrors[_0x5ecaa0(0xaa)]('Project\x20name\x20cannot\x20be\x20empty.');const _0x854245=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x854245[_0x5ecaa0(0x7a)](_0x20649c))throw CliErrors[_0x5ecaa0(0xaa)](_0x5ecaa0(0x80),'Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters');if(_0x20649c[_0x5ecaa0(0xa3)]>0x64)throw CliErrors[_0x5ecaa0(0xaa)](_0x5ecaa0(0xad));const _0x25d125=a97_0x2e5433[_0x5ecaa0(0xa1)](process['cwd'](),_0x20649c);if(existsSync(_0x25d125))throw CliErrors[_0x5ecaa0(0xaa)]('Project\x20directory\x20\x22'+_0x20649c+_0x5ecaa0(0x8d),_0x5ecaa0(0x7e));try{const _0x3c1fd2=a97_0x2e5433[_0x5ecaa0(0x8c)](_0x25d125);await a97_0xf4b8cd[_0x5ecaa0(0x94)](_0x3c1fd2,a97_0xf4b8cd['constants'][_0x5ecaa0(0xa4)]);}catch{throw CliErrors[_0x5ecaa0(0xaa)](_0x5ecaa0(0x97),_0x5ecaa0(0xa6));}try{console[_0x5ecaa0(0x8a)]('*\x20Creating\x20project\x20'+_0x20649c+_0x5ecaa0(0xa9));const _0x2a6db6=getTemplateDir();await copyDirectory(_0x2a6db6,_0x25d125),console[_0x5ecaa0(0x8a)](_0x5ecaa0(0x95)),await updatePackageJsonName(_0x20649c),console[_0x5ecaa0(0x8a)](_0x5ecaa0(0x98)),console['log']('\x20\x20Installing\x20dependencies...'),console[_0x5ecaa0(0x8a)](_0x5ecaa0(0x85)),await formatCode(_0x25d125),console['log'](_0x5ecaa0(0xa7)),await configureProject(_0x20649c,_0x3508e9,_0x5d2c67),console[_0x5ecaa0(0x8a)](_0x5ecaa0(0x72)),_0x3508e9&&await pullApiConfig(_0x25d125,_0x3508e9,_0x5d2c67,_0x1a4823),console[_0x5ecaa0(0x8a)](_0x5ecaa0(0x87)+_0x20649c+_0x5ecaa0(0x8f)),console['log'](_0x5ecaa0(0x73)+_0x20649c),console['log'](_0x5ecaa0(0x75));}catch(_0x3a6d7c){try{existsSync(_0x25d125)&&await a97_0xf4b8cd['rm'](_0x25d125,{'recursive':!![],'force':!![]});}catch{}throw _0x3a6d7c;}}async function updatePackageJsonName(_0x59ef2c){const _0x141f32=a97_0x155c,_0xfdcdb4=a97_0x2e5433['resolve'](process[_0x141f32(0xac)](),_0x59ef2c),_0x37d965=a97_0x2e5433['join'](_0xfdcdb4,_0x141f32(0x96)),_0x33758e=await a97_0xf4b8cd[_0x141f32(0x7f)](_0x37d965,_0x141f32(0x9b)),_0x286cbf=JSON['parse'](_0x33758e);_0x286cbf[_0x141f32(0xab)]=_0x59ef2c,_0x286cbf['description']=_0x141f32(0xa2),await a97_0xf4b8cd[_0x141f32(0x91)](_0x37d965,JSON[_0x141f32(0xa5)](_0x286cbf,null,0x2)+'\x0a');}function detectPackageManager(){const _0x57daa1=a97_0x155c;try{return execSync('bun\x20--version',{'stdio':_0x57daa1(0x78)}),_0x57daa1(0x90);}catch{return _0x57daa1(0x77);}}async function formatCode(_0x5f008f){try{await execAsync('bun\x20run\x20format',{'cwd':_0x5f008f});}catch{}}async function configureProject(_0x59dd7b,_0x259cb4,_0x79884b){const _0x15586d=a97_0x155c,_0x2d69a1=a97_0x2e5433[_0x15586d(0xa1)](process[_0x15586d(0xac)](),_0x59dd7b),_0x13c14d=a97_0x2e5433[_0x15586d(0x88)](_0x2d69a1,NEW_CONFIG_NAME),_0x46bc2b=readConfig(),_0x2b58b8=typeof _0x46bc2b[_0x15586d(0x74)]===_0x15586d(0x71)?_0x46bc2b[_0x15586d(0x74)]:undefined,{app:_0x439b3d,appcode:_0x7c449e,..._0x319ed5}=_0x46bc2b,_0x4e2c83={..._0x319ed5,'appcode':_0x259cb4||'','env':_0x79884b||_0x2b58b8||_0x15586d(0x83),'createdAt':new Date()[_0x15586d(0x9c)](),'version':getCliVersion()};writeConfigFile(_0x13c14d,_0x4e2c83);}function a97_0x5b00(){const _0x2b633a=['1370674riZFqd','utf-8','toLocaleString','23101SlaMtw','\x20model(s)','4917SRsurQ','chdir','resolve','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','length','W_OK','stringify','Check\x20directory\x20permissions.','\x20\x20√\x20Code\x20formatted','1764HRnNqd','...','validation','name','cwd','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','string','\x20\x20√\x20Configuration\x20file\x20created','\x0a\x20\x20cd\x20','env','\x20\x20rabetbase\x20run\x20start\x0a','3922317wjOZjQ','npm','ignore','trim','test','needsUpgrade','6ibNsAv','774QwsBWl','Use\x20a\x20different\x20project\x20name.','readFile','Project\x20name\x20contains\x20invalid\x20characters.','../../templates/projects/sub-app-react-demo','19064qDaFSF','production','3027egvNuV','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','5688qJMZOC','\x0a√\x20Project\x20','join','modelCount','log','\x20\x20Pulling\x20API\x20configuration...','dirname','\x22\x20already\x20exists.','\x20\x20√\x20Pulled\x20','\x20created\x20successfully!','bun','writeFile','1CpNawC','1893110sVXVyy','access','\x20\x20√\x20Project\x20template\x20created','package.json','Cannot\x20create\x20project\x20in\x20current\x20directory.','\x20\x20√\x20package.json\x20updated','5420KYXicX'];a97_0x5b00=function(){return _0x2b633a;};return a97_0x5b00();}async function pullApiConfig(_0x39e03b,_0x2397c8,_0x258f72,_0x489a93){const _0x618221=a97_0x155c,_0x455d27=process[_0x618221(0xac)]();try{process[_0x618221(0xa0)](_0x39e03b);const _0x171396=_0x258f72||'production';initEnv(_0x171396),console['log'](_0x618221(0x8b));const {configArray:_0x42035f}=await fetchModelList(_0x2397c8,_0x489a93||''),_0x296914=await generateApiFile(_0x42035f,'',_0x2397c8,!![],_0x171396,'./src/api/');console[_0x618221(0x8a)](_0x618221(0x8e)+_0x42035f[_0x618221(0xa3)]+'\x20dataset(s),\x20generated\x20'+_0x296914[_0x618221(0x89)]+_0x618221(0x9e));}catch(_0x4bd798){console[_0x618221(0x8a)]('\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20manually\x20later.');}finally{process['chdir'](_0x455d27);}}
@@ -1 +0,0 @@
1
- const a98_0x31d48e=a98_0x17a0;(function(_0x15722d,_0x4fa465){const _0x3fb48c=a98_0x17a0,_0x2a363b=_0x15722d();while(!![]){try{const _0x10c94d=-parseInt(_0x3fb48c(0xdf))/0x1+-parseInt(_0x3fb48c(0xd1))/0x2*(-parseInt(_0x3fb48c(0xd6))/0x3)+-parseInt(_0x3fb48c(0xdc))/0x4+parseInt(_0x3fb48c(0xd3))/0x5+-parseInt(_0x3fb48c(0xcd))/0x6*(-parseInt(_0x3fb48c(0xd0))/0x7)+-parseInt(_0x3fb48c(0xdb))/0x8*(-parseInt(_0x3fb48c(0xcf))/0x9)+-parseInt(_0x3fb48c(0xd8))/0xa*(-parseInt(_0x3fb48c(0xd5))/0xb);if(_0x10c94d===_0x4fa465)break;else _0x2a363b['push'](_0x2a363b['shift']());}catch(_0x20efb3){_0x2a363b['push'](_0x2a363b['shift']());}}}(a98_0x1d5b,0xd566f));import a98_0xe815cb from'node:path';import{fileURLToPath}from'node:url';import{copyDirectory}from'../utils/copy-directory.js';function a98_0x17a0(_0x551cf3,_0x184f46){_0x551cf3=_0x551cf3-0xcd;const _0x1d5bbf=a98_0x1d5b();let _0x17a0c4=_0x1d5bbf[_0x551cf3];return _0x17a0c4;}import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';function a98_0x1d5b(){const _0x159521=['33qbidGp','3576777akDeXi','../../templates/projects/sub-app-react-demo','1629990tVzwWk','error','now','9072848usnGvq','3657600qndfJB','copy','开始复制项目模板','1618755KOHuDx','cwd','resolve','9558GzNoVQ','dirname','9eUcLlu','2583uQkVRl','2BAAKpJ','message','20355OCOOvb','项目模板复制完成'];a98_0x1d5b=function(){return _0x159521;};return a98_0x1d5b();}const __dirname=a98_0xe815cb[a98_0x31d48e(0xce)](fileURLToPath(import.meta.url)),templateDir=a98_0xe815cb[a98_0x31d48e(0xe1)](__dirname,a98_0x31d48e(0xd7));export async function copyProjectTemplate(_0x419c60){const _0x5956f5=a98_0x31d48e,_0x3ca5a6=Date['now'](),_0x2375ef=a98_0xe815cb[_0x5956f5(0xe1)](process[_0x5956f5(0xe0)](),_0x419c60);try{logger['info'](_0x5956f5(0xdd),_0x5956f5(0xde),{'projectCode':_0x419c60,'templateDir':templateDir}),await copyDirectory(templateDir,_0x2375ef);const _0x31ad21=Date['now']()-_0x3ca5a6;logger['success'](_0x5956f5(0xdd),_0x5956f5(0xd4),_0x31ad21,{'projectCode':_0x419c60});}catch(_0x4c3156){const _0x97abe3=Date[_0x5956f5(0xda)]()-_0x3ca5a6;logger[_0x5956f5(0xd9)](_0x5956f5(0xdd),'项目模板复制失败',{'projectCode':_0x419c60,'error':_0x4c3156 instanceof Error?_0x4c3156[_0x5956f5(0xd2)]:String(_0x4c3156),'duration':_0x97abe3});throw _0x4c3156;}return formatElapsed(_0x3ca5a6);}
@@ -1 +0,0 @@
1
- function a99_0x55f9(){const _0x2e9117=['prettier','3123rNPPys','代码格式化完成','9628692VgDVDP','52RLXjlu','now','format','message','2706QzJvpC','1803109Utzzte','npx','error','32qVRVpx','开始格式化代码','1389188VlxGEX','info','cwd','5313087KmOAYe','success','404720YCpoFu','resolve','3347570QeegaR'];a99_0x55f9=function(){return _0x2e9117;};return a99_0x55f9();}(function(_0xb5dbe1,_0x19bd21){const _0x4b2eca=a99_0x268f,_0x465ffc=_0xb5dbe1();while(!![]){try{const _0x2a275d=parseInt(_0x4b2eca(0x1c2))/0x1+-parseInt(_0x4b2eca(0x1d2))/0x2*(-parseInt(_0x4b2eca(0x1cb))/0x3)+-parseInt(_0x4b2eca(0x1ce))/0x4*(parseInt(_0x4b2eca(0x1c7))/0x5)+-parseInt(_0x4b2eca(0x1cd))/0x6+parseInt(_0x4b2eca(0x1d3))/0x7*(parseInt(_0x4b2eca(0x1d6))/0x8)+-parseInt(_0x4b2eca(0x1c5))/0x9+parseInt(_0x4b2eca(0x1c9))/0xa;if(_0x2a275d===_0x19bd21)break;else _0x465ffc['push'](_0x465ffc['shift']());}catch(_0xd6a9f6){_0x465ffc['push'](_0x465ffc['shift']());}}}(a99_0x55f9,0xdf7a9));import a99_0x42545a from'node:path';import{execa}from'execa';function a99_0x268f(_0x33a288,_0x3e33c1){_0x33a288=_0x33a288-0x1c2;const _0x55f9e7=a99_0x55f9();let _0x268fe7=_0x55f9e7[_0x33a288];return _0x268fe7;}import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';import{resolveNpmBin}from'../utils/platform.js';export async function formatProjectCode(_0x586469){const _0x2f5754=a99_0x268f,_0x4b9da0=Date[_0x2f5754(0x1cf)](),_0x567c11=a99_0x42545a[_0x2f5754(0x1c8)](process[_0x2f5754(0x1c4)](),_0x586469);try{logger[_0x2f5754(0x1c3)]('format',_0x2f5754(0x1d7),{'projectCode':_0x586469}),await execa(resolveNpmBin(_0x2f5754(0x1d4)),[_0x2f5754(0x1ca),'--write','.'],{'cwd':_0x567c11});const _0x253dba=Date[_0x2f5754(0x1cf)]()-_0x4b9da0;logger[_0x2f5754(0x1c6)]('format',_0x2f5754(0x1cc),_0x253dba,{'projectCode':_0x586469});}catch(_0x44c780){const _0x13f872=Date[_0x2f5754(0x1cf)]()-_0x4b9da0;logger[_0x2f5754(0x1d5)](_0x2f5754(0x1d0),'代码格式化失败',{'projectCode':_0x586469,'error':_0x44c780 instanceof Error?_0x44c780[_0x2f5754(0x1d1)]:String(_0x44c780),'duration':_0x13f872});throw _0x44c780;}return formatElapsed(_0x4b9da0);}
@@ -1 +0,0 @@
1
- (function(_0x1c6c8d,_0x314347){const _0x2e0dad=a100_0x598a,_0x944761=_0x1c6c8d();while(!![]){try{const _0x1a6483=-parseInt(_0x2e0dad(0x172))/0x1*(-parseInt(_0x2e0dad(0x17b))/0x2)+parseInt(_0x2e0dad(0x177))/0x3+-parseInt(_0x2e0dad(0x17f))/0x4*(-parseInt(_0x2e0dad(0x175))/0x5)+parseInt(_0x2e0dad(0x181))/0x6*(parseInt(_0x2e0dad(0x17a))/0x7)+-parseInt(_0x2e0dad(0x174))/0x8+parseInt(_0x2e0dad(0x173))/0x9+parseInt(_0x2e0dad(0x17d))/0xa*(-parseInt(_0x2e0dad(0x180))/0xb);if(_0x1a6483===_0x314347)break;else _0x944761['push'](_0x944761['shift']());}catch(_0x3fb362){_0x944761['push'](_0x944761['shift']());}}}(a100_0x5097,0x43f11));function a100_0x598a(_0x190905,_0x1c183d){_0x190905=_0x190905-0x172;const _0x5097dd=a100_0x5097();let _0x598acc=_0x5097dd[_0x190905];return _0x598acc;}import a100_0x5dc411 from'node:path';import{execa}from'execa';import{formatElapsed}from'./format-elapsed.js';import{logger}from'../utils/logger.js';import{resolveNpmBin}from'../utils/platform.js';function a100_0x5097(){const _0x52111b=['3727999nmYGMC','38292VVVpRb','开始安装依赖','info','error','now','2LHUqJQ','763065uGZCHQ','718272KXAnWM','166475YnXJRG','npm','411954ivGFmE','install','https://registry.npmmirror.com','490mdUqEj','44098wborBx','--registry','20bdUGdU','message','40DpzcOl'];a100_0x5097=function(){return _0x52111b;};return a100_0x5097();}export async function installDependencies(_0x14d365){const _0x2d321c=a100_0x598a,_0x13559f=Date[_0x2d321c(0x185)](),_0x13e1d8=a100_0x5dc411['resolve'](process['cwd'](),_0x14d365);try{logger[_0x2d321c(0x183)](_0x2d321c(0x178),_0x2d321c(0x182),{'projectCode':_0x14d365,'registry':'https://registry.npmmirror.com'}),await execa(resolveNpmBin(_0x2d321c(0x176)),[_0x2d321c(0x178),_0x2d321c(0x17c),_0x2d321c(0x179)],{'cwd':_0x13e1d8});const _0x253d67=Date[_0x2d321c(0x185)]()-_0x13559f;logger['success'](_0x2d321c(0x178),'依赖安装完成',_0x253d67,{'projectCode':_0x14d365});}catch(_0x440e15){const _0x11fc39=Date[_0x2d321c(0x185)]()-_0x13559f;logger[_0x2d321c(0x184)](_0x2d321c(0x178),'依赖安装失败',{'projectCode':_0x14d365,'error':_0x440e15 instanceof Error?_0x440e15[_0x2d321c(0x17e)]:String(_0x440e15),'duration':_0x11fc39});throw _0x440e15;}return formatElapsed(_0x13559f);}
package/lib/init/main.js DELETED
@@ -1 +0,0 @@
1
- (function(_0x3d036c,_0x481465){const _0x10749a=a111_0x3010,_0x15f1c7=_0x3d036c();while(!![]){try{const _0x241541=-parseInt(_0x10749a(0xd6))/0x1*(parseInt(_0x10749a(0xda))/0x2)+-parseInt(_0x10749a(0xd9))/0x3+-parseInt(_0x10749a(0xee))/0x4+parseInt(_0x10749a(0xeb))/0x5*(parseInt(_0x10749a(0xdb))/0x6)+-parseInt(_0x10749a(0xf4))/0x7+-parseInt(_0x10749a(0xc6))/0x8*(parseInt(_0x10749a(0xd1))/0x9)+parseInt(_0x10749a(0xef))/0xa;if(_0x241541===_0x481465)break;else _0x15f1c7['push'](_0x15f1c7['shift']());}catch(_0xacdcf3){_0x15f1c7['push'](_0x15f1c7['shift']());}}}(a111_0x4521,0x56eba));function a111_0x4521(){const _0x5c38c5=['8QJmBqX','126uxRDBk','utf8','trim','.bak','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','\x20api\x20doc\x27\x20and\x20\x27','version','\x20api\x20pull\x27','appcode','info','../..','\x20project\x20init`\x20to\x20start\x20fresh.','parse','1.0.0','package.json','.rabetbase.json','51920GIWigo','\x20\x20appcode:\x20','?\x20(Old\x20file\x20→\x20*.bak)','1874888lSzmGK','18348770uFALlj','string','setLogPath','init','\x20\x20AppCode:\x20','4844882FNEnNN','cyan','Upgrade\x20it\x20to\x20','32zKWmFX','env','toLocaleString','log','✓\x20Upgraded\x20','Please\x20enter\x20App\x20Code:','app','从旧配置文件升级成功','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','bold','cwd','687123PEPTLm','初始化项目配置文件成功','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory','green','production','51223KSueki','\x20→\x20.rabetbase.json','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','77361qmRhSV'];a111_0x4521=function(){return _0x5c38c5;};return a111_0x4521();}import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a111_0x2d1f48 from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../constant/cli.js';function a111_0x3010(_0x469638,_0x5459a5){_0x469638=_0x469638-0xc6;const _0x45210f=a111_0x4521();let _0x301090=_0x45210f[_0x469638];return _0x301090;}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';export async function initConfig(_0xc2367){const _0x513905=a111_0x3010,{appcode:_0x59f941,env:_0x1a17bd,autoYes:_0x1cf72b}=_0xc2367,_0x258fde=process[_0x513905(0xd0)]();if(getProjectConfigPath())throw new Error(_0x513905(0xd8));let _0x20b88c;for(const _0x27aeda of LEGACY_CONFIG_NAMES){const _0x555944=resolve(_0x258fde,_0x27aeda);if(existsSync(_0x555944)){_0x20b88c=_0x555944;break;}}if(_0x20b88c){let _0x1ad925={};try{_0x1ad925=JSON[_0x513905(0xe7)](readFileSync(_0x20b88c,_0x513905(0xdc)));}catch{}const _0x1a1340=basename(_0x20b88c),_0x243b38=_0x1ad925?.[_0x513905(0xe3)]||_0x1ad925?.['app'];let _0x5e6e61=_0x1cf72b;!_0x1cf72b&&(console[_0x513905(0xc9)](a111_0x2d1f48['yellow']('⚠\x20Found\x20legacy\x20configuration\x20file:\x20'+a111_0x2d1f48[_0x513905(0xcf)](_0x1a1340))),_0x243b38&&console['log'](a111_0x2d1f48[_0x513905(0xf5)](_0x513905(0xec)+_0x243b38)),_0x5e6e61=await confirm({'message':_0x513905(0xf6)+a111_0x2d1f48[_0x513905(0xcf)](_0x513905(0xea))+_0x513905(0xed),'default':!![]}));if(!_0x5e6e61){console[_0x513905(0xc9)]('Migration\x20cancelled.\x20Run\x20`'+CLI_BIN_NAME+_0x513905(0xe6));return;}const _0xd9ee7d=resolve(_0x258fde,NEW_CONFIG_NAME),_0x39ff4a=getCliVersionFromPkg(),_0x55c2ba=readRawConfig(),_0x54b0b8={..._0x55c2ba,..._0x1ad925,'version':_0x39ff4a,'migratedAt':new Date()[_0x513905(0xc8)](),'migratedFrom':_0x20b88c};if(!_0x54b0b8['appcode']&&!_0x54b0b8['app']){if(!_0x59f941){const _0x2f532e=await askAppcode();_0x54b0b8[_0x513905(0xe3)]=_0x2f532e;}else _0x54b0b8[_0x513905(0xe3)]=_0x59f941;}if(_0x54b0b8[_0x513905(0xc7)]&&typeof _0x54b0b8['env']!=='string')delete _0x54b0b8[_0x513905(0xc7)];else!_0x54b0b8[_0x513905(0xc7)]&&(_0x54b0b8[_0x513905(0xc7)]=_0x55c2ba[_0x513905(0xc7)]||_0x513905(0xd5));writeConfigFile(_0xd9ee7d,_0x54b0b8);const _0x3ec1c4=_0x20b88c+_0x513905(0xde);renameSync(_0x20b88c,_0x3ec1c4),logger[_0x513905(0xf1)](_0x258fde),logger[_0x513905(0xe4)](_0x513905(0xf2),_0x513905(0xcd),{'from':_0x20b88c,'to':_0xd9ee7d,'appcode':_0x54b0b8['appcode']||_0x54b0b8['app'],'env':_0x54b0b8[_0x513905(0xc7)]}),console[_0x513905(0xc9)](a111_0x2d1f48['green'](_0x513905(0xca)+_0x1a1340+_0x513905(0xd7))),console[_0x513905(0xc9)](a111_0x2d1f48[_0x513905(0xf5)](_0x513905(0xf3)+(_0x54b0b8[_0x513905(0xe3)]||_0x54b0b8[_0x513905(0xcc)]))),console[_0x513905(0xc9)](a111_0x2d1f48['gray'](_0x513905(0xdf)+_0x1a1340+_0x513905(0xde)));return;}const _0x1728f7=_0x59f941||await askAppcode(),_0x56f42a=resolve(_0x258fde,NEW_CONFIG_NAME),_0x3c49c5=getCliVersionFromPkg(),_0x2eb63c=readRawConfig(),_0x51b4bd=typeof _0x2eb63c[_0x513905(0xc7)]===_0x513905(0xf0)?_0x2eb63c[_0x513905(0xc7)]:undefined,_0x2f9f0d={'version':_0x3c49c5,'createdAt':new Date()[_0x513905(0xc8)](),'appcode':_0x1728f7,'env':_0x1a17bd||_0x51b4bd||'production'};writeConfigFile(_0x56f42a,_0x2f9f0d),logger[_0x513905(0xf1)](_0x258fde),logger[_0x513905(0xe4)]('init',_0x513905(0xd2),{'appcode':_0x2f9f0d[_0x513905(0xe3)],'env':_0x2f9f0d['env'],'version':_0x2f9f0d[_0x513905(0xe1)],'configPath':_0x56f42a}),console[_0x513905(0xc9)](a111_0x2d1f48[_0x513905(0xd4)](_0x513905(0xd3))),console[_0x513905(0xc9)](a111_0x2d1f48[_0x513905(0xf5)](_0x513905(0xf3)+_0x1728f7)),console['log'](_0x513905(0xce)+CLI_BIN_NAME+_0x513905(0xe0)+CLI_BIN_NAME+_0x513905(0xe2));}function askAppcode(){const _0x19956b=a111_0x3010;return input({'message':_0x19956b(0xcb),'validate':_0x58f99d=>{const _0x53f2a3=_0x19956b;if(!_0x58f99d[_0x53f2a3(0xdd)]())return'App\x20Code\x20cannot\x20be\x20empty';const {valid:_0x2644b5,message:_0x34c66f}=validateAppcode(_0x58f99d[_0x53f2a3(0xdd)]());return _0x2644b5||_0x34c66f||'Invalid\x20App\x20Code';}});}function getCliVersionFromPkg(){const _0x329e9f=a111_0x3010;try{const _0x22b9c5=fileURLToPath(import.meta.url),_0x56472c=resolve(dirname(_0x22b9c5),_0x329e9f(0xe5)),_0xb1750d=JSON['parse'](readFileSync(resolve(_0x56472c,_0x329e9f(0xe9)),'utf8'));return _0xb1750d[_0x329e9f(0xe1)]||_0x329e9f(0xe8);}catch{return _0x329e9f(0xe8);}}