@lovrabet/rabetbase-cli 2.0.2-beta.3 → 2.0.2-beta.6
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/ai-setup/config.js +1 -1
- 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/is-session-valid.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/doc.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/app.js +1 -1
- package/lib/commands/auth.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/new.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/build.js +1 -1
- package/lib/commands/cli-update.js +1 -0
- 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/flags.js +1 -1
- package/lib/commands/config.js +1 -1
- package/lib/commands/create.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/links.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/doctor.js +1 -0
- package/lib/commands/init.js +1 -1
- package/lib/commands/logout.js +1 -1
- package/lib/commands/logs.js +1 -1
- package/lib/commands/mcp.js +1 -1
- package/lib/commands/menu/index.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/preview.js +1 -1
- package/lib/commands/project-upgrade.js +1 -0
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run.js +1 -1
- package/lib/commands/skill.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/save.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/start.js +1 -1
- package/lib/config/config-help.js +1 -1
- package/lib/config/main.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.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/sql-validator.js +1 -1
- package/lib/create-app/enhanced-guided-create.js +1 -1
- package/lib/create-app/format-elapsed.js +1 -1
- package/lib/create-app/main.js +1 -1
- package/lib/create-app/non-interactive.js +1 -1
- package/lib/create-app/task-finished.js +1 -1
- package/lib/create-app/task-loading.js +1 -1
- package/lib/create-app/task-running.js +1 -1
- package/lib/create-app/task-time.js +1 -1
- package/lib/create-app/use-copy-project-template.js +1 -1
- package/lib/create-app/use-format-code.js +1 -1
- package/lib/create-app/use-install-dependencies.js +1 -1
- package/lib/errors.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.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/init/main.js +1 -1
- package/lib/mcp/McpInstallUI.js +1 -1
- package/lib/mcp/claude.js +1 -1
- package/lib/mcp/cursor.js +1 -1
- package/lib/mcp/main.js +1 -1
- package/lib/mcp/mcp-install-non-interactive.js +1 -1
- package/lib/mcp/mcp-installer.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/ui/IDESelector.js +1 -1
- package/lib/ui/useIDESelection.js +1 -1
- package/lib/utils/ai_config.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/config.js +1 -1
- package/lib/utils/copy-directory.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/logger.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/package.json +1 -1
- package/lib/api/pull-silent.js +0 -1
package/lib/skills/main.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a113_0x4b770d=a113_0x47e6;(function(_0x39d18a,_0x2ea8e7){const _0x5f33f7=a113_0x47e6,_0xb70e70=_0x39d18a();while(!![]){try{const _0x3338b9=-parseInt(_0x5f33f7(0x14c))/0x1+-parseInt(_0x5f33f7(0x155))/0x2*(parseInt(_0x5f33f7(0x157))/0x3)+parseInt(_0x5f33f7(0x142))/0x4+-parseInt(_0x5f33f7(0x14a))/0x5*(-parseInt(_0x5f33f7(0x139))/0x6)+parseInt(_0x5f33f7(0x13e))/0x7+-parseInt(_0x5f33f7(0x13f))/0x8+parseInt(_0x5f33f7(0x13a))/0x9;if(_0x3338b9===_0x2ea8e7)break;else _0xb70e70['push'](_0xb70e70['shift']());}catch(_0x5bd109){_0xb70e70['push'](_0xb70e70['shift']());}}}(a113_0x4372,0x4ebc5));import{logger}from'../utils/logger.js';export function camelCaseFlagsToKebab(_0x3468c5){const _0xaab6a0=a113_0x47e6,_0x33e850=[];for(const [_0x2b9b36,_0x6e0fdb]of Object['entries'](_0x3468c5)){if(_0x6e0fdb===!![]){const _0x4f99a3=_0x2b9b36[_0xaab6a0(0x14e)](/([A-Z])/g,_0xaab6a0(0x147))['toLowerCase']();_0x33e850[_0xaab6a0(0x13b)](_0x4f99a3);}}return _0x33e850;}function a113_0x4372(){const _0x268beb=['276plWdpj','1328580vkRdul','push','length','skill','4286016DqbIvv','953152HErAbu','log','dangerously-bff-save','515960bhULyD','\x0aAvailable\x20commands:','\x20\x20rabetbase\x20skill\x20install\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Interactive\x20skill\x20installation','npx\x20-y\x20skills\x20add\x20lovrabet/rabetbase\x20--global','enable-bff-save','-$1','startsWith','argv','1490BSznbz','error','232268lwACnJ','help','replace','exit','--help','(empty)','\x20\x20rabetbase\x20skill\x20--help\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20help\x0a','cwd','add','457386EdwBni','setLogPath','3JXmKoj'];a113_0x4372=function(){return _0x268beb;};return a113_0x4372();}function a113_0x47e6(_0x3d2f8d,_0x425a3d){_0x3d2f8d=_0x3d2f8d-0x139;const _0x4372fa=a113_0x4372();let _0x47e69c=_0x4372fa[_0x3d2f8d];return _0x47e69c;}export function parseDynamicFlags(){const _0x10c293=a113_0x47e6,_0x501188=[];for(let _0x42b5d9=0x3;_0x42b5d9<process[_0x10c293(0x149)][_0x10c293(0x13c)];_0x42b5d9++){const _0x23e68b=process['argv'][_0x42b5d9];if(_0x23e68b&&_0x23e68b[_0x10c293(0x148)]('--')){const _0x4dc082=_0x23e68b['slice'](0x2);_0x4dc082&&!_0x4dc082['includes']('=')&&_0x501188[_0x10c293(0x13b)](_0x4dc082);}}return _0x501188;}export function getAllProvidedFlags(_0x241b7d){const _0x38f425=camelCaseFlagsToKebab(_0x241b7d),_0x186f90=parseDynamicFlags(),_0x58eb6e=new Set([..._0x38f425,..._0x186f90]);return Array['from'](_0x58eb6e);}export function normalizeLegacyBffSaveFlags(_0xe849f6){const _0x16c8bb=a113_0x47e6,_0x105688=new Set(_0xe849f6);return _0x105688['has'](_0x16c8bb(0x141))&&_0x105688[_0x16c8bb(0x154)](_0x16c8bb(0x146)),Array['from'](_0x105688);}const SKILLS_INSTALL_COMMAND_LINE=a113_0x4b770d(0x145);export async function skillsCommand(_0x195f0c,_0x2b3cb4,_0x24abe3){const _0x3d85fd=a113_0x4b770d;logger[_0x3d85fd(0x156)](process[_0x3d85fd(0x153)]());if(_0x24abe3?.[_0x3d85fd(0x14d)]||_0x195f0c===_0x3d85fd(0x150)){showHelp();return;}console['error']('Error:\x20Unsupported\x20command:\x20'+(_0x195f0c||_0x3d85fd(0x151))),console['log'](_0x3d85fd(0x143)),console[_0x3d85fd(0x140)](_0x3d85fd(0x144)),console[_0x3d85fd(0x140)](_0x3d85fd(0x152)),console[_0x3d85fd(0x140)](''),console[_0x3d85fd(0x140)]('Equivalent\x20command:\x20'+SKILLS_INSTALL_COMMAND_LINE),logger[_0x3d85fd(0x14b)](_0x3d85fd(0x13d),'不支持的命令:\x20'+_0x195f0c),process[_0x3d85fd(0x14f)](0x1);}function showHelp(){const _0x3428ae=a113_0x4b770d;console[_0x3428ae(0x140)]('\x0aLovrabet\x20Skill\x20-\x20Developer\x20Skill\x20Installation\x20Tool\x0a\x0aUsage:\x0a\x20\x20rabetbase\x20skill\x20--help\x0a\x20\x20rabetbase\x20skill\x20install\x0a\x0aEquivalent\x20command:\x20'+SKILLS_INSTALL_COMMAND_LINE+'\x0a\x0aNote:\x20npx\x20skills\x20selects\x20the\x20agent\x20and\x20writes\x20files;\x20guides\x20live\x20under\x20skills/lovrabet/guides/.\x0a');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a114_0x1517d7=a114_0x1d5d;(function(_0x510be2,_0x319527){const _0x5ddbce=a114_0x1d5d,_0x1d5c54=_0x510be2();while(!![]){try{const _0x33e0b1=-parseInt(_0x5ddbce(0x146))/0x1*(parseInt(_0x5ddbce(0x140))/0x2)+parseInt(_0x5ddbce(0x155))/0x3*(parseInt(_0x5ddbce(0x148))/0x4)+-parseInt(_0x5ddbce(0x14e))/0x5+parseInt(_0x5ddbce(0x142))/0x6+-parseInt(_0x5ddbce(0x153))/0x7*(parseInt(_0x5ddbce(0x143))/0x8)+-parseInt(_0x5ddbce(0x149))/0x9*(parseInt(_0x5ddbce(0x14c))/0xa)+-parseInt(_0x5ddbce(0x157))/0xb*(-parseInt(_0x5ddbce(0x150))/0xc);if(_0x33e0b1===_0x319527)break;else _0x1d5c54['push'](_0x1d5c54['shift']());}catch(_0x21ac69){_0x1d5c54['push'](_0x1d5c54['shift']());}}}(a114_0x4efb,0x23806));import{spawnSync}from'node:child_process';export const NPX_FLAG_YES='-y';export const NPX_SKILLS_CLI=a114_0x1517d7(0x14f);export const NPX_SKILLS_SUBCOMMAND_ADD=a114_0x1517d7(0x154);function a114_0x1d5d(_0x1d4936,_0x4749b5){_0x1d4936=_0x1d4936-0x13a;const _0x4efbb4=a114_0x4efb();let _0x1d5d2f=_0x4efbb4[_0x1d4936];return _0x1d5d2f;}export const NPX_SKILLS_FLAG_SKILL='--skill';export const RABETBASE_SKILL_SOURCE=a114_0x1517d7(0x14d);export const DEFAULT_RABETBASE_SKILL_NAME='Lovrabet';export function buildNpxSkillsAddArgv(_0x5ec79f=DEFAULT_RABETBASE_SKILL_NAME){return[NPX_FLAG_YES,NPX_SKILLS_CLI,NPX_SKILLS_SUBCOMMAND_ADD,RABETBASE_SKILL_SOURCE,NPX_SKILLS_FLAG_SKILL,_0x5ec79f];}export const NPX_SKILLS_ADD_COMMAND_LINE=['npx',...buildNpxSkillsAddArgv()][a114_0x1517d7(0x14a)]('\x20');export function shouldSkipNpxSkillsAdd(){const _0x42afa5=a114_0x1517d7;return process[_0x42afa5(0x158)]['RABETBASE_SKIP_NPX_SKILLS']==='1';}function a114_0x4efb(){const _0x58be92=['win32','npx.cmd','1147AuLUBx','stdout','128564OGiMHe','429399ndFqAV','join','exit\x20','50ABccSU','lovrabet/lovrabet-skill','959330ootGES','skills','4375824PvXJpK','stdio','trim','21SvwFRa','add','3AzvTyb','inherit','22ZEneMy','env','status','remove','--global','npx','log','pipe','stderr','unknown','platform','184awZLGB','toString','833142vUtDkl','583848adkmfv'];a114_0x4efb=function(){return _0x58be92;};return a114_0x4efb();}export function runNpxSkillsAdd(_0x53c238,_0x432103){const _0x5da932=a114_0x1517d7;if(shouldSkipNpxSkillsAdd())return{'ok':!![],'status':0x0,'skipped':!![]};const _0x5a008c=_0x432103?.[_0x5da932(0x151)]??_0x5da932(0x156),_0x5eeabf=process[_0x5da932(0x13f)]===_0x5da932(0x144)?_0x5da932(0x145):_0x5da932(0x13a),_0x273e78=buildNpxSkillsAddArgv(_0x432103?.['skill']??DEFAULT_RABETBASE_SKILL_NAME),_0x17f042=[_0x5eeabf,..._0x273e78][_0x5da932(0x14a)]('\x20');console['log']('*\x20'+_0x17f042);const _0xad917c=spawnSync(_0x5eeabf,_0x273e78,{'cwd':_0x53c238,'stdio':_0x5a008c,'env':process[_0x5da932(0x158)],'shell':![]}),_0x3c1864=_0xad917c['status'];if(_0x3c1864===0x0)return{'ok':!![],'status':0x0};let _0x3bbc81=_0x5da932(0x14b)+(_0x3c1864??_0x5da932(0x13e));if(_0x5a008c===_0x5da932(0x13c)){const _0x4b6c7a=_0xad917c[_0x5da932(0x13d)]?_0xad917c['stderr'][_0x5da932(0x141)]()['trim']():'',_0x22bd33=_0xad917c[_0x5da932(0x147)]?_0xad917c[_0x5da932(0x147)][_0x5da932(0x141)]()[_0x5da932(0x152)]():'';if(_0x4b6c7a)_0x3bbc81=_0x4b6c7a;else{if(_0x22bd33)_0x3bbc81=_0x22bd33;}}return{'ok':![],'status':_0x3c1864??null,'error':_0x3bbc81};}export function runNpxSkillsRemove(_0x30be7a,_0xa61dc0){const _0x2b64b6=a114_0x1517d7,_0x5c3094=_0xa61dc0?.[_0x2b64b6(0x151)]??_0x2b64b6(0x156),_0x162343=process[_0x2b64b6(0x13f)]===_0x2b64b6(0x144)?_0x2b64b6(0x145):_0x2b64b6(0x13a),_0x31212c=[NPX_FLAG_YES,NPX_SKILLS_CLI,_0x2b64b6(0x15a),RABETBASE_SKILL_SOURCE,NPX_SKILLS_FLAG_SKILL,_0xa61dc0?.['skill']??DEFAULT_RABETBASE_SKILL_NAME],_0x467f28=[_0x162343,..._0x31212c][_0x2b64b6(0x14a)]('\x20');console['log']('*\x20'+_0x467f28);const _0x3420a0=spawnSync(_0x162343,_0x31212c,{'cwd':_0x30be7a,'stdio':_0x5c3094,'env':process[_0x2b64b6(0x158)],'shell':![]}),_0x3f60a9=_0x3420a0[_0x2b64b6(0x159)];if(_0x3f60a9===0x0)return{'ok':!![],'status':0x0};let _0x5b9ba6='exit\x20'+(_0x3f60a9??_0x2b64b6(0x13e));if(_0x5c3094===_0x2b64b6(0x13c)){const _0x434fdb=_0x3420a0['stderr']?_0x3420a0[_0x2b64b6(0x13d)][_0x2b64b6(0x141)]()[_0x2b64b6(0x152)]():'',_0x1d7fc6=_0x3420a0[_0x2b64b6(0x147)]?_0x3420a0['stdout']['toString']()[_0x2b64b6(0x152)]():'';if(_0x434fdb)_0x5b9ba6=_0x434fdb;else{if(_0x1d7fc6)_0x5b9ba6=_0x1d7fc6;}}return{'ok':![],'status':_0x3f60a9??null,'error':_0x5b9ba6};}export function runNpxSkillsAddGlobal(_0x2b5fff,_0x28490d,_0x572995){const _0x32e721=a114_0x1517d7,_0x23e708=_0x572995?.[_0x32e721(0x151)]??_0x32e721(0x156),_0xe1c75b=process[_0x32e721(0x13f)]===_0x32e721(0x144)?_0x32e721(0x145):'npx',_0x47f836=[NPX_FLAG_YES,NPX_SKILLS_CLI,NPX_SKILLS_SUBCOMMAND_ADD,_0x28490d,_0x32e721(0x15b)],_0x436347=[_0xe1c75b,..._0x47f836][_0x32e721(0x14a)]('\x20');console[_0x32e721(0x13b)]('*\x20'+_0x436347);const _0x5063ab=spawnSync(_0xe1c75b,_0x47f836,{'cwd':_0x2b5fff,'stdio':_0x23e708,'env':process[_0x32e721(0x158)],'shell':![]}),_0x38aeaf=_0x5063ab[_0x32e721(0x159)];if(_0x38aeaf===0x0)return{'ok':!![],'status':0x0};let _0x3da8e1='exit\x20'+(_0x38aeaf??'unknown');if(_0x23e708===_0x32e721(0x13c)){const _0x2116cb=_0x5063ab[_0x32e721(0x13d)]?_0x5063ab[_0x32e721(0x13d)][_0x32e721(0x141)]()[_0x32e721(0x152)]():'',_0x18273f=_0x5063ab[_0x32e721(0x147)]?_0x5063ab[_0x32e721(0x147)][_0x32e721(0x141)]()[_0x32e721(0x152)]():'';if(_0x2116cb)_0x3da8e1=_0x2116cb;else{if(_0x18273f)_0x3da8e1=_0x18273f;}}return{'ok':![],'status':_0x38aeaf??null,'error':_0x3da8e1};}
|
package/lib/ui/IDESelector.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1e8e8b,_0x4c459e){const _0x329aa6=a116_0x5ddf,_0x5be627=_0x1e8e8b();while(!![]){try{const _0x15912d=parseInt(_0x329aa6(0xce))/0x1+-parseInt(_0x329aa6(0xcb))/0x2+parseInt(_0x329aa6(0xd1))/0x3+-parseInt(_0x329aa6(0xd5))/0x4+parseInt(_0x329aa6(0xd2))/0x5*(parseInt(_0x329aa6(0xd4))/0x6)+-parseInt(_0x329aa6(0xdb))/0x7*(-parseInt(_0x329aa6(0xd7))/0x8)+parseInt(_0x329aa6(0xd3))/0x9;if(_0x15912d===_0x4c459e)break;else _0x5be627['push'](_0x5be627['shift']());}catch(_0x452ff5){_0x5be627['push'](_0x5be627['shift']());}}}(a116_0x55b0,0xc210f));import{jsxs as a116_0x3d2433,jsx as a116_0x36d736}from'react/jsx-runtime';import{Text,Box}from'ink';function a116_0x55b0(){const _0x18f989=['cyan','56ZGJrEK','map','has','white','403361AgSJgc','red','column','blue','description','766254jVYLQU','[✓]','*\x20Select\x20IDEs\x20to\x20configure:','203260snjnYc','gray','key','1946256CogbOl','845SZhtXk','9711999EXrofT','14214LhUvOv','6227292GbYGHb'];a116_0x55b0=function(){return _0x18f989;};return a116_0x55b0();}function a116_0x5ddf(_0x427c1e,_0x3022ff){_0x427c1e=_0x427c1e-0xcb;const _0x55b0d5=a116_0x55b0();let _0x5ddf0a=_0x55b0d5[_0x427c1e];return _0x5ddf0a;}export function IDESelector({ideList:_0x23c1c5,title:_0x56411d,selection:_0x53f4db}){const _0x3fdbb=a116_0x5ddf,{selectedIndexes:_0x4afffc,highlightIndex:_0x1e93e3,errorMsg:_0x266614}=_0x53f4db;return a116_0x3d2433(Box,{'flexDirection':_0x3fdbb(0xdd),'marginTop':0x1,'children':[a116_0x36d736(Box,{'children':a116_0x3d2433(Text,{'color':_0x3fdbb(0xd6),'children':['*\x20',_0x56411d]})}),_0x266614&&a116_0x36d736(Box,{'marginTop':0x1,'children':a116_0x3d2433(Text,{'color':_0x3fdbb(0xdc),'children':['✗\x20',_0x266614]})}),a116_0x3d2433(Box,{'marginTop':0x1,'flexDirection':_0x3fdbb(0xdd),'children':[a116_0x36d736(Text,{'bold':!![],'children':_0x3fdbb(0xcd)}),_0x23c1c5[_0x3fdbb(0xd8)]((_0x56726a,_0xb8c909)=>{const _0x883dc5=_0x3fdbb,_0x55abe8=_0x1e93e3===_0xb8c909,_0x28d18f=_0x4afffc[_0x883dc5(0xd9)](_0xb8c909);return a116_0x36d736(Box,{'children':a116_0x3d2433(Text,{'backgroundColor':_0x55abe8?_0x883dc5(0xde):undefined,'color':_0x55abe8?_0x883dc5(0xda):undefined,'children':['\x20\x20',_0x28d18f?_0x883dc5(0xcc):'[\x20]','\x20',_0x56726a['name'],'\x20',a116_0x3d2433(Text,{'color':_0x55abe8?_0x883dc5(0xda):_0x883dc5(0xcf),'dimColor':!_0x55abe8,'children':['-\x20',_0x56726a[_0x883dc5(0xdf)]]})]})},_0x56726a[_0x883dc5(0xd0)]);}),a116_0x36d736(Box,{'marginTop':0x1,'children':a116_0x36d736(Text,{'color':_0x3fdbb(0xcf),'children':'\x20↑/↓:\x20Move\x20\x20Space:\x20Toggle\x20\x20a:\x20All\x20\x20i/r:\x20Invert\x20\x20q:\x20Quit\x20\x20Enter:\x20Confirm'})})]})]});}export{useIDESelection}from'./useIDESelection.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a117_0x33ca(_0x4d68be,_0x3a4f2b){_0x4d68be=_0x4d68be-0x173;const _0x5854d2=a117_0x5854();let _0x33cab5=_0x5854d2[_0x4d68be];return _0x33cab5;}(function(_0x27390b,_0x1d75d3){const _0x2488d8=a117_0x33ca,_0x261f82=_0x27390b();while(!![]){try{const _0x1be5e0=-parseInt(_0x2488d8(0x187))/0x1+parseInt(_0x2488d8(0x17f))/0x2*(-parseInt(_0x2488d8(0x184))/0x3)+parseInt(_0x2488d8(0x17b))/0x4*(-parseInt(_0x2488d8(0x182))/0x5)+parseInt(_0x2488d8(0x175))/0x6+-parseInt(_0x2488d8(0x180))/0x7+-parseInt(_0x2488d8(0x17c))/0x8*(-parseInt(_0x2488d8(0x17d))/0x9)+parseInt(_0x2488d8(0x178))/0xa*(parseInt(_0x2488d8(0x17a))/0xb);if(_0x1be5e0===_0x1d75d3)break;else _0x261f82['push'](_0x261f82['shift']());}catch(_0x5f4378){_0x261f82['push'](_0x261f82['shift']());}}}(a117_0x5854,0x5608e));import{useState,useCallback}from'react';export function useIDESelection({ideList:_0x4a3deb,preselectedIDEs:preselectedIDEs=[],multiSelect:multiSelect=!![]}){const _0x1b5a8b=a117_0x33ca,[_0x5ea783,_0xf4f1f5]=useState(new Set(preselectedIDEs[_0x1b5a8b(0x183)](_0x3e0689=>_0x4a3deb['findIndex'](_0x43ecb8=>_0x43ecb8[_0x1b5a8b(0x181)]===_0x3e0689))['filter'](_0x10a090=>_0x10a090>=0x0))),[_0x344b27,_0x41c468]=useState(0x0),[_0x142b40,_0x569055]=useState(''),_0x59bd5e=useCallback(()=>{const _0x3a0ceb=_0x1b5a8b;_0x41c468(_0x3c6af6=>_0x3c6af6>0x0?_0x3c6af6-0x1:_0x4a3deb[_0x3a0ceb(0x17e)]-0x1);},[_0x4a3deb[_0x1b5a8b(0x17e)]]),_0x3d170c=useCallback(()=>{_0x41c468(_0x11c2c3=>_0x11c2c3<_0x4a3deb['length']-0x1?_0x11c2c3+0x1:0x0);},[_0x4a3deb['length']]),_0x18cdc6=useCallback(()=>{if(!multiSelect){_0xf4f1f5(new Set([_0x344b27]));return;}_0xf4f1f5(_0x2b3f4e=>{const _0x4a8843=a117_0x33ca,_0xca08fb=new Set(_0x2b3f4e);return _0xca08fb[_0x4a8843(0x177)](_0x344b27)?_0xca08fb[_0x4a8843(0x185)](_0x344b27):_0xca08fb['add'](_0x344b27),_0xca08fb;});},[_0x344b27,multiSelect]),_0x12c405=useCallback(()=>{const _0x29a997=_0x1b5a8b;_0xf4f1f5(new Set(_0x4a3deb[_0x29a997(0x183)]((_0x2770a5,_0x3b38c)=>_0x3b38c)));},[_0x4a3deb]),_0x38e5c7=useCallback(()=>{_0xf4f1f5(_0x37cc00=>{const _0x4b670f=a117_0x33ca,_0x56af64=new Set();for(let _0x302158=0x0;_0x302158<_0x4a3deb[_0x4b670f(0x17e)];_0x302158++){!_0x37cc00[_0x4b670f(0x177)](_0x302158)&&_0x56af64[_0x4b670f(0x186)](_0x302158);}return _0x56af64;});},[_0x4a3deb]),_0x28b399=useCallback(()=>{const _0x1d64b2=_0x1b5a8b;return Array['from'](_0x5ea783)[_0x1d64b2(0x183)](_0x8ee091=>_0x4a3deb[_0x8ee091]?.['key'])[_0x1d64b2(0x174)](_0x24be5f=>_0x24be5f!==undefined);},[_0x5ea783,_0x4a3deb]),_0x2d69eb=useCallback(()=>{const _0x4573d3=_0x1b5a8b;return _0x5ea783[_0x4573d3(0x176)]===_0x4a3deb['length'];},[_0x5ea783,_0x4a3deb]),_0x21e3f0=useCallback((_0x379699,_0x40ee55)=>{const _0x45b671=_0x1b5a8b;if(_0x40ee55[_0x45b671(0x179)])return _0x59bd5e(),!![];if(_0x40ee55[_0x45b671(0x173)])return _0x3d170c(),!![];if(_0x379699==='\x20')return _0x18cdc6(),!![];if(_0x379699==='a'||_0x379699==='A')return _0x12c405(),!![];if(_0x379699==='i'||_0x379699==='I'||_0x379699==='r'||_0x379699==='R')return _0x38e5c7(),!![];return![];},[_0x59bd5e,_0x3d170c,_0x18cdc6,_0x12c405,_0x38e5c7]);return{'selectedIndexes':_0x5ea783,'highlightIndex':_0x344b27,'errorMsg':_0x142b40,'setErrorMsg':_0x569055,'handleKeyDown':_0x21e3f0,'getSelectedIDEs':_0x28b399,'isAllSelected':_0x2d69eb,'toggleSelection':_0x18cdc6,'selectAll':_0x12c405,'invertSelection':_0x38e5c7,'moveHighlightUp':_0x59bd5e,'moveHighlightDown':_0x3d170c};}function a117_0x5854(){const _0x2e2c94=['delete','add','238430TiCATO','downArrow','filter','620364hZlOIm','size','has','20ZyzWMY','upArrow','4703347EfHjGY','449744HAZVIR','4248UoDDAW','11187wGzcnK','length','1185128BBbths','2259271WBaCyE','key','5jgpqCB','map','3ubazuI'];a117_0x5854=function(){return _0x2e2c94;};return a117_0x5854();}
|
package/lib/utils/ai_config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a118_0x330534=a118_0xf009;(function(_0x70ea72,_0x55e437){const _0x179d37=a118_0xf009,_0x2852ea=_0x70ea72();while(!![]){try{const _0x58db55=-parseInt(_0x179d37(0x133))/0x1*(parseInt(_0x179d37(0x15f))/0x2)+-parseInt(_0x179d37(0x167))/0x3*(-parseInt(_0x179d37(0x14e))/0x4)+-parseInt(_0x179d37(0x13e))/0x5+parseInt(_0x179d37(0x159))/0x6*(-parseInt(_0x179d37(0x14b))/0x7)+parseInt(_0x179d37(0x161))/0x8*(parseInt(_0x179d37(0x16a))/0x9)+parseInt(_0x179d37(0x147))/0xa*(-parseInt(_0x179d37(0x15c))/0xb)+-parseInt(_0x179d37(0x153))/0xc*(-parseInt(_0x179d37(0x131))/0xd);if(_0x58db55===_0x55e437)break;else _0x2852ea['push'](_0x2852ea['shift']());}catch(_0x5998ba){_0x2852ea['push'](_0x2852ea['shift']());}}}(a118_0x4ee1,0x5145e));export const CORE_IDE_CONFIGS={'cursor':{'name':a118_0x330534(0x164),'description':a118_0x330534(0x140),'folders':[a118_0x330534(0x137),a118_0x330534(0x13c)],'files':[{'type':a118_0x330534(0x15e),'path':a118_0x330534(0x162),'template':a118_0x330534(0x169)}]},'windsurf':{'name':'Windsurf','description':a118_0x330534(0x151),'folders':[a118_0x330534(0x142)],'files':[{'type':a118_0x330534(0x15e),'path':a118_0x330534(0x15a),'template':a118_0x330534(0x169)}]},'claude':{'name':a118_0x330534(0x13a),'description':a118_0x330534(0x13a),'folders':[a118_0x330534(0x157)],'files':[{'type':'file','path':a118_0x330534(0x134),'template':'SKILL.md.tpl'}]},'cline':{'name':'Cline','description':a118_0x330534(0x135),'folders':['.cline'],'files':[{'type':'file','path':a118_0x330534(0x16b),'template':a118_0x330534(0x169)}]},'codex':{'name':'Codex','description':a118_0x330534(0x132),'folders':[a118_0x330534(0x136)],'files':[{'type':a118_0x330534(0x15e),'path':a118_0x330534(0x158),'template':a118_0x330534(0x169)}]},'opencode':{'name':'OpenCode','description':a118_0x330534(0x145),'folders':[a118_0x330534(0x143)],'files':[{'type':'file','path':a118_0x330534(0x14c),'template':a118_0x330534(0x169)}]},'qoder':{'name':a118_0x330534(0x144),'description':a118_0x330534(0x154),'folders':[a118_0x330534(0x15d)],'files':[{'type':a118_0x330534(0x15e),'path':a118_0x330534(0x139),'template':a118_0x330534(0x169)},{'type':a118_0x330534(0x15e),'path':a118_0x330534(0x149),'template':a118_0x330534(0x169)}]},'codebuddy':{'name':a118_0x330534(0x160),'description':a118_0x330534(0x156),'folders':[a118_0x330534(0x16c)],'files':[{'type':a118_0x330534(0x15e),'path':a118_0x330534(0x168),'template':a118_0x330534(0x169)}]},'trae':{'name':a118_0x330534(0x13b),'description':a118_0x330534(0x14f),'folders':[a118_0x330534(0x150)],'files':[{'type':a118_0x330534(0x15e),'path':'.trae/skills/lovrabet/SKILL.md','template':a118_0x330534(0x169)}]}};function a118_0xf009(_0x14de3f,_0x3475b1){_0x14de3f=_0x14de3f-0x130;const _0x4ee13f=a118_0x4ee1();let _0xf00946=_0x4ee13f[_0x14de3f];return _0xf00946;}export const IDE_CONFIGS={...CORE_IDE_CONFIGS,'agent':{'name':a118_0x330534(0x14d),'description':'通用模板\x20-\x20兜底方案','folders':[a118_0x330534(0x14a)],'files':[{'type':a118_0x330534(0x15e),'path':'.agent/skills/lovrabet/SKILL.md','template':'SKILL.md.tpl'}]},'antigravity':{'name':a118_0x330534(0x138),'description':a118_0x330534(0x146),'folders':[a118_0x330534(0x14a)],'files':[{'type':a118_0x330534(0x15e),'path':a118_0x330534(0x165),'template':'SKILL.md.tpl'}]}};export const CORE_IDE_LIST=[a118_0x330534(0x166),a118_0x330534(0x152),a118_0x330534(0x148),'codex','cursor','opencode',a118_0x330534(0x130),a118_0x330534(0x16d),a118_0x330534(0x13d)];export const IDE_LIST=[a118_0x330534(0x13f),a118_0x330534(0x166),a118_0x330534(0x152),a118_0x330534(0x148),a118_0x330534(0x163),a118_0x330534(0x141),a118_0x330534(0x155),a118_0x330534(0x130),a118_0x330534(0x16d),a118_0x330534(0x13d),a118_0x330534(0x15b)];export const ALL_CORE_IDES=[a118_0x330534(0x141),a118_0x330534(0x13d),a118_0x330534(0x166),a118_0x330534(0x152),'codex','opencode',a118_0x330534(0x130),a118_0x330534(0x148),a118_0x330534(0x16d)];function a118_0x4ee1(){const _0x2a70dd=['6GyESFu','.windsurf/workflows/rabetbase.md','agent','11CEPcbN','.qoder','file','2ZDZNwf','CodeBuddy','88znASZs','.cursor/skills/rabetbase.md','codex','Cursor','.agent/skills/lovrabet/SKILL.md','claude','5028YsVOED','.codebuddy/skills/lovrabet/SKILL.md','SKILL.md.tpl','309807vPjVcK','.cline/skills/lovrabet/SKILL.md','.codebuddy','trae','qoder','65kNhbpp','Codex\x20IDE','217219PpdtIN','.claude/skills/lovrabet/SKILL.md','Cline\x20IDE','.codex','.cursorrules','Antigravity','.qoder/rules/rabetbase.md','Claude\x20Code','Trae','.cursor','windsurf','1717370fqFlnw','antigravity','Cursor\x20IDE','cursor','.windsurf','.opencode','Qoder','OpenCode\x20IDE','Antigravity\x20IDE','265970YVHRnr','codebuddy','.qoder/skills/lovrabet/SKILL.md','.agent','3729222uvFOAm','.opencode/skills/lovrabet/SKILL.md','其他\x20(通用模板)','208VGobIs','Trae\x20IDE','.trae','Windsurf\x20IDE','cline','2369100edafQU','Qoder\x20IDE','opencode','CodeBuddy\x20IDE','.claude','.codex/skills/lovrabet/SKILL.md'];a118_0x4ee1=function(){return _0x2a70dd;};return a118_0x4ee1();}export const MCP_IDES=new Set([a118_0x330534(0x141),'claude']);
|
package/lib/utils/cdn-config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2c5ccc,_0x23b8a2){const _0x231324=a119_0x2433,_0xfc6c54=_0x2c5ccc();while(!![]){try{const _0x4baffb=parseInt(_0x231324(0x138))/0x1+parseInt(_0x231324(0x13b))/0x2+parseInt(_0x231324(0x141))/0x3+parseInt(_0x231324(0x13e))/0x4*(parseInt(_0x231324(0x143))/0x5)+-parseInt(_0x231324(0x142))/0x6+parseInt(_0x231324(0x144))/0x7*(-parseInt(_0x231324(0x139))/0x8)+-parseInt(_0x231324(0x13c))/0x9;if(_0x4baffb===_0x23b8a2)break;else _0xfc6c54['push'](_0xfc6c54['shift']());}catch(_0x333115){_0xfc6c54['push'](_0xfc6c54['shift']());}}}(a119_0x51aa,0x8b393));import{getTemplateBaseUrl}from'./config.js';function a119_0x51aa(){const _0x5d8ca1=['1675352ueVCTb','6434289LpziPO','sdk','3431612uARbuo','node','cli','900450epojbd','5089572wzTviv','5YvNUpK','2954TqgTrQ','stableVersion','264313MrhEgw','2400jQQoLl','application/json'];a119_0x51aa=function(){return _0x5d8ca1;};return a119_0x51aa();}export async function fetchCdnConfig(){const _0x4137d3=a119_0x2433;try{const _0x2b9e32=getTemplateBaseUrl(),_0x3fc7a4=_0x2b9e32+'/config.json',_0x536430=await fetch(_0x3fc7a4,{'headers':{'Accept':_0x4137d3(0x13a)}});if(!_0x536430['ok'])return null;const _0x203d6b=await _0x536430['json']();if(!_0x203d6b[_0x4137d3(0x140)]?.[_0x4137d3(0x137)]||!_0x203d6b[_0x4137d3(0x13d)]?.[_0x4137d3(0x13f)]?.['stableVersion'])return null;return _0x203d6b;}catch{return null;}}let cachedConfig=null,cacheTime=0x0;const CACHE_TTL=0x5*0x3c*0x3e8;function a119_0x2433(_0x2b14eb,_0x327b19){_0x2b14eb=_0x2b14eb-0x137;const _0x51aa25=a119_0x51aa();let _0x243362=_0x51aa25[_0x2b14eb];return _0x243362;}export async function getCdnConfig(){const _0x400f34=Date['now']();if(cachedConfig&&_0x400f34-cacheTime<CACHE_TTL)return cachedConfig;const _0x2a997f=await fetchCdnConfig();return _0x2a997f&&(cachedConfig=_0x2a997f,cacheTime=_0x400f34),_0x2a997f;}export function clearCdnConfigCache(){cachedConfig=null,cacheTime=0x0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a120_0x6b78c5=a120_0x5327;(function(_0x52216f,_0x3c25b1){const _0x3c457a=a120_0x5327,_0x589924=_0x52216f();while(!![]){try{const _0x9fb619=-parseInt(_0x3c457a(0x101))/0x1+parseInt(_0x3c457a(0xfb))/0x2*(parseInt(_0x3c457a(0x105))/0x3)+-parseInt(_0x3c457a(0xfc))/0x4*(-parseInt(_0x3c457a(0x100))/0x5)+-parseInt(_0x3c457a(0x10c))/0x6*(parseInt(_0x3c457a(0x106))/0x7)+-parseInt(_0x3c457a(0x103))/0x8+parseInt(_0x3c457a(0x108))/0x9+parseInt(_0x3c457a(0x10b))/0xa;if(_0x9fb619===_0x3c25b1)break;else _0x589924['push'](_0x589924['shift']());}catch(_0x21b9e4){_0x589924['push'](_0x589924['shift']());}}}(a120_0x36b6,0xd57cd));import a120_0x3fc487 from'node:fs';import a120_0x585f74 from'node:path';import a120_0x542364 from'semver';import{getCdnConfig}from'./cdn-config.js';const FALLBACK_MIN_SDK_VERSION=a120_0x6b78c5(0xfd);function isNonNumericVersion(_0x2478bd){const _0x34ed28=a120_0x6b78c5,_0x417eae=[/^latest$/i,/^beta$/i,/^alpha$/i,/^canary$/i,/^\*$/,/^x$/];return _0x417eae['some'](_0x18fcef=>_0x18fcef[_0x34ed28(0x10a)](_0x2478bd));}function getInstalledVersion(_0x23a8dd,_0x3f8709){const _0x14de5b=a120_0x6b78c5;try{const _0x2e4375=a120_0x585f74['join'](_0x23a8dd,_0x14de5b(0xef),_0x3f8709,'package.json');if(a120_0x3fc487['existsSync'](_0x2e4375)){const _0x27bbf6=JSON[_0x14de5b(0xee)](a120_0x3fc487[_0x14de5b(0xfe)](_0x2e4375,'utf-8'));return _0x27bbf6[_0x14de5b(0x102)]||null;}}catch{}return null;}async function getSdkStableVersion(){const _0x34393a=a120_0x6b78c5;try{const _0x21b630=await getCdnConfig();return _0x21b630?.[_0x34393a(0xf8)]?.[_0x34393a(0x104)]?.['stableVersion']||null;}catch{return null;}}async function getSdkPackageName(){const _0x551c2d=a120_0x6b78c5;try{const _0x5e2045=await getCdnConfig();return _0x5e2045?.['sdk']?.[_0x551c2d(0x104)]?.['packageName']||_0x551c2d(0xf9);}catch{return _0x551c2d(0xf9);}}export async function checkSdkVersion(_0x57de09){const _0x30302c=a120_0x6b78c5,_0x533b27=a120_0x585f74[_0x30302c(0xff)](_0x57de09,_0x30302c(0x107)),[_0x388efc,_0x4e560c]=await Promise['all']([getSdkStableVersion(),getSdkPackageName()]),_0xe7113e=_0x388efc||FALLBACK_MIN_SDK_VERSION;if(!a120_0x3fc487[_0x30302c(0x10e)](_0x533b27))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0xe7113e,'packageName':_0x4e560c,'stableVersion':_0x388efc};try{const _0x2a2e5d=JSON[_0x30302c(0xee)](a120_0x3fc487[_0x30302c(0xfe)](_0x533b27,_0x30302c(0x111))),_0x239b1f=_0x2a2e5d[_0x30302c(0x110)]||{},_0xce60f6=_0x2a2e5d[_0x30302c(0xf5)]||{},_0x5a2cb0=_0x239b1f[_0x4e560c]||_0xce60f6[_0x4e560c];if(!_0x5a2cb0)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0xe7113e,'packageName':_0x4e560c,'stableVersion':_0x388efc};let _0x131c86=getInstalledVersion(_0x57de09,_0x4e560c);!_0x131c86&&(_0x131c86=_0x5a2cb0);if(isNonNumericVersion(_0x5a2cb0))return{'installed':!![],'version':_0x131c86,'needsUpgrade':![],'minVersion':_0xe7113e,'packageName':_0x4e560c,'stableVersion':_0x388efc};const _0x2fd68d=a120_0x542364['coerce'](_0x131c86),_0x2b30d6=a120_0x542364['coerce'](_0xe7113e),_0x2710c4=_0x2fd68d&&_0x2b30d6?a120_0x542364['lt'](_0x2fd68d,_0x2b30d6):![];return{'installed':!![],'version':_0x131c86,'needsUpgrade':_0x2710c4,'minVersion':_0xe7113e,'packageName':_0x4e560c,'stableVersion':_0x388efc};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':_0xe7113e,'packageName':_0x4e560c,'stableVersion':_0x388efc};}}function a120_0x5327(_0x4f6245,_0x380cee){_0x4f6245=_0x4f6245-0xed;const _0x36b623=a120_0x36b6();let _0x532731=_0x36b623[_0x4f6245];return _0x532731;}export function checkSdkVersionSync(_0x4867a0){const _0x31838e=a120_0x6b78c5,_0x1d0b91=a120_0x585f74[_0x31838e(0xff)](_0x4867a0,_0x31838e(0x107)),_0x6b91f5='@lovrabet/sdk';if(!a120_0x3fc487[_0x31838e(0x10e)](_0x1d0b91))return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x6b91f5,'stableVersion':null};try{const _0x22b5f2=JSON[_0x31838e(0xee)](a120_0x3fc487[_0x31838e(0xfe)](_0x1d0b91,_0x31838e(0x111))),_0x16f8a0=_0x22b5f2[_0x31838e(0x110)]||{},_0x55a3eb=_0x22b5f2[_0x31838e(0xf5)]||{},_0x2f883e=_0x16f8a0[_0x6b91f5]||_0x55a3eb[_0x6b91f5];if(!_0x2f883e)return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x6b91f5,'stableVersion':null};let _0x23ba35=getInstalledVersion(_0x4867a0,_0x6b91f5);!_0x23ba35&&(_0x23ba35=_0x2f883e);if(isNonNumericVersion(_0x2f883e))return{'installed':!![],'version':_0x23ba35,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x6b91f5,'stableVersion':null};const _0x1d437d=a120_0x542364[_0x31838e(0xf7)](_0x23ba35),_0xc19de4=_0x1d437d?a120_0x542364['lt'](_0x1d437d,FALLBACK_MIN_SDK_VERSION):![];return{'installed':!![],'version':_0x23ba35,'needsUpgrade':_0xc19de4,'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x6b91f5,'stableVersion':null};}catch{return{'installed':![],'version':null,'needsUpgrade':![],'minVersion':FALLBACK_MIN_SDK_VERSION,'packageName':_0x6b91f5,'stableVersion':null};}}function a120_0x36b6(){const _0x29c9e6=['latest','188254mmIQIK','172VuUWpr','1.2.0','readFileSync','join','45655kEWEQq','1597161XHepHI','version','9625176QOwmKp','node','51LjoQmU','7tKveWE','package.json','637101EwDrmo','npm\x20install\x20','test','23663960GxinaJ','4531344nMePze','\x1b[1m','existsSync','\x1b[0m','dependencies','utf8','\x1b[33m','parse','node_modules','\x20\x20\x20Current\x20version:\x20','↪\x20SDK\x20update\x20available','stableVersion','minVersion','log','devDependencies','needsUpgrade','coerce','sdk','@lovrabet/sdk'];a120_0x36b6=function(){return _0x29c9e6;};return a120_0x36b6();}export function printSdkUpgradeWarning(_0x3b80ee){const _0x29e955=a120_0x6b78c5;if(!_0x3b80ee[_0x29e955(0xf6)])return;const _0x2b5d80=_0x29e955(0xed),_0x448a61=_0x29e955(0x10f),_0x255d52=_0x29e955(0x10d),_0x4309e1=_0x3b80ee['packageName']||_0x29e955(0xf9),_0x3eb07a=_0x3b80ee[_0x29e955(0xf2)]||_0x3b80ee[_0x29e955(0xf3)],_0x12ae6e=_0x29e955(0x109)+_0x4309e1+'@'+(_0x3eb07a||_0x29e955(0xfa));console[_0x29e955(0xf4)](),console[_0x29e955(0xf4)](''+_0x2b5d80+_0x255d52+_0x29e955(0xf1)+_0x448a61),console[_0x29e955(0xf4)](_0x2b5d80+_0x29e955(0xf0)+_0x4309e1+'@'+_0x3b80ee[_0x29e955(0x102)]+_0x448a61),console['log'](_0x2b5d80+'\x20\x20\x20Stable\x20version:\x20'+_0x3eb07a+_0x448a61),console[_0x29e955(0xf4)](_0x2b5d80+'\x20\x20\x20Upgrade\x20command:\x20'+_0x12ae6e+_0x448a61),console[_0x29e955(0xf4)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4a7359,_0x597f02){const _0x1caf74=a121_0x3888,_0x40c4d0=_0x4a7359();while(!![]){try{const _0x2ec7db=parseInt(_0x1caf74(0x162))/0x1*(-parseInt(_0x1caf74(0x158))/0x2)+-parseInt(_0x1caf74(0x15d))/0x3*(-parseInt(_0x1caf74(0x14f))/0x4)+parseInt(_0x1caf74(0x163))/0x5*(parseInt(_0x1caf74(0x14d))/0x6)+parseInt(_0x1caf74(0x150))/0x7*(-parseInt(_0x1caf74(0x149))/0x8)+parseInt(_0x1caf74(0x15a))/0x9*(-parseInt(_0x1caf74(0x157))/0xa)+parseInt(_0x1caf74(0x153))/0xb*(-parseInt(_0x1caf74(0x159))/0xc)+parseInt(_0x1caf74(0x151))/0xd*(parseInt(_0x1caf74(0x15b))/0xe);if(_0x2ec7db===_0x597f02)break;else _0x40c4d0['push'](_0x40c4d0['shift']());}catch(_0x3ba43c){_0x40c4d0['push'](_0x40c4d0['shift']());}}}(a121_0x38b9,0x2ea49));import{readFileSync}from'node:fs';function a121_0x3888(_0xa7aabf,_0x6a0e08){_0xa7aabf=_0xa7aabf-0x144;const _0x38b997=a121_0x38b9();let _0x388847=_0x38b997[_0xa7aabf];return _0x388847;}import{resolve,dirname}from'node:path';import{fileURLToPath}from'node:url';import a121_0x2f52b2 from'semver';import{getCdnConfig}from'./cdn-config.js';import{NPM_PACKAGE_NAME}from'../constant/cli.js';function getCurrentCliVersion(){const _0x44caa1=a121_0x3888;try{const _0x2c29ce=fileURLToPath(import.meta.url),_0x224e29=resolve(dirname(_0x2c29ce),_0x44caa1(0x14e)),_0xd5ba6a=resolve(_0x224e29,_0x44caa1(0x156)),_0x5b873c=JSON[_0x44caa1(0x146)](readFileSync(_0xd5ba6a,_0x44caa1(0x15c)));return _0x5b873c['version']||_0x44caa1(0x14c);}catch{return _0x44caa1(0x14c);}}function isNonNumericVersion(_0x5b6133){const _0x163229=a121_0x3888,_0x4ea1b9=[/^latest$/i,/^beta$/i,/^alpha$/i,/^canary$/i,/^\^/,/^~/,/^>/,/^</,/^\*/,/^x$/];return _0x4ea1b9[_0x163229(0x14a)](_0x421c7f=>_0x421c7f[_0x163229(0x164)](_0x5b6133));}export async function checkCliVersion(){const _0x26734a=a121_0x3888,_0x439a8b=getCurrentCliVersion(),_0x4ca522=await getCdnConfig(),_0x376fbc=_0x4ca522?.[_0x26734a(0x15f)]?.[_0x26734a(0x15e)]||null;let _0x19da78=![];if(_0x376fbc)try{const _0x4bc850=a121_0x2f52b2['coerce'](_0x439a8b),_0x5972ab=a121_0x2f52b2['coerce'](_0x376fbc);_0x4bc850&&_0x5972ab&&(_0x19da78=a121_0x2f52b2['lt'](_0x4bc850,_0x5972ab));}catch{_0x19da78=![];}return{'currentVersion':_0x439a8b,'stableVersion':_0x376fbc,'needsUpgrade':_0x19da78,'isPreRelease':![]};}export function printCliUpgradeWarning(_0x22acf8){const _0x4340d=a121_0x3888;if(!_0x22acf8[_0x4340d(0x155)])return;const _0x192bfb='\x1b[33m',_0x331b25=_0x4340d(0x144),_0x410697='\x1b[1m',_0x137641=_0x4340d(0x154)+NPM_PACKAGE_NAME+_0x4340d(0x160);console[_0x4340d(0x148)](),console[_0x4340d(0x148)](''+_0x192bfb+_0x410697+_0x4340d(0x145)+_0x331b25),console[_0x4340d(0x148)](_0x192bfb+_0x4340d(0x161)+_0x22acf8[_0x4340d(0x152)]+_0x331b25),console['log'](_0x192bfb+_0x4340d(0x14b)+_0x22acf8[_0x4340d(0x15e)]+_0x331b25),console['log'](_0x192bfb+_0x4340d(0x147)+_0x137641+_0x331b25),console[_0x4340d(0x148)]();}function a121_0x38b9(){const _0x435e9d=['utf-8','582emDnWw','stableVersion','cli','@latest','\x20\x20\x20Current\x20CLI\x20version:\x20','3NiDfVf','55zrPazs','test','\x1b[0m','↪\x20New\x20version\x20available','parse','\x20\x20\x20Upgrade\x20command:\x20','log','1133256pCzZiu','some','\x20\x20\x20Stable\x20version:\x20','1.0.0','168918MJnbVm','../..','4440MkzeAH','7ZnjRFw','13HrPbEr','currentVersion','21934oNAbCP','npm\x20install\x20-g\x20','needsUpgrade','package.json','222710MmoWaP','136646eHDLgk','1788vbvXWq','63crUnie','6519170jtsthz'];a121_0x38b9=function(){return _0x435e9d;};return a121_0x38b9();}
|
package/lib/utils/config.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5f5915,_0x21efc3){const _0x417400=a122_0x17a9,_0x24fd9f=_0x5f5915();while(!![]){try{const _0x4650ab=-parseInt(_0x417400(0xcd))/0x1*(-parseInt(_0x417400(0xc8))/0x2)+-parseInt(_0x417400(0xd3))/0x3*(parseInt(_0x417400(0xcf))/0x4)+-parseInt(_0x417400(0xc3))/0x5+-parseInt(_0x417400(0xd2))/0x6+-parseInt(_0x417400(0xc4))/0x7+-parseInt(_0x417400(0xbc))/0x8*(parseInt(_0x417400(0xc2))/0x9)+-parseInt(_0x417400(0xd1))/0xa*(-parseInt(_0x417400(0xce))/0xb);if(_0x4650ab===_0x21efc3)break;else _0x24fd9f['push'](_0x24fd9f['shift']());}catch(_0x5577f8){_0x24fd9f['push'](_0x24fd9f['shift']());}}}(a122_0x182e,0xd14b3));import{initEnv}from'../constant/env.js';function a122_0x182e(){const _0x481fe3=['apps','env','string','appcode','template_base_url','9wTNkhX','6543040ZsKnJN','1131830RORKsO','values','app','length','23314GjGhdH','keys','entries','object','trim','7tGHwWX','660edaShe','4LOheZU','map','943700LSghtF','8070048kQkckG','2457087PZeyce','10017576oWbIMI'];a122_0x182e=function(){return _0x481fe3;};return a122_0x182e();}import{readRawConfig}from'../context.js';export{getProjectConfigPath,getGlobalConfigPath}from'../context.js';export{isInProject}from'../context.js';export function readConfig(_0x2de62f){const _0x5095c8=a122_0x17a9,_0x41bb2f=readRawConfig(_0x2de62f);return _0x41bb2f[_0x5095c8(0xbe)]&&typeof _0x41bb2f[_0x5095c8(0xbe)]===_0x5095c8(0xbf)&&initEnv(_0x41bb2f[_0x5095c8(0xbe)]),_0x41bb2f;}export function getConfigAppCode(){const _0x547e9f=a122_0x17a9,_0x28c668=readRawConfig();if(_0x28c668[_0x547e9f(0xbd)]&&typeof _0x28c668[_0x547e9f(0xbd)]===_0x547e9f(0xcb)){const _0xd20d3d=_0x28c668['defaultApp'];if(_0xd20d3d&&_0x28c668[_0x547e9f(0xbd)][_0xd20d3d]?.[_0x547e9f(0xc0)])return String(_0x28c668[_0x547e9f(0xbd)][_0xd20d3d]['appcode'])[_0x547e9f(0xcc)]();const _0x118866=Object[_0x547e9f(0xc5)](_0x28c668['apps'])[0x0];if(_0x118866?.[_0x547e9f(0xc0)])return String(_0x118866[_0x547e9f(0xc0)])['trim']();}const _0x4aafca=_0x28c668[_0x547e9f(0xc0)]||_0x28c668[_0x547e9f(0xc6)];if(typeof _0x4aafca!==_0x547e9f(0xbf)||_0x4aafca[_0x547e9f(0xcc)]()==='')return undefined;return _0x4aafca[_0x547e9f(0xcc)]();}function a122_0x17a9(_0x515039,_0x145c4e){_0x515039=_0x515039-0xbc;const _0x182ea1=a122_0x182e();let _0x17a943=_0x182ea1[_0x515039];return _0x17a943;}export function getMultiAppConfigs(){const _0x1ac47d=a122_0x17a9,_0x384084=readRawConfig(),_0x49e755=_0x384084['apps'];if(!_0x49e755||typeof _0x49e755!==_0x1ac47d(0xcb)||Object[_0x1ac47d(0xc9)](_0x49e755)[_0x1ac47d(0xc7)]===0x0)return null;const _0x1ebd69=_0x384084['defaultApp'];return Object[_0x1ac47d(0xca)](_0x49e755)[_0x1ac47d(0xd0)](([_0x125f00,_0x34a8c1])=>({'name':_0x125f00,'appcode':_0x34a8c1?.['appcode']||'','isDefault':_0x125f00===_0x1ebd69,'env':_0x34a8c1?.['env'],'apiDir':_0x34a8c1?.['apiDir'],'cookie':_0x34a8c1?.['cookie']||undefined}))['filter'](_0xf9e92=>_0xf9e92[_0x1ac47d(0xc0)]);}export function getTemplateBaseUrl(){const _0x369ac3=a122_0x17a9,_0x18cb29=readRawConfig();if(_0x18cb29[_0x369ac3(0xc1)]&&typeof _0x18cb29[_0x369ac3(0xc1)]==='string')return _0x18cb29[_0x369ac3(0xc1)]['replace'](/\/$/,'');return'https://g.lovrabet.com/dist/lovrabet-skill';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a123_0x1782(_0x392f8f,_0x48c10c){_0x392f8f=_0x392f8f-0x1e0;const _0x3afc08=a123_0x3afc();let _0x178245=_0x3afc08[_0x392f8f];return _0x178245;}(function(_0x471dd1,_0x1c7278){const _0x46964a=a123_0x1782,_0x54a74a=_0x471dd1();while(!![]){try{const _0x27811e=-parseInt(_0x46964a(0x1e4))/0x1+parseInt(_0x46964a(0x1e9))/0x2+-parseInt(_0x46964a(0x1e0))/0x3+parseInt(_0x46964a(0x1e7))/0x4*(parseInt(_0x46964a(0x1e8))/0x5)+parseInt(_0x46964a(0x1ec))/0x6*(-parseInt(_0x46964a(0x1ee))/0x7)+parseInt(_0x46964a(0x1ed))/0x8*(-parseInt(_0x46964a(0x1e5))/0x9)+parseInt(_0x46964a(0x1e1))/0xa;if(_0x27811e===_0x1c7278)break;else _0x54a74a['push'](_0x54a74a['shift']());}catch(_0x5402e7){_0x54a74a['push'](_0x54a74a['shift']());}}}(a123_0x3afc,0x1de76));import a123_0x2e8eda from'node:path';function a123_0x3afc(){const _0x3100a7=['326892CERIOO','5gytTpy','174914iCyvqA','name','isDirectory','696nbXzuc','528464PuFJtR','3066xjVPKv','copyFileSync','546396mpYBBa','4573720BJrvRl','mkdirSync','join','205068IWHzqP','9mxZHlB','复制目录时出错:'];a123_0x3afc=function(){return _0x3100a7;};return a123_0x3afc();}import a123_0x1533e4 from'node:fs';export async function copyDirectory(_0xf4dbe5,_0x5cd389){const _0x27b6b9=a123_0x1782;try{const _0x54a1f6=a123_0x1533e4['readdirSync'](_0xf4dbe5,{'withFileTypes':!![]});a123_0x1533e4[_0x27b6b9(0x1e2)](_0x5cd389,{'recursive':!![]});for(const _0x2111f2 of _0x54a1f6){const _0x379224=a123_0x2e8eda[_0x27b6b9(0x1e3)](_0xf4dbe5,_0x2111f2[_0x27b6b9(0x1ea)]),_0xbc0362=a123_0x2e8eda[_0x27b6b9(0x1e3)](_0x5cd389,_0x2111f2[_0x27b6b9(0x1ea)]);_0x2111f2[_0x27b6b9(0x1eb)]()?await copyDirectory(_0x379224,_0xbc0362):a123_0x1533e4[_0x27b6b9(0x1ef)](_0x379224,_0xbc0362);}}catch(_0x5c9bb6){console['error'](_0x27b6b9(0x1e6),_0x5c9bb6);}}
|
package/lib/utils/file-utils.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a124_0x5c0a(_0x5d7a95,_0x37da19){_0x5d7a95=_0x5d7a95-0x91;const _0x3a2403=a124_0x3a24();let _0x5c0a1f=_0x3a2403[_0x5d7a95];return _0x5c0a1f;}(function(_0x14793d,_0x3b763d){const _0x5dca03=a124_0x5c0a,_0x2efe4b=_0x14793d();while(!![]){try{const _0x557775=parseInt(_0x5dca03(0x93))/0x1*(parseInt(_0x5dca03(0x9a))/0x2)+parseInt(_0x5dca03(0x95))/0x3*(parseInt(_0x5dca03(0x91))/0x4)+-parseInt(_0x5dca03(0x9c))/0x5+-parseInt(_0x5dca03(0x98))/0x6+parseInt(_0x5dca03(0x96))/0x7*(parseInt(_0x5dca03(0x9b))/0x8)+-parseInt(_0x5dca03(0x94))/0x9*(parseInt(_0x5dca03(0x92))/0xa)+-parseInt(_0x5dca03(0x97))/0xb*(parseInt(_0x5dca03(0x99))/0xc);if(_0x557775===_0x3b763d)break;else _0x2efe4b['push'](_0x2efe4b['shift']());}catch(_0x24b498){_0x2efe4b['push'](_0x2efe4b['shift']());}}}(a124_0x3a24,0xf0272));function a124_0x3a24(){const _0x525e4c=['34156ZdjpHQ','16BsozSR','6572535QBYpwA','116980iXVBny','30IzvgfP','100atcHdU','1823247QryhgF','183fmYxqn','976647oznmWo','209icaYBA','3795654DGdOor','146688gRfJSl'];a124_0x3a24=function(){return _0x525e4c;};return a124_0x3a24();}import{existsSync,mkdirSync,copyFileSync,readdirSync,statSync}from'node:fs';import{join}from'node:path';export async function copyDir(_0x51b090,_0x69ab0){const _0x381351=statSync(_0x51b090);if(_0x381351['isDirectory']()){!existsSync(_0x69ab0)&&mkdirSync(_0x69ab0,{'recursive':!![]});const _0x291111=readdirSync(_0x51b090);for(const _0x40be6a of _0x291111){await copyDir(join(_0x51b090,_0x40be6a),join(_0x69ab0,_0x40be6a));}}else copyFileSync(_0x51b090,_0x69ab0);}export function ensureDir(_0x705ef6){!existsSync(_0x705ef6)&&mkdirSync(_0x705ef6,{'recursive':!![]});}export function pathExists(_0x45b189){return existsSync(_0x45b189);}
|
package/lib/utils/guides-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a125_0x2b6d31=a125_0x2bcf;(function(_0x18779f,_0x26848e){const _0x56db83=a125_0x2bcf,_0x408271=_0x18779f();while(!![]){try{const _0x53d680=-parseInt(_0x56db83(0x1e2))/0x1+-parseInt(_0x56db83(0x1c4))/0x2+parseInt(_0x56db83(0x1c2))/0x3+parseInt(_0x56db83(0x1d7))/0x4*(-parseInt(_0x56db83(0x1d4))/0x5)+-parseInt(_0x56db83(0x1e7))/0x6*(-parseInt(_0x56db83(0x1c6))/0x7)+parseInt(_0x56db83(0x1e8))/0x8*(parseInt(_0x56db83(0x1c3))/0x9)+parseInt(_0x56db83(0x1cf))/0xa*(parseInt(_0x56db83(0x1dc))/0xb);if(_0x53d680===_0x26848e)break;else _0x408271['push'](_0x408271['shift']());}catch(_0x7da6fd){_0x408271['push'](_0x408271['shift']());}}}(a125_0x2531,0xf18d5));import{mkdirSync,writeFileSync}from'node:fs';import{dirname,join}from'node:path';import{getTemplateBaseUrl}from'./config.js';function getGuidesCdnUrl(){const _0x57ba02=a125_0x2bcf,_0x553234=getTemplateBaseUrl();return _0x553234+_0x57ba02(0x1cd);}function a125_0x2531(){const _0xb599e8=['CDN\x20请求失败:\x20','CDN\x20数据中缺少\x20skillTemplate','content','1060015usYhnb','skillTemplate','application/json','4cYaRsl','title','HOME','push','CDN\x20返回数据格式错误','1236059YDLFpb','length','replace','USERPROFILE','map','extendContent','110638lQvKyg','utf-8','env','json','trimEnd','6OqSXdM','136DprSbZ','2607174resKSG','1962kGPagK','3260330BIxLbT','join','327579AfyTvB','guides','lastUpdated','entries','.lovrabet','.md','keys','/skills/guides.json','path','180vFgcrw','statusText'];a125_0x2531=function(){return _0xb599e8;};return a125_0x2531();}const CACHE_DIR=join(process[a125_0x2b6d31(0x1e4)][a125_0x2b6d31(0x1d9)]||process['env'][a125_0x2b6d31(0x1df)]||'',a125_0x2b6d31(0x1ca),'cache');export async function fetchGuidesFromCDN(){const _0x522986=a125_0x2b6d31,_0xf46b72=getGuidesCdnUrl(),_0x5276b6=await fetch(_0xf46b72,{'headers':{'Accept':_0x522986(0x1d6)}});if(!_0x5276b6['ok'])throw new Error(_0x522986(0x1d1)+_0x5276b6['status']+'\x20'+_0x5276b6[_0x522986(0x1d0)]);const _0xe86d93=await _0x5276b6[_0x522986(0x1e5)]();if(!_0xe86d93['guides']||typeof _0xe86d93['guides']!=='object')throw new Error(_0x522986(0x1db));return _0xe86d93;}export function writeGuidesToProject(_0x1d316e,_0xb5d72f,_0x46b5e5='.lovrabet/skill/guides',_0x397820){const _0x4f09fb=a125_0x2b6d31,_0x4c8edc=join(_0xb5d72f,_0x46b5e5);mkdirSync(_0x4c8edc,{'recursive':!![]});for(const [_0x284c9a,_0x31d651]of Object[_0x4f09fb(0x1c9)](_0x1d316e[_0x4f09fb(0x1c7)])){let _0x5db530=_0x31d651['content'];_0x31d651[_0x4f09fb(0x1c8)]&&(_0x5db530=appendUpdateTime(_0x5db530,_0x31d651[_0x4f09fb(0x1c8)])),writeFileSync(join(_0x4c8edc,_0x284c9a+_0x4f09fb(0x1cb)),_0x5db530,_0x4f09fb(0x1e3));}}export function appendUpdateTime(_0x5b13a4,_0x8d0b9f){return _0x5b13a4=_0x5b13a4['replace'](/\n*>更新时间:.*$/m,''),_0x5b13a4['trimEnd']()+('\x0a\x0a>更新时间:'+_0x8d0b9f);}function a125_0x2bcf(_0x7d3427,_0x4fbf3c){_0x7d3427=_0x7d3427-0x1c2;const _0x2531cf=a125_0x2531();let _0x2bcf86=_0x2531cf[_0x7d3427];return _0x2bcf86;}export function getSkillTemplate(_0x3ece89){const _0x2523b5=a125_0x2b6d31;return _0x3ece89[_0x2523b5(0x1d5)]?.[_0x2523b5(0x1d3)]||'';}export function appendExtendContents(_0xa9ccfe,_0xac7f8e,_0x1a33b0){const _0xfca377=a125_0x2b6d31,_0x51f33e=[];for(const [,_0x13f52f]of Object[_0xfca377(0x1c9)](_0xac7f8e[_0xfca377(0x1c7)])){_0x13f52f[_0xfca377(0x1e1)]&&_0x51f33e[_0xfca377(0x1da)](_0x13f52f[_0xfca377(0x1e1)][_0xfca377(0x1e6)]());}if(_0x51f33e[_0xfca377(0x1dd)]===0x0)return _0xa9ccfe;return _0xa9ccfe[_0xfca377(0x1e6)]()+'\x0a\x0a'+_0x51f33e[_0xfca377(0x1c5)]('\x0a\x0a')+'\x0a';}export function writeSkillFile(_0x27b59d,_0x5289c5,_0x15b737){const _0x200df6=a125_0x2b6d31,_0x156491=getSkillTemplate(_0x27b59d);if(!_0x156491)throw new Error(_0x200df6(0x1d2));const _0x58b1dc=dirname(_0x5289c5);mkdirSync(_0x58b1dc,{'recursive':!![]});let _0x45d3f2=_0x156491[_0x200df6(0x1de)](/\{\{IDE_NAME\}\}/g,_0x15b737);_0x45d3f2=appendExtendContents(_0x45d3f2,_0x27b59d),_0x27b59d['skillTemplate'][_0x200df6(0x1c8)]&&(_0x45d3f2=appendUpdateTime(_0x45d3f2,_0x27b59d[_0x200df6(0x1d5)][_0x200df6(0x1c8)])),writeFileSync(_0x5289c5,_0x45d3f2,_0x200df6(0x1e3));}export async function installGuides(_0x570c49){const _0x23d660=a125_0x2b6d31,_0x44bee6=await fetchGuidesFromCDN();return writeGuidesToProject(_0x44bee6,_0x570c49),Object[_0x23d660(0x1cc)](_0x44bee6[_0x23d660(0x1c7)])[_0x23d660(0x1dd)];}export function getGuidesSummary(_0x596e32){const _0x4717a3=a125_0x2b6d31;return Object['entries'](_0x596e32['guides'])[_0x4717a3(0x1e0)](([_0x5a2cce,_0x334747])=>({'key':_0x5a2cce,'title':_0x334747[_0x4717a3(0x1d8)],'path':_0x334747[_0x4717a3(0x1ce)]}));}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5935d1,_0x20d7c9){const _0x318805=a126_0x1278,_0x3c0c93=_0x5935d1();while(!![]){try{const _0x1e5a11=-parseInt(_0x318805(0x137))/0x1+parseInt(_0x318805(0x139))/0x2+parseInt(_0x318805(0x130))/0x3*(-parseInt(_0x318805(0x12c))/0x4)+parseInt(_0x318805(0x13f))/0x5*(parseInt(_0x318805(0x146))/0x6)+-parseInt(_0x318805(0x131))/0x7*(parseInt(_0x318805(0x134))/0x8)+-parseInt(_0x318805(0x13e))/0x9+-parseInt(_0x318805(0x12e))/0xa*(-parseInt(_0x318805(0x12d))/0xb);if(_0x1e5a11===_0x20d7c9)break;else _0x3c0c93['push'](_0x3c0c93['shift']());}catch(_0x140973){_0x3c0c93['push'](_0x3c0c93['shift']());}}}(a126_0x503d,0x84395));export async function httpRequest(_0xbea2e0,_0x491f0c={}){const _0x3a391a=a126_0x1278,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x491f0c;let _0x3abb44=null;for(let _0x1c917e=0x0;_0x1c917e<=retries;_0x1c917e++){try{const _0xa2b486=new AbortController(),_0x18a653=setTimeout(()=>_0xa2b486['abort'](),timeout),_0x1db501=await fetch(_0xbea2e0,{'headers':headers,'signal':_0xa2b486[_0x3a391a(0x12f)]});clearTimeout(_0x18a653);let _0x1e6f9b;const _0x3506a1=_0x1db501[_0x3a391a(0x147)][_0x3a391a(0x133)](_0x3a391a(0x144));return _0x3506a1?.[_0x3a391a(0x12b)](_0x3a391a(0x138))?_0x1e6f9b=await _0x1db501[_0x3a391a(0x143)]():_0x1e6f9b=await _0x1db501[_0x3a391a(0x149)](),{'ok':_0x1db501['ok'],'status':_0x1db501['status'],'statusText':_0x1db501[_0x3a391a(0x140)],'data':_0x1e6f9b,'headers':_0x1db501[_0x3a391a(0x147)],'url':_0x1db501[_0x3a391a(0x14b)],'text':()=>_0x1db501[_0x3a391a(0x149)]()};}catch(_0x1b06b0){_0x3abb44=_0x1b06b0 instanceof Error?_0x1b06b0:new Error(String(_0x1b06b0));if(_0x1c917e===retries)break;if(shouldRetry(_0x1b06b0)){console[_0x3a391a(0x14a)](_0x3a391a(0x13c)+retryDelay+_0x3a391a(0x13d)+(_0x1c917e+0x1)+_0x3a391a(0x13b)),await sleep(retryDelay);continue;}else break;}}throw _0x3abb44||new Error(_0x3a391a(0x142));}function shouldRetry(_0x2046c0){const _0x5449ed=a126_0x1278;if(_0x2046c0 instanceof Error){if(_0x2046c0[_0x5449ed(0x13a)]===_0x5449ed(0x141))return![];if(_0x2046c0[_0x5449ed(0x13a)]===_0x5449ed(0x145)&&_0x2046c0[_0x5449ed(0x136)][_0x5449ed(0x12b)](_0x5449ed(0x132)))return!![];if(_0x2046c0[_0x5449ed(0x136)][_0x5449ed(0x12b)](_0x5449ed(0x148)))return!![];if(_0x2046c0['message'][_0x5449ed(0x12b)](_0x5449ed(0x135)))return![];}return![];}function a126_0x1278(_0x4f09d9,_0x2f2233){_0x4f09d9=_0x4f09d9-0x12b;const _0x503d14=a126_0x503d();let _0x1278be=_0x503d14[_0x4f09d9];return _0x1278be;}function sleep(_0x3f16ce){return new Promise(_0x4eadb6=>setTimeout(_0x4eadb6,_0x3f16ce));}function a126_0x503d(){const _0x3346d1=['ms\x20后进行第\x20','8811909jnXfdj','2593085deDwEU','statusText','AbortError','Request\x20failed','json','content-type','TypeError','6tzGJIn','headers','ECONNRESET','text','log','url','includes','4692DJjqfS','572MHPapo','203230WsADma','signal','156yfiPQR','37513AVmHsx','fetch','get','1168aQqNHn','ENOTFOUND','message','3373sONvIV','application/json','1584120iEBMrl','name','\x20次重试...','*\x20请求失败,'];a126_0x503d=function(){return _0x3346d1;};return a126_0x503d();}export function validateUrl(_0x1e0402){try{return new URL(_0x1e0402),!![];}catch{return![];}}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a127_0x101972=a127_0x2a14;function a127_0x2a14(_0x33c4f3,_0x3c468f){_0x33c4f3=_0x33c4f3-0x99;const _0x1c4fbc=a127_0x1c4f();let _0x2a145b=_0x1c4fbc[_0x33c4f3];return _0x2a145b;}(function(_0xb0543a,_0x1fbe47){const _0x435fd2=a127_0x2a14,_0x29327b=_0xb0543a();while(!![]){try{const _0x40a794=-parseInt(_0x435fd2(0xc1))/0x1+parseInt(_0x435fd2(0xbf))/0x2*(-parseInt(_0x435fd2(0xb0))/0x3)+parseInt(_0x435fd2(0xbd))/0x4*(-parseInt(_0x435fd2(0xa4))/0x5)+parseInt(_0x435fd2(0xc0))/0x6*(parseInt(_0x435fd2(0xc7))/0x7)+-parseInt(_0x435fd2(0xb3))/0x8*(parseInt(_0x435fd2(0xc8))/0x9)+-parseInt(_0x435fd2(0xc6))/0xa+parseInt(_0x435fd2(0xaa))/0xb;if(_0x40a794===_0x1fbe47)break;else _0x29327b['push'](_0x29327b['shift']());}catch(_0x247713){_0x29327b['push'](_0x29327b['shift']());}}}(a127_0x1c4f,0xac93a));import a127_0x1bf77f from'winston';function a127_0x1c4f(){const _0x5a6558=['34pOtmwt','286500HELxBB','631076EcgcUO','existsSync','split','完成:\x20','format','11668950xFSIQY','7zKYsrY','8750043nrVEvB','errors','success','utf8','map','timestamp','currentRawCommand','error','logFilePath','red','printf','setLogPath','toISOString','Failed\x20to\x20read\x20logs:','getWinstonInstance','mkdirSync','log','initWinstonLogger','logTask','23605IGfISL','now','message','info','File','setRawCommand','46450228CnNPFY','blue','开始执行:\x20','warn','clear','yellow','109191SmgZiE','addColors','winstonLogger','8MMmpny','writeFileSync','filter','command','dirname','parse','stringify','green','失败:\x20','unknown','148CQdtYs','join'];a127_0x1c4f=function(){return _0x5a6558;};return a127_0x1c4f();}import a127_0x44dcb0 from'node:fs';import a127_0x5a40e2 from'node:path';class Logger{[a127_0x101972(0xb2)];[a127_0x101972(0x99)];[a127_0x101972(0xce)]='';constructor(){const _0x1da440=a127_0x101972;this[_0x1da440(0x99)]='';}[a127_0x101972(0xa9)](_0x4549fe){this['currentRawCommand']=_0x4549fe;}[a127_0x101972(0xa2)](){const _0x5ab4e1=a127_0x101972,_0x12d190=a127_0x5a40e2[_0x5ab4e1(0xb7)](this[_0x5ab4e1(0x99)]);!a127_0x44dcb0[_0x5ab4e1(0xc2)](_0x12d190)&&a127_0x44dcb0[_0x5ab4e1(0xa0)](_0x12d190,{'recursive':!![]});const _0x57781f=a127_0x1bf77f[_0x5ab4e1(0xc5)]['combine'](a127_0x1bf77f[_0x5ab4e1(0xc5)][_0x5ab4e1(0xcd)](),a127_0x1bf77f[_0x5ab4e1(0xc5)][_0x5ab4e1(0xc9)]({'stack':!![]}),a127_0x1bf77f[_0x5ab4e1(0xc5)][_0x5ab4e1(0x9b)](_0x1a418f=>{const _0x3a1d80=_0x5ab4e1,_0x14a658={'timestamp':_0x1a418f[_0x3a1d80(0xcd)]||new Date()[_0x3a1d80(0x9d)](),'level':_0x1a418f['level']||'info','command':_0x1a418f[_0x3a1d80(0xb6)]||_0x3a1d80(0xbc),'rawCommand':_0x1a418f['rawCommand']||this['currentRawCommand']||undefined,'message':_0x1a418f[_0x3a1d80(0xa6)]||'','duration':_0x1a418f['duration']||undefined,'details':_0x1a418f['details']||undefined};return JSON[_0x3a1d80(0xb9)](_0x14a658);}));this[_0x5ab4e1(0xb2)]=a127_0x1bf77f['createLogger']({'level':'info','format':_0x57781f,'transports':[new a127_0x1bf77f['transports'][(_0x5ab4e1(0xa8))]({'filename':this[_0x5ab4e1(0x99)],'level':'info'})],'silent':![]}),a127_0x1bf77f[_0x5ab4e1(0xb1)]({'success':_0x5ab4e1(0xba),'error':_0x5ab4e1(0x9a),'warn':_0x5ab4e1(0xaf),'info':_0x5ab4e1(0xab)});}[a127_0x101972(0x9c)](_0x3eb470){const _0x2efdce=a127_0x101972;this[_0x2efdce(0x99)]=a127_0x5a40e2[_0x2efdce(0xbe)](_0x3eb470,'.lovrabet.log'),this[_0x2efdce(0xb2)]&&this[_0x2efdce(0xb2)][_0x2efdce(0xae)](),this['initWinstonLogger']();}['info'](_0x1e3bb7,_0x5a4675,_0x308c11){const _0x12c4be=a127_0x101972;if(!this[_0x12c4be(0x99)]||!this[_0x12c4be(0xb2)])return;this[_0x12c4be(0xb2)][_0x12c4be(0xa7)](_0x5a4675,{'command':_0x1e3bb7,'details':_0x308c11});}[a127_0x101972(0xca)](_0x3750d5,_0x246d66,_0x1390c8,_0x385ba5){const _0x27ffbc=a127_0x101972;if(!this['logFilePath']||!this['winstonLogger'])return;this['winstonLogger'][_0x27ffbc(0xa1)](_0x27ffbc(0xa7),_0x246d66,{'level':_0x27ffbc(0xca),'command':_0x3750d5,'duration':_0x1390c8,'details':_0x385ba5});}[a127_0x101972(0xcf)](_0x8cb8c0,_0x517290,_0x24285d){const _0x3a23e6=a127_0x101972;if(!this[_0x3a23e6(0x99)]||!this[_0x3a23e6(0xb2)])return;this[_0x3a23e6(0xb2)][_0x3a23e6(0xcf)](_0x517290,{'command':_0x8cb8c0,'details':_0x24285d});}['warn'](_0x172f15,_0x2d9d91,_0x19793c){const _0x1a1f6d=a127_0x101972;if(!this[_0x1a1f6d(0x99)]||!this[_0x1a1f6d(0xb2)])return;this[_0x1a1f6d(0xb2)]['warn'](_0x2d9d91,{'command':_0x172f15,'details':_0x19793c});}async[a127_0x101972(0xa3)](_0x5d824d,_0x45c8e0,_0x3da1aa){const _0x5af827=a127_0x101972,_0x29b296=Date[_0x5af827(0xa5)]();this[_0x5af827(0xa7)](_0x5d824d,_0x5af827(0xac)+_0x45c8e0);try{const _0x2c49d4=await _0x3da1aa(),_0x5029ac=Date['now']()-_0x29b296;return this['success'](_0x5d824d,_0x5af827(0xc4)+_0x45c8e0,_0x5029ac),_0x2c49d4;}catch(_0x27b100){const _0xabad6a=Date[_0x5af827(0xa5)]()-_0x29b296;this[_0x5af827(0xcf)](_0x5d824d,_0x5af827(0xbb)+_0x45c8e0,{'error':_0x27b100 instanceof Error?_0x27b100['message']:String(_0x27b100),'duration':_0xabad6a});throw _0x27b100;}}['readLogs'](){const _0x3e9c9d=a127_0x101972;try{if(!a127_0x44dcb0[_0x3e9c9d(0xc2)](this['logFilePath']))return[];const _0x3382d4=a127_0x44dcb0['readFileSync'](this[_0x3e9c9d(0x99)],'utf8');return _0x3382d4[_0x3e9c9d(0xc3)]('\x0a')[_0x3e9c9d(0xb5)](_0x4c14a5=>_0x4c14a5['trim']())[_0x3e9c9d(0xcc)](_0xc23a2f=>JSON[_0x3e9c9d(0xb8)](_0xc23a2f));}catch(_0x41c46a){return console[_0x3e9c9d(0xad)](_0x3e9c9d(0x9e),_0x41c46a),[];}}['clearLogs'](){const _0xc9861a=a127_0x101972;try{a127_0x44dcb0['existsSync'](this[_0xc9861a(0x99)])&&a127_0x44dcb0[_0xc9861a(0xb4)](this['logFilePath'],'',_0xc9861a(0xcb));}catch(_0x2ea9fb){console['warn']('Failed\x20to\x20clear\x20logs:',_0x2ea9fb);}}[a127_0x101972(0x9f)](){const _0x14c15b=a127_0x101972;return this[_0x14c15b(0xb2)];}}export const logger=new Logger();
|
package/lib/utils/rules-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a128_0x5dcd(){const _0x4382b4=['../../templates/rules/lovrabet_rules.mdc.tpl','statusText','content','lastUpdated','utf-8','444qQZvwW','1286VLrYjD','120Lcnthw','236410wOwgUi','1430883IKnaZj','7qVWwMt','19313OCltJA','11289216cSSryO','3777DpuWeP','80IwTMEW','json','.cursor/rules','CDN\x20请求失败:\x20','223597RAKeGu','application/json','string','/rules/rules.json','lovrabet_rules.mdc','4661970VxdYoz'];a128_0x5dcd=function(){return _0x4382b4;};return a128_0x5dcd();}const a128_0x28c1c4=a128_0x409b;(function(_0x2b5dcd,_0x2b17e5){const _0x355dff=a128_0x409b,_0x3ef68a=_0x2b5dcd();while(!![]){try{const _0x2eb275=-parseInt(_0x355dff(0x6d))/0x1+parseInt(_0x355dff(0x68))/0x2*(parseInt(_0x355dff(0x6f))/0x3)+-parseInt(_0x355dff(0x69))/0x4*(-parseInt(_0x355dff(0x6a))/0x5)+-parseInt(_0x355dff(0x79))/0x6*(parseInt(_0x355dff(0x6c))/0x7)+parseInt(_0x355dff(0x6e))/0x8+-parseInt(_0x355dff(0x6b))/0x9*(parseInt(_0x355dff(0x70))/0xa)+parseInt(_0x355dff(0x74))/0xb*(-parseInt(_0x355dff(0x67))/0xc);if(_0x2eb275===_0x2b17e5)break;else _0x3ef68a['push'](_0x3ef68a['shift']());}catch(_0x3dd63a){_0x3ef68a['push'](_0x3ef68a['shift']());}}}(a128_0x5dcd,0xc7e9e));import{existsSync,mkdirSync,readFileSync,writeFileSync}from'node:fs';import{dirname,join,resolve}from'node:path';import{fileURLToPath}from'node:url';import{getTemplateBaseUrl}from'./config.js';import{appendUpdateTime}from'./guides-cdn.js';const __filename=fileURLToPath(import.meta.url),__dirname=dirname(__filename);function getRulesCdnUrl(){const _0xdbba81=a128_0x409b,_0x2c0eee=getTemplateBaseUrl();return _0x2c0eee+_0xdbba81(0x77);}const LOCAL_TEMPLATE_PATH=resolve(__dirname,a128_0x28c1c4(0x7a));export async function fetchRulesFromCDN(){const _0x27b313=a128_0x28c1c4,_0x5395a4=getRulesCdnUrl(),_0x604401=await fetch(_0x5395a4,{'headers':{'Accept':_0x27b313(0x75)}});if(!_0x604401['ok'])throw new Error(_0x27b313(0x73)+_0x604401['status']+'\x20'+_0x604401[_0x27b313(0x7b)]);const _0x4e15e7=await _0x604401[_0x27b313(0x71)]();if(!_0x4e15e7[_0x27b313(0x64)]||typeof _0x4e15e7[_0x27b313(0x64)]!==_0x27b313(0x76))throw new Error('CDN\x20返回数据格式错误');return _0x4e15e7;}export async function getRulesContent(){const _0x50bf5e=a128_0x28c1c4;try{const _0x57ed20=await fetchRulesFromCDN();return _0x57ed20[_0x50bf5e(0x64)];}catch{return readLocalTemplate();}}export function readLocalTemplate(){if(existsSync(LOCAL_TEMPLATE_PATH))return readFileSync(LOCAL_TEMPLATE_PATH,'utf-8');throw new Error('本地模板文件不存在:\x20'+LOCAL_TEMPLATE_PATH);}export async function writeRulesFile(_0x29991e){const _0x2623d8=a128_0x28c1c4,_0x47f7f7=await fetchRulesFromCDN()['catch'](()=>null);let _0x407734;_0x47f7f7?(_0x407734=_0x47f7f7['content'],_0x47f7f7[_0x2623d8(0x65)]&&(_0x407734=appendUpdateTime(_0x407734,_0x47f7f7[_0x2623d8(0x65)]))):_0x407734=readLocalTemplate();const _0x1633a9=dirname(_0x29991e);!existsSync(_0x1633a9)&&mkdirSync(_0x1633a9,{'recursive':!![]}),writeFileSync(_0x29991e,_0x407734,_0x2623d8(0x66));}function a128_0x409b(_0x1520c2,_0x32a53f){_0x1520c2=_0x1520c2-0x64;const _0x5dcdfe=a128_0x5dcd();let _0x409b93=_0x5dcdfe[_0x1520c2];return _0x409b93;}export async function copyRulesToCursor(_0x1389de){const _0x13f36c=a128_0x28c1c4,_0x22876=join(_0x1389de,_0x13f36c(0x72)),_0x1dbe91=join(_0x22876,_0x13f36c(0x78));if(existsSync(_0x1dbe91))return![];return await writeRulesFile(_0x1dbe91),!![];}export async function copyRulesToAgentsMd(_0x26bdf1){const _0x44916a=join(_0x26bdf1,'agents.md');if(existsSync(_0x44916a))return![];return await writeRulesFile(_0x44916a),!![];}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x58b24b){return new Promise(_0x4df566=>setTimeout(_0x4df566,_0x58b24b));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a130_0x3dd8(_0x377f1b,_0x397cbe){_0x377f1b=_0x377f1b-0x1ed;const _0x173192=a130_0x1731();let _0x3dd855=_0x173192[_0x377f1b];return _0x3dd855;}const a130_0x4fb013=a130_0x3dd8;function a130_0x1731(){const _0x44013f=['.jsx','promises','push','charAt','.js','datasetCode:\x20\x22','7390586JzIJiy','.tpl','utf8','toLocaleDateString','message','api','\x20},','toUpperCase','slice','success','1841354ShzQlv','alias','开始处理模板内容替换','.ts','22743210KhgxvQ','split','readdir','isDirectory','name:\x20\x22','97413BypHop','endsWith','902556ZmuBsy','8qtyBqm','LOVRABET','datasetCode','template','.json','35TKZoMP','processDirectory','map','../../package.json','copyFile','name','replace','processFile','.tsx','toComponentName','version','alias:\x20\x22','mkdir','pop','replaceContent','error','join','toLocaleString','7233939jJgaYO','toLowerCase','tableName:\x20\x22','info','116ySuDhu','2-digit','\x0a\x20\x20\x20\x20{\x20','346077kIqfmM','processTemplate','now','numeric','toDisplayTitle','writeFile'];a130_0x1731=function(){return _0x44013f;};return a130_0x1731();}(function(_0x1dc293,_0x1ce529){const _0x5edabd=a130_0x3dd8,_0x2fa007=_0x1dc293();while(!![]){try{const _0x15660d=-parseInt(_0x5edabd(0x1f3))/0x1+parseInt(_0x5edabd(0x209))/0x2+-parseInt(_0x5edabd(0x212))/0x3*(-parseInt(_0x5edabd(0x1f0))/0x4)+parseInt(_0x5edabd(0x21a))/0x5*(parseInt(_0x5edabd(0x214))/0x6)+parseInt(_0x5edabd(0x1ff))/0x7*(parseInt(_0x5edabd(0x215))/0x8)+-parseInt(_0x5edabd(0x22c))/0x9+-parseInt(_0x5edabd(0x20d))/0xa;if(_0x15660d===_0x1ce529)break;else _0x2fa007['push'](_0x2fa007['shift']());}catch(_0x44f69c){_0x2fa007['push'](_0x2fa007['shift']());}}}(a130_0x1731,0x85883));import a130_0x289c56 from'node:fs';import a130_0x383d38 from'node:path';import{createRequire}from'node:module';import{logger}from'./logger.js';const require=createRequire(import.meta.url),CLI_VERSION=require(a130_0x4fb013(0x21d))[a130_0x4fb013(0x224)];export class TemplateReplacer{static[a130_0x4fb013(0x223)](_0x529505){const _0xfd1033=a130_0x4fb013,_0x63f1ff=_0x529505[_0xfd1033(0x20e)]('/')[_0xfd1033(0x227)]()||_0x529505;return _0x63f1ff[_0xfd1033(0x20e)]('-')[_0xfd1033(0x21c)](_0x559bdf=>_0x559bdf[_0xfd1033(0x1fc)](0x0)[_0xfd1033(0x206)]()+_0x559bdf[_0xfd1033(0x207)](0x1)[_0xfd1033(0x1ed)]())[_0xfd1033(0x22a)]('');}static[a130_0x4fb013(0x1f7)](_0x8c1e59){const _0x3280ec=a130_0x4fb013,_0x2ddfea=_0x8c1e59[_0x3280ec(0x20e)]('/')[_0x3280ec(0x227)]()||_0x8c1e59;return _0x2ddfea[_0x3280ec(0x20e)]('-')[_0x3280ec(0x21c)](_0x3e77dd=>_0x3e77dd[_0x3280ec(0x1fc)](0x0)[_0x3280ec(0x206)]()+_0x3e77dd[_0x3280ec(0x207)](0x1)[_0x3280ec(0x1ed)]())[_0x3280ec(0x22a)]('\x20');}static['replaceContent'](_0x2f2ce0,_0x4b9a14,_0x16ff71){const _0x4bcdb7=a130_0x4fb013,_0x53440c=this[_0x4bcdb7(0x223)](_0x4b9a14),_0x3b6307=this[_0x4bcdb7(0x1f7)](_0x4b9a14),_0xe3dac4=new Date(),_0x547e14=_0xe3dac4[_0x4bcdb7(0x22b)](undefined,{'year':_0x4bcdb7(0x1f6),'month':_0x4bcdb7(0x1f1),'day':'2-digit','hour':_0x4bcdb7(0x1f1),'minute':_0x4bcdb7(0x1f1),'second':_0x4bcdb7(0x1f1),'hour12':![]})[_0x4bcdb7(0x220)](/\//g,'-'),_0x2a776b=_0xe3dac4[_0x4bcdb7(0x202)](undefined,{'year':_0x4bcdb7(0x1f6),'month':_0x4bcdb7(0x1f1),'day':_0x4bcdb7(0x1f1)})['replace'](/\//g,'-'),_0x44816e=_0xe3dac4['toLocaleTimeString'](undefined,{'hour12':![]});let _0x358a39=_0x2f2ce0['replace'](/\{CliVersion\}/g,CLI_VERSION)['replace'](/\{ComponentName\}/g,_0x53440c)['replace'](/\{DisplayTitle\}/g,_0x3b6307)['replace'](/\{PageName\}/g,_0x4b9a14)['replace'](/\{TemplateName\}/g,_0x16ff71)[_0x4bcdb7(0x220)](/\{CreatedAt\}/g,_0x547e14)['replace'](/\{CreatedDate\}/g,_0x2a776b)[_0x4bcdb7(0x220)](/\{CreatedTime\}/g,_0x44816e);return _0x358a39;}static['replaceApiContent'](_0x49a0e0,_0x968c79,_0x4c59c7,_0x9f88ef,_0x43b926,_0x451588,_0x1d866b,_0x2b871c){const _0xe31c90=a130_0x4fb013,_0x4c27a3=new Date(),_0x5a5f43=_0x4c27a3['toISOString'](),_0x574c32=_0x4c59c7['map'](_0x4ae707=>{const _0x37a926=a130_0x3dd8,_0x5e8cbc=[_0x37a926(0x1fe)+_0x4ae707[_0x37a926(0x217)]+'\x22',_0x37a926(0x1ee)+_0x4ae707['tableName']+'\x22',_0x37a926(0x211)+_0x4ae707[_0x37a926(0x21f)]+'\x22'];return _0x4ae707[_0x37a926(0x20a)]&&_0x5e8cbc[_0x37a926(0x1fb)](_0x37a926(0x225)+_0x4ae707[_0x37a926(0x20a)]+'\x22'),_0x37a926(0x1f2)+_0x5e8cbc[_0x37a926(0x22a)](',\x20')+_0x37a926(0x205);})[_0xe31c90(0x22a)](''),_0x3ad794=_0x9f88ef||_0x4c59c7[0x0]?.[_0xe31c90(0x20a)]||'YourModel';let _0x73f8ee=_0x49a0e0[_0xe31c90(0x220)](/\{AppCode\}/g,_0x968c79)[_0xe31c90(0x220)](/\{ModelConfigs\}/g,_0x574c32)[_0xe31c90(0x220)](/\{ExampleModelName\}/g,_0x3ad794)[_0xe31c90(0x220)](/\{ApiFileName\}/g,_0x43b926||_0xe31c90(0x204))[_0xe31c90(0x220)](/\{ConfigName\}/g,_0x451588||'default')[_0xe31c90(0x220)](/\{ClientConfigParam\}/g,_0x1d866b||'')[_0xe31c90(0x220)](/\{VarPrefix\}/g,_0x2b871c||_0xe31c90(0x216))[_0xe31c90(0x220)](/\{CreatedAt\}/g,_0x5a5f43);return _0x73f8ee;}static async[a130_0x4fb013(0x1f4)](_0x4b61dd,_0x5bf735,_0x15b5bf,_0x656b82,_0x22487f=!![]){const _0x443e97=a130_0x4fb013,_0x2471ae=Date[_0x443e97(0x1f5)]();try{_0x22487f&&logger[_0x443e97(0x1ef)]('template',_0x443e97(0x20b),{'templatePath':_0x4b61dd,'targetPath':_0x5bf735,'pageName':_0x15b5bf,'templateName':_0x656b82});await a130_0x289c56[_0x443e97(0x1fa)][_0x443e97(0x226)](_0x5bf735,{'recursive':!![]}),await this[_0x443e97(0x21b)](_0x4b61dd,_0x5bf735,_0x15b5bf,_0x656b82);if(_0x22487f){const _0x52145c=Date['now']()-_0x2471ae;logger[_0x443e97(0x208)](_0x443e97(0x218),'模板内容替换完成',_0x52145c,{'pageName':_0x15b5bf,'templateName':_0x656b82});}}catch(_0x2125c2){if(_0x22487f){const _0x36ab7f=Date[_0x443e97(0x1f5)]()-_0x2471ae;logger[_0x443e97(0x229)](_0x443e97(0x218),'模板内容替换失败',{'templatePath':_0x4b61dd,'targetPath':_0x5bf735,'pageName':_0x15b5bf,'templateName':_0x656b82,'error':_0x2125c2 instanceof Error?_0x2125c2[_0x443e97(0x203)]:String(_0x2125c2),'duration':_0x36ab7f});}throw _0x2125c2;}}static async[a130_0x4fb013(0x21b)](_0x3afbe7,_0x26a8cb,_0x2a8869,_0x2c042c){const _0x3b60c3=a130_0x4fb013,_0x2ea808=await a130_0x289c56[_0x3b60c3(0x1fa)][_0x3b60c3(0x20f)](_0x3afbe7,{'withFileTypes':!![]});for(const _0x184d7b of _0x2ea808){const _0x40208f=a130_0x383d38[_0x3b60c3(0x22a)](_0x3afbe7,_0x184d7b[_0x3b60c3(0x21f)]);let _0xa4b064=a130_0x383d38['join'](_0x26a8cb,_0x184d7b[_0x3b60c3(0x21f)]);_0x184d7b['name']['endsWith']('.tpl')&&(_0xa4b064=a130_0x383d38[_0x3b60c3(0x22a)](_0x26a8cb,_0x184d7b['name'][_0x3b60c3(0x220)](/\.tpl$/,'')));if(_0x184d7b[_0x3b60c3(0x210)]())await a130_0x289c56['promises'][_0x3b60c3(0x226)](_0xa4b064,{'recursive':!![]}),await this['processDirectory'](_0x40208f,_0xa4b064,_0x2a8869,_0x2c042c);else _0x184d7b['isFile']()&&await this['processFile'](_0x40208f,_0xa4b064,_0x2a8869,_0x2c042c);}}static async[a130_0x4fb013(0x221)](_0x515953,_0x39a54c,_0x30371c,_0x1153ed){const _0x230558=a130_0x4fb013,_0x4093dd=a130_0x383d38['extname'](_0x515953)[_0x230558(0x1ed)]();_0x515953['endsWith'](_0x230558(0x200))&&(_0x39a54c=_0x39a54c['replace'](/\.tpl$/,''));const _0x53040d=[_0x230558(0x222),_0x230558(0x20c),_0x230558(0x1f9),_0x230558(0x1fd),_0x230558(0x219),'.md','.css','.scss','.tpl'];if(_0x53040d['includes'](_0x4093dd)||_0x515953[_0x230558(0x213)](_0x230558(0x200))){const _0x4e1603=await a130_0x289c56[_0x230558(0x1fa)]['readFile'](_0x515953,_0x230558(0x201)),_0x5320f4=this[_0x230558(0x228)](_0x4e1603,_0x30371c,_0x1153ed);await a130_0x289c56[_0x230558(0x1fa)][_0x230558(0x1f8)](_0x39a54c,_0x5320f4,_0x230558(0x201));}else await a130_0x289c56[_0x230558(0x1fa)][_0x230558(0x21e)](_0x515953,_0x39a54c);}}
|