@lovrabet/rabetbase-cli 2.1.1 → 2.1.2-beta.1

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 (162) 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 -0
  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 -0
  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 -0
  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/delete.js +1 -1
  28. package/lib/commands/bff/detail.js +1 -1
  29. package/lib/commands/bff/index.js +1 -1
  30. package/lib/commands/bff/list.js +1 -1
  31. package/lib/commands/bff/new.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/dataset/detail.js +1 -1
  48. package/lib/commands/dataset/index.js +1 -1
  49. package/lib/commands/dataset/links.js +1 -1
  50. package/lib/commands/dataset/list.js +1 -1
  51. package/lib/commands/dataset/operations.js +1 -1
  52. package/lib/commands/db/analyze-cancel.js +1 -1
  53. package/lib/commands/db/analyze-start.js +1 -1
  54. package/lib/commands/db/analyze-status.js +1 -1
  55. package/lib/commands/db/create.js +1 -1
  56. package/lib/commands/db/delete.js +1 -1
  57. package/lib/commands/db/detail.js +1 -1
  58. package/lib/commands/db/diff.js +1 -1
  59. package/lib/commands/db/index.js +1 -1
  60. package/lib/commands/db/list.js +1 -1
  61. package/lib/commands/db/shared.js +1 -1
  62. package/lib/commands/db/tables.js +1 -1
  63. package/lib/commands/db/test.js +1 -1
  64. package/lib/commands/db/update.js +1 -1
  65. package/lib/commands/doctor.js +1 -1
  66. package/lib/commands/init/index.js +1 -1
  67. package/lib/commands/logs/index.js +1 -1
  68. package/lib/commands/menu/index.js +1 -1
  69. package/lib/commands/menu/shared/compare-table.js +1 -1
  70. package/lib/commands/menu/shared/index.js +1 -1
  71. package/lib/commands/menu/shared/inquirer.js +1 -1
  72. package/lib/commands/menu/shared/local-pages.js +1 -1
  73. package/lib/commands/menu/shared/logic.js +1 -1
  74. package/lib/commands/menu/shared/service.js +1 -1
  75. package/lib/commands/menu/shared/sync-core.js +1 -1
  76. package/lib/commands/menu/shared/update-core.js +1 -1
  77. package/lib/commands/menu/shared/valid-url.js +1 -1
  78. package/lib/commands/menu/sync.js +1 -1
  79. package/lib/commands/menu/update.js +1 -1
  80. package/lib/commands/project/create/enhanced-guided-create.js +1 -1
  81. package/lib/commands/project/create/format-elapsed.js +1 -1
  82. package/lib/commands/project/create/main.js +1 -1
  83. package/lib/commands/project/create/non-interactive.js +1 -1
  84. package/lib/commands/project/create/project-template-path.js +1 -1
  85. package/lib/commands/project/create/use-copy-project-template.js +1 -1
  86. package/lib/commands/project/create/use-format-code.js +1 -1
  87. package/lib/commands/project/create/use-install-dependencies.js +1 -1
  88. package/lib/commands/project/index.js +1 -1
  89. package/lib/commands/project/init.js +1 -1
  90. package/lib/commands/project/upgrade.js +1 -1
  91. package/lib/commands/registry.js +1 -1
  92. package/lib/commands/run/index.js +1 -1
  93. package/lib/commands/schema.js +1 -1
  94. package/lib/commands/skill/index.js +1 -1
  95. package/lib/commands/sql/detail.js +1 -1
  96. package/lib/commands/sql/exec.js +1 -1
  97. package/lib/commands/sql/index.js +1 -1
  98. package/lib/commands/sql/list.js +1 -1
  99. package/lib/commands/sql/pull.js +1 -1
  100. package/lib/commands/sql/save.js +1 -1
  101. package/lib/commands/sql/shared.js +1 -1
  102. package/lib/commands/sql/validate.js +1 -1
  103. package/lib/config/schema.js +1 -0
  104. package/lib/constant/cli.js +1 -1
  105. package/lib/constant/defaults.js +1 -0
  106. package/lib/constant/domain.js +1 -1
  107. package/lib/constant/env.js +1 -1
  108. package/lib/constant/output.js +1 -0
  109. package/lib/constant/paths.js +1 -1
  110. package/lib/constant/risk.js +1 -0
  111. package/lib/context.js +1 -1
  112. package/lib/core/alias-resolver.js +1 -1
  113. package/lib/core/api-client.js +1 -1
  114. package/lib/core/bff/config.js +1 -1
  115. package/lib/core/bff/file-system.js +1 -1
  116. package/lib/core/bff/hash.js +1 -1
  117. package/lib/core/bff/lock.js +1 -1
  118. package/lib/core/bff/utils.js +1 -1
  119. package/lib/core/db-resolver.js +1 -1
  120. package/lib/core/sql-validator.js +1 -1
  121. package/lib/errors.js +1 -1
  122. package/lib/framework/build-all-flags.js +1 -1
  123. package/lib/framework/flags.js +1 -1
  124. package/lib/framework/help.js +1 -1
  125. package/lib/framework/index.js +1 -1
  126. package/lib/framework/output.js +1 -1
  127. package/lib/framework/response.js +1 -1
  128. package/lib/framework/runner-alias.js +1 -0
  129. package/lib/framework/runner.js +1 -1
  130. package/lib/framework/schema-export.js +1 -1
  131. package/lib/framework/types.js +1 -1
  132. package/lib/generated/build-info.js +1 -1
  133. package/lib/help.js +1 -1
  134. package/lib/skills/main.js +1 -1
  135. package/lib/skills/npx-skills-add.js +1 -1
  136. package/lib/telemetry/cli-command-trace.js +1 -1
  137. package/lib/telemetry/cli-help-trace.js +1 -1
  138. package/lib/telemetry/ensure-cli-otel-config.js +1 -1
  139. package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
  140. package/lib/telemetry/send-cli-trace-log.js +1 -1
  141. package/lib/utils/ai_config.js +1 -1
  142. package/lib/utils/apply-jq-filter.js +1 -1
  143. package/lib/utils/cdn-config.js +1 -1
  144. package/lib/utils/check-sdk-version.js +1 -1
  145. package/lib/utils/cli-version-check.js +1 -1
  146. package/lib/utils/config.js +1 -1
  147. package/lib/utils/copy-directory.js +1 -1
  148. package/lib/utils/file-utils.js +1 -1
  149. package/lib/utils/guides-cdn.js +1 -1
  150. package/lib/utils/http-client.js +1 -1
  151. package/lib/utils/is-non-interactive.js +1 -1
  152. package/lib/utils/logger.js +1 -1
  153. package/lib/utils/platform.js +1 -1
  154. package/lib/utils/rules-cdn.js +1 -1
  155. package/lib/utils/sleep.js +1 -1
  156. package/lib/utils/template-replacer.js +1 -1
  157. package/lib/utils/version.js +1 -1
  158. package/lib/utils/with-active-cookie.js +1 -1
  159. package/lib/utils/write-cli-side-channel.js +1 -1
  160. package/package.json +3 -2
  161. package/lib/commands/api/doc.js +0 -1
  162. package/lib/commands/app/remote.js +0 -1
