@lovrabet/rabetbase-cli 2.3.4-beta.1 → 2.3.4-beta.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/README.md +99 -560
- 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-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/generate.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 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +18 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a115_0x26b15e=a115_0x1bfc;(function(_0x5919d8,_0x53abf6){const _0x546807=a115_0x1bfc,_0x488109=_0x5919d8();while(!![]){try{const _0x1e985d=-parseInt(_0x546807(0x156))/0x1*(-parseInt(_0x546807(0x16a))/0x2)+-parseInt(_0x546807(0x152))/0x3+-parseInt(_0x546807(0x16d))/0x4*(-parseInt(_0x546807(0x159))/0x5)+parseInt(_0x546807(0x16c))/0x6*(parseInt(_0x546807(0x168))/0x7)+parseInt(_0x546807(0x167))/0x8*(-parseInt(_0x546807(0x163))/0x9)+-parseInt(_0x546807(0x151))/0xa+-parseInt(_0x546807(0x15e))/0xb*(-parseInt(_0x546807(0x154))/0xc);if(_0x1e985d===_0x53abf6)break;else _0x488109['push'](_0x488109['shift']());}catch(_0x47068a){_0x488109['push'](_0x488109['shift']());}}}(a115_0x40a1,0x47e6a));function a115_0x1bfc(_0x45114d,_0x1524f7){_0x45114d=_0x45114d-0x14f;const _0x40a12d=a115_0x40a1();let _0x1bfcbc=_0x40a12d[_0x45114d];return _0x1bfcbc;}import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assessStandardPageState,getUndeletedRelatedPages,loadDatasetDetailForPage,loadStandardPageStatusForGenerate,serializeDryRunDescription,validateDatasetSelector}from'../../commands/page/shared.js';function a115_0x40a1(){const _0x2a6a67=['8edLQxn','status','6jblZLp','124CImKfr','code','GET','779780MIAGZC','1299078RyuRcx','standard-page-status','5064spAASe','source','36946UEVcjd','length','Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)','28630dKuyYr','relatedPages','read','query-standard-page-status','related-pages-fallback','13442pUgtfG','string','appCode','/smartapi/lovrabet/dataset/','name','711DiAuur','alias','manualResolutionRequired','nextAction','26872GAgkSM','1609279nRUGhs','Query\x20Smart\x20List\x20Page\x20facts\x20for\x20a\x20dataset'];a115_0x40a1=function(){return _0x2a6a67;};return a115_0x40a1();}export const pageStandardPageStatus={'service':'page','command':a115_0x26b15e(0x153),'description':a115_0x26b15e(0x169),'risk':a115_0x26b15e(0x15b),'defaultOutputFormat':'compress','flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a115_0x26b15e(0x164),'type':a115_0x26b15e(0x15f),'description':a115_0x26b15e(0x158)}],async 'validate'(_0x5e8a4b){validateDatasetSelector(_0x5e8a4b);},async 'dryRun'(_0x4a3f0d){const _0x28bd1a=a115_0x26b15e,_0x3205e0=await loadDatasetDetailForPage(_0x4a3f0d);return{'method':_0x28bd1a(0x150),'url':_0x28bd1a(0x161)+_0x3205e0[_0x28bd1a(0x14f)]+'/standard-page-status?appCode='+encodeURIComponent(_0x4a3f0d[_0x28bd1a(0x160)]),'description':serializeDryRunDescription({'dataset':{'id':_0x3205e0['id'],'code':_0x3205e0[_0x28bd1a(0x14f)],'name':_0x3205e0[_0x28bd1a(0x162)]},'action':_0x28bd1a(0x15c)})};},async 'execute'(_0x3c1648){const _0x36915d=a115_0x26b15e,_0x421bc3=await loadDatasetDetailForPage(_0x3c1648),_0x22dc60=await loadStandardPageStatusForGenerate(_0x3c1648,_0x421bc3['code']),_0x3bd5dd=getUndeletedRelatedPages(_0x421bc3),_0x3ef926=assessStandardPageState(_0x421bc3[_0x36915d(0x14f)],_0x22dc60,{'fallbackUndeletedPages':_0x3bd5dd});return{'ok':!![],'data':{'datasetCode':_0x421bc3[_0x36915d(0x14f)],'precheckSource':_0x22dc60?.[_0x36915d(0x155)]??_0x36915d(0x15d),'status':_0x3ef926[_0x36915d(0x16b)],'manualResolutionRequired':_0x3ef926[_0x36915d(0x165)],'nextAction':_0x3ef926[_0x36915d(0x166)],'standardPageStatus':_0x22dc60,'relatedPages':{'total':_0x421bc3[_0x36915d(0x15a)][_0x36915d(0x157)],'undeletedCount':_0x3bd5dd['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a116_0x36b62f=a116_0x4cb4;(function(_0x24828e,_0xc33a5d){const _0x104e7d=a116_0x4cb4,_0x5a92b8=_0x24828e();while(!![]){try{const _0x24dbfb=parseInt(_0x104e7d(0x151))/0x1+parseInt(_0x104e7d(0x150))/0x2+-parseInt(_0x104e7d(0x159))/0x3+-parseInt(_0x104e7d(0x161))/0x4*(parseInt(_0x104e7d(0x155))/0x5)+parseInt(_0x104e7d(0x15f))/0x6*(-parseInt(_0x104e7d(0x153))/0x7)+parseInt(_0x104e7d(0x154))/0x8+-parseInt(_0x104e7d(0x156))/0x9;if(_0x24dbfb===_0xc33a5d)break;else _0x5a92b8['push'](_0x5a92b8['shift']());}catch(_0x598757){_0x5a92b8['push'](_0x5a92b8['shift']());}}}(a116_0x35ad,0x3ebd2));function a116_0x4cb4(_0x2d7378,_0x4581b6){_0x2d7378=_0x2d7378-0x14a;const _0x35ad01=a116_0x35ad();let _0x4cb4b7=_0x35ad01[_0x2d7378];return _0x4cb4b7;}import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{loadDatasetDetailForPage,prepareDatasetAction,serializeDryRunDescription,validateDatasetSelector}from'../../commands/page/shared.js';import{syncStandardPages}from'../../core/api-client.js';export const pageSync={'service':'page','command':a116_0x36b62f(0x165),'description':a116_0x36b62f(0x163),'risk':'write','defaultOutputFormat':'compress','flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a116_0x36b62f(0x14d),'type':'string','description':a116_0x36b62f(0x15e)}],async 'validate'(_0x10e2ad){validateDatasetSelector(_0x10e2ad);},async 'dryRun'(_0x4fa073){const _0x48f496=a116_0x36b62f,_0x1186b5=await prepare(_0x4fa073);return{'method':_0x48f496(0x160),'url':_0x48f496(0x15b)+_0x1186b5[_0x48f496(0x14a)]['code']+_0x48f496(0x162),'body':{'appCode':_0x4fa073[_0x48f496(0x15c)]},'description':serializeDryRunDescription({'dataset':{'id':_0x1186b5[_0x48f496(0x14a)]['id'],'code':_0x1186b5[_0x48f496(0x14a)]['code'],'name':_0x1186b5[_0x48f496(0x14a)][_0x48f496(0x14e)],'fieldCount':_0x1186b5['dataset'][_0x48f496(0x157)]},'relatedPages':{'total':_0x1186b5[_0x48f496(0x14a)][_0x48f496(0x14b)][_0x48f496(0x14f)],'undeletedCount':_0x1186b5['undeletedPages'][_0x48f496(0x14f)]},'action':_0x48f496(0x165),'reason':_0x1186b5['undeletedPages'][_0x48f496(0x14f)]+_0x48f496(0x164)})};},async 'execute'(_0x20d19a){const _0x554582=a116_0x36b62f,_0x14eaf9=await prepare(_0x20d19a),_0x47778a=await syncStandardPages(_0x20d19a[_0x554582(0x15c)],_0x14eaf9[_0x554582(0x14a)][_0x554582(0x14c)]),_0x234b3c=Array[_0x554582(0x15a)](_0x47778a[_0x554582(0x15d)])&&_0x47778a[_0x554582(0x15d)][_0x554582(0x14f)]>0x0,_0x2e8f1b=_0x234b3c?_0x554582(0x158):_0x554582(0x152);return{'ok':!![],'message':_0x2e8f1b,'data':{'datasetCode':_0x14eaf9[_0x554582(0x14a)]['code'],..._0x47778a}};}};async function prepare(_0x34c4b2){const _0x15ad66=await loadDatasetDetailForPage(_0x34c4b2);return prepareDatasetAction(_0x15ad66,'sync');}function a116_0x35ad(){const _0x406f51=['40EHmbrs','3768201VLKKGW','fieldCount','部分页面同步失败','1281081LNvhvC','isArray','/smartapi/lovrabet/dataset/','appCode','failedPages','Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)','111450oZIhNm','POST','21836oHjEiM','/sync-to-pages','Sync\x20dataset\x20changes\x20to\x20related\x20Smart\x20List\x20Pages','\x20undeleted\x20related\x20page(s)\x20found','sync','dataset','relatedPages','code','alias','name','length','1015440jKuupJ','288193oLvmbp','同步成功','7riKMvf','2952224iaKBDY'];a116_0x35ad=function(){return _0x406f51;};return a116_0x35ad();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xd61a9b,_0x23bba6){const _0xca8f15=a117_0xf07e,_0x2b04e8=_0xd61a9b();while(!![]){try{const _0x252db8=parseInt(_0xca8f15(0xbd))/0x1+-parseInt(_0xca8f15(0xc8))/0x2*(parseInt(_0xca8f15(0xc0))/0x3)+-parseInt(_0xca8f15(0xc4))/0x4+parseInt(_0xca8f15(0xc3))/0x5*(-parseInt(_0xca8f15(0xb7))/0x6)+-parseInt(_0xca8f15(0xcd))/0x7+parseInt(_0xca8f15(0xc9))/0x8*(parseInt(_0xca8f15(0xb2))/0x9)+parseInt(_0xca8f15(0xb1))/0xa;if(_0x252db8===_0x23bba6)break;else _0x2b04e8['push'](_0x2b04e8['shift']());}catch(_0x3cbdc7){_0x2b04e8['push'](_0x2b04e8['shift']());}}}(a117_0xe926,0x32c31));function a117_0xe926(){const _0x291c01=['cyan','80CpRHCN','1376488lMiWqA','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','√\x20Login\x20status:\x20','Project\x20name:','2TZryiS','528hcHnAI','log','Not\x20set','Skipped','2032583tIfkIK','8610960uoXlar','12591muTfGt','env','Login\x20failed','production','trim','143544LlwqTn','cwd','√\x20App\x20Code:\x20','test','Project\x20name\x20cannot\x20exceed\x2050\x20characters','resolve','413321OWuxym','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','√\x20Project\x20Name:\x20','424665CooJlN','green'];a117_0xe926=function(){return _0x291c01;};return a117_0xe926();}function a117_0xf07e(_0x54e7e7,_0x4dfa5a){_0x54e7e7=_0x54e7e7-0xb1;const _0xe92603=a117_0xe926();let _0xf07ee8=_0xe92603[_0x54e7e7];return _0xf07ee8;}import{existsSync}from'node:fs';import a117_0x515061 from'node:path';import a117_0x1766df from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x101960,_0xcd713c,_0x524b48){const _0x3762cc=a117_0xf07e,_0x583865='my-app',_0x217ad5=readConfig(),_0x3c71b7=typeof _0x217ad5['env']==='string'?_0x217ad5[_0x3762cc(0xb3)]:undefined,_0xd138b7=await input({'message':_0x3762cc(0xc7),'default':_0x583865,'validate':_0x2ff32d=>{const _0x58929a=_0x3762cc,_0x1df7d4=_0x2ff32d[_0x58929a(0xb6)]()||_0x583865;if(_0x1df7d4['length']>0x32)return _0x58929a(0xbb);const _0x326d96=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x1df7d4&&!_0x326d96[_0x58929a(0xba)](_0x1df7d4))return _0x58929a(0xc5);const _0x185762=a117_0x515061[_0x58929a(0xbc)](process[_0x58929a(0xb8)](),_0x1df7d4);if(existsSync(_0x185762))return'Directory\x20\x22'+_0x1df7d4+'\x22\x20already\x20exists';return!![];}});console[_0x3762cc(0xca)](a117_0x1766df[_0x3762cc(0xc1)](_0x3762cc(0xbf)+a117_0x1766df['cyan'](_0xd138b7)));const _0x3fcd6b=await selectSingleAppcode(_0x524b48);console[_0x3762cc(0xca)](a117_0x1766df[_0x3762cc(0xc1)](_0x3762cc(0xb9)+a117_0x1766df['cyan'](_0x3fcd6b||_0x3762cc(0xcb))));if(_0x3fcd6b){const _0x26c91b=await getIsSessionValid();if(!_0x26c91b){const _0x31abcc=await confirm({'message':_0x3762cc(0xbe),'default':!![]});if(_0x31abcc){const _0x1cb4a6=await authServer({'silent':!![]});console[_0x3762cc(0xca)](a117_0x1766df[_0x3762cc(0xc1)](_0x3762cc(0xc6)+a117_0x1766df['cyan'](_0x1cb4a6?'Logged\x20in':_0x3762cc(0xb4))));}else console[_0x3762cc(0xca)](a117_0x1766df[_0x3762cc(0xc1)](_0x3762cc(0xc6)+a117_0x1766df[_0x3762cc(0xc2)](_0x3762cc(0xcc))));}await _0x101960({'projectName':_0xd138b7,'appCode':_0x3fcd6b,'env':_0xcd713c||_0x3c71b7||_0x3762cc(0xb5)});}else await _0x101960({'projectName':_0xd138b7,'env':_0xcd713c||_0x3c71b7||_0x3762cc(0xb5)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a118_0x4d81(_0x55b986,_0x43ba97){_0x55b986=_0x55b986-0x1dd;const _0x4055c0=a118_0x4055();let _0x4d81c1=_0x4055c0[_0x55b986];return _0x4d81c1;}(function(_0x4dccbf,_0x3f1518){const _0x2b3039=a118_0x4d81,_0x80b566=_0x4dccbf();while(!![]){try{const _0x2f5619=-parseInt(_0x2b3039(0x1e1))/0x1*(parseInt(_0x2b3039(0x1ea))/0x2)+-parseInt(_0x2b3039(0x1e9))/0x3*(-parseInt(_0x2b3039(0x1e3))/0x4)+parseInt(_0x2b3039(0x1dd))/0x5*(-parseInt(_0x2b3039(0x1e5))/0x6)+-parseInt(_0x2b3039(0x1df))/0x7+parseInt(_0x2b3039(0x1e7))/0x8+-parseInt(_0x2b3039(0x1e6))/0x9+-parseInt(_0x2b3039(0x1e8))/0xa*(-parseInt(_0x2b3039(0x1e0))/0xb);if(_0x2f5619===_0x3f1518)break;else _0x80b566['push'](_0x80b566['shift']());}catch(_0x18a45d){_0x80b566['push'](_0x80b566['shift']());}}}(a118_0x4055,0x5e584));export function formatElapsed(_0x2c8cc3){const _0x32f5ec=a118_0x4d81,_0x1f75fc=Date[_0x32f5ec(0x1e4)]()-_0x2c8cc3;if(_0x1f75fc<0x3e8)return _0x1f75fc+'ms';const _0x59cb4b=(_0x1f75fc/0x3e8)[_0x32f5ec(0x1e2)](0x2),_0x38b696=_0x59cb4b[_0x32f5ec(0x1de)](/\.?0+$/u,'');return _0x38b696+'s';}function a118_0x4055(){const _0x2d15cc=['171500IFFjKr','1425378HtrQbo','50DXGbgE','5rTEFmg','replace','4090989DTMSXj','1078wpcTKS','16621fhtCnt','toFixed','4qPJlwp','now','2370468ccCVjQ','5557149txsecM','1944808vPYJNE'];a118_0x4055=function(){return _0x2d15cc;};return a118_0x4055();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4577ef,_0x1dead0){const _0x420445=a119_0x2d53,_0xf06f19=_0x4577ef();while(!![]){try{const _0x51ad06=parseInt(_0x420445(0x1f3))/0x1+parseInt(_0x420445(0x236))/0x2+-parseInt(_0x420445(0x23f))/0x3+-parseInt(_0x420445(0x23b))/0x4+-parseInt(_0x420445(0x1fd))/0x5*(parseInt(_0x420445(0x1f5))/0x6)+parseInt(_0x420445(0x1e9))/0x7*(parseInt(_0x420445(0x1f8))/0x8)+-parseInt(_0x420445(0x237))/0x9;if(_0x51ad06===_0x1dead0)break;else _0xf06f19['push'](_0xf06f19['shift']());}catch(_0x3c1af4){_0xf06f19['push'](_0xf06f19['shift']());}}}(a119_0x2384,0x6a408));import a119_0x5da4f4 from'path';import a119_0x2ffcd4 from'fs';import a119_0x3c528b from'chalk';import a119_0x507733 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';function a119_0x2d53(_0x52c809,_0x21b0a8){_0x52c809=_0x52c809-0x1e9;const _0x2384f9=a119_0x2384();let _0x2d5312=_0x2384f9[_0x52c809];return _0x2d5312;}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_0x2384(){const _0x66bca=['repeat','更新\x20package.json\x20name','√\x20package.json\x20updated:\x20name=','readFileSync','minimumVersion','项目创建失败:\x20','清理项目目录失败:\x20','version','\x20already\x20exists','\x20dataset(s),\x20generated\x20','projectName','needsUpgrade','\x20Generated\x20by\x20rabetbase\x20cli\x20','writeFileSync','√\x20Pulled\x20','production','*\x20Pulling\x20API\x20configuration...','W_OK','error','trim','更新\x20package.json\x20失败','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','package.json','开始创建项目:\x20','🚀\x20Next\x20Steps:','\x20|\x20AppCode:\x20','gray','projectCode','cookie','chdir','1082262crFdGr','1016415YOcfPh','\x20api\x20pull','resolve','API\x20configuration\x20pulled:\x20','740916kOmBgI','Project\x20name\x20cannot\x20be\x20empty','CLI\x20版本检查','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','115536jnkayJ','\x20\x202.\x20Pull\x20API\x20configuration:\x20','28yvZHee','1.0.0','defaultApp','warn','create','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','info','test','\x20|\x20Default:\x20','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','329435GPXLCh','Format\x20code','413238uJlXEC','length','\x20model(s)','1180096oBnTqw','stop','message','appCode','Copy\x20project\x20files','50GWEgCi','\x20\x201.\x20Start\x20project:\x20','parse','\x20√\x20','utf8','fail','belowMinimum','green','bold','join','...','配置应用AppCode失败','\x20&&\x20','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','cwd','description','env','cyan','cd\x20','log','stableVersion','\x20config\x20set\x20appcode\x20<app-code>\x27','\x20run\x20start','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','name','constants','existsSync'];a119_0x2384=function(){return _0x66bca;};return a119_0x2384();}export async function createApp(_0x1819ec){const _0x10e93f=a119_0x2d53,_0xa69ab0=await checkCliVersion();(_0xa69ab0[_0x10e93f(0x223)]||_0xa69ab0[_0x10e93f(0x203)])&&(printCliUpgradeWarning(_0xa69ab0),assertCliVersionSupported(_0xa69ab0),logger[_0x10e93f(0x1ef)](_0x10e93f(0x1ed),_0x10e93f(0x23d),{'currentVersion':_0xa69ab0['currentVersion'],'stableVersion':_0xa69ab0[_0x10e93f(0x211)],'minimumVersion':_0xa69ab0[_0x10e93f(0x21c)],'needsUpgrade':_0xa69ab0[_0x10e93f(0x223)],'belowMinimum':_0xa69ab0[_0x10e93f(0x203)]}));if(_0x1819ec['projectCode']&&_0x1819ec[_0x10e93f(0x1fb)])await runCreate({'projectName':_0x1819ec[_0x10e93f(0x233)],'appCode':_0x1819ec[_0x10e93f(0x1fb)],'env':_0x1819ec[_0x10e93f(0x20d)]},_0x1819ec);else{if(_0x1819ec[_0x10e93f(0x233)]){const _0x967281=await selectSingleAppcode(_0x1819ec['cookie']);await runCreate({'projectName':_0x1819ec['projectCode'],'appCode':_0x967281||undefined,'env':_0x1819ec[_0x10e93f(0x20d)]},_0x1819ec);}else await guidedCreateProject(_0x4051ee=>runCreate(_0x4051ee,_0x1819ec),_0x1819ec[_0x10e93f(0x20d)],_0x1819ec[_0x10e93f(0x234)]);}}async function runCreate(_0x1256fe,_0x43fabb){const _0x2e5fab=a119_0x2d53;if(!_0x1256fe[_0x2e5fab(0x222)]||_0x1256fe['projectName'][_0x2e5fab(0x22b)]()==='')throw new Error(_0x2e5fab(0x23c));const _0x5ec620=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x5ec620[_0x2e5fab(0x1f0)](_0x1256fe[_0x2e5fab(0x222)]))throw new Error(_0x2e5fab(0x23e));if(_0x1256fe['projectName'][_0x2e5fab(0x1f6)]>0x64)throw new Error(_0x2e5fab(0x1f2));const _0x3c50ec=a119_0x5da4f4[_0x2e5fab(0x239)](process[_0x2e5fab(0x20b)](),_0x1256fe['projectName']);if(a119_0x2ffcd4[_0x2e5fab(0x217)](_0x3c50ec))throw new Error('Project\x20directory\x20'+_0x1256fe[_0x2e5fab(0x222)]+_0x2e5fab(0x220));try{a119_0x2ffcd4['accessSync'](a119_0x5da4f4['dirname'](_0x3c50ec),a119_0x2ffcd4[_0x2e5fab(0x216)][_0x2e5fab(0x229)]);}catch{throw new Error(_0x2e5fab(0x22d));}logger['setLogPath'](_0x3c50ec),logger[_0x2e5fab(0x1ef)](_0x2e5fab(0x1ed),_0x2e5fab(0x22f)+_0x1256fe['projectName'],{'projectDir':_0x3c50ec,'appCode':_0x1256fe[_0x2e5fab(0x1fb)]}),console[_0x2e5fab(0x210)](),console['log'](a119_0x3c528b[_0x2e5fab(0x204)](_0x2e5fab(0x200))+'Project\x20name:\x20'+a119_0x3c528b[_0x2e5fab(0x204)](_0x1256fe[_0x2e5fab(0x222)])+(_0x1256fe[_0x2e5fab(0x1fb)]?_0x2e5fab(0x231)+a119_0x3c528b[_0x2e5fab(0x20e)](_0x1256fe[_0x2e5fab(0x1fb)]):''));try{await runTask(_0x2e5fab(0x1fc),()=>copyProjectTemplate(_0x1256fe[_0x2e5fab(0x222)])),await updatePackageJsonName(_0x1256fe[_0x2e5fab(0x222)]),await runTask('Install\x20dependencies',()=>installDependencies(_0x1256fe['projectName'])),await runTask(_0x2e5fab(0x1f4),()=>formatProjectCode(_0x1256fe['projectName'])),await configureAppCode(_0x1256fe[_0x2e5fab(0x222)],_0x1256fe['appCode']||'',_0x1256fe[_0x2e5fab(0x20d)]);let _0x25f37c=![];if(_0x1256fe[_0x2e5fab(0x1fb)]){console[_0x2e5fab(0x210)](_0x2e5fab(0x228));const _0x477457=process['cwd']();try{process[_0x2e5fab(0x235)](_0x3c50ec);const _0x4e6450=_0x1256fe[_0x2e5fab(0x20d)]||_0x2e5fab(0x227);initEnv(_0x4e6450);const {configArray:_0x42584b}=await fetchModelList(_0x1256fe[_0x2e5fab(0x1fb)],_0x43fabb[_0x2e5fab(0x234)]||''),_0x55aeeb=DEFAULT_API_DIR,_0x1838d3=await generateApiFile(_0x42584b,'',_0x1256fe['appCode'],!![],_0x4e6450,_0x55aeeb);console[_0x2e5fab(0x210)](_0x2e5fab(0x226)+_0x42584b[_0x2e5fab(0x1f6)]+_0x2e5fab(0x221)+_0x1838d3['modelCount']+_0x2e5fab(0x1f7)),logger[_0x2e5fab(0x1ef)]('create',_0x2e5fab(0x23a)+_0x1256fe[_0x2e5fab(0x1fb)]);}catch(_0x56eff4){_0x25f37c=!![],console[_0x2e5fab(0x210)](_0x2e5fab(0x1ee)),logger[_0x2e5fab(0x1ec)](_0x2e5fab(0x1ed),'API\x20配置拉取异常',{'error':_0x56eff4 instanceof Error?_0x56eff4[_0x2e5fab(0x1fa)]:String(_0x56eff4)});}finally{process[_0x2e5fab(0x235)](_0x477457);}}logger['success'](_0x2e5fab(0x1ed),'项目创建完成:\x20'+_0x1256fe[_0x2e5fab(0x222)]),console[_0x2e5fab(0x210)](),console['log'](a119_0x3c528b[_0x2e5fab(0x204)]('─'[_0x2e5fab(0x218)](0x3c))),console[_0x2e5fab(0x210)](a119_0x3c528b[_0x2e5fab(0x20e)][_0x2e5fab(0x205)](_0x2e5fab(0x230))),console[_0x2e5fab(0x210)](),console[_0x2e5fab(0x210)](_0x2e5fab(0x1fe)+a119_0x3c528b['cyan'][_0x2e5fab(0x205)](_0x2e5fab(0x20f)+_0x1256fe[_0x2e5fab(0x222)]+_0x2e5fab(0x209)+CLI_BIN_NAME+_0x2e5fab(0x213))),_0x25f37c&&console[_0x2e5fab(0x210)](_0x2e5fab(0x240)+a119_0x3c528b[_0x2e5fab(0x20e)][_0x2e5fab(0x205)](CLI_BIN_NAME+_0x2e5fab(0x238))),console[_0x2e5fab(0x210)](a119_0x3c528b[_0x2e5fab(0x204)]('─'[_0x2e5fab(0x218)](0x3c)));}catch(_0x24aa57){logger[_0x2e5fab(0x22a)](_0x2e5fab(0x1ed),_0x2e5fab(0x21d)+_0x1256fe[_0x2e5fab(0x222)],{'error':_0x24aa57 instanceof Error?_0x24aa57[_0x2e5fab(0x1fa)]:String(_0x24aa57)});try{a119_0x2ffcd4[_0x2e5fab(0x217)](_0x3c50ec)&&(console[_0x2e5fab(0x210)](_0x2e5fab(0x214)+_0x3c50ec),a119_0x2ffcd4['rmSync'](_0x3c50ec,{'recursive':!![],'force':!![]}));}catch{logger['warn'](_0x2e5fab(0x1ed),_0x2e5fab(0x21e)+_0x3c50ec);}throw _0x24aa57;}}async function runTask(_0x543478,_0x5d8f45){const _0x32de14=a119_0x2d53,_0x3cfb15=a119_0x507733(_0x543478+_0x32de14(0x207))['start']();try{const _0x357190=await _0x5d8f45();_0x3cfb15[_0x32de14(0x1f9)](),console[_0x32de14(0x210)](''+a119_0x3c528b[_0x32de14(0x204)]('\x20√\x20')+_0x543478+'\x20'+a119_0x3c528b[_0x32de14(0x232)]('['+_0x357190+']'));}catch(_0x388740){_0x3cfb15[_0x32de14(0x202)](_0x543478);throw _0x388740;}}async function updatePackageJsonName(_0x36d12e){const _0x55f653=a119_0x2d53,_0x382fb7=a119_0x5da4f4[_0x55f653(0x239)](process[_0x55f653(0x20b)](),_0x36d12e),_0x29463a=a119_0x5da4f4[_0x55f653(0x206)](_0x382fb7,'package.json');try{console[_0x55f653(0x210)]('*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields');const _0x66a743=getRabetbaseCliPackageRoot(),_0x4faf58=a119_0x5da4f4[_0x55f653(0x206)](_0x66a743,_0x55f653(0x22e));let _0x404fcd=_0x55f653(0x1ea);try{const _0x24ac85=JSON[_0x55f653(0x1ff)](a119_0x2ffcd4[_0x55f653(0x21b)](_0x4faf58,_0x55f653(0x201)));_0x404fcd=_0x24ac85[_0x55f653(0x21f)]||'1.0.0';}catch{}const _0xa2b42e=a119_0x2ffcd4[_0x55f653(0x21b)](_0x29463a,_0x55f653(0x201)),_0x1d4752=JSON[_0x55f653(0x1ff)](_0xa2b42e);_0x1d4752[_0x55f653(0x215)]=_0x36d12e,_0x1d4752[_0x55f653(0x20c)]=_0x36d12e+_0x55f653(0x224)+_0x404fcd,a119_0x2ffcd4[_0x55f653(0x225)](_0x29463a,JSON['stringify'](_0x1d4752,null,0x2)+'\x0a',_0x55f653(0x201)),console['log'](_0x55f653(0x21a)+_0x36d12e),logger[_0x55f653(0x1ef)](_0x55f653(0x1ed),_0x55f653(0x219));}catch(_0x52494c){logger[_0x55f653(0x22a)](_0x55f653(0x1ed),_0x55f653(0x22c));throw _0x52494c;}}async function configureAppCode(_0x42fc11,_0x2728d9,_0x1e362b){const _0x34a446=a119_0x2d53,_0x593d5b=a119_0x5da4f4[_0x34a446(0x239)](process[_0x34a446(0x20b)](),_0x42fc11),_0x4a6e02=a119_0x5da4f4[_0x34a446(0x206)](_0x593d5b,NEW_CONFIG_NAME);try{_0x2728d9?console[_0x34a446(0x210)]('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x42fc11+':\x20'+_0x2728d9):console[_0x34a446(0x210)](_0x34a446(0x20a)+_0x42fc11);const _0x45438f=getRabetbaseCliPackageRoot(),_0x59dab6=a119_0x5da4f4['join'](_0x45438f,_0x34a446(0x22e));let _0x54ff85=_0x34a446(0x1ea);try{const _0x2a8dff=JSON['parse'](a119_0x2ffcd4[_0x34a446(0x21b)](_0x59dab6,_0x34a446(0x201)));_0x54ff85=_0x2a8dff[_0x34a446(0x21f)]||_0x34a446(0x1ea);}catch{}const _0x4999aa=readConfig(),_0x43c111=typeof _0x4999aa[_0x34a446(0x20d)]==='string'?_0x4999aa[_0x34a446(0x20d)]:undefined,_0x383b7e={};for(const _0x2aa513 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x4999aa[_0x2aa513]!=null)_0x383b7e[_0x2aa513]=_0x4999aa[_0x2aa513];}const _0x138234=buildCanonicalProjectConfig(_0x383b7e,{'appCodes':_0x2728d9?[_0x2728d9]:[],'env':_0x1e362b||_0x43c111||_0x34a446(0x227),'metadata':{'createdAt':new Date()['toLocaleString'](),'version':_0x54ff85}});writeConfigFile(_0x4a6e02,_0x138234),_0x2728d9?console['log']('√\x20Configuration\x20file\x20created,\x20Apps:\x20'+Object['keys'](_0x138234['apps']||{})[_0x34a446(0x206)](',\x20')+_0x34a446(0x1f1)+_0x138234[_0x34a446(0x1eb)]):console[_0x34a446(0x210)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+_0x34a446(0x212)),logger[_0x34a446(0x1ef)](_0x34a446(0x1ed),'配置应用AppCode:\x20'+_0x2728d9);}catch(_0x26d3b6){logger[_0x34a446(0x22a)](_0x34a446(0x1ed),_0x34a446(0x208));}}
|
|
1
|
+
(function(_0x3d35fe,_0x531cdd){const _0x56058e=a119_0x4faa,_0x8729c=_0x3d35fe();while(!![]){try{const _0x28dde1=parseInt(_0x56058e(0x1e5))/0x1+-parseInt(_0x56058e(0x18f))/0x2+parseInt(_0x56058e(0x18e))/0x3*(-parseInt(_0x56058e(0x191))/0x4)+parseInt(_0x56058e(0x1c4))/0x5*(parseInt(_0x56058e(0x195))/0x6)+-parseInt(_0x56058e(0x1d5))/0x7*(parseInt(_0x56058e(0x1a1))/0x8)+-parseInt(_0x56058e(0x1de))/0x9*(-parseInt(_0x56058e(0x19c))/0xa)+parseInt(_0x56058e(0x1a5))/0xb*(parseInt(_0x56058e(0x1c9))/0xc);if(_0x28dde1===_0x531cdd)break;else _0x8729c['push'](_0x8729c['shift']());}catch(_0x43d664){_0x8729c['push'](_0x8729c['shift']());}}}(a119_0x5b5b,0xaa291));import a119_0x2581f8 from'path';function a119_0x5b5b(){const _0x5f3b26=['12diwYQf','🚀\x20Next\x20Steps:','\x20model(s)','*\x20Pulling\x20API\x20configuration...','CLI\x20版本检查','项目创建完成:\x20','\x20|\x20AppCode:\x20','test','message','*\x20Configuring\x20AppCode\x20for\x20project\x20','log','\x20config\x20set\x20appcode\x20<app-code>\x27','4543eAaLIs','resolve','projectName','\x20&&\x20','production','green','string','env','existsSync','6687WmiGMD','utf8','\x20\x202.\x20Pull\x20API\x20configuration:\x20','error','join','description','\x20run\x20start','181186MSVbbg','配置应用AppCode失败','start','Project\x20name\x20cannot\x20be\x20empty','projectCode','6wpSGWF','723390ThYUCP','Format\x20code','1347492TuVUom','Copy\x20project\x20files','appCode','name','5556606ZwGKGS','rmSync','更新\x20package.json\x20name','length','Project\x20name:\x20','stableVersion','chdir','14990TArpgu','belowMinimum','bold','\x20Generated\x20by\x20rabetbase\x20cli\x20','\x20\x201.\x20Start\x20project:\x20','12984QDoytG','√\x20Pulled\x20','\x20dataset(s),\x20generated\x20','success','6211711qvqucB','√\x20Configuration\x20file\x20created,\x20Apps:\x20','更新\x20package.json\x20失败','\x20api\x20pull','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','needsUpgrade','parse','trim','\x20already\x20exists','1.0.0','version','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','minimumVersion','setLogPath','cd\x20','stringify','gray','create','API\x20configuration\x20pulled:\x20','cookie','清理项目目录失败:\x20','readFileSync','constants','dirname','toLocaleString','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','repeat','...','currentVersion','cwd','info','5EUkMmy','package.json','cyan','开始创建项目:\x20','fail'];a119_0x5b5b=function(){return _0x5f3b26;};return a119_0x5b5b();}import a119_0x304ce8 from'fs';import a119_0x117a6a from'chalk';import a119_0x4cbb86 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../api/fetch-model-list.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';function a119_0x4faa(_0x436082,_0x4b26b3){_0x436082=_0x436082-0x18d;const _0x5b5b55=a119_0x5b5b();let _0x4faa93=_0x5b5b55[_0x436082];return _0x4faa93;}import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0xfd99d6){const _0x441ce9=a119_0x4faa,_0x49ade9=await checkCliVersion();(_0x49ade9[_0x441ce9(0x1aa)]||_0x49ade9['belowMinimum'])&&(printCliUpgradeWarning(_0x49ade9),assertCliVersionSupported(_0x49ade9),logger[_0x441ce9(0x1c3)](_0x441ce9(0x1b6),_0x441ce9(0x1cd),{'currentVersion':_0x49ade9[_0x441ce9(0x1c1)],'stableVersion':_0x49ade9[_0x441ce9(0x19a)],'minimumVersion':_0x49ade9[_0x441ce9(0x1b1)],'needsUpgrade':_0x49ade9[_0x441ce9(0x1aa)],'belowMinimum':_0x49ade9[_0x441ce9(0x19d)]}));if(_0xfd99d6['projectCode']&&_0xfd99d6[_0x441ce9(0x193)])await runCreate({'projectName':_0xfd99d6['projectCode'],'appCode':_0xfd99d6[_0x441ce9(0x193)],'env':_0xfd99d6[_0x441ce9(0x1dc)]},_0xfd99d6);else{if(_0xfd99d6['projectCode']){const _0x3dd46a=await selectSingleAppcode(_0xfd99d6[_0x441ce9(0x1b8)]);await runCreate({'projectName':_0xfd99d6[_0x441ce9(0x18d)],'appCode':_0x3dd46a||undefined,'env':_0xfd99d6[_0x441ce9(0x1dc)]},_0xfd99d6);}else await guidedCreateProject(_0x57a9d7=>runCreate(_0x57a9d7,_0xfd99d6),_0xfd99d6[_0x441ce9(0x1dc)],_0xfd99d6[_0x441ce9(0x1b8)]);}}async function runCreate(_0x37d129,_0x1b68e5){const _0x3532d2=a119_0x4faa;if(!_0x37d129[_0x3532d2(0x1d7)]||_0x37d129[_0x3532d2(0x1d7)][_0x3532d2(0x1ac)]()==='')throw new Error(_0x3532d2(0x1e8));const _0x54a14d=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x54a14d[_0x3532d2(0x1d0)](_0x37d129[_0x3532d2(0x1d7)]))throw new Error('Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters');if(_0x37d129[_0x3532d2(0x1d7)][_0x3532d2(0x198)]>0x64)throw new Error('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters');const _0x21ee86=a119_0x2581f8['resolve'](process[_0x3532d2(0x1c2)](),_0x37d129[_0x3532d2(0x1d7)]);if(a119_0x304ce8[_0x3532d2(0x1dd)](_0x21ee86))throw new Error('Project\x20directory\x20'+_0x37d129[_0x3532d2(0x1d7)]+_0x3532d2(0x1ad));try{a119_0x304ce8['accessSync'](a119_0x2581f8[_0x3532d2(0x1bc)](_0x21ee86),a119_0x304ce8[_0x3532d2(0x1bb)]['W_OK']);}catch{throw new Error(_0x3532d2(0x1be));}logger[_0x3532d2(0x1b2)](_0x21ee86),logger[_0x3532d2(0x1c3)](_0x3532d2(0x1b6),_0x3532d2(0x1c7)+_0x37d129[_0x3532d2(0x1d7)],{'projectDir':_0x21ee86,'appCode':_0x37d129['appCode']}),console[_0x3532d2(0x1d3)](),console[_0x3532d2(0x1d3)](a119_0x117a6a[_0x3532d2(0x1da)]('\x20√\x20')+_0x3532d2(0x199)+a119_0x117a6a[_0x3532d2(0x1da)](_0x37d129[_0x3532d2(0x1d7)])+(_0x37d129['appCode']?_0x3532d2(0x1cf)+a119_0x117a6a['cyan'](_0x37d129[_0x3532d2(0x193)]):''));try{await runTask(_0x3532d2(0x192),()=>copyProjectTemplate(_0x37d129[_0x3532d2(0x1d7)])),await updatePackageJsonName(_0x37d129[_0x3532d2(0x1d7)]),await runTask('Install\x20dependencies',()=>installDependencies(_0x37d129['projectName'])),await runTask(_0x3532d2(0x190),()=>formatProjectCode(_0x37d129[_0x3532d2(0x1d7)])),await configureAppCode(_0x37d129[_0x3532d2(0x1d7)],_0x37d129['appCode']||'',_0x37d129[_0x3532d2(0x1dc)]);let _0xa667e8=![];if(_0x37d129['appCode']){console[_0x3532d2(0x1d3)](_0x3532d2(0x1cc));const _0x286e9c=process[_0x3532d2(0x1c2)]();try{process[_0x3532d2(0x19b)](_0x21ee86);const _0x1c6e32=_0x37d129[_0x3532d2(0x1dc)]||'production';initEnv(_0x1c6e32);const {configArray:_0x5b46af}=await fetchModelList(_0x37d129[_0x3532d2(0x193)],_0x1b68e5[_0x3532d2(0x1b8)]||''),_0x5e8218=DEFAULT_API_DIR,_0x5598a1=await generateApiFile(_0x5b46af,'',_0x37d129[_0x3532d2(0x193)],!![],_0x1c6e32,_0x5e8218);console[_0x3532d2(0x1d3)](_0x3532d2(0x1a2)+_0x5b46af[_0x3532d2(0x198)]+_0x3532d2(0x1a3)+_0x5598a1['modelCount']+_0x3532d2(0x1cb)),logger[_0x3532d2(0x1c3)](_0x3532d2(0x1b6),_0x3532d2(0x1b7)+_0x37d129['appCode']);}catch(_0x1a43b4){_0xa667e8=!![],console['log']('!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull'),logger['warn'](_0x3532d2(0x1b6),'API\x20配置拉取异常',{'error':_0x1a43b4 instanceof Error?_0x1a43b4[_0x3532d2(0x1d1)]:String(_0x1a43b4)});}finally{process[_0x3532d2(0x19b)](_0x286e9c);}}logger[_0x3532d2(0x1a4)](_0x3532d2(0x1b6),_0x3532d2(0x1ce)+_0x37d129[_0x3532d2(0x1d7)]),console['log'](),console[_0x3532d2(0x1d3)](a119_0x117a6a[_0x3532d2(0x1da)]('─'[_0x3532d2(0x1bf)](0x3c))),console[_0x3532d2(0x1d3)](a119_0x117a6a[_0x3532d2(0x1c6)]['bold'](_0x3532d2(0x1ca))),console['log'](),console[_0x3532d2(0x1d3)](_0x3532d2(0x1a0)+a119_0x117a6a[_0x3532d2(0x1c6)][_0x3532d2(0x19e)](_0x3532d2(0x1b3)+_0x37d129[_0x3532d2(0x1d7)]+_0x3532d2(0x1d8)+CLI_BIN_NAME+_0x3532d2(0x1e4))),_0xa667e8&&console[_0x3532d2(0x1d3)](_0x3532d2(0x1e0)+a119_0x117a6a['cyan'][_0x3532d2(0x19e)](CLI_BIN_NAME+_0x3532d2(0x1a8))),console[_0x3532d2(0x1d3)](a119_0x117a6a['green']('─'[_0x3532d2(0x1bf)](0x3c)));}catch(_0x55eb9d){logger[_0x3532d2(0x1e1)](_0x3532d2(0x1b6),'项目创建失败:\x20'+_0x37d129[_0x3532d2(0x1d7)],{'error':_0x55eb9d instanceof Error?_0x55eb9d['message']:String(_0x55eb9d)});try{a119_0x304ce8['existsSync'](_0x21ee86)&&(console['log'](_0x3532d2(0x1a9)+_0x21ee86),a119_0x304ce8[_0x3532d2(0x196)](_0x21ee86,{'recursive':!![],'force':!![]}));}catch{logger['warn'](_0x3532d2(0x1b6),_0x3532d2(0x1b9)+_0x21ee86);}throw _0x55eb9d;}}async function runTask(_0x598a69,_0x105063){const _0x29cbe6=a119_0x4faa,_0x36a976=a119_0x4cbb86(_0x598a69+_0x29cbe6(0x1c0))[_0x29cbe6(0x1e7)]();try{const _0x465322=await _0x105063();_0x36a976['stop'](),console[_0x29cbe6(0x1d3)](''+a119_0x117a6a[_0x29cbe6(0x1da)]('\x20√\x20')+_0x598a69+'\x20'+a119_0x117a6a[_0x29cbe6(0x1b5)]('['+_0x465322+']'));}catch(_0x2dd558){_0x36a976[_0x29cbe6(0x1c8)](_0x598a69);throw _0x2dd558;}}async function updatePackageJsonName(_0x383d49){const _0x57198c=a119_0x4faa,_0x5225f0=a119_0x2581f8[_0x57198c(0x1d6)](process['cwd'](),_0x383d49),_0x4d4b3f=a119_0x2581f8[_0x57198c(0x1e2)](_0x5225f0,_0x57198c(0x1c5));try{console[_0x57198c(0x1d3)]('*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields');const _0x19e67f=getRabetbaseCliPackageRoot(),_0x1ffcab=a119_0x2581f8[_0x57198c(0x1e2)](_0x19e67f,_0x57198c(0x1c5));let _0x1f3d60=_0x57198c(0x1ae);try{const _0x47e13f=JSON[_0x57198c(0x1ab)](a119_0x304ce8[_0x57198c(0x1ba)](_0x1ffcab,'utf8'));_0x1f3d60=_0x47e13f[_0x57198c(0x1af)]||_0x57198c(0x1ae);}catch{}const _0x1cc9f2=a119_0x304ce8[_0x57198c(0x1ba)](_0x4d4b3f,_0x57198c(0x1df)),_0x129e34=JSON[_0x57198c(0x1ab)](_0x1cc9f2);_0x129e34[_0x57198c(0x194)]=_0x383d49,_0x129e34[_0x57198c(0x1e3)]=_0x383d49+_0x57198c(0x19f)+_0x1f3d60,a119_0x304ce8['writeFileSync'](_0x4d4b3f,JSON[_0x57198c(0x1b4)](_0x129e34,null,0x2)+'\x0a','utf8'),console[_0x57198c(0x1d3)]('√\x20package.json\x20updated:\x20name='+_0x383d49),logger[_0x57198c(0x1c3)](_0x57198c(0x1b6),_0x57198c(0x197));}catch(_0xc91ebf){logger[_0x57198c(0x1e1)](_0x57198c(0x1b6),_0x57198c(0x1a7));throw _0xc91ebf;}}async function configureAppCode(_0x35bae4,_0x573b95,_0x5bb0fb){const _0x5c2dd9=a119_0x4faa,_0xccb99=a119_0x2581f8[_0x5c2dd9(0x1d6)](process[_0x5c2dd9(0x1c2)](),_0x35bae4),_0x1cdba4=a119_0x2581f8['join'](_0xccb99,NEW_CONFIG_NAME);try{_0x573b95?console[_0x5c2dd9(0x1d3)](_0x5c2dd9(0x1d2)+_0x35bae4+':\x20'+_0x573b95):console[_0x5c2dd9(0x1d3)](_0x5c2dd9(0x1b0)+_0x35bae4);const _0x30881e=getRabetbaseCliPackageRoot(),_0x2b1d09=a119_0x2581f8[_0x5c2dd9(0x1e2)](_0x30881e,'package.json');let _0x1901c0='1.0.0';try{const _0x28da7b=JSON[_0x5c2dd9(0x1ab)](a119_0x304ce8[_0x5c2dd9(0x1ba)](_0x2b1d09,_0x5c2dd9(0x1df)));_0x1901c0=_0x28da7b[_0x5c2dd9(0x1af)]||_0x5c2dd9(0x1ae);}catch{}const _0x31f956=readConfig(),_0x24904e=typeof _0x31f956[_0x5c2dd9(0x1dc)]===_0x5c2dd9(0x1db)?_0x31f956[_0x5c2dd9(0x1dc)]:undefined,_0x26a023={};for(const _0x4b192a of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x31f956[_0x4b192a]!=null)_0x26a023[_0x4b192a]=_0x31f956[_0x4b192a];}const _0x1dda7c=buildCanonicalProjectConfig(_0x26a023,{'appCodes':_0x573b95?[_0x573b95]:[],'env':_0x5bb0fb||_0x24904e||_0x5c2dd9(0x1d9),'metadata':{'createdAt':new Date()[_0x5c2dd9(0x1bd)](),'version':_0x1901c0}});writeConfigFile(_0x1cdba4,_0x1dda7c),_0x573b95?console[_0x5c2dd9(0x1d3)](_0x5c2dd9(0x1a6)+Object['keys'](_0x1dda7c['apps']||{})[_0x5c2dd9(0x1e2)](',\x20')+'\x20|\x20Default:\x20'+_0x1dda7c['defaultApp']):console[_0x5c2dd9(0x1d3)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+_0x5c2dd9(0x1d4)),logger[_0x5c2dd9(0x1c3)](_0x5c2dd9(0x1b6),'配置应用AppCode:\x20'+_0x573b95);}catch(_0x48c093){logger[_0x5c2dd9(0x1e1)](_0x5c2dd9(0x1b6),_0x5c2dd9(0x1e6));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2412cc,_0x5c1be5){const _0x523dbf=a120_0x508e,_0x2efde0=_0x2412cc();while(!![]){try{const _0x2f2897=-parseInt(_0x523dbf(0x1bc))/0x1+-parseInt(_0x523dbf(0x1e2))/0x2+-parseInt(_0x523dbf(0x1b8))/0x3+parseInt(_0x523dbf(0x1de))/0x4+-parseInt(_0x523dbf(0x1be))/0x5*(-parseInt(_0x523dbf(0x1b9))/0x6)+-parseInt(_0x523dbf(0x1c4))/0x7*(parseInt(_0x523dbf(0x1c9))/0x8)+-parseInt(_0x523dbf(0x1b3))/0x9*(-parseInt(_0x523dbf(0x1e0))/0xa);if(_0x2f2897===_0x5c1be5)break;else _0x2efde0['push'](_0x2efde0['shift']());}catch(_0x16bce6){_0x2efde0['push'](_0x2efde0['shift']());}}}(a120_0x2ab0,0xb2c24));import a120_0x5645dc from'path';import a120_0x360ce6 from'fs/promises';function a120_0x508e(_0x574174,_0x60e853){_0x574174=_0x574174-0x1b2;const _0x2ab08a=a120_0x2ab0();let _0x508e65=_0x2ab08a[_0x574174];return _0x508e65;}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';function a120_0x2ab0(){const _0x215e10=['W_OK','Cannot\x20create\x20project\x20in\x20current\x20directory.','\x22\x20already\x20exists.','trim','1359009StFVUM','1767462GLQdHs','Project\x20name\x20cannot\x20be\x20empty.','log','1388817jxzORB','validation','15VIKnaM','resolve','\x20\x20√\x20Pulled\x20','parse','join','package.json','190519JJxUSW','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','needsUpgrade','ignore','336dacwNk','\x20model(s)','constants','string','bun','dirname','\x20created\x20successfully!','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','name','\x0a√\x20Project\x20','length','npm','stringify','utf-8','\x20\x20√\x20Configuration\x20file\x20created','cwd','\x20\x20√\x20Project\x20template\x20created','bun\x20--version','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','\x20\x20rabetbase\x20run\x20start\x0a','*\x20Creating\x20project\x20','3144884jdhTLd','\x0a\x20\x20cd\x20','110Siamdd','\x20dataset(s),\x20generated\x20','2383830SYwZDv','\x20\x20√\x20package.json\x20updated','\x20api\x20pull`\x20manually\x20later.','\x20\x20Installing\x20dependencies...','belowMinimum','modelCount','...','toLocaleString','production','readFile','description','env','access','2650167mubJPx'];a120_0x2ab0=function(){return _0x215e10;};return a120_0x2ab0();}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(_0x2b387b,_0x3a3372,_0x2c0195,_0x19ee7d){const _0x3dd06c=a120_0x508e,_0x23b36f=await checkCliVersion();(_0x23b36f[_0x3dd06c(0x1c7)]||_0x23b36f[_0x3dd06c(0x1e6)])&&(printCliUpgradeWarning(_0x23b36f),assertCliVersionSupported(_0x23b36f));if(!_0x2b387b||_0x2b387b[_0x3dd06c(0x1b7)]()==='')throw CliErrors[_0x3dd06c(0x1bd)](_0x3dd06c(0x1ba));const _0x2a8cde=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x2a8cde['test'](_0x2b387b))throw CliErrors[_0x3dd06c(0x1bd)]('Project\x20name\x20contains\x20invalid\x20characters.',_0x3dd06c(0x1d0));if(_0x2b387b[_0x3dd06c(0x1d3)]>0x64)throw CliErrors[_0x3dd06c(0x1bd)](_0x3dd06c(0x1db));const _0x3303c2=a120_0x5645dc[_0x3dd06c(0x1bf)](process['cwd'](),_0x2b387b);if(existsSync(_0x3303c2))throw CliErrors[_0x3dd06c(0x1bd)]('Project\x20directory\x20\x22'+_0x2b387b+_0x3dd06c(0x1b6),'Use\x20a\x20different\x20project\x20name.');try{const _0x434fb1=a120_0x5645dc[_0x3dd06c(0x1ce)](_0x3303c2);await a120_0x360ce6[_0x3dd06c(0x1b2)](_0x434fb1,a120_0x360ce6[_0x3dd06c(0x1cb)][_0x3dd06c(0x1b4)]);}catch{throw CliErrors[_0x3dd06c(0x1bd)](_0x3dd06c(0x1b5),'Check\x20directory\x20permissions.');}try{console['log'](_0x3dd06c(0x1dd)+_0x2b387b+_0x3dd06c(0x1e8));const _0x4bd1b6=getSubAppReactDemoTemplateDir();await copyDirectory(_0x4bd1b6,_0x3303c2),console[_0x3dd06c(0x1bb)](_0x3dd06c(0x1d9)),await updatePackageJsonName(_0x2b387b),console[_0x3dd06c(0x1bb)](_0x3dd06c(0x1e3)),console[_0x3dd06c(0x1bb)](_0x3dd06c(0x1e5)),console[_0x3dd06c(0x1bb)]('\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)'),await formatCode(_0x3303c2),console['log']('\x20\x20√\x20Code\x20formatted'),await configureProject(_0x2b387b,_0x2c0195,_0x3a3372),console[_0x3dd06c(0x1bb)](_0x3dd06c(0x1d7)),_0x2c0195&&await pullApiConfig(_0x3303c2,_0x2c0195,_0x3a3372,_0x19ee7d),console[_0x3dd06c(0x1bb)](_0x3dd06c(0x1d2)+_0x2b387b+_0x3dd06c(0x1cf)),console[_0x3dd06c(0x1bb)](_0x3dd06c(0x1df)+_0x2b387b),console['log'](_0x3dd06c(0x1dc));}catch(_0x275f3f){try{existsSync(_0x3303c2)&&await a120_0x360ce6['rm'](_0x3303c2,{'recursive':!![],'force':!![]});}catch{}throw _0x275f3f;}}async function updatePackageJsonName(_0x35d762){const _0x4d16d0=a120_0x508e,_0x2283b6=a120_0x5645dc['resolve'](process['cwd'](),_0x35d762),_0x2e9705=a120_0x5645dc[_0x4d16d0(0x1c2)](_0x2283b6,_0x4d16d0(0x1c3)),_0x4e2dcd=await a120_0x360ce6[_0x4d16d0(0x1eb)](_0x2e9705,_0x4d16d0(0x1d6)),_0x3962e5=JSON[_0x4d16d0(0x1c1)](_0x4e2dcd);_0x3962e5[_0x4d16d0(0x1d1)]=_0x35d762,_0x3962e5[_0x4d16d0(0x1ec)]=_0x4d16d0(0x1c5),await a120_0x360ce6['writeFile'](_0x2e9705,JSON[_0x4d16d0(0x1d5)](_0x3962e5,null,0x2)+'\x0a');}function detectPackageManager(){const _0x2eb9fd=a120_0x508e;try{return execSync(_0x2eb9fd(0x1da),{'stdio':_0x2eb9fd(0x1c8)}),_0x2eb9fd(0x1cd);}catch{return _0x2eb9fd(0x1d4);}}async function formatCode(_0x47e35d){try{await execAsync('bun\x20run\x20format',{'cwd':_0x47e35d});}catch{}}async function configureProject(_0x45608c,_0x4df499,_0x59ca9f){const _0x20e3de=a120_0x508e,_0x4031e3=a120_0x5645dc[_0x20e3de(0x1bf)](process[_0x20e3de(0x1d8)](),_0x45608c),_0x36cb94=a120_0x5645dc[_0x20e3de(0x1c2)](_0x4031e3,NEW_CONFIG_NAME),_0x323525=readConfig(),_0x5a1259=typeof _0x323525[_0x20e3de(0x1ed)]===_0x20e3de(0x1cc)?_0x323525[_0x20e3de(0x1ed)]:undefined,_0x29d739={};for(const _0x515552 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x323525[_0x515552]!=null)_0x29d739[_0x515552]=_0x323525[_0x515552];}const _0x5ecbef=buildCanonicalProjectConfig(_0x29d739,{'appCodes':_0x4df499?[_0x4df499]:[],'env':_0x59ca9f||_0x5a1259||_0x20e3de(0x1ea),'metadata':{'createdAt':new Date()[_0x20e3de(0x1e9)](),'version':getCliVersion()}});writeConfigFile(_0x36cb94,_0x5ecbef);}async function pullApiConfig(_0x616c78,_0x1ce323,_0x2e007a,_0x5c5ab9){const _0x1316f3=a120_0x508e,_0x23f7d4=process['cwd']();try{process['chdir'](_0x616c78);const _0x15c79b=_0x2e007a||'production';initEnv(_0x15c79b),console[_0x1316f3(0x1bb)]('\x20\x20Pulling\x20API\x20configuration...');const {configArray:_0x33535a}=await fetchModelList(_0x1ce323,_0x5c5ab9||''),_0xc4de8a=await generateApiFile(_0x33535a,'',_0x1ce323,!![],_0x15c79b,DEFAULT_API_DIR);console['log'](_0x1316f3(0x1c0)+_0x33535a[_0x1316f3(0x1d3)]+_0x1316f3(0x1e1)+_0xc4de8a[_0x1316f3(0x1e7)]+_0x1316f3(0x1ca));}catch(_0x4e001b){console[_0x1316f3(0x1bb)](_0x1316f3(0x1c6)+CLI_BIN_NAME+_0x1316f3(0x1e4));}finally{process['chdir'](_0x23f7d4);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a121_0x2d0b48=a121_0x3c79;(function(_0xf60b90,_0x1edf1d){const _0x578aa7=a121_0x3c79,_0x152564=_0xf60b90();while(!![]){try{const _0x112cc1=-parseInt(_0x578aa7(0x144))/0x1+-parseInt(_0x578aa7(0x142))/0x2+-parseInt(_0x578aa7(0x148))/0x3*(-parseInt(_0x578aa7(0x150))/0x4)+-parseInt(_0x578aa7(0x143))/0x5+-parseInt(_0x578aa7(0x14d))/0x6+-parseInt(_0x578aa7(0x146))/0x7*(parseInt(_0x578aa7(0x14c))/0x8)+parseInt(_0x578aa7(0x149))/0x9*(parseInt(_0x578aa7(0x145))/0xa);if(_0x112cc1===_0x1edf1d)break;else _0x152564['push'](_0x152564['shift']());}catch(_0x2f0767){_0x152564['push'](_0x152564['shift']());}}}(a121_0x35e9,0x3318c));function a121_0x35e9(){const _0x57bc7d=['261591PBGVad','35019ttRceT','resolve','dirname','8AWlKNI','642264amcbLl','sub-app-react-demo','projects','16hfxQLA','templates','690062rdQwPy','1167510pZjJQX','190826oyCCMp','2540ijcsAu','1759849lShhFR','join'];a121_0x35e9=function(){return _0x57bc7d;};return a121_0x35e9();}function a121_0x3c79(_0x4fd775,_0x17a2a2){_0x4fd775=_0x4fd775-0x142;const _0x35e98c=a121_0x35e9();let _0x3c7966=_0x35e98c[_0x4fd775];return _0x3c7966;}import a121_0xd6e23f from'node:path';import{fileURLToPath}from'node:url';const __dirname=a121_0xd6e23f[a121_0x2d0b48(0x14b)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x219984=a121_0x2d0b48;return a121_0xd6e23f[_0x219984(0x14a)](__dirname,'../../../../');}export function getSubAppReactDemoTemplateDir(){const _0x5228f6=a121_0x2d0b48;return a121_0xd6e23f[_0x5228f6(0x147)](getRabetbaseCliPackageRoot(),_0x5228f6(0x151),_0x5228f6(0x14f),_0x5228f6(0x14e));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a122_0x41a4(_0x1d7d38,_0x48b58d){_0x1d7d38=_0x1d7d38-0x1d3;const _0xbff4ee=a122_0xbff4();let _0x41a42b=_0xbff4ee[_0x1d7d38];return _0x41a42b;}(function(_0x16f61c,_0x4b4511){const _0x352e13=a122_0x41a4,_0xbb9855=_0x16f61c();while(!![]){try{const _0x4d86e6=parseInt(_0x352e13(0x1de))/0x1*(parseInt(_0x352e13(0x1e0))/0x2)+-parseInt(_0x352e13(0x1e6))/0x3+-parseInt(_0x352e13(0x1db))/0x4+-parseInt(_0x352e13(0x1dd))/0x5*(parseInt(_0x352e13(0x1e5))/0x6)+parseInt(_0x352e13(0x1e1))/0x7+-parseInt(_0x352e13(0x1d8))/0x8+parseInt(_0x352e13(0x1d5))/0x9*(parseInt(_0x352e13(0x1d3))/0xa);if(_0x4d86e6===_0x4b4511)break;else _0xbb9855['push'](_0xbb9855['shift']());}catch(_0x2a98fd){_0xbb9855['push'](_0xbb9855['shift']());}}}(a122_0xbff4,0xd54c7));import a122_0x4c071f from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a122_0xbff4(){const _0x49756b=['49FWeWsa','error','64426wtyeNX','8141945fmHWJP','开始复制项目模板','message','项目模板复制完成','8286xSujws','5045919xTeRPp','success','5310taqSCI','项目模板复制失败','40347BfPWpN','resolve','copy','8138384vjiRLp','info','cwd','5417528pMIGRR','now','705FJKstS'];a122_0xbff4=function(){return _0x49756b;};return a122_0xbff4();}import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x27a44e){const _0x13d1f6=a122_0x41a4,_0x1dcbcb=Date[_0x13d1f6(0x1dc)](),_0xdb8447=a122_0x4c071f[_0x13d1f6(0x1d6)](process[_0x13d1f6(0x1da)](),_0x27a44e);try{logger[_0x13d1f6(0x1d9)](_0x13d1f6(0x1d7),_0x13d1f6(0x1e2),{'projectCode':_0x27a44e,'templateDir':templateDir}),await copyDirectory(templateDir,_0xdb8447);const _0x3ace0b=Date[_0x13d1f6(0x1dc)]()-_0x1dcbcb;logger[_0x13d1f6(0x1e7)]('copy',_0x13d1f6(0x1e4),_0x3ace0b,{'projectCode':_0x27a44e});}catch(_0x316557){const _0x54ab7b=Date[_0x13d1f6(0x1dc)]()-_0x1dcbcb;logger[_0x13d1f6(0x1df)](_0x13d1f6(0x1d7),_0x13d1f6(0x1d4),{'projectCode':_0x27a44e,'error':_0x316557 instanceof Error?_0x316557[_0x13d1f6(0x1e3)]:String(_0x316557),'duration':_0x54ab7b});throw _0x316557;}return formatElapsed(_0x1dcbcb);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xf65638,_0x38bc33){const _0xcc322a=a123_0x27c7,_0x16c866=_0xf65638();while(!![]){try{const _0x57b28b=-parseInt(_0xcc322a(0xc2))/0x1+-parseInt(_0xcc322a(0xd5))/0x2+parseInt(_0xcc322a(0xcf))/0x3+parseInt(_0xcc322a(0xc8))/0x4*(parseInt(_0xcc322a(0xbe))/0x5)+parseInt(_0xcc322a(0xc6))/0x6*(-parseInt(_0xcc322a(0xc1))/0x7)+parseInt(_0xcc322a(0xd2))/0x8*(parseInt(_0xcc322a(0xd4))/0x9)+parseInt(_0xcc322a(0xcc))/0xa*(parseInt(_0xcc322a(0xd3))/0xb);if(_0x57b28b===_0x38bc33)break;else _0x16c866['push'](_0x16c866['shift']());}catch(_0x2c6a16){_0x16c866['push'](_0x16c866['shift']());}}}(a123_0x1b75,0x5b8d4));import a123_0x2f6185 from'node:path';function a123_0x27c7(_0xda695e,_0x1635c6){_0xda695e=_0xda695e-0xbe;const _0x1b750f=a123_0x1b75();let _0x27c772=_0x1b750f[_0xda695e];return _0x27c772;}import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x437e7b){const _0xf54b5b=a123_0x27c7,_0x177575=Date[_0xf54b5b(0xc9)](),_0x2a37a8=a123_0x2f6185[_0xf54b5b(0xc3)](process[_0xf54b5b(0xcb)](),_0x437e7b);try{logger[_0xf54b5b(0xce)](_0xf54b5b(0xcd),'开始格式化代码',{'projectCode':_0x437e7b}),await execa(resolveNpmBin(_0xf54b5b(0xc7)),[_0xf54b5b(0xd1),_0xf54b5b(0xbf),'.'],{'cwd':_0x2a37a8});const _0x314d96=Date[_0xf54b5b(0xc9)]()-_0x177575;logger[_0xf54b5b(0xd0)]('format',_0xf54b5b(0xc0),_0x314d96,{'projectCode':_0x437e7b});}catch(_0x56b61e){const _0x234e1e=Date[_0xf54b5b(0xc9)]()-_0x177575;logger[_0xf54b5b(0xca)](_0xf54b5b(0xcd),_0xf54b5b(0xc4),{'projectCode':_0x437e7b,'error':_0x56b61e instanceof Error?_0x56b61e[_0xf54b5b(0xc5)]:String(_0x56b61e),'duration':_0x234e1e});throw _0x56b61e;}return formatElapsed(_0x177575);}function a123_0x1b75(){const _0x4db082=['format','info','1175832vDRRYG','success','prettier','1032008gebwkI','19129gzbyMN','45bJaYQR','702488FevRmJ','955pcqHrR','--write','代码格式化完成','428911shcuqU','583876uCpqIv','resolve','代码格式化失败','message','66BUUzuf','npx','9748BTuzxs','now','error','cwd','2770KehNVh'];a123_0x1b75=function(){return _0x4db082;};return a123_0x1b75();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3303d8,_0x125bfe){const _0x1ac8b2=a124_0x3458,_0xdde244=_0x3303d8();while(!![]){try{const _0x4684b1=parseInt(_0x1ac8b2(0x1a5))/0x1*(parseInt(_0x1ac8b2(0x1b2))/0x2)+parseInt(_0x1ac8b2(0x1aa))/0x3+parseInt(_0x1ac8b2(0x1a7))/0x4*(-parseInt(_0x1ac8b2(0x19f))/0x5)+-parseInt(_0x1ac8b2(0x1a9))/0x6*(parseInt(_0x1ac8b2(0x1a6))/0x7)+-parseInt(_0x1ac8b2(0x1b1))/0x8*(-parseInt(_0x1ac8b2(0x1a0))/0x9)+-parseInt(_0x1ac8b2(0x1a8))/0xa+parseInt(_0x1ac8b2(0x1ab))/0xb;if(_0x4684b1===_0x125bfe)break;else _0xdde244['push'](_0xdde244['shift']());}catch(_0x14a024){_0xdde244['push'](_0xdde244['shift']());}}}(a124_0x506d,0x7adea));import a124_0x504d80 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';function a124_0x3458(_0x9e5762,_0xf99bd9){_0x9e5762=_0x9e5762-0x19d;const _0x506db3=a124_0x506d();let _0x3458d8=_0x506db3[_0x9e5762];return _0x3458d8;}function a124_0x506d(){const _0x290880=['5774945Wsglcw','install','error','依赖安装失败','resolve','success','750072bRUgSB','704138ihXcvX','info','https://registry.npmmirror.com','7035TRYVLm','27JsSonY','开始安装依赖','now','npm','message','1aERAeR','7EYQknJ','708MsSFpv','2959330mSqEkV','3986616JxnSVw','1663023mGiIqJ'];a124_0x506d=function(){return _0x290880;};return a124_0x506d();}export async function installDependencies(_0x37303a){const _0x400b0f=a124_0x3458,_0x4ae6ca=Date[_0x400b0f(0x1a2)](),_0x50ed28=a124_0x504d80[_0x400b0f(0x1af)](process['cwd'](),_0x37303a);try{logger[_0x400b0f(0x19d)](_0x400b0f(0x1ac),_0x400b0f(0x1a1),{'projectCode':_0x37303a,'registry':_0x400b0f(0x19e)}),await execa(resolveNpmBin(_0x400b0f(0x1a3)),[_0x400b0f(0x1ac),'--registry','https://registry.npmmirror.com'],{'cwd':_0x50ed28});const _0x345092=Date[_0x400b0f(0x1a2)]()-_0x4ae6ca;logger[_0x400b0f(0x1b0)](_0x400b0f(0x1ac),'依赖安装完成',_0x345092,{'projectCode':_0x37303a});}catch(_0x432da1){const _0xe8798c=Date[_0x400b0f(0x1a2)]()-_0x4ae6ca;logger[_0x400b0f(0x1ad)](_0x400b0f(0x1ac),_0x400b0f(0x1ae),{'projectCode':_0x37303a,'error':_0x432da1 instanceof Error?_0x432da1[_0x400b0f(0x1a4)]:String(_0x432da1),'duration':_0xe8798c});throw _0x432da1;}return formatElapsed(_0x4ae6ca);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a125_0x3387(_0x73f4af,_0x533035){_0x73f4af=_0x73f4af-0x1bc;const _0x35f1dd=a125_0x35f1();let _0x3387b9=_0x35f1dd[_0x73f4af];return _0x3387b9;}const a125_0x52dbde=a125_0x3387;(function(_0x12248c,_0x45ef84){const _0x4cc54c=a125_0x3387,_0x51f5a0=_0x12248c();while(!![]){try{const _0x34c841=parseInt(_0x4cc54c(0x1dd))/0x1*(parseInt(_0x4cc54c(0x1c2))/0x2)+-parseInt(_0x4cc54c(0x1c8))/0x3+parseInt(_0x4cc54c(0x1c3))/0x4*(-parseInt(_0x4cc54c(0x1d0))/0x5)+parseInt(_0x4cc54c(0x1d6))/0x6+parseInt(_0x4cc54c(0x1c1))/0x7+-parseInt(_0x4cc54c(0x1de))/0x8+parseInt(_0x4cc54c(0x1df))/0x9;if(_0x34c841===_0x45ef84)break;else _0x51f5a0['push'](_0x51f5a0['shift']());}catch(_0x271bae){_0x51f5a0['push'](_0x51f5a0['shift']());}}}(a125_0x35f1,0xee5ea));function a125_0x35f1(){const _0x432dd8=['bool','../../commands/project/create/main.js','1436556jmFCjp','Create\x20a\x20new\x20project','trim','Skip\x20confirmation\x20prompt','args','nonInteractive','project','5ZXiBUy','5682512ixItyG','21883932Tfbcdo','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','Auto-confirm\x20prompts','Usage:\x20','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','init','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','boolean','7770000sTHWmb','350228tPqJyi','5837424bbujkD','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','upgrade','write','appcode','4531536yRWoJR','project-name','string','../../commands/project/create/non-interactive.js','env','Target\x20environment','Project\x20name','yes','5vASVNO','cookie','str','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli'];a125_0x35f1=function(){return _0x432dd8;};return a125_0x35f1();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';const initFlags=[{'name':a125_0x52dbde(0x1c7),'type':a125_0x52dbde(0x1ca),'description':'App\x20code\x20to\x20initialize'},{'name':a125_0x52dbde(0x1cc),'type':a125_0x52dbde(0x1ca),'description':a125_0x52dbde(0x1cd)},{'name':a125_0x52dbde(0x1cf),'type':'boolean','description':a125_0x52dbde(0x1e1),'default':![]}],createFlags=[{'name':'name','type':a125_0x52dbde(0x1ca),'description':a125_0x52dbde(0x1ce)},{'name':'env','type':'string','description':a125_0x52dbde(0x1cd)},{'name':a125_0x52dbde(0x1c7),'type':a125_0x52dbde(0x1ca),'description':a125_0x52dbde(0x1bd)}],upgradeFlags=[{'name':a125_0x52dbde(0x1cf),'type':a125_0x52dbde(0x1c0),'description':a125_0x52dbde(0x1d9),'default':![]}];export const projectDefinitions=[{'service':'project','command':a125_0x52dbde(0x1be),'description':'Initialize\x20.rabetbase.json\x20config\x20in\x20existing\x20project','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initFlags,async 'execute'(_0x2182ab){const _0x5ea919=a125_0x52dbde;return await initConfig({'appcode':_0x2182ab[_0x5ea919(0x1d2)]('appcode')||undefined,'env':_0x2182ab['str'](_0x5ea919(0x1cc))||undefined,'autoYes':_0x2182ab['bool'](_0x5ea919(0x1cf))}),{'ok':!![]};}},{'service':a125_0x52dbde(0x1dc),'command':'create','description':a125_0x52dbde(0x1d7),'risk':a125_0x52dbde(0x1c6),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a125_0x52dbde(0x1c9),'description':a125_0x52dbde(0x1c4),'required':![]}],'flags':createFlags,async 'execute'(_0x4841e5){const _0xfedbc4=a125_0x52dbde,{createApp:_0x308c43}=await import(_0xfedbc4(0x1d5)),{createProjectNonInteractive:_0xd156a8}=await import(_0xfedbc4(0x1cb)),_0x2fd68e=_0x4841e5[_0xfedbc4(0x1d2)]('name')[_0xfedbc4(0x1d8)]()||_0x4841e5[_0xfedbc4(0x1da)][0x0]?.[_0xfedbc4(0x1d8)](),_0x1736b1=_0x4841e5[_0xfedbc4(0x1d2)](_0xfedbc4(0x1cc))||undefined,_0xbb95ed=_0x4841e5[_0xfedbc4(0x1d2)](_0xfedbc4(0x1c7))||undefined;if(_0x4841e5[_0xfedbc4(0x1db)]){if(!_0x2fd68e)throw CliErrors['validation'](_0xfedbc4(0x1bf),_0xfedbc4(0x1bc)+CLI_BIN_NAME+_0xfedbc4(0x1e0));await _0xd156a8(_0x2fd68e,_0x1736b1,_0xbb95ed,_0x4841e5[_0xfedbc4(0x1d1)]);}else await _0x308c43({'projectCode':_0x2fd68e,'appCode':_0xbb95ed,'env':_0x1736b1,'cookie':_0x4841e5[_0xfedbc4(0x1d1)]});return{'ok':!![]};}},{'service':a125_0x52dbde(0x1dc),'command':a125_0x52dbde(0x1c5),'description':a125_0x52dbde(0x1d3),'risk':a125_0x52dbde(0x1c6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x3b3dc4){const _0x42ec4c=a125_0x52dbde;return await upgradeApp(_0x3b3dc4['nonInteractive'],{'yes':_0x3b3dc4[_0x42ec4c(0x1d4)](_0x42ec4c(0x1cf))}),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x139793,_0x2400e4){const _0x3db2e8=a126_0x1a92,_0x188aa2=_0x139793();while(!![]){try{const _0x1e3a68=parseInt(_0x3db2e8(0x129))/0x1+parseInt(_0x3db2e8(0x145))/0x2*(parseInt(_0x3db2e8(0x143))/0x3)+parseInt(_0x3db2e8(0x13b))/0x4+-parseInt(_0x3db2e8(0x112))/0x5*(parseInt(_0x3db2e8(0x12c))/0x6)+-parseInt(_0x3db2e8(0x134))/0x7*(parseInt(_0x3db2e8(0x12b))/0x8)+parseInt(_0x3db2e8(0x147))/0x9+-parseInt(_0x3db2e8(0x130))/0xa*(-parseInt(_0x3db2e8(0x127))/0xb);if(_0x1e3a68===_0x2400e4)break;else _0x188aa2['push'](_0x188aa2['shift']());}catch(_0x588df1){_0x188aa2['push'](_0x188aa2['shift']());}}}(a126_0x1ab6,0x42bd0));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';function a126_0x1a92(_0x485b57,_0x2faf76){_0x485b57=_0x485b57-0x10f;const _0x1ab602=a126_0x1ab6();let _0x1a922f=_0x1ab602[_0x485b57];return _0x1a922f;}import{fileURLToPath}from'node:url';import a126_0x3f1950 from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';function a126_0x1ab6(){const _0x53886e=['.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','1.0.0','join','\x20api\x20pull\x27','cwd','62572RCGiVX','\x20project\x20init`\x20to\x20start\x20fresh.','.rabetbase.json','\x20→\x20.rabetbase.json','production','App\x20Code\x20cannot\x20be\x20empty','yellow','app','4785LwDRFG','.bak','4bmbjhJ','初始化项目配置文件成功','1142046dFZDvz','Invalid\x20App\x20Code','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','gray','65TBVERr','从旧配置文件升级成功','log','keys','green','\x20\x20appcode:\x20','Upgrade\x20it\x20to\x20','info','appcode','init','\x20api\x20generate\x27\x20and\x20\x27','\x20\x20Apps:\x20','✓\x20Upgraded\x20','toLocaleString','parse','?\x20(Old\x20file\x20→\x20*.bak)','defaultApp','../..','string','version','setLogPath','2875114pcMRkU','trim','318422msPDXC','apps','2156104ZqEwow','84300jkGLsO','Please\x20enter\x20App\x20Code:','\x20\x20Default:\x20','cyan','10HxEbpd','package.json','env','utf8','7FFvGwQ','\x20\x20Old\x20file\x20backed\x20up\x20as\x20'];a126_0x1ab6=function(){return _0x53886e;};return a126_0x1ab6();}import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x559e39){const _0x323b21=a126_0x1a92,{appcode:_0x5b7a5b,env:_0x1623aa,autoYes:_0x15a1da}=_0x559e39,_0x53a9b2=process[_0x323b21(0x13a)]();if(getProjectConfigPath())throw new Error(_0x323b21(0x136));let _0x484c9f;for(const _0x1ca55a of LEGACY_CONFIG_NAMES){const _0xa9e3d1=resolve(_0x53a9b2,_0x1ca55a);if(existsSync(_0xa9e3d1)){_0x484c9f=_0xa9e3d1;break;}}if(_0x484c9f){let _0x472ae0={};try{_0x472ae0=JSON[_0x323b21(0x120)](readFileSync(_0x484c9f,'utf8'));}catch{}const _0x11c815=basename(_0x484c9f),_0x28b6cb=_0x472ae0?.[_0x323b21(0x11a)]||_0x472ae0?.[_0x323b21(0x142)];let _0x122617=_0x15a1da;!_0x15a1da&&(console[_0x323b21(0x114)](a126_0x3f1950[_0x323b21(0x141)](_0x323b21(0x110)+a126_0x3f1950['bold'](_0x11c815))),_0x28b6cb&&console[_0x323b21(0x114)](a126_0x3f1950[_0x323b21(0x12f)](_0x323b21(0x117)+_0x28b6cb)),_0x122617=await confirm({'message':_0x323b21(0x118)+a126_0x3f1950['bold'](_0x323b21(0x13d))+_0x323b21(0x121),'default':!![]}));if(!_0x122617){console[_0x323b21(0x114)]('Migration\x20cancelled.\x20Run\x20`'+CLI_BIN_NAME+_0x323b21(0x13c));return;}const _0x20d5bc=resolve(_0x53a9b2,NEW_CONFIG_NAME),_0x56bb3d=getCliVersionFromPkg(),_0x58e72f=readRawConfig(),_0x3a6e80=_0x5b7a5b||(typeof _0x472ae0?.[_0x323b21(0x11a)]===_0x323b21(0x124)?_0x472ae0[_0x323b21(0x11a)]:undefined)||(typeof _0x472ae0?.[_0x323b21(0x142)]==='string'?_0x472ae0[_0x323b21(0x142)]:undefined)||await askAppcode(),_0x3a6107=typeof _0x472ae0?.[_0x323b21(0x132)]===_0x323b21(0x124)?_0x472ae0['env']:typeof _0x58e72f[_0x323b21(0x132)]==='string'?_0x58e72f['env']:_0x323b21(0x13f),_0x115600=buildCanonicalProjectConfig({..._0x58e72f,..._0x472ae0},{'appCodes':[_0x3a6e80],'env':_0x3a6107,'metadata':{'version':_0x56bb3d,'migratedAt':new Date()[_0x323b21(0x11f)](),'migratedFrom':_0x484c9f}});writeConfigFile(_0x20d5bc,_0x115600);const _0x5cb3b6=_0x484c9f+_0x323b21(0x144);renameSync(_0x484c9f,_0x5cb3b6),logger[_0x323b21(0x126)](_0x53a9b2),logger[_0x323b21(0x119)](_0x323b21(0x11b),_0x323b21(0x113),{'from':_0x484c9f,'to':_0x20d5bc,'appcode':_0x3a6e80,'env':_0x115600[_0x323b21(0x132)]}),console[_0x323b21(0x114)](a126_0x3f1950['green'](_0x323b21(0x11e)+_0x11c815+_0x323b21(0x13e))),console['log'](a126_0x3f1950['cyan'](_0x323b21(0x11d)+Object[_0x323b21(0x115)](_0x115600[_0x323b21(0x12a)]||{})[_0x323b21(0x138)](',\x20'))),console['log'](a126_0x3f1950['cyan'](_0x323b21(0x12e)+_0x115600['defaultApp'])),console[_0x323b21(0x114)](a126_0x3f1950[_0x323b21(0x111)](_0x323b21(0x135)+_0x11c815+_0x323b21(0x144)));return;}const _0x3d1b94=_0x5b7a5b||await askAppcode(),_0x54dfdc=resolve(_0x53a9b2,NEW_CONFIG_NAME),_0x502b02=getCliVersionFromPkg(),_0x35f417=readRawConfig(),_0x412568=typeof _0x35f417[_0x323b21(0x132)]===_0x323b21(0x124)?_0x35f417['env']:undefined,_0x1ec060=buildCanonicalProjectConfig({},{'appCodes':[_0x3d1b94],'env':_0x1623aa||_0x412568||_0x323b21(0x13f),'metadata':{'version':_0x502b02,'createdAt':new Date()[_0x323b21(0x11f)]()}});writeConfigFile(_0x54dfdc,_0x1ec060),logger[_0x323b21(0x126)](_0x53a9b2),logger[_0x323b21(0x119)](_0x323b21(0x11b),_0x323b21(0x146),{'appcode':_0x3d1b94,'env':_0x1ec060[_0x323b21(0x132)],'version':_0x1ec060['version'],'configPath':_0x54dfdc}),console[_0x323b21(0x114)](a126_0x3f1950[_0x323b21(0x116)]('✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory')),console['log'](a126_0x3f1950[_0x323b21(0x12f)]('\x20\x20Apps:\x20'+Object[_0x323b21(0x115)](_0x1ec060[_0x323b21(0x12a)]||{})[_0x323b21(0x138)](',\x20'))),console[_0x323b21(0x114)](a126_0x3f1950[_0x323b21(0x12f)](_0x323b21(0x12e)+_0x1ec060[_0x323b21(0x122)])),console[_0x323b21(0x114)]('\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27'+CLI_BIN_NAME+_0x323b21(0x11c)+CLI_BIN_NAME+_0x323b21(0x139));}function askAppcode(){const _0x32e7a2=a126_0x1a92;return input({'message':_0x32e7a2(0x12d),'validate':_0x147832=>{const _0x563c6c=_0x32e7a2;if(!_0x147832[_0x563c6c(0x128)]())return _0x563c6c(0x140);const {valid:_0x56912f,message:_0x2b773f}=validateAppcode(_0x147832[_0x563c6c(0x128)]());return _0x56912f||_0x2b773f||_0x563c6c(0x10f);}});}function getCliVersionFromPkg(){const _0x3b434f=a126_0x1a92;try{const _0x124d3=fileURLToPath(import.meta.url),_0x3711c1=resolve(dirname(_0x124d3),_0x3b434f(0x123)),_0x3f3886=JSON[_0x3b434f(0x120)](readFileSync(resolve(_0x3711c1,_0x3b434f(0x131)),_0x3b434f(0x133)));return _0x3f3886[_0x3b434f(0x125)]||_0x3b434f(0x137);}catch{return _0x3b434f(0x137);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a127_0x361b18=a127_0x3c72;(function(_0x342bae,_0x1aed40){const _0x4010cd=a127_0x3c72,_0x5b04aa=_0x342bae();while(!![]){try{const _0x1a5090=parseInt(_0x4010cd(0xd8))/0x1+-parseInt(_0x4010cd(0xfd))/0x2+-parseInt(_0x4010cd(0xcd))/0x3+parseInt(_0x4010cd(0xd9))/0x4*(parseInt(_0x4010cd(0x125))/0x5)+-parseInt(_0x4010cd(0x137))/0x6*(-parseInt(_0x4010cd(0xf4))/0x7)+-parseInt(_0x4010cd(0x146))/0x8+-parseInt(_0x4010cd(0xd2))/0x9;if(_0x1a5090===_0x1aed40)break;else _0x5b04aa['push'](_0x5b04aa['shift']());}catch(_0x5d4bf6){_0x5b04aa['push'](_0x5b04aa['shift']());}}}(a127_0x4400,0x19c6c));import a127_0xcdf982 from'chalk';import a127_0x29e27a 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[a127_0x361b18(0x10e)](_0xfaab90=>_0xfaab90!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0xf6b7b7){const _0x186f3e=a127_0x361b18,_0x23e7a3=[];for(const _0x342e47 of Object[_0x186f3e(0xfb)](CORE_IDE_CONFIGS)){if(_0x342e47[_0x186f3e(0x113)])for(const _0x4a5f35 of _0x342e47[_0x186f3e(0x113)]){_0x23e7a3['push'](resolve(_0xf6b7b7,_0x4a5f35[_0x186f3e(0x129)]));}}return _0x23e7a3;}function analyse(_0xcb137a){const _0x276ecc=a127_0x361b18;let _0x69a3c3=null;const _0x5989b3=resolve(_0xcb137a,NEW_CONFIG_NAME),_0x53e0a8=existsSync(_0x5989b3);for(const _0x59042e of LEGACY_CONFIG_NAMES){const _0x412cb2=resolve(_0xcb137a,_0x59042e);if(existsSync(_0x412cb2)){const _0x2edae7=readConfigFile(_0x412cb2),_0x42381b=Object[_0x276ecc(0xee)](_0x2edae7)[_0x276ecc(0x10e)](_0x433ec4=>typeof _0x2edae7[_0x433ec4]!=='undefined');_0x69a3c3={'oldPath':_0x412cb2,'hasNewConfig':_0x53e0a8,'fields':_0x42381b};break;}}const _0x2b4b2d=[],_0x27b54c=resolve(_0xcb137a,_0x276ecc(0x108));if(existsSync(_0x27b54c))_0x2b4b2d[_0x276ecc(0x134)](_0x27b54c);const _0x44ad7a=resolve(_0xcb137a,_0x276ecc(0x117));if(existsSync(_0x44ad7a))_0x2b4b2d[_0x276ecc(0x134)](_0x44ad7a);const _0x27de10=resolve(_0xcb137a,'.claude/skills/lovrabet');if(existsSync(_0x27de10))_0x2b4b2d[_0x276ecc(0x134)](_0x27de10);for(const _0x3b44b1 of collectIdeSkillFiles(_0xcb137a)){if(existsSync(_0x3b44b1))_0x2b4b2d[_0x276ecc(0x134)](_0x3b44b1);}let _0xc6509d=null;const _0x1e23c0=resolve(_0xcb137a,_0x276ecc(0xe5));if(existsSync(_0x1e23c0))try{const _0x319764=JSON[_0x276ecc(0x10d)](readFileSync(_0x1e23c0,'utf8'));if(_0x319764?.['mcpServers']&&typeof _0x319764[_0x276ecc(0xdb)]===_0x276ecc(0xf5)){const _0x200d25=[];for(const [_0x35d749,_0x4848c1]of Object[_0x276ecc(0x105)](_0x319764[_0x276ecc(0xdb)])){const _0x4c4f85=_0x4848c1;_0x4c4f85?.[_0x276ecc(0xf8)]&&Array['isArray'](_0x4c4f85[_0x276ecc(0xf8)])&&_0x4c4f85['args'][_0x276ecc(0xe8)](_0x3b9f0b=>typeof _0x3b9f0b===_0x276ecc(0xd3)&&_0x3b9f0b[_0x276ecc(0x11e)]('@lovrabet/dataset-mcp-server'))&&_0x200d25[_0x276ecc(0x134)](_0x35d749);}_0x200d25[_0x276ecc(0x14a)]>0x0&&(_0xc6509d={'path':_0x1e23c0,'keys':_0x200d25});}}catch{}const _0x368724=_0x2b4b2d[_0x276ecc(0x14a)]>0x0||_0x69a3c3!==null;let _0x558928=null;const _0x13715e=resolve(_0xcb137a,'package.json');if(existsSync(_0x13715e))try{const _0x56b8e2=JSON['parse'](readFileSync(_0x13715e,'utf8'));for(const _0x433f4d of[_0x276ecc(0x12a),_0x276ecc(0xfc)]){const _0x295cd1=_0x56b8e2?.[_0x433f4d]?.[_0x276ecc(0x110)];if(typeof _0x295cd1===_0x276ecc(0xd3)){_0x295cd1!==_0x276ecc(0xd5)&&(_0x558928={'pkgPath':_0x13715e,'currentVersion':_0x295cd1,'field':_0x433f4d});break;}}}catch{}return{'configMigration':_0x69a3c3,'oldArtifacts':_0x2b4b2d,'oldMcpConfig':_0xc6509d,'needsSkillSwap':_0x368724,'sdkUpgrade':_0x558928};}function printReport(_0x2ec1d5){const _0x579c29=a127_0x361b18,{configMigration:_0x14ea99,oldArtifacts:_0x18bb0f,oldMcpConfig:_0x1002d3,needsSkillSwap:_0x33f34e}=_0x2ec1d5;console[_0x579c29(0x100)](''),console[_0x579c29(0x100)](a127_0xcdf982['bold'](_0x579c29(0xdc))),console['log']('');_0x14ea99?(console['log'](a127_0xcdf982['cyan']('Config\x20file:')+('\x20\x20'+a127_0xcdf982[_0x579c29(0xe0)](_0x14ea99[_0x579c29(0x140)]))),console[_0x579c29(0x100)](_0x579c29(0x120)+(_0x14ea99['hasNewConfig']?a127_0xcdf982['green'](_0x579c29(0xf1)):a127_0xcdf982[_0x579c29(0x14c)](_0x579c29(0x107)))),console[_0x579c29(0x100)](_0x579c29(0x11c)+_0x14ea99[_0x579c29(0x10b)]['join'](',\x20')),console[_0x579c29(0x100)]('\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak')):console['log'](a127_0xcdf982[_0x579c29(0x136)](_0x579c29(0x126))+'\x20\x20'+a127_0xcdf982[_0x579c29(0x14c)](_0x579c29(0x143)));console[_0x579c29(0x100)]('');if(_0x18bb0f[_0x579c29(0x14a)]>0x0){console[_0x579c29(0x100)](a127_0xcdf982['cyan'](_0x579c29(0xf3)));for(const _0xd986b7 of _0x18bb0f){console[_0x579c29(0x100)]('\x20\x20'+a127_0xcdf982[_0x579c29(0x132)]('FOUND')+'\x20\x20'+_0xd986b7);}console[_0x579c29(0x100)]('\x20\x20Action:\x20delete');}else console[_0x579c29(0x100)](a127_0xcdf982[_0x579c29(0x136)]('Legacy\x20artifacts:')+'\x20\x20'+a127_0xcdf982[_0x579c29(0x14c)](_0x579c29(0x13a)));console[_0x579c29(0x100)]('');_0x1002d3?(console[_0x579c29(0x100)](a127_0xcdf982['cyan'](_0x579c29(0xd1))+('\x20\x20'+a127_0xcdf982[_0x579c29(0xe0)](_0x1002d3['path'])+_0x579c29(0xea)+_0x1002d3['keys'][_0x579c29(0x121)](',\x20'))),console[_0x579c29(0x100)](_0x579c29(0x149))):console['log'](a127_0xcdf982[_0x579c29(0x136)](_0x579c29(0xd1))+'\x20\x20'+a127_0xcdf982['gray'](_0x579c29(0xcc)));console[_0x579c29(0x100)](''),console[_0x579c29(0x100)](a127_0xcdf982[_0x579c29(0x136)](_0x579c29(0x11b))+('\x20\x20'+(_0x33f34e?a127_0xcdf982[_0x579c29(0xe0)]('needed'):a127_0xcdf982[_0x579c29(0x13d)](_0x579c29(0x13f)))));_0x33f34e&&console[_0x579c29(0x100)](_0x579c29(0xd6)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x579c29(0x100)]('');if(_0x2ec1d5[_0x579c29(0x12b)]){const {currentVersion:_0x2a91d0,field:_0x200be5,pkgPath:_0x5e381a}=_0x2ec1d5['sdkUpgrade'];console[_0x579c29(0x100)](a127_0xcdf982[_0x579c29(0x136)](_0x579c29(0x12e))+('\x20\x20'+a127_0xcdf982[_0x579c29(0xe0)](_0x5e381a))),console['log'](_0x579c29(0x135)+_0x200be5+':\x20'+a127_0xcdf982[_0x579c29(0xe0)](_0x2a91d0)+_0x579c29(0x10c)+a127_0xcdf982['green'](_0x579c29(0xd5))),console[_0x579c29(0x100)](_0x579c29(0xf6));}else console[_0x579c29(0x100)](a127_0xcdf982[_0x579c29(0x136)](_0x579c29(0x12e))+'\x20\x20'+a127_0xcdf982[_0x579c29(0x14c)](_0x579c29(0xcf)));console[_0x579c29(0x100)]('');}function execConfigMigration(_0x4cd2e1,_0x468289){const _0x4e3709=a127_0x361b18,{configMigration:_0xeeb21b}=_0x4cd2e1;if(!_0xeeb21b?.['oldPath'])return{'step':0x1,'label':_0x4e3709(0x144),'ok':!![],'detail':'skipped\x20(no\x20legacy\x20config)'};const _0x2e2258=readConfigFile(_0xeeb21b['oldPath']),_0x39950c=resolve(_0x468289,NEW_CONFIG_NAME),_0x5e36df=_0xeeb21b['hasNewConfig']?readConfigFile(_0x39950c):{};for(const [_0xba977d,_0x1e69a2]of Object[_0x4e3709(0x105)](_0x2e2258)){!(_0xba977d in _0x5e36df)&&(_0x5e36df[_0xba977d]=_0x1e69a2);}writeConfigFile(_0x39950c,_0x5e36df);const _0x5082b9=_0xeeb21b[_0x4e3709(0x140)]+_0x4e3709(0x122);return renameSync(_0xeeb21b['oldPath'],_0x5082b9),{'step':0x1,'label':_0x4e3709(0x144),'ok':!![],'detail':_0xeeb21b[_0x4e3709(0x140)]+_0x4e3709(0x10c)+_0x39950c+'\x20(backup:\x20'+_0x5082b9+')'};}function execRemoveOldArtifacts(_0x55901b){const _0x56650a=a127_0x361b18,_0xac4e03=[];for(const _0x119a07 of _0x55901b){try{if(!existsSync(_0x119a07))continue;const _0x1b83d5=tryStat(_0x119a07);_0x1b83d5?.[_0x56650a(0x124)]()?rmSync(_0x119a07,{'recursive':!![],'force':!![]}):unlinkSync(_0x119a07);}catch(_0x46ba5b){_0xac4e03[_0x56650a(0x134)](_0x119a07+':\x20'+_0x46ba5b['message']);}}return{'step':0x3,'label':_0x56650a(0x11a),'ok':_0xac4e03['length']===0x0,'detail':_0xac4e03['length']>0x0?_0x55901b[_0x56650a(0x14a)]-_0xac4e03[_0x56650a(0x14a)]+'/'+_0x55901b[_0x56650a(0x14a)]+_0x56650a(0xf7)+_0xac4e03[_0x56650a(0x121)](';\x20')+')':_0x55901b[_0x56650a(0x14a)]+_0x56650a(0xf2)};}function execCleanMcp(_0x343aea){const _0x1ff75a=a127_0x361b18;if(!_0x343aea['oldMcpConfig'])return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':'skipped'};try{const _0x34f831=readFileSync(_0x343aea[_0x1ff75a(0x128)]['path'],'utf8'),_0x25cc96=JSON[_0x1ff75a(0x10d)](_0x34f831);if(_0x25cc96?.[_0x1ff75a(0xdb)]&&typeof _0x25cc96[_0x1ff75a(0xdb)]===_0x1ff75a(0xf5)){const _0x4b11f8=[];for(const [_0x20da63,_0x5d8e05]of Object['entries'](_0x25cc96[_0x1ff75a(0xdb)])){_0x5d8e05?.[_0x1ff75a(0xf8)]&&Array[_0x1ff75a(0xdf)](_0x5d8e05[_0x1ff75a(0xf8)])&&_0x5d8e05[_0x1ff75a(0xf8)][_0x1ff75a(0xe8)](_0x5884d9=>typeof _0x5884d9===_0x1ff75a(0xd3)&&_0x5884d9['includes'](_0x1ff75a(0x147)))&&_0x4b11f8[_0x1ff75a(0x134)](_0x20da63);}for(const _0x16001a of _0x4b11f8){delete _0x25cc96['mcpServers'][_0x16001a];}return _0x4b11f8[_0x1ff75a(0x14a)]>0x0&&writeFileSync(_0x343aea[_0x1ff75a(0x128)]['path'],JSON['stringify'](_0x25cc96,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':_0x1ff75a(0x116),'ok':!![],'detail':_0x1ff75a(0xe7)+_0x4b11f8[_0x1ff75a(0x121)](',\x20')+_0x1ff75a(0x119)+_0x343aea['oldMcpConfig'][_0x1ff75a(0x129)]};}return{'step':0x4,'label':_0x1ff75a(0x116),'ok':!![],'detail':_0x1ff75a(0x101)};}catch(_0x1ac717){return{'step':0x4,'label':_0x1ff75a(0x116),'ok':![],'detail':_0x1ac717[_0x1ff75a(0x102)]};}}function execSkillsRemove(_0x2bced9,_0x2b7bba){const _0x46e1df=a127_0x361b18,_0x1d5e3c=runNpxSkillsRemove(_0x2bced9,{'stdio':_0x46e1df(0x11f),'yes':_0x2b7bba});return{'step':0x5,'label':_0x46e1df(0x130),'ok':_0x1d5e3c['ok'],'detail':_0x1d5e3c['ok']?_0x46e1df(0x109):_0x1d5e3c[_0x46e1df(0xed)]??_0x46e1df(0x10a)+_0x1d5e3c['status']};}function a127_0x3c72(_0x522947,_0xc39a34){_0x522947=_0x522947-0xcc;const _0x4400c3=a127_0x4400();let _0x3c72ee=_0x4400c3[_0x522947];return _0x3c72ee;}function a127_0x4400(){const _0x4ace5c=['Config\x20migration','cwd','260904aVndLW','@lovrabet/dataset-mcp-server','needsSkillSwap','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','length','[\x22@lovrabet/sdk\x22]:\x20','gray','no\x20legacy\x20entry','550899patYQR','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','not\x20found\x20or\x20already\x20at\x20latest','===\x20Upgrade\x20Summary\x20===','MCP\x20config:','1171566Cbwriy','string','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','latest','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','start','196290QYPLqO','8972dRPlNT','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','mcpServers','===\x20Upgrade\x20Analysis\x20===','white','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','isArray','yellow','Upgrade\x20@lovrabet/sdk','utf8','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','.cursor/mcp.json','Step\x205/7:\x20Removing\x20old\x20skill...','removed\x20','some','done','\x20→\x20keys:\x20','yes','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','error','keys','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','succeed','already\x20exists\x20(will\x20merge)','\x20removed','Legacy\x20artifacts:','348502IrlOqH','object','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','\x20removed\x20(','args','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','failed','values','devDependencies','70794IAhiuR','Upgrade\x20cancelled.','\x20\x20#\x20or','log','no\x20matching\x20entry\x20found','message','bold','info','entries','Remove\x20.lovrabet/','not\x20found\x20(will\x20create)','.lovrabet','lovrabet/lovrabet-skill\x20removed','exit\x20','fields','\x20→\x20','parse','filter','fail','@lovrabet/sdk','\x20\x20Step\x20','label','files','detail','lovrabet/rabetbase','Clean\x20MCP\x20config','.cursor/rules/lovrabet_rules.mdc','\x20\x20npm\x20install','\x20from\x20','Remove\x20legacy\x20artifacts','Skill\x20swap:','\x20\x20Fields\x20to\x20migrate:\x20','Install\x20new\x20skill','includes','inherit','\x20\x20New\x20config\x20(.rabetbase.json):\x20','join','.bak','Step\x204/7:\x20MCP\x20config\x20—\x20','isDirectory','205LngxkR','Config\x20file:','\x20\x20bun\x20install','oldMcpConfig','path','dependencies','sdkUpgrade','step','Step\x204/7:\x20Cleaning\x20MCP\x20config...','@lovrabet/sdk:','Step\x201/7:\x20Config\x20migration\x20—\x20','Remove\x20old\x20skill','skipped','red','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','push','\x20\x20Current\x20version\x20in\x20','cyan','24ddqVPY','lovrabet/rabetbase\x20installed\x20globally','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','none\x20found','Step\x201/7:\x20Migrating\x20config...','oldArtifacts','green','Proceed\x20with\x20upgrade?','not\x20needed','oldPath','\x20→\x20latest','FAIL','no\x20legacy\x20config\x20found'];a127_0x4400=function(){return _0x4ace5c;};return a127_0x4400();}function execSkillsAdd(_0x62090,_0x2c8699){const _0x2c6656=a127_0x361b18,_0xf91d1d=runNpxSkillsAddGlobal(_0x62090,_0x2c6656(0x115),{'stdio':_0x2c6656(0x11f),'yes':_0x2c8699});return{'step':0x6,'label':_0x2c6656(0x11d),'ok':_0xf91d1d['ok'],'detail':_0xf91d1d['ok']?_0x2c6656(0x138):_0xf91d1d[_0x2c6656(0xed)]??_0x2c6656(0x10a)+_0xf91d1d['status']};}function execUpgradeSdk(_0x526e74){const _0x531743=a127_0x361b18;if(!_0x526e74[_0x531743(0x12b)])return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x531743(0xde)};const {pkgPath:_0x56a116,currentVersion:_0x48e6a0,field:_0x2c16aa}=_0x526e74[_0x531743(0x12b)];try{const _0xc24b6e=readFileSync(_0x56a116,_0x531743(0xe2)),_0x4b7da9=JSON['parse'](_0xc24b6e);return _0x4b7da9[_0x2c16aa]['@lovrabet/sdk']='latest',writeFileSync(_0x56a116,JSON['stringify'](_0x4b7da9,null,0x2)+'\x0a',_0x531743(0xe2)),{'step':0x7,'label':_0x531743(0xe1),'ok':!![],'detail':_0x2c16aa+_0x531743(0x14b)+_0x48e6a0+_0x531743(0x141)};}catch(_0x52fcda){return{'step':0x7,'label':_0x531743(0xe1),'ok':![],'detail':_0x52fcda['message']};}}function tryStat(_0x30a505){try{return statSync(_0x30a505);}catch{return undefined;}}function printSummary(_0x8f4c49){const _0x2debde=a127_0x361b18;console['log'](''),console['log'](a127_0xcdf982[_0x2debde(0x103)](_0x2debde(0xd0))),console[_0x2debde(0x100)]('');for(const _0x5283e6 of _0x8f4c49){const _0x5ae77a=_0x5283e6['ok']?a127_0xcdf982[_0x2debde(0x13d)]('OK'):a127_0xcdf982[_0x2debde(0x132)](_0x2debde(0x142));console[_0x2debde(0x100)]('\x20\x20'+_0x5ae77a+_0x2debde(0x111)+_0x5283e6[_0x2debde(0x12c)]+':\x20'+_0x5283e6[_0x2debde(0x112)]);if(_0x5283e6[_0x2debde(0x114)])console[_0x2debde(0x100)]('\x20\x20\x20\x20\x20\x20\x20'+a127_0xcdf982[_0x2debde(0x14c)](_0x5283e6[_0x2debde(0x114)]));}console['log']('');}export async function upgradeApp(_0x5c6ab8,_0x4310c7){const _0x141b6a=a127_0x361b18,_0x4c26a2=process[_0x141b6a(0x145)](),_0x21581b=analyse(_0x4c26a2),_0x41b581=!_0x21581b['configMigration']&&_0x21581b['oldArtifacts'][_0x141b6a(0x14a)]===0x0&&!_0x21581b[_0x141b6a(0x128)]&&!_0x21581b[_0x141b6a(0x148)]&&!_0x21581b[_0x141b6a(0x12b)];if(_0x41b581){console[_0x141b6a(0x100)](a127_0xcdf982[_0x141b6a(0x13d)]('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0x21581b);const _0x1171d3=!!(_0x4310c7[_0x141b6a(0xeb)]||_0x4310c7['Y']||_0x5c6ab8);if(!_0x1171d3)try{const _0x43c7e1=await askConfirm(_0x141b6a(0x13e));if(!_0x43c7e1){console[_0x141b6a(0x100)](a127_0xcdf982[_0x141b6a(0x14c)](_0x141b6a(0xfe)));return;}}catch(_0x467db2){if(_0x467db2?.['message']==='CANCEL'){console[_0x141b6a(0x100)](a127_0xcdf982['gray'](_0x141b6a(0xfe)));return;}throw _0x467db2;}const _0x4bd044=[],_0x209e57=a127_0x29e27a({'text':_0x141b6a(0x13b),'color':_0x141b6a(0x136)})[_0x141b6a(0xd7)](),_0x281bb3=execConfigMigration(_0x21581b,_0x4c26a2);_0x4bd044[_0x141b6a(0x134)](_0x281bb3),_0x209e57[_0x281bb3['ok']?'succeed':'fail'](_0x141b6a(0x12f)+(_0x281bb3[_0x141b6a(0x114)]??(_0x281bb3['ok']?_0x141b6a(0xe9):_0x141b6a(0xfa))));const _0x5db177=resolve(_0x4c26a2,_0x141b6a(0x108)),_0x588a98=a127_0x29e27a({'text':_0x141b6a(0xe3),'color':_0x141b6a(0x136)})[_0x141b6a(0xd7)]();if(existsSync(_0x5db177))try{rmSync(_0x5db177,{'recursive':!![],'force':!![]}),_0x588a98[_0x141b6a(0xf0)](_0x141b6a(0x133)),_0x4bd044[_0x141b6a(0x134)]({'step':0x2,'label':_0x141b6a(0x106),'ok':!![]});}catch(_0x5ca180){_0x588a98[_0x141b6a(0x10f)](_0x141b6a(0xce)+_0x5ca180[_0x141b6a(0x102)]),_0x4bd044[_0x141b6a(0x134)]({'step':0x2,'label':_0x141b6a(0x106),'ok':![],'detail':_0x5ca180[_0x141b6a(0x102)]});}else _0x588a98[_0x141b6a(0x104)]('Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped'),_0x4bd044[_0x141b6a(0x134)]({'step':0x2,'label':_0x141b6a(0x106),'ok':!![],'detail':_0x141b6a(0x131)});const _0x5743b4=a127_0x29e27a({'text':_0x141b6a(0xda),'color':_0x141b6a(0x136)})[_0x141b6a(0xd7)](),_0x542da4=execRemoveOldArtifacts(_0x21581b[_0x141b6a(0x13c)]);_0x4bd044[_0x141b6a(0x134)](_0x542da4),_0x5743b4[_0x542da4['ok']?_0x141b6a(0xf0):_0x141b6a(0x10f)](_0x141b6a(0xd4)+(_0x542da4[_0x141b6a(0x114)]??(_0x542da4['ok']?_0x141b6a(0xe9):_0x141b6a(0xfa))));const _0xb132f=a127_0x29e27a({'text':_0x141b6a(0x12d),'color':_0x141b6a(0x136)})['start'](),_0x4019f7=execCleanMcp(_0x21581b);_0x4bd044['push'](_0x4019f7),_0xb132f[_0x4019f7['ok']?'succeed':_0x141b6a(0x10f)](_0x141b6a(0x123)+(_0x4019f7[_0x141b6a(0x114)]??(_0x4019f7['ok']?_0x141b6a(0xe9):_0x141b6a(0xfa))));const _0x2fd5d2=a127_0x29e27a({'text':_0x141b6a(0xe6),'color':_0x141b6a(0x136)})[_0x141b6a(0xd7)](),_0x3d535b=execSkillsRemove(_0x4c26a2,_0x1171d3);_0x4bd044[_0x141b6a(0x134)](_0x3d535b),_0x2fd5d2[_0x3d535b['ok']?'succeed':'fail'](_0x141b6a(0xec)+(_0x3d535b[_0x141b6a(0x114)]??(_0x3d535b['ok']?_0x141b6a(0xe9):_0x141b6a(0xfa))));const _0x3d0081=a127_0x29e27a({'text':'Step\x206/7:\x20Installing\x20new\x20skill...','color':_0x141b6a(0x136)})[_0x141b6a(0xd7)](),_0x39bb6a=execSkillsAdd(_0x4c26a2,_0x1171d3);_0x4bd044[_0x141b6a(0x134)](_0x39bb6a),_0x3d0081[_0x39bb6a['ok']?_0x141b6a(0xf0):'fail']('Step\x206/7:\x20Install\x20new\x20skill\x20—\x20'+(_0x39bb6a[_0x141b6a(0x114)]??(_0x39bb6a['ok']?_0x141b6a(0xe9):'failed')));const _0x29c824=a127_0x29e27a({'text':_0x141b6a(0xe4),'color':_0x141b6a(0x136)})[_0x141b6a(0xd7)](),_0x28d659=execUpgradeSdk(_0x21581b);_0x4bd044[_0x141b6a(0x134)](_0x28d659),_0x29c824[_0x28d659['ok']?_0x141b6a(0xf0):_0x141b6a(0x10f)](_0x141b6a(0xf9)+(_0x28d659[_0x141b6a(0x114)]??(_0x28d659['ok']?_0x141b6a(0xe9):_0x141b6a(0xfa)))),printSummary(_0x4bd044);const _0xf4eb6a=_0x4bd044[_0x141b6a(0xe8)](_0x115fd8=>!_0x115fd8['ok']);_0xf4eb6a?console[_0x141b6a(0x100)](a127_0xcdf982[_0x141b6a(0xe0)](_0x141b6a(0xef))):console[_0x141b6a(0x100)](a127_0xcdf982['green']('Upgrade\x20completed\x20successfully!')),_0x28d659['ok']&&_0x21581b[_0x141b6a(0x12b)]&&(console[_0x141b6a(0x100)](''),console['log'](a127_0xcdf982[_0x141b6a(0x103)][_0x141b6a(0x136)](_0x141b6a(0x139))),console[_0x141b6a(0x100)](a127_0xcdf982['cyan']('Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:')),console[_0x141b6a(0x100)](''),console[_0x141b6a(0x100)](a127_0xcdf982[_0x141b6a(0xdd)](_0x141b6a(0x118))),console[_0x141b6a(0x100)](a127_0xcdf982[_0x141b6a(0xdd)](_0x141b6a(0xff))),console[_0x141b6a(0x100)](a127_0xcdf982[_0x141b6a(0xdd)](_0x141b6a(0x127))),console['log'](''));}
|
|
1
|
+
(function(_0x1ada7f,_0xa53b24){const _0x15e159=a127_0x33f1,_0x13ce27=_0x1ada7f();while(!![]){try{const _0x4ef4f9=-parseInt(_0x15e159(0x148))/0x1+parseInt(_0x15e159(0x166))/0x2+-parseInt(_0x15e159(0x189))/0x3*(parseInt(_0x15e159(0x177))/0x4)+parseInt(_0x15e159(0x160))/0x5*(-parseInt(_0x15e159(0x14a))/0x6)+parseInt(_0x15e159(0x12d))/0x7+-parseInt(_0x15e159(0x193))/0x8+parseInt(_0x15e159(0x15b))/0x9;if(_0x4ef4f9===_0xa53b24)break;else _0x13ce27['push'](_0x13ce27['shift']());}catch(_0x5ae5e1){_0x13ce27['push'](_0x13ce27['shift']());}}}(a127_0x2931,0x5113c));import a127_0x389592 from'chalk';import a127_0x56bc45 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';function a127_0x2931(){const _0xb37dc9=['cwd','4388335atJmix','needsSkillSwap','inherit','filter','Step\x201/7:\x20Config\x20migration\x20—\x20','@lovrabet/dataset-mcp-server','stringify','\x20(backup:\x20','Clean\x20MCP\x20config','skipped','no\x20legacy\x20config\x20found','lovrabet/rabetbase\x20installed\x20globally','hasNewConfig','mcpServers','info','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','utf8','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','detail','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','succeed','oldPath','\x20removed\x20(','files','\x20\x20Action:\x20delete','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','661871CgilDS','not\x20found\x20(will\x20create)','94002kBqDVP','undefined','no\x20legacy\x20entry','Legacy\x20artifacts:','\x20→\x20latest','none\x20found','some','FAIL','.claude/skills/lovrabet','length','done','error','status','lovrabet/lovrabet-skill\x20removed','\x20removed','.cursor/mcp.json','args','11223522YPfUdw','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','Remove\x20legacy\x20artifacts','lovrabet/rabetbase','.cursor/rules/lovrabet_rules.mdc','180uYUQOV','Install\x20new\x20skill','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','oldArtifacts','\x20→\x20keys:\x20','green','88900hmLgDh','isDirectory','latest','log','\x20\x20npm\x20install','\x20\x20#\x20or','bold','red','@lovrabet/sdk','failed','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','\x20→\x20','\x20\x20bun\x20install','fields','Upgrade\x20cancelled.','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','\x20\x20New\x20config\x20(.rabetbase.json):\x20','1190012UPeTrN','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','skipped\x20(no\x20legacy\x20config)','parse','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','Skill\x20swap:','\x20\x20\x20\x20\x20\x20\x20','isArray','path','FOUND','fail','sdkUpgrade','push','Remove\x20.lovrabet/','keys','Upgrade\x20@lovrabet/sdk','message','3jgrXOY','includes','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','[\x22@lovrabet/sdk\x22]:\x20','label','@lovrabet/sdk:','entries','===\x20Upgrade\x20Analysis\x20===','white','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','503480CMImSF','object','not\x20found\x20or\x20already\x20at\x20latest','Step\x201/7:\x20Migrating\x20config...','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','.lovrabet','start','join','already\x20exists\x20(will\x20merge)','cyan','\x20\x20Current\x20version\x20in\x20','configMigration','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','string','\x20from\x20','Upgrade\x20completed\x20successfully!','Proceed\x20with\x20upgrade?','Remove\x20old\x20skill','Config\x20migration','MCP\x20config:','yellow','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','gray','yes','oldMcpConfig','exit\x20'];a127_0x2931=function(){return _0xb37dc9;};return a127_0x2931();}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';function a127_0x33f1(_0x5202df,_0x321a34){_0x5202df=_0x5202df-0x11e;const _0x293149=a127_0x2931();let _0x33f1ee=_0x293149[_0x5202df];return _0x33f1ee;}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'](_0x4cf1d3=>_0x4cf1d3!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x5a1d30){const _0x1f0ea9=a127_0x33f1,_0x1c7d2a=[];for(const _0x13ac27 of Object['values'](CORE_IDE_CONFIGS)){if(_0x13ac27[_0x1f0ea9(0x144)])for(const _0x52264a of _0x13ac27[_0x1f0ea9(0x144)]){_0x1c7d2a[_0x1f0ea9(0x184)](resolve(_0x5a1d30,_0x52264a['path']));}}return _0x1c7d2a;}function analyse(_0x22f644){const _0x580051=a127_0x33f1;let _0x18304c=null;const _0x2eebac=resolve(_0x22f644,NEW_CONFIG_NAME),_0x51c7cf=existsSync(_0x2eebac);for(const _0x1a8e7a of LEGACY_CONFIG_NAMES){const _0xa9b9c=resolve(_0x22f644,_0x1a8e7a);if(existsSync(_0xa9b9c)){const _0x608d95=readConfigFile(_0xa9b9c),_0x1f7b60=Object[_0x580051(0x186)](_0x608d95)[_0x580051(0x130)](_0x13053f=>typeof _0x608d95[_0x13053f]!==_0x580051(0x14b));_0x18304c={'oldPath':_0xa9b9c,'hasNewConfig':_0x51c7cf,'fields':_0x1f7b60};break;}}const _0x36eeaa=[],_0x21fd96=resolve(_0x22f644,_0x580051(0x198));if(existsSync(_0x21fd96))_0x36eeaa[_0x580051(0x184)](_0x21fd96);const _0x30e7f1=resolve(_0x22f644,_0x580051(0x15f));if(existsSync(_0x30e7f1))_0x36eeaa['push'](_0x30e7f1);const _0x832ce2=resolve(_0x22f644,_0x580051(0x152));if(existsSync(_0x832ce2))_0x36eeaa['push'](_0x832ce2);for(const _0x3a70bb of collectIdeSkillFiles(_0x22f644)){if(existsSync(_0x3a70bb))_0x36eeaa['push'](_0x3a70bb);}let _0x161a70=null;const _0x38d10f=resolve(_0x22f644,_0x580051(0x159));if(existsSync(_0x38d10f))try{const _0x3755a2=JSON[_0x580051(0x17b)](readFileSync(_0x38d10f,_0x580051(0x13d)));if(_0x3755a2?.['mcpServers']&&typeof _0x3755a2['mcpServers']===_0x580051(0x194)){const _0x170bcf=[];for(const [_0x6dd29c,_0x3680a9]of Object[_0x580051(0x18f)](_0x3755a2[_0x580051(0x13a)])){const _0x11c18f=_0x3680a9;_0x11c18f?.[_0x580051(0x15a)]&&Array[_0x580051(0x17f)](_0x11c18f[_0x580051(0x15a)])&&_0x11c18f[_0x580051(0x15a)]['some'](_0x3ef18f=>typeof _0x3ef18f===_0x580051(0x11f)&&_0x3ef18f['includes']('@lovrabet/dataset-mcp-server'))&&_0x170bcf[_0x580051(0x184)](_0x6dd29c);}_0x170bcf[_0x580051(0x153)]>0x0&&(_0x161a70={'path':_0x38d10f,'keys':_0x170bcf});}}catch{}const _0x36bdbb=_0x36eeaa[_0x580051(0x153)]>0x0||_0x18304c!==null;let _0x3b19a7=null;const _0x915a7f=resolve(_0x22f644,'package.json');if(existsSync(_0x915a7f))try{const _0x35e8ec=JSON[_0x580051(0x17b)](readFileSync(_0x915a7f,_0x580051(0x13d)));for(const _0xaeac61 of['dependencies','devDependencies']){const _0x181465=_0x35e8ec?.[_0xaeac61]?.['@lovrabet/sdk'];if(typeof _0x181465===_0x580051(0x11f)){_0x181465!==_0x580051(0x168)&&(_0x3b19a7={'pkgPath':_0x915a7f,'currentVersion':_0x181465,'field':_0xaeac61});break;}}}catch{}return{'configMigration':_0x18304c,'oldArtifacts':_0x36eeaa,'oldMcpConfig':_0x161a70,'needsSkillSwap':_0x36bdbb,'sdkUpgrade':_0x3b19a7};}function printReport(_0x17057e){const _0x4ec80b=a127_0x33f1,{configMigration:_0x37a303,oldArtifacts:_0x30ea82,oldMcpConfig:_0x58d565,needsSkillSwap:_0x368429}=_0x17057e;console[_0x4ec80b(0x169)](''),console[_0x4ec80b(0x169)](a127_0x389592[_0x4ec80b(0x16c)](_0x4ec80b(0x190))),console['log']('');_0x37a303?(console['log'](a127_0x389592['cyan']('Config\x20file:')+('\x20\x20'+a127_0x389592[_0x4ec80b(0x126)](_0x37a303[_0x4ec80b(0x142)]))),console[_0x4ec80b(0x169)](_0x4ec80b(0x176)+(_0x37a303[_0x4ec80b(0x139)]?a127_0x389592[_0x4ec80b(0x165)](_0x4ec80b(0x19b)):a127_0x389592['gray'](_0x4ec80b(0x149)))),console[_0x4ec80b(0x169)]('\x20\x20Fields\x20to\x20migrate:\x20'+_0x37a303[_0x4ec80b(0x173)][_0x4ec80b(0x19a)](',\x20')),console[_0x4ec80b(0x169)](_0x4ec80b(0x13e))):console[_0x4ec80b(0x169)](a127_0x389592[_0x4ec80b(0x19c)]('Config\x20file:')+'\x20\x20'+a127_0x389592[_0x4ec80b(0x128)](_0x4ec80b(0x137)));console[_0x4ec80b(0x169)]('');if(_0x30ea82[_0x4ec80b(0x153)]>0x0){console[_0x4ec80b(0x169)](a127_0x389592[_0x4ec80b(0x19c)](_0x4ec80b(0x14d)));for(const _0x23ea21 of _0x30ea82){console[_0x4ec80b(0x169)]('\x20\x20'+a127_0x389592[_0x4ec80b(0x16d)](_0x4ec80b(0x181))+'\x20\x20'+_0x23ea21);}console['log'](_0x4ec80b(0x145));}else console[_0x4ec80b(0x169)](a127_0x389592['cyan'](_0x4ec80b(0x14d))+'\x20\x20'+a127_0x389592['gray'](_0x4ec80b(0x14f)));console[_0x4ec80b(0x169)]('');_0x58d565?(console[_0x4ec80b(0x169)](a127_0x389592['cyan'](_0x4ec80b(0x125))+('\x20\x20'+a127_0x389592['yellow'](_0x58d565['path'])+_0x4ec80b(0x164)+_0x58d565['keys'][_0x4ec80b(0x19a)](',\x20'))),console[_0x4ec80b(0x169)](_0x4ec80b(0x17c))):console[_0x4ec80b(0x169)](a127_0x389592[_0x4ec80b(0x19c)](_0x4ec80b(0x125))+'\x20\x20'+a127_0x389592['gray'](_0x4ec80b(0x14c)));console[_0x4ec80b(0x169)](''),console[_0x4ec80b(0x169)](a127_0x389592[_0x4ec80b(0x19c)](_0x4ec80b(0x17d))+('\x20\x20'+(_0x368429?a127_0x389592['yellow']('needed'):a127_0x389592[_0x4ec80b(0x165)]('not\x20needed'))));_0x368429&&console[_0x4ec80b(0x169)](_0x4ec80b(0x13c)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x4ec80b(0x169)]('');if(_0x17057e[_0x4ec80b(0x183)]){const {currentVersion:_0x339875,field:_0x19ba96,pkgPath:_0x283408}=_0x17057e[_0x4ec80b(0x183)];console[_0x4ec80b(0x169)](a127_0x389592[_0x4ec80b(0x19c)](_0x4ec80b(0x18e))+('\x20\x20'+a127_0x389592['yellow'](_0x283408))),console[_0x4ec80b(0x169)](_0x4ec80b(0x19d)+_0x19ba96+':\x20'+a127_0x389592[_0x4ec80b(0x126)](_0x339875)+_0x4ec80b(0x171)+a127_0x389592[_0x4ec80b(0x165)](_0x4ec80b(0x168))),console[_0x4ec80b(0x169)](_0x4ec80b(0x15c));}else console[_0x4ec80b(0x169)](a127_0x389592[_0x4ec80b(0x19c)](_0x4ec80b(0x18e))+'\x20\x20'+a127_0x389592[_0x4ec80b(0x128)](_0x4ec80b(0x195)));console[_0x4ec80b(0x169)]('');}function execConfigMigration(_0xf3331a,_0xd232e8){const _0x5bb2b6=a127_0x33f1,{configMigration:_0xe153e9}=_0xf3331a;if(!_0xe153e9?.[_0x5bb2b6(0x142)])return{'step':0x1,'label':_0x5bb2b6(0x124),'ok':!![],'detail':_0x5bb2b6(0x17a)};const _0x2933fa=readConfigFile(_0xe153e9[_0x5bb2b6(0x142)]),_0x5bcb96=resolve(_0xd232e8,NEW_CONFIG_NAME),_0x316597=_0xe153e9[_0x5bb2b6(0x139)]?readConfigFile(_0x5bcb96):{};for(const [_0x2e2dbd,_0x35eb18]of Object[_0x5bb2b6(0x18f)](_0x2933fa)){!(_0x2e2dbd in _0x316597)&&(_0x316597[_0x2e2dbd]=_0x35eb18);}writeConfigFile(_0x5bcb96,_0x316597);const _0x4f0180=_0xe153e9[_0x5bb2b6(0x142)]+'.bak';return renameSync(_0xe153e9[_0x5bb2b6(0x142)],_0x4f0180),{'step':0x1,'label':_0x5bb2b6(0x124),'ok':!![],'detail':_0xe153e9[_0x5bb2b6(0x142)]+_0x5bb2b6(0x171)+_0x5bcb96+_0x5bb2b6(0x134)+_0x4f0180+')'};}function execRemoveOldArtifacts(_0x185ca4){const _0x4bc1de=a127_0x33f1,_0xfe5075=[];for(const _0x2e550b of _0x185ca4){try{if(!existsSync(_0x2e550b))continue;const _0x2ea29f=tryStat(_0x2e550b);_0x2ea29f?.[_0x4bc1de(0x167)]()?rmSync(_0x2e550b,{'recursive':!![],'force':!![]}):unlinkSync(_0x2e550b);}catch(_0x3fbe97){_0xfe5075[_0x4bc1de(0x184)](_0x2e550b+':\x20'+_0x3fbe97[_0x4bc1de(0x188)]);}}return{'step':0x3,'label':_0x4bc1de(0x15d),'ok':_0xfe5075[_0x4bc1de(0x153)]===0x0,'detail':_0xfe5075['length']>0x0?_0x185ca4[_0x4bc1de(0x153)]-_0xfe5075[_0x4bc1de(0x153)]+'/'+_0x185ca4[_0x4bc1de(0x153)]+_0x4bc1de(0x143)+_0xfe5075[_0x4bc1de(0x19a)](';\x20')+')':_0x185ca4[_0x4bc1de(0x153)]+_0x4bc1de(0x158)};}function execCleanMcp(_0x1c3188){const _0x544dd3=a127_0x33f1;if(!_0x1c3188[_0x544dd3(0x12a)])return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':_0x544dd3(0x136)};try{const _0x2490b2=readFileSync(_0x1c3188[_0x544dd3(0x12a)][_0x544dd3(0x180)],_0x544dd3(0x13d)),_0xb99be3=JSON[_0x544dd3(0x17b)](_0x2490b2);if(_0xb99be3?.['mcpServers']&&typeof _0xb99be3[_0x544dd3(0x13a)]===_0x544dd3(0x194)){const _0xc76082=[];for(const [_0x2356bd,_0x356c88]of Object['entries'](_0xb99be3[_0x544dd3(0x13a)])){_0x356c88?.[_0x544dd3(0x15a)]&&Array['isArray'](_0x356c88[_0x544dd3(0x15a)])&&_0x356c88[_0x544dd3(0x15a)][_0x544dd3(0x150)](_0xb033c5=>typeof _0xb033c5===_0x544dd3(0x11f)&&_0xb033c5[_0x544dd3(0x18a)](_0x544dd3(0x132)))&&_0xc76082['push'](_0x2356bd);}for(const _0x4af5c3 of _0xc76082){delete _0xb99be3['mcpServers'][_0x4af5c3];}return _0xc76082['length']>0x0&&writeFileSync(_0x1c3188[_0x544dd3(0x12a)]['path'],JSON[_0x544dd3(0x133)](_0xb99be3,null,0x2)+'\x0a',_0x544dd3(0x13d)),{'step':0x4,'label':'Clean\x20MCP\x20config','ok':!![],'detail':'removed\x20'+_0xc76082[_0x544dd3(0x19a)](',\x20')+_0x544dd3(0x120)+_0x1c3188['oldMcpConfig']['path']};}return{'step':0x4,'label':_0x544dd3(0x135),'ok':!![],'detail':'no\x20matching\x20entry\x20found'};}catch(_0x1dc0a5){return{'step':0x4,'label':_0x544dd3(0x135),'ok':![],'detail':_0x1dc0a5[_0x544dd3(0x188)]};}}function execSkillsRemove(_0x2d7bea,_0x3959cd){const _0x413eb2=a127_0x33f1,_0x4b1d0d=runNpxSkillsRemove(_0x2d7bea,{'stdio':_0x413eb2(0x12f),'yes':_0x3959cd});return{'step':0x5,'label':_0x413eb2(0x123),'ok':_0x4b1d0d['ok'],'detail':_0x4b1d0d['ok']?_0x413eb2(0x157):_0x4b1d0d['error']??_0x413eb2(0x12b)+_0x4b1d0d[_0x413eb2(0x156)]};}function execSkillsAdd(_0x3f312a,_0x3f67c0){const _0x31c7bc=a127_0x33f1,_0x5862e0=runNpxSkillsAddGlobal(_0x3f312a,_0x31c7bc(0x15e),{'stdio':_0x31c7bc(0x12f),'yes':_0x3f67c0});return{'step':0x6,'label':_0x31c7bc(0x161),'ok':_0x5862e0['ok'],'detail':_0x5862e0['ok']?_0x31c7bc(0x138):_0x5862e0[_0x31c7bc(0x155)]??_0x31c7bc(0x12b)+_0x5862e0[_0x31c7bc(0x156)]};}function execUpgradeSdk(_0x2b029d){const _0x515bf5=a127_0x33f1;if(!_0x2b029d[_0x515bf5(0x183)])return{'step':0x7,'label':_0x515bf5(0x187),'ok':!![],'detail':'skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)'};const {pkgPath:_0x4645aa,currentVersion:_0x4ceb8e,field:_0x3813d1}=_0x2b029d['sdkUpgrade'];try{const _0x371c65=readFileSync(_0x4645aa,_0x515bf5(0x13d)),_0x32a3e5=JSON['parse'](_0x371c65);return _0x32a3e5[_0x3813d1][_0x515bf5(0x16e)]='latest',writeFileSync(_0x4645aa,JSON[_0x515bf5(0x133)](_0x32a3e5,null,0x2)+'\x0a',_0x515bf5(0x13d)),{'step':0x7,'label':_0x515bf5(0x187),'ok':!![],'detail':_0x3813d1+_0x515bf5(0x18c)+_0x4ceb8e+_0x515bf5(0x14e)};}catch(_0xe3e240){return{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':![],'detail':_0xe3e240[_0x515bf5(0x188)]};}}function tryStat(_0x167196){try{return statSync(_0x167196);}catch{return undefined;}}function printSummary(_0x2bb593){const _0x9069aa=a127_0x33f1;console[_0x9069aa(0x169)](''),console['log'](a127_0x389592[_0x9069aa(0x16c)]('===\x20Upgrade\x20Summary\x20===')),console[_0x9069aa(0x169)]('');for(const _0x30f9e4 of _0x2bb593){const _0x301841=_0x30f9e4['ok']?a127_0x389592['green']('OK'):a127_0x389592['red'](_0x9069aa(0x151));console[_0x9069aa(0x169)]('\x20\x20'+_0x301841+'\x20\x20Step\x20'+_0x30f9e4['step']+':\x20'+_0x30f9e4[_0x9069aa(0x18d)]);if(_0x30f9e4[_0x9069aa(0x13f)])console[_0x9069aa(0x169)](_0x9069aa(0x17e)+a127_0x389592[_0x9069aa(0x128)](_0x30f9e4[_0x9069aa(0x13f)]));}console[_0x9069aa(0x169)]('');}export async function upgradeApp(_0x308bfb,_0x4fa64d){const _0x2bf904=a127_0x33f1,_0x4112b0=process[_0x2bf904(0x12c)](),_0x4e9ea4=analyse(_0x4112b0),_0x23e8ad=!_0x4e9ea4[_0x2bf904(0x19e)]&&_0x4e9ea4['oldArtifacts']['length']===0x0&&!_0x4e9ea4[_0x2bf904(0x12a)]&&!_0x4e9ea4[_0x2bf904(0x12e)]&&!_0x4e9ea4[_0x2bf904(0x183)];if(_0x23e8ad){console[_0x2bf904(0x169)](a127_0x389592['green'](_0x2bf904(0x178)));return;}printReport(_0x4e9ea4);const _0x28ba77=!!(_0x4fa64d[_0x2bf904(0x129)]||_0x4fa64d['Y']||_0x308bfb);if(!_0x28ba77)try{const _0x38e4b7=await askConfirm(_0x2bf904(0x122));if(!_0x38e4b7){console[_0x2bf904(0x169)](a127_0x389592[_0x2bf904(0x128)](_0x2bf904(0x174)));return;}}catch(_0x2d6671){if(_0x2d6671?.['message']==='CANCEL'){console[_0x2bf904(0x169)](a127_0x389592[_0x2bf904(0x128)]('Upgrade\x20cancelled.'));return;}throw _0x2d6671;}const _0x5283bd=[],_0x33c257=a127_0x56bc45({'text':_0x2bf904(0x196),'color':_0x2bf904(0x19c)})[_0x2bf904(0x199)](),_0x55c642=execConfigMigration(_0x4e9ea4,_0x4112b0);_0x5283bd['push'](_0x55c642),_0x33c257[_0x55c642['ok']?'succeed':'fail'](_0x2bf904(0x131)+(_0x55c642[_0x2bf904(0x13f)]??(_0x55c642['ok']?'done':'failed')));const _0x5f4729=resolve(_0x4112b0,'.lovrabet'),_0x2c6f3b=a127_0x56bc45({'text':_0x2bf904(0x162),'color':_0x2bf904(0x19c)})[_0x2bf904(0x199)]();if(existsSync(_0x5f4729))try{rmSync(_0x5f4729,{'recursive':!![],'force':!![]}),_0x2c6f3b[_0x2bf904(0x141)](_0x2bf904(0x11e)),_0x5283bd[_0x2bf904(0x184)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x3f4a00){_0x2c6f3b[_0x2bf904(0x182)](_0x2bf904(0x18b)+_0x3f4a00[_0x2bf904(0x188)]),_0x5283bd[_0x2bf904(0x184)]({'step':0x2,'label':_0x2bf904(0x185),'ok':![],'detail':_0x3f4a00[_0x2bf904(0x188)]});}else _0x2c6f3b[_0x2bf904(0x13b)](_0x2bf904(0x170)),_0x5283bd[_0x2bf904(0x184)]({'step':0x2,'label':_0x2bf904(0x185),'ok':!![],'detail':_0x2bf904(0x136)});const _0x48155b=a127_0x56bc45({'text':_0x2bf904(0x175),'color':_0x2bf904(0x19c)})[_0x2bf904(0x199)](),_0xad03ec=execRemoveOldArtifacts(_0x4e9ea4[_0x2bf904(0x163)]);_0x5283bd['push'](_0xad03ec),_0x48155b[_0xad03ec['ok']?_0x2bf904(0x141):_0x2bf904(0x182)](_0x2bf904(0x140)+(_0xad03ec['detail']??(_0xad03ec['ok']?_0x2bf904(0x154):'failed')));const _0x2fcdad=a127_0x56bc45({'text':'Step\x204/7:\x20Cleaning\x20MCP\x20config...','color':_0x2bf904(0x19c)})[_0x2bf904(0x199)](),_0xb67bbe=execCleanMcp(_0x4e9ea4);_0x5283bd[_0x2bf904(0x184)](_0xb67bbe),_0x2fcdad[_0xb67bbe['ok']?_0x2bf904(0x141):'fail']('Step\x204/7:\x20MCP\x20config\x20—\x20'+(_0xb67bbe[_0x2bf904(0x13f)]??(_0xb67bbe['ok']?_0x2bf904(0x154):_0x2bf904(0x16f))));const _0x288510=a127_0x56bc45({'text':'Step\x205/7:\x20Removing\x20old\x20skill...','color':'cyan'})['start'](),_0x23c926=execSkillsRemove(_0x4112b0,_0x28ba77);_0x5283bd[_0x2bf904(0x184)](_0x23c926),_0x288510[_0x23c926['ok']?_0x2bf904(0x141):'fail'](_0x2bf904(0x146)+(_0x23c926[_0x2bf904(0x13f)]??(_0x23c926['ok']?_0x2bf904(0x154):'failed')));const _0x53c93e=a127_0x56bc45({'text':'Step\x206/7:\x20Installing\x20new\x20skill...','color':_0x2bf904(0x19c)})[_0x2bf904(0x199)](),_0x2462dc=execSkillsAdd(_0x4112b0,_0x28ba77);_0x5283bd['push'](_0x2462dc),_0x53c93e[_0x2462dc['ok']?_0x2bf904(0x141):'fail'](_0x2bf904(0x179)+(_0x2462dc[_0x2bf904(0x13f)]??(_0x2462dc['ok']?'done':_0x2bf904(0x16f))));const _0x2aa132=a127_0x56bc45({'text':'Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','color':'cyan'})['start'](),_0x273c13=execUpgradeSdk(_0x4e9ea4);_0x5283bd['push'](_0x273c13),_0x2aa132[_0x273c13['ok']?_0x2bf904(0x141):_0x2bf904(0x182)](_0x2bf904(0x147)+(_0x273c13[_0x2bf904(0x13f)]??(_0x273c13['ok']?'done':'failed'))),printSummary(_0x5283bd);const _0x3b99b5=_0x5283bd[_0x2bf904(0x150)](_0x4e1c28=>!_0x4e1c28['ok']);_0x3b99b5?console[_0x2bf904(0x169)](a127_0x389592[_0x2bf904(0x126)](_0x2bf904(0x127))):console[_0x2bf904(0x169)](a127_0x389592['green'](_0x2bf904(0x121))),_0x273c13['ok']&&_0x4e9ea4[_0x2bf904(0x183)]&&(console[_0x2bf904(0x169)](''),console[_0x2bf904(0x169)](a127_0x389592[_0x2bf904(0x16c)]['cyan'](_0x2bf904(0x197))),console['log'](a127_0x389592[_0x2bf904(0x19c)](_0x2bf904(0x192))),console[_0x2bf904(0x169)](''),console['log'](a127_0x389592[_0x2bf904(0x191)](_0x2bf904(0x16a))),console[_0x2bf904(0x169)](a127_0x389592[_0x2bf904(0x191)](_0x2bf904(0x16b))),console[_0x2bf904(0x169)](a127_0x389592['white'](_0x2bf904(0x172))),console['log'](''));}
|