@lovrabet/rabetbase-cli 2.3.1-beta.2 → 2.3.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 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.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 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.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/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(_0x59568c,_0x570042){const _0x47d841=a116_0x2d9a,_0x3424b2=_0x59568c();while(!![]){try{const _0x2e5fb3=parseInt(_0x47d841(0x124))/0x1+-parseInt(_0x47d841(0x127))/0x2*(parseInt(_0x47d841(0x12f))/0x3)+-parseInt(_0x47d841(0x137))/0x4*(-parseInt(_0x47d841(0x13b))/0x5)+parseInt(_0x47d841(0x138))/0x6+-parseInt(_0x47d841(0x122))/0x7*(parseInt(_0x47d841(0x136))/0x8)+parseInt(_0x47d841(0x125))/0x9+-parseInt(_0x47d841(0x135))/0xa;if(_0x2e5fb3===_0x570042)break;else _0x3424b2['push'](_0x3424b2['shift']());}catch(_0x3433b0){_0x3424b2['push'](_0x3424b2['shift']());}}}(a116_0xd32c,0xe56f1));function a116_0x2d9a(_0x2fe5a8,_0x260518){_0x2fe5a8=_0x2fe5a8-0x120;const _0xd32c0a=a116_0xd32c();let _0x2d9af7=_0xd32c0a[_0x2fe5a8];return _0x2d9af7;}import{existsSync}from'node:fs';import a116_0xd0e145 from'node:path';import a116_0x414ca7 from'chalk';import{input,confirm}from'@inquirer/prompts';function a116_0xd32c(){const _0x190813=['115649vAdYqg','14410638YYqHGH','env','2ktBjth','test','\x22\x20already\x20exists','Not\x20set','resolve','√\x20Login\x20status:\x20','log','Logged\x20in','3029241tRUOht','cwd','Skipped','string','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','Directory\x20\x22','8214780PNqsrC','11432264iMcNeR','16BHigxu','7591920aksojt','my-app','Project\x20name:','1522335mDfjUs','green','length','production','Project\x20name\x20cannot\x20exceed\x2050\x20characters','7daRINt','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_'];a116_0xd32c=function(){return _0x190813;};return a116_0xd32c();}import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x3913cb,_0x148ec9,_0x379f64){const _0x5f512c=a116_0x2d9a,_0x2f4198=_0x5f512c(0x139),_0x51def5=readConfig(),_0x50d1d6=typeof _0x51def5[_0x5f512c(0x126)]===_0x5f512c(0x132)?_0x51def5[_0x5f512c(0x126)]:undefined,_0x3eadbe=await input({'message':_0x5f512c(0x13a),'default':_0x2f4198,'validate':_0x5805e7=>{const _0xcdc074=_0x5f512c,_0x50d461=_0x5805e7['trim']()||_0x2f4198;if(_0x50d461[_0xcdc074(0x13d)]>0x32)return _0xcdc074(0x121);const _0x50a544=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x50d461&&!_0x50a544[_0xcdc074(0x128)](_0x50d461))return _0xcdc074(0x123);const _0x4b9538=a116_0xd0e145[_0xcdc074(0x12b)](process[_0xcdc074(0x130)](),_0x50d461);if(existsSync(_0x4b9538))return _0xcdc074(0x134)+_0x50d461+_0xcdc074(0x129);return!![];}});console[_0x5f512c(0x12d)](a116_0x414ca7[_0x5f512c(0x13c)]('√\x20Project\x20Name:\x20'+a116_0x414ca7['cyan'](_0x3eadbe)));const _0x28aa02=await selectSingleAppcode(_0x379f64);console[_0x5f512c(0x12d)](a116_0x414ca7[_0x5f512c(0x13c)]('√\x20App\x20Code:\x20'+a116_0x414ca7['cyan'](_0x28aa02||_0x5f512c(0x12a))));if(_0x28aa02){const _0xa57619=await getIsSessionValid();if(!_0xa57619){const _0x1e5643=await confirm({'message':_0x5f512c(0x133),'default':!![]});if(_0x1e5643){const _0x4c9c54=await authServer({'silent':!![]});console[_0x5f512c(0x12d)](a116_0x414ca7[_0x5f512c(0x13c)](_0x5f512c(0x12c)+a116_0x414ca7['cyan'](_0x4c9c54?_0x5f512c(0x12e):'Login\x20failed')));}else console['log'](a116_0x414ca7[_0x5f512c(0x13c)](_0x5f512c(0x12c)+a116_0x414ca7['cyan'](_0x5f512c(0x131))));}await _0x3913cb({'projectName':_0x3eadbe,'appCode':_0x28aa02,'env':_0x148ec9||_0x50d1d6||_0x5f512c(0x120)});}else await _0x3913cb({'projectName':_0x3eadbe,'env':_0x148ec9||_0x50d1d6||_0x5f512c(0x120)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a117_0x1d40(){const _0xae97b0=['replace','27440UUUZBh','112458VEYonM','toFixed','now','196igmqAV','18068MQYMsz','265641mtuGhs','25HWBRwz','272496LoFWmF','11408MPRPms','2734551kudDuD'];a117_0x1d40=function(){return _0xae97b0;};return a117_0x1d40();}function a117_0x2ff0(_0x372f76,_0xf4d1ed){_0x372f76=_0x372f76-0x193;const _0x1d400a=a117_0x1d40();let _0x2ff0d2=_0x1d400a[_0x372f76];return _0x2ff0d2;}(function(_0x143810,_0x305ccc){const _0x38161f=a117_0x2ff0,_0x54e560=_0x143810();while(!![]){try{const _0x1de422=-parseInt(_0x38161f(0x19c))/0x1+-parseInt(_0x38161f(0x19d))/0x2+-parseInt(_0x38161f(0x196))/0x3+-parseInt(_0x38161f(0x195))/0x4*(parseInt(_0x38161f(0x197))/0x5)+parseInt(_0x38161f(0x198))/0x6+-parseInt(_0x38161f(0x194))/0x7*(parseInt(_0x38161f(0x199))/0x8)+parseInt(_0x38161f(0x19a))/0x9;if(_0x1de422===_0x305ccc)break;else _0x54e560['push'](_0x54e560['shift']());}catch(_0x57f854){_0x54e560['push'](_0x54e560['shift']());}}}(a117_0x1d40,0x1bf5e));export function formatElapsed(_0x156653){const _0x570470=a117_0x2ff0,_0x29da73=Date[_0x570470(0x193)]()-_0x156653;if(_0x29da73<0x3e8)return _0x29da73+'ms';const _0x293c50=(_0x29da73/0x3e8)[_0x570470(0x19e)](0x2),_0x333836=_0x293c50[_0x570470(0x19b)](/\.?0+$/u,'');return _0x333836+'s';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a118_0x5f2e(_0x4b3f1b,_0x390b71){_0x4b3f1b=_0x4b3f1b-0x6b;const _0x622df9=a118_0x622d();let _0x5f2e7a=_0x622df9[_0x4b3f1b];return _0x5f2e7a;}(function(_0x4f0376,_0x84e01d){const _0x21f605=a118_0x5f2e,_0xb0c064=_0x4f0376();while(!![]){try{const _0x71a318=parseInt(_0x21f605(0x9b))/0x1*(-parseInt(_0x21f605(0x7f))/0x2)+parseInt(_0x21f605(0xa1))/0x3+parseInt(_0x21f605(0x8d))/0x4*(-parseInt(_0x21f605(0x86))/0x5)+parseInt(_0x21f605(0x8a))/0x6*(parseInt(_0x21f605(0xb8))/0x7)+-parseInt(_0x21f605(0x82))/0x8*(parseInt(_0x21f605(0xbb))/0x9)+parseInt(_0x21f605(0xa0))/0xa+parseInt(_0x21f605(0x7a))/0xb*(parseInt(_0x21f605(0xb3))/0xc);if(_0x71a318===_0x84e01d)break;else _0xb0c064['push'](_0xb0c064['shift']());}catch(_0x25ae3a){_0xb0c064['push'](_0xb0c064['shift']());}}}(a118_0x622d,0xb4253));import a118_0x2cd85b from'path';import a118_0x1e53e0 from'fs';import a118_0x210517 from'chalk';import a118_0x391224 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../api/fetch-model-list.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x10a539){const _0x39a143=a118_0x5f2e,_0x26f172=await checkCliVersion();(_0x26f172['needsUpgrade']||_0x26f172[_0x39a143(0x9d)])&&(printCliUpgradeWarning(_0x26f172),assertCliVersionSupported(_0x26f172),logger[_0x39a143(0x78)](_0x39a143(0x98),_0x39a143(0x88),{'currentVersion':_0x26f172[_0x39a143(0xc5)],'stableVersion':_0x26f172[_0x39a143(0xa4)],'minimumVersion':_0x26f172['minimumVersion'],'needsUpgrade':_0x26f172[_0x39a143(0x7c)],'belowMinimum':_0x26f172['belowMinimum']}));if(_0x10a539[_0x39a143(0xac)]&&_0x10a539[_0x39a143(0x95)])await runCreate({'projectName':_0x10a539[_0x39a143(0xac)],'appCode':_0x10a539[_0x39a143(0x95)],'env':_0x10a539['env']},_0x10a539);else{if(_0x10a539[_0x39a143(0xac)]){const _0x23374c=await selectSingleAppcode(_0x10a539[_0x39a143(0xa7)]);await runCreate({'projectName':_0x10a539[_0x39a143(0xac)],'appCode':_0x23374c||undefined,'env':_0x10a539[_0x39a143(0x91)]},_0x10a539);}else await guidedCreateProject(_0x32d825=>runCreate(_0x32d825,_0x10a539),_0x10a539[_0x39a143(0x91)],_0x10a539['cookie']);}}async function runCreate(_0x1a66f2,_0x30f196){const _0x2873e4=a118_0x5f2e;if(!_0x1a66f2[_0x2873e4(0x93)]||_0x1a66f2[_0x2873e4(0x93)][_0x2873e4(0xaa)]()==='')throw new Error(_0x2873e4(0x92));const _0x1e7792=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1e7792['test'](_0x1a66f2[_0x2873e4(0x93)]))throw new Error(_0x2873e4(0x87));if(_0x1a66f2[_0x2873e4(0x93)]['length']>0x64)throw new Error(_0x2873e4(0x99));const _0x3fd9cb=a118_0x2cd85b['resolve'](process[_0x2873e4(0x81)](),_0x1a66f2['projectName']);if(a118_0x1e53e0[_0x2873e4(0xae)](_0x3fd9cb))throw new Error(_0x2873e4(0xa3)+_0x1a66f2[_0x2873e4(0x93)]+_0x2873e4(0xb6));try{a118_0x1e53e0['accessSync'](a118_0x2cd85b[_0x2873e4(0xb7)](_0x3fd9cb),a118_0x1e53e0[_0x2873e4(0xa5)]['W_OK']);}catch{throw new Error(_0x2873e4(0x73));}logger[_0x2873e4(0xba)](_0x3fd9cb),logger[_0x2873e4(0x78)](_0x2873e4(0x98),'开始创建项目:\x20'+_0x1a66f2[_0x2873e4(0x93)],{'projectDir':_0x3fd9cb,'appCode':_0x1a66f2[_0x2873e4(0x95)]}),console[_0x2873e4(0xa6)](),console['log'](a118_0x210517['green'](_0x2873e4(0x79))+_0x2873e4(0x74)+a118_0x210517[_0x2873e4(0xb0)](_0x1a66f2[_0x2873e4(0x93)])+(_0x1a66f2['appCode']?_0x2873e4(0x71)+a118_0x210517[_0x2873e4(0x6c)](_0x1a66f2[_0x2873e4(0x95)]):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x1a66f2[_0x2873e4(0x93)])),await updatePackageJsonName(_0x1a66f2[_0x2873e4(0x93)]),await runTask(_0x2873e4(0xc4),()=>installDependencies(_0x1a66f2['projectName'])),await runTask(_0x2873e4(0xbc),()=>formatProjectCode(_0x1a66f2[_0x2873e4(0x93)])),await configureAppCode(_0x1a66f2[_0x2873e4(0x93)],_0x1a66f2[_0x2873e4(0x95)]||'',_0x1a66f2[_0x2873e4(0x91)]);let _0x1f4bd2=![];if(_0x1a66f2[_0x2873e4(0x95)]){console[_0x2873e4(0xa6)](_0x2873e4(0xa9));const _0x75563f=process[_0x2873e4(0x81)]();try{process['chdir'](_0x3fd9cb);const _0x4309b8=_0x1a66f2[_0x2873e4(0x91)]||_0x2873e4(0x9f);initEnv(_0x4309b8);const {configArray:_0x2ad3e5}=await fetchModelList(_0x1a66f2['appCode'],_0x30f196[_0x2873e4(0xa7)]||''),_0x279fb6=DEFAULT_API_DIR,_0x2ed96e=await generateApiFile(_0x2ad3e5,'',_0x1a66f2[_0x2873e4(0x95)],!![],_0x4309b8,_0x279fb6);console[_0x2873e4(0xa6)](_0x2873e4(0x9a)+_0x2ad3e5[_0x2873e4(0x9e)]+_0x2873e4(0x8b)+_0x2ed96e['modelCount']+_0x2873e4(0x75)),logger['info'](_0x2873e4(0x98),_0x2873e4(0xbd)+_0x1a66f2[_0x2873e4(0x95)]);}catch(_0x147820){_0x1f4bd2=!![],console['log'](_0x2873e4(0xbe)),logger[_0x2873e4(0xaf)]('create',_0x2873e4(0xab),{'error':_0x147820 instanceof Error?_0x147820[_0x2873e4(0xb4)]:String(_0x147820)});}finally{process['chdir'](_0x75563f);}}logger['success'](_0x2873e4(0x98),'项目创建完成:\x20'+_0x1a66f2['projectName']),console[_0x2873e4(0xa6)](),console['log'](a118_0x210517[_0x2873e4(0xb0)]('─'[_0x2873e4(0x85)](0x3c))),console[_0x2873e4(0xa6)](a118_0x210517['cyan']['bold'](_0x2873e4(0xa8))),console[_0x2873e4(0xa6)](),console[_0x2873e4(0xa6)](_0x2873e4(0x89)+a118_0x210517['cyan'][_0x2873e4(0x7b)]('cd\x20'+_0x1a66f2[_0x2873e4(0x93)]+_0x2873e4(0xad)+CLI_BIN_NAME+'\x20run\x20start')),_0x1f4bd2&&console['log']('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a118_0x210517[_0x2873e4(0x6c)]['bold'](CLI_BIN_NAME+_0x2873e4(0x90))),console[_0x2873e4(0xa6)](a118_0x210517[_0x2873e4(0xb0)]('─'[_0x2873e4(0x85)](0x3c)));}catch(_0x31c59d){logger[_0x2873e4(0x83)]('create','项目创建失败:\x20'+_0x1a66f2['projectName'],{'error':_0x31c59d instanceof Error?_0x31c59d[_0x2873e4(0xb4)]:String(_0x31c59d)});try{a118_0x1e53e0['existsSync'](_0x3fd9cb)&&(console[_0x2873e4(0xa6)](_0x2873e4(0x94)+_0x3fd9cb),a118_0x1e53e0[_0x2873e4(0x6f)](_0x3fd9cb,{'recursive':!![],'force':!![]}));}catch{logger['warn'](_0x2873e4(0x98),'清理项目目录失败:\x20'+_0x3fd9cb);}throw _0x31c59d;}}async function runTask(_0x175ef3,_0x3f6028){const _0x563abf=a118_0x5f2e,_0x4c56f6=a118_0x391224(_0x175ef3+_0x563abf(0x70))[_0x563abf(0xb1)]();try{const _0x9185db=await _0x3f6028();_0x4c56f6[_0x563abf(0x6d)](),console[_0x563abf(0xa6)](''+a118_0x210517['green'](_0x563abf(0x79))+_0x175ef3+'\x20'+a118_0x210517[_0x563abf(0xa2)]('['+_0x9185db+']'));}catch(_0x18b52a){_0x4c56f6[_0x563abf(0x8c)](_0x175ef3);throw _0x18b52a;}}async function updatePackageJsonName(_0x54468d){const _0x5bf23e=a118_0x5f2e,_0x3d2dab=a118_0x2cd85b['resolve'](process[_0x5bf23e(0x81)](),_0x54468d),_0x21e613=a118_0x2cd85b[_0x5bf23e(0x96)](_0x3d2dab,_0x5bf23e(0xb9));try{console[_0x5bf23e(0xa6)](_0x5bf23e(0x97));const _0x110742=getRabetbaseCliPackageRoot(),_0x3d3909=a118_0x2cd85b[_0x5bf23e(0x96)](_0x110742,_0x5bf23e(0xb9));let _0x296762=_0x5bf23e(0x6b);try{const _0x4213ae=JSON[_0x5bf23e(0xb2)](a118_0x1e53e0[_0x5bf23e(0x7e)](_0x3d3909,_0x5bf23e(0xb5)));_0x296762=_0x4213ae['version']||_0x5bf23e(0x6b);}catch{}const _0x3eb7c0=a118_0x1e53e0[_0x5bf23e(0x7e)](_0x21e613,_0x5bf23e(0xb5)),_0x1a5e8c=JSON[_0x5bf23e(0xb2)](_0x3eb7c0);_0x1a5e8c['name']=_0x54468d,_0x1a5e8c[_0x5bf23e(0x84)]=_0x54468d+_0x5bf23e(0xc6)+_0x296762,a118_0x1e53e0[_0x5bf23e(0x76)](_0x21e613,JSON[_0x5bf23e(0x77)](_0x1a5e8c,null,0x2)+'\x0a','utf8'),console[_0x5bf23e(0xa6)](_0x5bf23e(0xbf)+_0x54468d),logger['info'](_0x5bf23e(0x98),_0x5bf23e(0x80));}catch(_0x558b61){logger[_0x5bf23e(0x83)](_0x5bf23e(0x98),_0x5bf23e(0x72));throw _0x558b61;}}function a118_0x622d(){const _0x4ecae4=['cwd','528vxpTWO','error','description','repeat','4980545SfRICo','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','CLI\x20版本检查','\x20\x201.\x20Start\x20project:\x20','366DoWCnX','\x20dataset(s),\x20generated\x20','fail','4hgEpaO','keys','\x20config\x20set\x20appcode\x20<app-code>\x27','\x20api\x20pull','env','Project\x20name\x20cannot\x20be\x20empty','projectName','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','appCode','join','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','create','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','√\x20Pulled\x20','1rkoSXS','配置应用AppCode失败','belowMinimum','length','production','9903790VVGdHs','2353998BxAnPe','gray','Project\x20directory\x20','stableVersion','constants','log','cookie','🚀\x20Next\x20Steps:','*\x20Pulling\x20API\x20configuration...','trim','API\x20配置拉取异常','projectCode','\x20&&\x20','existsSync','warn','green','start','parse','2724WRTOYC','message','utf8','\x20already\x20exists','dirname','8981WZjRVN','package.json','setLogPath','68850GdxXcu','Format\x20code','API\x20configuration\x20pulled:\x20','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','√\x20package.json\x20updated:\x20name=','\x20|\x20Default:\x20','version','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','resolve','Install\x20dependencies','currentVersion','\x20Generated\x20by\x20rabetbase\x20cli\x20','1.0.0','cyan','stop','配置应用AppCode:\x20','rmSync','...','\x20|\x20AppCode:\x20','更新\x20package.json\x20失败','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','Project\x20name:\x20','\x20model(s)','writeFileSync','stringify','info','\x20√\x20','77077TVrpUp','bold','needsUpgrade','√\x20Configuration\x20file\x20created,\x20Apps:\x20','readFileSync','2410026jJxjSB','更新\x20package.json\x20name'];a118_0x622d=function(){return _0x4ecae4;};return a118_0x622d();}async function configureAppCode(_0x29097f,_0x16dd86,_0x11e440){const _0x45a01c=a118_0x5f2e,_0x48ab8f=a118_0x2cd85b[_0x45a01c(0xc3)](process['cwd'](),_0x29097f),_0x29883e=a118_0x2cd85b[_0x45a01c(0x96)](_0x48ab8f,NEW_CONFIG_NAME);try{_0x16dd86?console[_0x45a01c(0xa6)]('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x29097f+':\x20'+_0x16dd86):console[_0x45a01c(0xa6)](_0x45a01c(0xc2)+_0x29097f);const _0x2bc6c5=getRabetbaseCliPackageRoot(),_0x5321d9=a118_0x2cd85b[_0x45a01c(0x96)](_0x2bc6c5,_0x45a01c(0xb9));let _0x55d5f3=_0x45a01c(0x6b);try{const _0xa30a6d=JSON['parse'](a118_0x1e53e0[_0x45a01c(0x7e)](_0x5321d9,_0x45a01c(0xb5)));_0x55d5f3=_0xa30a6d[_0x45a01c(0xc1)]||_0x45a01c(0x6b);}catch{}const _0x441f39=readConfig(),_0x1f364d=typeof _0x441f39[_0x45a01c(0x91)]==='string'?_0x441f39[_0x45a01c(0x91)]:undefined,_0x28657e={};for(const _0x123775 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x441f39[_0x123775]!=null)_0x28657e[_0x123775]=_0x441f39[_0x123775];}const _0x2579e9=buildCanonicalProjectConfig(_0x28657e,{'appCodes':_0x16dd86?[_0x16dd86]:[],'env':_0x11e440||_0x1f364d||_0x45a01c(0x9f),'metadata':{'createdAt':new Date()['toLocaleString'](),'version':_0x55d5f3}});writeConfigFile(_0x29883e,_0x2579e9),_0x16dd86?console['log'](_0x45a01c(0x7d)+Object[_0x45a01c(0x8e)](_0x2579e9['apps']||{})[_0x45a01c(0x96)](',\x20')+_0x45a01c(0xc0)+_0x2579e9['defaultApp']):console['log']('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+_0x45a01c(0x8f)),logger[_0x45a01c(0x78)](_0x45a01c(0x98),_0x45a01c(0x6e)+_0x16dd86);}catch(_0x429027){logger[_0x45a01c(0x83)](_0x45a01c(0x98),_0x45a01c(0x9c));}}
|
|
1
|
+
(function(_0x117192,_0x17e5cf){const _0x5ed833=a118_0x20a5,_0x52d99a=_0x117192();while(!![]){try{const _0x20a5c0=parseInt(_0x5ed833(0xfc))/0x1*(-parseInt(_0x5ed833(0x117))/0x2)+parseInt(_0x5ed833(0x116))/0x3+-parseInt(_0x5ed833(0xbd))/0x4*(parseInt(_0x5ed833(0xd8))/0x5)+-parseInt(_0x5ed833(0xb8))/0x6+-parseInt(_0x5ed833(0xca))/0x7+parseInt(_0x5ed833(0xc3))/0x8*(-parseInt(_0x5ed833(0xf6))/0x9)+parseInt(_0x5ed833(0xe8))/0xa;if(_0x20a5c0===_0x17e5cf)break;else _0x52d99a['push'](_0x52d99a['shift']());}catch(_0x58f3af){_0x52d99a['push'](_0x52d99a['shift']());}}}(a118_0x4e83,0x6acb2));import a118_0x1c1cfc from'path';import a118_0x6887e from'fs';import a118_0x2ed7cb from'chalk';import a118_0x5d988a from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../api/fetch-model-list.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';function a118_0x4e83(){const _0x4398a3=['chdir','Project\x20directory\x20','\x20&&\x20','6898rNrGlt','Install\x20dependencies','\x20|\x20AppCode:\x20','projectCode','string','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','\x20config\x20set\x20appcode\x20<app-code>\x27','√\x20Configuration\x20file\x20created,\x20Apps:\x20','1.0.0','readFileSync','√\x20package.json\x20updated:\x20name=','Project\x20name\x20cannot\x20be\x20empty','Project\x20name:\x20','log','green','resolve','更新\x20package.json\x20失败','start','utf8','\x20|\x20Default:\x20','repeat','cwd','项目创建失败:\x20','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','apps','Format\x20code','979023iEGBUA','236flVTzH','\x20api\x20pull','modelCount','info','903984UrrEVg','join','create','bold','\x20\x202.\x20Pull\x20API\x20configuration:\x20','99028GeEKZg','existsSync','length','version','\x20√\x20','keys','40gVPeNr','rmSync','setLogPath','清理项目目录失败:\x20','API\x20配置拉取异常','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','3405080SUWtib','\x20already\x20exists','name','API\x20configuration\x20pulled:\x20','*\x20Pulling\x20API\x20configuration...','minimumVersion','constants','production','success','\x20dataset(s),\x20generated\x20','warn','accessSync','trim','配置应用AppCode失败','25ZtpLAj','\x20model(s)','\x20run\x20start','项目创建完成:\x20','needsUpgrade','Copy\x20project\x20files','CLI\x20版本检查','belowMinimum','dirname','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','...','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','配置应用AppCode:\x20','gray','\x20\x201.\x20Start\x20project:\x20','开始创建项目:\x20','19657730PcMMtv','更新\x20package.json\x20name','description','W_OK','error','*\x20Configuring\x20AppCode\x20for\x20project\x20','cyan','cookie','defaultApp','env','projectName','parse','toLocaleString','package.json','503703QSCzcQ','🚀\x20Next\x20Steps:','appCode'];a118_0x4e83=function(){return _0x4398a3;};return a118_0x4e83();}import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';function a118_0x20a5(_0x49ebe0,_0x3f14cf){_0x49ebe0=_0x49ebe0-0xb8;const _0x4e83ba=a118_0x4e83();let _0x20a5f4=_0x4e83ba[_0x49ebe0];return _0x20a5f4;}import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x2b60a1){const _0x5d9f00=a118_0x20a5,_0x1b48d7=await checkCliVersion();(_0x1b48d7[_0x5d9f00(0xdc)]||_0x1b48d7[_0x5d9f00(0xdf)])&&(printCliUpgradeWarning(_0x1b48d7),assertCliVersionSupported(_0x1b48d7),logger['info'](_0x5d9f00(0xba),_0x5d9f00(0xde),{'currentVersion':_0x1b48d7['currentVersion'],'stableVersion':_0x1b48d7['stableVersion'],'minimumVersion':_0x1b48d7[_0x5d9f00(0xcf)],'needsUpgrade':_0x1b48d7[_0x5d9f00(0xdc)],'belowMinimum':_0x1b48d7[_0x5d9f00(0xdf)]}));if(_0x2b60a1['projectCode']&&_0x2b60a1[_0x5d9f00(0xf8)])await runCreate({'projectName':_0x2b60a1[_0x5d9f00(0xff)],'appCode':_0x2b60a1[_0x5d9f00(0xf8)],'env':_0x2b60a1['env']},_0x2b60a1);else{if(_0x2b60a1['projectCode']){const _0x45454c=await selectSingleAppcode(_0x2b60a1[_0x5d9f00(0xef)]);await runCreate({'projectName':_0x2b60a1[_0x5d9f00(0xff)],'appCode':_0x45454c||undefined,'env':_0x2b60a1[_0x5d9f00(0xf1)]},_0x2b60a1);}else await guidedCreateProject(_0x5d2f3a=>runCreate(_0x5d2f3a,_0x2b60a1),_0x2b60a1[_0x5d9f00(0xf1)],_0x2b60a1[_0x5d9f00(0xef)]);}}async function runCreate(_0x38484d,_0x4d1e16){const _0x37652f=a118_0x20a5;if(!_0x38484d[_0x37652f(0xf2)]||_0x38484d[_0x37652f(0xf2)][_0x37652f(0xd6)]()==='')throw new Error(_0x37652f(0x107));const _0x16325b=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x16325b['test'](_0x38484d[_0x37652f(0xf2)]))throw new Error('Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters');if(_0x38484d['projectName'][_0x37652f(0xbf)]>0x64)throw new Error(_0x37652f(0xe3));const _0x56b689=a118_0x1c1cfc[_0x37652f(0x10b)](process[_0x37652f(0x111)](),_0x38484d[_0x37652f(0xf2)]);if(a118_0x6887e[_0x37652f(0xbe)](_0x56b689))throw new Error(_0x37652f(0xfa)+_0x38484d[_0x37652f(0xf2)]+_0x37652f(0xcb));try{a118_0x6887e[_0x37652f(0xd5)](a118_0x1c1cfc[_0x37652f(0xe0)](_0x56b689),a118_0x6887e[_0x37652f(0xd0)][_0x37652f(0xeb)]);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger[_0x37652f(0xc5)](_0x56b689),logger[_0x37652f(0x11a)]('create',_0x37652f(0xe7)+_0x38484d[_0x37652f(0xf2)],{'projectDir':_0x56b689,'appCode':_0x38484d[_0x37652f(0xf8)]}),console[_0x37652f(0x109)](),console['log'](a118_0x2ed7cb[_0x37652f(0x10a)](_0x37652f(0xc1))+_0x37652f(0x108)+a118_0x2ed7cb[_0x37652f(0x10a)](_0x38484d[_0x37652f(0xf2)])+(_0x38484d['appCode']?_0x37652f(0xfe)+a118_0x2ed7cb['cyan'](_0x38484d[_0x37652f(0xf8)]):''));try{await runTask(_0x37652f(0xdd),()=>copyProjectTemplate(_0x38484d[_0x37652f(0xf2)])),await updatePackageJsonName(_0x38484d['projectName']),await runTask(_0x37652f(0xfd),()=>installDependencies(_0x38484d[_0x37652f(0xf2)])),await runTask(_0x37652f(0x115),()=>formatProjectCode(_0x38484d[_0x37652f(0xf2)])),await configureAppCode(_0x38484d[_0x37652f(0xf2)],_0x38484d['appCode']||'',_0x38484d[_0x37652f(0xf1)]);let _0x3af50b=![];if(_0x38484d[_0x37652f(0xf8)]){console[_0x37652f(0x109)](_0x37652f(0xce));const _0x4b677c=process['cwd']();try{process['chdir'](_0x56b689);const _0xa9e8b2=_0x38484d[_0x37652f(0xf1)]||'production';initEnv(_0xa9e8b2);const {configArray:_0x5dbc54}=await fetchModelList(_0x38484d[_0x37652f(0xf8)],_0x4d1e16['cookie']||''),_0x395c32=DEFAULT_API_DIR,_0x20b6cb=await generateApiFile(_0x5dbc54,'',_0x38484d[_0x37652f(0xf8)],!![],_0xa9e8b2,_0x395c32);console[_0x37652f(0x109)]('√\x20Pulled\x20'+_0x5dbc54[_0x37652f(0xbf)]+_0x37652f(0xd3)+_0x20b6cb[_0x37652f(0x119)]+_0x37652f(0xd9)),logger['info'](_0x37652f(0xba),_0x37652f(0xcd)+_0x38484d[_0x37652f(0xf8)]);}catch(_0x493fa4){_0x3af50b=!![],console[_0x37652f(0x109)](_0x37652f(0x101)),logger['warn']('create',_0x37652f(0xc7),{'error':_0x493fa4 instanceof Error?_0x493fa4['message']:String(_0x493fa4)});}finally{process[_0x37652f(0xf9)](_0x4b677c);}}logger[_0x37652f(0xd2)](_0x37652f(0xba),_0x37652f(0xdb)+_0x38484d[_0x37652f(0xf2)]),console[_0x37652f(0x109)](),console[_0x37652f(0x109)](a118_0x2ed7cb[_0x37652f(0x10a)]('─'[_0x37652f(0x110)](0x3c))),console['log'](a118_0x2ed7cb[_0x37652f(0xee)][_0x37652f(0xbb)](_0x37652f(0xf7))),console[_0x37652f(0x109)](),console[_0x37652f(0x109)](_0x37652f(0xe6)+a118_0x2ed7cb[_0x37652f(0xee)][_0x37652f(0xbb)]('cd\x20'+_0x38484d['projectName']+_0x37652f(0xfb)+CLI_BIN_NAME+_0x37652f(0xda))),_0x3af50b&&console[_0x37652f(0x109)](_0x37652f(0xbc)+a118_0x2ed7cb[_0x37652f(0xee)][_0x37652f(0xbb)](CLI_BIN_NAME+_0x37652f(0x118))),console['log'](a118_0x2ed7cb[_0x37652f(0x10a)]('─'[_0x37652f(0x110)](0x3c)));}catch(_0x482a5b){logger[_0x37652f(0xec)](_0x37652f(0xba),_0x37652f(0x112)+_0x38484d[_0x37652f(0xf2)],{'error':_0x482a5b instanceof Error?_0x482a5b['message']:String(_0x482a5b)});try{a118_0x6887e['existsSync'](_0x56b689)&&(console[_0x37652f(0x109)](_0x37652f(0xe1)+_0x56b689),a118_0x6887e[_0x37652f(0xc4)](_0x56b689,{'recursive':!![],'force':!![]}));}catch{logger[_0x37652f(0xd4)](_0x37652f(0xba),_0x37652f(0xc6)+_0x56b689);}throw _0x482a5b;}}async function runTask(_0x122bf9,_0x49fa7f){const _0xfad2a2=a118_0x20a5,_0x3d4e55=a118_0x5d988a(_0x122bf9+_0xfad2a2(0xe2))[_0xfad2a2(0x10d)]();try{const _0x39710f=await _0x49fa7f();_0x3d4e55['stop'](),console[_0xfad2a2(0x109)](''+a118_0x2ed7cb[_0xfad2a2(0x10a)]('\x20√\x20')+_0x122bf9+'\x20'+a118_0x2ed7cb[_0xfad2a2(0xe5)]('['+_0x39710f+']'));}catch(_0x5552e7){_0x3d4e55['fail'](_0x122bf9);throw _0x5552e7;}}async function updatePackageJsonName(_0xa989c7){const _0x311485=a118_0x20a5,_0x590ff3=a118_0x1c1cfc[_0x311485(0x10b)](process[_0x311485(0x111)](),_0xa989c7),_0xce7b50=a118_0x1c1cfc[_0x311485(0xb9)](_0x590ff3,_0x311485(0xf5));try{console['log'](_0x311485(0xc9));const _0x21bd7e=getRabetbaseCliPackageRoot(),_0x5590fb=a118_0x1c1cfc[_0x311485(0xb9)](_0x21bd7e,_0x311485(0xf5));let _0x4d6e62=_0x311485(0x104);try{const _0x1dd29f=JSON[_0x311485(0xf3)](a118_0x6887e[_0x311485(0x105)](_0x5590fb,_0x311485(0x10e)));_0x4d6e62=_0x1dd29f[_0x311485(0xc0)]||_0x311485(0x104);}catch{}const _0x54fce8=a118_0x6887e[_0x311485(0x105)](_0xce7b50,_0x311485(0x10e)),_0x7a5a82=JSON[_0x311485(0xf3)](_0x54fce8);_0x7a5a82[_0x311485(0xcc)]=_0xa989c7,_0x7a5a82[_0x311485(0xea)]=_0xa989c7+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x4d6e62,a118_0x6887e['writeFileSync'](_0xce7b50,JSON['stringify'](_0x7a5a82,null,0x2)+'\x0a',_0x311485(0x10e)),console[_0x311485(0x109)](_0x311485(0x106)+_0xa989c7),logger[_0x311485(0x11a)](_0x311485(0xba),_0x311485(0xe9));}catch(_0x10caf0){logger[_0x311485(0xec)](_0x311485(0xba),_0x311485(0x10c));throw _0x10caf0;}}async function configureAppCode(_0x250f11,_0x287ac5,_0x1033cc){const _0x4d8a65=a118_0x20a5,_0x4929a4=a118_0x1c1cfc[_0x4d8a65(0x10b)](process[_0x4d8a65(0x111)](),_0x250f11),_0x2abee2=a118_0x1c1cfc[_0x4d8a65(0xb9)](_0x4929a4,NEW_CONFIG_NAME);try{_0x287ac5?console[_0x4d8a65(0x109)](_0x4d8a65(0xed)+_0x250f11+':\x20'+_0x287ac5):console[_0x4d8a65(0x109)](_0x4d8a65(0x113)+_0x250f11);const _0x26acde=getRabetbaseCliPackageRoot(),_0x172628=a118_0x1c1cfc[_0x4d8a65(0xb9)](_0x26acde,_0x4d8a65(0xf5));let _0x28338e=_0x4d8a65(0x104);try{const _0x52a9b7=JSON['parse'](a118_0x6887e[_0x4d8a65(0x105)](_0x172628,_0x4d8a65(0x10e)));_0x28338e=_0x52a9b7[_0x4d8a65(0xc0)]||_0x4d8a65(0x104);}catch{}const _0x1e6d82=readConfig(),_0xebce95=typeof _0x1e6d82[_0x4d8a65(0xf1)]===_0x4d8a65(0x100)?_0x1e6d82[_0x4d8a65(0xf1)]:undefined,_0xbd8269={};for(const _0x2fff8d of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x1e6d82[_0x2fff8d]!=null)_0xbd8269[_0x2fff8d]=_0x1e6d82[_0x2fff8d];}const _0x4417a2=buildCanonicalProjectConfig(_0xbd8269,{'appCodes':_0x287ac5?[_0x287ac5]:[],'env':_0x1033cc||_0xebce95||_0x4d8a65(0xd1),'metadata':{'createdAt':new Date()[_0x4d8a65(0xf4)](),'version':_0x28338e}});writeConfigFile(_0x2abee2,_0x4417a2),_0x287ac5?console[_0x4d8a65(0x109)](_0x4d8a65(0x103)+Object[_0x4d8a65(0xc2)](_0x4417a2[_0x4d8a65(0x114)]||{})[_0x4d8a65(0xb9)](',\x20')+_0x4d8a65(0x10f)+_0x4417a2[_0x4d8a65(0xf0)]):console[_0x4d8a65(0x109)](_0x4d8a65(0xc8)+CLI_BIN_NAME+_0x4d8a65(0x102)),logger[_0x4d8a65(0x11a)](_0x4d8a65(0xba),_0x4d8a65(0xe4)+_0x287ac5);}catch(_0x13494b){logger[_0x4d8a65(0xec)](_0x4d8a65(0xba),_0x4d8a65(0xd7));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xbab542,_0x36e933){const _0x486c4a=a119_0x2553,_0x5c50bd=_0xbab542();while(!![]){try{const _0x13faf7=-parseInt(_0x486c4a(0xb9))/0x1+parseInt(_0x486c4a(0xbb))/0x2*(-parseInt(_0x486c4a(0x8c))/0x3)+-parseInt(_0x486c4a(0x90))/0x4*(-parseInt(_0x486c4a(0xb1))/0x5)+-parseInt(_0x486c4a(0x9a))/0x6*(parseInt(_0x486c4a(0x92))/0x7)+-parseInt(_0x486c4a(0x8f))/0x8+-parseInt(_0x486c4a(0x91))/0x9+-parseInt(_0x486c4a(0x8d))/0xa*(-parseInt(_0x486c4a(0xa8))/0xb);if(_0x13faf7===_0x36e933)break;else _0x5c50bd['push'](_0x5c50bd['shift']());}catch(_0x53760b){_0x5c50bd['push'](_0x5c50bd['shift']());}}}(a119_0x3672,0x3e595));import a119_0x339331 from'path';import a119_0x281b77 from'fs/promises';function a119_0x3672(){const _0x329862=['toLocaleString','Project\x20name\x20contains\x20invalid\x20characters.','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','Project\x20name\x20cannot\x20be\x20empty.','package.json','readFile','\x20\x20Installing\x20dependencies...','\x20model(s)','\x20dataset(s),\x20generated\x20','bun\x20run\x20format','\x20\x20√\x20Project\x20template\x20created','\x20\x20rabetbase\x20run\x20start\x0a','1670141eDKinm','name','\x20created\x20successfully!','Use\x20a\x20different\x20project\x20name.','chdir','...','modelCount','string','resolve','1779280bKiWmy','length','ignore','constants','production','*\x20Creating\x20project\x20','description','\x20\x20Pulling\x20API\x20configuration...','240174gLoNLw','bun','4026wpPtof','\x0a\x20\x20cd\x20','W_OK','test','npm','447XCFPkC','60JMVEuD','log','1366280diTWZD','4VMNebl','1918980zGMEpP','13587gOabjL','parse','join','\x20\x20√\x20Code\x20formatted','env','validation','\x20api\x20pull`\x20manually\x20later.','cwd','270PRycRG'];a119_0x3672=function(){return _0x329862;};return a119_0x3672();}import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';function a119_0x2553(_0xbc81ee,_0x5e55ce){_0xbc81ee=_0xbc81ee-0x8c;const _0x3672d6=a119_0x3672();let _0x255397=_0x3672d6[_0xbc81ee];return _0x255397;}import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';import{fetchModelList}from'../../../api/fetch-model-list.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x3a6d3e,_0x4ece22,_0x3ecfaa,_0x201a64){const _0x1db4bd=a119_0x2553,_0x596641=await checkCliVersion();(_0x596641['needsUpgrade']||_0x596641['belowMinimum'])&&(printCliUpgradeWarning(_0x596641),assertCliVersionSupported(_0x596641));if(!_0x3a6d3e||_0x3a6d3e['trim']()==='')throw CliErrors['validation'](_0x1db4bd(0x9f));const _0x18f161=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x18f161[_0x1db4bd(0xbe)](_0x3a6d3e))throw CliErrors[_0x1db4bd(0x97)](_0x1db4bd(0x9c),_0x1db4bd(0x9d));if(_0x3a6d3e[_0x1db4bd(0xb2)]>0x64)throw CliErrors['validation']('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.');const _0x33dc08=a119_0x339331['resolve'](process[_0x1db4bd(0x99)](),_0x3a6d3e);if(existsSync(_0x33dc08))throw CliErrors[_0x1db4bd(0x97)]('Project\x20directory\x20\x22'+_0x3a6d3e+'\x22\x20already\x20exists.',_0x1db4bd(0xab));try{const _0x9dbcc4=a119_0x339331['dirname'](_0x33dc08);await a119_0x281b77['access'](_0x9dbcc4,a119_0x281b77[_0x1db4bd(0xb4)][_0x1db4bd(0xbd)]);}catch{throw CliErrors['validation']('Cannot\x20create\x20project\x20in\x20current\x20directory.','Check\x20directory\x20permissions.');}try{console[_0x1db4bd(0x8e)](_0x1db4bd(0xb6)+_0x3a6d3e+_0x1db4bd(0xad));const _0x2087d8=getSubAppReactDemoTemplateDir();await copyDirectory(_0x2087d8,_0x33dc08),console[_0x1db4bd(0x8e)](_0x1db4bd(0xa6)),await updatePackageJsonName(_0x3a6d3e),console[_0x1db4bd(0x8e)]('\x20\x20√\x20package.json\x20updated'),console['log'](_0x1db4bd(0xa2)),console[_0x1db4bd(0x8e)]('\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)'),await formatCode(_0x33dc08),console[_0x1db4bd(0x8e)](_0x1db4bd(0x95)),await configureProject(_0x3a6d3e,_0x3ecfaa,_0x4ece22),console[_0x1db4bd(0x8e)]('\x20\x20√\x20Configuration\x20file\x20created'),_0x3ecfaa&&await pullApiConfig(_0x33dc08,_0x3ecfaa,_0x4ece22,_0x201a64),console[_0x1db4bd(0x8e)]('\x0a√\x20Project\x20'+_0x3a6d3e+_0x1db4bd(0xaa)),console[_0x1db4bd(0x8e)](_0x1db4bd(0xbc)+_0x3a6d3e),console['log'](_0x1db4bd(0xa7));}catch(_0x5c5c00){try{existsSync(_0x33dc08)&&await a119_0x281b77['rm'](_0x33dc08,{'recursive':!![],'force':!![]});}catch{}throw _0x5c5c00;}}async function updatePackageJsonName(_0x1767e9){const _0x4e095d=a119_0x2553,_0x39b2c2=a119_0x339331[_0x4e095d(0xb0)](process[_0x4e095d(0x99)](),_0x1767e9),_0x5c21ea=a119_0x339331[_0x4e095d(0x94)](_0x39b2c2,_0x4e095d(0xa0)),_0x55b698=await a119_0x281b77[_0x4e095d(0xa1)](_0x5c21ea,'utf-8'),_0x920ded=JSON[_0x4e095d(0x93)](_0x55b698);_0x920ded[_0x4e095d(0xa9)]=_0x1767e9,_0x920ded[_0x4e095d(0xb7)]=_0x4e095d(0x9e),await a119_0x281b77['writeFile'](_0x5c21ea,JSON['stringify'](_0x920ded,null,0x2)+'\x0a');}function detectPackageManager(){const _0x46d769=a119_0x2553;try{return execSync('bun\x20--version',{'stdio':_0x46d769(0xb3)}),_0x46d769(0xba);}catch{return _0x46d769(0xbf);}}async function formatCode(_0x2f75cc){const _0xb36c9e=a119_0x2553;try{await execAsync(_0xb36c9e(0xa5),{'cwd':_0x2f75cc});}catch{}}async function configureProject(_0x4e2b9e,_0x3fa34b,_0x414781){const _0x57ea18=a119_0x2553,_0x761636=a119_0x339331['resolve'](process[_0x57ea18(0x99)](),_0x4e2b9e),_0x195720=a119_0x339331[_0x57ea18(0x94)](_0x761636,NEW_CONFIG_NAME),_0x1ad95c=readConfig(),_0x5d5953=typeof _0x1ad95c['env']===_0x57ea18(0xaf)?_0x1ad95c[_0x57ea18(0x96)]:undefined,_0x1e777c={};for(const _0x43a8b4 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x1ad95c[_0x43a8b4]!=null)_0x1e777c[_0x43a8b4]=_0x1ad95c[_0x43a8b4];}const _0x38e33e=buildCanonicalProjectConfig(_0x1e777c,{'appCodes':_0x3fa34b?[_0x3fa34b]:[],'env':_0x414781||_0x5d5953||_0x57ea18(0xb5),'metadata':{'createdAt':new Date()[_0x57ea18(0x9b)](),'version':getCliVersion()}});writeConfigFile(_0x195720,_0x38e33e);}async function pullApiConfig(_0x286004,_0x4ed73c,_0x4b2bdd,_0x402f2b){const _0x48d76b=a119_0x2553,_0x581716=process['cwd']();try{process['chdir'](_0x286004);const _0x5683fc=_0x4b2bdd||_0x48d76b(0xb5);initEnv(_0x5683fc),console[_0x48d76b(0x8e)](_0x48d76b(0xb8));const {configArray:_0x132da5}=await fetchModelList(_0x4ed73c,_0x402f2b||''),_0x227f55=await generateApiFile(_0x132da5,'',_0x4ed73c,!![],_0x5683fc,DEFAULT_API_DIR);console[_0x48d76b(0x8e)]('\x20\x20√\x20Pulled\x20'+_0x132da5['length']+_0x48d76b(0xa4)+_0x227f55[_0x48d76b(0xae)]+_0x48d76b(0xa3));}catch(_0x23938a){console['log']('\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`'+CLI_BIN_NAME+_0x48d76b(0x98));}finally{process[_0x48d76b(0xac)](_0x581716);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x101f63,_0x838c3c){const _0x346957=a120_0x5d34,_0x4e0558=_0x101f63();while(!![]){try{const _0x36a7f3=-parseInt(_0x346957(0x1d2))/0x1+-parseInt(_0x346957(0x1ce))/0x2+-parseInt(_0x346957(0x1d0))/0x3*(parseInt(_0x346957(0x1cb))/0x4)+-parseInt(_0x346957(0x1ca))/0x5+parseInt(_0x346957(0x1d1))/0x6*(parseInt(_0x346957(0x1d5))/0x7)+-parseInt(_0x346957(0x1cc))/0x8+parseInt(_0x346957(0x1cd))/0x9;if(_0x36a7f3===_0x838c3c)break;else _0x4e0558['push'](_0x4e0558['shift']());}catch(_0x474ef1){_0x4e0558['push'](_0x4e0558['shift']());}}}(a120_0x343b,0xdf3b1));function a120_0x343b(){const _0x314b69=['305697bxotjf','29466EcbjEi','1544411DNqdJT','projects','templates','511xPmYrh','resolve','378835BjWOai','8TnRmtI','9831712MJBFDZ','44015319gdATvH','2563602sBADnz','sub-app-react-demo'];a120_0x343b=function(){return _0x314b69;};return a120_0x343b();}function a120_0x5d34(_0x1eaaf5,_0x37e96d){_0x1eaaf5=_0x1eaaf5-0x1c9;const _0x343ba1=a120_0x343b();let _0x5d3430=_0x343ba1[_0x1eaaf5];return _0x5d3430;}import a120_0x8a2286 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a120_0x8a2286['dirname'](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x5f00fa=a120_0x5d34;return a120_0x8a2286[_0x5f00fa(0x1c9)](__dirname,'../../../../');}export function getSubAppReactDemoTemplateDir(){const _0x217b42=a120_0x5d34;return a120_0x8a2286['join'](getRabetbaseCliPackageRoot(),_0x217b42(0x1d4),_0x217b42(0x1d3),_0x217b42(0x1cf));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1fe299,_0x35b32c){const _0x575b9b=a121_0x39cc,_0x429a9b=_0x1fe299();while(!![]){try{const _0x117078=-parseInt(_0x575b9b(0xc8))/0x1+parseInt(_0x575b9b(0xc7))/0x2+-parseInt(_0x575b9b(0xca))/0x3*(parseInt(_0x575b9b(0xcd))/0x4)+-parseInt(_0x575b9b(0xc1))/0x5+-parseInt(_0x575b9b(0xc5))/0x6*(parseInt(_0x575b9b(0xc3))/0x7)+-parseInt(_0x575b9b(0xc2))/0x8+parseInt(_0x575b9b(0xcc))/0x9;if(_0x117078===_0x35b32c)break;else _0x429a9b['push'](_0x429a9b['shift']());}catch(_0x2fd0a3){_0x429a9b['push'](_0x429a9b['shift']());}}}(a121_0x5a4b,0x1d957));import a121_0x1fd2df from'node:path';function a121_0x39cc(_0x2dc9ee,_0x50eb54){_0x2dc9ee=_0x2dc9ee-0xbd;const _0x5a4b1c=a121_0x5a4b();let _0x39ccae=_0x5a4b1c[_0x2dc9ee];return _0x39ccae;}function a121_0x5a4b(){const _0x48101a=['136iffQzY','copy','resolve','项目模板复制失败','开始复制项目模板','1160480kYomva','880520tpQdoQ','389809XuSpgk','项目模板复制完成','18zYGrGi','message','185632UgQhFB','202916PPMypd','info','14835yLQGiG','now','8177643DUYrjr'];a121_0x5a4b=function(){return _0x48101a;};return a121_0x5a4b();}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(_0x4d8523){const _0x3c0c62=a121_0x39cc,_0x31eea2=Date[_0x3c0c62(0xcb)](),_0x5273da=a121_0x1fd2df[_0x3c0c62(0xbe)](process['cwd'](),_0x4d8523);try{logger[_0x3c0c62(0xc9)](_0x3c0c62(0xbd),_0x3c0c62(0xc0),{'projectCode':_0x4d8523,'templateDir':templateDir}),await copyDirectory(templateDir,_0x5273da);const _0x1943f8=Date[_0x3c0c62(0xcb)]()-_0x31eea2;logger['success']('copy',_0x3c0c62(0xc4),_0x1943f8,{'projectCode':_0x4d8523});}catch(_0x1f789c){const _0x4beea4=Date[_0x3c0c62(0xcb)]()-_0x31eea2;logger['error'](_0x3c0c62(0xbd),_0x3c0c62(0xbf),{'projectCode':_0x4d8523,'error':_0x1f789c instanceof Error?_0x1f789c[_0x3c0c62(0xc6)]:String(_0x1f789c),'duration':_0x4beea4});throw _0x1f789c;}return formatElapsed(_0x31eea2);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x50cd6b,_0x48f961){const _0x1f58fa=a122_0x3fcd,_0x5c3ac7=_0x50cd6b();while(!![]){try{const _0x7aa658=parseInt(_0x1f58fa(0x137))/0x1*(-parseInt(_0x1f58fa(0x12b))/0x2)+-parseInt(_0x1f58fa(0x127))/0x3*(-parseInt(_0x1f58fa(0x131))/0x4)+parseInt(_0x1f58fa(0x135))/0x5*(parseInt(_0x1f58fa(0x12d))/0x6)+-parseInt(_0x1f58fa(0x138))/0x7+parseInt(_0x1f58fa(0x124))/0x8+-parseInt(_0x1f58fa(0x130))/0x9*(parseInt(_0x1f58fa(0x136))/0xa)+parseInt(_0x1f58fa(0x132))/0xb*(parseInt(_0x1f58fa(0x128))/0xc);if(_0x7aa658===_0x48f961)break;else _0x5c3ac7['push'](_0x5c3ac7['shift']());}catch(_0x220a62){_0x5c3ac7['push'](_0x5c3ac7['shift']());}}}(a122_0xb51e,0xa6862));function a122_0xb51e(){const _0x230ede=['resolve','message','798ZFQnYr','263868ZjdWKq','开始格式化代码','prettier','12882ZTInkP','error','6lAMVkO','success','now','21708jEfsUR','11080sIYoMY','363TmOWJl','info','代码格式化完成','1741515Sbnklh','1110oLzOdS','112YpFuPf','7597387JeUhiT','format','--write','7566296cHwsNQ'];a122_0xb51e=function(){return _0x230ede;};return a122_0xb51e();}import a122_0x3b53db from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a122_0x3fcd(_0x294e14,_0x5d1658){_0x294e14=_0x294e14-0x122;const _0xb51e5f=a122_0xb51e();let _0x3fcd0c=_0xb51e5f[_0x294e14];return _0x3fcd0c;}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x3b949c){const _0x4f5d82=a122_0x3fcd,_0x5de299=Date[_0x4f5d82(0x12f)](),_0xab7790=a122_0x3b53db[_0x4f5d82(0x125)](process['cwd'](),_0x3b949c);try{logger[_0x4f5d82(0x133)]('format',_0x4f5d82(0x129),{'projectCode':_0x3b949c}),await execa(resolveNpmBin('npx'),[_0x4f5d82(0x12a),_0x4f5d82(0x123),'.'],{'cwd':_0xab7790});const _0x3b8589=Date[_0x4f5d82(0x12f)]()-_0x5de299;logger[_0x4f5d82(0x12e)](_0x4f5d82(0x122),_0x4f5d82(0x134),_0x3b8589,{'projectCode':_0x3b949c});}catch(_0x5bba7c){const _0x467953=Date[_0x4f5d82(0x12f)]()-_0x5de299;logger[_0x4f5d82(0x12c)](_0x4f5d82(0x122),'代码格式化失败',{'projectCode':_0x3b949c,'error':_0x5bba7c instanceof Error?_0x5bba7c[_0x4f5d82(0x126)]:String(_0x5bba7c),'duration':_0x467953});throw _0x5bba7c;}return formatElapsed(_0x5de299);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x431dfe,_0x5616e0){const _0x2d4255=a123_0xe1f9,_0x43eb93=_0x431dfe();while(!![]){try{const _0x4254e2=-parseInt(_0x2d4255(0x12e))/0x1+-parseInt(_0x2d4255(0x128))/0x2+parseInt(_0x2d4255(0x11f))/0x3+-parseInt(_0x2d4255(0x123))/0x4+-parseInt(_0x2d4255(0x12f))/0x5*(parseInt(_0x2d4255(0x121))/0x6)+parseInt(_0x2d4255(0x125))/0x7*(parseInt(_0x2d4255(0x129))/0x8)+parseInt(_0x2d4255(0x130))/0x9;if(_0x4254e2===_0x5616e0)break;else _0x43eb93['push'](_0x43eb93['shift']());}catch(_0x3c4699){_0x43eb93['push'](_0x43eb93['shift']());}}}(a123_0x2fcc,0x2ea34));import a123_0x4cdd90 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a123_0x2fcc(){const _0x40e49a=['335105tUjPTv','2145573cfRZPf','开始安装依赖','message','775383kLRzly','https://registry.npmmirror.com','12ziczpR','resolve','886080gGZTJj','npm','175vCitgN','--registry','info','81008yshdfo','56536LsBwek','install','now','cwd','success','86439orgBip'];a123_0x2fcc=function(){return _0x40e49a;};return a123_0x2fcc();}import{logger}from'../../../utils/logger.js';function a123_0xe1f9(_0x2ef832,_0x4806c6){_0x2ef832=_0x2ef832-0x11d;const _0x2fccf4=a123_0x2fcc();let _0xe1f9d8=_0x2fccf4[_0x2ef832];return _0xe1f9d8;}import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x3ba42f){const _0x1afb4f=a123_0xe1f9,_0x242afd=Date['now'](),_0x3fad93=a123_0x4cdd90[_0x1afb4f(0x122)](process[_0x1afb4f(0x12c)](),_0x3ba42f);try{logger[_0x1afb4f(0x127)]('install',_0x1afb4f(0x11d),{'projectCode':_0x3ba42f,'registry':_0x1afb4f(0x120)}),await execa(resolveNpmBin(_0x1afb4f(0x124)),[_0x1afb4f(0x12a),_0x1afb4f(0x126),_0x1afb4f(0x120)],{'cwd':_0x3fad93});const _0x3db748=Date[_0x1afb4f(0x12b)]()-_0x242afd;logger[_0x1afb4f(0x12d)](_0x1afb4f(0x12a),'依赖安装完成',_0x3db748,{'projectCode':_0x3ba42f});}catch(_0x481593){const _0x13b8ae=Date['now']()-_0x242afd;logger['error']('install','依赖安装失败',{'projectCode':_0x3ba42f,'error':_0x481593 instanceof Error?_0x481593[_0x1afb4f(0x11e)]:String(_0x481593),'duration':_0x13b8ae});throw _0x481593;}return formatElapsed(_0x242afd);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a124_0x400bee=a124_0x388b;(function(_0x371daa,_0x4dc056){const _0x205911=a124_0x388b,_0x54d270=_0x371daa();while(!![]){try{const _0x169d6c=parseInt(_0x205911(0x11f))/0x1*(-parseInt(_0x205911(0x136))/0x2)+parseInt(_0x205911(0x123))/0x3*(-parseInt(_0x205911(0x132))/0x4)+parseInt(_0x205911(0x12d))/0x5+parseInt(_0x205911(0x121))/0x6+-parseInt(_0x205911(0x138))/0x7*(parseInt(_0x205911(0x139))/0x8)+-parseInt(_0x205911(0x12e))/0x9*(parseInt(_0x205911(0x130))/0xa)+parseInt(_0x205911(0x128))/0xb;if(_0x169d6c===_0x4dc056)break;else _0x54d270['push'](_0x54d270['shift']());}catch(_0x979115){_0x54d270['push'](_0x54d270['shift']());}}}(a124_0x16cb,0x8ce7f));function a124_0x16cb(){const _0x4b3c86=['nonInteractive','3384455wtobNa','144muWbWv','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','69140ibpBMQ','string','3702932FFeoCi','boolean','bool','../../commands/project/create/non-interactive.js','160EqfRsj','Initialize\x20.rabetbase.json\x20config\x20in\x20existing\x20project','14mpFANT','337504ZtUtSA','App\x20code\x20to\x20initialize','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','upgrade','trim','str','Target\x20environment','args','Auto-confirm\x20prompts','name','validation','6044lYpnzX','cookie','4748694HEnjqv','appcode','3QbGTgW','project','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','env','write','7843704mMUlBD','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','yes'];a124_0x16cb=function(){return _0x4b3c86;};return a124_0x16cb();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';function a124_0x388b(_0x486563,_0x438de2){_0x486563=_0x486563-0x11e;const _0x16cb81=a124_0x16cb();let _0x388b97=_0x16cb81[_0x486563];return _0x388b97;}const initFlags=[{'name':'appcode','type':a124_0x400bee(0x131),'description':a124_0x400bee(0x13a)},{'name':a124_0x400bee(0x126),'type':a124_0x400bee(0x131),'description':a124_0x400bee(0x13f)},{'name':a124_0x400bee(0x12b),'type':a124_0x400bee(0x133),'description':a124_0x400bee(0x141),'default':![]}],createFlags=[{'name':a124_0x400bee(0x142),'type':a124_0x400bee(0x131),'description':'Project\x20name'},{'name':'env','type':a124_0x400bee(0x131),'description':a124_0x400bee(0x13f)},{'name':a124_0x400bee(0x122),'type':a124_0x400bee(0x131),'description':a124_0x400bee(0x12a)}],upgradeFlags=[{'name':a124_0x400bee(0x12b),'type':a124_0x400bee(0x133),'description':'Skip\x20confirmation\x20prompt','default':![]}];export const projectDefinitions=[{'service':a124_0x400bee(0x124),'command':'init','description':a124_0x400bee(0x137),'risk':a124_0x400bee(0x127),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initFlags,async 'execute'(_0x59311c){const _0x483557=a124_0x400bee;return await initConfig({'appcode':_0x59311c['str'](_0x483557(0x122))||undefined,'env':_0x59311c[_0x483557(0x13e)](_0x483557(0x126))||undefined,'autoYes':_0x59311c[_0x483557(0x134)]('yes')}),{'ok':!![]};}},{'service':a124_0x400bee(0x124),'command':'create','description':'Create\x20a\x20new\x20project','risk':a124_0x400bee(0x127),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':'project-name','description':a124_0x400bee(0x13b),'required':![]}],'flags':createFlags,async 'execute'(_0x3b78f1){const _0x1d83c4=a124_0x400bee,{createApp:_0x32af57}=await import('../../commands/project/create/main.js'),{createProjectNonInteractive:_0x2cea24}=await import(_0x1d83c4(0x135)),_0x143ba4=_0x3b78f1[_0x1d83c4(0x13e)]('name')[_0x1d83c4(0x13d)]()||_0x3b78f1[_0x1d83c4(0x140)][0x0]?.[_0x1d83c4(0x13d)](),_0x157f91=_0x3b78f1[_0x1d83c4(0x13e)](_0x1d83c4(0x126))||undefined,_0xdfde07=_0x3b78f1['str'](_0x1d83c4(0x122))||undefined;if(_0x3b78f1[_0x1d83c4(0x12c)]){if(!_0x143ba4)throw CliErrors[_0x1d83c4(0x11e)](_0x1d83c4(0x129),'Usage:\x20'+CLI_BIN_NAME+_0x1d83c4(0x125));await _0x2cea24(_0x143ba4,_0x157f91,_0xdfde07,_0x3b78f1[_0x1d83c4(0x120)]);}else await _0x32af57({'projectCode':_0x143ba4,'appCode':_0xdfde07,'env':_0x157f91,'cookie':_0x3b78f1[_0x1d83c4(0x120)]});return{'ok':!![]};}},{'service':a124_0x400bee(0x124),'command':a124_0x400bee(0x13c),'description':a124_0x400bee(0x12f),'risk':a124_0x400bee(0x127),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x487759){const _0x37001c=a124_0x400bee;return await upgradeApp(_0x487759['nonInteractive'],{'yes':_0x487759[_0x37001c(0x134)](_0x37001c(0x12b))}),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x285dc1,_0x23ea9c){const _0xe6d645=a125_0x3988,_0x4e6a55=_0x285dc1();while(!![]){try{const _0xba4d11=parseInt(_0xe6d645(0x11c))/0x1*(parseInt(_0xe6d645(0x10c))/0x2)+-parseInt(_0xe6d645(0x11e))/0x3+-parseInt(_0xe6d645(0x109))/0x4*(-parseInt(_0xe6d645(0x130))/0x5)+-parseInt(_0xe6d645(0x117))/0x6+parseInt(_0xe6d645(0x12d))/0x7*(parseInt(_0xe6d645(0x125))/0x8)+-parseInt(_0xe6d645(0x118))/0x9+-parseInt(_0xe6d645(0x113))/0xa;if(_0xba4d11===_0x23ea9c)break;else _0x4e6a55['push'](_0x4e6a55['shift']());}catch(_0x2369d9){_0x4e6a55['push'](_0x4e6a55['shift']());}}}(a125_0x1caa,0xdfbfb));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a125_0x2efd2d from'chalk';import{input,confirm}from'@inquirer/prompts';function a125_0x1caa(){const _0x374d06=['toLocaleString','parse','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','Upgrade\x20it\x20to\x20','579952LQZeGd','setLogPath','apps','log','app','bold','../..','production','112vrKITJ','string','\x20\x20Apps:\x20','140Ourumk','trim','green','\x20\x20Default:\x20','从旧配置文件升级成功','appcode','info','✓\x20Upgraded\x20','257596nLtcYV','join','keys','1565114MjnxwX','\x20→\x20.rabetbase.json','?\x20(Old\x20file\x20→\x20*.bak)','init','Migration\x20cancelled.\x20Run\x20`','1.0.0','cyan','2379240fNDeli','\x20project\x20init`\x20to\x20start\x20fresh.','\x20api\x20generate\x27\x20and\x20\x27','version','10799580uoOyht','2818332odsbOp','.bak','.rabetbase.json','utf8','2xYOFim','env','3782139KqGUUR','✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory'];a125_0x1caa=function(){return _0x374d06;};return a125_0x1caa();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';import{validateAppcode}from'../../commands/common/validate.js';function a125_0x3988(_0x3c7930,_0x11236c){_0x3c7930=_0x3c7930-0x106;const _0x1caa14=a125_0x1caa();let _0x3988de=_0x1caa14[_0x3c7930];return _0x3988de;}import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x156151){const _0x2d716a=a125_0x3988,{appcode:_0x155d03,env:_0x3af64c,autoYes:_0x266b49}=_0x156151,_0x252a9=process['cwd']();if(getProjectConfigPath())throw new Error('.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.');let _0x1c2009;for(const _0x558396 of LEGACY_CONFIG_NAMES){const _0x371343=resolve(_0x252a9,_0x558396);if(existsSync(_0x371343)){_0x1c2009=_0x371343;break;}}if(_0x1c2009){let _0x6dc0bf={};try{_0x6dc0bf=JSON[_0x2d716a(0x121)](readFileSync(_0x1c2009,_0x2d716a(0x11b)));}catch{}const _0x4f5072=basename(_0x1c2009),_0x371d27=_0x6dc0bf?.[_0x2d716a(0x106)]||_0x6dc0bf?.[_0x2d716a(0x129)];let _0x3ca968=_0x266b49;!_0x266b49&&(console[_0x2d716a(0x128)](a125_0x2efd2d['yellow']('⚠\x20Found\x20legacy\x20configuration\x20file:\x20'+a125_0x2efd2d[_0x2d716a(0x12a)](_0x4f5072))),_0x371d27&&console[_0x2d716a(0x128)](a125_0x2efd2d[_0x2d716a(0x112)]('\x20\x20appcode:\x20'+_0x371d27)),_0x3ca968=await confirm({'message':_0x2d716a(0x124)+a125_0x2efd2d[_0x2d716a(0x12a)](_0x2d716a(0x11a))+_0x2d716a(0x10e),'default':!![]}));if(!_0x3ca968){console['log'](_0x2d716a(0x110)+CLI_BIN_NAME+_0x2d716a(0x114));return;}const _0xea2087=resolve(_0x252a9,NEW_CONFIG_NAME),_0x2a327c=getCliVersionFromPkg(),_0x47e4c7=readRawConfig(),_0x4c8ce1=_0x155d03||(typeof _0x6dc0bf?.[_0x2d716a(0x106)]===_0x2d716a(0x12e)?_0x6dc0bf[_0x2d716a(0x106)]:undefined)||(typeof _0x6dc0bf?.[_0x2d716a(0x129)]===_0x2d716a(0x12e)?_0x6dc0bf[_0x2d716a(0x129)]:undefined)||await askAppcode(),_0x3dadea=typeof _0x6dc0bf?.[_0x2d716a(0x11d)]===_0x2d716a(0x12e)?_0x6dc0bf['env']:typeof _0x47e4c7['env']===_0x2d716a(0x12e)?_0x47e4c7[_0x2d716a(0x11d)]:_0x2d716a(0x12c),_0x336f60=buildCanonicalProjectConfig({..._0x47e4c7,..._0x6dc0bf},{'appCodes':[_0x4c8ce1],'env':_0x3dadea,'metadata':{'version':_0x2a327c,'migratedAt':new Date()[_0x2d716a(0x120)](),'migratedFrom':_0x1c2009}});writeConfigFile(_0xea2087,_0x336f60);const _0x2cf81a=_0x1c2009+'.bak';renameSync(_0x1c2009,_0x2cf81a),logger[_0x2d716a(0x126)](_0x252a9),logger[_0x2d716a(0x107)](_0x2d716a(0x10f),_0x2d716a(0x134),{'from':_0x1c2009,'to':_0xea2087,'appcode':_0x4c8ce1,'env':_0x336f60[_0x2d716a(0x11d)]}),console[_0x2d716a(0x128)](a125_0x2efd2d[_0x2d716a(0x132)](_0x2d716a(0x108)+_0x4f5072+_0x2d716a(0x10d))),console[_0x2d716a(0x128)](a125_0x2efd2d[_0x2d716a(0x112)](_0x2d716a(0x12f)+Object[_0x2d716a(0x10b)](_0x336f60['apps']||{})[_0x2d716a(0x10a)](',\x20'))),console[_0x2d716a(0x128)](a125_0x2efd2d[_0x2d716a(0x112)](_0x2d716a(0x133)+_0x336f60['defaultApp'])),console[_0x2d716a(0x128)](a125_0x2efd2d['gray'](_0x2d716a(0x122)+_0x4f5072+_0x2d716a(0x119)));return;}const _0x3575ad=_0x155d03||await askAppcode(),_0x35237a=resolve(_0x252a9,NEW_CONFIG_NAME),_0xe2a8bc=getCliVersionFromPkg(),_0x57c42c=readRawConfig(),_0x383374=typeof _0x57c42c[_0x2d716a(0x11d)]===_0x2d716a(0x12e)?_0x57c42c[_0x2d716a(0x11d)]:undefined,_0xd1094c=buildCanonicalProjectConfig({},{'appCodes':[_0x3575ad],'env':_0x3af64c||_0x383374||_0x2d716a(0x12c),'metadata':{'version':_0xe2a8bc,'createdAt':new Date()[_0x2d716a(0x120)]()}});writeConfigFile(_0x35237a,_0xd1094c),logger[_0x2d716a(0x126)](_0x252a9),logger['info'](_0x2d716a(0x10f),'初始化项目配置文件成功',{'appcode':_0x3575ad,'env':_0xd1094c[_0x2d716a(0x11d)],'version':_0xd1094c[_0x2d716a(0x116)],'configPath':_0x35237a}),console[_0x2d716a(0x128)](a125_0x2efd2d[_0x2d716a(0x132)](_0x2d716a(0x11f))),console[_0x2d716a(0x128)](a125_0x2efd2d[_0x2d716a(0x112)](_0x2d716a(0x12f)+Object[_0x2d716a(0x10b)](_0xd1094c[_0x2d716a(0x127)]||{})['join'](',\x20'))),console[_0x2d716a(0x128)](a125_0x2efd2d[_0x2d716a(0x112)](_0x2d716a(0x133)+_0xd1094c['defaultApp'])),console['log'](_0x2d716a(0x123)+CLI_BIN_NAME+_0x2d716a(0x115)+CLI_BIN_NAME+'\x20api\x20pull\x27');}function askAppcode(){return input({'message':'Please\x20enter\x20App\x20Code:','validate':_0x763b6c=>{const _0xdb93a0=a125_0x3988;if(!_0x763b6c[_0xdb93a0(0x131)]())return'App\x20Code\x20cannot\x20be\x20empty';const {valid:_0x4f92f7,message:_0x125736}=validateAppcode(_0x763b6c['trim']());return _0x4f92f7||_0x125736||'Invalid\x20App\x20Code';}});}function getCliVersionFromPkg(){const _0x2fc13f=a125_0x3988;try{const _0x2b116e=fileURLToPath(import.meta.url),_0x36c5d9=resolve(dirname(_0x2b116e),_0x2fc13f(0x12b)),_0x4f2184=JSON['parse'](readFileSync(resolve(_0x36c5d9,'package.json'),'utf8'));return _0x4f2184[_0x2fc13f(0x116)]||_0x2fc13f(0x111);}catch{return _0x2fc13f(0x111);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a126_0x4acc28=a126_0x2b07;(function(_0x54e97c,_0x1fa897){const _0x50128a=a126_0x2b07,_0x591559=_0x54e97c();while(!![]){try{const _0x48497c=-parseInt(_0x50128a(0x18f))/0x1+parseInt(_0x50128a(0x187))/0x2+parseInt(_0x50128a(0x1a7))/0x3*(-parseInt(_0x50128a(0x1c7))/0x4)+parseInt(_0x50128a(0x1d7))/0x5+-parseInt(_0x50128a(0x172))/0x6+parseInt(_0x50128a(0x1a1))/0x7+parseInt(_0x50128a(0x1d4))/0x8;if(_0x48497c===_0x1fa897)break;else _0x591559['push'](_0x591559['shift']());}catch(_0x4278ec){_0x591559['push'](_0x591559['shift']());}}}(a126_0x2aa3,0x78fbb));import a126_0x36533f from'chalk';import a126_0x2fc026 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';function a126_0x2aa3(){const _0x3631d6=['1196ugcXyD','oldPath','object','isDirectory','.lovrabet','.cursor/mcp.json','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','[\x22@lovrabet/sdk\x22]:\x20','gray','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','bold','\x20→\x20','\x20\x20Action:\x20delete','10510144jGfbNt','some','includes','1402800rQlIyB','join','oldMcpConfig','args','Step\x201/7:\x20Migrating\x20config...','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','skipped','fail','lovrabet/rabetbase','Upgrade\x20@lovrabet/sdk','.claude/skills/lovrabet','\x20from\x20','path','\x20\x20bun\x20install','latest','\x20(backup:\x20','fields','skipped\x20(no\x20legacy\x20config)','===\x20Upgrade\x20Analysis\x20===','Install\x20new\x20skill','label','white','1238712sqinoL','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','Step\x204/7:\x20MCP\x20config\x20—\x20','not\x20found\x20or\x20already\x20at\x20latest','===\x20Upgrade\x20Summary\x20===','MCP\x20config:','sdkUpgrade','\x20\x20#\x20or','lovrabet/rabetbase\x20installed\x20globally','no\x20legacy\x20entry','push','\x20\x20Current\x20version\x20in\x20','\x20removed','length','Config\x20migration','green','@lovrabet/dataset-mcp-server','Clean\x20MCP\x20config','start','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','\x20\x20\x20\x20\x20\x20\x20','704292jBShhx','cwd','configMigration','error','\x20removed\x20(','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','FAIL','@lovrabet/sdk:','761820BpIyBJ','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','red','cyan','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','utf8','mcpServers','no\x20matching\x20entry\x20found','files','exit\x20','Remove\x20old\x20skill','done','isArray','Step\x205/7:\x20Removing\x20old\x20skill...','Remove\x20legacy\x20artifacts','@lovrabet/sdk','detail','hasNewConfig','424396JVFNzZ','needed','keys','stringify','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','inherit','5451wSMSAO','not\x20found\x20(will\x20create)','filter','status','Step\x206/7:\x20Installing\x20new\x20skill...','Step\x204/7:\x20Cleaning\x20MCP\x20config...','Config\x20file:','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','message','string','dependencies','failed','yellow','succeed','Legacy\x20artifacts:','entries','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','removed\x20','package.json','Remove\x20.lovrabet/','values','.bak','log','Step\x201/7:\x20Config\x20migration\x20—\x20','needsSkillSwap','not\x20needed','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','\x20\x20New\x20config\x20(.rabetbase.json):\x20','parse','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...'];a126_0x2aa3=function(){return _0x3631d6;};return a126_0x2aa3();}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[a126_0x4acc28(0x1a9)](_0x40d556=>_0x40d556!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x1335dc){const _0x1edf4f=a126_0x4acc28,_0x105110=[];for(const _0x59c45c of Object[_0x1edf4f(0x1bb)](CORE_IDE_CONFIGS)){if(_0x59c45c[_0x1edf4f(0x197)])for(const _0x2cdfab of _0x59c45c[_0x1edf4f(0x197)]){_0x105110[_0x1edf4f(0x17c)](resolve(_0x1335dc,_0x2cdfab[_0x1edf4f(0x168)]));}}return _0x105110;}function a126_0x2b07(_0x50b75f,_0x2b9d92){_0x50b75f=_0x50b75f-0x168;const _0x2aa3c5=a126_0x2aa3();let _0x2b07d8=_0x2aa3c5[_0x50b75f];return _0x2b07d8;}function analyse(_0x108c88){const _0xef69a6=a126_0x4acc28;let _0x25570d=null;const _0x84ac47=resolve(_0x108c88,NEW_CONFIG_NAME),_0x492c44=existsSync(_0x84ac47);for(const _0x53340b of LEGACY_CONFIG_NAMES){const _0x3e2aee=resolve(_0x108c88,_0x53340b);if(existsSync(_0x3e2aee)){const _0x568f0a=readConfigFile(_0x3e2aee),_0x37480b=Object[_0xef69a6(0x1a3)](_0x568f0a)[_0xef69a6(0x1a9)](_0x74d28d=>typeof _0x568f0a[_0x74d28d]!=='undefined');_0x25570d={'oldPath':_0x3e2aee,'hasNewConfig':_0x492c44,'fields':_0x37480b};break;}}const _0x2fa767=[],_0x33782a=resolve(_0x108c88,_0xef69a6(0x1cb));if(existsSync(_0x33782a))_0x2fa767[_0xef69a6(0x17c)](_0x33782a);const _0x579965=resolve(_0x108c88,'.cursor/rules/lovrabet_rules.mdc');if(existsSync(_0x579965))_0x2fa767[_0xef69a6(0x17c)](_0x579965);const _0x31c8f0=resolve(_0x108c88,_0xef69a6(0x1e1));if(existsSync(_0x31c8f0))_0x2fa767['push'](_0x31c8f0);for(const _0x4b9560 of collectIdeSkillFiles(_0x108c88)){if(existsSync(_0x4b9560))_0x2fa767['push'](_0x4b9560);}let _0xed432e=null;const _0x45fb8b=resolve(_0x108c88,_0xef69a6(0x1cc));if(existsSync(_0x45fb8b))try{const _0x25b24c=JSON[_0xef69a6(0x1c5)](readFileSync(_0x45fb8b,_0xef69a6(0x194)));if(_0x25b24c?.[_0xef69a6(0x195)]&&typeof _0x25b24c[_0xef69a6(0x195)]===_0xef69a6(0x1c9)){const _0x163146=[];for(const [_0x472c42,_0x11ecc6]of Object[_0xef69a6(0x1b6)](_0x25b24c['mcpServers'])){const _0x324a5c=_0x11ecc6;_0x324a5c?.['args']&&Array[_0xef69a6(0x19b)](_0x324a5c[_0xef69a6(0x1da)])&&_0x324a5c[_0xef69a6(0x1da)][_0xef69a6(0x1d5)](_0x20db1a=>typeof _0x20db1a===_0xef69a6(0x1b0)&&_0x20db1a[_0xef69a6(0x1d6)](_0xef69a6(0x182)))&&_0x163146['push'](_0x472c42);}_0x163146[_0xef69a6(0x17f)]>0x0&&(_0xed432e={'path':_0x45fb8b,'keys':_0x163146});}}catch{}const _0x5d5bfd=_0x2fa767[_0xef69a6(0x17f)]>0x0||_0x25570d!==null;let _0x3903a2=null;const _0x449634=resolve(_0x108c88,_0xef69a6(0x1b9));if(existsSync(_0x449634))try{const _0x3330dd=JSON[_0xef69a6(0x1c5)](readFileSync(_0x449634,'utf8'));for(const _0x457191 of[_0xef69a6(0x1b1),'devDependencies']){const _0x28ef2b=_0x3330dd?.[_0x457191]?.[_0xef69a6(0x19e)];if(typeof _0x28ef2b===_0xef69a6(0x1b0)){_0x28ef2b!==_0xef69a6(0x16a)&&(_0x3903a2={'pkgPath':_0x449634,'currentVersion':_0x28ef2b,'field':_0x457191});break;}}}catch{}return{'configMigration':_0x25570d,'oldArtifacts':_0x2fa767,'oldMcpConfig':_0xed432e,'needsSkillSwap':_0x5d5bfd,'sdkUpgrade':_0x3903a2};}function printReport(_0x4886bc){const _0x12ad13=a126_0x4acc28,{configMigration:_0x584ebd,oldArtifacts:_0x5ca313,oldMcpConfig:_0x2d827b,needsSkillSwap:_0x3ffa12}=_0x4886bc;console['log'](''),console[_0x12ad13(0x1bd)](a126_0x36533f[_0x12ad13(0x1d1)](_0x12ad13(0x16e))),console[_0x12ad13(0x1bd)]('');_0x584ebd?(console[_0x12ad13(0x1bd)](a126_0x36533f[_0x12ad13(0x192)](_0x12ad13(0x1ad))+('\x20\x20'+a126_0x36533f[_0x12ad13(0x1b3)](_0x584ebd[_0x12ad13(0x1c8)]))),console[_0x12ad13(0x1bd)](_0x12ad13(0x1c4)+(_0x584ebd[_0x12ad13(0x1a0)]?a126_0x36533f[_0x12ad13(0x181)]('already\x20exists\x20(will\x20merge)'):a126_0x36533f[_0x12ad13(0x1cf)](_0x12ad13(0x1a8)))),console['log']('\x20\x20Fields\x20to\x20migrate:\x20'+_0x584ebd[_0x12ad13(0x16c)][_0x12ad13(0x1d8)](',\x20')),console[_0x12ad13(0x1bd)](_0x12ad13(0x1cd))):console[_0x12ad13(0x1bd)](a126_0x36533f[_0x12ad13(0x192)](_0x12ad13(0x1ad))+'\x20\x20'+a126_0x36533f[_0x12ad13(0x1cf)]('no\x20legacy\x20config\x20found'));console[_0x12ad13(0x1bd)]('');if(_0x5ca313[_0x12ad13(0x17f)]>0x0){console['log'](a126_0x36533f['cyan'](_0x12ad13(0x1b5)));for(const _0x1d2584 of _0x5ca313){console['log']('\x20\x20'+a126_0x36533f[_0x12ad13(0x191)]('FOUND')+'\x20\x20'+_0x1d2584);}console[_0x12ad13(0x1bd)](_0x12ad13(0x1d3));}else console[_0x12ad13(0x1bd)](a126_0x36533f['cyan']('Legacy\x20artifacts:')+'\x20\x20'+a126_0x36533f[_0x12ad13(0x1cf)]('none\x20found'));console[_0x12ad13(0x1bd)]('');_0x2d827b?(console[_0x12ad13(0x1bd)](a126_0x36533f['cyan'](_0x12ad13(0x177))+('\x20\x20'+a126_0x36533f[_0x12ad13(0x1b3)](_0x2d827b[_0x12ad13(0x168)])+'\x20→\x20keys:\x20'+_0x2d827b[_0x12ad13(0x1a3)][_0x12ad13(0x1d8)](',\x20'))),console[_0x12ad13(0x1bd)](_0x12ad13(0x193))):console[_0x12ad13(0x1bd)](a126_0x36533f[_0x12ad13(0x192)](_0x12ad13(0x177))+'\x20\x20'+a126_0x36533f[_0x12ad13(0x1cf)](_0x12ad13(0x17b)));console[_0x12ad13(0x1bd)](''),console[_0x12ad13(0x1bd)](a126_0x36533f['cyan']('Skill\x20swap:')+('\x20\x20'+(_0x3ffa12?a126_0x36533f['yellow'](_0x12ad13(0x1a2)):a126_0x36533f[_0x12ad13(0x181)](_0x12ad13(0x1c0)))));_0x3ffa12&&console['log'](_0x12ad13(0x1c2)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x12ad13(0x1bd)]('');if(_0x4886bc['sdkUpgrade']){const {currentVersion:_0x381f9a,field:_0x6e3235,pkgPath:_0xceb358}=_0x4886bc[_0x12ad13(0x178)];console[_0x12ad13(0x1bd)](a126_0x36533f['cyan'](_0x12ad13(0x18e))+('\x20\x20'+a126_0x36533f[_0x12ad13(0x1b3)](_0xceb358))),console['log'](_0x12ad13(0x17d)+_0x6e3235+':\x20'+a126_0x36533f[_0x12ad13(0x1b3)](_0x381f9a)+_0x12ad13(0x1d2)+a126_0x36533f[_0x12ad13(0x181)](_0x12ad13(0x16a))),console[_0x12ad13(0x1bd)](_0x12ad13(0x1ae));}else console[_0x12ad13(0x1bd)](a126_0x36533f[_0x12ad13(0x192)](_0x12ad13(0x18e))+'\x20\x20'+a126_0x36533f[_0x12ad13(0x1cf)](_0x12ad13(0x175)));console[_0x12ad13(0x1bd)]('');}function execConfigMigration(_0x47a27d,_0xa035be){const _0x5b411f=a126_0x4acc28,{configMigration:_0x1f4248}=_0x47a27d;if(!_0x1f4248?.[_0x5b411f(0x1c8)])return{'step':0x1,'label':_0x5b411f(0x180),'ok':!![],'detail':_0x5b411f(0x16d)};const _0x2ee421=readConfigFile(_0x1f4248[_0x5b411f(0x1c8)]),_0x4555e9=resolve(_0xa035be,NEW_CONFIG_NAME),_0x103b78=_0x1f4248[_0x5b411f(0x1a0)]?readConfigFile(_0x4555e9):{};for(const [_0x2b41c4,_0x312df8]of Object['entries'](_0x2ee421)){!(_0x2b41c4 in _0x103b78)&&(_0x103b78[_0x2b41c4]=_0x312df8);}writeConfigFile(_0x4555e9,_0x103b78);const _0x57d2e5=_0x1f4248[_0x5b411f(0x1c8)]+_0x5b411f(0x1bc);return renameSync(_0x1f4248[_0x5b411f(0x1c8)],_0x57d2e5),{'step':0x1,'label':_0x5b411f(0x180),'ok':!![],'detail':_0x1f4248[_0x5b411f(0x1c8)]+_0x5b411f(0x1d2)+_0x4555e9+_0x5b411f(0x16b)+_0x57d2e5+')'};}function execRemoveOldArtifacts(_0x3d716d){const _0x31007b=a126_0x4acc28,_0xe14a0e=[];for(const _0x2a92b0 of _0x3d716d){try{if(!existsSync(_0x2a92b0))continue;const _0x344fdb=tryStat(_0x2a92b0);_0x344fdb?.[_0x31007b(0x1ca)]()?rmSync(_0x2a92b0,{'recursive':!![],'force':!![]}):unlinkSync(_0x2a92b0);}catch(_0x181050){_0xe14a0e['push'](_0x2a92b0+':\x20'+_0x181050[_0x31007b(0x1af)]);}}return{'step':0x3,'label':_0x31007b(0x19d),'ok':_0xe14a0e[_0x31007b(0x17f)]===0x0,'detail':_0xe14a0e[_0x31007b(0x17f)]>0x0?_0x3d716d[_0x31007b(0x17f)]-_0xe14a0e[_0x31007b(0x17f)]+'/'+_0x3d716d['length']+_0x31007b(0x18b)+_0xe14a0e['join'](';\x20')+')':_0x3d716d[_0x31007b(0x17f)]+_0x31007b(0x17e)};}function execCleanMcp(_0x5b8208){const _0x43bb66=a126_0x4acc28;if(!_0x5b8208['oldMcpConfig'])return{'step':0x4,'label':_0x43bb66(0x183),'ok':!![],'detail':_0x43bb66(0x1dd)};try{const _0x24fd54=readFileSync(_0x5b8208['oldMcpConfig'][_0x43bb66(0x168)],_0x43bb66(0x194)),_0x59582e=JSON[_0x43bb66(0x1c5)](_0x24fd54);if(_0x59582e?.[_0x43bb66(0x195)]&&typeof _0x59582e['mcpServers']===_0x43bb66(0x1c9)){const _0x31ee2a=[];for(const [_0x5aacf6,_0x17e7ee]of Object[_0x43bb66(0x1b6)](_0x59582e[_0x43bb66(0x195)])){_0x17e7ee?.[_0x43bb66(0x1da)]&&Array[_0x43bb66(0x19b)](_0x17e7ee['args'])&&_0x17e7ee[_0x43bb66(0x1da)][_0x43bb66(0x1d5)](_0x3c3e96=>typeof _0x3c3e96===_0x43bb66(0x1b0)&&_0x3c3e96[_0x43bb66(0x1d6)](_0x43bb66(0x182)))&&_0x31ee2a['push'](_0x5aacf6);}for(const _0x157a7b of _0x31ee2a){delete _0x59582e[_0x43bb66(0x195)][_0x157a7b];}return _0x31ee2a[_0x43bb66(0x17f)]>0x0&&writeFileSync(_0x5b8208['oldMcpConfig'][_0x43bb66(0x168)],JSON['stringify'](_0x59582e,null,0x2)+'\x0a',_0x43bb66(0x194)),{'step':0x4,'label':_0x43bb66(0x183),'ok':!![],'detail':_0x43bb66(0x1b8)+_0x31ee2a[_0x43bb66(0x1d8)](',\x20')+_0x43bb66(0x1e2)+_0x5b8208[_0x43bb66(0x1d9)][_0x43bb66(0x168)]};}return{'step':0x4,'label':_0x43bb66(0x183),'ok':!![],'detail':_0x43bb66(0x196)};}catch(_0x45ecef){return{'step':0x4,'label':_0x43bb66(0x183),'ok':![],'detail':_0x45ecef['message']};}}function execSkillsRemove(_0x478758,_0x11d372){const _0x43e2d7=a126_0x4acc28,_0x4afdbe=runNpxSkillsRemove(_0x478758,{'stdio':_0x43e2d7(0x1a6),'yes':_0x11d372});return{'step':0x5,'label':_0x43e2d7(0x199),'ok':_0x4afdbe['ok'],'detail':_0x4afdbe['ok']?'lovrabet/lovrabet-skill\x20removed':_0x4afdbe[_0x43e2d7(0x18a)]??_0x43e2d7(0x198)+_0x4afdbe[_0x43e2d7(0x1aa)]};}function execSkillsAdd(_0x4a1343,_0x238617){const _0x38c965=a126_0x4acc28,_0x54ad14=runNpxSkillsAddGlobal(_0x4a1343,_0x38c965(0x1df),{'stdio':_0x38c965(0x1a6),'yes':_0x238617});return{'step':0x6,'label':_0x38c965(0x16f),'ok':_0x54ad14['ok'],'detail':_0x54ad14['ok']?_0x38c965(0x17a):_0x54ad14[_0x38c965(0x18a)]??_0x38c965(0x198)+_0x54ad14[_0x38c965(0x1aa)]};}function execUpgradeSdk(_0x4e5487){const _0x9ff4ca=a126_0x4acc28;if(!_0x4e5487[_0x9ff4ca(0x178)])return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x9ff4ca(0x1b7)};const {pkgPath:_0x400122,currentVersion:_0x48fd33,field:_0xa6d01}=_0x4e5487[_0x9ff4ca(0x178)];try{const _0xc84307=readFileSync(_0x400122,'utf8'),_0x8659f=JSON[_0x9ff4ca(0x1c5)](_0xc84307);return _0x8659f[_0xa6d01][_0x9ff4ca(0x19e)]=_0x9ff4ca(0x16a),writeFileSync(_0x400122,JSON[_0x9ff4ca(0x1a4)](_0x8659f,null,0x2)+'\x0a',_0x9ff4ca(0x194)),{'step':0x7,'label':_0x9ff4ca(0x1e0),'ok':!![],'detail':_0xa6d01+_0x9ff4ca(0x1ce)+_0x48fd33+'\x20→\x20latest'};}catch(_0x53a964){return{'step':0x7,'label':_0x9ff4ca(0x1e0),'ok':![],'detail':_0x53a964[_0x9ff4ca(0x1af)]};}}function tryStat(_0x3af87a){try{return statSync(_0x3af87a);}catch{return undefined;}}function printSummary(_0x39744a){const _0x1e5517=a126_0x4acc28;console['log'](''),console['log'](a126_0x36533f['bold'](_0x1e5517(0x176))),console[_0x1e5517(0x1bd)]('');for(const _0x27c573 of _0x39744a){const _0x405f3e=_0x27c573['ok']?a126_0x36533f['green']('OK'):a126_0x36533f['red'](_0x1e5517(0x18d));console[_0x1e5517(0x1bd)]('\x20\x20'+_0x405f3e+'\x20\x20Step\x20'+_0x27c573['step']+':\x20'+_0x27c573[_0x1e5517(0x170)]);if(_0x27c573[_0x1e5517(0x19f)])console[_0x1e5517(0x1bd)](_0x1e5517(0x186)+a126_0x36533f[_0x1e5517(0x1cf)](_0x27c573[_0x1e5517(0x19f)]));}console[_0x1e5517(0x1bd)]('');}export async function upgradeApp(_0x5bf3ef,_0x4d678b){const _0x4e9db4=a126_0x4acc28,_0x145e49=process[_0x4e9db4(0x188)](),_0x4ea308=analyse(_0x145e49),_0x4f49d5=!_0x4ea308[_0x4e9db4(0x189)]&&_0x4ea308['oldArtifacts']['length']===0x0&&!_0x4ea308[_0x4e9db4(0x1d9)]&&!_0x4ea308[_0x4e9db4(0x1bf)]&&!_0x4ea308['sdkUpgrade'];if(_0x4f49d5){console[_0x4e9db4(0x1bd)](a126_0x36533f[_0x4e9db4(0x181)](_0x4e9db4(0x1d0)));return;}printReport(_0x4ea308);const _0x165992=!!(_0x4d678b['yes']||_0x4d678b['Y']||_0x5bf3ef);if(!_0x165992)try{const _0x163375=await askConfirm('Proceed\x20with\x20upgrade?');if(!_0x163375){console[_0x4e9db4(0x1bd)](a126_0x36533f[_0x4e9db4(0x1cf)]('Upgrade\x20cancelled.'));return;}}catch(_0x171766){if(_0x171766?.['message']==='CANCEL'){console[_0x4e9db4(0x1bd)](a126_0x36533f[_0x4e9db4(0x1cf)]('Upgrade\x20cancelled.'));return;}throw _0x171766;}const _0x888a77=[],_0x3eece2=a126_0x2fc026({'text':_0x4e9db4(0x1db),'color':_0x4e9db4(0x192)})[_0x4e9db4(0x184)](),_0x7a16a=execConfigMigration(_0x4ea308,_0x145e49);_0x888a77[_0x4e9db4(0x17c)](_0x7a16a),_0x3eece2[_0x7a16a['ok']?'succeed':_0x4e9db4(0x1de)](_0x4e9db4(0x1be)+(_0x7a16a['detail']??(_0x7a16a['ok']?_0x4e9db4(0x19a):_0x4e9db4(0x1b2))));const _0x5b5aa8=resolve(_0x145e49,'.lovrabet'),_0x345560=a126_0x2fc026({'text':'Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','color':_0x4e9db4(0x192)})[_0x4e9db4(0x184)]();if(existsSync(_0x5b5aa8))try{rmSync(_0x5b5aa8,{'recursive':!![],'force':!![]}),_0x345560[_0x4e9db4(0x1b4)](_0x4e9db4(0x1a5)),_0x888a77[_0x4e9db4(0x17c)]({'step':0x2,'label':_0x4e9db4(0x1ba),'ok':!![]});}catch(_0x2f5eed){_0x345560[_0x4e9db4(0x1de)](_0x4e9db4(0x173)+_0x2f5eed[_0x4e9db4(0x1af)]),_0x888a77[_0x4e9db4(0x17c)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':![],'detail':_0x2f5eed['message']});}else _0x345560['info'](_0x4e9db4(0x185)),_0x888a77[_0x4e9db4(0x17c)]({'step':0x2,'label':_0x4e9db4(0x1ba),'ok':!![],'detail':_0x4e9db4(0x1dd)});const _0x24d4c3=a126_0x2fc026({'text':_0x4e9db4(0x1c6),'color':_0x4e9db4(0x192)})[_0x4e9db4(0x184)](),_0x217dc0=execRemoveOldArtifacts(_0x4ea308['oldArtifacts']);_0x888a77[_0x4e9db4(0x17c)](_0x217dc0),_0x24d4c3[_0x217dc0['ok']?_0x4e9db4(0x1b4):_0x4e9db4(0x1de)](_0x4e9db4(0x1dc)+(_0x217dc0['detail']??(_0x217dc0['ok']?_0x4e9db4(0x19a):_0x4e9db4(0x1b2))));const _0x1c149b=a126_0x2fc026({'text':_0x4e9db4(0x1ac),'color':_0x4e9db4(0x192)})['start'](),_0x16059b=execCleanMcp(_0x4ea308);_0x888a77['push'](_0x16059b),_0x1c149b[_0x16059b['ok']?_0x4e9db4(0x1b4):_0x4e9db4(0x1de)](_0x4e9db4(0x174)+(_0x16059b[_0x4e9db4(0x19f)]??(_0x16059b['ok']?'done':_0x4e9db4(0x1b2))));const _0x18d03c=a126_0x2fc026({'text':_0x4e9db4(0x19c),'color':_0x4e9db4(0x192)})[_0x4e9db4(0x184)](),_0x2abf9d=execSkillsRemove(_0x145e49,_0x165992);_0x888a77[_0x4e9db4(0x17c)](_0x2abf9d),_0x18d03c[_0x2abf9d['ok']?_0x4e9db4(0x1b4):_0x4e9db4(0x1de)](_0x4e9db4(0x1c3)+(_0x2abf9d[_0x4e9db4(0x19f)]??(_0x2abf9d['ok']?_0x4e9db4(0x19a):_0x4e9db4(0x1b2))));const _0x564cb8=a126_0x2fc026({'text':_0x4e9db4(0x1ab),'color':_0x4e9db4(0x192)})[_0x4e9db4(0x184)](),_0x279723=execSkillsAdd(_0x145e49,_0x165992);_0x888a77[_0x4e9db4(0x17c)](_0x279723),_0x564cb8[_0x279723['ok']?_0x4e9db4(0x1b4):_0x4e9db4(0x1de)]('Step\x206/7:\x20Install\x20new\x20skill\x20—\x20'+(_0x279723['detail']??(_0x279723['ok']?'done':_0x4e9db4(0x1b2))));const _0x4b6832=a126_0x2fc026({'text':_0x4e9db4(0x18c),'color':_0x4e9db4(0x192)})[_0x4e9db4(0x184)](),_0x5cc815=execUpgradeSdk(_0x4ea308);_0x888a77[_0x4e9db4(0x17c)](_0x5cc815),_0x4b6832[_0x5cc815['ok']?_0x4e9db4(0x1b4):_0x4e9db4(0x1de)](_0x4e9db4(0x190)+(_0x5cc815[_0x4e9db4(0x19f)]??(_0x5cc815['ok']?_0x4e9db4(0x19a):_0x4e9db4(0x1b2)))),printSummary(_0x888a77);const _0x6c79e6=_0x888a77[_0x4e9db4(0x1d5)](_0x35adec=>!_0x35adec['ok']);_0x6c79e6?console[_0x4e9db4(0x1bd)](a126_0x36533f[_0x4e9db4(0x1b3)]('Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.')):console[_0x4e9db4(0x1bd)](a126_0x36533f[_0x4e9db4(0x181)]('Upgrade\x20completed\x20successfully!')),_0x5cc815['ok']&&_0x4ea308['sdkUpgrade']&&(console[_0x4e9db4(0x1bd)](''),console[_0x4e9db4(0x1bd)](a126_0x36533f[_0x4e9db4(0x1d1)][_0x4e9db4(0x192)]('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console[_0x4e9db4(0x1bd)](a126_0x36533f[_0x4e9db4(0x192)](_0x4e9db4(0x1c1))),console[_0x4e9db4(0x1bd)](''),console[_0x4e9db4(0x1bd)](a126_0x36533f['white']('\x20\x20npm\x20install')),console['log'](a126_0x36533f['white'](_0x4e9db4(0x179))),console['log'](a126_0x36533f[_0x4e9db4(0x171)](_0x4e9db4(0x169))),console[_0x4e9db4(0x1bd)](''));}
|
|
1
|
+
function a126_0x42e8(){const _0x5d951d=['needsSkillSwap','step','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','\x20\x20bun\x20install','oldPath','stringify','white','906070qtLrRa','\x20\x20Fields\x20to\x20migrate:\x20','\x20→\x20latest','CANCEL','configMigration','some','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','7pbwHYS','args','join','yes','oldMcpConfig','Upgrade\x20completed\x20successfully!','info','oldArtifacts','333924gblmqZ','sdkUpgrade','Legacy\x20artifacts:','green','exit\x20','9RQRkjo','.cursor/mcp.json','526CaLFKj','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','succeed','lovrabet/rabetbase\x20installed\x20globally','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','yellow','bold','Remove\x20old\x20skill','dependencies','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','not\x20found\x20(will\x20create)','@lovrabet/dataset-mcp-server','path','2050550MOcPmP','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','detail','isDirectory','done','entries','length','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','\x20→\x20','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','\x20\x20Step\x20','object','hasNewConfig','parse','\x20from\x20','Upgrade\x20cancelled.','undefined','includes','3021obaZdT','lovrabet/rabetbase','@lovrabet/sdk:','string','@lovrabet/sdk','Remove\x20legacy\x20artifacts','devDependencies','727ZZqYxd','76KprQrK','Remove\x20.lovrabet/','\x20removed','Upgrade\x20@lovrabet/sdk','none\x20found','message','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','Install\x20new\x20skill','.claude/skills/lovrabet','.lovrabet','Step\x201/7:\x20Config\x20migration\x20—\x20','\x20\x20Current\x20version\x20in\x20','not\x20found\x20or\x20already\x20at\x20latest','start','isArray','\x20\x20#\x20or','Step\x206/7:\x20Installing\x20new\x20skill...','red','Clean\x20MCP\x20config','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','failed','Step\x201/7:\x20Migrating\x20config...','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','gray','\x20removed\x20(','\x20\x20Action:\x20delete','\x20(backup:\x20','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','mcpServers','inherit','1352392uoaPQg','FAIL','fail','files','already\x20exists\x20(will\x20merge)','needed','status','utf8','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','cyan','values','20SfSpEw','Step\x204/7:\x20Cleaning\x20MCP\x20config...','label','not\x20needed','2018820cLhlMG','error','fields','keys','push','skipped\x20(no\x20legacy\x20config)','Config\x20migration','latest','\x20\x20\x20\x20\x20\x20\x20','===\x20Upgrade\x20Summary\x20===','\x20\x20New\x20config\x20(.rabetbase.json):\x20','.bak','log','no\x20matching\x20entry\x20found','MCP\x20config:','filter'];a126_0x42e8=function(){return _0x5d951d;};return a126_0x42e8();}(function(_0xd9d178,_0x1ca889){const _0x87a60e=a126_0x18f7,_0x1f0729=_0xd9d178();while(!![]){try{const _0x32267d=-parseInt(_0x87a60e(0x1dd))/0x1*(-parseInt(_0x87a60e(0x238))/0x2)+parseInt(_0x87a60e(0x1d6))/0x3*(parseInt(_0x87a60e(0x1de))/0x4)+parseInt(_0x87a60e(0x207))/0x5*(parseInt(_0x87a60e(0x231))/0x6)+parseInt(_0x87a60e(0x229))/0x7*(parseInt(_0x87a60e(0x1fc))/0x8)+parseInt(_0x87a60e(0x236))/0x9*(-parseInt(_0x87a60e(0x245))/0xa)+-parseInt(_0x87a60e(0x222))/0xb+-parseInt(_0x87a60e(0x20b))/0xc;if(_0x32267d===_0x1ca889)break;else _0x1f0729['push'](_0x1f0729['shift']());}catch(_0x5d7e19){_0x1f0729['push'](_0x1f0729['shift']());}}}(a126_0x42e8,0x23ba3));import a126_0x1e57a9 from'chalk';import a126_0x1e1828 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['filter'](_0xc1911=>_0xc1911!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x371f3d){const _0x41fed5=a126_0x18f7,_0x1b33b6=[];for(const _0x4adfa9 of Object[_0x41fed5(0x206)](CORE_IDE_CONFIGS)){if(_0x4adfa9['files'])for(const _0x430b1b of _0x4adfa9[_0x41fed5(0x1ff)]){_0x1b33b6[_0x41fed5(0x20f)](resolve(_0x371f3d,_0x430b1b['path']));}}return _0x1b33b6;}function analyse(_0x2b709e){const _0x115f33=a126_0x18f7;let _0x35e731=null;const _0x5d62b9=resolve(_0x2b709e,NEW_CONFIG_NAME),_0x5acd29=existsSync(_0x5d62b9);for(const _0xde4c04 of LEGACY_CONFIG_NAMES){const _0x3b43ee=resolve(_0x2b709e,_0xde4c04);if(existsSync(_0x3b43ee)){const _0x259bde=readConfigFile(_0x3b43ee),_0x5d2d0a=Object['keys'](_0x259bde)[_0x115f33(0x21a)](_0x4534f2=>typeof _0x259bde[_0x4534f2]!==_0x115f33(0x1d4));_0x35e731={'oldPath':_0x3b43ee,'hasNewConfig':_0x5acd29,'fields':_0x5d2d0a};break;}}const _0x5b91e8=[],_0x2d8c4d=resolve(_0x2b709e,_0x115f33(0x1e7));if(existsSync(_0x2d8c4d))_0x5b91e8[_0x115f33(0x20f)](_0x2d8c4d);const _0x253827=resolve(_0x2b709e,'.cursor/rules/lovrabet_rules.mdc');if(existsSync(_0x253827))_0x5b91e8[_0x115f33(0x20f)](_0x253827);const _0x479ffe=resolve(_0x2b709e,_0x115f33(0x1e6));if(existsSync(_0x479ffe))_0x5b91e8[_0x115f33(0x20f)](_0x479ffe);for(const _0x3818f7 of collectIdeSkillFiles(_0x2b709e)){if(existsSync(_0x3818f7))_0x5b91e8[_0x115f33(0x20f)](_0x3818f7);}let _0x397269=null;const _0x2cf250=resolve(_0x2b709e,_0x115f33(0x237));if(existsSync(_0x2cf250))try{const _0x4613c2=JSON[_0x115f33(0x253)](readFileSync(_0x2cf250,_0x115f33(0x203)));if(_0x4613c2?.['mcpServers']&&typeof _0x4613c2[_0x115f33(0x1fa)]==='object'){const _0x6e6e2c=[];for(const [_0x4c6113,_0xe7e31c]of Object[_0x115f33(0x24a)](_0x4613c2[_0x115f33(0x1fa)])){const _0x1d51ff=_0xe7e31c;_0x1d51ff?.[_0x115f33(0x22a)]&&Array[_0x115f33(0x1ec)](_0x1d51ff[_0x115f33(0x22a)])&&_0x1d51ff[_0x115f33(0x22a)][_0x115f33(0x227)](_0x2fac14=>typeof _0x2fac14===_0x115f33(0x1d9)&&_0x2fac14[_0x115f33(0x1d5)](_0x115f33(0x243)))&&_0x6e6e2c['push'](_0x4c6113);}_0x6e6e2c[_0x115f33(0x24b)]>0x0&&(_0x397269={'path':_0x2cf250,'keys':_0x6e6e2c});}}catch{}const _0x2d0ea9=_0x5b91e8[_0x115f33(0x24b)]>0x0||_0x35e731!==null;let _0x44c741=null;const _0x26d66e=resolve(_0x2b709e,'package.json');if(existsSync(_0x26d66e))try{const _0x35c3ca=JSON[_0x115f33(0x253)](readFileSync(_0x26d66e,_0x115f33(0x203)));for(const _0x10603 of[_0x115f33(0x240),_0x115f33(0x1dc)]){const _0x181645=_0x35c3ca?.[_0x10603]?.[_0x115f33(0x1da)];if(typeof _0x181645==='string'){_0x181645!=='latest'&&(_0x44c741={'pkgPath':_0x26d66e,'currentVersion':_0x181645,'field':_0x10603});break;}}}catch{}return{'configMigration':_0x35e731,'oldArtifacts':_0x5b91e8,'oldMcpConfig':_0x397269,'needsSkillSwap':_0x2d0ea9,'sdkUpgrade':_0x44c741};}function printReport(_0x19712d){const _0x44686c=a126_0x18f7,{configMigration:_0x5b89a2,oldArtifacts:_0x5c32e6,oldMcpConfig:_0x5a655b,needsSkillSwap:_0x38369b}=_0x19712d;console[_0x44686c(0x217)](''),console['log'](a126_0x1e57a9[_0x44686c(0x23e)]('===\x20Upgrade\x20Analysis\x20===')),console[_0x44686c(0x217)]('');_0x5b89a2?(console[_0x44686c(0x217)](a126_0x1e57a9['cyan']('Config\x20file:')+('\x20\x20'+a126_0x1e57a9[_0x44686c(0x23d)](_0x5b89a2[_0x44686c(0x21f)]))),console[_0x44686c(0x217)](_0x44686c(0x215)+(_0x5b89a2['hasNewConfig']?a126_0x1e57a9[_0x44686c(0x234)](_0x44686c(0x200)):a126_0x1e57a9[_0x44686c(0x1f5)](_0x44686c(0x242)))),console[_0x44686c(0x217)](_0x44686c(0x223)+_0x5b89a2[_0x44686c(0x20d)]['join'](',\x20')),console[_0x44686c(0x217)](_0x44686c(0x246))):console[_0x44686c(0x217)](a126_0x1e57a9[_0x44686c(0x205)]('Config\x20file:')+'\x20\x20'+a126_0x1e57a9['gray']('no\x20legacy\x20config\x20found'));console[_0x44686c(0x217)]('');if(_0x5c32e6[_0x44686c(0x24b)]>0x0){console[_0x44686c(0x217)](a126_0x1e57a9['cyan'](_0x44686c(0x233)));for(const _0x51de14 of _0x5c32e6){console['log']('\x20\x20'+a126_0x1e57a9['red']('FOUND')+'\x20\x20'+_0x51de14);}console[_0x44686c(0x217)](_0x44686c(0x1f7));}else console['log'](a126_0x1e57a9[_0x44686c(0x205)](_0x44686c(0x233))+'\x20\x20'+a126_0x1e57a9[_0x44686c(0x1f5)](_0x44686c(0x1e2)));console[_0x44686c(0x217)]('');_0x5a655b?(console[_0x44686c(0x217)](a126_0x1e57a9[_0x44686c(0x205)](_0x44686c(0x219))+('\x20\x20'+a126_0x1e57a9[_0x44686c(0x23d)](_0x5a655b['path'])+'\x20→\x20keys:\x20'+_0x5a655b[_0x44686c(0x20e)]['join'](',\x20'))),console[_0x44686c(0x217)](_0x44686c(0x204))):console[_0x44686c(0x217)](a126_0x1e57a9[_0x44686c(0x205)]('MCP\x20config:')+'\x20\x20'+a126_0x1e57a9['gray']('no\x20legacy\x20entry'));console[_0x44686c(0x217)](''),console[_0x44686c(0x217)](a126_0x1e57a9['cyan']('Skill\x20swap:')+('\x20\x20'+(_0x38369b?a126_0x1e57a9[_0x44686c(0x23d)](_0x44686c(0x201)):a126_0x1e57a9[_0x44686c(0x234)](_0x44686c(0x20a)))));_0x38369b&&console[_0x44686c(0x217)](_0x44686c(0x23c)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x44686c(0x217)]('');if(_0x19712d[_0x44686c(0x232)]){const {currentVersion:_0x33dc5,field:_0x201da7,pkgPath:_0x18b814}=_0x19712d['sdkUpgrade'];console[_0x44686c(0x217)](a126_0x1e57a9[_0x44686c(0x205)](_0x44686c(0x1d8))+('\x20\x20'+a126_0x1e57a9[_0x44686c(0x23d)](_0x18b814))),console[_0x44686c(0x217)](_0x44686c(0x1e9)+_0x201da7+':\x20'+a126_0x1e57a9[_0x44686c(0x23d)](_0x33dc5)+_0x44686c(0x24d)+a126_0x1e57a9[_0x44686c(0x234)]('latest')),console[_0x44686c(0x217)](_0x44686c(0x21d));}else console[_0x44686c(0x217)](a126_0x1e57a9[_0x44686c(0x205)]('@lovrabet/sdk:')+'\x20\x20'+a126_0x1e57a9[_0x44686c(0x1f5)](_0x44686c(0x1ea)));console[_0x44686c(0x217)]('');}function execConfigMigration(_0x54f474,_0x3c081c){const _0x868f73=a126_0x18f7,{configMigration:_0x511c24}=_0x54f474;if(!_0x511c24?.['oldPath'])return{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x868f73(0x210)};const _0x242b1e=readConfigFile(_0x511c24[_0x868f73(0x21f)]),_0xd79934=resolve(_0x3c081c,NEW_CONFIG_NAME),_0x226aea=_0x511c24[_0x868f73(0x252)]?readConfigFile(_0xd79934):{};for(const [_0x19ade3,_0x21541c]of Object[_0x868f73(0x24a)](_0x242b1e)){!(_0x19ade3 in _0x226aea)&&(_0x226aea[_0x19ade3]=_0x21541c);}writeConfigFile(_0xd79934,_0x226aea);const _0x23935f=_0x511c24['oldPath']+_0x868f73(0x216);return renameSync(_0x511c24[_0x868f73(0x21f)],_0x23935f),{'step':0x1,'label':_0x868f73(0x211),'ok':!![],'detail':_0x511c24[_0x868f73(0x21f)]+'\x20→\x20'+_0xd79934+_0x868f73(0x1f8)+_0x23935f+')'};}function execRemoveOldArtifacts(_0x1caca9){const _0x156387=a126_0x18f7,_0x3251ee=[];for(const _0xc311c5 of _0x1caca9){try{if(!existsSync(_0xc311c5))continue;const _0x2a99f0=tryStat(_0xc311c5);_0x2a99f0?.[_0x156387(0x248)]()?rmSync(_0xc311c5,{'recursive':!![],'force':!![]}):unlinkSync(_0xc311c5);}catch(_0x514da4){_0x3251ee['push'](_0xc311c5+':\x20'+_0x514da4[_0x156387(0x1e3)]);}}return{'step':0x3,'label':_0x156387(0x1db),'ok':_0x3251ee[_0x156387(0x24b)]===0x0,'detail':_0x3251ee[_0x156387(0x24b)]>0x0?_0x1caca9[_0x156387(0x24b)]-_0x3251ee[_0x156387(0x24b)]+'/'+_0x1caca9[_0x156387(0x24b)]+_0x156387(0x1f6)+_0x3251ee[_0x156387(0x22b)](';\x20')+')':_0x1caca9['length']+_0x156387(0x1e0)};}function execCleanMcp(_0x129754){const _0x429974=a126_0x18f7;if(!_0x129754['oldMcpConfig'])return{'step':0x4,'label':_0x429974(0x1f0),'ok':!![],'detail':'skipped'};try{const _0x33ac3b=readFileSync(_0x129754[_0x429974(0x22d)][_0x429974(0x244)],'utf8'),_0x26ea97=JSON['parse'](_0x33ac3b);if(_0x26ea97?.['mcpServers']&&typeof _0x26ea97[_0x429974(0x1fa)]===_0x429974(0x251)){const _0x48c913=[];for(const [_0x50a7b8,_0x3213c7]of Object[_0x429974(0x24a)](_0x26ea97[_0x429974(0x1fa)])){_0x3213c7?.['args']&&Array[_0x429974(0x1ec)](_0x3213c7[_0x429974(0x22a)])&&_0x3213c7['args'][_0x429974(0x227)](_0x3811ba=>typeof _0x3811ba===_0x429974(0x1d9)&&_0x3811ba['includes'](_0x429974(0x243)))&&_0x48c913[_0x429974(0x20f)](_0x50a7b8);}for(const _0x2c1863 of _0x48c913){delete _0x26ea97[_0x429974(0x1fa)][_0x2c1863];}return _0x48c913[_0x429974(0x24b)]>0x0&&writeFileSync(_0x129754[_0x429974(0x22d)][_0x429974(0x244)],JSON[_0x429974(0x220)](_0x26ea97,null,0x2)+'\x0a',_0x429974(0x203)),{'step':0x4,'label':_0x429974(0x1f0),'ok':!![],'detail':'removed\x20'+_0x48c913[_0x429974(0x22b)](',\x20')+_0x429974(0x254)+_0x129754[_0x429974(0x22d)][_0x429974(0x244)]};}return{'step':0x4,'label':_0x429974(0x1f0),'ok':!![],'detail':_0x429974(0x218)};}catch(_0x442882){return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':![],'detail':_0x442882['message']};}}function a126_0x18f7(_0x322cc5,_0x30a16b){_0x322cc5=_0x322cc5-0x1d3;const _0x42e847=a126_0x42e8();let _0x18f70c=_0x42e847[_0x322cc5];return _0x18f70c;}function execSkillsRemove(_0x35863c,_0x34f3c0){const _0xe89e41=a126_0x18f7,_0x58917=runNpxSkillsRemove(_0x35863c,{'stdio':_0xe89e41(0x1fb),'yes':_0x34f3c0});return{'step':0x5,'label':_0xe89e41(0x23f),'ok':_0x58917['ok'],'detail':_0x58917['ok']?'lovrabet/lovrabet-skill\x20removed':_0x58917[_0xe89e41(0x20c)]??_0xe89e41(0x235)+_0x58917[_0xe89e41(0x202)]};}function execSkillsAdd(_0x167d85,_0x5d2989){const _0x12d211=a126_0x18f7,_0x404dcc=runNpxSkillsAddGlobal(_0x167d85,_0x12d211(0x1d7),{'stdio':_0x12d211(0x1fb),'yes':_0x5d2989});return{'step':0x6,'label':_0x12d211(0x1e5),'ok':_0x404dcc['ok'],'detail':_0x404dcc['ok']?_0x12d211(0x23b):_0x404dcc[_0x12d211(0x20c)]??_0x12d211(0x235)+_0x404dcc[_0x12d211(0x202)]};}function execUpgradeSdk(_0x2fb704){const _0x258d43=a126_0x18f7;if(!_0x2fb704['sdkUpgrade'])return{'step':0x7,'label':_0x258d43(0x1e1),'ok':!![],'detail':_0x258d43(0x24c)};const {pkgPath:_0x3cdca8,currentVersion:_0x5cfc49,field:_0x2e5087}=_0x2fb704[_0x258d43(0x232)];try{const _0x25aeff=readFileSync(_0x3cdca8,'utf8'),_0x4a17ac=JSON[_0x258d43(0x253)](_0x25aeff);return _0x4a17ac[_0x2e5087][_0x258d43(0x1da)]=_0x258d43(0x212),writeFileSync(_0x3cdca8,JSON[_0x258d43(0x220)](_0x4a17ac,null,0x2)+'\x0a',_0x258d43(0x203)),{'step':0x7,'label':_0x258d43(0x1e1),'ok':!![],'detail':_0x2e5087+'[\x22@lovrabet/sdk\x22]:\x20'+_0x5cfc49+_0x258d43(0x224)};}catch(_0x27a927){return{'step':0x7,'label':_0x258d43(0x1e1),'ok':![],'detail':_0x27a927[_0x258d43(0x1e3)]};}}function tryStat(_0x573baf){try{return statSync(_0x573baf);}catch{return undefined;}}function printSummary(_0x52ad8f){const _0x385526=a126_0x18f7;console[_0x385526(0x217)](''),console[_0x385526(0x217)](a126_0x1e57a9[_0x385526(0x23e)](_0x385526(0x214))),console[_0x385526(0x217)]('');for(const _0x297a6d of _0x52ad8f){const _0x432103=_0x297a6d['ok']?a126_0x1e57a9['green']('OK'):a126_0x1e57a9[_0x385526(0x1ef)](_0x385526(0x1fd));console['log']('\x20\x20'+_0x432103+_0x385526(0x250)+_0x297a6d[_0x385526(0x21c)]+':\x20'+_0x297a6d[_0x385526(0x209)]);if(_0x297a6d[_0x385526(0x247)])console[_0x385526(0x217)](_0x385526(0x213)+a126_0x1e57a9[_0x385526(0x1f5)](_0x297a6d[_0x385526(0x247)]));}console[_0x385526(0x217)]('');}export async function upgradeApp(_0x2073ac,_0x2f53d0){const _0x33e370=a126_0x18f7,_0x284201=process['cwd'](),_0x1ca490=analyse(_0x284201),_0x1b725e=!_0x1ca490[_0x33e370(0x226)]&&_0x1ca490[_0x33e370(0x230)][_0x33e370(0x24b)]===0x0&&!_0x1ca490['oldMcpConfig']&&!_0x1ca490[_0x33e370(0x21b)]&&!_0x1ca490[_0x33e370(0x232)];if(_0x1b725e){console[_0x33e370(0x217)](a126_0x1e57a9[_0x33e370(0x234)]('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0x1ca490);const _0x4029e7=!!(_0x2f53d0[_0x33e370(0x22c)]||_0x2f53d0['Y']||_0x2073ac);if(!_0x4029e7)try{const _0x4da11f=await askConfirm('Proceed\x20with\x20upgrade?');if(!_0x4da11f){console[_0x33e370(0x217)](a126_0x1e57a9['gray'](_0x33e370(0x1d3)));return;}}catch(_0x476a99){if(_0x476a99?.['message']===_0x33e370(0x225)){console[_0x33e370(0x217)](a126_0x1e57a9[_0x33e370(0x1f5)](_0x33e370(0x1d3)));return;}throw _0x476a99;}const _0x5a3355=[],_0x1fda6e=a126_0x1e1828({'text':_0x33e370(0x1f3),'color':_0x33e370(0x205)})['start'](),_0x23cac0=execConfigMigration(_0x1ca490,_0x284201);_0x5a3355['push'](_0x23cac0),_0x1fda6e[_0x23cac0['ok']?_0x33e370(0x23a):_0x33e370(0x1fe)](_0x33e370(0x1e8)+(_0x23cac0[_0x33e370(0x247)]??(_0x23cac0['ok']?'done':'failed')));const _0x4cd7e0=resolve(_0x284201,_0x33e370(0x1e7)),_0x78672a=a126_0x1e1828({'text':_0x33e370(0x24e),'color':_0x33e370(0x205)})[_0x33e370(0x1eb)]();if(existsSync(_0x4cd7e0))try{rmSync(_0x4cd7e0,{'recursive':!![],'force':!![]}),_0x78672a[_0x33e370(0x23a)](_0x33e370(0x1f1)),_0x5a3355['push']({'step':0x2,'label':_0x33e370(0x1df),'ok':!![]});}catch(_0x1e8792){_0x78672a[_0x33e370(0x1fe)]('Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20'+_0x1e8792[_0x33e370(0x1e3)]),_0x5a3355[_0x33e370(0x20f)]({'step':0x2,'label':_0x33e370(0x1df),'ok':![],'detail':_0x1e8792[_0x33e370(0x1e3)]});}else _0x78672a[_0x33e370(0x22f)](_0x33e370(0x1f9)),_0x5a3355[_0x33e370(0x20f)]({'step':0x2,'label':_0x33e370(0x1df),'ok':!![],'detail':'skipped'});const _0x292983=a126_0x1e1828({'text':_0x33e370(0x1f4),'color':_0x33e370(0x205)})['start'](),_0x5c5f7c=execRemoveOldArtifacts(_0x1ca490[_0x33e370(0x230)]);_0x5a3355[_0x33e370(0x20f)](_0x5c5f7c),_0x292983[_0x5c5f7c['ok']?'succeed':'fail'](_0x33e370(0x239)+(_0x5c5f7c[_0x33e370(0x247)]??(_0x5c5f7c['ok']?'done':_0x33e370(0x1f2))));const _0x12508d=a126_0x1e1828({'text':_0x33e370(0x208),'color':_0x33e370(0x205)})[_0x33e370(0x1eb)](),_0x4017f0=execCleanMcp(_0x1ca490);_0x5a3355[_0x33e370(0x20f)](_0x4017f0),_0x12508d[_0x4017f0['ok']?_0x33e370(0x23a):'fail']('Step\x204/7:\x20MCP\x20config\x20—\x20'+(_0x4017f0[_0x33e370(0x247)]??(_0x4017f0['ok']?_0x33e370(0x249):_0x33e370(0x1f2))));const _0x147e4f=a126_0x1e1828({'text':'Step\x205/7:\x20Removing\x20old\x20skill...','color':'cyan'})['start'](),_0x192977=execSkillsRemove(_0x284201,_0x4029e7);_0x5a3355['push'](_0x192977),_0x147e4f[_0x192977['ok']?_0x33e370(0x23a):_0x33e370(0x1fe)](_0x33e370(0x1e4)+(_0x192977['detail']??(_0x192977['ok']?_0x33e370(0x249):_0x33e370(0x1f2))));const _0x35b88d=a126_0x1e1828({'text':_0x33e370(0x1ee),'color':'cyan'})[_0x33e370(0x1eb)](),_0x4b560f=execSkillsAdd(_0x284201,_0x4029e7);_0x5a3355[_0x33e370(0x20f)](_0x4b560f),_0x35b88d[_0x4b560f['ok']?_0x33e370(0x23a):_0x33e370(0x1fe)]('Step\x206/7:\x20Install\x20new\x20skill\x20—\x20'+(_0x4b560f[_0x33e370(0x247)]??(_0x4b560f['ok']?_0x33e370(0x249):_0x33e370(0x1f2))));const _0x42c198=a126_0x1e1828({'text':_0x33e370(0x228),'color':_0x33e370(0x205)})[_0x33e370(0x1eb)](),_0x39ad2a=execUpgradeSdk(_0x1ca490);_0x5a3355[_0x33e370(0x20f)](_0x39ad2a),_0x42c198[_0x39ad2a['ok']?_0x33e370(0x23a):_0x33e370(0x1fe)](_0x33e370(0x241)+(_0x39ad2a[_0x33e370(0x247)]??(_0x39ad2a['ok']?_0x33e370(0x249):_0x33e370(0x1f2)))),printSummary(_0x5a3355);const _0x5834e1=_0x5a3355[_0x33e370(0x227)](_0x4d6908=>!_0x4d6908['ok']);_0x5834e1?console[_0x33e370(0x217)](a126_0x1e57a9[_0x33e370(0x23d)]('Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.')):console[_0x33e370(0x217)](a126_0x1e57a9[_0x33e370(0x234)](_0x33e370(0x22e))),_0x39ad2a['ok']&&_0x1ca490['sdkUpgrade']&&(console[_0x33e370(0x217)](''),console[_0x33e370(0x217)](a126_0x1e57a9[_0x33e370(0x23e)][_0x33e370(0x205)]('@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.')),console['log'](a126_0x1e57a9[_0x33e370(0x205)](_0x33e370(0x24f))),console[_0x33e370(0x217)](''),console[_0x33e370(0x217)](a126_0x1e57a9[_0x33e370(0x221)]('\x20\x20npm\x20install')),console[_0x33e370(0x217)](a126_0x1e57a9[_0x33e370(0x221)](_0x33e370(0x1ed))),console['log'](a126_0x1e57a9[_0x33e370(0x221)](_0x33e370(0x21e))),console[_0x33e370(0x217)](''));}
|
package/lib/commands/registry.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a127_0x3ed19c=a127_0x1afb;(function(_0x4ea31,_0x2d308e){const _0x4df43d=a127_0x1afb,_0x2c5861=_0x4ea31();while(!![]){try{const _0xfc543f=-parseInt(_0x4df43d(0x1e7))/0x1+parseInt(_0x4df43d(0x1fb))/0x2*(-parseInt(_0x4df43d(0x1e8))/0x3)+parseInt(_0x4df43d(0x1e3))/0x4+parseInt(_0x4df43d(0x1e5))/0x5+-parseInt(_0x4df43d(0x1ed))/0x6*(parseInt(_0x4df43d(0x1e2))/0x7)+-parseInt(_0x4df43d(0x1f1))/0x8*(-parseInt(_0x4df43d(0x1e4))/0x9)+parseInt(_0x4df43d(0x1f2))/0xa*(parseInt(_0x4df43d(0x1dd))/0xb);if(_0xfc543f===_0x2d308e)break;else _0x2c5861['push'](_0x2c5861['shift']());}catch(_0x1307d1){_0x2c5861['push'](_0x2c5861['shift']());}}}(a127_0x1991,0x66aa5));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';function a127_0x1991(){const _0x3b50d1=['command','Configuration','3707429hddnSC','has','`rabetbase\x20skills`\x20has\x20been\x20removed.','Run\x20Scripts','run','5726mOfLqt','3131160kOOBEm','6192rddCZa','1155665tVhNCH','\x20\x20[high-risk-write]','56653sgmHQB','313164YGoNsN','Menu','isSingleCommand','wildcardDef','Schema','3252coOHAG','preview','Dataset\x20&\x20Operations','skills','1064ojgply','10ooorHk','Authentication','service','logout','Code\x20Generation','SQL\x20Queries','Self\x20Update','install','from','10oxPAFv','push','create','Diagnostics','show','risk','skill','API','read','Workspace','Database\x20Connections','values','set','Logs','Use\x20`rabetbase\x20cli-skill\x20install`\x20to\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill.\x20To\x20install\x20business\x20Skills,\x20use\x20`lovrabet\x20skill\x20install`.','get','`rabetbase\x20','Smart\x20List\x20Pages','build','`\x20has\x20been\x20removed.','auth','Run\x20any\x20package.json\x20script'];a127_0x1991=function(){return _0x3b50d1;};return a127_0x1991();}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';import{issueDefinitions}from'../commands/issue/index.js';import{cliSkillDefinitions}from'../commands/cli-skill/index.js';import{authDefinitions}from'../commands/auth/index.js';import{logsDefinitions}from'../commands/logs/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(_0x56acfc){const _0x2a84ea=a127_0x1afb;for(const _0x5398cb of _0x56acfc){definitions[_0x2a84ea(0x1d1)](_0x5398cb['service']+':'+_0x5398cb[_0x2a84ea(0x1db)],_0x5398cb);let _0x3002a6=serviceGroups['get'](_0x5398cb['service']);!_0x3002a6&&(_0x3002a6=[],serviceGroups[_0x2a84ea(0x1d1)](_0x5398cb[_0x2a84ea(0x1f4)],_0x3002a6)),_0x3002a6[_0x2a84ea(0x1fc)](_0x5398cb);}}function registerDeclarativeService(_0x48feb8,_0x33d7d8,_0x54ecbd){const _0x46e7fc=a127_0x1afb;registerDefinitions(_0x33d7d8);_0x54ecbd?.[_0x46e7fc(0x1eb)]&®isterDefinitions([_0x54ecbd[_0x46e7fc(0x1eb)]]);const _0x1e19b0=_0x513182=>_0x513182===_0x46e7fc(0x203)?'':_0x513182==='write'?'\x20\x20[write]':_0x46e7fc(0x1e6),_0x44e863={'service':_0x33d7d8[0x0][_0x46e7fc(0x1f4)],'label':_0x48feb8,'commands':_0x33d7d8['map'](_0x33c948=>({'command':_0x33c948[_0x46e7fc(0x1db)],'description':_0x33c948['description'],'tag':_0x1e19b0(_0x33c948[_0x46e7fc(0x200)])})),'declarative':!![],'defaultCommand':_0x54ecbd?.['defaultCommand']??(_0x54ecbd?.[_0x46e7fc(0x1ea)]?_0x33d7d8[0x0][_0x46e7fc(0x1db)]:undefined),'wildcardDef':_0x54ecbd?.[_0x46e7fc(0x1eb)],'isSingleCommand':_0x54ecbd?.[_0x46e7fc(0x1ea)]};serviceRegistry[_0x46e7fc(0x1fc)](_0x44e863),serviceByName[_0x46e7fc(0x1d1)](_0x44e863['service'],_0x44e863);}registerDeclarativeService('Quick\x20Start',initDefinitions,{'defaultCommand':a127_0x3ed19c(0x1e1),'isSingleCommand':!![]}),registerDeclarativeService('Project',projectDefinitions),registerDeclarativeService(a127_0x3ed19c(0x204),workspaceDefinitions),registerDeclarativeService('App\x20Management',appDefinitions),registerDeclarativeService(a127_0x3ed19c(0x1e0),[runDefinition],{'wildcardDef':runDefinition});function a127_0x1afb(_0x53b8b8,_0x559fc9){_0x53b8b8=_0x53b8b8-0x1d1;const _0x19911b=a127_0x1991();let _0x1afbcc=_0x19911b[_0x53b8b8];return _0x1afbcc;}{const last=serviceRegistry[serviceRegistry['length']-0x1];last['commands']=[{'command':'<script>','description':a127_0x3ed19c(0x1da),'tag':''}];}registerDeclarativeService(a127_0x3ed19c(0x1f3),authDefinitions,{'defaultCommand':'login'}),registerDeclarativeService(a127_0x3ed19c(0x1f8),[updateDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a127_0x3ed19c(0x1fe),[doctorDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a127_0x3ed19c(0x1ec),[schemaDefinition],{'isSingleCommand':!![]}),registerDeclarativeService(a127_0x3ed19c(0x1dc),configDefinitions),registerDeclarativeService('Remote\x20App\x20Config',appConfigDefinitions),registerDeclarativeService('Platform\x20Issue',issueDefinitions),registerDeclarativeService(a127_0x3ed19c(0x202),apiDefinitions),registerDeclarativeService(a127_0x3ed19c(0x1e9),menuDefinitions),registerDeclarativeService(a127_0x3ed19c(0x205),dbDefinitions),registerDeclarativeService(a127_0x3ed19c(0x1ef),datasetDefinitions),registerDeclarativeService(a127_0x3ed19c(0x1d6),pageDefinitions),registerDeclarativeService('Instant\x20API',dataDefinitions),registerDeclarativeService('BFF\x20Scripts',bffDefinitions),registerDeclarativeService(a127_0x3ed19c(0x1f7),sqlDefinitions),registerDeclarativeService(a127_0x3ed19c(0x1f6),codegenDefinitions),registerDeclarativeService('CLI\x20Built-in\x20Skill',cliSkillDefinitions,{'defaultCommand':a127_0x3ed19c(0x1f9)}),registerDeclarativeService(a127_0x3ed19c(0x1d2),logsDefinitions,{'defaultCommand':a127_0x3ed19c(0x1ff)});export const deprecatedAliases={'create':{'service':'project','command':a127_0x3ed19c(0x1fd)},'start':{'service':'run','command':'start'},'build':{'service':a127_0x3ed19c(0x1e1),'command':a127_0x3ed19c(0x1d7)},'preview':{'service':a127_0x3ed19c(0x1e1),'command':a127_0x3ed19c(0x1ee)},'logout':{'service':a127_0x3ed19c(0x1d9),'command':a127_0x3ed19c(0x1f5)}};const CLI_SKILL_INSTALL_REMOVED_HINT=a127_0x3ed19c(0x1d3);export function resolveRemovedCommand(_0x2779d3,_0x5e12d7){const _0x24cb69=a127_0x3ed19c;if(_0x2779d3===_0x24cb69(0x201)){const _0x51e3ef=_0x5e12d7?'skill\x20'+_0x5e12d7:_0x24cb69(0x201);return{'command':_0x51e3ef,'message':_0x24cb69(0x1d5)+_0x51e3ef+_0x24cb69(0x1d8),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};}if(_0x2779d3==='skills')return{'command':_0x24cb69(0x1f0),'message':_0x24cb69(0x1df),'hint':CLI_SKILL_INSTALL_REMOVED_HINT};return undefined;}export const deprecatedSubcommands={'bff':{'new':a127_0x3ed19c(0x1fd)},'sql':{'new':a127_0x3ed19c(0x1fd)}};export function resolveDeprecatedSubcommand(_0xaa011c,_0x47630d){return deprecatedSubcommands[_0xaa011c]?.[_0x47630d];}export function findDefinition(_0x6df7f9,_0x43ee14){const _0x312d78=a127_0x3ed19c;return definitions[_0x312d78(0x1d4)](_0x6df7f9+':'+_0x43ee14);}export function isKnownService(_0x185614){const _0x16875f=a127_0x3ed19c;return serviceByName[_0x16875f(0x1de)](_0x185614);}export function isDeclarativeService(_0xeb9480){const _0x37ceb7=a127_0x3ed19c;return serviceGroups[_0x37ceb7(0x1de)](_0xeb9480)||serviceByName[_0x37ceb7(0x1d4)](_0xeb9480)?.[_0x37ceb7(0x1eb)]!==undefined;}export function getServiceEntry(_0x2743f7){return serviceByName['get'](_0x2743f7);}export function getLegacyHandler(_0xff13ae,_0x48174a){return undefined;}export function getAllDefinitions(){const _0x2ac36b=a127_0x3ed19c;return Array[_0x2ac36b(0x1fa)](definitions[_0x2ac36b(0x206)]());}
|