@lovrabet/rabetbase-cli 2.1.2-beta.1 → 2.1.2-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/new.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -0
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x38a6d2,_0xa43ebc){const _0x4c05c7=a86_0x1596,_0x6790c7=_0x38a6d2();while(!![]){try{const _0x979350=parseInt(_0x4c05c7(0x1d7))/0x1+-parseInt(_0x4c05c7(0x1de))/0x2+parseInt(_0x4c05c7(0x1df))/0x3*(parseInt(_0x4c05c7(0x1e7))/0x4)+parseInt(_0x4c05c7(0x1e4))/0x5*(parseInt(_0x4c05c7(0x1d8))/0x6)+-parseInt(_0x4c05c7(0x1ea))/0x7*(-parseInt(_0x4c05c7(0x1e9))/0x8)+parseInt(_0x4c05c7(0x1e0))/0x9*(-parseInt(_0x4c05c7(0x1d9))/0xa)+-parseInt(_0x4c05c7(0x1db))/0xb*(parseInt(_0x4c05c7(0x1dd))/0xc);if(_0x979350===_0xa43ebc)break;else _0x6790c7['push'](_0x6790c7['shift']());}catch(_0x257a95){_0x6790c7['push'](_0x6790c7['shift']());}}}(a86_0xe979,0xaa061));function a86_0x1596(_0x28c63e,_0x310e38){_0x28c63e=_0x28c63e-0x1d7;const _0xe979d4=a86_0xe979();let _0x159608=_0xe979d4[_0x28c63e];return _0x159608;}import a86_0x587fb3 from'node:path';function a86_0xe979(){const _0x470cb7=['npx','168iJeRaK','433398NXTNLb','1271178IuliGQ','2984046VkSovo','10qDvcqq','now','1474FLgKza','resolve','135312lqkAqF','1552502WYFDBI','870yEyuhW','10842759msolNh','success','error','format','5Oyhqpy','cwd','message','15444LzOUCd'];a86_0xe979=function(){return _0x470cb7;};return a86_0xe979();}import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x1cf15f){const _0x193245=a86_0x1596,_0xc77801=Date[_0x193245(0x1da)](),_0x423d37=a86_0x587fb3[_0x193245(0x1dc)](process[_0x193245(0x1e5)](),_0x1cf15f);try{logger['info'](_0x193245(0x1e3),'开始格式化代码',{'projectCode':_0x1cf15f}),await execa(resolveNpmBin(_0x193245(0x1e8)),['prettier','--write','.'],{'cwd':_0x423d37});const _0x253bb9=Date[_0x193245(0x1da)]()-_0xc77801;logger[_0x193245(0x1e1)](_0x193245(0x1e3),'代码格式化完成',_0x253bb9,{'projectCode':_0x1cf15f});}catch(_0x377231){const _0x1632ec=Date['now']()-_0xc77801;logger[_0x193245(0x1e2)](_0x193245(0x1e3),'代码格式化失败',{'projectCode':_0x1cf15f,'error':_0x377231 instanceof Error?_0x377231[_0x193245(0x1e6)]:String(_0x377231),'duration':_0x1632ec});throw _0x377231;}return formatElapsed(_0xc77801);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2859ce,_0x52d874){const _0x3e04e9=a87_0x4e09,_0x25b4c7=_0x2859ce();while(!![]){try{const _0x10cd95=parseInt(_0x3e04e9(0x1a8))/0x1+parseInt(_0x3e04e9(0x1a7))/0x2*(-parseInt(_0x3e04e9(0x1a4))/0x3)+-parseInt(_0x3e04e9(0x1a2))/0x4+-parseInt(_0x3e04e9(0x1a0))/0x5*(parseInt(_0x3e04e9(0x1a9))/0x6)+parseInt(_0x3e04e9(0x19d))/0x7*(-parseInt(_0x3e04e9(0x19e))/0x8)+-parseInt(_0x3e04e9(0x1a3))/0x9+parseInt(_0x3e04e9(0x19a))/0xa;if(_0x10cd95===_0x52d874)break;else _0x25b4c7['push'](_0x25b4c7['shift']());}catch(_0x242a97){_0x25b4c7['push'](_0x25b4c7['shift']());}}}(a87_0x23d7,0xf283b));import a87_0xb15b91 from'node:path';function a87_0x23d7(){const _0x39ffd8=['now','5ZCdtHw','error','1896668LFNEjd','11315556AWRBKM','63069vueOwE','message','success','72GlNsGk','1183715powIDN','9032994ilAFgE','info','install','https://registry.npmmirror.com','开始安装依赖','依赖安装失败','49040420WXklkC','npm','--registry','128408FBnnlC','480LCHxZZ'];a87_0x23d7=function(){return _0x39ffd8;};return a87_0x23d7();}import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a87_0x4e09(_0x1f2d1f,_0x19e367){_0x1f2d1f=_0x1f2d1f-0x195;const _0x23d794=a87_0x23d7();let _0x4e0990=_0x23d794[_0x1f2d1f];return _0x4e0990;}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x251736){const _0x10e590=a87_0x4e09,_0x270979=Date[_0x10e590(0x19f)](),_0x578aeb=a87_0xb15b91['resolve'](process['cwd'](),_0x251736);try{logger[_0x10e590(0x195)](_0x10e590(0x196),_0x10e590(0x198),{'projectCode':_0x251736,'registry':_0x10e590(0x197)}),await execa(resolveNpmBin(_0x10e590(0x19b)),['install',_0x10e590(0x19c),_0x10e590(0x197)],{'cwd':_0x578aeb});const _0x36bc62=Date['now']()-_0x270979;logger[_0x10e590(0x1a6)](_0x10e590(0x196),'依赖安装完成',_0x36bc62,{'projectCode':_0x251736});}catch(_0x4bc70b){const _0x53c8d1=Date['now']()-_0x270979;logger[_0x10e590(0x1a1)](_0x10e590(0x196),_0x10e590(0x199),{'projectCode':_0x251736,'error':_0x4bc70b instanceof Error?_0x4bc70b[_0x10e590(0x1a5)]:String(_0x4bc70b),'duration':_0x53c8d1});throw _0x4bc70b;}return formatElapsed(_0x270979);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a88_0x5501fb=a88_0x1de4;(function(_0x549a7b,_0x199344){const _0x1990db=a88_0x1de4,_0x10cbd6=_0x549a7b();while(!![]){try{const _0x381426=-parseInt(_0x1990db(0x1ea))/0x1+parseInt(_0x1990db(0x200))/0x2+parseInt(_0x1990db(0x1ef))/0x3*(-parseInt(_0x1990db(0x1fc))/0x4)+parseInt(_0x1990db(0x1f4))/0x5+-parseInt(_0x1990db(0x1f8))/0x6+-parseInt(_0x1990db(0x1e6))/0x7+parseInt(_0x1990db(0x203))/0x8;if(_0x381426===_0x199344)break;else _0x10cbd6['push'](_0x10cbd6['shift']());}catch(_0x2f9f77){_0x10cbd6['push'](_0x10cbd6['shift']());}}}(a88_0x3d4b,0x250e3));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a88_0x3d4b(){const _0x242055=['cookie','../../commands/project/create/non-interactive.js','boolean','177470csCGdQ','Project\x20name','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','Usage:\x20','667770dlBSEZ','bool','project','write','601780ocECPl','Target\x20environment','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','Auto-confirm\x20prompts','486818XyEmxS','nonInteractive','project-name','4873296nyhSBV','str','validation','Create\x20a\x20new\x20project','yes','Initialize\x20.rabetbase.json\x20config\x20in\x20existing\x20project','string','480361xirHya','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','Skip\x20confirmation\x20prompt','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','255478aeOaGL','trim','env','create','appcode','6TVpkbJ','name'];a88_0x3d4b=function(){return _0x242055;};return a88_0x3d4b();}import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';function a88_0x1de4(_0x1eff51,_0x347fad){_0x1eff51=_0x1eff51-0x1e4;const _0x3d4b65=a88_0x3d4b();let _0x1de4e4=_0x3d4b65[_0x1eff51];return _0x1de4e4;}const initFlags=[{'name':a88_0x5501fb(0x1ee),'type':a88_0x5501fb(0x1e5),'description':'App\x20code\x20to\x20initialize'},{'name':a88_0x5501fb(0x1ec),'type':'string','description':a88_0x5501fb(0x1fd)},{'name':a88_0x5501fb(0x207),'type':a88_0x5501fb(0x1f3),'description':a88_0x5501fb(0x1ff),'default':![]}],createFlags=[{'name':a88_0x5501fb(0x1f0),'type':a88_0x5501fb(0x1e5),'description':a88_0x5501fb(0x1f5)},{'name':a88_0x5501fb(0x1ec),'type':'string','description':a88_0x5501fb(0x1fd)},{'name':a88_0x5501fb(0x1ee),'type':a88_0x5501fb(0x1e5),'description':a88_0x5501fb(0x1e7)}],upgradeFlags=[{'name':a88_0x5501fb(0x207),'type':'boolean','description':a88_0x5501fb(0x1e8),'default':![]}];export const projectDefinitions=[{'service':a88_0x5501fb(0x1fa),'command':'init','description':a88_0x5501fb(0x1e4),'risk':a88_0x5501fb(0x1fb),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initFlags,async 'execute'(_0xb4e308){const _0x399cc0=a88_0x5501fb;return await initConfig({'appcode':_0xb4e308[_0x399cc0(0x204)](_0x399cc0(0x1ee))||undefined,'env':_0xb4e308[_0x399cc0(0x204)](_0x399cc0(0x1ec))||undefined,'autoYes':_0xb4e308[_0x399cc0(0x1f9)](_0x399cc0(0x207))}),{'ok':!![]};}},{'service':'project','command':a88_0x5501fb(0x1ed),'description':a88_0x5501fb(0x206),'risk':a88_0x5501fb(0x1fb),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a88_0x5501fb(0x202),'description':'Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','required':![]}],'flags':createFlags,async 'execute'(_0x519d46){const _0x5a4685=a88_0x5501fb,{createApp:_0x5853ee}=await import('../../commands/project/create/main.js'),{createProjectNonInteractive:_0x138826}=await import(_0x5a4685(0x1f2)),_0x50eaa5=_0x519d46[_0x5a4685(0x204)]('name')[_0x5a4685(0x1eb)]()||_0x519d46['args'][0x0]?.[_0x5a4685(0x1eb)](),_0x3b94c3=_0x519d46[_0x5a4685(0x204)]('env')||undefined,_0x4cfc51=_0x519d46[_0x5a4685(0x204)](_0x5a4685(0x1ee))||undefined;if(_0x519d46[_0x5a4685(0x201)]){if(!_0x50eaa5)throw CliErrors[_0x5a4685(0x205)](_0x5a4685(0x1fe),_0x5a4685(0x1f7)+CLI_BIN_NAME+_0x5a4685(0x1f6));await _0x138826(_0x50eaa5,_0x3b94c3,_0x4cfc51,_0x519d46[_0x5a4685(0x1f1)]);}else await _0x5853ee({'projectCode':_0x50eaa5,'appCode':_0x4cfc51,'env':_0x3b94c3,'cookie':_0x519d46[_0x5a4685(0x1f1)]});return{'ok':!![]};}},{'service':a88_0x5501fb(0x1fa),'command':'upgrade','description':a88_0x5501fb(0x1e9),'risk':a88_0x5501fb(0x1fb),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x3564ca){const _0x2190a4=a88_0x5501fb;return await upgradeApp(_0x3564ca[_0x2190a4(0x201)],{'yes':_0x3564ca[_0x2190a4(0x1f9)](_0x2190a4(0x207))}),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x35c40f,_0x3d2d46){const _0x5b6b13=a89_0x1605,_0x6b8a30=_0x35c40f();while(!![]){try{const _0x1632f4=parseInt(_0x5b6b13(0x13a))/0x1+parseInt(_0x5b6b13(0x141))/0x2+parseInt(_0x5b6b13(0x155))/0x3+-parseInt(_0x5b6b13(0x15c))/0x4+parseInt(_0x5b6b13(0x143))/0x5*(parseInt(_0x5b6b13(0x135))/0x6)+parseInt(_0x5b6b13(0x161))/0x7+-parseInt(_0x5b6b13(0x149))/0x8*(parseInt(_0x5b6b13(0x15d))/0x9);if(_0x1632f4===_0x3d2d46)break;else _0x6b8a30['push'](_0x6b8a30['shift']());}catch(_0x563d73){_0x6b8a30['push'](_0x6b8a30['shift']());}}}(a89_0x34b4,0xdc2af));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a89_0x4f2821 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(_0x59b5a6){const _0x212703=a89_0x1605,{appcode:_0x27131c,env:_0x36fc71,autoYes:_0x5596e6}=_0x59b5a6,_0x5c3e27=process[_0x212703(0x137)]();if(getProjectConfigPath())throw new Error(_0x212703(0x158));let _0x5e7074;for(const _0x5d9a96 of LEGACY_CONFIG_NAMES){const _0x1f071b=resolve(_0x5c3e27,_0x5d9a96);if(existsSync(_0x1f071b)){_0x5e7074=_0x1f071b;break;}}if(_0x5e7074){let _0x3c98e3={};try{_0x3c98e3=JSON[_0x212703(0x147)](readFileSync(_0x5e7074,'utf8'));}catch{}const _0x11d9d9=basename(_0x5e7074),_0x2821d3=_0x3c98e3?.[_0x212703(0x13c)]||_0x3c98e3?.[_0x212703(0x151)];let _0x127dda=_0x5596e6;!_0x5596e6&&(console[_0x212703(0x144)](a89_0x4f2821[_0x212703(0x140)](_0x212703(0x150)+a89_0x4f2821[_0x212703(0x14b)](_0x11d9d9))),_0x2821d3&&console[_0x212703(0x144)](a89_0x4f2821['cyan'](_0x212703(0x13d)+_0x2821d3)),_0x127dda=await confirm({'message':_0x212703(0x15e)+a89_0x4f2821[_0x212703(0x14b)](_0x212703(0x15b))+_0x212703(0x133),'default':!![]}));if(!_0x127dda){console[_0x212703(0x144)]('Migration\x20cancelled.\x20Run\x20`'+CLI_BIN_NAME+_0x212703(0x13f));return;}const _0x30fa10=resolve(_0x5c3e27,NEW_CONFIG_NAME),_0x385162=getCliVersionFromPkg(),_0x50a628=readRawConfig(),_0x47cce6=_0x27131c||(typeof _0x3c98e3?.[_0x212703(0x13c)]==='string'?_0x3c98e3[_0x212703(0x13c)]:undefined)||(typeof _0x3c98e3?.['app']==='string'?_0x3c98e3[_0x212703(0x151)]:undefined)||await askAppcode(),_0x33309c=typeof _0x3c98e3?.[_0x212703(0x148)]==='string'?_0x3c98e3[_0x212703(0x148)]:typeof _0x50a628[_0x212703(0x148)]==='string'?_0x50a628['env']:_0x212703(0x139),_0x314580=buildCanonicalProjectConfig({..._0x50a628,..._0x3c98e3},{'appCodes':[_0x47cce6],'env':_0x33309c,'metadata':{'version':_0x385162,'migratedAt':new Date()[_0x212703(0x15a)](),'migratedFrom':_0x5e7074}});writeConfigFile(_0x30fa10,_0x314580);const _0x3c031b=_0x5e7074+_0x212703(0x14e);renameSync(_0x5e7074,_0x3c031b),logger[_0x212703(0x157)](_0x5c3e27),logger[_0x212703(0x142)]('init','从旧配置文件升级成功',{'from':_0x5e7074,'to':_0x30fa10,'appcode':_0x47cce6,'env':_0x314580[_0x212703(0x148)]}),console[_0x212703(0x144)](a89_0x4f2821['green']('✓\x20Upgraded\x20'+_0x11d9d9+_0x212703(0x152))),console[_0x212703(0x144)](a89_0x4f2821[_0x212703(0x159)]('\x20\x20Apps:\x20'+Object['keys'](_0x314580[_0x212703(0x146)]||{})[_0x212703(0x13e)](',\x20'))),console[_0x212703(0x144)](a89_0x4f2821['cyan']('\x20\x20Default:\x20'+_0x314580[_0x212703(0x13b)])),console[_0x212703(0x144)](a89_0x4f2821[_0x212703(0x160)](_0x212703(0x14c)+_0x11d9d9+_0x212703(0x14e)));return;}const _0x3faf37=_0x27131c||await askAppcode(),_0x3766b5=resolve(_0x5c3e27,NEW_CONFIG_NAME),_0x232d57=getCliVersionFromPkg(),_0x1ad645=readRawConfig(),_0x25efc6=typeof _0x1ad645[_0x212703(0x148)]===_0x212703(0x162)?_0x1ad645[_0x212703(0x148)]:undefined,_0x5a6612=buildCanonicalProjectConfig({},{'appCodes':[_0x3faf37],'env':_0x36fc71||_0x25efc6||_0x212703(0x139),'metadata':{'version':_0x232d57,'createdAt':new Date()['toLocaleString']()}});writeConfigFile(_0x3766b5,_0x5a6612),logger[_0x212703(0x157)](_0x5c3e27),logger[_0x212703(0x142)]('init',_0x212703(0x156),{'appcode':_0x3faf37,'env':_0x5a6612[_0x212703(0x148)],'version':_0x5a6612[_0x212703(0x14a)],'configPath':_0x3766b5}),console[_0x212703(0x144)](a89_0x4f2821[_0x212703(0x154)](_0x212703(0x131))),console[_0x212703(0x144)](a89_0x4f2821[_0x212703(0x159)](_0x212703(0x14f)+Object[_0x212703(0x132)](_0x5a6612[_0x212703(0x146)]||{})[_0x212703(0x13e)](',\x20'))),console[_0x212703(0x144)](a89_0x4f2821[_0x212703(0x159)]('\x20\x20Default:\x20'+_0x5a6612['defaultApp'])),console[_0x212703(0x144)](_0x212703(0x15f)+CLI_BIN_NAME+_0x212703(0x153)+CLI_BIN_NAME+'\x20api\x20pull\x27');}function askAppcode(){return input({'message':'Please\x20enter\x20App\x20Code:','validate':_0x1673e1=>{const _0x566a0e=a89_0x1605;if(!_0x1673e1[_0x566a0e(0x14d)]())return _0x566a0e(0x145);const {valid:_0x407130,message:_0x3361dd}=validateAppcode(_0x1673e1['trim']());return _0x407130||_0x3361dd||'Invalid\x20App\x20Code';}});}function a89_0x34b4(){const _0x3062d3=['984612TMsLIS','301491aifGms','Upgrade\x20it\x20to\x20','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','gray','11600862parxHf','string','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory','keys','?\x20(Old\x20file\x20→\x20*.bak)','1.0.0','36bPJedk','utf8','cwd','package.json','production','1790361sjJost','defaultApp','appcode','\x20\x20appcode:\x20','join','\x20project\x20init`\x20to\x20start\x20fresh.','yellow','996104LUYRCY','info','676475zvvasZ','log','App\x20Code\x20cannot\x20be\x20empty','apps','parse','env','984zuhAyB','version','bold','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','trim','.bak','\x20\x20Apps:\x20','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','app','\x20→\x20.rabetbase.json','\x20api\x20generate\x27\x20and\x20\x27','green','1532664nENalr','初始化项目配置文件成功','setLogPath','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','cyan','toLocaleString','.rabetbase.json'];a89_0x34b4=function(){return _0x3062d3;};return a89_0x34b4();}function a89_0x1605(_0x5d1447,_0x266fb1){_0x5d1447=_0x5d1447-0x131;const _0x34b429=a89_0x34b4();let _0x16056c=_0x34b429[_0x5d1447];return _0x16056c;}function getCliVersionFromPkg(){const _0x2b5f58=a89_0x1605;try{const _0x3a05db=fileURLToPath(import.meta.url),_0x1fed0d=resolve(dirname(_0x3a05db),'../..'),_0x3cacff=JSON['parse'](readFileSync(resolve(_0x1fed0d,_0x2b5f58(0x138)),_0x2b5f58(0x136)));return _0x3cacff[_0x2b5f58(0x14a)]||_0x2b5f58(0x134);}catch{return _0x2b5f58(0x134);}}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
const a90_0x24dfd0=a90_0x48c4;(function(_0x5f5798,_0xa61927){const _0x3e2f11=a90_0x48c4,_0x403fc5=_0x5f5798();while(!![]){try{const _0x3bf8e8=-parseInt(_0x3e2f11(0x220))/0x1*(-parseInt(_0x3e2f11(0x221))/0x2)+-parseInt(_0x3e2f11(0x225))/0x3*(parseInt(_0x3e2f11(0x1e6))/0x4)+-parseInt(_0x3e2f11(0x1e4))/0x5*(-parseInt(_0x3e2f11(0x1f7))/0x6)+parseInt(_0x3e2f11(0x1b2))/0x7+parseInt(_0x3e2f11(0x20c))/0x8+parseInt(_0x3e2f11(0x1f3))/0x9+-parseInt(_0x3e2f11(0x1ae))/0xa;if(_0x3bf8e8===_0xa61927)break;else _0x403fc5['push'](_0x403fc5['shift']());}catch(_0x1e222e){_0x403fc5['push'](_0x403fc5['shift']());}}}(a90_0x9a94,0x8cd4d));import a90_0x37712a from'chalk';import a90_0x76d35a 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';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a90_0x24dfd0(0x211)](_0x329664=>_0x329664!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x4db498){const _0x291884=a90_0x24dfd0,_0x545310=[];for(const _0x5bb3b2 of Object[_0x291884(0x1d5)](CORE_IDE_CONFIGS)){if(_0x5bb3b2[_0x291884(0x1df)])for(const _0x430d3f of _0x5bb3b2['files']){_0x545310[_0x291884(0x1ff)](resolve(_0x4db498,_0x430d3f[_0x291884(0x216)]));}}return _0x545310;}function analyse(_0x10b9ba){const _0x271769=a90_0x24dfd0;let _0x516ef8=null;const _0x4644eb=resolve(_0x10b9ba,NEW_CONFIG_NAME),_0x4a047e=existsSync(_0x4644eb);for(const _0x22fe79 of LEGACY_CONFIG_NAMES){const _0x18949c=resolve(_0x10b9ba,_0x22fe79);if(existsSync(_0x18949c)){const _0x30a056=readConfigFile(_0x18949c),_0xb6a641=Object['keys'](_0x30a056)[_0x271769(0x211)](_0x58a792=>typeof _0x30a056[_0x58a792]!==_0x271769(0x1d9));_0x516ef8={'oldPath':_0x18949c,'hasNewConfig':_0x4a047e,'fields':_0xb6a641};break;}}const _0x2705a8=[],_0x58654b=resolve(_0x10b9ba,_0x271769(0x1d8));if(existsSync(_0x58654b))_0x2705a8[_0x271769(0x1ff)](_0x58654b);const _0x3e8804=resolve(_0x10b9ba,_0x271769(0x1bf));if(existsSync(_0x3e8804))_0x2705a8[_0x271769(0x1ff)](_0x3e8804);const _0x63cd4a=resolve(_0x10b9ba,_0x271769(0x1f1));if(existsSync(_0x63cd4a))_0x2705a8[_0x271769(0x1ff)](_0x63cd4a);for(const _0x9c08f2 of collectIdeSkillFiles(_0x10b9ba)){if(existsSync(_0x9c08f2))_0x2705a8[_0x271769(0x1ff)](_0x9c08f2);}let _0x3f773f=null;const _0xaae0a7=resolve(_0x10b9ba,'.cursor/mcp.json');if(existsSync(_0xaae0a7))try{const _0x444f51=JSON[_0x271769(0x1d6)](readFileSync(_0xaae0a7,'utf8'));if(_0x444f51?.[_0x271769(0x217)]&&typeof _0x444f51['mcpServers']==='object'){const _0x4abf29=[];for(const [_0x59c497,_0x164c7b]of Object[_0x271769(0x215)](_0x444f51[_0x271769(0x217)])){const _0x33dfcd=_0x164c7b;_0x33dfcd?.[_0x271769(0x1fe)]&&Array['isArray'](_0x33dfcd[_0x271769(0x1fe)])&&_0x33dfcd[_0x271769(0x1fe)][_0x271769(0x1af)](_0x5afc38=>typeof _0x5afc38==='string'&&_0x5afc38['includes'](_0x271769(0x1ed)))&&_0x4abf29[_0x271769(0x1ff)](_0x59c497);}_0x4abf29[_0x271769(0x1bd)]>0x0&&(_0x3f773f={'path':_0xaae0a7,'keys':_0x4abf29});}}catch{}const _0x44291c=_0x2705a8[_0x271769(0x1bd)]>0x0||_0x516ef8!==null;let _0x2b0f52=null;const _0xac1070=resolve(_0x10b9ba,_0x271769(0x214));if(existsSync(_0xac1070))try{const _0x59952f=JSON[_0x271769(0x1d6)](readFileSync(_0xac1070,_0x271769(0x1d0)));for(const _0x45244d of['dependencies',_0x271769(0x1f2)]){const _0x5141d2=_0x59952f?.[_0x45244d]?.[_0x271769(0x1c7)];if(typeof _0x5141d2===_0x271769(0x1c6)){_0x5141d2!==_0x271769(0x1c2)&&(_0x2b0f52={'pkgPath':_0xac1070,'currentVersion':_0x5141d2,'field':_0x45244d});break;}}}catch{}return{'configMigration':_0x516ef8,'oldArtifacts':_0x2705a8,'oldMcpConfig':_0x3f773f,'needsSkillSwap':_0x44291c,'sdkUpgrade':_0x2b0f52};}function printReport(_0x23ce6c){const _0x1c7cd6=a90_0x24dfd0,{configMigration:_0x2657ec,oldArtifacts:_0x2bbff3,oldMcpConfig:_0x396a79,needsSkillSwap:_0xeca952}=_0x23ce6c;console['log'](''),console[_0x1c7cd6(0x1c8)](a90_0x37712a[_0x1c7cd6(0x1c4)](_0x1c7cd6(0x1b0))),console[_0x1c7cd6(0x1c8)]('');_0x2657ec?(console[_0x1c7cd6(0x1c8)](a90_0x37712a[_0x1c7cd6(0x204)](_0x1c7cd6(0x208))+('\x20\x20'+a90_0x37712a[_0x1c7cd6(0x1c1)](_0x2657ec[_0x1c7cd6(0x1ac)]))),console['log'](_0x1c7cd6(0x1dc)+(_0x2657ec[_0x1c7cd6(0x212)]?a90_0x37712a[_0x1c7cd6(0x1de)](_0x1c7cd6(0x206)):a90_0x37712a[_0x1c7cd6(0x1d4)](_0x1c7cd6(0x21f)))),console['log'](_0x1c7cd6(0x219)+_0x2657ec[_0x1c7cd6(0x1be)]['join'](',\x20')),console[_0x1c7cd6(0x1c8)]('\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak')):console[_0x1c7cd6(0x1c8)](a90_0x37712a['cyan']('Config\x20file:')+'\x20\x20'+a90_0x37712a['gray']('no\x20legacy\x20config\x20found'));console['log']('');if(_0x2bbff3[_0x1c7cd6(0x1bd)]>0x0){console[_0x1c7cd6(0x1c8)](a90_0x37712a['cyan'](_0x1c7cd6(0x1b5)));for(const _0x54cf8a of _0x2bbff3){console[_0x1c7cd6(0x1c8)]('\x20\x20'+a90_0x37712a[_0x1c7cd6(0x1dd)](_0x1c7cd6(0x1ad))+'\x20\x20'+_0x54cf8a);}console['log'](_0x1c7cd6(0x1e1));}else console['log'](a90_0x37712a[_0x1c7cd6(0x204)](_0x1c7cd6(0x1b5))+'\x20\x20'+a90_0x37712a[_0x1c7cd6(0x1d4)](_0x1c7cd6(0x1f4)));console[_0x1c7cd6(0x1c8)]('');_0x396a79?(console['log'](a90_0x37712a[_0x1c7cd6(0x204)]('MCP\x20config:')+('\x20\x20'+a90_0x37712a[_0x1c7cd6(0x1c1)](_0x396a79[_0x1c7cd6(0x216)])+_0x1c7cd6(0x20e)+_0x396a79[_0x1c7cd6(0x20f)][_0x1c7cd6(0x209)](',\x20'))),console['log'](_0x1c7cd6(0x202))):console[_0x1c7cd6(0x1c8)](a90_0x37712a[_0x1c7cd6(0x204)]('MCP\x20config:')+'\x20\x20'+a90_0x37712a[_0x1c7cd6(0x1d4)](_0x1c7cd6(0x21a)));console['log'](''),console[_0x1c7cd6(0x1c8)](a90_0x37712a[_0x1c7cd6(0x204)](_0x1c7cd6(0x1b3))+('\x20\x20'+(_0xeca952?a90_0x37712a[_0x1c7cd6(0x1c1)](_0x1c7cd6(0x1c5)):a90_0x37712a[_0x1c7cd6(0x1de)](_0x1c7cd6(0x210)))));_0xeca952&&console[_0x1c7cd6(0x1c8)](_0x1c7cd6(0x226));console[_0x1c7cd6(0x1c8)]('');if(_0x23ce6c[_0x1c7cd6(0x1fc)]){const {currentVersion:_0x3c6a7e,field:_0x104aba,pkgPath:_0x2e51a0}=_0x23ce6c[_0x1c7cd6(0x1fc)];console[_0x1c7cd6(0x1c8)](a90_0x37712a['cyan'](_0x1c7cd6(0x1e7))+('\x20\x20'+a90_0x37712a['yellow'](_0x2e51a0))),console[_0x1c7cd6(0x1c8)]('\x20\x20Current\x20version\x20in\x20'+_0x104aba+':\x20'+a90_0x37712a[_0x1c7cd6(0x1c1)](_0x3c6a7e)+_0x1c7cd6(0x218)+a90_0x37712a['green'](_0x1c7cd6(0x1c2))),console[_0x1c7cd6(0x1c8)](_0x1c7cd6(0x1bc));}else console['log'](a90_0x37712a[_0x1c7cd6(0x204)](_0x1c7cd6(0x1e7))+'\x20\x20'+a90_0x37712a[_0x1c7cd6(0x1d4)](_0x1c7cd6(0x1e2)));console['log']('');}function a90_0x48c4(_0x3b39df,_0x5afd21){_0x3b39df=_0x3b39df-0x1aa;const _0x9a948d=a90_0x9a94();let _0x48c4ef=_0x9a948d[_0x3b39df];return _0x48c4ef;}function execConfigMigration(_0x3c9709,_0x1a80d3){const _0x516430=a90_0x24dfd0,{configMigration:_0x5d335f}=_0x3c9709;if(!_0x5d335f?.['oldPath'])return{'step':0x1,'label':_0x516430(0x201),'ok':!![],'detail':'skipped\x20(no\x20legacy\x20config)'};const _0x3a64b7=readConfigFile(_0x5d335f['oldPath']),_0x1566c0=resolve(_0x1a80d3,NEW_CONFIG_NAME),_0x125a4d=_0x5d335f[_0x516430(0x212)]?readConfigFile(_0x1566c0):{};for(const [_0x3cadf3,_0x368b0b]of Object[_0x516430(0x215)](_0x3a64b7)){!(_0x3cadf3 in _0x125a4d)&&(_0x125a4d[_0x3cadf3]=_0x368b0b);}writeConfigFile(_0x1566c0,_0x125a4d);const _0x3292cf=_0x5d335f[_0x516430(0x1ac)]+'.bak';return renameSync(_0x5d335f['oldPath'],_0x3292cf),{'step':0x1,'label':_0x516430(0x201),'ok':!![],'detail':_0x5d335f[_0x516430(0x1ac)]+'\x20→\x20'+_0x1566c0+'\x20(backup:\x20'+_0x3292cf+')'};}function execRemoveOldArtifacts(_0x3cd677){const _0x2025f0=a90_0x24dfd0,_0x34bab3=[];for(const _0xfe0d1f of _0x3cd677){try{if(!existsSync(_0xfe0d1f))continue;const _0x49aacb=tryStat(_0xfe0d1f);_0x49aacb?.[_0x2025f0(0x1e5)]()?rmSync(_0xfe0d1f,{'recursive':!![],'force':!![]}):unlinkSync(_0xfe0d1f);}catch(_0x385c3f){_0x34bab3['push'](_0xfe0d1f+':\x20'+_0x385c3f[_0x2025f0(0x1da)]);}}return{'step':0x3,'label':_0x2025f0(0x207),'ok':_0x34bab3[_0x2025f0(0x1bd)]===0x0,'detail':_0x34bab3[_0x2025f0(0x1bd)]>0x0?_0x3cd677[_0x2025f0(0x1bd)]-_0x34bab3[_0x2025f0(0x1bd)]+'/'+_0x3cd677[_0x2025f0(0x1bd)]+_0x2025f0(0x1e0)+_0x34bab3[_0x2025f0(0x209)](';\x20')+')':_0x3cd677[_0x2025f0(0x1bd)]+'\x20removed'};}function execCleanMcp(_0x1189c1){const _0x155ae9=a90_0x24dfd0;if(!_0x1189c1[_0x155ae9(0x1f8)])return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':'skipped'};try{const _0x1d3fa3=readFileSync(_0x1189c1['oldMcpConfig'][_0x155ae9(0x216)],_0x155ae9(0x1d0)),_0x422c84=JSON[_0x155ae9(0x1d6)](_0x1d3fa3);if(_0x422c84?.['mcpServers']&&typeof _0x422c84[_0x155ae9(0x217)]===_0x155ae9(0x1cf)){const _0x3825c4=[];for(const [_0x58a747,_0xe69504]of Object['entries'](_0x422c84[_0x155ae9(0x217)])){_0xe69504?.['args']&&Array['isArray'](_0xe69504['args'])&&_0xe69504[_0x155ae9(0x1fe)][_0x155ae9(0x1af)](_0x4bed13=>typeof _0x4bed13===_0x155ae9(0x1c6)&&_0x4bed13[_0x155ae9(0x1eb)](_0x155ae9(0x1ed)))&&_0x3825c4[_0x155ae9(0x1ff)](_0x58a747);}for(const _0x5ccb84 of _0x3825c4){delete _0x422c84[_0x155ae9(0x217)][_0x5ccb84];}return _0x3825c4[_0x155ae9(0x1bd)]>0x0&&writeFileSync(_0x1189c1[_0x155ae9(0x1f8)]['path'],JSON[_0x155ae9(0x224)](_0x422c84,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':_0x155ae9(0x1d7),'ok':!![],'detail':_0x155ae9(0x1b9)+_0x3825c4[_0x155ae9(0x209)](',\x20')+_0x155ae9(0x1ba)+_0x1189c1[_0x155ae9(0x1f8)][_0x155ae9(0x216)]};}return{'step':0x4,'label':_0x155ae9(0x1d7),'ok':!![],'detail':'no\x20matching\x20entry\x20found'};}catch(_0x484cb1){return{'step':0x4,'label':_0x155ae9(0x1d7),'ok':![],'detail':_0x484cb1[_0x155ae9(0x1da)]};}}function execSkillsRemove(_0x26e0e6,_0x34f955){const _0x2a2947=a90_0x24dfd0,_0x5931bb=runNpxSkillsRemove(_0x26e0e6,{'stdio':_0x2a2947(0x21d),'yes':_0x34f955});return{'step':0x5,'label':_0x2a2947(0x1ee),'ok':_0x5931bb['ok'],'detail':_0x5931bb['ok']?'lovrabet/lovrabet-skill\x20removed':_0x5931bb[_0x2a2947(0x1d2)]??'exit\x20'+_0x5931bb[_0x2a2947(0x1c9)]};}function execSkillsAdd(_0x40a7bd,_0x2feebf){const _0xf1ae66=a90_0x24dfd0,_0x16f0ee=runNpxSkillsAddGlobal(_0x40a7bd,'lovrabet/rabetbase',{'stdio':'inherit','yes':_0x2feebf});return{'step':0x6,'label':_0xf1ae66(0x223),'ok':_0x16f0ee['ok'],'detail':_0x16f0ee['ok']?_0xf1ae66(0x1d3):_0x16f0ee[_0xf1ae66(0x1d2)]??_0xf1ae66(0x1fd)+_0x16f0ee[_0xf1ae66(0x1c9)]};}function execUpgradeSdk(_0x3c6f84){const _0x21cffa=a90_0x24dfd0;if(!_0x3c6f84[_0x21cffa(0x1fc)])return{'step':0x7,'label':_0x21cffa(0x1cb),'ok':!![],'detail':_0x21cffa(0x213)};const {pkgPath:_0x4be3b8,currentVersion:_0x4b0092,field:_0xd40b3e}=_0x3c6f84[_0x21cffa(0x1fc)];try{const _0x59ce15=readFileSync(_0x4be3b8,_0x21cffa(0x1d0)),_0x33e0df=JSON[_0x21cffa(0x1d6)](_0x59ce15);return _0x33e0df[_0xd40b3e][_0x21cffa(0x1c7)]=_0x21cffa(0x1c2),writeFileSync(_0x4be3b8,JSON[_0x21cffa(0x224)](_0x33e0df,null,0x2)+'\x0a',_0x21cffa(0x1d0)),{'step':0x7,'label':_0x21cffa(0x1cb),'ok':!![],'detail':_0xd40b3e+'[\x22@lovrabet/sdk\x22]:\x20'+_0x4b0092+'\x20→\x20latest'};}catch(_0x3835e1){return{'step':0x7,'label':_0x21cffa(0x1cb),'ok':![],'detail':_0x3835e1[_0x21cffa(0x1da)]};}}function tryStat(_0x47b3ff){try{return statSync(_0x47b3ff);}catch{return undefined;}}function a90_0x9a94(){const _0x5f27f2=['.claude/skills/lovrabet','devDependencies','5764374aRZxOe','none\x20found','failed','\x20\x20Step\x20','52326AwelYW','oldMcpConfig','done','Step\x205/7:\x20Removing\x20old\x20skill...','cwd','sdkUpgrade','exit\x20','args','push','needsSkillSwap','Config\x20migration','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','Remove\x20.lovrabet/','cyan','===\x20Upgrade\x20Summary\x20===','already\x20exists\x20(will\x20merge)','Remove\x20legacy\x20artifacts','Config\x20file:','join','FAIL','succeed','8872920DwfZnL','label','\x20→\x20keys:\x20','keys','not\x20needed','filter','hasNewConfig','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','package.json','entries','path','mcpServers','\x20→\x20','\x20\x20Fields\x20to\x20migrate:\x20','no\x20legacy\x20entry','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','inherit','Step\x201/7:\x20Config\x20migration\x20—\x20','not\x20found\x20(will\x20create)','17lnwjma','113626nhUWRf','fail','Install\x20new\x20skill','stringify','12eSLgWV','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20lovrabet/rabetbase\x20--global','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','skipped','oldPath','FOUND','25261690sNiJWi','some','===\x20Upgrade\x20Analysis\x20===','info','6415773zjWcsd','Skill\x20swap:','\x20\x20#\x20or','Legacy\x20artifacts:','Proceed\x20with\x20upgrade?','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','removed\x20','\x20from\x20','start','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','length','fields','.cursor/rules/lovrabet_rules.mdc','Step\x206/7:\x20Installing\x20new\x20skill...','yellow','latest','\x20\x20npm\x20install','bold','needed','string','@lovrabet/sdk','log','status','detail','Upgrade\x20@lovrabet/sdk','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','Upgrade\x20completed\x20successfully!','yes','object','utf8','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','error','lovrabet/rabetbase\x20installed\x20globally','gray','values','parse','Clean\x20MCP\x20config','.lovrabet','undefined','message','oldArtifacts','\x20\x20New\x20config\x20(.rabetbase.json):\x20','red','green','files','\x20removed\x20(','\x20\x20Action:\x20delete','not\x20found\x20or\x20already\x20at\x20latest','white','45QyvyKA','isDirectory','607436TfWPyM','@lovrabet/sdk:','Step\x204/7:\x20MCP\x20config\x20—\x20','configMigration','\x20\x20\x20\x20\x20\x20\x20','includes','\x20\x20bun\x20install','@lovrabet/dataset-mcp-server','Remove\x20old\x20skill','step','Upgrade\x20cancelled.'];a90_0x9a94=function(){return _0x5f27f2;};return a90_0x9a94();}function printSummary(_0x2c0598){const _0x1b9bfc=a90_0x24dfd0;console[_0x1b9bfc(0x1c8)](''),console[_0x1b9bfc(0x1c8)](a90_0x37712a[_0x1b9bfc(0x1c4)](_0x1b9bfc(0x205))),console[_0x1b9bfc(0x1c8)]('');for(const _0x128d6f of _0x2c0598){const _0x1e1fe9=_0x128d6f['ok']?a90_0x37712a[_0x1b9bfc(0x1de)]('OK'):a90_0x37712a[_0x1b9bfc(0x1dd)](_0x1b9bfc(0x20a));console[_0x1b9bfc(0x1c8)]('\x20\x20'+_0x1e1fe9+_0x1b9bfc(0x1f6)+_0x128d6f[_0x1b9bfc(0x1ef)]+':\x20'+_0x128d6f[_0x1b9bfc(0x20d)]);if(_0x128d6f['detail'])console[_0x1b9bfc(0x1c8)](_0x1b9bfc(0x1ea)+a90_0x37712a[_0x1b9bfc(0x1d4)](_0x128d6f['detail']));}console[_0x1b9bfc(0x1c8)]('');}export async function upgradeApp(_0x34fc05,_0x5242eb){const _0x41edd6=a90_0x24dfd0,_0xa753d1=process[_0x41edd6(0x1fb)](),_0x3a69f4=analyse(_0xa753d1),_0x1d1041=!_0x3a69f4[_0x41edd6(0x1e9)]&&_0x3a69f4[_0x41edd6(0x1db)]['length']===0x0&&!_0x3a69f4[_0x41edd6(0x1f8)]&&!_0x3a69f4[_0x41edd6(0x200)]&&!_0x3a69f4['sdkUpgrade'];if(_0x1d1041){console['log'](a90_0x37712a['green']('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0x3a69f4);const _0x17d0a3=!!(_0x5242eb[_0x41edd6(0x1ce)]||_0x5242eb['Y']||_0x34fc05);if(!_0x17d0a3)try{const _0x53a5d6=await askConfirm(_0x41edd6(0x1b6));if(!_0x53a5d6){console[_0x41edd6(0x1c8)](a90_0x37712a[_0x41edd6(0x1d4)](_0x41edd6(0x1f0)));return;}}catch(_0x4cc0f6){if(_0x4cc0f6?.[_0x41edd6(0x1da)]==='CANCEL'){console['log'](a90_0x37712a[_0x41edd6(0x1d4)](_0x41edd6(0x1f0)));return;}throw _0x4cc0f6;}const _0x3b05a8=[],_0x3b5750=a90_0x76d35a({'text':'Step\x201/7:\x20Migrating\x20config...','color':'cyan'})['start'](),_0x16cd7b=execConfigMigration(_0x3a69f4,_0xa753d1);_0x3b05a8[_0x41edd6(0x1ff)](_0x16cd7b),_0x3b5750[_0x16cd7b['ok']?'succeed':_0x41edd6(0x222)](_0x41edd6(0x21e)+(_0x16cd7b[_0x41edd6(0x1ca)]??(_0x16cd7b['ok']?_0x41edd6(0x1f9):_0x41edd6(0x1f5))));const _0x410daf=resolve(_0xa753d1,_0x41edd6(0x1d8)),_0x5d78d8=a90_0x76d35a({'text':_0x41edd6(0x1b7),'color':_0x41edd6(0x204)})['start']();if(existsSync(_0x410daf))try{rmSync(_0x410daf,{'recursive':!![],'force':!![]}),_0x5d78d8[_0x41edd6(0x20b)](_0x41edd6(0x1d1)),_0x3b05a8[_0x41edd6(0x1ff)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x1f246e){_0x5d78d8[_0x41edd6(0x222)](_0x41edd6(0x21b)+_0x1f246e[_0x41edd6(0x1da)]),_0x3b05a8[_0x41edd6(0x1ff)]({'step':0x2,'label':_0x41edd6(0x203),'ok':![],'detail':_0x1f246e['message']});}else _0x5d78d8[_0x41edd6(0x1b1)](_0x41edd6(0x21c)),_0x3b05a8[_0x41edd6(0x1ff)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![],'detail':_0x41edd6(0x1ab)});const _0x46afee=a90_0x76d35a({'text':'Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':_0x41edd6(0x204)})[_0x41edd6(0x1bb)](),_0x234539=execRemoveOldArtifacts(_0x3a69f4[_0x41edd6(0x1db)]);_0x3b05a8['push'](_0x234539),_0x46afee[_0x234539['ok']?'succeed':_0x41edd6(0x222)]('Step\x203/7:\x20Legacy\x20artifacts\x20—\x20'+(_0x234539[_0x41edd6(0x1ca)]??(_0x234539['ok']?_0x41edd6(0x1f9):_0x41edd6(0x1f5))));const _0x2b77a6=a90_0x76d35a({'text':'Step\x204/7:\x20Cleaning\x20MCP\x20config...','color':'cyan'})['start'](),_0x495543=execCleanMcp(_0x3a69f4);_0x3b05a8[_0x41edd6(0x1ff)](_0x495543),_0x2b77a6[_0x495543['ok']?_0x41edd6(0x20b):_0x41edd6(0x222)](_0x41edd6(0x1e8)+(_0x495543[_0x41edd6(0x1ca)]??(_0x495543['ok']?_0x41edd6(0x1f9):'failed')));const _0x31ed2b=a90_0x76d35a({'text':_0x41edd6(0x1fa),'color':_0x41edd6(0x204)})['start'](),_0xc43500=execSkillsRemove(_0xa753d1,_0x17d0a3);_0x3b05a8[_0x41edd6(0x1ff)](_0xc43500),_0x31ed2b[_0xc43500['ok']?_0x41edd6(0x20b):_0x41edd6(0x222)](_0x41edd6(0x1aa)+(_0xc43500[_0x41edd6(0x1ca)]??(_0xc43500['ok']?'done':_0x41edd6(0x1f5))));const _0x19634e=a90_0x76d35a({'text':_0x41edd6(0x1c0),'color':_0x41edd6(0x204)})[_0x41edd6(0x1bb)](),_0x10d253=execSkillsAdd(_0xa753d1,_0x17d0a3);_0x3b05a8['push'](_0x10d253),_0x19634e[_0x10d253['ok']?_0x41edd6(0x20b):_0x41edd6(0x222)]('Step\x206/7:\x20Install\x20new\x20skill\x20—\x20'+(_0x10d253[_0x41edd6(0x1ca)]??(_0x10d253['ok']?_0x41edd6(0x1f9):_0x41edd6(0x1f5))));const _0x22ba12=a90_0x76d35a({'text':_0x41edd6(0x1cc),'color':_0x41edd6(0x204)})[_0x41edd6(0x1bb)](),_0x19a5ff=execUpgradeSdk(_0x3a69f4);_0x3b05a8[_0x41edd6(0x1ff)](_0x19a5ff),_0x22ba12[_0x19a5ff['ok']?_0x41edd6(0x20b):_0x41edd6(0x222)](_0x41edd6(0x1b8)+(_0x19a5ff['detail']??(_0x19a5ff['ok']?_0x41edd6(0x1f9):_0x41edd6(0x1f5)))),printSummary(_0x3b05a8);const _0x565d98=_0x3b05a8[_0x41edd6(0x1af)](_0x5a053b=>!_0x5a053b['ok']);_0x565d98?console[_0x41edd6(0x1c8)](a90_0x37712a[_0x41edd6(0x1c1)]('Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.')):console['log'](a90_0x37712a[_0x41edd6(0x1de)](_0x41edd6(0x1cd))),_0x19a5ff['ok']&&_0x3a69f4[_0x41edd6(0x1fc)]&&(console[_0x41edd6(0x1c8)](''),console['log'](a90_0x37712a[_0x41edd6(0x1c4)][_0x41edd6(0x204)]('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console[_0x41edd6(0x1c8)](a90_0x37712a['cyan']('Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:')),console[_0x41edd6(0x1c8)](''),console['log'](a90_0x37712a[_0x41edd6(0x1e3)](_0x41edd6(0x1c3))),console['log'](a90_0x37712a[_0x41edd6(0x1e3)](_0x41edd6(0x1b4))),console[_0x41edd6(0x1c8)](a90_0x37712a[_0x41edd6(0x1e3)](_0x41edd6(0x1ec))),console[_0x41edd6(0x1c8)](''));}
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a91_0x2edd1c=a91_0x2f73;(function(_0x10cf24,_0x40f225){const _0x4823a0=a91_0x2f73,_0x4a969a=_0x10cf24();while(!![]){try{const _0x235767=parseInt(_0x4823a0(0x109))/0x1+parseInt(_0x4823a0(0xfa))/0x2*(-parseInt(_0x4823a0(0x11c))/0x3)+-parseInt(_0x4823a0(0x107))/0x4*(-parseInt(_0x4823a0(0x100))/0x5)+-parseInt(_0x4823a0(0x115))/0x6+-parseInt(_0x4823a0(0xf5))/0x7*(parseInt(_0x4823a0(0x11a))/0x8)+-parseInt(_0x4823a0(0x103))/0x9*(parseInt(_0x4823a0(0x10c))/0xa)+parseInt(_0x4823a0(0xfd))/0xb;if(_0x235767===_0x40f225)break;else _0x4a969a['push'](_0x4a969a['shift']());}catch(_0x39b43a){_0x4a969a['push'](_0x4a969a['shift']());}}}(a91_0x1a47,0xeb2be));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';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();function a91_0x1a47(){const _0x48c8e1=['6813VEepZC','Project','Dataset\x20&\x20Operations','from','16hGLLJx','Database\x20Connections','642671tGcdic','map','risk','3290zdCaoY','SQL\x20Queries','Run\x20any\x20package.json\x20script','auth','run','push','\x20\x20[high-risk-write]','description','Self\x20Update','9651120PGdjKl','\x20\x20[write]','defaultCommand','Diagnostics','get','6472VdNorp','isSingleCommand','5997GVZczi','logout','login','start','<script>','show','write','command','14567tNIcTo','App\x20Management','has','Menu','commands','1842vSPUEf','service','wildcardDef','55831468zPLhzn','skill','set','783980eLWeUP','Schema','Logs'];a91_0x1a47=function(){return _0x48c8e1;};return a91_0x1a47();}export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x5ccdc1){const _0x134121=a91_0x2f73;for(const _0x2514b7 of _0x5ccdc1){definitions[_0x134121(0xff)](_0x2514b7['service']+':'+_0x2514b7[_0x134121(0xf4)],_0x2514b7);let _0x5b64f6=serviceGroups[_0x134121(0x119)](_0x2514b7[_0x134121(0xfb)]);!_0x5b64f6&&(_0x5b64f6=[],serviceGroups[_0x134121(0xff)](_0x2514b7[_0x134121(0xfb)],_0x5b64f6)),_0x5b64f6[_0x134121(0x111)](_0x2514b7);}}function registerDeclarativeService(_0xa7b308,_0x5e5c4d,_0xfe0af4){const _0x2efd6f=a91_0x2f73;registerDefinitions(_0x5e5c4d);_0xfe0af4?.['wildcardDef']&®isterDefinitions([_0xfe0af4[_0x2efd6f(0xfc)]]);const _0x2b519e=_0x496ae4=>_0x496ae4==='read'?'':_0x496ae4===_0x2efd6f(0xf3)?_0x2efd6f(0x116):_0x2efd6f(0x112),_0x5b04ca={'service':_0x5e5c4d[0x0]['service'],'label':_0xa7b308,'commands':_0x5e5c4d[_0x2efd6f(0x10a)](_0x2a0861=>({'command':_0x2a0861[_0x2efd6f(0xf4)],'description':_0x2a0861[_0x2efd6f(0x113)],'tag':_0x2b519e(_0x2a0861[_0x2efd6f(0x10b)])})),'declarative':!![],'defaultCommand':_0xfe0af4?.[_0x2efd6f(0x117)]??(_0xfe0af4?.[_0x2efd6f(0x11b)]?_0x5e5c4d[0x0][_0x2efd6f(0xf4)]:undefined),'wildcardDef':_0xfe0af4?.[_0x2efd6f(0xfc)],'isSingleCommand':_0xfe0af4?.[_0x2efd6f(0x11b)]};serviceRegistry[_0x2efd6f(0x111)](_0x5b04ca),serviceByName[_0x2efd6f(0xff)](_0x5b04ca[_0x2efd6f(0xfb)],_0x5b04ca);}function a91_0x2f73(_0x51dfbb,_0x4f8a9c){_0x51dfbb=_0x51dfbb-0xef;const _0x1a4772=a91_0x1a47();let _0x2f738e=_0x1a4772[_0x51dfbb];return _0x2f738e;}registerDeclarativeService('Quick\x20Start',initDefinitions,{'defaultCommand':a91_0x2edd1c(0x110),'isSingleCommand':!![]}),registerDeclarativeService(a91_0x2edd1c(0x104),projectDefinitions),registerDeclarativeService(a91_0x2edd1c(0xf6),appDefinitions),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry['length']-0x1];last[a91_0x2edd1c(0xf9)]=[{'command':a91_0x2edd1c(0xf1),'description':a91_0x2edd1c(0x10e),'tag':''}];}registerDeclarativeService('Authentication',authDefinitions,{'defaultCommand':a91_0x2edd1c(0xef)}),registerDeclarativeService(a91_0x2edd1c(0x114),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a91_0x2edd1c(0x118),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a91_0x2edd1c(0x101),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Configuration',configDefinitions),registerDeclarativeService('API',apiDefinitions),registerDeclarativeService(a91_0x2edd1c(0xf8),menuDefinitions),registerDeclarativeService(a91_0x2edd1c(0x108),dbDefinitions),registerDeclarativeService(a91_0x2edd1c(0x105),datasetDefinitions),registerDeclarativeService('BFF\x20Scripts',bffDefinitions),registerDeclarativeService(a91_0x2edd1c(0x10d),sqlDefinitions),registerDeclarativeService('Code\x20Generation',codegenDefinitions),registerDeclarativeService('Skills',skillDefinitions),registerDeclarativeService(a91_0x2edd1c(0x102),logsDefinitions,{'defaultCommand':a91_0x2edd1c(0xf2)});export const deprecatedAliases={'create':{'service':'project','command':'create'},'start':{'service':a91_0x2edd1c(0x110),'command':a91_0x2edd1c(0xf0)},'build':{'service':a91_0x2edd1c(0x110),'command':'build'},'preview':{'service':a91_0x2edd1c(0x110),'command':'preview'},'logout':{'service':a91_0x2edd1c(0x10f),'command':a91_0x2edd1c(0x11d)},'skills':{'service':a91_0x2edd1c(0xfe),'command':'install'}};export function findDefinition(_0x17f396,_0x12188f){return definitions['get'](_0x17f396+':'+_0x12188f);}export function isKnownService(_0x252a6c){const _0x3afe3a=a91_0x2edd1c;return serviceByName[_0x3afe3a(0xf7)](_0x252a6c);}export function isDeclarativeService(_0xa28846){const _0x421d41=a91_0x2edd1c;return serviceGroups[_0x421d41(0xf7)](_0xa28846)||serviceByName[_0x421d41(0x119)](_0xa28846)?.[_0x421d41(0xfc)]!==undefined;}export function getServiceEntry(_0x181c90){return serviceByName['get'](_0x181c90);}export function getLegacyHandler(_0x4fb221,_0x565a18){return undefined;}export function getAllDefinitions(){const _0x1a6dea=a91_0x2edd1c;return Array[_0x1a6dea(0x106)](definitions['values']());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a92_0x5819(_0x386d53,_0x3c3f2a){_0x386d53=_0x386d53-0x8e;const _0x39c8d8=a92_0x39c8();let _0x581918=_0x39c8d8[_0x386d53];return _0x581918;}const a92_0x31a05d=a92_0x5819;(function(_0x4add9d,_0x2b546f){const _0x4df239=a92_0x5819,_0x479421=_0x4add9d();while(!![]){try{const _0x446b3c=-parseInt(_0x4df239(0xa0))/0x1*(parseInt(_0x4df239(0xc9))/0x2)+-parseInt(_0x4df239(0xae))/0x3*(parseInt(_0x4df239(0xb2))/0x4)+-parseInt(_0x4df239(0xbc))/0x5*(-parseInt(_0x4df239(0xc8))/0x6)+-parseInt(_0x4df239(0x8f))/0x7+parseInt(_0x4df239(0x98))/0x8*(parseInt(_0x4df239(0x9e))/0x9)+-parseInt(_0x4df239(0x9f))/0xa+parseInt(_0x4df239(0x8e))/0xb;if(_0x446b3c===_0x2b546f)break;else _0x479421['push'](_0x479421['shift']());}catch(_0x57b80d){_0x479421['push'](_0x479421['shift']());}}}(a92_0x39c8,0x25c6b));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';function a92_0x39c8(){const _0x3f255e=['\x20run\x20build','args','watch','node_modules','9EAyLPh','slice','max','close','317216FUuBgB','join','script','vite\x20preview\x20exited\x20with\x20code\x20','\x20run\x20','keys','push','\x20\x20\x20\x20','scripts','.bin','110RHshro','cwd','utf-8','\x22\x20not\x20found\x20in\x20package.json.','needsUpgrade','\x20run\x20start','\x20\x20AVAILABLE\x20SCRIPTS\x20\x20(current\x20project)','start','length','validation','error','log','43968GuqnmF','13678DtLtZj','entries','7894381McNzUz','543172fglRKD','(none)','run','No\x20scripts\x20defined\x20in\x20package.json.','Run\x20a\x20package.json\x20script','padEnd','\x20\x20EXAMPLES','bun.lock','yarn','8yCQyOa','all','inherit','has','\x20run\x20<script>\x0a','Script\x20name\x20defined\x20in\x20package.json','728199AlmDhg','1818040ZbHzVC','45BHPstk','pnpm-lock.yaml','map','package.json','dev','boolean','parse','No\x20package.json\x20found\x20in\x20current\x20directory.','vite','npm'];a92_0x39c8=function(){return _0x3f255e;};return a92_0x39c8();}import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a92_0x31a05d(0xc3),a92_0x31a05d(0xa4)]);function readPackageScripts(_0x2c48de){const _0x2b7383=a92_0x31a05d,_0x2a1146=resolve(_0x2c48de,_0x2b7383(0xa3));if(!existsSync(_0x2a1146))return null;try{const _0x9f84a7=JSON[_0x2b7383(0xa6)](readFileSync(_0x2a1146,_0x2b7383(0xbe)));return _0x9f84a7[_0x2b7383(0xba)]??{};}catch{return null;}}function detectPackageManager(_0x58a7a9){const _0x4ea8fd=a92_0x31a05d;if(existsSync(resolve(_0x58a7a9,'bun.lockb'))||existsSync(resolve(_0x58a7a9,_0x4ea8fd(0x96))))return'bun';if(existsSync(resolve(_0x58a7a9,_0x4ea8fd(0xa1))))return'pnpm';if(existsSync(resolve(_0x58a7a9,'yarn.lock')))return _0x4ea8fd(0x97);return _0x4ea8fd(0xa9);}async function versionCheck(_0x489b04){const _0x2c9385=a92_0x31a05d,_0x140557=await checkCliVersion();if(_0x140557['needsUpgrade'])printCliUpgradeWarning(_0x140557);const _0x501fec=await checkSdkVersion(_0x489b04);if(_0x501fec[_0x2c9385(0xc0)])printSdkUpgradeWarning(_0x501fec);}function spawnScript(_0x33654f,_0x31ff7f,_0x5350f,_0x5642b5){return new Promise((_0x453492,_0x3f6be2)=>{const _0x4ac083=a92_0x5819,_0x5d49b1=['run',_0x31ff7f,..._0x5350f],_0x102a06=spawn(_0x33654f,_0x5d49b1,{'cwd':_0x5642b5,'stdio':_0x4ac083(0x9a),'shell':!![],'env':{...process.env,'PATH':''+join(_0x5642b5,_0x4ac083(0xad),_0x4ac083(0xbb))+delimiter+process.env.PATH}});_0x102a06['on'](_0x4ac083(0xb1),_0x394c69=>{const _0x5733af=_0x4ac083;if(_0x394c69===0x0||_0x394c69===null)_0x453492();else _0x3f6be2(new Error(_0x33654f+_0x5733af(0xb6)+_0x31ff7f+'\x20exited\x20with\x20code\x20'+_0x394c69));}),_0x102a06['on']('error',_0x3f6be2);});}function spawnViteBuildWatch(_0x55e30d){return new Promise((_0x3e3040,_0x348b39)=>{const _0x3bbf1d=a92_0x5819,_0x1763e4=spawn(_0x3bbf1d(0xa8),['build','--watch'],{'cwd':_0x55e30d,'stdio':_0x3bbf1d(0x9a),'shell':!![],'env':{...process.env,'PATH':''+join(_0x55e30d,_0x3bbf1d(0xad),_0x3bbf1d(0xbb))+delimiter+process.env.PATH}});_0x1763e4['on'](_0x3bbf1d(0xb1),_0x369377=>{if(_0x369377===0x0||_0x369377===null)_0x3e3040();else _0x348b39(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x369377));}),_0x1763e4['on'](_0x3bbf1d(0xc6),_0x348b39);});}function spawnVitePreview(_0x116802){return new Promise((_0x2ee17f,_0x4a7967)=>{const _0x428e01=a92_0x5819,_0x5a05df=spawn(_0x428e01(0xa8),['preview'],{'cwd':_0x116802,'stdio':_0x428e01(0x9a),'shell':!![],'env':{...process.env,'PATH':''+join(_0x116802,_0x428e01(0xad),_0x428e01(0xbb))+delimiter+process.env.PATH}});_0x5a05df['on'](_0x428e01(0xb1),_0x322d04=>{const _0x410804=_0x428e01;if(_0x322d04===0x0||_0x322d04===null)_0x2ee17f();else _0x4a7967(new Error(_0x410804(0xb5)+_0x322d04));}),_0x5a05df['on'](_0x428e01(0xc6),_0x4a7967);});}const runFlags=[{'name':a92_0x31a05d(0xac),'type':a92_0x31a05d(0xa5),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':a92_0x31a05d(0x91),'command':a92_0x31a05d(0x91),'description':a92_0x31a05d(0x93),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a92_0x31a05d(0xb4),'description':a92_0x31a05d(0x9d),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x5c6132=a92_0x31a05d,_0x11b4b7=readPackageScripts(process[_0x5c6132(0xbd)]()),_0xc3af7d=[];if(_0x11b4b7&&Object['keys'](_0x11b4b7)[_0x5c6132(0xc4)]>0x0){const _0x53bab1=Object[_0x5c6132(0xb7)](_0x11b4b7),_0x63aa83=Math[_0x5c6132(0xb0)](..._0x53bab1[_0x5c6132(0xa2)](_0x22f2e8=>_0x22f2e8[_0x5c6132(0xc4)]));_0xc3af7d[_0x5c6132(0xb8)](_0x5c6132(0xc2));for(const [_0x44a174,_0xf7963d]of Object[_0x5c6132(0xca)](_0x11b4b7)){_0xc3af7d[_0x5c6132(0xb8)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x5c6132(0xb6)+_0x44a174[_0x5c6132(0x94)](_0x63aa83+0x2)+'#\x20'+_0xf7963d);}}else _0xc3af7d[_0x5c6132(0xb8)](_0x5c6132(0x95)),_0xc3af7d[_0x5c6132(0xb8)](_0x5c6132(0xb9)+CLI_BIN_NAME+_0x5c6132(0xc1)),_0xc3af7d[_0x5c6132(0xb8)](_0x5c6132(0xb9)+CLI_BIN_NAME+_0x5c6132(0xaa)),_0xc3af7d[_0x5c6132(0xb8)](_0x5c6132(0xb9)+CLI_BIN_NAME+'\x20run\x20preview'),_0xc3af7d[_0x5c6132(0xb8)](_0x5c6132(0xb9)+CLI_BIN_NAME+'\x20run\x20preview\x20--watch\x20\x20\x20#\x20parallel\x20build\x20--watch\x20+\x20preview');return _0xc3af7d[_0x5c6132(0xb3)]('\x0a');},async 'execute'(_0x102ec9){const _0x2ee861=a92_0x31a05d,_0x1cfc5a=process['cwd'](),_0x4a4e6f=_0x102ec9[_0x2ee861(0xab)][0x0],_0x322c9e=_0x102ec9[_0x2ee861(0xab)][_0x2ee861(0xaf)](0x1),_0x2bc4b9=readPackageScripts(_0x1cfc5a);if(!_0x2bc4b9)throw CliErrors[_0x2ee861(0xc5)](_0x2ee861(0xa7));if(!_0x4a4e6f){const _0x2eb5eb=Object[_0x2ee861(0xb7)](_0x2bc4b9);if(_0x2eb5eb['length']===0x0)console[_0x2ee861(0xc7)](_0x2ee861(0x92));else{console['log']('\x0a\x20\x20Available\x20scripts:\x0a');const _0x292bbd=Math[_0x2ee861(0xb0)](..._0x2eb5eb[_0x2ee861(0xa2)](_0x362003=>_0x362003[_0x2ee861(0xc4)]));for(const [_0x1685fd,_0x55932f]of Object[_0x2ee861(0xca)](_0x2bc4b9)){console[_0x2ee861(0xc7)](_0x2ee861(0xb9)+_0x1685fd[_0x2ee861(0x94)](_0x292bbd+0x2)+_0x55932f);}console[_0x2ee861(0xc7)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+_0x2ee861(0x9c));}return{'ok':!![]};}if(!_0x2bc4b9[_0x4a4e6f])throw CliErrors[_0x2ee861(0xc5)]('Script\x20\x22'+_0x4a4e6f+_0x2ee861(0xbf),'Available:\x20'+(Object[_0x2ee861(0xb7)](_0x2bc4b9)['join'](',\x20')||_0x2ee861(0x90)));const _0x339300=detectPackageManager(_0x1cfc5a);VERSION_CHECK_SCRIPTS[_0x2ee861(0x9b)](_0x4a4e6f)&&await versionCheck(_0x1cfc5a);if(_0x4a4e6f==='preview'&&_0x102ec9['bool'](_0x2ee861(0xac)))return await Promise[_0x2ee861(0x99)]([spawnViteBuildWatch(_0x1cfc5a),spawnVitePreview(_0x1cfc5a)]),{'ok':!![]};return await spawnScript(_0x339300,_0x4a4e6f,_0x322c9e,_0x1cfc5a),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a93_0x32cd(_0x4b049e,_0x503ecd){_0x4b049e=_0x4b049e-0xa2;const _0x29b0d0=a93_0x29b0();let _0x32cd3b=_0x29b0d0[_0x4b049e];return _0x32cd3b;}const a93_0x4e7f89=a93_0x32cd;(function(_0x62bc7,_0x557075){const _0x1b2e49=a93_0x32cd,_0x4980eb=_0x62bc7();while(!![]){try{const _0x3f4cd6=parseInt(_0x1b2e49(0xa9))/0x1*(-parseInt(_0x1b2e49(0xa5))/0x2)+parseInt(_0x1b2e49(0xac))/0x3*(parseInt(_0x1b2e49(0xa4))/0x4)+parseInt(_0x1b2e49(0xa7))/0x5+parseInt(_0x1b2e49(0xad))/0x6*(-parseInt(_0x1b2e49(0xab))/0x7)+-parseInt(_0x1b2e49(0xa6))/0x8+-parseInt(_0x1b2e49(0xaa))/0x9*(parseInt(_0x1b2e49(0xa2))/0xa)+parseInt(_0x1b2e49(0xa8))/0xb;if(_0x3f4cd6===_0x557075)break;else _0x4980eb['push'](_0x4980eb['shift']());}catch(_0xb8574d){_0x4980eb['push'](_0x4980eb['shift']());}}}(a93_0x29b0,0xaab46));import{buildSchemaPayload}from'../framework/schema-export.js';function a93_0x29b0(){const _0x33fe7e=['110JByUIX','json','40VxOaLv','284pecZVd','2226792gvwDTI','6692445UoOLwc','10462067BBSvGK','6029nwBuYI','838602JRUYow','35EBzvau','255516kowQAJ','339210NktKsT'];a93_0x29b0=function(){return _0x33fe7e;};return a93_0x29b0();}async function execute(_0x4a52eb){const _0x39e5a2=await buildSchemaPayload();return{'ok':!![],'data':_0x39e5a2};}export const schemaDefinition={'service':'schema','command':'export','description':'Export\x20machine-readable\x20command\x20schema\x20(JSON)','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a93_0x4e7f89(0xa3),'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a94_0x255bfd=a94_0x1b93;function a94_0x1b93(_0x50a7d5,_0x8fed61){_0x50a7d5=_0x50a7d5-0x1e1;const _0x469c6f=a94_0x469c();let _0x1b93b6=_0x469c6f[_0x50a7d5];return _0x1b93b6;}(function(_0x4c1714,_0x3eb844){const _0x4ced79=a94_0x1b93,_0x367897=_0x4c1714();while(!![]){try{const _0x295bd7=parseInt(_0x4ced79(0x1fd))/0x1+-parseInt(_0x4ced79(0x1ea))/0x2*(-parseInt(_0x4ced79(0x1eb))/0x3)+parseInt(_0x4ced79(0x1f7))/0x4+-parseInt(_0x4ced79(0x1ef))/0x5+parseInt(_0x4ced79(0x1f0))/0x6+-parseInt(_0x4ced79(0x1f5))/0x7+parseInt(_0x4ced79(0x1e3))/0x8*(-parseInt(_0x4ced79(0x1e6))/0x9);if(_0x295bd7===_0x3eb844)break;else _0x367897['push'](_0x367897['shift']());}catch(_0xd5954a){_0x367897['push'](_0x367897['shift']());}}}(a94_0x469c,0x4ba63));import{CliErrors}from'../../errors.js';function a94_0x469c(){const _0x337134=['setLogPath','write','log','29228ohiHiA','\x20skill\x20installed','npx\x20skills\x20add\x20failed:\x20','cwd','4920MrNogy','lovrabet/rabetbase','pipe','7038LpluAC','apiError','Installing\x20official\x20skill\x20via\x20npx\x20(npx\x20-y\x20skills\x20add\x20lovrabet/rabetbase\x20--global)...','nonInteractive','745196xKtopn','3UMYgxM','skill-install','skipped','info','2241850BpNfPX','1673460CZKjVp','unknown','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20skill\x20is\x20already\x20present.','Install\x20developer\x20skill\x20package','error','185815Wxkpig','../../skills/npx-skills-add.js','2339872cyDRHB','inherit','Check\x20network\x20connectivity\x20and\x20try\x20again.'];a94_0x469c=function(){return _0x337134;};return a94_0x469c();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';export const skillDefinitions=[{'service':'skill','command':'install','description':a94_0x255bfd(0x1f3),'risk':a94_0x255bfd(0x1fb),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2bbd87){const _0x59763e=a94_0x255bfd;logger[_0x59763e(0x1fa)](process[_0x59763e(0x1e2)]()),logger[_0x59763e(0x1ee)](_0x59763e(0x1ec),'执行安装技能包命令(委托给\x20npx\x20skills\x20--global)');const {runNpxSkillsAddGlobal:_0x356ac8}=await import(_0x59763e(0x1f6)),_0x4cc41e=_0x2bbd87[_0x59763e(0x1e9)]?_0x59763e(0x1e5):_0x59763e(0x1f8);console[_0x59763e(0x1fc)](_0x59763e(0x1e8));const _0x30773e=_0x356ac8(process[_0x59763e(0x1e2)](),_0x59763e(0x1e4),{'stdio':_0x4cc41e});if(_0x30773e[_0x59763e(0x1ed)])console['log'](_0x59763e(0x1f2));else{if(_0x30773e['ok'])console[_0x59763e(0x1fc)](CLI_BIN_NAME+_0x59763e(0x1fe));else throw CliErrors[_0x59763e(0x1e7)](_0x59763e(0x1e1)+(_0x30773e[_0x59763e(0x1f4)]||_0x59763e(0x1f1)),_0x59763e(0x1f9));}return{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a95_0x363c(_0x545503,_0x520132){_0x545503=_0x545503-0x142;const _0x40e3a9=a95_0x40e3();let _0x363c8e=_0x40e3a9[_0x545503];return _0x363c8e;}const a95_0x12a954=a95_0x363c;(function(_0x34102a,_0x5de7e7){const _0x53fd16=a95_0x363c,_0x1d7057=_0x34102a();while(!![]){try{const _0x51b511=-parseInt(_0x53fd16(0x14e))/0x1*(parseInt(_0x53fd16(0x154))/0x2)+-parseInt(_0x53fd16(0x144))/0x3+-parseInt(_0x53fd16(0x142))/0x4*(-parseInt(_0x53fd16(0x152))/0x5)+parseInt(_0x53fd16(0x14a))/0x6*(parseInt(_0x53fd16(0x14f))/0x7)+parseInt(_0x53fd16(0x155))/0x8+-parseInt(_0x53fd16(0x143))/0x9+parseInt(_0x53fd16(0x151))/0xa;if(_0x51b511===_0x5de7e7)break;else _0x1d7057['push'](_0x1d7057['shift']());}catch(_0x581d8e){_0x1d7057['push'](_0x1d7057['shift']());}}}(a95_0x40e3,0x20f28));import{getSqlQueryInfo}from'../../core/api-client.js';function a95_0x40e3(){const _0x506369=['sqlName','Get\x20custom\x20SQL\x20query\x20details\x20by\x20sqlCode','1335NKwhnm','10570QvlnBH','appCode','3006230lzzwQl','5wwdCAU','verbose','98tldlTc','781384HyrkZM','dbId','81460emeasN','1074960UuCUOn','373572NyUkws','detail','str','description','read','sql','102flhiDR','sqlcode'];a95_0x40e3=function(){return _0x506369;};return a95_0x40e3();}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const sqlDetail={'service':a95_0x12a954(0x149),'command':a95_0x12a954(0x145),'description':a95_0x12a954(0x14d),'risk':a95_0x12a954(0x148),'flags':[SQLCODE_FLAG,{'name':'verbose','type':'boolean','description':'Return\x20full\x20raw\x20SQL\x20query\x20object'}],async 'execute'(_0x5f1f46){const _0x3c6ab6=a95_0x12a954,_0xeb334a=await getSqlQueryInfo(_0x5f1f46[_0x3c6ab6(0x150)],_0x5f1f46[_0x3c6ab6(0x146)](_0x3c6ab6(0x14b))),_0x577776=_0x5f1f46['bool'](_0x3c6ab6(0x153));if(_0x577776)return{'ok':!![],'data':_0xeb334a};const _0x3371f8=_0xeb334a[_0x3c6ab6(0x156)]?await getDbName(_0x5f1f46['appCode'],_0xeb334a[_0x3c6ab6(0x156)]):undefined;return{'ok':!![],'data':{'sqlCode':_0xeb334a['sqlCode'],'sqlName':_0xeb334a[_0x3c6ab6(0x14c)],'db':_0x3371f8?_0x3371f8+'\x20('+_0xeb334a[_0x3c6ab6(0x156)]+')':_0xeb334a['dbId']??'','description':_0xeb334a[_0x3c6ab6(0x147)]??'','sqlContent':_0xeb334a['sqlContent']??''}};}};
|
package/lib/commands/sql/exec.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a96_0x319bc2=a96_0x1621;function a96_0x1621(_0x2f4aa6,_0x3a3a3b){_0x2f4aa6=_0x2f4aa6-0x103;const _0x546b65=a96_0x546b();let _0x162189=_0x546b65[_0x2f4aa6];return _0x162189;}(function(_0x57baee,_0x5e8691){const _0x59f99f=a96_0x1621,_0x24ee3a=_0x57baee();while(!![]){try{const _0x236253=-parseInt(_0x59f99f(0x114))/0x1+parseInt(_0x59f99f(0x110))/0x2*(parseInt(_0x59f99f(0x11a))/0x3)+-parseInt(_0x59f99f(0x11b))/0x4*(parseInt(_0x59f99f(0x113))/0x5)+-parseInt(_0x59f99f(0x119))/0x6+-parseInt(_0x59f99f(0x115))/0x7+-parseInt(_0x59f99f(0x10b))/0x8+-parseInt(_0x59f99f(0x109))/0x9*(-parseInt(_0x59f99f(0x103))/0xa);if(_0x236253===_0x5e8691)break;else _0x24ee3a['push'](_0x24ee3a['shift']());}catch(_0x59e02a){_0x24ee3a['push'](_0x24ee3a['shift']());}}}(a96_0x546b,0x3f39d));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_0x319bc2(0x104),'command':a96_0x319bc2(0x10a),'description':'Execute\x20a\x20custom\x20SQL\x20query\x20by\x20sqlCode','risk':a96_0x319bc2(0x116),'flags':[SQLCODE_FLAG,{'name':a96_0x319bc2(0x107),'type':'string','description':a96_0x319bc2(0x117)}],async 'execute'(_0x58ebe8){const _0x129c5c=a96_0x319bc2;let _0x1f6fe0;const _0x3a4ddf=_0x58ebe8['str'](_0x129c5c(0x107));if(_0x3a4ddf)try{_0x1f6fe0=JSON['parse'](_0x3a4ddf);}catch{throw CliErrors['validation'](_0x129c5c(0x106)+_0x3a4ddf);}const _0x4c0041=Date[_0x129c5c(0x112)](),_0x4b89e2=await executeSql(_0x58ebe8['appCode'],_0x58ebe8[_0x129c5c(0x10d)]('sqlcode'),_0x1f6fe0),_0x13a2ef=Date[_0x129c5c(0x112)]()-_0x4c0041,_0x2508a3=_0x4b89e2?.[_0x129c5c(0x118)]??_0x4b89e2,_0x156c6=_0x4b89e2?.[_0x129c5c(0x10c)]??!![];if(!_0x156c6)return{'ok':![],'data':{'error':_0x4b89e2?.[_0x129c5c(0x111)]||_0x129c5c(0x10e),'elapsed':_0x13a2ef},'message':_0x129c5c(0x10e)};const _0x2143bf=Array['isArray'](_0x2508a3)?_0x2508a3:[];return{'ok':!![],'data':{'rows':_0x2143bf,'rowCount':_0x2143bf[_0x129c5c(0x108)],'elapsed':_0x13a2ef},'message':_0x129c5c(0x105)+_0x2143bf[_0x129c5c(0x108)]+_0x129c5c(0x10f)+_0x13a2ef+'ms'};}};function a96_0x546b(){const _0x3e24e9=['8bRGCXf','execError','now','319055yGxNjO','488053lXoETn','2140453pIhoZe','read','SQL\x20parameters\x20as\x20JSON\x20string\x20(e.g.\x20\x27{\x22key\x22:\x22value\x22}\x27)','execResult','1794594wLQzpD','191250AjsERq','4HveERL','1330WTuXrb','sql','Returned\x20','Invalid\x20JSON\x20for\x20--params:\x20','params','length','89874yzQQSs','exec','1339384qBxgar','execSuccess','str','SQL\x20execution\x20failed','\x20row(s)\x20in\x20'];a96_0x546b=function(){return _0x3e24e9;};return a96_0x546b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a97_0x52ca(){const _0x160311=['1887126ymycxE','10ODYXNY','10ptObRF','3357072SyLFjp','7oNnAnp','27248155BGYrKH','1298216CTAbzb','1661582gTvGHA','1140504IJuwEg','1yanxdW','5277708FPpPoi'];a97_0x52ca=function(){return _0x160311;};return a97_0x52ca();}(function(_0x383667,_0x206ce2){const _0x4a34d6=a97_0x47f8,_0xbcbde0=_0x383667();while(!![]){try{const _0x4a3fd2=parseInt(_0x4a34d6(0xb7))/0x1*(-parseInt(_0x4a34d6(0xb5))/0x2)+-parseInt(_0x4a34d6(0xb9))/0x3+parseInt(_0x4a34d6(0xb4))/0x4*(parseInt(_0x4a34d6(0xb0))/0x5)+-parseInt(_0x4a34d6(0xb6))/0x6*(parseInt(_0x4a34d6(0xb2))/0x7)+-parseInt(_0x4a34d6(0xb1))/0x8+-parseInt(_0x4a34d6(0xb8))/0x9+-parseInt(_0x4a34d6(0xba))/0xa*(-parseInt(_0x4a34d6(0xb3))/0xb);if(_0x4a3fd2===_0x206ce2)break;else _0xbcbde0['push'](_0xbcbde0['shift']());}catch(_0x380730){_0xbcbde0['push'](_0xbcbde0['shift']());}}}(a97_0x52ca,0x72cea));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_0x47f8(_0xfc59be,_0x1bfd7a){_0xfc59be=_0xfc59be-0xb0;const _0x52ca59=a97_0x52ca();let _0x47f8b1=_0x52ca59[_0xfc59be];return _0x47f8b1;}import{sqlExec}from'../../commands/sql/exec.js';import{sqlPull}from'../../commands/sql/pull.js';export const sqlDefinitions=[sqlList,sqlDetail,sqlValidate,sqlSave,sqlExec,sqlPull];
|
package/lib/commands/sql/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a98_0xfb5cc5=a98_0x120c;(function(_0x1d8afa,_0x9ca0f4){const _0x237410=a98_0x120c,_0x4717f9=_0x1d8afa();while(!![]){try{const _0x78207a=parseInt(_0x237410(0xd3))/0x1*(parseInt(_0x237410(0xcf))/0x2)+-parseInt(_0x237410(0xbd))/0x3*(parseInt(_0x237410(0xb5))/0x4)+-parseInt(_0x237410(0xd0))/0x5*(-parseInt(_0x237410(0xae))/0x6)+-parseInt(_0x237410(0xb0))/0x7*(parseInt(_0x237410(0xb2))/0x8)+-parseInt(_0x237410(0xcb))/0x9*(parseInt(_0x237410(0xc4))/0xa)+parseInt(_0x237410(0xb3))/0xb*(parseInt(_0x237410(0xd1))/0xc)+parseInt(_0x237410(0xbc))/0xd*(parseInt(_0x237410(0xc8))/0xe);if(_0x78207a===_0x9ca0f4)break;else _0x4717f9['push'](_0x4717f9['shift']());}catch(_0x12aa00){_0x4717f9['push'](_0x4717f9['shift']());}}}(a98_0x3924,0xda23f));function a98_0x3924(){const _0x349ad9=['tableData','pagesize','6gEiYnf','totalCount','855225PGmoPC','\x20SQL\x20queries\x20(total:\x20','8wFiOLX','11rZoBxf','Found\x20','5381724OfITGU','boolean','all','num','sqlCode','map','number','3969849udiKsv','3MLdTbN','length','appCode','sqlcode','page','sql','paging','11823550DiTBBp','List\x20custom\x20SQL\x20queries','Page\x20number','sqlName','14jqmmzi','name','string','9ULGCcs','Filter\x20by\x20SQL\x20name','dbId','str','2680842fSbpBN','3437905XJDVoE','14521068insNQZ','description','1FfdMXB'];a98_0x3924=function(){return _0x349ad9;};return a98_0x3924();}import{listSqlQueries}from'../../core/api-client.js';function a98_0x120c(_0x2e1eec,_0x36f7d7){_0x2e1eec=_0x2e1eec-0xae;const _0x39245c=a98_0x3924();let _0x120ce5=_0x39245c[_0x2e1eec];return _0x120ce5;}import{getDbName}from'../../core/db-resolver.js';import{SQLCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const sqlList={'service':a98_0xfb5cc5(0xc2),'command':'list','description':a98_0xfb5cc5(0xc5),'risk':'read','flags':[SQLCODE_FLAG_OPTIONAL,{'name':a98_0xfb5cc5(0xc9),'type':a98_0xfb5cc5(0xca),'description':a98_0xfb5cc5(0xcc)},{'name':a98_0xfb5cc5(0xc1),'type':a98_0xfb5cc5(0xbb),'description':a98_0xfb5cc5(0xc6),'default':0x1},{'name':a98_0xfb5cc5(0xd5),'type':a98_0xfb5cc5(0xbb),'description':'Page\x20size'},{'name':'verbose','type':a98_0xfb5cc5(0xb6),'description':'Return\x20full\x20SQL\x20query\x20objects\x20including\x20parameters\x20and\x20SQL\x20content'}],async 'execute'(_0x739eb9){const _0x278dae=a98_0xfb5cc5,_0x33665c=await listSqlQueries(_0x739eb9['appCode'],{'sqlCode':_0x739eb9[_0x278dae(0xce)](_0x278dae(0xc0))||undefined,'sqlName':_0x739eb9['str'](_0x278dae(0xc9))||undefined,'currentPage':_0x739eb9[_0x278dae(0xb8)]('page'),'pageSize':_0x739eb9[_0x278dae(0xb8)](_0x278dae(0xd5),0x32)}),_0xb1b709=_0x739eb9['bool']('verbose'),_0x5046ef=_0x33665c[_0x278dae(0xd4)]??[],_0x22abc2=_0x33665c[_0x278dae(0xc3)]?.[_0x278dae(0xaf)]??_0x5046ef[_0x278dae(0xbe)];let _0x3323f7;return _0xb1b709?_0x3323f7=_0x5046ef:_0x3323f7=await Promise[_0x278dae(0xb7)](_0x5046ef[_0x278dae(0xba)](async _0x18f033=>{const _0x464b01=_0x278dae;let _0x3fa3ff;try{_0x3fa3ff=_0x18f033[_0x464b01(0xcd)]?await getDbName(_0x739eb9[_0x464b01(0xbf)],_0x18f033[_0x464b01(0xcd)]):undefined;}catch{}return{'sqlCode':_0x18f033[_0x464b01(0xb9)],'sqlName':_0x18f033[_0x464b01(0xc7)],'description':_0x18f033[_0x464b01(0xd2)]??'','db':_0x3fa3ff?_0x3fa3ff+'\x20('+_0x18f033[_0x464b01(0xcd)]+')':_0x18f033['dbId']??''};})),{'ok':!![],'data':_0x3323f7,'message':_0x5046ef[_0x278dae(0xbe)]===0x0?'No\x20custom\x20SQL\x20queries\x20found.':_0x278dae(0xb4)+_0x5046ef['length']+_0x278dae(0xb1)+_0x22abc2+').'};}};
|