@lovrabet/rabetbase-cli 2.2.4 → 2.2.5-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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/app-config/delete.js +1 -0
- package/lib/commands/app-config/get.js +1 -0
- package/lib/commands/app-config/index.js +1 -0
- package/lib/commands/app-config/list.js +1 -0
- package/lib/commands/app-config/set.js +1 -0
- package/lib/commands/app-config/shared.js +1 -0
- 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/business-group-update.js +1 -0
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4bdf89,_0x4d1057){const _0xa8acd6=a117_0x10e7,_0x25013c=_0x4bdf89();while(!![]){try{const _0x4cce6a=parseInt(_0xa8acd6(0x9d))/0x1+-parseInt(_0xa8acd6(0xa6))/0x2+parseInt(_0xa8acd6(0x9f))/0x3*(parseInt(_0xa8acd6(0xb3))/0x4)+-parseInt(_0xa8acd6(0x89))/0x5*(parseInt(_0xa8acd6(0xa0))/0x6)+-parseInt(_0xa8acd6(0xba))/0x7*(-parseInt(_0xa8acd6(0xa3))/0x8)+parseInt(_0xa8acd6(0xb4))/0x9+-parseInt(_0xa8acd6(0x8e))/0xa;if(_0x4cce6a===_0x4d1057)break;else _0x25013c['push'](_0x25013c['shift']());}catch(_0x2ca7b6){_0x25013c['push'](_0x25013c['shift']());}}}(a117_0x5dfd,0x68045));import a117_0x5cb95e from'path';import a117_0x1ecf02 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';function a117_0x10e7(_0x1b61b6,_0x36f4aa){_0x1b61b6=_0x1b61b6-0x87;const _0x5dfd51=a117_0x5dfd();let _0x10e71e=_0x5dfd51[_0x1b61b6];return _0x10e71e;}import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';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';function a117_0x5dfd(){const _0x2ddfa7=['\x20dataset(s),\x20generated\x20','toLocaleString','ignore','Use\x20a\x20different\x20project\x20name.','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','cwd','name','validation','join','modelCount','4QWlLNl','4230261xOBJAF','npm','stringify','W_OK','length','\x20\x20√\x20Project\x20template\x20created','205037QQhgdI','\x20\x20√\x20Pulled\x20','log','2531380BgwZAk','package.json','\x0a\x20\x20cd\x20','\x20\x20√\x20Code\x20formatted','resolve','4072090tkVuQg','env','readFile','bun\x20run\x20format','Check\x20directory\x20permissions.','production','string','access','\x22\x20already\x20exists.','bun\x20--version','chdir','needsUpgrade','writeFile','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','bun','276680wnNxqA','*\x20Creating\x20project\x20','2087889elGwYN','6jEJqGi','\x20\x20√\x20Configuration\x20file\x20created','\x20\x20Installing\x20dependencies...','152sQRCKu','constants','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','1319326roJiYn','\x20model(s)','Project\x20name\x20contains\x20invalid\x20characters.'];a117_0x5dfd=function(){return _0x2ddfa7;};return a117_0x5dfd();}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(_0x1957d8,_0x26f37b,_0x1b3853,_0x31f615){const _0xfee2b0=a117_0x10e7,_0x33a471=await checkCliVersion();(_0x33a471[_0xfee2b0(0x99)]||_0x33a471['belowMinimum'])&&(printCliUpgradeWarning(_0x33a471),assertCliVersionSupported(_0x33a471));if(!_0x1957d8||_0x1957d8['trim']()==='')throw CliErrors[_0xfee2b0(0xb0)]('Project\x20name\x20cannot\x20be\x20empty.');const _0x4ed2de=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x4ed2de['test'](_0x1957d8))throw CliErrors[_0xfee2b0(0xb0)](_0xfee2b0(0xa8),_0xfee2b0(0xa5));if(_0x1957d8['length']>0x64)throw CliErrors[_0xfee2b0(0xb0)]('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.');const _0x44106d=a117_0x5cb95e[_0xfee2b0(0x8d)](process[_0xfee2b0(0xae)](),_0x1957d8);if(existsSync(_0x44106d))throw CliErrors[_0xfee2b0(0xb0)]('Project\x20directory\x20\x22'+_0x1957d8+_0xfee2b0(0x96),_0xfee2b0(0xac));try{const _0x5cf8c6=a117_0x5cb95e['dirname'](_0x44106d);await a117_0x1ecf02[_0xfee2b0(0x95)](_0x5cf8c6,a117_0x1ecf02[_0xfee2b0(0xa4)][_0xfee2b0(0xb7)]);}catch{throw CliErrors[_0xfee2b0(0xb0)]('Cannot\x20create\x20project\x20in\x20current\x20directory.',_0xfee2b0(0x92));}try{console[_0xfee2b0(0x88)](_0xfee2b0(0x9e)+_0x1957d8+'...');const _0x271ea3=getSubAppReactDemoTemplateDir();await copyDirectory(_0x271ea3,_0x44106d),console[_0xfee2b0(0x88)](_0xfee2b0(0xb9)),await updatePackageJsonName(_0x1957d8),console[_0xfee2b0(0x88)]('\x20\x20√\x20package.json\x20updated'),console[_0xfee2b0(0x88)](_0xfee2b0(0xa2)),console['log'](_0xfee2b0(0xad)),await formatCode(_0x44106d),console[_0xfee2b0(0x88)](_0xfee2b0(0x8c)),await configureProject(_0x1957d8,_0x1b3853,_0x26f37b),console[_0xfee2b0(0x88)](_0xfee2b0(0xa1)),_0x1b3853&&await pullApiConfig(_0x44106d,_0x1b3853,_0x26f37b,_0x31f615),console[_0xfee2b0(0x88)]('\x0a√\x20Project\x20'+_0x1957d8+'\x20created\x20successfully!'),console[_0xfee2b0(0x88)](_0xfee2b0(0x8b)+_0x1957d8),console[_0xfee2b0(0x88)]('\x20\x20rabetbase\x20run\x20start\x0a');}catch(_0x115eaf){try{existsSync(_0x44106d)&&await a117_0x1ecf02['rm'](_0x44106d,{'recursive':!![],'force':!![]});}catch{}throw _0x115eaf;}}async function updatePackageJsonName(_0x27de46){const _0x488abe=a117_0x10e7,_0x434240=a117_0x5cb95e[_0x488abe(0x8d)](process[_0x488abe(0xae)](),_0x27de46),_0x573a91=a117_0x5cb95e['join'](_0x434240,_0x488abe(0x8a)),_0x144920=await a117_0x1ecf02[_0x488abe(0x90)](_0x573a91,'utf-8'),_0x2f48b9=JSON['parse'](_0x144920);_0x2f48b9[_0x488abe(0xaf)]=_0x27de46,_0x2f48b9['description']='A\x20project\x20created\x20with\x20Lovrabet\x20CLI',await a117_0x1ecf02[_0x488abe(0x9a)](_0x573a91,JSON[_0x488abe(0xb6)](_0x2f48b9,null,0x2)+'\x0a');}function detectPackageManager(){const _0x30e603=a117_0x10e7;try{return execSync(_0x30e603(0x97),{'stdio':_0x30e603(0xab)}),_0x30e603(0x9c);}catch{return _0x30e603(0xb5);}}async function formatCode(_0x5df1e4){const _0x41cc95=a117_0x10e7;try{await execAsync(_0x41cc95(0x91),{'cwd':_0x5df1e4});}catch{}}async function configureProject(_0x337625,_0x4a46c7,_0x2b5ae7){const _0x4d7cea=a117_0x10e7,_0x56dc98=a117_0x5cb95e[_0x4d7cea(0x8d)](process[_0x4d7cea(0xae)](),_0x337625),_0x353fdc=a117_0x5cb95e[_0x4d7cea(0xb1)](_0x56dc98,NEW_CONFIG_NAME),_0x2ea6d8=readConfig(),_0x2b238b=typeof _0x2ea6d8[_0x4d7cea(0x8f)]===_0x4d7cea(0x94)?_0x2ea6d8[_0x4d7cea(0x8f)]:undefined,_0x27fccc={};for(const _0x2f9d0d of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x2ea6d8[_0x2f9d0d]!=null)_0x27fccc[_0x2f9d0d]=_0x2ea6d8[_0x2f9d0d];}const _0x29ac21=buildCanonicalProjectConfig(_0x27fccc,{'appCodes':_0x4a46c7?[_0x4a46c7]:[],'env':_0x2b5ae7||_0x2b238b||_0x4d7cea(0x93),'metadata':{'createdAt':new Date()[_0x4d7cea(0xaa)](),'version':getCliVersion()}});writeConfigFile(_0x353fdc,_0x29ac21);}async function pullApiConfig(_0x8b1c14,_0x13264d,_0x41c13c,_0x14d395){const _0x4b6ec4=a117_0x10e7,_0x4b5c18=process[_0x4b6ec4(0xae)]();try{process['chdir'](_0x8b1c14);const _0x506b68=_0x41c13c||_0x4b6ec4(0x93);initEnv(_0x506b68),console[_0x4b6ec4(0x88)]('\x20\x20Pulling\x20API\x20configuration...');const {configArray:_0x4bfd04}=await fetchModelList(_0x13264d,_0x14d395||''),_0x260bb2=await generateApiFile(_0x4bfd04,'',_0x13264d,!![],_0x506b68,DEFAULT_API_DIR);console[_0x4b6ec4(0x88)](_0x4b6ec4(0x87)+_0x4bfd04[_0x4b6ec4(0xb8)]+_0x4b6ec4(0xa9)+_0x260bb2[_0x4b6ec4(0xb2)]+_0x4b6ec4(0xa7));}catch(_0x42db10){console[_0x4b6ec4(0x88)](_0x4b6ec4(0x9b)+CLI_BIN_NAME+'\x20api\x20pull`\x20manually\x20later.');}finally{process[_0x4b6ec4(0x98)](_0x4b5c18);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a118_0x5230d0=a118_0x5354;(function(_0x4331f4,_0x414040){const _0x1a88ef=a118_0x5354,_0x5de1da=_0x4331f4();while(!![]){try{const _0x31899d=parseInt(_0x1a88ef(0x93))/0x1*(parseInt(_0x1a88ef(0x8e))/0x2)+-parseInt(_0x1a88ef(0x97))/0x3*(parseInt(_0x1a88ef(0x95))/0x4)+-parseInt(_0x1a88ef(0x98))/0x5+-parseInt(_0x1a88ef(0x8f))/0x6*(-parseInt(_0x1a88ef(0x92))/0x7)+parseInt(_0x1a88ef(0x9b))/0x8+parseInt(_0x1a88ef(0x94))/0x9+-parseInt(_0x1a88ef(0x96))/0xa*(-parseInt(_0x1a88ef(0x8c))/0xb);if(_0x31899d===_0x414040)break;else _0x5de1da['push'](_0x5de1da['shift']());}catch(_0x955345){_0x5de1da['push'](_0x5de1da['shift']());}}}(a118_0xd61b,0xcafd4));import a118_0xa8b2d0 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a118_0xa8b2d0[a118_0x5230d0(0x99)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x3c9a05=a118_0x5230d0;return a118_0xa8b2d0[_0x3c9a05(0x8d)](__dirname,_0x3c9a05(0x9a));}function a118_0x5354(_0x15a453,_0x374a5f){_0x15a453=_0x15a453-0x8b;const _0xd61b3f=a118_0xd61b();let _0x5354da=_0xd61b3f[_0x15a453];return _0x5354da;}function a118_0xd61b(){const _0x40250b=['2620512MbOUvB','4756132JsHClV','8976500tOgOcr','3bCfLRi','6869885rksUud','dirname','../../../../','11506656cGjcNc','projects','11WnSIbY','resolve','2gDXTQV','11148ZnFcZl','sub-app-react-demo','templates','1596UTjGmn','343680PfPWzS'];a118_0xd61b=function(){return _0x40250b;};return a118_0xd61b();}export function getSubAppReactDemoTemplateDir(){const _0x4cf2ec=a118_0x5230d0;return a118_0xa8b2d0['join'](getRabetbaseCliPackageRoot(),_0x4cf2ec(0x91),_0x4cf2ec(0x8b),_0x4cf2ec(0x90));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4fe3f2,_0x3146e0){const _0xe2b0d7=a119_0x4aab,_0x311ec8=_0x4fe3f2();while(!![]){try{const _0x4e423b=parseInt(_0xe2b0d7(0xb2))/0x1*(-parseInt(_0xe2b0d7(0xb6))/0x2)+-parseInt(_0xe2b0d7(0xbd))/0x3*(parseInt(_0xe2b0d7(0xbb))/0x4)+parseInt(_0xe2b0d7(0xc2))/0x5*(-parseInt(_0xe2b0d7(0xb4))/0x6)+-parseInt(_0xe2b0d7(0xc0))/0x7+-parseInt(_0xe2b0d7(0xc1))/0x8*(parseInt(_0xe2b0d7(0xba))/0x9)+parseInt(_0xe2b0d7(0xb8))/0xa*(parseInt(_0xe2b0d7(0xbf))/0xb)+parseInt(_0xe2b0d7(0xb7))/0xc;if(_0x4e423b===_0x3146e0)break;else _0x311ec8['push'](_0x311ec8['shift']());}catch(_0x1549a9){_0x311ec8['push'](_0x311ec8['shift']());}}}(a119_0xf594,0xe1129));function a119_0xf594(){const _0x460cad=['项目模板复制完成','项目模板复制失败','copy','cwd','1liGAks','error','3144ThRMNM','resolve','1109566MANAPT','55272240VaydFA','150VlcIVr','now','45WmncyN','1045252LELFWy','info','21IzSCXS','message','151349UYdTqA','7737597xIfUlw','288056LGnaQh','2110rhPxHQ'];a119_0xf594=function(){return _0x460cad;};return a119_0xf594();}function a119_0x4aab(_0xeee472,_0x1fa008){_0xeee472=_0xeee472-0xb0;const _0xf594df=a119_0xf594();let _0x4aabfe=_0xf594df[_0xeee472];return _0x4aabfe;}import a119_0x55ba0c 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(_0x239cdb){const _0x50578d=a119_0x4aab,_0xa01bd9=Date['now'](),_0x4b69f1=a119_0x55ba0c[_0x50578d(0xb5)](process[_0x50578d(0xb1)](),_0x239cdb);try{logger[_0x50578d(0xbc)](_0x50578d(0xb0),'开始复制项目模板',{'projectCode':_0x239cdb,'templateDir':templateDir}),await copyDirectory(templateDir,_0x4b69f1);const _0x1d4c29=Date[_0x50578d(0xb9)]()-_0xa01bd9;logger['success']('copy',_0x50578d(0xc3),_0x1d4c29,{'projectCode':_0x239cdb});}catch(_0x24c661){const _0x392e19=Date['now']()-_0xa01bd9;logger[_0x50578d(0xb3)](_0x50578d(0xb0),_0x50578d(0xc4),{'projectCode':_0x239cdb,'error':_0x24c661 instanceof Error?_0x24c661[_0x50578d(0xbe)]:String(_0x24c661),'duration':_0x392e19});throw _0x24c661;}return formatElapsed(_0xa01bd9);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a120_0x1d6f(){const _0x23cb37=['8724478HjeUfp','prettier','代码格式化失败','npx','开始格式化代码','format','120006sYfqxM','43776310eIuOsP','452kojRtI','resolve','44943HhOQhC','188576HIBDkv','10CXOBWC','now','--write','cwd','4762385nusOXa','4297240JcvZaW','代码格式化完成','9rJRlIY','message'];a120_0x1d6f=function(){return _0x23cb37;};return a120_0x1d6f();}(function(_0x76f6ed,_0x52c250){const _0x5a35db=a120_0x5ae9,_0x1bf41c=_0x76f6ed();while(!![]){try{const _0x35f228=-parseInt(_0x5a35db(0x1ea))/0x1*(parseInt(_0x5a35db(0x1e9))/0x2)+-parseInt(_0x5a35db(0x1e8))/0x3*(parseInt(_0x5a35db(0x1e6))/0x4)+parseInt(_0x5a35db(0x1ee))/0x5+-parseInt(_0x5a35db(0x1e4))/0x6+-parseInt(_0x5a35db(0x1f3))/0x7+-parseInt(_0x5a35db(0x1ef))/0x8+-parseInt(_0x5a35db(0x1f1))/0x9*(-parseInt(_0x5a35db(0x1e5))/0xa);if(_0x35f228===_0x52c250)break;else _0x1bf41c['push'](_0x1bf41c['shift']());}catch(_0x2d8c5e){_0x1bf41c['push'](_0x1bf41c['shift']());}}}(a120_0x1d6f,0xd97f1));import a120_0x68d832 from'node:path';function a120_0x5ae9(_0x18c18b,_0x3ef026){_0x18c18b=_0x18c18b-0x1e3;const _0x1d6fc9=a120_0x1d6f();let _0x5ae97d=_0x1d6fc9[_0x18c18b];return _0x5ae97d;}import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x4eb1e9){const _0x5a4947=a120_0x5ae9,_0x2a63b1=Date[_0x5a4947(0x1eb)](),_0x538e8f=a120_0x68d832[_0x5a4947(0x1e7)](process[_0x5a4947(0x1ed)](),_0x4eb1e9);try{logger['info'](_0x5a4947(0x1e3),_0x5a4947(0x1f7),{'projectCode':_0x4eb1e9}),await execa(resolveNpmBin(_0x5a4947(0x1f6)),[_0x5a4947(0x1f4),_0x5a4947(0x1ec),'.'],{'cwd':_0x538e8f});const _0x1aa71c=Date['now']()-_0x2a63b1;logger['success'](_0x5a4947(0x1e3),_0x5a4947(0x1f0),_0x1aa71c,{'projectCode':_0x4eb1e9});}catch(_0x4a769f){const _0x45e117=Date[_0x5a4947(0x1eb)]()-_0x2a63b1;logger['error'](_0x5a4947(0x1e3),_0x5a4947(0x1f5),{'projectCode':_0x4eb1e9,'error':_0x4a769f instanceof Error?_0x4a769f[_0x5a4947(0x1f2)]:String(_0x4a769f),'duration':_0x45e117});throw _0x4a769f;}return formatElapsed(_0x2a63b1);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2279b8,_0x24b8ef){const _0x1f5c15=a121_0x35ec,_0x50004b=_0x2279b8();while(!![]){try{const _0x1d85dd=parseInt(_0x1f5c15(0x165))/0x1+parseInt(_0x1f5c15(0x16b))/0x2+-parseInt(_0x1f5c15(0x166))/0x3+parseInt(_0x1f5c15(0x161))/0x4*(parseInt(_0x1f5c15(0x160))/0x5)+-parseInt(_0x1f5c15(0x16d))/0x6*(-parseInt(_0x1f5c15(0x16a))/0x7)+-parseInt(_0x1f5c15(0x169))/0x8+parseInt(_0x1f5c15(0x167))/0x9;if(_0x1d85dd===_0x24b8ef)break;else _0x50004b['push'](_0x50004b['shift']());}catch(_0x43c44d){_0x50004b['push'](_0x50004b['shift']());}}}(a121_0x1b95,0xc6bef));import a121_0x241237 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a121_0x1b95(){const _0xa8aea0=['6682232BQBeRP','196777bncoUR','744690ZfCkxH','resolve','120XXEJAW','依赖安装完成','--registry','npm','now','5uKQWTG','3777052ccTFGa','info','error','cwd','407048JegpQp','3359106iDRQOW','4348512KCaJMo','install'];a121_0x1b95=function(){return _0xa8aea0;};return a121_0x1b95();}function a121_0x35ec(_0x28dfe7,_0x35bd35){_0x28dfe7=_0x28dfe7-0x15f;const _0x1b9574=a121_0x1b95();let _0x35ece7=_0x1b9574[_0x28dfe7];return _0x35ece7;}import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x114e83){const _0xf81922=a121_0x35ec,_0x16502d=Date[_0xf81922(0x15f)](),_0x3ca976=a121_0x241237[_0xf81922(0x16c)](process[_0xf81922(0x164)](),_0x114e83);try{logger[_0xf81922(0x162)](_0xf81922(0x168),'开始安装依赖',{'projectCode':_0x114e83,'registry':'https://registry.npmmirror.com'}),await execa(resolveNpmBin(_0xf81922(0x170)),['install',_0xf81922(0x16f),'https://registry.npmmirror.com'],{'cwd':_0x3ca976});const _0x1d0ec3=Date[_0xf81922(0x15f)]()-_0x16502d;logger['success']('install',_0xf81922(0x16e),_0x1d0ec3,{'projectCode':_0x114e83});}catch(_0x4efa4f){const _0x3ebc91=Date[_0xf81922(0x15f)]()-_0x16502d;logger[_0xf81922(0x163)](_0xf81922(0x168),'依赖安装失败',{'projectCode':_0x114e83,'error':_0x4efa4f instanceof Error?_0x4efa4f['message']:String(_0x4efa4f),'duration':_0x3ebc91});throw _0x4efa4f;}return formatElapsed(_0x16502d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a122_0x3ff7(){const _0x250be1=['str','270624WnBjNE','2077898NoQcCL','validation','init','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','env','525192SwxjYo','nonInteractive','write','15JdTYai','Auto-confirm\x20prompts','name','20861280JloNIc','8ORzZxA','upgrade','../../commands/project/create/main.js','create','83264JvzRjr','appcode','Target\x20environment','yes','project','Usage:\x20','Initialize\x20.rabetbase.json\x20config\x20in\x20existing\x20project','63TnpLVY','989955kzexgo','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','App\x20code\x20to\x20initialize','string','618102gbVuCA','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','bool','Project\x20name','boolean','project-name','trim','../../commands/project/create/non-interactive.js','args','Skip\x20confirmation\x20prompt','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)'];a122_0x3ff7=function(){return _0x250be1;};return a122_0x3ff7();}const a122_0x21ea5e=a122_0xd48d;(function(_0x5333b3,_0x4f68c2){const _0x553bd4=a122_0xd48d,_0xd5e5dc=_0x5333b3();while(!![]){try{const _0x25b180=-parseInt(_0x553bd4(0x133))/0x1+-parseInt(_0x553bd4(0x140))/0x2+-parseInt(_0x553bd4(0x145))/0x3+-parseInt(_0x553bd4(0x127))/0x4*(-parseInt(_0x553bd4(0x148))/0x5)+-parseInt(_0x553bd4(0x13f))/0x6*(-parseInt(_0x553bd4(0x12e))/0x7)+parseInt(_0x553bd4(0x123))/0x8*(-parseInt(_0x553bd4(0x12f))/0x9)+parseInt(_0x553bd4(0x122))/0xa;if(_0x25b180===_0x4f68c2)break;else _0xd5e5dc['push'](_0xd5e5dc['shift']());}catch(_0x418f43){_0xd5e5dc['push'](_0xd5e5dc['shift']());}}}(a122_0x3ff7,0x95832));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a122_0xd48d(_0x2a3a1,_0x1028f8){_0x2a3a1=_0x2a3a1-0x122;const _0x3ff791=a122_0x3ff7();let _0xd48de1=_0x3ff791[_0x2a3a1];return _0xd48de1;}import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';const initFlags=[{'name':a122_0x21ea5e(0x128),'type':a122_0x21ea5e(0x132),'description':a122_0x21ea5e(0x131)},{'name':a122_0x21ea5e(0x144),'type':a122_0x21ea5e(0x132),'description':'Target\x20environment'},{'name':a122_0x21ea5e(0x12a),'type':a122_0x21ea5e(0x137),'description':a122_0x21ea5e(0x149),'default':![]}],createFlags=[{'name':a122_0x21ea5e(0x14a),'type':'string','description':a122_0x21ea5e(0x136)},{'name':a122_0x21ea5e(0x144),'type':a122_0x21ea5e(0x132),'description':a122_0x21ea5e(0x129)},{'name':a122_0x21ea5e(0x128),'type':a122_0x21ea5e(0x132),'description':a122_0x21ea5e(0x13d)}],upgradeFlags=[{'name':a122_0x21ea5e(0x12a),'type':a122_0x21ea5e(0x137),'description':a122_0x21ea5e(0x13c),'default':![]}];export const projectDefinitions=[{'service':'project','command':a122_0x21ea5e(0x142),'description':a122_0x21ea5e(0x12d),'risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initFlags,async 'execute'(_0x4196e5){const _0x41f555=a122_0x21ea5e;return await initConfig({'appcode':_0x4196e5[_0x41f555(0x13e)](_0x41f555(0x128))||undefined,'env':_0x4196e5[_0x41f555(0x13e)](_0x41f555(0x144))||undefined,'autoYes':_0x4196e5[_0x41f555(0x135)](_0x41f555(0x12a))}),{'ok':!![]};}},{'service':'project','command':a122_0x21ea5e(0x126),'description':'Create\x20a\x20new\x20project','risk':a122_0x21ea5e(0x147),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a122_0x21ea5e(0x138),'description':a122_0x21ea5e(0x130),'required':![]}],'flags':createFlags,async 'execute'(_0x558f73){const _0x2326d6=a122_0x21ea5e,{createApp:_0x2507b9}=await import(_0x2326d6(0x125)),{createProjectNonInteractive:_0x4686e4}=await import(_0x2326d6(0x13a)),_0x2d8916=_0x558f73['str']('name')[_0x2326d6(0x139)]()||_0x558f73[_0x2326d6(0x13b)][0x0]?.['trim'](),_0x15f21c=_0x558f73[_0x2326d6(0x13e)](_0x2326d6(0x144))||undefined,_0x186bbc=_0x558f73['str'](_0x2326d6(0x128))||undefined;if(_0x558f73[_0x2326d6(0x146)]){if(!_0x2d8916)throw CliErrors[_0x2326d6(0x141)](_0x2326d6(0x143),_0x2326d6(0x12c)+CLI_BIN_NAME+_0x2326d6(0x134));await _0x4686e4(_0x2d8916,_0x15f21c,_0x186bbc,_0x558f73['cookie']);}else await _0x2507b9({'projectCode':_0x2d8916,'appCode':_0x186bbc,'env':_0x15f21c,'cookie':_0x558f73['cookie']});return{'ok':!![]};}},{'service':a122_0x21ea5e(0x12b),'command':a122_0x21ea5e(0x124),'description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','risk':a122_0x21ea5e(0x147),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x2816d2){const _0x490dd4=a122_0x21ea5e;return await upgradeApp(_0x2816d2[_0x490dd4(0x146)],{'yes':_0x2816d2[_0x490dd4(0x135)]('yes')}),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x49d843,_0xea46c2){const _0x164c55=a123_0x3128,_0x1e3ea9=_0x49d843();while(!![]){try{const _0x294b0a=-parseInt(_0x164c55(0xfb))/0x1+parseInt(_0x164c55(0xec))/0x2*(-parseInt(_0x164c55(0xe7))/0x3)+parseInt(_0x164c55(0xeb))/0x4*(parseInt(_0x164c55(0x106))/0x5)+-parseInt(_0x164c55(0x10e))/0x6*(parseInt(_0x164c55(0x10c))/0x7)+parseInt(_0x164c55(0x113))/0x8*(parseInt(_0x164c55(0xfc))/0x9)+-parseInt(_0x164c55(0xe5))/0xa*(-parseInt(_0x164c55(0xf9))/0xb)+parseInt(_0x164c55(0xf3))/0xc;if(_0x294b0a===_0xea46c2)break;else _0x1e3ea9['push'](_0x1e3ea9['shift']());}catch(_0x9c13dc){_0x1e3ea9['push'](_0x1e3ea9['shift']());}}}(a123_0x2bb6,0x4a436));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';function a123_0x3128(_0x1c2aa2,_0x52eccb){_0x1c2aa2=_0x1c2aa2-0xe2;const _0x2bb603=a123_0x2bb6();let _0x3128ca=_0x2bb603[_0x1c2aa2];return _0x3128ca;}function a123_0x2bb6(){const _0x3848fe=['1477900BoQzKe','86FUgHoT','Please\x20enter\x20App\x20Code:','yellow','string','join','\x20api\x20generate\x27\x20and\x20\x27','env','9297996xWTktt','app','appcode','gray','toLocaleString','.rabetbase.json','33lHSVRi','setLogPath','59679lzKTUK','90iIDoIx','\x20\x20Default:\x20','初始化项目配置文件成功','package.json','App\x20Code\x20cannot\x20be\x20empty','version','1.0.0','init','parse','.bak','5khJgFb','green','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','Migration\x20cancelled.\x20Run\x20`','utf8','apps','31759KWlicR','Upgrade\x20it\x20to\x20','618MZAntn','info','../..','?\x20(Old\x20file\x20→\x20*.bak)','defaultApp','229144ZCwrEq','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory','trim','production','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','\x20project\x20init`\x20to\x20start\x20fresh.','7970pgxIGq','\x20→\x20.rabetbase.json','41997HbLIjR','cyan','keys','log'];a123_0x2bb6=function(){return _0x3848fe;};return a123_0x2bb6();}import a123_0x510543 from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x4df46f){const _0x27cb93=a123_0x3128,{appcode:_0x81d1fe,env:_0x43ceed,autoYes:_0x34a540}=_0x4df46f,_0x46857e=process['cwd']();if(getProjectConfigPath())throw new Error('.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.');let _0x3d8d0f;for(const _0x548991 of LEGACY_CONFIG_NAMES){const _0x37fdc9=resolve(_0x46857e,_0x548991);if(existsSync(_0x37fdc9)){_0x3d8d0f=_0x37fdc9;break;}}if(_0x3d8d0f){let _0x30c49f={};try{_0x30c49f=JSON[_0x27cb93(0x104)](readFileSync(_0x3d8d0f,_0x27cb93(0x10a)));}catch{}const _0x110296=basename(_0x3d8d0f),_0x18a623=_0x30c49f?.[_0x27cb93(0xf5)]||_0x30c49f?.[_0x27cb93(0xf4)];let _0x53e3b5=_0x34a540;!_0x34a540&&(console[_0x27cb93(0xea)](a123_0x510543[_0x27cb93(0xee)](_0x27cb93(0x108)+a123_0x510543['bold'](_0x110296))),_0x18a623&&console[_0x27cb93(0xea)](a123_0x510543[_0x27cb93(0xe8)]('\x20\x20appcode:\x20'+_0x18a623)),_0x53e3b5=await confirm({'message':_0x27cb93(0x10d)+a123_0x510543['bold'](_0x27cb93(0xf8))+_0x27cb93(0x111),'default':!![]}));if(!_0x53e3b5){console[_0x27cb93(0xea)](_0x27cb93(0x109)+CLI_BIN_NAME+_0x27cb93(0xe4));return;}const _0x37baf3=resolve(_0x46857e,NEW_CONFIG_NAME),_0x2a3eaf=getCliVersionFromPkg(),_0x208ad8=readRawConfig(),_0x2945ca=_0x81d1fe||(typeof _0x30c49f?.[_0x27cb93(0xf5)]===_0x27cb93(0xef)?_0x30c49f[_0x27cb93(0xf5)]:undefined)||(typeof _0x30c49f?.[_0x27cb93(0xf4)]==='string'?_0x30c49f[_0x27cb93(0xf4)]:undefined)||await askAppcode(),_0x1245d4=typeof _0x30c49f?.[_0x27cb93(0xf2)]===_0x27cb93(0xef)?_0x30c49f[_0x27cb93(0xf2)]:typeof _0x208ad8[_0x27cb93(0xf2)]==='string'?_0x208ad8[_0x27cb93(0xf2)]:_0x27cb93(0x116),_0x3f8965=buildCanonicalProjectConfig({..._0x208ad8,..._0x30c49f},{'appCodes':[_0x2945ca],'env':_0x1245d4,'metadata':{'version':_0x2a3eaf,'migratedAt':new Date()['toLocaleString'](),'migratedFrom':_0x3d8d0f}});writeConfigFile(_0x37baf3,_0x3f8965);const _0x518fe2=_0x3d8d0f+_0x27cb93(0x105);renameSync(_0x3d8d0f,_0x518fe2),logger[_0x27cb93(0xfa)](_0x46857e),logger[_0x27cb93(0x10f)](_0x27cb93(0x103),'从旧配置文件升级成功',{'from':_0x3d8d0f,'to':_0x37baf3,'appcode':_0x2945ca,'env':_0x3f8965[_0x27cb93(0xf2)]}),console[_0x27cb93(0xea)](a123_0x510543[_0x27cb93(0x107)]('✓\x20Upgraded\x20'+_0x110296+_0x27cb93(0xe6))),console['log'](a123_0x510543[_0x27cb93(0xe8)]('\x20\x20Apps:\x20'+Object['keys'](_0x3f8965['apps']||{})[_0x27cb93(0xf0)](',\x20'))),console['log'](a123_0x510543[_0x27cb93(0xe8)]('\x20\x20Default:\x20'+_0x3f8965[_0x27cb93(0x112)])),console[_0x27cb93(0xea)](a123_0x510543[_0x27cb93(0xf6)](_0x27cb93(0xe3)+_0x110296+_0x27cb93(0x105)));return;}const _0x53d681=_0x81d1fe||await askAppcode(),_0x501d98=resolve(_0x46857e,NEW_CONFIG_NAME),_0xd48179=getCliVersionFromPkg(),_0x1ae336=readRawConfig(),_0x6bcee4=typeof _0x1ae336[_0x27cb93(0xf2)]==='string'?_0x1ae336[_0x27cb93(0xf2)]:undefined,_0x58881c=buildCanonicalProjectConfig({},{'appCodes':[_0x53d681],'env':_0x43ceed||_0x6bcee4||'production','metadata':{'version':_0xd48179,'createdAt':new Date()[_0x27cb93(0xf7)]()}});writeConfigFile(_0x501d98,_0x58881c),logger['setLogPath'](_0x46857e),logger['info'](_0x27cb93(0x103),_0x27cb93(0xfe),{'appcode':_0x53d681,'env':_0x58881c[_0x27cb93(0xf2)],'version':_0x58881c[_0x27cb93(0x101)],'configPath':_0x501d98}),console['log'](a123_0x510543['green'](_0x27cb93(0x114))),console[_0x27cb93(0xea)](a123_0x510543['cyan']('\x20\x20Apps:\x20'+Object[_0x27cb93(0xe9)](_0x58881c[_0x27cb93(0x10b)]||{})['join'](',\x20'))),console[_0x27cb93(0xea)](a123_0x510543[_0x27cb93(0xe8)](_0x27cb93(0xfd)+_0x58881c[_0x27cb93(0x112)])),console['log'](_0x27cb93(0xe2)+CLI_BIN_NAME+_0x27cb93(0xf1)+CLI_BIN_NAME+'\x20api\x20pull\x27');}function askAppcode(){const _0x2a5101=a123_0x3128;return input({'message':_0x2a5101(0xed),'validate':_0x3bdcd7=>{const _0x1e9c06=_0x2a5101;if(!_0x3bdcd7[_0x1e9c06(0x115)]())return _0x1e9c06(0x100);const {valid:_0x23084b,message:_0x2b4202}=validateAppcode(_0x3bdcd7[_0x1e9c06(0x115)]());return _0x23084b||_0x2b4202||'Invalid\x20App\x20Code';}});}function getCliVersionFromPkg(){const _0x3b781a=a123_0x3128;try{const _0x37789e=fileURLToPath(import.meta.url),_0x5ba27c=resolve(dirname(_0x37789e),_0x3b781a(0x110)),_0x3f13ae=JSON[_0x3b781a(0x104)](readFileSync(resolve(_0x5ba27c,_0x3b781a(0xff)),_0x3b781a(0x10a)));return _0x3f13ae[_0x3b781a(0x101)]||_0x3b781a(0x102);}catch{return _0x3b781a(0x102);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a117_0x17e390=a117_0x252e;(function(_0x5a4bfd,_0x4974da){const _0x3d20bb=a117_0x252e,_0x382c49=_0x5a4bfd();while(!![]){try{const _0x593191=-parseInt(_0x3d20bb(0xd4))/0x1*(parseInt(_0x3d20bb(0xd3))/0x2)+parseInt(_0x3d20bb(0xc0))/0x3*(parseInt(_0x3d20bb(0xa7))/0x4)+-parseInt(_0x3d20bb(0xf0))/0x5*(-parseInt(_0x3d20bb(0xd1))/0x6)+-parseInt(_0x3d20bb(0xe9))/0x7*(-parseInt(_0x3d20bb(0x8c))/0x8)+parseInt(_0x3d20bb(0xd0))/0x9+-parseInt(_0x3d20bb(0x103))/0xa*(-parseInt(_0x3d20bb(0xbe))/0xb)+-parseInt(_0x3d20bb(0xca))/0xc;if(_0x593191===_0x4974da)break;else _0x382c49['push'](_0x382c49['shift']());}catch(_0x291214){_0x382c49['push'](_0x382c49['shift']());}}}(a117_0xd3b6,0x34ba1));import a117_0x5d314 from'chalk';import a117_0x679d75 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';function a117_0xd3b6(){const _0x215771=['succeed','latest','Proceed\x20with\x20upgrade?','Step\x204/7:\x20MCP\x20config\x20—\x20','55pNdLLy','.claude/skills/lovrabet','13683rOCLDk','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','@lovrabet/dataset-mcp-server','done','Step\x201/7:\x20Migrating\x20config...','Skill\x20swap:','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','\x20\x20npm\x20install','fields','[\x22@lovrabet/sdk\x22]:\x20','6330288xiHrYj','isArray','\x20→\x20keys:\x20','no\x20legacy\x20config\x20found','detail','skipped','1859535Kclrbo','200412JMAfHY','skipped\x20(no\x20legacy\x20config)','2sWLjyu','427406UTYkSn','\x20removed\x20(','removed\x20','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','cwd','status','already\x20exists\x20(will\x20merge)','inherit','cyan','values','\x20\x20New\x20config\x20(.rabetbase.json):\x20','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','undefined','start','lovrabet/lovrabet-skill\x20removed','hasNewConfig','\x20(backup:\x20','Step\x206/7:\x20Installing\x20new\x20skill...','red','error','isDirectory','3024fKqqGc','args','utf8','needsSkillSwap','failed','configMigration','sdkUpgrade','5NCNUBF','gray','oldPath','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','MCP\x20config:','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','yes','mcpServers','filter','\x20→\x20','join','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','Step\x204/7:\x20Cleaning\x20MCP\x20config...','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','Config\x20file:','Clean\x20MCP\x20config','message','no\x20legacy\x20entry','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','555770ZAFsSX','stringify','info','\x20\x20Step\x20','.cursor/mcp.json','exit\x20','devDependencies','fail','.cursor/rules/lovrabet_rules.mdc','\x20→\x20latest','lovrabet/rabetbase','string','bold','7616dNMbFe','lovrabet/rabetbase\x20installed\x20globally','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','\x20\x20Action:\x20delete','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','@lovrabet/sdk:','===\x20Upgrade\x20Summary\x20===','\x20\x20Current\x20version\x20in\x20','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','.lovrabet','log','label','includes','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','oldArtifacts','parse','Legacy\x20artifacts:','path','Step\x205/7:\x20Removing\x20old\x20skill...','not\x20found\x20(will\x20create)','not\x20needed','@lovrabet/sdk','not\x20found\x20or\x20already\x20at\x20latest','CANCEL','Upgrade\x20cancelled.','Install\x20new\x20skill','212MnvLYp','yellow','Remove\x20.lovrabet/','step','white','Config\x20migration','entries','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','oldMcpConfig','push','length','green','\x20\x20\x20\x20\x20\x20\x20','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','\x20removed','Remove\x20old\x20skill','files','FAIL','keys'];a117_0xd3b6=function(){return _0x215771;};return a117_0xd3b6();}import{CONFIG_NAMES,NEW_CONFIG_NAME,readConfigFile,writeConfigFile}from'../../context.js';import{CORE_IDE_CONFIGS}from'../../utils/ai_config.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE,runNpxSkillsAddGlobal,runNpxSkillsRemove}from'../../skills/npx-skills-add.js';import{askConfirm}from'../../commands/menu/shared/inquirer.js';const LEGACY_CONFIG_NAMES=CONFIG_NAMES[a117_0x17e390(0xf8)](_0x2ed470=>_0x2ed470!==NEW_CONFIG_NAME);function a117_0x252e(_0x18efed,_0x2a67ef){_0x18efed=_0x18efed-0x80;const _0xd3b62a=a117_0xd3b6();let _0x252e97=_0xd3b62a[_0x18efed];return _0x252e97;}function collectIdeSkillFiles(_0x5ed2df){const _0x203c89=a117_0x17e390,_0x552299=[];for(const _0x293472 of Object[_0x203c89(0xdd)](CORE_IDE_CONFIGS)){if(_0x293472[_0x203c89(0xb7)])for(const _0x49bd3f of _0x293472['files']){_0x552299['push'](resolve(_0x5ed2df,_0x49bd3f[_0x203c89(0x9e)]));}}return _0x552299;}function analyse(_0x2bd2d9){const _0x1e8ab4=a117_0x17e390;let _0x45c658=null;const _0x46369f=resolve(_0x2bd2d9,NEW_CONFIG_NAME),_0x38ffb4=existsSync(_0x46369f);for(const _0x340a7f of LEGACY_CONFIG_NAMES){const _0x7db1fc=resolve(_0x2bd2d9,_0x340a7f);if(existsSync(_0x7db1fc)){const _0x39c577=readConfigFile(_0x7db1fc),_0x46c769=Object['keys'](_0x39c577)[_0x1e8ab4(0xf8)](_0x177bb9=>typeof _0x39c577[_0x177bb9]!==_0x1e8ab4(0xe0));_0x45c658={'oldPath':_0x7db1fc,'hasNewConfig':_0x38ffb4,'fields':_0x46c769};break;}}const _0x37c735=[],_0x51b3ff=resolve(_0x2bd2d9,_0x1e8ab4(0x95));if(existsSync(_0x51b3ff))_0x37c735['push'](_0x51b3ff);const _0xb9734=resolve(_0x2bd2d9,_0x1e8ab4(0x87));if(existsSync(_0xb9734))_0x37c735[_0x1e8ab4(0xb0)](_0xb9734);const _0x429f8c=resolve(_0x2bd2d9,_0x1e8ab4(0xbf));if(existsSync(_0x429f8c))_0x37c735[_0x1e8ab4(0xb0)](_0x429f8c);for(const _0x5620cc of collectIdeSkillFiles(_0x2bd2d9)){if(existsSync(_0x5620cc))_0x37c735['push'](_0x5620cc);}let _0x44c73a=null;const _0x511ac0=resolve(_0x2bd2d9,_0x1e8ab4(0x83));if(existsSync(_0x511ac0))try{const _0x22efa4=JSON[_0x1e8ab4(0x9c)](readFileSync(_0x511ac0,'utf8'));if(_0x22efa4?.[_0x1e8ab4(0xf7)]&&typeof _0x22efa4[_0x1e8ab4(0xf7)]==='object'){const _0x386bfb=[];for(const [_0x1c5d54,_0x1941b1]of Object[_0x1e8ab4(0xad)](_0x22efa4[_0x1e8ab4(0xf7)])){const _0x231a5e=_0x1941b1;_0x231a5e?.[_0x1e8ab4(0xea)]&&Array[_0x1e8ab4(0xcb)](_0x231a5e[_0x1e8ab4(0xea)])&&_0x231a5e[_0x1e8ab4(0xea)]['some'](_0x52056a=>typeof _0x52056a==='string'&&_0x52056a['includes'](_0x1e8ab4(0xc2)))&&_0x386bfb[_0x1e8ab4(0xb0)](_0x1c5d54);}_0x386bfb['length']>0x0&&(_0x44c73a={'path':_0x511ac0,'keys':_0x386bfb});}}catch{}const _0x386269=_0x37c735[_0x1e8ab4(0xb1)]>0x0||_0x45c658!==null;let _0x5e9f3a=null;const _0x5603c7=resolve(_0x2bd2d9,'package.json');if(existsSync(_0x5603c7))try{const _0x192cc6=JSON[_0x1e8ab4(0x9c)](readFileSync(_0x5603c7,_0x1e8ab4(0xeb)));for(const _0x41c2fd of['dependencies',_0x1e8ab4(0x85)]){const _0x232218=_0x192cc6?.[_0x41c2fd]?.[_0x1e8ab4(0xa2)];if(typeof _0x232218===_0x1e8ab4(0x8a)){_0x232218!==_0x1e8ab4(0xbb)&&(_0x5e9f3a={'pkgPath':_0x5603c7,'currentVersion':_0x232218,'field':_0x41c2fd});break;}}}catch{}return{'configMigration':_0x45c658,'oldArtifacts':_0x37c735,'oldMcpConfig':_0x44c73a,'needsSkillSwap':_0x386269,'sdkUpgrade':_0x5e9f3a};}function printReport(_0x51d3af){const _0x4b4965=a117_0x17e390,{configMigration:_0xb0e43e,oldArtifacts:_0x2dae9c,oldMcpConfig:_0x52112e,needsSkillSwap:_0x494b97}=_0x51d3af;console[_0x4b4965(0x96)](''),console[_0x4b4965(0x96)](a117_0x5d314[_0x4b4965(0x8b)]('===\x20Upgrade\x20Analysis\x20===')),console[_0x4b4965(0x96)]('');_0xb0e43e?(console[_0x4b4965(0x96)](a117_0x5d314[_0x4b4965(0xdc)](_0x4b4965(0xfe))+('\x20\x20'+a117_0x5d314[_0x4b4965(0xa8)](_0xb0e43e['oldPath']))),console[_0x4b4965(0x96)](_0x4b4965(0xde)+(_0xb0e43e[_0x4b4965(0xe3)]?a117_0x5d314['green'](_0x4b4965(0xda)):a117_0x5d314['gray'](_0x4b4965(0xa0)))),console[_0x4b4965(0x96)]('\x20\x20Fields\x20to\x20migrate:\x20'+_0xb0e43e[_0x4b4965(0xc8)][_0x4b4965(0xfa)](',\x20')),console[_0x4b4965(0x96)](_0x4b4965(0x8e))):console['log'](a117_0x5d314['cyan']('Config\x20file:')+'\x20\x20'+a117_0x5d314['gray'](_0x4b4965(0xcd)));console[_0x4b4965(0x96)]('');if(_0x2dae9c[_0x4b4965(0xb1)]>0x0){console[_0x4b4965(0x96)](a117_0x5d314[_0x4b4965(0xdc)](_0x4b4965(0x9d)));for(const _0x52266f of _0x2dae9c){console['log']('\x20\x20'+a117_0x5d314['red']('FOUND')+'\x20\x20'+_0x52266f);}console[_0x4b4965(0x96)](_0x4b4965(0x8f));}else console[_0x4b4965(0x96)](a117_0x5d314[_0x4b4965(0xdc)](_0x4b4965(0x9d))+'\x20\x20'+a117_0x5d314[_0x4b4965(0xf1)]('none\x20found'));console['log']('');_0x52112e?(console[_0x4b4965(0x96)](a117_0x5d314[_0x4b4965(0xdc)](_0x4b4965(0xf4))+('\x20\x20'+a117_0x5d314['yellow'](_0x52112e[_0x4b4965(0x9e)])+_0x4b4965(0xcc)+_0x52112e[_0x4b4965(0xb9)][_0x4b4965(0xfa)](',\x20'))),console[_0x4b4965(0x96)](_0x4b4965(0xf5))):console[_0x4b4965(0x96)](a117_0x5d314['cyan'](_0x4b4965(0xf4))+'\x20\x20'+a117_0x5d314[_0x4b4965(0xf1)](_0x4b4965(0x101)));console[_0x4b4965(0x96)](''),console[_0x4b4965(0x96)](a117_0x5d314[_0x4b4965(0xdc)](_0x4b4965(0xc5))+('\x20\x20'+(_0x494b97?a117_0x5d314[_0x4b4965(0xa8)]('needed'):a117_0x5d314[_0x4b4965(0xb2)](_0x4b4965(0xa1)))));_0x494b97&&console[_0x4b4965(0x96)](_0x4b4965(0x90)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console['log']('');if(_0x51d3af[_0x4b4965(0xef)]){const {currentVersion:_0x5388b5,field:_0x30bda4,pkgPath:_0x4721e7}=_0x51d3af[_0x4b4965(0xef)];console['log'](a117_0x5d314['cyan'](_0x4b4965(0x91))+('\x20\x20'+a117_0x5d314[_0x4b4965(0xa8)](_0x4721e7))),console[_0x4b4965(0x96)](_0x4b4965(0x93)+_0x30bda4+':\x20'+a117_0x5d314[_0x4b4965(0xa8)](_0x5388b5)+_0x4b4965(0xf9)+a117_0x5d314[_0x4b4965(0xb2)]('latest')),console[_0x4b4965(0x96)]('\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)');}else console['log'](a117_0x5d314[_0x4b4965(0xdc)]('@lovrabet/sdk:')+'\x20\x20'+a117_0x5d314[_0x4b4965(0xf1)](_0x4b4965(0xa3)));console[_0x4b4965(0x96)]('');}function execConfigMigration(_0x48e9b3,_0x2a1fd3){const _0x245034=a117_0x17e390,{configMigration:_0x4f58b0}=_0x48e9b3;if(!_0x4f58b0?.['oldPath'])return{'step':0x1,'label':_0x245034(0xac),'ok':!![],'detail':_0x245034(0xd2)};const _0x49f9aa=readConfigFile(_0x4f58b0['oldPath']),_0x2c23a6=resolve(_0x2a1fd3,NEW_CONFIG_NAME),_0x9a319c=_0x4f58b0[_0x245034(0xe3)]?readConfigFile(_0x2c23a6):{};for(const [_0x68365a,_0x8fc764]of Object['entries'](_0x49f9aa)){!(_0x68365a in _0x9a319c)&&(_0x9a319c[_0x68365a]=_0x8fc764);}writeConfigFile(_0x2c23a6,_0x9a319c);const _0x15abb8=_0x4f58b0['oldPath']+'.bak';return renameSync(_0x4f58b0[_0x245034(0xf2)],_0x15abb8),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x4f58b0[_0x245034(0xf2)]+_0x245034(0xf9)+_0x2c23a6+_0x245034(0xe4)+_0x15abb8+')'};}function execRemoveOldArtifacts(_0x34bf20){const _0x30b93f=a117_0x17e390,_0x4f384b=[];for(const _0x5c5d69 of _0x34bf20){try{if(!existsSync(_0x5c5d69))continue;const _0x4e7421=tryStat(_0x5c5d69);_0x4e7421?.[_0x30b93f(0xe8)]()?rmSync(_0x5c5d69,{'recursive':!![],'force':!![]}):unlinkSync(_0x5c5d69);}catch(_0x5355c8){_0x4f384b['push'](_0x5c5d69+':\x20'+_0x5355c8[_0x30b93f(0x100)]);}}return{'step':0x3,'label':'Remove\x20legacy\x20artifacts','ok':_0x4f384b[_0x30b93f(0xb1)]===0x0,'detail':_0x4f384b[_0x30b93f(0xb1)]>0x0?_0x34bf20[_0x30b93f(0xb1)]-_0x4f384b[_0x30b93f(0xb1)]+'/'+_0x34bf20[_0x30b93f(0xb1)]+_0x30b93f(0xd5)+_0x4f384b[_0x30b93f(0xfa)](';\x20')+')':_0x34bf20[_0x30b93f(0xb1)]+_0x30b93f(0xb5)};}function execCleanMcp(_0x56fa0c){const _0x1f889e=a117_0x17e390;if(!_0x56fa0c[_0x1f889e(0xaf)])return{'step':0x4,'label':_0x1f889e(0xff),'ok':!![],'detail':_0x1f889e(0xcf)};try{const _0x14113b=readFileSync(_0x56fa0c['oldMcpConfig'][_0x1f889e(0x9e)],_0x1f889e(0xeb)),_0x3506ee=JSON[_0x1f889e(0x9c)](_0x14113b);if(_0x3506ee?.['mcpServers']&&typeof _0x3506ee['mcpServers']==='object'){const _0x30e755=[];for(const [_0x230ba0,_0x7cdc41]of Object[_0x1f889e(0xad)](_0x3506ee[_0x1f889e(0xf7)])){_0x7cdc41?.[_0x1f889e(0xea)]&&Array[_0x1f889e(0xcb)](_0x7cdc41['args'])&&_0x7cdc41[_0x1f889e(0xea)]['some'](_0x5be1be=>typeof _0x5be1be==='string'&&_0x5be1be[_0x1f889e(0x98)](_0x1f889e(0xc2)))&&_0x30e755['push'](_0x230ba0);}for(const _0x3cb689 of _0x30e755){delete _0x3506ee['mcpServers'][_0x3cb689];}return _0x30e755[_0x1f889e(0xb1)]>0x0&&writeFileSync(_0x56fa0c[_0x1f889e(0xaf)][_0x1f889e(0x9e)],JSON[_0x1f889e(0x80)](_0x3506ee,null,0x2)+'\x0a',_0x1f889e(0xeb)),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x1f889e(0xd6)+_0x30e755['join'](',\x20')+'\x20from\x20'+_0x56fa0c[_0x1f889e(0xaf)][_0x1f889e(0x9e)]};}return{'step':0x4,'label':_0x1f889e(0xff),'ok':!![],'detail':'no\x20matching\x20entry\x20found'};}catch(_0x5e3db5){return{'step':0x4,'label':_0x1f889e(0xff),'ok':![],'detail':_0x5e3db5[_0x1f889e(0x100)]};}}function execSkillsRemove(_0x194c2f,_0xe9c426){const _0x157a9a=a117_0x17e390,_0x58567a=runNpxSkillsRemove(_0x194c2f,{'stdio':_0x157a9a(0xdb),'yes':_0xe9c426});return{'step':0x5,'label':_0x157a9a(0xb6),'ok':_0x58567a['ok'],'detail':_0x58567a['ok']?_0x157a9a(0xe2):_0x58567a['error']??'exit\x20'+_0x58567a['status']};}function execSkillsAdd(_0x1ee994,_0x4292a5){const _0x4b03a4=a117_0x17e390,_0x3a78de=runNpxSkillsAddGlobal(_0x1ee994,_0x4b03a4(0x89),{'stdio':_0x4b03a4(0xdb),'yes':_0x4292a5});return{'step':0x6,'label':_0x4b03a4(0xa6),'ok':_0x3a78de['ok'],'detail':_0x3a78de['ok']?_0x4b03a4(0x8d):_0x3a78de[_0x4b03a4(0xe7)]??_0x4b03a4(0x84)+_0x3a78de[_0x4b03a4(0xd9)]};}function execUpgradeSdk(_0x824c7b){const _0x2f8630=a117_0x17e390;if(!_0x824c7b['sdkUpgrade'])return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x2f8630(0xfb)};const {pkgPath:_0x53fc3a,currentVersion:_0x5606b8,field:_0x591467}=_0x824c7b['sdkUpgrade'];try{const _0x39c12e=readFileSync(_0x53fc3a,_0x2f8630(0xeb)),_0x4489d6=JSON[_0x2f8630(0x9c)](_0x39c12e);return _0x4489d6[_0x591467][_0x2f8630(0xa2)]=_0x2f8630(0xbb),writeFileSync(_0x53fc3a,JSON[_0x2f8630(0x80)](_0x4489d6,null,0x2)+'\x0a',_0x2f8630(0xeb)),{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x591467+_0x2f8630(0xc9)+_0x5606b8+_0x2f8630(0x88)};}catch(_0x47464a){return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':![],'detail':_0x47464a['message']};}}function tryStat(_0x5a95a9){try{return statSync(_0x5a95a9);}catch{return undefined;}}function printSummary(_0x33caf6){const _0x367f4a=a117_0x17e390;console[_0x367f4a(0x96)](''),console[_0x367f4a(0x96)](a117_0x5d314['bold'](_0x367f4a(0x92))),console['log']('');for(const _0x2950a0 of _0x33caf6){const _0xec4f53=_0x2950a0['ok']?a117_0x5d314[_0x367f4a(0xb2)]('OK'):a117_0x5d314[_0x367f4a(0xe6)](_0x367f4a(0xb8));console[_0x367f4a(0x96)]('\x20\x20'+_0xec4f53+_0x367f4a(0x82)+_0x2950a0[_0x367f4a(0xaa)]+':\x20'+_0x2950a0[_0x367f4a(0x97)]);if(_0x2950a0['detail'])console[_0x367f4a(0x96)](_0x367f4a(0xb3)+a117_0x5d314[_0x367f4a(0xf1)](_0x2950a0[_0x367f4a(0xce)]));}console[_0x367f4a(0x96)]('');}export async function upgradeApp(_0xcd7bdc,_0x447b6e){const _0x5904db=a117_0x17e390,_0x473085=process[_0x5904db(0xd8)](),_0x59b446=analyse(_0x473085),_0x1d33a4=!_0x59b446[_0x5904db(0xee)]&&_0x59b446[_0x5904db(0x9b)]['length']===0x0&&!_0x59b446['oldMcpConfig']&&!_0x59b446[_0x5904db(0xec)]&&!_0x59b446[_0x5904db(0xef)];if(_0x1d33a4){console['log'](a117_0x5d314[_0x5904db(0xb2)]('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0x59b446);const _0x2d1aed=!!(_0x447b6e[_0x5904db(0xf6)]||_0x447b6e['Y']||_0xcd7bdc);if(!_0x2d1aed)try{const _0x295b1f=await askConfirm(_0x5904db(0xbc));if(!_0x295b1f){console[_0x5904db(0x96)](a117_0x5d314[_0x5904db(0xf1)](_0x5904db(0xa5)));return;}}catch(_0x530b0f){if(_0x530b0f?.[_0x5904db(0x100)]===_0x5904db(0xa4)){console[_0x5904db(0x96)](a117_0x5d314[_0x5904db(0xf1)](_0x5904db(0xa5)));return;}throw _0x530b0f;}const _0x4e41d7=[],_0x42d340=a117_0x679d75({'text':_0x5904db(0xc4),'color':_0x5904db(0xdc)})['start'](),_0xa23082=execConfigMigration(_0x59b446,_0x473085);_0x4e41d7[_0x5904db(0xb0)](_0xa23082),_0x42d340[_0xa23082['ok']?_0x5904db(0xba):_0x5904db(0x86)]('Step\x201/7:\x20Config\x20migration\x20—\x20'+(_0xa23082['detail']??(_0xa23082['ok']?_0x5904db(0xc3):_0x5904db(0xed))));const _0x381419=resolve(_0x473085,_0x5904db(0x95)),_0x22534f=a117_0x679d75({'text':_0x5904db(0x99),'color':_0x5904db(0xdc)})[_0x5904db(0xe1)]();if(existsSync(_0x381419))try{rmSync(_0x381419,{'recursive':!![],'force':!![]}),_0x22534f['succeed'](_0x5904db(0xfd)),_0x4e41d7['push']({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x364d3a){_0x22534f['fail'](_0x5904db(0xf3)+_0x364d3a[_0x5904db(0x100)]),_0x4e41d7[_0x5904db(0xb0)]({'step':0x2,'label':_0x5904db(0xa9),'ok':![],'detail':_0x364d3a[_0x5904db(0x100)]});}else _0x22534f[_0x5904db(0x81)](_0x5904db(0xae)),_0x4e41d7[_0x5904db(0xb0)]({'step':0x2,'label':_0x5904db(0xa9),'ok':!![],'detail':'skipped'});const _0x51884c=a117_0x679d75({'text':_0x5904db(0x9a),'color':'cyan'})[_0x5904db(0xe1)](),_0xa65329=execRemoveOldArtifacts(_0x59b446['oldArtifacts']);_0x4e41d7['push'](_0xa65329),_0x51884c[_0xa65329['ok']?_0x5904db(0xba):_0x5904db(0x86)](_0x5904db(0xd7)+(_0xa65329[_0x5904db(0xce)]??(_0xa65329['ok']?_0x5904db(0xc3):_0x5904db(0xed))));const _0x5df248=a117_0x679d75({'text':_0x5904db(0xfc),'color':_0x5904db(0xdc)})[_0x5904db(0xe1)](),_0xe8ea18=execCleanMcp(_0x59b446);_0x4e41d7[_0x5904db(0xb0)](_0xe8ea18),_0x5df248[_0xe8ea18['ok']?_0x5904db(0xba):'fail'](_0x5904db(0xbd)+(_0xe8ea18['detail']??(_0xe8ea18['ok']?_0x5904db(0xc3):_0x5904db(0xed))));const _0x521ec9=a117_0x679d75({'text':_0x5904db(0x9f),'color':_0x5904db(0xdc)})[_0x5904db(0xe1)](),_0x2fb0ab=execSkillsRemove(_0x473085,_0x2d1aed);_0x4e41d7[_0x5904db(0xb0)](_0x2fb0ab),_0x521ec9[_0x2fb0ab['ok']?'succeed':_0x5904db(0x86)](_0x5904db(0xc1)+(_0x2fb0ab[_0x5904db(0xce)]??(_0x2fb0ab['ok']?_0x5904db(0xc3):'failed')));const _0x1d8cb2=a117_0x679d75({'text':_0x5904db(0xe5),'color':_0x5904db(0xdc)})[_0x5904db(0xe1)](),_0x12ed51=execSkillsAdd(_0x473085,_0x2d1aed);_0x4e41d7[_0x5904db(0xb0)](_0x12ed51),_0x1d8cb2[_0x12ed51['ok']?_0x5904db(0xba):'fail'](_0x5904db(0xdf)+(_0x12ed51['detail']??(_0x12ed51['ok']?'done':_0x5904db(0xed))));const _0x269963=a117_0x679d75({'text':_0x5904db(0xc6),'color':_0x5904db(0xdc)})[_0x5904db(0xe1)](),_0x5585c3=execUpgradeSdk(_0x59b446);_0x4e41d7[_0x5904db(0xb0)](_0x5585c3),_0x269963[_0x5585c3['ok']?_0x5904db(0xba):_0x5904db(0x86)](_0x5904db(0x102)+(_0x5585c3['detail']??(_0x5585c3['ok']?'done':_0x5904db(0xed)))),printSummary(_0x4e41d7);const _0x115b3c=_0x4e41d7['some'](_0x5b04fb=>!_0x5b04fb['ok']);_0x115b3c?console[_0x5904db(0x96)](a117_0x5d314[_0x5904db(0xa8)](_0x5904db(0x94))):console['log'](a117_0x5d314[_0x5904db(0xb2)]('Upgrade\x20completed\x20successfully!')),_0x5585c3['ok']&&_0x59b446[_0x5904db(0xef)]&&(console[_0x5904db(0x96)](''),console[_0x5904db(0x96)](a117_0x5d314[_0x5904db(0x8b)][_0x5904db(0xdc)]('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console['log'](a117_0x5d314[_0x5904db(0xdc)](_0x5904db(0xb4))),console['log'](''),console[_0x5904db(0x96)](a117_0x5d314['white'](_0x5904db(0xc7))),console[_0x5904db(0x96)](a117_0x5d314[_0x5904db(0xab)]('\x20\x20#\x20or')),console[_0x5904db(0x96)](a117_0x5d314['white']('\x20\x20bun\x20install')),console['log'](''));}
|
|
1
|
+
const a124_0x2973df=a124_0x303a;(function(_0x4e1a77,_0x5ab289){const _0x119cdd=a124_0x303a,_0x37ce70=_0x4e1a77();while(!![]){try{const _0x4161f9=parseInt(_0x119cdd(0xd5))/0x1*(-parseInt(_0x119cdd(0x128))/0x2)+parseInt(_0x119cdd(0xee))/0x3+-parseInt(_0x119cdd(0xc0))/0x4+-parseInt(_0x119cdd(0xcb))/0x5+-parseInt(_0x119cdd(0x11b))/0x6+parseInt(_0x119cdd(0xcf))/0x7*(-parseInt(_0x119cdd(0xb3))/0x8)+parseInt(_0x119cdd(0xda))/0x9*(parseInt(_0x119cdd(0xe5))/0xa);if(_0x4161f9===_0x5ab289)break;else _0x37ce70['push'](_0x37ce70['shift']());}catch(_0x48e4a3){_0x37ce70['push'](_0x37ce70['shift']());}}}(a124_0x4b4c,0x5e93e));import a124_0x3899f4 from'chalk';import a124_0x2030c3 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[a124_0x2973df(0xca)](_0x354123=>_0x354123!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x399446){const _0x2b1ed5=a124_0x2973df,_0x50814a=[];for(const _0xa8773a of Object['values'](CORE_IDE_CONFIGS)){if(_0xa8773a[_0x2b1ed5(0x10d)])for(const _0x4ba84c of _0xa8773a['files']){_0x50814a[_0x2b1ed5(0x104)](resolve(_0x399446,_0x4ba84c[_0x2b1ed5(0x12b)]));}}return _0x50814a;}function analyse(_0x55ce9c){const _0x2addcc=a124_0x2973df;let _0x3693d1=null;const _0x4864a8=resolve(_0x55ce9c,NEW_CONFIG_NAME),_0x5e81b4=existsSync(_0x4864a8);for(const _0x1e45bd of LEGACY_CONFIG_NAMES){const _0x1f7050=resolve(_0x55ce9c,_0x1e45bd);if(existsSync(_0x1f7050)){const _0x2e66b3=readConfigFile(_0x1f7050),_0x148e94=Object['keys'](_0x2e66b3)[_0x2addcc(0xca)](_0x1a89f3=>typeof _0x2e66b3[_0x1a89f3]!==_0x2addcc(0xc6));_0x3693d1={'oldPath':_0x1f7050,'hasNewConfig':_0x5e81b4,'fields':_0x148e94};break;}}const _0xb33250=[],_0x19aa01=resolve(_0x55ce9c,_0x2addcc(0xf4));if(existsSync(_0x19aa01))_0xb33250[_0x2addcc(0x104)](_0x19aa01);const _0x58d00b=resolve(_0x55ce9c,_0x2addcc(0xfa));if(existsSync(_0x58d00b))_0xb33250[_0x2addcc(0x104)](_0x58d00b);const _0x5b4d6d=resolve(_0x55ce9c,_0x2addcc(0xef));if(existsSync(_0x5b4d6d))_0xb33250[_0x2addcc(0x104)](_0x5b4d6d);for(const _0x3bdf28 of collectIdeSkillFiles(_0x55ce9c)){if(existsSync(_0x3bdf28))_0xb33250[_0x2addcc(0x104)](_0x3bdf28);}let _0xb52401=null;const _0x23cba0=resolve(_0x55ce9c,_0x2addcc(0x123));if(existsSync(_0x23cba0))try{const _0x581951=JSON[_0x2addcc(0xf0)](readFileSync(_0x23cba0,_0x2addcc(0xfb)));if(_0x581951?.[_0x2addcc(0xff)]&&typeof _0x581951['mcpServers']==='object'){const _0x4e9104=[];for(const [_0x5bc7ba,_0x308caf]of Object[_0x2addcc(0x116)](_0x581951['mcpServers'])){const _0x5d2d1f=_0x308caf;_0x5d2d1f?.['args']&&Array[_0x2addcc(0xb9)](_0x5d2d1f[_0x2addcc(0x10b)])&&_0x5d2d1f[_0x2addcc(0x10b)][_0x2addcc(0xfd)](_0x1ae3a5=>typeof _0x1ae3a5===_0x2addcc(0xd9)&&_0x1ae3a5[_0x2addcc(0xb6)](_0x2addcc(0xdb)))&&_0x4e9104[_0x2addcc(0x104)](_0x5bc7ba);}_0x4e9104[_0x2addcc(0x109)]>0x0&&(_0xb52401={'path':_0x23cba0,'keys':_0x4e9104});}}catch{}const _0x1edd0a=_0xb33250[_0x2addcc(0x109)]>0x0||_0x3693d1!==null;let _0x262721=null;const _0x2e48cf=resolve(_0x55ce9c,'package.json');if(existsSync(_0x2e48cf))try{const _0x210939=JSON['parse'](readFileSync(_0x2e48cf,_0x2addcc(0xfb)));for(const _0x767726 of[_0x2addcc(0xd0),_0x2addcc(0xec)]){const _0x56e5db=_0x210939?.[_0x767726]?.['@lovrabet/sdk'];if(typeof _0x56e5db===_0x2addcc(0xd9)){_0x56e5db!=='latest'&&(_0x262721={'pkgPath':_0x2e48cf,'currentVersion':_0x56e5db,'field':_0x767726});break;}}}catch{}return{'configMigration':_0x3693d1,'oldArtifacts':_0xb33250,'oldMcpConfig':_0xb52401,'needsSkillSwap':_0x1edd0a,'sdkUpgrade':_0x262721};}function a124_0x303a(_0x169a27,_0x104861){_0x169a27=_0x169a27-0xb3;const _0x4b4c52=a124_0x4b4c();let _0x303af9=_0x4b4c52[_0x169a27];return _0x303af9;}function printReport(_0x57bec1){const _0x3b4ba0=a124_0x2973df,{configMigration:_0x25cc9e,oldArtifacts:_0xd0d4f,oldMcpConfig:_0x1efa74,needsSkillSwap:_0x5bdaad}=_0x57bec1;console[_0x3b4ba0(0xb4)](''),console[_0x3b4ba0(0xb4)](a124_0x3899f4[_0x3b4ba0(0x111)](_0x3b4ba0(0xe2))),console[_0x3b4ba0(0xb4)]('');_0x25cc9e?(console['log'](a124_0x3899f4[_0x3b4ba0(0xe9)](_0x3b4ba0(0xd1))+('\x20\x20'+a124_0x3899f4[_0x3b4ba0(0xfc)](_0x25cc9e[_0x3b4ba0(0x120)]))),console[_0x3b4ba0(0xb4)]('\x20\x20New\x20config\x20(.rabetbase.json):\x20'+(_0x25cc9e[_0x3b4ba0(0xea)]?a124_0x3899f4['green'](_0x3b4ba0(0xf9)):a124_0x3899f4[_0x3b4ba0(0xc8)](_0x3b4ba0(0x114)))),console['log'](_0x3b4ba0(0x110)+_0x25cc9e[_0x3b4ba0(0xba)][_0x3b4ba0(0xe4)](',\x20')),console['log'](_0x3b4ba0(0x11c))):console[_0x3b4ba0(0xb4)](a124_0x3899f4[_0x3b4ba0(0xe9)](_0x3b4ba0(0xd1))+'\x20\x20'+a124_0x3899f4[_0x3b4ba0(0xc8)](_0x3b4ba0(0xf1)));console['log']('');if(_0xd0d4f['length']>0x0){console['log'](a124_0x3899f4[_0x3b4ba0(0xe9)](_0x3b4ba0(0xe1)));for(const _0x55a9f9 of _0xd0d4f){console[_0x3b4ba0(0xb4)]('\x20\x20'+a124_0x3899f4[_0x3b4ba0(0xf7)]('FOUND')+'\x20\x20'+_0x55a9f9);}console[_0x3b4ba0(0xb4)](_0x3b4ba0(0x129));}else console[_0x3b4ba0(0xb4)](a124_0x3899f4[_0x3b4ba0(0xe9)](_0x3b4ba0(0xe1))+'\x20\x20'+a124_0x3899f4['gray']('none\x20found'));console[_0x3b4ba0(0xb4)]('');_0x1efa74?(console[_0x3b4ba0(0xb4)](a124_0x3899f4[_0x3b4ba0(0xe9)](_0x3b4ba0(0xbf))+('\x20\x20'+a124_0x3899f4[_0x3b4ba0(0xfc)](_0x1efa74[_0x3b4ba0(0x12b)])+_0x3b4ba0(0xeb)+_0x1efa74[_0x3b4ba0(0xed)][_0x3b4ba0(0xe4)](',\x20'))),console[_0x3b4ba0(0xb4)]('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console[_0x3b4ba0(0xb4)](a124_0x3899f4[_0x3b4ba0(0xe9)](_0x3b4ba0(0xbf))+'\x20\x20'+a124_0x3899f4[_0x3b4ba0(0xc8)](_0x3b4ba0(0x125)));console[_0x3b4ba0(0xb4)](''),console[_0x3b4ba0(0xb4)](a124_0x3899f4['cyan'](_0x3b4ba0(0xe3))+('\x20\x20'+(_0x5bdaad?a124_0x3899f4[_0x3b4ba0(0xfc)]('needed'):a124_0x3899f4['green'](_0x3b4ba0(0x10e)))));_0x5bdaad&&console[_0x3b4ba0(0xb4)]('\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`'+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console['log']('');if(_0x57bec1[_0x3b4ba0(0xbb)]){const {currentVersion:_0x22ea91,field:_0x219b32,pkgPath:_0x492c57}=_0x57bec1['sdkUpgrade'];console[_0x3b4ba0(0xb4)](a124_0x3899f4[_0x3b4ba0(0xe9)]('@lovrabet/sdk:')+('\x20\x20'+a124_0x3899f4[_0x3b4ba0(0xfc)](_0x492c57))),console[_0x3b4ba0(0xb4)](_0x3b4ba0(0xd2)+_0x219b32+':\x20'+a124_0x3899f4[_0x3b4ba0(0xfc)](_0x22ea91)+_0x3b4ba0(0x11e)+a124_0x3899f4[_0x3b4ba0(0xd4)](_0x3b4ba0(0x106))),console[_0x3b4ba0(0xb4)]('\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)');}else console[_0x3b4ba0(0xb4)](a124_0x3899f4[_0x3b4ba0(0xe9)]('@lovrabet/sdk:')+'\x20\x20'+a124_0x3899f4[_0x3b4ba0(0xc8)]('not\x20found\x20or\x20already\x20at\x20latest'));console['log']('');}function a124_0x4b4c(){const _0x556272=['===\x20Upgrade\x20Summary\x20===','MCP\x20config:','486524fDNSfs','skipped','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','CANCEL','skipped\x20(no\x20legacy\x20config)','oldMcpConfig','undefined','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','gray','stringify','filter','2538245Lugdiy','failed','no\x20matching\x20entry\x20found','\x20removed','14BYyqVa','dependencies','Config\x20file:','\x20\x20Current\x20version\x20in\x20','exit\x20','green','1tJMvie','detail','error','fail','string','45epKpvR','@lovrabet/dataset-mcp-server','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','Upgrade\x20cancelled.','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','white','\x20\x20\x20\x20\x20\x20\x20','Legacy\x20artifacts:','===\x20Upgrade\x20Analysis\x20===','Skill\x20swap:','join','4426190wjXdCQ','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','Remove\x20legacy\x20artifacts','cyan','hasNewConfig','\x20→\x20keys:\x20','devDependencies','keys','198504QXgqUV','.claude/skills/lovrabet','parse','no\x20legacy\x20config\x20found','@lovrabet/sdk','Upgrade\x20completed\x20successfully!','.lovrabet','Step\x201/7:\x20Config\x20migration\x20—\x20','message','red','\x20\x20#\x20or','already\x20exists\x20(will\x20merge)','.cursor/rules/lovrabet_rules.mdc','utf8','yellow','some','step','mcpServers','cwd','FAIL','\x20removed\x20(','\x20→\x20latest','push','yes','latest','succeed','Config\x20migration','length','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','args','needsSkillSwap','files','not\x20needed','removed\x20','\x20\x20Fields\x20to\x20migrate:\x20','bold','done','lovrabet/lovrabet-skill\x20removed','not\x20found\x20(will\x20create)','Step\x201/7:\x20Migrating\x20config...','entries','\x20\x20bun\x20install','Install\x20new\x20skill','status','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','4035492vzdXQU','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','Step\x204/7:\x20Cleaning\x20MCP\x20config...','\x20→\x20','label','oldPath','Clean\x20MCP\x20config','oldArtifacts','.cursor/mcp.json','Step\x204/7:\x20MCP\x20config\x20—\x20','no\x20legacy\x20entry','start','Remove\x20.lovrabet/','1069066JsegXQ','\x20\x20Action:\x20delete','lovrabet/rabetbase','path','Upgrade\x20@lovrabet/sdk','221912hmQeZR','log','inherit','includes','Step\x205/7:\x20Removing\x20old\x20skill...','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','isArray','fields','sdkUpgrade','\x20\x20Step\x20','info'];a124_0x4b4c=function(){return _0x556272;};return a124_0x4b4c();}function execConfigMigration(_0x289891,_0x4c8e69){const _0x512dda=a124_0x2973df,{configMigration:_0x38ead0}=_0x289891;if(!_0x38ead0?.[_0x512dda(0x120)])return{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x512dda(0xc4)};const _0x374f35=readConfigFile(_0x38ead0['oldPath']),_0x42b213=resolve(_0x4c8e69,NEW_CONFIG_NAME),_0x17b6d1=_0x38ead0[_0x512dda(0xea)]?readConfigFile(_0x42b213):{};for(const [_0xc5c259,_0x323133]of Object[_0x512dda(0x116)](_0x374f35)){!(_0xc5c259 in _0x17b6d1)&&(_0x17b6d1[_0xc5c259]=_0x323133);}writeConfigFile(_0x42b213,_0x17b6d1);const _0xf64de4=_0x38ead0['oldPath']+'.bak';return renameSync(_0x38ead0[_0x512dda(0x120)],_0xf64de4),{'step':0x1,'label':_0x512dda(0x108),'ok':!![],'detail':_0x38ead0[_0x512dda(0x120)]+_0x512dda(0x11e)+_0x42b213+'\x20(backup:\x20'+_0xf64de4+')'};}function execRemoveOldArtifacts(_0x32423e){const _0xede85b=a124_0x2973df,_0x14df91=[];for(const _0x475c25 of _0x32423e){try{if(!existsSync(_0x475c25))continue;const _0x3ba56a=tryStat(_0x475c25);_0x3ba56a?.['isDirectory']()?rmSync(_0x475c25,{'recursive':!![],'force':!![]}):unlinkSync(_0x475c25);}catch(_0x56d549){_0x14df91[_0xede85b(0x104)](_0x475c25+':\x20'+_0x56d549[_0xede85b(0xf6)]);}}return{'step':0x3,'label':_0xede85b(0xe8),'ok':_0x14df91[_0xede85b(0x109)]===0x0,'detail':_0x14df91[_0xede85b(0x109)]>0x0?_0x32423e['length']-_0x14df91[_0xede85b(0x109)]+'/'+_0x32423e[_0xede85b(0x109)]+_0xede85b(0x102)+_0x14df91[_0xede85b(0xe4)](';\x20')+')':_0x32423e['length']+_0xede85b(0xce)};}function execCleanMcp(_0x209011){const _0xc88430=a124_0x2973df;if(!_0x209011[_0xc88430(0xc5)])return{'step':0x4,'label':_0xc88430(0x121),'ok':!![],'detail':_0xc88430(0xc1)};try{const _0x26faf6=readFileSync(_0x209011[_0xc88430(0xc5)][_0xc88430(0x12b)],_0xc88430(0xfb)),_0x41df3d=JSON['parse'](_0x26faf6);if(_0x41df3d?.[_0xc88430(0xff)]&&typeof _0x41df3d[_0xc88430(0xff)]==='object'){const _0x2c7a6c=[];for(const [_0x4c448c,_0x47e550]of Object[_0xc88430(0x116)](_0x41df3d[_0xc88430(0xff)])){_0x47e550?.[_0xc88430(0x10b)]&&Array[_0xc88430(0xb9)](_0x47e550[_0xc88430(0x10b)])&&_0x47e550[_0xc88430(0x10b)]['some'](_0x11fbad=>typeof _0x11fbad==='string'&&_0x11fbad[_0xc88430(0xb6)](_0xc88430(0xdb)))&&_0x2c7a6c[_0xc88430(0x104)](_0x4c448c);}for(const _0xeb5e63 of _0x2c7a6c){delete _0x41df3d['mcpServers'][_0xeb5e63];}return _0x2c7a6c[_0xc88430(0x109)]>0x0&&writeFileSync(_0x209011[_0xc88430(0xc5)]['path'],JSON[_0xc88430(0xc9)](_0x41df3d,null,0x2)+'\x0a',_0xc88430(0xfb)),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0xc88430(0x10f)+_0x2c7a6c['join'](',\x20')+'\x20from\x20'+_0x209011[_0xc88430(0xc5)]['path']};}return{'step':0x4,'label':_0xc88430(0x121),'ok':!![],'detail':_0xc88430(0xcd)};}catch(_0x47f206){return{'step':0x4,'label':_0xc88430(0x121),'ok':![],'detail':_0x47f206[_0xc88430(0xf6)]};}}function execSkillsRemove(_0x5d2ae2,_0x5b4b99){const _0x3cc758=a124_0x2973df,_0x30155f=runNpxSkillsRemove(_0x5d2ae2,{'stdio':_0x3cc758(0xb5),'yes':_0x5b4b99});return{'step':0x5,'label':'Remove\x20old\x20skill','ok':_0x30155f['ok'],'detail':_0x30155f['ok']?_0x3cc758(0x113):_0x30155f['error']??_0x3cc758(0xd3)+_0x30155f[_0x3cc758(0x119)]};}function execSkillsAdd(_0x3eb07d,_0xfee786){const _0x4b6abc=a124_0x2973df,_0xffd632=runNpxSkillsAddGlobal(_0x3eb07d,_0x4b6abc(0x12a),{'stdio':_0x4b6abc(0xb5),'yes':_0xfee786});return{'step':0x6,'label':_0x4b6abc(0x118),'ok':_0xffd632['ok'],'detail':_0xffd632['ok']?'lovrabet/rabetbase\x20installed\x20globally':_0xffd632[_0x4b6abc(0xd7)]??'exit\x20'+_0xffd632[_0x4b6abc(0x119)]};}function execUpgradeSdk(_0x46a7e1){const _0x1cd1ad=a124_0x2973df;if(!_0x46a7e1[_0x1cd1ad(0xbb)])return{'step':0x7,'label':_0x1cd1ad(0x12c),'ok':!![],'detail':_0x1cd1ad(0x11a)};const {pkgPath:_0x352493,currentVersion:_0x2cfd13,field:_0x334819}=_0x46a7e1[_0x1cd1ad(0xbb)];try{const _0x24de00=readFileSync(_0x352493,_0x1cd1ad(0xfb)),_0x1fa49c=JSON[_0x1cd1ad(0xf0)](_0x24de00);return _0x1fa49c[_0x334819][_0x1cd1ad(0xf2)]=_0x1cd1ad(0x106),writeFileSync(_0x352493,JSON[_0x1cd1ad(0xc9)](_0x1fa49c,null,0x2)+'\x0a',_0x1cd1ad(0xfb)),{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x334819+'[\x22@lovrabet/sdk\x22]:\x20'+_0x2cfd13+_0x1cd1ad(0x103)};}catch(_0x18d1e7){return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':![],'detail':_0x18d1e7['message']};}}function tryStat(_0x17740a){try{return statSync(_0x17740a);}catch{return undefined;}}function printSummary(_0x474434){const _0xfc83e1=a124_0x2973df;console['log'](''),console['log'](a124_0x3899f4['bold'](_0xfc83e1(0xbe))),console[_0xfc83e1(0xb4)]('');for(const _0x35c8b1 of _0x474434){const _0xb7874f=_0x35c8b1['ok']?a124_0x3899f4[_0xfc83e1(0xd4)]('OK'):a124_0x3899f4['red'](_0xfc83e1(0x101));console[_0xfc83e1(0xb4)]('\x20\x20'+_0xb7874f+_0xfc83e1(0xbc)+_0x35c8b1[_0xfc83e1(0xfe)]+':\x20'+_0x35c8b1[_0xfc83e1(0x11f)]);if(_0x35c8b1['detail'])console['log'](_0xfc83e1(0xe0)+a124_0x3899f4[_0xfc83e1(0xc8)](_0x35c8b1[_0xfc83e1(0xd6)]));}console[_0xfc83e1(0xb4)]('');}export async function upgradeApp(_0xc6cbde,_0x478a50){const _0xd3fd20=a124_0x2973df,_0x2f9424=process[_0xd3fd20(0x100)](),_0x4ed372=analyse(_0x2f9424),_0x25c504=!_0x4ed372['configMigration']&&_0x4ed372[_0xd3fd20(0x122)][_0xd3fd20(0x109)]===0x0&&!_0x4ed372[_0xd3fd20(0xc5)]&&!_0x4ed372[_0xd3fd20(0x10c)]&&!_0x4ed372[_0xd3fd20(0xbb)];if(_0x25c504){console[_0xd3fd20(0xb4)](a124_0x3899f4[_0xd3fd20(0xd4)](_0xd3fd20(0xc7)));return;}printReport(_0x4ed372);const _0x11b72b=!!(_0x478a50[_0xd3fd20(0x105)]||_0x478a50['Y']||_0xc6cbde);if(!_0x11b72b)try{const _0x1354c0=await askConfirm('Proceed\x20with\x20upgrade?');if(!_0x1354c0){console[_0xd3fd20(0xb4)](a124_0x3899f4[_0xd3fd20(0xc8)]('Upgrade\x20cancelled.'));return;}}catch(_0x31520b){if(_0x31520b?.['message']===_0xd3fd20(0xc3)){console[_0xd3fd20(0xb4)](a124_0x3899f4[_0xd3fd20(0xc8)](_0xd3fd20(0xdd)));return;}throw _0x31520b;}const _0x122150=[],_0x29c416=a124_0x2030c3({'text':_0xd3fd20(0x115),'color':_0xd3fd20(0xe9)})[_0xd3fd20(0x126)](),_0x1fe71d=execConfigMigration(_0x4ed372,_0x2f9424);_0x122150[_0xd3fd20(0x104)](_0x1fe71d),_0x29c416[_0x1fe71d['ok']?_0xd3fd20(0x107):_0xd3fd20(0xd8)](_0xd3fd20(0xf5)+(_0x1fe71d[_0xd3fd20(0xd6)]??(_0x1fe71d['ok']?_0xd3fd20(0x112):_0xd3fd20(0xcc))));const _0x4265a6=resolve(_0x2f9424,_0xd3fd20(0xf4)),_0x34ff30=a124_0x2030c3({'text':'Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','color':_0xd3fd20(0xe9)})['start']();if(existsSync(_0x4265a6))try{rmSync(_0x4265a6,{'recursive':!![],'force':!![]}),_0x34ff30[_0xd3fd20(0x107)](_0xd3fd20(0xc2)),_0x122150[_0xd3fd20(0x104)]({'step':0x2,'label':_0xd3fd20(0x127),'ok':!![]});}catch(_0x57f8c0){_0x34ff30[_0xd3fd20(0xd8)](_0xd3fd20(0xde)+_0x57f8c0[_0xd3fd20(0xf6)]),_0x122150[_0xd3fd20(0x104)]({'step':0x2,'label':_0xd3fd20(0x127),'ok':![],'detail':_0x57f8c0[_0xd3fd20(0xf6)]});}else _0x34ff30[_0xd3fd20(0xbd)]('Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped'),_0x122150['push']({'step':0x2,'label':_0xd3fd20(0x127),'ok':!![],'detail':_0xd3fd20(0xc1)});const _0x213045=a124_0x2030c3({'text':_0xd3fd20(0xe7),'color':_0xd3fd20(0xe9)})[_0xd3fd20(0x126)](),_0x2fde33=execRemoveOldArtifacts(_0x4ed372['oldArtifacts']);_0x122150[_0xd3fd20(0x104)](_0x2fde33),_0x213045[_0x2fde33['ok']?'succeed':'fail']('Step\x203/7:\x20Legacy\x20artifacts\x20—\x20'+(_0x2fde33[_0xd3fd20(0xd6)]??(_0x2fde33['ok']?'done':_0xd3fd20(0xcc))));const _0xf13d0b=a124_0x2030c3({'text':_0xd3fd20(0x11d),'color':_0xd3fd20(0xe9)})['start'](),_0x3a6425=execCleanMcp(_0x4ed372);_0x122150['push'](_0x3a6425),_0xf13d0b[_0x3a6425['ok']?'succeed':'fail'](_0xd3fd20(0x124)+(_0x3a6425[_0xd3fd20(0xd6)]??(_0x3a6425['ok']?_0xd3fd20(0x112):_0xd3fd20(0xcc))));const _0x52a409=a124_0x2030c3({'text':_0xd3fd20(0xb7),'color':_0xd3fd20(0xe9)})[_0xd3fd20(0x126)](),_0x397f28=execSkillsRemove(_0x2f9424,_0x11b72b);_0x122150['push'](_0x397f28),_0x52a409[_0x397f28['ok']?'succeed':_0xd3fd20(0xd8)](_0xd3fd20(0xdc)+(_0x397f28[_0xd3fd20(0xd6)]??(_0x397f28['ok']?'done':_0xd3fd20(0xcc))));const _0x5e3eb5=a124_0x2030c3({'text':'Step\x206/7:\x20Installing\x20new\x20skill...','color':_0xd3fd20(0xe9)})[_0xd3fd20(0x126)](),_0x27c42e=execSkillsAdd(_0x2f9424,_0x11b72b);_0x122150[_0xd3fd20(0x104)](_0x27c42e),_0x5e3eb5[_0x27c42e['ok']?_0xd3fd20(0x107):'fail']('Step\x206/7:\x20Install\x20new\x20skill\x20—\x20'+(_0x27c42e['detail']??(_0x27c42e['ok']?_0xd3fd20(0x112):_0xd3fd20(0xcc))));const _0x48e472=a124_0x2030c3({'text':_0xd3fd20(0xb8),'color':_0xd3fd20(0xe9)})['start'](),_0x145e69=execUpgradeSdk(_0x4ed372);_0x122150['push'](_0x145e69),_0x48e472[_0x145e69['ok']?_0xd3fd20(0x107):_0xd3fd20(0xd8)](_0xd3fd20(0x10a)+(_0x145e69['detail']??(_0x145e69['ok']?'done':_0xd3fd20(0xcc)))),printSummary(_0x122150);const _0x33c02e=_0x122150['some'](_0x2a0c0c=>!_0x2a0c0c['ok']);_0x33c02e?console['log'](a124_0x3899f4[_0xd3fd20(0xfc)](_0xd3fd20(0xe6))):console[_0xd3fd20(0xb4)](a124_0x3899f4[_0xd3fd20(0xd4)](_0xd3fd20(0xf3))),_0x145e69['ok']&&_0x4ed372[_0xd3fd20(0xbb)]&&(console[_0xd3fd20(0xb4)](''),console[_0xd3fd20(0xb4)](a124_0x3899f4[_0xd3fd20(0x111)]['cyan']('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console['log'](a124_0x3899f4[_0xd3fd20(0xe9)]('Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:')),console[_0xd3fd20(0xb4)](''),console[_0xd3fd20(0xb4)](a124_0x3899f4['white']('\x20\x20npm\x20install')),console[_0xd3fd20(0xb4)](a124_0x3899f4[_0xd3fd20(0xdf)](_0xd3fd20(0xf8))),console[_0xd3fd20(0xb4)](a124_0x3899f4['white'](_0xd3fd20(0x117))),console[_0xd3fd20(0xb4)](''));}
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a125_0x119477=a125_0x5a56;(function(_0x389be5,_0x1dec30){const _0x13cd23=a125_0x5a56,_0x57f550=_0x389be5();while(!![]){try{const _0x5375ad=parseInt(_0x13cd23(0xb3))/0x1*(-parseInt(_0x13cd23(0x8a))/0x2)+parseInt(_0x13cd23(0x86))/0x3+-parseInt(_0x13cd23(0xae))/0x4*(parseInt(_0x13cd23(0xb4))/0x5)+-parseInt(_0x13cd23(0x9e))/0x6*(parseInt(_0x13cd23(0x83))/0x7)+-parseInt(_0x13cd23(0xb2))/0x8+parseInt(_0x13cd23(0x89))/0x9+parseInt(_0x13cd23(0x85))/0xa;if(_0x5375ad===_0x1dec30)break;else _0x57f550['push'](_0x57f550['shift']());}catch(_0x393e85){_0x57f550['push'](_0x57f550['shift']());}}}(a125_0x3433,0x52731));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{appConfigDefinitions}from'../commands/app-config/index.js';import{workspaceDefinitions}from'../commands/workspace/index.js';import{configDefinitions}from'../commands/config/index.js';import{doctorDefinition}from'../commands/doctor.js';import{updateDefinition}from'../commands/cli-update.js';import{schemaDefinition}from'../commands/schema.js';function a125_0x3433(){const _0x112b48=['write','isSingleCommand','4844200utBHFj','30035YgVoQe','10YXVvZK','show','Project','Menu','project','API','Self\x20Update','14PMQVAP','defaultCommand','14368550OoijkZ','1508037HDPGaA','set','risk','4615677RAMzJJ','22CyybHT','create','Instant\x20API','Skills','Authentication','map','\x20\x20[write]','Code\x20Generation','service','Configuration','has','read','Platform\x20Issue','start','App\x20Management','logout','Remote\x20App\x20Config','Dataset\x20&\x20Operations','get','\x20\x20[high-risk-write]','1724424wrvTeJ','Smart\x20List\x20Pages','skill','SQL\x20Queries','wildcardDef','values','Run\x20any\x20package.json\x20script','auth','run','BFF\x20Scripts','Run\x20Scripts','from','description','Logs','Schema','push','1207912IbeRyu','command'];a125_0x3433=function(){return _0x112b48;};return a125_0x3433();}import{issueDefinitions}from'../commands/issue/index.js';function a125_0x5a56(_0xdcee2,_0x1c7e67){_0xdcee2=_0xdcee2-0x81;const _0x343340=a125_0x3433();let _0x5a565f=_0x343340[_0xdcee2];return _0x5a565f;}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(_0x2be25d){const _0x3e6106=a125_0x5a56;for(const _0x432e16 of _0x2be25d){definitions[_0x3e6106(0x87)](_0x432e16[_0x3e6106(0x92)]+':'+_0x432e16[_0x3e6106(0xaf)],_0x432e16);let _0x1684a6=serviceGroups[_0x3e6106(0x9c)](_0x432e16[_0x3e6106(0x92)]);!_0x1684a6&&(_0x1684a6=[],serviceGroups[_0x3e6106(0x87)](_0x432e16[_0x3e6106(0x92)],_0x1684a6)),_0x1684a6[_0x3e6106(0xad)](_0x432e16);}}function registerDeclarativeService(_0x31ab74,_0x4e41a8,_0x44619f){const _0x1d9fd0=a125_0x5a56;registerDefinitions(_0x4e41a8);_0x44619f?.['wildcardDef']&®isterDefinitions([_0x44619f[_0x1d9fd0(0xa2)]]);const _0x1ede32=_0x4373cd=>_0x4373cd===_0x1d9fd0(0x95)?'':_0x4373cd===_0x1d9fd0(0xb0)?_0x1d9fd0(0x90):_0x1d9fd0(0x9d),_0x30120f={'service':_0x4e41a8[0x0][_0x1d9fd0(0x92)],'label':_0x31ab74,'commands':_0x4e41a8[_0x1d9fd0(0x8f)](_0x547395=>({'command':_0x547395[_0x1d9fd0(0xaf)],'description':_0x547395[_0x1d9fd0(0xaa)],'tag':_0x1ede32(_0x547395[_0x1d9fd0(0x88)])})),'declarative':!![],'defaultCommand':_0x44619f?.[_0x1d9fd0(0x84)]??(_0x44619f?.[_0x1d9fd0(0xb1)]?_0x4e41a8[0x0][_0x1d9fd0(0xaf)]:undefined),'wildcardDef':_0x44619f?.[_0x1d9fd0(0xa2)],'isSingleCommand':_0x44619f?.[_0x1d9fd0(0xb1)]};serviceRegistry[_0x1d9fd0(0xad)](_0x30120f),serviceByName[_0x1d9fd0(0x87)](_0x30120f[_0x1d9fd0(0x92)],_0x30120f);}registerDeclarativeService('Quick\x20Start',initDefinitions,{'defaultCommand':'run','isSingleCommand':!![]}),registerDeclarativeService(a125_0x119477(0xb6),projectDefinitions),registerDeclarativeService('Workspace',workspaceDefinitions),registerDeclarativeService(a125_0x119477(0x98),appDefinitions),registerDeclarativeService(a125_0x119477(0xa8),[runDefinition],{'wildcardDef':runDefinition});{const last=serviceRegistry[serviceRegistry['length']-0x1];last['commands']=[{'command':'<script>','description':a125_0x119477(0xa4),'tag':''}];}registerDeclarativeService(a125_0x119477(0x8e),authDefinitions,{'defaultCommand':'login'}),registerDeclarativeService(a125_0x119477(0x82),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService('Diagnostics',[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a125_0x119477(0xac),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a125_0x119477(0x93),configDefinitions),registerDeclarativeService(a125_0x119477(0x9a),appConfigDefinitions),registerDeclarativeService(a125_0x119477(0x96),issueDefinitions),registerDeclarativeService(a125_0x119477(0x81),apiDefinitions),registerDeclarativeService(a125_0x119477(0xb7),menuDefinitions),registerDeclarativeService('Database\x20Connections',dbDefinitions),registerDeclarativeService(a125_0x119477(0x9b),datasetDefinitions),registerDeclarativeService(a125_0x119477(0x9f),pageDefinitions),registerDeclarativeService(a125_0x119477(0x8c),dataDefinitions),registerDeclarativeService(a125_0x119477(0xa7),bffDefinitions),registerDeclarativeService(a125_0x119477(0xa1),sqlDefinitions),registerDeclarativeService(a125_0x119477(0x91),codegenDefinitions),registerDeclarativeService(a125_0x119477(0x8d),skillDefinitions),registerDeclarativeService(a125_0x119477(0xab),logsDefinitions,{'defaultCommand':a125_0x119477(0xb5)});export const deprecatedAliases={'create':{'service':a125_0x119477(0xb8),'command':a125_0x119477(0x8b)},'start':{'service':a125_0x119477(0xa6),'command':a125_0x119477(0x97)},'build':{'service':a125_0x119477(0xa6),'command':'build'},'preview':{'service':a125_0x119477(0xa6),'command':'preview'},'logout':{'service':a125_0x119477(0xa5),'command':a125_0x119477(0x99)},'skills':{'service':a125_0x119477(0xa0),'command':'install'}};export const deprecatedSubcommands={'bff':{'new':a125_0x119477(0x8b)},'sql':{'new':'create'}};export function resolveDeprecatedSubcommand(_0x3046f8,_0x215576){return deprecatedSubcommands[_0x3046f8]?.[_0x215576];}export function findDefinition(_0x58301c,_0x5aaa8a){const _0x17e18a=a125_0x119477;return definitions[_0x17e18a(0x9c)](_0x58301c+':'+_0x5aaa8a);}export function isKnownService(_0x3e992){const _0x36170=a125_0x119477;return serviceByName[_0x36170(0x94)](_0x3e992);}export function isDeclarativeService(_0x1e4558){const _0x26e759=a125_0x119477;return serviceGroups[_0x26e759(0x94)](_0x1e4558)||serviceByName[_0x26e759(0x9c)](_0x1e4558)?.[_0x26e759(0xa2)]!==undefined;}export function getServiceEntry(_0x173174){const _0x265405=a125_0x119477;return serviceByName[_0x265405(0x9c)](_0x173174);}export function getLegacyHandler(_0x424841,_0x296401){return undefined;}export function getAllDefinitions(){const _0x5b1ecd=a125_0x119477;return Array[_0x5b1ecd(0xa9)](definitions[_0x5b1ecd(0xa3)]());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a126_0x123563=a126_0x101a;(function(_0x23e21e,_0x111224){const _0x3742c5=a126_0x101a,_0x486e4c=_0x23e21e();while(!![]){try{const _0x78f067=parseInt(_0x3742c5(0xf0))/0x1*(-parseInt(_0x3742c5(0xd6))/0x2)+parseInt(_0x3742c5(0xec))/0x3*(-parseInt(_0x3742c5(0xd8))/0x4)+parseInt(_0x3742c5(0xea))/0x5+parseInt(_0x3742c5(0x104))/0x6*(parseInt(_0x3742c5(0xf3))/0x7)+-parseInt(_0x3742c5(0xe7))/0x8+-parseInt(_0x3742c5(0xff))/0x9+-parseInt(_0x3742c5(0xce))/0xa*(-parseInt(_0x3742c5(0xd3))/0xb);if(_0x78f067===_0x111224)break;else _0x486e4c['push'](_0x486e4c['shift']());}catch(_0x478b22){_0x486e4c['push'](_0x486e4c['shift']());}}}(a126_0x4cbe,0xce7d5));import{readFileSync,existsSync}from'node:fs';function a126_0x101a(_0x59c7c6,_0x4ae350){_0x59c7c6=_0x59c7c6-0xce;const _0x4cbecb=a126_0x4cbe();let _0x101a2a=_0x4cbecb[_0x59c7c6];return _0x101a2a;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{resolve,delimiter,join}from'node:path';function a126_0x4cbe(){const _0x179b96=['map','No\x20scripts\x20defined\x20in\x20package.json.','validation','\x20run\x20preview','593190AFzcUY','belowMinimum','boolean','build','Enable\x20watch\x20mode\x20for\x20preview','555012sGdfWe','bun.lockb','\x20\x20AVAILABLE\x20SCRIPTS\x20\x20(current\x20project)','bun.lock','30GiNCaV','\x22\x20not\x20found\x20in\x20package.json.','\x20run\x20<script>\x0a','slice','bool','6167337zwrdOP','log','\x20exited\x20with\x20code\x20','3145386zDGMKa','Script\x20\x22','561128squgeQ','length','join','padEnd','vite\x20build\x20--watch\x20exited\x20with\x20code\x20','yarn','parse','args','push','start','inherit','preview','\x0a\x20\x20Available\x20scripts:\x0a','Script\x20name\x20defined\x20in\x20package.json','needsUpgrade','673352SJmVEQ','No\x20package.json\x20found\x20in\x20current\x20directory.','node_modules','986870NJUVRE','read','9NJKrGI','\x20run\x20','bun','keys','1rZREHp','vite','cwd','84GIIbst','error','\x20\x20\x20\x20','max','.bin','pnpm-lock.yaml','close','utf-8'];a126_0x4cbe=function(){return _0x179b96;};return a126_0x4cbe();}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([a126_0x123563(0xe1),'dev']);function readPackageScripts(_0x3d1618){const _0x118058=a126_0x123563,_0x3c7a7d=resolve(_0x3d1618,'package.json');if(!existsSync(_0x3c7a7d))return null;try{const _0x113105=JSON[_0x118058(0xde)](readFileSync(_0x3c7a7d,_0x118058(0xfa)));return _0x113105['scripts']??{};}catch{return null;}}function detectPackageManager(_0x50a0ae){const _0x37259e=a126_0x123563;if(existsSync(resolve(_0x50a0ae,_0x37259e(0x105)))||existsSync(resolve(_0x50a0ae,_0x37259e(0x107))))return _0x37259e(0xee);if(existsSync(resolve(_0x50a0ae,_0x37259e(0xf8))))return'pnpm';if(existsSync(resolve(_0x50a0ae,'yarn.lock')))return _0x37259e(0xdd);return'npm';}async function versionCheck(_0x1f2dc1){const _0x46430b=a126_0x123563,_0x2a39e4=await checkCliVersion();(_0x2a39e4[_0x46430b(0xe6)]||_0x2a39e4[_0x46430b(0x100)])&&(printCliUpgradeWarning(_0x2a39e4),assertCliVersionSupported(_0x2a39e4));const _0x667bb3=await checkSdkVersion(_0x1f2dc1);if(_0x667bb3[_0x46430b(0xe6)])printSdkUpgradeWarning(_0x667bb3);}function spawnScript(_0x40d875,_0x12db76,_0x35dc6e,_0x27e875){return new Promise((_0x306990,_0x4d72f4)=>{const _0x47752b=a126_0x101a,_0x24c6cc=['run',_0x12db76,..._0x35dc6e],_0x391d26=spawn(_0x40d875,_0x24c6cc,{'cwd':_0x27e875,'stdio':_0x47752b(0xe2),'shell':!![],'env':{...process.env,'PATH':''+join(_0x27e875,'node_modules',_0x47752b(0xf7))+delimiter+process.env.PATH}});_0x391d26['on']('close',_0x77e10a=>{const _0x3150cf=_0x47752b;if(_0x77e10a===0x0||_0x77e10a===null)_0x306990();else _0x4d72f4(new Error(_0x40d875+_0x3150cf(0xed)+_0x12db76+_0x3150cf(0xd5)+_0x77e10a));}),_0x391d26['on']('error',_0x4d72f4);});}function spawnViteBuildWatch(_0x2240e0){return new Promise((_0x2c16a4,_0x3128c5)=>{const _0x179ef6=a126_0x101a,_0x534032=spawn(_0x179ef6(0xf1),[_0x179ef6(0x102),'--watch'],{'cwd':_0x2240e0,'stdio':_0x179ef6(0xe2),'shell':!![],'env':{...process.env,'PATH':''+join(_0x2240e0,_0x179ef6(0xe9),_0x179ef6(0xf7))+delimiter+process.env.PATH}});_0x534032['on']('close',_0x4251e3=>{const _0x5786e7=_0x179ef6;if(_0x4251e3===0x0||_0x4251e3===null)_0x2c16a4();else _0x3128c5(new Error(_0x5786e7(0xdc)+_0x4251e3));}),_0x534032['on'](_0x179ef6(0xf4),_0x3128c5);});}function spawnVitePreview(_0x53f00d){return new Promise((_0xe60c,_0x370954)=>{const _0xfea353=a126_0x101a,_0x1ed85f=spawn(_0xfea353(0xf1),[_0xfea353(0xe3)],{'cwd':_0x53f00d,'stdio':'inherit','shell':!![],'env':{...process.env,'PATH':''+join(_0x53f00d,_0xfea353(0xe9),'.bin')+delimiter+process.env.PATH}});_0x1ed85f['on'](_0xfea353(0xf9),_0x93e5e5=>{if(_0x93e5e5===0x0||_0x93e5e5===null)_0xe60c();else _0x370954(new Error('vite\x20preview\x20exited\x20with\x20code\x20'+_0x93e5e5));}),_0x1ed85f['on']('error',_0x370954);});}const runFlags=[{'name':'watch','type':a126_0x123563(0x101),'description':a126_0x123563(0x103),'default':![]}];export const runDefinition={'service':'run','command':'run','description':'Run\x20a\x20package.json\x20script','risk':a126_0x123563(0xeb),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'script','description':a126_0x123563(0xe5),'required':![]}],'flags':runFlags,'helpExtra':()=>{const _0x164248=a126_0x123563,_0x25a923=readPackageScripts(process[_0x164248(0xf2)]()),_0x274437=[];if(_0x25a923&&Object[_0x164248(0xef)](_0x25a923)['length']>0x0){const _0x23fb42=Object[_0x164248(0xef)](_0x25a923),_0x2d4620=Math[_0x164248(0xf6)](..._0x23fb42['map'](_0x15a9c1=>_0x15a9c1[_0x164248(0xd9)]));_0x274437[_0x164248(0xe0)](_0x164248(0x106));for(const [_0x4cd25d,_0x25863e]of Object['entries'](_0x25a923)){_0x274437[_0x164248(0xe0)](_0x164248(0xf5)+CLI_BIN_NAME+_0x164248(0xed)+_0x4cd25d[_0x164248(0xdb)](_0x2d4620+0x2)+'#\x20'+_0x25863e);}}else _0x274437['push']('\x20\x20EXAMPLES'),_0x274437[_0x164248(0xe0)]('\x20\x20\x20\x20'+CLI_BIN_NAME+'\x20run\x20start'),_0x274437[_0x164248(0xe0)](_0x164248(0xf5)+CLI_BIN_NAME+'\x20run\x20build'),_0x274437[_0x164248(0xe0)]('\x20\x20\x20\x20'+CLI_BIN_NAME+_0x164248(0xfe)),_0x274437['push'](_0x164248(0xf5)+CLI_BIN_NAME+'\x20run\x20preview\x20--watch\x20\x20\x20#\x20parallel\x20build\x20--watch\x20+\x20preview');return _0x274437[_0x164248(0xda)]('\x0a');},async 'execute'(_0x3bd89a){const _0x3ca840=a126_0x123563,_0x3bfba1=process[_0x3ca840(0xf2)](),_0x6572e9=_0x3bd89a[_0x3ca840(0xdf)][0x0],_0x5192b3=_0x3bd89a['args'][_0x3ca840(0xd1)](0x1),_0x367401=readPackageScripts(_0x3bfba1);if(!_0x367401)throw CliErrors[_0x3ca840(0xfd)](_0x3ca840(0xe8));if(!_0x6572e9){const _0x498384=Object['keys'](_0x367401);if(_0x498384[_0x3ca840(0xd9)]===0x0)console[_0x3ca840(0xd4)](_0x3ca840(0xfc));else{console[_0x3ca840(0xd4)](_0x3ca840(0xe4));const _0xf327f3=Math['max'](..._0x498384[_0x3ca840(0xfb)](_0x278a82=>_0x278a82['length']));for(const [_0x2bfb14,_0x52c301]of Object['entries'](_0x367401)){console[_0x3ca840(0xd4)](_0x3ca840(0xf5)+_0x2bfb14[_0x3ca840(0xdb)](_0xf327f3+0x2)+_0x52c301);}console[_0x3ca840(0xd4)]('\x0a\x20\x20Usage:\x20'+CLI_BIN_NAME+_0x3ca840(0xd0));}return{'ok':!![]};}if(!_0x367401[_0x6572e9])throw CliErrors['validation'](_0x3ca840(0xd7)+_0x6572e9+_0x3ca840(0xcf),'Available:\x20'+(Object[_0x3ca840(0xef)](_0x367401)[_0x3ca840(0xda)](',\x20')||'(none)'));const _0x434286=detectPackageManager(_0x3bfba1);VERSION_CHECK_SCRIPTS['has'](_0x6572e9)&&await versionCheck(_0x3bfba1);if(_0x6572e9==='preview'&&_0x3bd89a[_0x3ca840(0xd2)]('watch'))return await Promise['all']([spawnViteBuildWatch(_0x3bfba1),spawnVitePreview(_0x3bfba1)]),{'ok':!![]};return await spawnScript(_0x434286,_0x6572e9,_0x5192b3,_0x3bfba1),{'ok':!![]};}};
|
package/lib/commands/schema.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a127_0x67b262=a127_0x137d;(function(_0x15410d,_0x48680c){const _0x41e76c=a127_0x137d,_0x2d6f11=_0x15410d();while(!![]){try{const _0x5ac40c=-parseInt(_0x41e76c(0x159))/0x1+-parseInt(_0x41e76c(0x15c))/0x2*(parseInt(_0x41e76c(0x15b))/0x3)+parseInt(_0x41e76c(0x160))/0x4+parseInt(_0x41e76c(0x15e))/0x5+parseInt(_0x41e76c(0x165))/0x6+-parseInt(_0x41e76c(0x15f))/0x7+parseInt(_0x41e76c(0x161))/0x8*(parseInt(_0x41e76c(0x15a))/0x9);if(_0x5ac40c===_0x48680c)break;else _0x2d6f11['push'](_0x2d6f11['shift']());}catch(_0x33249f){_0x2d6f11['push'](_0x2d6f11['shift']());}}}(a127_0x1563,0x29f31));function a127_0x137d(_0x3a1c0f,_0x2caefe){_0x3a1c0f=_0x3a1c0f-0x159;const _0x156312=a127_0x1563();let _0x137da7=_0x156312[_0x3a1c0f];return _0x137da7;}import{buildSchemaPayload}from'../framework/schema-export.js';async function execute(_0x7d2fa7){const _0xd6b96b=await buildSchemaPayload();return{'ok':!![],'data':_0xd6b96b};}function a127_0x1563(){const _0x2e6570=['679632GgbSkH','338952dhlmBV','json','Export\x20machine-readable\x20command\x20schema\x20(JSON)','read','1912758xuPthQ','152918cRNLeA','9pIBDqc','301641bZFhsU','6DGIyOz','schema','564575hpogPM','123207cNKaKv'];a127_0x1563=function(){return _0x2e6570;};return a127_0x1563();}export const schemaDefinition={'service':a127_0x67b262(0x15d),'command':'export','description':a127_0x67b262(0x163),'risk':a127_0x67b262(0x164),'requiresAuth':![],'requiresAppCode':![],'hasFormat':!![],'defaultOutputFormat':a127_0x67b262(0x162),'flags':[],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a128_0x378022=a128_0x3893;(function(_0x4ed5fd,_0x259eb9){const _0x47e304=a128_0x3893,_0x33da79=_0x4ed5fd();while(!![]){try{const _0x1be15d=-parseInt(_0x47e304(0x122))/0x1+parseInt(_0x47e304(0x114))/0x2*(-parseInt(_0x47e304(0x10c))/0x3)+parseInt(_0x47e304(0x118))/0x4+-parseInt(_0x47e304(0x124))/0x5*(-parseInt(_0x47e304(0x125))/0x6)+-parseInt(_0x47e304(0x11b))/0x7*(-parseInt(_0x47e304(0x115))/0x8)+parseInt(_0x47e304(0x11e))/0x9+-parseInt(_0x47e304(0x10b))/0xa;if(_0x1be15d===_0x259eb9)break;else _0x33da79['push'](_0x33da79['shift']());}catch(_0x510fac){_0x33da79['push'](_0x33da79['shift']());}}}(a128_0x4cd7,0x85bc5));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';function a128_0x3893(_0x5c6e8a,_0x1c811a){_0x5c6e8a=_0x5c6e8a-0x108;const _0x4cd762=a128_0x4cd7();let _0x38939c=_0x4cd762[_0x5c6e8a];return _0x38939c;}import{logger}from'../../utils/logger.js';import{NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE}from'../../skills/npx-skills-add.js';export const skillDefinitions=[{'service':a128_0x378022(0x109),'command':a128_0x378022(0x108),'description':'Install\x20developer\x20skill\x20package','risk':a128_0x378022(0x112),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x34505){const _0x1716af=a128_0x378022;logger[_0x1716af(0x121)](process[_0x1716af(0x11c)]()),logger[_0x1716af(0x113)](_0x1716af(0x119),_0x1716af(0x10a));const {runNpxSkillsAddGlobal:_0x31330e}=await import(_0x1716af(0x10f)),_0x3508e8=_0x34505[_0x1716af(0x11a)]?_0x1716af(0x110):_0x1716af(0x10e);console['log'](_0x1716af(0x111)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+')...');const _0x19bca6=_0x31330e(process[_0x1716af(0x11c)](),_0x1716af(0x117),{'stdio':_0x3508e8});if(_0x19bca6[_0x1716af(0x120)])console['log']('Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20skill\x20is\x20already\x20present.');else{if(_0x19bca6['ok'])console['log'](CLI_BIN_NAME+_0x1716af(0x11f));else throw CliErrors[_0x1716af(0x123)](_0x1716af(0x11d)+(_0x19bca6[_0x1716af(0x10d)]||'unknown'),_0x1716af(0x116));}return{'ok':!![]};}}];function a128_0x4cd7(){const _0x456c76=['error','inherit','../../skills/npx-skills-add.js','pipe','Installing\x20official\x20skill\x20via\x20npx\x20(','write','info','3732PMWLAS','48oJfXED','Check\x20network\x20connectivity\x20and\x20try\x20again.','lovrabet/rabetbase','2693432kEBHHj','skill-install','nonInteractive','63182tFWPXo','cwd','npx\x20skills\x20add\x20failed:\x20','4023153LYJBPb','\x20skill\x20installed','skipped','setLogPath','386243WMeFDX','apiError','5WoFcHP','2513208MfPvyn','install','skill','执行安装技能包命令(委托给\x20npx\x20skills\x20add\x20-g\x20-y)','1443590pfQYcU','828AiqtxO'];a128_0x4cd7=function(){return _0x456c76;};return a128_0x4cd7();}
|