@lovrabet/rabetbase-cli 2.2.4-beta.6 → 2.2.4
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/create.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/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/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.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/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.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/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.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/create.js +1 -1
- package/lib/commands/sql/delete.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/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.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/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.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/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.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/telemetry/send-platform-issue-collect-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/cli-version-policy.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 -1
- 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/params.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/update-notice.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 +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x444549,_0x1ae9c3){const _0x1e16f3=a110_0x5b93,_0xf17a0a=_0x444549();while(!![]){try{const _0x2a8e78=-parseInt(_0x1e16f3(0xb0))/0x1+parseInt(_0x1e16f3(0xcb))/0x2+parseInt(_0x1e16f3(0xa4))/0x3+parseInt(_0x1e16f3(0xc2))/0x4+-parseInt(_0x1e16f3(0x9c))/0x5*(parseInt(_0x1e16f3(0xd0))/0x6)+-parseInt(_0x1e16f3(0xab))/0x7*(-parseInt(_0x1e16f3(0xb1))/0x8)+-parseInt(_0x1e16f3(0xa2))/0x9*(parseInt(_0x1e16f3(0xbb))/0xa);if(_0x2a8e78===_0x1ae9c3)break;else _0xf17a0a['push'](_0xf17a0a['shift']());}catch(_0x190428){_0xf17a0a['push'](_0xf17a0a['shift']());}}}(a110_0x234e,0x56c7f));import a110_0x42b928 from'path';function a110_0x234e(){const _0x4a4f8c=['20YkkBTP','\x20dataset(s),\x20generated\x20','test','description','\x20\x20√\x20Project\x20template\x20created','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','6093sirqbi','utf-8','1577967HJbbxj','\x20\x20Pulling\x20API\x20configuration...','name','needsUpgrade','\x20\x20√\x20package.json\x20updated','\x20model(s)','resolve','21FAYgze','Cannot\x20create\x20project\x20in\x20current\x20directory.','Check\x20directory\x20permissions.','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','package.json','440585kWfIQA','930776EItdJx','constants','toLocaleString','string','bun\x20run\x20format','\x20\x20√\x20Pulled\x20','\x0a√\x20Project\x20','env','\x0a\x20\x20cd\x20','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','840wHHaXn','belowMinimum','\x20\x20√\x20Code\x20formatted','\x20\x20Installing\x20dependencies...','ignore','Project\x20directory\x20\x22','join','472272vRcUUL','...','production','dirname','modelCount','readFile','validation','*\x20Creating\x20project\x20','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','60836yFtBva','Project\x20name\x20cannot\x20be\x20empty.','writeFile','\x20api\x20pull`\x20manually\x20later.','chdir','255912JMGPLB','length','cwd','trim','parse','log','bun\x20--version','\x20\x20√\x20Configuration\x20file\x20created','bun'];a110_0x234e=function(){return _0x4a4f8c;};return a110_0x234e();}import a110_0x1ec1db from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';function a110_0x5b93(_0xc85b91,_0x1c22db){_0xc85b91=_0xc85b91-0x9a;const _0x234e9f=a110_0x234e();let _0x5b93e3=_0x234e9f[_0xc85b91];return _0x5b93e3;}import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';import{fetchModelList}from'../../../api/fetch-model-list.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x48cc5d,_0x50700a,_0x14ff6f,_0x3c1159){const _0x34ac34=a110_0x5b93,_0x269157=await checkCliVersion();(_0x269157[_0x34ac34(0xa7)]||_0x269157[_0x34ac34(0xbc)])&&(printCliUpgradeWarning(_0x269157),assertCliVersionSupported(_0x269157));if(!_0x48cc5d||_0x48cc5d[_0x34ac34(0xd3)]()==='')throw CliErrors[_0x34ac34(0xc8)](_0x34ac34(0xcc));const _0x1a2f25=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1a2f25[_0x34ac34(0x9e)](_0x48cc5d))throw CliErrors[_0x34ac34(0xc8)]('Project\x20name\x20contains\x20invalid\x20characters.',_0x34ac34(0xca));if(_0x48cc5d[_0x34ac34(0xd1)]>0x64)throw CliErrors[_0x34ac34(0xc8)]('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.');const _0x2282f4=a110_0x42b928[_0x34ac34(0xaa)](process[_0x34ac34(0xd2)](),_0x48cc5d);if(existsSync(_0x2282f4))throw CliErrors[_0x34ac34(0xc8)](_0x34ac34(0xc0)+_0x48cc5d+'\x22\x20already\x20exists.','Use\x20a\x20different\x20project\x20name.');try{const _0x10142f=a110_0x42b928[_0x34ac34(0xc5)](_0x2282f4);await a110_0x1ec1db['access'](_0x10142f,a110_0x1ec1db[_0x34ac34(0xb2)]['W_OK']);}catch{throw CliErrors['validation'](_0x34ac34(0xac),_0x34ac34(0xad));}try{console['log'](_0x34ac34(0xc9)+_0x48cc5d+_0x34ac34(0xc3));const _0x226421=getSubAppReactDemoTemplateDir();await copyDirectory(_0x226421,_0x2282f4),console[_0x34ac34(0xd5)](_0x34ac34(0xa0)),await updatePackageJsonName(_0x48cc5d),console[_0x34ac34(0xd5)](_0x34ac34(0xa8)),console['log'](_0x34ac34(0xbe)),console[_0x34ac34(0xd5)](_0x34ac34(0xae)),await formatCode(_0x2282f4),console['log'](_0x34ac34(0xbd)),await configureProject(_0x48cc5d,_0x14ff6f,_0x50700a),console[_0x34ac34(0xd5)](_0x34ac34(0x9a)),_0x14ff6f&&await pullApiConfig(_0x2282f4,_0x14ff6f,_0x50700a,_0x3c1159),console[_0x34ac34(0xd5)](_0x34ac34(0xb7)+_0x48cc5d+'\x20created\x20successfully!'),console[_0x34ac34(0xd5)](_0x34ac34(0xb9)+_0x48cc5d),console['log']('\x20\x20rabetbase\x20run\x20start\x0a');}catch(_0x4a9cfb){try{existsSync(_0x2282f4)&&await a110_0x1ec1db['rm'](_0x2282f4,{'recursive':!![],'force':!![]});}catch{}throw _0x4a9cfb;}}async function updatePackageJsonName(_0x518d88){const _0x41134b=a110_0x5b93,_0x218246=a110_0x42b928[_0x41134b(0xaa)](process[_0x41134b(0xd2)](),_0x518d88),_0x24308a=a110_0x42b928[_0x41134b(0xc1)](_0x218246,_0x41134b(0xaf)),_0x979542=await a110_0x1ec1db[_0x41134b(0xc7)](_0x24308a,_0x41134b(0xa3)),_0x27a66b=JSON[_0x41134b(0xd4)](_0x979542);_0x27a66b[_0x41134b(0xa6)]=_0x518d88,_0x27a66b[_0x41134b(0x9f)]=_0x41134b(0xba),await a110_0x1ec1db[_0x41134b(0xcd)](_0x24308a,JSON['stringify'](_0x27a66b,null,0x2)+'\x0a');}function detectPackageManager(){const _0x73adf7=a110_0x5b93;try{return execSync(_0x73adf7(0xd6),{'stdio':_0x73adf7(0xbf)}),_0x73adf7(0x9b);}catch{return'npm';}}async function formatCode(_0x4ef8c4){const _0x2ba134=a110_0x5b93;try{await execAsync(_0x2ba134(0xb5),{'cwd':_0x4ef8c4});}catch{}}async function configureProject(_0x503bac,_0x1c4357,_0x2d245f){const _0x2c7cf8=a110_0x5b93,_0x2ee1ed=a110_0x42b928[_0x2c7cf8(0xaa)](process[_0x2c7cf8(0xd2)](),_0x503bac),_0x1d47f3=a110_0x42b928[_0x2c7cf8(0xc1)](_0x2ee1ed,NEW_CONFIG_NAME),_0x35d3b0=readConfig(),_0x4391a0=typeof _0x35d3b0['env']===_0x2c7cf8(0xb4)?_0x35d3b0[_0x2c7cf8(0xb8)]:undefined,_0x2f1118={};for(const _0x432138 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x35d3b0[_0x432138]!=null)_0x2f1118[_0x432138]=_0x35d3b0[_0x432138];}const _0x44787f=buildCanonicalProjectConfig(_0x2f1118,{'appCodes':_0x1c4357?[_0x1c4357]:[],'env':_0x2d245f||_0x4391a0||_0x2c7cf8(0xc4),'metadata':{'createdAt':new Date()[_0x2c7cf8(0xb3)](),'version':getCliVersion()}});writeConfigFile(_0x1d47f3,_0x44787f);}async function pullApiConfig(_0x46b924,_0x488fd2,_0x3bbcb6,_0x425cf5){const _0x2de396=a110_0x5b93,_0x2543b0=process[_0x2de396(0xd2)]();try{process[_0x2de396(0xcf)](_0x46b924);const _0x15d16f=_0x3bbcb6||_0x2de396(0xc4);initEnv(_0x15d16f),console[_0x2de396(0xd5)](_0x2de396(0xa5));const {configArray:_0xaaab5e}=await fetchModelList(_0x488fd2,_0x425cf5||''),_0x54ba71=await generateApiFile(_0xaaab5e,'',_0x488fd2,!![],_0x15d16f,DEFAULT_API_DIR);console[_0x2de396(0xd5)](_0x2de396(0xb6)+_0xaaab5e[_0x2de396(0xd1)]+_0x2de396(0x9d)+_0x54ba71[_0x2de396(0xc6)]+_0x2de396(0xa9));}catch(_0x52cf66){console[_0x2de396(0xd5)](_0x2de396(0xa1)+CLI_BIN_NAME+_0x2de396(0xce));}finally{process['chdir'](_0x2543b0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1dc091,_0x6a009d){const _0x20e946=a111_0x3bde,_0x52e7ef=_0x1dc091();while(!![]){try{const _0x3fddef=parseInt(_0x20e946(0x1c5))/0x1*(-parseInt(_0x20e946(0x1cc))/0x2)+parseInt(_0x20e946(0x1cb))/0x3+-parseInt(_0x20e946(0x1c8))/0x4*(parseInt(_0x20e946(0x1c6))/0x5)+-parseInt(_0x20e946(0x1c2))/0x6+-parseInt(_0x20e946(0x1cd))/0x7*(parseInt(_0x20e946(0x1c7))/0x8)+parseInt(_0x20e946(0x1c4))/0x9*(-parseInt(_0x20e946(0x1c9))/0xa)+parseInt(_0x20e946(0x1ce))/0xb;if(_0x3fddef===_0x6a009d)break;else _0x52e7ef['push'](_0x52e7ef['shift']());}catch(_0x4118ac){_0x52e7ef['push'](_0x52e7ef['shift']());}}}(a111_0x1efa,0xb8e24));function a111_0x1efa(){const _0x2f18f0=['1623828wERvgW','templates','18ttZgEZ','426pxpCMo','49110pxmyQE','1296niYgIj','568yZXFPk','815780kbEODU','join','541812zjZsWc','494ceIYnH','21938zlJLOq','33199408BhZKCd','resolve','sub-app-react-demo','../../../../'];a111_0x1efa=function(){return _0x2f18f0;};return a111_0x1efa();}import a111_0x4f5096 from'node:path';import{fileURLToPath}from'node:url';function a111_0x3bde(_0x2105cf,_0xd87fb1){_0x2105cf=_0x2105cf-0x1c1;const _0x1efa77=a111_0x1efa();let _0x3bde04=_0x1efa77[_0x2105cf];return _0x3bde04;}const __dirname=a111_0x4f5096['dirname'](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x573d45=a111_0x3bde;return a111_0x4f5096[_0x573d45(0x1cf)](__dirname,_0x573d45(0x1c1));}export function getSubAppReactDemoTemplateDir(){const _0x48d6db=a111_0x3bde;return a111_0x4f5096[_0x48d6db(0x1ca)](getRabetbaseCliPackageRoot(),_0x48d6db(0x1c3),'projects',_0x48d6db(0x1d0));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3e22ff,_0x2944d3){const _0x2f0c3b=a112_0x4a39,_0x3ab57a=_0x3e22ff();while(!![]){try{const _0x48a6c1=-parseInt(_0x2f0c3b(0x93))/0x1*(parseInt(_0x2f0c3b(0x95))/0x2)+-parseInt(_0x2f0c3b(0x97))/0x3+parseInt(_0x2f0c3b(0x8d))/0x4*(parseInt(_0x2f0c3b(0x90))/0x5)+parseInt(_0x2f0c3b(0x8b))/0x6+-parseInt(_0x2f0c3b(0x8c))/0x7+parseInt(_0x2f0c3b(0x96))/0x8+-parseInt(_0x2f0c3b(0x91))/0x9*(-parseInt(_0x2f0c3b(0x89))/0xa);if(_0x48a6c1===_0x2944d3)break;else _0x3ab57a['push'](_0x3ab57a['shift']());}catch(_0x4dcea6){_0x3ab57a['push'](_0x3ab57a['shift']());}}}(a112_0x3957,0xe5a6c));function a112_0x3957(){const _0xcaa78a=['项目模板复制失败','项目模板复制完成','copy','23390xxLcIG','message','7034778jpNVjL','13071688xmkdOc','332HwONsv','error','resolve','23685MnpvlU','10917xSimQl','success','32855vIHKrl','now','60ylkAVq','9519176FUBpvq','5397156rVfrfq','开始复制项目模板'];a112_0x3957=function(){return _0xcaa78a;};return a112_0x3957();}import a112_0x42dca6 from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';function a112_0x4a39(_0xdad637,_0x42d202){_0xdad637=_0xdad637-0x87;const _0x3957e6=a112_0x3957();let _0x4a39ad=_0x3957e6[_0xdad637];return _0x4a39ad;}const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x3c3c1c){const _0x1f7f1b=a112_0x4a39,_0x44532e=Date[_0x1f7f1b(0x94)](),_0x13f7e1=a112_0x42dca6[_0x1f7f1b(0x8f)](process['cwd'](),_0x3c3c1c);try{logger['info'](_0x1f7f1b(0x88),_0x1f7f1b(0x98),{'projectCode':_0x3c3c1c,'templateDir':templateDir}),await copyDirectory(templateDir,_0x13f7e1);const _0x9db746=Date[_0x1f7f1b(0x94)]()-_0x44532e;logger[_0x1f7f1b(0x92)](_0x1f7f1b(0x88),_0x1f7f1b(0x87),_0x9db746,{'projectCode':_0x3c3c1c});}catch(_0x3dc662){const _0x360e26=Date['now']()-_0x44532e;logger[_0x1f7f1b(0x8e)](_0x1f7f1b(0x88),_0x1f7f1b(0x99),{'projectCode':_0x3c3c1c,'error':_0x3dc662 instanceof Error?_0x3dc662[_0x1f7f1b(0x8a)]:String(_0x3dc662),'duration':_0x360e26});throw _0x3dc662;}return formatElapsed(_0x44532e);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a113_0x2a32(){const _0x1b6308=['开始格式化代码','info','cwd','message','npx','resolve','259292pPZIKB','代码格式化失败','代码格式化完成','format','284pghWgt','330365YLBctk','86015NhkUIS','error','901184zcKylZ','now','4145646JQOnft','prettier','17336056NqhzoF','2085126sOypxo'];a113_0x2a32=function(){return _0x1b6308;};return a113_0x2a32();}(function(_0x55ac98,_0x5f13de){const _0x9567aa=a113_0x172a,_0x1aee1a=_0x55ac98();while(!![]){try{const _0x1e0123=-parseInt(_0x9567aa(0x77))/0x1+parseInt(_0x9567aa(0x7f))/0x2+parseInt(_0x9567aa(0x81))/0x3+parseInt(_0x9567aa(0x7b))/0x4*(parseInt(_0x9567aa(0x7d))/0x5)+parseInt(_0x9567aa(0x84))/0x6+-parseInt(_0x9567aa(0x7c))/0x7+-parseInt(_0x9567aa(0x83))/0x8;if(_0x1e0123===_0x5f13de)break;else _0x1aee1a['push'](_0x1aee1a['shift']());}catch(_0x538c87){_0x1aee1a['push'](_0x1aee1a['shift']());}}}(a113_0x2a32,0xe28aa));import a113_0xc92210 from'node:path';function a113_0x172a(_0x1f7230,_0x3c6da7){_0x1f7230=_0x1f7230-0x77;const _0x2a320a=a113_0x2a32();let _0x172ab3=_0x2a320a[_0x1f7230];return _0x172ab3;}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(_0x2f2f6a){const _0x1d46f7=a113_0x172a,_0x542c6d=Date[_0x1d46f7(0x80)](),_0x150720=a113_0xc92210[_0x1d46f7(0x8a)](process[_0x1d46f7(0x87)](),_0x2f2f6a);try{logger[_0x1d46f7(0x86)](_0x1d46f7(0x7a),_0x1d46f7(0x85),{'projectCode':_0x2f2f6a}),await execa(resolveNpmBin(_0x1d46f7(0x89)),[_0x1d46f7(0x82),'--write','.'],{'cwd':_0x150720});const _0x31b194=Date[_0x1d46f7(0x80)]()-_0x542c6d;logger['success'](_0x1d46f7(0x7a),_0x1d46f7(0x79),_0x31b194,{'projectCode':_0x2f2f6a});}catch(_0x5a76ef){const _0x3e60fc=Date[_0x1d46f7(0x80)]()-_0x542c6d;logger[_0x1d46f7(0x7e)]('format',_0x1d46f7(0x78),{'projectCode':_0x2f2f6a,'error':_0x5a76ef instanceof Error?_0x5a76ef[_0x1d46f7(0x88)]:String(_0x5a76ef),'duration':_0x3e60fc});throw _0x5a76ef;}return formatElapsed(_0x542c6d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x356a3f,_0x3d52cc){const _0x55fc82=a114_0x2dbc,_0x141322=_0x356a3f();while(!![]){try{const _0x37cc5d=-parseInt(_0x55fc82(0xc9))/0x1+parseInt(_0x55fc82(0xc4))/0x2+parseInt(_0x55fc82(0xb8))/0x3*(parseInt(_0x55fc82(0xc1))/0x4)+parseInt(_0x55fc82(0xbe))/0x5*(-parseInt(_0x55fc82(0xc7))/0x6)+-parseInt(_0x55fc82(0xcd))/0x7*(parseInt(_0x55fc82(0xcc))/0x8)+-parseInt(_0x55fc82(0xbf))/0x9+parseInt(_0x55fc82(0xc5))/0xa*(parseInt(_0x55fc82(0xbb))/0xb);if(_0x37cc5d===_0x3d52cc)break;else _0x141322['push'](_0x141322['shift']());}catch(_0x127449){_0x141322['push'](_0x141322['shift']());}}}(a114_0x431c,0x9c18a));import a114_0x5ab4f9 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a114_0x2dbc(_0x28bea3,_0x1ed3ae){_0x28bea3=_0x28bea3-0xb8;const _0x431c5f=a114_0x431c();let _0x2dbc8a=_0x431c5f[_0x28bea3];return _0x2dbc8a;}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';function a114_0x431c(){const _0x11baac=['29327749zUYZAB','now','npm','544780sBjWhe','4342212pnhQmY','--registry','4iVJVdF','https://registry.npmmirror.com','依赖安装失败','1344222onZyhg','10RMdFiJ','install','42PrHYND','success','1275626GDHTcw','error','resolve','8ucQRha','4459028tDdtXb','1376670jspyFi','开始安装依赖','message'];a114_0x431c=function(){return _0x11baac;};return a114_0x431c();}export async function installDependencies(_0x48e99b){const _0x3d40b1=a114_0x2dbc,_0x490fc8=Date['now'](),_0x446f94=a114_0x5ab4f9[_0x3d40b1(0xcb)](process['cwd'](),_0x48e99b);try{logger['info'](_0x3d40b1(0xc6),_0x3d40b1(0xb9),{'projectCode':_0x48e99b,'registry':_0x3d40b1(0xc2)}),await execa(resolveNpmBin(_0x3d40b1(0xbd)),[_0x3d40b1(0xc6),_0x3d40b1(0xc0),_0x3d40b1(0xc2)],{'cwd':_0x446f94});const _0x5e1379=Date[_0x3d40b1(0xbc)]()-_0x490fc8;logger[_0x3d40b1(0xc8)](_0x3d40b1(0xc6),'依赖安装完成',_0x5e1379,{'projectCode':_0x48e99b});}catch(_0x2a5dbb){const _0x21c32=Date[_0x3d40b1(0xbc)]()-_0x490fc8;logger[_0x3d40b1(0xca)]('install',_0x3d40b1(0xc3),{'projectCode':_0x48e99b,'error':_0x2a5dbb instanceof Error?_0x2a5dbb[_0x3d40b1(0xba)]:String(_0x2a5dbb),'duration':_0x21c32});throw _0x2a5dbb;}return formatElapsed(_0x490fc8);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a115_0x517868=a115_0x5ac2;(function(_0x1e04ff,_0x408fbf){const _0x54e53b=a115_0x5ac2,_0x32cde6=_0x1e04ff();while(!![]){try{const _0x494926=parseInt(_0x54e53b(0xac))/0x1*(parseInt(_0x54e53b(0xa0))/0x2)+parseInt(_0x54e53b(0xb7))/0x3+-parseInt(_0x54e53b(0xa9))/0x4+-parseInt(_0x54e53b(0xb3))/0x5*(-parseInt(_0x54e53b(0xb0))/0x6)+parseInt(_0x54e53b(0xaf))/0x7+parseInt(_0x54e53b(0xbb))/0x8*(-parseInt(_0x54e53b(0xb9))/0x9)+-parseInt(_0x54e53b(0xbc))/0xa;if(_0x494926===_0x408fbf)break;else _0x32cde6['push'](_0x32cde6['shift']());}catch(_0x297048){_0x32cde6['push'](_0x32cde6['shift']());}}}(a115_0x4298,0xbd777));import{CliErrors}from'../../errors.js';function a115_0x5ac2(_0x276704,_0x484249){_0x276704=_0x276704-0x9c;const _0x42983e=a115_0x4298();let _0x5ac2d5=_0x42983e[_0x276704];return _0x5ac2d5;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';function a115_0x4298(){const _0x4ade66=['4232560KQkZcQ','validation','Usage:\x20','244939vrElhL','str','boolean','10653377MuMAQD','5229282SvNyxc','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','string','5XHqYMQ','project','create','Target\x20environment','3696498GXPqMD','project-name','36QdTwdP','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','1438072PSIcUk','22970880bNoAYp','yes','bool','name','args','trim','Skip\x20confirmation\x20prompt','10JCWLrO','init','cookie','env','../../commands/project/create/non-interactive.js','Project\x20name','nonInteractive','upgrade','appcode'];a115_0x4298=function(){return _0x4ade66;};return a115_0x4298();}const initFlags=[{'name':'appcode','type':'string','description':'App\x20code\x20to\x20initialize'},{'name':a115_0x517868(0xa3),'type':a115_0x517868(0xb2),'description':a115_0x517868(0xb6)},{'name':a115_0x517868(0xbd),'type':a115_0x517868(0xae),'description':'Auto-confirm\x20prompts','default':![]}],createFlags=[{'name':a115_0x517868(0x9c),'type':'string','description':a115_0x517868(0xa5)},{'name':a115_0x517868(0xa3),'type':a115_0x517868(0xb2),'description':a115_0x517868(0xb6)},{'name':a115_0x517868(0xa8),'type':a115_0x517868(0xb2),'description':'App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)'}],upgradeFlags=[{'name':a115_0x517868(0xbd),'type':a115_0x517868(0xae),'description':a115_0x517868(0x9f),'default':![]}];export const projectDefinitions=[{'service':a115_0x517868(0xb4),'command':a115_0x517868(0xa1),'description':'Initialize\x20.rabetbase.json\x20config\x20in\x20existing\x20project','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initFlags,async 'execute'(_0x2f63e4){const _0x297df4=a115_0x517868;return await initConfig({'appcode':_0x2f63e4[_0x297df4(0xad)](_0x297df4(0xa8))||undefined,'env':_0x2f63e4['str'](_0x297df4(0xa3))||undefined,'autoYes':_0x2f63e4['bool'](_0x297df4(0xbd))}),{'ok':!![]};}},{'service':a115_0x517868(0xb4),'command':a115_0x517868(0xb5),'description':'Create\x20a\x20new\x20project','risk':'write','requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a115_0x517868(0xb8),'description':a115_0x517868(0xb1),'required':![]}],'flags':createFlags,async 'execute'(_0x13f16e){const _0x447ecb=a115_0x517868,{createApp:_0x5993cf}=await import('../../commands/project/create/main.js'),{createProjectNonInteractive:_0x2374a4}=await import(_0x447ecb(0xa4)),_0x14be0a=_0x13f16e[_0x447ecb(0xad)](_0x447ecb(0x9c))[_0x447ecb(0x9e)]()||_0x13f16e[_0x447ecb(0x9d)][0x0]?.[_0x447ecb(0x9e)](),_0x358030=_0x13f16e[_0x447ecb(0xad)](_0x447ecb(0xa3))||undefined,_0x4a2549=_0x13f16e['str'](_0x447ecb(0xa8))||undefined;if(_0x13f16e[_0x447ecb(0xa6)]){if(!_0x14be0a)throw CliErrors[_0x447ecb(0xaa)]('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.',_0x447ecb(0xab)+CLI_BIN_NAME+'\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]');await _0x2374a4(_0x14be0a,_0x358030,_0x4a2549,_0x13f16e[_0x447ecb(0xa2)]);}else await _0x5993cf({'projectCode':_0x14be0a,'appCode':_0x4a2549,'env':_0x358030,'cookie':_0x13f16e[_0x447ecb(0xa2)]});return{'ok':!![]};}},{'service':a115_0x517868(0xb4),'command':a115_0x517868(0xa7),'description':a115_0x517868(0xba),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x396d7c){const _0x4a91c3=a115_0x517868;return await upgradeApp(_0x396d7c[_0x4a91c3(0xa6)],{'yes':_0x396d7c[_0x4a91c3(0xbe)]('yes')}),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0x331b51,_0x3ae964){const _0x2ff899=a116_0xa89a,_0x2b028e=_0x331b51();while(!![]){try{const _0x1d7cd1=-parseInt(_0x2ff899(0x156))/0x1+-parseInt(_0x2ff899(0x13a))/0x2*(-parseInt(_0x2ff899(0x137))/0x3)+-parseInt(_0x2ff899(0x15d))/0x4+parseInt(_0x2ff899(0x15c))/0x5*(-parseInt(_0x2ff899(0x15e))/0x6)+parseInt(_0x2ff899(0x15f))/0x7+parseInt(_0x2ff899(0x13f))/0x8*(parseInt(_0x2ff899(0x155))/0x9)+parseInt(_0x2ff899(0x14d))/0xa;if(_0x1d7cd1===_0x3ae964)break;else _0x2b028e['push'](_0x2b028e['shift']());}catch(_0x2b5a71){_0x2b028e['push'](_0x2b028e['shift']());}}}(a116_0x2ae3,0x9517b));import{readFileSync,existsSync,renameSync}from'node:fs';function a116_0xa89a(_0x5949aa,_0x382d1b){_0x5949aa=_0x5949aa-0x131;const _0x2ae323=a116_0x2ae3();let _0xa89a24=_0x2ae323[_0x5949aa];return _0xa89a24;}import{resolve,dirname,basename}from'node:path';function a116_0x2ae3(){const _0x25ebc6=['\x20→\x20.rabetbase.json','4616680SbDHye','App\x20Code\x20cannot\x20be\x20empty','info','init','log','✓\x20Upgraded\x20','green','keys','14733XNwHwD','907215GStgsN','parse','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory','version','\x20\x20Default:\x20','utf8','2198330oStqix','2031360rBXQll','6vOgpmD','1667155OOvKsd','../..','Invalid\x20App\x20Code','env','apps','bold','package.json','app','\x20project\x20init`\x20to\x20start\x20fresh.','appcode','.bak','cwd','2944344BhzuGv','?\x20(Old\x20file\x20→\x20*.bak)','join','2geCKyS','\x20api\x20generate\x27\x20and\x20\x27','toLocaleString','1.0.0','\x20\x20Apps:\x20','3832MKuvZk','production','yellow','\x20api\x20pull\x27','cyan','trim','setLogPath','初始化项目配置文件成功','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','string','Upgrade\x20it\x20to\x20','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','defaultApp'];a116_0x2ae3=function(){return _0x25ebc6;};return a116_0x2ae3();}import{fileURLToPath}from'node:url';import a116_0x1e60f1 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(_0x148c98){const _0x2a3d12=a116_0xa89a,{appcode:_0x32d69a,env:_0x478848,autoYes:_0x471fbf}=_0x148c98,_0x3c80d2=process[_0x2a3d12(0x136)]();if(getProjectConfigPath())throw new Error(_0x2a3d12(0x14a));let _0x31d7ec;for(const _0xf32261 of LEGACY_CONFIG_NAMES){const _0x53e99d=resolve(_0x3c80d2,_0xf32261);if(existsSync(_0x53e99d)){_0x31d7ec=_0x53e99d;break;}}if(_0x31d7ec){let _0x44ba9a={};try{_0x44ba9a=JSON[_0x2a3d12(0x157)](readFileSync(_0x31d7ec,_0x2a3d12(0x15b)));}catch{}const _0x327492=basename(_0x31d7ec),_0x97515=_0x44ba9a?.['appcode']||_0x44ba9a?.['app'];let _0x297600=_0x471fbf;!_0x471fbf&&(console[_0x2a3d12(0x151)](a116_0x1e60f1[_0x2a3d12(0x141)]('⚠\x20Found\x20legacy\x20configuration\x20file:\x20'+a116_0x1e60f1[_0x2a3d12(0x164)](_0x327492))),_0x97515&&console[_0x2a3d12(0x151)](a116_0x1e60f1[_0x2a3d12(0x143)]('\x20\x20appcode:\x20'+_0x97515)),_0x297600=await confirm({'message':_0x2a3d12(0x149)+a116_0x1e60f1['bold']('.rabetbase.json')+_0x2a3d12(0x138),'default':!![]}));if(!_0x297600){console['log']('Migration\x20cancelled.\x20Run\x20`'+CLI_BIN_NAME+_0x2a3d12(0x133));return;}const _0x1ca05e=resolve(_0x3c80d2,NEW_CONFIG_NAME),_0x3dfb9c=getCliVersionFromPkg(),_0x702218=readRawConfig(),_0x19c303=_0x32d69a||(typeof _0x44ba9a?.[_0x2a3d12(0x134)]===_0x2a3d12(0x148)?_0x44ba9a[_0x2a3d12(0x134)]:undefined)||(typeof _0x44ba9a?.[_0x2a3d12(0x132)]==='string'?_0x44ba9a[_0x2a3d12(0x132)]:undefined)||await askAppcode(),_0x4eb6b4=typeof _0x44ba9a?.[_0x2a3d12(0x162)]===_0x2a3d12(0x148)?_0x44ba9a[_0x2a3d12(0x162)]:typeof _0x702218[_0x2a3d12(0x162)]===_0x2a3d12(0x148)?_0x702218[_0x2a3d12(0x162)]:_0x2a3d12(0x140),_0x4664cd=buildCanonicalProjectConfig({..._0x702218,..._0x44ba9a},{'appCodes':[_0x19c303],'env':_0x4eb6b4,'metadata':{'version':_0x3dfb9c,'migratedAt':new Date()[_0x2a3d12(0x13c)](),'migratedFrom':_0x31d7ec}});writeConfigFile(_0x1ca05e,_0x4664cd);const _0x16f637=_0x31d7ec+'.bak';renameSync(_0x31d7ec,_0x16f637),logger[_0x2a3d12(0x145)](_0x3c80d2),logger[_0x2a3d12(0x14f)](_0x2a3d12(0x150),'从旧配置文件升级成功',{'from':_0x31d7ec,'to':_0x1ca05e,'appcode':_0x19c303,'env':_0x4664cd[_0x2a3d12(0x162)]}),console['log'](a116_0x1e60f1['green'](_0x2a3d12(0x152)+_0x327492+_0x2a3d12(0x14c))),console[_0x2a3d12(0x151)](a116_0x1e60f1[_0x2a3d12(0x143)](_0x2a3d12(0x13e)+Object[_0x2a3d12(0x154)](_0x4664cd[_0x2a3d12(0x163)]||{})['join'](',\x20'))),console[_0x2a3d12(0x151)](a116_0x1e60f1[_0x2a3d12(0x143)]('\x20\x20Default:\x20'+_0x4664cd[_0x2a3d12(0x14b)])),console[_0x2a3d12(0x151)](a116_0x1e60f1['gray'](_0x2a3d12(0x147)+_0x327492+_0x2a3d12(0x135)));return;}const _0x3e2695=_0x32d69a||await askAppcode(),_0x1706f1=resolve(_0x3c80d2,NEW_CONFIG_NAME),_0xd716b=getCliVersionFromPkg(),_0x154185=readRawConfig(),_0x32f2d0=typeof _0x154185[_0x2a3d12(0x162)]===_0x2a3d12(0x148)?_0x154185[_0x2a3d12(0x162)]:undefined,_0x219599=buildCanonicalProjectConfig({},{'appCodes':[_0x3e2695],'env':_0x478848||_0x32f2d0||_0x2a3d12(0x140),'metadata':{'version':_0xd716b,'createdAt':new Date()['toLocaleString']()}});writeConfigFile(_0x1706f1,_0x219599),logger[_0x2a3d12(0x145)](_0x3c80d2),logger[_0x2a3d12(0x14f)](_0x2a3d12(0x150),_0x2a3d12(0x146),{'appcode':_0x3e2695,'env':_0x219599['env'],'version':_0x219599['version'],'configPath':_0x1706f1}),console[_0x2a3d12(0x151)](a116_0x1e60f1[_0x2a3d12(0x153)](_0x2a3d12(0x158))),console[_0x2a3d12(0x151)](a116_0x1e60f1[_0x2a3d12(0x143)]('\x20\x20Apps:\x20'+Object[_0x2a3d12(0x154)](_0x219599[_0x2a3d12(0x163)]||{})[_0x2a3d12(0x139)](',\x20'))),console[_0x2a3d12(0x151)](a116_0x1e60f1['cyan'](_0x2a3d12(0x15a)+_0x219599[_0x2a3d12(0x14b)])),console[_0x2a3d12(0x151)]('\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27'+CLI_BIN_NAME+_0x2a3d12(0x13b)+CLI_BIN_NAME+_0x2a3d12(0x142));}function askAppcode(){return input({'message':'Please\x20enter\x20App\x20Code:','validate':_0xbca2d4=>{const _0x46ff7e=a116_0xa89a;if(!_0xbca2d4[_0x46ff7e(0x144)]())return _0x46ff7e(0x14e);const {valid:_0x59bdbc,message:_0x25bcdc}=validateAppcode(_0xbca2d4[_0x46ff7e(0x144)]());return _0x59bdbc||_0x25bcdc||_0x46ff7e(0x161);}});}function getCliVersionFromPkg(){const _0x20c4a4=a116_0xa89a;try{const _0x2b779b=fileURLToPath(import.meta.url),_0x3f68fb=resolve(dirname(_0x2b779b),_0x20c4a4(0x160)),_0x534f19=JSON[_0x20c4a4(0x157)](readFileSync(resolve(_0x3f68fb,_0x20c4a4(0x131)),_0x20c4a4(0x15b)));return _0x534f19[_0x20c4a4(0x159)]||_0x20c4a4(0x13d);}catch{return'1.0.0';}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a117_0x523c0e=a117_0x4fcd;(function(_0x9996e5,_0x439b4c){const _0x51a7dd=a117_0x4fcd,_0x375927=_0x9996e5();while(!![]){try{const _0x266ee6=parseInt(_0x51a7dd(0x135))/0x1+parseInt(_0x51a7dd(0xda))/0x2*(-parseInt(_0x51a7dd(0xd7))/0x3)+-parseInt(_0x51a7dd(0x10e))/0x4+parseInt(_0x51a7dd(0x11a))/0x5*(parseInt(_0x51a7dd(0xf7))/0x6)+-parseInt(_0x51a7dd(0x11c))/0x7+parseInt(_0x51a7dd(0xe1))/0x8+parseInt(_0x51a7dd(0xf8))/0x9*(parseInt(_0x51a7dd(0xfe))/0xa);if(_0x266ee6===_0x439b4c)break;else _0x375927['push'](_0x375927['shift']());}catch(_0xfcffbe){_0x375927['push'](_0x375927['shift']());}}}(a117_0x221a,0xc4838));import a117_0x259e33 from'chalk';import a117_0x3bcf88 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a117_0x523c0e(0x133)](_0x210ddf=>_0x210ddf!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x4a94bd){const _0x4d17f4=a117_0x523c0e,_0x41910b=[];for(const _0x5c6aff of Object['values'](CORE_IDE_CONFIGS)){if(_0x5c6aff[_0x4d17f4(0xf5)])for(const _0x42ce6f of _0x5c6aff[_0x4d17f4(0xf5)]){_0x41910b['push'](resolve(_0x4a94bd,_0x42ce6f['path']));}}return _0x41910b;}function analyse(_0x2bbd28){const _0x456416=a117_0x523c0e;let _0x2d3766=null;const _0x712470=resolve(_0x2bbd28,NEW_CONFIG_NAME),_0x49379f=existsSync(_0x712470);for(const _0x2989a0 of LEGACY_CONFIG_NAMES){const _0x1963e2=resolve(_0x2bbd28,_0x2989a0);if(existsSync(_0x1963e2)){const _0x30e334=readConfigFile(_0x1963e2),_0x4e72d0=Object[_0x456416(0x13b)](_0x30e334)['filter'](_0x4af244=>typeof _0x30e334[_0x4af244]!==_0x456416(0x13a));_0x2d3766={'oldPath':_0x1963e2,'hasNewConfig':_0x49379f,'fields':_0x4e72d0};break;}}const _0x3e0350=[],_0x5e77f9=resolve(_0x2bbd28,_0x456416(0xd2));if(existsSync(_0x5e77f9))_0x3e0350[_0x456416(0xeb)](_0x5e77f9);const _0x2b5524=resolve(_0x2bbd28,_0x456416(0xdc));if(existsSync(_0x2b5524))_0x3e0350['push'](_0x2b5524);const _0x14f79c=resolve(_0x2bbd28,_0x456416(0x121));if(existsSync(_0x14f79c))_0x3e0350[_0x456416(0xeb)](_0x14f79c);for(const _0x132039 of collectIdeSkillFiles(_0x2bbd28)){if(existsSync(_0x132039))_0x3e0350[_0x456416(0xeb)](_0x132039);}let _0xbdf9b1=null;const _0x2bcde6=resolve(_0x2bbd28,_0x456416(0x106));if(existsSync(_0x2bcde6))try{const _0x569dad=JSON[_0x456416(0xf9)](readFileSync(_0x2bcde6,_0x456416(0x116)));if(_0x569dad?.[_0x456416(0xd3)]&&typeof _0x569dad['mcpServers']===_0x456416(0x132)){const _0x10360d=[];for(const [_0x32fbbf,_0x39fc5f]of Object['entries'](_0x569dad['mcpServers'])){const _0xb77311=_0x39fc5f;_0xb77311?.[_0x456416(0xea)]&&Array[_0x456416(0xf4)](_0xb77311[_0x456416(0xea)])&&_0xb77311[_0x456416(0xea)]['some'](_0x34a262=>typeof _0x34a262===_0x456416(0x12f)&&_0x34a262[_0x456416(0x14a)](_0x456416(0xe5)))&&_0x10360d[_0x456416(0xeb)](_0x32fbbf);}_0x10360d['length']>0x0&&(_0xbdf9b1={'path':_0x2bcde6,'keys':_0x10360d});}}catch{}const _0x4eaee6=_0x3e0350[_0x456416(0xf6)]>0x0||_0x2d3766!==null;let _0x2707fa=null;const _0x7791e=resolve(_0x2bbd28,_0x456416(0xf3));if(existsSync(_0x7791e))try{const _0xf9dc6e=JSON['parse'](readFileSync(_0x7791e,_0x456416(0x116)));for(const _0x5f054c of[_0x456416(0xd9),_0x456416(0xfa)]){const _0x6ed482=_0xf9dc6e?.[_0x5f054c]?.['@lovrabet/sdk'];if(typeof _0x6ed482===_0x456416(0x12f)){_0x6ed482!==_0x456416(0x112)&&(_0x2707fa={'pkgPath':_0x7791e,'currentVersion':_0x6ed482,'field':_0x5f054c});break;}}}catch{}return{'configMigration':_0x2d3766,'oldArtifacts':_0x3e0350,'oldMcpConfig':_0xbdf9b1,'needsSkillSwap':_0x4eaee6,'sdkUpgrade':_0x2707fa};}function printReport(_0x1f3a78){const _0x112721=a117_0x523c0e,{configMigration:_0x5786ea,oldArtifacts:_0xbe1a48,oldMcpConfig:_0xd6df0a,needsSkillSwap:_0x416049}=_0x1f3a78;console[_0x112721(0x10b)](''),console[_0x112721(0x10b)](a117_0x259e33[_0x112721(0xfb)](_0x112721(0x130))),console[_0x112721(0x10b)]('');_0x5786ea?(console[_0x112721(0x10b)](a117_0x259e33[_0x112721(0xdf)](_0x112721(0x11e))+('\x20\x20'+a117_0x259e33[_0x112721(0x144)](_0x5786ea['oldPath']))),console[_0x112721(0x10b)](_0x112721(0xf0)+(_0x5786ea[_0x112721(0x141)]?a117_0x259e33[_0x112721(0x12d)]('already\x20exists\x20(will\x20merge)'):a117_0x259e33['gray']('not\x20found\x20(will\x20create)'))),console[_0x112721(0x10b)](_0x112721(0x13d)+_0x5786ea[_0x112721(0x147)][_0x112721(0x143)](',\x20')),console[_0x112721(0x10b)]('\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak')):console[_0x112721(0x10b)](a117_0x259e33[_0x112721(0xdf)](_0x112721(0x11e))+'\x20\x20'+a117_0x259e33['gray'](_0x112721(0x100)));console[_0x112721(0x10b)]('');if(_0xbe1a48[_0x112721(0xf6)]>0x0){console[_0x112721(0x10b)](a117_0x259e33[_0x112721(0xdf)](_0x112721(0x127)));for(const _0x3c2f4a of _0xbe1a48){console['log']('\x20\x20'+a117_0x259e33[_0x112721(0x115)](_0x112721(0x149))+'\x20\x20'+_0x3c2f4a);}console[_0x112721(0x10b)]('\x20\x20Action:\x20delete');}else console[_0x112721(0x10b)](a117_0x259e33[_0x112721(0xdf)](_0x112721(0x127))+'\x20\x20'+a117_0x259e33[_0x112721(0x10c)](_0x112721(0x123)));console[_0x112721(0x10b)]('');_0xd6df0a?(console[_0x112721(0x10b)](a117_0x259e33['cyan'](_0x112721(0x138))+('\x20\x20'+a117_0x259e33[_0x112721(0x144)](_0xd6df0a[_0x112721(0x14b)])+_0x112721(0xe3)+_0xd6df0a[_0x112721(0x13b)][_0x112721(0x143)](',\x20'))),console['log'](_0x112721(0xee))):console['log'](a117_0x259e33[_0x112721(0xdf)](_0x112721(0x138))+'\x20\x20'+a117_0x259e33[_0x112721(0x10c)](_0x112721(0x109)));console[_0x112721(0x10b)](''),console[_0x112721(0x10b)](a117_0x259e33[_0x112721(0xdf)](_0x112721(0x101))+('\x20\x20'+(_0x416049?a117_0x259e33[_0x112721(0x144)](_0x112721(0xde)):a117_0x259e33[_0x112721(0x12d)](_0x112721(0xe2)))));_0x416049&&console[_0x112721(0x10b)](_0x112721(0x110)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console['log']('');if(_0x1f3a78[_0x112721(0x111)]){const {currentVersion:_0x13f6ac,field:_0x3de602,pkgPath:_0x421bea}=_0x1f3a78['sdkUpgrade'];console[_0x112721(0x10b)](a117_0x259e33['cyan'](_0x112721(0x11b))+('\x20\x20'+a117_0x259e33['yellow'](_0x421bea))),console[_0x112721(0x10b)](_0x112721(0xd8)+_0x3de602+':\x20'+a117_0x259e33[_0x112721(0x144)](_0x13f6ac)+_0x112721(0xfd)+a117_0x259e33[_0x112721(0x12d)]('latest')),console['log']('\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)');}else console[_0x112721(0x10b)](a117_0x259e33[_0x112721(0xdf)](_0x112721(0x11b))+'\x20\x20'+a117_0x259e33['gray'](_0x112721(0x142)));console[_0x112721(0x10b)]('');}function execConfigMigration(_0x2c433f,_0x336a7e){const _0x23528a=a117_0x523c0e,{configMigration:_0x311ce4}=_0x2c433f;if(!_0x311ce4?.['oldPath'])return{'step':0x1,'label':_0x23528a(0x10a),'ok':!![],'detail':_0x23528a(0x113)};const _0x41ed2d=readConfigFile(_0x311ce4['oldPath']),_0x5758bf=resolve(_0x336a7e,NEW_CONFIG_NAME),_0x204f85=_0x311ce4[_0x23528a(0x141)]?readConfigFile(_0x5758bf):{};for(const [_0x39b0cc,_0x56b417]of Object['entries'](_0x41ed2d)){!(_0x39b0cc in _0x204f85)&&(_0x204f85[_0x39b0cc]=_0x56b417);}writeConfigFile(_0x5758bf,_0x204f85);const _0x2b9d89=_0x311ce4[_0x23528a(0x114)]+'.bak';return renameSync(_0x311ce4[_0x23528a(0x114)],_0x2b9d89),{'step':0x1,'label':_0x23528a(0x10a),'ok':!![],'detail':_0x311ce4[_0x23528a(0x114)]+'\x20→\x20'+_0x5758bf+'\x20(backup:\x20'+_0x2b9d89+')'};}function execRemoveOldArtifacts(_0x1a3917){const _0x466f72=a117_0x523c0e,_0x2a187b=[];for(const _0x47d429 of _0x1a3917){try{if(!existsSync(_0x47d429))continue;const _0x5da095=tryStat(_0x47d429);_0x5da095?.[_0x466f72(0xe6)]()?rmSync(_0x47d429,{'recursive':!![],'force':!![]}):unlinkSync(_0x47d429);}catch(_0x22eaf8){_0x2a187b[_0x466f72(0xeb)](_0x47d429+':\x20'+_0x22eaf8[_0x466f72(0x136)]);}}return{'step':0x3,'label':_0x466f72(0x10f),'ok':_0x2a187b[_0x466f72(0xf6)]===0x0,'detail':_0x2a187b['length']>0x0?_0x1a3917[_0x466f72(0xf6)]-_0x2a187b['length']+'/'+_0x1a3917[_0x466f72(0xf6)]+'\x20removed\x20('+_0x2a187b[_0x466f72(0x143)](';\x20')+')':_0x1a3917['length']+_0x466f72(0x118)};}function execCleanMcp(_0x123e5c){const _0x599b5a=a117_0x523c0e;if(!_0x123e5c['oldMcpConfig'])return{'step':0x4,'label':_0x599b5a(0xd6),'ok':!![],'detail':_0x599b5a(0xe0)};try{const _0x359b65=readFileSync(_0x123e5c['oldMcpConfig'][_0x599b5a(0x14b)],_0x599b5a(0x116)),_0xc3c6a6=JSON[_0x599b5a(0xf9)](_0x359b65);if(_0xc3c6a6?.['mcpServers']&&typeof _0xc3c6a6[_0x599b5a(0xd3)]===_0x599b5a(0x132)){const _0x3d7869=[];for(const [_0x5132b5,_0x5dec73]of Object[_0x599b5a(0x11d)](_0xc3c6a6[_0x599b5a(0xd3)])){_0x5dec73?.[_0x599b5a(0xea)]&&Array['isArray'](_0x5dec73[_0x599b5a(0xea)])&&_0x5dec73[_0x599b5a(0xea)][_0x599b5a(0x117)](_0x47d138=>typeof _0x47d138===_0x599b5a(0x12f)&&_0x47d138[_0x599b5a(0x14a)](_0x599b5a(0xe5)))&&_0x3d7869[_0x599b5a(0xeb)](_0x5132b5);}for(const _0x20ed4c of _0x3d7869){delete _0xc3c6a6[_0x599b5a(0xd3)][_0x20ed4c];}return _0x3d7869[_0x599b5a(0xf6)]>0x0&&writeFileSync(_0x123e5c['oldMcpConfig'][_0x599b5a(0x14b)],JSON[_0x599b5a(0x126)](_0xc3c6a6,null,0x2)+'\x0a',_0x599b5a(0x116)),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':'removed\x20'+_0x3d7869['join'](',\x20')+_0x599b5a(0x119)+_0x123e5c[_0x599b5a(0x122)][_0x599b5a(0x14b)]};}return{'step':0x4,'label':_0x599b5a(0xd6),'ok':!![],'detail':_0x599b5a(0x12a)};}catch(_0x472a92){return{'step':0x4,'label':_0x599b5a(0xd6),'ok':![],'detail':_0x472a92[_0x599b5a(0x136)]};}}function execSkillsRemove(_0x2f3314,_0xa5ffb6){const _0x22d807=a117_0x523c0e,_0x23f1c7=runNpxSkillsRemove(_0x2f3314,{'stdio':_0x22d807(0x10d),'yes':_0xa5ffb6});return{'step':0x5,'label':_0x22d807(0xef),'ok':_0x23f1c7['ok'],'detail':_0x23f1c7['ok']?_0x22d807(0x104):_0x23f1c7[_0x22d807(0xed)]??_0x22d807(0x131)+_0x23f1c7[_0x22d807(0xf1)]};}function execSkillsAdd(_0x522810,_0x258a4d){const _0x1d54c4=a117_0x523c0e,_0x27df84=runNpxSkillsAddGlobal(_0x522810,_0x1d54c4(0xdd),{'stdio':_0x1d54c4(0x10d),'yes':_0x258a4d});return{'step':0x6,'label':_0x1d54c4(0x139),'ok':_0x27df84['ok'],'detail':_0x27df84['ok']?'lovrabet/rabetbase\x20installed\x20globally':_0x27df84[_0x1d54c4(0xed)]??_0x1d54c4(0x131)+_0x27df84[_0x1d54c4(0xf1)]};}function a117_0x4fcd(_0x2e1459,_0x4e579e){_0x2e1459=_0x2e1459-0xd2;const _0x221aca=a117_0x221a();let _0x4fcdd=_0x221aca[_0x2e1459];return _0x4fcdd;}function execUpgradeSdk(_0x23d894){const _0x2a1bce=a117_0x523c0e;if(!_0x23d894[_0x2a1bce(0x111)])return{'step':0x7,'label':_0x2a1bce(0x13f),'ok':!![],'detail':_0x2a1bce(0x14d)};const {pkgPath:_0x47ad85,currentVersion:_0x4cb0c1,field:_0x43cca5}=_0x23d894[_0x2a1bce(0x111)];try{const _0xacd0b7=readFileSync(_0x47ad85,'utf8'),_0x4757e3=JSON[_0x2a1bce(0xf9)](_0xacd0b7);return _0x4757e3[_0x43cca5][_0x2a1bce(0x125)]='latest',writeFileSync(_0x47ad85,JSON[_0x2a1bce(0x126)](_0x4757e3,null,0x2)+'\x0a',_0x2a1bce(0x116)),{'step':0x7,'label':_0x2a1bce(0x13f),'ok':!![],'detail':_0x43cca5+_0x2a1bce(0x13c)+_0x4cb0c1+'\x20→\x20latest'};}catch(_0x588841){return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':![],'detail':_0x588841['message']};}}function tryStat(_0x21e38d){try{return statSync(_0x21e38d);}catch{return undefined;}}function printSummary(_0x16be07){const _0x13e867=a117_0x523c0e;console[_0x13e867(0x10b)](''),console[_0x13e867(0x10b)](a117_0x259e33[_0x13e867(0xfb)](_0x13e867(0x129))),console[_0x13e867(0x10b)]('');for(const _0x4795b8 of _0x16be07){const _0x472b71=_0x4795b8['ok']?a117_0x259e33[_0x13e867(0x12d)]('OK'):a117_0x259e33[_0x13e867(0x115)]('FAIL');console['log']('\x20\x20'+_0x472b71+'\x20\x20Step\x20'+_0x4795b8[_0x13e867(0xd4)]+':\x20'+_0x4795b8[_0x13e867(0x102)]);if(_0x4795b8[_0x13e867(0x12b)])console[_0x13e867(0x10b)]('\x20\x20\x20\x20\x20\x20\x20'+a117_0x259e33[_0x13e867(0x10c)](_0x4795b8['detail']));}console[_0x13e867(0x10b)]('');}export async function upgradeApp(_0xcad3bf,_0x19b851){const _0x8dbf10=a117_0x523c0e,_0x28133f=process[_0x8dbf10(0x137)](),_0xd96bff=analyse(_0x28133f),_0xc99060=!_0xd96bff[_0x8dbf10(0x11f)]&&_0xd96bff['oldArtifacts'][_0x8dbf10(0xf6)]===0x0&&!_0xd96bff[_0x8dbf10(0x122)]&&!_0xd96bff['needsSkillSwap']&&!_0xd96bff[_0x8dbf10(0x111)];if(_0xc99060){console[_0x8dbf10(0x10b)](a117_0x259e33[_0x8dbf10(0x12d)]('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0xd96bff);const _0x5ece88=!!(_0x19b851[_0x8dbf10(0xe9)]||_0x19b851['Y']||_0xcad3bf);if(!_0x5ece88)try{const _0x42939e=await askConfirm(_0x8dbf10(0x148));if(!_0x42939e){console['log'](a117_0x259e33[_0x8dbf10(0x10c)]('Upgrade\x20cancelled.'));return;}}catch(_0x24a759){if(_0x24a759?.[_0x8dbf10(0x136)]===_0x8dbf10(0xfc)){console[_0x8dbf10(0x10b)](a117_0x259e33[_0x8dbf10(0x10c)]('Upgrade\x20cancelled.'));return;}throw _0x24a759;}const _0x267ecc=[],_0x4a29d9=a117_0x3bcf88({'text':_0x8dbf10(0xe8),'color':_0x8dbf10(0xdf)})[_0x8dbf10(0xdb)](),_0x23c78a=execConfigMigration(_0xd96bff,_0x28133f);_0x267ecc[_0x8dbf10(0xeb)](_0x23c78a),_0x4a29d9[_0x23c78a['ok']?_0x8dbf10(0xf2):_0x8dbf10(0x134)](_0x8dbf10(0x146)+(_0x23c78a[_0x8dbf10(0x12b)]??(_0x23c78a['ok']?_0x8dbf10(0xec):_0x8dbf10(0x12c))));const _0x1c64f3=resolve(_0x28133f,'.lovrabet'),_0x4a345e=a117_0x3bcf88({'text':_0x8dbf10(0x128),'color':_0x8dbf10(0xdf)})[_0x8dbf10(0xdb)]();if(existsSync(_0x1c64f3))try{rmSync(_0x1c64f3,{'recursive':!![],'force':!![]}),_0x4a345e[_0x8dbf10(0xf2)]('Step\x202/7:\x20.lovrabet/\x20directory\x20removed'),_0x267ecc['push']({'step':0x2,'label':_0x8dbf10(0x105),'ok':!![]});}catch(_0x4d5306){_0x4a345e[_0x8dbf10(0x134)](_0x8dbf10(0x108)+_0x4d5306[_0x8dbf10(0x136)]),_0x267ecc[_0x8dbf10(0xeb)]({'step':0x2,'label':_0x8dbf10(0x105),'ok':![],'detail':_0x4d5306[_0x8dbf10(0x136)]});}else _0x4a345e[_0x8dbf10(0x14c)]('Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped'),_0x267ecc[_0x8dbf10(0xeb)]({'step':0x2,'label':_0x8dbf10(0x105),'ok':!![],'detail':_0x8dbf10(0xe0)});const _0x581eb8=a117_0x3bcf88({'text':_0x8dbf10(0xe4),'color':_0x8dbf10(0xdf)})[_0x8dbf10(0xdb)](),_0x213d43=execRemoveOldArtifacts(_0xd96bff[_0x8dbf10(0x124)]);_0x267ecc[_0x8dbf10(0xeb)](_0x213d43),_0x581eb8[_0x213d43['ok']?_0x8dbf10(0xf2):_0x8dbf10(0x134)](_0x8dbf10(0x12e)+(_0x213d43['detail']??(_0x213d43['ok']?_0x8dbf10(0xec):_0x8dbf10(0x12c))));const _0x547262=a117_0x3bcf88({'text':_0x8dbf10(0x107),'color':_0x8dbf10(0xdf)})['start'](),_0x4351e3=execCleanMcp(_0xd96bff);_0x267ecc['push'](_0x4351e3),_0x547262[_0x4351e3['ok']?'succeed':_0x8dbf10(0x134)](_0x8dbf10(0x103)+(_0x4351e3['detail']??(_0x4351e3['ok']?_0x8dbf10(0xec):_0x8dbf10(0x12c))));const _0x20ad19=a117_0x3bcf88({'text':_0x8dbf10(0xd5),'color':_0x8dbf10(0xdf)})[_0x8dbf10(0xdb)](),_0x191281=execSkillsRemove(_0x28133f,_0x5ece88);_0x267ecc['push'](_0x191281),_0x20ad19[_0x191281['ok']?_0x8dbf10(0xf2):'fail'](_0x8dbf10(0x145)+(_0x191281[_0x8dbf10(0x12b)]??(_0x191281['ok']?_0x8dbf10(0xec):_0x8dbf10(0x12c))));const _0x29e29d=a117_0x3bcf88({'text':'Step\x206/7:\x20Installing\x20new\x20skill...','color':_0x8dbf10(0xdf)})['start'](),_0x2a4be0=execSkillsAdd(_0x28133f,_0x5ece88);_0x267ecc[_0x8dbf10(0xeb)](_0x2a4be0),_0x29e29d[_0x2a4be0['ok']?_0x8dbf10(0xf2):_0x8dbf10(0x134)]('Step\x206/7:\x20Install\x20new\x20skill\x20—\x20'+(_0x2a4be0[_0x8dbf10(0x12b)]??(_0x2a4be0['ok']?_0x8dbf10(0xec):_0x8dbf10(0x12c))));const _0x2c5f3d=a117_0x3bcf88({'text':'Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','color':_0x8dbf10(0xdf)})[_0x8dbf10(0xdb)](),_0x18c462=execUpgradeSdk(_0xd96bff);_0x267ecc['push'](_0x18c462),_0x2c5f3d[_0x18c462['ok']?'succeed':_0x8dbf10(0x134)]('Step\x207/7:\x20@lovrabet/sdk\x20—\x20'+(_0x18c462[_0x8dbf10(0x12b)]??(_0x18c462['ok']?_0x8dbf10(0xec):'failed'))),printSummary(_0x267ecc);const _0x14f739=_0x267ecc[_0x8dbf10(0x117)](_0x1b2862=>!_0x1b2862['ok']);_0x14f739?console['log'](a117_0x259e33[_0x8dbf10(0x144)]('Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.')):console[_0x8dbf10(0x10b)](a117_0x259e33[_0x8dbf10(0x12d)](_0x8dbf10(0x140))),_0x18c462['ok']&&_0xd96bff[_0x8dbf10(0x111)]&&(console[_0x8dbf10(0x10b)](''),console['log'](a117_0x259e33[_0x8dbf10(0xfb)][_0x8dbf10(0xdf)]('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console[_0x8dbf10(0x10b)](a117_0x259e33[_0x8dbf10(0xdf)](_0x8dbf10(0xff))),console[_0x8dbf10(0x10b)](''),console['log'](a117_0x259e33[_0x8dbf10(0x120)](_0x8dbf10(0xe7))),console[_0x8dbf10(0x10b)](a117_0x259e33[_0x8dbf10(0x120)](_0x8dbf10(0x13e))),console[_0x8dbf10(0x10b)](a117_0x259e33[_0x8dbf10(0x120)]('\x20\x20bun\x20install')),console[_0x8dbf10(0x10b)](''));}function a117_0x221a(){const _0x131bc5=['.cursor/rules/lovrabet_rules.mdc','lovrabet/rabetbase','needed','cyan','skipped','10543560jNnjxg','not\x20needed','\x20→\x20keys:\x20','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','@lovrabet/dataset-mcp-server','isDirectory','\x20\x20npm\x20install','Step\x201/7:\x20Migrating\x20config...','yes','args','push','done','error','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','Remove\x20old\x20skill','\x20\x20New\x20config\x20(.rabetbase.json):\x20','status','succeed','package.json','isArray','files','length','268698keteJx','18PkINEQ','parse','devDependencies','bold','CANCEL','\x20→\x20','675460GCiHCy','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','no\x20legacy\x20config\x20found','Skill\x20swap:','label','Step\x204/7:\x20MCP\x20config\x20—\x20','lovrabet/lovrabet-skill\x20removed','Remove\x20.lovrabet/','.cursor/mcp.json','Step\x204/7:\x20Cleaning\x20MCP\x20config...','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','no\x20legacy\x20entry','Config\x20migration','log','gray','inherit','382044IbdMJU','Remove\x20legacy\x20artifacts','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','sdkUpgrade','latest','skipped\x20(no\x20legacy\x20config)','oldPath','red','utf8','some','\x20removed','\x20from\x20','35wGUxXL','@lovrabet/sdk:','3053512KKPIPr','entries','Config\x20file:','configMigration','white','.claude/skills/lovrabet','oldMcpConfig','none\x20found','oldArtifacts','@lovrabet/sdk','stringify','Legacy\x20artifacts:','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','===\x20Upgrade\x20Summary\x20===','no\x20matching\x20entry\x20found','detail','failed','green','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','string','===\x20Upgrade\x20Analysis\x20===','exit\x20','object','filter','fail','114990NnKbXK','message','cwd','MCP\x20config:','Install\x20new\x20skill','undefined','keys','[\x22@lovrabet/sdk\x22]:\x20','\x20\x20Fields\x20to\x20migrate:\x20','\x20\x20#\x20or','Upgrade\x20@lovrabet/sdk','Upgrade\x20completed\x20successfully!','hasNewConfig','not\x20found\x20or\x20already\x20at\x20latest','join','yellow','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','Step\x201/7:\x20Config\x20migration\x20—\x20','fields','Proceed\x20with\x20upgrade?','FOUND','includes','path','info','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','.lovrabet','mcpServers','step','Step\x205/7:\x20Removing\x20old\x20skill...','Clean\x20MCP\x20config','3vfXinE','\x20\x20Current\x20version\x20in\x20','dependencies','1089722OJLKHW','start'];a117_0x221a=function(){return _0x131bc5;};return a117_0x221a();}
|
|
1
|
+
const a117_0x17e390=a117_0x252e;(function(_0x5a4bfd,_0x4974da){const _0x3d20bb=a117_0x252e,_0x382c49=_0x5a4bfd();while(!![]){try{const _0x593191=-parseInt(_0x3d20bb(0xd4))/0x1*(parseInt(_0x3d20bb(0xd3))/0x2)+parseInt(_0x3d20bb(0xc0))/0x3*(parseInt(_0x3d20bb(0xa7))/0x4)+-parseInt(_0x3d20bb(0xf0))/0x5*(-parseInt(_0x3d20bb(0xd1))/0x6)+-parseInt(_0x3d20bb(0xe9))/0x7*(-parseInt(_0x3d20bb(0x8c))/0x8)+parseInt(_0x3d20bb(0xd0))/0x9+-parseInt(_0x3d20bb(0x103))/0xa*(-parseInt(_0x3d20bb(0xbe))/0xb)+-parseInt(_0x3d20bb(0xca))/0xc;if(_0x593191===_0x4974da)break;else _0x382c49['push'](_0x382c49['shift']());}catch(_0x291214){_0x382c49['push'](_0x382c49['shift']());}}}(a117_0xd3b6,0x34ba1));import a117_0x5d314 from'chalk';import a117_0x679d75 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';function a117_0xd3b6(){const _0x215771=['succeed','latest','Proceed\x20with\x20upgrade?','Step\x204/7:\x20MCP\x20config\x20—\x20','55pNdLLy','.claude/skills/lovrabet','13683rOCLDk','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','@lovrabet/dataset-mcp-server','done','Step\x201/7:\x20Migrating\x20config...','Skill\x20swap:','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','\x20\x20npm\x20install','fields','[\x22@lovrabet/sdk\x22]:\x20','6330288xiHrYj','isArray','\x20→\x20keys:\x20','no\x20legacy\x20config\x20found','detail','skipped','1859535Kclrbo','200412JMAfHY','skipped\x20(no\x20legacy\x20config)','2sWLjyu','427406UTYkSn','\x20removed\x20(','removed\x20','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','cwd','status','already\x20exists\x20(will\x20merge)','inherit','cyan','values','\x20\x20New\x20config\x20(.rabetbase.json):\x20','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','undefined','start','lovrabet/lovrabet-skill\x20removed','hasNewConfig','\x20(backup:\x20','Step\x206/7:\x20Installing\x20new\x20skill...','red','error','isDirectory','3024fKqqGc','args','utf8','needsSkillSwap','failed','configMigration','sdkUpgrade','5NCNUBF','gray','oldPath','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','MCP\x20config:','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','yes','mcpServers','filter','\x20→\x20','join','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','Step\x204/7:\x20Cleaning\x20MCP\x20config...','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','Config\x20file:','Clean\x20MCP\x20config','message','no\x20legacy\x20entry','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','555770ZAFsSX','stringify','info','\x20\x20Step\x20','.cursor/mcp.json','exit\x20','devDependencies','fail','.cursor/rules/lovrabet_rules.mdc','\x20→\x20latest','lovrabet/rabetbase','string','bold','7616dNMbFe','lovrabet/rabetbase\x20installed\x20globally','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','\x20\x20Action:\x20delete','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','@lovrabet/sdk:','===\x20Upgrade\x20Summary\x20===','\x20\x20Current\x20version\x20in\x20','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','.lovrabet','log','label','includes','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','oldArtifacts','parse','Legacy\x20artifacts:','path','Step\x205/7:\x20Removing\x20old\x20skill...','not\x20found\x20(will\x20create)','not\x20needed','@lovrabet/sdk','not\x20found\x20or\x20already\x20at\x20latest','CANCEL','Upgrade\x20cancelled.','Install\x20new\x20skill','212MnvLYp','yellow','Remove\x20.lovrabet/','step','white','Config\x20migration','entries','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','oldMcpConfig','push','length','green','\x20\x20\x20\x20\x20\x20\x20','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','\x20removed','Remove\x20old\x20skill','files','FAIL','keys'];a117_0xd3b6=function(){return _0x215771;};return a117_0xd3b6();}import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a117_0x17e390(0xf8)](_0x2ed470=>_0x2ed470!==NEW_CONFIG_NAME);function a117_0x252e(_0x18efed,_0x2a67ef){_0x18efed=_0x18efed-0x80;const _0xd3b62a=a117_0xd3b6();let _0x252e97=_0xd3b62a[_0x18efed];return _0x252e97;}function collectIdeSkillFiles(_0x5ed2df){const _0x203c89=a117_0x17e390,_0x552299=[];for(const _0x293472 of Object[_0x203c89(0xdd)](CORE_IDE_CONFIGS)){if(_0x293472[_0x203c89(0xb7)])for(const _0x49bd3f of _0x293472['files']){_0x552299['push'](resolve(_0x5ed2df,_0x49bd3f[_0x203c89(0x9e)]));}}return _0x552299;}function analyse(_0x2bd2d9){const _0x1e8ab4=a117_0x17e390;let _0x45c658=null;const _0x46369f=resolve(_0x2bd2d9,NEW_CONFIG_NAME),_0x38ffb4=existsSync(_0x46369f);for(const _0x340a7f of LEGACY_CONFIG_NAMES){const _0x7db1fc=resolve(_0x2bd2d9,_0x340a7f);if(existsSync(_0x7db1fc)){const _0x39c577=readConfigFile(_0x7db1fc),_0x46c769=Object['keys'](_0x39c577)[_0x1e8ab4(0xf8)](_0x177bb9=>typeof _0x39c577[_0x177bb9]!==_0x1e8ab4(0xe0));_0x45c658={'oldPath':_0x7db1fc,'hasNewConfig':_0x38ffb4,'fields':_0x46c769};break;}}const _0x37c735=[],_0x51b3ff=resolve(_0x2bd2d9,_0x1e8ab4(0x95));if(existsSync(_0x51b3ff))_0x37c735['push'](_0x51b3ff);const _0xb9734=resolve(_0x2bd2d9,_0x1e8ab4(0x87));if(existsSync(_0xb9734))_0x37c735[_0x1e8ab4(0xb0)](_0xb9734);const _0x429f8c=resolve(_0x2bd2d9,_0x1e8ab4(0xbf));if(existsSync(_0x429f8c))_0x37c735[_0x1e8ab4(0xb0)](_0x429f8c);for(const _0x5620cc of collectIdeSkillFiles(_0x2bd2d9)){if(existsSync(_0x5620cc))_0x37c735['push'](_0x5620cc);}let _0x44c73a=null;const _0x511ac0=resolve(_0x2bd2d9,_0x1e8ab4(0x83));if(existsSync(_0x511ac0))try{const _0x22efa4=JSON[_0x1e8ab4(0x9c)](readFileSync(_0x511ac0,'utf8'));if(_0x22efa4?.[_0x1e8ab4(0xf7)]&&typeof _0x22efa4[_0x1e8ab4(0xf7)]==='object'){const _0x386bfb=[];for(const [_0x1c5d54,_0x1941b1]of Object[_0x1e8ab4(0xad)](_0x22efa4[_0x1e8ab4(0xf7)])){const _0x231a5e=_0x1941b1;_0x231a5e?.[_0x1e8ab4(0xea)]&&Array[_0x1e8ab4(0xcb)](_0x231a5e[_0x1e8ab4(0xea)])&&_0x231a5e[_0x1e8ab4(0xea)]['some'](_0x52056a=>typeof _0x52056a==='string'&&_0x52056a['includes'](_0x1e8ab4(0xc2)))&&_0x386bfb[_0x1e8ab4(0xb0)](_0x1c5d54);}_0x386bfb['length']>0x0&&(_0x44c73a={'path':_0x511ac0,'keys':_0x386bfb});}}catch{}const _0x386269=_0x37c735[_0x1e8ab4(0xb1)]>0x0||_0x45c658!==null;let _0x5e9f3a=null;const _0x5603c7=resolve(_0x2bd2d9,'package.json');if(existsSync(_0x5603c7))try{const _0x192cc6=JSON[_0x1e8ab4(0x9c)](readFileSync(_0x5603c7,_0x1e8ab4(0xeb)));for(const _0x41c2fd of['dependencies',_0x1e8ab4(0x85)]){const _0x232218=_0x192cc6?.[_0x41c2fd]?.[_0x1e8ab4(0xa2)];if(typeof _0x232218===_0x1e8ab4(0x8a)){_0x232218!==_0x1e8ab4(0xbb)&&(_0x5e9f3a={'pkgPath':_0x5603c7,'currentVersion':_0x232218,'field':_0x41c2fd});break;}}}catch{}return{'configMigration':_0x45c658,'oldArtifacts':_0x37c735,'oldMcpConfig':_0x44c73a,'needsSkillSwap':_0x386269,'sdkUpgrade':_0x5e9f3a};}function printReport(_0x51d3af){const _0x4b4965=a117_0x17e390,{configMigration:_0xb0e43e,oldArtifacts:_0x2dae9c,oldMcpConfig:_0x52112e,needsSkillSwap:_0x494b97}=_0x51d3af;console[_0x4b4965(0x96)](''),console[_0x4b4965(0x96)](a117_0x5d314[_0x4b4965(0x8b)]('===\x20Upgrade\x20Analysis\x20===')),console[_0x4b4965(0x96)]('');_0xb0e43e?(console[_0x4b4965(0x96)](a117_0x5d314[_0x4b4965(0xdc)](_0x4b4965(0xfe))+('\x20\x20'+a117_0x5d314[_0x4b4965(0xa8)](_0xb0e43e['oldPath']))),console[_0x4b4965(0x96)](_0x4b4965(0xde)+(_0xb0e43e[_0x4b4965(0xe3)]?a117_0x5d314['green'](_0x4b4965(0xda)):a117_0x5d314['gray'](_0x4b4965(0xa0)))),console[_0x4b4965(0x96)]('\x20\x20Fields\x20to\x20migrate:\x20'+_0xb0e43e[_0x4b4965(0xc8)][_0x4b4965(0xfa)](',\x20')),console[_0x4b4965(0x96)](_0x4b4965(0x8e))):console['log'](a117_0x5d314['cyan']('Config\x20file:')+'\x20\x20'+a117_0x5d314['gray'](_0x4b4965(0xcd)));console[_0x4b4965(0x96)]('');if(_0x2dae9c[_0x4b4965(0xb1)]>0x0){console[_0x4b4965(0x96)](a117_0x5d314[_0x4b4965(0xdc)](_0x4b4965(0x9d)));for(const _0x52266f of _0x2dae9c){console['log']('\x20\x20'+a117_0x5d314['red']('FOUND')+'\x20\x20'+_0x52266f);}console[_0x4b4965(0x96)](_0x4b4965(0x8f));}else console[_0x4b4965(0x96)](a117_0x5d314[_0x4b4965(0xdc)](_0x4b4965(0x9d))+'\x20\x20'+a117_0x5d314[_0x4b4965(0xf1)]('none\x20found'));console['log']('');_0x52112e?(console[_0x4b4965(0x96)](a117_0x5d314[_0x4b4965(0xdc)](_0x4b4965(0xf4))+('\x20\x20'+a117_0x5d314['yellow'](_0x52112e[_0x4b4965(0x9e)])+_0x4b4965(0xcc)+_0x52112e[_0x4b4965(0xb9)][_0x4b4965(0xfa)](',\x20'))),console[_0x4b4965(0x96)](_0x4b4965(0xf5))):console[_0x4b4965(0x96)](a117_0x5d314['cyan'](_0x4b4965(0xf4))+'\x20\x20'+a117_0x5d314[_0x4b4965(0xf1)](_0x4b4965(0x101)));console[_0x4b4965(0x96)](''),console[_0x4b4965(0x96)](a117_0x5d314[_0x4b4965(0xdc)](_0x4b4965(0xc5))+('\x20\x20'+(_0x494b97?a117_0x5d314[_0x4b4965(0xa8)]('needed'):a117_0x5d314[_0x4b4965(0xb2)](_0x4b4965(0xa1)))));_0x494b97&&console[_0x4b4965(0x96)](_0x4b4965(0x90)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console['log']('');if(_0x51d3af[_0x4b4965(0xef)]){const {currentVersion:_0x5388b5,field:_0x30bda4,pkgPath:_0x4721e7}=_0x51d3af[_0x4b4965(0xef)];console['log'](a117_0x5d314['cyan'](_0x4b4965(0x91))+('\x20\x20'+a117_0x5d314[_0x4b4965(0xa8)](_0x4721e7))),console[_0x4b4965(0x96)](_0x4b4965(0x93)+_0x30bda4+':\x20'+a117_0x5d314[_0x4b4965(0xa8)](_0x5388b5)+_0x4b4965(0xf9)+a117_0x5d314[_0x4b4965(0xb2)]('latest')),console[_0x4b4965(0x96)]('\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)');}else console['log'](a117_0x5d314[_0x4b4965(0xdc)]('@lovrabet/sdk:')+'\x20\x20'+a117_0x5d314[_0x4b4965(0xf1)](_0x4b4965(0xa3)));console[_0x4b4965(0x96)]('');}function execConfigMigration(_0x48e9b3,_0x2a1fd3){const _0x245034=a117_0x17e390,{configMigration:_0x4f58b0}=_0x48e9b3;if(!_0x4f58b0?.['oldPath'])return{'step':0x1,'label':_0x245034(0xac),'ok':!![],'detail':_0x245034(0xd2)};const _0x49f9aa=readConfigFile(_0x4f58b0['oldPath']),_0x2c23a6=resolve(_0x2a1fd3,NEW_CONFIG_NAME),_0x9a319c=_0x4f58b0[_0x245034(0xe3)]?readConfigFile(_0x2c23a6):{};for(const [_0x68365a,_0x8fc764]of Object['entries'](_0x49f9aa)){!(_0x68365a in _0x9a319c)&&(_0x9a319c[_0x68365a]=_0x8fc764);}writeConfigFile(_0x2c23a6,_0x9a319c);const _0x15abb8=_0x4f58b0['oldPath']+'.bak';return renameSync(_0x4f58b0[_0x245034(0xf2)],_0x15abb8),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x4f58b0[_0x245034(0xf2)]+_0x245034(0xf9)+_0x2c23a6+_0x245034(0xe4)+_0x15abb8+')'};}function execRemoveOldArtifacts(_0x34bf20){const _0x30b93f=a117_0x17e390,_0x4f384b=[];for(const _0x5c5d69 of _0x34bf20){try{if(!existsSync(_0x5c5d69))continue;const _0x4e7421=tryStat(_0x5c5d69);_0x4e7421?.[_0x30b93f(0xe8)]()?rmSync(_0x5c5d69,{'recursive':!![],'force':!![]}):unlinkSync(_0x5c5d69);}catch(_0x5355c8){_0x4f384b['push'](_0x5c5d69+':\x20'+_0x5355c8[_0x30b93f(0x100)]);}}return{'step':0x3,'label':'Remove\x20legacy\x20artifacts','ok':_0x4f384b[_0x30b93f(0xb1)]===0x0,'detail':_0x4f384b[_0x30b93f(0xb1)]>0x0?_0x34bf20[_0x30b93f(0xb1)]-_0x4f384b[_0x30b93f(0xb1)]+'/'+_0x34bf20[_0x30b93f(0xb1)]+_0x30b93f(0xd5)+_0x4f384b[_0x30b93f(0xfa)](';\x20')+')':_0x34bf20[_0x30b93f(0xb1)]+_0x30b93f(0xb5)};}function execCleanMcp(_0x56fa0c){const _0x1f889e=a117_0x17e390;if(!_0x56fa0c[_0x1f889e(0xaf)])return{'step':0x4,'label':_0x1f889e(0xff),'ok':!![],'detail':_0x1f889e(0xcf)};try{const _0x14113b=readFileSync(_0x56fa0c['oldMcpConfig'][_0x1f889e(0x9e)],_0x1f889e(0xeb)),_0x3506ee=JSON[_0x1f889e(0x9c)](_0x14113b);if(_0x3506ee?.['mcpServers']&&typeof _0x3506ee['mcpServers']==='object'){const _0x30e755=[];for(const [_0x230ba0,_0x7cdc41]of Object[_0x1f889e(0xad)](_0x3506ee[_0x1f889e(0xf7)])){_0x7cdc41?.[_0x1f889e(0xea)]&&Array[_0x1f889e(0xcb)](_0x7cdc41['args'])&&_0x7cdc41[_0x1f889e(0xea)]['some'](_0x5be1be=>typeof _0x5be1be==='string'&&_0x5be1be[_0x1f889e(0x98)](_0x1f889e(0xc2)))&&_0x30e755['push'](_0x230ba0);}for(const _0x3cb689 of _0x30e755){delete _0x3506ee['mcpServers'][_0x3cb689];}return _0x30e755[_0x1f889e(0xb1)]>0x0&&writeFileSync(_0x56fa0c[_0x1f889e(0xaf)][_0x1f889e(0x9e)],JSON[_0x1f889e(0x80)](_0x3506ee,null,0x2)+'\x0a',_0x1f889e(0xeb)),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x1f889e(0xd6)+_0x30e755['join'](',\x20')+'\x20from\x20'+_0x56fa0c[_0x1f889e(0xaf)][_0x1f889e(0x9e)]};}return{'step':0x4,'label':_0x1f889e(0xff),'ok':!![],'detail':'no\x20matching\x20entry\x20found'};}catch(_0x5e3db5){return{'step':0x4,'label':_0x1f889e(0xff),'ok':![],'detail':_0x5e3db5[_0x1f889e(0x100)]};}}function execSkillsRemove(_0x194c2f,_0xe9c426){const _0x157a9a=a117_0x17e390,_0x58567a=runNpxSkillsRemove(_0x194c2f,{'stdio':_0x157a9a(0xdb),'yes':_0xe9c426});return{'step':0x5,'label':_0x157a9a(0xb6),'ok':_0x58567a['ok'],'detail':_0x58567a['ok']?_0x157a9a(0xe2):_0x58567a['error']??'exit\x20'+_0x58567a['status']};}function execSkillsAdd(_0x1ee994,_0x4292a5){const _0x4b03a4=a117_0x17e390,_0x3a78de=runNpxSkillsAddGlobal(_0x1ee994,_0x4b03a4(0x89),{'stdio':_0x4b03a4(0xdb),'yes':_0x4292a5});return{'step':0x6,'label':_0x4b03a4(0xa6),'ok':_0x3a78de['ok'],'detail':_0x3a78de['ok']?_0x4b03a4(0x8d):_0x3a78de[_0x4b03a4(0xe7)]??_0x4b03a4(0x84)+_0x3a78de[_0x4b03a4(0xd9)]};}function execUpgradeSdk(_0x824c7b){const _0x2f8630=a117_0x17e390;if(!_0x824c7b['sdkUpgrade'])return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x2f8630(0xfb)};const {pkgPath:_0x53fc3a,currentVersion:_0x5606b8,field:_0x591467}=_0x824c7b['sdkUpgrade'];try{const _0x39c12e=readFileSync(_0x53fc3a,_0x2f8630(0xeb)),_0x4489d6=JSON[_0x2f8630(0x9c)](_0x39c12e);return _0x4489d6[_0x591467][_0x2f8630(0xa2)]=_0x2f8630(0xbb),writeFileSync(_0x53fc3a,JSON[_0x2f8630(0x80)](_0x4489d6,null,0x2)+'\x0a',_0x2f8630(0xeb)),{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x591467+_0x2f8630(0xc9)+_0x5606b8+_0x2f8630(0x88)};}catch(_0x47464a){return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':![],'detail':_0x47464a['message']};}}function tryStat(_0x5a95a9){try{return statSync(_0x5a95a9);}catch{return undefined;}}function printSummary(_0x33caf6){const _0x367f4a=a117_0x17e390;console[_0x367f4a(0x96)](''),console[_0x367f4a(0x96)](a117_0x5d314['bold'](_0x367f4a(0x92))),console['log']('');for(const _0x2950a0 of _0x33caf6){const _0xec4f53=_0x2950a0['ok']?a117_0x5d314[_0x367f4a(0xb2)]('OK'):a117_0x5d314[_0x367f4a(0xe6)](_0x367f4a(0xb8));console[_0x367f4a(0x96)]('\x20\x20'+_0xec4f53+_0x367f4a(0x82)+_0x2950a0[_0x367f4a(0xaa)]+':\x20'+_0x2950a0[_0x367f4a(0x97)]);if(_0x2950a0['detail'])console[_0x367f4a(0x96)](_0x367f4a(0xb3)+a117_0x5d314[_0x367f4a(0xf1)](_0x2950a0[_0x367f4a(0xce)]));}console[_0x367f4a(0x96)]('');}export async function upgradeApp(_0xcd7bdc,_0x447b6e){const _0x5904db=a117_0x17e390,_0x473085=process[_0x5904db(0xd8)](),_0x59b446=analyse(_0x473085),_0x1d33a4=!_0x59b446[_0x5904db(0xee)]&&_0x59b446[_0x5904db(0x9b)]['length']===0x0&&!_0x59b446['oldMcpConfig']&&!_0x59b446[_0x5904db(0xec)]&&!_0x59b446[_0x5904db(0xef)];if(_0x1d33a4){console['log'](a117_0x5d314[_0x5904db(0xb2)]('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0x59b446);const _0x2d1aed=!!(_0x447b6e[_0x5904db(0xf6)]||_0x447b6e['Y']||_0xcd7bdc);if(!_0x2d1aed)try{const _0x295b1f=await askConfirm(_0x5904db(0xbc));if(!_0x295b1f){console[_0x5904db(0x96)](a117_0x5d314[_0x5904db(0xf1)](_0x5904db(0xa5)));return;}}catch(_0x530b0f){if(_0x530b0f?.[_0x5904db(0x100)]===_0x5904db(0xa4)){console[_0x5904db(0x96)](a117_0x5d314[_0x5904db(0xf1)](_0x5904db(0xa5)));return;}throw _0x530b0f;}const _0x4e41d7=[],_0x42d340=a117_0x679d75({'text':_0x5904db(0xc4),'color':_0x5904db(0xdc)})['start'](),_0xa23082=execConfigMigration(_0x59b446,_0x473085);_0x4e41d7[_0x5904db(0xb0)](_0xa23082),_0x42d340[_0xa23082['ok']?_0x5904db(0xba):_0x5904db(0x86)]('Step\x201/7:\x20Config\x20migration\x20—\x20'+(_0xa23082['detail']??(_0xa23082['ok']?_0x5904db(0xc3):_0x5904db(0xed))));const _0x381419=resolve(_0x473085,_0x5904db(0x95)),_0x22534f=a117_0x679d75({'text':_0x5904db(0x99),'color':_0x5904db(0xdc)})[_0x5904db(0xe1)]();if(existsSync(_0x381419))try{rmSync(_0x381419,{'recursive':!![],'force':!![]}),_0x22534f['succeed'](_0x5904db(0xfd)),_0x4e41d7['push']({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x364d3a){_0x22534f['fail'](_0x5904db(0xf3)+_0x364d3a[_0x5904db(0x100)]),_0x4e41d7[_0x5904db(0xb0)]({'step':0x2,'label':_0x5904db(0xa9),'ok':![],'detail':_0x364d3a[_0x5904db(0x100)]});}else _0x22534f[_0x5904db(0x81)](_0x5904db(0xae)),_0x4e41d7[_0x5904db(0xb0)]({'step':0x2,'label':_0x5904db(0xa9),'ok':!![],'detail':'skipped'});const _0x51884c=a117_0x679d75({'text':_0x5904db(0x9a),'color':'cyan'})[_0x5904db(0xe1)](),_0xa65329=execRemoveOldArtifacts(_0x59b446['oldArtifacts']);_0x4e41d7['push'](_0xa65329),_0x51884c[_0xa65329['ok']?_0x5904db(0xba):_0x5904db(0x86)](_0x5904db(0xd7)+(_0xa65329[_0x5904db(0xce)]??(_0xa65329['ok']?_0x5904db(0xc3):_0x5904db(0xed))));const _0x5df248=a117_0x679d75({'text':_0x5904db(0xfc),'color':_0x5904db(0xdc)})[_0x5904db(0xe1)](),_0xe8ea18=execCleanMcp(_0x59b446);_0x4e41d7[_0x5904db(0xb0)](_0xe8ea18),_0x5df248[_0xe8ea18['ok']?_0x5904db(0xba):'fail'](_0x5904db(0xbd)+(_0xe8ea18['detail']??(_0xe8ea18['ok']?_0x5904db(0xc3):_0x5904db(0xed))));const _0x521ec9=a117_0x679d75({'text':_0x5904db(0x9f),'color':_0x5904db(0xdc)})[_0x5904db(0xe1)](),_0x2fb0ab=execSkillsRemove(_0x473085,_0x2d1aed);_0x4e41d7[_0x5904db(0xb0)](_0x2fb0ab),_0x521ec9[_0x2fb0ab['ok']?'succeed':_0x5904db(0x86)](_0x5904db(0xc1)+(_0x2fb0ab[_0x5904db(0xce)]??(_0x2fb0ab['ok']?_0x5904db(0xc3):'failed')));const _0x1d8cb2=a117_0x679d75({'text':_0x5904db(0xe5),'color':_0x5904db(0xdc)})[_0x5904db(0xe1)](),_0x12ed51=execSkillsAdd(_0x473085,_0x2d1aed);_0x4e41d7[_0x5904db(0xb0)](_0x12ed51),_0x1d8cb2[_0x12ed51['ok']?_0x5904db(0xba):'fail'](_0x5904db(0xdf)+(_0x12ed51['detail']??(_0x12ed51['ok']?'done':_0x5904db(0xed))));const _0x269963=a117_0x679d75({'text':_0x5904db(0xc6),'color':_0x5904db(0xdc)})[_0x5904db(0xe1)](),_0x5585c3=execUpgradeSdk(_0x59b446);_0x4e41d7[_0x5904db(0xb0)](_0x5585c3),_0x269963[_0x5585c3['ok']?_0x5904db(0xba):_0x5904db(0x86)](_0x5904db(0x102)+(_0x5585c3['detail']??(_0x5585c3['ok']?'done':_0x5904db(0xed)))),printSummary(_0x4e41d7);const _0x115b3c=_0x4e41d7['some'](_0x5b04fb=>!_0x5b04fb['ok']);_0x115b3c?console[_0x5904db(0x96)](a117_0x5d314[_0x5904db(0xa8)](_0x5904db(0x94))):console['log'](a117_0x5d314[_0x5904db(0xb2)]('Upgrade\x20completed\x20successfully!')),_0x5585c3['ok']&&_0x59b446[_0x5904db(0xef)]&&(console[_0x5904db(0x96)](''),console[_0x5904db(0x96)](a117_0x5d314[_0x5904db(0x8b)][_0x5904db(0xdc)]('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console['log'](a117_0x5d314[_0x5904db(0xdc)](_0x5904db(0xb4))),console['log'](''),console[_0x5904db(0x96)](a117_0x5d314['white'](_0x5904db(0xc7))),console[_0x5904db(0x96)](a117_0x5d314[_0x5904db(0xab)]('\x20\x20#\x20or')),console[_0x5904db(0x96)](a117_0x5d314['white']('\x20\x20bun\x20install')),console['log'](''));}
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a118_0x21761b=a118_0x4ed7;function a118_0x4200(){const _0x2cafe1=['build','SQL\x20Queries','313kiYLIO','set','show','Diagnostics','get','BFF\x20Scripts','start','isSingleCommand','Smart\x20List\x20Pages','70nqMxGU','Logs','30dGimqv','API','2290771xQAbqg','486uoEQaP','command','read','Quick\x20Start','wildcardDef','service','Authentication','push','auth','Platform\x20Issue','Code\x20Generation','Schema','Workspace','949157otCJif','risk','write','1297575vDZKOK','55644IUSHCf','Self\x20Update','Instant\x20API','create','from','824488BcOkBS','Dataset\x20&\x20Operations','Project','Menu','project','preview','3fSFGTs','Database\x20Connections','Configuration','run','has','571624clGurE','logout'];a118_0x4200=function(){return _0x2cafe1;};return a118_0x4200();}(function(_0x6c91e3,_0x1e7b8a){const _0x3e6e72=a118_0x4ed7,_0x28f8aa=_0x6c91e3();while(!![]){try{const _0x25ca07=parseInt(_0x3e6e72(0xac))/0x1*(-parseInt(_0x3e6e72(0x87))/0x2)+-parseInt(_0x3e6e72(0xa3))/0x3*(parseInt(_0x3e6e72(0x9d))/0x4)+parseInt(_0x3e6e72(0x82))/0x5*(parseInt(_0x3e6e72(0x98))/0x6)+parseInt(_0x3e6e72(0x86))/0x7+-parseInt(_0x3e6e72(0xa8))/0x8+-parseInt(_0x3e6e72(0x97))/0x9+parseInt(_0x3e6e72(0x84))/0xa*(parseInt(_0x3e6e72(0x94))/0xb);if(_0x25ca07===_0x1e7b8a)break;else _0x28f8aa['push'](_0x28f8aa['shift']());}catch(_0x25ffdd){_0x28f8aa['push'](_0x28f8aa['shift']());}}}(a118_0x4200,0x3541d));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{appDefinitions}from'../commands/app/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';import{issueDefinitions}from'../commands/issue/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/index.js';import{skillDefinitions}from'../commands/skill/index.js';import{projectDefinitions}from'../commands/project/index.js';import{initDefinitions}from'../commands/init/index.js';import{runDefinition}from'../commands/run/index.js';export const serviceRegistry=[];const serviceByName=new Map();export const definitions=new Map();export const serviceGroups=new Map();function registerDefinitions(_0x307119){const _0x136bc0=a118_0x4ed7;for(const _0x4bf271 of _0x307119){definitions[_0x136bc0(0xad)](_0x4bf271[_0x136bc0(0x8c)]+':'+_0x4bf271[_0x136bc0(0x88)],_0x4bf271);let _0x28431d=serviceGroups[_0x136bc0(0xb0)](_0x4bf271[_0x136bc0(0x8c)]);!_0x28431d&&(_0x28431d=[],serviceGroups[_0x136bc0(0xad)](_0x4bf271[_0x136bc0(0x8c)],_0x28431d)),_0x28431d['push'](_0x4bf271);}}function registerDeclarativeService(_0x2a68a2,_0x660314,_0x1e6f86){const _0x161f14=a118_0x4ed7;registerDefinitions(_0x660314);_0x1e6f86?.[_0x161f14(0x8b)]&®isterDefinitions([_0x1e6f86[_0x161f14(0x8b)]]);const _0x16ad43=_0xbd0050=>_0xbd0050===_0x161f14(0x89)?'':_0xbd0050===_0x161f14(0x96)?'\x20\x20[write]':'\x20\x20[high-risk-write]',_0x33ad33={'service':_0x660314[0x0][_0x161f14(0x8c)],'label':_0x2a68a2,'commands':_0x660314['map'](_0x3a29be=>({'command':_0x3a29be[_0x161f14(0x88)],'description':_0x3a29be['description'],'tag':_0x16ad43(_0x3a29be[_0x161f14(0x95)])})),'declarative':!![],'defaultCommand':_0x1e6f86?.['defaultCommand']??(_0x1e6f86?.['isSingleCommand']?_0x660314[0x0][_0x161f14(0x88)]:undefined),'wildcardDef':_0x1e6f86?.[_0x161f14(0x8b)],'isSingleCommand':_0x1e6f86?.[_0x161f14(0x80)]};serviceRegistry[_0x161f14(0x8e)](_0x33ad33),serviceByName['set'](_0x33ad33[_0x161f14(0x8c)],_0x33ad33);}registerDeclarativeService(a118_0x21761b(0x8a),initDefinitions,{'defaultCommand':'run','isSingleCommand':!![]}),registerDeclarativeService(a118_0x21761b(0x9f),projectDefinitions),registerDeclarativeService(a118_0x21761b(0x93),workspaceDefinitions),registerDeclarativeService('App\x20Management',appDefinitions),registerDeclarativeService('Run\x20Scripts',[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry['length']-0x1];last['commands']=[{'command':'<script>','description':'Run\x20any\x20package.json\x20script','tag':''}];}registerDeclarativeService(a118_0x21761b(0x8d),authDefinitions,{'defaultCommand':'login'}),registerDeclarativeService(a118_0x21761b(0x99),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a118_0x21761b(0xaf),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a118_0x21761b(0x92),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a118_0x21761b(0xa5),configDefinitions),registerDeclarativeService(a118_0x21761b(0x90),issueDefinitions),registerDeclarativeService(a118_0x21761b(0x85),apiDefinitions),registerDeclarativeService(a118_0x21761b(0xa0),menuDefinitions),registerDeclarativeService(a118_0x21761b(0xa4),dbDefinitions),registerDeclarativeService(a118_0x21761b(0x9e),datasetDefinitions),registerDeclarativeService(a118_0x21761b(0x81),pageDefinitions),registerDeclarativeService(a118_0x21761b(0x9a),dataDefinitions),registerDeclarativeService(a118_0x21761b(0xb1),bffDefinitions),registerDeclarativeService(a118_0x21761b(0xab),sqlDefinitions),registerDeclarativeService(a118_0x21761b(0x91),codegenDefinitions),registerDeclarativeService('Skills',skillDefinitions),registerDeclarativeService(a118_0x21761b(0x83),logsDefinitions,{'defaultCommand':a118_0x21761b(0xae)});export const deprecatedAliases={'create':{'service':a118_0x21761b(0xa1),'command':a118_0x21761b(0x9b)},'start':{'service':a118_0x21761b(0xa6),'command':a118_0x21761b(0xb2)},'build':{'service':'run','command':a118_0x21761b(0xaa)},'preview':{'service':a118_0x21761b(0xa6),'command':a118_0x21761b(0xa2)},'logout':{'service':a118_0x21761b(0x8f),'command':a118_0x21761b(0xa9)},'skills':{'service':'skill','command':'install'}};function a118_0x4ed7(_0x1d3f33,_0x3ac11d){_0x1d3f33=_0x1d3f33-0x80;const _0x4200c2=a118_0x4200();let _0x4ed74b=_0x4200c2[_0x1d3f33];return _0x4ed74b;}export const deprecatedSubcommands={'bff':{'new':a118_0x21761b(0x9b)},'sql':{'new':a118_0x21761b(0x9b)}};export function resolveDeprecatedSubcommand(_0x51981e,_0x333fd2){return deprecatedSubcommands[_0x51981e]?.[_0x333fd2];}export function findDefinition(_0x19f498,_0x2432eb){const _0x21c524=a118_0x21761b;return definitions[_0x21c524(0xb0)](_0x19f498+':'+_0x2432eb);}export function isKnownService(_0x385fc9){const _0x1e9bd8=a118_0x21761b;return serviceByName[_0x1e9bd8(0xa7)](_0x385fc9);}export function isDeclarativeService(_0x432de7){const _0x18d75c=a118_0x21761b;return serviceGroups[_0x18d75c(0xa7)](_0x432de7)||serviceByName[_0x18d75c(0xb0)](_0x432de7)?.['wildcardDef']!==undefined;}export function getServiceEntry(_0x19ab71){return serviceByName['get'](_0x19ab71);}export function getLegacyHandler(_0x467df1,_0x598ea){return undefined;}export function getAllDefinitions(){const _0x3a3bbf=a118_0x21761b;return Array[_0x3a3bbf(0x9c)](definitions['values']());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a119_0x432602=a119_0x2cd9;(function(_0x3dec05,_0x264951){const _0x1cb8a8=a119_0x2cd9,_0x42eeae=_0x3dec05();while(!![]){try{const _0x403981=parseInt(_0x1cb8a8(0xdc))/0x1+-parseInt(_0x1cb8a8(0x102))/0x2*(-parseInt(_0x1cb8a8(0xdb))/0x3)+-parseInt(_0x1cb8a8(0xef))/0x4+parseInt(_0x1cb8a8(0x111))/0x5+-parseInt(_0x1cb8a8(0xf8))/0x6*(-parseInt(_0x1cb8a8(0x117))/0x7)+-parseInt(_0x1cb8a8(0xe5))/0x8*(-parseInt(_0x1cb8a8(0x108))/0x9)+parseInt(_0x1cb8a8(0xd6))/0xa*(-parseInt(_0x1cb8a8(0xda))/0xb);if(_0x403981===_0x264951)break;else _0x42eeae['push'](_0x42eeae['shift']());}catch(_0x59d90d){_0x42eeae['push'](_0x42eeae['shift']());}}}(a119_0x1ad9,0x9a7fe));import{readFileSync,existsSync}from'node:fs';import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';import{spawn}from'node:child_process';import{CliErrors}from'../../errors.js';import{checkSdkVersion,printSdkUpgradeWarning}from'../../utils/check-sdk-version.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../utils/cli-version-check.js';const VERSION_CHECK_SCRIPTS=new Set([a119_0x432602(0xee),'dev']);function readPackageScripts(_0x191c46){const _0x2b5421=a119_0x432602,_0x2f95e7=resolve(_0x191c46,'package.json');if(!existsSync(_0x2f95e7))return null;try{const _0x13643c=JSON[_0x2b5421(0x113)](readFileSync(_0x2f95e7,_0x2b5421(0xe4)));return _0x13643c[_0x2b5421(0xf7)]??{};}catch{return null;}}function a119_0x1ad9(){const _0x162e1b=['Script\x20\x22','pnpm-lock.yaml','bun.lockb','watch','read','vite\x20preview\x20exited\x20with\x20code\x20','\x20run\x20start','scripts','6fEuBAP','push','needsUpgrade','\x0a\x20\x20Available\x20scripts:\x0a','all','No\x20package.json\x20found\x20in\x20current\x20directory.','validation','length','Available:\x20','close','3234VLwFDF','log','\x22\x20not\x20found\x20in\x20package.json.','slice','bun.lock','belowMinimum','194652LNAXrZ','bun','run','Run\x20a\x20package.json\x20script','cwd','preview','\x20run\x20preview','error','build','4639370BRMGHq','yarn.lock','parse','script','\x20run\x20<script>\x0a','vite','1616993hvdDfx','10JntuWp','inherit','\x20\x20EXAMPLES','\x20\x20\x20\x20','29329267SRehgR','753oEOIxT','1187117IDZIer','(none)','map','.bin','padEnd','\x20run\x20build','boolean','entries','utf-8','360oBalpq','\x20run\x20','\x20exited\x20with\x20code\x20','npm','node_modules','keys','args','max','bool','start','1703960pWnznh'];a119_0x1ad9=function(){return _0x162e1b;};return a119_0x1ad9();}function a119_0x2cd9(_0x36d2f9,_0xe4efa1){_0x36d2f9=_0x36d2f9-0xd6;const _0x1ad91c=a119_0x1ad9();let _0x2cd9dd=_0x1ad91c[_0x36d2f9];return _0x2cd9dd;}function detectPackageManager(_0x27a18b){const _0x486ec1=a119_0x432602;if(existsSync(resolve(_0x27a18b,_0x486ec1(0xf2)))||existsSync(resolve(_0x27a18b,_0x486ec1(0x106))))return _0x486ec1(0x109);if(existsSync(resolve(_0x27a18b,_0x486ec1(0xf1))))return'pnpm';if(existsSync(resolve(_0x27a18b,_0x486ec1(0x112))))return'yarn';return _0x486ec1(0xe8);}async function versionCheck(_0x50f300){const _0x5d2e35=a119_0x432602,_0x82e139=await checkCliVersion();(_0x82e139[_0x5d2e35(0xfa)]||_0x82e139[_0x5d2e35(0x107)])&&(printCliUpgradeWarning(_0x82e139),assertCliVersionSupported(_0x82e139));const _0x146fe5=await checkSdkVersion(_0x50f300);if(_0x146fe5['needsUpgrade'])printSdkUpgradeWarning(_0x146fe5);}function spawnScript(_0x2e2c29,_0x4b6d48,_0x4d29a4,_0x1c7611){return new Promise((_0x17a8ad,_0x9dd0ab)=>{const _0x39a30d=a119_0x2cd9,_0x4b9063=[_0x39a30d(0x10a),_0x4b6d48,..._0x4d29a4],_0xcaa94c=spawn(_0x2e2c29,_0x4b9063,{'cwd':_0x1c7611,'stdio':_0x39a30d(0xd7),'shell':!![],'env':{...process.env,'PATH':''+join(_0x1c7611,_0x39a30d(0xe9),'.bin')+delimiter+process.env.PATH}});_0xcaa94c['on'](_0x39a30d(0x101),_0x154703=>{const _0x21aba9=_0x39a30d;if(_0x154703===0x0||_0x154703===null)_0x17a8ad();else _0x9dd0ab(new Error(_0x2e2c29+'\x20run\x20'+_0x4b6d48+_0x21aba9(0xe7)+_0x154703));}),_0xcaa94c['on'](_0x39a30d(0x10f),_0x9dd0ab);});}function spawnViteBuildWatch(_0x3fa0b8){return new Promise((_0x5b27d3,_0x117966)=>{const _0x1a2ce5=a119_0x2cd9,_0x18ef6a=spawn(_0x1a2ce5(0x116),[_0x1a2ce5(0x110),'--watch'],{'cwd':_0x3fa0b8,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x3fa0b8,_0x1a2ce5(0xe9),_0x1a2ce5(0xdf))+delimiter+process.env.PATH}});_0x18ef6a['on']('close',_0x2687b2=>{if(_0x2687b2===0x0||_0x2687b2===null)_0x5b27d3();else _0x117966(new Error('vite\x20build\x20--watch\x20exited\x20with\x20code\x20'+_0x2687b2));}),_0x18ef6a['on'](_0x1a2ce5(0x10f),_0x117966);});}function spawnVitePreview(_0x1cb149){return new Promise((_0x34b61d,_0x531ed2)=>{const _0x3d9007=a119_0x2cd9,_0x54a656=spawn(_0x3d9007(0x116),['preview'],{'cwd':_0x1cb149,'stdio':_0x3d9007(0xd7),'shell':!![],'env':{...process.env,'PATH':''+join(_0x1cb149,'node_modules',_0x3d9007(0xdf))+delimiter+process.env.PATH}});_0x54a656['on'](_0x3d9007(0x101),_0xd1e2cd=>{const _0x52c0ea=_0x3d9007;if(_0xd1e2cd===0x0||_0xd1e2cd===null)_0x34b61d();else _0x531ed2(new Error(_0x52c0ea(0xf5)+_0xd1e2cd));}),_0x54a656['on'](_0x3d9007(0x10f),_0x531ed2);});}const runFlags=[{'name':a119_0x432602(0xf3),'type':a119_0x432602(0xe2),'description':'Enable\x20watch\x20mode\x20for\x20preview','default':![]}];export const runDefinition={'service':a119_0x432602(0x10a),'command':a119_0x432602(0x10a),'description':a119_0x432602(0x10b),'risk':a119_0x432602(0xf4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a119_0x432602(0x114),'description':'Script\x20name\x20defined\x20in\x20package.json','required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x3e2360=a119_0x432602,_0x6f1e8e=readPackageScripts(process[_0x3e2360(0x10c)]()),_0x353ee7=[];if(_0x6f1e8e&&Object[_0x3e2360(0xea)](_0x6f1e8e)[_0x3e2360(0xff)]>0x0){const _0x85b8a9=Object[_0x3e2360(0xea)](_0x6f1e8e),_0x2364ad=Math[_0x3e2360(0xec)](..._0x85b8a9[_0x3e2360(0xde)](_0x130115=>_0x130115['length']));_0x353ee7[_0x3e2360(0xf9)]('\x20\x20AVAILABLE\x20SCRIPTS\x20\x20(current\x20project)');for(const [_0xbe7ebb,_0x13f27b]of Object['entries'](_0x6f1e8e)){_0x353ee7['push'](_0x3e2360(0xd9)+CLI_BIN_NAME+_0x3e2360(0xe6)+_0xbe7ebb[_0x3e2360(0xe0)](_0x2364ad+0x2)+'#\x20'+_0x13f27b);}}else _0x353ee7['push'](_0x3e2360(0xd8)),_0x353ee7[_0x3e2360(0xf9)](_0x3e2360(0xd9)+CLI_BIN_NAME+_0x3e2360(0xf6)),_0x353ee7['push'](_0x3e2360(0xd9)+CLI_BIN_NAME+_0x3e2360(0xe1)),_0x353ee7[_0x3e2360(0xf9)](_0x3e2360(0xd9)+CLI_BIN_NAME+_0x3e2360(0x10e)),_0x353ee7[_0x3e2360(0xf9)](_0x3e2360(0xd9)+CLI_BIN_NAME+'\x20run\x20preview\x20--watch\x20\x20\x20#\x20parallel\x20build\x20--watch\x20+\x20preview');return _0x353ee7['join']('\x0a');},async 'execute'(_0x2e02a7){const _0x303741=a119_0x432602,_0x3a9c2c=process['cwd'](),_0x57ec91=_0x2e02a7[_0x303741(0xeb)][0x0],_0x32c8b3=_0x2e02a7[_0x303741(0xeb)][_0x303741(0x105)](0x1),_0x14d8b1=readPackageScripts(_0x3a9c2c);if(!_0x14d8b1)throw CliErrors[_0x303741(0xfe)](_0x303741(0xfd));if(!_0x57ec91){const _0x13c35b=Object[_0x303741(0xea)](_0x14d8b1);if(_0x13c35b[_0x303741(0xff)]===0x0)console[_0x303741(0x103)]('No\x20scripts\x20defined\x20in\x20package.json.');else{console[_0x303741(0x103)](_0x303741(0xfb));const _0x46f3cc=Math[_0x303741(0xec)](..._0x13c35b[_0x303741(0xde)](_0x2b829c=>_0x2b829c[_0x303741(0xff)]));for(const [_0x495f0a,_0x3c54e6]of Object[_0x303741(0xe3)](_0x14d8b1)){console[_0x303741(0x103)]('\x20\x20\x20\x20'+_0x495f0a['padEnd'](_0x46f3cc+0x2)+_0x3c54e6);}console[_0x303741(0x103)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+_0x303741(0x115));}return{'ok':!![]};}if(!_0x14d8b1[_0x57ec91])throw CliErrors['validation'](_0x303741(0xf0)+_0x57ec91+_0x303741(0x104),_0x303741(0x100)+(Object[_0x303741(0xea)](_0x14d8b1)['join'](',\x20')||_0x303741(0xdd)));const _0x58c47f=detectPackageManager(_0x3a9c2c);VERSION_CHECK_SCRIPTS['has'](_0x57ec91)&&await versionCheck(_0x3a9c2c);if(_0x57ec91===_0x303741(0x10d)&&_0x2e02a7[_0x303741(0xed)](_0x303741(0xf3)))return await Promise[_0x303741(0xfc)]([spawnViteBuildWatch(_0x3a9c2c),spawnVitePreview(_0x3a9c2c)]),{'ok':!![]};return await spawnScript(_0x58c47f,_0x57ec91,_0x32c8b3,_0x3a9c2c),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a120_0x4ca24a=a120_0x3aa2;function a120_0x3aa2(_0x17c67a,_0x90f9fc){_0x17c67a=_0x17c67a-0xbc;const _0x2c4c6c=a120_0x2c4c();let _0x3aa2a3=_0x2c4c6c[_0x17c67a];return _0x3aa2a3;}(function(_0x5cfc2e,_0x28cecf){const _0x4cac0d=a120_0x3aa2,_0x11b397=_0x5cfc2e();while(!![]){try{const _0x30151a=-parseInt(_0x4cac0d(0xc9))/0x1+-parseInt(_0x4cac0d(0xbf))/0x2*(-parseInt(_0x4cac0d(0xc4))/0x3)+parseInt(_0x4cac0d(0xc0))/0x4*(-parseInt(_0x4cac0d(0xca))/0x5)+-parseInt(_0x4cac0d(0xbc))/0x6*(-parseInt(_0x4cac0d(0xbd))/0x7)+parseInt(_0x4cac0d(0xc8))/0x8*(-parseInt(_0x4cac0d(0xc1))/0x9)+-parseInt(_0x4cac0d(0xbe))/0xa+-parseInt(_0x4cac0d(0xc6))/0xb*(-parseInt(_0x4cac0d(0xcb))/0xc);if(_0x30151a===_0x28cecf)break;else _0x11b397['push'](_0x11b397['shift']());}catch(_0x18b0d6){_0x11b397['push'](_0x11b397['shift']());}}}(a120_0x2c4c,0xcbcde));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x36e728){const _0x3b6b26=await buildSchemaPayload();return{'ok':!![],'data':_0x3b6b26};}export const schemaDefinition={'service':'schema','command':a120_0x4ca24a(0xc5),'description':a120_0x4ca24a(0xc7),'risk':a120_0x4ca24a(0xc3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a120_0x4ca24a(0xc2),'flags':[],'execute':execute};function a120_0x2c4c(){const _0x3b6094=['102XPxPKF','46753DHXACv','2856830rvcswk','3298854psnOrO','27268lhASoC','8339157DYzBNI','json','read','3Rvtzgv','export','1412389XPdvfg','Export\x20machine-readable\x20command\x20schema\x20(JSON)','8Oapfaq','1320394LDgxMy','330Hdtoax','192fWUKDr'];a120_0x2c4c=function(){return _0x3b6094;};return a120_0x2c4c();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a121_0x16b6bd=a121_0x2611;(function(_0x2ceb2f,_0x5f4af8){const _0xcaad00=a121_0x2611,_0x3b2b5f=_0x2ceb2f();while(!![]){try{const _0x1ed058=parseInt(_0xcaad00(0x1a5))/0x1+-parseInt(_0xcaad00(0x19e))/0x2+parseInt(_0xcaad00(0x1a1))/0x3*(parseInt(_0xcaad00(0x1ad))/0x4)+parseInt(_0xcaad00(0x1a6))/0x5*(-parseInt(_0xcaad00(0x1a7))/0x6)+-parseInt(_0xcaad00(0x19c))/0x7*(parseInt(_0xcaad00(0x19d))/0x8)+parseInt(_0xcaad00(0x1b1))/0x9+-parseInt(_0xcaad00(0x1a8))/0xa*(parseInt(_0xcaad00(0x1b6))/0xb);if(_0x1ed058===_0x5f4af8)break;else _0x3b2b5f['push'](_0x3b2b5f['shift']());}catch(_0x1b626a){_0x3b2b5f['push'](_0x3b2b5f['shift']());}}}(a121_0x3f3f,0x5deb6));import{CliErrors}from'../../errors.js';function a121_0x3f3f(){const _0x58706a=['633346dGfMhl','1190BOWXse','1602arpSRo','90iwIkYu','Check\x20network\x20connectivity\x20and\x20try\x20again.','../../skills/npx-skills-add.js','Installing\x20official\x20skill\x20via\x20npx\x20(','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20skill\x20is\x20already\x20present.','36836wIMdKV','skill-install','nonInteractive','write','6904593nsvPQO','pipe','skipped','install','error','926167qEoDTy','setLogPath','cwd','920087YTQXAD','8mhdzag','439244VUMnNe','info','log','51dgTwQt','skill','\x20skill\x20installed','unknown'];a121_0x3f3f=function(){return _0x58706a;};return a121_0x3f3f();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE}from'../../skills/npx-skills-add.js';function a121_0x2611(_0x584fe9,_0x5db719){_0x584fe9=_0x584fe9-0x19b;const _0x3f3f9f=a121_0x3f3f();let _0x2611ff=_0x3f3f9f[_0x584fe9];return _0x2611ff;}export const skillDefinitions=[{'service':a121_0x16b6bd(0x1a2),'command':a121_0x16b6bd(0x1b4),'description':'Install\x20developer\x20skill\x20package','risk':a121_0x16b6bd(0x1b0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x1b0fdd){const _0x1079af=a121_0x16b6bd;logger[_0x1079af(0x1b7)](process['cwd']()),logger[_0x1079af(0x19f)](_0x1079af(0x1ae),'执行安装技能包命令(委托给\x20npx\x20skills\x20add\x20-g\x20-y)');const {runNpxSkillsAddGlobal:_0x47d007}=await import(_0x1079af(0x1aa)),_0x2ad4d9=_0x1b0fdd[_0x1079af(0x1af)]?_0x1079af(0x1b2):'inherit';console[_0x1079af(0x1a0)](_0x1079af(0x1ab)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+')...');const _0x28c5ea=_0x47d007(process[_0x1079af(0x19b)](),'lovrabet/rabetbase',{'stdio':_0x2ad4d9});if(_0x28c5ea[_0x1079af(0x1b3)])console[_0x1079af(0x1a0)](_0x1079af(0x1ac));else{if(_0x28c5ea['ok'])console[_0x1079af(0x1a0)](CLI_BIN_NAME+_0x1079af(0x1a3));else throw CliErrors['apiError']('npx\x20skills\x20add\x20failed:\x20'+(_0x28c5ea[_0x1079af(0x1b5)]||_0x1079af(0x1a4)),_0x1079af(0x1a9));}return{'ok':!![]};}}];
|