@lovrabet/rabetbase-cli 2.2.0-beta.1 → 2.2.0-beta.2

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 (204) hide show
  1. package/lib/api/api-doc.js +1 -1
  2. package/lib/api/fetch-model-list.js +1 -1
  3. package/lib/api/generate-api-file.js +1 -1
  4. package/lib/auth/auth-server-ui.js +1 -1
  5. package/lib/auth/auth-server.js +1 -1
  6. package/lib/auth/constant.js +1 -1
  7. package/lib/auth/get-cookie.js +1 -1
  8. package/lib/auth/get-session-user.js +1 -1
  9. package/lib/auth/is-session-valid.js +1 -1
  10. package/lib/auth/login-success-html.js +1 -1
  11. package/lib/auth/logout.js +1 -1
  12. package/lib/cli-flags.js +1 -1
  13. package/lib/cli.js +1 -1
  14. package/lib/commands/api/generate.js +1 -1
  15. package/lib/commands/api/index.js +1 -1
  16. package/lib/commands/api/list.js +1 -1
  17. package/lib/commands/api/pull.js +1 -1
  18. package/lib/commands/api/shared.js +1 -1
  19. package/lib/commands/app/add.js +1 -1
  20. package/lib/commands/app/discover.js +1 -1
  21. package/lib/commands/app/index.js +1 -1
  22. package/lib/commands/app/list.js +1 -1
  23. package/lib/commands/app/remove.js +1 -1
  24. package/lib/commands/app/shared.js +1 -1
  25. package/lib/commands/app/use.js +1 -1
  26. package/lib/commands/auth/index.js +1 -1
  27. package/lib/commands/bff/create.js +1 -1
  28. package/lib/commands/bff/delete.js +1 -1
  29. package/lib/commands/bff/detail.js +1 -1
  30. package/lib/commands/bff/index.js +1 -1
  31. package/lib/commands/bff/list.js +1 -1
  32. package/lib/commands/bff/pull.js +1 -1
  33. package/lib/commands/bff/push.js +1 -1
  34. package/lib/commands/bff/status.js +1 -1
  35. package/lib/commands/cli-update.js +1 -1
  36. package/lib/commands/codegen/index.js +1 -1
  37. package/lib/commands/codegen/sdk.js +1 -1
  38. package/lib/commands/codegen/sql.js +1 -1
  39. package/lib/commands/common/app-selector.js +1 -1
  40. package/lib/commands/common/flags.js +1 -1
  41. package/lib/commands/common/validate.js +1 -1
  42. package/lib/commands/config/get.js +1 -1
  43. package/lib/commands/config/index.js +1 -1
  44. package/lib/commands/config/list.js +1 -1
  45. package/lib/commands/config/set.js +1 -1
  46. package/lib/commands/config/shared.js +1 -1
  47. package/lib/commands/data/filter.js +1 -1
  48. package/lib/commands/data/getOne.js +1 -1
  49. package/lib/commands/data/index.js +1 -1
  50. package/lib/commands/data/shared.js +1 -1
  51. package/lib/commands/dataset/capability.js +1 -1
  52. package/lib/commands/dataset/delete.js +1 -1
  53. package/lib/commands/dataset/detail.js +1 -1
  54. package/lib/commands/dataset/extend-update.js +1 -1
  55. package/lib/commands/dataset/field-update.js +1 -1
  56. package/lib/commands/dataset/index.js +1 -1
  57. package/lib/commands/dataset/list.js +1 -1
  58. package/lib/commands/dataset/operations.js +1 -1
  59. package/lib/commands/dataset/relation-create.js +1 -1
  60. package/lib/commands/dataset/relation-delete.js +1 -1
  61. package/lib/commands/dataset/relation-shared.js +1 -1
  62. package/lib/commands/dataset/relation-update.js +1 -1
  63. package/lib/commands/dataset/relations.js +1 -1
  64. package/lib/commands/dataset/rename.js +1 -1
  65. package/lib/commands/db/analyze-cancel.js +1 -1
  66. package/lib/commands/db/analyze-start.js +1 -1
  67. package/lib/commands/db/analyze-status.js +1 -1
  68. package/lib/commands/db/create.js +1 -1
  69. package/lib/commands/db/delete.js +1 -1
  70. package/lib/commands/db/detail.js +1 -1
  71. package/lib/commands/db/diff.js +1 -1
  72. package/lib/commands/db/index.js +1 -1
  73. package/lib/commands/db/list.js +1 -1
  74. package/lib/commands/db/shared.js +1 -1
  75. package/lib/commands/db/tables.js +1 -1
  76. package/lib/commands/db/test.js +1 -1
  77. package/lib/commands/db/update.js +1 -1
  78. package/lib/commands/doctor.js +1 -1
  79. package/lib/commands/init/index.js +1 -1
  80. package/lib/commands/issue/index.js +1 -1
  81. package/lib/commands/issue/nudge.js +1 -1
  82. package/lib/commands/issue/report.js +1 -1
  83. package/lib/commands/issue/shared.js +1 -1
  84. package/lib/commands/logs/index.js +1 -1
  85. package/lib/commands/menu/index.js +1 -1
  86. package/lib/commands/menu/shared/compare-table.js +1 -1
  87. package/lib/commands/menu/shared/index.js +1 -1
  88. package/lib/commands/menu/shared/inquirer.js +1 -1
  89. package/lib/commands/menu/shared/local-pages.js +1 -1
  90. package/lib/commands/menu/shared/logic.js +1 -1
  91. package/lib/commands/menu/shared/service.js +1 -1
  92. package/lib/commands/menu/shared/sync-core.js +1 -1
  93. package/lib/commands/menu/shared/update-core.js +1 -1
  94. package/lib/commands/menu/shared/valid-url.js +1 -1
  95. package/lib/commands/menu/sync.js +1 -1
  96. package/lib/commands/menu/update.js +1 -1
  97. package/lib/commands/page/generate-start.js +1 -1
  98. package/lib/commands/page/generate-status.js +1 -1
  99. package/lib/commands/page/index.js +1 -1
  100. package/lib/commands/page/pull.js +1 -1
  101. package/lib/commands/page/push.js +1 -1
  102. package/lib/commands/page/relation-audit.js +1 -1
  103. package/lib/commands/page/shared.js +1 -1
  104. package/lib/commands/page/standard-page-status.js +1 -1
  105. package/lib/commands/page/sync.js +1 -1
  106. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  107. package/lib/commands/project/create/format-elapsed.js +1 -1
  108. package/lib/commands/project/create/main.js +1 -1
  109. package/lib/commands/project/create/non-interactive.js +1 -1
  110. package/lib/commands/project/create/project-template-path.js +1 -1
  111. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  112. package/lib/commands/project/create/use-format-code.js +1 -1
  113. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  114. package/lib/commands/project/index.js +1 -1
  115. package/lib/commands/project/init.js +1 -1
  116. package/lib/commands/project/upgrade.js +1 -1
  117. package/lib/commands/registry.js +1 -1
  118. package/lib/commands/run/index.js +1 -1
  119. package/lib/commands/schema.js +1 -1
  120. package/lib/commands/skill/index.js +1 -1
  121. package/lib/commands/sql/create.js +1 -1
  122. package/lib/commands/sql/delete.js +1 -1
  123. package/lib/commands/sql/detail.js +1 -1
  124. package/lib/commands/sql/exec.js +1 -1
  125. package/lib/commands/sql/index.js +1 -1
  126. package/lib/commands/sql/list.js +1 -1
  127. package/lib/commands/sql/pull.js +1 -1
  128. package/lib/commands/sql/push.js +1 -1
  129. package/lib/commands/sql/save.js +1 -1
  130. package/lib/commands/sql/shared.js +1 -1
  131. package/lib/commands/sql/status.js +1 -1
  132. package/lib/commands/sql/validate.js +1 -1
  133. package/lib/config/schema.js +1 -1
  134. package/lib/constant/cdn.js +1 -1
  135. package/lib/constant/cli.js +1 -1
  136. package/lib/constant/defaults.js +1 -1
  137. package/lib/constant/domain.js +1 -1
  138. package/lib/constant/env.js +1 -1
  139. package/lib/constant/output.js +1 -1
  140. package/lib/constant/paths.js +1 -1
  141. package/lib/constant/risk.js +1 -1
  142. package/lib/context.js +1 -1
  143. package/lib/core/alias-resolver.js +1 -1
  144. package/lib/core/api-client.js +1 -1
  145. package/lib/core/bff/config.js +1 -1
  146. package/lib/core/bff/file-system.js +1 -1
  147. package/lib/core/bff/hash.js +1 -1
  148. package/lib/core/bff/lock.js +1 -1
  149. package/lib/core/bff/utils.js +1 -1
  150. package/lib/core/db-resolver.js +1 -1
  151. package/lib/core/page/file-system.js +1 -1
  152. package/lib/core/page/hash.js +1 -1
  153. package/lib/core/page/lock.js +1 -1
  154. package/lib/core/sql-sync/config.js +1 -1
  155. package/lib/core/sql-sync/file-system.js +1 -1
  156. package/lib/core/sql-sync/hash.js +1 -1
  157. package/lib/core/sql-sync/lock.js +1 -1
  158. package/lib/core/sql-sync/utils.js +1 -1
  159. package/lib/core/sql-validator.js +1 -1
  160. package/lib/errors.js +1 -1
  161. package/lib/framework/build-all-flags.js +1 -1
  162. package/lib/framework/flags.js +1 -1
  163. package/lib/framework/help.js +1 -1
  164. package/lib/framework/index.js +1 -1
  165. package/lib/framework/output.js +1 -1
  166. package/lib/framework/response.js +1 -1
  167. package/lib/framework/runner-alias.js +1 -1
  168. package/lib/framework/runner.js +1 -1
  169. package/lib/framework/schema-export.js +1 -1
  170. package/lib/framework/types.js +1 -1
  171. package/lib/generated/build-info.js +1 -1
  172. package/lib/help.js +1 -1
  173. package/lib/skills/main.js +1 -1
  174. package/lib/skills/npx-skills-add.js +1 -1
  175. package/lib/telemetry/cli-command-trace.js +1 -1
  176. package/lib/telemetry/cli-help-trace.js +1 -1
  177. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  178. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  179. package/lib/telemetry/send-cli-trace-log.js +1 -1
  180. package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
  181. package/lib/utils/ai_config.js +1 -1
  182. package/lib/utils/apply-jq-filter.js +1 -1
  183. package/lib/utils/cdn-config.js +1 -1
  184. package/lib/utils/check-sdk-version.js +1 -1
  185. package/lib/utils/cli-version-check.js +1 -1
  186. package/lib/utils/cli-version-policy.js +1 -1
  187. package/lib/utils/config.js +1 -1
  188. package/lib/utils/copy-directory.js +1 -1
  189. package/lib/utils/entity-with-id.js +1 -1
  190. package/lib/utils/file-utils.js +1 -1
  191. package/lib/utils/guides-cdn.js +1 -1
  192. package/lib/utils/http-client.js +1 -1
  193. package/lib/utils/is-non-interactive.js +1 -1
  194. package/lib/utils/logger.js +1 -1
  195. package/lib/utils/params.js +1 -1
  196. package/lib/utils/platform.js +1 -1
  197. package/lib/utils/rules-cdn.js +1 -1
  198. package/lib/utils/sleep.js +1 -1
  199. package/lib/utils/template-replacer.js +1 -1
  200. package/lib/utils/update-notice.js +1 -1
  201. package/lib/utils/version.js +1 -1
  202. package/lib/utils/with-active-cookie.js +1 -1
  203. package/lib/utils/write-cli-side-channel.js +1 -1
  204. package/package.json +1 -1