@@ -1 +1 @@
1
- const a87_0x2b2bd5=a87_0x55e1;(function(_0x6be44f,_0x2b60ec){const _0xbc2ef2=a87_0x55e1,_0x3360fc=_0x6be44f();while(!![]){try{const _0x5b7f9d=parseInt(_0xbc2ef2(0x216))/0x1*(-parseInt(_0xbc2ef2(0x1f9))/0x2)+parseInt(_0xbc2ef2(0x1f4))/0x3*(parseInt(_0xbc2ef2(0x1fa))/0x4)+parseInt(_0xbc2ef2(0x204))/0x5+-parseInt(_0xbc2ef2(0x202))/0x6*(-parseInt(_0xbc2ef2(0x206))/0x7)+parseInt(_0xbc2ef2(0x20c))/0x8+parseInt(_0xbc2ef2(0x207))/0x9+-parseInt(_0xbc2ef2(0x20e))/0xa;if(_0x5b7f9d===_0x2b60ec)break;else _0x3360fc['push'](_0x3360fc['shift']());}catch(_0x49e7a3){_0x3360fc['push'](_0x3360fc['shift']());}}}(a87_0x4202,0xc5966));function a87_0x55e1(_0x241b68,_0x556c7c){_0x241b68=_0x241b68-0x1f3;const _0x42020c=a87_0x4202();let _0x55e14e=_0x42020c[_0x241b68];return _0x55e14e;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';function a87_0x4202(){const _0x246684=['Target\x20environment','project-name','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','Usage:\x20','bool','yes','trim','2235456DZhRoP','env','6683945xrLmId','appcode','28RuSKCf','12848949XncqEs','str','init','name','Auto-confirm\x20prompts','8986920JOaUWY','nonInteractive','48542350aYIjfL','Project\x20name','Skip\x20confirmation\x20prompt','upgrade','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','../../commands/project/create/non-interactive.js','App\x20code\x20to\x20initialize','boolean','478823ujEDVg','write','string','Create\x20a\x20new\x20project','validation','176367SVmFUQ','Initialize\x20.rabetbase.json\x20config\x20in\x20existing\x20project','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','project','cookie','2WSjflk','52GihWpz'];a87_0x4202=function(){return _0x246684;};return a87_0x4202();}const initFlags=[{'name':a87_0x2b2bd5(0x205),'type':a87_0x2b2bd5(0x218),'description':a87_0x2b2bd5(0x214)},{'name':a87_0x2b2bd5(0x203),'type':a87_0x2b2bd5(0x218),'description':a87_0x2b2bd5(0x1fb)},{'name':a87_0x2b2bd5(0x200),'type':a87_0x2b2bd5(0x215),'description':a87_0x2b2bd5(0x20b),'default':![]}],createFlags=[{'name':a87_0x2b2bd5(0x20a),'type':'string','description':a87_0x2b2bd5(0x20f)},{'name':'env','type':a87_0x2b2bd5(0x218),'description':a87_0x2b2bd5(0x1fb)},{'name':a87_0x2b2bd5(0x205),'type':'string','description':a87_0x2b2bd5(0x1f6)}],upgradeFlags=[{'name':a87_0x2b2bd5(0x200),'type':a87_0x2b2bd5(0x215),'description':a87_0x2b2bd5(0x210),'default':![]}];export const projectDefinitions=[{'service':a87_0x2b2bd5(0x1f7),'command':a87_0x2b2bd5(0x209),'description':a87_0x2b2bd5(0x1f5),'risk':a87_0x2b2bd5(0x217),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initFlags,async 'execute'(_0x29f4d){const _0x7881c7=a87_0x2b2bd5;return await initConfig({'appcode':_0x29f4d[_0x7881c7(0x208)](_0x7881c7(0x205))||undefined,'env':_0x29f4d[_0x7881c7(0x208)]('env')||undefined,'autoYes':_0x29f4d['bool']('yes')}),{'ok':!![]};}},{'service':a87_0x2b2bd5(0x1f7),'command':'create','description':a87_0x2b2bd5(0x219),'risk':a87_0x2b2bd5(0x217),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a87_0x2b2bd5(0x1fc),'description':a87_0x2b2bd5(0x1fd),'required':![]}],'flags':createFlags,async 'execute'(_0xa8ae13){const _0x112e83=a87_0x2b2bd5,{createApp:_0x135dc2}=await import('../../commands/project/create/main.js'),{createProjectNonInteractive:_0x37725a}=await import(_0x112e83(0x213)),_0x3a8b32=_0xa8ae13[_0x112e83(0x208)](_0x112e83(0x20a))[_0x112e83(0x201)]()||_0xa8ae13['args'][0x0]?.[_0x112e83(0x201)](),_0x217ab9=_0xa8ae13[_0x112e83(0x208)]('env')||undefined,_0x1ce53e=_0xa8ae13['str']('appcode')||undefined;if(_0xa8ae13[_0x112e83(0x20d)]){if(!_0x3a8b32)throw CliErrors[_0x112e83(0x1f3)](_0x112e83(0x212),_0x112e83(0x1fe)+CLI_BIN_NAME+'\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]');await _0x37725a(_0x3a8b32,_0x217ab9,_0x1ce53e,_0xa8ae13[_0x112e83(0x1f8)]);}else await _0x135dc2({'projectCode':_0x3a8b32,'appCode':_0x1ce53e,'env':_0x217ab9,'cookie':_0xa8ae13[_0x112e83(0x1f8)]});return{'ok':!![]};}},{'service':a87_0x2b2bd5(0x1f7),'command':a87_0x2b2bd5(0x211),'description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','risk':a87_0x2b2bd5(0x217),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x36e7c5){const _0x3ee257=a87_0x2b2bd5;return await upgradeApp(_0x36e7c5[_0x3ee257(0x20d)],{'yes':_0x36e7c5[_0x3ee257(0x1ff)]('yes')}),{'ok':!![]};}}];
1
+ const a88_0x1f09b9=a88_0x4e1b;(function(_0x322016,_0x2346f1){const _0x4dccef=a88_0x4e1b,_0x3185e8=_0x322016();while(!![]){try{const _0x3325da=-parseInt(_0x4dccef(0x8a))/0x1*(parseInt(_0x4dccef(0x91))/0x2)+parseInt(_0x4dccef(0x75))/0x3*(parseInt(_0x4dccef(0x82))/0x4)+-parseInt(_0x4dccef(0x7f))/0x5+-parseInt(_0x4dccef(0x88))/0x6*(-parseInt(_0x4dccef(0x81))/0x7)+parseInt(_0x4dccef(0x8c))/0x8+parseInt(_0x4dccef(0x76))/0x9+parseInt(_0x4dccef(0x87))/0xa*(-parseInt(_0x4dccef(0x7d))/0xb);if(_0x3325da===_0x2346f1)break;else _0x3185e8['push'](_0x3185e8['shift']());}catch(_0x128b56){_0x3185e8['push'](_0x3185e8['shift']());}}}(a88_0xa452,0xcf18b));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a88_0xa452(){const _0x34417f=['string','Target\x20environment','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','1662753bznLHi','6095052NZLfyj','write','Project\x20name','appcode','upgrade','Auto-confirm\x20prompts','Create\x20a\x20new\x20project','25265526TlRivy','str','2520935GCFekq','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','427FMivpy','12aBsyYk','bool','project-name','Initialize\x20.rabetbase.json\x20config\x20in\x20existing\x20project','Usage:\x20','10CdsmTN','114702XFRcbc','env','2BBWJaW','boolean','5046720MpAdSv','nonInteractive','../../commands/project/create/non-interactive.js','yes','trim','487638tjgRWb','project','../../commands/project/create/main.js','name','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','cookie','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.'];a88_0xa452=function(){return _0x34417f;};return a88_0xa452();}function a88_0x4e1b(_0x535a5f,_0x28ecd8){_0x535a5f=_0x535a5f-0x6c;const _0xa452cc=a88_0xa452();let _0x4e1b9b=_0xa452cc[_0x535a5f];return _0x4e1b9b;}import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';const initFlags=[{'name':a88_0x1f09b9(0x79),'type':a88_0x1f09b9(0x72),'description':'App\x20code\x20to\x20initialize'},{'name':a88_0x1f09b9(0x89),'type':a88_0x1f09b9(0x72),'description':a88_0x1f09b9(0x73)},{'name':a88_0x1f09b9(0x8f),'type':a88_0x1f09b9(0x8b),'description':a88_0x1f09b9(0x7b),'default':![]}],createFlags=[{'name':a88_0x1f09b9(0x6d),'type':a88_0x1f09b9(0x72),'description':a88_0x1f09b9(0x78)},{'name':a88_0x1f09b9(0x89),'type':a88_0x1f09b9(0x72),'description':'Target\x20environment'},{'name':a88_0x1f09b9(0x79),'type':a88_0x1f09b9(0x72),'description':a88_0x1f09b9(0x6e)}],upgradeFlags=[{'name':a88_0x1f09b9(0x8f),'type':a88_0x1f09b9(0x8b),'description':'Skip\x20confirmation\x20prompt','default':![]}];export const projectDefinitions=[{'service':a88_0x1f09b9(0x92),'command':'init','description':a88_0x1f09b9(0x85),'risk':a88_0x1f09b9(0x77),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initFlags,async 'execute'(_0x18ad9d){const _0x9a24e=a88_0x1f09b9;return await initConfig({'appcode':_0x18ad9d[_0x9a24e(0x7e)](_0x9a24e(0x79))||undefined,'env':_0x18ad9d[_0x9a24e(0x7e)](_0x9a24e(0x89))||undefined,'autoYes':_0x18ad9d[_0x9a24e(0x83)](_0x9a24e(0x8f))}),{'ok':!![]};}},{'service':a88_0x1f09b9(0x92),'command':'create','description':a88_0x1f09b9(0x7c),'risk':a88_0x1f09b9(0x77),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a88_0x1f09b9(0x84),'description':a88_0x1f09b9(0x80),'required':![]}],'flags':createFlags,async 'execute'(_0x3adb57){const _0x24fa39=a88_0x1f09b9,{createApp:_0x34158b}=await import(_0x24fa39(0x6c)),{createProjectNonInteractive:_0x54b384}=await import(_0x24fa39(0x8e)),_0x519660=_0x3adb57['str'](_0x24fa39(0x6d))[_0x24fa39(0x90)]()||_0x3adb57['args'][0x0]?.[_0x24fa39(0x90)](),_0x215124=_0x3adb57[_0x24fa39(0x7e)](_0x24fa39(0x89))||undefined,_0x593c29=_0x3adb57[_0x24fa39(0x7e)](_0x24fa39(0x79))||undefined;if(_0x3adb57[_0x24fa39(0x8d)]){if(!_0x519660)throw CliErrors['validation'](_0x24fa39(0x71),_0x24fa39(0x86)+CLI_BIN_NAME+_0x24fa39(0x74));await _0x54b384(_0x519660,_0x215124,_0x593c29,_0x3adb57[_0x24fa39(0x6f)]);}else await _0x34158b({'projectCode':_0x519660,'appCode':_0x593c29,'env':_0x215124,'cookie':_0x3adb57['cookie']});return{'ok':!![]};}},{'service':'project','command':a88_0x1f09b9(0x7a),'description':a88_0x1f09b9(0x70),'risk':a88_0x1f09b9(0x77),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x17c35f){const _0x166c8f=a88_0x1f09b9;return await upgradeApp(_0x17c35f[_0x166c8f(0x8d)],{'yes':_0x17c35f[_0x166c8f(0x83)](_0x166c8f(0x8f))}),{'ok':!![]};}}];
@@ -1 +1 @@
1
- (function(_0xdd6991,_0x5b9958){const _0x5a3280=a88_0x6128,_0x1ee2e9=_0xdd6991();while(!![]){try{const _0xab0d4f=parseInt(_0x5a3280(0x13f))/0x1+-parseInt(_0x5a3280(0x156))/0x2*(parseInt(_0x5a3280(0x15e))/0x3)+parseInt(_0x5a3280(0x136))/0x4+-parseInt(_0x5a3280(0x15a))/0x5*(parseInt(_0x5a3280(0x14d))/0x6)+parseInt(_0x5a3280(0x13a))/0x7*(parseInt(_0x5a3280(0x133))/0x8)+parseInt(_0x5a3280(0x13d))/0x9+parseInt(_0x5a3280(0x139))/0xa*(parseInt(_0x5a3280(0x15c))/0xb);if(_0xab0d4f===_0x5b9958)break;else _0x1ee2e9['push'](_0x1ee2e9['shift']());}catch(_0x1bc21d){_0x1ee2e9['push'](_0x1ee2e9['shift']());}}}(a88_0x426e,0x3d85a));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';function a88_0x6128(_0x2a8bec,_0x6ed2ac){_0x2a8bec=_0x2a8bec-0x132;const _0x426ee8=a88_0x426e();let _0x6128b5=_0x426ee8[_0x2a8bec];return _0x6128b5;}import a88_0x41df03 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';export async function initConfig(_0x254297){const _0x38c78a=a88_0x6128,{appcode:_0x4c2a52,env:_0x5d4f50,autoYes:_0x2325bc}=_0x254297,_0x85ed9=process[_0x38c78a(0x147)]();if(getProjectConfigPath())throw new Error('.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.');let _0x162767;for(const _0xdadac5 of LEGACY_CONFIG_NAMES){const _0x32be33=resolve(_0x85ed9,_0xdadac5);if(existsSync(_0x32be33)){_0x162767=_0x32be33;break;}}if(_0x162767){let _0x32edae={};try{_0x32edae=JSON[_0x38c78a(0x13b)](readFileSync(_0x162767,_0x38c78a(0x135)));}catch{}const _0x5d4a61=basename(_0x162767),_0x2c3cbc=_0x32edae?.[_0x38c78a(0x159)]||_0x32edae?.['app'];let _0xa1c87e=_0x2325bc;!_0x2325bc&&(console[_0x38c78a(0x144)](a88_0x41df03[_0x38c78a(0x158)](_0x38c78a(0x157)+a88_0x41df03[_0x38c78a(0x14b)](_0x5d4a61))),_0x2c3cbc&&console[_0x38c78a(0x144)](a88_0x41df03[_0x38c78a(0x15b)]('\x20\x20appcode:\x20'+_0x2c3cbc)),_0xa1c87e=await confirm({'message':_0x38c78a(0x145)+a88_0x41df03[_0x38c78a(0x14b)](_0x38c78a(0x15d))+'?\x20(Old\x20file\x20→\x20*.bak)','default':!![]}));if(!_0xa1c87e){console[_0x38c78a(0x144)]('Migration\x20cancelled.\x20Run\x20`'+CLI_BIN_NAME+'\x20project\x20init`\x20to\x20start\x20fresh.');return;}const _0x3b596d=resolve(_0x85ed9,NEW_CONFIG_NAME),_0x15acea=getCliVersionFromPkg(),_0x4960ea=readRawConfig(),_0x24e9a1={..._0x4960ea,..._0x32edae,'version':_0x15acea,'migratedAt':new Date()['toLocaleString'](),'migratedFrom':_0x162767};if(!_0x24e9a1[_0x38c78a(0x159)]&&!_0x24e9a1[_0x38c78a(0x149)]){if(!_0x4c2a52){const _0x57866c=await askAppcode();_0x24e9a1[_0x38c78a(0x159)]=_0x57866c;}else _0x24e9a1['appcode']=_0x4c2a52;}if(_0x24e9a1['env']&&typeof _0x24e9a1[_0x38c78a(0x142)]!=='string')delete _0x24e9a1[_0x38c78a(0x142)];else!_0x24e9a1[_0x38c78a(0x142)]&&(_0x24e9a1[_0x38c78a(0x142)]=_0x4960ea[_0x38c78a(0x142)]||_0x38c78a(0x148));writeConfigFile(_0x3b596d,_0x24e9a1);const _0x451ff3=_0x162767+_0x38c78a(0x14a);renameSync(_0x162767,_0x451ff3),logger['setLogPath'](_0x85ed9),logger['info'](_0x38c78a(0x13c),'从旧配置文件升级成功',{'from':_0x162767,'to':_0x3b596d,'appcode':_0x24e9a1[_0x38c78a(0x159)]||_0x24e9a1[_0x38c78a(0x149)],'env':_0x24e9a1[_0x38c78a(0x142)]}),console[_0x38c78a(0x144)](a88_0x41df03[_0x38c78a(0x137)](_0x38c78a(0x13e)+_0x5d4a61+'\x20→\x20.rabetbase.json')),console[_0x38c78a(0x144)](a88_0x41df03['cyan'](_0x38c78a(0x134)+(_0x24e9a1[_0x38c78a(0x159)]||_0x24e9a1[_0x38c78a(0x149)]))),console[_0x38c78a(0x144)](a88_0x41df03['gray'](_0x38c78a(0x146)+_0x5d4a61+'.bak'));return;}const _0x2bae0c=_0x4c2a52||await askAppcode(),_0x285b75=resolve(_0x85ed9,NEW_CONFIG_NAME),_0x240a41=getCliVersionFromPkg(),_0x358c4e=readRawConfig(),_0x2061a0=typeof _0x358c4e[_0x38c78a(0x142)]===_0x38c78a(0x160)?_0x358c4e[_0x38c78a(0x142)]:undefined,_0x3429bc={'version':_0x240a41,'createdAt':new Date()[_0x38c78a(0x152)](),'appcode':_0x2bae0c,'env':_0x5d4f50||_0x2061a0||_0x38c78a(0x148)};writeConfigFile(_0x285b75,_0x3429bc),logger['setLogPath'](_0x85ed9),logger[_0x38c78a(0x143)](_0x38c78a(0x13c),_0x38c78a(0x14e),{'appcode':_0x3429bc[_0x38c78a(0x159)],'env':_0x3429bc[_0x38c78a(0x142)],'version':_0x3429bc[_0x38c78a(0x151)],'configPath':_0x285b75}),console[_0x38c78a(0x144)](a88_0x41df03[_0x38c78a(0x137)](_0x38c78a(0x140))),console['log'](a88_0x41df03['cyan']('\x20\x20AppCode:\x20'+_0x2bae0c)),console[_0x38c78a(0x144)](_0x38c78a(0x132)+CLI_BIN_NAME+_0x38c78a(0x14f)+CLI_BIN_NAME+_0x38c78a(0x14c));}function askAppcode(){const _0x3f4555=a88_0x6128;return input({'message':_0x3f4555(0x153),'validate':_0xfd11d5=>{const _0x5781b5=_0x3f4555;if(!_0xfd11d5[_0x5781b5(0x15f)]())return _0x5781b5(0x141);const {valid:_0x57c942,message:_0x233b23}=validateAppcode(_0xfd11d5[_0x5781b5(0x15f)]());return _0x57c942||_0x233b23||_0x5781b5(0x138);}});}function getCliVersionFromPkg(){const _0x3e8c77=a88_0x6128;try{const _0x4fa1a2=fileURLToPath(import.meta.url),_0x48f704=resolve(dirname(_0x4fa1a2),_0x3e8c77(0x154)),_0x112488=JSON[_0x3e8c77(0x13b)](readFileSync(resolve(_0x48f704,_0x3e8c77(0x150)),'utf8'));return _0x112488[_0x3e8c77(0x151)]||_0x3e8c77(0x155);}catch{return'1.0.0';}}function a88_0x426e(){const _0x147577=['Upgrade\x20it\x20to\x20','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','cwd','production','app','.bak','bold','\x20api\x20pull\x27','29844XYleNk','初始化项目配置文件成功','\x20api\x20doc\x27\x20and\x20\x27','package.json','version','toLocaleString','Please\x20enter\x20App\x20Code:','../..','1.0.0','1620SYdKOE','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','yellow','appcode','215UDVNGa','cyan','11aAmWQm','.rabetbase.json','1359wkIngA','trim','string','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','632BTIHnG','\x20\x20AppCode:\x20','utf8','143752uBodxO','green','Invalid\x20App\x20Code','600410LhyoIx','22148GFtizF','parse','init','90576DzCIbb','✓\x20Upgraded\x20','476807zPJSmW','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory','App\x20Code\x20cannot\x20be\x20empty','env','info','log'];a88_0x426e=function(){return _0x147577;};return a88_0x426e();}
1
+ (function(_0x4e530f,_0x1ee817){const _0x517a7f=a89_0x4843,_0x598ea4=_0x4e530f();while(!![]){try{const _0x4cfb4b=-parseInt(_0x517a7f(0x154))/0x1+parseInt(_0x517a7f(0x151))/0x2*(parseInt(_0x517a7f(0x156))/0x3)+-parseInt(_0x517a7f(0x160))/0x4*(-parseInt(_0x517a7f(0x142))/0x5)+-parseInt(_0x517a7f(0x13b))/0x6*(-parseInt(_0x517a7f(0x13e))/0x7)+-parseInt(_0x517a7f(0x16e))/0x8*(parseInt(_0x517a7f(0x13a))/0x9)+parseInt(_0x517a7f(0x159))/0xa*(parseInt(_0x517a7f(0x13d))/0xb)+parseInt(_0x517a7f(0x146))/0xc*(-parseInt(_0x517a7f(0x16c))/0xd);if(_0x4cfb4b===_0x1ee817)break;else _0x598ea4['push'](_0x598ea4['shift']());}catch(_0x1d8e7c){_0x598ea4['push'](_0x598ea4['shift']());}}}(a89_0x5880,0x46d6f));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';function a89_0x5880(){const _0x24758c=['578270OgWOjH','139979jZZDQc','cyan','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','初始化项目配置文件成功','405qmSMxV','Upgrade\x20it\x20to\x20','App\x20Code\x20cannot\x20be\x20empty','.rabetbase.json','12haXnNr','\x20api\x20generate\x27\x20and\x20\x27','string','toLocaleString','init','bold','green','setLogPath','parse','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','Migration\x20cancelled.\x20Run\x20`','174644IdvrvN','\x20api\x20pull\x27','yellow','181777TziIGl','apps','18NqvlUF','../..','Please\x20enter\x20App\x20Code:','90FAQbSY','\x20→\x20.rabetbase.json','app','\x20\x20Default:\x20','utf8','log','package.json','856dxRuzR','✓\x20Upgraded\x20','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','appcode','\x20\x20Apps:\x20','info','join','defaultApp','version','keys','\x20project\x20init`\x20to\x20start\x20fresh.','?\x20(Old\x20file\x20→\x20*.bak)','8079929RBTiNM','\x20\x20appcode:\x20','1683408LfZiJR','从旧配置文件升级成功','.bak','gray','env','trim','18zjlCcx','150kjFeAt','Invalid\x20App\x20Code'];a89_0x5880=function(){return _0x24758c;};return a89_0x5880();}import a89_0x20d5f6 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(_0x4b8e89){const _0x155f41=a89_0x4843,{appcode:_0x5685a4,env:_0x186285,autoYes:_0x52bd84}=_0x4b8e89,_0x5a868f=process['cwd']();if(getProjectConfigPath())throw new Error('.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.');let _0x14eb13;for(const _0x5c0a0e of LEGACY_CONFIG_NAMES){const _0x52fa46=resolve(_0x5a868f,_0x5c0a0e);if(existsSync(_0x52fa46)){_0x14eb13=_0x52fa46;break;}}if(_0x14eb13){let _0xda1fe2={};try{_0xda1fe2=JSON[_0x155f41(0x14e)](readFileSync(_0x14eb13,_0x155f41(0x15d)));}catch{}const _0x791faa=basename(_0x14eb13),_0x1eae99=_0xda1fe2?.[_0x155f41(0x163)]||_0xda1fe2?.['app'];let _0x2cd11d=_0x52bd84;!_0x52bd84&&(console[_0x155f41(0x15e)](a89_0x20d5f6[_0x155f41(0x153)](_0x155f41(0x14f)+a89_0x20d5f6[_0x155f41(0x14b)](_0x791faa))),_0x1eae99&&console['log'](a89_0x20d5f6[_0x155f41(0x13f)](_0x155f41(0x16d)+_0x1eae99)),_0x2cd11d=await confirm({'message':_0x155f41(0x143)+a89_0x20d5f6[_0x155f41(0x14b)](_0x155f41(0x145))+_0x155f41(0x16b),'default':!![]}));if(!_0x2cd11d){console[_0x155f41(0x15e)](_0x155f41(0x150)+CLI_BIN_NAME+_0x155f41(0x16a));return;}const _0x3df2ab=resolve(_0x5a868f,NEW_CONFIG_NAME),_0x2aa145=getCliVersionFromPkg(),_0x157844=readRawConfig(),_0x4b4640=_0x5685a4||(typeof _0xda1fe2?.[_0x155f41(0x163)]===_0x155f41(0x148)?_0xda1fe2[_0x155f41(0x163)]:undefined)||(typeof _0xda1fe2?.['app']===_0x155f41(0x148)?_0xda1fe2[_0x155f41(0x15b)]:undefined)||await askAppcode(),_0x54984c=typeof _0xda1fe2?.[_0x155f41(0x138)]===_0x155f41(0x148)?_0xda1fe2[_0x155f41(0x138)]:typeof _0x157844['env']===_0x155f41(0x148)?_0x157844[_0x155f41(0x138)]:'production',_0x45a82a=buildCanonicalProjectConfig({..._0x157844,..._0xda1fe2},{'appCodes':[_0x4b4640],'env':_0x54984c,'metadata':{'version':_0x2aa145,'migratedAt':new Date()[_0x155f41(0x149)](),'migratedFrom':_0x14eb13}});writeConfigFile(_0x3df2ab,_0x45a82a);const _0x3b8bf0=_0x14eb13+_0x155f41(0x170);renameSync(_0x14eb13,_0x3b8bf0),logger[_0x155f41(0x14d)](_0x5a868f),logger[_0x155f41(0x165)]('init',_0x155f41(0x16f),{'from':_0x14eb13,'to':_0x3df2ab,'appcode':_0x4b4640,'env':_0x45a82a[_0x155f41(0x138)]}),console['log'](a89_0x20d5f6[_0x155f41(0x14c)](_0x155f41(0x161)+_0x791faa+_0x155f41(0x15a))),console['log'](a89_0x20d5f6[_0x155f41(0x13f)](_0x155f41(0x164)+Object[_0x155f41(0x169)](_0x45a82a[_0x155f41(0x155)]||{})[_0x155f41(0x166)](',\x20'))),console[_0x155f41(0x15e)](a89_0x20d5f6[_0x155f41(0x13f)](_0x155f41(0x15c)+_0x45a82a[_0x155f41(0x167)])),console[_0x155f41(0x15e)](a89_0x20d5f6[_0x155f41(0x171)](_0x155f41(0x140)+_0x791faa+_0x155f41(0x170)));return;}const _0x317d26=_0x5685a4||await askAppcode(),_0x1b7c7d=resolve(_0x5a868f,NEW_CONFIG_NAME),_0x76c5a2=getCliVersionFromPkg(),_0x3739da=readRawConfig(),_0x1c7d67=typeof _0x3739da[_0x155f41(0x138)]===_0x155f41(0x148)?_0x3739da['env']:undefined,_0x10c260=buildCanonicalProjectConfig({},{'appCodes':[_0x317d26],'env':_0x186285||_0x1c7d67||'production','metadata':{'version':_0x76c5a2,'createdAt':new Date()['toLocaleString']()}});writeConfigFile(_0x1b7c7d,_0x10c260),logger[_0x155f41(0x14d)](_0x5a868f),logger[_0x155f41(0x165)](_0x155f41(0x14a),_0x155f41(0x141),{'appcode':_0x317d26,'env':_0x10c260[_0x155f41(0x138)],'version':_0x10c260['version'],'configPath':_0x1b7c7d}),console[_0x155f41(0x15e)](a89_0x20d5f6[_0x155f41(0x14c)]('✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory')),console['log'](a89_0x20d5f6[_0x155f41(0x13f)](_0x155f41(0x164)+Object[_0x155f41(0x169)](_0x10c260[_0x155f41(0x155)]||{})[_0x155f41(0x166)](',\x20'))),console[_0x155f41(0x15e)](a89_0x20d5f6[_0x155f41(0x13f)](_0x155f41(0x15c)+_0x10c260[_0x155f41(0x167)])),console[_0x155f41(0x15e)](_0x155f41(0x162)+CLI_BIN_NAME+_0x155f41(0x147)+CLI_BIN_NAME+_0x155f41(0x152));}function askAppcode(){const _0x1ed8ff=a89_0x4843;return input({'message':_0x1ed8ff(0x158),'validate':_0x48030f=>{const _0x509a6c=_0x1ed8ff;if(!_0x48030f[_0x509a6c(0x139)]())return _0x509a6c(0x144);const {valid:_0x2a4009,message:_0x1c4203}=validateAppcode(_0x48030f['trim']());return _0x2a4009||_0x1c4203||_0x509a6c(0x13c);}});}function a89_0x4843(_0x312f1a,_0x5052cb){_0x312f1a=_0x312f1a-0x138;const _0x58802e=a89_0x5880();let _0x4843fa=_0x58802e[_0x312f1a];return _0x4843fa;}function getCliVersionFromPkg(){const _0x2aa5c0=a89_0x4843;try{const _0x5adff6=fileURLToPath(import.meta.url),_0x26fdf0=resolve(dirname(_0x5adff6),_0x2aa5c0(0x157)),_0x5ca36c=JSON[_0x2aa5c0(0x14e)](readFileSync(resolve(_0x26fdf0,_0x2aa5c0(0x15f)),_0x2aa5c0(0x15d)));return _0x5ca36c[_0x2aa5c0(0x168)]||'1.0.0';}catch{return'1.0.0';}}
@@ -1 +1 @@
1
- const a89_0x4e1fd9=a89_0x5b99;(function(_0x1c836a,_0x29a001){const _0x40a754=a89_0x5b99,_0x15781a=_0x1c836a();while(!![]){try{const _0x2237eb=parseInt(_0x40a754(0x178))/0x1+-parseInt(_0x40a754(0x1f3))/0x2+parseInt(_0x40a754(0x1c0))/0x3+-parseInt(_0x40a754(0x186))/0x4+-parseInt(_0x40a754(0x190))/0x5*(parseInt(_0x40a754(0x1eb))/0x6)+-parseInt(_0x40a754(0x197))/0x7+parseInt(_0x40a754(0x19b))/0x8;if(_0x2237eb===_0x29a001)break;else _0x15781a['push'](_0x15781a['shift']());}catch(_0x3c7f44){_0x15781a['push'](_0x15781a['shift']());}}}(a89_0x1450,0x5b6ed));import a89_0x1486b8 from'chalk';import a89_0x353349 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';function a89_0x5b99(_0x21e371,_0x28302a){_0x21e371=_0x21e371-0x175;const _0x14505e=a89_0x1450();let _0x5b9917=_0x14505e[_0x21e371];return _0x5b9917;}import{runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a89_0x4e1fd9(0x1cc)](_0x566993=>_0x566993!==NEW_CONFIG_NAME);function a89_0x1450(){const _0x34c4f7=['Proceed\x20with\x20upgrade?','some','FAIL','detail','\x20\x20bun\x20install','none\x20found','.cursor/mcp.json','no\x20legacy\x20config\x20found','\x20→\x20latest','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','\x20(backup:\x20','CANCEL','@lovrabet/sdk','sdkUpgrade','dependencies','Step\x205/7:\x20Removing\x20old\x20skill...','utf8','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','\x20removed\x20(','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','bold','entries','fail','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','FOUND','status','Config\x20file:','\x20→\x20keys:\x20','log','exit\x20','cwd','1542822KCrlmL','white','info','@lovrabet/dataset-mcp-server','not\x20found\x20(will\x20create)','isDirectory','[\x22@lovrabet/sdk\x22]:\x20','lovrabet/rabetbase\x20installed\x20globally','.cursor/rules/lovrabet_rules.mdc','hasNewConfig','undefined','cyan','filter','devDependencies','succeed','\x20from\x20','parse','string','===\x20Upgrade\x20Analysis\x20===','gray','message','step','join','Upgrade\x20cancelled.','\x20\x20New\x20config\x20(.rabetbase.json):\x20','path','isArray','.lovrabet','\x20\x20Current\x20version\x20in\x20','Skill\x20swap:','done','green','includes','\x20\x20Fields\x20to\x20migrate:\x20','Step\x206/7:\x20Installing\x20new\x20skill...','Remove\x20legacy\x20artifacts','error','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','yellow','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','===\x20Upgrade\x20Summary\x20===','Step\x204/7:\x20MCP\x20config\x20—\x20','removed\x20','636ShchhY','Legacy\x20artifacts:','.bak','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','\x20→\x20','oldPath','files','1045628aVvGWy','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','lovrabet/rabetbase','red','658723iRsiLb','Config\x20migration','push','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20lovrabet/rabetbase\x20--global','\x20removed','length','Clean\x20MCP\x20config','keys','stringify','configMigration','mcpServers','oldMcpConfig','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','skipped\x20(no\x20legacy\x20config)','1601084IixBmN','latest','package.json','object','Remove\x20old\x20skill','Step\x201/7:\x20Config\x20migration\x20—\x20','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','args','\x20\x20#\x20or','oldArtifacts','21860Sysvvr','no\x20legacy\x20entry','Remove\x20.lovrabet/','already\x20exists\x20(will\x20merge)','failed','Upgrade\x20@lovrabet/sdk','start','3591693mGjXlf','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','lovrabet/lovrabet-skill\x20removed','Step\x204/7:\x20Cleaning\x20MCP\x20config...','8809024XRiydD','\x20\x20Step\x20','MCP\x20config:','Install\x20new\x20skill','values','@lovrabet/sdk:'];a89_0x1450=function(){return _0x34c4f7;};return a89_0x1450();}function collectIdeSkillFiles(_0x132862){const _0x340dd8=a89_0x4e1fd9,_0x13c7b8=[];for(const _0x3f659a of Object[_0x340dd8(0x19f)](CORE_IDE_CONFIGS)){if(_0x3f659a[_0x340dd8(0x1f2)])for(const _0x56ae59 of _0x3f659a[_0x340dd8(0x1f2)]){_0x13c7b8[_0x340dd8(0x17a)](resolve(_0x132862,_0x56ae59['path']));}}return _0x13c7b8;}function analyse(_0x3f0b37){const _0x892751=a89_0x4e1fd9;let _0x41b72f=null;const _0x2176dc=resolve(_0x3f0b37,NEW_CONFIG_NAME),_0xa35320=existsSync(_0x2176dc);for(const _0x34fd7f of LEGACY_CONFIG_NAMES){const _0x59c345=resolve(_0x3f0b37,_0x34fd7f);if(existsSync(_0x59c345)){const _0x3d56b2=readConfigFile(_0x59c345),_0x5b9cd7=Object[_0x892751(0x17f)](_0x3d56b2)[_0x892751(0x1cc)](_0x42f151=>typeof _0x3d56b2[_0x42f151]!==_0x892751(0x1ca));_0x41b72f={'oldPath':_0x59c345,'hasNewConfig':_0xa35320,'fields':_0x5b9cd7};break;}}const _0x29dee7=[],_0x2faacc=resolve(_0x3f0b37,_0x892751(0x1db));if(existsSync(_0x2faacc))_0x29dee7[_0x892751(0x17a)](_0x2faacc);const _0xfcd013=resolve(_0x3f0b37,_0x892751(0x1c8));if(existsSync(_0xfcd013))_0x29dee7['push'](_0xfcd013);const _0x4023bb=resolve(_0x3f0b37,'.claude/skills/lovrabet');if(existsSync(_0x4023bb))_0x29dee7[_0x892751(0x17a)](_0x4023bb);for(const _0x27f34b of collectIdeSkillFiles(_0x3f0b37)){if(existsSync(_0x27f34b))_0x29dee7[_0x892751(0x17a)](_0x27f34b);}let _0x5d9780=null;const _0x27c962=resolve(_0x3f0b37,_0x892751(0x1a7));if(existsSync(_0x27c962))try{const _0x305c98=JSON[_0x892751(0x1d0)](readFileSync(_0x27c962,'utf8'));if(_0x305c98?.[_0x892751(0x182)]&&typeof _0x305c98[_0x892751(0x182)]===_0x892751(0x189)){const _0x374bb3=[];for(const [_0x32298a,_0xa83eb6]of Object[_0x892751(0x1b6)](_0x305c98[_0x892751(0x182)])){const _0x245de8=_0xa83eb6;_0x245de8?.[_0x892751(0x18d)]&&Array['isArray'](_0x245de8[_0x892751(0x18d)])&&_0x245de8[_0x892751(0x18d)][_0x892751(0x1a2)](_0x542416=>typeof _0x542416==='string'&&_0x542416[_0x892751(0x1e0)](_0x892751(0x1c3)))&&_0x374bb3[_0x892751(0x17a)](_0x32298a);}_0x374bb3[_0x892751(0x17d)]>0x0&&(_0x5d9780={'path':_0x27c962,'keys':_0x374bb3});}}catch{}const _0x5c73be=_0x29dee7[_0x892751(0x17d)]>0x0||_0x41b72f!==null;let _0x3f104f=null;const _0x2c8207=resolve(_0x3f0b37,_0x892751(0x188));if(existsSync(_0x2c8207))try{const _0x19b79d=JSON[_0x892751(0x1d0)](readFileSync(_0x2c8207,_0x892751(0x1b1)));for(const _0xbec2e1 of[_0x892751(0x1af),_0x892751(0x1cd)]){const _0x47f088=_0x19b79d?.[_0xbec2e1]?.[_0x892751(0x1ad)];if(typeof _0x47f088===_0x892751(0x1d1)){_0x47f088!==_0x892751(0x187)&&(_0x3f104f={'pkgPath':_0x2c8207,'currentVersion':_0x47f088,'field':_0xbec2e1});break;}}}catch{}return{'configMigration':_0x41b72f,'oldArtifacts':_0x29dee7,'oldMcpConfig':_0x5d9780,'needsSkillSwap':_0x5c73be,'sdkUpgrade':_0x3f104f};}function printReport(_0x18786c){const _0x170932=a89_0x4e1fd9,{configMigration:_0x10e9c8,oldArtifacts:_0x3cfee1,oldMcpConfig:_0x2c96c1,needsSkillSwap:_0x3d3938}=_0x18786c;console[_0x170932(0x1bd)](''),console['log'](a89_0x1486b8[_0x170932(0x1b5)](_0x170932(0x1d2))),console[_0x170932(0x1bd)]('');_0x10e9c8?(console[_0x170932(0x1bd)](a89_0x1486b8[_0x170932(0x1cb)](_0x170932(0x1bb))+('\x20\x20'+a89_0x1486b8[_0x170932(0x1e6)](_0x10e9c8[_0x170932(0x1f1)]))),console[_0x170932(0x1bd)](_0x170932(0x1d8)+(_0x10e9c8[_0x170932(0x1c9)]?a89_0x1486b8[_0x170932(0x1df)](_0x170932(0x193)):a89_0x1486b8[_0x170932(0x1d3)](_0x170932(0x1c4)))),console[_0x170932(0x1bd)](_0x170932(0x1e1)+_0x10e9c8['fields'][_0x170932(0x1d6)](',\x20')),console['log'](_0x170932(0x1e7))):console[_0x170932(0x1bd)](a89_0x1486b8[_0x170932(0x1cb)](_0x170932(0x1bb))+'\x20\x20'+a89_0x1486b8['gray'](_0x170932(0x1a8)));console[_0x170932(0x1bd)]('');if(_0x3cfee1['length']>0x0){console['log'](a89_0x1486b8[_0x170932(0x1cb)](_0x170932(0x1ec)));for(const _0x1b355c of _0x3cfee1){console['log']('\x20\x20'+a89_0x1486b8[_0x170932(0x177)](_0x170932(0x1b9))+'\x20\x20'+_0x1b355c);}console[_0x170932(0x1bd)]('\x20\x20Action:\x20delete');}else console[_0x170932(0x1bd)](a89_0x1486b8[_0x170932(0x1cb)](_0x170932(0x1ec))+'\x20\x20'+a89_0x1486b8['gray'](_0x170932(0x1a6)));console[_0x170932(0x1bd)]('');_0x2c96c1?(console[_0x170932(0x1bd)](a89_0x1486b8[_0x170932(0x1cb)](_0x170932(0x19d))+('\x20\x20'+a89_0x1486b8[_0x170932(0x1e6)](_0x2c96c1['path'])+_0x170932(0x1bc)+_0x2c96c1[_0x170932(0x17f)][_0x170932(0x1d6)](',\x20'))),console[_0x170932(0x1bd)](_0x170932(0x1e5))):console[_0x170932(0x1bd)](a89_0x1486b8[_0x170932(0x1cb)](_0x170932(0x19d))+'\x20\x20'+a89_0x1486b8[_0x170932(0x1d3)](_0x170932(0x191)));console[_0x170932(0x1bd)](''),console[_0x170932(0x1bd)](a89_0x1486b8['cyan'](_0x170932(0x1dd))+('\x20\x20'+(_0x3d3938?a89_0x1486b8[_0x170932(0x1e6)]('needed'):a89_0x1486b8[_0x170932(0x1df)]('not\x20needed'))));_0x3d3938&&console[_0x170932(0x1bd)](_0x170932(0x17b));console[_0x170932(0x1bd)]('');if(_0x18786c[_0x170932(0x1ae)]){const {currentVersion:_0xc58510,field:_0x1d13da,pkgPath:_0x2155f7}=_0x18786c[_0x170932(0x1ae)];console[_0x170932(0x1bd)](a89_0x1486b8['cyan'](_0x170932(0x1a0))+('\x20\x20'+a89_0x1486b8[_0x170932(0x1e6)](_0x2155f7))),console[_0x170932(0x1bd)](_0x170932(0x1dc)+_0x1d13da+':\x20'+a89_0x1486b8[_0x170932(0x1e6)](_0xc58510)+_0x170932(0x1f0)+a89_0x1486b8['green']('latest')),console[_0x170932(0x1bd)]('\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)');}else console[_0x170932(0x1bd)](a89_0x1486b8[_0x170932(0x1cb)]('@lovrabet/sdk:')+'\x20\x20'+a89_0x1486b8[_0x170932(0x1d3)]('not\x20found\x20or\x20already\x20at\x20latest'));console[_0x170932(0x1bd)]('');}function execConfigMigration(_0x3f664a,_0x10cba4){const _0x437883=a89_0x4e1fd9,{configMigration:_0x103b23}=_0x3f664a;if(!_0x103b23?.['oldPath'])return{'step':0x1,'label':_0x437883(0x179),'ok':!![],'detail':_0x437883(0x185)};const _0x141248=readConfigFile(_0x103b23[_0x437883(0x1f1)]),_0x3d3656=resolve(_0x10cba4,NEW_CONFIG_NAME),_0xd4b20f=_0x103b23[_0x437883(0x1c9)]?readConfigFile(_0x3d3656):{};for(const [_0x3fb7d0,_0x1c269b]of Object[_0x437883(0x1b6)](_0x141248)){!(_0x3fb7d0 in _0xd4b20f)&&(_0xd4b20f[_0x3fb7d0]=_0x1c269b);}writeConfigFile(_0x3d3656,_0xd4b20f);const _0x55bfc9=_0x103b23[_0x437883(0x1f1)]+_0x437883(0x1ed);return renameSync(_0x103b23[_0x437883(0x1f1)],_0x55bfc9),{'step':0x1,'label':_0x437883(0x179),'ok':!![],'detail':_0x103b23[_0x437883(0x1f1)]+_0x437883(0x1f0)+_0x3d3656+_0x437883(0x1ab)+_0x55bfc9+')'};}function execRemoveOldArtifacts(_0xd0ca7e){const _0xe1e3a1=a89_0x4e1fd9,_0x11354d=[];for(const _0x29568b of _0xd0ca7e){try{if(!existsSync(_0x29568b))continue;const _0x39c02a=tryStat(_0x29568b);_0x39c02a?.[_0xe1e3a1(0x1c5)]()?rmSync(_0x29568b,{'recursive':!![],'force':!![]}):unlinkSync(_0x29568b);}catch(_0x25c6ff){_0x11354d['push'](_0x29568b+':\x20'+_0x25c6ff[_0xe1e3a1(0x1d4)]);}}return{'step':0x3,'label':_0xe1e3a1(0x1e3),'ok':_0x11354d['length']===0x0,'detail':_0x11354d[_0xe1e3a1(0x17d)]>0x0?_0xd0ca7e[_0xe1e3a1(0x17d)]-_0x11354d[_0xe1e3a1(0x17d)]+'/'+_0xd0ca7e['length']+_0xe1e3a1(0x1b3)+_0x11354d['join'](';\x20')+')':_0xd0ca7e[_0xe1e3a1(0x17d)]+_0xe1e3a1(0x17c)};}function execCleanMcp(_0x1a179c){const _0x25aa64=a89_0x4e1fd9;if(!_0x1a179c[_0x25aa64(0x183)])return{'step':0x4,'label':_0x25aa64(0x17e),'ok':!![],'detail':'skipped'};try{const _0x1a32fb=readFileSync(_0x1a179c[_0x25aa64(0x183)]['path'],_0x25aa64(0x1b1)),_0x40472b=JSON[_0x25aa64(0x1d0)](_0x1a32fb);if(_0x40472b?.[_0x25aa64(0x182)]&&typeof _0x40472b['mcpServers']===_0x25aa64(0x189)){const _0x5988a8=[];for(const [_0x17f10b,_0x26362d]of Object[_0x25aa64(0x1b6)](_0x40472b[_0x25aa64(0x182)])){_0x26362d?.[_0x25aa64(0x18d)]&&Array[_0x25aa64(0x1da)](_0x26362d[_0x25aa64(0x18d)])&&_0x26362d[_0x25aa64(0x18d)]['some'](_0x2fef6b=>typeof _0x2fef6b===_0x25aa64(0x1d1)&&_0x2fef6b[_0x25aa64(0x1e0)](_0x25aa64(0x1c3)))&&_0x5988a8[_0x25aa64(0x17a)](_0x17f10b);}for(const _0x5a9937 of _0x5988a8){delete _0x40472b[_0x25aa64(0x182)][_0x5a9937];}return _0x5988a8[_0x25aa64(0x17d)]>0x0&&writeFileSync(_0x1a179c['oldMcpConfig'][_0x25aa64(0x1d9)],JSON[_0x25aa64(0x180)](_0x40472b,null,0x2)+'\x0a',_0x25aa64(0x1b1)),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x25aa64(0x1ea)+_0x5988a8[_0x25aa64(0x1d6)](',\x20')+_0x25aa64(0x1cf)+_0x1a179c[_0x25aa64(0x183)]['path']};}return{'step':0x4,'label':_0x25aa64(0x17e),'ok':!![],'detail':'no\x20matching\x20entry\x20found'};}catch(_0x519ad3){return{'step':0x4,'label':_0x25aa64(0x17e),'ok':![],'detail':_0x519ad3['message']};}}function execSkillsRemove(_0x377843,_0x231916){const _0x2a5843=a89_0x4e1fd9,_0xc8caef=runNpxSkillsRemove(_0x377843,{'stdio':'inherit','yes':_0x231916});return{'step':0x5,'label':_0x2a5843(0x18a),'ok':_0xc8caef['ok'],'detail':_0xc8caef['ok']?_0x2a5843(0x199):_0xc8caef['error']??'exit\x20'+_0xc8caef[_0x2a5843(0x1ba)]};}function execSkillsAdd(_0x46d7df,_0x5ab8ea){const _0x47155f=a89_0x4e1fd9,_0x39989a=runNpxSkillsAddGlobal(_0x46d7df,_0x47155f(0x176),{'stdio':'inherit','yes':_0x5ab8ea});return{'step':0x6,'label':_0x47155f(0x19e),'ok':_0x39989a['ok'],'detail':_0x39989a['ok']?_0x47155f(0x1c7):_0x39989a[_0x47155f(0x1e4)]??_0x47155f(0x1be)+_0x39989a[_0x47155f(0x1ba)]};}function execUpgradeSdk(_0x557bee){const _0x59fba6=a89_0x4e1fd9;if(!_0x557bee['sdkUpgrade'])return{'step':0x7,'label':_0x59fba6(0x195),'ok':!![],'detail':_0x59fba6(0x1b4)};const {pkgPath:_0x55f078,currentVersion:_0x47cdf6,field:_0x57a1af}=_0x557bee[_0x59fba6(0x1ae)];try{const _0x36896b=readFileSync(_0x55f078,_0x59fba6(0x1b1)),_0x5b489f=JSON[_0x59fba6(0x1d0)](_0x36896b);return _0x5b489f[_0x57a1af]['@lovrabet/sdk']=_0x59fba6(0x187),writeFileSync(_0x55f078,JSON[_0x59fba6(0x180)](_0x5b489f,null,0x2)+'\x0a','utf8'),{'step':0x7,'label':_0x59fba6(0x195),'ok':!![],'detail':_0x57a1af+_0x59fba6(0x1c6)+_0x47cdf6+_0x59fba6(0x1a9)};}catch(_0x5282e4){return{'step':0x7,'label':_0x59fba6(0x195),'ok':![],'detail':_0x5282e4[_0x59fba6(0x1d4)]};}}function tryStat(_0x21d726){try{return statSync(_0x21d726);}catch{return undefined;}}function printSummary(_0x1e0617){const _0x10d9b9=a89_0x4e1fd9;console[_0x10d9b9(0x1bd)](''),console[_0x10d9b9(0x1bd)](a89_0x1486b8[_0x10d9b9(0x1b5)](_0x10d9b9(0x1e8))),console['log']('');for(const _0x38455b of _0x1e0617){const _0x262067=_0x38455b['ok']?a89_0x1486b8['green']('OK'):a89_0x1486b8['red'](_0x10d9b9(0x1a3));console['log']('\x20\x20'+_0x262067+_0x10d9b9(0x19c)+_0x38455b[_0x10d9b9(0x1d5)]+':\x20'+_0x38455b['label']);if(_0x38455b[_0x10d9b9(0x1a4)])console[_0x10d9b9(0x1bd)]('\x20\x20\x20\x20\x20\x20\x20'+a89_0x1486b8[_0x10d9b9(0x1d3)](_0x38455b['detail']));}console[_0x10d9b9(0x1bd)]('');}export async function upgradeApp(_0x5aa5d4,_0x4a840f){const _0x2773d7=a89_0x4e1fd9,_0x379505=process[_0x2773d7(0x1bf)](),_0x34e2df=analyse(_0x379505),_0x343f6e=!_0x34e2df[_0x2773d7(0x181)]&&_0x34e2df[_0x2773d7(0x18f)][_0x2773d7(0x17d)]===0x0&&!_0x34e2df[_0x2773d7(0x183)]&&!_0x34e2df['needsSkillSwap']&&!_0x34e2df['sdkUpgrade'];if(_0x343f6e){console[_0x2773d7(0x1bd)](a89_0x1486b8['green'](_0x2773d7(0x1ee)));return;}printReport(_0x34e2df);const _0x3a08c3=!!(_0x4a840f['yes']||_0x4a840f['Y']||_0x5aa5d4);if(!_0x3a08c3)try{const _0x153c45=await askConfirm(_0x2773d7(0x1a1));if(!_0x153c45){console[_0x2773d7(0x1bd)](a89_0x1486b8['gray'](_0x2773d7(0x1d7)));return;}}catch(_0x2f6f9a){if(_0x2f6f9a?.[_0x2773d7(0x1d4)]===_0x2773d7(0x1ac)){console['log'](a89_0x1486b8['gray'](_0x2773d7(0x1d7)));return;}throw _0x2f6f9a;}const _0x6a19a3=[],_0x509704=a89_0x353349({'text':'Step\x201/7:\x20Migrating\x20config...','color':'cyan'})[_0x2773d7(0x196)](),_0x5ea09e=execConfigMigration(_0x34e2df,_0x379505);_0x6a19a3[_0x2773d7(0x17a)](_0x5ea09e),_0x509704[_0x5ea09e['ok']?_0x2773d7(0x1ce):_0x2773d7(0x1b7)](_0x2773d7(0x18b)+(_0x5ea09e[_0x2773d7(0x1a4)]??(_0x5ea09e['ok']?_0x2773d7(0x1de):_0x2773d7(0x194))));const _0x547c1e=resolve(_0x379505,'.lovrabet'),_0x536597=a89_0x353349({'text':_0x2773d7(0x18c),'color':'cyan'})[_0x2773d7(0x196)]();if(existsSync(_0x547c1e))try{rmSync(_0x547c1e,{'recursive':!![],'force':!![]}),_0x536597['succeed']('Step\x202/7:\x20.lovrabet/\x20directory\x20removed'),_0x6a19a3[_0x2773d7(0x17a)]({'step':0x2,'label':_0x2773d7(0x192),'ok':!![]});}catch(_0x1362ec){_0x536597[_0x2773d7(0x1b7)](_0x2773d7(0x1aa)+_0x1362ec[_0x2773d7(0x1d4)]),_0x6a19a3['push']({'step':0x2,'label':_0x2773d7(0x192),'ok':![],'detail':_0x1362ec['message']});}else _0x536597[_0x2773d7(0x1c2)](_0x2773d7(0x1b8)),_0x6a19a3[_0x2773d7(0x17a)]({'step':0x2,'label':_0x2773d7(0x192),'ok':!![],'detail':'skipped'});const _0x1dffc5=a89_0x353349({'text':'Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':_0x2773d7(0x1cb)})[_0x2773d7(0x196)](),_0x32b73e=execRemoveOldArtifacts(_0x34e2df[_0x2773d7(0x18f)]);_0x6a19a3[_0x2773d7(0x17a)](_0x32b73e),_0x1dffc5[_0x32b73e['ok']?_0x2773d7(0x1ce):_0x2773d7(0x1b7)](_0x2773d7(0x175)+(_0x32b73e[_0x2773d7(0x1a4)]??(_0x32b73e['ok']?_0x2773d7(0x1de):_0x2773d7(0x194))));const _0x3ef243=a89_0x353349({'text':_0x2773d7(0x19a),'color':_0x2773d7(0x1cb)})[_0x2773d7(0x196)](),_0x3aa26e=execCleanMcp(_0x34e2df);_0x6a19a3[_0x2773d7(0x17a)](_0x3aa26e),_0x3ef243[_0x3aa26e['ok']?_0x2773d7(0x1ce):'fail'](_0x2773d7(0x1e9)+(_0x3aa26e[_0x2773d7(0x1a4)]??(_0x3aa26e['ok']?_0x2773d7(0x1de):_0x2773d7(0x194))));const _0x50582b=a89_0x353349({'text':_0x2773d7(0x1b0),'color':'cyan'})[_0x2773d7(0x196)](),_0x3c40d7=execSkillsRemove(_0x379505,_0x3a08c3);_0x6a19a3[_0x2773d7(0x17a)](_0x3c40d7),_0x50582b[_0x3c40d7['ok']?_0x2773d7(0x1ce):_0x2773d7(0x1b7)](_0x2773d7(0x1ef)+(_0x3c40d7[_0x2773d7(0x1a4)]??(_0x3c40d7['ok']?_0x2773d7(0x1de):_0x2773d7(0x194))));const _0xf51cdb=a89_0x353349({'text':_0x2773d7(0x1e2),'color':_0x2773d7(0x1cb)})[_0x2773d7(0x196)](),_0x35d0d4=execSkillsAdd(_0x379505,_0x3a08c3);_0x6a19a3[_0x2773d7(0x17a)](_0x35d0d4),_0xf51cdb[_0x35d0d4['ok']?'succeed':_0x2773d7(0x1b7)]('Step\x206/7:\x20Install\x20new\x20skill\x20—\x20'+(_0x35d0d4[_0x2773d7(0x1a4)]??(_0x35d0d4['ok']?_0x2773d7(0x1de):_0x2773d7(0x194))));const _0x38264f=a89_0x353349({'text':'Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','color':_0x2773d7(0x1cb)})[_0x2773d7(0x196)](),_0x559ee4=execUpgradeSdk(_0x34e2df);_0x6a19a3[_0x2773d7(0x17a)](_0x559ee4),_0x38264f[_0x559ee4['ok']?'succeed':_0x2773d7(0x1b7)](_0x2773d7(0x184)+(_0x559ee4[_0x2773d7(0x1a4)]??(_0x559ee4['ok']?_0x2773d7(0x1de):_0x2773d7(0x194)))),printSummary(_0x6a19a3);const _0x4f52ee=_0x6a19a3['some'](_0x21b2eb=>!_0x21b2eb['ok']);_0x4f52ee?console[_0x2773d7(0x1bd)](a89_0x1486b8['yellow'](_0x2773d7(0x198))):console[_0x2773d7(0x1bd)](a89_0x1486b8['green']('Upgrade\x20completed\x20successfully!')),_0x559ee4['ok']&&_0x34e2df[_0x2773d7(0x1ae)]&&(console[_0x2773d7(0x1bd)](''),console[_0x2773d7(0x1bd)](a89_0x1486b8[_0x2773d7(0x1b5)]['cyan']('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console[_0x2773d7(0x1bd)](a89_0x1486b8['cyan'](_0x2773d7(0x1b2))),console[_0x2773d7(0x1bd)](''),console['log'](a89_0x1486b8['white']('\x20\x20npm\x20install')),console['log'](a89_0x1486b8[_0x2773d7(0x1c1)](_0x2773d7(0x18e))),console[_0x2773d7(0x1bd)](a89_0x1486b8['white'](_0x2773d7(0x1a5))),console[_0x2773d7(0x1bd)](''));}
1
+ const a90_0x1100db=a90_0xa48f;(function(_0x4a97cf,_0x234092){const _0x4a9b26=a90_0xa48f,_0x31b8dd=_0x4a97cf();while(!![]){try{const _0x1ddc05=parseInt(_0x4a9b26(0x226))/0x1+parseInt(_0x4a9b26(0x212))/0x2*(-parseInt(_0x4a9b26(0x1bb))/0x3)+parseInt(_0x4a9b26(0x1fc))/0x4+-parseInt(_0x4a9b26(0x1d4))/0x5*(-parseInt(_0x4a9b26(0x1f3))/0x6)+-parseInt(_0x4a9b26(0x205))/0x7*(-parseInt(_0x4a9b26(0x200))/0x8)+-parseInt(_0x4a9b26(0x1f7))/0x9+-parseInt(_0x4a9b26(0x1f8))/0xa*(parseInt(_0x4a9b26(0x1b7))/0xb);if(_0x1ddc05===_0x234092)break;else _0x31b8dd['push'](_0x31b8dd['shift']());}catch(_0x2094e8){_0x31b8dd['push'](_0x31b8dd['shift']());}}}(a90_0x2f08,0xe63a4));import a90_0x4fbcba from'chalk';import a90_0x4fa5d1 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{runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';function a90_0xa48f(_0x417e12,_0x20e642){_0x417e12=_0x417e12-0x1ae;const _0x2f0870=a90_0x2f08();let _0xa48fa7=_0x2f0870[_0x417e12];return _0xa48fa7;}import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a90_0x1100db(0x1cc)](_0x1df9cb=>_0x1df9cb!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x3a629d){const _0x2998ab=a90_0x1100db,_0x57b146=[];for(const _0x1c448e of Object['values'](CORE_IDE_CONFIGS)){if(_0x1c448e[_0x2998ab(0x204)])for(const _0x5141d8 of _0x1c448e[_0x2998ab(0x204)]){_0x57b146[_0x2998ab(0x213)](resolve(_0x3a629d,_0x5141d8[_0x2998ab(0x1c4)]));}}return _0x57b146;}function analyse(_0x10bd0b){const _0x93319b=a90_0x1100db;let _0x115583=null;const _0x5a4d17=resolve(_0x10bd0b,NEW_CONFIG_NAME),_0x2f11e1=existsSync(_0x5a4d17);for(const _0x1ce197 of LEGACY_CONFIG_NAMES){const _0x2d714f=resolve(_0x10bd0b,_0x1ce197);if(existsSync(_0x2d714f)){const _0x5266a2=readConfigFile(_0x2d714f),_0x44a3df=Object['keys'](_0x5266a2)[_0x93319b(0x1cc)](_0x2f00a1=>typeof _0x5266a2[_0x2f00a1]!==_0x93319b(0x1ca));_0x115583={'oldPath':_0x2d714f,'hasNewConfig':_0x2f11e1,'fields':_0x44a3df};break;}}const _0x52d4b4=[],_0x5c8205=resolve(_0x10bd0b,_0x93319b(0x1e7));if(existsSync(_0x5c8205))_0x52d4b4['push'](_0x5c8205);const _0x56d191=resolve(_0x10bd0b,_0x93319b(0x1db));if(existsSync(_0x56d191))_0x52d4b4[_0x93319b(0x213)](_0x56d191);const _0x4eea99=resolve(_0x10bd0b,_0x93319b(0x216));if(existsSync(_0x4eea99))_0x52d4b4[_0x93319b(0x213)](_0x4eea99);for(const _0x1c324a of collectIdeSkillFiles(_0x10bd0b)){if(existsSync(_0x1c324a))_0x52d4b4[_0x93319b(0x213)](_0x1c324a);}let _0x417ee6=null;const _0x88dbd5=resolve(_0x10bd0b,_0x93319b(0x1ee));if(existsSync(_0x88dbd5))try{const _0x3933c1=JSON[_0x93319b(0x1af)](readFileSync(_0x88dbd5,_0x93319b(0x215)));if(_0x3933c1?.[_0x93319b(0x1df)]&&typeof _0x3933c1['mcpServers']===_0x93319b(0x1c2)){const _0x49fc85=[];for(const [_0x1b7d40,_0x3985a8]of Object['entries'](_0x3933c1[_0x93319b(0x1df)])){const _0xdd70fc=_0x3985a8;_0xdd70fc?.[_0x93319b(0x1b0)]&&Array[_0x93319b(0x1f5)](_0xdd70fc['args'])&&_0xdd70fc['args'][_0x93319b(0x1b3)](_0x92e962=>typeof _0x92e962===_0x93319b(0x1ef)&&_0x92e962['includes'](_0x93319b(0x1ff)))&&_0x49fc85['push'](_0x1b7d40);}_0x49fc85[_0x93319b(0x1c0)]>0x0&&(_0x417ee6={'path':_0x88dbd5,'keys':_0x49fc85});}}catch{}const _0x250ac1=_0x52d4b4[_0x93319b(0x1c0)]>0x0||_0x115583!==null;let _0x532661=null;const _0xe53197=resolve(_0x10bd0b,_0x93319b(0x1cf));if(existsSync(_0xe53197))try{const _0x431814=JSON['parse'](readFileSync(_0xe53197,_0x93319b(0x215)));for(const _0x2922aa of[_0x93319b(0x1cd),'devDependencies']){const _0x1d690a=_0x431814?.[_0x2922aa]?.[_0x93319b(0x1c3)];if(typeof _0x1d690a==='string'){_0x1d690a!==_0x93319b(0x1dd)&&(_0x532661={'pkgPath':_0xe53197,'currentVersion':_0x1d690a,'field':_0x2922aa});break;}}}catch{}return{'configMigration':_0x115583,'oldArtifacts':_0x52d4b4,'oldMcpConfig':_0x417ee6,'needsSkillSwap':_0x250ac1,'sdkUpgrade':_0x532661};}function printReport(_0x4947ab){const _0x3af48f=a90_0x1100db,{configMigration:_0x35e6f2,oldArtifacts:_0x2c7f52,oldMcpConfig:_0x56f882,needsSkillSwap:_0x5745cd}=_0x4947ab;console[_0x3af48f(0x1eb)](''),console['log'](a90_0x4fbcba[_0x3af48f(0x219)]('===\x20Upgrade\x20Analysis\x20===')),console['log']('');_0x35e6f2?(console[_0x3af48f(0x1eb)](a90_0x4fbcba['cyan'](_0x3af48f(0x209))+('\x20\x20'+a90_0x4fbcba[_0x3af48f(0x206)](_0x35e6f2[_0x3af48f(0x1de)]))),console[_0x3af48f(0x1eb)](_0x3af48f(0x201)+(_0x35e6f2[_0x3af48f(0x20a)]?a90_0x4fbcba['green']('already\x20exists\x20(will\x20merge)'):a90_0x4fbcba[_0x3af48f(0x203)](_0x3af48f(0x207)))),console[_0x3af48f(0x1eb)]('\x20\x20Fields\x20to\x20migrate:\x20'+_0x35e6f2[_0x3af48f(0x1fa)][_0x3af48f(0x1d8)](',\x20')),console['log']('\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak')):console[_0x3af48f(0x1eb)](a90_0x4fbcba[_0x3af48f(0x20d)](_0x3af48f(0x209))+'\x20\x20'+a90_0x4fbcba[_0x3af48f(0x203)](_0x3af48f(0x1b6)));console[_0x3af48f(0x1eb)]('');if(_0x2c7f52[_0x3af48f(0x1c0)]>0x0){console[_0x3af48f(0x1eb)](a90_0x4fbcba[_0x3af48f(0x20d)](_0x3af48f(0x225)));for(const _0x42fb02 of _0x2c7f52){console[_0x3af48f(0x1eb)]('\x20\x20'+a90_0x4fbcba[_0x3af48f(0x1f9)]('FOUND')+'\x20\x20'+_0x42fb02);}console[_0x3af48f(0x1eb)](_0x3af48f(0x208));}else console['log'](a90_0x4fbcba['cyan']('Legacy\x20artifacts:')+'\x20\x20'+a90_0x4fbcba[_0x3af48f(0x203)](_0x3af48f(0x1be)));console[_0x3af48f(0x1eb)]('');_0x56f882?(console['log'](a90_0x4fbcba[_0x3af48f(0x20d)]('MCP\x20config:')+('\x20\x20'+a90_0x4fbcba[_0x3af48f(0x206)](_0x56f882[_0x3af48f(0x1c4)])+_0x3af48f(0x20b)+_0x56f882[_0x3af48f(0x1e9)][_0x3af48f(0x1d8)](',\x20'))),console[_0x3af48f(0x1eb)]('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console[_0x3af48f(0x1eb)](a90_0x4fbcba[_0x3af48f(0x20d)](_0x3af48f(0x1fb))+'\x20\x20'+a90_0x4fbcba[_0x3af48f(0x203)](_0x3af48f(0x1e2)));console[_0x3af48f(0x1eb)](''),console[_0x3af48f(0x1eb)](a90_0x4fbcba['cyan'](_0x3af48f(0x1d5))+('\x20\x20'+(_0x5745cd?a90_0x4fbcba[_0x3af48f(0x206)](_0x3af48f(0x21d)):a90_0x4fbcba[_0x3af48f(0x1b9)]('not\x20needed'))));_0x5745cd&&console[_0x3af48f(0x1eb)](_0x3af48f(0x1d1));console[_0x3af48f(0x1eb)]('');if(_0x4947ab['sdkUpgrade']){const {currentVersion:_0x5619f9,field:_0x1ef140,pkgPath:_0x4c3ba0}=_0x4947ab[_0x3af48f(0x1dc)];console[_0x3af48f(0x1eb)](a90_0x4fbcba[_0x3af48f(0x20d)]('@lovrabet/sdk:')+('\x20\x20'+a90_0x4fbcba[_0x3af48f(0x206)](_0x4c3ba0))),console[_0x3af48f(0x1eb)](_0x3af48f(0x1c1)+_0x1ef140+':\x20'+a90_0x4fbcba[_0x3af48f(0x206)](_0x5619f9)+'\x20→\x20'+a90_0x4fbcba[_0x3af48f(0x1b9)](_0x3af48f(0x1dd))),console['log'](_0x3af48f(0x1bc));}else console[_0x3af48f(0x1eb)](a90_0x4fbcba[_0x3af48f(0x20d)](_0x3af48f(0x1f1))+'\x20\x20'+a90_0x4fbcba['gray'](_0x3af48f(0x218)));console['log']('');}function execConfigMigration(_0x5c3f36,_0x2df2b7){const _0x5f104d=a90_0x1100db,{configMigration:_0xe11f59}=_0x5c3f36;if(!_0xe11f59?.[_0x5f104d(0x1de)])return{'step':0x1,'label':_0x5f104d(0x21a),'ok':!![],'detail':_0x5f104d(0x214)};const _0x5be596=readConfigFile(_0xe11f59['oldPath']),_0x384191=resolve(_0x2df2b7,NEW_CONFIG_NAME),_0xdcbf54=_0xe11f59[_0x5f104d(0x20a)]?readConfigFile(_0x384191):{};for(const [_0x4fc178,_0x4d22a9]of Object[_0x5f104d(0x1b4)](_0x5be596)){!(_0x4fc178 in _0xdcbf54)&&(_0xdcbf54[_0x4fc178]=_0x4d22a9);}writeConfigFile(_0x384191,_0xdcbf54);const _0x293c05=_0xe11f59['oldPath']+_0x5f104d(0x1bf);return renameSync(_0xe11f59['oldPath'],_0x293c05),{'step':0x1,'label':_0x5f104d(0x21a),'ok':!![],'detail':_0xe11f59[_0x5f104d(0x1de)]+'\x20→\x20'+_0x384191+_0x5f104d(0x1ce)+_0x293c05+')'};}function execRemoveOldArtifacts(_0x1c1a7c){const _0x837d28=a90_0x1100db,_0x173841=[];for(const _0x1b1cd7 of _0x1c1a7c){try{if(!existsSync(_0x1b1cd7))continue;const _0x1a9921=tryStat(_0x1b1cd7);_0x1a9921?.['isDirectory']()?rmSync(_0x1b1cd7,{'recursive':!![],'force':!![]}):unlinkSync(_0x1b1cd7);}catch(_0xbc03d6){_0x173841[_0x837d28(0x213)](_0x1b1cd7+':\x20'+_0xbc03d6[_0x837d28(0x20c)]);}}return{'step':0x3,'label':_0x837d28(0x210),'ok':_0x173841[_0x837d28(0x1c0)]===0x0,'detail':_0x173841[_0x837d28(0x1c0)]>0x0?_0x1c1a7c['length']-_0x173841['length']+'/'+_0x1c1a7c['length']+'\x20removed\x20('+_0x173841[_0x837d28(0x1d8)](';\x20')+')':_0x1c1a7c[_0x837d28(0x1c0)]+_0x837d28(0x1d9)};}function execCleanMcp(_0x40ff49){const _0x367ddc=a90_0x1100db;if(!_0x40ff49[_0x367ddc(0x1c5)])return{'step':0x4,'label':_0x367ddc(0x223),'ok':!![],'detail':'skipped'};try{const _0x55bc2f=readFileSync(_0x40ff49[_0x367ddc(0x1c5)][_0x367ddc(0x1c4)],_0x367ddc(0x215)),_0x14092d=JSON[_0x367ddc(0x1af)](_0x55bc2f);if(_0x14092d?.['mcpServers']&&typeof _0x14092d[_0x367ddc(0x1df)]===_0x367ddc(0x1c2)){const _0x42c91a=[];for(const [_0x33923d,_0x120491]of Object['entries'](_0x14092d[_0x367ddc(0x1df)])){_0x120491?.[_0x367ddc(0x1b0)]&&Array[_0x367ddc(0x1f5)](_0x120491[_0x367ddc(0x1b0)])&&_0x120491[_0x367ddc(0x1b0)]['some'](_0x5710dc=>typeof _0x5710dc==='string'&&_0x5710dc['includes']('@lovrabet/dataset-mcp-server'))&&_0x42c91a[_0x367ddc(0x213)](_0x33923d);}for(const _0x193c43 of _0x42c91a){delete _0x14092d[_0x367ddc(0x1df)][_0x193c43];}return _0x42c91a['length']>0x0&&writeFileSync(_0x40ff49[_0x367ddc(0x1c5)][_0x367ddc(0x1c4)],JSON[_0x367ddc(0x1d6)](_0x14092d,null,0x2)+'\x0a',_0x367ddc(0x215)),{'step':0x4,'label':_0x367ddc(0x223),'ok':!![],'detail':_0x367ddc(0x21f)+_0x42c91a[_0x367ddc(0x1d8)](',\x20')+'\x20from\x20'+_0x40ff49[_0x367ddc(0x1c5)][_0x367ddc(0x1c4)]};}return{'step':0x4,'label':_0x367ddc(0x223),'ok':!![],'detail':_0x367ddc(0x1ec)};}catch(_0x21fb3c){return{'step':0x4,'label':_0x367ddc(0x223),'ok':![],'detail':_0x21fb3c['message']};}}function execSkillsRemove(_0x4731fa,_0x3419af){const _0x3c7527=a90_0x1100db,_0x37ed4d=runNpxSkillsRemove(_0x4731fa,{'stdio':'inherit','yes':_0x3419af});return{'step':0x5,'label':_0x3c7527(0x1cb),'ok':_0x37ed4d['ok'],'detail':_0x37ed4d['ok']?'lovrabet/lovrabet-skill\x20removed':_0x37ed4d[_0x3c7527(0x20e)]??_0x3c7527(0x1ae)+_0x37ed4d[_0x3c7527(0x20f)]};}function a90_0x2f08(){const _0x1e3b2f=['needed','Remove\x20.lovrabet/','removed\x20','Upgrade\x20@lovrabet/sdk','oldArtifacts','\x20\x20#\x20or','Clean\x20MCP\x20config','yes','Legacy\x20artifacts:','1384676hoCJwu','exit\x20','parse','args','\x20→\x20latest','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','some','entries','fail','no\x20legacy\x20config\x20found','11MJrmNE','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','green','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','1779XGYJzn','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','none\x20found','.bak','length','\x20\x20Current\x20version\x20in\x20','object','@lovrabet/sdk','path','oldMcpConfig','Proceed\x20with\x20upgrade?','\x20\x20\x20\x20\x20\x20\x20','Step\x206/7:\x20Installing\x20new\x20skill...','\x20\x20Step\x20','undefined','Remove\x20old\x20skill','filter','dependencies','\x20(backup:\x20','package.json','cwd','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20lovrabet/rabetbase\x20--global','white','needsSkillSwap','5kTXtuL','Skill\x20swap:','stringify','Step\x201/7:\x20Config\x20migration\x20—\x20','join','\x20removed','done','.cursor/rules/lovrabet_rules.mdc','sdkUpgrade','latest','oldPath','mcpServers','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','no\x20legacy\x20entry','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','[\x22@lovrabet/sdk\x22]:\x20','label','detail','.lovrabet','\x20\x20npm\x20install','keys','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','log','no\x20matching\x20entry\x20found','configMigration','.cursor/mcp.json','string','CANCEL','@lovrabet/sdk:','inherit','1868646isqIQT','succeed','isArray','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','12765906ckfyGo','1335190nHsAEe','red','fields','MCP\x20config:','1136644YIvdZU','start','Step\x201/7:\x20Migrating\x20config...','@lovrabet/dataset-mcp-server','1191856SuGIFV','\x20\x20New\x20config\x20(.rabetbase.json):\x20','Step\x205/7:\x20Removing\x20old\x20skill...','gray','files','28EHgTMX','yellow','not\x20found\x20(will\x20create)','\x20\x20Action:\x20delete','Config\x20file:','hasNewConfig','\x20→\x20keys:\x20','message','cyan','error','status','Remove\x20legacy\x20artifacts','Upgrade\x20cancelled.','274MMEsHx','push','skipped\x20(no\x20legacy\x20config)','utf8','.claude/skills/lovrabet','skipped','not\x20found\x20or\x20already\x20at\x20latest','bold','Config\x20migration','failed','Step\x207/7:\x20@lovrabet/sdk\x20—\x20'];a90_0x2f08=function(){return _0x1e3b2f;};return a90_0x2f08();}function execSkillsAdd(_0x3e6204,_0x25c737){const _0x2c6f7c=a90_0x1100db,_0xf27bf7=runNpxSkillsAddGlobal(_0x3e6204,'lovrabet/rabetbase',{'stdio':_0x2c6f7c(0x1f2),'yes':_0x25c737});return{'step':0x6,'label':'Install\x20new\x20skill','ok':_0xf27bf7['ok'],'detail':_0xf27bf7['ok']?'lovrabet/rabetbase\x20installed\x20globally':_0xf27bf7[_0x2c6f7c(0x20e)]??_0x2c6f7c(0x1ae)+_0xf27bf7[_0x2c6f7c(0x20f)]};}function execUpgradeSdk(_0x42a106){const _0x284be0=a90_0x1100db;if(!_0x42a106[_0x284be0(0x1dc)])return{'step':0x7,'label':_0x284be0(0x220),'ok':!![],'detail':_0x284be0(0x1b2)};const {pkgPath:_0x166fe1,currentVersion:_0x5722dc,field:_0x37778d}=_0x42a106[_0x284be0(0x1dc)];try{const _0xe7554d=readFileSync(_0x166fe1,_0x284be0(0x215)),_0x8e9081=JSON['parse'](_0xe7554d);return _0x8e9081[_0x37778d][_0x284be0(0x1c3)]=_0x284be0(0x1dd),writeFileSync(_0x166fe1,JSON[_0x284be0(0x1d6)](_0x8e9081,null,0x2)+'\x0a',_0x284be0(0x215)),{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x37778d+_0x284be0(0x1e4)+_0x5722dc+_0x284be0(0x1b1)};}catch(_0x487fb9){return{'step':0x7,'label':_0x284be0(0x220),'ok':![],'detail':_0x487fb9[_0x284be0(0x20c)]};}}function tryStat(_0x413cd6){try{return statSync(_0x413cd6);}catch{return undefined;}}function printSummary(_0x4e2ea9){const _0x4d4de5=a90_0x1100db;console['log'](''),console[_0x4d4de5(0x1eb)](a90_0x4fbcba[_0x4d4de5(0x219)]('===\x20Upgrade\x20Summary\x20===')),console[_0x4d4de5(0x1eb)]('');for(const _0x1f6356 of _0x4e2ea9){const _0x4e210b=_0x1f6356['ok']?a90_0x4fbcba['green']('OK'):a90_0x4fbcba[_0x4d4de5(0x1f9)]('FAIL');console[_0x4d4de5(0x1eb)]('\x20\x20'+_0x4e210b+_0x4d4de5(0x1c9)+_0x1f6356['step']+':\x20'+_0x1f6356[_0x4d4de5(0x1e5)]);if(_0x1f6356[_0x4d4de5(0x1e6)])console['log'](_0x4d4de5(0x1c7)+a90_0x4fbcba[_0x4d4de5(0x203)](_0x1f6356[_0x4d4de5(0x1e6)]));}console[_0x4d4de5(0x1eb)]('');}export async function upgradeApp(_0x47ac0b,_0x173047){const _0x8b4cd8=a90_0x1100db,_0xbe94d3=process[_0x8b4cd8(0x1d0)](),_0xff3826=analyse(_0xbe94d3),_0x44e913=!_0xff3826[_0x8b4cd8(0x1ed)]&&_0xff3826['oldArtifacts'][_0x8b4cd8(0x1c0)]===0x0&&!_0xff3826[_0x8b4cd8(0x1c5)]&&!_0xff3826[_0x8b4cd8(0x1d3)]&&!_0xff3826[_0x8b4cd8(0x1dc)];if(_0x44e913){console[_0x8b4cd8(0x1eb)](a90_0x4fbcba['green']('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0xff3826);const _0x8dd231=!!(_0x173047[_0x8b4cd8(0x224)]||_0x173047['Y']||_0x47ac0b);if(!_0x8dd231)try{const _0x20283c=await askConfirm(_0x8b4cd8(0x1c6));if(!_0x20283c){console['log'](a90_0x4fbcba[_0x8b4cd8(0x203)](_0x8b4cd8(0x211)));return;}}catch(_0x4c89b2){if(_0x4c89b2?.[_0x8b4cd8(0x20c)]===_0x8b4cd8(0x1f0)){console['log'](a90_0x4fbcba[_0x8b4cd8(0x203)](_0x8b4cd8(0x211)));return;}throw _0x4c89b2;}const _0x3fed28=[],_0x4bf614=a90_0x4fa5d1({'text':_0x8b4cd8(0x1fe),'color':_0x8b4cd8(0x20d)})[_0x8b4cd8(0x1fd)](),_0x270f24=execConfigMigration(_0xff3826,_0xbe94d3);_0x3fed28['push'](_0x270f24),_0x4bf614[_0x270f24['ok']?_0x8b4cd8(0x1f4):'fail'](_0x8b4cd8(0x1d7)+(_0x270f24[_0x8b4cd8(0x1e6)]??(_0x270f24['ok']?_0x8b4cd8(0x1da):'failed')));const _0x22f137=resolve(_0xbe94d3,_0x8b4cd8(0x1e7)),_0x10bf46=a90_0x4fa5d1({'text':'Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','color':_0x8b4cd8(0x20d)})[_0x8b4cd8(0x1fd)]();if(existsSync(_0x22f137))try{rmSync(_0x22f137,{'recursive':!![],'force':!![]}),_0x10bf46[_0x8b4cd8(0x1f4)](_0x8b4cd8(0x1b8)),_0x3fed28[_0x8b4cd8(0x213)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x1d64d1){_0x10bf46[_0x8b4cd8(0x1b5)]('Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20'+_0x1d64d1[_0x8b4cd8(0x20c)]),_0x3fed28[_0x8b4cd8(0x213)]({'step':0x2,'label':_0x8b4cd8(0x21e),'ok':![],'detail':_0x1d64d1[_0x8b4cd8(0x20c)]});}else _0x10bf46['info'](_0x8b4cd8(0x1e0)),_0x3fed28['push']({'step':0x2,'label':_0x8b4cd8(0x21e),'ok':!![],'detail':_0x8b4cd8(0x217)});const _0x1546e8=a90_0x4fa5d1({'text':_0x8b4cd8(0x1ba),'color':'cyan'})[_0x8b4cd8(0x1fd)](),_0x447a82=execRemoveOldArtifacts(_0xff3826[_0x8b4cd8(0x221)]);_0x3fed28[_0x8b4cd8(0x213)](_0x447a82),_0x1546e8[_0x447a82['ok']?_0x8b4cd8(0x1f4):_0x8b4cd8(0x1b5)]('Step\x203/7:\x20Legacy\x20artifacts\x20—\x20'+(_0x447a82[_0x8b4cd8(0x1e6)]??(_0x447a82['ok']?_0x8b4cd8(0x1da):'failed')));const _0x2ebb09=a90_0x4fa5d1({'text':'Step\x204/7:\x20Cleaning\x20MCP\x20config...','color':_0x8b4cd8(0x20d)})['start'](),_0x36612d=execCleanMcp(_0xff3826);_0x3fed28[_0x8b4cd8(0x213)](_0x36612d),_0x2ebb09[_0x36612d['ok']?_0x8b4cd8(0x1f4):_0x8b4cd8(0x1b5)]('Step\x204/7:\x20MCP\x20config\x20—\x20'+(_0x36612d['detail']??(_0x36612d['ok']?_0x8b4cd8(0x1da):_0x8b4cd8(0x21b))));const _0x2e06b0=a90_0x4fa5d1({'text':_0x8b4cd8(0x202),'color':_0x8b4cd8(0x20d)})[_0x8b4cd8(0x1fd)](),_0xc302e2=execSkillsRemove(_0xbe94d3,_0x8dd231);_0x3fed28['push'](_0xc302e2),_0x2e06b0[_0xc302e2['ok']?_0x8b4cd8(0x1f4):_0x8b4cd8(0x1b5)](_0x8b4cd8(0x1e1)+(_0xc302e2[_0x8b4cd8(0x1e6)]??(_0xc302e2['ok']?_0x8b4cd8(0x1da):'failed')));const _0x509583=a90_0x4fa5d1({'text':_0x8b4cd8(0x1c8),'color':'cyan'})[_0x8b4cd8(0x1fd)](),_0x25641e=execSkillsAdd(_0xbe94d3,_0x8dd231);_0x3fed28[_0x8b4cd8(0x213)](_0x25641e),_0x509583[_0x25641e['ok']?'succeed':_0x8b4cd8(0x1b5)](_0x8b4cd8(0x1e3)+(_0x25641e[_0x8b4cd8(0x1e6)]??(_0x25641e['ok']?'done':'failed')));const _0x316a54=a90_0x4fa5d1({'text':_0x8b4cd8(0x1f6),'color':_0x8b4cd8(0x20d)})[_0x8b4cd8(0x1fd)](),_0x4a94ee=execUpgradeSdk(_0xff3826);_0x3fed28[_0x8b4cd8(0x213)](_0x4a94ee),_0x316a54[_0x4a94ee['ok']?_0x8b4cd8(0x1f4):_0x8b4cd8(0x1b5)](_0x8b4cd8(0x21c)+(_0x4a94ee[_0x8b4cd8(0x1e6)]??(_0x4a94ee['ok']?_0x8b4cd8(0x1da):_0x8b4cd8(0x21b)))),printSummary(_0x3fed28);const _0x149a4e=_0x3fed28[_0x8b4cd8(0x1b3)](_0x376f09=>!_0x376f09['ok']);_0x149a4e?console[_0x8b4cd8(0x1eb)](a90_0x4fbcba[_0x8b4cd8(0x206)](_0x8b4cd8(0x1ea))):console[_0x8b4cd8(0x1eb)](a90_0x4fbcba['green']('Upgrade\x20completed\x20successfully!')),_0x4a94ee['ok']&&_0xff3826[_0x8b4cd8(0x1dc)]&&(console[_0x8b4cd8(0x1eb)](''),console['log'](a90_0x4fbcba[_0x8b4cd8(0x219)][_0x8b4cd8(0x20d)](_0x8b4cd8(0x1bd))),console[_0x8b4cd8(0x1eb)](a90_0x4fbcba[_0x8b4cd8(0x20d)]('Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:')),console[_0x8b4cd8(0x1eb)](''),console[_0x8b4cd8(0x1eb)](a90_0x4fbcba['white'](_0x8b4cd8(0x1e8))),console[_0x8b4cd8(0x1eb)](a90_0x4fbcba[_0x8b4cd8(0x1d2)](_0x8b4cd8(0x222))),console[_0x8b4cd8(0x1eb)](a90_0x4fbcba[_0x8b4cd8(0x1d2)]('\x20\x20bun\x20install')),console['log'](''));}
@@ -1 +1 @@
1
- const a90_0x8d63fe=a90_0x5e96;(function(_0x130cc5,_0x1a01b9){const _0x4232ad=a90_0x5e96,_0x40ba80=_0x130cc5();while(!![]){try{const _0x1ae2f8=-parseInt(_0x4232ad(0x1da))/0x1+-parseInt(_0x4232ad(0x1db))/0x2*(parseInt(_0x4232ad(0x1eb))/0x3)+parseInt(_0x4232ad(0x1d2))/0x4+-parseInt(_0x4232ad(0x1e9))/0x5+parseInt(_0x4232ad(0x1e4))/0x6+-parseInt(_0x4232ad(0x1c2))/0x7*(-parseInt(_0x4232ad(0x1d7))/0x8)+parseInt(_0x4232ad(0x1e2))/0x9;if(_0x1ae2f8===_0x1a01b9)break;else _0x40ba80['push'](_0x40ba80['shift']());}catch(_0x1de360){_0x40ba80['push'](_0x40ba80['shift']());}}}(a90_0xdee6,0x9e737));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{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';function a90_0xdee6(){const _0xa6c000=['<script>','write','description','Menu','build','Dataset\x20&\x20Operations','Skills','defaultCommand','Authentication','Code\x20Generation','Schema','Configuration','3698356OSowhf','Run\x20Scripts','\x20\x20[high-risk-write]','BFF\x20Scripts','Database\x20Connections','888oRsLmr','\x20\x20[write]','API','370861tFtxgM','970czUwLD','create','SQL\x20Queries','from','Diagnostics','length','risk','3205953MUTHrJ','install','6358416AWGLOd','get','wildcardDef','service','Project','4163290BJIkRA','command','4479GEJypH','login','values','project','logout','has','preview','show','run','14889TRxKtk','set','App\x20Management','push'];a90_0xdee6=function(){return _0xa6c000;};return a90_0xdee6();}import{schemaDefinition}from'../commands/schema.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(_0x4645ee){const _0x10e5b2=a90_0x5e96;for(const _0x2c3710 of _0x4645ee){definitions['set'](_0x2c3710[_0x10e5b2(0x1e7)]+':'+_0x2c3710[_0x10e5b2(0x1ea)],_0x2c3710);let _0x290bab=serviceGroups[_0x10e5b2(0x1e5)](_0x2c3710[_0x10e5b2(0x1e7)]);!_0x290bab&&(_0x290bab=[],serviceGroups['set'](_0x2c3710[_0x10e5b2(0x1e7)],_0x290bab)),_0x290bab[_0x10e5b2(0x1c5)](_0x2c3710);}}function registerDeclarativeService(_0xdfe335,_0x556e12,_0x3840e6){const _0x9e0f95=a90_0x5e96;registerDefinitions(_0x556e12);_0x3840e6?.[_0x9e0f95(0x1e6)]&&registerDefinitions([_0x3840e6[_0x9e0f95(0x1e6)]]);const _0x4f4e9d=_0x427ce0=>_0x427ce0==='read'?'':_0x427ce0===_0x9e0f95(0x1c7)?_0x9e0f95(0x1d8):_0x9e0f95(0x1d4),_0x6e128c={'service':_0x556e12[0x0][_0x9e0f95(0x1e7)],'label':_0xdfe335,'commands':_0x556e12['map'](_0x392078=>({'command':_0x392078[_0x9e0f95(0x1ea)],'description':_0x392078[_0x9e0f95(0x1c8)],'tag':_0x4f4e9d(_0x392078[_0x9e0f95(0x1e1)])})),'declarative':!![],'defaultCommand':_0x3840e6?.[_0x9e0f95(0x1cd)]??(_0x3840e6?.['isSingleCommand']?_0x556e12[0x0][_0x9e0f95(0x1ea)]:undefined),'wildcardDef':_0x3840e6?.[_0x9e0f95(0x1e6)],'isSingleCommand':_0x3840e6?.['isSingleCommand']};serviceRegistry[_0x9e0f95(0x1c5)](_0x6e128c),serviceByName[_0x9e0f95(0x1c3)](_0x6e128c['service'],_0x6e128c);}registerDeclarativeService('Quick\x20Start',initDefinitions,{'defaultCommand':a90_0x8d63fe(0x1c1),'isSingleCommand':!![]}),registerDeclarativeService(a90_0x8d63fe(0x1e8),projectDefinitions),registerDeclarativeService(a90_0x8d63fe(0x1c4),appDefinitions),registerDeclarativeService(a90_0x8d63fe(0x1d3),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a90_0x8d63fe(0x1e0)]-0x1];last['commands']=[{'command':a90_0x8d63fe(0x1c6),'description':'Run\x20any\x20package.json\x20script','tag':''}];}registerDeclarativeService(a90_0x8d63fe(0x1ce),authDefinitions,{'defaultCommand':a90_0x8d63fe(0x1ec)}),registerDeclarativeService('Self\x20Update',[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a90_0x8d63fe(0x1df),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a90_0x8d63fe(0x1d0),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a90_0x8d63fe(0x1d1),configDefinitions),registerDeclarativeService(a90_0x8d63fe(0x1d9),apiDefinitions),registerDeclarativeService(a90_0x8d63fe(0x1c9),menuDefinitions),registerDeclarativeService(a90_0x8d63fe(0x1d6),dbDefinitions),registerDeclarativeService(a90_0x8d63fe(0x1cb),datasetDefinitions),registerDeclarativeService(a90_0x8d63fe(0x1d5),bffDefinitions),registerDeclarativeService(a90_0x8d63fe(0x1dd),sqlDefinitions),registerDeclarativeService(a90_0x8d63fe(0x1cf),codegenDefinitions),registerDeclarativeService(a90_0x8d63fe(0x1cc),skillDefinitions),registerDeclarativeService('Logs',logsDefinitions,{'defaultCommand':a90_0x8d63fe(0x1c0)});export const deprecatedAliases={'create':{'service':a90_0x8d63fe(0x1bc),'command':a90_0x8d63fe(0x1dc)},'start':{'service':'run','command':'start'},'build':{'service':a90_0x8d63fe(0x1c1),'command':a90_0x8d63fe(0x1ca)},'preview':{'service':a90_0x8d63fe(0x1c1),'command':a90_0x8d63fe(0x1bf)},'logout':{'service':'auth','command':a90_0x8d63fe(0x1bd)},'skills':{'service':'skill','command':a90_0x8d63fe(0x1e3)}};function a90_0x5e96(_0x496f68,_0x5ee3d7){_0x496f68=_0x496f68-0x1bb;const _0xdee6c6=a90_0xdee6();let _0x5e9673=_0xdee6c6[_0x496f68];return _0x5e9673;}export function findDefinition(_0x3518e5,_0x26ca35){const _0x33cd94=a90_0x8d63fe;return definitions[_0x33cd94(0x1e5)](_0x3518e5+':'+_0x26ca35);}export function isKnownService(_0x59464e){const _0x1b023d=a90_0x8d63fe;return serviceByName[_0x1b023d(0x1be)](_0x59464e);}export function isDeclarativeService(_0x544634){const _0x51083c=a90_0x8d63fe;return serviceGroups[_0x51083c(0x1be)](_0x544634)||serviceByName['get'](_0x544634)?.[_0x51083c(0x1e6)]!==undefined;}export function getServiceEntry(_0x534d0e){return serviceByName['get'](_0x534d0e);}export function getLegacyHandler(_0x9c008c,_0x2a6133){return undefined;}export function getAllDefinitions(){const _0x483929=a90_0x8d63fe;return Array[_0x483929(0x1de)](definitions[_0x483929(0x1bb)]());}
1
+ const a91_0x4695b4=a91_0x2955;(function(_0x140843,_0x5aab13){const _0x3ec488=a91_0x2955,_0x593f04=_0x140843();while(!![]){try{const _0x4f5c9d=-parseInt(_0x3ec488(0x171))/0x1+parseInt(_0x3ec488(0x191))/0x2+parseInt(_0x3ec488(0x18b))/0x3*(-parseInt(_0x3ec488(0x18f))/0x4)+-parseInt(_0x3ec488(0x197))/0x5*(parseInt(_0x3ec488(0x183))/0x6)+-parseInt(_0x3ec488(0x19a))/0x7+parseInt(_0x3ec488(0x190))/0x8+parseInt(_0x3ec488(0x19f))/0x9;if(_0x4f5c9d===_0x5aab13)break;else _0x593f04['push'](_0x593f04['shift']());}catch(_0xb104eb){_0x593f04['push'](_0x593f04['shift']());}}}(a91_0x7f6c,0x61c06));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';function a91_0x2955(_0x218b82,_0x586cd7){_0x218b82=_0x218b82-0x16d;const _0x7f6c75=a91_0x7f6c();let _0x2955da=_0x7f6c75[_0x218b82];return _0x2955da;}import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/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';function a91_0x7f6c(){const _0x124f29=['225645chIOfv','push','command','Skills','Schema','3005640jfidvI','<script>','install','set','start','87519ZWaKLX','Run\x20Scripts','commands','Diagnostics','has','Self\x20Update','isSingleCommand','BFF\x20Scripts','project','Run\x20any\x20package.json\x20script','login','run','logout','defaultCommand','App\x20Management','wildcardDef','values','create','270YIwYkC','Code\x20Generation','Configuration','length','Database\x20Connections','build','Menu','SQL\x20Queries','6JrdoNH','write','get','Project','1106124PceMQU','3143824HxLCdb','970816AHkqZK','preview','show','risk','Dataset\x20&\x20Operations','API','15460BYjgMG','service','read'];a91_0x7f6c=function(){return _0x124f29;};return a91_0x7f6c();}import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.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(_0x1d0ed6){const _0x182439=a91_0x2955;for(const _0x424d0d of _0x1d0ed6){definitions['set'](_0x424d0d[_0x182439(0x198)]+':'+_0x424d0d[_0x182439(0x19c)],_0x424d0d);let _0x5d1826=serviceGroups[_0x182439(0x18d)](_0x424d0d['service']);!_0x5d1826&&(_0x5d1826=[],serviceGroups[_0x182439(0x16f)](_0x424d0d[_0x182439(0x198)],_0x5d1826)),_0x5d1826[_0x182439(0x19b)](_0x424d0d);}}function registerDeclarativeService(_0x2de5e9,_0x4f01a6,_0x4f638c){const _0x5df87f=a91_0x2955;registerDefinitions(_0x4f01a6);_0x4f638c?.[_0x5df87f(0x180)]&&registerDefinitions([_0x4f638c[_0x5df87f(0x180)]]);const _0x37a6f1=_0x18ea9f=>_0x18ea9f===_0x5df87f(0x199)?'':_0x18ea9f===_0x5df87f(0x18c)?'\x20\x20[write]':'\x20\x20[high-risk-write]',_0x94f16d={'service':_0x4f01a6[0x0][_0x5df87f(0x198)],'label':_0x2de5e9,'commands':_0x4f01a6['map'](_0x414475=>({'command':_0x414475[_0x5df87f(0x19c)],'description':_0x414475['description'],'tag':_0x37a6f1(_0x414475[_0x5df87f(0x194)])})),'declarative':!![],'defaultCommand':_0x4f638c?.[_0x5df87f(0x17e)]??(_0x4f638c?.[_0x5df87f(0x177)]?_0x4f01a6[0x0][_0x5df87f(0x19c)]:undefined),'wildcardDef':_0x4f638c?.[_0x5df87f(0x180)],'isSingleCommand':_0x4f638c?.[_0x5df87f(0x177)]};serviceRegistry[_0x5df87f(0x19b)](_0x94f16d),serviceByName[_0x5df87f(0x16f)](_0x94f16d[_0x5df87f(0x198)],_0x94f16d);}registerDeclarativeService('Quick\x20Start',initDefinitions,{'defaultCommand':a91_0x4695b4(0x17c),'isSingleCommand':!![]}),registerDeclarativeService(a91_0x4695b4(0x18e),projectDefinitions),registerDeclarativeService(a91_0x4695b4(0x17f),appDefinitions),registerDeclarativeService(a91_0x4695b4(0x172),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a91_0x4695b4(0x186)]-0x1];last[a91_0x4695b4(0x173)]=[{'command':a91_0x4695b4(0x16d),'description':a91_0x4695b4(0x17a),'tag':''}];}registerDeclarativeService('Authentication',authDefinitions,{'defaultCommand':a91_0x4695b4(0x17b)}),registerDeclarativeService(a91_0x4695b4(0x176),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a91_0x4695b4(0x174),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a91_0x4695b4(0x19e),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a91_0x4695b4(0x185),configDefinitions),registerDeclarativeService(a91_0x4695b4(0x196),apiDefinitions),registerDeclarativeService(a91_0x4695b4(0x189),menuDefinitions),registerDeclarativeService(a91_0x4695b4(0x187),dbDefinitions),registerDeclarativeService(a91_0x4695b4(0x195),datasetDefinitions),registerDeclarativeService(a91_0x4695b4(0x178),bffDefinitions),registerDeclarativeService(a91_0x4695b4(0x18a),sqlDefinitions),registerDeclarativeService(a91_0x4695b4(0x184),codegenDefinitions),registerDeclarativeService(a91_0x4695b4(0x19d),skillDefinitions),registerDeclarativeService('Logs',logsDefinitions,{'defaultCommand':a91_0x4695b4(0x193)});export const deprecatedAliases={'create':{'service':a91_0x4695b4(0x179),'command':a91_0x4695b4(0x182)},'start':{'service':a91_0x4695b4(0x17c),'command':a91_0x4695b4(0x170)},'build':{'service':a91_0x4695b4(0x17c),'command':a91_0x4695b4(0x188)},'preview':{'service':'run','command':a91_0x4695b4(0x192)},'logout':{'service':'auth','command':a91_0x4695b4(0x17d)},'skills':{'service':'skill','command':a91_0x4695b4(0x16e)}};export function findDefinition(_0xc89a2,_0x122d1b){const _0x524871=a91_0x4695b4;return definitions[_0x524871(0x18d)](_0xc89a2+':'+_0x122d1b);}export function isKnownService(_0x54dde0){const _0x192c0=a91_0x4695b4;return serviceByName[_0x192c0(0x175)](_0x54dde0);}export function isDeclarativeService(_0x14e01e){const _0x24b24e=a91_0x4695b4;return serviceGroups[_0x24b24e(0x175)](_0x14e01e)||serviceByName[_0x24b24e(0x18d)](_0x14e01e)?.[_0x24b24e(0x180)]!==undefined;}export function getServiceEntry(_0xd906a5){const _0x468c5f=a91_0x4695b4;return serviceByName[_0x468c5f(0x18d)](_0xd906a5);}export function getLegacyHandler(_0x2b0ba3,_0x34849e){return undefined;}export function getAllDefinitions(){const _0x20b9be=a91_0x4695b4;return Array['from'](definitions[_0x20b9be(0x181)]());}
@@ -1 +1 @@
1
- const a91_0x3d1933=a91_0x8f53;function a91_0x8f53(_0x379e6a,_0x1fc777){_0x379e6a=_0x379e6a-0x159;const _0x5575b9=a91_0x5575();let _0x8f5358=_0x5575b9[_0x379e6a];return _0x8f5358;}(function(_0x34860b,_0x502fa8){const _0x495caa=a91_0x8f53,_0x4f1d31=_0x34860b();while(!![]){try{const _0xcf7d18=parseInt(_0x495caa(0x172))/0x1*(-parseInt(_0x495caa(0x16b))/0x2)+parseInt(_0x495caa(0x15f))/0x3+parseInt(_0x495caa(0x175))/0x4+-parseInt(_0x495caa(0x162))/0x5*(-parseInt(_0x495caa(0x177))/0x6)+-parseInt(_0x495caa(0x17c))/0x7+-parseInt(_0x495caa(0x196))/0x8+parseInt(_0x495caa(0x178))/0x9;if(_0xcf7d18===_0x502fa8)break;else _0x4f1d31['push'](_0x4f1d31['shift']());}catch(_0x5b6b57){_0x4f1d31['push'](_0x4f1d31['shift']());}}}(a91_0x5575,0xdc8b8));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{checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set(['start','dev']);function readPackageScripts(_0x117067){const _0x1e840d=a91_0x8f53,_0x3f9ffe=resolve(_0x117067,'package.json');if(!existsSync(_0x3f9ffe))return null;try{const _0x27d425=JSON[_0x1e840d(0x182)](readFileSync(_0x3f9ffe,_0x1e840d(0x181)));return _0x27d425[_0x1e840d(0x191)]??{};}catch{return null;}}function detectPackageManager(_0x4c5658){const _0x340f6d=a91_0x8f53;if(existsSync(resolve(_0x4c5658,_0x340f6d(0x176)))||existsSync(resolve(_0x4c5658,'bun.lock')))return _0x340f6d(0x190);if(existsSync(resolve(_0x4c5658,_0x340f6d(0x184))))return _0x340f6d(0x17f);if(existsSync(resolve(_0x4c5658,_0x340f6d(0x17d))))return _0x340f6d(0x18d);return _0x340f6d(0x194);}async function versionCheck(_0x3673f2){const _0x5b344a=a91_0x8f53,_0x43844d=await checkCliVersion();if(_0x43844d[_0x5b344a(0x186)])printCliUpgradeWarning(_0x43844d);const _0x5082fa=await checkSdkVersion(_0x3673f2);if(_0x5082fa[_0x5b344a(0x186)])printSdkUpgradeWarning(_0x5082fa);}function spawnScript(_0x101033,_0xe8621f,_0x30c78f,_0x3854f1){return new Promise((_0x36ff30,_0x78b810)=>{const _0x43de3a=a91_0x8f53,_0x4e4e8c=[_0x43de3a(0x174),_0xe8621f,..._0x30c78f],_0x550118=spawn(_0x101033,_0x4e4e8c,{'cwd':_0x3854f1,'stdio':_0x43de3a(0x16a),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3854f1,_0x43de3a(0x165),_0x43de3a(0x167))+delimiter+process.env.PATH}});_0x550118['on'](_0x43de3a(0x163),_0xde6937=>{const _0x3c65b7=_0x43de3a;if(_0xde6937===0x0||_0xde6937===null)_0x36ff30();else _0x78b810(new Error(_0x101033+_0x3c65b7(0x183)+_0xe8621f+_0x3c65b7(0x15c)+_0xde6937));}),_0x550118['on'](_0x43de3a(0x171),_0x78b810);});}function a91_0x5575(){const _0x148383=['watch','4117551nEQVxr','entries','push','20WAyKmR','close','validation','node_modules','length','.bin','No\x20package.json\x20found\x20in\x20current\x20directory.','args','inherit','1644494ZLZhIP','slice','keys','log','Run\x20a\x20package.json\x20script','preview','error','1QrujSV','Enable\x20watch\x20mode\x20for\x20preview','run','1313844UyakHF','bun.lockb','2123622oayJNf','10306611XnDVlg','script','max','map','5198263scjCkw','yarn.lock','Script\x20name\x20defined\x20in\x20package.json','pnpm','boolean','utf-8','parse','\x20run\x20','pnpm-lock.yaml','\x0a\x20\x20Available\x20scripts:\x0a','needsUpgrade','(none)','\x20\x20\x20\x20','padEnd','bool','Available:\x20','\x20run\x20preview','yarn','\x0a\x20\x20Usage:\x20','join','bun','scripts','vite','\x20\x20AVAILABLE\x20SCRIPTS\x20\x20(current\x20project)','npm','Script\x20\x22','14349576IxUJqN','No\x20scripts\x20defined\x20in\x20package.json.','all','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','--watch','\x20exited\x20with\x20code\x20','\x20\x20EXAMPLES'];a91_0x5575=function(){return _0x148383;};return a91_0x5575();}function spawnViteBuildWatch(_0x24476a){return new Promise((_0x27b903,_0x2c5d0a)=>{const _0x474705=a91_0x8f53,_0x20ecb5=spawn(_0x474705(0x192),['build',_0x474705(0x15b)],{'cwd':_0x24476a,'stdio':_0x474705(0x16a),'shell':!![],'env':{...process.env,'PATH':''+join(_0x24476a,_0x474705(0x165),_0x474705(0x167))+delimiter+process.env.PATH}});_0x20ecb5['on'](_0x474705(0x163),_0x423c26=>{const _0x6f6387=_0x474705;if(_0x423c26===0x0||_0x423c26===null)_0x27b903();else _0x2c5d0a(new Error(_0x6f6387(0x15a)+_0x423c26));}),_0x20ecb5['on'](_0x474705(0x171),_0x2c5d0a);});}function spawnVitePreview(_0x17e9ac){return new Promise((_0x28565c,_0x24c8fc)=>{const _0x204e05=a91_0x8f53,_0x18bb4b=spawn('vite',[_0x204e05(0x170)],{'cwd':_0x17e9ac,'stdio':_0x204e05(0x16a),'shell':!![],'env':{...process.env,'PATH':''+join(_0x17e9ac,'node_modules','.bin')+delimiter+process.env.PATH}});_0x18bb4b['on'](_0x204e05(0x163),_0x4f0a7c=>{if(_0x4f0a7c===0x0||_0x4f0a7c===null)_0x28565c();else _0x24c8fc(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x4f0a7c));}),_0x18bb4b['on'](_0x204e05(0x171),_0x24c8fc);});}const runFlags=[{'name':a91_0x3d1933(0x15e),'type':a91_0x3d1933(0x180),'description':a91_0x3d1933(0x173),'default':![]}];export const runDefinition={'service':a91_0x3d1933(0x174),'command':'run','description':a91_0x3d1933(0x16f),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a91_0x3d1933(0x179),'description':a91_0x3d1933(0x17e),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x1461b2=a91_0x3d1933,_0x4e1479=readPackageScripts(process['cwd']()),_0x1d2fa2=[];if(_0x4e1479&&Object[_0x1461b2(0x16d)](_0x4e1479)[_0x1461b2(0x166)]>0x0){const _0x3fa3ba=Object['keys'](_0x4e1479),_0x5f20be=Math['max'](..._0x3fa3ba[_0x1461b2(0x17b)](_0x59ecac=>_0x59ecac[_0x1461b2(0x166)]));_0x1d2fa2['push'](_0x1461b2(0x193));for(const [_0x1c91d9,_0x5c085e]of Object[_0x1461b2(0x160)](_0x4e1479)){_0x1d2fa2['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20'+_0x1c91d9[_0x1461b2(0x189)](_0x5f20be+0x2)+'#\x20'+_0x5c085e);}}else _0x1d2fa2['push'](_0x1461b2(0x15d)),_0x1d2fa2['push'](_0x1461b2(0x188)+CLI_BIN_NAME+'\x20run\x20start'),_0x1d2fa2[_0x1461b2(0x161)](_0x1461b2(0x188)+CLI_BIN_NAME+'\x20run\x20build'),_0x1d2fa2['push']('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x1461b2(0x18c)),_0x1d2fa2['push'](_0x1461b2(0x188)+CLI_BIN_NAME+'\x20run\x20preview\x20--watch\x20\x20\x20#\x20parallel\x20build\x20--watch\x20+\x20preview');return _0x1d2fa2['join']('\x0a');},async 'execute'(_0x8d0143){const _0x1b735e=a91_0x3d1933,_0x50b587=process['cwd'](),_0x1a47e4=_0x8d0143[_0x1b735e(0x169)][0x0],_0x206383=_0x8d0143[_0x1b735e(0x169)][_0x1b735e(0x16c)](0x1),_0x31a86b=readPackageScripts(_0x50b587);if(!_0x31a86b)throw CliErrors[_0x1b735e(0x164)](_0x1b735e(0x168));if(!_0x1a47e4){const _0x411f4a=Object[_0x1b735e(0x16d)](_0x31a86b);if(_0x411f4a[_0x1b735e(0x166)]===0x0)console[_0x1b735e(0x16e)](_0x1b735e(0x197));else{console[_0x1b735e(0x16e)](_0x1b735e(0x185));const _0x428931=Math[_0x1b735e(0x17a)](..._0x411f4a[_0x1b735e(0x17b)](_0x58ef38=>_0x58ef38[_0x1b735e(0x166)]));for(const [_0x2da530,_0x5ebb23]of Object[_0x1b735e(0x160)](_0x31a86b)){console[_0x1b735e(0x16e)](_0x1b735e(0x188)+_0x2da530['padEnd'](_0x428931+0x2)+_0x5ebb23);}console[_0x1b735e(0x16e)](_0x1b735e(0x18e)+CLI_BIN_NAME+'\x20run\x20<script>\x0a');}return{'ok':!![]};}if(!_0x31a86b[_0x1a47e4])throw CliErrors[_0x1b735e(0x164)](_0x1b735e(0x195)+_0x1a47e4+'\x22\x20not\x20found\x20in\x20package.json.',_0x1b735e(0x18b)+(Object['keys'](_0x31a86b)[_0x1b735e(0x18f)](',\x20')||_0x1b735e(0x187)));const _0xe7c224=detectPackageManager(_0x50b587);VERSION_CHECK_SCRIPTS['has'](_0x1a47e4)&&await versionCheck(_0x50b587);if(_0x1a47e4==='preview'&&_0x8d0143[_0x1b735e(0x18a)](_0x1b735e(0x15e)))return await Promise[_0x1b735e(0x159)]([spawnViteBuildWatch(_0x50b587),spawnVitePreview(_0x50b587)]),{'ok':!![]};return await spawnScript(_0xe7c224,_0x1a47e4,_0x206383,_0x50b587),{'ok':!![]};}};
1
+ const a92_0x16117c=a92_0x1318;(function(_0x16ae18,_0x5a4abf){const _0x144506=a92_0x1318,_0x86c85b=_0x16ae18();while(!![]){try{const _0x40ebf1=parseInt(_0x144506(0x12e))/0x1*(parseInt(_0x144506(0xff))/0x2)+parseInt(_0x144506(0x136))/0x3*(parseInt(_0x144506(0x11f))/0x4)+-parseInt(_0x144506(0x106))/0x5*(-parseInt(_0x144506(0x12c))/0x6)+-parseInt(_0x144506(0x10a))/0x7+parseInt(_0x144506(0xfd))/0x8*(-parseInt(_0x144506(0x110))/0x9)+parseInt(_0x144506(0x102))/0xa*(-parseInt(_0x144506(0x121))/0xb)+-parseInt(_0x144506(0x11a))/0xc;if(_0x40ebf1===_0x5a4abf)break;else _0x86c85b['push'](_0x86c85b['shift']());}catch(_0x731e69){_0x86c85b['push'](_0x86c85b['shift']());}}}(a92_0xe583,0x84ade));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';function a92_0x1318(_0x171ad1,_0x116c36){_0x171ad1=_0x171ad1-0xf9;const _0xe5833b=a92_0xe583();let _0x1318fe=_0xe5833b[_0x171ad1];return _0x1318fe;}import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';function a92_0xe583(){const _0x1794eb=['\x20exited\x20with\x20code\x20','npm','2729036NcYWCP','args','1772089jFEVip','slice','\x20\x20\x20\x20','Available:\x20','map','utf-8','bun.lockb','(none)','dev','yarn','error','36iWZASi','close','59NcumrZ','keys','has','length','max','\x22\x20not\x20found\x20in\x20package.json.','parse','build','3SwgpFM','\x20run\x20preview\x20--watch\x20\x20\x20#\x20parallel\x20build\x20--watch\x20+\x20preview','No\x20package.json\x20found\x20in\x20current\x20directory.','read','\x20run\x20','No\x20scripts\x20defined\x20in\x20package.json.','bun.lock','padEnd','856gjfjbX','preview','29426xdcOnn','\x20run\x20<script>\x0a','vite','10LUhspH','join','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','Enable\x20watch\x20mode\x20for\x20preview','609110PBVaPy','pnpm','needsUpgrade','log','473697pFcUbT','.bin','boolean','\x20\x20EXAMPLES','cwd','\x20run\x20build','6246YArptb','node_modules','inherit','bun','push','yarn.lock','run','validation','package.json','\x20run\x20preview','17217312KklxJQ','Script\x20\x22','watch'];a92_0xe583=function(){return _0x1794eb;};return a92_0xe583();}import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set(['start',a92_0x16117c(0x129)]);function readPackageScripts(_0x5bedf7){const _0x3f1099=a92_0x16117c,_0xcfeca4=resolve(_0x5bedf7,_0x3f1099(0x118));if(!existsSync(_0xcfeca4))return null;try{const _0x4049ff=JSON[_0x3f1099(0x134)](readFileSync(_0xcfeca4,_0x3f1099(0x126)));return _0x4049ff['scripts']??{};}catch{return null;}}function detectPackageManager(_0x544e06){const _0x199676=a92_0x16117c;if(existsSync(resolve(_0x544e06,_0x199676(0x127)))||existsSync(resolve(_0x544e06,_0x199676(0xfb))))return _0x199676(0x113);if(existsSync(resolve(_0x544e06,'pnpm-lock.yaml')))return _0x199676(0x107);if(existsSync(resolve(_0x544e06,_0x199676(0x115))))return _0x199676(0x12a);return _0x199676(0x11e);}async function versionCheck(_0x37b607){const _0x47ecce=a92_0x16117c,_0x558278=await checkCliVersion();if(_0x558278[_0x47ecce(0x108)])printCliUpgradeWarning(_0x558278);const _0x5e176f=await checkSdkVersion(_0x37b607);if(_0x5e176f[_0x47ecce(0x108)])printSdkUpgradeWarning(_0x5e176f);}function spawnScript(_0x12beb1,_0x1d1b97,_0x39bf26,_0x854dee){return new Promise((_0x3a79d6,_0x2814c2)=>{const _0x515937=a92_0x1318,_0x1745e8=[_0x515937(0x116),_0x1d1b97,..._0x39bf26],_0x4d668f=spawn(_0x12beb1,_0x1745e8,{'cwd':_0x854dee,'stdio':_0x515937(0x112),'shell':!![],'env':{...process.env,'PATH':''+join(_0x854dee,_0x515937(0x111),_0x515937(0x10b))+delimiter+process.env.PATH}});_0x4d668f['on'](_0x515937(0x12d),_0x3038dc=>{const _0x33c0c5=_0x515937;if(_0x3038dc===0x0||_0x3038dc===null)_0x3a79d6();else _0x2814c2(new Error(_0x12beb1+_0x33c0c5(0xf9)+_0x1d1b97+_0x33c0c5(0x11d)+_0x3038dc));}),_0x4d668f['on'](_0x515937(0x12b),_0x2814c2);});}function spawnViteBuildWatch(_0x28e297){return new Promise((_0x59baf4,_0x324b42)=>{const _0xd7b54f=a92_0x1318,_0x287acb=spawn('vite',[_0xd7b54f(0x135),'--watch'],{'cwd':_0x28e297,'stdio':_0xd7b54f(0x112),'shell':!![],'env':{...process.env,'PATH':''+join(_0x28e297,_0xd7b54f(0x111),_0xd7b54f(0x10b))+delimiter+process.env.PATH}});_0x287acb['on'](_0xd7b54f(0x12d),_0x512a5c=>{const _0xf9cabf=_0xd7b54f;if(_0x512a5c===0x0||_0x512a5c===null)_0x59baf4();else _0x324b42(new Error(_0xf9cabf(0x104)+_0x512a5c));}),_0x287acb['on'](_0xd7b54f(0x12b),_0x324b42);});}function spawnVitePreview(_0x3574da){return new Promise((_0x10bb68,_0x417f20)=>{const _0x4ba5c4=a92_0x1318,_0x2f41d5=spawn(_0x4ba5c4(0x101),[_0x4ba5c4(0xfe)],{'cwd':_0x3574da,'stdio':_0x4ba5c4(0x112),'shell':!![],'env':{...process.env,'PATH':''+join(_0x3574da,_0x4ba5c4(0x111),'.bin')+delimiter+process.env.PATH}});_0x2f41d5['on'](_0x4ba5c4(0x12d),_0x6d22ce=>{if(_0x6d22ce===0x0||_0x6d22ce===null)_0x10bb68();else _0x417f20(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x6d22ce));}),_0x2f41d5['on'](_0x4ba5c4(0x12b),_0x417f20);});}const runFlags=[{'name':a92_0x16117c(0x11c),'type':a92_0x16117c(0x10c),'description':a92_0x16117c(0x105),'default':![]}];export const runDefinition={'service':a92_0x16117c(0x116),'command':a92_0x16117c(0x116),'description':'Run\x20a\x20package.json\x20script','risk':a92_0x16117c(0x139),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0xfc397c=a92_0x16117c,_0x1a3f9d=readPackageScripts(process['cwd']()),_0x45e97c=[];if(_0x1a3f9d&&Object[_0xfc397c(0x12f)](_0x1a3f9d)['length']>0x0){const _0x16afb0=Object['keys'](_0x1a3f9d),_0x3a73d1=Math[_0xfc397c(0x132)](..._0x16afb0[_0xfc397c(0x125)](_0x3d9cb0=>_0x3d9cb0[_0xfc397c(0x131)]));_0x45e97c[_0xfc397c(0x114)]('\x20\x20AVAILABLE\x20SCRIPTS\x20\x20(current\x20project)');for(const [_0x1faca4,_0x4e5502]of Object['entries'](_0x1a3f9d)){_0x45e97c[_0xfc397c(0x114)](_0xfc397c(0x123)+CLI_BIN_NAME+_0xfc397c(0xf9)+_0x1faca4[_0xfc397c(0xfc)](_0x3a73d1+0x2)+'#\x20'+_0x4e5502);}}else _0x45e97c[_0xfc397c(0x114)](_0xfc397c(0x10d)),_0x45e97c[_0xfc397c(0x114)](_0xfc397c(0x123)+CLI_BIN_NAME+'\x20run\x20start'),_0x45e97c[_0xfc397c(0x114)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0xfc397c(0x10f)),_0x45e97c[_0xfc397c(0x114)](_0xfc397c(0x123)+CLI_BIN_NAME+_0xfc397c(0x119)),_0x45e97c[_0xfc397c(0x114)](_0xfc397c(0x123)+CLI_BIN_NAME+_0xfc397c(0x137));return _0x45e97c[_0xfc397c(0x103)]('\x0a');},async 'execute'(_0x39b8f5){const _0xeb1828=a92_0x16117c,_0x1f779c=process[_0xeb1828(0x10e)](),_0x62bd27=_0x39b8f5[_0xeb1828(0x120)][0x0],_0x49f159=_0x39b8f5[_0xeb1828(0x120)][_0xeb1828(0x122)](0x1),_0x499049=readPackageScripts(_0x1f779c);if(!_0x499049)throw CliErrors[_0xeb1828(0x117)](_0xeb1828(0x138));if(!_0x62bd27){const _0x515f90=Object[_0xeb1828(0x12f)](_0x499049);if(_0x515f90['length']===0x0)console[_0xeb1828(0x109)](_0xeb1828(0xfa));else{console['log']('\x0a\x20\x20Available\x20scripts:\x0a');const _0x31ed2b=Math['max'](..._0x515f90[_0xeb1828(0x125)](_0x5b2f28=>_0x5b2f28['length']));for(const [_0x577a0a,_0x1fcbbd]of Object['entries'](_0x499049)){console[_0xeb1828(0x109)](_0xeb1828(0x123)+_0x577a0a[_0xeb1828(0xfc)](_0x31ed2b+0x2)+_0x1fcbbd);}console[_0xeb1828(0x109)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+_0xeb1828(0x100));}return{'ok':!![]};}if(!_0x499049[_0x62bd27])throw CliErrors['validation'](_0xeb1828(0x11b)+_0x62bd27+_0xeb1828(0x133),_0xeb1828(0x124)+(Object[_0xeb1828(0x12f)](_0x499049)[_0xeb1828(0x103)](',\x20')||_0xeb1828(0x128)));const _0x5ba8e2=detectPackageManager(_0x1f779c);VERSION_CHECK_SCRIPTS[_0xeb1828(0x130)](_0x62bd27)&&await versionCheck(_0x1f779c);if(_0x62bd27===_0xeb1828(0xfe)&&_0x39b8f5['bool'](_0xeb1828(0x11c)))return await Promise['all']([spawnViteBuildWatch(_0x1f779c),spawnVitePreview(_0x1f779c)]),{'ok':!![]};return await spawnScript(_0x5ba8e2,_0x62bd27,_0x49f159,_0x1f779c),{'ok':!![]};}};
@@ -1 +1 @@
1
- function a92_0x3aa3(){const _0x56bfd0=['12945slVADz','2625912hAZDGr','588JtVyMA','62MAhzXq','read','6577109MXRBLF','27bdaqkV','export','857115jYQRQe','2017224hZoAkW','24020100XNotZq','2280DYPAdW','Export\x20machine-readable\x20command\x20schema\x20(JSON)'];a92_0x3aa3=function(){return _0x56bfd0;};return a92_0x3aa3();}function a92_0x516e(_0x4f302b,_0x4e851b){_0x4f302b=_0x4f302b-0xd1;const _0x3aa36f=a92_0x3aa3();let _0x516e84=_0x3aa36f[_0x4f302b];return _0x516e84;}const a92_0xacebdf=a92_0x516e;(function(_0x58317a,_0x49154b){const _0x4ed44e=a92_0x516e,_0x2f72e2=_0x58317a();while(!![]){try{const _0x467804=-parseInt(_0x4ed44e(0xd6))/0x1*(-parseInt(_0x4ed44e(0xd9))/0x2)+parseInt(_0x4ed44e(0xd1))/0x3+-parseInt(_0x4ed44e(0xd2))/0x4+parseInt(_0x4ed44e(0xd4))/0x5*(-parseInt(_0x4ed44e(0xd8))/0x6)+-parseInt(_0x4ed44e(0xdb))/0x7+-parseInt(_0x4ed44e(0xd7))/0x8*(parseInt(_0x4ed44e(0xdc))/0x9)+parseInt(_0x4ed44e(0xd3))/0xa;if(_0x467804===_0x49154b)break;else _0x2f72e2['push'](_0x2f72e2['shift']());}catch(_0x59c525){_0x2f72e2['push'](_0x2f72e2['shift']());}}}(a92_0x3aa3,0x96520));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x32b646){const _0x113cb3=await buildSchemaPayload();return{'ok':!![],'data':_0x113cb3};}export const schemaDefinition={'service':'schema','command':a92_0xacebdf(0xdd),'description':a92_0xacebdf(0xd5),'risk':a92_0xacebdf(0xda),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};
1
+ function a93_0x370d(_0x243a10,_0x46175b){_0x243a10=_0x243a10-0x198;const _0x5e61f7=a93_0x5e61();let _0x370d34=_0x5e61f7[_0x243a10];return _0x370d34;}const a93_0x1b398f=a93_0x370d;(function(_0x32f3d0,_0x2ed6c8){const _0x34eb44=a93_0x370d,_0x5c3ac6=_0x32f3d0();while(!![]){try{const _0x453b24=parseInt(_0x34eb44(0x1a1))/0x1+parseInt(_0x34eb44(0x1a0))/0x2*(-parseInt(_0x34eb44(0x1a3))/0x3)+-parseInt(_0x34eb44(0x19a))/0x4+parseInt(_0x34eb44(0x19e))/0x5+parseInt(_0x34eb44(0x199))/0x6*(-parseInt(_0x34eb44(0x19c))/0x7)+-parseInt(_0x34eb44(0x1a4))/0x8+parseInt(_0x34eb44(0x1a2))/0x9*(parseInt(_0x34eb44(0x19b))/0xa);if(_0x453b24===_0x2ed6c8)break;else _0x5c3ac6['push'](_0x5c3ac6['shift']());}catch(_0x45673c){_0x5c3ac6['push'](_0x5c3ac6['shift']());}}}(a93_0x5e61,0x655c5));import{buildSchemaPayload}from'../framework/schema-export.js';function a93_0x5e61(){const _0x36ec19=['28AFrIzR','606821IaQiqO','9MmULuI','148515uaAtAs','226768IMTXDc','schema','export','Export\x20machine-readable\x20command\x20schema\x20(JSON)','317862Ueglwl','713100SQJlxK','8600050QZdatQ','105qVeWOp','read','3213465HxsByX','json'];a93_0x5e61=function(){return _0x36ec19;};return a93_0x5e61();}async function execute(_0xd0f649){const _0x166fcf=await buildSchemaPayload();return{'ok':!![],'data':_0x166fcf};}export const schemaDefinition={'service':a93_0x1b398f(0x1a5),'command':a93_0x1b398f(0x1a6),'description':a93_0x1b398f(0x198),'risk':a93_0x1b398f(0x19d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a93_0x1b398f(0x19f),'flags':[],'execute':execute};
@@ -1 +1 @@
1
- function a93_0x2d13(_0x4d3372,_0x5856e){_0x4d3372=_0x4d3372-0x1ab;const _0x34d974=a93_0x34d9();let _0x2d13f5=_0x34d974[_0x4d3372];return _0x2d13f5;}const a93_0x5129e3=a93_0x2d13;(function(_0x1ae2c1,_0x3086ee){const _0x2e0584=a93_0x2d13,_0x2498a4=_0x1ae2c1();while(!![]){try{const _0x2e560f=-parseInt(_0x2e0584(0x1b0))/0x1+parseInt(_0x2e0584(0x1bc))/0x2*(-parseInt(_0x2e0584(0x1b5))/0x3)+-parseInt(_0x2e0584(0x1c4))/0x4*(-parseInt(_0x2e0584(0x1be))/0x5)+-parseInt(_0x2e0584(0x1b8))/0x6+parseInt(_0x2e0584(0x1c1))/0x7*(-parseInt(_0x2e0584(0x1b4))/0x8)+parseInt(_0x2e0584(0x1b9))/0x9*(-parseInt(_0x2e0584(0x1ba))/0xa)+-parseInt(_0x2e0584(0x1bb))/0xb*(-parseInt(_0x2e0584(0x1c0))/0xc);if(_0x2e560f===_0x3086ee)break;else _0x2498a4['push'](_0x2498a4['shift']());}catch(_0xbe82b6){_0x2498a4['push'](_0x2498a4['shift']());}}}(a93_0x34d9,0xbcc8a));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';export const skillDefinitions=[{'service':'skill','command':a93_0x5129e3(0x1b3),'description':'Install\x20developer\x20skill\x20package','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2728a6){const _0x1aa973=a93_0x5129e3;logger[_0x1aa973(0x1b6)](process[_0x1aa973(0x1c5)]()),logger[_0x1aa973(0x1ab)](_0x1aa973(0x1b2),_0x1aa973(0x1ae));const {runNpxSkillsAddGlobal:_0x51d811}=await import(_0x1aa973(0x1c2)),_0x39469e=_0x2728a6[_0x1aa973(0x1ac)]?'pipe':'inherit';console[_0x1aa973(0x1c3)]('Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20-y\x20skills\x20add\x20lovrabet/rabetbase\x20--global)...');const _0x578e8a=_0x51d811(process[_0x1aa973(0x1c5)](),'lovrabet/rabetbase',{'stdio':_0x39469e});if(_0x578e8a[_0x1aa973(0x1bd)])console[_0x1aa973(0x1c3)](_0x1aa973(0x1bf));else{if(_0x578e8a['ok'])console[_0x1aa973(0x1c3)](CLI_BIN_NAME+_0x1aa973(0x1b7));else throw CliErrors[_0x1aa973(0x1b1)]('npx\x20skills\x20add\x20failed:\x20'+(_0x578e8a['error']||_0x1aa973(0x1ad)),_0x1aa973(0x1af));}return{'ok':!![]};}}];function a93_0x34d9(){const _0x464265=['install','1522336znhLEA','1470FlSPBJ','setLogPath','\x20skill\x20installed','6218250wFhqrT','13746141ryszce','10iHjggd','11IYGUer','5382KKgWME','skipped','411695MIKidy','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20skill\x20is\x20already\x20present.','75053868RaSIWp','28YElYqi','../../skills/npx-skills-add.js','log','4zNKiIA','cwd','info','nonInteractive','unknown','执行安装技能包命令(委托给\x20npx\x20skills\x20--global)','Check\x20network\x20connectivity\x20and\x20try\x20again.','920088vpqYAh','apiError','skill-install'];a93_0x34d9=function(){return _0x464265;};return a93_0x34d9();}
1
+ const a94_0x5f479a=a94_0x2137;function a94_0x3996(){const _0x315b7d=['596997HzSMGr','skill','setLogPath','inherit','write','npx\x20skills\x20add\x20failed:\x20','1790oTXZpc','1694536mumHfl','31912cDPHtF','lovrabet/rabetbase','install','9jRXQbb','20702HcHHLa','skipped','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20skill\x20is\x20already\x20present.','Install\x20developer\x20skill\x20package','892264muvnwO','630cQBZhJ','745525dTypgk','apiError','cwd','Check\x20network\x20connectivity\x20and\x20try\x20again.','9aFgwce','log','38745kiXtli','Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20-y\x20skills\x20add\x20lovrabet/rabetbase\x20--global)...','nonInteractive','pipe','skill-install','unknown'];a94_0x3996=function(){return _0x315b7d;};return a94_0x3996();}(function(_0x159ff5,_0x119efb){const _0x5afb3e=a94_0x2137,_0x2d026b=_0x159ff5();while(!![]){try{const _0x1c6f9a=parseInt(_0x5afb3e(0x121))/0x1+parseInt(_0x5afb3e(0x129))/0x2*(parseInt(_0x5afb3e(0x12c))/0x3)+parseInt(_0x5afb3e(0x131))/0x4+parseInt(_0x5afb3e(0x133))/0x5+parseInt(_0x5afb3e(0x132))/0x6*(-parseInt(_0x5afb3e(0x11b))/0x7)+parseInt(_0x5afb3e(0x128))/0x8*(parseInt(_0x5afb3e(0x119))/0x9)+-parseInt(_0x5afb3e(0x127))/0xa*(parseInt(_0x5afb3e(0x12d))/0xb);if(_0x1c6f9a===_0x119efb)break;else _0x2d026b['push'](_0x2d026b['shift']());}catch(_0x4011e4){_0x2d026b['push'](_0x2d026b['shift']());}}}(a94_0x3996,0x4be10));function a94_0x2137(_0x334952,_0x2ada51){_0x334952=_0x334952-0x117;const _0x3996d9=a94_0x3996();let _0x2137de=_0x3996d9[_0x334952];return _0x2137de;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';export const skillDefinitions=[{'service':a94_0x5f479a(0x122),'command':a94_0x5f479a(0x12b),'description':a94_0x5f479a(0x130),'risk':a94_0x5f479a(0x125),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x232ea3){const _0x442720=a94_0x5f479a;logger[_0x442720(0x123)](process[_0x442720(0x117)]()),logger['info'](_0x442720(0x11f),'执行安装技能包命令(委托给\x20npx\x20skills\x20--global)');const {runNpxSkillsAddGlobal:_0x560d5d}=await import('../../skills/npx-skills-add.js'),_0x536e70=_0x232ea3[_0x442720(0x11d)]?_0x442720(0x11e):_0x442720(0x124);console[_0x442720(0x11a)](_0x442720(0x11c));const _0x2302a6=_0x560d5d(process[_0x442720(0x117)](),_0x442720(0x12a),{'stdio':_0x536e70});if(_0x2302a6[_0x442720(0x12e)])console[_0x442720(0x11a)](_0x442720(0x12f));else{if(_0x2302a6['ok'])console[_0x442720(0x11a)](CLI_BIN_NAME+'\x20skill\x20installed');else throw CliErrors[_0x442720(0x134)](_0x442720(0x126)+(_0x2302a6['error']||_0x442720(0x120)),_0x442720(0x118));}return{'ok':!![]};}}];
@@ -1 +1 @@
1
- const a94_0x256bfb=a94_0x2e1b;(function(_0x3a6ce7,_0x3bb31d){const _0xa59d7f=a94_0x2e1b,_0x3184bf=_0x3a6ce7();while(!![]){try{const _0x3f3170=-parseInt(_0xa59d7f(0x68))/0x1*(-parseInt(_0xa59d7f(0x67))/0x2)+parseInt(_0xa59d7f(0x75))/0x3*(parseInt(_0xa59d7f(0x77))/0x4)+-parseInt(_0xa59d7f(0x7b))/0x5*(-parseInt(_0xa59d7f(0x74))/0x6)+parseInt(_0xa59d7f(0x78))/0x7+parseInt(_0xa59d7f(0x7a))/0x8+-parseInt(_0xa59d7f(0x6d))/0x9*(-parseInt(_0xa59d7f(0x79))/0xa)+-parseInt(_0xa59d7f(0x71))/0xb;if(_0x3f3170===_0x3bb31d)break;else _0x3184bf['push'](_0x3184bf['shift']());}catch(_0x4b5d64){_0x3184bf['push'](_0x3184bf['shift']());}}}(a94_0x455a,0x70a3c));import{getSqlQueryInfo}from'../../core/api-client.js';import{getDbName}from'../../core/db-resolver.js';function a94_0x2e1b(_0x49e072,_0x50669d){_0x49e072=_0x49e072-0x67;const _0x455ad5=a94_0x455a();let _0x2e1b28=_0x455ad5[_0x49e072];return _0x2e1b28;}function a94_0x455a(){const _0x31f314=['4AdqAoW','5201028XGrpGb','573470LiidmD','1302568PLvdEg','35FLMJbv','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','detail','10cUJUAr','120473mvMxxE','verbose','sqlContent','dbId','description','9NhvVOi','sqlcode','appCode','Return\x20full\x20raw\x20SQL\x20query\x20object','23062490NybRnn','sql','str','109062vhZaza','2595558eXUJgf','sqlCode'];a94_0x455a=function(){return _0x31f314;};return a94_0x455a();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a94_0x256bfb(0x72),'command':a94_0x256bfb(0x7d),'description':a94_0x256bfb(0x7c),'risk':'read','flags':[SQLCODE_FLAG,{'name':'verbose','type':'boolean','description':a94_0x256bfb(0x70)}],async 'execute'(_0x6a97bc){const _0x54245c=a94_0x256bfb,_0x521cf4=await getSqlQueryInfo(_0x6a97bc[_0x54245c(0x6f)],_0x6a97bc[_0x54245c(0x73)](_0x54245c(0x6e))),_0xf75e50=_0x6a97bc['bool'](_0x54245c(0x69));if(_0xf75e50)return{'ok':!![],'data':_0x521cf4};const _0x30e4f4=_0x521cf4[_0x54245c(0x6b)]?await getDbName(_0x6a97bc[_0x54245c(0x6f)],_0x521cf4[_0x54245c(0x6b)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x521cf4[_0x54245c(0x76)],'sqlName':_0x521cf4['sqlName'],'db':_0x30e4f4?_0x30e4f4+'\x20('+_0x521cf4[_0x54245c(0x6b)]+')':_0x521cf4[_0x54245c(0x6b)]??'','description':_0x521cf4[_0x54245c(0x6c)]??'','sqlContent':_0x521cf4[_0x54245c(0x6a)]??''}};}};
1
+ const a95_0x4d9378=a95_0x1115;(function(_0x282689,_0x383f46){const _0x494181=a95_0x1115,_0x22ed94=_0x282689();while(!![]){try{const _0x12b8f4=parseInt(_0x494181(0x1dc))/0x1+parseInt(_0x494181(0x1db))/0x2*(-parseInt(_0x494181(0x1d6))/0x3)+-parseInt(_0x494181(0x1cb))/0x4+parseInt(_0x494181(0x1cd))/0x5*(parseInt(_0x494181(0x1cf))/0x6)+-parseInt(_0x494181(0x1d1))/0x7+parseInt(_0x494181(0x1d2))/0x8+parseInt(_0x494181(0x1ce))/0x9*(-parseInt(_0x494181(0x1d9))/0xa);if(_0x12b8f4===_0x383f46)break;else _0x22ed94['push'](_0x22ed94['shift']());}catch(_0x127de4){_0x22ed94['push'](_0x22ed94['shift']());}}}(a95_0x5751,0x491ab));import{getSqlQueryInfo}from'../../core/api-client.js';function a95_0x1115(_0xaccc5f,_0x4425fe){_0xaccc5f=_0xaccc5f-0x1ca;const _0x5751fa=a95_0x5751();let _0x1115e5=_0x5751fa[_0xaccc5f];return _0x1115e5;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':'sql','command':'detail','description':a95_0x4d9378(0x1d0),'risk':a95_0x4d9378(0x1e0),'flags':[SQLCODE_FLAG,{'name':a95_0x4d9378(0x1d8),'type':a95_0x4d9378(0x1da),'description':a95_0x4d9378(0x1cc)}],async 'execute'(_0x233a92){const _0x59dcb0=a95_0x4d9378,_0x5cdeee=await getSqlQueryInfo(_0x233a92[_0x59dcb0(0x1d3)],_0x233a92[_0x59dcb0(0x1de)](_0x59dcb0(0x1d7))),_0x21466a=_0x233a92[_0x59dcb0(0x1dd)](_0x59dcb0(0x1d8));if(_0x21466a)return{'ok':!![],'data':_0x5cdeee};const _0x29b470=_0x5cdeee[_0x59dcb0(0x1df)]?await getDbName(_0x233a92[_0x59dcb0(0x1d3)],_0x5cdeee[_0x59dcb0(0x1df)]):undefined;return{'ok':!![],'data':{'sqlCode':_0x5cdeee[_0x59dcb0(0x1d4)],'sqlName':_0x5cdeee[_0x59dcb0(0x1d5)],'db':_0x29b470?_0x29b470+'\x20('+_0x5cdeee[_0x59dcb0(0x1df)]+')':_0x5cdeee[_0x59dcb0(0x1df)]??'','description':_0x5cdeee[_0x59dcb0(0x1ca)]??'','sqlContent':_0x5cdeee['sqlContent']??''}};}};function a95_0x5751(){const _0x4afa2c=['sqlCode','sqlName','2964IkYzru','sqlcode','verbose','194820vsAwmP','boolean','566DHgcHi','369720WsexBT','bool','str','dbId','read','description','601264foOGTS','Return\x20full\x20raw\x20SQL\x20query\x20object','125KuwzqJ','9nqrVBb','71916wXjraa','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','920682WWYycC','1687944npPcAg','appCode'];a95_0x5751=function(){return _0x4afa2c;};return a95_0x5751();}
@@ -1 +1 @@
1
- function a95_0x2d74(_0x21d865,_0x4372a2){_0x21d865=_0x21d865-0x76;const _0x23bdaa=a95_0x23bd();let _0x2d747b=_0x23bdaa[_0x21d865];return _0x2d747b;}const a95_0x2f19e5=a95_0x2d74;(function(_0x5acac0,_0x4d6dc9){const _0xd8e9df=a95_0x2d74,_0x301275=_0x5acac0();while(!![]){try{const _0x916bb3=-parseInt(_0xd8e9df(0x92))/0x1*(parseInt(_0xd8e9df(0x76))/0x2)+parseInt(_0xd8e9df(0x7a))/0x3+-parseInt(_0xd8e9df(0x84))/0x4*(parseInt(_0xd8e9df(0x82))/0x5)+-parseInt(_0xd8e9df(0x85))/0x6*(-parseInt(_0xd8e9df(0x94))/0x7)+-parseInt(_0xd8e9df(0x8c))/0x8+parseInt(_0xd8e9df(0x7b))/0x9*(parseInt(_0xd8e9df(0x81))/0xa)+parseInt(_0xd8e9df(0x8e))/0xb*(parseInt(_0xd8e9df(0x87))/0xc);if(_0x916bb3===_0x4d6dc9)break;else _0x301275['push'](_0x301275['shift']());}catch(_0x2168bb){_0x301275['push'](_0x301275['shift']());}}}(a95_0x23bd,0x5274b));function a95_0x23bd(){const _0x580d3c=['178077cAnjnO','1425555vHDhhH','SQL\x20execution\x20failed','isArray','string','sqlcode','now','30nSvdxG','6985RhFgPE','params','1036bzjrzE','24Bpdcyj','sql','12tdKGJP','execResult','execSuccess','parse','\x20row(s)\x20in\x20','3202552FaoMxR','validation','2575639UxCMlF','Returned\x20','execError','str','56976pVYMGf','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','878703pnVJof','6wwbCeJ','exec','Invalid\x20JSON\x20for\x20--params:\x20','length'];a95_0x23bd=function(){return _0x580d3c;};return a95_0x23bd();}import{executeSql}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlExec={'service':a95_0x2f19e5(0x86),'command':a95_0x2f19e5(0x77),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':'read','flags':[SQLCODE_FLAG,{'name':a95_0x2f19e5(0x83),'type':a95_0x2f19e5(0x7e),'description':a95_0x2f19e5(0x93)}],async 'execute'(_0x117105){const _0x7fc9fd=a95_0x2f19e5;let _0x356a6d;const _0x177b93=_0x117105['str'](_0x7fc9fd(0x83));if(_0x177b93)try{_0x356a6d=JSON[_0x7fc9fd(0x8a)](_0x177b93);}catch{throw CliErrors[_0x7fc9fd(0x8d)](_0x7fc9fd(0x78)+_0x177b93);}const _0x57c32f=Date[_0x7fc9fd(0x80)](),_0x4645a6=await executeSql(_0x117105['appCode'],_0x117105[_0x7fc9fd(0x91)](_0x7fc9fd(0x7f)),_0x356a6d),_0x16c5e1=Date[_0x7fc9fd(0x80)]()-_0x57c32f,_0x1c2097=_0x4645a6?.[_0x7fc9fd(0x88)]??_0x4645a6,_0x1b7e28=_0x4645a6?.[_0x7fc9fd(0x89)]??!![];if(!_0x1b7e28)return{'ok':![],'data':{'error':_0x4645a6?.[_0x7fc9fd(0x90)]||_0x7fc9fd(0x7c),'elapsed':_0x16c5e1},'message':'SQL\x20execution\x20failed'};const _0x160e81=Array[_0x7fc9fd(0x7d)](_0x1c2097)?_0x1c2097:[];return{'ok':!![],'data':{'rows':_0x160e81,'rowCount':_0x160e81[_0x7fc9fd(0x79)],'elapsed':_0x16c5e1},'message':_0x7fc9fd(0x8f)+_0x160e81['length']+_0x7fc9fd(0x8b)+_0x16c5e1+'ms'};}};
1
+ const a96_0x17f68a=a96_0x192c;function a96_0x4a00(){const _0x41c931=['SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','read','now','307578yfnwTW','1679544MpYanB','171IIPtMi','Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','string','SQL\x20execution\x20failed','sqlcode','10NeZPFq','parse','8NeOfTE','468942JduQaA','1642669EVqzeI','validation','252224BhrhZt','params','appCode','sql','11SMjvnd','\x20row(s)\x20in\x20','length','128433KxhXBl','Returned\x20','str','3CmtrUD','31160xCQkTR','execError','isArray','execResult'];a96_0x4a00=function(){return _0x41c931;};return a96_0x4a00();}function a96_0x192c(_0x5d535f,_0x3620d0){_0x5d535f=_0x5d535f-0x78;const _0x4a006a=a96_0x4a00();let _0x192ced=_0x4a006a[_0x5d535f];return _0x192ced;}(function(_0x2d5db0,_0x34b6d9){const _0x1210f6=a96_0x192c,_0x243000=_0x2d5db0();while(!![]){try{const _0x5c300f=-parseInt(_0x1210f6(0x95))/0x1+parseInt(_0x1210f6(0x8b))/0x2*(-parseInt(_0x1210f6(0x79))/0x3)+parseInt(_0x1210f6(0x8e))/0x4+parseInt(_0x1210f6(0x88))/0x5*(parseInt(_0x1210f6(0x81))/0x6)+-parseInt(_0x1210f6(0x8c))/0x7*(-parseInt(_0x1210f6(0x8a))/0x8)+parseInt(_0x1210f6(0x83))/0x9*(-parseInt(_0x1210f6(0x7a))/0xa)+-parseInt(_0x1210f6(0x92))/0xb*(-parseInt(_0x1210f6(0x82))/0xc);if(_0x5c300f===_0x34b6d9)break;else _0x243000['push'](_0x243000['shift']());}catch(_0xcef8ca){_0x243000['push'](_0x243000['shift']());}}}(a96_0x4a00,0x1cd57));import{executeSql}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlExec={'service':a96_0x17f68a(0x91),'command':'exec','description':a96_0x17f68a(0x84),'risk':a96_0x17f68a(0x7f),'flags':[SQLCODE_FLAG,{'name':a96_0x17f68a(0x8f),'type':a96_0x17f68a(0x85),'description':a96_0x17f68a(0x7e)}],async 'execute'(_0x198e11){const _0x4945f5=a96_0x17f68a;let _0x3551f1;const _0x3605b2=_0x198e11[_0x4945f5(0x78)](_0x4945f5(0x8f));if(_0x3605b2)try{_0x3551f1=JSON[_0x4945f5(0x89)](_0x3605b2);}catch{throw CliErrors[_0x4945f5(0x8d)]('Invalid\x20JSON\x20for\x20--params:\x20'+_0x3605b2);}const _0x2f49bc=Date['now'](),_0x2aa1d6=await executeSql(_0x198e11[_0x4945f5(0x90)],_0x198e11[_0x4945f5(0x78)](_0x4945f5(0x87)),_0x3551f1),_0x3cd8f3=Date[_0x4945f5(0x80)]()-_0x2f49bc,_0x21a309=_0x2aa1d6?.[_0x4945f5(0x7d)]??_0x2aa1d6,_0x23302c=_0x2aa1d6?.['execSuccess']??!![];if(!_0x23302c)return{'ok':![],'data':{'error':_0x2aa1d6?.[_0x4945f5(0x7b)]||'SQL\x20execution\x20failed','elapsed':_0x3cd8f3},'message':_0x4945f5(0x86)};const _0x794be0=Array[_0x4945f5(0x7c)](_0x21a309)?_0x21a309:[];return{'ok':!![],'data':{'rows':_0x794be0,'rowCount':_0x794be0[_0x4945f5(0x94)],'elapsed':_0x3cd8f3},'message':_0x4945f5(0x96)+_0x794be0[_0x4945f5(0x94)]+_0x4945f5(0x93)+_0x3cd8f3+'ms'};}};
@@ -1 +1 @@
1
- (function(_0x46a909,_0x423be1){const _0x5c6459=a96_0x1dde,_0x3ba518=_0x46a909();while(!![]){try{const _0x277831=-parseInt(_0x5c6459(0x1ee))/0x1*(parseInt(_0x5c6459(0x1ed))/0x2)+parseInt(_0x5c6459(0x1f5))/0x3*(parseInt(_0x5c6459(0x1f8))/0x4)+-parseInt(_0x5c6459(0x1f4))/0x5*(parseInt(_0x5c6459(0x1ec))/0x6)+-parseInt(_0x5c6459(0x1f3))/0x7*(parseInt(_0x5c6459(0x1f1))/0x8)+parseInt(_0x5c6459(0x1ef))/0x9*(parseInt(_0x5c6459(0x1f2))/0xa)+-parseInt(_0x5c6459(0x1f9))/0xb*(parseInt(_0x5c6459(0x1f0))/0xc)+parseInt(_0x5c6459(0x1f6))/0xd*(parseInt(_0x5c6459(0x1f7))/0xe);if(_0x277831===_0x423be1)break;else _0x3ba518['push'](_0x3ba518['shift']());}catch(_0xdac9d0){_0x3ba518['push'](_0x3ba518['shift']());}}}(a96_0x18cd,0xa0676));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';import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlValidate,sqlSave,sqlExec,sqlPull];function a96_0x1dde(_0x51a0e8,_0x456209){_0x51a0e8=_0x51a0e8-0x1ec;const _0x18cdb5=a96_0x18cd();let _0x1dde3a=_0x18cdb5[_0x51a0e8];return _0x1dde3a;}function a96_0x18cd(){const _0x345b1b=['18WdLPMu','2HHZlqP','474711hqWWdD','9GfwfCU','108mmeMlQ','2922968nsOBgR','11918820dlrMCw','7irDksx','1827615tLtRFi','81NbNkJE','3991JEdDOH','62958fQwbQK','153932NvXjXL','1244023KvGQWA'];a96_0x18cd=function(){return _0x345b1b;};return a96_0x18cd();}
1
+ (function(_0x554269,_0x245958){const _0x4f7802=a97_0x40ba,_0x4eebcb=_0x554269();while(!![]){try{const _0x5e9c4b=-parseInt(_0x4f7802(0x129))/0x1*(parseInt(_0x4f7802(0x12a))/0x2)+parseInt(_0x4f7802(0x126))/0x3*(-parseInt(_0x4f7802(0x125))/0x4)+parseInt(_0x4f7802(0x127))/0x5+-parseInt(_0x4f7802(0x12c))/0x6+-parseInt(_0x4f7802(0x128))/0x7*(parseInt(_0x4f7802(0x12e))/0x8)+parseInt(_0x4f7802(0x12b))/0x9*(parseInt(_0x4f7802(0x123))/0xa)+parseInt(_0x4f7802(0x124))/0xb*(parseInt(_0x4f7802(0x12d))/0xc);if(_0x5e9c4b===_0x245958)break;else _0x4eebcb['push'](_0x4eebcb['shift']());}catch(_0x16b93e){_0x4eebcb['push'](_0x4eebcb['shift']());}}}(a97_0x37cd,0x5039c));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 a97_0x37cd(){const _0x49c73b=['10yHbYnu','11972059ULYEdb','28ctQAAb','274653aTwciZ','2276455yilAZF','7VQgKJl','1GQzlIf','943244ZqqDQe','3470490VbmQFQ','883356qJQvMK','12QCHHtN','2727688TAHVuJ'];a97_0x37cd=function(){return _0x49c73b;};return a97_0x37cd();}function a97_0x40ba(_0x2fbba1,_0xc49dfb){_0x2fbba1=_0x2fbba1-0x123;const _0x37cdff=a97_0x37cd();let _0x40ba05=_0x37cdff[_0x2fbba1];return _0x40ba05;}import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlValidate,sqlSave,sqlExec,sqlPull];
@@ -1 +1 @@
1
- function a97_0x2944(){const _0x478511=['sqlCode','all','5832610NwaMYa','5229190jQOjfs','Found\x20','list','str','154AcPFah','7fHxOKm','read','11vYbcap','map','tableData','6nMsvTl','appCode','num','sqlName','description','boolean','\x20SQL\x20queries\x20(total:\x20','Page\x20size','15wDTSrJ','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','Page\x20number','verbose','paging','10374128XfWBva','5003sCMgtJ','totalCount','1810464NMhnCw','page','bool','6758739vbGeWd','number','length','642364UHRHrl','No\x20custom\x20SQL\x20queries\x20found.','sql','name','dbId','pagesize'];a97_0x2944=function(){return _0x478511;};return a97_0x2944();}const a97_0x2a2d89=a97_0xad83;function a97_0xad83(_0x4099fd,_0x3e16bf){_0x4099fd=_0x4099fd-0xe1;const _0x294473=a97_0x2944();let _0xad830=_0x294473[_0x4099fd];return _0xad830;}(function(_0x344a4e,_0x2eb499){const _0x25c269=a97_0xad83,_0x1b2f57=_0x344a4e();while(!![]){try{const _0x4e9c20=parseInt(_0x25c269(0xf6))/0x1*(-parseInt(_0x25c269(0xe2))/0x2)+-parseInt(_0x25c269(0xf0))/0x3*(-parseInt(_0x25c269(0xfe))/0x4)+parseInt(_0x25c269(0x107))/0x5*(-parseInt(_0x25c269(0xe8))/0x6)+parseInt(_0x25c269(0xe3))/0x7*(parseInt(_0x25c269(0xf5))/0x8)+-parseInt(_0x25c269(0xfb))/0x9+parseInt(_0x25c269(0x106))/0xa+-parseInt(_0x25c269(0xe5))/0xb*(-parseInt(_0x25c269(0xf8))/0xc);if(_0x4e9c20===_0x2eb499)break;else _0x1b2f57['push'](_0x1b2f57['shift']());}catch(_0x17381d){_0x1b2f57['push'](_0x1b2f57['shift']());}}}(a97_0x2944,0x9f226));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':a97_0x2a2d89(0x100),'command':a97_0x2a2d89(0x109),'description':'List\x20custom\x20SQL\x20queries','risk':a97_0x2a2d89(0xe4),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a97_0x2a2d89(0x101),'type':'string','description':'Filter\x20by\x20SQL\x20name'},{'name':a97_0x2a2d89(0xf9),'type':a97_0x2a2d89(0xfc),'description':a97_0x2a2d89(0xf2),'default':0x1},{'name':a97_0x2a2d89(0x103),'type':'number','description':a97_0x2a2d89(0xef)},{'name':a97_0x2a2d89(0xf3),'type':a97_0x2a2d89(0xed),'description':a97_0x2a2d89(0xf1)}],async 'execute'(_0x36ea58){const _0x76c60d=a97_0x2a2d89,_0x52e752=await listSqlQueries(_0x36ea58[_0x76c60d(0xe9)],{'sqlCode':_0x36ea58[_0x76c60d(0xe1)]('sqlcode')||undefined,'sqlName':_0x36ea58[_0x76c60d(0xe1)](_0x76c60d(0x101))||undefined,'currentPage':_0x36ea58['num'](_0x76c60d(0xf9)),'pageSize':_0x36ea58[_0x76c60d(0xea)](_0x76c60d(0x103),0x32)}),_0x43f700=_0x36ea58[_0x76c60d(0xfa)](_0x76c60d(0xf3)),_0x275db3=_0x52e752[_0x76c60d(0xe7)]??[],_0x3e0687=_0x52e752[_0x76c60d(0xf4)]?.[_0x76c60d(0xf7)]??_0x275db3[_0x76c60d(0xfd)];let _0x175e9e;return _0x43f700?_0x175e9e=_0x275db3:_0x175e9e=await Promise[_0x76c60d(0x105)](_0x275db3[_0x76c60d(0xe6)](async _0xec32e3=>{const _0x4b3225=_0x76c60d;let _0x48ebac;try{_0x48ebac=_0xec32e3[_0x4b3225(0x102)]?await getDbName(_0x36ea58['appCode'],_0xec32e3[_0x4b3225(0x102)]):undefined;}catch{}return{'sqlCode':_0xec32e3[_0x4b3225(0x104)],'sqlName':_0xec32e3[_0x4b3225(0xeb)],'description':_0xec32e3[_0x4b3225(0xec)]??'','db':_0x48ebac?_0x48ebac+'\x20('+_0xec32e3['dbId']+')':_0xec32e3[_0x4b3225(0x102)]??''};})),{'ok':!![],'data':_0x175e9e,'message':_0x275db3[_0x76c60d(0xfd)]===0x0?_0x76c60d(0xff):_0x76c60d(0x108)+_0x275db3[_0x76c60d(0xfd)]+_0x76c60d(0xee)+_0x3e0687+').'};}};
1
+ const a98_0x3a3317=a98_0x1fa7;function a98_0x420e(){const _0x348d78=['verbose','4899282DJJbLL','length','totalCount','description','name','number','List\x20custom\x20SQL\x20queries','12AJuLzN','paging','page','Page\x20number','sqlCode','7nHIyGn','string','sql','4406488cmdTBw','read','36iaUZAp','num','2OniZhD','18CwfiWW','\x20SQL\x20queries\x20(total:\x20','Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content','Found\x20','636880TsnhXp','14686023AYaRgS','2533092monicX','str','4626250hBwUWx','pagesize','map','1528145nCGKKe','all','Filter\x20by\x20SQL\x20name','boolean','dbId','appCode','tableData'];a98_0x420e=function(){return _0x348d78;};return a98_0x420e();}(function(_0x6eb6cd,_0x2460d7){const _0x5ca7be=a98_0x1fa7,_0x139d88=_0x6eb6cd();while(!![]){try{const _0x37e861=parseInt(_0x5ca7be(0x11f))/0x1+-parseInt(_0x5ca7be(0x11a))/0x2*(parseInt(_0x5ca7be(0x121))/0x3)+-parseInt(_0x5ca7be(0x10e))/0x4*(parseInt(_0x5ca7be(0x126))/0x5)+-parseInt(_0x5ca7be(0x12e))/0x6+-parseInt(_0x5ca7be(0x113))/0x7*(parseInt(_0x5ca7be(0x116))/0x8)+-parseInt(_0x5ca7be(0x11b))/0x9*(parseInt(_0x5ca7be(0x123))/0xa)+-parseInt(_0x5ca7be(0x120))/0xb*(-parseInt(_0x5ca7be(0x118))/0xc);if(_0x37e861===_0x2460d7)break;else _0x139d88['push'](_0x139d88['shift']());}catch(_0x5d43b1){_0x139d88['push'](_0x139d88['shift']());}}}(a98_0x420e,0x8fa0c));import{listSqlQueries}from'../../core/api-client.js';function a98_0x1fa7(_0x36333b,_0x33db3c){_0x36333b=_0x36333b-0x10a;const _0x420e23=a98_0x420e();let _0x1fa779=_0x420e23[_0x36333b];return _0x1fa779;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a98_0x3a3317(0x115),'command':'list','description':a98_0x3a3317(0x10d),'risk':a98_0x3a3317(0x117),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a98_0x3a3317(0x10b),'type':a98_0x3a3317(0x114),'description':a98_0x3a3317(0x128)},{'name':a98_0x3a3317(0x110),'type':'number','description':a98_0x3a3317(0x111),'default':0x1},{'name':a98_0x3a3317(0x124),'type':a98_0x3a3317(0x10c),'description':'Page\x20size'},{'name':a98_0x3a3317(0x12d),'type':a98_0x3a3317(0x129),'description':a98_0x3a3317(0x11d)}],async 'execute'(_0x215043){const _0x17aab1=a98_0x3a3317,_0xddfaf4=await listSqlQueries(_0x215043[_0x17aab1(0x12b)],{'sqlCode':_0x215043['str']('sqlcode')||undefined,'sqlName':_0x215043[_0x17aab1(0x122)](_0x17aab1(0x10b))||undefined,'currentPage':_0x215043[_0x17aab1(0x119)](_0x17aab1(0x110)),'pageSize':_0x215043['num'](_0x17aab1(0x124),0x32)}),_0x38d573=_0x215043['bool']('verbose'),_0x609a13=_0xddfaf4[_0x17aab1(0x12c)]??[],_0x4ce496=_0xddfaf4[_0x17aab1(0x10f)]?.[_0x17aab1(0x130)]??_0x609a13[_0x17aab1(0x12f)];let _0x32c43d;return _0x38d573?_0x32c43d=_0x609a13:_0x32c43d=await Promise[_0x17aab1(0x127)](_0x609a13[_0x17aab1(0x125)](async _0x3c5d3b=>{const _0x8edaa2=_0x17aab1;let _0x2a3e32;try{_0x2a3e32=_0x3c5d3b[_0x8edaa2(0x12a)]?await getDbName(_0x215043[_0x8edaa2(0x12b)],_0x3c5d3b[_0x8edaa2(0x12a)]):undefined;}catch{}return{'sqlCode':_0x3c5d3b[_0x8edaa2(0x112)],'sqlName':_0x3c5d3b['sqlName'],'description':_0x3c5d3b[_0x8edaa2(0x10a)]??'','db':_0x2a3e32?_0x2a3e32+'\x20('+_0x3c5d3b['dbId']+')':_0x3c5d3b[_0x8edaa2(0x12a)]??''};})),{'ok':!![],'data':_0x32c43d,'message':_0x609a13[_0x17aab1(0x12f)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':_0x17aab1(0x11e)+_0x609a13[_0x17aab1(0x12f)]+_0x17aab1(0x11c)+_0x4ce496+').'};}};
@@ -1 +1 @@
1
- const a98_0x4fe761=a98_0xeb5c;(function(_0x497aca,_0xa78ca2){const _0x5849f4=a98_0xeb5c,_0x19e347=_0x497aca();while(!![]){try{const _0x3fc2b8=-parseInt(_0x5849f4(0x149))/0x1*(-parseInt(_0x5849f4(0x13d))/0x2)+parseInt(_0x5849f4(0x12e))/0x3+parseInt(_0x5849f4(0x125))/0x4*(parseInt(_0x5849f4(0x147))/0x5)+-parseInt(_0x5849f4(0x146))/0x6*(-parseInt(_0x5849f4(0x141))/0x7)+-parseInt(_0x5849f4(0x150))/0x8*(parseInt(_0x5849f4(0x142))/0x9)+parseInt(_0x5849f4(0x13a))/0xa+-parseInt(_0x5849f4(0x128))/0xb;if(_0x3fc2b8===_0xa78ca2)break;else _0x19e347['push'](_0x19e347['shift']());}catch(_0x3a1896){_0x19e347['push'](_0x19e347['shift']());}}}(a98_0x18e8,0xcda1c));import{createInterface}from'node:readline';import{readFile,writeFile}from'node:fs/promises';function a98_0x18e8(){const _0x58325a=['includes','Pull\x20remote\x20custom\x20SQL\x20queries\x20into\x20.rabetbase/sql/','boolean','No\x20remote\x20SQL\x20queries\x20matched.','18960XacKXE','length','yes','sqlName','conflict','would_pull','bool','close','sqlContent','2536760TQbvvb','force','\x20skipped,\x20','42463190ETPaEV','utf8','totalCount','name','unchanged','Filter\x20by\x20SQL\x20display\x20name\x20(API\x20filter)','2372169zQKhkq','nonInteractive','sql','paging','sqlCode','appCode','str','\x20failed','string','sqlcode','Pull\x20failed:\x20could\x20not\x20load\x20SQL\x20content\x20(','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.\x20Continue?\x20[y/N]\x20','16527950MuLAdd','write','/smartapi/custom/queryUserCustomSqlList','2740988LvhDlt','stdin','toLowerCase','cancelled','1056503HarviX','3735sialyr','stderr','\x20error(s)).','push','24HKqnmS','10XDghFN','message','1YAfIwc','trim','skipped'];a98_0x18e8=function(){return _0x58325a;};return a98_0x18e8();}import{join}from'node:path';import{getSqlQueryInfo,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';import{findProjectRootDirectory}from'../../context.js';import{assignSqlFileNames,buildPulledSqlFileContent,resolveSqlLocalDir}from'../../commands/sql/shared.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x583b60,_0x571bfa){const _0x1c881c=a98_0xeb5c,_0x290d76=[];let _0xed75ad=0x1;while(!![]){const _0x588d87=await listSqlQueries(_0x583b60,{'currentPage':_0xed75ad,'pageSize':PAGE_SIZE,'sqlCode':_0x571bfa['sqlCode'],'sqlName':_0x571bfa[_0x1c881c(0x153)]}),_0x1b82e1=_0x588d87['tableData']??[];_0x290d76[_0x1c881c(0x145)](..._0x1b82e1);if(_0x1b82e1[_0x1c881c(0x151)]===0x0)break;const _0x537af5=_0x588d87[_0x1c881c(0x131)]?.[_0x1c881c(0x12a)];if(_0x537af5!=null?_0x290d76[_0x1c881c(0x151)]>=_0x537af5:_0x1b82e1[_0x1c881c(0x151)]<PAGE_SIZE)break;_0xed75ad++;}return _0x290d76;}async function ensureSqlContent(_0x44c935,_0x5981ac){const _0x230945=a98_0xeb5c;if(_0x5981ac[_0x230945(0x124)]!=null&&String(_0x5981ac[_0x230945(0x124)])[_0x230945(0x151)]>0x0)return _0x5981ac;return getSqlQueryInfo(_0x44c935,_0x5981ac[_0x230945(0x132)]);}function a98_0xeb5c(_0x48504a,_0x4a7396){_0x48504a=_0x48504a-0x123;const _0x18e8e2=a98_0x18e8();let _0xeb5ced=_0x18e8e2[_0x48504a];return _0xeb5ced;}export const sqlPull={'service':a98_0x4fe761(0x130),'command':'pull','description':a98_0x4fe761(0x14d),'risk':a98_0x4fe761(0x13b),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a98_0x4fe761(0x12b),'type':a98_0x4fe761(0x136),'description':a98_0x4fe761(0x12d)},{'name':a98_0x4fe761(0x126),'type':a98_0x4fe761(0x14e),'description':'Overwrite\x20local\x20files\x20that\x20differ\x20from\x20remote'}],async 'dryRun'(_0x546f2b){const _0xdb96f5=a98_0x4fe761,_0xa58ed9=findProjectRootDirectory(),_0x23eaa5=resolveSqlLocalDir(_0xa58ed9),_0x7824e4=_0x546f2b[_0xdb96f5(0x134)](_0xdb96f5(0x137))||undefined,_0x1a5f9f=_0x546f2b[_0xdb96f5(0x134)]('name')||undefined,_0x5abc31=await fetchAllSqlQueries(_0x546f2b[_0xdb96f5(0x133)],{'sqlCode':_0x7824e4,'sqlName':_0x1a5f9f}),_0x1743eb=[],_0x4df210=[];for(const _0xd419f7 of _0x5abc31){try{_0x1743eb[_0xdb96f5(0x145)](await ensureSqlContent(_0x546f2b[_0xdb96f5(0x133)],_0xd419f7));}catch(_0x3ba109){_0x4df210['push']({'sqlCode':_0xd419f7[_0xdb96f5(0x132)],'error':_0x3ba109 instanceof Error?_0x3ba109[_0xdb96f5(0x148)]:String(_0x3ba109)});}}const _0x252db0=assignSqlFileNames(_0x1743eb),_0x1c3d55=[];for(const [_0x1a46d2,_0x532676]of _0x252db0){const _0xadf02f=join(_0x23eaa5,_0x1a46d2),_0x3457af=buildPulledSqlFileContent(_0x532676);let _0x1f4699=_0xdb96f5(0x155),_0x58223b;if(await fileExists(_0xadf02f)){const _0x1a70ff=await readFile(_0xadf02f,_0xdb96f5(0x129));_0x1a70ff===_0x3457af?(_0x1f4699=_0xdb96f5(0x14b),_0x58223b=_0xdb96f5(0x12c)):(_0x1f4699=_0xdb96f5(0x154),_0x58223b='local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)');}_0x1c3d55[_0xdb96f5(0x145)]({'sqlCode':_0x532676[_0xdb96f5(0x132)],'sqlName':_0x532676['sqlName'],'filePath':_0xadf02f,'status':_0x1f4699,'reason':_0x58223b});}return{'method':'POST','url':_0xdb96f5(0x13c),'body':{'appCode':_0x546f2b['appCode'],'sqlCode':_0x7824e4??null,'sqlName':_0x1a5f9f??null,'loadErrors':_0x4df210,'files':_0x1c3d55},'description':'Would\x20pull\x20'+_0x1c3d55[_0xdb96f5(0x151)]+'\x20SQL\x20file(s)\x20under\x20'+_0x23eaa5};},async 'execute'(_0x3aebaa){const _0x474ee8=a98_0x4fe761,_0xb1d85a=findProjectRootDirectory(),_0x5fc1f7=resolveSqlLocalDir(_0xb1d85a),_0x2a86f4=_0x3aebaa[_0x474ee8(0x134)]('sqlcode')||undefined,_0x1221cb=_0x3aebaa[_0x474ee8(0x134)](_0x474ee8(0x12b))||undefined,_0x19ebef=_0x3aebaa[_0x474ee8(0x156)](_0x474ee8(0x126)),_0x4919=await fetchAllSqlQueries(_0x3aebaa['appCode'],{'sqlCode':_0x2a86f4,'sqlName':_0x1221cb});if(_0x4919['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x474ee8(0x14f)};const _0xb81af7=[],_0x145b02=[];for(const _0x5a408c of _0x4919){try{_0xb81af7[_0x474ee8(0x145)](await ensureSqlContent(_0x3aebaa[_0x474ee8(0x133)],_0x5a408c));}catch(_0x327ac7){_0x145b02[_0x474ee8(0x145)]({'sqlCode':_0x5a408c[_0x474ee8(0x132)],'error':_0x327ac7 instanceof Error?_0x327ac7['message']:String(_0x327ac7)});}}if(_0xb81af7[_0x474ee8(0x151)]===0x0)return{'ok':![],'data':{'pulled':[],'skipped':[],'failed':_0x145b02},'message':_0x474ee8(0x138)+_0x145b02[_0x474ee8(0x151)]+_0x474ee8(0x144)};const _0x531719=assignSqlFileNames(_0xb81af7);if(_0x19ebef&&!_0x3aebaa[_0x474ee8(0x12f)]){let _0x40e7be=![];for(const [_0x520029,_0x3e5c24]of _0x531719){const _0xc641e=join(_0x5fc1f7,_0x520029),_0x3ac909=buildPulledSqlFileContent(_0x3e5c24);if(await fileExists(_0xc641e)){const _0xe1c70=await readFile(_0xc641e,_0x474ee8(0x129));if(_0xe1c70!==_0x3ac909){_0x40e7be=!![];break;}}}if(_0x40e7be){const _0x277cfc=await confirmForce();if(!_0x277cfc)throw CliErrors[_0x474ee8(0x140)]('Force\x20pull\x20cancelled.');}}const _0x3c54ad=[],_0x1bbd88=[];for(const [_0x7d54f6,_0x64b60e]of _0x531719){const _0x3d38fe=join(_0x5fc1f7,_0x7d54f6),_0x556e54=buildPulledSqlFileContent(_0x64b60e);try{if(await fileExists(_0x3d38fe)){const _0xc30c75=await readFile(_0x3d38fe,_0x474ee8(0x129));if(_0xc30c75===_0x556e54){_0x1bbd88[_0x474ee8(0x145)]({'sqlCode':_0x64b60e[_0x474ee8(0x132)],'reason':_0x474ee8(0x12c)});continue;}if(!_0x19ebef){_0x1bbd88['push']({'sqlCode':_0x64b60e[_0x474ee8(0x132)],'reason':'local\x20differs\x20from\x20remote'});continue;}}await ensureParentDirectory(_0x3d38fe),await writeFile(_0x3d38fe,_0x556e54,_0x474ee8(0x129)),_0x3c54ad[_0x474ee8(0x145)]({'sqlCode':_0x64b60e[_0x474ee8(0x132)],'filePath':_0x3d38fe});}catch(_0x5a6aef){_0x145b02[_0x474ee8(0x145)]({'sqlCode':_0x64b60e[_0x474ee8(0x132)],'error':_0x5a6aef instanceof Error?_0x5a6aef[_0x474ee8(0x148)]:String(_0x5a6aef)});}}const _0x2529fb=_0x145b02[_0x474ee8(0x151)]===0x0;return{'ok':_0x2529fb,'data':{'pulled':_0x3c54ad,'skipped':_0x1bbd88,'failed':_0x145b02},'message':'Pull\x20complete:\x20'+_0x3c54ad[_0x474ee8(0x151)]+'\x20written,\x20'+_0x1bbd88[_0x474ee8(0x151)]+_0x474ee8(0x127)+_0x145b02[_0x474ee8(0x151)]+_0x474ee8(0x135)};}};async function confirmForce(){const _0x1789b9=a98_0x4fe761,_0x1764f8=createInterface({'input':process[_0x1789b9(0x13e)],'output':process[_0x1789b9(0x143)]}),_0x13bdc4=await new Promise(_0x816e5b=>{const _0x38eaed=_0x1789b9;_0x1764f8['question'](_0x38eaed(0x139),_0x816e5b);});return _0x1764f8[_0x1789b9(0x123)](),['y',_0x1789b9(0x152)][_0x1789b9(0x14c)](_0x13bdc4[_0x1789b9(0x14a)]()[_0x1789b9(0x13f)]());}
1
+ const a99_0x3b567b=a99_0x48e1;(function(_0x464bb5,_0x2efe8c){const _0xce53b7=a99_0x48e1,_0x48952b=_0x464bb5();while(!![]){try{const _0x4114c1=parseInt(_0xce53b7(0x195))/0x1+-parseInt(_0xce53b7(0x175))/0x2+-parseInt(_0xce53b7(0x18b))/0x3+parseInt(_0xce53b7(0x197))/0x4*(parseInt(_0xce53b7(0x199))/0x5)+parseInt(_0xce53b7(0x17f))/0x6+parseInt(_0xce53b7(0x179))/0x7*(parseInt(_0xce53b7(0x188))/0x8)+-parseInt(_0xce53b7(0x185))/0x9;if(_0x4114c1===_0x2efe8c)break;else _0x48952b['push'](_0x48952b['shift']());}catch(_0x3e3736){_0x48952b['push'](_0x48952b['shift']());}}}(a99_0x5b8f,0x7dcdb));import{createInterface}from'node:readline';import{readFile,writeFile}from'node:fs/promises';import{join}from'node:path';import{getSqlQueryInfo,listSqlQueries}from'../../core/api-client.js';import{ensureParentDirectory,fileExists}from'../../core/bff/file-system.js';function a99_0x5b8f(){const _0x12a69e=['length','skipped','\x20written,\x20','conflict','sql','923278UJHxJM','Pull\x20remote\x20custom\x20SQL\x20queries\x20into\x20.rabetbase/sql/','string','utf8','4164517mYwwVy','No\x20remote\x20SQL\x20queries\x20matched.','message','toLowerCase','force','stderr','2917896iiIEsn','tableData','Force\x20pull\x20will\x20overwrite\x20local\x20SQL\x20that\x20differs\x20from\x20remote.\x20Continue?\x20[y/N]\x20','question','push','sqlcode','6162066bZyXRN','close','local\x20differs\x20from\x20remote\x20(use\x20--force\x20to\x20overwrite)','8klLBbA','write','sqlCode','1041867zDqEmv','\x20skipped,\x20','cancelled','nonInteractive','/smartapi/custom/queryUserCustomSqlList','local\x20differs\x20from\x20remote','boolean','Force\x20pull\x20cancelled.','\x20error(s)).','Overwrite\x20local\x20files\x20that\x20differ\x20from\x20remote','22748DJzOxv','bool','1809796mfwAhn','str','10wthKsJ','Would\x20pull\x20','POST','Pull\x20failed:\x20could\x20not\x20load\x20SQL\x20content\x20(','appCode','sqlName','name'];a99_0x5b8f=function(){return _0x12a69e;};return a99_0x5b8f();}import{findProjectRootDirectory}from'../../context.js';import{assignSqlFileNames,buildPulledSqlFileContent,resolveSqlLocalDir}from'../../commands/sql/shared.js';import{CliErrors}from'../../errors.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const PAGE_SIZE=0x64;async function fetchAllSqlQueries(_0x4eb6fd,_0x2d6916){const _0x4d5dc7=a99_0x48e1,_0x245b6f=[];let _0x4318bb=0x1;while(!![]){const _0x50e91c=await listSqlQueries(_0x4eb6fd,{'currentPage':_0x4318bb,'pageSize':PAGE_SIZE,'sqlCode':_0x2d6916[_0x4d5dc7(0x18a)],'sqlName':_0x2d6916[_0x4d5dc7(0x19e)]}),_0x598d92=_0x50e91c[_0x4d5dc7(0x180)]??[];_0x245b6f['push'](..._0x598d92);if(_0x598d92[_0x4d5dc7(0x1a0)]===0x0)break;const _0x3a57bf=_0x50e91c['paging']?.['totalCount'];if(_0x3a57bf!=null?_0x245b6f[_0x4d5dc7(0x1a0)]>=_0x3a57bf:_0x598d92['length']<PAGE_SIZE)break;_0x4318bb++;}return _0x245b6f;}async function ensureSqlContent(_0x205883,_0x32937e){const _0x52edfe=a99_0x48e1;if(_0x32937e['sqlContent']!=null&&String(_0x32937e['sqlContent'])['length']>0x0)return _0x32937e;return getSqlQueryInfo(_0x205883,_0x32937e[_0x52edfe(0x18a)]);}function a99_0x48e1(_0x4d101c,_0x1d42b0){_0x4d101c=_0x4d101c-0x174;const _0x5b8ff1=a99_0x5b8f();let _0x48e1ff=_0x5b8ff1[_0x4d101c];return _0x48e1ff;}export const sqlPull={'service':a99_0x3b567b(0x174),'command':'pull','description':a99_0x3b567b(0x176),'risk':a99_0x3b567b(0x189),'flags':[SQLCODE_FLAG_OPTIONAL,{'name':a99_0x3b567b(0x19f),'type':a99_0x3b567b(0x177),'description':'Filter\x20by\x20SQL\x20display\x20name\x20(API\x20filter)'},{'name':a99_0x3b567b(0x17d),'type':a99_0x3b567b(0x191),'description':a99_0x3b567b(0x194)}],async 'dryRun'(_0x4194be){const _0x13e12d=a99_0x3b567b,_0x409866=findProjectRootDirectory(),_0x14b842=resolveSqlLocalDir(_0x409866),_0x4972c7=_0x4194be[_0x13e12d(0x198)]('sqlcode')||undefined,_0x170291=_0x4194be[_0x13e12d(0x198)](_0x13e12d(0x19f))||undefined,_0x5afc82=await fetchAllSqlQueries(_0x4194be[_0x13e12d(0x19d)],{'sqlCode':_0x4972c7,'sqlName':_0x170291}),_0x228cc0=[],_0x102c48=[];for(const _0x229125 of _0x5afc82){try{_0x228cc0[_0x13e12d(0x183)](await ensureSqlContent(_0x4194be[_0x13e12d(0x19d)],_0x229125));}catch(_0x3181c7){_0x102c48[_0x13e12d(0x183)]({'sqlCode':_0x229125[_0x13e12d(0x18a)],'error':_0x3181c7 instanceof Error?_0x3181c7[_0x13e12d(0x17b)]:String(_0x3181c7)});}}const _0x4fd41c=assignSqlFileNames(_0x228cc0),_0x2e0d12=[];for(const [_0x42b164,_0x1d4673]of _0x4fd41c){const _0x343933=join(_0x14b842,_0x42b164),_0x4e69cf=buildPulledSqlFileContent(_0x1d4673);let _0x37554c='would_pull',_0x3db104;if(await fileExists(_0x343933)){const _0xa84646=await readFile(_0x343933,_0x13e12d(0x178));_0xa84646===_0x4e69cf?(_0x37554c=_0x13e12d(0x1a1),_0x3db104='unchanged'):(_0x37554c=_0x13e12d(0x1a3),_0x3db104=_0x13e12d(0x187));}_0x2e0d12[_0x13e12d(0x183)]({'sqlCode':_0x1d4673[_0x13e12d(0x18a)],'sqlName':_0x1d4673[_0x13e12d(0x19e)],'filePath':_0x343933,'status':_0x37554c,'reason':_0x3db104});}return{'method':_0x13e12d(0x19b),'url':_0x13e12d(0x18f),'body':{'appCode':_0x4194be[_0x13e12d(0x19d)],'sqlCode':_0x4972c7??null,'sqlName':_0x170291??null,'loadErrors':_0x102c48,'files':_0x2e0d12},'description':_0x13e12d(0x19a)+_0x2e0d12[_0x13e12d(0x1a0)]+'\x20SQL\x20file(s)\x20under\x20'+_0x14b842};},async 'execute'(_0x5796c4){const _0x10f3a5=a99_0x3b567b,_0x29ccc4=findProjectRootDirectory(),_0x9ea4ce=resolveSqlLocalDir(_0x29ccc4),_0x468c77=_0x5796c4['str'](_0x10f3a5(0x184))||undefined,_0x2f865f=_0x5796c4[_0x10f3a5(0x198)](_0x10f3a5(0x19f))||undefined,_0x47264c=_0x5796c4[_0x10f3a5(0x196)](_0x10f3a5(0x17d)),_0x48172b=await fetchAllSqlQueries(_0x5796c4[_0x10f3a5(0x19d)],{'sqlCode':_0x468c77,'sqlName':_0x2f865f});if(_0x48172b[_0x10f3a5(0x1a0)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x10f3a5(0x17a)};const _0x35b57c=[],_0x4572ef=[];for(const _0x1806a7 of _0x48172b){try{_0x35b57c['push'](await ensureSqlContent(_0x5796c4[_0x10f3a5(0x19d)],_0x1806a7));}catch(_0x917279){_0x4572ef['push']({'sqlCode':_0x1806a7[_0x10f3a5(0x18a)],'error':_0x917279 instanceof Error?_0x917279[_0x10f3a5(0x17b)]:String(_0x917279)});}}if(_0x35b57c[_0x10f3a5(0x1a0)]===0x0)return{'ok':![],'data':{'pulled':[],'skipped':[],'failed':_0x4572ef},'message':_0x10f3a5(0x19c)+_0x4572ef[_0x10f3a5(0x1a0)]+_0x10f3a5(0x193)};const _0x3cec97=assignSqlFileNames(_0x35b57c);if(_0x47264c&&!_0x5796c4[_0x10f3a5(0x18e)]){let _0x5dda89=![];for(const [_0x55019e,_0x4b63e5]of _0x3cec97){const _0x25da7f=join(_0x9ea4ce,_0x55019e),_0x239bf6=buildPulledSqlFileContent(_0x4b63e5);if(await fileExists(_0x25da7f)){const _0x259a14=await readFile(_0x25da7f,_0x10f3a5(0x178));if(_0x259a14!==_0x239bf6){_0x5dda89=!![];break;}}}if(_0x5dda89){const _0x3c2ef7=await confirmForce();if(!_0x3c2ef7)throw CliErrors[_0x10f3a5(0x18d)](_0x10f3a5(0x192));}}const _0x5e5286=[],_0x5f0813=[];for(const [_0x27da49,_0x4a9435]of _0x3cec97){const _0x39d501=join(_0x9ea4ce,_0x27da49),_0x491461=buildPulledSqlFileContent(_0x4a9435);try{if(await fileExists(_0x39d501)){const _0x1b7cfe=await readFile(_0x39d501,_0x10f3a5(0x178));if(_0x1b7cfe===_0x491461){_0x5f0813[_0x10f3a5(0x183)]({'sqlCode':_0x4a9435[_0x10f3a5(0x18a)],'reason':'unchanged'});continue;}if(!_0x47264c){_0x5f0813[_0x10f3a5(0x183)]({'sqlCode':_0x4a9435[_0x10f3a5(0x18a)],'reason':_0x10f3a5(0x190)});continue;}}await ensureParentDirectory(_0x39d501),await writeFile(_0x39d501,_0x491461,_0x10f3a5(0x178)),_0x5e5286[_0x10f3a5(0x183)]({'sqlCode':_0x4a9435[_0x10f3a5(0x18a)],'filePath':_0x39d501});}catch(_0x3b15e6){_0x4572ef[_0x10f3a5(0x183)]({'sqlCode':_0x4a9435[_0x10f3a5(0x18a)],'error':_0x3b15e6 instanceof Error?_0x3b15e6['message']:String(_0x3b15e6)});}}const _0x173bb4=_0x4572ef[_0x10f3a5(0x1a0)]===0x0;return{'ok':_0x173bb4,'data':{'pulled':_0x5e5286,'skipped':_0x5f0813,'failed':_0x4572ef},'message':'Pull\x20complete:\x20'+_0x5e5286['length']+_0x10f3a5(0x1a2)+_0x5f0813[_0x10f3a5(0x1a0)]+_0x10f3a5(0x18c)+_0x4572ef[_0x10f3a5(0x1a0)]+'\x20failed'};}};async function confirmForce(){const _0x5f02da=a99_0x3b567b,_0x3f526b=createInterface({'input':process['stdin'],'output':process[_0x5f02da(0x17e)]}),_0x1cf058=await new Promise(_0x275642=>{const _0x22a61d=_0x5f02da;_0x3f526b[_0x22a61d(0x182)](_0x22a61d(0x181),_0x275642);});return _0x3f526b[_0x5f02da(0x186)](),['y','yes']['includes'](_0x1cf058['trim']()[_0x5f02da(0x17c)]());}