@lovrabet/rabetbase-cli 2.1.12-beta.4 → 2.1.13
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/field-update.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/link-create.js +1 -1
- package/lib/commands/dataset/link-delete.js +1 -1
- package/lib/commands/dataset/link-shared.js +1 -1
- package/lib/commands/dataset/link-update.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/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/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/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/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.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/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5e3279,_0x5ca14b){const _0x1a3c39=a106_0x672e,_0x5bc110=_0x5e3279();while(!![]){try{const _0x179410=-parseInt(_0x1a3c39(0x12c))/0x1*(parseInt(_0x1a3c39(0x15b))/0x2)+parseInt(_0x1a3c39(0x130))/0x3*(-parseInt(_0x1a3c39(0x14e))/0x4)+parseInt(_0x1a3c39(0x14d))/0x5*(-parseInt(_0x1a3c39(0x145))/0x6)+-parseInt(_0x1a3c39(0x13e))/0x7+parseInt(_0x1a3c39(0x157))/0x8*(-parseInt(_0x1a3c39(0x159))/0x9)+parseInt(_0x1a3c39(0x144))/0xa*(parseInt(_0x1a3c39(0x125))/0xb)+parseInt(_0x1a3c39(0x147))/0xc;if(_0x179410===_0x5ca14b)break;else _0x5bc110['push'](_0x5bc110['shift']());}catch(_0xb5b162){_0x5bc110['push'](_0x5bc110['shift']());}}}(a106_0x1cf1,0x4aa42));function a106_0x1cf1(){const _0xf6a7f2=['Project\x20name\x20cannot\x20be\x20empty.','\x20\x20Installing\x20dependencies...','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','resolve','\x20\x20√\x20Pulled\x20','1807864CPZJiq','length','9oymNJM','bun\x20--version','288qIeREH','\x20\x20rabetbase\x20run\x20start\x0a','Project\x20name\x20contains\x20invalid\x20characters.','utf-8','toLocaleString','bun','\x20\x20√\x20Code\x20formatted','validation','57233ptLKVQ','modelCount','...','description','join','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','\x20\x20√\x20Configuration\x20file\x20created','2627dgsPNj','Use\x20a\x20different\x20project\x20name.','W_OK','*\x20Creating\x20project\x20','171tLcETq','\x20dataset(s),\x20generated\x20','package.json','\x20api\x20pull`\x20manually\x20later.','parse','env','constants','\x20created\x20successfully!','npm','cwd','\x20\x20√\x20package.json\x20updated','\x0a\x20\x20cd\x20','production','chdir','743932NUXfQC','\x22\x20already\x20exists.','\x0a√\x20Project\x20','belowMinimum','string','dirname','370jTmYPK','6sjrMjF','\x20\x20√\x20Project\x20template\x20created','17144148ZrlypW','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','\x20model(s)','log','test','1101385QeQehF','26992EAYVlr','Check\x20directory\x20permissions.','bun\x20run\x20format'];a106_0x1cf1=function(){return _0xf6a7f2;};return a106_0x1cf1();}import a106_0x36cbe1 from'path';import a106_0x3485d6 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 a106_0x672e(_0x1c17f8,_0x37b51f){_0x1c17f8=_0x1c17f8-0x121;const _0x1cf1ff=a106_0x1cf1();let _0x672e33=_0x1cf1ff[_0x1c17f8];return _0x672e33;}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(_0x2ca3a1,_0x3d8e63,_0x265830,_0x30f529){const _0x50ac09=a106_0x672e,_0x4a4a01=await checkCliVersion();(_0x4a4a01['needsUpgrade']||_0x4a4a01[_0x50ac09(0x141)])&&(printCliUpgradeWarning(_0x4a4a01),assertCliVersionSupported(_0x4a4a01));if(!_0x2ca3a1||_0x2ca3a1['trim']()==='')throw CliErrors[_0x50ac09(0x124)](_0x50ac09(0x151));const _0x494038=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x494038[_0x50ac09(0x14c)](_0x2ca3a1))throw CliErrors['validation'](_0x50ac09(0x15d),_0x50ac09(0x148));if(_0x2ca3a1['length']>0x64)throw CliErrors[_0x50ac09(0x124)](_0x50ac09(0x12a));const _0x1756a5=a106_0x36cbe1['resolve'](process[_0x50ac09(0x139)](),_0x2ca3a1);if(existsSync(_0x1756a5))throw CliErrors[_0x50ac09(0x124)]('Project\x20directory\x20\x22'+_0x2ca3a1+_0x50ac09(0x13f),_0x50ac09(0x12d));try{const _0x4a49c5=a106_0x36cbe1[_0x50ac09(0x143)](_0x1756a5);await a106_0x3485d6['access'](_0x4a49c5,a106_0x3485d6[_0x50ac09(0x136)][_0x50ac09(0x12e)]);}catch{throw CliErrors['validation']('Cannot\x20create\x20project\x20in\x20current\x20directory.',_0x50ac09(0x14f));}try{console[_0x50ac09(0x14b)](_0x50ac09(0x12f)+_0x2ca3a1+_0x50ac09(0x127));const _0x212db8=getSubAppReactDemoTemplateDir();await copyDirectory(_0x212db8,_0x1756a5),console[_0x50ac09(0x14b)](_0x50ac09(0x146)),await updatePackageJsonName(_0x2ca3a1),console[_0x50ac09(0x14b)](_0x50ac09(0x13a)),console[_0x50ac09(0x14b)](_0x50ac09(0x152)),console['log'](_0x50ac09(0x153)),await formatCode(_0x1756a5),console[_0x50ac09(0x14b)](_0x50ac09(0x123)),await configureProject(_0x2ca3a1,_0x265830,_0x3d8e63),console['log'](_0x50ac09(0x12b)),_0x265830&&await pullApiConfig(_0x1756a5,_0x265830,_0x3d8e63,_0x30f529),console[_0x50ac09(0x14b)](_0x50ac09(0x140)+_0x2ca3a1+_0x50ac09(0x137)),console[_0x50ac09(0x14b)](_0x50ac09(0x13b)+_0x2ca3a1),console[_0x50ac09(0x14b)](_0x50ac09(0x15c));}catch(_0x1ee296){try{existsSync(_0x1756a5)&&await a106_0x3485d6['rm'](_0x1756a5,{'recursive':!![],'force':!![]});}catch{}throw _0x1ee296;}}async function updatePackageJsonName(_0x585963){const _0x5b2245=a106_0x672e,_0x3539f7=a106_0x36cbe1[_0x5b2245(0x155)](process[_0x5b2245(0x139)](),_0x585963),_0x4efa23=a106_0x36cbe1[_0x5b2245(0x129)](_0x3539f7,_0x5b2245(0x132)),_0x4c51de=await a106_0x3485d6['readFile'](_0x4efa23,_0x5b2245(0x15e)),_0x28fa13=JSON[_0x5b2245(0x134)](_0x4c51de);_0x28fa13['name']=_0x585963,_0x28fa13[_0x5b2245(0x128)]=_0x5b2245(0x149),await a106_0x3485d6['writeFile'](_0x4efa23,JSON['stringify'](_0x28fa13,null,0x2)+'\x0a');}function detectPackageManager(){const _0xdf9331=a106_0x672e;try{return execSync(_0xdf9331(0x15a),{'stdio':'ignore'}),_0xdf9331(0x122);}catch{return _0xdf9331(0x138);}}async function formatCode(_0x1fb80c){const _0x3ff10f=a106_0x672e;try{await execAsync(_0x3ff10f(0x150),{'cwd':_0x1fb80c});}catch{}}async function configureProject(_0x19483e,_0x512a73,_0x7b23e4){const _0x1fa8f3=a106_0x672e,_0x3fa9e1=a106_0x36cbe1['resolve'](process['cwd'](),_0x19483e),_0xde5213=a106_0x36cbe1['join'](_0x3fa9e1,NEW_CONFIG_NAME),_0x53ab06=readConfig(),_0x927f4a=typeof _0x53ab06[_0x1fa8f3(0x135)]===_0x1fa8f3(0x142)?_0x53ab06[_0x1fa8f3(0x135)]:undefined,_0x41998a={};for(const _0x2fa7ec of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x53ab06[_0x2fa7ec]!=null)_0x41998a[_0x2fa7ec]=_0x53ab06[_0x2fa7ec];}const _0x296a6e=buildCanonicalProjectConfig(_0x41998a,{'appCodes':_0x512a73?[_0x512a73]:[],'env':_0x7b23e4||_0x927f4a||_0x1fa8f3(0x13c),'metadata':{'createdAt':new Date()[_0x1fa8f3(0x121)](),'version':getCliVersion()}});writeConfigFile(_0xde5213,_0x296a6e);}async function pullApiConfig(_0x4a2693,_0x1419a3,_0xf6c093,_0x340873){const _0x18d065=a106_0x672e,_0xd66b74=process['cwd']();try{process[_0x18d065(0x13d)](_0x4a2693);const _0x138ed5=_0xf6c093||_0x18d065(0x13c);initEnv(_0x138ed5),console['log']('\x20\x20Pulling\x20API\x20configuration...');const {configArray:_0x857775}=await fetchModelList(_0x1419a3,_0x340873||''),_0xd0153d=await generateApiFile(_0x857775,'',_0x1419a3,!![],_0x138ed5,DEFAULT_API_DIR);console[_0x18d065(0x14b)](_0x18d065(0x156)+_0x857775[_0x18d065(0x158)]+_0x18d065(0x131)+_0xd0153d[_0x18d065(0x126)]+_0x18d065(0x14a));}catch(_0x4b877f){console[_0x18d065(0x14b)](_0x18d065(0x154)+CLI_BIN_NAME+_0x18d065(0x133));}finally{process['chdir'](_0xd66b74);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a107_0x24b11d=a107_0x11c4;(function(_0x541218,_0x50c14a){const _0x424ecc=a107_0x11c4,_0x2db652=_0x541218();while(!![]){try{const _0x2d9f41=parseInt(_0x424ecc(0x66))/0x1*(parseInt(_0x424ecc(0x68))/0x2)+parseInt(_0x424ecc(0x71))/0x3*(parseInt(_0x424ecc(0x6d))/0x4)+-parseInt(_0x424ecc(0x6f))/0x5*(parseInt(_0x424ecc(0x67))/0x6)+-parseInt(_0x424ecc(0x65))/0x7+-parseInt(_0x424ecc(0x6b))/0x8+-parseInt(_0x424ecc(0x74))/0x9*(-parseInt(_0x424ecc(0x69))/0xa)+parseInt(_0x424ecc(0x6e))/0xb;if(_0x2d9f41===_0x50c14a)break;else _0x2db652['push'](_0x2db652['shift']());}catch(_0x1fc1d9){_0x2db652['push'](_0x2db652['shift']());}}}(a107_0x13ff,0x45db5));import a107_0x3473e0 from'node:path';import{fileURLToPath}from'node:url';function a107_0x11c4(_0x26248d,_0x4f24b5){_0x26248d=_0x26248d-0x65;const _0x13ff16=a107_0x13ff();let _0x11c4ab=_0x13ff16[_0x26248d];return _0x11c4ab;}const __dirname=a107_0x3473e0[a107_0x24b11d(0x75)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x35c322=a107_0x24b11d;return a107_0x3473e0[_0x35c322(0x6a)](__dirname,_0x35c322(0x76));}function a107_0x13ff(){const _0x4cb766=['35CkYBzA','join','204564pVlXWk','sub-app-react-demo','templates','5679NtOcnh','dirname','../../../../','3374168EebvxO','1JzQFar','427110qsGahO','732874NzjgQw','4310YCwkbw','resolve','2520136rBnSjw','projects','20hwiBjF','6623441MTaIqJ'];a107_0x13ff=function(){return _0x4cb766;};return a107_0x13ff();}export function getSubAppReactDemoTemplateDir(){const _0x369f13=a107_0x24b11d;return a107_0x3473e0[_0x369f13(0x70)](getRabetbaseCliPackageRoot(),_0x369f13(0x73),_0x369f13(0x6c),_0x369f13(0x72));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a108_0x219f(){const _0x1f2df4=['now','1158HxNAjd','cwd','583640DGfKmw','info','254440SkwzsN','3dJdNng','729356BuHbVC','项目模板复制完成','82160BxmcVY','message','copy','9093fKugDV','71880OAcvGw','项目模板复制失败','开始复制项目模板','2044467lUxGcf'];a108_0x219f=function(){return _0x1f2df4;};return a108_0x219f();}function a108_0x3c51(_0x30308b,_0x4151d9){_0x30308b=_0x30308b-0x126;const _0x219f04=a108_0x219f();let _0x3c5173=_0x219f04[_0x30308b];return _0x3c5173;}(function(_0x4ca335,_0xaf922e){const _0x186240=a108_0x3c51,_0x1fb778=_0x4ca335();while(!![]){try{const _0x544ed0=-parseInt(_0x186240(0x136))/0x1+-parseInt(_0x186240(0x12e))/0x2+parseInt(_0x186240(0x12f))/0x3*(-parseInt(_0x186240(0x130))/0x4)+-parseInt(_0x186240(0x132))/0x5+-parseInt(_0x186240(0x12a))/0x6*(-parseInt(_0x186240(0x135))/0x7)+parseInt(_0x186240(0x12c))/0x8+parseInt(_0x186240(0x128))/0x9;if(_0x544ed0===_0xaf922e)break;else _0x1fb778['push'](_0x1fb778['shift']());}catch(_0x241306){_0x1fb778['push'](_0x1fb778['shift']());}}}(a108_0x219f,0x2557a));import a108_0x4db5f7 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';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x38f5a1){const _0x2fc600=a108_0x3c51,_0x5a1d57=Date[_0x2fc600(0x129)](),_0x158e23=a108_0x4db5f7['resolve'](process[_0x2fc600(0x12b)](),_0x38f5a1);try{logger[_0x2fc600(0x12d)](_0x2fc600(0x134),_0x2fc600(0x127),{'projectCode':_0x38f5a1,'templateDir':templateDir}),await copyDirectory(templateDir,_0x158e23);const _0x4828c9=Date[_0x2fc600(0x129)]()-_0x5a1d57;logger['success'](_0x2fc600(0x134),_0x2fc600(0x131),_0x4828c9,{'projectCode':_0x38f5a1});}catch(_0x4ab0e3){const _0x27e0b3=Date['now']()-_0x5a1d57;logger['error'](_0x2fc600(0x134),_0x2fc600(0x126),{'projectCode':_0x38f5a1,'error':_0x4ab0e3 instanceof Error?_0x4ab0e3[_0x2fc600(0x133)]:String(_0x4ab0e3),'duration':_0x27e0b3});throw _0x4ab0e3;}return formatElapsed(_0x5a1d57);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5b3b7a,_0x3f4bd3){const _0x3af746=a109_0x3bfb,_0x1d80ad=_0x5b3b7a();while(!![]){try{const _0x445de2=parseInt(_0x3af746(0x81))/0x1*(parseInt(_0x3af746(0x85))/0x2)+-parseInt(_0x3af746(0x74))/0x3*(-parseInt(_0x3af746(0x83))/0x4)+-parseInt(_0x3af746(0x7c))/0x5+parseInt(_0x3af746(0x73))/0x6*(-parseInt(_0x3af746(0x7f))/0x7)+-parseInt(_0x3af746(0x77))/0x8*(-parseInt(_0x3af746(0x82))/0x9)+-parseInt(_0x3af746(0x88))/0xa+parseInt(_0x3af746(0x7a))/0xb;if(_0x445de2===_0x3f4bd3)break;else _0x1d80ad['push'](_0x1d80ad['shift']());}catch(_0x28e387){_0x1d80ad['push'](_0x1d80ad['shift']());}}}(a109_0x3ed1,0x492b0));import a109_0x45f7a4 from'node:path';function a109_0x3ed1(){const _0x13e253=['success','npx','5099530xQeLcX','18WXXURZ','3CWfeIJ','prettier','开始格式化代码','8ocIiOC','format','info','6111017fMHjTB','error','259185SVnEer','代码格式化完成','resolve','1149939YdGNEh','now','1FJAjkE','2870271BKihtF','577112hOuGMc','代码格式化失败','671146sQNqsC'];a109_0x3ed1=function(){return _0x13e253;};return a109_0x3ed1();}import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a109_0x3bfb(_0x4521fd,_0x4d0438){_0x4521fd=_0x4521fd-0x73;const _0x3ed12f=a109_0x3ed1();let _0x3bfba8=_0x3ed12f[_0x4521fd];return _0x3bfba8;}import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x338adc){const _0x4dcca5=a109_0x3bfb,_0x364206=Date['now'](),_0x53fb7d=a109_0x45f7a4[_0x4dcca5(0x7e)](process['cwd'](),_0x338adc);try{logger[_0x4dcca5(0x79)]('format',_0x4dcca5(0x76),{'projectCode':_0x338adc}),await execa(resolveNpmBin(_0x4dcca5(0x87)),[_0x4dcca5(0x75),'--write','.'],{'cwd':_0x53fb7d});const _0x42e82e=Date[_0x4dcca5(0x80)]()-_0x364206;logger[_0x4dcca5(0x86)](_0x4dcca5(0x78),_0x4dcca5(0x7d),_0x42e82e,{'projectCode':_0x338adc});}catch(_0x2d1689){const _0x41e387=Date[_0x4dcca5(0x80)]()-_0x364206;logger[_0x4dcca5(0x7b)](_0x4dcca5(0x78),_0x4dcca5(0x84),{'projectCode':_0x338adc,'error':_0x2d1689 instanceof Error?_0x2d1689['message']:String(_0x2d1689),'duration':_0x41e387});throw _0x2d1689;}return formatElapsed(_0x364206);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a110_0x555d(_0x31047e,_0xac7617){_0x31047e=_0x31047e-0xf4;const _0x2fd0ed=a110_0x2fd0();let _0x555d7d=_0x2fd0ed[_0x31047e];return _0x555d7d;}(function(_0x27f48b,_0x45dae9){const _0x16df7a=a110_0x555d,_0x375209=_0x27f48b();while(!![]){try{const _0xe41284=parseInt(_0x16df7a(0xf5))/0x1+-parseInt(_0x16df7a(0x108))/0x2*(parseInt(_0x16df7a(0xff))/0x3)+-parseInt(_0x16df7a(0x104))/0x4+-parseInt(_0x16df7a(0x106))/0x5+-parseInt(_0x16df7a(0xf4))/0x6*(parseInt(_0x16df7a(0x100))/0x7)+parseInt(_0x16df7a(0x103))/0x8*(parseInt(_0x16df7a(0xf8))/0x9)+parseInt(_0x16df7a(0xfa))/0xa;if(_0xe41284===_0x45dae9)break;else _0x375209['push'](_0x375209['shift']());}catch(_0x4e5ab0){_0x375209['push'](_0x375209['shift']());}}}(a110_0x2fd0,0x73094));import a110_0x3b41e9 from'node:path';import{execa}from'execa';function a110_0x2fd0(){const _0x15c9d2=['info','https://registry.npmmirror.com','cwd','184839YGVTVZ','721PbjeJz','install','npm','632xOTAqd','1624124EBduLK','--registry','4042770SoTBhQ','message','18mlVuBX','依赖安装失败','50244KpHOJh','533852TnDgOL','依赖安装完成','resolve','76653HxBVeI','now','18961170oTztwd','error'];a110_0x2fd0=function(){return _0x15c9d2;};return a110_0x2fd0();}import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x21dbbe){const _0x4433fc=a110_0x555d,_0x5e0112=Date[_0x4433fc(0xf9)](),_0x43370a=a110_0x3b41e9[_0x4433fc(0xf7)](process[_0x4433fc(0xfe)](),_0x21dbbe);try{logger[_0x4433fc(0xfc)](_0x4433fc(0x101),'开始安装依赖',{'projectCode':_0x21dbbe,'registry':_0x4433fc(0xfd)}),await execa(resolveNpmBin(_0x4433fc(0x102)),[_0x4433fc(0x101),_0x4433fc(0x105),'https://registry.npmmirror.com'],{'cwd':_0x43370a});const _0x262333=Date[_0x4433fc(0xf9)]()-_0x5e0112;logger['success'](_0x4433fc(0x101),_0x4433fc(0xf6),_0x262333,{'projectCode':_0x21dbbe});}catch(_0x45c7d7){const _0xe4b538=Date[_0x4433fc(0xf9)]()-_0x5e0112;logger[_0x4433fc(0xfb)](_0x4433fc(0x101),_0x4433fc(0x109),{'projectCode':_0x21dbbe,'error':_0x45c7d7 instanceof Error?_0x45c7d7[_0x4433fc(0x107)]:String(_0x45c7d7),'duration':_0xe4b538});throw _0x45c7d7;}return formatElapsed(_0x5e0112);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a111_0xe350(){const _0x4fd795=['name','Project\x20name','2054569rgswCD','appcode','3gAVTnt','9207708kCcdNB','yes','../../commands/project/create/non-interactive.js','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','78ttYqQi','Usage:\x20','env','856737QyJNSo','App\x20code\x20to\x20initialize','60ChMBtB','Auto-confirm\x20prompts','project-name','trim','../../commands/project/create/main.js','string','13897PNSngW','args','nonInteractive','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','str','create','boolean','1240455wpjEui','81WqqNev','write','bool','1052200xFxTuR','14LWXZIV','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','project','13cgqUXZ','init','Skip\x20confirmation\x20prompt','5703188CAgwKv','cookie','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.'];a111_0xe350=function(){return _0x4fd795;};return a111_0xe350();}const a111_0x4da70e=a111_0x590e;(function(_0x519fe5,_0x3a9f09){const _0x31fd0d=a111_0x590e,_0x5ca3d0=_0x519fe5();while(!![]){try{const _0x170a9c=-parseInt(_0x31fd0d(0x145))/0x1*(-parseInt(_0x31fd0d(0x152))/0x2)+parseInt(_0x31fd0d(0x15f))/0x3*(parseInt(_0x31fd0d(0x158))/0x4)+parseInt(_0x31fd0d(0x14d))/0x5+parseInt(_0x31fd0d(0x164))/0x6*(-parseInt(_0x31fd0d(0x167))/0x7)+parseInt(_0x31fd0d(0x151))/0x8*(-parseInt(_0x31fd0d(0x14e))/0x9)+-parseInt(_0x31fd0d(0x169))/0xa*(-parseInt(_0x31fd0d(0x15d))/0xb)+-parseInt(_0x31fd0d(0x160))/0xc*(-parseInt(_0x31fd0d(0x155))/0xd);if(_0x170a9c===_0x3a9f09)break;else _0x5ca3d0['push'](_0x5ca3d0['shift']());}catch(_0x4bc5b5){_0x5ca3d0['push'](_0x5ca3d0['shift']());}}}(a111_0xe350,0xd7e76));import{CliErrors}from'../../errors.js';function a111_0x590e(_0x31a5cd,_0x41376b){_0x31a5cd=_0x31a5cd-0x141;const _0xe350b=a111_0xe350();let _0x590e3b=_0xe350b[_0x31a5cd];return _0x590e3b;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';const initFlags=[{'name':a111_0x4da70e(0x15e),'type':a111_0x4da70e(0x144),'description':a111_0x4da70e(0x168)},{'name':a111_0x4da70e(0x166),'type':a111_0x4da70e(0x144),'description':'Target\x20environment'},{'name':'yes','type':'boolean','description':a111_0x4da70e(0x16a),'default':![]}],createFlags=[{'name':a111_0x4da70e(0x15b),'type':'string','description':a111_0x4da70e(0x15c)},{'name':'env','type':a111_0x4da70e(0x144),'description':'Target\x20environment'},{'name':a111_0x4da70e(0x15e),'type':a111_0x4da70e(0x144),'description':a111_0x4da70e(0x148)}],upgradeFlags=[{'name':'yes','type':a111_0x4da70e(0x14c),'description':a111_0x4da70e(0x157),'default':![]}];export const projectDefinitions=[{'service':a111_0x4da70e(0x154),'command':a111_0x4da70e(0x156),'description':'Initialize\x20.rabetbase.json\x20config\x20in\x20existing\x20project','risk':a111_0x4da70e(0x14f),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initFlags,async 'execute'(_0x21fd5f){const _0x5d4cf1=a111_0x4da70e;return await initConfig({'appcode':_0x21fd5f['str'](_0x5d4cf1(0x15e))||undefined,'env':_0x21fd5f[_0x5d4cf1(0x14a)](_0x5d4cf1(0x166))||undefined,'autoYes':_0x21fd5f[_0x5d4cf1(0x150)](_0x5d4cf1(0x161))}),{'ok':!![]};}},{'service':a111_0x4da70e(0x154),'command':a111_0x4da70e(0x14b),'description':'Create\x20a\x20new\x20project','risk':a111_0x4da70e(0x14f),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a111_0x4da70e(0x141),'description':a111_0x4da70e(0x149),'required':![]}],'flags':createFlags,async 'execute'(_0x474623){const _0xc6c11d=a111_0x4da70e,{createApp:_0x2f2c07}=await import(_0xc6c11d(0x143)),{createProjectNonInteractive:_0x37ec6a}=await import(_0xc6c11d(0x162)),_0x194289=_0x474623[_0xc6c11d(0x14a)](_0xc6c11d(0x15b))[_0xc6c11d(0x142)]()||_0x474623[_0xc6c11d(0x146)][0x0]?.[_0xc6c11d(0x142)](),_0x2719e1=_0x474623['str'](_0xc6c11d(0x166))||undefined,_0x5d73b3=_0x474623[_0xc6c11d(0x14a)](_0xc6c11d(0x15e))||undefined;if(_0x474623[_0xc6c11d(0x147)]){if(!_0x194289)throw CliErrors['validation'](_0xc6c11d(0x15a),_0xc6c11d(0x165)+CLI_BIN_NAME+_0xc6c11d(0x163));await _0x37ec6a(_0x194289,_0x2719e1,_0x5d73b3,_0x474623[_0xc6c11d(0x159)]);}else await _0x2f2c07({'projectCode':_0x194289,'appCode':_0x5d73b3,'env':_0x2719e1,'cookie':_0x474623[_0xc6c11d(0x159)]});return{'ok':!![]};}},{'service':a111_0x4da70e(0x154),'command':'upgrade','description':a111_0x4da70e(0x153),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x3e907a){const _0x17bd0c=a111_0x4da70e;return await upgradeApp(_0x3e907a['nonInteractive'],{'yes':_0x3e907a[_0x17bd0c(0x150)](_0x17bd0c(0x161))}),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x39d04f,_0x4981f6){const _0x503366=a112_0x16e3,_0x5c277f=_0x39d04f();while(!![]){try{const _0x19c21e=-parseInt(_0x503366(0x197))/0x1+-parseInt(_0x503366(0x1a9))/0x2+parseInt(_0x503366(0x1be))/0x3*(parseInt(_0x503366(0x1b6))/0x4)+-parseInt(_0x503366(0x199))/0x5*(parseInt(_0x503366(0x1a0))/0x6)+-parseInt(_0x503366(0x1a6))/0x7+-parseInt(_0x503366(0x1b3))/0x8+parseInt(_0x503366(0x1b7))/0x9;if(_0x19c21e===_0x4981f6)break;else _0x5c277f['push'](_0x5c277f['shift']());}catch(_0x3d1655){_0x5c277f['push'](_0x5c277f['shift']());}}}(a112_0x55a2,0x67f65));import{readFileSync,existsSync,renameSync}from'node:fs';function a112_0x16e3(_0x121edd,_0x31665c){_0x121edd=_0x121edd-0x18f;const _0x55a240=a112_0x55a2();let _0x16e3e8=_0x55a240[_0x121edd];return _0x16e3e8;}import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a112_0x19d170 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';function a112_0x55a2(){const _0x2b6657=['package.json','App\x20Code\x20cannot\x20be\x20empty','.rabetbase.json','.bak','string','cyan','join','713436MrizRC','\x20\x20Apps:\x20','3141455fgwmlz','keys','Please\x20enter\x20App\x20Code:','✓\x20Upgraded\x20','toLocaleString','init','bold','6VmWYzE','app','Upgrade\x20it\x20to\x20','\x20api\x20generate\x27\x20and\x20\x27','utf8','?\x20(Old\x20file\x20→\x20*.bak)','3503171dsdmtZ','version','parse','859050DWUdbA','env','Invalid\x20App\x20Code','trim','appcode','1.0.0','\x20\x20appcode:\x20','setLogPath','green','gray','6313680toWHol','\x20api\x20pull\x27','info','336sSKyow','27159192xfEGkg','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','\x20→\x20.rabetbase.json','log','defaultApp','apps','../..','16752SfcxwD','从旧配置文件升级成功','\x20project\x20init`\x20to\x20start\x20fresh.'];a112_0x55a2=function(){return _0x2b6657;};return a112_0x55a2();}import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x25948c){const _0x48d918=a112_0x16e3,{appcode:_0x27c802,env:_0x1ddb57,autoYes:_0x2aa4e1}=_0x25948c,_0x28d751=process['cwd']();if(getProjectConfigPath())throw new Error('.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.');let _0x44ffdf;for(const _0x18b96e of LEGACY_CONFIG_NAMES){const _0x4826e7=resolve(_0x28d751,_0x18b96e);if(existsSync(_0x4826e7)){_0x44ffdf=_0x4826e7;break;}}if(_0x44ffdf){let _0x1c5596={};try{_0x1c5596=JSON[_0x48d918(0x1a8)](readFileSync(_0x44ffdf,_0x48d918(0x1a4)));}catch{}const _0x1a02c5=basename(_0x44ffdf),_0x5407cf=_0x1c5596?.[_0x48d918(0x1ad)]||_0x1c5596?.[_0x48d918(0x1a1)];let _0x49256f=_0x2aa4e1;!_0x2aa4e1&&(console[_0x48d918(0x1ba)](a112_0x19d170['yellow']('⚠\x20Found\x20legacy\x20configuration\x20file:\x20'+a112_0x19d170[_0x48d918(0x19f)](_0x1a02c5))),_0x5407cf&&console[_0x48d918(0x1ba)](a112_0x19d170[_0x48d918(0x195)](_0x48d918(0x1af)+_0x5407cf)),_0x49256f=await confirm({'message':_0x48d918(0x1a2)+a112_0x19d170[_0x48d918(0x19f)](_0x48d918(0x192))+_0x48d918(0x1a5),'default':!![]}));if(!_0x49256f){console[_0x48d918(0x1ba)]('Migration\x20cancelled.\x20Run\x20`'+CLI_BIN_NAME+_0x48d918(0x18f));return;}const _0x2de840=resolve(_0x28d751,NEW_CONFIG_NAME),_0x8df18b=getCliVersionFromPkg(),_0x36a044=readRawConfig(),_0x12420c=_0x27c802||(typeof _0x1c5596?.[_0x48d918(0x1ad)]==='string'?_0x1c5596[_0x48d918(0x1ad)]:undefined)||(typeof _0x1c5596?.[_0x48d918(0x1a1)]==='string'?_0x1c5596['app']:undefined)||await askAppcode(),_0x587df5=typeof _0x1c5596?.[_0x48d918(0x1aa)]===_0x48d918(0x194)?_0x1c5596[_0x48d918(0x1aa)]:typeof _0x36a044[_0x48d918(0x1aa)]===_0x48d918(0x194)?_0x36a044[_0x48d918(0x1aa)]:'production',_0x9a15e8=buildCanonicalProjectConfig({..._0x36a044,..._0x1c5596},{'appCodes':[_0x12420c],'env':_0x587df5,'metadata':{'version':_0x8df18b,'migratedAt':new Date()['toLocaleString'](),'migratedFrom':_0x44ffdf}});writeConfigFile(_0x2de840,_0x9a15e8);const _0x2b5ecc=_0x44ffdf+_0x48d918(0x193);renameSync(_0x44ffdf,_0x2b5ecc),logger['setLogPath'](_0x28d751),logger[_0x48d918(0x1b5)](_0x48d918(0x19e),_0x48d918(0x1bf),{'from':_0x44ffdf,'to':_0x2de840,'appcode':_0x12420c,'env':_0x9a15e8['env']}),console['log'](a112_0x19d170[_0x48d918(0x1b1)](_0x48d918(0x19c)+_0x1a02c5+_0x48d918(0x1b9))),console[_0x48d918(0x1ba)](a112_0x19d170[_0x48d918(0x195)](_0x48d918(0x198)+Object[_0x48d918(0x19a)](_0x9a15e8[_0x48d918(0x1bc)]||{})[_0x48d918(0x196)](',\x20'))),console['log'](a112_0x19d170[_0x48d918(0x195)]('\x20\x20Default:\x20'+_0x9a15e8['defaultApp'])),console[_0x48d918(0x1ba)](a112_0x19d170[_0x48d918(0x1b2)]('\x20\x20Old\x20file\x20backed\x20up\x20as\x20'+_0x1a02c5+_0x48d918(0x193)));return;}const _0x49b7f0=_0x27c802||await askAppcode(),_0x347e31=resolve(_0x28d751,NEW_CONFIG_NAME),_0x4e2623=getCliVersionFromPkg(),_0x189749=readRawConfig(),_0x28e836=typeof _0x189749[_0x48d918(0x1aa)]===_0x48d918(0x194)?_0x189749[_0x48d918(0x1aa)]:undefined,_0x67a1a3=buildCanonicalProjectConfig({},{'appCodes':[_0x49b7f0],'env':_0x1ddb57||_0x28e836||'production','metadata':{'version':_0x4e2623,'createdAt':new Date()[_0x48d918(0x19d)]()}});writeConfigFile(_0x347e31,_0x67a1a3),logger[_0x48d918(0x1b0)](_0x28d751),logger['info'](_0x48d918(0x19e),'初始化项目配置文件成功',{'appcode':_0x49b7f0,'env':_0x67a1a3[_0x48d918(0x1aa)],'version':_0x67a1a3['version'],'configPath':_0x347e31}),console[_0x48d918(0x1ba)](a112_0x19d170['green']('✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory')),console['log'](a112_0x19d170[_0x48d918(0x195)]('\x20\x20Apps:\x20'+Object['keys'](_0x67a1a3[_0x48d918(0x1bc)]||{})[_0x48d918(0x196)](',\x20'))),console[_0x48d918(0x1ba)](a112_0x19d170[_0x48d918(0x195)]('\x20\x20Default:\x20'+_0x67a1a3[_0x48d918(0x1bb)])),console[_0x48d918(0x1ba)](_0x48d918(0x1b8)+CLI_BIN_NAME+_0x48d918(0x1a3)+CLI_BIN_NAME+_0x48d918(0x1b4));}function askAppcode(){const _0x189581=a112_0x16e3;return input({'message':_0x189581(0x19b),'validate':_0x402a1b=>{const _0x26fd25=_0x189581;if(!_0x402a1b[_0x26fd25(0x1ac)]())return _0x26fd25(0x191);const {valid:_0x57fc98,message:_0x56d900}=validateAppcode(_0x402a1b[_0x26fd25(0x1ac)]());return _0x57fc98||_0x56d900||_0x26fd25(0x1ab);}});}function getCliVersionFromPkg(){const _0x941e7c=a112_0x16e3;try{const _0x398fd4=fileURLToPath(import.meta.url),_0x43d0af=resolve(dirname(_0x398fd4),_0x941e7c(0x1bd)),_0x3c0d3d=JSON['parse'](readFileSync(resolve(_0x43d0af,_0x941e7c(0x190)),_0x941e7c(0x1a4)));return _0x3c0d3d[_0x941e7c(0x1a7)]||_0x941e7c(0x1ae);}catch{return _0x941e7c(0x1ae);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a113_0xab848=a113_0x1d0e;(function(_0x2ef296,_0x28d890){const _0x10f9c7=a113_0x1d0e,_0x1c60f7=_0x2ef296();while(!![]){try{const _0x5d0a92=parseInt(_0x10f9c7(0x15a))/0x1+parseInt(_0x10f9c7(0x132))/0x2*(-parseInt(_0x10f9c7(0x120))/0x3)+-parseInt(_0x10f9c7(0x143))/0x4+parseInt(_0x10f9c7(0x153))/0x5+parseInt(_0x10f9c7(0x16f))/0x6*(parseInt(_0x10f9c7(0x100))/0x7)+parseInt(_0x10f9c7(0x11b))/0x8+-parseInt(_0x10f9c7(0x167))/0x9*(parseInt(_0x10f9c7(0x117))/0xa);if(_0x5d0a92===_0x28d890)break;else _0x1c60f7['push'](_0x1c60f7['shift']());}catch(_0x6affa9){_0x1c60f7['push'](_0x1c60f7['shift']());}}}(a113_0x24cf,0xbae91));import a113_0x46b14a from'chalk';import a113_0xf70336 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[a113_0xab848(0x14a)](_0x4329ae=>_0x4329ae!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x4f4653){const _0x9c3e94=a113_0xab848,_0x7ea7e7=[];for(const _0x3803c6 of Object[_0x9c3e94(0xf2)](CORE_IDE_CONFIGS)){if(_0x3803c6[_0x9c3e94(0xf7)])for(const _0x5c2b8d of _0x3803c6[_0x9c3e94(0xf7)]){_0x7ea7e7[_0x9c3e94(0xf4)](resolve(_0x4f4653,_0x5c2b8d['path']));}}return _0x7ea7e7;}function analyse(_0x4ccdb7){const _0x3d6c55=a113_0xab848;let _0x1aac22=null;const _0x2bef5e=resolve(_0x4ccdb7,NEW_CONFIG_NAME),_0x3b5d6d=existsSync(_0x2bef5e);for(const _0x23ce31 of LEGACY_CONFIG_NAMES){const _0x4d1fd5=resolve(_0x4ccdb7,_0x23ce31);if(existsSync(_0x4d1fd5)){const _0x29d582=readConfigFile(_0x4d1fd5),_0x3c2be5=Object['keys'](_0x29d582)[_0x3d6c55(0x14a)](_0x4faabe=>typeof _0x29d582[_0x4faabe]!==_0x3d6c55(0x154));_0x1aac22={'oldPath':_0x4d1fd5,'hasNewConfig':_0x3b5d6d,'fields':_0x3c2be5};break;}}const _0x118f7b=[],_0x5cd55a=resolve(_0x4ccdb7,_0x3d6c55(0x122));if(existsSync(_0x5cd55a))_0x118f7b[_0x3d6c55(0xf4)](_0x5cd55a);const _0xe0df17=resolve(_0x4ccdb7,'.cursor/rules/lovrabet_rules.mdc');if(existsSync(_0xe0df17))_0x118f7b[_0x3d6c55(0xf4)](_0xe0df17);const _0x1f844f=resolve(_0x4ccdb7,_0x3d6c55(0x102));if(existsSync(_0x1f844f))_0x118f7b[_0x3d6c55(0xf4)](_0x1f844f);for(const _0x1138ef of collectIdeSkillFiles(_0x4ccdb7)){if(existsSync(_0x1138ef))_0x118f7b['push'](_0x1138ef);}let _0x529406=null;const _0x3de452=resolve(_0x4ccdb7,_0x3d6c55(0xfa));if(existsSync(_0x3de452))try{const _0x4faf7d=JSON[_0x3d6c55(0x12c)](readFileSync(_0x3de452,_0x3d6c55(0x103)));if(_0x4faf7d?.[_0x3d6c55(0x11f)]&&typeof _0x4faf7d[_0x3d6c55(0x11f)]===_0x3d6c55(0x162)){const _0x1f8acb=[];for(const [_0x4b9105,_0x2eff07]of Object[_0x3d6c55(0x12f)](_0x4faf7d[_0x3d6c55(0x11f)])){const _0x31a87a=_0x2eff07;_0x31a87a?.[_0x3d6c55(0xef)]&&Array[_0x3d6c55(0x12d)](_0x31a87a['args'])&&_0x31a87a[_0x3d6c55(0xef)][_0x3d6c55(0x13c)](_0x1e91d1=>typeof _0x1e91d1===_0x3d6c55(0x10b)&&_0x1e91d1[_0x3d6c55(0x12a)](_0x3d6c55(0x10c)))&&_0x1f8acb[_0x3d6c55(0xf4)](_0x4b9105);}_0x1f8acb[_0x3d6c55(0x11a)]>0x0&&(_0x529406={'path':_0x3de452,'keys':_0x1f8acb});}}catch{}const _0x1b4942=_0x118f7b[_0x3d6c55(0x11a)]>0x0||_0x1aac22!==null;let _0x2cf95b=null;const _0x2c9700=resolve(_0x4ccdb7,_0x3d6c55(0xf5));if(existsSync(_0x2c9700))try{const _0x5e031c=JSON[_0x3d6c55(0x12c)](readFileSync(_0x2c9700,_0x3d6c55(0x103)));for(const _0x313a3d of[_0x3d6c55(0x168),_0x3d6c55(0xfd)]){const _0x4675f8=_0x5e031c?.[_0x313a3d]?.['@lovrabet/sdk'];if(typeof _0x4675f8===_0x3d6c55(0x10b)){_0x4675f8!==_0x3d6c55(0x155)&&(_0x2cf95b={'pkgPath':_0x2c9700,'currentVersion':_0x4675f8,'field':_0x313a3d});break;}}}catch{}return{'configMigration':_0x1aac22,'oldArtifacts':_0x118f7b,'oldMcpConfig':_0x529406,'needsSkillSwap':_0x1b4942,'sdkUpgrade':_0x2cf95b};}function printReport(_0x229fe2){const _0x346c0f=a113_0xab848,{configMigration:_0x23fb0f,oldArtifacts:_0x26af27,oldMcpConfig:_0x350fe7,needsSkillSwap:_0x2c9d3b}=_0x229fe2;console['log'](''),console[_0x346c0f(0x115)](a113_0x46b14a[_0x346c0f(0x124)](_0x346c0f(0xf8))),console['log']('');_0x23fb0f?(console[_0x346c0f(0x115)](a113_0x46b14a[_0x346c0f(0x16e)](_0x346c0f(0x146))+('\x20\x20'+a113_0x46b14a['yellow'](_0x23fb0f[_0x346c0f(0x144)]))),console['log'](_0x346c0f(0x13e)+(_0x23fb0f['hasNewConfig']?a113_0x46b14a['green'](_0x346c0f(0x158)):a113_0x46b14a[_0x346c0f(0x16c)](_0x346c0f(0x11c)))),console[_0x346c0f(0x115)](_0x346c0f(0x125)+_0x23fb0f['fields'][_0x346c0f(0x165)](',\x20')),console[_0x346c0f(0x115)]('\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak')):console[_0x346c0f(0x115)](a113_0x46b14a[_0x346c0f(0x16e)]('Config\x20file:')+'\x20\x20'+a113_0x46b14a[_0x346c0f(0x16c)](_0x346c0f(0x114)));console['log']('');if(_0x26af27[_0x346c0f(0x11a)]>0x0){console[_0x346c0f(0x115)](a113_0x46b14a[_0x346c0f(0x16e)](_0x346c0f(0x131)));for(const _0x50d62b of _0x26af27){console[_0x346c0f(0x115)]('\x20\x20'+a113_0x46b14a[_0x346c0f(0x16b)]('FOUND')+'\x20\x20'+_0x50d62b);}console[_0x346c0f(0x115)]('\x20\x20Action:\x20delete');}else console[_0x346c0f(0x115)](a113_0x46b14a[_0x346c0f(0x16e)](_0x346c0f(0x131))+'\x20\x20'+a113_0x46b14a['gray'](_0x346c0f(0x156)));console[_0x346c0f(0x115)]('');_0x350fe7?(console[_0x346c0f(0x115)](a113_0x46b14a[_0x346c0f(0x16e)]('MCP\x20config:')+('\x20\x20'+a113_0x46b14a[_0x346c0f(0x128)](_0x350fe7[_0x346c0f(0x10a)])+_0x346c0f(0x123)+_0x350fe7[_0x346c0f(0x142)][_0x346c0f(0x165)](',\x20'))),console[_0x346c0f(0x115)](_0x346c0f(0x15d))):console[_0x346c0f(0x115)](a113_0x46b14a['cyan'](_0x346c0f(0x13b))+'\x20\x20'+a113_0x46b14a[_0x346c0f(0x16c)](_0x346c0f(0x13d)));console[_0x346c0f(0x115)](''),console['log'](a113_0x46b14a['cyan'](_0x346c0f(0x14e))+('\x20\x20'+(_0x2c9d3b?a113_0x46b14a[_0x346c0f(0x128)]('needed'):a113_0x46b14a['green'](_0x346c0f(0x13a)))));_0x2c9d3b&&console[_0x346c0f(0x115)](_0x346c0f(0x151)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console['log']('');if(_0x229fe2[_0x346c0f(0x106)]){const {currentVersion:_0x49825c,field:_0x1e175f,pkgPath:_0x11d639}=_0x229fe2[_0x346c0f(0x106)];console[_0x346c0f(0x115)](a113_0x46b14a[_0x346c0f(0x16e)]('@lovrabet/sdk:')+('\x20\x20'+a113_0x46b14a[_0x346c0f(0x128)](_0x11d639))),console[_0x346c0f(0x115)](_0x346c0f(0xfc)+_0x1e175f+':\x20'+a113_0x46b14a['yellow'](_0x49825c)+_0x346c0f(0xf3)+a113_0x46b14a[_0x346c0f(0x12b)](_0x346c0f(0x155))),console['log'](_0x346c0f(0x15b));}else console[_0x346c0f(0x115)](a113_0x46b14a[_0x346c0f(0x16e)]('@lovrabet/sdk:')+'\x20\x20'+a113_0x46b14a[_0x346c0f(0x16c)](_0x346c0f(0x105)));console[_0x346c0f(0x115)]('');}function execConfigMigration(_0x46a054,_0x11c362){const _0x13999b=a113_0xab848,{configMigration:_0x25226c}=_0x46a054;if(!_0x25226c?.[_0x13999b(0x144)])return{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x13999b(0x16a)};const _0x3d3888=readConfigFile(_0x25226c[_0x13999b(0x144)]),_0x5d1ecd=resolve(_0x11c362,NEW_CONFIG_NAME),_0x47de4b=_0x25226c[_0x13999b(0x107)]?readConfigFile(_0x5d1ecd):{};for(const [_0x29810c,_0x1dfc6c]of Object[_0x13999b(0x12f)](_0x3d3888)){!(_0x29810c in _0x47de4b)&&(_0x47de4b[_0x29810c]=_0x1dfc6c);}writeConfigFile(_0x5d1ecd,_0x47de4b);const _0xb3a828=_0x25226c[_0x13999b(0x144)]+_0x13999b(0x157);return renameSync(_0x25226c[_0x13999b(0x144)],_0xb3a828),{'step':0x1,'label':_0x13999b(0x160),'ok':!![],'detail':_0x25226c['oldPath']+'\x20→\x20'+_0x5d1ecd+_0x13999b(0x126)+_0xb3a828+')'};}function execRemoveOldArtifacts(_0x4307f6){const _0x211c9d=a113_0xab848,_0x5321ab=[];for(const _0x5bdce3 of _0x4307f6){try{if(!existsSync(_0x5bdce3))continue;const _0x4c33fe=tryStat(_0x5bdce3);_0x4c33fe?.[_0x211c9d(0xf6)]()?rmSync(_0x5bdce3,{'recursive':!![],'force':!![]}):unlinkSync(_0x5bdce3);}catch(_0x190e1b){_0x5321ab[_0x211c9d(0xf4)](_0x5bdce3+':\x20'+_0x190e1b[_0x211c9d(0x152)]);}}return{'step':0x3,'label':_0x211c9d(0x169),'ok':_0x5321ab[_0x211c9d(0x11a)]===0x0,'detail':_0x5321ab[_0x211c9d(0x11a)]>0x0?_0x4307f6[_0x211c9d(0x11a)]-_0x5321ab[_0x211c9d(0x11a)]+'/'+_0x4307f6['length']+_0x211c9d(0xff)+_0x5321ab[_0x211c9d(0x165)](';\x20')+')':_0x4307f6[_0x211c9d(0x11a)]+'\x20removed'};}function execCleanMcp(_0x5edbc7){const _0x296942=a113_0xab848;if(!_0x5edbc7['oldMcpConfig'])return{'step':0x4,'label':_0x296942(0x111),'ok':!![],'detail':_0x296942(0x14c)};try{const _0x308948=readFileSync(_0x5edbc7[_0x296942(0xf1)][_0x296942(0x10a)],'utf8'),_0x28febb=JSON[_0x296942(0x12c)](_0x308948);if(_0x28febb?.[_0x296942(0x11f)]&&typeof _0x28febb[_0x296942(0x11f)]===_0x296942(0x162)){const _0x137462=[];for(const [_0x338086,_0xdb4b5a]of Object[_0x296942(0x12f)](_0x28febb[_0x296942(0x11f)])){_0xdb4b5a?.[_0x296942(0xef)]&&Array[_0x296942(0x12d)](_0xdb4b5a[_0x296942(0xef)])&&_0xdb4b5a[_0x296942(0xef)][_0x296942(0x13c)](_0x31198a=>typeof _0x31198a===_0x296942(0x10b)&&_0x31198a['includes'](_0x296942(0x10c)))&&_0x137462[_0x296942(0xf4)](_0x338086);}for(const _0x29ce17 of _0x137462){delete _0x28febb['mcpServers'][_0x29ce17];}return _0x137462[_0x296942(0x11a)]>0x0&&writeFileSync(_0x5edbc7[_0x296942(0xf1)][_0x296942(0x10a)],JSON[_0x296942(0x14d)](_0x28febb,null,0x2)+'\x0a',_0x296942(0x103)),{'step':0x4,'label':_0x296942(0x111),'ok':!![],'detail':_0x296942(0x113)+_0x137462['join'](',\x20')+_0x296942(0x11e)+_0x5edbc7['oldMcpConfig'][_0x296942(0x10a)]};}return{'step':0x4,'label':_0x296942(0x111),'ok':!![],'detail':_0x296942(0x109)};}catch(_0x79ebf2){return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':![],'detail':_0x79ebf2[_0x296942(0x152)]};}}function execSkillsRemove(_0x1a46d6,_0x30a9cb){const _0x2dcee0=a113_0xab848,_0x32f134=runNpxSkillsRemove(_0x1a46d6,{'stdio':_0x2dcee0(0x129),'yes':_0x30a9cb});return{'step':0x5,'label':_0x2dcee0(0x138),'ok':_0x32f134['ok'],'detail':_0x32f134['ok']?_0x2dcee0(0x145):_0x32f134[_0x2dcee0(0x10e)]??_0x2dcee0(0x12e)+_0x32f134['status']};}function execSkillsAdd(_0x4484bd,_0x27a7b7){const _0x17410a=a113_0xab848,_0x5d684d=runNpxSkillsAddGlobal(_0x4484bd,_0x17410a(0x141),{'stdio':_0x17410a(0x129),'yes':_0x27a7b7});return{'step':0x6,'label':_0x17410a(0x16d),'ok':_0x5d684d['ok'],'detail':_0x5d684d['ok']?'lovrabet/rabetbase\x20installed\x20globally':_0x5d684d[_0x17410a(0x10e)]??_0x17410a(0x12e)+_0x5d684d['status']};}function execUpgradeSdk(_0x2a1e65){const _0x569ce6=a113_0xab848;if(!_0x2a1e65[_0x569ce6(0x106)])return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':'skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)'};const {pkgPath:_0x3c6698,currentVersion:_0x4c0aa0,field:_0x4da533}=_0x2a1e65[_0x569ce6(0x106)];try{const _0x27c0da=readFileSync(_0x3c6698,'utf8'),_0x1d6aa2=JSON[_0x569ce6(0x12c)](_0x27c0da);return _0x1d6aa2[_0x4da533][_0x569ce6(0xf9)]=_0x569ce6(0x155),writeFileSync(_0x3c6698,JSON[_0x569ce6(0x14d)](_0x1d6aa2,null,0x2)+'\x0a',_0x569ce6(0x103)),{'step':0x7,'label':_0x569ce6(0x10f),'ok':!![],'detail':_0x4da533+_0x569ce6(0x119)+_0x4c0aa0+'\x20→\x20latest'};}catch(_0x1bbe62){return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':![],'detail':_0x1bbe62[_0x569ce6(0x152)]};}}function a113_0x24cf(){const _0x35d445=['Step\x207/7:\x20@lovrabet/sdk\x20—\x20','oldMcpConfig','values','\x20→\x20','push','package.json','isDirectory','files','===\x20Upgrade\x20Analysis\x20===','@lovrabet/sdk','.cursor/mcp.json','\x20\x20npm\x20install','\x20\x20Current\x20version\x20in\x20','devDependencies','configMigration','\x20removed\x20(','7anBMMs','===\x20Upgrade\x20Summary\x20===','.claude/skills/lovrabet','utf8','Step\x201/7:\x20Migrating\x20config...','not\x20found\x20or\x20already\x20at\x20latest','sdkUpgrade','hasNewConfig','Step\x206/7:\x20Installing\x20new\x20skill...','no\x20matching\x20entry\x20found','path','string','@lovrabet/dataset-mcp-server','Proceed\x20with\x20upgrade?','error','Upgrade\x20@lovrabet/sdk','oldArtifacts','Clean\x20MCP\x20config','\x20\x20bun\x20install','removed\x20','no\x20legacy\x20config\x20found','log','label','10cOBHwd','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','[\x22@lovrabet/sdk\x22]:\x20','length','339664DQXvyy','not\x20found\x20(will\x20create)','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','\x20from\x20','mcpServers','2043BAWtNu','FAIL','.lovrabet','\x20→\x20keys:\x20','bold','\x20\x20Fields\x20to\x20migrate:\x20','\x20(backup:\x20','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','yellow','inherit','includes','green','parse','isArray','exit\x20','entries','succeed','Legacy\x20artifacts:','1626jrRcQe','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','cwd','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','white','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','Remove\x20old\x20skill','\x20\x20\x20\x20\x20\x20\x20','not\x20needed','MCP\x20config:','some','no\x20legacy\x20entry','\x20\x20New\x20config\x20(.rabetbase.json):\x20','Step\x204/7:\x20Cleaning\x20MCP\x20config...','\x20\x20Step\x20','lovrabet/rabetbase','keys','2326140wxKxkY','oldPath','lovrabet/lovrabet-skill\x20removed','Config\x20file:','step','detail','Remove\x20.lovrabet/','filter','Step\x204/7:\x20MCP\x20config\x20—\x20','skipped','stringify','Skill\x20swap:','fail','Upgrade\x20completed\x20successfully!','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','message','3551120LOQifd','undefined','latest','none\x20found','.bak','already\x20exists\x20(will\x20merge)','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','1238969byJXIy','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','info','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','Config\x20migration','Upgrade\x20cancelled.','object','Step\x201/7:\x20Config\x20migration\x20—\x20','done','join','start','4830093vAWPMN','dependencies','Remove\x20legacy\x20artifacts','skipped\x20(no\x20legacy\x20config)','red','gray','Install\x20new\x20skill','cyan','2674794oYkDqa','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','failed','args'];a113_0x24cf=function(){return _0x35d445;};return a113_0x24cf();}function a113_0x1d0e(_0x790f13,_0x570c0b){_0x790f13=_0x790f13-0xee;const _0x24cfb7=a113_0x24cf();let _0x1d0e58=_0x24cfb7[_0x790f13];return _0x1d0e58;}function tryStat(_0xa94713){try{return statSync(_0xa94713);}catch{return undefined;}}function printSummary(_0x55c1ef){const _0x4e5cb2=a113_0xab848;console['log'](''),console[_0x4e5cb2(0x115)](a113_0x46b14a[_0x4e5cb2(0x124)](_0x4e5cb2(0x101))),console[_0x4e5cb2(0x115)]('');for(const _0x268fad of _0x55c1ef){const _0x56e873=_0x268fad['ok']?a113_0x46b14a[_0x4e5cb2(0x12b)]('OK'):a113_0x46b14a[_0x4e5cb2(0x16b)](_0x4e5cb2(0x121));console['log']('\x20\x20'+_0x56e873+_0x4e5cb2(0x140)+_0x268fad[_0x4e5cb2(0x147)]+':\x20'+_0x268fad[_0x4e5cb2(0x116)]);if(_0x268fad[_0x4e5cb2(0x148)])console[_0x4e5cb2(0x115)](_0x4e5cb2(0x139)+a113_0x46b14a[_0x4e5cb2(0x16c)](_0x268fad['detail']));}console[_0x4e5cb2(0x115)]('');}export async function upgradeApp(_0x21a106,_0x4c24dc){const _0x4b17a2=a113_0xab848,_0x1a304d=process[_0x4b17a2(0x134)](),_0x65e702=analyse(_0x1a304d),_0x4a0587=!_0x65e702[_0x4b17a2(0xfe)]&&_0x65e702[_0x4b17a2(0x110)][_0x4b17a2(0x11a)]===0x0&&!_0x65e702['oldMcpConfig']&&!_0x65e702['needsSkillSwap']&&!_0x65e702[_0x4b17a2(0x106)];if(_0x4a0587){console[_0x4b17a2(0x115)](a113_0x46b14a[_0x4b17a2(0x12b)](_0x4b17a2(0x11d)));return;}printReport(_0x65e702);const _0x2e242c=!!(_0x4c24dc['yes']||_0x4c24dc['Y']||_0x21a106);if(!_0x2e242c)try{const _0x292edc=await askConfirm(_0x4b17a2(0x10d));if(!_0x292edc){console[_0x4b17a2(0x115)](a113_0x46b14a[_0x4b17a2(0x16c)](_0x4b17a2(0x161)));return;}}catch(_0x1d92c1){if(_0x1d92c1?.[_0x4b17a2(0x152)]==='CANCEL'){console[_0x4b17a2(0x115)](a113_0x46b14a[_0x4b17a2(0x16c)](_0x4b17a2(0x161)));return;}throw _0x1d92c1;}const _0x31cd30=[],_0x15824f=a113_0xf70336({'text':_0x4b17a2(0x104),'color':_0x4b17a2(0x16e)})[_0x4b17a2(0x166)](),_0x54cff6=execConfigMigration(_0x65e702,_0x1a304d);_0x31cd30[_0x4b17a2(0xf4)](_0x54cff6),_0x15824f[_0x54cff6['ok']?_0x4b17a2(0x130):_0x4b17a2(0x14f)](_0x4b17a2(0x163)+(_0x54cff6[_0x4b17a2(0x148)]??(_0x54cff6['ok']?'done':'failed')));const _0x94d27d=resolve(_0x1a304d,_0x4b17a2(0x122)),_0x3d82ce=a113_0xf70336({'text':_0x4b17a2(0x133),'color':_0x4b17a2(0x16e)})[_0x4b17a2(0x166)]();if(existsSync(_0x94d27d))try{rmSync(_0x94d27d,{'recursive':!![],'force':!![]}),_0x3d82ce[_0x4b17a2(0x130)]('Step\x202/7:\x20.lovrabet/\x20directory\x20removed'),_0x31cd30[_0x4b17a2(0xf4)]({'step':0x2,'label':_0x4b17a2(0x149),'ok':!![]});}catch(_0x107493){_0x3d82ce[_0x4b17a2(0x14f)](_0x4b17a2(0x159)+_0x107493[_0x4b17a2(0x152)]),_0x31cd30['push']({'step':0x2,'label':_0x4b17a2(0x149),'ok':![],'detail':_0x107493[_0x4b17a2(0x152)]});}else _0x3d82ce[_0x4b17a2(0x15c)]('Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped'),_0x31cd30[_0x4b17a2(0xf4)]({'step':0x2,'label':_0x4b17a2(0x149),'ok':!![],'detail':_0x4b17a2(0x14c)});const _0x22fc88=a113_0xf70336({'text':_0x4b17a2(0x137),'color':_0x4b17a2(0x16e)})[_0x4b17a2(0x166)](),_0x43e529=execRemoveOldArtifacts(_0x65e702[_0x4b17a2(0x110)]);_0x31cd30[_0x4b17a2(0xf4)](_0x43e529),_0x22fc88[_0x43e529['ok']?_0x4b17a2(0x130):_0x4b17a2(0x14f)](_0x4b17a2(0x15f)+(_0x43e529[_0x4b17a2(0x148)]??(_0x43e529['ok']?_0x4b17a2(0x164):_0x4b17a2(0xee))));const _0x2025b0=a113_0xf70336({'text':_0x4b17a2(0x13f),'color':'cyan'})[_0x4b17a2(0x166)](),_0x2ec069=execCleanMcp(_0x65e702);_0x31cd30[_0x4b17a2(0xf4)](_0x2ec069),_0x2025b0[_0x2ec069['ok']?_0x4b17a2(0x130):_0x4b17a2(0x14f)](_0x4b17a2(0x14b)+(_0x2ec069[_0x4b17a2(0x148)]??(_0x2ec069['ok']?'done':_0x4b17a2(0xee))));const _0x343003=a113_0xf70336({'text':'Step\x205/7:\x20Removing\x20old\x20skill...','color':_0x4b17a2(0x16e)})['start'](),_0x4d2e3d=execSkillsRemove(_0x1a304d,_0x2e242c);_0x31cd30[_0x4b17a2(0xf4)](_0x4d2e3d),_0x343003[_0x4d2e3d['ok']?'succeed':_0x4b17a2(0x14f)](_0x4b17a2(0x127)+(_0x4d2e3d[_0x4b17a2(0x148)]??(_0x4d2e3d['ok']?_0x4b17a2(0x164):_0x4b17a2(0xee))));const _0x42b1dd=a113_0xf70336({'text':_0x4b17a2(0x108),'color':_0x4b17a2(0x16e)})[_0x4b17a2(0x166)](),_0x2b88e0=execSkillsAdd(_0x1a304d,_0x2e242c);_0x31cd30['push'](_0x2b88e0),_0x42b1dd[_0x2b88e0['ok']?_0x4b17a2(0x130):_0x4b17a2(0x14f)](_0x4b17a2(0x15e)+(_0x2b88e0[_0x4b17a2(0x148)]??(_0x2b88e0['ok']?_0x4b17a2(0x164):_0x4b17a2(0xee))));const _0x5077ea=a113_0xf70336({'text':_0x4b17a2(0x135),'color':_0x4b17a2(0x16e)})[_0x4b17a2(0x166)](),_0x1a017b=execUpgradeSdk(_0x65e702);_0x31cd30[_0x4b17a2(0xf4)](_0x1a017b),_0x5077ea[_0x1a017b['ok']?_0x4b17a2(0x130):'fail'](_0x4b17a2(0xf0)+(_0x1a017b['detail']??(_0x1a017b['ok']?'done':_0x4b17a2(0xee)))),printSummary(_0x31cd30);const _0x400e46=_0x31cd30[_0x4b17a2(0x13c)](_0x109311=>!_0x109311['ok']);_0x400e46?console[_0x4b17a2(0x115)](a113_0x46b14a['yellow'](_0x4b17a2(0x118))):console['log'](a113_0x46b14a[_0x4b17a2(0x12b)](_0x4b17a2(0x150))),_0x1a017b['ok']&&_0x65e702['sdkUpgrade']&&(console[_0x4b17a2(0x115)](''),console[_0x4b17a2(0x115)](a113_0x46b14a[_0x4b17a2(0x124)][_0x4b17a2(0x16e)](_0x4b17a2(0x170))),console[_0x4b17a2(0x115)](a113_0x46b14a['cyan']('Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:')),console['log'](''),console[_0x4b17a2(0x115)](a113_0x46b14a[_0x4b17a2(0x136)](_0x4b17a2(0xfb))),console[_0x4b17a2(0x115)](a113_0x46b14a[_0x4b17a2(0x136)]('\x20\x20#\x20or')),console[_0x4b17a2(0x115)](a113_0x46b14a[_0x4b17a2(0x136)](_0x4b17a2(0x112))),console[_0x4b17a2(0x115)](''));}
|
|
1
|
+
const a113_0x236c17=a113_0x4876;(function(_0x4e1104,_0x4ce508){const _0x1618ac=a113_0x4876,_0xd43b92=_0x4e1104();while(!![]){try{const _0x362549=-parseInt(_0x1618ac(0xf9))/0x1+parseInt(_0x1618ac(0xba))/0x2+-parseInt(_0x1618ac(0x11f))/0x3+-parseInt(_0x1618ac(0x10d))/0x4*(parseInt(_0x1618ac(0xd7))/0x5)+-parseInt(_0x1618ac(0xd0))/0x6*(-parseInt(_0x1618ac(0x105))/0x7)+-parseInt(_0x1618ac(0x11c))/0x8*(parseInt(_0x1618ac(0x12f))/0x9)+-parseInt(_0x1618ac(0x117))/0xa*(-parseInt(_0x1618ac(0xc5))/0xb);if(_0x362549===_0x4ce508)break;else _0xd43b92['push'](_0xd43b92['shift']());}catch(_0x414ea9){_0xd43b92['push'](_0xd43b92['shift']());}}}(a113_0x2309,0x3c972));import a113_0x50726f from'chalk';import a113_0x1c7a2f 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[a113_0x236c17(0xd9)](_0x1d82a7=>_0x1d82a7!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x316868){const _0x2f1537=a113_0x236c17,_0x10c5f0=[];for(const _0x341799 of Object[_0x2f1537(0x110)](CORE_IDE_CONFIGS)){if(_0x341799['files'])for(const _0x59243 of _0x341799[_0x2f1537(0xbe)]){_0x10c5f0['push'](resolve(_0x316868,_0x59243['path']));}}return _0x10c5f0;}function analyse(_0x9d4b63){const _0xedd9bf=a113_0x236c17;let _0x4c8515=null;const _0x23bc8f=resolve(_0x9d4b63,NEW_CONFIG_NAME),_0x2981cf=existsSync(_0x23bc8f);for(const _0x16f459 of LEGACY_CONFIG_NAMES){const _0x3089dd=resolve(_0x9d4b63,_0x16f459);if(existsSync(_0x3089dd)){const _0x58099a=readConfigFile(_0x3089dd),_0x391b8f=Object['keys'](_0x58099a)[_0xedd9bf(0xd9)](_0x5b665a=>typeof _0x58099a[_0x5b665a]!==_0xedd9bf(0xcc));_0x4c8515={'oldPath':_0x3089dd,'hasNewConfig':_0x2981cf,'fields':_0x391b8f};break;}}const _0x3479a6=[],_0x336c2c=resolve(_0x9d4b63,_0xedd9bf(0x10c));if(existsSync(_0x336c2c))_0x3479a6[_0xedd9bf(0x100)](_0x336c2c);const _0x1e4470=resolve(_0x9d4b63,_0xedd9bf(0xfb));if(existsSync(_0x1e4470))_0x3479a6[_0xedd9bf(0x100)](_0x1e4470);const _0x29ae28=resolve(_0x9d4b63,_0xedd9bf(0xd5));if(existsSync(_0x29ae28))_0x3479a6[_0xedd9bf(0x100)](_0x29ae28);for(const _0x1d4143 of collectIdeSkillFiles(_0x9d4b63)){if(existsSync(_0x1d4143))_0x3479a6[_0xedd9bf(0x100)](_0x1d4143);}let _0x50db78=null;const _0x1e29a4=resolve(_0x9d4b63,'.cursor/mcp.json');if(existsSync(_0x1e29a4))try{const _0x366210=JSON[_0xedd9bf(0x107)](readFileSync(_0x1e29a4,_0xedd9bf(0x12b)));if(_0x366210?.[_0xedd9bf(0xeb)]&&typeof _0x366210[_0xedd9bf(0xeb)]===_0xedd9bf(0x101)){const _0x221c81=[];for(const [_0xbd0468,_0x4359ba]of Object['entries'](_0x366210['mcpServers'])){const _0x2d62a8=_0x4359ba;_0x2d62a8?.[_0xedd9bf(0x11d)]&&Array[_0xedd9bf(0xe9)](_0x2d62a8[_0xedd9bf(0x11d)])&&_0x2d62a8['args'][_0xedd9bf(0x127)](_0x3377ea=>typeof _0x3377ea===_0xedd9bf(0xda)&&_0x3377ea[_0xedd9bf(0xb9)]('@lovrabet/dataset-mcp-server'))&&_0x221c81[_0xedd9bf(0x100)](_0xbd0468);}_0x221c81[_0xedd9bf(0xc9)]>0x0&&(_0x50db78={'path':_0x1e29a4,'keys':_0x221c81});}}catch{}const _0x3c1008=_0x3479a6[_0xedd9bf(0xc9)]>0x0||_0x4c8515!==null;let _0x2f95b7=null;const _0x494a9c=resolve(_0x9d4b63,_0xedd9bf(0x130));if(existsSync(_0x494a9c))try{const _0x3370ed=JSON['parse'](readFileSync(_0x494a9c,'utf8'));for(const _0x452d60 of[_0xedd9bf(0xe6),'devDependencies']){const _0x866d81=_0x3370ed?.[_0x452d60]?.[_0xedd9bf(0x120)];if(typeof _0x866d81===_0xedd9bf(0xda)){_0x866d81!=='latest'&&(_0x2f95b7={'pkgPath':_0x494a9c,'currentVersion':_0x866d81,'field':_0x452d60});break;}}}catch{}return{'configMigration':_0x4c8515,'oldArtifacts':_0x3479a6,'oldMcpConfig':_0x50db78,'needsSkillSwap':_0x3c1008,'sdkUpgrade':_0x2f95b7};}function printReport(_0x3894a8){const _0x3eed1c=a113_0x236c17,{configMigration:_0x4eb6ed,oldArtifacts:_0x6e6119,oldMcpConfig:_0x110047,needsSkillSwap:_0x1a73e7}=_0x3894a8;console['log'](''),console[_0x3eed1c(0x132)](a113_0x50726f[_0x3eed1c(0xf2)](_0x3eed1c(0x12d))),console[_0x3eed1c(0x132)]('');_0x4eb6ed?(console[_0x3eed1c(0x132)](a113_0x50726f[_0x3eed1c(0x104)](_0x3eed1c(0xd8))+('\x20\x20'+a113_0x50726f['yellow'](_0x4eb6ed[_0x3eed1c(0xd3)]))),console['log'](_0x3eed1c(0xf1)+(_0x4eb6ed[_0x3eed1c(0x12a)]?a113_0x50726f[_0x3eed1c(0xe8)](_0x3eed1c(0x131)):a113_0x50726f[_0x3eed1c(0xbd)]('not\x20found\x20(will\x20create)'))),console['log'](_0x3eed1c(0xd1)+_0x4eb6ed[_0x3eed1c(0x119)]['join'](',\x20')),console[_0x3eed1c(0x132)]('\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak')):console[_0x3eed1c(0x132)](a113_0x50726f[_0x3eed1c(0x104)]('Config\x20file:')+'\x20\x20'+a113_0x50726f[_0x3eed1c(0xbd)](_0x3eed1c(0xe2)));console[_0x3eed1c(0x132)]('');if(_0x6e6119['length']>0x0){console[_0x3eed1c(0x132)](a113_0x50726f[_0x3eed1c(0x104)]('Legacy\x20artifacts:'));for(const _0x164b4a of _0x6e6119){console[_0x3eed1c(0x132)]('\x20\x20'+a113_0x50726f['red']('FOUND')+'\x20\x20'+_0x164b4a);}console[_0x3eed1c(0x132)](_0x3eed1c(0xef));}else console[_0x3eed1c(0x132)](a113_0x50726f[_0x3eed1c(0x104)](_0x3eed1c(0xcb))+'\x20\x20'+a113_0x50726f[_0x3eed1c(0xbd)](_0x3eed1c(0x109)));console[_0x3eed1c(0x132)]('');_0x110047?(console[_0x3eed1c(0x132)](a113_0x50726f[_0x3eed1c(0x104)](_0x3eed1c(0x103))+('\x20\x20'+a113_0x50726f[_0x3eed1c(0x10a)](_0x110047[_0x3eed1c(0x10b)])+'\x20→\x20keys:\x20'+_0x110047['keys'][_0x3eed1c(0x10f)](',\x20'))),console[_0x3eed1c(0x132)](_0x3eed1c(0x11b))):console[_0x3eed1c(0x132)](a113_0x50726f[_0x3eed1c(0x104)](_0x3eed1c(0x103))+'\x20\x20'+a113_0x50726f['gray'](_0x3eed1c(0xe4)));console[_0x3eed1c(0x132)](''),console[_0x3eed1c(0x132)](a113_0x50726f[_0x3eed1c(0x104)](_0x3eed1c(0x118))+('\x20\x20'+(_0x1a73e7?a113_0x50726f['yellow'](_0x3eed1c(0x136)):a113_0x50726f[_0x3eed1c(0xe8)](_0x3eed1c(0xfa)))));_0x1a73e7&&console[_0x3eed1c(0x132)]('\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`'+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x3eed1c(0x132)]('');if(_0x3894a8[_0x3eed1c(0x124)]){const {currentVersion:_0x3b90e8,field:_0x2cb8dd,pkgPath:_0x5d6620}=_0x3894a8[_0x3eed1c(0x124)];console['log'](a113_0x50726f[_0x3eed1c(0x104)](_0x3eed1c(0xf7))+('\x20\x20'+a113_0x50726f[_0x3eed1c(0x10a)](_0x5d6620))),console[_0x3eed1c(0x132)](_0x3eed1c(0xea)+_0x2cb8dd+':\x20'+a113_0x50726f[_0x3eed1c(0x10a)](_0x3b90e8)+_0x3eed1c(0xb8)+a113_0x50726f[_0x3eed1c(0xe8)]('latest')),console[_0x3eed1c(0x132)]('\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)');}else console['log'](a113_0x50726f[_0x3eed1c(0x104)](_0x3eed1c(0xf7))+'\x20\x20'+a113_0x50726f[_0x3eed1c(0xbd)]('not\x20found\x20or\x20already\x20at\x20latest'));console[_0x3eed1c(0x132)]('');}function execConfigMigration(_0x2cc2a5,_0x49bb42){const _0x2b82bc=a113_0x236c17,{configMigration:_0x1de183}=_0x2cc2a5;if(!_0x1de183?.[_0x2b82bc(0xd3)])return{'step':0x1,'label':_0x2b82bc(0xf3),'ok':!![],'detail':_0x2b82bc(0xde)};const _0x1663ed=readConfigFile(_0x1de183[_0x2b82bc(0xd3)]),_0x133c54=resolve(_0x49bb42,NEW_CONFIG_NAME),_0x1e63ee=_0x1de183[_0x2b82bc(0x12a)]?readConfigFile(_0x133c54):{};for(const [_0x138af1,_0x339046]of Object[_0x2b82bc(0xd6)](_0x1663ed)){!(_0x138af1 in _0x1e63ee)&&(_0x1e63ee[_0x138af1]=_0x339046);}writeConfigFile(_0x133c54,_0x1e63ee);const _0x10fd0e=_0x1de183[_0x2b82bc(0xd3)]+_0x2b82bc(0xd2);return renameSync(_0x1de183[_0x2b82bc(0xd3)],_0x10fd0e),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x1de183[_0x2b82bc(0xd3)]+_0x2b82bc(0xb8)+_0x133c54+_0x2b82bc(0x116)+_0x10fd0e+')'};}function execRemoveOldArtifacts(_0x510fa7){const _0x1b6d90=a113_0x236c17,_0x1a0135=[];for(const _0x49130e of _0x510fa7){try{if(!existsSync(_0x49130e))continue;const _0x617d7a=tryStat(_0x49130e);_0x617d7a?.['isDirectory']()?rmSync(_0x49130e,{'recursive':!![],'force':!![]}):unlinkSync(_0x49130e);}catch(_0x245ad4){_0x1a0135[_0x1b6d90(0x100)](_0x49130e+':\x20'+_0x245ad4['message']);}}return{'step':0x3,'label':'Remove\x20legacy\x20artifacts','ok':_0x1a0135['length']===0x0,'detail':_0x1a0135[_0x1b6d90(0xc9)]>0x0?_0x510fa7[_0x1b6d90(0xc9)]-_0x1a0135[_0x1b6d90(0xc9)]+'/'+_0x510fa7[_0x1b6d90(0xc9)]+_0x1b6d90(0xc8)+_0x1a0135[_0x1b6d90(0x10f)](';\x20')+')':_0x510fa7[_0x1b6d90(0xc9)]+'\x20removed'};}function a113_0x4876(_0x18069a,_0x129eb2){_0x18069a=_0x18069a-0xb7;const _0x2309e1=a113_0x2309();let _0x487610=_0x2309e1[_0x18069a];return _0x487610;}function execCleanMcp(_0x287061){const _0x5793dd=a113_0x236c17;if(!_0x287061[_0x5793dd(0x108)])return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x5793dd(0x128)};try{const _0xfde506=readFileSync(_0x287061[_0x5793dd(0x108)][_0x5793dd(0x10b)],_0x5793dd(0x12b)),_0x136700=JSON[_0x5793dd(0x107)](_0xfde506);if(_0x136700?.[_0x5793dd(0xeb)]&&typeof _0x136700[_0x5793dd(0xeb)]===_0x5793dd(0x101)){const _0xedb496=[];for(const [_0x136a45,_0x333f11]of Object['entries'](_0x136700['mcpServers'])){_0x333f11?.[_0x5793dd(0x11d)]&&Array['isArray'](_0x333f11[_0x5793dd(0x11d)])&&_0x333f11[_0x5793dd(0x11d)][_0x5793dd(0x127)](_0x4fca91=>typeof _0x4fca91===_0x5793dd(0xda)&&_0x4fca91['includes'](_0x5793dd(0xdd)))&&_0xedb496['push'](_0x136a45);}for(const _0x29de6a of _0xedb496){delete _0x136700[_0x5793dd(0xeb)][_0x29de6a];}return _0xedb496['length']>0x0&&writeFileSync(_0x287061[_0x5793dd(0x108)][_0x5793dd(0x10b)],JSON[_0x5793dd(0x123)](_0x136700,null,0x2)+'\x0a',_0x5793dd(0x12b)),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x5793dd(0x134)+_0xedb496['join'](',\x20')+_0x5793dd(0xfd)+_0x287061[_0x5793dd(0x108)][_0x5793dd(0x10b)]};}return{'step':0x4,'label':_0x5793dd(0x135),'ok':!![],'detail':_0x5793dd(0x10e)};}catch(_0x48438f){return{'step':0x4,'label':_0x5793dd(0x135),'ok':![],'detail':_0x48438f[_0x5793dd(0xe5)]};}}function execSkillsRemove(_0x571d07,_0x344d7b){const _0x52c607=a113_0x236c17,_0x1e8931=runNpxSkillsRemove(_0x571d07,{'stdio':'inherit','yes':_0x344d7b});return{'step':0x5,'label':_0x52c607(0xcd),'ok':_0x1e8931['ok'],'detail':_0x1e8931['ok']?'lovrabet/lovrabet-skill\x20removed':_0x1e8931[_0x52c607(0xe3)]??_0x52c607(0x121)+_0x1e8931['status']};}function a113_0x2309(){const _0x5c1735=['\x20from\x20','Install\x20new\x20skill','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','push','object','fail','MCP\x20config:','cyan','7KSNysj','lovrabet/rabetbase\x20installed\x20globally','parse','oldMcpConfig','none\x20found','yellow','path','.lovrabet','40ydWwQx','no\x20matching\x20entry\x20found','join','values','white','start','Step\x201/7:\x20Migrating\x20config...','Upgrade\x20@lovrabet/sdk','done','\x20(backup:\x20','250WyeJhl','Skill\x20swap:','fields','\x20→\x20latest','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','8OmpQoO','args','yes','755382dgdNfU','@lovrabet/sdk','exit\x20','Step\x204/7:\x20Cleaning\x20MCP\x20config...','stringify','sdkUpgrade','\x20\x20bun\x20install','red','some','skipped','\x20\x20npm\x20install','hasNewConfig','utf8','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','===\x20Upgrade\x20Analysis\x20===','oldArtifacts','1197702VzLQzQ','package.json','already\x20exists\x20(will\x20merge)','log','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','removed\x20','Clean\x20MCP\x20config','needed','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','\x20→\x20','includes','321636uLuszJ','detail','CANCEL','gray','files','failed','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','Step\x206/7:\x20Installing\x20new\x20skill...','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','latest','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','364859FPuLLe','Remove\x20.lovrabet/','===\x20Upgrade\x20Summary\x20===','\x20removed\x20(','length','inherit','Legacy\x20artifacts:','undefined','Remove\x20old\x20skill','Upgrade\x20completed\x20successfully!','configMigration','1678440nKiDSO','\x20\x20Fields\x20to\x20migrate:\x20','.bak','oldPath','\x20\x20\x20\x20\x20\x20\x20','.claude/skills/lovrabet','entries','74695bExOmL','Config\x20file:','filter','string','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','Step\x201/7:\x20Config\x20migration\x20—\x20','@lovrabet/dataset-mcp-server','skipped\x20(no\x20legacy\x20config)','\x20\x20Step\x20','needsSkillSwap','\x20\x20#\x20or','no\x20legacy\x20config\x20found','error','no\x20legacy\x20entry','message','dependencies','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','green','isArray','\x20\x20Current\x20version\x20in\x20','mcpServers','succeed','[\x22@lovrabet/sdk\x22]:\x20','FAIL','\x20\x20Action:\x20delete','cwd','\x20\x20New\x20config\x20(.rabetbase.json):\x20','bold','Config\x20migration','Upgrade\x20cancelled.','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','@lovrabet/sdk:','lovrabet/rabetbase','487343RcwRIA','not\x20needed','.cursor/rules/lovrabet_rules.mdc','label'];a113_0x2309=function(){return _0x5c1735;};return a113_0x2309();}function execSkillsAdd(_0x52c78a,_0x4ffc02){const _0x33eca4=a113_0x236c17,_0x1bb8f1=runNpxSkillsAddGlobal(_0x52c78a,_0x33eca4(0xf8),{'stdio':_0x33eca4(0xca),'yes':_0x4ffc02});return{'step':0x6,'label':_0x33eca4(0xfe),'ok':_0x1bb8f1['ok'],'detail':_0x1bb8f1['ok']?_0x33eca4(0x106):_0x1bb8f1[_0x33eca4(0xe3)]??_0x33eca4(0x121)+_0x1bb8f1['status']};}function execUpgradeSdk(_0x355709){const _0x145a9f=a113_0x236c17;if(!_0x355709[_0x145a9f(0x124)])return{'step':0x7,'label':_0x145a9f(0x114),'ok':!![],'detail':_0x145a9f(0xf5)};const {pkgPath:_0x4b1645,currentVersion:_0x106ada,field:_0x2c7461}=_0x355709[_0x145a9f(0x124)];try{const _0x3fdd0e=readFileSync(_0x4b1645,_0x145a9f(0x12b)),_0x51a982=JSON['parse'](_0x3fdd0e);return _0x51a982[_0x2c7461]['@lovrabet/sdk']=_0x145a9f(0xc3),writeFileSync(_0x4b1645,JSON['stringify'](_0x51a982,null,0x2)+'\x0a',_0x145a9f(0x12b)),{'step':0x7,'label':_0x145a9f(0x114),'ok':!![],'detail':_0x2c7461+_0x145a9f(0xed)+_0x106ada+_0x145a9f(0x11a)};}catch(_0x189e20){return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':![],'detail':_0x189e20[_0x145a9f(0xe5)]};}}function tryStat(_0x48dcc9){try{return statSync(_0x48dcc9);}catch{return undefined;}}function printSummary(_0x2ced3e){const _0x2d8d61=a113_0x236c17;console['log'](''),console[_0x2d8d61(0x132)](a113_0x50726f['bold'](_0x2d8d61(0xc7))),console['log']('');for(const _0x2f2e54 of _0x2ced3e){const _0x2dfa93=_0x2f2e54['ok']?a113_0x50726f[_0x2d8d61(0xe8)]('OK'):a113_0x50726f[_0x2d8d61(0x126)](_0x2d8d61(0xee));console[_0x2d8d61(0x132)]('\x20\x20'+_0x2dfa93+_0x2d8d61(0xdf)+_0x2f2e54['step']+':\x20'+_0x2f2e54[_0x2d8d61(0xfc)]);if(_0x2f2e54['detail'])console[_0x2d8d61(0x132)](_0x2d8d61(0xd4)+a113_0x50726f[_0x2d8d61(0xbd)](_0x2f2e54[_0x2d8d61(0xbb)]));}console[_0x2d8d61(0x132)]('');}export async function upgradeApp(_0x10b483,_0x5c471c){const _0x2800a7=a113_0x236c17,_0x26cfa8=process[_0x2800a7(0xf0)](),_0xab9d36=analyse(_0x26cfa8),_0x181ff9=!_0xab9d36[_0x2800a7(0xcf)]&&_0xab9d36['oldArtifacts'][_0x2800a7(0xc9)]===0x0&&!_0xab9d36['oldMcpConfig']&&!_0xab9d36[_0x2800a7(0xe0)]&&!_0xab9d36['sdkUpgrade'];if(_0x181ff9){console[_0x2800a7(0x132)](a113_0x50726f[_0x2800a7(0xe8)]('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0xab9d36);const _0x1b73e5=!!(_0x5c471c[_0x2800a7(0x11e)]||_0x5c471c['Y']||_0x10b483);if(!_0x1b73e5)try{const _0x1db007=await askConfirm('Proceed\x20with\x20upgrade?');if(!_0x1db007){console[_0x2800a7(0x132)](a113_0x50726f[_0x2800a7(0xbd)]('Upgrade\x20cancelled.'));return;}}catch(_0x4efe4c){if(_0x4efe4c?.[_0x2800a7(0xe5)]===_0x2800a7(0xbc)){console[_0x2800a7(0x132)](a113_0x50726f[_0x2800a7(0xbd)](_0x2800a7(0xf4)));return;}throw _0x4efe4c;}const _0x421b8e=[],_0xd103c1=a113_0x1c7a2f({'text':_0x2800a7(0x113),'color':_0x2800a7(0x104)})[_0x2800a7(0x112)](),_0x501af5=execConfigMigration(_0xab9d36,_0x26cfa8);_0x421b8e['push'](_0x501af5),_0xd103c1[_0x501af5['ok']?'succeed':_0x2800a7(0x102)](_0x2800a7(0xdc)+(_0x501af5[_0x2800a7(0xbb)]??(_0x501af5['ok']?_0x2800a7(0x115):_0x2800a7(0xbf))));const _0x4c2ab6=resolve(_0x26cfa8,'.lovrabet'),_0x2eac42=a113_0x1c7a2f({'text':_0x2800a7(0x133),'color':_0x2800a7(0x104)})[_0x2800a7(0x112)]();if(existsSync(_0x4c2ab6))try{rmSync(_0x4c2ab6,{'recursive':!![],'force':!![]}),_0x2eac42[_0x2800a7(0xec)](_0x2800a7(0xb7)),_0x421b8e[_0x2800a7(0x100)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x202da3){_0x2eac42['fail']('Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20'+_0x202da3[_0x2800a7(0xe5)]),_0x421b8e[_0x2800a7(0x100)]({'step':0x2,'label':_0x2800a7(0xc6),'ok':![],'detail':_0x202da3[_0x2800a7(0xe5)]});}else _0x2eac42['info']('Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped'),_0x421b8e[_0x2800a7(0x100)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![],'detail':_0x2800a7(0x128)});const _0x1b0cd2=a113_0x1c7a2f({'text':_0x2800a7(0xc0),'color':_0x2800a7(0x104)})[_0x2800a7(0x112)](),_0xa63b79=execRemoveOldArtifacts(_0xab9d36[_0x2800a7(0x12e)]);_0x421b8e[_0x2800a7(0x100)](_0xa63b79),_0x1b0cd2[_0xa63b79['ok']?_0x2800a7(0xec):_0x2800a7(0x102)](_0x2800a7(0xc4)+(_0xa63b79[_0x2800a7(0xbb)]??(_0xa63b79['ok']?_0x2800a7(0x115):'failed')));const _0x2c2752=a113_0x1c7a2f({'text':_0x2800a7(0x122),'color':_0x2800a7(0x104)})[_0x2800a7(0x112)](),_0x2e8bcb=execCleanMcp(_0xab9d36);_0x421b8e[_0x2800a7(0x100)](_0x2e8bcb),_0x2c2752[_0x2e8bcb['ok']?'succeed':_0x2800a7(0x102)]('Step\x204/7:\x20MCP\x20config\x20—\x20'+(_0x2e8bcb[_0x2800a7(0xbb)]??(_0x2e8bcb['ok']?'done':_0x2800a7(0xbf))));const _0x191186=a113_0x1c7a2f({'text':'Step\x205/7:\x20Removing\x20old\x20skill...','color':_0x2800a7(0x104)})[_0x2800a7(0x112)](),_0x4cea30=execSkillsRemove(_0x26cfa8,_0x1b73e5);_0x421b8e[_0x2800a7(0x100)](_0x4cea30),_0x191186[_0x4cea30['ok']?_0x2800a7(0xec):_0x2800a7(0x102)](_0x2800a7(0xf6)+(_0x4cea30['detail']??(_0x4cea30['ok']?'done':'failed')));const _0x4668af=a113_0x1c7a2f({'text':_0x2800a7(0xc1),'color':_0x2800a7(0x104)})[_0x2800a7(0x112)](),_0x32d7a2=execSkillsAdd(_0x26cfa8,_0x1b73e5);_0x421b8e[_0x2800a7(0x100)](_0x32d7a2),_0x4668af[_0x32d7a2['ok']?_0x2800a7(0xec):'fail'](_0x2800a7(0xe7)+(_0x32d7a2[_0x2800a7(0xbb)]??(_0x32d7a2['ok']?_0x2800a7(0x115):'failed')));const _0x4beab1=a113_0x1c7a2f({'text':_0x2800a7(0xff),'color':'cyan'})[_0x2800a7(0x112)](),_0x4e3943=execUpgradeSdk(_0xab9d36);_0x421b8e['push'](_0x4e3943),_0x4beab1[_0x4e3943['ok']?'succeed':_0x2800a7(0x102)](_0x2800a7(0x12c)+(_0x4e3943[_0x2800a7(0xbb)]??(_0x4e3943['ok']?'done':'failed'))),printSummary(_0x421b8e);const _0x5ea6fb=_0x421b8e['some'](_0x1b479a=>!_0x1b479a['ok']);_0x5ea6fb?console[_0x2800a7(0x132)](a113_0x50726f['yellow'](_0x2800a7(0xc2))):console[_0x2800a7(0x132)](a113_0x50726f[_0x2800a7(0xe8)](_0x2800a7(0xce))),_0x4e3943['ok']&&_0xab9d36[_0x2800a7(0x124)]&&(console[_0x2800a7(0x132)](''),console['log'](a113_0x50726f['bold'][_0x2800a7(0x104)]('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console[_0x2800a7(0x132)](a113_0x50726f[_0x2800a7(0x104)](_0x2800a7(0xdb))),console[_0x2800a7(0x132)](''),console[_0x2800a7(0x132)](a113_0x50726f[_0x2800a7(0x111)](_0x2800a7(0x129))),console[_0x2800a7(0x132)](a113_0x50726f['white'](_0x2800a7(0xe1))),console[_0x2800a7(0x132)](a113_0x50726f[_0x2800a7(0x111)](_0x2800a7(0x125))),console[_0x2800a7(0x132)](''));}
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a114_0x5791d8=a114_0x564b;(function(_0x1ccf17,_0x27fe66){const _0x4d96e7=a114_0x564b,_0x318cbb=_0x1ccf17();while(!![]){try{const _0x19ccc9=parseInt(_0x4d96e7(0x110))/0x1+-parseInt(_0x4d96e7(0x10f))/0x2*(parseInt(_0x4d96e7(0x112))/0x3)+parseInt(_0x4d96e7(0x138))/0x4+-parseInt(_0x4d96e7(0x11a))/0x5*(-parseInt(_0x4d96e7(0x11c))/0x6)+-parseInt(_0x4d96e7(0x121))/0x7+-parseInt(_0x4d96e7(0x131))/0x8*(-parseInt(_0x4d96e7(0x12d))/0x9)+-parseInt(_0x4d96e7(0x140))/0xa;if(_0x19ccc9===_0x27fe66)break;else _0x318cbb['push'](_0x318cbb['shift']());}catch(_0x1a49a0){_0x318cbb['push'](_0x318cbb['shift']());}}}(a114_0x2157,0x546bc));import{apiDefinitions}from'../commands/api/index.js';import{bffDefinitions}from'../commands/bff/index.js';import{sqlDefinitions}from'../commands/sql/index.js';import{datasetDefinitions}from'../commands/dataset/index.js';import{pageDefinitions}from'../commands/page/index.js';import{dataDefinitions}from'../commands/data/index.js';import{dbDefinitions}from'../commands/db/index.js';import{codegenDefinitions}from'../commands/codegen/index.js';import{menuDefinitions}from'../commands/menu/index.js';import{appDefinitions}from'../commands/app/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';function a114_0x564b(_0x5b0c7b,_0x3e1e74){_0x5b0c7b=_0x5b0c7b-0x10d;const _0x21571d=a114_0x2157();let _0x564ba2=_0x21571d[_0x5b0c7b];return _0x564ba2;}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(_0x3b75f6){const _0x3f80da=a114_0x564b;for(const _0x51ce8c of _0x3b75f6){definitions[_0x3f80da(0x127)](_0x51ce8c['service']+':'+_0x51ce8c[_0x3f80da(0x13f)],_0x51ce8c);let _0x160239=serviceGroups[_0x3f80da(0x141)](_0x51ce8c[_0x3f80da(0x137)]);!_0x160239&&(_0x160239=[],serviceGroups[_0x3f80da(0x127)](_0x51ce8c[_0x3f80da(0x137)],_0x160239)),_0x160239[_0x3f80da(0x13e)](_0x51ce8c);}}function registerDeclarativeService(_0x131b58,_0x542731,_0x3229bb){const _0x568b94=a114_0x564b;registerDefinitions(_0x542731);_0x3229bb?.['wildcardDef']&®isterDefinitions([_0x3229bb[_0x568b94(0x113)]]);const _0x2263ae=_0x32b17d=>_0x32b17d===_0x568b94(0x13d)?'':_0x32b17d===_0x568b94(0x123)?_0x568b94(0x120):_0x568b94(0x146),_0x35db23={'service':_0x542731[0x0][_0x568b94(0x137)],'label':_0x131b58,'commands':_0x542731[_0x568b94(0x12c)](_0x1deecc=>({'command':_0x1deecc[_0x568b94(0x13f)],'description':_0x1deecc[_0x568b94(0x128)],'tag':_0x2263ae(_0x1deecc[_0x568b94(0x111)])})),'declarative':!![],'defaultCommand':_0x3229bb?.[_0x568b94(0x13c)]??(_0x3229bb?.[_0x568b94(0x136)]?_0x542731[0x0][_0x568b94(0x13f)]:undefined),'wildcardDef':_0x3229bb?.[_0x568b94(0x113)],'isSingleCommand':_0x3229bb?.[_0x568b94(0x136)]};serviceRegistry['push'](_0x35db23),serviceByName[_0x568b94(0x127)](_0x35db23[_0x568b94(0x137)],_0x35db23);}registerDeclarativeService(a114_0x5791d8(0x122),initDefinitions,{'defaultCommand':a114_0x5791d8(0x135),'isSingleCommand':!![]}),registerDeclarativeService(a114_0x5791d8(0x132),projectDefinitions),registerDeclarativeService(a114_0x5791d8(0x119),appDefinitions),registerDeclarativeService(a114_0x5791d8(0x143),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry[a114_0x5791d8(0x12e)]-0x1];last[a114_0x5791d8(0x11e)]=[{'command':a114_0x5791d8(0x130),'description':a114_0x5791d8(0x12f),'tag':''}];}registerDeclarativeService(a114_0x5791d8(0x129),authDefinitions,{'defaultCommand':'login'}),registerDeclarativeService(a114_0x5791d8(0x11f),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a114_0x5791d8(0x118),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a114_0x5791d8(0x10d),configDefinitions),registerDeclarativeService(a114_0x5791d8(0x134),issueDefinitions),registerDeclarativeService(a114_0x5791d8(0x12a),apiDefinitions),registerDeclarativeService('Menu',menuDefinitions),registerDeclarativeService('Database\x20Connections',dbDefinitions),registerDeclarativeService('Dataset\x20&\x20Operations',datasetDefinitions),registerDeclarativeService(a114_0x5791d8(0x11d),pageDefinitions),registerDeclarativeService(a114_0x5791d8(0x139),dataDefinitions),registerDeclarativeService(a114_0x5791d8(0x145),bffDefinitions),registerDeclarativeService(a114_0x5791d8(0x10e),sqlDefinitions),registerDeclarativeService(a114_0x5791d8(0x133),codegenDefinitions),registerDeclarativeService(a114_0x5791d8(0x13a),skillDefinitions),registerDeclarativeService(a114_0x5791d8(0x116),logsDefinitions,{'defaultCommand':'show'});export const deprecatedAliases={'create':{'service':a114_0x5791d8(0x114),'command':a114_0x5791d8(0x124)},'start':{'service':a114_0x5791d8(0x135),'command':a114_0x5791d8(0x13b)},'build':{'service':a114_0x5791d8(0x135),'command':a114_0x5791d8(0x142)},'preview':{'service':'run','command':a114_0x5791d8(0x115)},'logout':{'service':a114_0x5791d8(0x11b),'command':a114_0x5791d8(0x117)},'skills':{'service':a114_0x5791d8(0x12b),'command':a114_0x5791d8(0x125)}};function a114_0x2157(){const _0x12ec04=['Run\x20Scripts','from','BFF\x20Scripts','\x20\x20[high-risk-write]','Configuration','SQL\x20Queries','182822BvFkPj','421643GqdkcR','risk','12TIavfy','wildcardDef','project','preview','Logs','logout','Schema','App\x20Management','181480VHlyXL','auth','108sKQHbV','Smart\x20List\x20Pages','commands','Self\x20Update','\x20\x20[write]','3623403CUojMF','Quick\x20Start','write','create','install','has','set','description','Authentication','API','skill','map','288YbmXiU','length','Run\x20any\x20package.json\x20script','<script>','57672UKsivd','Project','Code\x20Generation','Platform\x20Issue','run','isSingleCommand','service','2117384VpoqOh','Instant\x20API','Skills','start','defaultCommand','read','push','command','6059440zdjTpg','get','build'];a114_0x2157=function(){return _0x12ec04;};return a114_0x2157();}export const deprecatedSubcommands={'bff':{'new':a114_0x5791d8(0x124)},'sql':{'new':'create'}};export function resolveDeprecatedSubcommand(_0x4e1753,_0x4243de){return deprecatedSubcommands[_0x4e1753]?.[_0x4243de];}export function findDefinition(_0x404180,_0x75b849){return definitions['get'](_0x404180+':'+_0x75b849);}export function isKnownService(_0xf60c18){const _0x12c898=a114_0x5791d8;return serviceByName[_0x12c898(0x126)](_0xf60c18);}export function isDeclarativeService(_0x21b4c5){const _0x768df7=a114_0x5791d8;return serviceGroups['has'](_0x21b4c5)||serviceByName[_0x768df7(0x141)](_0x21b4c5)?.[_0x768df7(0x113)]!==undefined;}export function getServiceEntry(_0x136ea1){const _0x1a77b6=a114_0x5791d8;return serviceByName[_0x1a77b6(0x141)](_0x136ea1);}export function getLegacyHandler(_0x539382,_0x568946){return undefined;}export function getAllDefinitions(){const _0xec9b2b=a114_0x5791d8;return Array[_0xec9b2b(0x144)](definitions['values']());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a115_0xc0216d=a115_0x1262;(function(_0x50cbb0,_0x27c7cb){const _0x14b44d=a115_0x1262,_0x143af3=_0x50cbb0();while(!![]){try{const _0x2f27df=parseInt(_0x14b44d(0x123))/0x1+parseInt(_0x14b44d(0x11d))/0x2+parseInt(_0x14b44d(0x144))/0x3*(parseInt(_0x14b44d(0x149))/0x4)+-parseInt(_0x14b44d(0x11a))/0x5*(parseInt(_0x14b44d(0x13d))/0x6)+-parseInt(_0x14b44d(0x152))/0x7*(parseInt(_0x14b44d(0x151))/0x8)+-parseInt(_0x14b44d(0x131))/0x9*(-parseInt(_0x14b44d(0x12e))/0xa)+parseInt(_0x14b44d(0x13b))/0xb;if(_0x2f27df===_0x27c7cb)break;else _0x143af3['push'](_0x143af3['shift']());}catch(_0x3ba29a){_0x143af3['push'](_0x143af3['shift']());}}}(a115_0x4539,0x867d3));import{readFileSync,existsSync}from'node:fs';function a115_0x4539(){const _0x3842a8=['vite','pnpm','13504jDPUeF','close','max','\x20\x20EXAMPLES','bun.lock','belowMinimum','preview','cwd','1055504ZfHCmr','28SXMYkv','\x20run\x20','bun.lockb','log','\x20run\x20preview','join','--watch','.bin','\x0a\x20\x20Available\x20scripts:\x0a','\x20run\x20build','dev','push','bun','read','485LAWMBh','needsUpgrade','error','777598mJbiVr','boolean','inherit','has','run','length','257209czRlHW','scripts','Script\x20name\x20defined\x20in\x20package.json','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','vite\x20preview\x20exited\x20with\x20code\x20','all','\x20run\x20preview\x20--watch\x20\x20\x20#\x20parallel\x20build\x20--watch\x20+\x20preview','node_modules','Run\x20a\x20package.json\x20script','\x20run\x20start','package.json','610yyQImk','build','slice','5634RBqVzW','args','script','padEnd','Available:\x20','keys','utf-8','pnpm-lock.yaml','\x20\x20\x20\x20','validation','5616666cFvWrc','bool','10110CHhoRa','entries','No\x20scripts\x20defined\x20in\x20package.json.','start','map','parse','No\x20package.json\x20found\x20in\x20current\x20directory.','42WdXCRS','watch','Enable\x20watch\x20mode\x20for\x20preview'];a115_0x4539=function(){return _0x3842a8;};return a115_0x4539();}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([a115_0xc0216d(0x140),a115_0xc0216d(0x116)]);function readPackageScripts(_0x574aee){const _0x778a7f=a115_0xc0216d,_0x1f10bd=resolve(_0x574aee,_0x778a7f(0x12d));if(!existsSync(_0x1f10bd))return null;try{const _0x4d51b1=JSON[_0x778a7f(0x142)](readFileSync(_0x1f10bd,_0x778a7f(0x137)));return _0x4d51b1[_0x778a7f(0x124)]??{};}catch{return null;}}function detectPackageManager(_0x260ba2){const _0x3f0d68=a115_0xc0216d;if(existsSync(resolve(_0x260ba2,_0x3f0d68(0x10e)))||existsSync(resolve(_0x260ba2,_0x3f0d68(0x14d))))return _0x3f0d68(0x118);if(existsSync(resolve(_0x260ba2,_0x3f0d68(0x138))))return _0x3f0d68(0x148);if(existsSync(resolve(_0x260ba2,'yarn.lock')))return'yarn';return'npm';}async function versionCheck(_0x5d075d){const _0x2439e2=a115_0xc0216d,_0x5e3d02=await checkCliVersion();(_0x5e3d02[_0x2439e2(0x11b)]||_0x5e3d02[_0x2439e2(0x14e)])&&(printCliUpgradeWarning(_0x5e3d02),assertCliVersionSupported(_0x5e3d02));const _0x23bc0d=await checkSdkVersion(_0x5d075d);if(_0x23bc0d['needsUpgrade'])printSdkUpgradeWarning(_0x23bc0d);}function spawnScript(_0x3955fe,_0x23b43f,_0x232793,_0x2c9b13){return new Promise((_0x5750af,_0x152d77)=>{const _0x732a4b=a115_0x1262,_0x124315=[_0x732a4b(0x121),_0x23b43f,..._0x232793],_0x1f0727=spawn(_0x3955fe,_0x124315,{'cwd':_0x2c9b13,'stdio':_0x732a4b(0x11f),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2c9b13,'node_modules','.bin')+delimiter+process.env.PATH}});_0x1f0727['on'](_0x732a4b(0x14a),_0x276d64=>{const _0x26d896=_0x732a4b;if(_0x276d64===0x0||_0x276d64===null)_0x5750af();else _0x152d77(new Error(_0x3955fe+_0x26d896(0x153)+_0x23b43f+'\x20exited\x20with\x20code\x20'+_0x276d64));}),_0x1f0727['on'](_0x732a4b(0x11c),_0x152d77);});}function spawnViteBuildWatch(_0x43f6cd){return new Promise((_0x41cf9f,_0x2aaeb6)=>{const _0x49a6e8=a115_0x1262,_0x4d7567=spawn(_0x49a6e8(0x147),[_0x49a6e8(0x12f),_0x49a6e8(0x112)],{'cwd':_0x43f6cd,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x43f6cd,_0x49a6e8(0x12a),_0x49a6e8(0x113))+delimiter+process.env.PATH}});_0x4d7567['on'](_0x49a6e8(0x14a),_0x3245f0=>{const _0x3317cc=_0x49a6e8;if(_0x3245f0===0x0||_0x3245f0===null)_0x41cf9f();else _0x2aaeb6(new Error(_0x3317cc(0x126)+_0x3245f0));}),_0x4d7567['on'](_0x49a6e8(0x11c),_0x2aaeb6);});}function spawnVitePreview(_0x4e7dcd){return new Promise((_0x331d8c,_0x1fb8a9)=>{const _0x3b87a6=a115_0x1262,_0x454a97=spawn('vite',[_0x3b87a6(0x14f)],{'cwd':_0x4e7dcd,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x4e7dcd,_0x3b87a6(0x12a),_0x3b87a6(0x113))+delimiter+process.env.PATH}});_0x454a97['on'](_0x3b87a6(0x14a),_0x896da2=>{const _0xee19aa=_0x3b87a6;if(_0x896da2===0x0||_0x896da2===null)_0x331d8c();else _0x1fb8a9(new Error(_0xee19aa(0x127)+_0x896da2));}),_0x454a97['on'](_0x3b87a6(0x11c),_0x1fb8a9);});}function a115_0x1262(_0x47b591,_0x3b43f3){_0x47b591=_0x47b591-0x10e;const _0x4539d3=a115_0x4539();let _0x1262a6=_0x4539d3[_0x47b591];return _0x1262a6;}const runFlags=[{'name':'watch','type':a115_0xc0216d(0x11e),'description':a115_0xc0216d(0x146),'default':![]}];export const runDefinition={'service':'run','command':a115_0xc0216d(0x121),'description':a115_0xc0216d(0x12b),'risk':a115_0xc0216d(0x119),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a115_0xc0216d(0x133),'description':a115_0xc0216d(0x125),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x19d537=a115_0xc0216d,_0x394ced=readPackageScripts(process[_0x19d537(0x150)]()),_0xb75123=[];if(_0x394ced&&Object[_0x19d537(0x136)](_0x394ced)['length']>0x0){const _0x53cfee=Object[_0x19d537(0x136)](_0x394ced),_0x1a91f1=Math[_0x19d537(0x14b)](..._0x53cfee[_0x19d537(0x141)](_0x6cd193=>_0x6cd193[_0x19d537(0x122)]));_0xb75123[_0x19d537(0x117)]('\x20\x20AVAILABLE\x20SCRIPTS\x20\x20(current\x20project)');for(const [_0x40d853,_0x4efcd1]of Object[_0x19d537(0x13e)](_0x394ced)){_0xb75123['push'](_0x19d537(0x139)+CLI_BIN_NAME+_0x19d537(0x153)+_0x40d853[_0x19d537(0x134)](_0x1a91f1+0x2)+'#\x20'+_0x4efcd1);}}else _0xb75123['push'](_0x19d537(0x14c)),_0xb75123['push'](_0x19d537(0x139)+CLI_BIN_NAME+_0x19d537(0x12c)),_0xb75123[_0x19d537(0x117)](_0x19d537(0x139)+CLI_BIN_NAME+_0x19d537(0x115)),_0xb75123[_0x19d537(0x117)](_0x19d537(0x139)+CLI_BIN_NAME+_0x19d537(0x110)),_0xb75123[_0x19d537(0x117)](_0x19d537(0x139)+CLI_BIN_NAME+_0x19d537(0x129));return _0xb75123['join']('\x0a');},async 'execute'(_0xf44510){const _0x16ca76=a115_0xc0216d,_0x92ce99=process[_0x16ca76(0x150)](),_0x676812=_0xf44510[_0x16ca76(0x132)][0x0],_0x2a3a51=_0xf44510[_0x16ca76(0x132)][_0x16ca76(0x130)](0x1),_0x4affdb=readPackageScripts(_0x92ce99);if(!_0x4affdb)throw CliErrors[_0x16ca76(0x13a)](_0x16ca76(0x143));if(!_0x676812){const _0x1713cf=Object['keys'](_0x4affdb);if(_0x1713cf[_0x16ca76(0x122)]===0x0)console[_0x16ca76(0x10f)](_0x16ca76(0x13f));else{console[_0x16ca76(0x10f)](_0x16ca76(0x114));const _0x27247b=Math[_0x16ca76(0x14b)](..._0x1713cf[_0x16ca76(0x141)](_0xc10b34=>_0xc10b34['length']));for(const [_0x4dcff6,_0x81876c]of Object[_0x16ca76(0x13e)](_0x4affdb)){console['log']('\x20\x20\x20\x20'+_0x4dcff6[_0x16ca76(0x134)](_0x27247b+0x2)+_0x81876c);}console[_0x16ca76(0x10f)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+'\x20run\x20<script>\x0a');}return{'ok':!![]};}if(!_0x4affdb[_0x676812])throw CliErrors[_0x16ca76(0x13a)]('Script\x20\x22'+_0x676812+'\x22\x20not\x20found\x20in\x20package.json.',_0x16ca76(0x135)+(Object[_0x16ca76(0x136)](_0x4affdb)[_0x16ca76(0x111)](',\x20')||'(none)'));const _0x2ab03f=detectPackageManager(_0x92ce99);VERSION_CHECK_SCRIPTS[_0x16ca76(0x120)](_0x676812)&&await versionCheck(_0x92ce99);if(_0x676812==='preview'&&_0xf44510[_0x16ca76(0x13c)](_0x16ca76(0x145)))return await Promise[_0x16ca76(0x128)]([spawnViteBuildWatch(_0x92ce99),spawnVitePreview(_0x92ce99)]),{'ok':!![]};return await spawnScript(_0x2ab03f,_0x676812,_0x2a3a51,_0x92ce99),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a116_0x3bb1(_0x87aea6,_0x423095){_0x87aea6=_0x87aea6-0x141;const _0x3acd29=a116_0x3acd();let _0x3bb19e=_0x3acd29[_0x87aea6];return _0x3bb19e;}const a116_0x378810=a116_0x3bb1;(function(_0xc49519,_0x3e7614){const _0x347c18=a116_0x3bb1,_0x2c2114=_0xc49519();while(!![]){try{const _0x4ff74a=parseInt(_0x347c18(0x14b))/0x1+parseInt(_0x347c18(0x143))/0x2*(-parseInt(_0x347c18(0x145))/0x3)+parseInt(_0x347c18(0x144))/0x4+parseInt(_0x347c18(0x14a))/0x5*(parseInt(_0x347c18(0x14c))/0x6)+-parseInt(_0x347c18(0x142))/0x7+-parseInt(_0x347c18(0x148))/0x8+-parseInt(_0x347c18(0x141))/0x9*(-parseInt(_0x347c18(0x146))/0xa);if(_0x4ff74a===_0x3e7614)break;else _0x2c2114['push'](_0x2c2114['shift']());}catch(_0x6dac58){_0x2c2114['push'](_0x2c2114['shift']());}}}(a116_0x3acd,0x5915a));import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x2de965){const _0x2fd12f=await buildSchemaPayload();return{'ok':!![],'data':_0x2fd12f};}function a116_0x3acd(){const _0x36e1c9=['export','7985ndpQsI','156322zmwTox','132kuYXwO','36qOSaTP','1627612uUMIMm','290086CdCbQM','2426136pArkbj','15iuvmBz','1606490fPTCUJ','Export\x20machine-readable\x20command\x20schema\x20(JSON)','943720zkSBDU'];a116_0x3acd=function(){return _0x36e1c9;};return a116_0x3acd();}export const schemaDefinition={'service':'schema','command':a116_0x378810(0x149),'description':a116_0x378810(0x147),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':'json','flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a117_0x2871(_0x52fc68,_0x31d3ff){_0x52fc68=_0x52fc68-0x146;const _0x359152=a117_0x3591();let _0x2871bd=_0x359152[_0x52fc68];return _0x2871bd;}const a117_0x32b381=a117_0x2871;(function(_0x5f5445,_0x1c4fcb){const _0x389d68=a117_0x2871,_0x137f64=_0x5f5445();while(!![]){try{const _0x36b651=-parseInt(_0x389d68(0x149))/0x1*(parseInt(_0x389d68(0x150))/0x2)+parseInt(_0x389d68(0x14e))/0x3+-parseInt(_0x389d68(0x156))/0x4*(parseInt(_0x389d68(0x155))/0x5)+parseInt(_0x389d68(0x154))/0x6+-parseInt(_0x389d68(0x146))/0x7+-parseInt(_0x389d68(0x15a))/0x8+parseInt(_0x389d68(0x151))/0x9*(parseInt(_0x389d68(0x14a))/0xa);if(_0x36b651===_0x1c4fcb)break;else _0x137f64['push'](_0x137f64['shift']());}catch(_0x5cd14d){_0x137f64['push'](_0x137f64['shift']());}}}(a117_0x3591,0xb32e6));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a117_0x3591(){const _0x740f00=['31313943GPnZbM','Installing\x20official\x20skill\x20via\x20npx\x20(','log','4746078iDHvRN','5aIpQma','5132916PPgqhE','lovrabet/rabetbase',')...','skipped','5245512SqsqXD','inherit','info','cwd','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20skill\x20is\x20already\x20present.','unknown','install','Check\x20network\x20connectivity\x20and\x20try\x20again.','7814121vxltvn','setLogPath','skill','1hARWVz','10rqEiyx','nonInteractive','apiError','write','1703736peuMYK','执行安装技能包命令(委托给\x20npx\x20skills\x20add\x20-g\x20-y)','2098210zDZjeK'];a117_0x3591=function(){return _0x740f00;};return a117_0x3591();}import{logger}from'../../utils/logger.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE}from'../../skills/npx-skills-add.js';export const skillDefinitions=[{'service':a117_0x32b381(0x148),'command':a117_0x32b381(0x160),'description':'Install\x20developer\x20skill\x20package','risk':a117_0x32b381(0x14d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x7933f8){const _0x4766fd=a117_0x32b381;logger[_0x4766fd(0x147)](process[_0x4766fd(0x15d)]()),logger[_0x4766fd(0x15c)]('skill-install',_0x4766fd(0x14f));const {runNpxSkillsAddGlobal:_0x1763a3}=await import('../../skills/npx-skills-add.js'),_0x3afe3c=_0x7933f8[_0x4766fd(0x14b)]?'pipe':_0x4766fd(0x15b);console['log'](_0x4766fd(0x152)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+_0x4766fd(0x158));const _0x40b784=_0x1763a3(process[_0x4766fd(0x15d)](),_0x4766fd(0x157),{'stdio':_0x3afe3c});if(_0x40b784[_0x4766fd(0x159)])console[_0x4766fd(0x153)](_0x4766fd(0x15e));else{if(_0x40b784['ok'])console[_0x4766fd(0x153)](CLI_BIN_NAME+'\x20skill\x20installed');else throw CliErrors[_0x4766fd(0x14c)]('npx\x20skills\x20add\x20failed:\x20'+(_0x40b784['error']||_0x4766fd(0x15f)),_0x4766fd(0x161));}return{'ok':!![]};}}];
|