@@ -1 +1 @@
1
- function a115_0x56b3(){const _0x131350=['\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','167153beJNOU','63591MKaeGv','env','string','\x20\x20Default:\x20','utf8','初始化项目配置文件成功','9294240uArdBi','3490rRzfiW','bold','8143938cvRxTo','appcode','2QBCjAo','join','Upgrade\x20it\x20to\x20','?\x20(Old\x20file\x20→\x20*.bak)','1535403yEPyTe','log','setLogPath','toLocaleString','Please\x20enter\x20App\x20Code:','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','init','从旧配置文件升级成功','keys','.bak','production','\x20project\x20init`\x20to\x20start\x20fresh.','\x20\x20appcode:\x20','package.json','\x20\x20Apps:\x20','cwd','\x20api\x20pull\x27','apps','cyan','428007oZAvXF','294zBYXUy','55VZtPPQ','version','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','app','info','✓\x20Upgraded\x20','gray','trim','green','1.0.0','defaultApp','Migration\x20cancelled.\x20Run\x20`','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory','\x20→\x20.rabetbase.json','62344TwvgxR'];a115_0x56b3=function(){return _0x131350;};return a115_0x56b3();}(function(_0x3029be,_0x3169c9){const _0x5bab85=a115_0x1fce,_0x152d80=_0x3029be();while(!![]){try{const _0x5789d0=-parseInt(_0x5bab85(0xc0))/0x1+-parseInt(_0x5bab85(0xa9))/0x2*(-parseInt(_0x5bab85(0xad))/0x3)+-parseInt(_0x5bab85(0x9b))/0x4*(-parseInt(_0x5bab85(0x8d))/0x5)+-parseInt(_0x5bab85(0xc1))/0x6*(parseInt(_0x5bab85(0x9d))/0x7)+-parseInt(_0x5bab85(0xa4))/0x8+parseInt(_0x5bab85(0xa7))/0x9+parseInt(_0x5bab85(0xa5))/0xa*(parseInt(_0x5bab85(0x9e))/0xb);if(_0x5789d0===_0x3169c9)break;else _0x152d80['push'](_0x152d80['shift']());}catch(_0x523a45){_0x152d80['push'](_0x152d80['shift']());}}}(a115_0x56b3,0xce810));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a115_0x404802 from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x136ece){const _0xe2f8be=a115_0x1fce,{appcode:_0xe6385,env:_0x5bf403,autoYes:_0x40fdf7}=_0x136ece,_0x4269a4=process[_0xe2f8be(0xbc)]();if(getProjectConfigPath())throw new Error(_0xe2f8be(0xb2));let _0x342a23;for(const _0xe7dda0 of LEGACY_CONFIG_NAMES){const _0x371d96=resolve(_0x4269a4,_0xe7dda0);if(existsSync(_0x371d96)){_0x342a23=_0x371d96;break;}}if(_0x342a23){let _0x54a119={};try{_0x54a119=JSON['parse'](readFileSync(_0x342a23,_0xe2f8be(0xa2)));}catch{}const _0x7991d1=basename(_0x342a23),_0xa226d9=_0x54a119?.[_0xe2f8be(0xa8)]||_0x54a119?.['app'];let _0x1d01df=_0x40fdf7;!_0x40fdf7&&(console[_0xe2f8be(0xae)](a115_0x404802['yellow']('⚠\x20Found\x20legacy\x20configuration\x20file:\x20'+a115_0x404802['bold'](_0x7991d1))),_0xa226d9&&console[_0xe2f8be(0xae)](a115_0x404802[_0xe2f8be(0xbf)](_0xe2f8be(0xb9)+_0xa226d9)),_0x1d01df=await confirm({'message':_0xe2f8be(0xab)+a115_0x404802[_0xe2f8be(0xa6)]('.rabetbase.json')+_0xe2f8be(0xac),'default':!![]}));if(!_0x1d01df){console[_0xe2f8be(0xae)](_0xe2f8be(0x98)+CLI_BIN_NAME+_0xe2f8be(0xb8));return;}const _0x6dff79=resolve(_0x4269a4,NEW_CONFIG_NAME),_0x16fec7=getCliVersionFromPkg(),_0x8be981=readRawConfig(),_0x5af1d4=_0xe6385||(typeof _0x54a119?.[_0xe2f8be(0xa8)]==='string'?_0x54a119[_0xe2f8be(0xa8)]:undefined)||(typeof _0x54a119?.[_0xe2f8be(0x90)]===_0xe2f8be(0xa0)?_0x54a119[_0xe2f8be(0x90)]:undefined)||await askAppcode(),_0xc441f8=typeof _0x54a119?.[_0xe2f8be(0x9f)]===_0xe2f8be(0xa0)?_0x54a119[_0xe2f8be(0x9f)]:typeof _0x8be981[_0xe2f8be(0x9f)]===_0xe2f8be(0xa0)?_0x8be981[_0xe2f8be(0x9f)]:_0xe2f8be(0xb7),_0x34fa22=buildCanonicalProjectConfig({..._0x8be981,..._0x54a119},{'appCodes':[_0x5af1d4],'env':_0xc441f8,'metadata':{'version':_0x16fec7,'migratedAt':new Date()[_0xe2f8be(0xb0)](),'migratedFrom':_0x342a23}});writeConfigFile(_0x6dff79,_0x34fa22);const _0x479e48=_0x342a23+_0xe2f8be(0xb6);renameSync(_0x342a23,_0x479e48),logger[_0xe2f8be(0xaf)](_0x4269a4),logger[_0xe2f8be(0x91)](_0xe2f8be(0xb3),_0xe2f8be(0xb4),{'from':_0x342a23,'to':_0x6dff79,'appcode':_0x5af1d4,'env':_0x34fa22[_0xe2f8be(0x9f)]}),console[_0xe2f8be(0xae)](a115_0x404802[_0xe2f8be(0x95)](_0xe2f8be(0x92)+_0x7991d1+_0xe2f8be(0x9a))),console[_0xe2f8be(0xae)](a115_0x404802['cyan'](_0xe2f8be(0xbb)+Object[_0xe2f8be(0xb5)](_0x34fa22[_0xe2f8be(0xbe)]||{})['join'](',\x20'))),console[_0xe2f8be(0xae)](a115_0x404802[_0xe2f8be(0xbf)]('\x20\x20Default:\x20'+_0x34fa22[_0xe2f8be(0x97)])),console['log'](a115_0x404802[_0xe2f8be(0x93)](_0xe2f8be(0x8f)+_0x7991d1+'.bak'));return;}const _0x5de6cc=_0xe6385||await askAppcode(),_0x137cf6=resolve(_0x4269a4,NEW_CONFIG_NAME),_0x2b9523=getCliVersionFromPkg(),_0x5330be=readRawConfig(),_0x940d2b=typeof _0x5330be[_0xe2f8be(0x9f)]===_0xe2f8be(0xa0)?_0x5330be[_0xe2f8be(0x9f)]:undefined,_0xd87426=buildCanonicalProjectConfig({},{'appCodes':[_0x5de6cc],'env':_0x5bf403||_0x940d2b||_0xe2f8be(0xb7),'metadata':{'version':_0x2b9523,'createdAt':new Date()[_0xe2f8be(0xb0)]()}});writeConfigFile(_0x137cf6,_0xd87426),logger[_0xe2f8be(0xaf)](_0x4269a4),logger[_0xe2f8be(0x91)]('init',_0xe2f8be(0xa3),{'appcode':_0x5de6cc,'env':_0xd87426[_0xe2f8be(0x9f)],'version':_0xd87426[_0xe2f8be(0x8e)],'configPath':_0x137cf6}),console[_0xe2f8be(0xae)](a115_0x404802[_0xe2f8be(0x95)](_0xe2f8be(0x99))),console['log'](a115_0x404802[_0xe2f8be(0xbf)](_0xe2f8be(0xbb)+Object['keys'](_0xd87426[_0xe2f8be(0xbe)]||{})[_0xe2f8be(0xaa)](',\x20'))),console['log'](a115_0x404802[_0xe2f8be(0xbf)](_0xe2f8be(0xa1)+_0xd87426[_0xe2f8be(0x97)])),console[_0xe2f8be(0xae)](_0xe2f8be(0x9c)+CLI_BIN_NAME+'\x20api\x20generate\x27\x20and\x20\x27'+CLI_BIN_NAME+_0xe2f8be(0xbd));}function a115_0x1fce(_0x207678,_0x190c37){_0x207678=_0x207678-0x8d;const _0x56b317=a115_0x56b3();let _0x1fce65=_0x56b317[_0x207678];return _0x1fce65;}function askAppcode(){const _0x279df5=a115_0x1fce;return input({'message':_0x279df5(0xb1),'validate':_0x54f8e7=>{const _0xb4d91b=_0x279df5;if(!_0x54f8e7[_0xb4d91b(0x94)]())return'App\x20Code\x20cannot\x20be\x20empty';const {valid:_0x5e1abb,message:_0x58b99c}=validateAppcode(_0x54f8e7['trim']());return _0x5e1abb||_0x58b99c||'Invalid\x20App\x20Code';}});}function getCliVersionFromPkg(){const _0x4eb4f6=a115_0x1fce;try{const _0x2fb013=fileURLToPath(import.meta.url),_0x4d606a=resolve(dirname(_0x2fb013),'../..'),_0x3d24fb=JSON['parse'](readFileSync(resolve(_0x4d606a,_0x4eb4f6(0xba)),_0x4eb4f6(0xa2)));return _0x3d24fb[_0x4eb4f6(0x8e)]||_0x4eb4f6(0x96);}catch{return _0x4eb4f6(0x96);}}
1
+ (function(_0x4ca657,_0xe619b){const _0x15c7c8=a115_0x1454,_0x4084e8=_0x4ca657();while(!![]){try{const _0x27a1b0=parseInt(_0x15c7c8(0x15a))/0x1+-parseInt(_0x15c7c8(0x140))/0x2+parseInt(_0x15c7c8(0x14b))/0x3*(parseInt(_0x15c7c8(0x137))/0x4)+-parseInt(_0x15c7c8(0x15b))/0x5*(parseInt(_0x15c7c8(0x133))/0x6)+parseInt(_0x15c7c8(0x155))/0x7*(parseInt(_0x15c7c8(0x12e))/0x8)+parseInt(_0x15c7c8(0x138))/0x9*(-parseInt(_0x15c7c8(0x144))/0xa)+parseInt(_0x15c7c8(0x149))/0xb*(parseInt(_0x15c7c8(0x13f))/0xc);if(_0x27a1b0===_0xe619b)break;else _0x4084e8['push'](_0x4084e8['shift']());}catch(_0x140607){_0x4084e8['push'](_0x4084e8['shift']());}}}(a115_0x4ee0,0x617ac));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a115_0x427e95 from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';function a115_0x4ee0(){const _0x1db59a=['Invalid\x20App\x20Code','keys','.bak','\x20project\x20init`\x20to\x20start\x20fresh.','622573gOOQac','✓\x20Upgraded\x20','string','production','toLocaleString','454559mGWQWJ','10CmCXAQ','\x20\x20appcode:\x20','parse','defaultApp','cyan','初始化项目配置文件成功','\x20\x20Default:\x20','App\x20Code\x20cannot\x20be\x20empty','8ErYWed','../..','1.0.0','appcode','log','1836834AWjRhf','init','?\x20(Old\x20file\x20→\x20*.bak)','Upgrade\x20it\x20to\x20','4kfoTwG','7713TMfLqh','gray','trim','Migration\x20cancelled.\x20Run\x20`','.rabetbase.json','green','yellow','24rIVdJU','280028WGWVyo','version','package.json','\x20\x20Apps:\x20','7510MIAMcF','app','info','\x20→\x20.rabetbase.json','env','4942993JxClKC','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','1058853yjGxhT','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','Please\x20enter\x20App\x20Code:','setLogPath','cwd','\x20api\x20pull\x27'];a115_0x4ee0=function(){return _0x1db59a;};return a115_0x4ee0();}import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x4e7c35){const _0x2d7147=a115_0x1454,{appcode:_0x51bc3d,env:_0x38b3ff,autoYes:_0x4fb375}=_0x4e7c35,_0x4acc45=process[_0x2d7147(0x14f)]();if(getProjectConfigPath())throw new Error(_0x2d7147(0x14a));let _0x2eeb8c;for(const _0x24b89a of LEGACY_CONFIG_NAMES){const _0xac3822=resolve(_0x4acc45,_0x24b89a);if(existsSync(_0xac3822)){_0x2eeb8c=_0xac3822;break;}}if(_0x2eeb8c){let _0x4e4cdf={};try{_0x4e4cdf=JSON['parse'](readFileSync(_0x2eeb8c,'utf8'));}catch{}const _0xdb4ccb=basename(_0x2eeb8c),_0x54a733=_0x4e4cdf?.[_0x2d7147(0x131)]||_0x4e4cdf?.[_0x2d7147(0x145)];let _0x482eba=_0x4fb375;!_0x4fb375&&(console[_0x2d7147(0x132)](a115_0x427e95[_0x2d7147(0x13e)]('⚠\x20Found\x20legacy\x20configuration\x20file:\x20'+a115_0x427e95['bold'](_0xdb4ccb))),_0x54a733&&console[_0x2d7147(0x132)](a115_0x427e95['cyan'](_0x2d7147(0x15c)+_0x54a733)),_0x482eba=await confirm({'message':_0x2d7147(0x136)+a115_0x427e95['bold'](_0x2d7147(0x13c))+_0x2d7147(0x135),'default':!![]}));if(!_0x482eba){console[_0x2d7147(0x132)](_0x2d7147(0x13b)+CLI_BIN_NAME+_0x2d7147(0x154));return;}const _0x27eb79=resolve(_0x4acc45,NEW_CONFIG_NAME),_0x5e1b2f=getCliVersionFromPkg(),_0x20aca9=readRawConfig(),_0x3bbdf0=_0x51bc3d||(typeof _0x4e4cdf?.[_0x2d7147(0x131)]===_0x2d7147(0x157)?_0x4e4cdf[_0x2d7147(0x131)]:undefined)||(typeof _0x4e4cdf?.['app']===_0x2d7147(0x157)?_0x4e4cdf[_0x2d7147(0x145)]:undefined)||await askAppcode(),_0x28f1ae=typeof _0x4e4cdf?.[_0x2d7147(0x148)]==='string'?_0x4e4cdf[_0x2d7147(0x148)]:typeof _0x20aca9[_0x2d7147(0x148)]===_0x2d7147(0x157)?_0x20aca9[_0x2d7147(0x148)]:'production',_0x1bd740=buildCanonicalProjectConfig({..._0x20aca9,..._0x4e4cdf},{'appCodes':[_0x3bbdf0],'env':_0x28f1ae,'metadata':{'version':_0x5e1b2f,'migratedAt':new Date()[_0x2d7147(0x159)](),'migratedFrom':_0x2eeb8c}});writeConfigFile(_0x27eb79,_0x1bd740);const _0x2549f3=_0x2eeb8c+_0x2d7147(0x153);renameSync(_0x2eeb8c,_0x2549f3),logger[_0x2d7147(0x14e)](_0x4acc45),logger[_0x2d7147(0x146)](_0x2d7147(0x134),'从旧配置文件升级成功',{'from':_0x2eeb8c,'to':_0x27eb79,'appcode':_0x3bbdf0,'env':_0x1bd740['env']}),console[_0x2d7147(0x132)](a115_0x427e95[_0x2d7147(0x13d)](_0x2d7147(0x156)+_0xdb4ccb+_0x2d7147(0x147))),console[_0x2d7147(0x132)](a115_0x427e95['cyan'](_0x2d7147(0x143)+Object[_0x2d7147(0x152)](_0x1bd740['apps']||{})['join'](',\x20'))),console['log'](a115_0x427e95['cyan']('\x20\x20Default:\x20'+_0x1bd740['defaultApp'])),console[_0x2d7147(0x132)](a115_0x427e95[_0x2d7147(0x139)]('\x20\x20Old\x20file\x20backed\x20up\x20as\x20'+_0xdb4ccb+'.bak'));return;}const _0x2e38f4=_0x51bc3d||await askAppcode(),_0x25c25a=resolve(_0x4acc45,NEW_CONFIG_NAME),_0x59a3a0=getCliVersionFromPkg(),_0x5c33cb=readRawConfig(),_0xcd11ab=typeof _0x5c33cb[_0x2d7147(0x148)]===_0x2d7147(0x157)?_0x5c33cb[_0x2d7147(0x148)]:undefined,_0xcccf79=buildCanonicalProjectConfig({},{'appCodes':[_0x2e38f4],'env':_0x38b3ff||_0xcd11ab||_0x2d7147(0x158),'metadata':{'version':_0x59a3a0,'createdAt':new Date()['toLocaleString']()}});writeConfigFile(_0x25c25a,_0xcccf79),logger[_0x2d7147(0x14e)](_0x4acc45),logger[_0x2d7147(0x146)](_0x2d7147(0x134),_0x2d7147(0x12b),{'appcode':_0x2e38f4,'env':_0xcccf79[_0x2d7147(0x148)],'version':_0xcccf79[_0x2d7147(0x141)],'configPath':_0x25c25a}),console[_0x2d7147(0x132)](a115_0x427e95[_0x2d7147(0x13d)]('✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory')),console['log'](a115_0x427e95[_0x2d7147(0x12a)](_0x2d7147(0x143)+Object[_0x2d7147(0x152)](_0xcccf79['apps']||{})['join'](',\x20'))),console['log'](a115_0x427e95[_0x2d7147(0x12a)](_0x2d7147(0x12c)+_0xcccf79[_0x2d7147(0x129)])),console[_0x2d7147(0x132)](_0x2d7147(0x14c)+CLI_BIN_NAME+'\x20api\x20generate\x27\x20and\x20\x27'+CLI_BIN_NAME+_0x2d7147(0x150));}function a115_0x1454(_0xd33edd,_0x474813){_0xd33edd=_0xd33edd-0x129;const _0x4ee03f=a115_0x4ee0();let _0x145433=_0x4ee03f[_0xd33edd];return _0x145433;}function askAppcode(){const _0x4e486b=a115_0x1454;return input({'message':_0x4e486b(0x14d),'validate':_0x2fe6a8=>{const _0x5e249c=_0x4e486b;if(!_0x2fe6a8[_0x5e249c(0x13a)]())return _0x5e249c(0x12d);const {valid:_0x5a2750,message:_0x1b01f8}=validateAppcode(_0x2fe6a8['trim']());return _0x5a2750||_0x1b01f8||_0x5e249c(0x151);}});}function getCliVersionFromPkg(){const _0x79eaf0=a115_0x1454;try{const _0x4e441c=fileURLToPath(import.meta.url),_0x38434c=resolve(dirname(_0x4e441c),_0x79eaf0(0x12f)),_0x7aaffc=JSON[_0x79eaf0(0x15d)](readFileSync(resolve(_0x38434c,_0x79eaf0(0x142)),'utf8'));return _0x7aaffc[_0x79eaf0(0x141)]||_0x79eaf0(0x130);}catch{return _0x79eaf0(0x130);}}
@@ -1 +1 @@
1
- const a116_0x4b40f6=a116_0x4799;(function(_0x4197e8,_0x552440){const _0x4769b3=a116_0x4799,_0x4a43f0=_0x4197e8();while(!![]){try{const _0x11b658=parseInt(_0x4769b3(0x1c4))/0x1+parseInt(_0x4769b3(0x1b1))/0x2+-parseInt(_0x4769b3(0x1c8))/0x3+parseInt(_0x4769b3(0x209))/0x4+parseInt(_0x4769b3(0x1af))/0x5+parseInt(_0x4769b3(0x21e))/0x6*(-parseInt(_0x4769b3(0x224))/0x7)+-parseInt(_0x4769b3(0x22a))/0x8*(-parseInt(_0x4769b3(0x1bb))/0x9);if(_0x11b658===_0x552440)break;else _0x4a43f0['push'](_0x4a43f0['shift']());}catch(_0x336541){_0x4a43f0['push'](_0x4a43f0['shift']());}}}(a116_0x244d,0x536e3));import a116_0x49b081 from'chalk';import a116_0x529828 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';function a116_0x244d(){const _0xdb8fb5=['undefined','Step\x201/7:\x20Migrating\x20config...','white','yes','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','\x20removed','.bak','string','@lovrabet/sdk','gray','skipped','CANCEL','no\x20legacy\x20entry','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','files','Upgrade\x20completed\x20successfully!','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','utf8','Step\x206/7:\x20Installing\x20new\x20skill...','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','Remove\x20old\x20skill','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','\x20\x20#\x20or','\x20\x20Step\x20','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','error','includes','cyan','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','label','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','fail','Step\x204/7:\x20Cleaning\x20MCP\x20config...','@lovrabet/sdk:','\x20→\x20latest','push','Clean\x20MCP\x20config','join','none\x20found','FAIL','sdkUpgrade','path','.cursor/mcp.json','\x20from\x20','Remove\x20.lovrabet/','detail','parse','exit\x20','step','.lovrabet','Upgrade\x20@lovrabet/sdk','some','mcpServers','failed','start','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','no\x20matching\x20entry\x20found','inherit','535584sSjpPg','Step\x204/7:\x20MCP\x20config\x20—\x20','Config\x20migration','\x20\x20Action:\x20delete','keys','lovrabet/rabetbase\x20installed\x20globally','\x20\x20npm\x20install','already\x20exists\x20(will\x20merge)','FOUND','succeed','values','lovrabet/rabetbase','.claude/skills/lovrabet','Config\x20file:','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','lovrabet/lovrabet-skill\x20removed','dependencies','args','status','devDependencies','info','24GbPvBq','\x20(backup:\x20','Upgrade\x20cancelled.','@lovrabet/dataset-mcp-server','skipped\x20(no\x20legacy\x20config)','not\x20found\x20or\x20already\x20at\x20latest','1148609MdXBJr','MCP\x20config:','green','red','object','oldMcpConfig','40tGMXqY','package.json','\x20→\x20','needed','143150jSRtYm','entries','562598UjKlzO','no\x20legacy\x20config\x20found','bold','oldPath','filter','stringify','message','[\x22@lovrabet/sdk\x22]:\x20','latest','oldArtifacts','510795xDvQpr','.cursor/rules/lovrabet_rules.mdc','Install\x20new\x20skill','done','length','\x20\x20\x20\x20\x20\x20\x20','hasNewConfig','Skill\x20swap:','yellow','462971JFmyeZ','configMigration','fields','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','577476sbJMRP','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','log'];a116_0x244d=function(){return _0xdb8fb5;};return a116_0x244d();}import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a116_0x4b40f6(0x1b5)](_0x1bc44f=>_0x1bc44f!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x1c0c76){const _0x3f0abd=a116_0x4b40f6,_0x3cbed8=[];for(const _0xd71aa1 of Object[_0x3f0abd(0x213)](CORE_IDE_CONFIGS)){if(_0xd71aa1['files'])for(const _0xa07b12 of _0xd71aa1[_0x3f0abd(0x1db)]){_0x3cbed8[_0x3f0abd(0x1f2)](resolve(_0x1c0c76,_0xa07b12[_0x3f0abd(0x1f8)]));}}return _0x3cbed8;}function analyse(_0x3ab195){const _0x26f449=a116_0x4b40f6;let _0x274fa1=null;const _0x91bdd1=resolve(_0x3ab195,NEW_CONFIG_NAME),_0x2bcc63=existsSync(_0x91bdd1);for(const _0x22189d of LEGACY_CONFIG_NAMES){const _0x4476e9=resolve(_0x3ab195,_0x22189d);if(existsSync(_0x4476e9)){const _0x3c696c=readConfigFile(_0x4476e9),_0x31cf04=Object[_0x26f449(0x20d)](_0x3c696c)['filter'](_0x2d7c90=>typeof _0x3c696c[_0x2d7c90]!==_0x26f449(0x1cb));_0x274fa1={'oldPath':_0x4476e9,'hasNewConfig':_0x2bcc63,'fields':_0x31cf04};break;}}const _0x48c173=[],_0x32d023=resolve(_0x3ab195,_0x26f449(0x200));if(existsSync(_0x32d023))_0x48c173[_0x26f449(0x1f2)](_0x32d023);const _0x2714fe=resolve(_0x3ab195,_0x26f449(0x1bc));if(existsSync(_0x2714fe))_0x48c173['push'](_0x2714fe);const _0x415487=resolve(_0x3ab195,_0x26f449(0x215));if(existsSync(_0x415487))_0x48c173[_0x26f449(0x1f2)](_0x415487);for(const _0x46ffad of collectIdeSkillFiles(_0x3ab195)){if(existsSync(_0x46ffad))_0x48c173['push'](_0x46ffad);}let _0x584780=null;const _0x325316=resolve(_0x3ab195,_0x26f449(0x1f9));if(existsSync(_0x325316))try{const _0xdaeb76=JSON[_0x26f449(0x1fd)](readFileSync(_0x325316,'utf8'));if(_0xdaeb76?.[_0x26f449(0x203)]&&typeof _0xdaeb76[_0x26f449(0x203)]===_0x26f449(0x228)){const _0x780cda=[];for(const [_0x1d5989,_0x21884c]of Object[_0x26f449(0x1b0)](_0xdaeb76[_0x26f449(0x203)])){const _0x4b19b1=_0x21884c;_0x4b19b1?.['args']&&Array['isArray'](_0x4b19b1[_0x26f449(0x21a)])&&_0x4b19b1[_0x26f449(0x21a)]['some'](_0x5a817a=>typeof _0x5a817a===_0x26f449(0x1d3)&&_0x5a817a[_0x26f449(0x1e8)](_0x26f449(0x221)))&&_0x780cda[_0x26f449(0x1f2)](_0x1d5989);}_0x780cda[_0x26f449(0x1bf)]>0x0&&(_0x584780={'path':_0x325316,'keys':_0x780cda});}}catch{}const _0x4f53bc=_0x48c173[_0x26f449(0x1bf)]>0x0||_0x274fa1!==null;let _0x3ef77e=null;const _0x2e2712=resolve(_0x3ab195,_0x26f449(0x22b));if(existsSync(_0x2e2712))try{const _0x8e5865=JSON[_0x26f449(0x1fd)](readFileSync(_0x2e2712,_0x26f449(0x1de)));for(const _0x2c3bfb of[_0x26f449(0x219),_0x26f449(0x21c)]){const _0x3b1d26=_0x8e5865?.[_0x2c3bfb]?.[_0x26f449(0x1d4)];if(typeof _0x3b1d26===_0x26f449(0x1d3)){_0x3b1d26!==_0x26f449(0x1b9)&&(_0x3ef77e={'pkgPath':_0x2e2712,'currentVersion':_0x3b1d26,'field':_0x2c3bfb});break;}}}catch{}return{'configMigration':_0x274fa1,'oldArtifacts':_0x48c173,'oldMcpConfig':_0x584780,'needsSkillSwap':_0x4f53bc,'sdkUpgrade':_0x3ef77e};}function printReport(_0x3bbca8){const _0xf01661=a116_0x4b40f6,{configMigration:_0x5bb3c6,oldArtifacts:_0x546514,oldMcpConfig:_0x4f964c,needsSkillSwap:_0x38dc97}=_0x3bbca8;console[_0xf01661(0x1ca)](''),console['log'](a116_0x49b081[_0xf01661(0x1b3)]('===\x20Upgrade\x20Analysis\x20===')),console[_0xf01661(0x1ca)]('');_0x5bb3c6?(console[_0xf01661(0x1ca)](a116_0x49b081[_0xf01661(0x1e9)](_0xf01661(0x216))+('\x20\x20'+a116_0x49b081[_0xf01661(0x1c3)](_0x5bb3c6[_0xf01661(0x1b4)]))),console['log']('\x20\x20New\x20config\x20(.rabetbase.json):\x20'+(_0x5bb3c6[_0xf01661(0x1c1)]?a116_0x49b081['green'](_0xf01661(0x210)):a116_0x49b081[_0xf01661(0x1d5)]('not\x20found\x20(will\x20create)'))),console[_0xf01661(0x1ca)]('\x20\x20Fields\x20to\x20migrate:\x20'+_0x5bb3c6[_0xf01661(0x1c6)][_0xf01661(0x1f4)](',\x20')),console['log'](_0xf01661(0x1e0))):console[_0xf01661(0x1ca)](a116_0x49b081['cyan'](_0xf01661(0x216))+'\x20\x20'+a116_0x49b081[_0xf01661(0x1d5)](_0xf01661(0x1b2)));console['log']('');if(_0x546514[_0xf01661(0x1bf)]>0x0){console['log'](a116_0x49b081['cyan']('Legacy\x20artifacts:'));for(const _0x12ba2e of _0x546514){console[_0xf01661(0x1ca)]('\x20\x20'+a116_0x49b081[_0xf01661(0x227)](_0xf01661(0x211))+'\x20\x20'+_0x12ba2e);}console['log'](_0xf01661(0x20c));}else console[_0xf01661(0x1ca)](a116_0x49b081[_0xf01661(0x1e9)]('Legacy\x20artifacts:')+'\x20\x20'+a116_0x49b081['gray'](_0xf01661(0x1f5)));console[_0xf01661(0x1ca)]('');_0x4f964c?(console[_0xf01661(0x1ca)](a116_0x49b081[_0xf01661(0x1e9)](_0xf01661(0x225))+('\x20\x20'+a116_0x49b081[_0xf01661(0x1c3)](_0x4f964c['path'])+'\x20→\x20keys:\x20'+_0x4f964c[_0xf01661(0x20d)][_0xf01661(0x1f4)](',\x20'))),console[_0xf01661(0x1ca)](_0xf01661(0x1d9))):console[_0xf01661(0x1ca)](a116_0x49b081[_0xf01661(0x1e9)](_0xf01661(0x225))+'\x20\x20'+a116_0x49b081[_0xf01661(0x1d5)](_0xf01661(0x1d8)));console[_0xf01661(0x1ca)](''),console[_0xf01661(0x1ca)](a116_0x49b081['cyan'](_0xf01661(0x1c2))+('\x20\x20'+(_0x38dc97?a116_0x49b081[_0xf01661(0x1c3)](_0xf01661(0x1ae)):a116_0x49b081[_0xf01661(0x226)]('not\x20needed'))));_0x38dc97&&console[_0xf01661(0x1ca)]('\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`'+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console['log']('');if(_0x3bbca8[_0xf01661(0x1f7)]){const {currentVersion:_0x5c81e2,field:_0x3bc700,pkgPath:_0x362042}=_0x3bbca8[_0xf01661(0x1f7)];console[_0xf01661(0x1ca)](a116_0x49b081['cyan']('@lovrabet/sdk:')+('\x20\x20'+a116_0x49b081[_0xf01661(0x1c3)](_0x362042))),console[_0xf01661(0x1ca)]('\x20\x20Current\x20version\x20in\x20'+_0x3bc700+':\x20'+a116_0x49b081[_0xf01661(0x1c3)](_0x5c81e2)+_0xf01661(0x1ad)+a116_0x49b081[_0xf01661(0x226)](_0xf01661(0x1b9))),console['log'](_0xf01661(0x1cf));}else console[_0xf01661(0x1ca)](a116_0x49b081[_0xf01661(0x1e9)](_0xf01661(0x1f0))+'\x20\x20'+a116_0x49b081[_0xf01661(0x1d5)](_0xf01661(0x223)));console[_0xf01661(0x1ca)]('');}function execConfigMigration(_0x1a1e97,_0x553dbf){const _0x30a7d8=a116_0x4b40f6,{configMigration:_0x507dbc}=_0x1a1e97;if(!_0x507dbc?.['oldPath'])return{'step':0x1,'label':_0x30a7d8(0x20b),'ok':!![],'detail':_0x30a7d8(0x222)};const _0x475ae1=readConfigFile(_0x507dbc[_0x30a7d8(0x1b4)]),_0x44a3d2=resolve(_0x553dbf,NEW_CONFIG_NAME),_0x3cd07b=_0x507dbc[_0x30a7d8(0x1c1)]?readConfigFile(_0x44a3d2):{};for(const [_0x5a924b,_0x2c90c2]of Object['entries'](_0x475ae1)){!(_0x5a924b in _0x3cd07b)&&(_0x3cd07b[_0x5a924b]=_0x2c90c2);}writeConfigFile(_0x44a3d2,_0x3cd07b);const _0x15f805=_0x507dbc[_0x30a7d8(0x1b4)]+_0x30a7d8(0x1d2);return renameSync(_0x507dbc[_0x30a7d8(0x1b4)],_0x15f805),{'step':0x1,'label':_0x30a7d8(0x20b),'ok':!![],'detail':_0x507dbc[_0x30a7d8(0x1b4)]+_0x30a7d8(0x1ad)+_0x44a3d2+_0x30a7d8(0x21f)+_0x15f805+')'};}function a116_0x4799(_0x2e05f9,_0x5241d7){_0x2e05f9=_0x2e05f9-0x1ad;const _0x244d13=a116_0x244d();let _0x4799fb=_0x244d13[_0x2e05f9];return _0x4799fb;}function execRemoveOldArtifacts(_0x211db6){const _0x53fc8c=a116_0x4b40f6,_0x2de9b8=[];for(const _0x46400d of _0x211db6){try{if(!existsSync(_0x46400d))continue;const _0x591362=tryStat(_0x46400d);_0x591362?.['isDirectory']()?rmSync(_0x46400d,{'recursive':!![],'force':!![]}):unlinkSync(_0x46400d);}catch(_0x2df995){_0x2de9b8[_0x53fc8c(0x1f2)](_0x46400d+':\x20'+_0x2df995['message']);}}return{'step':0x3,'label':'Remove\x20legacy\x20artifacts','ok':_0x2de9b8[_0x53fc8c(0x1bf)]===0x0,'detail':_0x2de9b8['length']>0x0?_0x211db6[_0x53fc8c(0x1bf)]-_0x2de9b8['length']+'/'+_0x211db6['length']+'\x20removed\x20('+_0x2de9b8[_0x53fc8c(0x1f4)](';\x20')+')':_0x211db6[_0x53fc8c(0x1bf)]+_0x53fc8c(0x1d1)};}function execCleanMcp(_0x5fbf51){const _0xc99bc5=a116_0x4b40f6;if(!_0x5fbf51[_0xc99bc5(0x229)])return{'step':0x4,'label':_0xc99bc5(0x1f3),'ok':!![],'detail':_0xc99bc5(0x1d6)};try{const _0x102933=readFileSync(_0x5fbf51[_0xc99bc5(0x229)][_0xc99bc5(0x1f8)],_0xc99bc5(0x1de)),_0x522f6b=JSON[_0xc99bc5(0x1fd)](_0x102933);if(_0x522f6b?.['mcpServers']&&typeof _0x522f6b[_0xc99bc5(0x203)]===_0xc99bc5(0x228)){const _0x3676de=[];for(const [_0x392487,_0x8839c7]of Object[_0xc99bc5(0x1b0)](_0x522f6b[_0xc99bc5(0x203)])){_0x8839c7?.[_0xc99bc5(0x21a)]&&Array['isArray'](_0x8839c7['args'])&&_0x8839c7[_0xc99bc5(0x21a)][_0xc99bc5(0x202)](_0xb6d8c0=>typeof _0xb6d8c0==='string'&&_0xb6d8c0['includes']('@lovrabet/dataset-mcp-server'))&&_0x3676de[_0xc99bc5(0x1f2)](_0x392487);}for(const _0x612dc7 of _0x3676de){delete _0x522f6b[_0xc99bc5(0x203)][_0x612dc7];}return _0x3676de['length']>0x0&&writeFileSync(_0x5fbf51[_0xc99bc5(0x229)][_0xc99bc5(0x1f8)],JSON[_0xc99bc5(0x1b6)](_0x522f6b,null,0x2)+'\x0a',_0xc99bc5(0x1de)),{'step':0x4,'label':_0xc99bc5(0x1f3),'ok':!![],'detail':'removed\x20'+_0x3676de[_0xc99bc5(0x1f4)](',\x20')+_0xc99bc5(0x1fa)+_0x5fbf51[_0xc99bc5(0x229)]['path']};}return{'step':0x4,'label':_0xc99bc5(0x1f3),'ok':!![],'detail':_0xc99bc5(0x207)};}catch(_0x3fd399){return{'step':0x4,'label':_0xc99bc5(0x1f3),'ok':![],'detail':_0x3fd399[_0xc99bc5(0x1b7)]};}}function execSkillsRemove(_0x4a99cd,_0x5f0cc8){const _0x4d3221=a116_0x4b40f6,_0x4c7d79=runNpxSkillsRemove(_0x4a99cd,{'stdio':'inherit','yes':_0x5f0cc8});return{'step':0x5,'label':_0x4d3221(0x1e1),'ok':_0x4c7d79['ok'],'detail':_0x4c7d79['ok']?_0x4d3221(0x218):_0x4c7d79[_0x4d3221(0x1e7)]??'exit\x20'+_0x4c7d79[_0x4d3221(0x21b)]};}function execSkillsAdd(_0x2e64ff,_0x5144b1){const _0xd1b6b4=a116_0x4b40f6,_0x59c0de=runNpxSkillsAddGlobal(_0x2e64ff,_0xd1b6b4(0x214),{'stdio':_0xd1b6b4(0x208),'yes':_0x5144b1});return{'step':0x6,'label':_0xd1b6b4(0x1bd),'ok':_0x59c0de['ok'],'detail':_0x59c0de['ok']?_0xd1b6b4(0x20e):_0x59c0de[_0xd1b6b4(0x1e7)]??_0xd1b6b4(0x1fe)+_0x59c0de[_0xd1b6b4(0x21b)]};}function execUpgradeSdk(_0x7730c4){const _0xbce458=a116_0x4b40f6;if(!_0x7730c4[_0xbce458(0x1f7)])return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':'skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)'};const {pkgPath:_0xd08cc8,currentVersion:_0x5070c8,field:_0x4775d6}=_0x7730c4['sdkUpgrade'];try{const _0x2c1066=readFileSync(_0xd08cc8,_0xbce458(0x1de)),_0x191595=JSON[_0xbce458(0x1fd)](_0x2c1066);return _0x191595[_0x4775d6][_0xbce458(0x1d4)]=_0xbce458(0x1b9),writeFileSync(_0xd08cc8,JSON['stringify'](_0x191595,null,0x2)+'\x0a',_0xbce458(0x1de)),{'step':0x7,'label':_0xbce458(0x201),'ok':!![],'detail':_0x4775d6+_0xbce458(0x1b8)+_0x5070c8+_0xbce458(0x1f1)};}catch(_0xb6a239){return{'step':0x7,'label':_0xbce458(0x201),'ok':![],'detail':_0xb6a239['message']};}}function tryStat(_0x532ed0){try{return statSync(_0x532ed0);}catch{return undefined;}}function printSummary(_0x3d6bb3){const _0x8eb76c=a116_0x4b40f6;console['log'](''),console['log'](a116_0x49b081[_0x8eb76c(0x1b3)]('===\x20Upgrade\x20Summary\x20===')),console[_0x8eb76c(0x1ca)]('');for(const _0x3c1b25 of _0x3d6bb3){const _0x5214cb=_0x3c1b25['ok']?a116_0x49b081[_0x8eb76c(0x226)]('OK'):a116_0x49b081[_0x8eb76c(0x227)](_0x8eb76c(0x1f6));console['log']('\x20\x20'+_0x5214cb+_0x8eb76c(0x1e4)+_0x3c1b25[_0x8eb76c(0x1ff)]+':\x20'+_0x3c1b25[_0x8eb76c(0x1eb)]);if(_0x3c1b25[_0x8eb76c(0x1fc)])console[_0x8eb76c(0x1ca)](_0x8eb76c(0x1c0)+a116_0x49b081['gray'](_0x3c1b25[_0x8eb76c(0x1fc)]));}console[_0x8eb76c(0x1ca)]('');}export async function upgradeApp(_0x1a388d,_0x3e3412){const _0x26ab7e=a116_0x4b40f6,_0x15d2b2=process['cwd'](),_0x2bf743=analyse(_0x15d2b2),_0x4a7d3f=!_0x2bf743[_0x26ab7e(0x1c5)]&&_0x2bf743[_0x26ab7e(0x1ba)]['length']===0x0&&!_0x2bf743['oldMcpConfig']&&!_0x2bf743['needsSkillSwap']&&!_0x2bf743[_0x26ab7e(0x1f7)];if(_0x4a7d3f){console[_0x26ab7e(0x1ca)](a116_0x49b081[_0x26ab7e(0x226)](_0x26ab7e(0x206)));return;}printReport(_0x2bf743);const _0x2aeae8=!!(_0x3e3412[_0x26ab7e(0x1ce)]||_0x3e3412['Y']||_0x1a388d);if(!_0x2aeae8)try{const _0x351c01=await askConfirm('Proceed\x20with\x20upgrade?');if(!_0x351c01){console['log'](a116_0x49b081[_0x26ab7e(0x1d5)](_0x26ab7e(0x220)));return;}}catch(_0x4e17e2){if(_0x4e17e2?.[_0x26ab7e(0x1b7)]===_0x26ab7e(0x1d7)){console['log'](a116_0x49b081[_0x26ab7e(0x1d5)](_0x26ab7e(0x220)));return;}throw _0x4e17e2;}const _0x3a61e1=[],_0x422c7c=a116_0x529828({'text':_0x26ab7e(0x1cc),'color':_0x26ab7e(0x1e9)})['start'](),_0x3b1be9=execConfigMigration(_0x2bf743,_0x15d2b2);_0x3a61e1[_0x26ab7e(0x1f2)](_0x3b1be9),_0x422c7c[_0x3b1be9['ok']?_0x26ab7e(0x212):_0x26ab7e(0x1ee)]('Step\x201/7:\x20Config\x20migration\x20—\x20'+(_0x3b1be9[_0x26ab7e(0x1fc)]??(_0x3b1be9['ok']?'done':_0x26ab7e(0x204))));const _0x5abf78=resolve(_0x15d2b2,_0x26ab7e(0x200)),_0x3598ef=a116_0x529828({'text':_0x26ab7e(0x1ea),'color':_0x26ab7e(0x1e9)})[_0x26ab7e(0x205)]();if(existsSync(_0x5abf78))try{rmSync(_0x5abf78,{'recursive':!![],'force':!![]}),_0x3598ef[_0x26ab7e(0x212)](_0x26ab7e(0x1e6)),_0x3a61e1[_0x26ab7e(0x1f2)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0xcb455c){_0x3598ef[_0x26ab7e(0x1ee)](_0x26ab7e(0x1c7)+_0xcb455c['message']),_0x3a61e1[_0x26ab7e(0x1f2)]({'step':0x2,'label':_0x26ab7e(0x1fb),'ok':![],'detail':_0xcb455c[_0x26ab7e(0x1b7)]});}else _0x3598ef[_0x26ab7e(0x21d)](_0x26ab7e(0x1c9)),_0x3a61e1['push']({'step':0x2,'label':_0x26ab7e(0x1fb),'ok':!![],'detail':'skipped'});const _0x5d4dfe=a116_0x529828({'text':_0x26ab7e(0x1e2),'color':_0x26ab7e(0x1e9)})[_0x26ab7e(0x205)](),_0x2659d9=execRemoveOldArtifacts(_0x2bf743[_0x26ab7e(0x1ba)]);_0x3a61e1[_0x26ab7e(0x1f2)](_0x2659d9),_0x5d4dfe[_0x2659d9['ok']?_0x26ab7e(0x212):_0x26ab7e(0x1ee)](_0x26ab7e(0x1dd)+(_0x2659d9[_0x26ab7e(0x1fc)]??(_0x2659d9['ok']?_0x26ab7e(0x1be):_0x26ab7e(0x204))));const _0x16c3f6=a116_0x529828({'text':_0x26ab7e(0x1ef),'color':_0x26ab7e(0x1e9)})[_0x26ab7e(0x205)](),_0x15ed1e=execCleanMcp(_0x2bf743);_0x3a61e1[_0x26ab7e(0x1f2)](_0x15ed1e),_0x16c3f6[_0x15ed1e['ok']?_0x26ab7e(0x212):_0x26ab7e(0x1ee)](_0x26ab7e(0x20a)+(_0x15ed1e[_0x26ab7e(0x1fc)]??(_0x15ed1e['ok']?_0x26ab7e(0x1be):_0x26ab7e(0x204))));const _0xcfb1c=a116_0x529828({'text':'Step\x205/7:\x20Removing\x20old\x20skill...','color':_0x26ab7e(0x1e9)})[_0x26ab7e(0x205)](),_0x4c72b5=execSkillsRemove(_0x15d2b2,_0x2aeae8);_0x3a61e1[_0x26ab7e(0x1f2)](_0x4c72b5),_0xcfb1c[_0x4c72b5['ok']?'succeed':_0x26ab7e(0x1ee)](_0x26ab7e(0x1d0)+(_0x4c72b5[_0x26ab7e(0x1fc)]??(_0x4c72b5['ok']?_0x26ab7e(0x1be):_0x26ab7e(0x204))));const _0x374d9b=a116_0x529828({'text':_0x26ab7e(0x1df),'color':_0x26ab7e(0x1e9)})[_0x26ab7e(0x205)](),_0x52f02d=execSkillsAdd(_0x15d2b2,_0x2aeae8);_0x3a61e1['push'](_0x52f02d),_0x374d9b[_0x52f02d['ok']?_0x26ab7e(0x212):_0x26ab7e(0x1ee)](_0x26ab7e(0x1ed)+(_0x52f02d[_0x26ab7e(0x1fc)]??(_0x52f02d['ok']?_0x26ab7e(0x1be):_0x26ab7e(0x204))));const _0x549061=a116_0x529828({'text':_0x26ab7e(0x217),'color':'cyan'})[_0x26ab7e(0x205)](),_0x2a5dbf=execUpgradeSdk(_0x2bf743);_0x3a61e1[_0x26ab7e(0x1f2)](_0x2a5dbf),_0x549061[_0x2a5dbf['ok']?_0x26ab7e(0x212):_0x26ab7e(0x1ee)](_0x26ab7e(0x1da)+(_0x2a5dbf[_0x26ab7e(0x1fc)]??(_0x2a5dbf['ok']?_0x26ab7e(0x1be):_0x26ab7e(0x204)))),printSummary(_0x3a61e1);const _0x17cb5c=_0x3a61e1[_0x26ab7e(0x202)](_0x1a45a7=>!_0x1a45a7['ok']);_0x17cb5c?console['log'](a116_0x49b081['yellow'](_0x26ab7e(0x1ec))):console[_0x26ab7e(0x1ca)](a116_0x49b081[_0x26ab7e(0x226)](_0x26ab7e(0x1dc))),_0x2a5dbf['ok']&&_0x2bf743['sdkUpgrade']&&(console[_0x26ab7e(0x1ca)](''),console[_0x26ab7e(0x1ca)](a116_0x49b081[_0x26ab7e(0x1b3)]['cyan']('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console[_0x26ab7e(0x1ca)](a116_0x49b081[_0x26ab7e(0x1e9)](_0x26ab7e(0x1e5))),console[_0x26ab7e(0x1ca)](''),console[_0x26ab7e(0x1ca)](a116_0x49b081[_0x26ab7e(0x1cd)](_0x26ab7e(0x20f))),console[_0x26ab7e(0x1ca)](a116_0x49b081[_0x26ab7e(0x1cd)](_0x26ab7e(0x1e3))),console['log'](a116_0x49b081[_0x26ab7e(0x1cd)]('\x20\x20bun\x20install')),console['log'](''));}
1
+ const a116_0xbae920=a116_0x419c;(function(_0x5a4125,_0x3beb9e){const _0x3b5628=a116_0x419c,_0x57f1ac=_0x5a4125();while(!![]){try{const _0x2d5209=-parseInt(_0x3b5628(0x174))/0x1+parseInt(_0x3b5628(0x1c2))/0x2*(-parseInt(_0x3b5628(0x1f6))/0x3)+-parseInt(_0x3b5628(0x1ba))/0x4*(-parseInt(_0x3b5628(0x1c9))/0x5)+parseInt(_0x3b5628(0x189))/0x6*(-parseInt(_0x3b5628(0x1c0))/0x7)+-parseInt(_0x3b5628(0x1cb))/0x8+-parseInt(_0x3b5628(0x19a))/0x9+parseInt(_0x3b5628(0x1e9))/0xa;if(_0x2d5209===_0x3beb9e)break;else _0x57f1ac['push'](_0x57f1ac['shift']());}catch(_0x124fac){_0x57f1ac['push'](_0x57f1ac['shift']());}}}(a116_0x3f4c,0x7696a));import a116_0x105924 from'chalk';import a116_0x4a8ca2 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a116_0xbae920(0x1cf)](_0x75e2=>_0x75e2!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x1df4b9){const _0x39691f=a116_0xbae920,_0x478ce9=[];for(const _0x48559e of Object[_0x39691f(0x1c7)](CORE_IDE_CONFIGS)){if(_0x48559e[_0x39691f(0x18b)])for(const _0x5db8c3 of _0x48559e[_0x39691f(0x18b)]){_0x478ce9['push'](resolve(_0x1df4b9,_0x5db8c3[_0x39691f(0x1b9)]));}}return _0x478ce9;}function analyse(_0x3d4421){const _0x16208a=a116_0xbae920;let _0x3988d7=null;const _0x3fe84b=resolve(_0x3d4421,NEW_CONFIG_NAME),_0x51e80b=existsSync(_0x3fe84b);for(const _0x38f75c of LEGACY_CONFIG_NAMES){const _0x525302=resolve(_0x3d4421,_0x38f75c);if(existsSync(_0x525302)){const _0x35a7a3=readConfigFile(_0x525302),_0x27c0d7=Object[_0x16208a(0x1ee)](_0x35a7a3)[_0x16208a(0x1cf)](_0x39c039=>typeof _0x35a7a3[_0x39c039]!==_0x16208a(0x1bf));_0x3988d7={'oldPath':_0x525302,'hasNewConfig':_0x51e80b,'fields':_0x27c0d7};break;}}const _0x4ecb29=[],_0xced91d=resolve(_0x3d4421,_0x16208a(0x1b2));if(existsSync(_0xced91d))_0x4ecb29[_0x16208a(0x17e)](_0xced91d);const _0x5a3a1c=resolve(_0x3d4421,_0x16208a(0x195));if(existsSync(_0x5a3a1c))_0x4ecb29[_0x16208a(0x17e)](_0x5a3a1c);const _0x149982=resolve(_0x3d4421,_0x16208a(0x187));if(existsSync(_0x149982))_0x4ecb29[_0x16208a(0x17e)](_0x149982);for(const _0x1e3823 of collectIdeSkillFiles(_0x3d4421)){if(existsSync(_0x1e3823))_0x4ecb29['push'](_0x1e3823);}let _0x46b71b=null;const _0x5e7ea8=resolve(_0x3d4421,'.cursor/mcp.json');if(existsSync(_0x5e7ea8))try{const _0x28c0ac=JSON['parse'](readFileSync(_0x5e7ea8,_0x16208a(0x1e0)));if(_0x28c0ac?.['mcpServers']&&typeof _0x28c0ac[_0x16208a(0x185)]===_0x16208a(0x1eb)){const _0xeb3137=[];for(const [_0x37ed2f,_0x24bc12]of Object[_0x16208a(0x1ea)](_0x28c0ac['mcpServers'])){const _0x46e221=_0x24bc12;_0x46e221?.[_0x16208a(0x1ab)]&&Array[_0x16208a(0x1ef)](_0x46e221['args'])&&_0x46e221[_0x16208a(0x1ab)][_0x16208a(0x188)](_0x403c5a=>typeof _0x403c5a===_0x16208a(0x1d9)&&_0x403c5a['includes'](_0x16208a(0x19d)))&&_0xeb3137[_0x16208a(0x17e)](_0x37ed2f);}_0xeb3137['length']>0x0&&(_0x46b71b={'path':_0x5e7ea8,'keys':_0xeb3137});}}catch{}const _0x1db4ee=_0x4ecb29[_0x16208a(0x1b5)]>0x0||_0x3988d7!==null;let _0x4fa3fe=null;const _0x486dde=resolve(_0x3d4421,_0x16208a(0x1d1));if(existsSync(_0x486dde))try{const _0x1ff7c8=JSON[_0x16208a(0x186)](readFileSync(_0x486dde,_0x16208a(0x1e0)));for(const _0x23a0a3 of[_0x16208a(0x1bb),'devDependencies']){const _0x549ea0=_0x1ff7c8?.[_0x23a0a3]?.[_0x16208a(0x1e7)];if(typeof _0x549ea0===_0x16208a(0x1d9)){_0x549ea0!==_0x16208a(0x190)&&(_0x4fa3fe={'pkgPath':_0x486dde,'currentVersion':_0x549ea0,'field':_0x23a0a3});break;}}}catch{}return{'configMigration':_0x3988d7,'oldArtifacts':_0x4ecb29,'oldMcpConfig':_0x46b71b,'needsSkillSwap':_0x1db4ee,'sdkUpgrade':_0x4fa3fe};}function printReport(_0x8d3276){const _0x4213e1=a116_0xbae920,{configMigration:_0x350eda,oldArtifacts:_0x5946b1,oldMcpConfig:_0x1928b1,needsSkillSwap:_0x40a9ca}=_0x8d3276;console['log'](''),console[_0x4213e1(0x179)](a116_0x105924[_0x4213e1(0x199)](_0x4213e1(0x1b6))),console[_0x4213e1(0x179)]('');_0x350eda?(console[_0x4213e1(0x179)](a116_0x105924[_0x4213e1(0x1a4)](_0x4213e1(0x18f))+('\x20\x20'+a116_0x105924[_0x4213e1(0x180)](_0x350eda['oldPath']))),console['log'](_0x4213e1(0x198)+(_0x350eda[_0x4213e1(0x1be)]?a116_0x105924[_0x4213e1(0x1d6)](_0x4213e1(0x1e2)):a116_0x105924[_0x4213e1(0x1f8)]('not\x20found\x20(will\x20create)'))),console[_0x4213e1(0x179)](_0x4213e1(0x1e3)+_0x350eda[_0x4213e1(0x1a3)]['join'](',\x20')),console[_0x4213e1(0x179)](_0x4213e1(0x1d0))):console[_0x4213e1(0x179)](a116_0x105924[_0x4213e1(0x1a4)](_0x4213e1(0x18f))+'\x20\x20'+a116_0x105924['gray'](_0x4213e1(0x184)));console[_0x4213e1(0x179)]('');if(_0x5946b1['length']>0x0){console[_0x4213e1(0x179)](a116_0x105924['cyan'](_0x4213e1(0x1a1)));for(const _0x16ee29 of _0x5946b1){console['log']('\x20\x20'+a116_0x105924[_0x4213e1(0x1f9)](_0x4213e1(0x1e5))+'\x20\x20'+_0x16ee29);}console['log']('\x20\x20Action:\x20delete');}else console[_0x4213e1(0x179)](a116_0x105924[_0x4213e1(0x1a4)]('Legacy\x20artifacts:')+'\x20\x20'+a116_0x105924[_0x4213e1(0x1f8)]('none\x20found'));console['log']('');_0x1928b1?(console[_0x4213e1(0x179)](a116_0x105924['cyan'](_0x4213e1(0x1a2))+('\x20\x20'+a116_0x105924['yellow'](_0x1928b1['path'])+_0x4213e1(0x1a0)+_0x1928b1[_0x4213e1(0x1ee)][_0x4213e1(0x192)](',\x20'))),console[_0x4213e1(0x179)]('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console[_0x4213e1(0x179)](a116_0x105924[_0x4213e1(0x1a4)](_0x4213e1(0x1a2))+'\x20\x20'+a116_0x105924[_0x4213e1(0x1f8)](_0x4213e1(0x196)));console[_0x4213e1(0x179)](''),console[_0x4213e1(0x179)](a116_0x105924[_0x4213e1(0x1a4)](_0x4213e1(0x1df))+('\x20\x20'+(_0x40a9ca?a116_0x105924['yellow'](_0x4213e1(0x1f2)):a116_0x105924['green'](_0x4213e1(0x1f4)))));_0x40a9ca&&console['log'](_0x4213e1(0x17d)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x4213e1(0x179)]('');if(_0x8d3276['sdkUpgrade']){const {currentVersion:_0x436b5a,field:_0x5d79e6,pkgPath:_0x546d0b}=_0x8d3276[_0x4213e1(0x1cd)];console[_0x4213e1(0x179)](a116_0x105924[_0x4213e1(0x1a4)](_0x4213e1(0x1b1))+('\x20\x20'+a116_0x105924[_0x4213e1(0x180)](_0x546d0b))),console[_0x4213e1(0x179)](_0x4213e1(0x17f)+_0x5d79e6+':\x20'+a116_0x105924[_0x4213e1(0x180)](_0x436b5a)+'\x20→\x20'+a116_0x105924['green'](_0x4213e1(0x190))),console[_0x4213e1(0x179)](_0x4213e1(0x17c));}else console[_0x4213e1(0x179)](a116_0x105924[_0x4213e1(0x1a4)](_0x4213e1(0x1b1))+'\x20\x20'+a116_0x105924[_0x4213e1(0x1f8)](_0x4213e1(0x1d5)));console[_0x4213e1(0x179)]('');}function execConfigMigration(_0x902f15,_0x1100ad){const _0x3cca5a=a116_0xbae920,{configMigration:_0x3015b2}=_0x902f15;if(!_0x3015b2?.[_0x3cca5a(0x1fa)])return{'step':0x1,'label':_0x3cca5a(0x194),'ok':!![],'detail':_0x3cca5a(0x1b3)};const _0x15af06=readConfigFile(_0x3015b2[_0x3cca5a(0x1fa)]),_0xde5481=resolve(_0x1100ad,NEW_CONFIG_NAME),_0x3f8afe=_0x3015b2[_0x3cca5a(0x1be)]?readConfigFile(_0xde5481):{};for(const [_0x5bffa3,_0xd9aea1]of Object[_0x3cca5a(0x1ea)](_0x15af06)){!(_0x5bffa3 in _0x3f8afe)&&(_0x3f8afe[_0x5bffa3]=_0xd9aea1);}writeConfigFile(_0xde5481,_0x3f8afe);const _0x5f1ea1=_0x3015b2[_0x3cca5a(0x1fa)]+_0x3cca5a(0x1a5);return renameSync(_0x3015b2[_0x3cca5a(0x1fa)],_0x5f1ea1),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x3015b2[_0x3cca5a(0x1fa)]+_0x3cca5a(0x19f)+_0xde5481+_0x3cca5a(0x1b8)+_0x5f1ea1+')'};}function execRemoveOldArtifacts(_0x2651a5){const _0x451318=a116_0xbae920,_0x2050f6=[];for(const _0x10b2b3 of _0x2651a5){try{if(!existsSync(_0x10b2b3))continue;const _0x5bb9c5=tryStat(_0x10b2b3);_0x5bb9c5?.[_0x451318(0x1f5)]()?rmSync(_0x10b2b3,{'recursive':!![],'force':!![]}):unlinkSync(_0x10b2b3);}catch(_0x2af0c8){_0x2050f6['push'](_0x10b2b3+':\x20'+_0x2af0c8['message']);}}return{'step':0x3,'label':_0x451318(0x1ae),'ok':_0x2050f6['length']===0x0,'detail':_0x2050f6[_0x451318(0x1b5)]>0x0?_0x2651a5[_0x451318(0x1b5)]-_0x2050f6['length']+'/'+_0x2651a5[_0x451318(0x1b5)]+_0x451318(0x19c)+_0x2050f6[_0x451318(0x192)](';\x20')+')':_0x2651a5[_0x451318(0x1b5)]+_0x451318(0x1dd)};}function a116_0x419c(_0x20e49b,_0x381fd){_0x20e49b=_0x20e49b-0x174;const _0x3f4c85=a116_0x3f4c();let _0x419c3c=_0x3f4c85[_0x20e49b];return _0x419c3c;}function execCleanMcp(_0x11003a){const _0x1bbe76=a116_0xbae920;if(!_0x11003a[_0x1bbe76(0x18c)])return{'step':0x4,'label':_0x1bbe76(0x19b),'ok':!![],'detail':_0x1bbe76(0x181)};try{const _0x52b449=readFileSync(_0x11003a[_0x1bbe76(0x18c)]['path'],_0x1bbe76(0x1e0)),_0x7abb91=JSON[_0x1bbe76(0x186)](_0x52b449);if(_0x7abb91?.[_0x1bbe76(0x185)]&&typeof _0x7abb91[_0x1bbe76(0x185)]===_0x1bbe76(0x1eb)){const _0x3aeee6=[];for(const [_0xf5cffe,_0x10df99]of Object[_0x1bbe76(0x1ea)](_0x7abb91[_0x1bbe76(0x185)])){_0x10df99?.[_0x1bbe76(0x1ab)]&&Array[_0x1bbe76(0x1ef)](_0x10df99['args'])&&_0x10df99[_0x1bbe76(0x1ab)]['some'](_0x50fde2=>typeof _0x50fde2==='string'&&_0x50fde2[_0x1bbe76(0x1c4)](_0x1bbe76(0x19d)))&&_0x3aeee6[_0x1bbe76(0x17e)](_0xf5cffe);}for(const _0x414ae1 of _0x3aeee6){delete _0x7abb91[_0x1bbe76(0x185)][_0x414ae1];}return _0x3aeee6['length']>0x0&&writeFileSync(_0x11003a['oldMcpConfig']['path'],JSON[_0x1bbe76(0x1ad)](_0x7abb91,null,0x2)+'\x0a',_0x1bbe76(0x1e0)),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x1bbe76(0x1dc)+_0x3aeee6['join'](',\x20')+_0x1bbe76(0x1ac)+_0x11003a['oldMcpConfig'][_0x1bbe76(0x1b9)]};}return{'step':0x4,'label':_0x1bbe76(0x19b),'ok':!![],'detail':_0x1bbe76(0x1d2)};}catch(_0x3b4700){return{'step':0x4,'label':_0x1bbe76(0x19b),'ok':![],'detail':_0x3b4700[_0x1bbe76(0x1ca)]};}}function execSkillsRemove(_0xd3a7ae,_0x3f688a){const _0x28adfc=a116_0xbae920,_0x136f57=runNpxSkillsRemove(_0xd3a7ae,{'stdio':'inherit','yes':_0x3f688a});return{'step':0x5,'label':'Remove\x20old\x20skill','ok':_0x136f57['ok'],'detail':_0x136f57['ok']?_0x28adfc(0x18a):_0x136f57[_0x28adfc(0x1d7)]??_0x28adfc(0x1db)+_0x136f57[_0x28adfc(0x1f0)]};}function execSkillsAdd(_0x15ba68,_0x5b30e5){const _0x1e5aa7=a116_0xbae920,_0x5a22ed=runNpxSkillsAddGlobal(_0x15ba68,'lovrabet/rabetbase',{'stdio':_0x1e5aa7(0x197),'yes':_0x5b30e5});return{'step':0x6,'label':_0x1e5aa7(0x1e6),'ok':_0x5a22ed['ok'],'detail':_0x5a22ed['ok']?_0x1e5aa7(0x1d3):_0x5a22ed[_0x1e5aa7(0x1d7)]??_0x1e5aa7(0x1db)+_0x5a22ed[_0x1e5aa7(0x1f0)]};}function execUpgradeSdk(_0x2959d1){const _0xd4fa98=a116_0xbae920;if(!_0x2959d1['sdkUpgrade'])return{'step':0x7,'label':_0xd4fa98(0x193),'ok':!![],'detail':_0xd4fa98(0x18d)};const {pkgPath:_0x19d31c,currentVersion:_0x119b84,field:_0x5906c4}=_0x2959d1['sdkUpgrade'];try{const _0x156e2a=readFileSync(_0x19d31c,_0xd4fa98(0x1e0)),_0x46df24=JSON[_0xd4fa98(0x186)](_0x156e2a);return _0x46df24[_0x5906c4]['@lovrabet/sdk']=_0xd4fa98(0x190),writeFileSync(_0x19d31c,JSON[_0xd4fa98(0x1ad)](_0x46df24,null,0x2)+'\x0a',_0xd4fa98(0x1e0)),{'step':0x7,'label':_0xd4fa98(0x193),'ok':!![],'detail':_0x5906c4+_0xd4fa98(0x191)+_0x119b84+_0xd4fa98(0x1e4)};}catch(_0x2cbf63){return{'step':0x7,'label':_0xd4fa98(0x193),'ok':![],'detail':_0x2cbf63[_0xd4fa98(0x1ca)]};}}function tryStat(_0x330d1d){try{return statSync(_0x330d1d);}catch{return undefined;}}function printSummary(_0x2a5e29){const _0x2ae3c1=a116_0xbae920;console[_0x2ae3c1(0x179)](''),console[_0x2ae3c1(0x179)](a116_0x105924[_0x2ae3c1(0x199)]('===\x20Upgrade\x20Summary\x20===')),console[_0x2ae3c1(0x179)]('');for(const _0x3dfe87 of _0x2a5e29){const _0xb74a31=_0x3dfe87['ok']?a116_0x105924[_0x2ae3c1(0x1d6)]('OK'):a116_0x105924[_0x2ae3c1(0x1f9)]('FAIL');console[_0x2ae3c1(0x179)]('\x20\x20'+_0xb74a31+_0x2ae3c1(0x1cc)+_0x3dfe87[_0x2ae3c1(0x1af)]+':\x20'+_0x3dfe87[_0x2ae3c1(0x1f7)]);if(_0x3dfe87[_0x2ae3c1(0x1a8)])console['log'](_0x2ae3c1(0x1e1)+a116_0x105924[_0x2ae3c1(0x1f8)](_0x3dfe87[_0x2ae3c1(0x1a8)]));}console['log']('');}function a116_0x3f4c(){const _0xf482fe=['exit\x20','removed\x20','\x20removed','Proceed\x20with\x20upgrade?','Skill\x20swap:','utf8','\x20\x20\x20\x20\x20\x20\x20','already\x20exists\x20(will\x20merge)','\x20\x20Fields\x20to\x20migrate:\x20','\x20→\x20latest','FOUND','Install\x20new\x20skill','@lovrabet/sdk','cwd','20026250CNXweK','entries','object','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','Step\x205/7:\x20Removing\x20old\x20skill...','keys','isArray','status','info','needed','Remove\x20.lovrabet/','not\x20needed','isDirectory','3891qYMwSE','label','gray','red','oldPath','287416tJrOUZ','done','Step\x201/7:\x20Migrating\x20config...','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','CANCEL','log','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','push','\x20\x20Current\x20version\x20in\x20','yellow','skipped','configMigration','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','no\x20legacy\x20config\x20found','mcpServers','parse','.claude/skills/lovrabet','some','18PHhTns','lovrabet/lovrabet-skill\x20removed','files','oldMcpConfig','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','start','Config\x20file:','latest','[\x22@lovrabet/sdk\x22]:\x20','join','Upgrade\x20@lovrabet/sdk','Config\x20migration','.cursor/rules/lovrabet_rules.mdc','no\x20legacy\x20entry','inherit','\x20\x20New\x20config\x20(.rabetbase.json):\x20','bold','2986704idTftY','Clean\x20MCP\x20config','\x20removed\x20(','@lovrabet/dataset-mcp-server','oldArtifacts','\x20→\x20','\x20→\x20keys:\x20','Legacy\x20artifacts:','MCP\x20config:','fields','cyan','.bak','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','detail','Step\x204/7:\x20MCP\x20config\x20—\x20','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','args','\x20from\x20','stringify','Remove\x20legacy\x20artifacts','step','fail','@lovrabet/sdk:','.lovrabet','skipped\x20(no\x20legacy\x20config)','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','length','===\x20Upgrade\x20Analysis\x20===','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','\x20(backup:\x20','path','3715784ooutDj','dependencies','Upgrade\x20completed\x20successfully!','succeed','hasNewConfig','undefined','1087401MkvOEq','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','1386PFhpxh','Upgrade\x20cancelled.','includes','needsSkillSwap','Step\x204/7:\x20Cleaning\x20MCP\x20config...','values','\x20\x20bun\x20install','5kpRpWQ','message','3693688kFdFIX','\x20\x20Step\x20','sdkUpgrade','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','filter','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','package.json','no\x20matching\x20entry\x20found','lovrabet/rabetbase\x20installed\x20globally','white','not\x20found\x20or\x20already\x20at\x20latest','green','error','failed','string','Step\x206/7:\x20Installing\x20new\x20skill...'];a116_0x3f4c=function(){return _0xf482fe;};return a116_0x3f4c();}export async function upgradeApp(_0x3dd3d3,_0x4c89ac){const _0x48e88f=a116_0xbae920,_0x519cc0=process[_0x48e88f(0x1e8)](),_0x56ba3c=analyse(_0x519cc0),_0x522ebd=!_0x56ba3c[_0x48e88f(0x182)]&&_0x56ba3c[_0x48e88f(0x19e)][_0x48e88f(0x1b5)]===0x0&&!_0x56ba3c[_0x48e88f(0x18c)]&&!_0x56ba3c[_0x48e88f(0x1c5)]&&!_0x56ba3c[_0x48e88f(0x1cd)];if(_0x522ebd){console[_0x48e88f(0x179)](a116_0x105924['green'](_0x48e88f(0x1ce)));return;}printReport(_0x56ba3c);const _0x29d5c6=!!(_0x4c89ac['yes']||_0x4c89ac['Y']||_0x3dd3d3);if(!_0x29d5c6)try{const _0x50e71e=await askConfirm(_0x48e88f(0x1de));if(!_0x50e71e){console[_0x48e88f(0x179)](a116_0x105924[_0x48e88f(0x1f8)](_0x48e88f(0x1c3)));return;}}catch(_0x5a0800){if(_0x5a0800?.[_0x48e88f(0x1ca)]===_0x48e88f(0x178)){console['log'](a116_0x105924[_0x48e88f(0x1f8)](_0x48e88f(0x1c3)));return;}throw _0x5a0800;}const _0x445a6e=[],_0x869890=a116_0x4a8ca2({'text':_0x48e88f(0x176),'color':_0x48e88f(0x1a4)})[_0x48e88f(0x18e)](),_0x16f829=execConfigMigration(_0x56ba3c,_0x519cc0);_0x445a6e[_0x48e88f(0x17e)](_0x16f829),_0x869890[_0x16f829['ok']?'succeed':'fail']('Step\x201/7:\x20Config\x20migration\x20—\x20'+(_0x16f829[_0x48e88f(0x1a8)]??(_0x16f829['ok']?'done':'failed')));const _0x305b61=resolve(_0x519cc0,'.lovrabet'),_0x2cbaae=a116_0x4a8ca2({'text':_0x48e88f(0x1aa),'color':_0x48e88f(0x1a4)})[_0x48e88f(0x18e)]();if(existsSync(_0x305b61))try{rmSync(_0x305b61,{'recursive':!![],'force':!![]}),_0x2cbaae[_0x48e88f(0x1bd)](_0x48e88f(0x17a)),_0x445a6e[_0x48e88f(0x17e)]({'step':0x2,'label':_0x48e88f(0x1f3),'ok':!![]});}catch(_0x5314dd){_0x2cbaae['fail'](_0x48e88f(0x183)+_0x5314dd[_0x48e88f(0x1ca)]),_0x445a6e[_0x48e88f(0x17e)]({'step':0x2,'label':_0x48e88f(0x1f3),'ok':![],'detail':_0x5314dd['message']});}else _0x2cbaae[_0x48e88f(0x1f1)](_0x48e88f(0x1b4)),_0x445a6e[_0x48e88f(0x17e)]({'step':0x2,'label':_0x48e88f(0x1f3),'ok':!![],'detail':'skipped'});const _0x247ae1=a116_0x4a8ca2({'text':_0x48e88f(0x1a7),'color':_0x48e88f(0x1a4)})[_0x48e88f(0x18e)](),_0x42a450=execRemoveOldArtifacts(_0x56ba3c['oldArtifacts']);_0x445a6e[_0x48e88f(0x17e)](_0x42a450),_0x247ae1[_0x42a450['ok']?_0x48e88f(0x1bd):_0x48e88f(0x1b0)](_0x48e88f(0x1b7)+(_0x42a450[_0x48e88f(0x1a8)]??(_0x42a450['ok']?_0x48e88f(0x175):_0x48e88f(0x1d8))));const _0x1e4cd6=a116_0x4a8ca2({'text':_0x48e88f(0x1c6),'color':'cyan'})[_0x48e88f(0x18e)](),_0x587acf=execCleanMcp(_0x56ba3c);_0x445a6e['push'](_0x587acf),_0x1e4cd6[_0x587acf['ok']?'succeed':_0x48e88f(0x1b0)](_0x48e88f(0x1a9)+(_0x587acf['detail']??(_0x587acf['ok']?_0x48e88f(0x175):_0x48e88f(0x1d8))));const _0x1a674e=a116_0x4a8ca2({'text':_0x48e88f(0x1ed),'color':'cyan'})[_0x48e88f(0x18e)](),_0x226e25=execSkillsRemove(_0x519cc0,_0x29d5c6);_0x445a6e['push'](_0x226e25),_0x1a674e[_0x226e25['ok']?_0x48e88f(0x1bd):_0x48e88f(0x1b0)](_0x48e88f(0x1c1)+(_0x226e25['detail']??(_0x226e25['ok']?_0x48e88f(0x175):_0x48e88f(0x1d8))));const _0x4bb237=a116_0x4a8ca2({'text':_0x48e88f(0x1da),'color':_0x48e88f(0x1a4)})[_0x48e88f(0x18e)](),_0x10fae1=execSkillsAdd(_0x519cc0,_0x29d5c6);_0x445a6e[_0x48e88f(0x17e)](_0x10fae1),_0x4bb237[_0x10fae1['ok']?_0x48e88f(0x1bd):_0x48e88f(0x1b0)](_0x48e88f(0x17b)+(_0x10fae1['detail']??(_0x10fae1['ok']?_0x48e88f(0x175):'failed')));const _0x5c382a=a116_0x4a8ca2({'text':'Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','color':_0x48e88f(0x1a4)})[_0x48e88f(0x18e)](),_0x128957=execUpgradeSdk(_0x56ba3c);_0x445a6e[_0x48e88f(0x17e)](_0x128957),_0x5c382a[_0x128957['ok']?_0x48e88f(0x1bd):_0x48e88f(0x1b0)](_0x48e88f(0x177)+(_0x128957[_0x48e88f(0x1a8)]??(_0x128957['ok']?_0x48e88f(0x175):_0x48e88f(0x1d8)))),printSummary(_0x445a6e);const _0x2d7e50=_0x445a6e[_0x48e88f(0x188)](_0x211c0b=>!_0x211c0b['ok']);_0x2d7e50?console[_0x48e88f(0x179)](a116_0x105924[_0x48e88f(0x180)]('Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.')):console[_0x48e88f(0x179)](a116_0x105924[_0x48e88f(0x1d6)](_0x48e88f(0x1bc))),_0x128957['ok']&&_0x56ba3c[_0x48e88f(0x1cd)]&&(console[_0x48e88f(0x179)](''),console[_0x48e88f(0x179)](a116_0x105924[_0x48e88f(0x199)][_0x48e88f(0x1a4)](_0x48e88f(0x1ec))),console['log'](a116_0x105924[_0x48e88f(0x1a4)](_0x48e88f(0x1a6))),console[_0x48e88f(0x179)](''),console[_0x48e88f(0x179)](a116_0x105924['white']('\x20\x20npm\x20install')),console['log'](a116_0x105924['white']('\x20\x20#\x20or')),console[_0x48e88f(0x179)](a116_0x105924[_0x48e88f(0x1d4)](_0x48e88f(0x1c8))),console[_0x48e88f(0x179)](''));}
@@ -1 +1 @@
1
- const a117_0x303d17=a117_0x21c0;(function(_0x2d3fb4,_0x15510c){const _0x406d1f=a117_0x21c0,_0x194865=_0x2d3fb4();while(!![]){try{const _0x1994d6=parseInt(_0x406d1f(0xc7))/0x1*(-parseInt(_0x406d1f(0xd6))/0x2)+-parseInt(_0x406d1f(0xd2))/0x3*(parseInt(_0x406d1f(0xbd))/0x4)+parseInt(_0x406d1f(0xbf))/0x5+parseInt(_0x406d1f(0xb0))/0x6*(-parseInt(_0x406d1f(0xcc))/0x7)+-parseInt(_0x406d1f(0xa8))/0x8+parseInt(_0x406d1f(0xba))/0x9+-parseInt(_0x406d1f(0xaf))/0xa*(parseInt(_0x406d1f(0xb6))/0xb);if(_0x1994d6===_0x15510c)break;else _0x194865['push'](_0x194865['shift']());}catch(_0x42ba74){_0x194865['push'](_0x194865['shift']());}}}(a117_0x5699,0x73471));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{appDefinitions}from'../commands/app/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x12ffab){const _0x23eb28=a117_0x21c0;for(const _0x4b1669 of _0x12ffab){definitions[_0x23eb28(0xc1)](_0x4b1669[_0x23eb28(0xd7)]+':'+_0x4b1669[_0x23eb28(0xab)],_0x4b1669);let _0x1f2201=serviceGroups[_0x23eb28(0xd1)](_0x4b1669[_0x23eb28(0xd7)]);!_0x1f2201&&(_0x1f2201=[],serviceGroups[_0x23eb28(0xc1)](_0x4b1669[_0x23eb28(0xd7)],_0x1f2201)),_0x1f2201[_0x23eb28(0xbc)](_0x4b1669);}}function registerDeclarativeService(_0x2f9f74,_0x578bcf,_0x1800ca){const _0x5c2020=a117_0x21c0;registerDefinitions(_0x578bcf);_0x1800ca?.[_0x5c2020(0xcd)]&&registerDefinitions([_0x1800ca[_0x5c2020(0xcd)]]);const _0x5eff22=_0x4eb366=>_0x4eb366===_0x5c2020(0xaa)?'':_0x4eb366===_0x5c2020(0xc9)?_0x5c2020(0xb2):_0x5c2020(0xd0),_0x59ac3a={'service':_0x578bcf[0x0][_0x5c2020(0xd7)],'label':_0x2f9f74,'commands':_0x578bcf[_0x5c2020(0xb4)](_0x522bfd=>({'command':_0x522bfd[_0x5c2020(0xab)],'description':_0x522bfd[_0x5c2020(0xda)],'tag':_0x5eff22(_0x522bfd[_0x5c2020(0xd4)])})),'declarative':!![],'defaultCommand':_0x1800ca?.[_0x5c2020(0xb9)]??(_0x1800ca?.[_0x5c2020(0xd5)]?_0x578bcf[0x0][_0x5c2020(0xab)]:undefined),'wildcardDef':_0x1800ca?.['wildcardDef'],'isSingleCommand':_0x1800ca?.['isSingleCommand']};serviceRegistry[_0x5c2020(0xbc)](_0x59ac3a),serviceByName[_0x5c2020(0xc1)](_0x59ac3a[_0x5c2020(0xd7)],_0x59ac3a);}registerDeclarativeService('Quick\x20Start',initDefinitions,{'defaultCommand':a117_0x303d17(0xd3),'isSingleCommand':!![]}),registerDeclarativeService(a117_0x303d17(0xbe),projectDefinitions),registerDeclarativeService(a117_0x303d17(0xad),appDefinitions),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});function a117_0x5699(){const _0x9cf5e0=['255GjolqX','run','risk','isSingleCommand','2Kvtwkm','service','Authentication','<script>','description','2020368EeZePv','skill','read','command','Instant\x20API','App\x20Management','API','10YMdhOb','42VvzefG','login','\x20\x20[write]','Dataset\x20&\x20Operations','map','preview','2723732QtIXxF','length','Database\x20Connections','defaultCommand','7755120FoDnxY','Run\x20any\x20package.json\x20script','push','6788EvYltA','Project','4222040uUAQyl','has','set','commands','Logs','from','Schema','auth','8137aZsDgd','build','write','Diagnostics','Configuration','581371jJlmih','wildcardDef','Smart\x20List\x20Pages','Skills','\x20\x20[high-risk-write]','get'];a117_0x5699=function(){return _0x9cf5e0;};return a117_0x5699();}{const last=serviceRegistry[serviceRegistry[a117_0x303d17(0xb7)]-0x1];last[a117_0x303d17(0xc2)]=[{'command':a117_0x303d17(0xd9),'description':a117_0x303d17(0xbb),'tag':''}];}registerDeclarativeService(a117_0x303d17(0xd8),authDefinitions,{'defaultCommand':a117_0x303d17(0xb1)}),registerDeclarativeService('Self\x20Update',[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a117_0x303d17(0xca),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a117_0x303d17(0xc5),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a117_0x303d17(0xcb),configDefinitions),registerDeclarativeService('Platform\x20Issue',issueDefinitions),registerDeclarativeService(a117_0x303d17(0xae),apiDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService(a117_0x303d17(0xb8),dbDefinitions),registerDeclarativeService(a117_0x303d17(0xb3),datasetDefinitions),registerDeclarativeService(a117_0x303d17(0xce),pageDefinitions),registerDeclarativeService(a117_0x303d17(0xac),dataDefinitions),registerDeclarativeService('BFF\x20Scripts',bffDefinitions),registerDeclarativeService('SQL\x20Queries',sqlDefinitions),registerDeclarativeService('Code\x20Generation',codegenDefinitions),registerDeclarativeService(a117_0x303d17(0xcf),skillDefinitions),registerDeclarativeService(a117_0x303d17(0xc3),logsDefinitions,{'defaultCommand':'show'});export const deprecatedAliases={'create':{'service':'project','command':'create'},'start':{'service':a117_0x303d17(0xd3),'command':'start'},'build':{'service':a117_0x303d17(0xd3),'command':a117_0x303d17(0xc8)},'preview':{'service':'run','command':a117_0x303d17(0xb5)},'logout':{'service':a117_0x303d17(0xc6),'command':'logout'},'skills':{'service':a117_0x303d17(0xa9),'command':'install'}};export const deprecatedSubcommands={'bff':{'new':'create'},'sql':{'new':'create'}};export function resolveDeprecatedSubcommand(_0x5323b1,_0x3585f0){return deprecatedSubcommands[_0x5323b1]?.[_0x3585f0];}export function findDefinition(_0x9df39b,_0x2c2878){const _0x5ebcf1=a117_0x303d17;return definitions[_0x5ebcf1(0xd1)](_0x9df39b+':'+_0x2c2878);}export function isKnownService(_0x597562){const _0x1b1000=a117_0x303d17;return serviceByName[_0x1b1000(0xc0)](_0x597562);}export function isDeclarativeService(_0x3a6dee){const _0x4350ba=a117_0x303d17;return serviceGroups[_0x4350ba(0xc0)](_0x3a6dee)||serviceByName['get'](_0x3a6dee)?.[_0x4350ba(0xcd)]!==undefined;}function a117_0x21c0(_0xb4101f,_0x54b61a){_0xb4101f=_0xb4101f-0xa8;const _0x56997c=a117_0x5699();let _0x21c0b4=_0x56997c[_0xb4101f];return _0x21c0b4;}export function getServiceEntry(_0x37fd0f){const _0x2a0138=a117_0x303d17;return serviceByName[_0x2a0138(0xd1)](_0x37fd0f);}export function getLegacyHandler(_0x80a53,_0x393114){return undefined;}export function getAllDefinitions(){const _0x400d9d=a117_0x303d17;return Array[_0x400d9d(0xc4)](definitions['values']());}
1
+ const a117_0x325097=a117_0x4bc6;function a117_0x4bc6(_0x82df8c,_0x3f709d){_0x82df8c=_0x82df8c-0xa4;const _0x3af503=a117_0x3af5();let _0x4bc6b4=_0x3af503[_0x82df8c];return _0x4bc6b4;}(function(_0x17e0c8,_0x21aa51){const _0x254dcd=a117_0x4bc6,_0x28e5eb=_0x17e0c8();while(!![]){try{const _0x2337f1=-parseInt(_0x254dcd(0xd7))/0x1+-parseInt(_0x254dcd(0xc4))/0x2*(parseInt(_0x254dcd(0xd2))/0x3)+-parseInt(_0x254dcd(0xc9))/0x4+-parseInt(_0x254dcd(0xa9))/0x5*(-parseInt(_0x254dcd(0xcc))/0x6)+parseInt(_0x254dcd(0xd0))/0x7*(parseInt(_0x254dcd(0xd1))/0x8)+-parseInt(_0x254dcd(0xbb))/0x9+parseInt(_0x254dcd(0xad))/0xa;if(_0x2337f1===_0x21aa51)break;else _0x28e5eb['push'](_0x28e5eb['shift']());}catch(_0x3b4c8e){_0x28e5eb['push'](_0x28e5eb['shift']());}}}(a117_0x3af5,0x4488c));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{appDefinitions}from'../commands/app/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();function a117_0x3af5(){const _0x5cd262=['Database\x20Connections','Platform\x20Issue','3566241hyOfwX','commands','install','wildcardDef','command','Self\x20Update','service','map','push','5766jDcNRU','Skills','Quick\x20Start','Logs','read','921148lFgsdo','<script>','length','12MXhsvq','isSingleCommand','Run\x20Scripts','logout','77XXsMWV','216128lozbfs','477gOFvko','Instant\x20API','from','get','Authentication','536053iwrCxt','write','Smart\x20List\x20Pages','show','login','BFF\x20Scripts','set','Configuration','SQL\x20Queries','API','run','404805WtsJXn','\x20\x20[write]','description','skill','14426040etJZMy','has','Project','Code\x20Generation','project','build','\x20\x20[high-risk-write]','Schema','Dataset\x20&\x20Operations','create','start','risk'];a117_0x3af5=function(){return _0x5cd262;};return a117_0x3af5();}export const serviceGroups=new Map();function registerDefinitions(_0x5c2699){const _0x37ca70=a117_0x4bc6;for(const _0x1e2a21 of _0x5c2699){definitions['set'](_0x1e2a21['service']+':'+_0x1e2a21[_0x37ca70(0xbf)],_0x1e2a21);let _0x5fc5f=serviceGroups[_0x37ca70(0xd5)](_0x1e2a21[_0x37ca70(0xc1)]);!_0x5fc5f&&(_0x5fc5f=[],serviceGroups[_0x37ca70(0xa4)](_0x1e2a21['service'],_0x5fc5f)),_0x5fc5f[_0x37ca70(0xc3)](_0x1e2a21);}}function registerDeclarativeService(_0x246ab1,_0x4b7789,_0x77f274){const _0x2a3af8=a117_0x4bc6;registerDefinitions(_0x4b7789);_0x77f274?.['wildcardDef']&&registerDefinitions([_0x77f274[_0x2a3af8(0xbe)]]);const _0xf9c8a=_0xfa201=>_0xfa201===_0x2a3af8(0xc8)?'':_0xfa201===_0x2a3af8(0xd8)?_0x2a3af8(0xaa):_0x2a3af8(0xb3),_0x1d0b3e={'service':_0x4b7789[0x0][_0x2a3af8(0xc1)],'label':_0x246ab1,'commands':_0x4b7789[_0x2a3af8(0xc2)](_0x5d5a56=>({'command':_0x5d5a56[_0x2a3af8(0xbf)],'description':_0x5d5a56[_0x2a3af8(0xab)],'tag':_0xf9c8a(_0x5d5a56[_0x2a3af8(0xb8)])})),'declarative':!![],'defaultCommand':_0x77f274?.['defaultCommand']??(_0x77f274?.[_0x2a3af8(0xcd)]?_0x4b7789[0x0][_0x2a3af8(0xbf)]:undefined),'wildcardDef':_0x77f274?.[_0x2a3af8(0xbe)],'isSingleCommand':_0x77f274?.[_0x2a3af8(0xcd)]};serviceRegistry[_0x2a3af8(0xc3)](_0x1d0b3e),serviceByName[_0x2a3af8(0xa4)](_0x1d0b3e[_0x2a3af8(0xc1)],_0x1d0b3e);}registerDeclarativeService(a117_0x325097(0xc6),initDefinitions,{'defaultCommand':a117_0x325097(0xa8),'isSingleCommand':!![]}),registerDeclarativeService(a117_0x325097(0xaf),projectDefinitions),registerDeclarativeService('App\x20Management',appDefinitions),registerDeclarativeService(a117_0x325097(0xce),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a117_0x325097(0xcb)]-0x1];last[a117_0x325097(0xbc)]=[{'command':a117_0x325097(0xca),'description':'Run\x20any\x20package.json\x20script','tag':''}];}registerDeclarativeService(a117_0x325097(0xd6),authDefinitions,{'defaultCommand':a117_0x325097(0xdb)}),registerDeclarativeService(a117_0x325097(0xc0),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a117_0x325097(0xb4),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a117_0x325097(0xa5),configDefinitions),registerDeclarativeService(a117_0x325097(0xba),issueDefinitions),registerDeclarativeService(a117_0x325097(0xa7),apiDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService(a117_0x325097(0xb9),dbDefinitions),registerDeclarativeService(a117_0x325097(0xb5),datasetDefinitions),registerDeclarativeService(a117_0x325097(0xd9),pageDefinitions),registerDeclarativeService(a117_0x325097(0xd3),dataDefinitions),registerDeclarativeService(a117_0x325097(0xdc),bffDefinitions),registerDeclarativeService(a117_0x325097(0xa6),sqlDefinitions),registerDeclarativeService(a117_0x325097(0xb0),codegenDefinitions),registerDeclarativeService(a117_0x325097(0xc5),skillDefinitions),registerDeclarativeService(a117_0x325097(0xc7),logsDefinitions,{'defaultCommand':a117_0x325097(0xda)});export const deprecatedAliases={'create':{'service':a117_0x325097(0xb1),'command':a117_0x325097(0xb6)},'start':{'service':a117_0x325097(0xa8),'command':a117_0x325097(0xb7)},'build':{'service':'run','command':a117_0x325097(0xb2)},'preview':{'service':'run','command':'preview'},'logout':{'service':'auth','command':a117_0x325097(0xcf)},'skills':{'service':a117_0x325097(0xac),'command':a117_0x325097(0xbd)}};export const deprecatedSubcommands={'bff':{'new':a117_0x325097(0xb6)},'sql':{'new':a117_0x325097(0xb6)}};export function resolveDeprecatedSubcommand(_0x57ab83,_0x28089f){return deprecatedSubcommands[_0x57ab83]?.[_0x28089f];}export function findDefinition(_0x170008,_0xcc44f7){const _0x571e72=a117_0x325097;return definitions[_0x571e72(0xd5)](_0x170008+':'+_0xcc44f7);}export function isKnownService(_0x2d2d59){const _0x55e14f=a117_0x325097;return serviceByName[_0x55e14f(0xae)](_0x2d2d59);}export function isDeclarativeService(_0x157032){const _0x54ed5c=a117_0x325097;return serviceGroups[_0x54ed5c(0xae)](_0x157032)||serviceByName[_0x54ed5c(0xd5)](_0x157032)?.[_0x54ed5c(0xbe)]!==undefined;}export function getServiceEntry(_0x3a74b2){const _0x5a7f06=a117_0x325097;return serviceByName[_0x5a7f06(0xd5)](_0x3a74b2);}export function getLegacyHandler(_0x3bae33,_0x1506dd){return undefined;}export function getAllDefinitions(){const _0x23f654=a117_0x325097;return Array[_0x23f654(0xd4)](definitions['values']());}
@@ -1 +1 @@
1
- const a118_0x528673=a118_0x5e84;function a118_0x9c44(){const _0x3b69ad=['watch','bun','push','npm','Run\x20a\x20package.json\x20script','inherit','16OfIAly','entries','log','script','\x20run\x20start','bun.lock','\x22\x20not\x20found\x20in\x20package.json.','2662450XRXSrt','\x20run\x20preview','utf-8','boolean','\x20\x20EXAMPLES','Script\x20name\x20defined\x20in\x20package.json','validation','\x0a\x20\x20Available\x20scripts:\x0a','padEnd','node_modules','close','length','all','2PujoaS','slice','--watch','\x20\x20\x20\x20','5tGSbZw','659502uMQuIA','join','map','No\x20package.json\x20found\x20in\x20current\x20directory.','1054287DaPTXQ','start','\x20run\x20','(none)','vite\x20preview\x20exited\x20with\x20code\x20','\x20exited\x20with\x20code\x20','error','\x0a\x20\x20Usage:\x20','preview','.bin','872272lCwqMJ','Enable\x20watch\x20mode\x20for\x20preview','2996166napUTP','295074ynpXSg','read','build','needsUpgrade','yarn.lock','cwd','args','run','keys','has','Script\x20\x22','scripts','1800869Nsrjki','vite'];a118_0x9c44=function(){return _0x3b69ad;};return a118_0x9c44();}(function(_0x396f70,_0x5a3fb5){const _0x1fa9df=a118_0x5e84,_0x202812=_0x396f70();while(!![]){try{const _0x3c9779=-parseInt(_0x1fa9df(0xd4))/0x1+-parseInt(_0x1fa9df(0xbe))/0x2*(-parseInt(_0x1fa9df(0xc3))/0x3)+parseInt(_0x1fa9df(0xd1))/0x4+parseInt(_0x1fa9df(0xc2))/0x5*(parseInt(_0x1fa9df(0xd3))/0x6)+parseInt(_0x1fa9df(0xe0))/0x7*(-parseInt(_0x1fa9df(0xe8))/0x8)+parseInt(_0x1fa9df(0xc7))/0x9+parseInt(_0x1fa9df(0xef))/0xa;if(_0x3c9779===_0x5a3fb5)break;else _0x202812['push'](_0x202812['shift']());}catch(_0x37e65f){_0x202812['push'](_0x202812['shift']());}}}(a118_0x9c44,0x7cc43));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a118_0x528673(0xc8),'dev']);function a118_0x5e84(_0x447850,_0x5495c9){_0x447850=_0x447850-0xbd;const _0x9c44c5=a118_0x9c44();let _0x5e849d=_0x9c44c5[_0x447850];return _0x5e849d;}function readPackageScripts(_0x47213b){const _0x4eb7e1=a118_0x528673,_0x345817=resolve(_0x47213b,'package.json');if(!existsSync(_0x345817))return null;try{const _0x28dc4c=JSON['parse'](readFileSync(_0x345817,_0x4eb7e1(0xf1)));return _0x28dc4c[_0x4eb7e1(0xdf)]??{};}catch{return null;}}function detectPackageManager(_0x45ac58){const _0x2b3e44=a118_0x528673;if(existsSync(resolve(_0x45ac58,'bun.lockb'))||existsSync(resolve(_0x45ac58,_0x2b3e44(0xed))))return _0x2b3e44(0xe3);if(existsSync(resolve(_0x45ac58,'pnpm-lock.yaml')))return'pnpm';if(existsSync(resolve(_0x45ac58,_0x2b3e44(0xd8))))return'yarn';return _0x2b3e44(0xe5);}async function versionCheck(_0x265d0c){const _0x3728b1=a118_0x528673,_0x55aac5=await checkCliVersion();(_0x55aac5['needsUpgrade']||_0x55aac5['belowMinimum'])&&(printCliUpgradeWarning(_0x55aac5),assertCliVersionSupported(_0x55aac5));const _0x5cb601=await checkSdkVersion(_0x265d0c);if(_0x5cb601[_0x3728b1(0xd7)])printSdkUpgradeWarning(_0x5cb601);}function spawnScript(_0x1452da,_0x4afe32,_0x10e258,_0x1ff835){return new Promise((_0xc084fa,_0xe2028a)=>{const _0x457ada=a118_0x5e84,_0x5d06e0=[_0x457ada(0xdb),_0x4afe32,..._0x10e258],_0x1ba82b=spawn(_0x1452da,_0x5d06e0,{'cwd':_0x1ff835,'stdio':_0x457ada(0xe7),'shell':!![],'env':{...process.env,'PATH':''+join(_0x1ff835,_0x457ada(0xf8),'.bin')+delimiter+process.env.PATH}});_0x1ba82b['on'](_0x457ada(0xf9),_0x56695a=>{const _0x4b7765=_0x457ada;if(_0x56695a===0x0||_0x56695a===null)_0xc084fa();else _0xe2028a(new Error(_0x1452da+_0x4b7765(0xc9)+_0x4afe32+_0x4b7765(0xcc)+_0x56695a));}),_0x1ba82b['on'](_0x457ada(0xcd),_0xe2028a);});}function spawnViteBuildWatch(_0x5544ee){return new Promise((_0x588e14,_0x4bdc38)=>{const _0x33c63f=a118_0x5e84,_0x259af2=spawn(_0x33c63f(0xe1),[_0x33c63f(0xd6),_0x33c63f(0xc0)],{'cwd':_0x5544ee,'stdio':_0x33c63f(0xe7),'shell':!![],'env':{...process.env,'PATH':''+join(_0x5544ee,_0x33c63f(0xf8),_0x33c63f(0xd0))+delimiter+process.env.PATH}});_0x259af2['on'](_0x33c63f(0xf9),_0x97654e=>{if(_0x97654e===0x0||_0x97654e===null)_0x588e14();else _0x4bdc38(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x97654e));}),_0x259af2['on'](_0x33c63f(0xcd),_0x4bdc38);});}function spawnVitePreview(_0x31eb77){return new Promise((_0x26d1fe,_0x5b13ea)=>{const _0xc49e72=a118_0x5e84,_0x588e1d=spawn('vite',[_0xc49e72(0xcf)],{'cwd':_0x31eb77,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x31eb77,_0xc49e72(0xf8),_0xc49e72(0xd0))+delimiter+process.env.PATH}});_0x588e1d['on'](_0xc49e72(0xf9),_0x79043b=>{const _0x507f0d=_0xc49e72;if(_0x79043b===0x0||_0x79043b===null)_0x26d1fe();else _0x5b13ea(new Error(_0x507f0d(0xcb)+_0x79043b));}),_0x588e1d['on'](_0xc49e72(0xcd),_0x5b13ea);});}const runFlags=[{'name':a118_0x528673(0xe2),'type':a118_0x528673(0xf2),'description':a118_0x528673(0xd2),'default':![]}];export const runDefinition={'service':a118_0x528673(0xdb),'command':a118_0x528673(0xdb),'description':a118_0x528673(0xe6),'risk':a118_0x528673(0xd5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a118_0x528673(0xeb),'description':a118_0x528673(0xf4),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x4a7a83=a118_0x528673,_0x132aa2=readPackageScripts(process[_0x4a7a83(0xd9)]()),_0x2d8cca=[];if(_0x132aa2&&Object['keys'](_0x132aa2)[_0x4a7a83(0xfa)]>0x0){const _0x36d34a=Object[_0x4a7a83(0xdc)](_0x132aa2),_0x1d8a63=Math['max'](..._0x36d34a[_0x4a7a83(0xc5)](_0x4b70d1=>_0x4b70d1[_0x4a7a83(0xfa)]));_0x2d8cca['push']('\x20\x20AVAILABLE\x20SCRIPTS\x20\x20(current\x20project)');for(const [_0x5b2981,_0xa05ec7]of Object[_0x4a7a83(0xe9)](_0x132aa2)){_0x2d8cca[_0x4a7a83(0xe4)](_0x4a7a83(0xc1)+CLI_BIN_NAME+'\x20run\x20'+_0x5b2981[_0x4a7a83(0xf7)](_0x1d8a63+0x2)+'#\x20'+_0xa05ec7);}}else _0x2d8cca['push'](_0x4a7a83(0xf3)),_0x2d8cca['push'](_0x4a7a83(0xc1)+CLI_BIN_NAME+_0x4a7a83(0xec)),_0x2d8cca[_0x4a7a83(0xe4)](_0x4a7a83(0xc1)+CLI_BIN_NAME+'\x20run\x20build'),_0x2d8cca[_0x4a7a83(0xe4)](_0x4a7a83(0xc1)+CLI_BIN_NAME+_0x4a7a83(0xf0)),_0x2d8cca[_0x4a7a83(0xe4)](_0x4a7a83(0xc1)+CLI_BIN_NAME+'\x20run\x20preview\x20--watch\x20\x20\x20#\x20parallel\x20build\x20--watch\x20+\x20preview');return _0x2d8cca[_0x4a7a83(0xc4)]('\x0a');},async 'execute'(_0x2ee2cf){const _0x51a13b=a118_0x528673,_0x29e8cc=process[_0x51a13b(0xd9)](),_0x4a6f6d=_0x2ee2cf[_0x51a13b(0xda)][0x0],_0x7c5f1e=_0x2ee2cf[_0x51a13b(0xda)][_0x51a13b(0xbf)](0x1),_0x520985=readPackageScripts(_0x29e8cc);if(!_0x520985)throw CliErrors['validation'](_0x51a13b(0xc6));if(!_0x4a6f6d){const _0x3652ec=Object[_0x51a13b(0xdc)](_0x520985);if(_0x3652ec[_0x51a13b(0xfa)]===0x0)console['log']('No\x20scripts\x20defined\x20in\x20package.json.');else{console[_0x51a13b(0xea)](_0x51a13b(0xf6));const _0x274eda=Math['max'](..._0x3652ec['map'](_0x2aa6d6=>_0x2aa6d6[_0x51a13b(0xfa)]));for(const [_0x4a7d7b,_0x1b948a]of Object[_0x51a13b(0xe9)](_0x520985)){console[_0x51a13b(0xea)](_0x51a13b(0xc1)+_0x4a7d7b[_0x51a13b(0xf7)](_0x274eda+0x2)+_0x1b948a);}console['log'](_0x51a13b(0xce)+CLI_BIN_NAME+'\x20run\x20<script>\x0a');}return{'ok':!![]};}if(!_0x520985[_0x4a6f6d])throw CliErrors[_0x51a13b(0xf5)](_0x51a13b(0xde)+_0x4a6f6d+_0x51a13b(0xee),'Available:\x20'+(Object['keys'](_0x520985)[_0x51a13b(0xc4)](',\x20')||_0x51a13b(0xca)));const _0x156664=detectPackageManager(_0x29e8cc);VERSION_CHECK_SCRIPTS[_0x51a13b(0xdd)](_0x4a6f6d)&&await versionCheck(_0x29e8cc);if(_0x4a6f6d===_0x51a13b(0xcf)&&_0x2ee2cf['bool'](_0x51a13b(0xe2)))return await Promise[_0x51a13b(0xbd)]([spawnViteBuildWatch(_0x29e8cc),spawnVitePreview(_0x29e8cc)]),{'ok':!![]};return await spawnScript(_0x156664,_0x4a6f6d,_0x7c5f1e,_0x29e8cc),{'ok':!![]};}};
1
+ function a118_0x4d16(){const _0xf9e562=['\x0a\x20\x20Usage:\x20','pnpm','watch','\x20run\x20preview','bun','(none)','padEnd','\x20run\x20','pnpm-lock.yaml','npm','vite\x20preview\x20exited\x20with\x20code\x20','boolean','close','\x20\x20EXAMPLES','.bin','10457eWniQW','node_modules','preview','bun.lockb','validation','inherit','Available:\x20','Run\x20a\x20package.json\x20script','run','\x20\x20\x20\x20','No\x20package.json\x20found\x20in\x20current\x20directory.','\x20run\x20start','needsUpgrade','12824YpSuya','error','5604kpcnpz','\x22\x20not\x20found\x20in\x20package.json.','build','--watch','keys','Enable\x20watch\x20mode\x20for\x20preview','entries','bun.lock','script','\x20exited\x20with\x20code\x20','scripts','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','vite','\x20\x20AVAILABLE\x20SCRIPTS\x20\x20(current\x20project)','38uuxYob','length','cwd','2012364rVyVHO','parse','271833JGGTxE','read','map','log','start','push','\x0a\x20\x20Available\x20scripts:\x0a','2285334IMYxOy','\x20run\x20<script>\x0a','yarn.lock','join','\x20run\x20build','1030fvJMbo','Script\x20name\x20defined\x20in\x20package.json','No\x20scripts\x20defined\x20in\x20package.json.','1592HfpTRY','Script\x20\x22','package.json','max','1674480ePvZwp','yarn','args'];a118_0x4d16=function(){return _0xf9e562;};return a118_0x4d16();}const a118_0x219d50=a118_0x56a8;(function(_0x9a86cc,_0x1d8a5b){const _0x39f484=a118_0x56a8,_0x27ffed=_0x9a86cc();while(!![]){try{const _0x56bb96=parseInt(_0x39f484(0x175))/0x1*(parseInt(_0x39f484(0x14b))/0x2)+parseInt(_0x39f484(0x150))/0x3+-parseInt(_0x39f484(0x13d))/0x4*(-parseInt(_0x39f484(0x15c))/0x5)+-parseInt(_0x39f484(0x157))/0x6+parseInt(_0x39f484(0x13b))/0x7*(-parseInt(_0x39f484(0x15f))/0x8)+parseInt(_0x39f484(0x14e))/0x9+parseInt(_0x39f484(0x163))/0xa;if(_0x56bb96===_0x1d8a5b)break;else _0x27ffed['push'](_0x27ffed['shift']());}catch(_0x55ba3f){_0x27ffed['push'](_0x27ffed['shift']());}}}(a118_0x4d16,0x368ff));import{readFileSync,existsSync}from'node:fs';function a118_0x56a8(_0x478596,_0x3763d0){_0x478596=_0x478596-0x133;const _0x4d16a2=a118_0x4d16();let _0x56a8a3=_0x4d16a2[_0x478596];return _0x56a8a3;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a118_0x219d50(0x154),'dev']);function readPackageScripts(_0xee72c){const _0x4b7321=a118_0x219d50,_0x1908e8=resolve(_0xee72c,_0x4b7321(0x161));if(!existsSync(_0x1908e8))return null;try{const _0x5148c3=JSON[_0x4b7321(0x14f)](readFileSync(_0x1908e8,'utf-8'));return _0x5148c3[_0x4b7321(0x147)]??{};}catch{return null;}}function detectPackageManager(_0x4710e5){const _0x365844=a118_0x219d50;if(existsSync(resolve(_0x4710e5,_0x365844(0x178)))||existsSync(resolve(_0x4710e5,_0x365844(0x144))))return _0x365844(0x16a);if(existsSync(resolve(_0x4710e5,_0x365844(0x16e))))return _0x365844(0x167);if(existsSync(resolve(_0x4710e5,_0x365844(0x159))))return _0x365844(0x164);return _0x365844(0x16f);}async function versionCheck(_0x4cc1b5){const _0x40c11f=a118_0x219d50,_0x2883d3=await checkCliVersion();(_0x2883d3[_0x40c11f(0x13a)]||_0x2883d3['belowMinimum'])&&(printCliUpgradeWarning(_0x2883d3),assertCliVersionSupported(_0x2883d3));const _0x197923=await checkSdkVersion(_0x4cc1b5);if(_0x197923[_0x40c11f(0x13a)])printSdkUpgradeWarning(_0x197923);}function spawnScript(_0x2f3352,_0x286ae6,_0x901b66,_0x3f8dd6){return new Promise((_0x4ebd4f,_0x1151fc)=>{const _0x5ec9ec=a118_0x56a8,_0x2bb9bc=['run',_0x286ae6,..._0x901b66],_0x37fb26=spawn(_0x2f3352,_0x2bb9bc,{'cwd':_0x3f8dd6,'stdio':_0x5ec9ec(0x133),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3f8dd6,_0x5ec9ec(0x176),_0x5ec9ec(0x174))+delimiter+process.env.PATH}});_0x37fb26['on']('close',_0x590f4c=>{const _0x3986ec=_0x5ec9ec;if(_0x590f4c===0x0||_0x590f4c===null)_0x4ebd4f();else _0x1151fc(new Error(_0x2f3352+_0x3986ec(0x16d)+_0x286ae6+_0x3986ec(0x146)+_0x590f4c));}),_0x37fb26['on']('error',_0x1151fc);});}function spawnViteBuildWatch(_0x7e19fc){return new Promise((_0x2989db,_0xc9c81d)=>{const _0x1543db=a118_0x56a8,_0x33c2ef=spawn(_0x1543db(0x149),[_0x1543db(0x13f),_0x1543db(0x140)],{'cwd':_0x7e19fc,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x7e19fc,'node_modules','.bin')+delimiter+process.env.PATH}});_0x33c2ef['on'](_0x1543db(0x172),_0x58e5ad=>{const _0x286bae=_0x1543db;if(_0x58e5ad===0x0||_0x58e5ad===null)_0x2989db();else _0xc9c81d(new Error(_0x286bae(0x148)+_0x58e5ad));}),_0x33c2ef['on'](_0x1543db(0x13c),_0xc9c81d);});}function spawnVitePreview(_0x374723){return new Promise((_0x16a9a5,_0x5ec5e1)=>{const _0x2c78dc=a118_0x56a8,_0x5e288f=spawn(_0x2c78dc(0x149),[_0x2c78dc(0x177)],{'cwd':_0x374723,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x374723,_0x2c78dc(0x176),_0x2c78dc(0x174))+delimiter+process.env.PATH}});_0x5e288f['on']('close',_0x374103=>{const _0x5041d1=_0x2c78dc;if(_0x374103===0x0||_0x374103===null)_0x16a9a5();else _0x5ec5e1(new Error(_0x5041d1(0x170)+_0x374103));}),_0x5e288f['on'](_0x2c78dc(0x13c),_0x5ec5e1);});}const runFlags=[{'name':'watch','type':a118_0x219d50(0x171),'description':a118_0x219d50(0x142),'default':![]}];export const runDefinition={'service':a118_0x219d50(0x136),'command':'run','description':a118_0x219d50(0x135),'risk':a118_0x219d50(0x151),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a118_0x219d50(0x145),'description':a118_0x219d50(0x15d),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x233c68=a118_0x219d50,_0x313cf6=readPackageScripts(process[_0x233c68(0x14d)]()),_0x8dd185=[];if(_0x313cf6&&Object[_0x233c68(0x141)](_0x313cf6)[_0x233c68(0x14c)]>0x0){const _0x4a9710=Object[_0x233c68(0x141)](_0x313cf6),_0x2cb6b=Math[_0x233c68(0x162)](..._0x4a9710[_0x233c68(0x152)](_0x146b0a=>_0x146b0a[_0x233c68(0x14c)]));_0x8dd185[_0x233c68(0x155)](_0x233c68(0x14a));for(const [_0x309d12,_0x51f558]of Object[_0x233c68(0x143)](_0x313cf6)){_0x8dd185[_0x233c68(0x155)]('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20'+_0x309d12['padEnd'](_0x2cb6b+0x2)+'#\x20'+_0x51f558);}}else _0x8dd185[_0x233c68(0x155)](_0x233c68(0x173)),_0x8dd185['push'](_0x233c68(0x137)+CLI_BIN_NAME+_0x233c68(0x139)),_0x8dd185[_0x233c68(0x155)](_0x233c68(0x137)+CLI_BIN_NAME+_0x233c68(0x15b)),_0x8dd185[_0x233c68(0x155)](_0x233c68(0x137)+CLI_BIN_NAME+_0x233c68(0x169)),_0x8dd185[_0x233c68(0x155)]('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20preview\x20--watch\x20\x20\x20#\x20parallel\x20build\x20--watch\x20+\x20preview');return _0x8dd185[_0x233c68(0x15a)]('\x0a');},async 'execute'(_0x4bb5b9){const _0x54a38f=a118_0x219d50,_0x2f9afd=process[_0x54a38f(0x14d)](),_0x5789ff=_0x4bb5b9[_0x54a38f(0x165)][0x0],_0xebb32d=_0x4bb5b9['args']['slice'](0x1),_0x18eb6b=readPackageScripts(_0x2f9afd);if(!_0x18eb6b)throw CliErrors[_0x54a38f(0x179)](_0x54a38f(0x138));if(!_0x5789ff){const _0x1a6f18=Object[_0x54a38f(0x141)](_0x18eb6b);if(_0x1a6f18[_0x54a38f(0x14c)]===0x0)console[_0x54a38f(0x153)](_0x54a38f(0x15e));else{console[_0x54a38f(0x153)](_0x54a38f(0x156));const _0x273ead=Math['max'](..._0x1a6f18[_0x54a38f(0x152)](_0x292fe0=>_0x292fe0[_0x54a38f(0x14c)]));for(const [_0x3779b8,_0x5170c]of Object['entries'](_0x18eb6b)){console[_0x54a38f(0x153)](_0x54a38f(0x137)+_0x3779b8[_0x54a38f(0x16c)](_0x273ead+0x2)+_0x5170c);}console[_0x54a38f(0x153)](_0x54a38f(0x166)+CLI_BIN_NAME+_0x54a38f(0x158));}return{'ok':!![]};}if(!_0x18eb6b[_0x5789ff])throw CliErrors[_0x54a38f(0x179)](_0x54a38f(0x160)+_0x5789ff+_0x54a38f(0x13e),_0x54a38f(0x134)+(Object[_0x54a38f(0x141)](_0x18eb6b)[_0x54a38f(0x15a)](',\x20')||_0x54a38f(0x16b)));const _0x4145ec=detectPackageManager(_0x2f9afd);VERSION_CHECK_SCRIPTS['has'](_0x5789ff)&&await versionCheck(_0x2f9afd);if(_0x5789ff==='preview'&&_0x4bb5b9['bool'](_0x54a38f(0x168)))return await Promise['all']([spawnViteBuildWatch(_0x2f9afd),spawnVitePreview(_0x2f9afd)]),{'ok':!![]};return await spawnScript(_0x4145ec,_0x5789ff,_0xebb32d,_0x2f9afd),{'ok':!![]};}};
@@ -1 +1 @@
1
- function a119_0x5875(_0x109b75,_0x28b673){_0x109b75=_0x109b75-0x67;const _0x2069ae=a119_0x2069();let _0x5875ea=_0x2069ae[_0x109b75];return _0x5875ea;}const a119_0x38e417=a119_0x5875;(function(_0x3383ac,_0x4e562a){const _0x5f572d=a119_0x5875,_0x128922=_0x3383ac();while(!![]){try{const _0x3c8de5=parseInt(_0x5f572d(0x72))/0x1*(-parseInt(_0x5f572d(0x6d))/0x2)+parseInt(_0x5f572d(0x70))/0x3*(-parseInt(_0x5f572d(0x6f))/0x4)+-parseInt(_0x5f572d(0x6b))/0x5*(parseInt(_0x5f572d(0x69))/0x6)+parseInt(_0x5f572d(0x6c))/0x7+-parseInt(_0x5f572d(0x6a))/0x8+parseInt(_0x5f572d(0x75))/0x9*(parseInt(_0x5f572d(0x67))/0xa)+-parseInt(_0x5f572d(0x6e))/0xb*(-parseInt(_0x5f572d(0x76))/0xc);if(_0x3c8de5===_0x4e562a)break;else _0x128922['push'](_0x128922['shift']());}catch(_0x953ca1){_0x128922['push'](_0x128922['shift']());}}}(a119_0x2069,0xe29fb));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x13f3d9){const _0x1cfdfa=await buildSchemaPayload();return{'ok':!![],'data':_0x1cfdfa};}export const schemaDefinition={'service':a119_0x38e417(0x68),'command':a119_0x38e417(0x73),'description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':a119_0x38e417(0x71),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a119_0x38e417(0x74),'flags':[],'execute':execute};function a119_0x2069(){const _0x2f6a6c=['56661SEHNct','read','2956ROYHJv','export','json','27PRcmYc','178524cFUofU','794430TmGdrG','schema','246nCLFTe','9493016eMKOZt','3470JhowNt','8878394TgLcnT','296ICzPqx','2079ojJOPL','368zxpBHN'];a119_0x2069=function(){return _0x2f6a6c;};return a119_0x2069();}
1
+ function a119_0x373a(_0x5f1eb9,_0x516b0e){_0x5f1eb9=_0x5f1eb9-0x9e;const _0x1d3ea9=a119_0x1d3e();let _0x373a34=_0x1d3ea9[_0x5f1eb9];return _0x373a34;}const a119_0x22422c=a119_0x373a;(function(_0x5f1bad,_0x5b6857){const _0x141594=a119_0x373a,_0x3a6ef8=_0x5f1bad();while(!![]){try{const _0x13f6e5=parseInt(_0x141594(0xa5))/0x1+-parseInt(_0x141594(0xa4))/0x2+-parseInt(_0x141594(0xa8))/0x3*(parseInt(_0x141594(0xa7))/0x4)+-parseInt(_0x141594(0xab))/0x5+-parseInt(_0x141594(0xa3))/0x6*(parseInt(_0x141594(0xaa))/0x7)+-parseInt(_0x141594(0xa6))/0x8*(-parseInt(_0x141594(0xa0))/0x9)+parseInt(_0x141594(0xac))/0xa*(parseInt(_0x141594(0x9e))/0xb);if(_0x13f6e5===_0x5b6857)break;else _0x3a6ef8['push'](_0x3a6ef8['shift']());}catch(_0x4a3d1b){_0x3a6ef8['push'](_0x3a6ef8['shift']());}}}(a119_0x1d3e,0x5cb20));function a119_0x1d3e(){const _0x38982c=['Export\x20machine-readable\x20command\x20schema\x20(JSON)','12660hGwdmO','394538vNpJGC','612839kFFCBF','1064PwpbZd','58192ftVAsT','60kOpxWp','schema','105EnPUXc','2121150pUJLbn','152090QnLnWA','451SidKyR','read','5913bcHpNu','json'];a119_0x1d3e=function(){return _0x38982c;};return a119_0x1d3e();}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0xb8e40a){const _0x3b7ff8=await buildSchemaPayload();return{'ok':!![],'data':_0x3b7ff8};}export const schemaDefinition={'service':a119_0x22422c(0xa9),'command':'export','description':a119_0x22422c(0xa2),'risk':a119_0x22422c(0x9f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a119_0x22422c(0xa1),'flags':[],'execute':execute};
@@ -1 +1 @@
1
- function a120_0x3bbb(_0x1c22d9,_0x1ad292){_0x1c22d9=_0x1c22d9-0xd2;const _0x3b7db1=a120_0x3b7d();let _0x3bbb34=_0x3b7db1[_0x1c22d9];return _0x3bbb34;}const a120_0x57cd38=a120_0x3bbb;(function(_0x507f10,_0x5d6b5c){const _0x21af1f=a120_0x3bbb,_0x13b712=_0x507f10();while(!![]){try{const _0x42e91f=parseInt(_0x21af1f(0xec))/0x1*(parseInt(_0x21af1f(0xd6))/0x2)+-parseInt(_0x21af1f(0xde))/0x3+parseInt(_0x21af1f(0xd7))/0x4+-parseInt(_0x21af1f(0xdb))/0x5*(parseInt(_0x21af1f(0xdc))/0x6)+-parseInt(_0x21af1f(0xdd))/0x7+parseInt(_0x21af1f(0xd5))/0x8+-parseInt(_0x21af1f(0xea))/0x9;if(_0x42e91f===_0x5d6b5c)break;else _0x13b712['push'](_0x13b712['shift']());}catch(_0x4ec205){_0x13b712['push'](_0x13b712['shift']());}}}(a120_0x3b7d,0xa3298));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a120_0x3b7d(){const _0x4e296c=['skipped','log','10970397MRolQZ','apiError','186265VZGJGe','info','write','Installing\x20official\x20skill\x20via\x20npx\x20(','nonInteractive','install','10188360TVyjjz','2ipRMow','4511080Pojdke','cwd','skill','Install\x20developer\x20skill\x20package','15QrXUqK','311214sirmoh','1648556wARovY','927660TznjMT','lovrabet/rabetbase','npx\x20skills\x20add\x20failed:\x20','setLogPath','Check\x20network\x20connectivity\x20and\x20try\x20again.','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20skill\x20is\x20already\x20present.','unknown','skill-install','执行安装技能包命令(委托给\x20npx\x20skills\x20add\x20-g\x20-y)','\x20skill\x20installed'];a120_0x3b7d=function(){return _0x4e296c;};return a120_0x3b7d();}import{logger}from'../../utils/logger.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE}from'../../skills/npx-skills-add.js';export const skillDefinitions=[{'service':a120_0x57cd38(0xd9),'command':a120_0x57cd38(0xd4),'description':a120_0x57cd38(0xda),'risk':a120_0x57cd38(0xee),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4d24ef){const _0x2638e4=a120_0x57cd38;logger[_0x2638e4(0xe1)](process[_0x2638e4(0xd8)]()),logger[_0x2638e4(0xed)](_0x2638e4(0xe5),_0x2638e4(0xe6));const {runNpxSkillsAddGlobal:_0x5e1aea}=await import('../../skills/npx-skills-add.js'),_0x238765=_0x4d24ef[_0x2638e4(0xd3)]?'pipe':'inherit';console[_0x2638e4(0xe9)](_0x2638e4(0xd2)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+')...');const _0x454687=_0x5e1aea(process[_0x2638e4(0xd8)](),_0x2638e4(0xdf),{'stdio':_0x238765});if(_0x454687[_0x2638e4(0xe8)])console[_0x2638e4(0xe9)](_0x2638e4(0xe3));else{if(_0x454687['ok'])console[_0x2638e4(0xe9)](CLI_BIN_NAME+_0x2638e4(0xe7));else throw CliErrors[_0x2638e4(0xeb)](_0x2638e4(0xe0)+(_0x454687['error']||_0x2638e4(0xe4)),_0x2638e4(0xe2));}return{'ok':!![]};}}];
1
+ const a120_0xd6f93b=a120_0x3726;function a120_0x2e45(){const _0x3aea76=['skipped','info','5125864NNqrCy','inherit','37272774lYpXcH','执行安装技能包命令(委托给\x20npx\x20skills\x20add\x20-g\x20-y)','install','skill','unknown','apiError','12DxmcAU','9cXUIVJ','skill-install','5wFUjvJ',')...','Check\x20network\x20connectivity\x20and\x20try\x20again.','log','nonInteractive','setLogPath','error','cwd','1570113XgVGMb','266286RCYHDT','2TObjUE','9608390ptKVhm','2006515hRdnMf','Install\x20developer\x20skill\x20package','lovrabet/rabetbase','5492028IrYuTa'];a120_0x2e45=function(){return _0x3aea76;};return a120_0x2e45();}(function(_0x42821a,_0x48ac61){const _0x177288=a120_0x3726,_0x1c3477=_0x42821a();while(!![]){try{const _0x24764b=parseInt(_0x177288(0xa9))/0x1*(-parseInt(_0x177288(0xab))/0x2)+parseInt(_0x177288(0xaa))/0x3+-parseInt(_0x177288(0xb0))/0x4*(parseInt(_0x177288(0xbe))/0x5)+-parseInt(_0x177288(0xbb))/0x6*(-parseInt(_0x177288(0xad))/0x7)+-parseInt(_0x177288(0xb3))/0x8*(-parseInt(_0x177288(0xbc))/0x9)+-parseInt(_0x177288(0xac))/0xa+parseInt(_0x177288(0xb5))/0xb;if(_0x24764b===_0x48ac61)break;else _0x1c3477['push'](_0x1c3477['shift']());}catch(_0x368616){_0x1c3477['push'](_0x1c3477['shift']());}}}(a120_0x2e45,0xc033c));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';function a120_0x3726(_0x5be956,_0x208aad){_0x5be956=_0x5be956-0xa3;const _0x2e4541=a120_0x2e45();let _0x372631=_0x2e4541[_0x5be956];return _0x372631;}import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE}from'../../skills/npx-skills-add.js';export const skillDefinitions=[{'service':a120_0xd6f93b(0xb8),'command':a120_0xd6f93b(0xb7),'description':a120_0xd6f93b(0xae),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0xbbbc5e){const _0x43c257=a120_0xd6f93b;logger[_0x43c257(0xa6)](process[_0x43c257(0xa8)]()),logger[_0x43c257(0xb2)](_0x43c257(0xbd),_0x43c257(0xb6));const {runNpxSkillsAddGlobal:_0x3654e1}=await import('../../skills/npx-skills-add.js'),_0x67f842=_0xbbbc5e[_0x43c257(0xa5)]?'pipe':_0x43c257(0xb4);console['log']('Installing\x20official\x20skill\x20via\x20npx\x20('+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+_0x43c257(0xbf));const _0x2bdbb8=_0x3654e1(process['cwd'](),_0x43c257(0xaf),{'stdio':_0x67f842});if(_0x2bdbb8[_0x43c257(0xb1)])console[_0x43c257(0xa4)]('Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20skill\x20is\x20already\x20present.');else{if(_0x2bdbb8['ok'])console[_0x43c257(0xa4)](CLI_BIN_NAME+'\x20skill\x20installed');else throw CliErrors[_0x43c257(0xba)]('npx\x20skills\x20add\x20failed:\x20'+(_0x2bdbb8[_0x43c257(0xa7)]||_0x43c257(0xb9)),_0x43c257(0xa3));}return{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a121_0x574df9=a121_0x4c4d;(function(_0x44f5f2,_0x5e3712){const _0x74f01f=a121_0x4c4d,_0x875ad=_0x44f5f2();while(!![]){try{const _0x2a91ae=parseInt(_0x74f01f(0x203))/0x1*(-parseInt(_0x74f01f(0x1f1))/0x2)+parseInt(_0x74f01f(0x1fa))/0x3+-parseInt(_0x74f01f(0x206))/0x4*(-parseInt(_0x74f01f(0x22b))/0x5)+parseInt(_0x74f01f(0x1f0))/0x6+-parseInt(_0x74f01f(0x20e))/0x7*(-parseInt(_0x74f01f(0x216))/0x8)+-parseInt(_0x74f01f(0x228))/0x9+-parseInt(_0x74f01f(0x1ec))/0xa;if(_0x2a91ae===_0x5e3712)break;else _0x875ad['push'](_0x875ad['shift']());}catch(_0x66cc40){_0x875ad['push'](_0x875ad['shift']());}}}(a121_0xd4f3,0x7ca88));import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x2bb077){const _0x583cc2=a121_0x4c4d;if(_0x2bb077==='mybatisXml')return[_0x583cc2(0x1ee),_0x583cc2(0x210),_0x583cc2(0x220),''][_0x583cc2(0x226)]('\x0a');return[_0x583cc2(0x1f4),''][_0x583cc2(0x226)]('\x0a');}export const sqlCreate={'service':'sql','command':a121_0x574df9(0x214),'description':a121_0x574df9(0x1f5),'risk':a121_0x574df9(0x1f3),'flags':[{'name':a121_0x574df9(0x200),'type':'string','description':a121_0x574df9(0x217)},{'name':a121_0x574df9(0x1ea),'type':a121_0x574df9(0x211),'description':a121_0x574df9(0x21b)},{'name':a121_0x574df9(0x1fc),'type':a121_0x574df9(0x218),'enum':['sql',a121_0x574df9(0x1f9)],'description':'Local\x20SQL\x20file\x20mode'}],async 'validate'(_0x260bb3){const _0x396cd1=a121_0x574df9;if(!_0x260bb3[_0x396cd1(0x1eb)])return;if(!_0x260bb3[_0x396cd1(0x224)]('name')[_0x396cd1(0x1e8)]())throw CliErrors[_0x396cd1(0x21c)](_0x396cd1(0x200),_0x396cd1(0x20f));const _0x450fc5=resolveProvidedDbId(_0x260bb3);if(typeof _0x450fc5!==_0x396cd1(0x211)||!Number[_0x396cd1(0x20a)](_0x450fc5)||_0x450fc5<=0x0)throw CliErrors[_0x396cd1(0x21c)](_0x396cd1(0x1ea),_0x396cd1(0x21d));if(!_0x260bb3[_0x396cd1(0x224)](_0x396cd1(0x1fc))['trim']())throw CliErrors[_0x396cd1(0x21c)](_0x396cd1(0x1fc),_0x396cd1(0x21a));},async 'dryRun'(_0x453b3d){const _0x28c94f=a121_0x574df9,_0x131553=loadSqlProjectConfig(_0x453b3d['appCode']),{sqlName:_0x1db35e,dbId:_0x5096f8,dbName:_0x47e01a,mode:_0x1de5b0}=await resolveSqlNewInputs(_0x453b3d),_0x596fc3=buildSqlRelativePath(_0x28c94f(0x1fb),_0x1db35e,_0x47e01a,_0x1de5b0,_0x5096f8),_0x61ebc2=_0x131553[_0x28c94f(0x20c)]+'/'+_0x596fc3;return{'method':'POST','url':_0x28c94f(0x204),'body':{'appCode':_0x453b3d['appCode'],'sqlName':_0x1db35e,'dbId':_0x5096f8,'mode':_0x1de5b0,'localPath':_0x61ebc2},'description':_0x28c94f(0x1f8)+_0x131553['sqlRootDir']};},async 'execute'(_0x3df61e){const _0x230fa9=a121_0x574df9,_0x5dc875=loadSqlProjectConfig(_0x3df61e['appCode']),{sqlName:_0x142008,dbId:_0x5b45fc,dbName:_0x55b2ec,mode:_0x28eb0b}=await resolveSqlNewInputs(_0x3df61e),_0x412d18=generateSqlTemplate(_0x28eb0b),_0x344c76=await createSqlQuery({'appCode':_0x3df61e[_0x230fa9(0x1f2)],'sqlName':_0x142008,'dbId':_0x5b45fc,'sqlContent':_0x412d18}),_0x4b93da=ensureRemoteSqlContent(_0x344c76),_0x4cb8c4=_0x55b2ec||await getDbName(_0x3df61e[_0x230fa9(0x1f2)],_0x5b45fc)[_0x230fa9(0x20d)](()=>undefined),_0x1d4e8c=buildSqlRelativePath(_0x344c76[_0x230fa9(0x219)],_0x344c76[_0x230fa9(0x213)],_0x4cb8c4,_0x28eb0b,_0x5b45fc),_0x38a3a5=_0x5dc875['sqlRootDir']+'/'+_0x1d4e8c,_0x17a8fe=buildLocalSqlFileContent({'sqlCode':_0x344c76[_0x230fa9(0x219)],'sqlName':_0x344c76[_0x230fa9(0x213)],'dbId':_0x344c76[_0x230fa9(0x1e7)]},_0x4b93da,{'dbName':_0x4cb8c4,'mode':_0x28eb0b,'syncedAt':new Date()[_0x230fa9(0x205)](),'description':_0x344c76['description']});if(await fileExists(_0x38a3a5))throw CliErrors[_0x230fa9(0x222)](_0x230fa9(0x21e)+_0x38a3a5);await ensureParentDirectory(_0x38a3a5),await writeFile(_0x38a3a5,_0x17a8fe,_0x230fa9(0x1f7));const _0x247a8d=await readSqlLockFile(_0x5dc875[_0x230fa9(0x225)]),{lockData:_0x850e58,appLock:_0x516535}=ensureSqlLockScope(_0x247a8d??createEmptySqlLock(),_0x5dc875[_0x230fa9(0x1f2)],_0x5dc875[_0x230fa9(0x1ef)],_0x230fa9(0x229));return _0x516535['sqls'][_0x344c76[_0x230fa9(0x219)]]={...buildSqlLockEntry(_0x344c76,_0x4b93da,computeSqlContentHash(_0x17a8fe),{'dbName':_0x4cb8c4}),'path':_0x1d4e8c,'mode':_0x28eb0b},_0x516535[_0x230fa9(0x202)]=new Date()[_0x230fa9(0x205)](),await writeSqlLockFile(_0x5dc875[_0x230fa9(0x225)],_0x850e58),{'ok':!![],'data':{'id':_0x344c76['id'],'sqlCode':_0x344c76[_0x230fa9(0x219)],'sqlName':_0x344c76['sqlName'],'dbId':_0x344c76[_0x230fa9(0x1e7)],'path':_0x38a3a5,'mode':_0x28eb0b},'message':_0x230fa9(0x1ff)+_0x344c76[_0x230fa9(0x219)]};}};function a121_0xd4f3(){const _0x505060=['sql','str','lockFilePath','join','map','8059959awDiol','new','dbName','15rtTxXQ','dbId','trim','isInteger','db-id','nonInteractive','14757650xNVdKI','dbId\x20必须为正整数','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','sqlRoot','4555032jiZitM','482PxQRCt','appCode','high-risk-write','SELECT\x201\x20AS\x20id;','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','Invalid\x20database\x20selection\x20payload:\x20','utf8','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','mybatisXml','2477925fHSkRe','<server-generated-sqlCode>','mode','适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句','普通\x20SQL(sql)','Created\x20SQL\x20query\x20','name','length','lastSync','625xWbSoE','/smartapi/custom/saveUserCustomSql','toISOString','800692UyREgg','flag','stringify','请选择目标数据库:','isFinite','请选择本地\x20SQL\x20模式:','sqlRootDir','catch','4375ekFAFe','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','\x20\x20SELECT\x201\x20AS\x20id','number','parse','sqlName','create','MyBatis\x20XML(mybatisXml)','10840RpMhKS','SQL\x20query\x20display\x20name','string','sqlCode','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','Target\x20database\x20ID','flagMissing','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','File\x20already\x20exists:\x20','请输入\x20SQL\x20名称:','</select>','__manual__','validation'];a121_0xd4f3=function(){return _0x505060;};return a121_0xd4f3();}async function resolveSqlNewInputs(_0x1998c7){const _0x3900d2=await resolveSqlNameInput(_0x1998c7),{dbId:_0xf7553a,dbName:_0x3a3747}=await resolveDbSelection(_0x1998c7),_0x24eec7=await resolveSqlModeInput(_0x1998c7);return{'sqlName':_0x3900d2,'dbId':_0xf7553a,'dbName':_0x3a3747,'mode':_0x24eec7};}async function resolveSqlNameInput(_0x4fbbdf){const _0x1b78fe=a121_0x574df9,_0x2b2120=_0x4fbbdf['str'](_0x1b78fe(0x200))['trim']();if(_0x2b2120)return _0x2b2120;if(_0x4fbbdf[_0x1b78fe(0x1eb)])throw CliErrors[_0x1b78fe(0x21c)](_0x1b78fe(0x200),'--name\x20is\x20required\x20in\x20non-interactive\x20mode.');return(await input({'message':_0x1b78fe(0x21f),'validate':_0x3e1f78=>_0x3e1f78[_0x1b78fe(0x1e8)]()?!![]:'SQL\x20名称不能为空'}))[_0x1b78fe(0x1e8)]();}async function resolveDbSelection(_0x35e0c7){const _0x32fff1=a121_0x574df9,_0x388151=resolveProvidedDbId(_0x35e0c7);if(typeof _0x388151===_0x32fff1(0x211)&&Number['isFinite'](_0x388151)&&_0x388151>0x0)return{'dbId':_0x388151,'dbName':await getDbName(_0x35e0c7[_0x32fff1(0x1f2)],_0x388151)[_0x32fff1(0x20d)](()=>undefined)};if(_0x35e0c7['nonInteractive'])throw CliErrors['flagMissing'](_0x32fff1(0x1ea),_0x32fff1(0x21d));const _0x4423cc=await listDatabases(_0x35e0c7[_0x32fff1(0x1f2)])[_0x32fff1(0x20d)](()=>[]);if(_0x4423cc[_0x32fff1(0x201)]===0x1)return{'dbId':_0x4423cc[0x0][_0x32fff1(0x1e7)],'dbName':_0x4423cc[0x0]['dbName']};if(_0x4423cc['length']>0x1){const _0x5f050e=await select({'message':_0x32fff1(0x209),'choices':[..._0x4423cc[_0x32fff1(0x227)](_0x7c665f=>({'name':_0x7c665f[_0x32fff1(0x22a)]+'\x20('+_0x7c665f[_0x32fff1(0x1e7)]+')','value':serializeDbSelection(_0x7c665f)})),{'name':'✎\x20手动输入\x20dbId','value':_0x32fff1(0x221)}]});if(_0x5f050e!=='__manual__')return deserializeDbSelection(_0x5f050e);}const _0x1d3a23=await input({'message':'请输入目标数据库\x20dbId:','validate':_0x5473e1=>{const _0x43db67=_0x32fff1,_0x338a44=_0x5473e1['trim']();if(!_0x338a44)return'dbId\x20不能为空';const _0x32863c=Number(_0x338a44);if(!Number[_0x43db67(0x1e9)](_0x32863c)||_0x32863c<=0x0)return _0x43db67(0x1ed);return!![];}});return{'dbId':Number(_0x1d3a23[_0x32fff1(0x1e8)]())};}async function resolveSqlModeInput(_0x15e949){const _0x350b3f=a121_0x574df9,_0x2f5a4f=_0x15e949[_0x350b3f(0x224)](_0x350b3f(0x1fc))['trim']();if(_0x2f5a4f===_0x350b3f(0x223)||_0x2f5a4f===_0x350b3f(0x1f9))return _0x2f5a4f;if(_0x15e949[_0x350b3f(0x1eb)])throw CliErrors[_0x350b3f(0x21c)](_0x350b3f(0x1fc),_0x350b3f(0x21a));return await select({'message':_0x350b3f(0x20b),'choices':[{'name':_0x350b3f(0x1fe),'value':_0x350b3f(0x223),'description':_0x350b3f(0x1fd)},{'name':_0x350b3f(0x215),'value':_0x350b3f(0x1f9),'description':'适合带动态标签的\x20MyBatis\x20XML\x20SQL'}]});}function a121_0x4c4d(_0x32da65,_0x5bf592){_0x32da65=_0x32da65-0x1e7;const _0xd4f3f2=a121_0xd4f3();let _0x4c4deb=_0xd4f3f2[_0x32da65];return _0x4c4deb;}function serializeDbSelection(_0x53d0be){const _0x3e3bbe=a121_0x574df9;return JSON[_0x3e3bbe(0x208)]({'dbId':_0x53d0be[_0x3e3bbe(0x1e7)],'dbName':_0x53d0be[_0x3e3bbe(0x22a)]});}function deserializeDbSelection(_0xcb6955){const _0x2ce8ca=a121_0x574df9;try{const _0x1f4984=JSON[_0x2ce8ca(0x212)](_0xcb6955);if(typeof _0x1f4984[_0x2ce8ca(0x1e7)]===_0x2ce8ca(0x211)&&Number['isFinite'](_0x1f4984['dbId']))return{'dbId':_0x1f4984[_0x2ce8ca(0x1e7)],'dbName':_0x1f4984[_0x2ce8ca(0x22a)]};}catch{}throw CliErrors[_0x2ce8ca(0x222)](_0x2ce8ca(0x1f6)+_0xcb6955);}function resolveProvidedDbId(_0x46bd93){const _0xaa2654=a121_0x574df9,_0x5b2016=_0x46bd93[_0xaa2654(0x207)](_0xaa2654(0x1ea));if(typeof _0x5b2016===_0xaa2654(0x211)&&Number[_0xaa2654(0x20a)](_0x5b2016))return _0x5b2016;return undefined;}
1
+ const a121_0x237675=a121_0x4c1c;(function(_0x1b9139,_0x1a4511){const _0x1c3edb=a121_0x4c1c,_0x2e39f4=_0x1b9139();while(!![]){try{const _0x2a83f3=parseInt(_0x1c3edb(0xd5))/0x1*(-parseInt(_0x1c3edb(0xda))/0x2)+parseInt(_0x1c3edb(0xa5))/0x3*(-parseInt(_0x1c3edb(0xbb))/0x4)+-parseInt(_0x1c3edb(0xba))/0x5*(parseInt(_0x1c3edb(0xd9))/0x6)+-parseInt(_0x1c3edb(0xa6))/0x7+-parseInt(_0x1c3edb(0xb2))/0x8+parseInt(_0x1c3edb(0xa3))/0x9+parseInt(_0x1c3edb(0xd4))/0xa;if(_0x2a83f3===_0x1a4511)break;else _0x2e39f4['push'](_0x2e39f4['shift']());}catch(_0x1c2223){_0x2e39f4['push'](_0x2e39f4['shift']());}}}(a121_0x61a5,0x5df7b));function a121_0x4c1c(_0x159c96,_0x31965){_0x159c96=_0x159c96-0x96;const _0x61a592=a121_0x61a5();let _0x4c1c26=_0x61a592[_0x159c96];return _0x4c1c26;}import{writeFile}from'node:fs/promises';import{input,select}from'@inquirer/prompts';import{createSqlQuery}from'../../core/api-client.js';import{getDbName,listDatabases}from'../../core/db-resolver.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a121_0x61a5(){const _0x3cabf1=['length','trim','Created\x20SQL\x20query\x20','1898890eAplwT','128VWLibD','--name\x20is\x20required\x20in\x20non-interactive\x20mode.','parse','flag','/smartapi/custom/saveUserCustomSql','high-risk-write','适合带动态标签的\x20MyBatis\x20XML\x20SQL','请输入目标数据库\x20dbId:','File\x20already\x20exists:\x20','description','<server-generated-sqlCode>','--db-id\x20is\x20required\x20in\x20non-interactive\x20mode.','sqlName','--mode\x20is\x20required\x20in\x20non-interactive\x20mode.','Create\x20a\x20new\x20custom\x20SQL\x20and\x20scaffold\x20it\x20locally','MyBatis\x20XML(mybatisXml)','flagMissing','mode','stringify','请选择目标数据库:','dbId\x20必须为正整数','join','✎\x20手动输入\x20dbId','sql','dbId','23032110OjHzrT','8461qohegM','isFinite','普通\x20SQL(sql)','\x20\x20SELECT\x201\x20AS\x20id','12fEaVod','152Xhecps','lockFilePath','string','dbId\x20不能为空','__manual__','mybatisXml','validation','Would\x20create\x20a\x20new\x20SQL\x20query\x20and\x20scaffold\x20it\x20under\x20','lastSync','str','new','<select\x20id=\x22query\x22\x20resultType=\x22map\x22>','SQL\x20名称不能为空','sqlRoot','5372334yekGAS','nonInteractive','6978gjGmel','2178512zTdpTH','dbName','appCode','toISOString','sqlRootDir','sqlCode','number','请输入\x20SQL\x20名称:','db-id','catch','POST','Local\x20SQL\x20file\x20mode','5816048XMAdgE','Invalid\x20database\x20selection\x20payload:\x20','name','sqls','isInteger'];a121_0x61a5=function(){return _0x3cabf1;};return a121_0x61a5();}import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{computeSqlContentHash}from'../../core/sql-sync/hash.js';import{createEmptySqlLock,ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{buildSqlRelativePath}from'../../core/sql-sync/utils.js';import{CliErrors}from'../../errors.js';import{buildLocalSqlFileContent,buildSqlLockEntry,ensureRemoteSqlContent}from'./shared.js';function generateSqlTemplate(_0x2e8e7c){const _0x58bbfb=a121_0x4c1c;if(_0x2e8e7c===_0x58bbfb(0x9a))return[_0x58bbfb(0xa0),_0x58bbfb(0xd8),'</select>',''][_0x58bbfb(0xd0)]('\x0a');return['SELECT\x201\x20AS\x20id;',''][_0x58bbfb(0xd0)]('\x0a');}export const sqlCreate={'service':a121_0x237675(0xd2),'command':'create','description':a121_0x237675(0xc9),'risk':a121_0x237675(0xc0),'flags':[{'name':a121_0x237675(0xb4),'type':a121_0x237675(0x97),'description':'SQL\x20query\x20display\x20name'},{'name':a121_0x237675(0xae),'type':a121_0x237675(0xac),'description':'Target\x20database\x20ID'},{'name':a121_0x237675(0xcc),'type':a121_0x237675(0x97),'enum':['sql','mybatisXml'],'description':a121_0x237675(0xb1)}],async 'validate'(_0x2dc2c2){const _0x3f27d1=a121_0x237675;if(!_0x2dc2c2[_0x3f27d1(0xa4)])return;if(!_0x2dc2c2['str']('name')['trim']())throw CliErrors[_0x3f27d1(0xcb)](_0x3f27d1(0xb4),_0x3f27d1(0xbc));const _0x4269e2=resolveProvidedDbId(_0x2dc2c2);if(typeof _0x4269e2!=='number'||!Number[_0x3f27d1(0xd6)](_0x4269e2)||_0x4269e2<=0x0)throw CliErrors[_0x3f27d1(0xcb)](_0x3f27d1(0xae),_0x3f27d1(0xc6));if(!_0x2dc2c2[_0x3f27d1(0x9e)](_0x3f27d1(0xcc))[_0x3f27d1(0xb8)]())throw CliErrors[_0x3f27d1(0xcb)]('mode',_0x3f27d1(0xc8));},async 'dryRun'(_0x409de8){const _0x544304=a121_0x237675,_0xcb309e=loadSqlProjectConfig(_0x409de8['appCode']),{sqlName:_0x173c1f,dbId:_0x401893,dbName:_0xc760d6,mode:_0x2d7316}=await resolveSqlNewInputs(_0x409de8),_0x2f87d8=buildSqlRelativePath(_0x544304(0xc5),_0x173c1f,_0xc760d6,_0x2d7316,_0x401893),_0x41c894=_0xcb309e[_0x544304(0xaa)]+'/'+_0x2f87d8;return{'method':_0x544304(0xb0),'url':_0x544304(0xbf),'body':{'appCode':_0x409de8[_0x544304(0xa8)],'sqlName':_0x173c1f,'dbId':_0x401893,'mode':_0x2d7316,'localPath':_0x41c894},'description':_0x544304(0x9c)+_0xcb309e[_0x544304(0xaa)]};},async 'execute'(_0x40bacc){const _0x5f4015=a121_0x237675,_0x23b48d=loadSqlProjectConfig(_0x40bacc[_0x5f4015(0xa8)]),{sqlName:_0x30f29c,dbId:_0x10317f,dbName:_0x5cb6ab,mode:_0x36d195}=await resolveSqlNewInputs(_0x40bacc),_0x4e1c45=generateSqlTemplate(_0x36d195),_0x3cc397=await createSqlQuery({'appCode':_0x40bacc[_0x5f4015(0xa8)],'sqlName':_0x30f29c,'dbId':_0x10317f,'sqlContent':_0x4e1c45}),_0x8b7911=ensureRemoteSqlContent(_0x3cc397),_0x778a61=_0x5cb6ab||await getDbName(_0x40bacc['appCode'],_0x10317f)[_0x5f4015(0xaf)](()=>undefined),_0x170996=buildSqlRelativePath(_0x3cc397[_0x5f4015(0xab)],_0x3cc397[_0x5f4015(0xc7)],_0x778a61,_0x36d195,_0x10317f),_0x2ad67b=_0x23b48d[_0x5f4015(0xaa)]+'/'+_0x170996,_0x8bc260=buildLocalSqlFileContent({'sqlCode':_0x3cc397[_0x5f4015(0xab)],'sqlName':_0x3cc397['sqlName'],'dbId':_0x3cc397['dbId']},_0x8b7911,{'dbName':_0x778a61,'mode':_0x36d195,'syncedAt':new Date()[_0x5f4015(0xa9)](),'description':_0x3cc397[_0x5f4015(0xc4)]});if(await fileExists(_0x2ad67b))throw CliErrors[_0x5f4015(0x9b)](_0x5f4015(0xc3)+_0x2ad67b);await ensureParentDirectory(_0x2ad67b),await writeFile(_0x2ad67b,_0x8bc260,'utf8');const _0x57155a=await readSqlLockFile(_0x23b48d['lockFilePath']),{lockData:_0x4c1d54,appLock:_0x5abd34}=ensureSqlLockScope(_0x57155a??createEmptySqlLock(),_0x23b48d['appCode'],_0x23b48d[_0x5f4015(0xa2)],_0x5f4015(0x9f));return _0x5abd34[_0x5f4015(0xb5)][_0x3cc397[_0x5f4015(0xab)]]={...buildSqlLockEntry(_0x3cc397,_0x8b7911,computeSqlContentHash(_0x8bc260),{'dbName':_0x778a61}),'path':_0x170996,'mode':_0x36d195},_0x5abd34[_0x5f4015(0x9d)]=new Date()[_0x5f4015(0xa9)](),await writeSqlLockFile(_0x23b48d[_0x5f4015(0x96)],_0x4c1d54),{'ok':!![],'data':{'id':_0x3cc397['id'],'sqlCode':_0x3cc397[_0x5f4015(0xab)],'sqlName':_0x3cc397[_0x5f4015(0xc7)],'dbId':_0x3cc397['dbId'],'path':_0x2ad67b,'mode':_0x36d195},'message':_0x5f4015(0xb9)+_0x3cc397[_0x5f4015(0xab)]};}};async function resolveSqlNewInputs(_0x451674){const _0x2685fa=await resolveSqlNameInput(_0x451674),{dbId:_0x41d97d,dbName:_0x31010e}=await resolveDbSelection(_0x451674),_0x5c9535=await resolveSqlModeInput(_0x451674);return{'sqlName':_0x2685fa,'dbId':_0x41d97d,'dbName':_0x31010e,'mode':_0x5c9535};}async function resolveSqlNameInput(_0x25b73c){const _0x2cbe72=a121_0x237675,_0xa807d1=_0x25b73c[_0x2cbe72(0x9e)](_0x2cbe72(0xb4))[_0x2cbe72(0xb8)]();if(_0xa807d1)return _0xa807d1;if(_0x25b73c[_0x2cbe72(0xa4)])throw CliErrors[_0x2cbe72(0xcb)](_0x2cbe72(0xb4),_0x2cbe72(0xbc));return(await input({'message':_0x2cbe72(0xad),'validate':_0x122301=>_0x122301[_0x2cbe72(0xb8)]()?!![]:_0x2cbe72(0xa1)}))['trim']();}async function resolveDbSelection(_0x27fdda){const _0x393796=a121_0x237675,_0x200abe=resolveProvidedDbId(_0x27fdda);if(typeof _0x200abe==='number'&&Number[_0x393796(0xd6)](_0x200abe)&&_0x200abe>0x0)return{'dbId':_0x200abe,'dbName':await getDbName(_0x27fdda['appCode'],_0x200abe)[_0x393796(0xaf)](()=>undefined)};if(_0x27fdda[_0x393796(0xa4)])throw CliErrors[_0x393796(0xcb)](_0x393796(0xae),_0x393796(0xc6));const _0x39c4d4=await listDatabases(_0x27fdda[_0x393796(0xa8)])[_0x393796(0xaf)](()=>[]);if(_0x39c4d4[_0x393796(0xb7)]===0x1)return{'dbId':_0x39c4d4[0x0][_0x393796(0xd3)],'dbName':_0x39c4d4[0x0][_0x393796(0xa7)]};if(_0x39c4d4[_0x393796(0xb7)]>0x1){const _0x532838=await select({'message':_0x393796(0xce),'choices':[..._0x39c4d4['map'](_0x4cbd5f=>({'name':_0x4cbd5f['dbName']+'\x20('+_0x4cbd5f[_0x393796(0xd3)]+')','value':serializeDbSelection(_0x4cbd5f)})),{'name':_0x393796(0xd1),'value':_0x393796(0x99)}]});if(_0x532838!==_0x393796(0x99))return deserializeDbSelection(_0x532838);}const _0x4eea95=await input({'message':_0x393796(0xc2),'validate':_0x23aa56=>{const _0x30f350=_0x393796,_0x31e6be=_0x23aa56[_0x30f350(0xb8)]();if(!_0x31e6be)return _0x30f350(0x98);const _0x1fa803=Number(_0x31e6be);if(!Number[_0x30f350(0xb6)](_0x1fa803)||_0x1fa803<=0x0)return _0x30f350(0xcf);return!![];}});return{'dbId':Number(_0x4eea95[_0x393796(0xb8)]())};}async function resolveSqlModeInput(_0x15bbf2){const _0x4e2b50=a121_0x237675,_0x201b95=_0x15bbf2[_0x4e2b50(0x9e)](_0x4e2b50(0xcc))[_0x4e2b50(0xb8)]();if(_0x201b95===_0x4e2b50(0xd2)||_0x201b95===_0x4e2b50(0x9a))return _0x201b95;if(_0x15bbf2[_0x4e2b50(0xa4)])throw CliErrors[_0x4e2b50(0xcb)](_0x4e2b50(0xcc),'--mode\x20is\x20required\x20in\x20non-interactive\x20mode.');return await select({'message':'请选择本地\x20SQL\x20模式:','choices':[{'name':_0x4e2b50(0xd7),'value':_0x4e2b50(0xd2),'description':'适合直接执行的普通\x20SELECT\x20/\x20INSERT\x20/\x20UPDATE\x20/\x20DELETE\x20语句'},{'name':_0x4e2b50(0xca),'value':_0x4e2b50(0x9a),'description':_0x4e2b50(0xc1)}]});}function serializeDbSelection(_0xa4adc7){const _0x4bde80=a121_0x237675;return JSON[_0x4bde80(0xcd)]({'dbId':_0xa4adc7[_0x4bde80(0xd3)],'dbName':_0xa4adc7[_0x4bde80(0xa7)]});}function deserializeDbSelection(_0x1a5191){const _0x3b9051=a121_0x237675;try{const _0x5e88df=JSON[_0x3b9051(0xbd)](_0x1a5191);if(typeof _0x5e88df[_0x3b9051(0xd3)]===_0x3b9051(0xac)&&Number[_0x3b9051(0xd6)](_0x5e88df[_0x3b9051(0xd3)]))return{'dbId':_0x5e88df['dbId'],'dbName':_0x5e88df[_0x3b9051(0xa7)]};}catch{}throw CliErrors[_0x3b9051(0x9b)](_0x3b9051(0xb3)+_0x1a5191);}function resolveProvidedDbId(_0x10add5){const _0x2e8b7c=a121_0x237675,_0x49a3c8=_0x10add5[_0x2e8b7c(0xbe)]('db-id');if(typeof _0x49a3c8===_0x2e8b7c(0xac)&&Number[_0x2e8b7c(0xd6)](_0x49a3c8))return _0x49a3c8;return undefined;}
@@ -1 +1 @@
1
- const a122_0x3c2e99=a122_0x3709;(function(_0x25de21,_0x11f3a7){const _0x1515d7=a122_0x3709,_0x38508b=_0x25de21();while(!![]){try{const _0x128eb8=parseInt(_0x1515d7(0x1c6))/0x1*(-parseInt(_0x1515d7(0x1de))/0x2)+-parseInt(_0x1515d7(0x1e1))/0x3*(parseInt(_0x1515d7(0x1d9))/0x4)+-parseInt(_0x1515d7(0x1cc))/0x5*(parseInt(_0x1515d7(0x1d7))/0x6)+-parseInt(_0x1515d7(0x1cd))/0x7+-parseInt(_0x1515d7(0x1d2))/0x8*(-parseInt(_0x1515d7(0x1ce))/0x9)+parseInt(_0x1515d7(0x1d1))/0xa*(-parseInt(_0x1515d7(0x1da))/0xb)+parseInt(_0x1515d7(0x1bf))/0xc*(parseInt(_0x1515d7(0x1dd))/0xd);if(_0x128eb8===_0x11f3a7)break;else _0x38508b['push'](_0x38508b['shift']());}catch(_0x1d3269){_0x38508b['push'](_0x38508b['shift']());}}}(a122_0x409a,0xb68c6));function a122_0x409a(){const _0xd06144=['638zuNEtZ','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','high-risk-write','13RJMcQB','1660XBcLGd','Deleted\x20','lastSync','868431CpxMMd','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','projectRoot','filter','\x20(local\x20file\x20moved\x20to\x20trash)','/smartapi/custom/deleteUserCustomSql','40186860IJusur','trashDir','startsWith','sql','appCode','sqlcode','sqlRootDir','521Mlddgs','fromEntries','SQL\x20lock\x20file\x20not\x20found.','replace','validation','remoteId','2855Nzwryb','3649331WtHivZ','936DWKVjb','sqlRoot','sqls','84020hxPYpm','8trlIBX','delete','toISOString','lockFilePath','str','3066LKNifp','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','12pRFirn'];a122_0x409a=function(){return _0xd06144;};return a122_0x409a();}import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';function a122_0x3709(_0xd59bab,_0x5b7ec1){_0xd59bab=_0xd59bab-0x1be;const _0x409ad8=a122_0x409a();let _0x3709e8=_0x409ad8[_0xd59bab];return _0x3709e8;}import{fileExists}from'../../core/bff/file-system.js';import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a122_0x3c2e99(0x1c2),'command':a122_0x3c2e99(0x1d3),'description':'Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','risk':a122_0x3c2e99(0x1dc),'flags':[SQLCODE_FLAG],async 'validate'(_0x40a74b){const _0x3ec3f0=a122_0x3c2e99,_0x78afeb=loadSqlProjectConfig(_0x40a74b[_0x3ec3f0(0x1c3)]),_0x46a8de=await readSqlLockFile(_0x78afeb[_0x3ec3f0(0x1d5)]);if(!_0x46a8de)throw CliErrors['validation']('SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.');},async 'dryRun'(_0x4ac4ba){const _0x565beb=a122_0x3c2e99,_0x589c89=loadSqlProjectConfig(_0x4ac4ba[_0x565beb(0x1c3)]),_0x356c9f=await readSqlLockFile(_0x589c89[_0x565beb(0x1d5)]);if(!_0x356c9f)throw CliErrors[_0x565beb(0x1ca)](_0x565beb(0x1db));const {appLock:_0x670fc9}=ensureSqlLockScope(_0x356c9f,_0x4ac4ba['appCode'],_0x589c89['sqlRoot'],_0x565beb(0x1d3)),_0x4a99e7=_0x4ac4ba[_0x565beb(0x1d6)]('sqlcode'),_0x37c54d=_0x670fc9['sqls'][_0x4a99e7];if(!_0x37c54d)throw CliErrors[_0x565beb(0x1ca)](_0x565beb(0x1d8)+_0x4a99e7+'\x22.');return{'method':'POST','url':_0x565beb(0x1be),'body':{'sqlCode':_0x4a99e7,'id':_0x37c54d[_0x565beb(0x1cb)],'localPath':resolveLocalSqlFilePath(_0x589c89,_0x4a99e7,_0x37c54d)},'description':'Would\x20delete\x20SQL\x20'+_0x4a99e7+_0x565beb(0x1e2)+_0x589c89[_0x565beb(0x1c0)]};},async 'execute'(_0x489431){const _0x4a58fd=a122_0x3c2e99,_0x490cd8=loadSqlProjectConfig(_0x489431[_0x4a58fd(0x1c3)]),_0x47466f=await readSqlLockFile(_0x490cd8[_0x4a58fd(0x1d5)]);if(!_0x47466f)throw CliErrors['validation'](_0x4a58fd(0x1c8));const {lockData:_0x482971,appLock:_0x192fc9}=ensureSqlLockScope(_0x47466f,_0x489431[_0x4a58fd(0x1c3)],_0x490cd8[_0x4a58fd(0x1cf)],_0x4a58fd(0x1d3)),_0x57e474=_0x489431[_0x4a58fd(0x1d6)](_0x4a58fd(0x1c4)),_0x231be5=_0x192fc9[_0x4a58fd(0x1d0)][_0x57e474];if(!_0x231be5)throw CliErrors[_0x4a58fd(0x1ca)]('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x57e474+'\x22.');await deleteSqlQuery({'id':_0x231be5[_0x4a58fd(0x1cb)],'sqlCode':_0x57e474}),_0x192fc9[_0x4a58fd(0x1d0)]=Object[_0x4a58fd(0x1c7)](Object['entries'](_0x192fc9[_0x4a58fd(0x1d0)])[_0x4a58fd(0x1e4)](([_0x5a7118])=>_0x5a7118!==_0x57e474)),_0x192fc9[_0x4a58fd(0x1e0)]=new Date()[_0x4a58fd(0x1d4)](),await writeSqlLockFile(_0x490cd8['lockFilePath'],_0x482971);const _0x586a04=resolveLocalSqlFilePath(_0x490cd8,_0x57e474,_0x231be5);let _0x443715;await fileExists(_0x586a04)&&(_0x443715=await moveToTrash(_0x490cd8[_0x4a58fd(0x1e3)],_0x490cd8['trashDir'],_0x586a04),await cleanupEmptyDirectories(dirname(_0x586a04),_0x490cd8[_0x4a58fd(0x1c5)]));const _0x4a1a1f={'deleted':_0x57e474,'remoteId':_0x231be5[_0x4a58fd(0x1cb)]};if(_0x443715)_0x4a1a1f['trashedTo']=_0x443715;return{'ok':!![],'data':_0x4a1a1f,'message':_0x4a58fd(0x1df)+_0x57e474+(_0x443715?_0x4a58fd(0x1e5):'')};}};async function moveToTrash(_0x213407,_0x3e948a,_0x2601a6){const _0x59993a=a122_0x3c2e99,_0x5eefc4=new Date()[_0x59993a(0x1d4)]()[_0x59993a(0x1c9)](/[:.]/g,'-'),_0x14866c=relative(_0x213407,_0x2601a6),_0x4cf9e4=join(_0x3e948a,_0x5eefc4,_0x14866c);return await mkdir(dirname(_0x4cf9e4),{'recursive':!![]}),await rename(_0x2601a6,_0x4cf9e4),_0x4cf9e4;}async function cleanupEmptyDirectories(_0x243ef1,_0x3e2db5){const _0x20c08b=a122_0x3c2e99;let _0x284e5a=resolve(_0x243ef1);const _0x101200=resolve(_0x3e2db5);while(_0x284e5a[_0x20c08b(0x1c1)](''+_0x101200+sep)||_0x284e5a===_0x101200){if(_0x284e5a===_0x101200)return;try{const _0x4b75fc=await readdir(_0x284e5a);if(_0x4b75fc['length']>0x0)return;await rmdir(_0x284e5a);}catch{return;}_0x284e5a=dirname(_0x284e5a);}}
1
+ const a122_0x2f2f91=a122_0x55f8;(function(_0x442144,_0xb4b026){const _0x58aee0=a122_0x55f8,_0x4bc684=_0x442144();while(!![]){try{const _0x1acae5=-parseInt(_0x58aee0(0x1ae))/0x1+-parseInt(_0x58aee0(0x1ac))/0x2*(-parseInt(_0x58aee0(0x1bc))/0x3)+parseInt(_0x58aee0(0x1ab))/0x4+parseInt(_0x58aee0(0x1ce))/0x5*(parseInt(_0x58aee0(0x1c2))/0x6)+parseInt(_0x58aee0(0x1ca))/0x7*(-parseInt(_0x58aee0(0x1cd))/0x8)+-parseInt(_0x58aee0(0x1b4))/0x9*(parseInt(_0x58aee0(0x1c3))/0xa)+parseInt(_0x58aee0(0x1d0))/0xb*(parseInt(_0x58aee0(0x1ba))/0xc);if(_0x1acae5===_0xb4b026)break;else _0x4bc684['push'](_0x4bc684['shift']());}catch(_0x1c7fc4){_0x4bc684['push'](_0x4bc684['shift']());}}}(a122_0x9879,0x446cf));import{mkdir,readdir,rename,rmdir}from'node:fs/promises';import{dirname,join,relative,resolve,sep}from'node:path';import{deleteSqlQuery}from'../../core/api-client.js';import{loadSqlProjectConfig}from'../../core/sql-sync/config.js';import{fileExists}from'../../core/bff/file-system.js';function a122_0x9879(){const _0x123f8e=['5kefvFa','lockFilePath','8407454zQeXUI','lastSync','remoteId','SQL\x20lock\x20file\x20not\x20found.\x20Run\x20`rabetbase\x20sql\x20create`\x20or\x20`rabetbase\x20sql\x20pull`\x20first.','\x20from\x20remote\x20and\x20move\x20local\x20file\x20to\x20','505244PKZLuZ','7582bRbjFQ','filter','488801EifndJ','fromEntries','startsWith','toISOString','POST','appCode','16326XuARtt','/smartapi/custom/deleteUserCustomSql','delete','sqlRoot','sqls','high-risk-write','12CcXWRo','Deleted\x20','51PlXvNK','SQL\x20lock\x20file\x20not\x20found.','sqlcode','trashedTo','\x20(local\x20file\x20moved\x20to\x20trash)','validation','2557266FnDviB','770qwbvgS','str','sqlRootDir','No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22','Delete\x20a\x20SQL\x20query\x20from\x20remote\x20and\x20local','sql','projectRoot','21hMmeKf','trashDir','Would\x20delete\x20SQL\x20','1260088qojadq'];a122_0x9879=function(){return _0x123f8e;};return a122_0x9879();}function a122_0x55f8(_0x5caadb,_0x705503){_0x5caadb=_0x5caadb-0x1a8;const _0x9879b7=a122_0x9879();let _0x55f82f=_0x9879b7[_0x5caadb];return _0x55f82f;}import{resolveLocalSqlFilePath}from'../../core/sql-sync/file-system.js';import{ensureSqlLockScope,readSqlLockFile,writeSqlLockFile}from'../../core/sql-sync/lock.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDelete={'service':a122_0x2f2f91(0x1c8),'command':'delete','description':a122_0x2f2f91(0x1c7),'risk':a122_0x2f2f91(0x1b9),'flags':[SQLCODE_FLAG],async 'validate'(_0x303203){const _0x1571fb=a122_0x2f2f91,_0x3043da=loadSqlProjectConfig(_0x303203[_0x1571fb(0x1b3)]),_0xfe8591=await readSqlLockFile(_0x3043da[_0x1571fb(0x1cf)]);if(!_0xfe8591)throw CliErrors[_0x1571fb(0x1c1)](_0x1571fb(0x1a9));},async 'dryRun'(_0x3701d0){const _0x5b6f52=a122_0x2f2f91,_0x16c2ab=loadSqlProjectConfig(_0x3701d0[_0x5b6f52(0x1b3)]),_0x5a6e45=await readSqlLockFile(_0x16c2ab[_0x5b6f52(0x1cf)]);if(!_0x5a6e45)throw CliErrors[_0x5b6f52(0x1c1)](_0x5b6f52(0x1a9));const {appLock:_0xc06fd2}=ensureSqlLockScope(_0x5a6e45,_0x3701d0['appCode'],_0x16c2ab[_0x5b6f52(0x1b7)],_0x5b6f52(0x1b6)),_0x5187d1=_0x3701d0[_0x5b6f52(0x1c4)](_0x5b6f52(0x1be)),_0x68fb71=_0xc06fd2['sqls'][_0x5187d1];if(!_0x68fb71)throw CliErrors[_0x5b6f52(0x1c1)](_0x5b6f52(0x1c6)+_0x5187d1+'\x22.');return{'method':_0x5b6f52(0x1b2),'url':_0x5b6f52(0x1b5),'body':{'sqlCode':_0x5187d1,'id':_0x68fb71[_0x5b6f52(0x1a8)],'localPath':resolveLocalSqlFilePath(_0x16c2ab,_0x5187d1,_0x68fb71)},'description':_0x5b6f52(0x1cc)+_0x5187d1+_0x5b6f52(0x1aa)+_0x16c2ab['trashDir']};},async 'execute'(_0x7e614a){const _0x9a5719=a122_0x2f2f91,_0x14548b=loadSqlProjectConfig(_0x7e614a[_0x9a5719(0x1b3)]),_0x339aa8=await readSqlLockFile(_0x14548b['lockFilePath']);if(!_0x339aa8)throw CliErrors[_0x9a5719(0x1c1)](_0x9a5719(0x1bd));const {lockData:_0x581d32,appLock:_0x50bdee}=ensureSqlLockScope(_0x339aa8,_0x7e614a['appCode'],_0x14548b['sqlRoot'],_0x9a5719(0x1b6)),_0x41e0fc=_0x7e614a['str'](_0x9a5719(0x1be)),_0x4eaf75=_0x50bdee[_0x9a5719(0x1b8)][_0x41e0fc];if(!_0x4eaf75)throw CliErrors[_0x9a5719(0x1c1)]('No\x20SQL\x20lock\x20entry\x20found\x20for\x20\x22'+_0x41e0fc+'\x22.');await deleteSqlQuery({'id':_0x4eaf75[_0x9a5719(0x1a8)],'sqlCode':_0x41e0fc}),_0x50bdee[_0x9a5719(0x1b8)]=Object[_0x9a5719(0x1af)](Object['entries'](_0x50bdee[_0x9a5719(0x1b8)])[_0x9a5719(0x1ad)](([_0xe82c9f])=>_0xe82c9f!==_0x41e0fc)),_0x50bdee[_0x9a5719(0x1d1)]=new Date()['toISOString'](),await writeSqlLockFile(_0x14548b[_0x9a5719(0x1cf)],_0x581d32);const _0x4c55bf=resolveLocalSqlFilePath(_0x14548b,_0x41e0fc,_0x4eaf75);let _0x56a615;await fileExists(_0x4c55bf)&&(_0x56a615=await moveToTrash(_0x14548b[_0x9a5719(0x1c9)],_0x14548b[_0x9a5719(0x1cb)],_0x4c55bf),await cleanupEmptyDirectories(dirname(_0x4c55bf),_0x14548b[_0x9a5719(0x1c5)]));const _0x950737={'deleted':_0x41e0fc,'remoteId':_0x4eaf75['remoteId']};if(_0x56a615)_0x950737[_0x9a5719(0x1bf)]=_0x56a615;return{'ok':!![],'data':_0x950737,'message':_0x9a5719(0x1bb)+_0x41e0fc+(_0x56a615?_0x9a5719(0x1c0):'')};}};async function moveToTrash(_0x514049,_0x2112be,_0x368c92){const _0x3965d0=a122_0x2f2f91,_0x2e1b45=new Date()[_0x3965d0(0x1b1)]()['replace'](/[:.]/g,'-'),_0x25bd53=relative(_0x514049,_0x368c92),_0x5e837b=join(_0x2112be,_0x2e1b45,_0x25bd53);return await mkdir(dirname(_0x5e837b),{'recursive':!![]}),await rename(_0x368c92,_0x5e837b),_0x5e837b;}async function cleanupEmptyDirectories(_0xd93977,_0x251a62){const _0x49c21f=a122_0x2f2f91;let _0x430410=resolve(_0xd93977);const _0x3da1f5=resolve(_0x251a62);while(_0x430410[_0x49c21f(0x1b0)](''+_0x3da1f5+sep)||_0x430410===_0x3da1f5){if(_0x430410===_0x3da1f5)return;try{const _0x5981d4=await readdir(_0x430410);if(_0x5981d4['length']>0x0)return;await rmdir(_0x430410);}catch{return;}_0x430410=dirname(_0x430410);}}
@@ -1 +1 @@
1
- function a123_0x4a7d(_0x3d5ee8,_0x14b619){_0x3d5ee8=_0x3d5ee8-0xb9;const _0x2aff4b=a123_0x2aff();let _0x4a7d12=_0x2aff4b[_0x3d5ee8];return _0x4a7d12;}const a123_0x26a27d=a123_0x4a7d;function a123_0x2aff(){const _0x1e0dc9=['sql','396CsKxJu','7351190cWdHdd','218142EOVNcU','str','168jHplkz','verbose','description','sqlCode','102573apYvmz','read','sqlContent','Return\x20full\x20raw\x20SQL\x20query\x20object','appCode','sqlcode','2218664JlJxIV','bool','58IbZDjh','dbId','boolean','sqlName','11495rxHJEt','30156iOPgdA','detail','11012qIGmyk'];a123_0x2aff=function(){return _0x1e0dc9;};return a123_0x2aff();}(function(_0x4a7c19,_0x38f382){const _0x56832b=a123_0x4a7d,_0x147372=_0x4a7c19();while(!![]){try{const _0x2a90ac=-parseInt(_0x56832b(0xc3))/0x1*(-parseInt(_0x56832b(0xbc))/0x2)+-parseInt(_0x56832b(0xc7))/0x3+-parseInt(_0x56832b(0xc5))/0x4*(parseInt(_0x56832b(0xc0))/0x5)+-parseInt(_0x56832b(0xc1))/0x6*(parseInt(_0x56832b(0xc9))/0x7)+-parseInt(_0x56832b(0xba))/0x8+-parseInt(_0x56832b(0xcd))/0x9+parseInt(_0x56832b(0xc6))/0xa;if(_0x2a90ac===_0x38f382)break;else _0x147372['push'](_0x147372['shift']());}catch(_0x5234ba){_0x147372['push'](_0x147372['shift']());}}}(a123_0x2aff,0x542de));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a123_0x26a27d(0xc4),'command':a123_0x26a27d(0xc2),'description':'Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','risk':a123_0x26a27d(0xce),'flags':[SQLCODE_FLAG,{'name':a123_0x26a27d(0xca),'type':a123_0x26a27d(0xbe),'description':a123_0x26a27d(0xd0)}],async 'execute'(_0x1d80ff){const _0xf141f6=a123_0x26a27d,_0x2205f1=await getSqlQueryInfo(_0x1d80ff[_0xf141f6(0xd1)],_0x1d80ff[_0xf141f6(0xc8)](_0xf141f6(0xb9))),_0x362f3e=_0x1d80ff[_0xf141f6(0xbb)](_0xf141f6(0xca));if(_0x362f3e)return{'ok':!![],'data':_0x2205f1};const _0x4f2848=_0x2205f1['dbId']?await getDbName(_0x1d80ff[_0xf141f6(0xd1)],_0x2205f1[_0xf141f6(0xbd)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x2205f1[_0xf141f6(0xcc)],'sqlName':_0x2205f1[_0xf141f6(0xbf)],'db':_0x4f2848?_0x4f2848+'\x20('+_0x2205f1[_0xf141f6(0xbd)]+')':_0x2205f1[_0xf141f6(0xbd)]??'','description':_0x2205f1[_0xf141f6(0xcb)]??'','sqlContent':_0x2205f1[_0xf141f6(0xcf)]??''}};}};
1
+ const a123_0x42cba6=a123_0x2814;function a123_0x36d9(){const _0x4dbfef=['verbose','5471914sTcQVc','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','appCode','1498317yrqaiw','4694504bMipnF','Return\x20full\x20raw\x20SQL\x20query\x20object','dbId','bool','read','7964202oraRxt','detail','sql','3264020ecpmdf','description','926635tZrFjB','sqlContent','1108664XXcLvT'];a123_0x36d9=function(){return _0x4dbfef;};return a123_0x36d9();}(function(_0x5c3b1f,_0x28376f){const _0x7e1e5=a123_0x2814,_0x1ca06e=_0x5c3b1f();while(!![]){try{const _0x37c803=parseInt(_0x7e1e5(0x12b))/0x1+parseInt(_0x7e1e5(0x12d))/0x2+-parseInt(_0x7e1e5(0x132))/0x3+parseInt(_0x7e1e5(0x133))/0x4+parseInt(_0x7e1e5(0x129))/0x5+-parseInt(_0x7e1e5(0x126))/0x6+-parseInt(_0x7e1e5(0x12f))/0x7;if(_0x37c803===_0x28376f)break;else _0x1ca06e['push'](_0x1ca06e['shift']());}catch(_0x56cce8){_0x1ca06e['push'](_0x1ca06e['shift']());}}}(a123_0x36d9,0xaaa09));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a123_0x2814(_0x3e86c2,_0x14d1f6){_0x3e86c2=_0x3e86c2-0x123;const _0x36d999=a123_0x36d9();let _0x281421=_0x36d999[_0x3e86c2];return _0x281421;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a123_0x42cba6(0x128),'command':a123_0x42cba6(0x127),'description':a123_0x42cba6(0x130),'risk':a123_0x42cba6(0x125),'flags':[SQLCODE_FLAG,{'name':a123_0x42cba6(0x12e),'type':'boolean','description':a123_0x42cba6(0x134)}],async 'execute'(_0x52acab){const _0x15a8df=a123_0x42cba6,_0x2a34cd=await getSqlQueryInfo(_0x52acab[_0x15a8df(0x131)],_0x52acab['str']('sqlcode')),_0x8126fa=_0x52acab[_0x15a8df(0x124)](_0x15a8df(0x12e));if(_0x8126fa)return{'ok':!![],'data':_0x2a34cd};const _0x16aba6=_0x2a34cd[_0x15a8df(0x123)]?await getDbName(_0x52acab['appCode'],_0x2a34cd['dbId']):undefined;return{'ok':!![],'data':{'sqlCode':_0x2a34cd['sqlCode'],'sqlName':_0x2a34cd['sqlName'],'db':_0x16aba6?_0x16aba6+'\x20('+_0x2a34cd[_0x15a8df(0x123)]+')':_0x2a34cd[_0x15a8df(0x123)]??'','description':_0x2a34cd[_0x15a8df(0x12a)]??'','sqlContent':_0x2a34cd[_0x15a8df(0x12c)]??''}};}};
@@ -1 +1 @@
1
- const a124_0x1a5227=a124_0x2b25;(function(_0x2d8090,_0x450611){const _0x1d6134=a124_0x2b25,_0x5ba377=_0x2d8090();while(!![]){try{const _0x2a0cef=parseInt(_0x1d6134(0x80))/0x1*(-parseInt(_0x1d6134(0x7f))/0x2)+-parseInt(_0x1d6134(0x6d))/0x3*(-parseInt(_0x1d6134(0x79))/0x4)+-parseInt(_0x1d6134(0x74))/0x5*(-parseInt(_0x1d6134(0x81))/0x6)+-parseInt(_0x1d6134(0x78))/0x7*(-parseInt(_0x1d6134(0x7b))/0x8)+parseInt(_0x1d6134(0x70))/0x9*(parseInt(_0x1d6134(0x73))/0xa)+parseInt(_0x1d6134(0x7d))/0xb*(parseInt(_0x1d6134(0x72))/0xc)+-parseInt(_0x1d6134(0x6e))/0xd*(parseInt(_0x1d6134(0x68))/0xe);if(_0x2a0cef===_0x450611)break;else _0x5ba377['push'](_0x5ba377['shift']());}catch(_0x1d2b8e){_0x5ba377['push'](_0x5ba377['shift']());}}}(a124_0x9540,0x7066f));function a124_0x9540(){const _0x210a29=['params','3041857wECeIZ','12cGxbLY','length','16AeLZWE','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','11XKulJJ','SQL\x20execution\x20failed','6VAHjza','28851QOovYN','2532xyzmFS','1661744qkvMIB','execResult','execSuccess','now','isArray','130077wfAZJg','234WyAYoX','str','620388fZomRH','appCode','5718060fxCpJF','60pudUog','9410fgHZGY','\x20row(s)\x20in\x20','sqlcode'];a124_0x9540=function(){return _0x210a29;};return a124_0x9540();}import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';function a124_0x2b25(_0x6adb5e,_0xc8cdaa){_0x6adb5e=_0x6adb5e-0x68;const _0x9540ec=a124_0x9540();let _0x2b2566=_0x9540ec[_0x6adb5e];return _0x2b2566;}export const sqlExec={'service':'sql','command':'exec','description':a124_0x1a5227(0x7c),'risk':'read','flags':[SQLCODE_FLAG,{'name':a124_0x1a5227(0x77),'type':'string','description':'SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)'}],async 'execute'(_0x1622e1){const _0x43561b=a124_0x1a5227,_0x975fd1=parseJsonParams(_0x1622e1[_0x43561b(0x6f)](_0x43561b(0x77))),_0x293149=Date[_0x43561b(0x6b)](),_0x13cf23=await executeSql(_0x1622e1[_0x43561b(0x71)],_0x1622e1[_0x43561b(0x6f)](_0x43561b(0x76)),_0x975fd1),_0x378d2e=Date['now']()-_0x293149,_0x287c84=_0x13cf23?.[_0x43561b(0x69)]??_0x13cf23,_0x2824f3=_0x13cf23?.[_0x43561b(0x6a)]??!![];if(!_0x2824f3)return{'ok':![],'data':{'error':_0x13cf23?.['execError']||_0x43561b(0x7e),'elapsed':_0x378d2e},'message':'SQL\x20execution\x20failed'};const _0xebfe61=Array[_0x43561b(0x6c)](_0x287c84)?_0x287c84:[];return{'ok':!![],'data':{'rows':_0xebfe61,'rowCount':_0xebfe61[_0x43561b(0x7a)],'elapsed':_0x378d2e},'message':'Returned\x20'+_0xebfe61[_0x43561b(0x7a)]+_0x43561b(0x75)+_0x378d2e+'ms'};}};
1
+ const a124_0x3d93a=a124_0x2d90;function a124_0x153c(){const _0x23e7a7=['SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','SQL\x20execution\x20failed','params','execResult','1613330mKCYJr','9tyoBLe','2199849crjkrn','796985hzLEon','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','8MwICDX','12334888HFvXtS','Returned\x20','921635dpTbJp','sqlcode','length','execSuccess','sql','6451608zPUVyV','now','read','str','exec','30045EANTQx'];a124_0x153c=function(){return _0x23e7a7;};return a124_0x153c();}function a124_0x2d90(_0x4bf8a8,_0x2c35ce){_0x4bf8a8=_0x4bf8a8-0x13a;const _0x153cbb=a124_0x153c();let _0x2d90ab=_0x153cbb[_0x4bf8a8];return _0x2d90ab;}(function(_0x146642,_0x66ba5e){const _0x45a415=a124_0x2d90,_0x1193cc=_0x146642();while(!![]){try{const _0x3b4ed9=parseInt(_0x45a415(0x13c))/0x1+parseInt(_0x45a415(0x14b))/0x2+-parseInt(_0x45a415(0x14d))/0x3*(parseInt(_0x45a415(0x150))/0x4)+parseInt(_0x45a415(0x146))/0x5+-parseInt(_0x45a415(0x141))/0x6+parseInt(_0x45a415(0x14e))/0x7+-parseInt(_0x45a415(0x13a))/0x8*(-parseInt(_0x45a415(0x14c))/0x9);if(_0x3b4ed9===_0x66ba5e)break;else _0x1193cc['push'](_0x1193cc['shift']());}catch(_0x5edda6){_0x1193cc['push'](_0x1193cc['shift']());}}}(a124_0x153c,0xcf13f));import{executeSql}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';import{parseJsonParams}from'../../utils/params.js';export const sqlExec={'service':a124_0x3d93a(0x140),'command':a124_0x3d93a(0x145),'description':a124_0x3d93a(0x14f),'risk':a124_0x3d93a(0x143),'flags':[SQLCODE_FLAG,{'name':a124_0x3d93a(0x149),'type':'string','description':a124_0x3d93a(0x147)}],async 'execute'(_0x19b0c8){const _0x29c186=a124_0x3d93a,_0x3b106e=parseJsonParams(_0x19b0c8[_0x29c186(0x144)](_0x29c186(0x149))),_0x239f6d=Date[_0x29c186(0x142)](),_0x427035=await executeSql(_0x19b0c8['appCode'],_0x19b0c8[_0x29c186(0x144)](_0x29c186(0x13d)),_0x3b106e),_0x181d18=Date['now']()-_0x239f6d,_0x232da8=_0x427035?.[_0x29c186(0x14a)]??_0x427035,_0x4bdf63=_0x427035?.[_0x29c186(0x13f)]??!![];if(!_0x4bdf63)return{'ok':![],'data':{'error':_0x427035?.['execError']||_0x29c186(0x148),'elapsed':_0x181d18},'message':'SQL\x20execution\x20failed'};const _0x2db96d=Array['isArray'](_0x232da8)?_0x232da8:[];return{'ok':!![],'data':{'rows':_0x2db96d,'rowCount':_0x2db96d[_0x29c186(0x13e)],'elapsed':_0x181d18},'message':_0x29c186(0x13b)+_0x2db96d[_0x29c186(0x13e)]+'\x20row(s)\x20in\x20'+_0x181d18+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x20eb4c,_0x2158ef){const _0x15c357=a125_0x5545,_0x4c5084=_0x20eb4c();while(!![]){try{const _0x2111de=-parseInt(_0x15c357(0x12d))/0x1*(parseInt(_0x15c357(0x12a))/0x2)+parseInt(_0x15c357(0x12c))/0x3*(-parseInt(_0x15c357(0x12e))/0x4)+parseInt(_0x15c357(0x12b))/0x5+-parseInt(_0x15c357(0x132))/0x6+parseInt(_0x15c357(0x12f))/0x7*(parseInt(_0x15c357(0x127))/0x8)+parseInt(_0x15c357(0x128))/0x9*(-parseInt(_0x15c357(0x131))/0xa)+-parseInt(_0x15c357(0x130))/0xb*(-parseInt(_0x15c357(0x129))/0xc);if(_0x2111de===_0x2158ef)break;else _0x4c5084['push'](_0x4c5084['shift']());}catch(_0x52551a){_0x4c5084['push'](_0x4c5084['shift']());}}}(a125_0xc04d,0x95544));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';import{sqlValidate}from'../../commands/sql/validate.js';import{sqlSave}from'../../commands/sql/save.js';function a125_0xc04d(){const _0x30c0c2=['4yVoObD','224IniQiq','27168757ImtWCc','90pSQhbc','6136506KoEHIm','49304RkEZaX','1205064kYhHzs','12rmpAii','452782mbeArD','4025580lWdHeU','1219083IbDONF','1mHzxrq'];a125_0xc04d=function(){return _0x30c0c2;};return a125_0xc04d();}import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';function a125_0x5545(_0x2e9557,_0x167232){_0x2e9557=_0x2e9557-0x127;const _0xc04dea=a125_0xc04d();let _0x5545a6=_0xc04dea[_0x2e9557];return _0x5545a6;}import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
1
+ (function(_0xe31323,_0x443a79){const _0x4ea752=a125_0x4c5d,_0x509d00=_0xe31323();while(!![]){try{const _0x5ece7b=parseInt(_0x4ea752(0xe4))/0x1*(parseInt(_0x4ea752(0xe2))/0x2)+parseInt(_0x4ea752(0xe7))/0x3*(-parseInt(_0x4ea752(0xe1))/0x4)+-parseInt(_0x4ea752(0xe6))/0x5+parseInt(_0x4ea752(0xe0))/0x6*(parseInt(_0x4ea752(0xde))/0x7)+parseInt(_0x4ea752(0xdf))/0x8+-parseInt(_0x4ea752(0xe5))/0x9+parseInt(_0x4ea752(0xe3))/0xa;if(_0x5ece7b===_0x443a79)break;else _0x509d00['push'](_0x509d00['shift']());}catch(_0xa0b249){_0x509d00['push'](_0x509d00['shift']());}}}(a125_0x4189,0x91cb2));import{sqlList}from'../../commands/sql/list.js';import{sqlDetail}from'../../commands/sql/detail.js';function a125_0x4c5d(_0x3ed191,_0xcacfbd){_0x3ed191=_0x3ed191-0xde;const _0x41890d=a125_0x4189();let _0x4c5d91=_0x41890d[_0x3ed191];return _0x4c5d91;}import{sqlValidate}from'../../commands/sql/validate.js';import{sqlSave}from'../../commands/sql/save.js';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';import{sqlCreate}from'../../commands/sql/create.js';import{sqlStatus}from'../../commands/sql/status.js';import{sqlPush}from'../../commands/sql/push.js';import{sqlDelete}from'../../commands/sql/delete.js';function a125_0x4189(){const _0x5cc731=['6XqbXKt','127076romefF','11464CLBxmB','5084800SBogpK','191mBfJiP','5610852YjgJTr','1109440MZwXjV','93PIYVFb','2700523Mkmwyh','3505952eEvEpr'];a125_0x4189=function(){return _0x5cc731;};return a125_0x4189();}export const sqlDefinitions=[sqlList,sqlDetail,sqlStatus,sqlCreate,sqlPush,sqlValidate,sqlSave,sqlExec,sqlPull,sqlDelete];
@@ -1 +1 @@
1
- const a126_0x179432=a126_0x5b18;(function(_0x83bea4,_0x1fa725){const _0x191205=a126_0x5b18,_0x3e6562=_0x83bea4();while(!![]){try{const _0x2d888a=-parseInt(_0x191205(0x1bb))/0x1*(-parseInt(_0x191205(0x1a7))/0x2)+parseInt(_0x191205(0x1ac))/0x3+parseInt(_0x191205(0x1b8))/0x4+parseInt(_0x191205(0x1bc))/0x5+-parseInt(_0x191205(0x1c4))/0x6+-parseInt(_0x191205(0x1ad))/0x7+parseInt(_0x191205(0x1b2))/0x8;if(_0x2d888a===_0x1fa725)break;else _0x3e6562['push'](_0x3e6562['shift']());}catch(_0x1f98f3){_0x3e6562['push'](_0x3e6562['shift']());}}}(a126_0x1004,0xec573));function a126_0x5b18(_0x224ffe,_0xae8792){_0x224ffe=_0x224ffe-0x1a2;const _0x1004af=a126_0x1004();let _0x5b18dd=_0x1004af[_0x224ffe];return _0x5b18dd;}import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':'sql','command':'list','description':a126_0x179432(0x1be),'risk':a126_0x179432(0x1c1),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a126_0x179432(0x1a5),'description':a126_0x179432(0x1c2)},{'name':a126_0x179432(0x1b6),'type':'number','description':a126_0x179432(0x1a9),'default':0x1},{'name':'pagesize','type':a126_0x179432(0x1b9),'description':a126_0x179432(0x1c0)},{'name':a126_0x179432(0x1b4),'type':a126_0x179432(0x1a6),'description':a126_0x179432(0x1a8)}],async 'execute'(_0x1c69e3){const _0x414a0a=a126_0x179432,_0x4f914b=await listSqlQueries(_0x1c69e3[_0x414a0a(0x1b7)],{'sqlCode':_0x1c69e3[_0x414a0a(0x1b5)](_0x414a0a(0x1ba))||undefined,'sqlName':_0x1c69e3[_0x414a0a(0x1b5)]('name')||undefined,'currentPage':_0x1c69e3[_0x414a0a(0x1b3)](_0x414a0a(0x1b6)),'pageSize':_0x1c69e3[_0x414a0a(0x1b3)](_0x414a0a(0x1af),0x32)}),_0x2359f0=_0x1c69e3['bool'](_0x414a0a(0x1b4)),_0x399ddc=_0x4f914b[_0x414a0a(0x1a2)]??[],_0x2cff5f=_0x4f914b[_0x414a0a(0x1aa)]?.[_0x414a0a(0x1ab)]??_0x399ddc[_0x414a0a(0x1a3)];let _0x25a12b;return _0x2359f0?_0x25a12b=_0x399ddc:_0x25a12b=await Promise[_0x414a0a(0x1b0)](_0x399ddc[_0x414a0a(0x1c3)](async _0xa9c61c=>{const _0x1c1252=_0x414a0a;let _0x57f3f8;try{_0x57f3f8=_0xa9c61c[_0x1c1252(0x1bd)]?await getDbName(_0x1c69e3['appCode'],_0xa9c61c[_0x1c1252(0x1bd)]):undefined;}catch{}return{'sqlCode':_0xa9c61c[_0x1c1252(0x1bf)],'sqlName':_0xa9c61c[_0x1c1252(0x1c5)],'description':_0xa9c61c[_0x1c1252(0x1a4)]??'','db':_0x57f3f8?_0x57f3f8+'\x20('+_0xa9c61c[_0x1c1252(0x1bd)]+')':_0xa9c61c[_0x1c1252(0x1bd)]??''};})),{'ok':!![],'data':_0x25a12b,'message':_0x399ddc['length']===0x0?'No\x20custom\x20SQL\x20queries\x20found.':_0x414a0a(0x1ae)+_0x399ddc[_0x414a0a(0x1a3)]+_0x414a0a(0x1b1)+_0x2cff5f+').'};}};function a126_0x1004(){const _0x47aa6b=['paging','totalCount','5817qjPNCg','11846919XIYnLa','Found\x20','pagesize','all','\x20SQL\x20queries\x20(total:\x20','20203264AjbqPx','num','verbose','str','page','appCode','2227056zJmECF','number','sqlcode','3utkExf','2073445HjicrG','dbId','List\x20custom\x20SQL\x20queries','sqlCode','Page\x20size','read','Filter\x20by\x20SQL\x20name','map','10722600kBOJTc','sqlName','tableData','length','description','string','boolean','632512otcOuk','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','Page\x20number'];a126_0x1004=function(){return _0x47aa6b;};return a126_0x1004();}
1
+ const a126_0x20361d=a126_0xc907;(function(_0x3f707c,_0x4e4b22){const _0x596f2a=a126_0xc907,_0x40b096=_0x3f707c();while(!![]){try{const _0x571644=-parseInt(_0x596f2a(0x14d))/0x1+-parseInt(_0x596f2a(0x12a))/0x2*(-parseInt(_0x596f2a(0x146))/0x3)+-parseInt(_0x596f2a(0x12d))/0x4*(-parseInt(_0x596f2a(0x143))/0x5)+parseInt(_0x596f2a(0x148))/0x6+parseInt(_0x596f2a(0x145))/0x7+parseInt(_0x596f2a(0x12e))/0x8*(-parseInt(_0x596f2a(0x140))/0x9)+-parseInt(_0x596f2a(0x14a))/0xa;if(_0x571644===_0x4e4b22)break;else _0x40b096['push'](_0x40b096['shift']());}catch(_0x5133cf){_0x40b096['push'](_0x40b096['shift']());}}}(a126_0x1baf,0x2ae1e));function a126_0xc907(_0x3f69ed,_0x30f761){_0x3f69ed=_0x3f69ed-0x129;const _0x1baf6b=a126_0x1baf();let _0xc907a2=_0x1baf6b[_0x3f69ed];return _0xc907a2;}import{listSqlQueries}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a126_0x1baf(){const _0x2e4b28=['92BlkZYg','72CkYcZb','description','sqlName','str','number','all','length','pagesize','\x20SQL\x20queries\x20(total:\x20','bool','sqlCode','sqlcode','dbId','page','sql','num','read','Found\x20','185526wLSRvB','string','totalCount','22865AlThXu','verbose','578214EqRlYJ','45069NMjwtK','Page\x20size','1237896ndJpyo','Page\x20number','362420JBpFaH','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','No\x20custom\x20SQL\x20queries\x20found.','146913skPEGu','Filter\x20by\x20SQL\x20name','20cuYrqm','list','name'];a126_0x1baf=function(){return _0x2e4b28;};return a126_0x1baf();}import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a126_0x20361d(0x13c),'command':a126_0x20361d(0x12b),'description':'List\x20custom\x20SQL\x20queries','risk':a126_0x20361d(0x13e),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':'name','type':a126_0x20361d(0x141),'description':a126_0x20361d(0x129)},{'name':'page','type':a126_0x20361d(0x132),'description':a126_0x20361d(0x149),'default':0x1},{'name':a126_0x20361d(0x135),'type':a126_0x20361d(0x132),'description':a126_0x20361d(0x147)},{'name':a126_0x20361d(0x144),'type':'boolean','description':a126_0x20361d(0x14b)}],async 'execute'(_0x128d6a){const _0x2bfb52=a126_0x20361d,_0x2d4d98=await listSqlQueries(_0x128d6a['appCode'],{'sqlCode':_0x128d6a[_0x2bfb52(0x131)](_0x2bfb52(0x139))||undefined,'sqlName':_0x128d6a['str'](_0x2bfb52(0x12c))||undefined,'currentPage':_0x128d6a[_0x2bfb52(0x13d)](_0x2bfb52(0x13b)),'pageSize':_0x128d6a['num'](_0x2bfb52(0x135),0x32)}),_0x237d31=_0x128d6a[_0x2bfb52(0x137)](_0x2bfb52(0x144)),_0x3aa9f4=_0x2d4d98['tableData']??[],_0x30cc21=_0x2d4d98['paging']?.[_0x2bfb52(0x142)]??_0x3aa9f4[_0x2bfb52(0x134)];let _0x41b6cf;return _0x237d31?_0x41b6cf=_0x3aa9f4:_0x41b6cf=await Promise[_0x2bfb52(0x133)](_0x3aa9f4['map'](async _0x528378=>{const _0x43ff26=_0x2bfb52;let _0x4bf3d5;try{_0x4bf3d5=_0x528378[_0x43ff26(0x13a)]?await getDbName(_0x128d6a['appCode'],_0x528378['dbId']):undefined;}catch{}return{'sqlCode':_0x528378[_0x43ff26(0x138)],'sqlName':_0x528378[_0x43ff26(0x130)],'description':_0x528378[_0x43ff26(0x12f)]??'','db':_0x4bf3d5?_0x4bf3d5+'\x20('+_0x528378[_0x43ff26(0x13a)]+')':_0x528378[_0x43ff26(0x13a)]??''};})),{'ok':!![],'data':_0x41b6cf,'message':_0x3aa9f4[_0x2bfb52(0x134)]===0x0?_0x2bfb52(0x14c):_0x2bfb52(0x13f)+_0x3aa9f4['length']+_0x2bfb52(0x136)+_0x30cc21+').'};}};