@lovrabet/rabetbase-cli 2.3.7-beta.2 → 2.3.7-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.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-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.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/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.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/file/index.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/notification/config-list.js +1 -0
- package/lib/commands/notification/index.js +1 -0
- 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/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.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/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.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/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a131_0x22f41b=a131_0x2338;(function(_0x50d0bf,_0x2a9003){const _0x5e9b88=a131_0x2338,_0x3b04d9=_0x50d0bf();while(!![]){try{const _0x2e2b04=parseInt(_0x5e9b88(0x128))/0x1*(-parseInt(_0x5e9b88(0x14a))/0x2)+-parseInt(_0x5e9b88(0x140))/0x3*(-parseInt(_0x5e9b88(0x129))/0x4)+parseInt(_0x5e9b88(0x141))/0x5+parseInt(_0x5e9b88(0x115))/0x6*(-parseInt(_0x5e9b88(0x126))/0x7)+-parseInt(_0x5e9b88(0xfb))/0x8*(parseInt(_0x5e9b88(0x136))/0x9)+parseInt(_0x5e9b88(0xff))/0xa*(-parseInt(_0x5e9b88(0x12b))/0xb)+parseInt(_0x5e9b88(0x130))/0xc;if(_0x2e2b04===_0x2a9003)break;else _0x3b04d9['push'](_0x3b04d9['shift']());}catch(_0x2752e3){_0x3b04d9['push'](_0x3b04d9['shift']());}}}(a131_0x1927,0xd7341));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a131_0x22f41b(0x147),'type':a131_0x22f41b(0x113),'required':!![],'description':'Menu\x20id\x20(from\x20`menu\x20list`)'};export const ROLE_REF_FLAG={'name':a131_0x22f41b(0xf6),'type':'string','required':!![],'description':a131_0x22f41b(0x106)};export const GRANT_FLAG={'name':a131_0x22f41b(0x110),'type':a131_0x22f41b(0x125),'required':![],'description':a131_0x22f41b(0x13a)};export const REVOKE_FLAG={'name':a131_0x22f41b(0x124),'type':a131_0x22f41b(0x125),'required':![],'description':a131_0x22f41b(0x14b)};function a131_0x1927(){const _0x3eb3ff=['bool','string','Special\x20role\x20',';\x20SELF\x20=\x20only\x20own\x20rows','54693432YGJdgb','delete-roles','trim','datasetCode','SELF','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','134433ZjkOEq','split','validation','menu\x20visibility','Grant\x20access\x20to\x20the\x20listed\x20resources','data\x20export','resourceName','test','get','set','3mwBXnh','1608975uyWrIS','map','rolePermit','SELF\x20is\x20not\x20allowed\x20for\x20','export-roles','update-roles','menu-id','data\x20update','create-roles','157222dyjvzK','Revoke\x20access\x20to\x20the\x20listed\x20resources','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','role','action','data\x20create','flagMissing','appCode','920zXauWA','find','menuId','key','208060iqNgNf','\x20not\x20found.','Pass\x20--role\x20<id|name>.','length','some','dataCreate','row-roles','Role\x20id\x20or\x20role\x20name','filter','Missing\x20action.','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.','apiList','label','Disambiguate\x20with\x20an\x20id.','Roles\x20for\x20','Run\x20`role\x20list`.','grant','allowSelf','entries','number','pageNodeList','6qTIcGH','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','access','flag','roleName','\x22\x20not\x20found.','toUpperCase','Role\x20\x22','dataUpdate','allowedActions','\x20(comma-separated\x20SELF/ALL/id/name)','datasets','roleType','join','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.','revoke','boolean','9124787tEoDll','menuPermit','13ILKhnG','4591396MiYRAe','resourceCode','583FYcqxz'];a131_0x1927=function(){return _0x3eb3ff;};return a131_0x1927();}export const MENUS_FLAG={'name':'menus','type':a131_0x22f41b(0x12d),'required':!![],'description':a131_0x22f41b(0x135)};export const DATASETS_FLAG={'name':a131_0x22f41b(0x120),'type':a131_0x22f41b(0x12d),'required':!![],'description':a131_0x22f41b(0x116)};export const PAGE_SLOT_SPECS=[{'flag':'menu-roles','key':a131_0x22f41b(0x127),'allowSelf':![],'label':a131_0x22f41b(0x139)},{'flag':a131_0x22f41b(0x149),'key':a131_0x22f41b(0x104),'allowSelf':![],'label':a131_0x22f41b(0xf8)},{'flag':a131_0x22f41b(0x146),'key':a131_0x22f41b(0x11d),'allowSelf':![],'label':a131_0x22f41b(0x148)},{'flag':a131_0x22f41b(0x131),'key':'dataDelete','allowSelf':![],'label':'data\x20delete'},{'flag':'detail-roles','key':'dataDetail','allowSelf':![],'label':'data\x20detail'},{'flag':a131_0x22f41b(0x145),'key':'dataExport','allowSelf':![],'label':a131_0x22f41b(0x13b)},{'flag':a131_0x22f41b(0x105),'key':'dataPermit','allowSelf':!![],'label':'row\x20visibility'}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a131_0x22f41b(0x142)](_0x59811f=>({'name':_0x59811f[a131_0x22f41b(0x118)],'type':a131_0x22f41b(0x12d),'required':![],'description':a131_0x22f41b(0x10e)+_0x59811f[a131_0x22f41b(0x10c)]+a131_0x22f41b(0x11f)+(_0x59811f[a131_0x22f41b(0x111)]?a131_0x22f41b(0x12f):'')}));export function splitList(_0x23bd1e){const _0x3de1ec=a131_0x22f41b;return _0x23bd1e[_0x3de1ec(0x137)](',')['map'](_0x37aaba=>_0x37aaba[_0x3de1ec(0x132)]())[_0x3de1ec(0x107)](Boolean);}export function projectRoleRef(_0x18c7dd){const _0x4349e6=a131_0x22f41b;return{'id':_0x18c7dd['id'],'roleName':_0x18c7dd[_0x4349e6(0x119)],'roleType':_0x18c7dd[_0x4349e6(0x121)]};}export async function resolvePermitRoles(_0x49f608,_0x5d61cf,_0x315e2d){const _0x3c7454=a131_0x22f41b,_0x4654f1=await listPermitRoles(_0x49f608,{'needSelf':!![],'needPublic':!![]}),_0xf3660d=[];for(const _0x168082 of _0x5d61cf){const _0x445564=resolveOnePermitRole(_0x4654f1,_0x168082);if(!_0x315e2d[_0x3c7454(0x111)]&&_0x445564[_0x3c7454(0x121)]===_0x3c7454(0x134))throw CliErrors[_0x3c7454(0x138)](_0x3c7454(0x144)+_0x315e2d[_0x3c7454(0x10c)]+'.',_0x3c7454(0x109));if(!_0xf3660d[_0x3c7454(0x103)](_0x296e96=>_0x296e96['id']===_0x445564['id']))_0xf3660d['push'](_0x445564);}return _0xf3660d;}function resolveOnePermitRole(_0x352b64,_0x5922ec){const _0x557903=a131_0x22f41b,_0x3d2445=_0x5922ec[_0x557903(0x132)](),_0x536f99=_0x3d2445[_0x557903(0x11b)]();if(_0x536f99===_0x557903(0x134)||_0x536f99==='ALL'){const _0x405c0a=_0x352b64[_0x557903(0xfc)](_0x223eef=>_0x223eef[_0x557903(0x121)]===_0x536f99);if(!_0x405c0a)throw CliErrors[_0x557903(0x138)](_0x557903(0x12e)+_0x536f99+'\x20is\x20not\x20available\x20for\x20this\x20app.');return _0x405c0a;}if(/^-?\d+$/[_0x557903(0x13d)](_0x3d2445)){const _0xcd1c6e=Number(_0x3d2445),_0x30b39c=_0x352b64['find'](_0x352f35=>_0x352f35['id']===_0xcd1c6e);if(!_0x30b39c)throw CliErrors[_0x557903(0x138)]('Role\x20id\x20'+_0xcd1c6e+_0x557903(0x100),_0x557903(0x10f));return _0x30b39c;}const _0x467e41=_0x352b64['filter'](_0x53aef2=>_0x53aef2['roleName']===_0x3d2445);if(_0x467e41[_0x557903(0x102)]===0x0)throw CliErrors[_0x557903(0x138)](_0x557903(0x11c)+_0x3d2445+_0x557903(0x11a),_0x557903(0x10a));if(_0x467e41[_0x557903(0x102)]>0x1)throw CliErrors['validation']('Role\x20\x22'+_0x3d2445+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x467e41[_0x557903(0x142)](_0x3a8093=>_0x3a8093['id'])[_0x557903(0x122)](',\x20')+').',_0x557903(0x10d));return _0x467e41[0x0];}export function projectPageSlot(_0x161df0){const _0x31f556=a131_0x22f41b;if(!_0x161df0)return null;return{'resourceCode':_0x161df0[_0x31f556(0x12a)],'roles':(_0x161df0[_0x31f556(0x143)]??[])[_0x31f556(0x142)](projectRoleRef)};}export function projectPagePermit(_0x24bef7){const _0x160cf2=a131_0x22f41b,_0x4f5ec9={'menuId':_0x24bef7[_0x160cf2(0xfd)],'appCode':_0x24bef7[_0x160cf2(0xfa)],'menuPermit':projectPageSlot(_0x24bef7[_0x160cf2(0x127)])};for(const _0x2473f8 of PAGE_SLOT_SPECS){if(_0x2473f8[_0x160cf2(0xfe)]===_0x160cf2(0x127))continue;_0x4f5ec9[_0x2473f8['key']]=projectPageSlot(_0x24bef7[_0x2473f8['key']]);}return _0x4f5ec9;}export function flattenMenuResources(_0xba1f7b){const _0x4cbd48=new Map(),_0x313d65=_0x196518=>{const _0x451369=a131_0x2338;for(const _0x4e03bc of _0x196518??[]){_0x4cbd48['set'](_0x4e03bc[_0x451369(0x12a)],{'resourceCode':_0x4e03bc[_0x451369(0x12a)],'resourceName':_0x4e03bc[_0x451369(0x13c)],'action':_0x4e03bc[_0x451369(0x11e)]?.[0x0]??'0'});if(_0x4e03bc[_0x451369(0x114)])_0x313d65(_0x4e03bc[_0x451369(0x114)]);}};return _0x313d65(_0xba1f7b),_0x4cbd48;}export function flattenApiResources(_0x2c07a3){const _0x2829a4=a131_0x22f41b,_0x547e1b=new Map(),_0x56b5bf=new Map();for(const _0xb98da6 of _0x2c07a3){const _0x34504b=_0xb98da6[_0x2829a4(0x10b)]??{};for(const [_0x4c95f3,_0x53752b]of Object[_0x2829a4(0x112)](_0x34504b)){_0x547e1b['set'](_0x4c95f3,{'resourceCode':_0x4c95f3,'resourceName':_0xb98da6[_0x2829a4(0x13c)],'datasetCode':_0xb98da6[_0x2829a4(0x133)],'action':_0x53752b?.[0x0]??'0'});const _0x1d6e8e=_0x56b5bf[_0x2829a4(0x13e)](_0xb98da6[_0x2829a4(0x133)])??[];_0x1d6e8e['push'](_0x4c95f3),_0x56b5bf[_0x2829a4(0x13f)](_0xb98da6[_0x2829a4(0x133)],_0x1d6e8e);}}return{'byCode':_0x547e1b,'byDataset':_0x56b5bf};}export function buildPermits(_0x5e2b21,_0x211d54){const _0x23e4ab=a131_0x22f41b,_0x1c0099={};for(const [_0x20914d,_0x505128]of _0x5e2b21){const _0x5e6b61=_0x211d54[_0x23e4ab(0x13e)](_0x20914d)??_0x505128[_0x23e4ab(0xf7)];_0x1c0099[_0x20914d]=[_0x5e6b61];}return _0x1c0099;}export function readRoleRef(_0x1c4516){const _0x52c08f=a131_0x22f41b,_0x4074cf=_0x1c4516['str']('role')[_0x52c08f(0x132)]();if(!_0x4074cf)throw CliErrors[_0x52c08f(0xf9)](_0x52c08f(0xf6),_0x52c08f(0x101));return _0x4074cf;}function a131_0x2338(_0x1c35bc,_0x2e0b9d){_0x1c35bc=_0x1c35bc-0xf5;const _0x192743=a131_0x1927();let _0x2338fa=_0x192743[_0x1c35bc];return _0x2338fa;}export function readGrantRevoke(_0x4a9a7e){const _0x46a065=a131_0x22f41b,_0x5047e1=_0x4a9a7e[_0x46a065(0x12c)](_0x46a065(0x110)),_0x1ba341=_0x4a9a7e['bool']('revoke');if(_0x5047e1&&_0x1ba341)throw CliErrors['validation'](_0x46a065(0xf5));if(!_0x5047e1&&!_0x1ba341)throw CliErrors['validation'](_0x46a065(0x108),_0x46a065(0x123));return _0x5047e1?_0x46a065(0x117):'0';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2ac728,_0x3784f6){const _0x54d6e3=a132_0x3154,_0x195e2a=_0x2ac728();while(!![]){try{const _0x180495=-parseInt(_0x54d6e3(0x99))/0x1+parseInt(_0x54d6e3(0x96))/0x2+parseInt(_0x54d6e3(0xaa))/0x3+parseInt(_0x54d6e3(0xa6))/0x4+parseInt(_0x54d6e3(0xae))/0x5+-parseInt(_0x54d6e3(0xa1))/0x6+parseInt(_0x54d6e3(0x9d))/0x7*(-parseInt(_0x54d6e3(0xa5))/0x8);if(_0x180495===_0x3784f6)break;else _0x195e2a['push'](_0x195e2a['shift']());}catch(_0x14e907){_0x195e2a['push'](_0x195e2a['shift']());}}}(a132_0x8695,0x6c711));import{existsSync}from'node:fs';function a132_0x8695(){const _0x30724e=['my-app','1364872rQTicA','Project\x20name:','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','56389PtRArv','log','length','cyan','21bggMfD','resolve','production','Not\x20set','1164726ZVgEik','test','Project\x20name\x20cannot\x20exceed\x2050\x20characters','Logged\x20in','4510472oxaIgE','2172160merybZ','env','\x22\x20already\x20exists','trim','993441ynwxgP','green','string','Skipped','4147455bvJNgn','Directory\x20\x22','Login\x20failed','√\x20Login\x20status:\x20'];a132_0x8695=function(){return _0x30724e;};return a132_0x8695();}import a132_0x1ee66b from'node:path';import a132_0x5c4f1f 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';function a132_0x3154(_0x2d2820,_0x3fd01f){_0x2d2820=_0x2d2820-0x94;const _0x869554=a132_0x8695();let _0x315465=_0x869554[_0x2d2820];return _0x315465;}import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x167134,_0x3c44f2,_0x5e0dd3){const _0xa94226=a132_0x3154,_0x25e189=_0xa94226(0x95),_0x28cdee=readConfig(),_0x4f7128=typeof _0x28cdee[_0xa94226(0xa7)]===_0xa94226(0xac)?_0x28cdee['env']:undefined,_0x320bfd=await input({'message':_0xa94226(0x97),'default':_0x25e189,'validate':_0x36eb69=>{const _0x39277f=_0xa94226,_0x54f948=_0x36eb69[_0x39277f(0xa9)]()||_0x25e189;if(_0x54f948[_0x39277f(0x9b)]>0x32)return _0x39277f(0xa3);const _0x1d7364=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x54f948&&!_0x1d7364[_0x39277f(0xa2)](_0x54f948))return'Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_';const _0x367992=a132_0x1ee66b[_0x39277f(0x9e)](process['cwd'](),_0x54f948);if(existsSync(_0x367992))return _0x39277f(0xaf)+_0x54f948+_0x39277f(0xa8);return!![];}});console[_0xa94226(0x9a)](a132_0x5c4f1f[_0xa94226(0xab)]('√\x20Project\x20Name:\x20'+a132_0x5c4f1f[_0xa94226(0x9c)](_0x320bfd)));const _0x4a9c0f=await selectSingleAppcode(_0x5e0dd3);console[_0xa94226(0x9a)](a132_0x5c4f1f[_0xa94226(0xab)]('√\x20App\x20Code:\x20'+a132_0x5c4f1f[_0xa94226(0x9c)](_0x4a9c0f||_0xa94226(0xa0))));if(_0x4a9c0f){const _0x4bdc44=await getIsSessionValid();if(!_0x4bdc44){const _0x1a8c30=await confirm({'message':_0xa94226(0x98),'default':!![]});if(_0x1a8c30){const _0x3d3c59=await authServer({'silent':!![]});console[_0xa94226(0x9a)](a132_0x5c4f1f[_0xa94226(0xab)](_0xa94226(0x94)+a132_0x5c4f1f['cyan'](_0x3d3c59?_0xa94226(0xa4):_0xa94226(0xb0))));}else console[_0xa94226(0x9a)](a132_0x5c4f1f[_0xa94226(0xab)](_0xa94226(0x94)+a132_0x5c4f1f[_0xa94226(0x9c)](_0xa94226(0xad))));}await _0x167134({'projectName':_0x320bfd,'appCode':_0x4a9c0f,'env':_0x3c44f2||_0x4f7128||'production'});}else await _0x167134({'projectName':_0x320bfd,'env':_0x3c44f2||_0x4f7128||_0xa94226(0x9f)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x49330e,_0x2baeb6){const _0x470c50=a133_0x86f3,_0x3145be=_0x49330e();while(!![]){try{const _0x31e24d=parseInt(_0x470c50(0x77))/0x1+-parseInt(_0x470c50(0x72))/0x2+parseInt(_0x470c50(0x71))/0x3*(parseInt(_0x470c50(0x75))/0x4)+parseInt(_0x470c50(0x7a))/0x5+parseInt(_0x470c50(0x78))/0x6+parseInt(_0x470c50(0x79))/0x7+parseInt(_0x470c50(0x7b))/0x8*(-parseInt(_0x470c50(0x74))/0x9);if(_0x31e24d===_0x2baeb6)break;else _0x3145be['push'](_0x3145be['shift']());}catch(_0x98a957){_0x3145be['push'](_0x3145be['shift']());}}}(a133_0x5dec,0x668ed));function a133_0x86f3(_0x4c553a,_0x156e0d){_0x4c553a=_0x4c553a-0x71;const _0x5dec8b=a133_0x5dec();let _0x86f30d=_0x5dec8b[_0x4c553a];return _0x86f30d;}export function formatElapsed(_0x4f2024){const _0x5e50fc=a133_0x86f3,_0x5ddc26=Date[_0x5e50fc(0x73)]()-_0x4f2024;if(_0x5ddc26<0x3e8)return _0x5ddc26+'ms';const _0x4a430d=(_0x5ddc26/0x3e8)['toFixed'](0x2),_0x41934e=_0x4a430d[_0x5e50fc(0x76)](/\.?0+$/u,'');return _0x41934e+'s';}function a133_0x5dec(){const _0x3321f1=['now','214893MUqblZ','4panYrc','replace','438587SMMJsS','969750fruwOf','732732kPysMi','1755330vFOBMa','152EGDone','691554mdjBxg','825464VMhBUp'];a133_0x5dec=function(){return _0x3321f1;};return a133_0x5dec();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a132_0x198b(){const _0x1035fd=['\x20\x202.\x20Pull\x20API\x20configuration:\x20','🚀\x20Next\x20Steps:','704pfkBlr','join','rmSync','needsUpgrade','开始创建项目:\x20','cd\x20','\x20config\x20set\x20appcode\x20<app-code>\x27','cwd','cookie','159672SHRHTI','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','2WHrxpB','cyan','name','appCode','Project\x20name:\x20','CLI\x20版本检查','\x20run\x20start','*\x20Pulling\x20API\x20configuration...','W_OK','4205205UbSdyg','log','stringify','√\x20package.json\x20updated:\x20name=','2905377vrCDkO','dirname','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','fail','889970QoJnNB','warn','error','utf8','keys','production','98bLUqGU','modelCount','stop','\x20already\x20exists','stableVersion','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','Format\x20code','readFileSync','belowMinimum','√\x20Pulled\x20','test','清理项目目录失败:\x20','26584162uTFhDZ','resolve','\x20&&\x20','√\x20Configuration\x20file\x20created,\x20Apps:\x20','parse','项目创建失败:\x20','projectName','info','projectCode','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','65133JOVaJZ','constants','toLocaleString','\x20\x201.\x20Start\x20project:\x20','gray','setLogPath','start','Install\x20dependencies','\x20√\x20','更新\x20package.json\x20name','create','env','配置应用AppCode:\x20','length','message','1.0.0','repeat','chdir','4YVNZYP','string','bold','12xZwjBf','existsSync','currentVersion','更新\x20package.json\x20失败','version','15994030XgVKRF','Project\x20name\x20cannot\x20be\x20empty','green','package.json','minimumVersion','*\x20Creating\x20configuration\x20file\x20for\x20project\x20'];a132_0x198b=function(){return _0x1035fd;};return a132_0x198b();}(function(_0x40c3f8,_0x50eef6){const _0x47c96d=a132_0x40ae,_0x469ece=_0x40c3f8();while(!![]){try{const _0x2dfbd1=parseInt(_0x47c96d(0x1cc))/0x1+parseInt(_0x47c96d(0x1bb))/0x2*(-parseInt(_0x47c96d(0x1c8))/0x3)+-parseInt(_0x47c96d(0x1fa))/0x4*(parseInt(_0x47c96d(0x1c4))/0x5)+-parseInt(_0x47c96d(0x1b9))/0x6*(-parseInt(_0x47c96d(0x1d2))/0x7)+parseInt(_0x47c96d(0x20a))/0x8*(parseInt(_0x47c96d(0x1e8))/0x9)+-parseInt(_0x47c96d(0x202))/0xa+-parseInt(_0x47c96d(0x1de))/0xb*(-parseInt(_0x47c96d(0x1fd))/0xc);if(_0x2dfbd1===_0x50eef6)break;else _0x469ece['push'](_0x469ece['shift']());}catch(_0x567038){_0x469ece['push'](_0x469ece['shift']());}}}(a132_0x198b,0xdd7e1));import a132_0xc81316 from'path';import a132_0x6da26d from'fs';import a132_0x1de3c4 from'chalk';import a132_0x6937ca from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';function a132_0x40ae(_0x3ce9cb,_0x5b1bff){_0x3ce9cb=_0x3ce9cb-0x1b9;const _0x198bd9=a132_0x198b();let _0x40ae97=_0x198bd9[_0x3ce9cb];return _0x40ae97;}import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x150d50){const _0x1e083c=a132_0x40ae,_0x2b4969=await checkCliVersion();(_0x2b4969[_0x1e083c(0x20d)]||_0x2b4969[_0x1e083c(0x1da)])&&(printCliUpgradeWarning(_0x2b4969),assertCliVersionSupported(_0x2b4969),logger['info']('create',_0x1e083c(0x1c0),{'currentVersion':_0x2b4969[_0x1e083c(0x1ff)],'stableVersion':_0x2b4969[_0x1e083c(0x1d6)],'minimumVersion':_0x2b4969[_0x1e083c(0x206)],'needsUpgrade':_0x2b4969[_0x1e083c(0x20d)],'belowMinimum':_0x2b4969[_0x1e083c(0x1da)]}));if(_0x150d50[_0x1e083c(0x1e6)]&&_0x150d50[_0x1e083c(0x1be)])await runCreate({'projectName':_0x150d50[_0x1e083c(0x1e6)],'appCode':_0x150d50[_0x1e083c(0x1be)],'env':_0x150d50[_0x1e083c(0x1f3)]},_0x150d50);else{if(_0x150d50[_0x1e083c(0x1e6)]){const _0x537d9a=await selectSingleAppcode(_0x150d50['cookie']);await runCreate({'projectName':_0x150d50[_0x1e083c(0x1e6)],'appCode':_0x537d9a||undefined,'env':_0x150d50[_0x1e083c(0x1f3)]},_0x150d50);}else await guidedCreateProject(_0x26e919=>runCreate(_0x26e919,_0x150d50),_0x150d50[_0x1e083c(0x1f3)],_0x150d50[_0x1e083c(0x212)]);}}async function runCreate(_0x426e5a,_0x54873e){const _0x5e1602=a132_0x40ae;if(!_0x426e5a['projectName']||_0x426e5a[_0x5e1602(0x1e4)]['trim']()==='')throw new Error(_0x5e1602(0x203));const _0x4485cf=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x4485cf[_0x5e1602(0x1dc)](_0x426e5a['projectName']))throw new Error(_0x5e1602(0x1e7));if(_0x426e5a[_0x5e1602(0x1e4)][_0x5e1602(0x1f5)]>0x64)throw new Error('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters');const _0x289b56=a132_0xc81316['resolve'](process[_0x5e1602(0x211)](),_0x426e5a[_0x5e1602(0x1e4)]);if(a132_0x6da26d[_0x5e1602(0x1fe)](_0x289b56))throw new Error('Project\x20directory\x20'+_0x426e5a['projectName']+_0x5e1602(0x1d5));try{a132_0x6da26d['accessSync'](a132_0xc81316[_0x5e1602(0x1c9)](_0x289b56),a132_0x6da26d[_0x5e1602(0x1e9)][_0x5e1602(0x1c3)]);}catch{throw new Error(_0x5e1602(0x1d7));}logger[_0x5e1602(0x1ed)](_0x289b56),logger['info']('create',_0x5e1602(0x20e)+_0x426e5a[_0x5e1602(0x1e4)],{'projectDir':_0x289b56,'appCode':_0x426e5a[_0x5e1602(0x1be)]}),console[_0x5e1602(0x1c5)](),console['log'](a132_0x1de3c4[_0x5e1602(0x204)]('\x20√\x20')+_0x5e1602(0x1bf)+a132_0x1de3c4[_0x5e1602(0x204)](_0x426e5a[_0x5e1602(0x1e4)])+(_0x426e5a[_0x5e1602(0x1be)]?'\x20|\x20AppCode:\x20'+a132_0x1de3c4['cyan'](_0x426e5a[_0x5e1602(0x1be)]):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x426e5a['projectName'])),await updatePackageJsonName(_0x426e5a[_0x5e1602(0x1e4)]),await runTask(_0x5e1602(0x1ef),()=>installDependencies(_0x426e5a[_0x5e1602(0x1e4)])),await runTask(_0x5e1602(0x1d8),()=>formatProjectCode(_0x426e5a['projectName'])),await configureAppCode(_0x426e5a[_0x5e1602(0x1e4)],_0x426e5a[_0x5e1602(0x1be)]||'',_0x426e5a['env']);let _0x53889c=![];if(_0x426e5a['appCode']){console['log'](_0x5e1602(0x1c2));const _0x255046=process[_0x5e1602(0x211)]();try{process[_0x5e1602(0x1f9)](_0x289b56);const _0x44de75=_0x426e5a[_0x5e1602(0x1f3)]||_0x5e1602(0x1d1);initEnv(_0x44de75);const {configArray:_0x49bfe3}=await fetchModelList(_0x426e5a[_0x5e1602(0x1be)],_0x54873e['cookie']||''),_0x1b99ef=DEFAULT_API_DIR,_0x3d2dce=await generateApiFile(_0x49bfe3,'',_0x426e5a[_0x5e1602(0x1be)],!![],_0x44de75,_0x1b99ef);console[_0x5e1602(0x1c5)](_0x5e1602(0x1db)+_0x49bfe3[_0x5e1602(0x1f5)]+'\x20dataset(s),\x20generated\x20'+_0x3d2dce[_0x5e1602(0x1d3)]+'\x20model(s)'),logger[_0x5e1602(0x1e5)](_0x5e1602(0x1f2),'API\x20configuration\x20pulled:\x20'+_0x426e5a[_0x5e1602(0x1be)]);}catch(_0x38e67f){_0x53889c=!![],console['log']('!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull'),logger['warn'](_0x5e1602(0x1f2),'API\x20配置拉取异常',{'error':_0x38e67f instanceof Error?_0x38e67f[_0x5e1602(0x1f6)]:String(_0x38e67f)});}finally{process[_0x5e1602(0x1f9)](_0x255046);}}logger['success'](_0x5e1602(0x1f2),'项目创建完成:\x20'+_0x426e5a[_0x5e1602(0x1e4)]),console[_0x5e1602(0x1c5)](),console[_0x5e1602(0x1c5)](a132_0x1de3c4[_0x5e1602(0x204)]('─'['repeat'](0x3c))),console[_0x5e1602(0x1c5)](a132_0x1de3c4['cyan'][_0x5e1602(0x1fc)](_0x5e1602(0x209))),console[_0x5e1602(0x1c5)](),console[_0x5e1602(0x1c5)](_0x5e1602(0x1eb)+a132_0x1de3c4[_0x5e1602(0x1bc)][_0x5e1602(0x1fc)](_0x5e1602(0x20f)+_0x426e5a['projectName']+_0x5e1602(0x1e0)+CLI_BIN_NAME+_0x5e1602(0x1c1))),_0x53889c&&console['log'](_0x5e1602(0x208)+a132_0x1de3c4[_0x5e1602(0x1bc)][_0x5e1602(0x1fc)](CLI_BIN_NAME+'\x20api\x20pull')),console[_0x5e1602(0x1c5)](a132_0x1de3c4[_0x5e1602(0x204)]('─'[_0x5e1602(0x1f8)](0x3c)));}catch(_0x14e3dc){logger[_0x5e1602(0x1ce)](_0x5e1602(0x1f2),_0x5e1602(0x1e3)+_0x426e5a[_0x5e1602(0x1e4)],{'error':_0x14e3dc instanceof Error?_0x14e3dc[_0x5e1602(0x1f6)]:String(_0x14e3dc)});try{a132_0x6da26d['existsSync'](_0x289b56)&&(console[_0x5e1602(0x1c5)](_0x5e1602(0x1ca)+_0x289b56),a132_0x6da26d[_0x5e1602(0x20c)](_0x289b56,{'recursive':!![],'force':!![]}));}catch{logger[_0x5e1602(0x1cd)](_0x5e1602(0x1f2),_0x5e1602(0x1dd)+_0x289b56);}throw _0x14e3dc;}}async function runTask(_0x415d30,_0x45f638){const _0x321694=a132_0x40ae,_0x2df4f0=a132_0x6937ca(_0x415d30+'...')[_0x321694(0x1ee)]();try{const _0x4aa72b=await _0x45f638();_0x2df4f0[_0x321694(0x1d4)](),console[_0x321694(0x1c5)](''+a132_0x1de3c4['green'](_0x321694(0x1f0))+_0x415d30+'\x20'+a132_0x1de3c4[_0x321694(0x1ec)]('['+_0x4aa72b+']'));}catch(_0x3323b3){_0x2df4f0[_0x321694(0x1cb)](_0x415d30);throw _0x3323b3;}}async function updatePackageJsonName(_0x362369){const _0x1da5a9=a132_0x40ae,_0x2bcf6e=a132_0xc81316[_0x1da5a9(0x1df)](process[_0x1da5a9(0x211)](),_0x362369),_0x194580=a132_0xc81316['join'](_0x2bcf6e,_0x1da5a9(0x205));try{console['log']('*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields');const _0x2dfc96=getRabetbaseCliPackageRoot(),_0x2dfcea=a132_0xc81316[_0x1da5a9(0x20b)](_0x2dfc96,_0x1da5a9(0x205));let _0x3df566=_0x1da5a9(0x1f7);try{const _0x525234=JSON[_0x1da5a9(0x1e2)](a132_0x6da26d[_0x1da5a9(0x1d9)](_0x2dfcea,_0x1da5a9(0x1cf)));_0x3df566=_0x525234[_0x1da5a9(0x201)]||_0x1da5a9(0x1f7);}catch{}const _0x33d57b=a132_0x6da26d[_0x1da5a9(0x1d9)](_0x194580,_0x1da5a9(0x1cf)),_0x16272f=JSON[_0x1da5a9(0x1e2)](_0x33d57b);_0x16272f[_0x1da5a9(0x1bd)]=_0x362369,_0x16272f['description']=_0x362369+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x3df566,a132_0x6da26d['writeFileSync'](_0x194580,JSON[_0x1da5a9(0x1c6)](_0x16272f,null,0x2)+'\x0a',_0x1da5a9(0x1cf)),console[_0x1da5a9(0x1c5)](_0x1da5a9(0x1c7)+_0x362369),logger['info']('create',_0x1da5a9(0x1f1));}catch(_0x2d8a0e){logger['error'](_0x1da5a9(0x1f2),_0x1da5a9(0x200));throw _0x2d8a0e;}}async function configureAppCode(_0x1382ca,_0x8ab7b0,_0x136dfe){const _0x32082c=a132_0x40ae,_0x3f9be3=a132_0xc81316[_0x32082c(0x1df)](process[_0x32082c(0x211)](),_0x1382ca),_0x119513=a132_0xc81316[_0x32082c(0x20b)](_0x3f9be3,NEW_CONFIG_NAME);try{_0x8ab7b0?console[_0x32082c(0x1c5)]('*\x20Configuring\x20AppCode\x20for\x20project\x20'+_0x1382ca+':\x20'+_0x8ab7b0):console['log'](_0x32082c(0x207)+_0x1382ca);const _0x46c62e=getRabetbaseCliPackageRoot(),_0x1573f8=a132_0xc81316[_0x32082c(0x20b)](_0x46c62e,_0x32082c(0x205));let _0x260ad8=_0x32082c(0x1f7);try{const _0x35df99=JSON['parse'](a132_0x6da26d[_0x32082c(0x1d9)](_0x1573f8,_0x32082c(0x1cf)));_0x260ad8=_0x35df99['version']||'1.0.0';}catch{}const _0x2de526=readConfig(),_0x5bb507=typeof _0x2de526[_0x32082c(0x1f3)]===_0x32082c(0x1fb)?_0x2de526[_0x32082c(0x1f3)]:undefined,_0x55208f={};for(const _0x5e1f41 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x2de526[_0x5e1f41]!=null)_0x55208f[_0x5e1f41]=_0x2de526[_0x5e1f41];}const _0x33159d=buildCanonicalProjectConfig(_0x55208f,{'appCodes':_0x8ab7b0?[_0x8ab7b0]:[],'env':_0x136dfe||_0x5bb507||'production','metadata':{'createdAt':new Date()[_0x32082c(0x1ea)](),'version':_0x260ad8}});writeConfigFile(_0x119513,_0x33159d),_0x8ab7b0?console['log'](_0x32082c(0x1e1)+Object[_0x32082c(0x1d0)](_0x33159d['apps']||{})[_0x32082c(0x20b)](',\x20')+'\x20|\x20Default:\x20'+_0x33159d['defaultApp']):console['log'](_0x32082c(0x1ba)+CLI_BIN_NAME+_0x32082c(0x210)),logger['info'](_0x32082c(0x1f2),_0x32082c(0x1f4)+_0x8ab7b0);}catch(_0x36073a){logger['error'](_0x32082c(0x1f2),'配置应用AppCode失败');}}
|
|
1
|
+
(function(_0x1feee6,_0x56ac02){const _0x2a7016=a134_0x5c3d,_0x4f21ee=_0x1feee6();while(!![]){try{const _0x1ca756=-parseInt(_0x2a7016(0x170))/0x1*(-parseInt(_0x2a7016(0x15a))/0x2)+parseInt(_0x2a7016(0x161))/0x3+-parseInt(_0x2a7016(0x13e))/0x4+-parseInt(_0x2a7016(0x13c))/0x5+-parseInt(_0x2a7016(0x175))/0x6+-parseInt(_0x2a7016(0x15d))/0x7*(-parseInt(_0x2a7016(0x130))/0x8)+parseInt(_0x2a7016(0x12f))/0x9;if(_0x1ca756===_0x56ac02)break;else _0x4f21ee['push'](_0x4f21ee['shift']());}catch(_0x5c1c86){_0x4f21ee['push'](_0x4f21ee['shift']());}}}(a134_0x37d7,0xe3e44));import a134_0x422514 from'path';import a134_0x4f7fc4 from'fs';import a134_0x360d0e from'chalk';function a134_0x5c3d(_0x47b0da,_0x4aef78){_0x47b0da=_0x47b0da-0x11c;const _0x37d789=a134_0x37d7();let _0x5c3d23=_0x37d789[_0x47b0da];return _0x5c3d23;}import a134_0x605785 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.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';function a134_0x37d7(){const _0x52144f=['\x20dataset(s),\x20generated\x20','fail','message','dirname','项目创建完成:\x20','appCode','constants','defaultApp','√\x20Pulled\x20','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','toLocaleString','green','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','196618djowOU','needsUpgrade','resolve','1.0.0','package.json','11091762ZuNPib','create','readFileSync','belowMinimum','error','env','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','\x20\x201.\x20Start\x20project:\x20','项目创建失败:\x20','Install\x20dependencies','开始创建项目:\x20','stop','utf8','\x20already\x20exists','modelCount','更新\x20package.json\x20name','\x20run\x20start','bold','cookie','gray','21587409dteGAF','40kUHhzc','配置应用AppCode失败','minimumVersion','repeat','√\x20package.json\x20updated:\x20name=','Project\x20directory\x20','existsSync','cwd','join','name','更新\x20package.json\x20失败','string','2034525xeCGth','API\x20configuration\x20pulled:\x20','4467604shntNe','rmSync','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','Copy\x20project\x20files','projectCode','\x20|\x20AppCode:\x20','info','清理项目目录失败:\x20','version','test','chdir','API\x20配置拉取异常','\x20&&\x20','currentVersion','*\x20Configuring\x20AppCode\x20for\x20project\x20','accessSync','warn','🚀\x20Next\x20Steps:','Project\x20name:\x20','parse','cyan','CLI\x20版本检查','√\x20Configuration\x20file\x20created,\x20Apps:\x20','\x20model(s)','projectName','setLogPath','length','apps','2dPHvbx','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','\x20api\x20pull','1531859KlacCU','start','writeFileSync','log','1849419KTTgRF','production'];a134_0x37d7=function(){return _0x52144f;};return a134_0x37d7();}import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x1a0bf9){const _0x588d54=a134_0x5c3d,_0xc13ec4=await checkCliVersion();(_0xc13ec4[_0x588d54(0x171)]||_0xc13ec4['belowMinimum'])&&(printCliUpgradeWarning(_0xc13ec4),assertCliVersionSupported(_0xc13ec4),logger[_0x588d54(0x144)]('create',_0x588d54(0x153),{'currentVersion':_0xc13ec4[_0x588d54(0x14b)],'stableVersion':_0xc13ec4['stableVersion'],'minimumVersion':_0xc13ec4[_0x588d54(0x132)],'needsUpgrade':_0xc13ec4[_0x588d54(0x171)],'belowMinimum':_0xc13ec4[_0x588d54(0x11e)]}));if(_0x1a0bf9[_0x588d54(0x142)]&&_0x1a0bf9['appCode'])await runCreate({'projectName':_0x1a0bf9[_0x588d54(0x142)],'appCode':_0x1a0bf9[_0x588d54(0x168)],'env':_0x1a0bf9[_0x588d54(0x120)]},_0x1a0bf9);else{if(_0x1a0bf9[_0x588d54(0x142)]){const _0x9bb992=await selectSingleAppcode(_0x1a0bf9[_0x588d54(0x12d)]);await runCreate({'projectName':_0x1a0bf9['projectCode'],'appCode':_0x9bb992||undefined,'env':_0x1a0bf9[_0x588d54(0x120)]},_0x1a0bf9);}else await guidedCreateProject(_0x4bb638=>runCreate(_0x4bb638,_0x1a0bf9),_0x1a0bf9['env'],_0x1a0bf9[_0x588d54(0x12d)]);}}async function runCreate(_0x468ee9,_0x3b5226){const _0x128fdd=a134_0x5c3d;if(!_0x468ee9[_0x128fdd(0x156)]||_0x468ee9[_0x128fdd(0x156)]['trim']()==='')throw new Error('Project\x20name\x20cannot\x20be\x20empty');const _0x37a0dd=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x37a0dd[_0x128fdd(0x147)](_0x468ee9['projectName']))throw new Error(_0x128fdd(0x140));if(_0x468ee9['projectName'][_0x128fdd(0x158)]>0x64)throw new Error('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters');const _0x18aaf2=a134_0x422514[_0x128fdd(0x172)](process['cwd'](),_0x468ee9['projectName']);if(a134_0x4f7fc4[_0x128fdd(0x136)](_0x18aaf2))throw new Error(_0x128fdd(0x135)+_0x468ee9[_0x128fdd(0x156)]+_0x128fdd(0x128));try{a134_0x4f7fc4[_0x128fdd(0x14d)](a134_0x422514[_0x128fdd(0x166)](_0x18aaf2),a134_0x4f7fc4[_0x128fdd(0x169)]['W_OK']);}catch{throw new Error(_0x128fdd(0x121));}logger[_0x128fdd(0x157)](_0x18aaf2),logger['info']('create',_0x128fdd(0x125)+_0x468ee9[_0x128fdd(0x156)],{'projectDir':_0x18aaf2,'appCode':_0x468ee9['appCode']}),console[_0x128fdd(0x160)](),console['log'](a134_0x360d0e[_0x128fdd(0x16e)]('\x20√\x20')+_0x128fdd(0x150)+a134_0x360d0e[_0x128fdd(0x16e)](_0x468ee9[_0x128fdd(0x156)])+(_0x468ee9[_0x128fdd(0x168)]?_0x128fdd(0x143)+a134_0x360d0e[_0x128fdd(0x152)](_0x468ee9[_0x128fdd(0x168)]):''));try{await runTask(_0x128fdd(0x141),()=>copyProjectTemplate(_0x468ee9[_0x128fdd(0x156)])),await updatePackageJsonName(_0x468ee9[_0x128fdd(0x156)]),await runTask(_0x128fdd(0x124),()=>installDependencies(_0x468ee9['projectName'])),await runTask('Format\x20code',()=>formatProjectCode(_0x468ee9[_0x128fdd(0x156)])),await configureAppCode(_0x468ee9['projectName'],_0x468ee9[_0x128fdd(0x168)]||'',_0x468ee9[_0x128fdd(0x120)]);let _0x36ce4c=![];if(_0x468ee9[_0x128fdd(0x168)]){console[_0x128fdd(0x160)]('*\x20Pulling\x20API\x20configuration...');const _0x5e38f5=process[_0x128fdd(0x137)]();try{process[_0x128fdd(0x148)](_0x18aaf2);const _0x234efc=_0x468ee9[_0x128fdd(0x120)]||_0x128fdd(0x162);initEnv(_0x234efc);const {configArray:_0x429b98}=await fetchModelList(_0x468ee9['appCode'],_0x3b5226[_0x128fdd(0x12d)]||''),_0x214624=DEFAULT_API_DIR,_0x228eee=await generateApiFile(_0x429b98,'',_0x468ee9[_0x128fdd(0x168)],!![],_0x234efc,_0x214624);console['log'](_0x128fdd(0x16b)+_0x429b98[_0x128fdd(0x158)]+_0x128fdd(0x163)+_0x228eee[_0x128fdd(0x129)]+_0x128fdd(0x155)),logger[_0x128fdd(0x144)](_0x128fdd(0x11c),_0x128fdd(0x13d)+_0x468ee9[_0x128fdd(0x168)]);}catch(_0x390b73){_0x36ce4c=!![],console[_0x128fdd(0x160)](_0x128fdd(0x15b)),logger[_0x128fdd(0x14e)](_0x128fdd(0x11c),_0x128fdd(0x149),{'error':_0x390b73 instanceof Error?_0x390b73[_0x128fdd(0x165)]:String(_0x390b73)});}finally{process[_0x128fdd(0x148)](_0x5e38f5);}}logger['success'](_0x128fdd(0x11c),_0x128fdd(0x167)+_0x468ee9[_0x128fdd(0x156)]),console[_0x128fdd(0x160)](),console[_0x128fdd(0x160)](a134_0x360d0e['green']('─'[_0x128fdd(0x133)](0x3c))),console[_0x128fdd(0x160)](a134_0x360d0e[_0x128fdd(0x152)][_0x128fdd(0x12c)](_0x128fdd(0x14f))),console[_0x128fdd(0x160)](),console[_0x128fdd(0x160)](_0x128fdd(0x122)+a134_0x360d0e[_0x128fdd(0x152)]['bold']('cd\x20'+_0x468ee9[_0x128fdd(0x156)]+_0x128fdd(0x14a)+CLI_BIN_NAME+_0x128fdd(0x12b))),_0x36ce4c&&console[_0x128fdd(0x160)]('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a134_0x360d0e[_0x128fdd(0x152)][_0x128fdd(0x12c)](CLI_BIN_NAME+_0x128fdd(0x15c))),console[_0x128fdd(0x160)](a134_0x360d0e['green']('─'[_0x128fdd(0x133)](0x3c)));}catch(_0x1cb933){logger['error'](_0x128fdd(0x11c),_0x128fdd(0x123)+_0x468ee9['projectName'],{'error':_0x1cb933 instanceof Error?_0x1cb933['message']:String(_0x1cb933)});try{a134_0x4f7fc4['existsSync'](_0x18aaf2)&&(console[_0x128fdd(0x160)](_0x128fdd(0x16f)+_0x18aaf2),a134_0x4f7fc4[_0x128fdd(0x13f)](_0x18aaf2,{'recursive':!![],'force':!![]}));}catch{logger[_0x128fdd(0x14e)](_0x128fdd(0x11c),_0x128fdd(0x145)+_0x18aaf2);}throw _0x1cb933;}}async function runTask(_0x11fd49,_0x19e645){const _0x93f174=a134_0x5c3d,_0x4f9299=a134_0x605785(_0x11fd49+'...')[_0x93f174(0x15e)]();try{const _0x35e79c=await _0x19e645();_0x4f9299[_0x93f174(0x126)](),console[_0x93f174(0x160)](''+a134_0x360d0e['green']('\x20√\x20')+_0x11fd49+'\x20'+a134_0x360d0e[_0x93f174(0x12e)]('['+_0x35e79c+']'));}catch(_0x54855f){_0x4f9299[_0x93f174(0x164)](_0x11fd49);throw _0x54855f;}}async function updatePackageJsonName(_0x452dad){const _0x3b2238=a134_0x5c3d,_0x1d55db=a134_0x422514['resolve'](process[_0x3b2238(0x137)](),_0x452dad),_0x57393f=a134_0x422514[_0x3b2238(0x138)](_0x1d55db,_0x3b2238(0x174));try{console[_0x3b2238(0x160)](_0x3b2238(0x16c));const _0x883b8b=getRabetbaseCliPackageRoot(),_0xf15788=a134_0x422514['join'](_0x883b8b,_0x3b2238(0x174));let _0x5dfb7f='1.0.0';try{const _0x3a3844=JSON[_0x3b2238(0x151)](a134_0x4f7fc4[_0x3b2238(0x11d)](_0xf15788,_0x3b2238(0x127)));_0x5dfb7f=_0x3a3844[_0x3b2238(0x146)]||_0x3b2238(0x173);}catch{}const _0x5b13eb=a134_0x4f7fc4['readFileSync'](_0x57393f,_0x3b2238(0x127)),_0x11568b=JSON[_0x3b2238(0x151)](_0x5b13eb);_0x11568b[_0x3b2238(0x139)]=_0x452dad,_0x11568b['description']=_0x452dad+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x5dfb7f,a134_0x4f7fc4[_0x3b2238(0x15f)](_0x57393f,JSON['stringify'](_0x11568b,null,0x2)+'\x0a',_0x3b2238(0x127)),console[_0x3b2238(0x160)](_0x3b2238(0x134)+_0x452dad),logger[_0x3b2238(0x144)]('create',_0x3b2238(0x12a));}catch(_0xd3743b){logger[_0x3b2238(0x11f)](_0x3b2238(0x11c),_0x3b2238(0x13a));throw _0xd3743b;}}async function configureAppCode(_0x3a03d7,_0x165704,_0x3a4979){const _0x207d09=a134_0x5c3d,_0xf474cd=a134_0x422514['resolve'](process['cwd'](),_0x3a03d7),_0x431b73=a134_0x422514[_0x207d09(0x138)](_0xf474cd,NEW_CONFIG_NAME);try{_0x165704?console[_0x207d09(0x160)](_0x207d09(0x14c)+_0x3a03d7+':\x20'+_0x165704):console[_0x207d09(0x160)]('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x3a03d7);const _0x1547a6=getRabetbaseCliPackageRoot(),_0x3c4a1f=a134_0x422514[_0x207d09(0x138)](_0x1547a6,_0x207d09(0x174));let _0x4471c8=_0x207d09(0x173);try{const _0x598c9e=JSON['parse'](a134_0x4f7fc4['readFileSync'](_0x3c4a1f,_0x207d09(0x127)));_0x4471c8=_0x598c9e['version']||_0x207d09(0x173);}catch{}const _0x113b4a=readConfig(),_0x2e75b6=typeof _0x113b4a[_0x207d09(0x120)]===_0x207d09(0x13b)?_0x113b4a['env']:undefined,_0x20f622={};for(const _0x50bd57 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x113b4a[_0x50bd57]!=null)_0x20f622[_0x50bd57]=_0x113b4a[_0x50bd57];}const _0x5c7682=buildCanonicalProjectConfig(_0x20f622,{'appCodes':_0x165704?[_0x165704]:[],'env':_0x3a4979||_0x2e75b6||_0x207d09(0x162),'metadata':{'createdAt':new Date()[_0x207d09(0x16d)](),'version':_0x4471c8}});writeConfigFile(_0x431b73,_0x5c7682),_0x165704?console[_0x207d09(0x160)](_0x207d09(0x154)+Object['keys'](_0x5c7682[_0x207d09(0x159)]||{})['join'](',\x20')+'\x20|\x20Default:\x20'+_0x5c7682[_0x207d09(0x16a)]):console[_0x207d09(0x160)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger[_0x207d09(0x144)](_0x207d09(0x11c),'配置应用AppCode:\x20'+_0x165704);}catch(_0x25b9ac){logger[_0x207d09(0x11f)](_0x207d09(0x11c),_0x207d09(0x131));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4ac796,_0x5c9575){const _0x277387=a135_0x4ebc,_0x22eb26=_0x4ac796();while(!![]){try{const _0x4bf5a5=parseInt(_0x277387(0x200))/0x1*(-parseInt(_0x277387(0x1f1))/0x2)+-parseInt(_0x277387(0x1fe))/0x3+-parseInt(_0x277387(0x210))/0x4*(-parseInt(_0x277387(0x1ef))/0x5)+-parseInt(_0x277387(0x1f8))/0x6+-parseInt(_0x277387(0x204))/0x7+parseInt(_0x277387(0x20e))/0x8*(parseInt(_0x277387(0x1fb))/0x9)+-parseInt(_0x277387(0x1fc))/0xa*(-parseInt(_0x277387(0x21e))/0xb);if(_0x4bf5a5===_0x5c9575)break;else _0x22eb26['push'](_0x22eb26['shift']());}catch(_0x11bf6e){_0x22eb26['push'](_0x22eb26['shift']());}}}(a135_0x1262,0x2e73b));import a135_0xe8dbb1 from'path';import a135_0x5e5b1c from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';function a135_0x4ebc(_0x55e739,_0x4733d4){_0x55e739=_0x55e739-0x1ea;const _0x1262a5=a135_0x1262();let _0x4ebc28=_0x1262a5[_0x55e739];return _0x4ebc28;}function a135_0x1262(){const _0x26104d=['validation','trim','needsUpgrade','\x20\x20√\x20Pulled\x20','770622QdwbMJ','cwd','Project\x20name\x20cannot\x20be\x20empty.','45dpwMWD','20qCIlNh','\x20\x20√\x20package.json\x20updated','311835QJuniD','\x20created\x20successfully!','1JgnxUu','*\x20Creating\x20project\x20','ignore','\x0a√\x20Project\x20','1058246qpmvSk','Project\x20directory\x20\x22','production','bun\x20--version','string','length','package.json','\x20api\x20pull`\x20manually\x20later.','Use\x20a\x20different\x20project\x20name.','npm','201560TFRzBT','\x20model(s)','66684bjxyqD','\x0a\x20\x20cd\x20','chdir','bun','join','resolve','log','access','env','bun\x20run\x20format','writeFile','\x20\x20√\x20Configuration\x20file\x20created','belowMinimum','\x20\x20Pulling\x20API\x20configuration...','2529164bEDKbS','...','\x20\x20√\x20Project\x20template\x20created','Cannot\x20create\x20project\x20in\x20current\x20directory.','dirname','\x20\x20√\x20Code\x20formatted','description','W_OK','\x22\x20already\x20exists.','name','25bESojd','\x20dataset(s),\x20generated\x20','190702peJxJr','constants','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.'];a135_0x1262=function(){return _0x26104d;};return a135_0x1262();}import{fetchModelList}from'../../../core/api-client.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(_0x1fee81,_0x396f8a,_0x527f7c,_0x5056ec){const _0x141098=a135_0x4ebc,_0xd1c2e0=await checkCliVersion();(_0xd1c2e0[_0x141098(0x1f6)]||_0xd1c2e0[_0x141098(0x21c)])&&(printCliUpgradeWarning(_0xd1c2e0),assertCliVersionSupported(_0xd1c2e0));if(!_0x1fee81||_0x1fee81[_0x141098(0x1f5)]()==='')throw CliErrors[_0x141098(0x1f4)](_0x141098(0x1fa));const _0x1bb677=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x1bb677['test'](_0x1fee81))throw CliErrors['validation']('Project\x20name\x20contains\x20invalid\x20characters.','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters');if(_0x1fee81[_0x141098(0x209)]>0x64)throw CliErrors[_0x141098(0x1f4)](_0x141098(0x1f3));const _0x46ddf6=a135_0xe8dbb1['resolve'](process[_0x141098(0x1f9)](),_0x1fee81);if(existsSync(_0x46ddf6))throw CliErrors[_0x141098(0x1f4)](_0x141098(0x205)+_0x1fee81+_0x141098(0x1ed),_0x141098(0x20c));try{const _0x2b7780=a135_0xe8dbb1[_0x141098(0x222)](_0x46ddf6);await a135_0x5e5b1c[_0x141098(0x217)](_0x2b7780,a135_0x5e5b1c[_0x141098(0x1f2)][_0x141098(0x1ec)]);}catch{throw CliErrors[_0x141098(0x1f4)](_0x141098(0x221),'Check\x20directory\x20permissions.');}try{console[_0x141098(0x216)](_0x141098(0x201)+_0x1fee81+_0x141098(0x21f));const _0x224e82=getSubAppReactDemoTemplateDir();await copyDirectory(_0x224e82,_0x46ddf6),console[_0x141098(0x216)](_0x141098(0x220)),await updatePackageJsonName(_0x1fee81),console[_0x141098(0x216)](_0x141098(0x1fd)),console[_0x141098(0x216)]('\x20\x20Installing\x20dependencies...'),console[_0x141098(0x216)]('\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)'),await formatCode(_0x46ddf6),console[_0x141098(0x216)](_0x141098(0x1ea)),await configureProject(_0x1fee81,_0x527f7c,_0x396f8a),console['log'](_0x141098(0x21b)),_0x527f7c&&await pullApiConfig(_0x46ddf6,_0x527f7c,_0x396f8a,_0x5056ec),console[_0x141098(0x216)](_0x141098(0x203)+_0x1fee81+_0x141098(0x1ff)),console['log'](_0x141098(0x211)+_0x1fee81),console[_0x141098(0x216)]('\x20\x20rabetbase\x20run\x20start\x0a');}catch(_0x166f77){try{existsSync(_0x46ddf6)&&await a135_0x5e5b1c['rm'](_0x46ddf6,{'recursive':!![],'force':!![]});}catch{}throw _0x166f77;}}async function updatePackageJsonName(_0x4ee0fa){const _0x619046=a135_0x4ebc,_0x4a7a04=a135_0xe8dbb1[_0x619046(0x215)](process['cwd'](),_0x4ee0fa),_0x2f5a93=a135_0xe8dbb1[_0x619046(0x214)](_0x4a7a04,_0x619046(0x20a)),_0x30bdf6=await a135_0x5e5b1c['readFile'](_0x2f5a93,'utf-8'),_0x36b316=JSON['parse'](_0x30bdf6);_0x36b316[_0x619046(0x1ee)]=_0x4ee0fa,_0x36b316[_0x619046(0x1eb)]='A\x20project\x20created\x20with\x20Lovrabet\x20CLI',await a135_0x5e5b1c[_0x619046(0x21a)](_0x2f5a93,JSON['stringify'](_0x36b316,null,0x2)+'\x0a');}function detectPackageManager(){const _0x1cd8a9=a135_0x4ebc;try{return execSync(_0x1cd8a9(0x207),{'stdio':_0x1cd8a9(0x202)}),_0x1cd8a9(0x213);}catch{return _0x1cd8a9(0x20d);}}async function formatCode(_0x17c8cb){const _0x14e874=a135_0x4ebc;try{await execAsync(_0x14e874(0x219),{'cwd':_0x17c8cb});}catch{}}async function configureProject(_0x2d8ea7,_0x386229,_0x276e41){const _0x5ee13a=a135_0x4ebc,_0x546ad6=a135_0xe8dbb1[_0x5ee13a(0x215)](process['cwd'](),_0x2d8ea7),_0x1ca978=a135_0xe8dbb1[_0x5ee13a(0x214)](_0x546ad6,NEW_CONFIG_NAME),_0xc7d596=readConfig(),_0x7bc0ac=typeof _0xc7d596[_0x5ee13a(0x218)]===_0x5ee13a(0x208)?_0xc7d596[_0x5ee13a(0x218)]:undefined,_0x44ad19={};for(const _0x1853ea of PROJECT_CREATE_INHERITABLE_KEYS){if(_0xc7d596[_0x1853ea]!=null)_0x44ad19[_0x1853ea]=_0xc7d596[_0x1853ea];}const _0x26edd5=buildCanonicalProjectConfig(_0x44ad19,{'appCodes':_0x386229?[_0x386229]:[],'env':_0x276e41||_0x7bc0ac||_0x5ee13a(0x206),'metadata':{'createdAt':new Date()['toLocaleString'](),'version':getCliVersion()}});writeConfigFile(_0x1ca978,_0x26edd5);}async function pullApiConfig(_0x333e06,_0xf11c2b,_0x24ac83,_0x19b8fe){const _0x55781f=a135_0x4ebc,_0x3d0930=process['cwd']();try{process[_0x55781f(0x212)](_0x333e06);const _0x26b3a9=_0x24ac83||_0x55781f(0x206);initEnv(_0x26b3a9),console[_0x55781f(0x216)](_0x55781f(0x21d));const {configArray:_0x18522c}=await fetchModelList(_0xf11c2b,_0x19b8fe||''),_0x4c11f4=await generateApiFile(_0x18522c,'',_0xf11c2b,!![],_0x26b3a9,DEFAULT_API_DIR);console[_0x55781f(0x216)](_0x55781f(0x1f7)+_0x18522c[_0x55781f(0x209)]+_0x55781f(0x1f0)+_0x4c11f4['modelCount']+_0x55781f(0x20f));}catch(_0x3b239e){console[_0x55781f(0x216)]('\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`'+CLI_BIN_NAME+_0x55781f(0x20b));}finally{process['chdir'](_0x3d0930);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a136_0xacde18=a136_0x3a70;(function(_0x535bcb,_0x150eb6){const _0x4d320e=a136_0x3a70,_0x2f7bbc=_0x535bcb();while(!![]){try{const _0xb4bcd=parseInt(_0x4d320e(0x9b))/0x1+parseInt(_0x4d320e(0x9f))/0x2+parseInt(_0x4d320e(0x9e))/0x3*(parseInt(_0x4d320e(0x9c))/0x4)+-parseInt(_0x4d320e(0x9a))/0x5*(-parseInt(_0x4d320e(0xa3))/0x6)+parseInt(_0x4d320e(0x99))/0x7*(-parseInt(_0x4d320e(0xa4))/0x8)+-parseInt(_0x4d320e(0xa0))/0x9*(parseInt(_0x4d320e(0x9d))/0xa)+parseInt(_0x4d320e(0xa5))/0xb*(-parseInt(_0x4d320e(0xa7))/0xc);if(_0xb4bcd===_0x150eb6)break;else _0x2f7bbc['push'](_0x2f7bbc['shift']());}catch(_0x4bc0a8){_0x2f7bbc['push'](_0x2f7bbc['shift']());}}}(a136_0x24b2,0x7823b));import a136_0x1238e0 from'node:path';import{fileURLToPath}from'node:url';const __dirname=a136_0x1238e0[a136_0xacde18(0xa1)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){return a136_0x1238e0['resolve'](__dirname,'../../../../');}export function getSubAppReactDemoTemplateDir(){const _0x45b24c=a136_0xacde18;return a136_0x1238e0['join'](getRabetbaseCliPackageRoot(),'templates',_0x45b24c(0xa2),_0x45b24c(0xa6));}function a136_0x3a70(_0x2ea756,_0x652fc3){_0x2ea756=_0x2ea756-0x99;const _0x24b242=a136_0x24b2();let _0x3a707c=_0x24b242[_0x2ea756];return _0x3a707c;}function a136_0x24b2(){const _0x43516c=['projects','4765158NqCmrs','467912eCutwQ','8453577kLOjrb','sub-app-react-demo','12UOOYeE','70UWptCV','5jJOgSt','80088BGYyhO','2892324fuxgbP','30MKaFaw','3ZXIYyk','511396nvvRZp','22716RhSJGw','dirname'];a136_0x24b2=function(){return _0x43516c;};return a136_0x24b2();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a137_0x49c0(_0x5dfbd0,_0x3d24d2){_0x5dfbd0=_0x5dfbd0-0x1f1;const _0x4afb32=a137_0x4afb();let _0x49c0e3=_0x4afb32[_0x5dfbd0];return _0x49c0e3;}(function(_0x1c3b78,_0x1ebef0){const _0x48dd41=a137_0x49c0,_0x1f5291=_0x1c3b78();while(!![]){try{const _0x4bdd4f=-parseInt(_0x48dd41(0x201))/0x1*(-parseInt(_0x48dd41(0x1f2))/0x2)+-parseInt(_0x48dd41(0x202))/0x3*(parseInt(_0x48dd41(0x1f9))/0x4)+-parseInt(_0x48dd41(0x1fa))/0x5+parseInt(_0x48dd41(0x1f8))/0x6+-parseInt(_0x48dd41(0x200))/0x7+parseInt(_0x48dd41(0x1fe))/0x8+-parseInt(_0x48dd41(0x1f4))/0x9;if(_0x4bdd4f===_0x1ebef0)break;else _0x1f5291['push'](_0x1f5291['shift']());}catch(_0x1224e9){_0x1f5291['push'](_0x1f5291['shift']());}}}(a137_0x4afb,0xc6efc));import a137_0x50fc32 from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();function a137_0x4afb(){const _0x2182ba=['info','copy','6781926nvvVCb','92620JsILiU','2352265OqSgdO','cwd','message','项目模板复制完成','12184432ZxWjMo','now','4774427CVnydz','579085ccEMhn','12OiAmRc','resolve','2YFUuaK','success','10552338leHIYj','项目模板复制失败'];a137_0x4afb=function(){return _0x2182ba;};return a137_0x4afb();}export async function copyProjectTemplate(_0x317e37){const _0x573451=a137_0x49c0,_0x5378b3=Date[_0x573451(0x1ff)](),_0x26059d=a137_0x50fc32[_0x573451(0x1f1)](process[_0x573451(0x1fb)](),_0x317e37);try{logger[_0x573451(0x1f6)](_0x573451(0x1f7),'开始复制项目模板',{'projectCode':_0x317e37,'templateDir':templateDir}),await copyDirectory(templateDir,_0x26059d);const _0x52499d=Date['now']()-_0x5378b3;logger[_0x573451(0x1f3)](_0x573451(0x1f7),_0x573451(0x1fd),_0x52499d,{'projectCode':_0x317e37});}catch(_0x2f3f77){const _0x434c0d=Date['now']()-_0x5378b3;logger['error'](_0x573451(0x1f7),_0x573451(0x1f5),{'projectCode':_0x317e37,'error':_0x2f3f77 instanceof Error?_0x2f3f77[_0x573451(0x1fc)]:String(_0x2f3f77),'duration':_0x434c0d});throw _0x2f3f77;}return formatElapsed(_0x5378b3);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x55c8ab,_0x566169){const _0x4b2c90=a138_0x456f,_0x40e2fb=_0x55c8ab();while(!![]){try{const _0x284b20=-parseInt(_0x4b2c90(0x15b))/0x1*(parseInt(_0x4b2c90(0x150))/0x2)+-parseInt(_0x4b2c90(0x15f))/0x3*(parseInt(_0x4b2c90(0x156))/0x4)+-parseInt(_0x4b2c90(0x152))/0x5+-parseInt(_0x4b2c90(0x158))/0x6+parseInt(_0x4b2c90(0x151))/0x7*(-parseInt(_0x4b2c90(0x161))/0x8)+-parseInt(_0x4b2c90(0x15a))/0x9*(parseInt(_0x4b2c90(0x155))/0xa)+-parseInt(_0x4b2c90(0x14c))/0xb*(-parseInt(_0x4b2c90(0x160))/0xc);if(_0x284b20===_0x566169)break;else _0x40e2fb['push'](_0x40e2fb['shift']());}catch(_0xd36116){_0x40e2fb['push'](_0x40e2fb['shift']());}}}(a138_0x10d5,0x2a2ad));function a138_0x10d5(){const _0x34a64d=['format','--write','开始格式化代码','2OhQSNj','301574souWGj','17925pVPfbb','cwd','代码格式化完成','1702430SroIHF','64FMhtGU','npx','984780Gnirpk','now','18cbWMjN','328003uFtRyi','info','success','message','33585GuLsvL','801972BleZMe','40AjQfnr','231zWAEXX'];a138_0x10d5=function(){return _0x34a64d;};return a138_0x10d5();}import a138_0x1325e1 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a138_0x456f(_0x36259c,_0x5edfca){_0x36259c=_0x36259c-0x14c;const _0x10d550=a138_0x10d5();let _0x456fb4=_0x10d550[_0x36259c];return _0x456fb4;}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x1ee6ce){const _0x377780=a138_0x456f,_0x25a1e2=Date[_0x377780(0x159)](),_0x2afe7e=a138_0x1325e1['resolve'](process[_0x377780(0x153)](),_0x1ee6ce);try{logger[_0x377780(0x15c)](_0x377780(0x14d),_0x377780(0x14f),{'projectCode':_0x1ee6ce}),await execa(resolveNpmBin(_0x377780(0x157)),['prettier',_0x377780(0x14e),'.'],{'cwd':_0x2afe7e});const _0x13717a=Date[_0x377780(0x159)]()-_0x25a1e2;logger[_0x377780(0x15d)]('format',_0x377780(0x154),_0x13717a,{'projectCode':_0x1ee6ce});}catch(_0x13ae36){const _0x1e4f5f=Date[_0x377780(0x159)]()-_0x25a1e2;logger['error'](_0x377780(0x14d),'代码格式化失败',{'projectCode':_0x1ee6ce,'error':_0x13ae36 instanceof Error?_0x13ae36[_0x377780(0x15e)]:String(_0x13ae36),'duration':_0x1e4f5f});throw _0x13ae36;}return formatElapsed(_0x25a1e2);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a139_0x7c6d(){const _0x377258=['install','19173xthqpk','8140099PsczsR','142SabJjq','https://registry.npmmirror.com','3TcwCGZ','cwd','依赖安装完成','1302okmxVh','开始安装依赖','info','7138390OpFekk','8304575bbDYkc','5917640SQQZDx','12lbSIwm','423UZKRSG','13588UGGFop','71992UEGBRw','--registry','now'];a139_0x7c6d=function(){return _0x377258;};return a139_0x7c6d();}function a139_0x28aa(_0x79f79a,_0x20a476){_0x79f79a=_0x79f79a-0x179;const _0x7c6d35=a139_0x7c6d();let _0x28aaa3=_0x7c6d35[_0x79f79a];return _0x28aaa3;}(function(_0x390e5f,_0x1c22bf){const _0x3e33a0=a139_0x28aa,_0x1745c6=_0x390e5f();while(!![]){try{const _0x30a157=parseInt(_0x3e33a0(0x181))/0x1*(-parseInt(_0x3e33a0(0x188))/0x2)+parseInt(_0x3e33a0(0x18a))/0x3*(parseInt(_0x3e33a0(0x17e))/0x4)+parseInt(_0x3e33a0(0x17d))/0x5+parseInt(_0x3e33a0(0x179))/0x6*(parseInt(_0x3e33a0(0x186))/0x7)+-parseInt(_0x3e33a0(0x182))/0x8*(parseInt(_0x3e33a0(0x180))/0x9)+-parseInt(_0x3e33a0(0x17c))/0xa+-parseInt(_0x3e33a0(0x187))/0xb*(parseInt(_0x3e33a0(0x17f))/0xc);if(_0x30a157===_0x1c22bf)break;else _0x1745c6['push'](_0x1745c6['shift']());}catch(_0x54ab27){_0x1745c6['push'](_0x1745c6['shift']());}}}(a139_0x7c6d,0xda0d3));import a139_0x1c348b 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';export async function installDependencies(_0x161126){const _0x221798=a139_0x28aa,_0x3b4409=Date[_0x221798(0x184)](),_0x453756=a139_0x1c348b['resolve'](process[_0x221798(0x18b)](),_0x161126);try{logger[_0x221798(0x17b)](_0x221798(0x185),_0x221798(0x17a),{'projectCode':_0x161126,'registry':_0x221798(0x189)}),await execa(resolveNpmBin('npm'),[_0x221798(0x185),_0x221798(0x183),_0x221798(0x189)],{'cwd':_0x453756});const _0x4337bb=Date[_0x221798(0x184)]()-_0x3b4409;logger['success']('install',_0x221798(0x18c),_0x4337bb,{'projectCode':_0x161126});}catch(_0x6b4829){const _0x1f49c5=Date['now']()-_0x3b4409;logger['error'](_0x221798(0x185),'依赖安装失败',{'projectCode':_0x161126,'error':_0x6b4829 instanceof Error?_0x6b4829['message']:String(_0x6b4829),'duration':_0x1f49c5});throw _0x6b4829;}return formatElapsed(_0x3b4409);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a140_0x1eb753=a140_0x1da1;(function(_0x40a6c6,_0x56e5b9){const _0x3d1839=a140_0x1da1,_0x386e73=_0x40a6c6();while(!![]){try{const _0x512034=parseInt(_0x3d1839(0x152))/0x1+parseInt(_0x3d1839(0x155))/0x2+parseInt(_0x3d1839(0x143))/0x3+parseInt(_0x3d1839(0x15a))/0x4*(-parseInt(_0x3d1839(0x162))/0x5)+-parseInt(_0x3d1839(0x13f))/0x6+-parseInt(_0x3d1839(0x163))/0x7*(-parseInt(_0x3d1839(0x156))/0x8)+-parseInt(_0x3d1839(0x160))/0x9*(-parseInt(_0x3d1839(0x145))/0xa);if(_0x512034===_0x56e5b9)break;else _0x386e73['push'](_0x386e73['shift']());}catch(_0x5f405a){_0x386e73['push'](_0x386e73['shift']());}}}(a140_0x2e4f,0x9c55c));function a140_0x1da1(_0x40644f,_0x55591c){_0x40644f=_0x40644f-0x13e;const _0x2e4f92=a140_0x2e4f();let _0x1da166=_0x2e4f92[_0x40644f];return _0x1da166;}function a140_0x2e4f(){const _0x2d9b5d=['trim','../../commands/project/create/main.js','create','87801rLndxL','boolean','Target\x20environment','940TBVKAT','176584hapEBU','project-name','project','cookie','5408SzTqGe','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','Project\x20name','\x20workspace\x20init','str','name','885375HkDIqn','nonInteractive','3640ChxnXK','77pZEQHE','args','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','5169630cOpqCK','2026-07','Skip\x20confirmation\x20prompt','App\x20code\x20to\x20initialize','2923905zuRQDg','env','120ExzYKk','string','appcode','Usage:\x20','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','write','bool','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','Auto-confirm\x20prompts','yes'];a140_0x2e4f=function(){return _0x2d9b5d;};return a140_0x2e4f();}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':'appcode','type':a140_0x1eb753(0x146),'description':a140_0x1eb753(0x142)},{'name':'env','type':a140_0x1eb753(0x146),'description':a140_0x1eb753(0x154)},{'name':a140_0x1eb753(0x14e),'type':a140_0x1eb753(0x153),'description':a140_0x1eb753(0x14d),'default':![]}],createFlags=[{'name':a140_0x1eb753(0x15f),'type':a140_0x1eb753(0x146),'description':a140_0x1eb753(0x15c)},{'name':a140_0x1eb753(0x144),'type':'string','description':a140_0x1eb753(0x154)},{'name':a140_0x1eb753(0x147),'type':a140_0x1eb753(0x146),'description':a140_0x1eb753(0x15b)}],upgradeFlags=[{'name':a140_0x1eb753(0x14e),'type':a140_0x1eb753(0x153),'description':a140_0x1eb753(0x141),'default':![]}];export const projectDefinitions=[{'service':'project','command':'init','description':a140_0x1eb753(0x13e),'risk':a140_0x1eb753(0x14a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a140_0x1eb753(0x15d),'since':a140_0x1eb753(0x140)},'flags':initFlags,async 'execute'(_0x3df17d){const _0x47b24c=a140_0x1eb753;return await initConfig({'appcode':_0x3df17d[_0x47b24c(0x15e)](_0x47b24c(0x147))||undefined,'env':_0x3df17d[_0x47b24c(0x15e)](_0x47b24c(0x144))||undefined,'autoYes':_0x3df17d[_0x47b24c(0x14b)](_0x47b24c(0x14e))}),{'ok':!![]};}},{'service':a140_0x1eb753(0x158),'command':a140_0x1eb753(0x151),'description':'Create\x20a\x20new\x20project','risk':a140_0x1eb753(0x14a),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a140_0x1eb753(0x157),'description':a140_0x1eb753(0x149),'required':![]}],'flags':createFlags,async 'execute'(_0x59183c){const _0x479984=a140_0x1eb753,{createApp:_0x75d615}=await import(_0x479984(0x150)),{createProjectNonInteractive:_0x12c9f0}=await import('../../commands/project/create/non-interactive.js'),_0x35d2a4=_0x59183c['str'](_0x479984(0x15f))[_0x479984(0x14f)]()||_0x59183c[_0x479984(0x164)][0x0]?.['trim'](),_0x5c3645=_0x59183c[_0x479984(0x15e)](_0x479984(0x144))||undefined,_0x1c5540=_0x59183c['str'](_0x479984(0x147))||undefined;if(_0x59183c[_0x479984(0x161)]){if(!_0x35d2a4)throw CliErrors['validation']('Non-interactive\x20mode\x20requires\x20a\x20project\x20name.',_0x479984(0x148)+CLI_BIN_NAME+'\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]');await _0x12c9f0(_0x35d2a4,_0x5c3645,_0x1c5540,_0x59183c['cookie']);}else await _0x75d615({'projectCode':_0x35d2a4,'appCode':_0x1c5540,'env':_0x5c3645,'cookie':_0x59183c[_0x479984(0x159)]});return{'ok':!![]};}},{'service':a140_0x1eb753(0x158),'command':'upgrade','description':a140_0x1eb753(0x14c),'risk':a140_0x1eb753(0x14a),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x3752b2){const _0x17ac64=a140_0x1eb753;return await upgradeApp(_0x3752b2[_0x17ac64(0x161)],{'yes':_0x3752b2['bool'](_0x17ac64(0x14e))}),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x23c2cf,_0x218d55){const _0x235e6e=a141_0x58a0,_0x39fb52=_0x23c2cf();while(!![]){try{const _0x352f4b=-parseInt(_0x235e6e(0x12f))/0x1+-parseInt(_0x235e6e(0x144))/0x2*(parseInt(_0x235e6e(0x127))/0x3)+parseInt(_0x235e6e(0x118))/0x4*(parseInt(_0x235e6e(0x11c))/0x5)+-parseInt(_0x235e6e(0x11f))/0x6+-parseInt(_0x235e6e(0x11b))/0x7*(parseInt(_0x235e6e(0x112))/0x8)+parseInt(_0x235e6e(0x117))/0x9+parseInt(_0x235e6e(0x141))/0xa;if(_0x352f4b===_0x218d55)break;else _0x39fb52['push'](_0x39fb52['shift']());}catch(_0xf9308b){_0x39fb52['push'](_0x39fb52['shift']());}}}(a141_0x3298,0x60aca));import{readFileSync,existsSync,renameSync}from'node:fs';function a141_0x58a0(_0x32e072,_0xfb1660){_0x32e072=_0x32e072-0x111;const _0x32982f=a141_0x3298();let _0x58a062=_0x32982f[_0x32e072];return _0x58a062;}function a141_0x3298(){const _0x117fac=['trim','appcode','info','\x20api\x20generate\x27\x20and\x20\x27','21AJkEuL','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','toLocaleString','\x20→\x20.rabetbase.json','yellow','log','setLogPath','../..','260688wqdMOM','gray','parse','\x20\x20appcode:\x20','cwd','apps','Invalid\x20App\x20Code','keys','Migration\x20cancelled.\x20Run\x20`','green','✓\x20Upgraded\x20','bold','defaultApp','1.0.0','.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','init','\x20api\x20pull\x27','join','9843370gdNjNv','Please\x20enter\x20App\x20Code:','\x20\x20Apps:\x20','61596akGXoz','从旧配置文件升级成功','632ITAwRW','version','Upgrade\x20it\x20to\x20','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','.bak','4352274sWHzPJ','12252CZJLdO','production','\x20\x20Default:\x20','52367sVXwcI','110LMGHtf','env','utf8','432348RXEBHO','cyan','string','app'];a141_0x3298=function(){return _0x117fac;};return a141_0x3298();}import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a141_0x162db1 from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x464843){const _0x5bd512=a141_0x58a0,{appcode:_0x2385db,env:_0xd642e9,autoYes:_0xb0edf4}=_0x464843,_0xd5cebe=process[_0x5bd512(0x133)]();if(getProjectConfigPath())throw new Error(_0x5bd512(0x13d));let _0xda2fcf;for(const _0x434d2f of LEGACY_CONFIG_NAMES){const _0x44bf9a=resolve(_0xd5cebe,_0x434d2f);if(existsSync(_0x44bf9a)){_0xda2fcf=_0x44bf9a;break;}}if(_0xda2fcf){let _0x2d34f8={};try{_0x2d34f8=JSON['parse'](readFileSync(_0xda2fcf,_0x5bd512(0x11e)));}catch{}const _0x42d16b=basename(_0xda2fcf),_0x53fe5c=_0x2d34f8?.[_0x5bd512(0x124)]||_0x2d34f8?.['app'];let _0x3c0e3e=_0xb0edf4;!_0xb0edf4&&(console[_0x5bd512(0x12c)](a141_0x162db1[_0x5bd512(0x12b)](_0x5bd512(0x128)+a141_0x162db1[_0x5bd512(0x13a)](_0x42d16b))),_0x53fe5c&&console[_0x5bd512(0x12c)](a141_0x162db1[_0x5bd512(0x120)](_0x5bd512(0x132)+_0x53fe5c)),_0x3c0e3e=await confirm({'message':_0x5bd512(0x114)+a141_0x162db1['bold']('.rabetbase.json')+'?\x20(Old\x20file\x20→\x20*.bak)','default':!![]}));if(!_0x3c0e3e){console['log'](_0x5bd512(0x137)+CLI_BIN_NAME+'\x20workspace\x20init`\x20to\x20start\x20fresh.');return;}const _0x55f872=resolve(_0xd5cebe,NEW_CONFIG_NAME),_0x30aa65=getCliVersionFromPkg(),_0xda2b44=readRawConfig(),_0xee15ce=_0x2385db||(typeof _0x2d34f8?.[_0x5bd512(0x124)]===_0x5bd512(0x121)?_0x2d34f8[_0x5bd512(0x124)]:undefined)||(typeof _0x2d34f8?.['app']==='string'?_0x2d34f8[_0x5bd512(0x122)]:undefined)||await askAppcode(),_0x43cbc2=typeof _0x2d34f8?.['env']===_0x5bd512(0x121)?_0x2d34f8[_0x5bd512(0x11d)]:typeof _0xda2b44['env']===_0x5bd512(0x121)?_0xda2b44[_0x5bd512(0x11d)]:_0x5bd512(0x119),_0x11b8f2=buildCanonicalProjectConfig({..._0xda2b44,..._0x2d34f8},{'appCodes':[_0xee15ce],'env':_0x43cbc2,'metadata':{'version':_0x30aa65,'migratedAt':new Date()['toLocaleString'](),'migratedFrom':_0xda2fcf}});writeConfigFile(_0x55f872,_0x11b8f2);const _0x11e3aa=_0xda2fcf+_0x5bd512(0x116);renameSync(_0xda2fcf,_0x11e3aa),logger[_0x5bd512(0x12d)](_0xd5cebe),logger[_0x5bd512(0x125)](_0x5bd512(0x13e),_0x5bd512(0x111),{'from':_0xda2fcf,'to':_0x55f872,'appcode':_0xee15ce,'env':_0x11b8f2[_0x5bd512(0x11d)]}),console[_0x5bd512(0x12c)](a141_0x162db1['green'](_0x5bd512(0x139)+_0x42d16b+_0x5bd512(0x12a))),console[_0x5bd512(0x12c)](a141_0x162db1[_0x5bd512(0x120)]('\x20\x20Apps:\x20'+Object['keys'](_0x11b8f2[_0x5bd512(0x134)]||{})[_0x5bd512(0x140)](',\x20'))),console['log'](a141_0x162db1[_0x5bd512(0x120)](_0x5bd512(0x11a)+_0x11b8f2[_0x5bd512(0x13b)])),console[_0x5bd512(0x12c)](a141_0x162db1[_0x5bd512(0x130)]('\x20\x20Old\x20file\x20backed\x20up\x20as\x20'+_0x42d16b+_0x5bd512(0x116)));return;}const _0x264da2=_0x2385db||await askAppcode(),_0x2583fa=resolve(_0xd5cebe,NEW_CONFIG_NAME),_0x732d0b=getCliVersionFromPkg(),_0x402921=readRawConfig(),_0x2a8775=typeof _0x402921[_0x5bd512(0x11d)]==='string'?_0x402921[_0x5bd512(0x11d)]:undefined,_0x5df00a=buildCanonicalProjectConfig({},{'appCodes':[_0x264da2],'env':_0xd642e9||_0x2a8775||_0x5bd512(0x119),'metadata':{'version':_0x732d0b,'createdAt':new Date()[_0x5bd512(0x129)]()}});writeConfigFile(_0x2583fa,_0x5df00a),logger[_0x5bd512(0x12d)](_0xd5cebe),logger[_0x5bd512(0x125)]('init','初始化项目配置文件成功',{'appcode':_0x264da2,'env':_0x5df00a['env'],'version':_0x5df00a[_0x5bd512(0x113)],'configPath':_0x2583fa}),console['log'](a141_0x162db1[_0x5bd512(0x138)]('✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory')),console['log'](a141_0x162db1[_0x5bd512(0x120)](_0x5bd512(0x143)+Object[_0x5bd512(0x136)](_0x5df00a['apps']||{})[_0x5bd512(0x140)](',\x20'))),console[_0x5bd512(0x12c)](a141_0x162db1['cyan'](_0x5bd512(0x11a)+_0x5df00a['defaultApp'])),console[_0x5bd512(0x12c)](_0x5bd512(0x115)+CLI_BIN_NAME+_0x5bd512(0x126)+CLI_BIN_NAME+_0x5bd512(0x13f));}function askAppcode(){const _0x279d10=a141_0x58a0;return input({'message':_0x279d10(0x142),'validate':_0x2eeb93=>{const _0x503fa0=_0x279d10;if(!_0x2eeb93[_0x503fa0(0x123)]())return'App\x20Code\x20cannot\x20be\x20empty';const {valid:_0x1af7c2,message:_0x906cf3}=validateAppcode(_0x2eeb93[_0x503fa0(0x123)]());return _0x1af7c2||_0x906cf3||_0x503fa0(0x135);}});}function getCliVersionFromPkg(){const _0x942aad=a141_0x58a0;try{const _0x2d15b9=fileURLToPath(import.meta.url),_0x4f46ad=resolve(dirname(_0x2d15b9),_0x942aad(0x12e)),_0x5c8ffc=JSON[_0x942aad(0x131)](readFileSync(resolve(_0x4f46ad,'package.json'),_0x942aad(0x11e)));return _0x5c8ffc[_0x942aad(0x113)]||_0x942aad(0x13c);}catch{return'1.0.0';}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a140_0x5aeff0=a140_0x1f14;(function(_0x2d8ca5,_0x279048){const _0x5cd184=a140_0x1f14,_0x457ad1=_0x2d8ca5();while(!![]){try{const _0x17afce=-parseInt(_0x5cd184(0x192))/0x1*(-parseInt(_0x5cd184(0x1c3))/0x2)+parseInt(_0x5cd184(0x1ad))/0x3+-parseInt(_0x5cd184(0x196))/0x4+parseInt(_0x5cd184(0x165))/0x5+parseInt(_0x5cd184(0x19b))/0x6+-parseInt(_0x5cd184(0x1bd))/0x7*(-parseInt(_0x5cd184(0x1d6))/0x8)+parseInt(_0x5cd184(0x1e4))/0x9;if(_0x17afce===_0x279048)break;else _0x457ad1['push'](_0x457ad1['shift']());}catch(_0x102e0c){_0x457ad1['push'](_0x457ad1['shift']());}}}(a140_0x118a,0xeb101));import a140_0x28b79e from'chalk';function a140_0x1f14(_0x5614dd,_0x37c2ab){_0x5614dd=_0x5614dd-0x164;const _0x118a7d=a140_0x118a();let _0x1f1426=_0x118a7d[_0x5614dd];return _0x1f1426;}import a140_0x17babd 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[a140_0x5aeff0(0x1af)](_0x536535=>_0x536535!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x442103){const _0x3b79f2=a140_0x5aeff0,_0x165214=[];for(const _0x2ba53f of Object[_0x3b79f2(0x1da)](CORE_IDE_CONFIGS)){if(_0x2ba53f[_0x3b79f2(0x18f)])for(const _0x4da879 of _0x2ba53f[_0x3b79f2(0x18f)]){_0x165214[_0x3b79f2(0x1e1)](resolve(_0x442103,_0x4da879[_0x3b79f2(0x1b5)]));}}return _0x165214;}function analyse(_0x31b317){const _0x36afe8=a140_0x5aeff0;let _0x1f2a14=null;const _0x3054d2=resolve(_0x31b317,NEW_CONFIG_NAME),_0xf92526=existsSync(_0x3054d2);for(const _0x2f2fe5 of LEGACY_CONFIG_NAMES){const _0x3eb1ea=resolve(_0x31b317,_0x2f2fe5);if(existsSync(_0x3eb1ea)){const _0x4f2bcb=readConfigFile(_0x3eb1ea),_0x5e4910=Object['keys'](_0x4f2bcb)['filter'](_0x332c5c=>typeof _0x4f2bcb[_0x332c5c]!==_0x36afe8(0x190));_0x1f2a14={'oldPath':_0x3eb1ea,'hasNewConfig':_0xf92526,'fields':_0x5e4910};break;}}const _0x4bbde7=[],_0x1a0d0e=resolve(_0x31b317,'.lovrabet');if(existsSync(_0x1a0d0e))_0x4bbde7[_0x36afe8(0x1e1)](_0x1a0d0e);const _0x53cd28=resolve(_0x31b317,_0x36afe8(0x16e));if(existsSync(_0x53cd28))_0x4bbde7[_0x36afe8(0x1e1)](_0x53cd28);const _0x5d7bdf=resolve(_0x31b317,_0x36afe8(0x1c5));if(existsSync(_0x5d7bdf))_0x4bbde7[_0x36afe8(0x1e1)](_0x5d7bdf);for(const _0x1aa38c of collectIdeSkillFiles(_0x31b317)){if(existsSync(_0x1aa38c))_0x4bbde7[_0x36afe8(0x1e1)](_0x1aa38c);}let _0x1057cf=null;const _0x1a5683=resolve(_0x31b317,_0x36afe8(0x1a3));if(existsSync(_0x1a5683))try{const _0x4b8ed5=JSON[_0x36afe8(0x19c)](readFileSync(_0x1a5683,_0x36afe8(0x1bb)));if(_0x4b8ed5?.[_0x36afe8(0x1e3)]&&typeof _0x4b8ed5[_0x36afe8(0x1e3)]===_0x36afe8(0x1ac)){const _0x5e835a=[];for(const [_0x2a37d7,_0x37350e]of Object[_0x36afe8(0x18c)](_0x4b8ed5[_0x36afe8(0x1e3)])){const _0x3c1296=_0x37350e;_0x3c1296?.['args']&&Array[_0x36afe8(0x175)](_0x3c1296[_0x36afe8(0x1ae)])&&_0x3c1296[_0x36afe8(0x1ae)][_0x36afe8(0x17c)](_0x4319db=>typeof _0x4319db===_0x36afe8(0x1ce)&&_0x4319db[_0x36afe8(0x1b0)]('@lovrabet/dataset-mcp-server'))&&_0x5e835a[_0x36afe8(0x1e1)](_0x2a37d7);}_0x5e835a['length']>0x0&&(_0x1057cf={'path':_0x1a5683,'keys':_0x5e835a});}}catch{}const _0x371291=_0x4bbde7[_0x36afe8(0x179)]>0x0||_0x1f2a14!==null;let _0x435483=null;const _0x28492e=resolve(_0x31b317,'package.json');if(existsSync(_0x28492e))try{const _0x35a7e4=JSON[_0x36afe8(0x19c)](readFileSync(_0x28492e,_0x36afe8(0x1bb)));for(const _0x55f496 of['dependencies',_0x36afe8(0x178)]){const _0x6ef759=_0x35a7e4?.[_0x55f496]?.['@lovrabet/sdk'];if(typeof _0x6ef759==='string'){_0x6ef759!=='latest'&&(_0x435483={'pkgPath':_0x28492e,'currentVersion':_0x6ef759,'field':_0x55f496});break;}}}catch{}return{'configMigration':_0x1f2a14,'oldArtifacts':_0x4bbde7,'oldMcpConfig':_0x1057cf,'needsSkillSwap':_0x371291,'sdkUpgrade':_0x435483};}function printReport(_0x3deda1){const _0x1ff49f=a140_0x5aeff0,{configMigration:_0x439f50,oldArtifacts:_0x42db20,oldMcpConfig:_0x3bef23,needsSkillSwap:_0x3b64f2}=_0x3deda1;console[_0x1ff49f(0x16b)](''),console[_0x1ff49f(0x16b)](a140_0x28b79e[_0x1ff49f(0x1aa)]('===\x20Upgrade\x20Analysis\x20===')),console[_0x1ff49f(0x16b)]('');_0x439f50?(console[_0x1ff49f(0x16b)](a140_0x28b79e['cyan'](_0x1ff49f(0x18a))+('\x20\x20'+a140_0x28b79e[_0x1ff49f(0x1df)](_0x439f50[_0x1ff49f(0x1d8)]))),console[_0x1ff49f(0x16b)](_0x1ff49f(0x1d2)+(_0x439f50[_0x1ff49f(0x1cb)]?a140_0x28b79e['green'](_0x1ff49f(0x18b)):a140_0x28b79e[_0x1ff49f(0x1a5)](_0x1ff49f(0x1a4)))),console[_0x1ff49f(0x16b)](_0x1ff49f(0x184)+_0x439f50[_0x1ff49f(0x17a)][_0x1ff49f(0x1b4)](',\x20')),console['log'](_0x1ff49f(0x164))):console[_0x1ff49f(0x16b)](a140_0x28b79e[_0x1ff49f(0x1bc)](_0x1ff49f(0x18a))+'\x20\x20'+a140_0x28b79e[_0x1ff49f(0x1a5)](_0x1ff49f(0x1d0)));console[_0x1ff49f(0x16b)]('');if(_0x42db20[_0x1ff49f(0x179)]>0x0){console[_0x1ff49f(0x16b)](a140_0x28b79e[_0x1ff49f(0x1bc)]('Legacy\x20artifacts:'));for(const _0x2e8c8d of _0x42db20){console[_0x1ff49f(0x16b)]('\x20\x20'+a140_0x28b79e[_0x1ff49f(0x18d)](_0x1ff49f(0x180))+'\x20\x20'+_0x2e8c8d);}console[_0x1ff49f(0x16b)](_0x1ff49f(0x170));}else console[_0x1ff49f(0x16b)](a140_0x28b79e[_0x1ff49f(0x1bc)](_0x1ff49f(0x16d))+'\x20\x20'+a140_0x28b79e['gray']('none\x20found'));console['log']('');_0x3bef23?(console['log'](a140_0x28b79e[_0x1ff49f(0x1bc)]('MCP\x20config:')+('\x20\x20'+a140_0x28b79e[_0x1ff49f(0x1df)](_0x3bef23[_0x1ff49f(0x1b5)])+_0x1ff49f(0x19d)+_0x3bef23[_0x1ff49f(0x1ca)][_0x1ff49f(0x1b4)](',\x20'))),console[_0x1ff49f(0x16b)](_0x1ff49f(0x1cc))):console[_0x1ff49f(0x16b)](a140_0x28b79e[_0x1ff49f(0x1bc)](_0x1ff49f(0x191))+'\x20\x20'+a140_0x28b79e[_0x1ff49f(0x1a5)](_0x1ff49f(0x16f)));console[_0x1ff49f(0x16b)](''),console[_0x1ff49f(0x16b)](a140_0x28b79e['cyan'](_0x1ff49f(0x1d9))+('\x20\x20'+(_0x3b64f2?a140_0x28b79e['yellow'](_0x1ff49f(0x195)):a140_0x28b79e[_0x1ff49f(0x197)]('not\x20needed'))));_0x3b64f2&&console[_0x1ff49f(0x16b)](_0x1ff49f(0x169)+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x1ff49f(0x16b)]('');if(_0x3deda1[_0x1ff49f(0x1a7)]){const {currentVersion:_0x1b9c55,field:_0x1e1651,pkgPath:_0x379226}=_0x3deda1['sdkUpgrade'];console[_0x1ff49f(0x16b)](a140_0x28b79e[_0x1ff49f(0x1bc)](_0x1ff49f(0x181))+('\x20\x20'+a140_0x28b79e[_0x1ff49f(0x1df)](_0x379226))),console['log']('\x20\x20Current\x20version\x20in\x20'+_0x1e1651+':\x20'+a140_0x28b79e['yellow'](_0x1b9c55)+_0x1ff49f(0x188)+a140_0x28b79e['green'](_0x1ff49f(0x1c2))),console[_0x1ff49f(0x16b)](_0x1ff49f(0x187));}else console['log'](a140_0x28b79e[_0x1ff49f(0x1bc)]('@lovrabet/sdk:')+'\x20\x20'+a140_0x28b79e[_0x1ff49f(0x1a5)]('not\x20found\x20or\x20already\x20at\x20latest'));console[_0x1ff49f(0x16b)]('');}function execConfigMigration(_0x3b8276,_0x51c58f){const _0x355a97=a140_0x5aeff0,{configMigration:_0x49cc29}=_0x3b8276;if(!_0x49cc29?.['oldPath'])return{'step':0x1,'label':_0x355a97(0x1c9),'ok':!![],'detail':_0x355a97(0x1a2)};const _0xbf0cdf=readConfigFile(_0x49cc29[_0x355a97(0x1d8)]),_0x2086da=resolve(_0x51c58f,NEW_CONFIG_NAME),_0x165bf9=_0x49cc29['hasNewConfig']?readConfigFile(_0x2086da):{};for(const [_0x4c875e,_0x124361]of Object[_0x355a97(0x18c)](_0xbf0cdf)){!(_0x4c875e in _0x165bf9)&&(_0x165bf9[_0x4c875e]=_0x124361);}writeConfigFile(_0x2086da,_0x165bf9);const _0x419c33=_0x49cc29['oldPath']+_0x355a97(0x19f);return renameSync(_0x49cc29['oldPath'],_0x419c33),{'step':0x1,'label':'Config\x20migration','ok':!![],'detail':_0x49cc29['oldPath']+_0x355a97(0x188)+_0x2086da+'\x20(backup:\x20'+_0x419c33+')'};}function execRemoveOldArtifacts(_0x156958){const _0x2556e3=a140_0x5aeff0,_0x2fa7b8=[];for(const _0x4be492 of _0x156958){try{if(!existsSync(_0x4be492))continue;const _0x32ba31=tryStat(_0x4be492);_0x32ba31?.['isDirectory']()?rmSync(_0x4be492,{'recursive':!![],'force':!![]}):unlinkSync(_0x4be492);}catch(_0x492d1d){_0x2fa7b8[_0x2556e3(0x1e1)](_0x4be492+':\x20'+_0x492d1d[_0x2556e3(0x1c7)]);}}return{'step':0x3,'label':_0x2556e3(0x1c0),'ok':_0x2fa7b8[_0x2556e3(0x179)]===0x0,'detail':_0x2fa7b8[_0x2556e3(0x179)]>0x0?_0x156958[_0x2556e3(0x179)]-_0x2fa7b8[_0x2556e3(0x179)]+'/'+_0x156958[_0x2556e3(0x179)]+_0x2556e3(0x16c)+_0x2fa7b8[_0x2556e3(0x1b4)](';\x20')+')':_0x156958[_0x2556e3(0x179)]+_0x2556e3(0x1cf)};}function execCleanMcp(_0x1926f7){const _0x35b28a=a140_0x5aeff0;if(!_0x1926f7[_0x35b28a(0x1a0)])return{'step':0x4,'label':_0x35b28a(0x186),'ok':!![],'detail':_0x35b28a(0x171)};try{const _0x30046b=readFileSync(_0x1926f7[_0x35b28a(0x1a0)][_0x35b28a(0x1b5)],'utf8'),_0x47aa27=JSON[_0x35b28a(0x19c)](_0x30046b);if(_0x47aa27?.[_0x35b28a(0x1e3)]&&typeof _0x47aa27[_0x35b28a(0x1e3)]===_0x35b28a(0x1ac)){const _0x1ca15a=[];for(const [_0x1fbd8d,_0x49ee8d]of Object[_0x35b28a(0x18c)](_0x47aa27['mcpServers'])){_0x49ee8d?.[_0x35b28a(0x1ae)]&&Array['isArray'](_0x49ee8d['args'])&&_0x49ee8d[_0x35b28a(0x1ae)][_0x35b28a(0x17c)](_0x96d403=>typeof _0x96d403===_0x35b28a(0x1ce)&&_0x96d403['includes']('@lovrabet/dataset-mcp-server'))&&_0x1ca15a[_0x35b28a(0x1e1)](_0x1fbd8d);}for(const _0x3e41fd of _0x1ca15a){delete _0x47aa27[_0x35b28a(0x1e3)][_0x3e41fd];}return _0x1ca15a['length']>0x0&&writeFileSync(_0x1926f7[_0x35b28a(0x1a0)][_0x35b28a(0x1b5)],JSON[_0x35b28a(0x1dc)](_0x47aa27,null,0x2)+'\x0a',_0x35b28a(0x1bb)),{'step':0x4,'label':_0x35b28a(0x186),'ok':!![],'detail':_0x35b28a(0x1cd)+_0x1ca15a[_0x35b28a(0x1b4)](',\x20')+_0x35b28a(0x1d3)+_0x1926f7[_0x35b28a(0x1a0)][_0x35b28a(0x1b5)]};}return{'step':0x4,'label':_0x35b28a(0x186),'ok':!![],'detail':_0x35b28a(0x198)};}catch(_0x2b238d){return{'step':0x4,'label':'Clean\x20MCP\x20config','ok':![],'detail':_0x2b238d[_0x35b28a(0x1c7)]};}}function a140_0x118a(){const _0x3e3324=['removed\x20','string','\x20removed','no\x20legacy\x20config\x20found','===\x20Upgrade\x20Summary\x20===','\x20\x20New\x20config\x20(.rabetbase.json):\x20','\x20from\x20','lovrabet/rabetbase','Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20','1176SOkQVB','[\x22@lovrabet/sdk\x22]:\x20','oldPath','Skill\x20swap:','values','configMigration','stringify','status','Install\x20new\x20skill','yellow','Step\x201/7:\x20Migrating\x20config...','push','CANCEL','mcpServers','1026486qBskox','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','1109060bakCgs','Step\x206/7:\x20Install\x20new\x20skill\x20—\x20','Step\x204/7:\x20MCP\x20config\x20—\x20','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`','failed','log','\x20removed\x20(','Legacy\x20artifacts:','.cursor/rules/lovrabet_rules.mdc','no\x20legacy\x20entry','\x20\x20Action:\x20delete','skipped','detail','skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','isArray','fail','lovrabet/rabetbase\x20installed\x20globally','devDependencies','length','fields','\x20→\x20latest','some','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','FAIL','Step\x206/7:\x20Installing\x20new\x20skill...','FOUND','@lovrabet/sdk:','needsSkillSwap','Step\x201/7:\x20Config\x20migration\x20—\x20','\x20\x20Fields\x20to\x20migrate:\x20','inherit','Clean\x20MCP\x20config','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','\x20→\x20','@lovrabet/sdk','Config\x20file:','already\x20exists\x20(will\x20merge)','entries','red','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','files','undefined','MCP\x20config:','1EmGwmX','Upgrade\x20cancelled.','Remove\x20old\x20skill','needed','6432888HxppFM','green','no\x20matching\x20entry\x20found','error','\x20\x20Step\x20','2859468PqJeMx','parse','\x20→\x20keys:\x20','Remove\x20.lovrabet/','.bak','oldMcpConfig','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','skipped\x20(no\x20legacy\x20config)','.cursor/mcp.json','not\x20found\x20(will\x20create)','gray','Upgrade\x20@lovrabet/sdk','sdkUpgrade','done','\x20\x20\x20\x20\x20\x20\x20','bold','Step\x207/7:\x20@lovrabet/sdk\x20—\x20','object','1350762ihBOsZ','args','filter','includes','\x20\x20#\x20or','Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:','label','join','path','start','exit\x20','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','white','\x20\x20bun\x20install','utf8','cyan','10367gxsheK','oldArtifacts','step','Remove\x20legacy\x20artifacts','cwd','latest','2181268bDyToh','No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.','.claude/skills/lovrabet','succeed','message','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','Config\x20migration','keys','hasNewConfig','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server'];a140_0x118a=function(){return _0x3e3324;};return a140_0x118a();}function execSkillsRemove(_0x14b745,_0x4de5f6){const _0x40b339=a140_0x5aeff0,_0x4037d7=runNpxSkillsRemove(_0x14b745,{'stdio':_0x40b339(0x185),'yes':_0x4de5f6});return{'step':0x5,'label':_0x40b339(0x194),'ok':_0x4037d7['ok'],'detail':_0x4037d7['ok']?'lovrabet/lovrabet-skill\x20removed':_0x4037d7[_0x40b339(0x199)]??_0x40b339(0x1b7)+_0x4037d7[_0x40b339(0x1dd)]};}function execSkillsAdd(_0x1d9f7f,_0x3569ea){const _0x7a6620=a140_0x5aeff0,_0x51c842=runNpxSkillsAddGlobal(_0x1d9f7f,_0x7a6620(0x1d4),{'stdio':_0x7a6620(0x185),'yes':_0x3569ea});return{'step':0x6,'label':_0x7a6620(0x1de),'ok':_0x51c842['ok'],'detail':_0x51c842['ok']?_0x7a6620(0x177):_0x51c842[_0x7a6620(0x199)]??_0x7a6620(0x1b7)+_0x51c842[_0x7a6620(0x1dd)]};}function execUpgradeSdk(_0x5143d4){const _0x1d9c9c=a140_0x5aeff0;if(!_0x5143d4[_0x1d9c9c(0x1a7)])return{'step':0x7,'label':_0x1d9c9c(0x1a6),'ok':!![],'detail':_0x1d9c9c(0x173)};const {pkgPath:_0x116737,currentVersion:_0x5a1f29,field:_0x208e09}=_0x5143d4[_0x1d9c9c(0x1a7)];try{const _0x47f517=readFileSync(_0x116737,_0x1d9c9c(0x1bb)),_0x4d86f7=JSON[_0x1d9c9c(0x19c)](_0x47f517);return _0x4d86f7[_0x208e09][_0x1d9c9c(0x189)]=_0x1d9c9c(0x1c2),writeFileSync(_0x116737,JSON['stringify'](_0x4d86f7,null,0x2)+'\x0a','utf8'),{'step':0x7,'label':_0x1d9c9c(0x1a6),'ok':!![],'detail':_0x208e09+_0x1d9c9c(0x1d7)+_0x5a1f29+_0x1d9c9c(0x17b)};}catch(_0x198941){return{'step':0x7,'label':_0x1d9c9c(0x1a6),'ok':![],'detail':_0x198941['message']};}}function tryStat(_0x2c9f8c){try{return statSync(_0x2c9f8c);}catch{return undefined;}}function printSummary(_0xa5d213){const _0x117f02=a140_0x5aeff0;console[_0x117f02(0x16b)](''),console['log'](a140_0x28b79e[_0x117f02(0x1aa)](_0x117f02(0x1d1))),console['log']('');for(const _0x2ab65d of _0xa5d213){const _0x3fa695=_0x2ab65d['ok']?a140_0x28b79e[_0x117f02(0x197)]('OK'):a140_0x28b79e[_0x117f02(0x18d)](_0x117f02(0x17e));console[_0x117f02(0x16b)]('\x20\x20'+_0x3fa695+_0x117f02(0x19a)+_0x2ab65d[_0x117f02(0x1bf)]+':\x20'+_0x2ab65d[_0x117f02(0x1b3)]);if(_0x2ab65d['detail'])console[_0x117f02(0x16b)](_0x117f02(0x1a9)+a140_0x28b79e[_0x117f02(0x1a5)](_0x2ab65d['detail']));}console[_0x117f02(0x16b)]('');}export async function upgradeApp(_0x50043c,_0x25c346){const _0x459b10=a140_0x5aeff0,_0x46360a=process[_0x459b10(0x1c1)](),_0x36dc38=analyse(_0x46360a),_0x4cbacf=!_0x36dc38[_0x459b10(0x1db)]&&_0x36dc38[_0x459b10(0x1be)][_0x459b10(0x179)]===0x0&&!_0x36dc38[_0x459b10(0x1a0)]&&!_0x36dc38[_0x459b10(0x182)]&&!_0x36dc38[_0x459b10(0x1a7)];if(_0x4cbacf){console[_0x459b10(0x16b)](a140_0x28b79e[_0x459b10(0x197)](_0x459b10(0x1c4)));return;}printReport(_0x36dc38);const _0x596d45=!!(_0x25c346['yes']||_0x25c346['Y']||_0x50043c);if(!_0x596d45)try{const _0x202814=await askConfirm('Proceed\x20with\x20upgrade?');if(!_0x202814){console['log'](a140_0x28b79e[_0x459b10(0x1a5)](_0x459b10(0x193)));return;}}catch(_0x53c1c4){if(_0x53c1c4?.['message']===_0x459b10(0x1e2)){console[_0x459b10(0x16b)](a140_0x28b79e[_0x459b10(0x1a5)](_0x459b10(0x193)));return;}throw _0x53c1c4;}const _0x29d2aa=[],_0x43ac9b=a140_0x17babd({'text':_0x459b10(0x1e0),'color':'cyan'})['start'](),_0x327e4e=execConfigMigration(_0x36dc38,_0x46360a);_0x29d2aa['push'](_0x327e4e),_0x43ac9b[_0x327e4e['ok']?_0x459b10(0x1c6):_0x459b10(0x176)](_0x459b10(0x183)+(_0x327e4e[_0x459b10(0x172)]??(_0x327e4e['ok']?'done':_0x459b10(0x16a))));const _0x1f75a9=resolve(_0x46360a,'.lovrabet'),_0x215ad0=a140_0x17babd({'text':_0x459b10(0x1b8),'color':_0x459b10(0x1bc)})[_0x459b10(0x1b6)]();if(existsSync(_0x1f75a9))try{rmSync(_0x1f75a9,{'recursive':!![],'force':!![]}),_0x215ad0[_0x459b10(0x1c6)]('Step\x202/7:\x20.lovrabet/\x20directory\x20removed'),_0x29d2aa[_0x459b10(0x1e1)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x2e42e9){_0x215ad0[_0x459b10(0x176)](_0x459b10(0x1d5)+_0x2e42e9[_0x459b10(0x1c7)]),_0x29d2aa[_0x459b10(0x1e1)]({'step':0x2,'label':_0x459b10(0x19e),'ok':![],'detail':_0x2e42e9[_0x459b10(0x1c7)]});}else _0x215ad0['info'](_0x459b10(0x18e)),_0x29d2aa[_0x459b10(0x1e1)]({'step':0x2,'label':_0x459b10(0x19e),'ok':!![],'detail':_0x459b10(0x171)});const _0x4063bb=a140_0x17babd({'text':'Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','color':_0x459b10(0x1bc)})[_0x459b10(0x1b6)](),_0x457e11=execRemoveOldArtifacts(_0x36dc38[_0x459b10(0x1be)]);_0x29d2aa[_0x459b10(0x1e1)](_0x457e11),_0x4063bb[_0x457e11['ok']?'succeed':'fail'](_0x459b10(0x1a1)+(_0x457e11[_0x459b10(0x172)]??(_0x457e11['ok']?_0x459b10(0x1a8):_0x459b10(0x16a))));const _0x49e206=a140_0x17babd({'text':'Step\x204/7:\x20Cleaning\x20MCP\x20config...','color':'cyan'})[_0x459b10(0x1b6)](),_0x3c057a=execCleanMcp(_0x36dc38);_0x29d2aa['push'](_0x3c057a),_0x49e206[_0x3c057a['ok']?_0x459b10(0x1c6):_0x459b10(0x176)](_0x459b10(0x167)+(_0x3c057a[_0x459b10(0x172)]??(_0x3c057a['ok']?'done':_0x459b10(0x16a))));const _0x1c04b0=a140_0x17babd({'text':'Step\x205/7:\x20Removing\x20old\x20skill...','color':_0x459b10(0x1bc)})[_0x459b10(0x1b6)](),_0x513bd3=execSkillsRemove(_0x46360a,_0x596d45);_0x29d2aa[_0x459b10(0x1e1)](_0x513bd3),_0x1c04b0[_0x513bd3['ok']?_0x459b10(0x1c6):_0x459b10(0x176)](_0x459b10(0x1c8)+(_0x513bd3['detail']??(_0x513bd3['ok']?_0x459b10(0x1a8):_0x459b10(0x16a))));const _0x58195f=a140_0x17babd({'text':_0x459b10(0x17f),'color':_0x459b10(0x1bc)})[_0x459b10(0x1b6)](),_0x32bbd9=execSkillsAdd(_0x46360a,_0x596d45);_0x29d2aa[_0x459b10(0x1e1)](_0x32bbd9),_0x58195f[_0x32bbd9['ok']?_0x459b10(0x1c6):'fail'](_0x459b10(0x166)+(_0x32bbd9[_0x459b10(0x172)]??(_0x32bbd9['ok']?_0x459b10(0x1a8):_0x459b10(0x16a))));const _0x83a4bc=a140_0x17babd({'text':_0x459b10(0x17d),'color':_0x459b10(0x1bc)})['start'](),_0x3c6754=execUpgradeSdk(_0x36dc38);_0x29d2aa['push'](_0x3c6754),_0x83a4bc[_0x3c6754['ok']?_0x459b10(0x1c6):_0x459b10(0x176)](_0x459b10(0x1ab)+(_0x3c6754['detail']??(_0x3c6754['ok']?_0x459b10(0x1a8):_0x459b10(0x16a)))),printSummary(_0x29d2aa);const _0x58e8b0=_0x29d2aa[_0x459b10(0x17c)](_0x5c61ea=>!_0x5c61ea['ok']);_0x58e8b0?console[_0x459b10(0x16b)](a140_0x28b79e['yellow'](_0x459b10(0x168))):console['log'](a140_0x28b79e[_0x459b10(0x197)]('Upgrade\x20completed\x20successfully!')),_0x3c6754['ok']&&_0x36dc38[_0x459b10(0x1a7)]&&(console['log'](''),console[_0x459b10(0x16b)](a140_0x28b79e['bold'][_0x459b10(0x1bc)](_0x459b10(0x174))),console[_0x459b10(0x16b)](a140_0x28b79e[_0x459b10(0x1bc)](_0x459b10(0x1b2))),console[_0x459b10(0x16b)](''),console[_0x459b10(0x16b)](a140_0x28b79e[_0x459b10(0x1b9)]('\x20\x20npm\x20install')),console['log'](a140_0x28b79e[_0x459b10(0x1b9)](_0x459b10(0x1b1))),console[_0x459b10(0x16b)](a140_0x28b79e[_0x459b10(0x1b9)](_0x459b10(0x1ba))),console[_0x459b10(0x16b)](''));}
|
|
1
|
+
const a142_0x405afc=a142_0x35af;(function(_0x1d6532,_0x2d79f4){const _0x5bd7ee=a142_0x35af,_0x3482f2=_0x1d6532();while(!![]){try{const _0x186420=parseInt(_0x5bd7ee(0x204))/0x1+-parseInt(_0x5bd7ee(0x241))/0x2*(parseInt(_0x5bd7ee(0x208))/0x3)+parseInt(_0x5bd7ee(0x206))/0x4+parseInt(_0x5bd7ee(0x21a))/0x5+parseInt(_0x5bd7ee(0x226))/0x6+parseInt(_0x5bd7ee(0x22b))/0x7+parseInt(_0x5bd7ee(0x247))/0x8*(-parseInt(_0x5bd7ee(0x1d8))/0x9);if(_0x186420===_0x2d79f4)break;else _0x3482f2['push'](_0x3482f2['shift']());}catch(_0x190f54){_0x3482f2['push'](_0x3482f2['shift']());}}}(a142_0x51eb,0x1984d));import a142_0x4fbda6 from'chalk';import a142_0x595cd0 from'ora';import{existsSync,readFileSync,renameSync,rmSync,statSync,unlinkSync,writeFileSync}from'node:fs';import{resolve}from'node:path';function a142_0x35af(_0x579a90,_0x2e4ac6){_0x579a90=_0x579a90-0x1c9;const _0x51eb7e=a142_0x51eb();let _0x35aff8=_0x51eb7e[_0x579a90];return _0x35aff8;}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[a142_0x405afc(0x217)](_0x533758=>_0x533758!==NEW_CONFIG_NAME);function collectIdeSkillFiles(_0x2e42dd){const _0x39d73c=a142_0x405afc,_0xb75f28=[];for(const _0x4373a7 of Object[_0x39d73c(0x1c9)](CORE_IDE_CONFIGS)){if(_0x4373a7[_0x39d73c(0x203)])for(const _0x1eb8f6 of _0x4373a7['files']){_0xb75f28[_0x39d73c(0x22a)](resolve(_0x2e42dd,_0x1eb8f6[_0x39d73c(0x230)]));}}return _0xb75f28;}function analyse(_0x2c1411){const _0x161f5e=a142_0x405afc;let _0x2ff929=null;const _0x529f51=resolve(_0x2c1411,NEW_CONFIG_NAME),_0x102ecb=existsSync(_0x529f51);for(const _0x8d76dd of LEGACY_CONFIG_NAMES){const _0x2b5e32=resolve(_0x2c1411,_0x8d76dd);if(existsSync(_0x2b5e32)){const _0x35935a=readConfigFile(_0x2b5e32),_0x57c32e=Object[_0x161f5e(0x1fa)](_0x35935a)[_0x161f5e(0x217)](_0x1d0ae8=>typeof _0x35935a[_0x1d0ae8]!==_0x161f5e(0x1e9));_0x2ff929={'oldPath':_0x2b5e32,'hasNewConfig':_0x102ecb,'fields':_0x57c32e};break;}}const _0x43a4bb=[],_0x4c5224=resolve(_0x2c1411,_0x161f5e(0x22f));if(existsSync(_0x4c5224))_0x43a4bb['push'](_0x4c5224);const _0x362132=resolve(_0x2c1411,_0x161f5e(0x1ce));if(existsSync(_0x362132))_0x43a4bb[_0x161f5e(0x22a)](_0x362132);const _0x409383=resolve(_0x2c1411,_0x161f5e(0x1d1));if(existsSync(_0x409383))_0x43a4bb[_0x161f5e(0x22a)](_0x409383);for(const _0x583700 of collectIdeSkillFiles(_0x2c1411)){if(existsSync(_0x583700))_0x43a4bb[_0x161f5e(0x22a)](_0x583700);}let _0x434285=null;const _0x304ae3=resolve(_0x2c1411,'.cursor/mcp.json');if(existsSync(_0x304ae3))try{const _0x1e5c78=JSON['parse'](readFileSync(_0x304ae3,_0x161f5e(0x1cb)));if(_0x1e5c78?.[_0x161f5e(0x1cf)]&&typeof _0x1e5c78[_0x161f5e(0x1cf)]==='object'){const _0x1f7af4=[];for(const [_0x3e7d5e,_0x5663d7]of Object['entries'](_0x1e5c78[_0x161f5e(0x1cf)])){const _0x1974d9=_0x5663d7;_0x1974d9?.['args']&&Array['isArray'](_0x1974d9['args'])&&_0x1974d9[_0x161f5e(0x233)][_0x161f5e(0x200)](_0x5a50f1=>typeof _0x5a50f1===_0x161f5e(0x1dd)&&_0x5a50f1[_0x161f5e(0x1f7)](_0x161f5e(0x225)))&&_0x1f7af4[_0x161f5e(0x22a)](_0x3e7d5e);}_0x1f7af4['length']>0x0&&(_0x434285={'path':_0x304ae3,'keys':_0x1f7af4});}}catch{}const _0x140b63=_0x43a4bb['length']>0x0||_0x2ff929!==null;let _0x6581c0=null;const _0x337720=resolve(_0x2c1411,_0x161f5e(0x1e8));if(existsSync(_0x337720))try{const _0xbb29e7=JSON[_0x161f5e(0x1f6)](readFileSync(_0x337720,_0x161f5e(0x1cb)));for(const _0x13a01c of[_0x161f5e(0x223),_0x161f5e(0x237)]){const _0xd8f86=_0xbb29e7?.[_0x13a01c]?.[_0x161f5e(0x1ff)];if(typeof _0xd8f86===_0x161f5e(0x1dd)){_0xd8f86!==_0x161f5e(0x227)&&(_0x6581c0={'pkgPath':_0x337720,'currentVersion':_0xd8f86,'field':_0x13a01c});break;}}}catch{}return{'configMigration':_0x2ff929,'oldArtifacts':_0x43a4bb,'oldMcpConfig':_0x434285,'needsSkillSwap':_0x140b63,'sdkUpgrade':_0x6581c0};}function printReport(_0xa00886){const _0x2fe460=a142_0x405afc,{configMigration:_0x26051e,oldArtifacts:_0x1ebc11,oldMcpConfig:_0x793bb1,needsSkillSwap:_0x1d4339}=_0xa00886;console[_0x2fe460(0x22d)](''),console['log'](a142_0x4fbda6[_0x2fe460(0x1fb)](_0x2fe460(0x21c))),console[_0x2fe460(0x22d)]('');_0x26051e?(console['log'](a142_0x4fbda6[_0x2fe460(0x1f2)](_0x2fe460(0x215))+('\x20\x20'+a142_0x4fbda6[_0x2fe460(0x1f4)](_0x26051e[_0x2fe460(0x243)]))),console[_0x2fe460(0x22d)](_0x2fe460(0x1fd)+(_0x26051e[_0x2fe460(0x1d3)]?a142_0x4fbda6['green'](_0x2fe460(0x211)):a142_0x4fbda6['gray'](_0x2fe460(0x1cc)))),console[_0x2fe460(0x22d)](_0x2fe460(0x216)+_0x26051e[_0x2fe460(0x22e)]['join'](',\x20')),console[_0x2fe460(0x22d)](_0x2fe460(0x236))):console[_0x2fe460(0x22d)](a142_0x4fbda6[_0x2fe460(0x1f2)](_0x2fe460(0x215))+'\x20\x20'+a142_0x4fbda6[_0x2fe460(0x1db)]('no\x20legacy\x20config\x20found'));console[_0x2fe460(0x22d)]('');if(_0x1ebc11[_0x2fe460(0x1de)]>0x0){console[_0x2fe460(0x22d)](a142_0x4fbda6['cyan']('Legacy\x20artifacts:'));for(const _0x1d076b of _0x1ebc11){console[_0x2fe460(0x22d)]('\x20\x20'+a142_0x4fbda6[_0x2fe460(0x207)]('FOUND')+'\x20\x20'+_0x1d076b);}console['log'](_0x2fe460(0x20e));}else console['log'](a142_0x4fbda6[_0x2fe460(0x1f2)](_0x2fe460(0x1eb))+'\x20\x20'+a142_0x4fbda6[_0x2fe460(0x1db)]('none\x20found'));console[_0x2fe460(0x22d)]('');_0x793bb1?(console['log'](a142_0x4fbda6[_0x2fe460(0x1f2)](_0x2fe460(0x1f5))+('\x20\x20'+a142_0x4fbda6[_0x2fe460(0x1f4)](_0x793bb1[_0x2fe460(0x230)])+_0x2fe460(0x1d6)+_0x793bb1[_0x2fe460(0x1fa)][_0x2fe460(0x212)](',\x20'))),console['log'](_0x2fe460(0x1ca))):console[_0x2fe460(0x22d)](a142_0x4fbda6[_0x2fe460(0x1f2)](_0x2fe460(0x1f5))+'\x20\x20'+a142_0x4fbda6[_0x2fe460(0x1db)]('no\x20legacy\x20entry'));console['log'](''),console[_0x2fe460(0x22d)](a142_0x4fbda6['cyan']('Skill\x20swap:')+('\x20\x20'+(_0x1d4339?a142_0x4fbda6[_0x2fe460(0x1f4)](_0x2fe460(0x1f3)):a142_0x4fbda6['green'](_0x2fe460(0x222)))));_0x1d4339&&console[_0x2fe460(0x22d)]('\x20\x20Action:\x20remove\x20old\x20lovrabet/lovrabet-skill,\x20add\x20via\x20`'+NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE+'`');console[_0x2fe460(0x22d)]('');if(_0xa00886['sdkUpgrade']){const {currentVersion:_0x4f17a8,field:_0x2dda42,pkgPath:_0xb220d0}=_0xa00886[_0x2fe460(0x232)];console[_0x2fe460(0x22d)](a142_0x4fbda6[_0x2fe460(0x1f2)](_0x2fe460(0x1da))+('\x20\x20'+a142_0x4fbda6[_0x2fe460(0x1f4)](_0xb220d0))),console[_0x2fe460(0x22d)](_0x2fe460(0x23e)+_0x2dda42+':\x20'+a142_0x4fbda6[_0x2fe460(0x1f4)](_0x4f17a8)+_0x2fe460(0x234)+a142_0x4fbda6[_0x2fe460(0x21d)](_0x2fe460(0x227))),console['log'](_0x2fe460(0x245));}else console[_0x2fe460(0x22d)](a142_0x4fbda6[_0x2fe460(0x1f2)](_0x2fe460(0x1da))+'\x20\x20'+a142_0x4fbda6[_0x2fe460(0x1db)](_0x2fe460(0x214)));console['log']('');}function execConfigMigration(_0x3bb7cd,_0xb0d8cd){const _0x493057=a142_0x405afc,{configMigration:_0x1de91b}=_0x3bb7cd;if(!_0x1de91b?.[_0x493057(0x243)])return{'step':0x1,'label':_0x493057(0x240),'ok':!![],'detail':_0x493057(0x1ef)};const _0x2cb85e=readConfigFile(_0x1de91b[_0x493057(0x243)]),_0x4290de=resolve(_0xb0d8cd,NEW_CONFIG_NAME),_0x1f7c14=_0x1de91b['hasNewConfig']?readConfigFile(_0x4290de):{};for(const [_0x4cf743,_0x35b4a7]of Object[_0x493057(0x1ec)](_0x2cb85e)){!(_0x4cf743 in _0x1f7c14)&&(_0x1f7c14[_0x4cf743]=_0x35b4a7);}writeConfigFile(_0x4290de,_0x1f7c14);const _0x27b62d=_0x1de91b[_0x493057(0x243)]+_0x493057(0x229);return renameSync(_0x1de91b[_0x493057(0x243)],_0x27b62d),{'step':0x1,'label':_0x493057(0x240),'ok':!![],'detail':_0x1de91b[_0x493057(0x243)]+'\x20→\x20'+_0x4290de+_0x493057(0x1e4)+_0x27b62d+')'};}function execRemoveOldArtifacts(_0x3d9776){const _0x85a65=a142_0x405afc,_0x5a99a2=[];for(const _0x33b928 of _0x3d9776){try{if(!existsSync(_0x33b928))continue;const _0x1a2629=tryStat(_0x33b928);_0x1a2629?.['isDirectory']()?rmSync(_0x33b928,{'recursive':!![],'force':!![]}):unlinkSync(_0x33b928);}catch(_0x21af0c){_0x5a99a2['push'](_0x33b928+':\x20'+_0x21af0c['message']);}}return{'step':0x3,'label':'Remove\x20legacy\x20artifacts','ok':_0x5a99a2['length']===0x0,'detail':_0x5a99a2[_0x85a65(0x1de)]>0x0?_0x3d9776[_0x85a65(0x1de)]-_0x5a99a2['length']+'/'+_0x3d9776['length']+_0x85a65(0x21e)+_0x5a99a2['join'](';\x20')+')':_0x3d9776[_0x85a65(0x1de)]+'\x20removed'};}function execCleanMcp(_0x1343dc){const _0x1f6e7d=a142_0x405afc;if(!_0x1343dc['oldMcpConfig'])return{'step':0x4,'label':_0x1f6e7d(0x221),'ok':!![],'detail':_0x1f6e7d(0x20b)};try{const _0x512dc0=readFileSync(_0x1343dc['oldMcpConfig'][_0x1f6e7d(0x230)],'utf8'),_0x55b545=JSON['parse'](_0x512dc0);if(_0x55b545?.[_0x1f6e7d(0x1cf)]&&typeof _0x55b545[_0x1f6e7d(0x1cf)]==='object'){const _0x27f666=[];for(const [_0x407472,_0x473067]of Object['entries'](_0x55b545[_0x1f6e7d(0x1cf)])){_0x473067?.[_0x1f6e7d(0x233)]&&Array[_0x1f6e7d(0x242)](_0x473067[_0x1f6e7d(0x233)])&&_0x473067[_0x1f6e7d(0x233)][_0x1f6e7d(0x200)](_0xfdd573=>typeof _0xfdd573==='string'&&_0xfdd573[_0x1f6e7d(0x1f7)](_0x1f6e7d(0x225)))&&_0x27f666[_0x1f6e7d(0x22a)](_0x407472);}for(const _0x554dc8 of _0x27f666){delete _0x55b545['mcpServers'][_0x554dc8];}return _0x27f666['length']>0x0&&writeFileSync(_0x1343dc['oldMcpConfig'][_0x1f6e7d(0x230)],JSON[_0x1f6e7d(0x244)](_0x55b545,null,0x2)+'\x0a','utf8'),{'step':0x4,'label':_0x1f6e7d(0x221),'ok':!![],'detail':_0x1f6e7d(0x20f)+_0x27f666['join'](',\x20')+_0x1f6e7d(0x21f)+_0x1343dc[_0x1f6e7d(0x213)]['path']};}return{'step':0x4,'label':_0x1f6e7d(0x221),'ok':!![],'detail':_0x1f6e7d(0x1f9)};}catch(_0x3e4fc3){return{'step':0x4,'label':_0x1f6e7d(0x221),'ok':![],'detail':_0x3e4fc3[_0x1f6e7d(0x1d5)]};}}function execSkillsRemove(_0x177a17,_0x504605){const _0x5d6ea8=a142_0x405afc,_0x5b3b02=runNpxSkillsRemove(_0x177a17,{'stdio':'inherit','yes':_0x504605});return{'step':0x5,'label':_0x5d6ea8(0x231),'ok':_0x5b3b02['ok'],'detail':_0x5b3b02['ok']?'lovrabet/lovrabet-skill\x20removed':_0x5b3b02['error']??_0x5d6ea8(0x23b)+_0x5b3b02[_0x5d6ea8(0x239)]};}function execSkillsAdd(_0xbbb813,_0x46425a){const _0x1628a0=a142_0x405afc,_0x472a1a=runNpxSkillsAddGlobal(_0xbbb813,_0x1628a0(0x1d4),{'stdio':_0x1628a0(0x228),'yes':_0x46425a});return{'step':0x6,'label':_0x1628a0(0x1d9),'ok':_0x472a1a['ok'],'detail':_0x472a1a['ok']?_0x1628a0(0x1f8):_0x472a1a[_0x1628a0(0x1ee)]??_0x1628a0(0x23b)+_0x472a1a[_0x1628a0(0x239)]};}function execUpgradeSdk(_0x200297){const _0x2502ca=a142_0x405afc;if(!_0x200297[_0x2502ca(0x232)])return{'step':0x7,'label':_0x2502ca(0x1df),'ok':!![],'detail':_0x2502ca(0x220)};const {pkgPath:_0x522b44,currentVersion:_0x40e3c9,field:_0x3b3d16}=_0x200297['sdkUpgrade'];try{const _0x50ed6c=readFileSync(_0x522b44,_0x2502ca(0x1cb)),_0x267961=JSON[_0x2502ca(0x1f6)](_0x50ed6c);return _0x267961[_0x3b3d16][_0x2502ca(0x1ff)]='latest',writeFileSync(_0x522b44,JSON['stringify'](_0x267961,null,0x2)+'\x0a',_0x2502ca(0x1cb)),{'step':0x7,'label':'Upgrade\x20@lovrabet/sdk','ok':!![],'detail':_0x3b3d16+_0x2502ca(0x1e0)+_0x40e3c9+_0x2502ca(0x1e1)};}catch(_0x20dd2b){return{'step':0x7,'label':_0x2502ca(0x1df),'ok':![],'detail':_0x20dd2b[_0x2502ca(0x1d5)]};}}function tryStat(_0x4a620a){try{return statSync(_0x4a620a);}catch{return undefined;}}function a142_0x51eb(){const _0x1121f3=['skipped\x20(not\x20found\x20or\x20already\x20at\x20latest)','Clean\x20MCP\x20config','not\x20needed','dependencies','configMigration','@lovrabet/dataset-mcp-server','831984pAHpye','latest','inherit','.bak','push','353479XobPrx','Step\x202/7:\x20.lovrabet/\x20not\x20found,\x20skipped','log','fields','.lovrabet','path','Remove\x20old\x20skill','sdkUpgrade','args','\x20→\x20','Step\x204/7:\x20Cleaning\x20MCP\x20config...','\x20\x20Action:\x20migrate\x20→\x20backup\x20old\x20as\x20.bak','devDependencies','failed','status','Step\x203/7:\x20Legacy\x20artifacts\x20—\x20','exit\x20','Step\x207/7:\x20Upgrading\x20@lovrabet/sdk\x20in\x20package.json...','\x20\x20bun\x20install','\x20\x20Current\x20version\x20in\x20','fail','Config\x20migration','223422gPymKF','isArray','oldPath','stringify','\x20\x20Action:\x20update\x20package.json\x20(you\x20will\x20need\x20to\x20re-run\x20install)','\x20\x20\x20\x20\x20\x20\x20','288CLIJZF','label','values','\x20\x20Action:\x20remove\x20entries\x20containing\x20@lovrabet/dataset-mcp-server','utf8','not\x20found\x20(will\x20create)','\x20\x20#\x20or','.cursor/rules/lovrabet_rules.mdc','mcpServers','===\x20Upgrade\x20Summary\x20===','.claude/skills/lovrabet','needsSkillSwap','hasNewConfig','lovrabet/rabetbase','message','\x20→\x20keys:\x20','\x20\x20npm\x20install','85680GsxkUR','Install\x20new\x20skill','@lovrabet/sdk:','gray','Some\x20steps\x20failed.\x20Check\x20the\x20summary\x20above\x20for\x20details.','string','length','Upgrade\x20@lovrabet/sdk','[\x22@lovrabet/sdk\x22]:\x20','\x20→\x20latest','succeed','yes','\x20(backup:\x20','step','Step\x205/7:\x20Remove\x20old\x20skill\x20—\x20','Upgrade\x20cancelled.','package.json','undefined','white','Legacy\x20artifacts:','entries','Proceed\x20with\x20upgrade?','error','skipped\x20(no\x20legacy\x20config)','info','Upgrade\x20completed\x20successfully!','cyan','needed','yellow','MCP\x20config:','parse','includes','lovrabet/rabetbase\x20installed\x20globally','no\x20matching\x20entry\x20found','keys','bold','Step\x202/7:\x20.lovrabet/\x20directory\x20removed','\x20\x20New\x20config\x20(.rabetbase.json):\x20','Remove\x20.lovrabet/','@lovrabet/sdk','some','done','cwd','files','142125zWEoAr','Step\x202/7:\x20Removing\x20.lovrabet/\x20directory...','554540nBzpNy','red','3AIpAiv','detail','\x20\x20Step\x20','skipped','@lovrabet/sdk\x20has\x20been\x20updated\x20to\x20latest\x20in\x20package.json.','FAIL','\x20\x20Action:\x20delete','removed\x20','oldArtifacts','already\x20exists\x20(will\x20merge)','join','oldMcpConfig','not\x20found\x20or\x20already\x20at\x20latest','Config\x20file:','\x20\x20Fields\x20to\x20migrate:\x20','filter','Step\x206/7:\x20Installing\x20new\x20skill...','start','445175aYQTHP','Step\x203/7:\x20Removing\x20legacy\x20IDE\x20skill\x20files...','===\x20Upgrade\x20Analysis\x20===','green','\x20removed\x20(','\x20from\x20'];a142_0x51eb=function(){return _0x1121f3;};return a142_0x51eb();}function printSummary(_0x3bbf96){const _0x2e6bc7=a142_0x405afc;console['log'](''),console[_0x2e6bc7(0x22d)](a142_0x4fbda6[_0x2e6bc7(0x1fb)](_0x2e6bc7(0x1d0))),console[_0x2e6bc7(0x22d)]('');for(const _0x219d0a of _0x3bbf96){const _0x1d7c32=_0x219d0a['ok']?a142_0x4fbda6['green']('OK'):a142_0x4fbda6[_0x2e6bc7(0x207)](_0x2e6bc7(0x20d));console[_0x2e6bc7(0x22d)]('\x20\x20'+_0x1d7c32+_0x2e6bc7(0x20a)+_0x219d0a[_0x2e6bc7(0x1e5)]+':\x20'+_0x219d0a[_0x2e6bc7(0x248)]);if(_0x219d0a[_0x2e6bc7(0x209)])console[_0x2e6bc7(0x22d)](_0x2e6bc7(0x246)+a142_0x4fbda6[_0x2e6bc7(0x1db)](_0x219d0a[_0x2e6bc7(0x209)]));}console[_0x2e6bc7(0x22d)]('');}export async function upgradeApp(_0x30f277,_0x17f0bd){const _0x31e53d=a142_0x405afc,_0x3b05c8=process[_0x31e53d(0x202)](),_0x2b9cbe=analyse(_0x3b05c8),_0x3be0e5=!_0x2b9cbe[_0x31e53d(0x224)]&&_0x2b9cbe['oldArtifacts'][_0x31e53d(0x1de)]===0x0&&!_0x2b9cbe['oldMcpConfig']&&!_0x2b9cbe[_0x31e53d(0x1d2)]&&!_0x2b9cbe['sdkUpgrade'];if(_0x3be0e5){console[_0x31e53d(0x22d)](a142_0x4fbda6[_0x31e53d(0x21d)]('No\x20legacy\x20artifacts\x20found.\x20Your\x20project\x20is\x20already\x20up-to-date.'));return;}printReport(_0x2b9cbe);const _0x26a412=!!(_0x17f0bd[_0x31e53d(0x1e3)]||_0x17f0bd['Y']||_0x30f277);if(!_0x26a412)try{const _0x10b9ba=await askConfirm(_0x31e53d(0x1ed));if(!_0x10b9ba){console[_0x31e53d(0x22d)](a142_0x4fbda6[_0x31e53d(0x1db)](_0x31e53d(0x1e7)));return;}}catch(_0x1561cb){if(_0x1561cb?.['message']==='CANCEL'){console['log'](a142_0x4fbda6[_0x31e53d(0x1db)](_0x31e53d(0x1e7)));return;}throw _0x1561cb;}const _0x1b3997=[],_0x3644e9=a142_0x595cd0({'text':'Step\x201/7:\x20Migrating\x20config...','color':_0x31e53d(0x1f2)})['start'](),_0x2eb7e6=execConfigMigration(_0x2b9cbe,_0x3b05c8);_0x1b3997['push'](_0x2eb7e6),_0x3644e9[_0x2eb7e6['ok']?_0x31e53d(0x1e2):_0x31e53d(0x23f)]('Step\x201/7:\x20Config\x20migration\x20—\x20'+(_0x2eb7e6[_0x31e53d(0x209)]??(_0x2eb7e6['ok']?'done':_0x31e53d(0x238))));const _0x1ba61d=resolve(_0x3b05c8,_0x31e53d(0x22f)),_0x15553a=a142_0x595cd0({'text':_0x31e53d(0x205),'color':_0x31e53d(0x1f2)})[_0x31e53d(0x219)]();if(existsSync(_0x1ba61d))try{rmSync(_0x1ba61d,{'recursive':!![],'force':!![]}),_0x15553a[_0x31e53d(0x1e2)](_0x31e53d(0x1fc)),_0x1b3997[_0x31e53d(0x22a)]({'step':0x2,'label':'Remove\x20.lovrabet/','ok':!![]});}catch(_0x4e2c75){_0x15553a[_0x31e53d(0x23f)]('Step\x202/7:\x20.lovrabet/\x20removal\x20failed\x20—\x20'+_0x4e2c75[_0x31e53d(0x1d5)]),_0x1b3997[_0x31e53d(0x22a)]({'step':0x2,'label':_0x31e53d(0x1fe),'ok':![],'detail':_0x4e2c75[_0x31e53d(0x1d5)]});}else _0x15553a[_0x31e53d(0x1f0)](_0x31e53d(0x22c)),_0x1b3997[_0x31e53d(0x22a)]({'step':0x2,'label':_0x31e53d(0x1fe),'ok':!![],'detail':'skipped'});const _0x3a95c3=a142_0x595cd0({'text':_0x31e53d(0x21b),'color':_0x31e53d(0x1f2)})[_0x31e53d(0x219)](),_0x3c1222=execRemoveOldArtifacts(_0x2b9cbe[_0x31e53d(0x210)]);_0x1b3997[_0x31e53d(0x22a)](_0x3c1222),_0x3a95c3[_0x3c1222['ok']?_0x31e53d(0x1e2):_0x31e53d(0x23f)](_0x31e53d(0x23a)+(_0x3c1222['detail']??(_0x3c1222['ok']?_0x31e53d(0x201):_0x31e53d(0x238))));const _0x170c58=a142_0x595cd0({'text':_0x31e53d(0x235),'color':_0x31e53d(0x1f2)})[_0x31e53d(0x219)](),_0xb70c16=execCleanMcp(_0x2b9cbe);_0x1b3997[_0x31e53d(0x22a)](_0xb70c16),_0x170c58[_0xb70c16['ok']?'succeed':'fail']('Step\x204/7:\x20MCP\x20config\x20—\x20'+(_0xb70c16[_0x31e53d(0x209)]??(_0xb70c16['ok']?_0x31e53d(0x201):_0x31e53d(0x238))));const _0x17d714=a142_0x595cd0({'text':'Step\x205/7:\x20Removing\x20old\x20skill...','color':_0x31e53d(0x1f2)})[_0x31e53d(0x219)](),_0x97f252=execSkillsRemove(_0x3b05c8,_0x26a412);_0x1b3997['push'](_0x97f252),_0x17d714[_0x97f252['ok']?_0x31e53d(0x1e2):'fail'](_0x31e53d(0x1e6)+(_0x97f252[_0x31e53d(0x209)]??(_0x97f252['ok']?_0x31e53d(0x201):_0x31e53d(0x238))));const _0x4611ff=a142_0x595cd0({'text':_0x31e53d(0x218),'color':'cyan'})[_0x31e53d(0x219)](),_0x136191=execSkillsAdd(_0x3b05c8,_0x26a412);_0x1b3997[_0x31e53d(0x22a)](_0x136191),_0x4611ff[_0x136191['ok']?_0x31e53d(0x1e2):_0x31e53d(0x23f)]('Step\x206/7:\x20Install\x20new\x20skill\x20—\x20'+(_0x136191[_0x31e53d(0x209)]??(_0x136191['ok']?_0x31e53d(0x201):_0x31e53d(0x238))));const _0x2f1ff3=a142_0x595cd0({'text':_0x31e53d(0x23c),'color':_0x31e53d(0x1f2)})['start'](),_0x5f3aa2=execUpgradeSdk(_0x2b9cbe);_0x1b3997['push'](_0x5f3aa2),_0x2f1ff3[_0x5f3aa2['ok']?_0x31e53d(0x1e2):'fail']('Step\x207/7:\x20@lovrabet/sdk\x20—\x20'+(_0x5f3aa2[_0x31e53d(0x209)]??(_0x5f3aa2['ok']?_0x31e53d(0x201):_0x31e53d(0x238)))),printSummary(_0x1b3997);const _0x14bd87=_0x1b3997['some'](_0x4a9070=>!_0x4a9070['ok']);_0x14bd87?console['log'](a142_0x4fbda6['yellow'](_0x31e53d(0x1dc))):console['log'](a142_0x4fbda6['green'](_0x31e53d(0x1f1))),_0x5f3aa2['ok']&&_0x2b9cbe[_0x31e53d(0x232)]&&(console[_0x31e53d(0x22d)](''),console[_0x31e53d(0x22d)](a142_0x4fbda6['bold'][_0x31e53d(0x1f2)](_0x31e53d(0x20c))),console[_0x31e53d(0x22d)](a142_0x4fbda6[_0x31e53d(0x1f2)]('Please\x20re-install\x20dependencies\x20to\x20apply\x20the\x20change:')),console['log'](''),console[_0x31e53d(0x22d)](a142_0x4fbda6[_0x31e53d(0x1ea)](_0x31e53d(0x1d7))),console[_0x31e53d(0x22d)](a142_0x4fbda6[_0x31e53d(0x1ea)](_0x31e53d(0x1cd))),console[_0x31e53d(0x22d)](a142_0x4fbda6[_0x31e53d(0x1ea)](_0x31e53d(0x23d))),console[_0x31e53d(0x22d)](''));}
|