@lovrabet/rabetbase-cli 2.3.1 → 2.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.js +1 -1
- package/lib/commands/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-audit.js +1 -0
- 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
|
+
const a115_0x3d618a=a115_0x20ec;function a115_0x509e(){const _0x3ffeae=['10bWUnzZ','/standard-page-status?appCode=','relatedPages','appCode','alias','49ycGYId','1295532iKKoMJ','compress','source','read','length','/smartapi/lovrabet/dataset/','1632734YQZyxg','2477200DdqZIp','430kbPtdT','code','name','GET','12273195COsmMB','query-standard-page-status','related-pages-fallback','5625675FqVyTZ','Query\x20Smart\x20List\x20Page\x20facts\x20for\x20a\x20dataset','426768uHhWcc','Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)','24224HyZiVy','nextAction','standard-page-status','1FdDSSk'];a115_0x509e=function(){return _0x3ffeae;};return a115_0x509e();}(function(_0x1c2b98,_0x259f4b){const _0x4b12f7=a115_0x20ec,_0x3e7b49=_0x1c2b98();while(!![]){try{const _0x130fe0=-parseInt(_0x4b12f7(0x89))/0x1*(-parseInt(_0x4b12f7(0x96))/0x2)+parseInt(_0x4b12f7(0x90))/0x3+parseInt(_0x4b12f7(0x86))/0x4*(-parseInt(_0x4b12f7(0x98))/0x5)+-parseInt(_0x4b12f7(0x84))/0x6*(parseInt(_0x4b12f7(0x8f))/0x7)+-parseInt(_0x4b12f7(0x97))/0x8+parseInt(_0x4b12f7(0x82))/0x9*(-parseInt(_0x4b12f7(0x8a))/0xa)+parseInt(_0x4b12f7(0x9c))/0xb;if(_0x130fe0===_0x259f4b)break;else _0x3e7b49['push'](_0x3e7b49['shift']());}catch(_0x3a3778){_0x3e7b49['push'](_0x3e7b49['shift']());}}}(a115_0x509e,0x64397));function a115_0x20ec(_0x23c6b9,_0x14d20d){_0x23c6b9=_0x23c6b9-0x80;const _0x509ec7=a115_0x509e();let _0x20ec9c=_0x509ec7[_0x23c6b9];return _0x20ec9c;}import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assessStandardPageState,getUndeletedRelatedPages,loadDatasetDetailForPage,loadStandardPageStatusForGenerate,serializeDryRunDescription,validateDatasetSelector}from'../../commands/page/shared.js';export const pageStandardPageStatus={'service':'page','command':a115_0x3d618a(0x88),'description':a115_0x3d618a(0x83),'risk':a115_0x3d618a(0x93),'defaultOutputFormat':a115_0x3d618a(0x91),'flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a115_0x3d618a(0x8e),'type':'string','description':a115_0x3d618a(0x85)}],async 'validate'(_0x4d9013){validateDatasetSelector(_0x4d9013);},async 'dryRun'(_0x181f06){const _0x3261a0=a115_0x3d618a,_0x22b498=await loadDatasetDetailForPage(_0x181f06);return{'method':_0x3261a0(0x9b),'url':_0x3261a0(0x95)+_0x22b498[_0x3261a0(0x99)]+_0x3261a0(0x8b)+encodeURIComponent(_0x181f06[_0x3261a0(0x8d)]),'description':serializeDryRunDescription({'dataset':{'id':_0x22b498['id'],'code':_0x22b498[_0x3261a0(0x99)],'name':_0x22b498[_0x3261a0(0x9a)]},'action':_0x3261a0(0x80)})};},async 'execute'(_0x21184f){const _0x3f3ce6=a115_0x3d618a,_0xf91c1d=await loadDatasetDetailForPage(_0x21184f),_0x1c5c54=await loadStandardPageStatusForGenerate(_0x21184f,_0xf91c1d[_0x3f3ce6(0x99)]),_0x3d4ae2=getUndeletedRelatedPages(_0xf91c1d),_0x29a2b6=assessStandardPageState(_0xf91c1d[_0x3f3ce6(0x99)],_0x1c5c54,{'fallbackUndeletedPages':_0x3d4ae2});return{'ok':!![],'data':{'datasetCode':_0xf91c1d['code'],'precheckSource':_0x1c5c54?.[_0x3f3ce6(0x92)]??_0x3f3ce6(0x81),'status':_0x29a2b6['status'],'manualResolutionRequired':_0x29a2b6['manualResolutionRequired'],'nextAction':_0x29a2b6[_0x3f3ce6(0x87)],'standardPageStatus':_0x1c5c54,'relatedPages':{'total':_0xf91c1d[_0x3f3ce6(0x8c)][_0x3f3ce6(0x94)],'undeletedCount':_0x3d4ae2[_0x3f3ce6(0x94)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a116_0xf48214=a116_0x1e1d;(function(_0x3d9be3,_0x200b9f){const _0x5e8064=a116_0x1e1d,_0x4ed8a0=_0x3d9be3();while(!![]){try{const _0x86202b=-parseInt(_0x5e8064(0xea))/0x1+-parseInt(_0x5e8064(0xe1))/0x2*(parseInt(_0x5e8064(0xda))/0x3)+-parseInt(_0x5e8064(0xf4))/0x4+parseInt(_0x5e8064(0xd8))/0x5*(-parseInt(_0x5e8064(0xe5))/0x6)+-parseInt(_0x5e8064(0xe7))/0x7+parseInt(_0x5e8064(0xdb))/0x8*(parseInt(_0x5e8064(0xf3))/0x9)+parseInt(_0x5e8064(0xdd))/0xa*(parseInt(_0x5e8064(0xec))/0xb);if(_0x86202b===_0x200b9f)break;else _0x4ed8a0['push'](_0x4ed8a0['shift']());}catch(_0x169274){_0x4ed8a0['push'](_0x4ed8a0['shift']());}}}(a116_0x1f68,0xdb6a5));import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a116_0x1e1d(_0x593dc4,_0x4163e0){_0x593dc4=_0x593dc4-0xd7;const _0x1f689f=a116_0x1f68();let _0x1e1d2a=_0x1f689f[_0x593dc4];return _0x1e1d2a;}import{loadDatasetDetailForPage,prepareDatasetAction,serializeDryRunDescription,validateDatasetSelector}from'../../commands/page/shared.js';import{syncStandardPages}from'../../core/api-client.js';function a116_0x1f68(){const _0x5dde94=['failedPages','sync','name','60255SqznNX','6393080VErlez','/sync-to-pages','\x20undeleted\x20related\x20page(s)\x20found','575290LzOVPv','alias','3zcUXSi','1096iFCWrl','undeletedPages','146890avKQpS','fieldCount','部分页面同步失败','dataset','755204PfwePL','appCode','code','同步成功','6zkDPLp','compress','5301471FfGYaR','/smartapi/lovrabet/dataset/','relatedPages','269586QQHxGA','page','2321RAGLsH','Sync\x20dataset\x20changes\x20to\x20related\x20Smart\x20List\x20Pages','length','write'];a116_0x1f68=function(){return _0x5dde94;};return a116_0x1f68();}export const pageSync={'service':a116_0xf48214(0xeb),'command':'sync','description':a116_0xf48214(0xed),'risk':a116_0xf48214(0xef),'defaultOutputFormat':a116_0xf48214(0xe6),'flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a116_0xf48214(0xd9),'type':'string','description':'Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)'}],async 'validate'(_0xda4c07){validateDatasetSelector(_0xda4c07);},async 'dryRun'(_0xefeb4a){const _0x102483=a116_0xf48214,_0x3f2ebb=await prepare(_0xefeb4a);return{'method':'POST','url':_0x102483(0xe8)+_0x3f2ebb[_0x102483(0xe0)][_0x102483(0xe3)]+_0x102483(0xf5),'body':{'appCode':_0xefeb4a[_0x102483(0xe2)]},'description':serializeDryRunDescription({'dataset':{'id':_0x3f2ebb['dataset']['id'],'code':_0x3f2ebb['dataset']['code'],'name':_0x3f2ebb[_0x102483(0xe0)][_0x102483(0xf2)],'fieldCount':_0x3f2ebb[_0x102483(0xe0)][_0x102483(0xde)]},'relatedPages':{'total':_0x3f2ebb[_0x102483(0xe0)][_0x102483(0xe9)][_0x102483(0xee)],'undeletedCount':_0x3f2ebb[_0x102483(0xdc)][_0x102483(0xee)]},'action':_0x102483(0xf1),'reason':_0x3f2ebb[_0x102483(0xdc)]['length']+_0x102483(0xd7)})};},async 'execute'(_0x40541b){const _0x518a06=a116_0xf48214,_0x1384d5=await prepare(_0x40541b),_0x3a1d47=await syncStandardPages(_0x40541b[_0x518a06(0xe2)],_0x1384d5[_0x518a06(0xe0)][_0x518a06(0xe3)]),_0x4aa265=Array['isArray'](_0x3a1d47[_0x518a06(0xf0)])&&_0x3a1d47[_0x518a06(0xf0)][_0x518a06(0xee)]>0x0,_0x373b76=_0x4aa265?_0x518a06(0xdf):_0x518a06(0xe4);return{'ok':!![],'message':_0x373b76,'data':{'datasetCode':_0x1384d5[_0x518a06(0xe0)][_0x518a06(0xe3)],..._0x3a1d47}};}};async function prepare(_0x385146){const _0x30bdcb=a116_0xf48214,_0x1b943a=await loadDatasetDetailForPage(_0x385146);return prepareDatasetAction(_0x1b943a,_0x30bdcb(0xf1));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1060a7,_0x5348d7){const _0x847b46=a117_0x1f65,_0x3606d1=_0x1060a7();while(!![]){try{const _0x2905fd=parseInt(_0x847b46(0x7c))/0x1+parseInt(_0x847b46(0x80))/0x2*(parseInt(_0x847b46(0x7f))/0x3)+-parseInt(_0x847b46(0x6f))/0x4+parseInt(_0x847b46(0x82))/0x5+parseInt(_0x847b46(0x6b))/0x6+parseInt(_0x847b46(0x7d))/0x7+-parseInt(_0x847b46(0x7b))/0x8;if(_0x2905fd===_0x5348d7)break;else _0x3606d1['push'](_0x3606d1['shift']());}catch(_0x4bb72e){_0x3606d1['push'](_0x3606d1['shift']());}}}(a117_0x3333,0xbb030));import{existsSync}from'node:fs';import a117_0x567133 from'node:path';import a117_0x550b5f from'chalk';import{input,confirm}from'@inquirer/prompts';function a117_0x3333(){const _0x363fa4=['Project\x20name:','trim','√\x20Project\x20Name:\x20','production','5678376dxFWcK','test','cyan','log','2332960MfcpDN','env','green','my-app','resolve','√\x20App\x20Code:\x20','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','string','Directory\x20\x22','Not\x20set','Skipped','cwd','31535680cLUFRm','1198988OlzScX','4223471RTUVog','Login\x20failed','171ZgkxaE','41508XPnyyw','Project\x20name\x20cannot\x20exceed\x2050\x20characters','6797425hiIzuT'];a117_0x3333=function(){return _0x363fa4;};return a117_0x3333();}import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';function a117_0x1f65(_0x32220f,_0x198b30){_0x32220f=_0x32220f-0x67;const _0x33332f=a117_0x3333();let _0x1f656d=_0x33332f[_0x32220f];return _0x1f656d;}import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x54cd17,_0x123ce5,_0x20159f){const _0xe52f8c=a117_0x1f65,_0x10f9e1=_0xe52f8c(0x72),_0x21ef76=readConfig(),_0x4dff73=typeof _0x21ef76[_0xe52f8c(0x70)]===_0xe52f8c(0x76)?_0x21ef76[_0xe52f8c(0x70)]:undefined,_0x4e8d4f=await input({'message':_0xe52f8c(0x67),'default':_0x10f9e1,'validate':_0x8077c=>{const _0x133403=_0xe52f8c,_0x1ba3e5=_0x8077c[_0x133403(0x68)]()||_0x10f9e1;if(_0x1ba3e5['length']>0x32)return _0x133403(0x81);const _0x54d676=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x1ba3e5&&!_0x54d676[_0x133403(0x6c)](_0x1ba3e5))return _0x133403(0x75);const _0x1b9815=a117_0x567133[_0x133403(0x73)](process[_0x133403(0x7a)](),_0x1ba3e5);if(existsSync(_0x1b9815))return _0x133403(0x77)+_0x1ba3e5+'\x22\x20already\x20exists';return!![];}});console[_0xe52f8c(0x6e)](a117_0x550b5f[_0xe52f8c(0x71)](_0xe52f8c(0x69)+a117_0x550b5f[_0xe52f8c(0x6d)](_0x4e8d4f)));const _0x359608=await selectSingleAppcode(_0x20159f);console[_0xe52f8c(0x6e)](a117_0x550b5f[_0xe52f8c(0x71)](_0xe52f8c(0x74)+a117_0x550b5f[_0xe52f8c(0x6d)](_0x359608||_0xe52f8c(0x78))));if(_0x359608){const _0x499deb=await getIsSessionValid();if(!_0x499deb){const _0x2b636b=await confirm({'message':'No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','default':!![]});if(_0x2b636b){const _0x2db45e=await authServer({'silent':!![]});console[_0xe52f8c(0x6e)](a117_0x550b5f['green']('√\x20Login\x20status:\x20'+a117_0x550b5f[_0xe52f8c(0x6d)](_0x2db45e?'Logged\x20in':_0xe52f8c(0x7e))));}else console[_0xe52f8c(0x6e)](a117_0x550b5f[_0xe52f8c(0x71)]('√\x20Login\x20status:\x20'+a117_0x550b5f['cyan'](_0xe52f8c(0x79))));}await _0x54cd17({'projectName':_0x4e8d4f,'appCode':_0x359608,'env':_0x123ce5||_0x4dff73||_0xe52f8c(0x6a)});}else await _0x54cd17({'projectName':_0x4e8d4f,'env':_0x123ce5||_0x4dff73||'production'});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a118_0x1dcc(_0x1c30ea,_0x3a0ff5){_0x1c30ea=_0x1c30ea-0x6f;const _0x497100=a118_0x4971();let _0x1dccbb=_0x497100[_0x1c30ea];return _0x1dccbb;}(function(_0x583983,_0x319d45){const _0x13c60d=a118_0x1dcc,_0x2b1345=_0x583983();while(!![]){try{const _0x5c7127=-parseInt(_0x13c60d(0x76))/0x1+-parseInt(_0x13c60d(0x72))/0x2*(-parseInt(_0x13c60d(0x79))/0x3)+parseInt(_0x13c60d(0x73))/0x4*(parseInt(_0x13c60d(0x6f))/0x5)+parseInt(_0x13c60d(0x71))/0x6+-parseInt(_0x13c60d(0x74))/0x7*(-parseInt(_0x13c60d(0x7a))/0x8)+parseInt(_0x13c60d(0x70))/0x9*(parseInt(_0x13c60d(0x75))/0xa)+-parseInt(_0x13c60d(0x78))/0xb;if(_0x5c7127===_0x319d45)break;else _0x2b1345['push'](_0x2b1345['shift']());}catch(_0x5dcbd0){_0x2b1345['push'](_0x2b1345['shift']());}}}(a118_0x4971,0xa07df));function a118_0x4971(){const _0x16c5a3=['514528dBdAWS','305WHnUKL','3447fWVUQG','7522374dpuIPV','6826QjciCb','3312uWQRAU','7XlPdrj','31470jQtxWo','235140PbuXFs','toFixed','25890700rbjAEr','591gWjTpc'];a118_0x4971=function(){return _0x16c5a3;};return a118_0x4971();}export function formatElapsed(_0xa3fc2d){const _0x163b4e=a118_0x1dcc,_0x5d9ba9=Date['now']()-_0xa3fc2d;if(_0x5d9ba9<0x3e8)return _0x5d9ba9+'ms';const _0x3355a7=(_0x5d9ba9/0x3e8)[_0x163b4e(0x77)](0x2),_0x222a55=_0x3355a7['replace'](/\.?0+$/u,'');return _0x222a55+'s';}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
(function(_0x5c764a,_0x24f0e6){const _0x5b9f35=a119_0x4054,_0x149b84=_0x5c764a();while(!![]){try{const _0x4760c9=-parseInt(_0x5b9f35(0x200))/0x1*(parseInt(_0x5b9f35(0x1da))/0x2)+-parseInt(_0x5b9f35(0x1fb))/0x3*(parseInt(_0x5b9f35(0x1fc))/0x4)+parseInt(_0x5b9f35(0x1e0))/0x5+-parseInt(_0x5b9f35(0x1cd))/0x6*(parseInt(_0x5b9f35(0x1de))/0x7)+-parseInt(_0x5b9f35(0x20a))/0x8+-parseInt(_0x5b9f35(0x1ed))/0x9*(parseInt(_0x5b9f35(0x1cb))/0xa)+parseInt(_0x5b9f35(0x1d9))/0xb;if(_0x4760c9===_0x24f0e6)break;else _0x149b84['push'](_0x149b84['shift']());}catch(_0x43d768){_0x149b84['push'](_0x149b84['shift']());}}}(a119_0x1f38,0xd23ec));import a119_0x4ce00b from'path';import a119_0x44565a from'fs';import a119_0x59f164 from'chalk';import a119_0x40c2d7 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';function a119_0x4054(_0x44e523,_0x3b2872){_0x44e523=_0x44e523-0x1b4;const _0x1f3810=a119_0x1f38();let _0x4054bc=_0x1f3810[_0x44e523];return _0x4054bc;}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';function a119_0x1f38(){const _0x4abaf3=['repeat','join','constants','3739563ZqoKhN','setLogPath','accessSync','*\x20Pulling\x20API\x20configuration...','success','appCode','W_OK','green','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','chdir','*\x20Configuring\x20AppCode\x20for\x20project\x20','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','\x20config\x20set\x20appcode\x20<app-code>\x27','项目创建完成:\x20','2157294MmttuZ','8WZOxcl','√\x20Pulled\x20','\x20run\x20start','apps','61ZUZFia','version','bold','env','stableVersion','Project\x20name\x20cannot\x20be\x20empty','package.json','\x20already\x20exists','needsUpgrade','清理项目目录失败:\x20','2544704jSxmTm','项目创建失败:\x20','message','配置应用AppCode:\x20','Format\x20code','production','🚀\x20Next\x20Steps:','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','start','...','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','fail','\x20\x202.\x20Pull\x20API\x20configuration:\x20','toLocaleString','defaultApp','1.0.0','cwd','\x20√\x20','cookie','create','cyan','readFileSync','length','belowMinimum','stringify','modelCount','projectName','parse','配置应用AppCode失败','API\x20configuration\x20pulled:\x20','Install\x20dependencies','10TiqjYo','utf8','78AlvoGs','warn','更新\x20package.json\x20name','\x20model(s)','writeFileSync','开始创建项目:\x20','\x20Generated\x20by\x20rabetbase\x20cli\x20','\x20\x201.\x20Start\x20project:\x20','Copy\x20project\x20files','resolve','Project\x20directory\x20','info','56146090HIABGm','24794dojJpw','\x20|\x20AppCode:\x20','error','\x20|\x20Default:\x20','800933EHruCG','existsSync','862145VZorcK','\x20dataset(s),\x20generated\x20','trim','minimumVersion','projectCode','log','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','CLI\x20版本检查','string','keys'];a119_0x1f38=function(){return _0x4abaf3;};return a119_0x1f38();}export async function createApp(_0x42f2f7){const _0x46aef8=a119_0x4054,_0x360a6c=await checkCliVersion();(_0x360a6c[_0x46aef8(0x208)]||_0x360a6c[_0x46aef8(0x1c3)])&&(printCliUpgradeWarning(_0x360a6c),assertCliVersionSupported(_0x360a6c),logger[_0x46aef8(0x1d8)](_0x46aef8(0x1bf),_0x46aef8(0x1e7),{'currentVersion':_0x360a6c['currentVersion'],'stableVersion':_0x360a6c[_0x46aef8(0x204)],'minimumVersion':_0x360a6c[_0x46aef8(0x1e3)],'needsUpgrade':_0x360a6c['needsUpgrade'],'belowMinimum':_0x360a6c[_0x46aef8(0x1c3)]}));if(_0x42f2f7[_0x46aef8(0x1e4)]&&_0x42f2f7[_0x46aef8(0x1f2)])await runCreate({'projectName':_0x42f2f7[_0x46aef8(0x1e4)],'appCode':_0x42f2f7['appCode'],'env':_0x42f2f7['env']},_0x42f2f7);else{if(_0x42f2f7[_0x46aef8(0x1e4)]){const _0x232d0a=await selectSingleAppcode(_0x42f2f7[_0x46aef8(0x1be)]);await runCreate({'projectName':_0x42f2f7['projectCode'],'appCode':_0x232d0a||undefined,'env':_0x42f2f7['env']},_0x42f2f7);}else await guidedCreateProject(_0x5270d7=>runCreate(_0x5270d7,_0x42f2f7),_0x42f2f7[_0x46aef8(0x203)],_0x42f2f7['cookie']);}}async function runCreate(_0xf1adef,_0x2b000c){const _0x50afbf=a119_0x4054;if(!_0xf1adef[_0x50afbf(0x1c6)]||_0xf1adef[_0x50afbf(0x1c6)][_0x50afbf(0x1e2)]()==='')throw new Error(_0x50afbf(0x205));const _0x103466=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x103466['test'](_0xf1adef[_0x50afbf(0x1c6)]))throw new Error('Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters');if(_0xf1adef[_0x50afbf(0x1c6)]['length']>0x64)throw new Error('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters');const _0xb87216=a119_0x4ce00b[_0x50afbf(0x1d6)](process['cwd'](),_0xf1adef['projectName']);if(a119_0x44565a[_0x50afbf(0x1df)](_0xb87216))throw new Error(_0x50afbf(0x1d7)+_0xf1adef[_0x50afbf(0x1c6)]+_0x50afbf(0x207));try{a119_0x44565a[_0x50afbf(0x1ef)](a119_0x4ce00b['dirname'](_0xb87216),a119_0x44565a[_0x50afbf(0x1ec)][_0x50afbf(0x1f3)]);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger[_0x50afbf(0x1ee)](_0xb87216),logger[_0x50afbf(0x1d8)]('create',_0x50afbf(0x1d2)+_0xf1adef[_0x50afbf(0x1c6)],{'projectDir':_0xb87216,'appCode':_0xf1adef['appCode']}),console[_0x50afbf(0x1e5)](),console[_0x50afbf(0x1e5)](a119_0x59f164[_0x50afbf(0x1f4)]('\x20√\x20')+'Project\x20name:\x20'+a119_0x59f164[_0x50afbf(0x1f4)](_0xf1adef[_0x50afbf(0x1c6)])+(_0xf1adef[_0x50afbf(0x1f2)]?_0x50afbf(0x1db)+a119_0x59f164[_0x50afbf(0x1c0)](_0xf1adef[_0x50afbf(0x1f2)]):''));try{await runTask(_0x50afbf(0x1d5),()=>copyProjectTemplate(_0xf1adef[_0x50afbf(0x1c6)])),await updatePackageJsonName(_0xf1adef[_0x50afbf(0x1c6)]),await runTask(_0x50afbf(0x1ca),()=>installDependencies(_0xf1adef[_0x50afbf(0x1c6)])),await runTask(_0x50afbf(0x20e),()=>formatProjectCode(_0xf1adef[_0x50afbf(0x1c6)])),await configureAppCode(_0xf1adef[_0x50afbf(0x1c6)],_0xf1adef[_0x50afbf(0x1f2)]||'',_0xf1adef['env']);let _0xa3ee6a=![];if(_0xf1adef[_0x50afbf(0x1f2)]){console[_0x50afbf(0x1e5)](_0x50afbf(0x1f0));const _0x1b6e7f=process[_0x50afbf(0x1bc)]();try{process['chdir'](_0xb87216);const _0x3078be=_0xf1adef[_0x50afbf(0x203)]||_0x50afbf(0x20f);initEnv(_0x3078be);const {configArray:_0xc2017f}=await fetchModelList(_0xf1adef[_0x50afbf(0x1f2)],_0x2b000c[_0x50afbf(0x1be)]||''),_0x2870f2=DEFAULT_API_DIR,_0x4c8096=await generateApiFile(_0xc2017f,'',_0xf1adef[_0x50afbf(0x1f2)],!![],_0x3078be,_0x2870f2);console[_0x50afbf(0x1e5)](_0x50afbf(0x1fd)+_0xc2017f[_0x50afbf(0x1c2)]+_0x50afbf(0x1e1)+_0x4c8096[_0x50afbf(0x1c5)]+_0x50afbf(0x1d0)),logger[_0x50afbf(0x1d8)]('create',_0x50afbf(0x1c9)+_0xf1adef[_0x50afbf(0x1f2)]);}catch(_0x89c558){_0xa3ee6a=!![],console[_0x50afbf(0x1e5)](_0x50afbf(0x1b6)),logger['warn'](_0x50afbf(0x1bf),'API\x20配置拉取异常',{'error':_0x89c558 instanceof Error?_0x89c558['message']:String(_0x89c558)});}finally{process[_0x50afbf(0x1f6)](_0x1b6e7f);}}logger[_0x50afbf(0x1f1)](_0x50afbf(0x1bf),_0x50afbf(0x1fa)+_0xf1adef[_0x50afbf(0x1c6)]),console[_0x50afbf(0x1e5)](),console['log'](a119_0x59f164[_0x50afbf(0x1f4)]('─'['repeat'](0x3c))),console[_0x50afbf(0x1e5)](a119_0x59f164[_0x50afbf(0x1c0)][_0x50afbf(0x202)](_0x50afbf(0x210))),console[_0x50afbf(0x1e5)](),console['log'](_0x50afbf(0x1d4)+a119_0x59f164['cyan']['bold']('cd\x20'+_0xf1adef[_0x50afbf(0x1c6)]+'\x20&&\x20'+CLI_BIN_NAME+_0x50afbf(0x1fe))),_0xa3ee6a&&console['log'](_0x50afbf(0x1b8)+a119_0x59f164[_0x50afbf(0x1c0)][_0x50afbf(0x202)](CLI_BIN_NAME+'\x20api\x20pull')),console[_0x50afbf(0x1e5)](a119_0x59f164['green']('─'[_0x50afbf(0x1ea)](0x3c)));}catch(_0x2dbea5){logger[_0x50afbf(0x1dc)]('create',_0x50afbf(0x20b)+_0xf1adef[_0x50afbf(0x1c6)],{'error':_0x2dbea5 instanceof Error?_0x2dbea5[_0x50afbf(0x20c)]:String(_0x2dbea5)});try{a119_0x44565a[_0x50afbf(0x1df)](_0xb87216)&&(console['log'](_0x50afbf(0x1f8)+_0xb87216),a119_0x44565a['rmSync'](_0xb87216,{'recursive':!![],'force':!![]}));}catch{logger[_0x50afbf(0x1ce)](_0x50afbf(0x1bf),_0x50afbf(0x209)+_0xb87216);}throw _0x2dbea5;}}async function runTask(_0x40c892,_0x1b1534){const _0x2f567d=a119_0x4054,_0x5434ab=a119_0x40c2d7(_0x40c892+_0x2f567d(0x1b5))[_0x2f567d(0x1b4)]();try{const _0x1bf6cd=await _0x1b1534();_0x5434ab['stop'](),console[_0x2f567d(0x1e5)](''+a119_0x59f164[_0x2f567d(0x1f4)](_0x2f567d(0x1bd))+_0x40c892+'\x20'+a119_0x59f164['gray']('['+_0x1bf6cd+']'));}catch(_0x405bf1){_0x5434ab[_0x2f567d(0x1b7)](_0x40c892);throw _0x405bf1;}}async function updatePackageJsonName(_0x5b8041){const _0xbc45c0=a119_0x4054,_0x497fcd=a119_0x4ce00b['resolve'](process['cwd'](),_0x5b8041),_0x4bba08=a119_0x4ce00b[_0xbc45c0(0x1eb)](_0x497fcd,_0xbc45c0(0x206));try{console[_0xbc45c0(0x1e5)](_0xbc45c0(0x1f5));const _0x45dcb7=getRabetbaseCliPackageRoot(),_0x1c0498=a119_0x4ce00b[_0xbc45c0(0x1eb)](_0x45dcb7,'package.json');let _0x123b1a=_0xbc45c0(0x1bb);try{const _0x1e902d=JSON['parse'](a119_0x44565a[_0xbc45c0(0x1c1)](_0x1c0498,'utf8'));_0x123b1a=_0x1e902d['version']||_0xbc45c0(0x1bb);}catch{}const _0xbf9e1d=a119_0x44565a[_0xbc45c0(0x1c1)](_0x4bba08,_0xbc45c0(0x1cc)),_0x4016d0=JSON[_0xbc45c0(0x1c7)](_0xbf9e1d);_0x4016d0['name']=_0x5b8041,_0x4016d0['description']=_0x5b8041+_0xbc45c0(0x1d3)+_0x123b1a,a119_0x44565a[_0xbc45c0(0x1d1)](_0x4bba08,JSON[_0xbc45c0(0x1c4)](_0x4016d0,null,0x2)+'\x0a','utf8'),console[_0xbc45c0(0x1e5)]('√\x20package.json\x20updated:\x20name='+_0x5b8041),logger[_0xbc45c0(0x1d8)]('create',_0xbc45c0(0x1cf));}catch(_0x190efc){logger['error'](_0xbc45c0(0x1bf),'更新\x20package.json\x20失败');throw _0x190efc;}}async function configureAppCode(_0x4c6963,_0x46a439,_0x4fe4d0){const _0x607284=a119_0x4054,_0xe3120c=a119_0x4ce00b[_0x607284(0x1d6)](process['cwd'](),_0x4c6963),_0x5c97ef=a119_0x4ce00b['join'](_0xe3120c,NEW_CONFIG_NAME);try{_0x46a439?console['log'](_0x607284(0x1f7)+_0x4c6963+':\x20'+_0x46a439):console[_0x607284(0x1e5)](_0x607284(0x1e6)+_0x4c6963);const _0x50b991=getRabetbaseCliPackageRoot(),_0x200057=a119_0x4ce00b['join'](_0x50b991,_0x607284(0x206));let _0x587b61=_0x607284(0x1bb);try{const _0x17b8b2=JSON['parse'](a119_0x44565a[_0x607284(0x1c1)](_0x200057,_0x607284(0x1cc)));_0x587b61=_0x17b8b2[_0x607284(0x201)]||'1.0.0';}catch{}const _0xfb30a8=readConfig(),_0xb9fbff=typeof _0xfb30a8[_0x607284(0x203)]===_0x607284(0x1e8)?_0xfb30a8[_0x607284(0x203)]:undefined,_0x227a70={};for(const _0x354ac0 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0xfb30a8[_0x354ac0]!=null)_0x227a70[_0x354ac0]=_0xfb30a8[_0x354ac0];}const _0x11c860=buildCanonicalProjectConfig(_0x227a70,{'appCodes':_0x46a439?[_0x46a439]:[],'env':_0x4fe4d0||_0xb9fbff||_0x607284(0x20f),'metadata':{'createdAt':new Date()[_0x607284(0x1b9)](),'version':_0x587b61}});writeConfigFile(_0x5c97ef,_0x11c860),_0x46a439?console['log']('√\x20Configuration\x20file\x20created,\x20Apps:\x20'+Object[_0x607284(0x1e9)](_0x11c860[_0x607284(0x1ff)]||{})[_0x607284(0x1eb)](',\x20')+_0x607284(0x1dd)+_0x11c860[_0x607284(0x1ba)]):console['log'](_0x607284(0x211)+CLI_BIN_NAME+_0x607284(0x1f9)),logger[_0x607284(0x1d8)](_0x607284(0x1bf),_0x607284(0x20d)+_0x46a439);}catch(_0x331b79){logger[_0x607284(0x1dc)](_0x607284(0x1bf),_0x607284(0x1c8));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a120_0x5aec(_0x437cb4,_0x5bd913){_0x437cb4=_0x437cb4-0xa4;const _0x1fd079=a120_0x1fd0();let _0x5aece7=_0x1fd079[_0x437cb4];return _0x5aece7;}(function(_0x122996,_0x1a85da){const _0xc2cb09=a120_0x5aec,_0x51812b=_0x122996();while(!![]){try{const _0x4fcaba=parseInt(_0xc2cb09(0xc7))/0x1*(parseInt(_0xc2cb09(0xb3))/0x2)+parseInt(_0xc2cb09(0xc5))/0x3*(parseInt(_0xc2cb09(0xb2))/0x4)+-parseInt(_0xc2cb09(0xdc))/0x5*(-parseInt(_0xc2cb09(0xc9))/0x6)+parseInt(_0xc2cb09(0xdb))/0x7*(parseInt(_0xc2cb09(0xc3))/0x8)+-parseInt(_0xc2cb09(0xd5))/0x9*(-parseInt(_0xc2cb09(0xd9))/0xa)+-parseInt(_0xc2cb09(0xe0))/0xb*(parseInt(_0xc2cb09(0xd6))/0xc)+-parseInt(_0xc2cb09(0xde))/0xd*(parseInt(_0xc2cb09(0xc2))/0xe);if(_0x4fcaba===_0x1a85da)break;else _0x51812b['push'](_0x51812b['shift']());}catch(_0x2fae09){_0x51812b['push'](_0x51812b['shift']());}}}(a120_0x1fd0,0xf05f4));import a120_0x3d7f6b from'path';import a120_0x10c68f from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';import{fetchModelList}from'../../../api/fetch-model-list.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x2ec189,_0x1026fb,_0x38ec41,_0x22e46e){const _0x5ca42e=a120_0x5aec,_0x2c4760=await checkCliVersion();(_0x2c4760[_0x5ca42e(0xdf)]||_0x2c4760[_0x5ca42e(0xbc)])&&(printCliUpgradeWarning(_0x2c4760),assertCliVersionSupported(_0x2c4760));if(!_0x2ec189||_0x2ec189['trim']()==='')throw CliErrors[_0x5ca42e(0xb9)](_0x5ca42e(0xa4));const _0x1b1132=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1b1132[_0x5ca42e(0xd4)](_0x2ec189))throw CliErrors['validation'](_0x5ca42e(0xc1),_0x5ca42e(0xb8));if(_0x2ec189['length']>0x64)throw CliErrors[_0x5ca42e(0xb9)](_0x5ca42e(0xac));const _0x196458=a120_0x3d7f6b['resolve'](process[_0x5ca42e(0xd1)](),_0x2ec189);if(existsSync(_0x196458))throw CliErrors[_0x5ca42e(0xb9)](_0x5ca42e(0xe2)+_0x2ec189+_0x5ca42e(0xb1),_0x5ca42e(0xaf));try{const _0xe83111=a120_0x3d7f6b[_0x5ca42e(0xd2)](_0x196458);await a120_0x10c68f[_0x5ca42e(0xaa)](_0xe83111,a120_0x10c68f[_0x5ca42e(0xc8)]['W_OK']);}catch{throw CliErrors[_0x5ca42e(0xb9)]('Cannot\x20create\x20project\x20in\x20current\x20directory.',_0x5ca42e(0xc0));}try{console[_0x5ca42e(0xca)](_0x5ca42e(0xe3)+_0x2ec189+_0x5ca42e(0xa8));const _0x120428=getSubAppReactDemoTemplateDir();await copyDirectory(_0x120428,_0x196458),console['log'](_0x5ca42e(0xd8)),await updatePackageJsonName(_0x2ec189),console[_0x5ca42e(0xca)](_0x5ca42e(0xbd)),console[_0x5ca42e(0xca)](_0x5ca42e(0xbb)),console[_0x5ca42e(0xca)](_0x5ca42e(0xcc)),await formatCode(_0x196458),console[_0x5ca42e(0xca)](_0x5ca42e(0xb5)),await configureProject(_0x2ec189,_0x38ec41,_0x1026fb),console[_0x5ca42e(0xca)](_0x5ca42e(0xcf)),_0x38ec41&&await pullApiConfig(_0x196458,_0x38ec41,_0x1026fb,_0x22e46e),console[_0x5ca42e(0xca)]('\x0a√\x20Project\x20'+_0x2ec189+'\x20created\x20successfully!'),console['log']('\x0a\x20\x20cd\x20'+_0x2ec189),console['log'](_0x5ca42e(0xa9));}catch(_0x22ff95){try{existsSync(_0x196458)&&await a120_0x10c68f['rm'](_0x196458,{'recursive':!![],'force':!![]});}catch{}throw _0x22ff95;}}async function updatePackageJsonName(_0x2e4624){const _0x36c5cb=a120_0x5aec,_0x4bc055=a120_0x3d7f6b[_0x36c5cb(0xba)](process[_0x36c5cb(0xd1)](),_0x2e4624),_0x377950=a120_0x3d7f6b[_0x36c5cb(0xbf)](_0x4bc055,_0x36c5cb(0xd7)),_0x171dba=await a120_0x10c68f[_0x36c5cb(0xae)](_0x377950,_0x36c5cb(0xc6)),_0x3d3507=JSON['parse'](_0x171dba);_0x3d3507[_0x36c5cb(0xb4)]=_0x2e4624,_0x3d3507['description']=_0x36c5cb(0xe1),await a120_0x10c68f[_0x36c5cb(0xdd)](_0x377950,JSON[_0x36c5cb(0xe4)](_0x3d3507,null,0x2)+'\x0a');}function a120_0x1fd0(){const _0x115ad2=['\x20\x20√\x20package.json\x20updated','chdir','join','Check\x20directory\x20permissions.','Project\x20name\x20contains\x20invalid\x20characters.','51828FEePen','32FRDIKL','bun\x20--version','3kcFmfo','utf-8','1WJjhLe','constants','6TMQkdG','log','\x20api\x20pull`\x20manually\x20later.','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','modelCount','env','\x20\x20√\x20Configuration\x20file\x20created','bun\x20run\x20format','cwd','dirname','toLocaleString','test','18IcMgrN','4812rGlHXi','package.json','\x20\x20√\x20Project\x20template\x20created','2740020PRSPiE','npm','222362MKyzgC','7650255lzJMcV','writeFile','9607pPiNVk','needsUpgrade','8371VJTBCf','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','Project\x20directory\x20\x22','*\x20Creating\x20project\x20','stringify','Project\x20name\x20cannot\x20be\x20empty.','string','bun','\x20\x20Pulling\x20API\x20configuration...','...','\x20\x20rabetbase\x20run\x20start\x0a','access','\x20\x20√\x20Pulled\x20','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','production','readFile','Use\x20a\x20different\x20project\x20name.','ignore','\x22\x20already\x20exists.','5343940REKgAI','968798rUIwVV','name','\x20\x20√\x20Code\x20formatted','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','length','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','validation','resolve','\x20\x20Installing\x20dependencies...','belowMinimum'];a120_0x1fd0=function(){return _0x115ad2;};return a120_0x1fd0();}function detectPackageManager(){const _0x3e8fd6=a120_0x5aec;try{return execSync(_0x3e8fd6(0xc4),{'stdio':_0x3e8fd6(0xb0)}),_0x3e8fd6(0xa6);}catch{return _0x3e8fd6(0xda);}}async function formatCode(_0x451c1b){const _0x3920ac=a120_0x5aec;try{await execAsync(_0x3920ac(0xd0),{'cwd':_0x451c1b});}catch{}}async function configureProject(_0x29bc7f,_0x2b6dd6,_0x440b64){const _0x2df0d4=a120_0x5aec,_0x4fcafb=a120_0x3d7f6b[_0x2df0d4(0xba)](process['cwd'](),_0x29bc7f),_0x1b7ea0=a120_0x3d7f6b['join'](_0x4fcafb,NEW_CONFIG_NAME),_0x44c30e=readConfig(),_0x5e7179=typeof _0x44c30e[_0x2df0d4(0xce)]===_0x2df0d4(0xa5)?_0x44c30e[_0x2df0d4(0xce)]:undefined,_0x55c99a={};for(const _0x5a9ac9 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x44c30e[_0x5a9ac9]!=null)_0x55c99a[_0x5a9ac9]=_0x44c30e[_0x5a9ac9];}const _0x218a52=buildCanonicalProjectConfig(_0x55c99a,{'appCodes':_0x2b6dd6?[_0x2b6dd6]:[],'env':_0x440b64||_0x5e7179||_0x2df0d4(0xad),'metadata':{'createdAt':new Date()[_0x2df0d4(0xd3)](),'version':getCliVersion()}});writeConfigFile(_0x1b7ea0,_0x218a52);}async function pullApiConfig(_0x330f70,_0x382a11,_0x4d2f91,_0x225eda){const _0x357cdb=a120_0x5aec,_0x156d5c=process[_0x357cdb(0xd1)]();try{process[_0x357cdb(0xbe)](_0x330f70);const _0x426f26=_0x4d2f91||_0x357cdb(0xad);initEnv(_0x426f26),console[_0x357cdb(0xca)](_0x357cdb(0xa7));const {configArray:_0x171963}=await fetchModelList(_0x382a11,_0x225eda||''),_0x29614f=await generateApiFile(_0x171963,'',_0x382a11,!![],_0x426f26,DEFAULT_API_DIR);console[_0x357cdb(0xca)](_0x357cdb(0xab)+_0x171963[_0x357cdb(0xb7)]+'\x20dataset(s),\x20generated\x20'+_0x29614f[_0x357cdb(0xcd)]+'\x20model(s)');}catch(_0x171087){console[_0x357cdb(0xca)](_0x357cdb(0xb6)+CLI_BIN_NAME+_0x357cdb(0xcb));}finally{process['chdir'](_0x156d5c);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a121_0x47dbde=a121_0x3f55;(function(_0x93c9e2,_0x10ed45){const _0x324f02=a121_0x3f55,_0x1e9636=_0x93c9e2();while(!![]){try{const _0x575a98=-parseInt(_0x324f02(0x202))/0x1*(parseInt(_0x324f02(0x1f7))/0x2)+-parseInt(_0x324f02(0x1fa))/0x3+parseInt(_0x324f02(0x1ff))/0x4*(-parseInt(_0x324f02(0x1f6))/0x5)+parseInt(_0x324f02(0x1f4))/0x6*(parseInt(_0x324f02(0x1fe))/0x7)+-parseInt(_0x324f02(0x1fd))/0x8*(parseInt(_0x324f02(0x200))/0x9)+-parseInt(_0x324f02(0x1f9))/0xa+parseInt(_0x324f02(0x203))/0xb;if(_0x575a98===_0x10ed45)break;else _0x1e9636['push'](_0x1e9636['shift']());}catch(_0x3e7538){_0x1e9636['push'](_0x1e9636['shift']());}}}(a121_0x2dfa,0x334b4));import a121_0xef8f0e from'node:path';import{fileURLToPath}from'node:url';function a121_0x3f55(_0x46c939,_0x23f517){_0x46c939=_0x46c939-0x1f4;const _0x2dfa83=a121_0x2dfa();let _0x3f55eb=_0x2dfa83[_0x46c939];return _0x3f55eb;}function a121_0x2dfa(){const _0x2d6f87=['templates','sub-app-react-demo','1526184ZhJPYd','21917VSpotj','16628UHwupU','18VNKExR','resolve','20251rhihxX','14932236YiQkUK','438kqIrAB','projects','465KAZYao','26ZbfChj','dirname','40200NJHeBU','1021527pvSrRf'];a121_0x2dfa=function(){return _0x2d6f87;};return a121_0x2dfa();}const __dirname=a121_0xef8f0e[a121_0x47dbde(0x1f8)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x306703=a121_0x47dbde;return a121_0xef8f0e[_0x306703(0x201)](__dirname,'../../../../');}export function getSubAppReactDemoTemplateDir(){const _0x34070b=a121_0x47dbde;return a121_0xef8f0e['join'](getRabetbaseCliPackageRoot(),_0x34070b(0x1fb),_0x34070b(0x1f5),_0x34070b(0x1fc));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5d3897,_0x4fcb4b){const _0x59ac25=a122_0x5b3a,_0x58a454=_0x5d3897();while(!![]){try{const _0x126729=parseInt(_0x59ac25(0xd5))/0x1*(parseInt(_0x59ac25(0xd9))/0x2)+-parseInt(_0x59ac25(0xe0))/0x3*(-parseInt(_0x59ac25(0xd4))/0x4)+-parseInt(_0x59ac25(0xce))/0x5*(parseInt(_0x59ac25(0xdd))/0x6)+-parseInt(_0x59ac25(0xd6))/0x7*(-parseInt(_0x59ac25(0xcd))/0x8)+parseInt(_0x59ac25(0xdc))/0x9+parseInt(_0x59ac25(0xd3))/0xa+-parseInt(_0x59ac25(0xde))/0xb;if(_0x126729===_0x4fcb4b)break;else _0x58a454['push'](_0x58a454['shift']());}catch(_0x3ed439){_0x58a454['push'](_0x58a454['shift']());}}}(a122_0x2a6c,0xb56fb));import a122_0x55a4c3 from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x139985){const _0x590b5b=a122_0x5b3a,_0x5b85be=Date[_0x590b5b(0xd0)](),_0x612e50=a122_0x55a4c3[_0x590b5b(0xcf)](process[_0x590b5b(0xd7)](),_0x139985);try{logger['info'](_0x590b5b(0xd1),_0x590b5b(0xda),{'projectCode':_0x139985,'templateDir':templateDir}),await copyDirectory(templateDir,_0x612e50);const _0x58313f=Date['now']()-_0x5b85be;logger[_0x590b5b(0xdb)](_0x590b5b(0xd1),_0x590b5b(0xdf),_0x58313f,{'projectCode':_0x139985});}catch(_0xc711de){const _0x47ca15=Date[_0x590b5b(0xd0)]()-_0x5b85be;logger[_0x590b5b(0xd2)](_0x590b5b(0xd1),_0x590b5b(0xd8),{'projectCode':_0x139985,'error':_0xc711de instanceof Error?_0xc711de['message']:String(_0xc711de),'duration':_0x47ca15});throw _0xc711de;}return formatElapsed(_0x5b85be);}function a122_0x5b3a(_0x35912a,_0x5ed427){_0x35912a=_0x35912a-0xcd;const _0x2a6c71=a122_0x2a6c();let _0x5b3a2b=_0x2a6c71[_0x35912a];return _0x5b3a2b;}function a122_0x2a6c(){const _0x7bce79=['16faakhj','3115nqSLKy','resolve','now','copy','error','13716520urOgUd','352UnXFeH','35463qaICvO','783839KOkldP','cwd','项目模板复制失败','18BzTnzL','开始复制项目模板','success','2421045fwupuN','7278RebpHJ','12702228YTuhGV','项目模板复制完成','16017XlQQQo'];a122_0x2a6c=function(){return _0x7bce79;};return a122_0x2a6c();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x11e855,_0x1570b4){const _0x48f377=a123_0x4931,_0x3be4ef=_0x11e855();while(!![]){try{const _0x5d28cd=-parseInt(_0x48f377(0x145))/0x1+-parseInt(_0x48f377(0x152))/0x2*(-parseInt(_0x48f377(0x156))/0x3)+-parseInt(_0x48f377(0x146))/0x4+-parseInt(_0x48f377(0x14c))/0x5+-parseInt(_0x48f377(0x159))/0x6*(parseInt(_0x48f377(0x158))/0x7)+parseInt(_0x48f377(0x14d))/0x8+parseInt(_0x48f377(0x153))/0x9*(parseInt(_0x48f377(0x14a))/0xa);if(_0x5d28cd===_0x1570b4)break;else _0x3be4ef['push'](_0x3be4ef['shift']());}catch(_0x2327ca){_0x3be4ef['push'](_0x3be4ef['shift']());}}}(a123_0x8417,0x453c2));import a123_0xd3ecfd from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a123_0x8417(){const _0x43e571=['2873340HwRkuU','now','success','354aPTMPh','--write','663446LxfDey','6nmxOfk','info','65703wkZuBH','1629108lSVDAi','error','cwd','代码格式化失败','20ujyVrq','代码格式化完成','522070iWWGDX','250592NeKwvT','开始格式化代码','prettier','message','format','4846paTRIK'];a123_0x8417=function(){return _0x43e571;};return a123_0x8417();}import{resolveNpmBin}from'../../../utils/platform.js';function a123_0x4931(_0x367e3e,_0x1d0948){_0x367e3e=_0x367e3e-0x145;const _0x84179b=a123_0x8417();let _0x4931b9=_0x84179b[_0x367e3e];return _0x4931b9;}export async function formatProjectCode(_0x3e20dc){const _0x351d14=a123_0x4931,_0x438cb7=Date['now'](),_0x11955c=a123_0xd3ecfd['resolve'](process[_0x351d14(0x148)](),_0x3e20dc);try{logger[_0x351d14(0x15a)]('format',_0x351d14(0x14e),{'projectCode':_0x3e20dc}),await execa(resolveNpmBin('npx'),[_0x351d14(0x14f),_0x351d14(0x157),'.'],{'cwd':_0x11955c});const _0x4d0afe=Date[_0x351d14(0x154)]()-_0x438cb7;logger[_0x351d14(0x155)]('format',_0x351d14(0x14b),_0x4d0afe,{'projectCode':_0x3e20dc});}catch(_0x5d69aa){const _0x284f60=Date[_0x351d14(0x154)]()-_0x438cb7;logger[_0x351d14(0x147)](_0x351d14(0x151),_0x351d14(0x149),{'projectCode':_0x3e20dc,'error':_0x5d69aa instanceof Error?_0x5d69aa[_0x351d14(0x150)]:String(_0x5d69aa),'duration':_0x284f60});throw _0x5d69aa;}return formatElapsed(_0x438cb7);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a124_0x3d97(){const _0x3af232=['1101504QrPZvb','error','--registry','550vHHEIz','7940YvEMHo','cwd','开始安装依赖','27050mrGVTB','231197Vlryyk','495ePnqnP','message','success','info','npm','893266MuWStd','80842ITuRRW','resolve','now','依赖安装失败','1065491pLFPRM','6zpHVdi','install','6BYtqDH'];a124_0x3d97=function(){return _0x3af232;};return a124_0x3d97();}(function(_0x3eada6,_0x103838){const _0x4bde61=a124_0x10ba,_0x45090e=_0x3eada6();while(!![]){try{const _0x5038f5=-parseInt(_0x4bde61(0x1e3))/0x1+-parseInt(_0x4bde61(0x1d3))/0x2*(-parseInt(_0x4bde61(0x1d8))/0x3)+-parseInt(_0x4bde61(0x1df))/0x4*(-parseInt(_0x4bde61(0x1de))/0x5)+-parseInt(_0x4bde61(0x1da))/0x6*(parseInt(_0x4bde61(0x1d7))/0x7)+parseInt(_0x4bde61(0x1db))/0x8+parseInt(_0x4bde61(0x1e4))/0x9*(parseInt(_0x4bde61(0x1e2))/0xa)+-parseInt(_0x4bde61(0x1d2))/0xb;if(_0x5038f5===_0x103838)break;else _0x45090e['push'](_0x45090e['shift']());}catch(_0x366631){_0x45090e['push'](_0x45090e['shift']());}}}(a124_0x3d97,0x1d8cf));import a124_0x17342c from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a124_0x10ba(_0xa05637,_0xef239b){_0xa05637=_0xa05637-0x1cf;const _0x3d97ca=a124_0x3d97();let _0x10bab1=_0x3d97ca[_0xa05637];return _0x10bab1;}import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x476afa){const _0x2063fc=a124_0x10ba,_0xc3b400=Date[_0x2063fc(0x1d5)](),_0x37fe68=a124_0x17342c[_0x2063fc(0x1d4)](process[_0x2063fc(0x1e0)](),_0x476afa);try{logger[_0x2063fc(0x1d0)]('install',_0x2063fc(0x1e1),{'projectCode':_0x476afa,'registry':'https://registry.npmmirror.com'}),await execa(resolveNpmBin(_0x2063fc(0x1d1)),[_0x2063fc(0x1d9),_0x2063fc(0x1dd),'https://registry.npmmirror.com'],{'cwd':_0x37fe68});const _0xdf1b56=Date['now']()-_0xc3b400;logger[_0x2063fc(0x1cf)]('install','依赖安装完成',_0xdf1b56,{'projectCode':_0x476afa});}catch(_0x44ab6a){const _0x30f465=Date['now']()-_0xc3b400;logger[_0x2063fc(0x1dc)](_0x2063fc(0x1d9),_0x2063fc(0x1d6),{'projectCode':_0x476afa,'error':_0x44ab6a instanceof Error?_0x44ab6a[_0x2063fc(0x1e5)]:String(_0x44ab6a),'duration':_0x30f465});throw _0x44ab6a;}return formatElapsed(_0xc3b400);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a125_0x43f1(){const _0x402af0=['Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','Target\x20environment','init','nonInteractive','write','appcode','34xJOVLq','1075087pnxKJm','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','Usage:\x20','validation','boolean','12707233yPrnTo','Skip\x20confirmation\x20prompt','336XVytOu','Create\x20a\x20new\x20project','Auto-confirm\x20prompts','bool','36430PrQOtv','10MYOEzw','../../commands/project/create/main.js','cookie','upgrade','str','yes','41518JAwhBl','1785918rNSyQU','48769lOJxKe','36MxDmBz','string','App\x20code\x20to\x20initialize','2216504WuejVQ','name','project-name','224fsvqmW','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','project','env','Initialize\x20.rabetbase.json\x20config\x20in\x20existing\x20project','trim','996oGthuH'];a125_0x43f1=function(){return _0x402af0;};return a125_0x43f1();}const a125_0x5b0e7a=a125_0x5d58;(function(_0xf88192,_0x26a24d){const _0x46e13f=a125_0x5d58,_0x3175f7=_0xf88192();while(!![]){try{const _0x3faa16=parseInt(_0x46e13f(0x1e6))/0x1*(parseInt(_0x46e13f(0x1f9))/0x2)+parseInt(_0x46e13f(0x1fa))/0x3+-parseInt(_0x46e13f(0x1d9))/0x4*(-parseInt(_0x46e13f(0x1f2))/0x5)+parseInt(_0x46e13f(0x1df))/0x6*(-parseInt(_0x46e13f(0x1fb))/0x7)+-parseInt(_0x46e13f(0x1ff))/0x8*(parseInt(_0x46e13f(0x1fc))/0x9)+parseInt(_0x46e13f(0x1f3))/0xa*(-parseInt(_0x46e13f(0x1ec))/0xb)+parseInt(_0x46e13f(0x1ee))/0xc*(parseInt(_0x46e13f(0x1e7))/0xd);if(_0x3faa16===_0x26a24d)break;else _0x3175f7['push'](_0x3175f7['shift']());}catch(_0x38cd27){_0x3175f7['push'](_0x3175f7['shift']());}}}(a125_0x43f1,0x93a33));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';function a125_0x5d58(_0x493587,_0x4ac449){_0x493587=_0x493587-0x1d7;const _0x43f1df=a125_0x43f1();let _0x5d5842=_0x43f1df[_0x493587];return _0x5d5842;}import{upgradeApp}from'../../commands/project/upgrade.js';const initFlags=[{'name':'appcode','type':'string','description':a125_0x5b0e7a(0x1fe)},{'name':a125_0x5b0e7a(0x1dc),'type':a125_0x5b0e7a(0x1fd),'description':a125_0x5b0e7a(0x1e1)},{'name':a125_0x5b0e7a(0x1f8),'type':a125_0x5b0e7a(0x1eb),'description':a125_0x5b0e7a(0x1f0),'default':![]}],createFlags=[{'name':'name','type':a125_0x5b0e7a(0x1fd),'description':'Project\x20name'},{'name':'env','type':a125_0x5b0e7a(0x1fd),'description':a125_0x5b0e7a(0x1e1)},{'name':a125_0x5b0e7a(0x1e5),'type':a125_0x5b0e7a(0x1fd),'description':'App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)'}],upgradeFlags=[{'name':a125_0x5b0e7a(0x1f8),'type':'boolean','description':a125_0x5b0e7a(0x1ed),'default':![]}];export const projectDefinitions=[{'service':a125_0x5b0e7a(0x1db),'command':a125_0x5b0e7a(0x1e2),'description':a125_0x5b0e7a(0x1dd),'risk':a125_0x5b0e7a(0x1e4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initFlags,async 'execute'(_0x165aab){const _0x58eea7=a125_0x5b0e7a;return await initConfig({'appcode':_0x165aab['str'](_0x58eea7(0x1e5))||undefined,'env':_0x165aab[_0x58eea7(0x1f7)](_0x58eea7(0x1dc))||undefined,'autoYes':_0x165aab[_0x58eea7(0x1f1)](_0x58eea7(0x1f8))}),{'ok':!![]};}},{'service':a125_0x5b0e7a(0x1db),'command':'create','description':a125_0x5b0e7a(0x1ef),'risk':a125_0x5b0e7a(0x1e4),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a125_0x5b0e7a(0x1d8),'description':a125_0x5b0e7a(0x1da),'required':![]}],'flags':createFlags,async 'execute'(_0x191764){const _0x67b5e6=a125_0x5b0e7a,{createApp:_0x51a415}=await import(_0x67b5e6(0x1f4)),{createProjectNonInteractive:_0x35f8a1}=await import('../../commands/project/create/non-interactive.js'),_0x10e8be=_0x191764[_0x67b5e6(0x1f7)](_0x67b5e6(0x1d7))[_0x67b5e6(0x1de)]()||_0x191764['args'][0x0]?.[_0x67b5e6(0x1de)](),_0x10cb10=_0x191764[_0x67b5e6(0x1f7)](_0x67b5e6(0x1dc))||undefined,_0x156c9e=_0x191764[_0x67b5e6(0x1f7)](_0x67b5e6(0x1e5))||undefined;if(_0x191764[_0x67b5e6(0x1e3)]){if(!_0x10e8be)throw CliErrors[_0x67b5e6(0x1ea)](_0x67b5e6(0x1e0),_0x67b5e6(0x1e9)+CLI_BIN_NAME+'\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]');await _0x35f8a1(_0x10e8be,_0x10cb10,_0x156c9e,_0x191764[_0x67b5e6(0x1f5)]);}else await _0x51a415({'projectCode':_0x10e8be,'appCode':_0x156c9e,'env':_0x10cb10,'cookie':_0x191764[_0x67b5e6(0x1f5)]});return{'ok':!![]};}},{'service':a125_0x5b0e7a(0x1db),'command':a125_0x5b0e7a(0x1f6),'description':a125_0x5b0e7a(0x1e8),'risk':a125_0x5b0e7a(0x1e4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x391d8a){const _0x49031c=a125_0x5b0e7a;return await upgradeApp(_0x391d8a[_0x49031c(0x1e3)],{'yes':_0x391d8a['bool'](_0x49031c(0x1f8))}),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2fd6a5,_0x36737f){const _0x88fedc=a126_0x37d3,_0x45cee3=_0x2fd6a5();while(!![]){try{const _0x135b30=parseInt(_0x88fedc(0xd0))/0x1+-parseInt(_0x88fedc(0xe4))/0x2*(parseInt(_0x88fedc(0xfd))/0x3)+parseInt(_0x88fedc(0xde))/0x4+parseInt(_0x88fedc(0xe1))/0x5+parseInt(_0x88fedc(0xfe))/0x6+parseInt(_0x88fedc(0xca))/0x7*(parseInt(_0x88fedc(0xe0))/0x8)+-parseInt(_0x88fedc(0xcf))/0x9*(parseInt(_0x88fedc(0xd5))/0xa);if(_0x135b30===_0x36737f)break;else _0x45cee3['push'](_0x45cee3['shift']());}catch(_0x52d775){_0x45cee3['push'](_0x45cee3['shift']());}}}(a126_0x62c8,0x1ed39));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a126_0x327fa0 from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';function a126_0x62c8(){const _0x27dc5f=['44397hvwsLR','439140vTLHbJ','.rabetbase.json','154EsEcGX','setLogPath','yellow','appcode','\x20project\x20init`\x20to\x20start\x20fresh.','18xUzayg','65354wjjlph','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','1.0.0','.bak','defaultApp','1369920bQbAdZ','log','trim','apps','✓\x20Upgraded\x20','toLocaleString','keys','init','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','956412tlraYn','string','81928EhJLgN','244415pLjDpx','初始化项目配置文件成功','\x20\x20appcode:\x20','34SaZnYE','app','cyan','Please\x20enter\x20App\x20Code:','\x20\x20Default:\x20','\x20api\x20generate\x27\x20and\x20\x27','\x20→\x20.rabetbase.json','package.json','Migration\x20cancelled.\x20Run\x20`','version','bold','从旧配置文件升级成功','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','\x20\x20Apps:\x20','parse','Upgrade\x20it\x20to\x20','green','env','Invalid\x20App\x20Code','join','utf8','info','production','cwd','gray'];a126_0x62c8=function(){return _0x27dc5f;};return a126_0x62c8();}import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x28a9cf){const _0x214bf2=a126_0x37d3,{appcode:_0x4d5fb5,env:_0xdb5e51,autoYes:_0x3b70b3}=_0x28a9cf,_0x3f918d=process[_0x214bf2(0xfb)]();if(getProjectConfigPath())throw new Error('.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.');let _0x1c9fd4;for(const _0x3a601c of LEGACY_CONFIG_NAMES){const _0x57ade4=resolve(_0x3f918d,_0x3a601c);if(existsSync(_0x57ade4)){_0x1c9fd4=_0x57ade4;break;}}if(_0x1c9fd4){let _0x2bb62b={};try{_0x2bb62b=JSON[_0x214bf2(0xf2)](readFileSync(_0x1c9fd4,_0x214bf2(0xf8)));}catch{}const _0x5d1477=basename(_0x1c9fd4),_0x3738a1=_0x2bb62b?.[_0x214bf2(0xcd)]||_0x2bb62b?.[_0x214bf2(0xe5)];let _0x4aabe4=_0x3b70b3;!_0x3b70b3&&(console[_0x214bf2(0xd6)](a126_0x327fa0[_0x214bf2(0xcc)](_0x214bf2(0xf0)+a126_0x327fa0[_0x214bf2(0xee)](_0x5d1477))),_0x3738a1&&console['log'](a126_0x327fa0[_0x214bf2(0xe6)](_0x214bf2(0xe3)+_0x3738a1)),_0x4aabe4=await confirm({'message':_0x214bf2(0xf3)+a126_0x327fa0['bold'](_0x214bf2(0xff))+'?\x20(Old\x20file\x20→\x20*.bak)','default':!![]}));if(!_0x4aabe4){console[_0x214bf2(0xd6)](_0x214bf2(0xec)+CLI_BIN_NAME+_0x214bf2(0xce));return;}const _0x1c9b79=resolve(_0x3f918d,NEW_CONFIG_NAME),_0x330208=getCliVersionFromPkg(),_0x19984b=readRawConfig(),_0x1af7dc=_0x4d5fb5||(typeof _0x2bb62b?.[_0x214bf2(0xcd)]===_0x214bf2(0xdf)?_0x2bb62b[_0x214bf2(0xcd)]:undefined)||(typeof _0x2bb62b?.['app']===_0x214bf2(0xdf)?_0x2bb62b[_0x214bf2(0xe5)]:undefined)||await askAppcode(),_0x1d2686=typeof _0x2bb62b?.[_0x214bf2(0xf5)]===_0x214bf2(0xdf)?_0x2bb62b[_0x214bf2(0xf5)]:typeof _0x19984b[_0x214bf2(0xf5)]===_0x214bf2(0xdf)?_0x19984b[_0x214bf2(0xf5)]:'production',_0x3e2b0e=buildCanonicalProjectConfig({..._0x19984b,..._0x2bb62b},{'appCodes':[_0x1af7dc],'env':_0x1d2686,'metadata':{'version':_0x330208,'migratedAt':new Date()[_0x214bf2(0xda)](),'migratedFrom':_0x1c9fd4}});writeConfigFile(_0x1c9b79,_0x3e2b0e);const _0x24b4d3=_0x1c9fd4+_0x214bf2(0xd3);renameSync(_0x1c9fd4,_0x24b4d3),logger[_0x214bf2(0xcb)](_0x3f918d),logger['info'](_0x214bf2(0xdc),_0x214bf2(0xef),{'from':_0x1c9fd4,'to':_0x1c9b79,'appcode':_0x1af7dc,'env':_0x3e2b0e[_0x214bf2(0xf5)]}),console['log'](a126_0x327fa0['green'](_0x214bf2(0xd9)+_0x5d1477+_0x214bf2(0xea))),console[_0x214bf2(0xd6)](a126_0x327fa0['cyan'](_0x214bf2(0xf1)+Object[_0x214bf2(0xdb)](_0x3e2b0e[_0x214bf2(0xd8)]||{})[_0x214bf2(0xf7)](',\x20'))),console[_0x214bf2(0xd6)](a126_0x327fa0[_0x214bf2(0xe6)](_0x214bf2(0xe8)+_0x3e2b0e[_0x214bf2(0xd4)])),console[_0x214bf2(0xd6)](a126_0x327fa0[_0x214bf2(0xfc)](_0x214bf2(0xd1)+_0x5d1477+_0x214bf2(0xd3)));return;}const _0x9a7e31=_0x4d5fb5||await askAppcode(),_0x25ffba=resolve(_0x3f918d,NEW_CONFIG_NAME),_0x847aca=getCliVersionFromPkg(),_0x3b8b6f=readRawConfig(),_0x580697=typeof _0x3b8b6f[_0x214bf2(0xf5)]===_0x214bf2(0xdf)?_0x3b8b6f[_0x214bf2(0xf5)]:undefined,_0x9c9e27=buildCanonicalProjectConfig({},{'appCodes':[_0x9a7e31],'env':_0xdb5e51||_0x580697||_0x214bf2(0xfa),'metadata':{'version':_0x847aca,'createdAt':new Date()[_0x214bf2(0xda)]()}});writeConfigFile(_0x25ffba,_0x9c9e27),logger[_0x214bf2(0xcb)](_0x3f918d),logger[_0x214bf2(0xf9)]('init',_0x214bf2(0xe2),{'appcode':_0x9a7e31,'env':_0x9c9e27[_0x214bf2(0xf5)],'version':_0x9c9e27[_0x214bf2(0xed)],'configPath':_0x25ffba}),console['log'](a126_0x327fa0[_0x214bf2(0xf4)]('✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory')),console['log'](a126_0x327fa0[_0x214bf2(0xe6)](_0x214bf2(0xf1)+Object['keys'](_0x9c9e27[_0x214bf2(0xd8)]||{})['join'](',\x20'))),console[_0x214bf2(0xd6)](a126_0x327fa0['cyan'](_0x214bf2(0xe8)+_0x9c9e27[_0x214bf2(0xd4)])),console[_0x214bf2(0xd6)](_0x214bf2(0xdd)+CLI_BIN_NAME+_0x214bf2(0xe9)+CLI_BIN_NAME+'\x20api\x20pull\x27');}function a126_0x37d3(_0x41e3d2,_0x2736cb){_0x41e3d2=_0x41e3d2-0xca;const _0x62c8b9=a126_0x62c8();let _0x37d327=_0x62c8b9[_0x41e3d2];return _0x37d327;}function askAppcode(){const _0x54271c=a126_0x37d3;return input({'message':_0x54271c(0xe7),'validate':_0x2bfab0=>{const _0x1173b7=_0x54271c;if(!_0x2bfab0[_0x1173b7(0xd7)]())return'App\x20Code\x20cannot\x20be\x20empty';const {valid:_0x7ef1f4,message:_0x5604a8}=validateAppcode(_0x2bfab0['trim']());return _0x7ef1f4||_0x5604a8||_0x1173b7(0xf6);}});}function getCliVersionFromPkg(){const _0x46fdd0=a126_0x37d3;try{const _0x3a5551=fileURLToPath(import.meta.url),_0x565be9=resolve(dirname(_0x3a5551),'../..'),_0x24ac99=JSON[_0x46fdd0(0xf2)](readFileSync(resolve(_0x565be9,_0x46fdd0(0xeb)),'utf8'));return _0x24ac99['version']||_0x46fdd0(0xd2);}catch{return _0x46fdd0(0xd2);}}
|
|
@@ -1 +1 @@
|
|
|
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)](''));}
|
|
1
|
+
(function(_0x313c66,_0x1fedc2){const _0x18d6ac=a127_0x2442,_0x4b9a86=_0x313c66();while(!![]){try{const _0x7c693f=-parseInt(_0x18d6ac(0x1ac))/0x1*(-parseInt(_0x18d6ac(0x193))/0x2)+-parseInt(_0x18d6ac(0x1c1))/0x3+parseInt(_0x18d6ac(0x20d))/0x4+parseInt(_0x18d6ac(0x196))/0x5*(parseInt(_0x18d6ac(0x1bc))/0x6)+-parseInt(_0x18d6ac(0x201))/0x7*(parseInt(_0x18d6ac(0x1fc))/0x8)+parseInt(_0x18d6ac(0x1ef))/0x9*(-parseInt(_0x18d6ac(0x19e))/0xa)+-parseInt(_0x18d6ac(0x1b5))/0xb*(-parseInt(_0x18d6ac(0x1ab))/0xc);if(_0x7c693f===_0x1fedc2)break;else _0x4b9a86['push'](_0x4b9a86['shift']());}catch(_0x2bbb29){_0x4b9a86['push'](_0x4b9a86['shift']());}}}(a127_0x3126,0xa4c82));function a127_0x2442(_0x8b0039,_0x2370a8){_0x8b0039=_0x8b0039-0x193;const _0x31269e=a127_0x3126();let _0x244275=_0x31269e[_0x8b0039];return _0x244275;}import a127_0x3b63cd from'chalk';import a127_0x4201fb 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'](_0x17b7d2=>_0x17b7d2!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x18ba1e){const _0x3d2438=a127_0x2442,_0x488bc8=[];for(const _0x4b3ec5 of Object[_0x3d2438(0x1a1)](CORE_IDE_CONFIGS)){if(_0x4b3ec5['files'])for(const _0x2cc7ff of _0x4b3ec5[_0x3d2438(0x1d1)]){_0x488bc8['push'](resolve(_0x18ba1e,_0x2cc7ff['path']));}}return _0x488bc8;}function analyse(_0x820369){const _0x27968c=a127_0x2442;let _0x38dc1a=null;const _0x57bd79=resolve(_0x820369,NEW_CONFIG_NAME),_0x3bbd37=existsSync(_0x57bd79);for(const _0x2ac0f2 of LEGACY_CONFIG_NAMES){const _0x3ab064=resolve(_0x820369,_0x2ac0f2);if(existsSync(_0x3ab064)){const _0x56f322=readConfigFile(_0x3ab064),_0x52abc9=Object[_0x27968c(0x1e4)](_0x56f322)[_0x27968c(0x204)](_0x5f11c6=>typeof _0x56f322[_0x5f11c6]!==_0x27968c(0x195));_0x38dc1a={'oldPath':_0x3ab064,'hasNewConfig':_0x3bbd37,'fields':_0x52abc9};break;}}const _0x5573be=[],_0x10665f=resolve(_0x820369,_0x27968c(0x1e8));if(existsSync(_0x10665f))_0x5573be[_0x27968c(0x1eb)](_0x10665f);const _0x48a3a6=resolve(_0x820369,'.cursor/rules/lovrabet_rules.mdc');if(existsSync(_0x48a3a6))_0x5573be[_0x27968c(0x1eb)](_0x48a3a6);const _0x55a148=resolve(_0x820369,_0x27968c(0x1f1));if(existsSync(_0x55a148))_0x5573be['push'](_0x55a148);for(const _0x54983f of collectIdeSkillFiles(_0x820369)){if(existsSync(_0x54983f))_0x5573be['push'](_0x54983f);}let _0x280186=null;const _0x1b6c71=resolve(_0x820369,_0x27968c(0x1cd));if(existsSync(_0x1b6c71))try{const _0x4c0401=JSON[_0x27968c(0x1ec)](readFileSync(_0x1b6c71,_0x27968c(0x1df)));if(_0x4c0401?.[_0x27968c(0x1c5)]&&typeof _0x4c0401[_0x27968c(0x1c5)]===_0x27968c(0x1c9)){const _0x10e4c9=[];for(const [_0x79849a,_0x3c1c40]of Object['entries'](_0x4c0401[_0x27968c(0x1c5)])){const _0x564395=_0x3c1c40;_0x564395?.[_0x27968c(0x1c2)]&&Array[_0x27968c(0x1d6)](_0x564395[_0x27968c(0x1c2)])&&_0x564395[_0x27968c(0x1c2)][_0x27968c(0x1e0)](_0x21e27c=>typeof _0x21e27c==='string'&&_0x21e27c['includes'](_0x27968c(0x19b)))&&_0x10e4c9['push'](_0x79849a);}_0x10e4c9[_0x27968c(0x1fe)]>0x0&&(_0x280186={'path':_0x1b6c71,'keys':_0x10e4c9});}}catch{}const _0x3739bf=_0x5573be[_0x27968c(0x1fe)]>0x0||_0x38dc1a!==null;let _0x19f063=null;const _0x1ea5e2=resolve(_0x820369,'package.json');if(existsSync(_0x1ea5e2))try{const _0x3892d0=JSON['parse'](readFileSync(_0x1ea5e2,_0x27968c(0x1df)));for(const _0x3c3d35 of[_0x27968c(0x1da),_0x27968c(0x1b0)]){const _0x1fb572=_0x3892d0?.[_0x3c3d35]?.[_0x27968c(0x1b9)];if(typeof _0x1fb572===_0x27968c(0x1b2)){_0x1fb572!=='latest'&&(_0x19f063={'pkgPath':_0x1ea5e2,'currentVersion':_0x1fb572,'field':_0x3c3d35});break;}}}catch{}return{'configMigration':_0x38dc1a,'oldArtifacts':_0x5573be,'oldMcpConfig':_0x280186,'needsSkillSwap':_0x3739bf,'sdkUpgrade':_0x19f063};}function printReport(_0xa5de9c){const _0x3e2c95=a127_0x2442,{configMigration:_0x1d4ec7,oldArtifacts:_0x5324e9,oldMcpConfig:_0x465551,needsSkillSwap:_0x1b9926}=_0xa5de9c;console[_0x3e2c95(0x1e7)](''),console[_0x3e2c95(0x1e7)](a127_0x3b63cd[_0x3e2c95(0x1b7)](_0x3e2c95(0x1a8))),console[_0x3e2c95(0x1e7)]('');_0x1d4ec7?(console['log'](a127_0x3b63cd[_0x3e2c95(0x1d9)](_0x3e2c95(0x1ee))+('\x20\x20'+a127_0x3b63cd[_0x3e2c95(0x1ca)](_0x1d4ec7[_0x3e2c95(0x1c4)]))),console[_0x3e2c95(0x1e7)]('\x20\x20New\x20config\x20(.rabetbase.json):\x20'+(_0x1d4ec7[_0x3e2c95(0x1b3)]?a127_0x3b63cd['green']('already\x20exists\x20(will\x20merge)'):a127_0x3b63cd[_0x3e2c95(0x1d3)](_0x3e2c95(0x200)))),console['log'](_0x3e2c95(0x198)+_0x1d4ec7[_0x3e2c95(0x1ea)][_0x3e2c95(0x1aa)](',\x20')),console[_0x3e2c95(0x1e7)](_0x3e2c95(0x1af))):console[_0x3e2c95(0x1e7)](a127_0x3b63cd[_0x3e2c95(0x1d9)](_0x3e2c95(0x1ee))+'\x20\x20'+a127_0x3b63cd[_0x3e2c95(0x1d3)]('no\x20legacy\x20config\x20found'));console[_0x3e2c95(0x1e7)]('');if(_0x5324e9['length']>0x0){console[_0x3e2c95(0x1e7)](a127_0x3b63cd[_0x3e2c95(0x1d9)](_0x3e2c95(0x1d8)));for(const _0x1ad67d of _0x5324e9){console['log']('\x20\x20'+a127_0x3b63cd[_0x3e2c95(0x1ed)](_0x3e2c95(0x1ae))+'\x20\x20'+_0x1ad67d);}console[_0x3e2c95(0x1e7)](_0x3e2c95(0x1f2));}else console[_0x3e2c95(0x1e7)](a127_0x3b63cd[_0x3e2c95(0x1d9)](_0x3e2c95(0x1d8))+'\x20\x20'+a127_0x3b63cd['gray'](_0x3e2c95(0x19f)));console[_0x3e2c95(0x1e7)]('');_0x465551?(console[_0x3e2c95(0x1e7)](a127_0x3b63cd[_0x3e2c95(0x1d9)](_0x3e2c95(0x1b1))+('\x20\x20'+a127_0x3b63cd['yellow'](_0x465551['path'])+'\x20→\x20keys:\x20'+_0x465551[_0x3e2c95(0x1e4)]['join'](',\x20'))),console[_0x3e2c95(0x1e7)]('\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server')):console[_0x3e2c95(0x1e7)](a127_0x3b63cd[_0x3e2c95(0x1d9)](_0x3e2c95(0x1b1))+'\x20\x20'+a127_0x3b63cd[_0x3e2c95(0x1d3)](_0x3e2c95(0x207)));console['log'](''),console['log'](a127_0x3b63cd['cyan'](_0x3e2c95(0x1a3))+('\x20\x20'+(_0x1b9926?a127_0x3b63cd[_0x3e2c95(0x1ca)]('needed'):a127_0x3b63cd[_0x3e2c95(0x1bb)]('not\x20needed'))));_0x1b9926&&console[_0x3e2c95(0x1e7)](_0x3e2c95(0x1f9)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x3e2c95(0x1e7)]('');if(_0xa5de9c[_0x3e2c95(0x1dc)]){const {currentVersion:_0x50a4e4,field:_0x5a895f,pkgPath:_0x3bdeff}=_0xa5de9c['sdkUpgrade'];console[_0x3e2c95(0x1e7)](a127_0x3b63cd[_0x3e2c95(0x1d9)](_0x3e2c95(0x1f3))+('\x20\x20'+a127_0x3b63cd['yellow'](_0x3bdeff))),console[_0x3e2c95(0x1e7)]('\x20\x20Current\x20version\x20in\x20'+_0x5a895f+':\x20'+a127_0x3b63cd[_0x3e2c95(0x1ca)](_0x50a4e4)+_0x3e2c95(0x197)+a127_0x3b63cd['green'](_0x3e2c95(0x1ad))),console[_0x3e2c95(0x1e7)](_0x3e2c95(0x1a0));}else console['log'](a127_0x3b63cd[_0x3e2c95(0x1d9)](_0x3e2c95(0x1f3))+'\x20\x20'+a127_0x3b63cd[_0x3e2c95(0x1d3)](_0x3e2c95(0x1b4)));console[_0x3e2c95(0x1e7)]('');}function execConfigMigration(_0x5d6929,_0x26cc79){const _0x1773f2=a127_0x2442,{configMigration:_0x22bfb5}=_0x5d6929;if(!_0x22bfb5?.[_0x1773f2(0x1c4)])return{'step':0x1,'label':_0x1773f2(0x1e2),'ok':!![],'detail':_0x1773f2(0x1bd)};const _0x5165c1=readConfigFile(_0x22bfb5[_0x1773f2(0x1c4)]),_0x450977=resolve(_0x26cc79,NEW_CONFIG_NAME),_0x431ba0=_0x22bfb5[_0x1773f2(0x1b3)]?readConfigFile(_0x450977):{};for(const [_0x1e84a8,_0x2d4d75]of Object[_0x1773f2(0x206)](_0x5165c1)){!(_0x1e84a8 in _0x431ba0)&&(_0x431ba0[_0x1e84a8]=_0x2d4d75);}writeConfigFile(_0x450977,_0x431ba0);const _0x4c82a7=_0x22bfb5[_0x1773f2(0x1c4)]+'.bak';return renameSync(_0x22bfb5[_0x1773f2(0x1c4)],_0x4c82a7),{'step':0x1,'label':_0x1773f2(0x1e2),'ok':!![],'detail':_0x22bfb5[_0x1773f2(0x1c4)]+_0x1773f2(0x197)+_0x450977+_0x1773f2(0x1f6)+_0x4c82a7+')'};}function a127_0x3126(){const _0x4961ca=['Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','Upgrade\x20@lovrabet/sdk','10080024qBWqhg','error','length','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','not\x20found\x20(will\x20create)','7wUjJCl','message','succeed','filter','no\x20matching\x20entry\x20found','entries','no\x20legacy\x20entry','Remove\x20old\x20skill','inherit','fail','lovrabet/lovrabet-skill\x20removed','\x20\x20Step\x20','101264NFEyrf','1267964KnljEZ','needsSkillSwap','undefined','26015HkvbYf','\x20→\x20','\x20\x20Fields\x20to\x20migrate:\x20','Install\x20new\x20skill','removed\x20','@lovrabet/dataset-mcp-server','stringify','cwd','70TtVCGr','none\x20found','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','values','path','Skill\x20swap:','oldMcpConfig','\x20\x20bun\x20install','yes','Step\x201/7:\x20Migrating\x20config...','===\x20Upgrade\x20Analysis\x20===','Step\x204/7:\x20MCP\x20config\x20—\x20','join','12pMNLCH','2NbTfTO','latest','FOUND','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','devDependencies','MCP\x20config:','string','hasNewConfig','not\x20found\x20or\x20already\x20at\x20latest','5270683xhbSOf','white','bold','Clean\x20MCP\x20config','@lovrabet/sdk','Step\x204/7:\x20Cleaning\x20MCP\x20config...','green','1386yHqcHL','skipped\x20(no\x20legacy\x20config)','isDirectory','[\x22@lovrabet/sdk\x22]:\x20','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','1981002wnmFHJ','args','start','oldPath','mcpServers','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','Step\x205/7:\x20Removing\x20old\x20skill...','===\x20Upgrade\x20Summary\x20===','object','yellow','Remove\x20.lovrabet/','\x20\x20npm\x20install','.cursor/mcp.json','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','Step\x201/7:\x20Config\x20migration\x20—\x20','files','detail','gray','Step\x206/7:\x20Installing\x20new\x20skill...','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','isArray','CANCEL','Legacy\x20artifacts:','cyan','dependencies','Upgrade\x20cancelled.','sdkUpgrade','done','Upgrade\x20completed\x20successfully!','utf8','some','oldArtifacts','Config\x20migration','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','keys','info','failed','log','.lovrabet','step','fields','push','parse','red','Config\x20file:','487341ZJCoQd','lovrabet/rabetbase\x20installed\x20globally','.claude/skills/lovrabet','\x20\x20Action:\x20delete','@lovrabet/sdk:','status','exit\x20','\x20(backup:\x20'];a127_0x3126=function(){return _0x4961ca;};return a127_0x3126();}function execRemoveOldArtifacts(_0xea2c98){const _0x50d3ae=a127_0x2442,_0x59c8e5=[];for(const _0x506fba of _0xea2c98){try{if(!existsSync(_0x506fba))continue;const _0x68bbb7=tryStat(_0x506fba);_0x68bbb7?.[_0x50d3ae(0x1be)]()?rmSync(_0x506fba,{'recursive':!![],'force':!![]}):unlinkSync(_0x506fba);}catch(_0x5dd553){_0x59c8e5[_0x50d3ae(0x1eb)](_0x506fba+':\x20'+_0x5dd553[_0x50d3ae(0x202)]);}}return{'step':0x3,'label':'Remove\x20legacy\x20artifacts','ok':_0x59c8e5[_0x50d3ae(0x1fe)]===0x0,'detail':_0x59c8e5['length']>0x0?_0xea2c98['length']-_0x59c8e5[_0x50d3ae(0x1fe)]+'/'+_0xea2c98['length']+'\x20removed\x20('+_0x59c8e5[_0x50d3ae(0x1aa)](';\x20')+')':_0xea2c98[_0x50d3ae(0x1fe)]+'\x20removed'};}function execCleanMcp(_0x29c2e7){const _0x29ef2c=a127_0x2442;if(!_0x29c2e7[_0x29ef2c(0x1a4)])return{'step':0x4,'label':_0x29ef2c(0x1b8),'ok':!![],'detail':'skipped'};try{const _0x3a53a9=readFileSync(_0x29c2e7['oldMcpConfig'][_0x29ef2c(0x1a2)],_0x29ef2c(0x1df)),_0x3c8ce1=JSON[_0x29ef2c(0x1ec)](_0x3a53a9);if(_0x3c8ce1?.['mcpServers']&&typeof _0x3c8ce1[_0x29ef2c(0x1c5)]==='object'){const _0x259da9=[];for(const [_0xb2ac5f,_0x1e5a78]of Object[_0x29ef2c(0x206)](_0x3c8ce1[_0x29ef2c(0x1c5)])){_0x1e5a78?.['args']&&Array[_0x29ef2c(0x1d6)](_0x1e5a78[_0x29ef2c(0x1c2)])&&_0x1e5a78[_0x29ef2c(0x1c2)]['some'](_0x3cf628=>typeof _0x3cf628==='string'&&_0x3cf628['includes']('@lovrabet/dataset-mcp-server'))&&_0x259da9[_0x29ef2c(0x1eb)](_0xb2ac5f);}for(const _0x5bd2dc of _0x259da9){delete _0x3c8ce1[_0x29ef2c(0x1c5)][_0x5bd2dc];}return _0x259da9[_0x29ef2c(0x1fe)]>0x0&&writeFileSync(_0x29c2e7['oldMcpConfig']['path'],JSON[_0x29ef2c(0x19c)](_0x3c8ce1,null,0x2)+'\x0a',_0x29ef2c(0x1df)),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x29ef2c(0x19a)+_0x259da9['join'](',\x20')+'\x20from\x20'+_0x29c2e7[_0x29ef2c(0x1a4)][_0x29ef2c(0x1a2)]};}return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x29ef2c(0x205)};}catch(_0x1a4121){return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':![],'detail':_0x1a4121[_0x29ef2c(0x202)]};}}function execSkillsRemove(_0x3bbbc1,_0x17d16d){const _0x637aaf=a127_0x2442,_0x258b8e=runNpxSkillsRemove(_0x3bbbc1,{'stdio':_0x637aaf(0x209),'yes':_0x17d16d});return{'step':0x5,'label':_0x637aaf(0x208),'ok':_0x258b8e['ok'],'detail':_0x258b8e['ok']?_0x637aaf(0x20b):_0x258b8e[_0x637aaf(0x1fd)]??_0x637aaf(0x1f5)+_0x258b8e[_0x637aaf(0x1f4)]};}function execSkillsAdd(_0x15fd16,_0x45f16f){const _0x2f6804=a127_0x2442,_0x567b78=runNpxSkillsAddGlobal(_0x15fd16,'lovrabet/rabetbase',{'stdio':_0x2f6804(0x209),'yes':_0x45f16f});return{'step':0x6,'label':_0x2f6804(0x199),'ok':_0x567b78['ok'],'detail':_0x567b78['ok']?_0x2f6804(0x1f0):_0x567b78[_0x2f6804(0x1fd)]??_0x2f6804(0x1f5)+_0x567b78[_0x2f6804(0x1f4)]};}function execUpgradeSdk(_0x1309a9){const _0x308a20=a127_0x2442;if(!_0x1309a9['sdkUpgrade'])return{'step':0x7,'label':_0x308a20(0x1fb),'ok':!![],'detail':_0x308a20(0x1c6)};const {pkgPath:_0x279494,currentVersion:_0x3bbe43,field:_0x138595}=_0x1309a9[_0x308a20(0x1dc)];try{const _0x42c5f9=readFileSync(_0x279494,_0x308a20(0x1df)),_0x1bba68=JSON['parse'](_0x42c5f9);return _0x1bba68[_0x138595]['@lovrabet/sdk']=_0x308a20(0x1ad),writeFileSync(_0x279494,JSON[_0x308a20(0x19c)](_0x1bba68,null,0x2)+'\x0a',_0x308a20(0x1df)),{'step':0x7,'label':_0x308a20(0x1fb),'ok':!![],'detail':_0x138595+_0x308a20(0x1bf)+_0x3bbe43+'\x20→\x20latest'};}catch(_0x3cf764){return{'step':0x7,'label':_0x308a20(0x1fb),'ok':![],'detail':_0x3cf764['message']};}}function tryStat(_0x3cc8a9){try{return statSync(_0x3cc8a9);}catch{return undefined;}}function printSummary(_0x511cb3){const _0x23769f=a127_0x2442;console[_0x23769f(0x1e7)](''),console['log'](a127_0x3b63cd['bold'](_0x23769f(0x1c8))),console['log']('');for(const _0x489356 of _0x511cb3){const _0x31e897=_0x489356['ok']?a127_0x3b63cd[_0x23769f(0x1bb)]('OK'):a127_0x3b63cd[_0x23769f(0x1ed)]('FAIL');console[_0x23769f(0x1e7)]('\x20\x20'+_0x31e897+_0x23769f(0x20c)+_0x489356[_0x23769f(0x1e9)]+':\x20'+_0x489356['label']);if(_0x489356['detail'])console['log']('\x20\x20\x20\x20\x20\x20\x20'+a127_0x3b63cd['gray'](_0x489356[_0x23769f(0x1d2)]));}console[_0x23769f(0x1e7)]('');}export async function upgradeApp(_0x428dbe,_0x2e3845){const _0x467d4d=a127_0x2442,_0x464c3b=process[_0x467d4d(0x19d)](),_0x5d2e32=analyse(_0x464c3b),_0x2b58b4=!_0x5d2e32['configMigration']&&_0x5d2e32[_0x467d4d(0x1e1)][_0x467d4d(0x1fe)]===0x0&&!_0x5d2e32['oldMcpConfig']&&!_0x5d2e32[_0x467d4d(0x194)]&&!_0x5d2e32['sdkUpgrade'];if(_0x2b58b4){console['log'](a127_0x3b63cd[_0x467d4d(0x1bb)]('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0x5d2e32);const _0x9155e4=!!(_0x2e3845[_0x467d4d(0x1a6)]||_0x2e3845['Y']||_0x428dbe);if(!_0x9155e4)try{const _0x1bcc01=await askConfirm('Proceed\x20with\x20upgrade?');if(!_0x1bcc01){console[_0x467d4d(0x1e7)](a127_0x3b63cd['gray'](_0x467d4d(0x1db)));return;}}catch(_0x2e1fa5){if(_0x2e1fa5?.[_0x467d4d(0x202)]===_0x467d4d(0x1d7)){console['log'](a127_0x3b63cd[_0x467d4d(0x1d3)](_0x467d4d(0x1db)));return;}throw _0x2e1fa5;}const _0x231fa6=[],_0x433f6b=a127_0x4201fb({'text':_0x467d4d(0x1a7),'color':_0x467d4d(0x1d9)})[_0x467d4d(0x1c3)](),_0x33e28a=execConfigMigration(_0x5d2e32,_0x464c3b);_0x231fa6['push'](_0x33e28a),_0x433f6b[_0x33e28a['ok']?_0x467d4d(0x203):_0x467d4d(0x20a)](_0x467d4d(0x1d0)+(_0x33e28a[_0x467d4d(0x1d2)]??(_0x33e28a['ok']?_0x467d4d(0x1dd):_0x467d4d(0x1e6))));const _0x38aa95=resolve(_0x464c3b,_0x467d4d(0x1e8)),_0x108c46=a127_0x4201fb({'text':_0x467d4d(0x1f7),'color':'cyan'})[_0x467d4d(0x1c3)]();if(existsSync(_0x38aa95))try{rmSync(_0x38aa95,{'recursive':!![],'force':!![]}),_0x108c46[_0x467d4d(0x203)](_0x467d4d(0x1c0)),_0x231fa6[_0x467d4d(0x1eb)]({'step':0x2,'label':_0x467d4d(0x1cb),'ok':!![]});}catch(_0x1b05c1){_0x108c46[_0x467d4d(0x20a)]('Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20'+_0x1b05c1[_0x467d4d(0x202)]),_0x231fa6[_0x467d4d(0x1eb)]({'step':0x2,'label':_0x467d4d(0x1cb),'ok':![],'detail':_0x1b05c1[_0x467d4d(0x202)]});}else _0x108c46[_0x467d4d(0x1e5)]('Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped'),_0x231fa6[_0x467d4d(0x1eb)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![],'detail':'skipped'});const _0xd52b95=a127_0x4201fb({'text':_0x467d4d(0x1fa),'color':_0x467d4d(0x1d9)})[_0x467d4d(0x1c3)](),_0x46e957=execRemoveOldArtifacts(_0x5d2e32[_0x467d4d(0x1e1)]);_0x231fa6[_0x467d4d(0x1eb)](_0x46e957),_0xd52b95[_0x46e957['ok']?_0x467d4d(0x203):_0x467d4d(0x20a)](_0x467d4d(0x1ce)+(_0x46e957[_0x467d4d(0x1d2)]??(_0x46e957['ok']?'done':_0x467d4d(0x1e6))));const _0x5ad15a=a127_0x4201fb({'text':_0x467d4d(0x1ba),'color':_0x467d4d(0x1d9)})['start'](),_0x1fccbb=execCleanMcp(_0x5d2e32);_0x231fa6[_0x467d4d(0x1eb)](_0x1fccbb),_0x5ad15a[_0x1fccbb['ok']?_0x467d4d(0x203):'fail'](_0x467d4d(0x1a9)+(_0x1fccbb[_0x467d4d(0x1d2)]??(_0x1fccbb['ok']?_0x467d4d(0x1dd):_0x467d4d(0x1e6))));const _0x4b87fc=a127_0x4201fb({'text':_0x467d4d(0x1c7),'color':_0x467d4d(0x1d9)})['start'](),_0x1a7ecb=execSkillsRemove(_0x464c3b,_0x9155e4);_0x231fa6[_0x467d4d(0x1eb)](_0x1a7ecb),_0x4b87fc[_0x1a7ecb['ok']?_0x467d4d(0x203):_0x467d4d(0x20a)](_0x467d4d(0x1d5)+(_0x1a7ecb[_0x467d4d(0x1d2)]??(_0x1a7ecb['ok']?_0x467d4d(0x1dd):_0x467d4d(0x1e6))));const _0xfe6cdd=a127_0x4201fb({'text':_0x467d4d(0x1d4),'color':_0x467d4d(0x1d9)})['start'](),_0x1f3bef=execSkillsAdd(_0x464c3b,_0x9155e4);_0x231fa6[_0x467d4d(0x1eb)](_0x1f3bef),_0xfe6cdd[_0x1f3bef['ok']?'succeed':_0x467d4d(0x20a)](_0x467d4d(0x1ff)+(_0x1f3bef[_0x467d4d(0x1d2)]??(_0x1f3bef['ok']?_0x467d4d(0x1dd):_0x467d4d(0x1e6))));const _0x3c5be7=a127_0x4201fb({'text':_0x467d4d(0x1cf),'color':_0x467d4d(0x1d9)})[_0x467d4d(0x1c3)](),_0x1f8fd9=execUpgradeSdk(_0x5d2e32);_0x231fa6[_0x467d4d(0x1eb)](_0x1f8fd9),_0x3c5be7[_0x1f8fd9['ok']?_0x467d4d(0x203):_0x467d4d(0x20a)](_0x467d4d(0x1f8)+(_0x1f8fd9[_0x467d4d(0x1d2)]??(_0x1f8fd9['ok']?_0x467d4d(0x1dd):_0x467d4d(0x1e6)))),printSummary(_0x231fa6);const _0x4e7e45=_0x231fa6['some'](_0x510ff9=>!_0x510ff9['ok']);_0x4e7e45?console[_0x467d4d(0x1e7)](a127_0x3b63cd[_0x467d4d(0x1ca)]('Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.')):console[_0x467d4d(0x1e7)](a127_0x3b63cd[_0x467d4d(0x1bb)](_0x467d4d(0x1de))),_0x1f8fd9['ok']&&_0x5d2e32[_0x467d4d(0x1dc)]&&(console[_0x467d4d(0x1e7)](''),console[_0x467d4d(0x1e7)](a127_0x3b63cd['bold'][_0x467d4d(0x1d9)](_0x467d4d(0x1e3))),console[_0x467d4d(0x1e7)](a127_0x3b63cd[_0x467d4d(0x1d9)]('Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:')),console['log'](''),console['log'](a127_0x3b63cd[_0x467d4d(0x1b6)](_0x467d4d(0x1cc))),console['log'](a127_0x3b63cd[_0x467d4d(0x1b6)]('\x20\x20#\x20or')),console[_0x467d4d(0x1e7)](a127_0x3b63cd[_0x467d4d(0x1b6)](_0x467d4d(0x1a5))),console[_0x467d4d(0x1e7)](''));}
|