@lovrabet/lovrabet-cli 2.2.3-beta.1 → 2.2.3-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.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/update.js +1 -1
- package/lib/commands/user-account/bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.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/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.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/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/lovrabet/SKILL.md +1 -1
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1ba12d,_0x53282b){const _0xa401b3=a39_0x5f2c,_0x45c9e=_0x1ba12d();while(!![]){try{const _0x384efe=-parseInt(_0xa401b3(0x157))/0x1*(-parseInt(_0xa401b3(0x177))/0x2)+-parseInt(_0xa401b3(0x15e))/0x3+-parseInt(_0xa401b3(0x136))/0x4+parseInt(_0xa401b3(0x156))/0x5*(parseInt(_0xa401b3(0x186))/0x6)+-parseInt(_0xa401b3(0x12c))/0x7*(parseInt(_0xa401b3(0x16f))/0x8)+parseInt(_0xa401b3(0x17b))/0x9*(-parseInt(_0xa401b3(0x171))/0xa)+parseInt(_0xa401b3(0x150))/0xb;if(_0x384efe===_0x53282b)break;else _0x45c9e['push'](_0x45c9e['shift']());}catch(_0x52e15e){_0x45c9e['push'](_0x45c9e['shift']());}}}(a39_0x14ef,0xd0392));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x6b4fe6,_0x6271a1){const _0x4a98ef=a39_0x5f2c,_0x4c345b=listLocalServiceTrees();let _0x288833;for(const _0x3c4e3c of _0x4c345b){const _0x459913=matchServiceTreeCommand(_0x3c4e3c,_0x6b4fe6);if(!_0x459913)continue;(!_0x288833||_0x459913['command'][_0x4a98ef(0x13d)]['length']>_0x288833[_0x4a98ef(0x123)][_0x4a98ef(0x13d)][_0x4a98ef(0x152)])&&(_0x288833={'tree':_0x3c4e3c,'command':_0x459913[_0x4a98ef(0x123)],'remainingArgs':_0x459913[_0x4a98ef(0x12a)]});}if(!_0x288833)return undefined;const _0x1b2b04={..._0x6271a1};return applyAppBinding(_0x288833[_0x4a98ef(0x170)],_0x288833['command'],_0x1b2b04),{'definition':buildDynamicCommandDefinition(_0x288833[_0x4a98ef(0x170)],_0x288833[_0x4a98ef(0x123)]),'args':_0x288833[_0x4a98ef(0x12a)],'flags':_0x1b2b04,'tree':_0x288833[_0x4a98ef(0x170)],'command':_0x288833[_0x4a98ef(0x123)]};}export function generateDynamicServiceHelp(_0x43daaf){const _0x37e038=a39_0x5f2c,_0x28c1cb=listLocalServiceTrees()['find'](_0x1451a9=>_0x1451a9[_0x37e038(0x14c)][_0x37e038(0x16b)]===_0x43daaf);if(!_0x28c1cb)return undefined;const _0x990d87=[CLI_BIN_NAME+'\x20'+_0x43daaf+_0x37e038(0x125),'',_0x28c1cb[_0x37e038(0x14c)][_0x37e038(0x153)]||_0x43daaf,_0x28c1cb[_0x37e038(0x14c)]['description']?'\x20\x20'+_0x28c1cb[_0x37e038(0x14c)][_0x37e038(0x175)]:'','',_0x37e038(0x16d),..._0x28c1cb[_0x37e038(0x174)][_0x37e038(0x126)](_0x1d1da1=>{const _0x26a3ff=_0x37e038,_0x45019c=_0x1d1da1[_0x26a3ff(0x13d)][_0x26a3ff(0x189)](0x1)['join']('\x20'),_0xb08eb8=_0x1d1da1[_0x26a3ff(0x16e)]===_0x26a3ff(0x160)?'':'\x20['+_0x1d1da1[_0x26a3ff(0x16e)]+']';return'\x20\x20'+_0x45019c[_0x26a3ff(0x13b)](0x18)+'\x20'+(_0x1d1da1['description']||'')+_0xb08eb8;}),'',_0x37e038(0x179)+CLI_BIN_NAME+_0x37e038(0x17e)+_0x43daaf+_0x37e038(0x163)][_0x37e038(0x149)](Boolean);return _0x990d87[_0x37e038(0x13c)]('\x0a');}export function listDynamicServiceEntries(){const _0x5ecb91=a39_0x5f2c;return listLocalServices()[_0x5ecb91(0x126)](_0x2f3dbb=>{const _0x3c9361=_0x5ecb91,_0xaeced4=_0x2f3dbb[_0x3c9361(0x142)];return{'service':_0xaeced4['service'][_0x3c9361(0x16b)],'label':_0xaeced4[_0x3c9361(0x14c)]['name']||_0xaeced4[_0x3c9361(0x14c)][_0x3c9361(0x16b)],'commands':_0xaeced4[_0x3c9361(0x174)]['map'](_0x1aa5c1=>({'command':dynamicCommandName(_0x1aa5c1),'description':_0x1aa5c1[_0x3c9361(0x175)]||_0x3c9361(0x188)+_0x1aa5c1[_0x3c9361(0x137)],'tag':riskTag(_0x1aa5c1[_0x3c9361(0x16e)])}))};});}export function getDynamicServiceEntry(_0x4ab8a0){const _0x54b3f3=a39_0x5f2c;return listDynamicServiceEntries()[_0x54b3f3(0x172)](_0x341e96=>_0x341e96[_0x54b3f3(0x14c)]===_0x4ab8a0);}export function listDynamicServiceDefinitions(_0x3dd1e1){const _0x5d835f=a39_0x5f2c;return listLocalServiceTrees()[_0x5d835f(0x149)](_0x49aea4=>!_0x3dd1e1||_0x49aea4[_0x5d835f(0x14c)][_0x5d835f(0x16b)]===_0x3dd1e1)['flatMap'](_0x28cd4c=>_0x28cd4c[_0x5d835f(0x174)][_0x5d835f(0x126)](_0x30ed6d=>buildDynamicCommandDefinition(_0x28cd4c,_0x30ed6d)));}export function getDynamicServiceDefinitions(_0x1ff00a){const _0x3b52d6=listDynamicServiceDefinitions(_0x1ff00a);return _0x3b52d6['length']>0x0?_0x3b52d6:undefined;}export function findDynamicServiceDefinition(_0x3493c5,_0x244858){const _0x47c9fc=a39_0x5f2c;return listDynamicServiceDefinitions(_0x3493c5)[_0x47c9fc(0x172)](_0x3f3b9e=>_0x3f3b9e['command']===_0x244858);}export function buildDynamicCommandDefinition(_0x23332f,_0x46a1fc){const _0x36b4ef=a39_0x5f2c;return{'service':_0x23332f['service']['code'],'command':dynamicCommandName(_0x46a1fc),'description':_0x46a1fc[_0x36b4ef(0x175)]||_0x36b4ef(0x188)+_0x46a1fc['cliPath'],'risk':_0x46a1fc[_0x36b4ef(0x16e)],..._0x46a1fc[_0x36b4ef(0x16e)]===_0x36b4ef(0x160)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x46a1fc)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x46a1fc['args'][_0x36b4ef(0x126)](_0x5492dc=>({'name':_0x5492dc[_0x36b4ef(0x153)],'description':_0x5492dc[_0x36b4ef(0x175)]||_0x5492dc['name'],'required':_0x5492dc[_0x36b4ef(0x17f)]})),'flags':_0x46a1fc[_0x36b4ef(0x162)]['map'](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x46a1fc),async 'dryRun'(_0xb1fa96){const _0x1d97b6=_0x36b4ef,_0x36b670=await compilePlan(_0x46a1fc,_0xb1fa96);return{'method':_0x1d97b6(0x129),'url':_0x46a1fc['cliPath'],'body':{'target':targetPreview(_0x36b670),'params':_0x36b670['params']},'description':_0x1d97b6(0x168)+_0x46a1fc[_0x1d97b6(0x137)]};},async 'execute'(_0x86f1f5){const _0x55fe6c=_0x36b4ef,_0x3c66d0=await compilePlan(_0x46a1fc,_0x86f1f5),_0x48b711=Date[_0x55fe6c(0x130)](),_0x2318e1=await executePlan(_0x3c66d0,_0x46a1fc,_0x86f1f5),_0x50f8af=Date['now']()-_0x48b711;return{'ok':!![],'data':{'service':_0x23332f[_0x55fe6c(0x14c)],'command':_0x46a1fc['cliPath'],'target':targetPreview(_0x3c66d0),'result':_0x2318e1,'elapsed':_0x50f8af},'message':_0x55fe6c(0x164)+_0x46a1fc['cliPath']+_0x55fe6c(0x182)+_0x50f8af+'ms'};}};}function buildDynamicConfirmationDescription(_0x4696f0){const _0x42f127=a39_0x5f2c,_0x4473c8=_0x4696f0[_0x42f127(0x175)]||_0x4696f0[_0x42f127(0x137)],_0x3cf968=_0x4696f0['risk']===_0x42f127(0x151)?_0x42f127(0x169):'该命令被清单标记为写入,可能修改业务数据或服务状态。';return _0x42f127(0x178)+_0x4473c8+'”。'+_0x3cf968;}function dynamicCommandName(_0x24e64b){const _0x24439e=a39_0x5f2c;return _0x24e64b[_0x24439e(0x13d)][_0x24439e(0x189)](0x1)['join']('\x20');}function riskTag(_0x13e3f6){return _0x13e3f6==='read'?'':'\x20\x20['+_0x13e3f6+']';}function flagToCommandFlag(_0x1c5122){const _0x12bcf4=a39_0x5f2c;return{'name':_0x1c5122[_0x12bcf4(0x17c)],'type':_0x1c5122[_0x12bcf4(0x158)]===_0x12bcf4(0x16c)?_0x12bcf4(0x144):_0x1c5122[_0x12bcf4(0x158)],'description':_0x1c5122[_0x12bcf4(0x175)]||_0x1c5122[_0x12bcf4(0x153)],'required':_0x1c5122[_0x12bcf4(0x17f)],'default':isPrimitiveFlagDefault(_0x1c5122[_0x12bcf4(0x146)])?_0x1c5122[_0x12bcf4(0x146)]:undefined,'enum':_0x1c5122['enum']};}async function compilePlan(_0x3c755f,_0x336d03){const _0x4754f4=a39_0x5f2c;return compileServiceTreeCommand(_0x3c755f,{'flags':_0x336d03[_0x4754f4(0x15f)],'args':_0x336d03[_0x4754f4(0x14b)],'context':await buildServiceContext(_0x3c755f,_0x336d03)});}async function buildServiceContext(_0x2f56b9,_0x272e41){const _0x7ce558=a39_0x5f2c,_0xffd8f3={'appCode':_0x272e41['appCode'],'env':_0x272e41['envName'],'envName':_0x272e41[_0x7ce558(0x122)]};if(!usesRuntimeContext(_0x2f56b9))return _0xffd8f3;const _0x454560=await getLoginUserInfo(),_0x4c0505=pickFirst(_0x454560[_0x7ce558(0x135)],_0x454560['id']);return{..._0xffd8f3,'user':_0x454560,'userId':_0x4c0505,'id':_0x454560['id'],'username':pickFirst(_0x454560[_0x7ce558(0x147)],_0x454560[_0x7ce558(0x12e)],_0x454560[_0x7ce558(0x131)]),'userName':_0x454560['userName'],'nickname':pickFirst(_0x454560['nickname'],_0x454560[_0x7ce558(0x15c)]),'nickName':_0x454560[_0x7ce558(0x15c)],'tenantCode':_0x454560[_0x7ce558(0x180)],'employeeId':_0x454560[_0x7ce558(0x183)]};}function usesRuntimeContext(_0x48365d){const _0x50e5e6=a39_0x5f2c;return _0x48365d[_0x50e5e6(0x13e)]['some'](_0x28cb90=>typeof _0x28cb90[_0x50e5e6(0x121)]===_0x50e5e6(0x144)&&(_0x28cb90[_0x50e5e6(0x121)][_0x50e5e6(0x145)](_0x50e5e6(0x127))||_0x28cb90[_0x50e5e6(0x121)][_0x50e5e6(0x145)](_0x50e5e6(0x16a))));}function pickFirst(..._0x12830a){const _0x14e981=a39_0x5f2c;return _0x12830a[_0x14e981(0x172)](_0x19b997=>_0x19b997!==undefined&&_0x19b997!==null);}async function executePlan(_0x1fb642,_0x4ef8fc,_0x1fdba6){const _0x3c99f0=a39_0x5f2c;if(_0x1fb642[_0x3c99f0(0x173)]==='data'){const _0xe901d1=await resolveDatasetCode(_0x1fb642,_0x4ef8fc,_0x1fdba6);return executeData(_0xe901d1,_0x1fb642[_0x3c99f0(0x123)],_0x1fb642[_0x3c99f0(0x134)]);}if(_0x1fb642[_0x3c99f0(0x173)]===_0x3c99f0(0x140)){if(!_0x1fb642[_0x3c99f0(0x13f)])throw CliErrors[_0x3c99f0(0x132)](_0x3c99f0(0x164)+_0x4ef8fc[_0x3c99f0(0x137)]+_0x3c99f0(0x128));return executeSdkSql(_0x1fb642[_0x3c99f0(0x13f)],normalizeScalarParams(_0x1fb642[_0x3c99f0(0x134)]));}if(_0x1fb642[_0x3c99f0(0x173)]==='bff'){const _0x533562=_0x1fb642[_0x3c99f0(0x155)]||_0x1fb642[_0x3c99f0(0x14e)]||(_0x1fb642['bffId']==null?'':String(_0x1fb642[_0x3c99f0(0x124)]));if(!_0x533562)throw CliErrors[_0x3c99f0(0x132)](_0x3c99f0(0x164)+_0x4ef8fc[_0x3c99f0(0x137)]+'\x20requires\x20target.functionName.');return executeSdkBff(_0x533562,_0x1fb642[_0x3c99f0(0x134)]);}throw CliErrors['validation'](_0x3c99f0(0x185)+_0x1fb642[_0x3c99f0(0x173)]);}async function resolveDatasetCode(_0x22b24e,_0x3a92af,_0x1c2b86){const _0x1f3d8b=a39_0x5f2c;if(_0x22b24e['datasetCode'])return _0x22b24e[_0x1f3d8b(0x166)];if(!_0x22b24e[_0x1f3d8b(0x148)])throw CliErrors['validation'](_0x1f3d8b(0x164)+_0x3a92af[_0x1f3d8b(0x137)]+_0x1f3d8b(0x154));const _0x248f06=await listDatasets(_0x1c2b86['appCode']),_0x2a4efd=_0x248f06['find'](_0xd9783e=>_0xd9783e[_0x1f3d8b(0x181)]?.[_0x1f3d8b(0x12f)]===_0x22b24e[_0x1f3d8b(0x148)]);if(!_0x2a4efd?.['code'])throw CliErrors['validation'](_0x1f3d8b(0x14f)+_0x22b24e[_0x1f3d8b(0x148)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x1c2b86[_0x1f3d8b(0x176)]+'.',_0x1f3d8b(0x15b));return _0x2a4efd[_0x1f3d8b(0x16b)];}function applyAppBinding(_0x426d93,_0x404e0d,_0xbe68c1){const _0x536782=a39_0x5f2c,_0x3e4ccd=_0x404e0d['target'][_0x536782(0x18b)];if(!_0x3e4ccd)return;const _0x3ce0d3=_0x426d93[_0x536782(0x141)][_0x3e4ccd];if(!_0x3ce0d3)throw CliErrors['validation'](_0x536782(0x12d)+_0x3e4ccd+_0x536782(0x133)+_0x404e0d[_0x536782(0x137)]+'.',_0x536782(0x18d));const _0x37b29f=_0x3ce0d3['appcode']||_0x3ce0d3['appCode'];_0x37b29f&&!hasText(_0xbe68c1[_0x536782(0x17a)])&&(_0xbe68c1['appcode']=_0x37b29f),_0x3ce0d3['app']&&!hasText(_0xbe68c1['app'])&&!hasText(_0xbe68c1[_0x536782(0x17a)])&&(_0xbe68c1[_0x536782(0x15a)]=_0x3ce0d3[_0x536782(0x15a)]),_0x3ce0d3[_0x536782(0x165)]&&!hasText(_0xbe68c1['env'])&&(_0xbe68c1[_0x536782(0x165)]=_0x3ce0d3[_0x536782(0x165)]);}function renderDynamicCommandHelp(_0x2d3e12){const _0x450f96=a39_0x5f2c,_0x389a1a=['\x20\x20SERVICE\x20TREE\x20TARGET',_0x450f96(0x139)+_0x2d3e12[_0x450f96(0x15d)][_0x450f96(0x173)],'\x20\x20\x20\x20command:\x20'+_0x2d3e12['target'][_0x450f96(0x123)]];if(_0x2d3e12[_0x450f96(0x15d)][_0x450f96(0x166)])_0x389a1a[_0x450f96(0x159)](_0x450f96(0x161)+_0x2d3e12[_0x450f96(0x15d)][_0x450f96(0x166)]);if(_0x2d3e12[_0x450f96(0x15d)][_0x450f96(0x148)])_0x389a1a['push']('\x20\x20\x20\x20datatable:\x20'+_0x2d3e12[_0x450f96(0x15d)][_0x450f96(0x148)]);if(_0x2d3e12[_0x450f96(0x15d)]['sqlCode'])_0x389a1a[_0x450f96(0x159)](_0x450f96(0x18a)+_0x2d3e12[_0x450f96(0x15d)][_0x450f96(0x13f)]);if(_0x2d3e12[_0x450f96(0x15d)][_0x450f96(0x155)])_0x389a1a[_0x450f96(0x159)](_0x450f96(0x13a)+_0x2d3e12[_0x450f96(0x15d)][_0x450f96(0x155)]);if(_0x2d3e12['mapTo'][_0x450f96(0x152)]>0x0){_0x389a1a[_0x450f96(0x159)]('',_0x450f96(0x143));for(const _0x123a41 of _0x2d3e12[_0x450f96(0x13e)]){_0x389a1a[_0x450f96(0x159)](_0x450f96(0x184)+(_0x123a41[_0x450f96(0x121)]||_0x450f96(0x17d))+_0x450f96(0x187)+_0x123a41[_0x450f96(0x15d)]+(_0x123a41[_0x450f96(0x14a)]?'.'+_0x123a41[_0x450f96(0x14a)]:''));}}return _0x389a1a['join']('\x0a');}function targetPreview(_0x3b10d8){const _0x22ec57=a39_0x5f2c;return{'kind':_0x3b10d8[_0x22ec57(0x173)],'command':_0x3b10d8[_0x22ec57(0x123)],'appRef':_0x3b10d8['appRef'],'datasetCode':_0x3b10d8[_0x22ec57(0x166)],'datatable':_0x3b10d8[_0x22ec57(0x148)],'sqlCode':_0x3b10d8['sqlCode'],'bffCode':_0x3b10d8[_0x22ec57(0x14e)],'bffId':_0x3b10d8['bffId'],'functionName':_0x3b10d8['scriptName']};}function normalizeScalarParams(_0x51924d){const _0x1ad57f=a39_0x5f2c;return Object[_0x1ad57f(0x14d)](Object[_0x1ad57f(0x18c)](_0x51924d)[_0x1ad57f(0x149)](([,_0x1e46f])=>typeof _0x1e46f==='string'||typeof _0x1e46f===_0x1ad57f(0x167)));}function a39_0x14ef(){const _0x1c87f8=['userId','5587292WfOwYK','cliPath','boolean','\x20\x20\x20\x20kind:\x20\x20\x20\x20','\x20\x20\x20\x20functionName:\x20','padEnd','join','fullPath','mapTo','sqlCode','sql','appBindings','normalizedManifest','\x20\x20MAP\x20TO','string','startsWith','default','username','datatable','filter','operator','args','service','fromEntries','bffCode','Cannot\x20resolve\x20datatable\x20\x22','22970035vcFpeo','high-risk-write','length','name','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','scriptName','5uPtLGf','145147RpIumF','type','push','app','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','nickName','target','1545177tbiaxu','rawFlags','read','\x20\x20\x20\x20datasetCode:\x20','flags','`\x20to\x20inspect\x20the\x20manifest.','Service\x20command\x20','env','datasetCode','number','Preview\x20dynamic\x20service\x20command:\x20','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','ctx.','code','json','Commands:','risk','473848mbMgNu','tree','21470cbGPlc','find','kind','commands','description','appCode','22jgoori','将通过\x20Service\x20Tree\x20执行“','Use\x20`','appcode','3015QHTQHb','cliName','const','\x20service\x20detail\x20--service\x20','required','tenantCode','dbtableConfig','\x20completed\x20in\x20','employeeId','\x20\x20\x20\x20','Unsupported\x20service\x20target\x20kind:\x20','572172MgUMhH','\x20->\x20','Run\x20service\x20command\x20','slice','\x20\x20\x20\x20sqlCode:\x20','appRef','entries','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','source','envName','command','bffId','\x20<command>\x20[flags]','map','context.','\x20requires\x20target.sqlCode.','SERVICE_TREE','remainingArgs','trim','35XEOgHc','Unknown\x20appRef\x20\x22','userName','tableName','now','loginName','validation','\x22\x20in\x20service\x20command\x20','params'];a39_0x14ef=function(){return _0x1c87f8;};return a39_0x14ef();}function a39_0x5f2c(_0x125647,_0x5e3497){_0x125647=_0x125647-0x121;const _0x14ef30=a39_0x14ef();let _0x5f2c7a=_0x14ef30[_0x125647];return _0x5f2c7a;}function hasText(_0x47ae55){const _0x186983=a39_0x5f2c;return typeof _0x47ae55===_0x186983(0x144)&&_0x47ae55[_0x186983(0x12b)]()[_0x186983(0x152)]>0x0;}function isPrimitiveFlagDefault(_0x3693a9){const _0x139d86=a39_0x5f2c;return _0x3693a9===undefined||typeof _0x3693a9===_0x139d86(0x144)||typeof _0x3693a9==='number'||typeof _0x3693a9===_0x139d86(0x138);}
|
|
1
|
+
(function(_0x3c6422,_0x4b9c0b){const _0x45296e=a39_0x1893,_0x23de02=_0x3c6422();while(!![]){try{const _0x16beb4=parseInt(_0x45296e(0x1fe))/0x1+parseInt(_0x45296e(0x252))/0x2*(-parseInt(_0x45296e(0x248))/0x3)+-parseInt(_0x45296e(0x230))/0x4*(parseInt(_0x45296e(0x256))/0x5)+parseInt(_0x45296e(0x217))/0x6+-parseInt(_0x45296e(0x225))/0x7*(-parseInt(_0x45296e(0x229))/0x8)+parseInt(_0x45296e(0x201))/0x9+-parseInt(_0x45296e(0x241))/0xa;if(_0x16beb4===_0x4b9c0b)break;else _0x23de02['push'](_0x23de02['shift']());}catch(_0x23c4ee){_0x23de02['push'](_0x23de02['shift']());}}}(a39_0x4eb2,0x9f78e));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';import{getLoginUserInfo,listDatasets}from'../../core/api-client.js';import{executeData,executeSdkBff,executeSdkSql}from'../../core/sdk-client.js';import{CliErrors}from'../../errors.js';import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x566d0d,_0x1cdd18){const _0x56fccf=a39_0x1893,_0x53e920=listLocalServiceTrees();let _0x6949b2;for(const _0x1380b7 of _0x53e920){const _0x2fc83c=matchServiceTreeCommand(_0x1380b7,_0x566d0d);if(!_0x2fc83c)continue;(!_0x6949b2||_0x2fc83c[_0x56fccf(0x218)]['fullPath'][_0x56fccf(0x242)]>_0x6949b2[_0x56fccf(0x218)]['fullPath'][_0x56fccf(0x242)])&&(_0x6949b2={'tree':_0x1380b7,'command':_0x2fc83c['command'],'remainingArgs':_0x2fc83c[_0x56fccf(0x25d)]});}if(!_0x6949b2)return undefined;const _0x40c8e7={..._0x1cdd18};return applyAppBinding(_0x6949b2[_0x56fccf(0x250)],_0x6949b2[_0x56fccf(0x218)],_0x40c8e7),{'definition':buildDynamicCommandDefinition(_0x6949b2['tree'],_0x6949b2['command']),'args':_0x6949b2[_0x56fccf(0x25d)],'flags':_0x40c8e7,'tree':_0x6949b2[_0x56fccf(0x250)],'command':_0x6949b2['command']};}export function generateDynamicServiceHelp(_0x269808){const _0x4cccbd=a39_0x1893,_0x3e734f=listLocalServiceTrees()['find'](_0x4b3e2f=>_0x4b3e2f[_0x4cccbd(0x214)]['code']===_0x269808);if(!_0x3e734f)return undefined;const _0x87a584=[CLI_BIN_NAME+'\x20'+_0x269808+'\x20<command>\x20[flags]','',_0x3e734f[_0x4cccbd(0x214)]['name']||_0x269808,_0x3e734f['service']['description']?'\x20\x20'+_0x3e734f[_0x4cccbd(0x214)]['description']:'','',_0x4cccbd(0x1fc),..._0x3e734f['commands'][_0x4cccbd(0x1f5)](_0x29c773=>{const _0x4d8a00=_0x4cccbd,_0x458271=_0x29c773[_0x4d8a00(0x1fb)][_0x4d8a00(0x22e)](0x1)[_0x4d8a00(0x25b)]('\x20'),_0xad6f88=_0x29c773[_0x4d8a00(0x24c)]===_0x4d8a00(0x23d)?'':'\x20['+_0x29c773[_0x4d8a00(0x24c)]+']';return'\x20\x20'+_0x458271[_0x4d8a00(0x23f)](0x18)+'\x20'+(_0x29c773[_0x4d8a00(0x234)]||'')+_0xad6f88;}),'',_0x4cccbd(0x22d)+CLI_BIN_NAME+_0x4cccbd(0x228)+_0x269808+_0x4cccbd(0x208)][_0x4cccbd(0x1f9)](Boolean);return _0x87a584['join']('\x0a');}export function listDynamicServiceEntries(){const _0x3686a9=a39_0x1893;return listLocalServices()[_0x3686a9(0x1f5)](_0x5d7b84=>{const _0x145e79=_0x3686a9,_0x11659c=_0x5d7b84[_0x145e79(0x216)];return{'service':_0x11659c[_0x145e79(0x214)][_0x145e79(0x21e)],'label':_0x11659c[_0x145e79(0x214)][_0x145e79(0x205)]||_0x11659c[_0x145e79(0x214)][_0x145e79(0x21e)],'commands':_0x11659c[_0x145e79(0x212)][_0x145e79(0x1f5)](_0x5672a7=>({'command':dynamicCommandName(_0x5672a7),'description':_0x5672a7['description']||_0x145e79(0x24f)+_0x5672a7[_0x145e79(0x25c)],'tag':riskTag(_0x5672a7[_0x145e79(0x24c)])}))};});}export function getDynamicServiceEntry(_0x41be6d){const _0x4094e0=a39_0x1893;return listDynamicServiceEntries()[_0x4094e0(0x21a)](_0x26b95d=>_0x26b95d['service']===_0x41be6d);}export function listDynamicServiceDefinitions(_0x25057c){const _0x47b14c=a39_0x1893;return listLocalServiceTrees()['filter'](_0x32a1b8=>!_0x25057c||_0x32a1b8['service'][_0x47b14c(0x21e)]===_0x25057c)[_0x47b14c(0x20f)](_0x5a3007=>_0x5a3007[_0x47b14c(0x212)][_0x47b14c(0x1f5)](_0x4e103a=>buildDynamicCommandDefinition(_0x5a3007,_0x4e103a)));}export function getDynamicServiceDefinitions(_0x134940){const _0x36e9d8=a39_0x1893,_0x458a3a=listDynamicServiceDefinitions(_0x134940);return _0x458a3a[_0x36e9d8(0x242)]>0x0?_0x458a3a:undefined;}export function findDynamicServiceDefinition(_0x417b66,_0x28c3f2){const _0x37e090=a39_0x1893;return listDynamicServiceDefinitions(_0x417b66)[_0x37e090(0x21a)](_0x3ff45a=>_0x3ff45a[_0x37e090(0x218)]===_0x28c3f2);}export function buildDynamicCommandDefinition(_0x1d4fa1,_0x31c208){const _0x3b5012=a39_0x1893;return{'service':_0x1d4fa1[_0x3b5012(0x214)]['code'],'command':dynamicCommandName(_0x31c208),'description':_0x31c208[_0x3b5012(0x234)]||_0x3b5012(0x24f)+_0x31c208[_0x3b5012(0x25c)],'risk':_0x31c208[_0x3b5012(0x24c)],..._0x31c208[_0x3b5012(0x24c)]===_0x3b5012(0x23d)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x31c208)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x31c208[_0x3b5012(0x249)][_0x3b5012(0x1f5)](_0x55b4a6=>({'name':_0x55b4a6[_0x3b5012(0x205)],'description':_0x55b4a6['description']||_0x55b4a6['name'],'required':_0x55b4a6[_0x3b5012(0x23b)]})),'flags':_0x31c208[_0x3b5012(0x222)]['map'](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x31c208),async 'dryRun'(_0x494388){const _0x47b2f2=_0x3b5012,_0x3fe3b1=await compilePlan(_0x31c208,_0x494388);return{'method':_0x47b2f2(0x22a),'url':_0x31c208[_0x47b2f2(0x25c)],'body':{'target':targetPreview(_0x3fe3b1),'params':_0x3fe3b1[_0x47b2f2(0x219)]},'description':_0x47b2f2(0x259)+_0x31c208[_0x47b2f2(0x25c)]};},async 'execute'(_0x542665){const _0x5337e4=_0x3b5012,_0x155868=await compilePlan(_0x31c208,_0x542665),_0x5883c3=Date['now'](),_0x1a13ad=await executePlan(_0x155868,_0x31c208,_0x542665),_0x57a689=Date['now']()-_0x5883c3;return{'ok':!![],'data':{'service':_0x1d4fa1[_0x5337e4(0x214)],'command':_0x31c208[_0x5337e4(0x25c)],'target':targetPreview(_0x155868),'result':_0x1a13ad,'elapsed':_0x57a689},'message':'Service\x20command\x20'+_0x31c208[_0x5337e4(0x25c)]+_0x5337e4(0x1f4)+_0x57a689+'ms'};}};}function buildDynamicConfirmationDescription(_0x4ad6a6){const _0x237de5=a39_0x1893,_0x13c3ef=_0x4ad6a6[_0x237de5(0x234)]||_0x4ad6a6['cliPath'],_0x38b49b=_0x4ad6a6['risk']===_0x237de5(0x251)?_0x237de5(0x1f8):_0x237de5(0x221);return _0x237de5(0x240)+_0x13c3ef+'”。'+_0x38b49b;}function a39_0x4eb2(){const _0x12ea48=['Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','datasetCode','Use\x20`','slice','ctx.','3196292WbcikL','appBindings','\x20\x20\x20\x20','json','description','boolean','some','data','\x20\x20\x20\x20datatable:\x20','mapTo','datatable','required','\x20->\x20','read','sqlCode','padEnd','将通过\x20Service\x20Tree\x20执行“','12451770sFChve','length','kind','appRef','\x20\x20\x20\x20datasetCode:\x20','env','appCode','3477qhbncJ','args','app','cliName','risk','push','scriptName','Run\x20service\x20command\x20','tree','high-risk-write','210nNMfOK','source','\x20\x20\x20\x20kind:\x20\x20\x20\x20','const','5NbGjpo','bffCode','target','Preview\x20dynamic\x20service\x20command:\x20','userId','join','cliPath','remainingArgs','\x20completed\x20in\x20','map','sql','entries','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','filter','enum','fullPath','Commands:','rawFlags','1051348KyMAIp','userName','fromEntries','1718865qxOPBz','bffId','string','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','name','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','bff','`\x20to\x20inspect\x20the\x20manifest.','appcode','\x20\x20SERVICE\x20TREE\x20TARGET','envName','default','number','operator','flatMap','\x20\x20[','Unknown\x20appRef\x20\x22','commands','startsWith','service','validation','normalizedManifest','7651266MjbewZ','command','params','find','\x22\x20in\x20service\x20command\x20','dbtableConfig','context.','code','Unsupported\x20service\x20target\x20kind:\x20','Service\x20command\x20','该命令被清单标记为写入,可能修改业务数据或服务状态。','flags','type','employeeId','44919XYOQph','\x20\x20\x20\x20command:\x20','nickName','\x20service\x20detail\x20--service\x20','376PTvgoL','SERVICE_TREE'];a39_0x4eb2=function(){return _0x12ea48;};return a39_0x4eb2();}function dynamicCommandName(_0x2292ef){const _0x2c928f=a39_0x1893;return _0x2292ef['fullPath'][_0x2c928f(0x22e)](0x1)[_0x2c928f(0x25b)]('\x20');}function riskTag(_0x546ea7){const _0xf0b22c=a39_0x1893;return _0x546ea7===_0xf0b22c(0x23d)?'':_0xf0b22c(0x210)+_0x546ea7+']';}function flagToCommandFlag(_0x1040aa){const _0x59b73f=a39_0x1893;return{'name':_0x1040aa[_0x59b73f(0x24b)],'type':_0x1040aa[_0x59b73f(0x223)]===_0x59b73f(0x233)?'string':_0x1040aa[_0x59b73f(0x223)],'description':_0x1040aa[_0x59b73f(0x234)]||_0x1040aa[_0x59b73f(0x205)],'required':_0x1040aa['required'],'default':isPrimitiveFlagDefault(_0x1040aa['default'])?_0x1040aa[_0x59b73f(0x20c)]:undefined,'enum':_0x1040aa[_0x59b73f(0x1fa)]};}async function compilePlan(_0x42d36f,_0x15f85b){const _0xde5b95=a39_0x1893;return compileServiceTreeCommand(_0x42d36f,{'flags':_0x15f85b[_0xde5b95(0x1fd)],'args':_0x15f85b[_0xde5b95(0x249)],'context':await buildServiceContext(_0x42d36f,_0x15f85b)});}async function buildServiceContext(_0x10c3d3,_0x7a042){const _0x47565e=a39_0x1893,_0x4f14f4={'appCode':_0x7a042['appCode'],'env':_0x7a042[_0x47565e(0x20b)],'envName':_0x7a042['envName']};if(!usesRuntimeContext(_0x10c3d3))return _0x4f14f4;const _0x41552a=await getLoginUserInfo(),_0x2217ec=pickFirst(_0x41552a[_0x47565e(0x25a)],_0x41552a['id']);return{..._0x4f14f4,'user':_0x41552a,'userId':_0x2217ec,'id':_0x41552a['id'],'username':pickFirst(_0x41552a['username'],_0x41552a['userName'],_0x41552a['loginName']),'userName':_0x41552a[_0x47565e(0x1ff)],'nickname':pickFirst(_0x41552a['nickname'],_0x41552a['nickName']),'nickName':_0x41552a[_0x47565e(0x227)],'tenantCode':_0x41552a['tenantCode'],'employeeId':_0x41552a[_0x47565e(0x224)]};}function usesRuntimeContext(_0x514196){const _0x305eb7=a39_0x1893;return _0x514196[_0x305eb7(0x239)][_0x305eb7(0x236)](_0x222fd7=>typeof _0x222fd7[_0x305eb7(0x253)]===_0x305eb7(0x203)&&(_0x222fd7[_0x305eb7(0x253)][_0x305eb7(0x213)](_0x305eb7(0x21d))||_0x222fd7[_0x305eb7(0x253)][_0x305eb7(0x213)](_0x305eb7(0x22f))));}function pickFirst(..._0xc4f8ef){return _0xc4f8ef['find'](_0x503d55=>_0x503d55!==undefined&&_0x503d55!==null);}async function executePlan(_0x3ebddb,_0x15622b,_0x40c036){const _0xb2ae45=a39_0x1893;if(_0x3ebddb[_0xb2ae45(0x243)]===_0xb2ae45(0x237)){const _0x3eeaaa=await resolveDatasetCode(_0x3ebddb,_0x15622b,_0x40c036);return executeData(_0x3eeaaa,_0x3ebddb[_0xb2ae45(0x218)],_0x3ebddb[_0xb2ae45(0x219)]);}if(_0x3ebddb[_0xb2ae45(0x243)]===_0xb2ae45(0x1f6)){if(!_0x3ebddb[_0xb2ae45(0x23e)])throw CliErrors[_0xb2ae45(0x215)](_0xb2ae45(0x220)+_0x15622b[_0xb2ae45(0x25c)]+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x3ebddb[_0xb2ae45(0x23e)],normalizeScalarParams(_0x3ebddb['params']));}if(_0x3ebddb['kind']===_0xb2ae45(0x207)){const _0x4f2344=_0x3ebddb[_0xb2ae45(0x24e)]||_0x3ebddb[_0xb2ae45(0x257)]||(_0x3ebddb['bffId']==null?'':String(_0x3ebddb[_0xb2ae45(0x202)]));if(!_0x4f2344)throw CliErrors[_0xb2ae45(0x215)](_0xb2ae45(0x220)+_0x15622b[_0xb2ae45(0x25c)]+'\x20requires\x20target.functionName.');return executeSdkBff(_0x4f2344,_0x3ebddb[_0xb2ae45(0x219)]);}throw CliErrors[_0xb2ae45(0x215)](_0xb2ae45(0x21f)+_0x3ebddb[_0xb2ae45(0x243)]);}async function resolveDatasetCode(_0x37c319,_0x392025,_0x5b5427){const _0x3f8a85=a39_0x1893;if(_0x37c319[_0x3f8a85(0x22c)])return _0x37c319[_0x3f8a85(0x22c)];if(!_0x37c319[_0x3f8a85(0x23a)])throw CliErrors[_0x3f8a85(0x215)](_0x3f8a85(0x220)+_0x392025[_0x3f8a85(0x25c)]+_0x3f8a85(0x206));const _0x59bbea=await listDatasets(_0x5b5427['appCode']),_0x123168=_0x59bbea[_0x3f8a85(0x21a)](_0xc3a858=>_0xc3a858[_0x3f8a85(0x21c)]?.['tableName']===_0x37c319[_0x3f8a85(0x23a)]);if(!_0x123168?.[_0x3f8a85(0x21e)])throw CliErrors['validation']('Cannot\x20resolve\x20datatable\x20\x22'+_0x37c319[_0x3f8a85(0x23a)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x5b5427[_0x3f8a85(0x247)]+'.',_0x3f8a85(0x204));return _0x123168[_0x3f8a85(0x21e)];}function applyAppBinding(_0x30736a,_0x5dafc1,_0xa1e234){const _0x5b5760=a39_0x1893,_0x2201ca=_0x5dafc1[_0x5b5760(0x258)]['appRef'];if(!_0x2201ca)return;const _0x37aabf=_0x30736a[_0x5b5760(0x231)][_0x2201ca];if(!_0x37aabf)throw CliErrors[_0x5b5760(0x215)](_0x5b5760(0x211)+_0x2201ca+_0x5b5760(0x21b)+_0x5dafc1['cliPath']+'.',_0x5b5760(0x22b));const _0x5ea953=_0x37aabf['appcode']||_0x37aabf[_0x5b5760(0x247)];_0x5ea953&&!hasText(_0xa1e234['appcode'])&&(_0xa1e234['appcode']=_0x5ea953),_0x37aabf[_0x5b5760(0x24a)]&&!hasText(_0xa1e234['app'])&&!hasText(_0xa1e234[_0x5b5760(0x209)])&&(_0xa1e234[_0x5b5760(0x24a)]=_0x37aabf[_0x5b5760(0x24a)]),_0x37aabf[_0x5b5760(0x246)]&&!hasText(_0xa1e234[_0x5b5760(0x246)])&&(_0xa1e234['env']=_0x37aabf[_0x5b5760(0x246)]);}function renderDynamicCommandHelp(_0x1edbd1){const _0x13b87c=a39_0x1893,_0x34a88b=[_0x13b87c(0x20a),_0x13b87c(0x254)+_0x1edbd1[_0x13b87c(0x258)][_0x13b87c(0x243)],_0x13b87c(0x226)+_0x1edbd1[_0x13b87c(0x258)][_0x13b87c(0x218)]];if(_0x1edbd1['target'][_0x13b87c(0x22c)])_0x34a88b[_0x13b87c(0x24d)](_0x13b87c(0x245)+_0x1edbd1[_0x13b87c(0x258)][_0x13b87c(0x22c)]);if(_0x1edbd1['target'][_0x13b87c(0x23a)])_0x34a88b[_0x13b87c(0x24d)](_0x13b87c(0x238)+_0x1edbd1[_0x13b87c(0x258)][_0x13b87c(0x23a)]);if(_0x1edbd1[_0x13b87c(0x258)]['sqlCode'])_0x34a88b[_0x13b87c(0x24d)]('\x20\x20\x20\x20sqlCode:\x20'+_0x1edbd1[_0x13b87c(0x258)][_0x13b87c(0x23e)]);if(_0x1edbd1[_0x13b87c(0x258)][_0x13b87c(0x24e)])_0x34a88b[_0x13b87c(0x24d)]('\x20\x20\x20\x20functionName:\x20'+_0x1edbd1[_0x13b87c(0x258)][_0x13b87c(0x24e)]);if(_0x1edbd1[_0x13b87c(0x239)]['length']>0x0){_0x34a88b['push']('','\x20\x20MAP\x20TO');for(const _0x28ebe9 of _0x1edbd1[_0x13b87c(0x239)]){_0x34a88b[_0x13b87c(0x24d)](_0x13b87c(0x232)+(_0x28ebe9[_0x13b87c(0x253)]||_0x13b87c(0x255))+_0x13b87c(0x23c)+_0x28ebe9[_0x13b87c(0x258)]+(_0x28ebe9[_0x13b87c(0x20e)]?'.'+_0x28ebe9[_0x13b87c(0x20e)]:''));}}return _0x34a88b['join']('\x0a');}function targetPreview(_0x48c040){const _0x216a4=a39_0x1893;return{'kind':_0x48c040[_0x216a4(0x243)],'command':_0x48c040[_0x216a4(0x218)],'appRef':_0x48c040[_0x216a4(0x244)],'datasetCode':_0x48c040['datasetCode'],'datatable':_0x48c040[_0x216a4(0x23a)],'sqlCode':_0x48c040['sqlCode'],'bffCode':_0x48c040['bffCode'],'bffId':_0x48c040['bffId'],'functionName':_0x48c040[_0x216a4(0x24e)]};}function normalizeScalarParams(_0x3b9885){const _0x158bc5=a39_0x1893;return Object[_0x158bc5(0x200)](Object[_0x158bc5(0x1f7)](_0x3b9885)['filter'](([,_0x5a7c5f])=>typeof _0x5a7c5f===_0x158bc5(0x203)||typeof _0x5a7c5f==='number'));}function hasText(_0x17586c){const _0x8c62fc=a39_0x1893;return typeof _0x17586c==='string'&&_0x17586c['trim']()[_0x8c62fc(0x242)]>0x0;}function a39_0x1893(_0x45c361,_0x51633f){_0x45c361=_0x45c361-0x1f4;const _0x4eb257=a39_0x4eb2();let _0x1893f1=_0x4eb257[_0x45c361];return _0x1893f1;}function isPrimitiveFlagDefault(_0x1afd16){const _0x1113c4=a39_0x1893;return _0x1afd16===undefined||typeof _0x1afd16===_0x1113c4(0x203)||typeof _0x1afd16===_0x1113c4(0x20d)||typeof _0x1afd16===_0x1113c4(0x235);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3c1108,_0x18b5dd){const _0x4c0b98=a40_0x52a5,_0x492368=_0x3c1108();while(!![]){try{const _0x784c43=parseInt(_0x4c0b98(0x11d))/0x1+-parseInt(_0x4c0b98(0x11b))/0x2+parseInt(_0x4c0b98(0x124))/0x3+parseInt(_0x4c0b98(0x109))/0x4*(parseInt(_0x4c0b98(0x10d))/0x5)+parseInt(_0x4c0b98(0x115))/0x6*(-parseInt(_0x4c0b98(0x119))/0x7)+parseInt(_0x4c0b98(0x121))/0x8+parseInt(_0x4c0b98(0x116))/0x9;if(_0x784c43===_0x18b5dd)break;else _0x492368['push'](_0x492368['shift']());}catch(_0xb53b28){_0x492368['push'](_0x492368['shift']());}}}(a40_0x5e82,0x523c3));export function adaptServiceTreeManifestForLegacyFramework(_0x4ce484){const _0x438195=a40_0x52a5,_0x55e299=cloneJsonValue(_0x4ce484),_0x5dd9d4=[];if(!isObjectRecord(_0x55e299))return{'manifest':_0x55e299,'errors':_0x5dd9d4};return Array[_0x438195(0x128)](_0x55e299[_0x438195(0x11e)])&&_0x55e299[_0x438195(0x11e)][_0x438195(0x11c)]((_0x2782e4,_0x66bed5)=>{const _0x28fb3f=_0x438195;if(!isObjectRecord(_0x2782e4))return;adaptBffTarget(_0x2782e4[_0x28fb3f(0x126)],_0x28fb3f(0x10b)+_0x66bed5+_0x28fb3f(0x120),_0x5dd9d4);}),adaptResources(_0x55e299[_0x438195(0x122)],'$.resources',_0x5dd9d4),{'manifest':_0x55e299,'errors':_0x5dd9d4};}export function toPublicServiceTreeTarget(_0x55e02d){const _0x4c44e0=a40_0x52a5,{scriptName:_0x3c38f5,..._0x227038}=_0x55e02d;return typeof _0x3c38f5===_0x4c44e0(0x127)&&_0x3c38f5[_0x4c44e0(0x10a)]()&&(_0x227038[_0x4c44e0(0x108)]=_0x3c38f5),_0x227038;}export function toPublicNormalizedServiceTree(_0x29f4fa){const _0xf1232b=a40_0x52a5;return{..._0x29f4fa,'commands':_0x29f4fa['commands'][_0xf1232b(0x112)](_0x478d9b=>({..._0x478d9b,'target':toPublicServiceTreeTarget(_0x478d9b[_0xf1232b(0x126)])}))};}function adaptResources(_0x1b26ec,_0x5a3e6f,_0x98c14b){const _0x3a90c9=a40_0x52a5;if(!isObjectRecord(_0x1b26ec))return;for(const [_0x2a8f3f,_0x3190a0]of Object[_0x3a90c9(0x125)](_0x1b26ec)){if(!isObjectRecord(_0x3190a0))continue;const _0x4fce64=_0x5a3e6f+'.'+_0x2a8f3f;if(isObjectRecord(_0x3190a0[_0x3a90c9(0x11f)]))for(const [_0x6f83cd,_0x498419]of Object[_0x3a90c9(0x125)](_0x3190a0[_0x3a90c9(0x11f)])){if(!isObjectRecord(_0x498419))continue;const _0x16ee8a=_0x4fce64+'.actions.'+_0x6f83cd,_0x5e1734=isObjectRecord(_0x498419[_0x3a90c9(0x126)])&&_0x498419['target']['kind']===_0x3a90c9(0x123);adaptBffTarget(_0x498419[_0x3a90c9(0x126)],_0x16ee8a+'.target',_0x98c14b),(_0x5e1734||isBffAction(_0x498419))&&adaptFunctionNameField(_0x498419,_0x16ee8a,_0x98c14b);}adaptResources(_0x3190a0['resources'],_0x4fce64+'.resources',_0x98c14b);}}function adaptBffTarget(_0x12bcf2,_0x5140e2,_0x3bea9a){const _0x4c0752=a40_0x52a5;if(!isObjectRecord(_0x12bcf2)||_0x12bcf2['kind']!==_0x4c0752(0x123))return;adaptFunctionNameField(_0x12bcf2,_0x5140e2,_0x3bea9a);}function adaptFunctionNameField(_0x58ee43,_0x4810e9,_0x294a09){const _0x5abc12=a40_0x52a5;Object[_0x5abc12(0x113)][_0x5abc12(0x118)][_0x5abc12(0x11a)](_0x58ee43,_0x5abc12(0x10c))&&_0x294a09[_0x5abc12(0x110)]({'level':'error','path':_0x4810e9+'.scriptName','message':_0x5abc12(0x117)});if(Object[_0x5abc12(0x113)][_0x5abc12(0x118)][_0x5abc12(0x11a)](_0x58ee43,_0x5abc12(0x108))){if(typeof _0x58ee43[_0x5abc12(0x108)]!==_0x5abc12(0x127)||!_0x58ee43['functionName']['trim']()){_0x294a09[_0x5abc12(0x110)]({'level':_0x5abc12(0x129),'path':_0x4810e9+_0x5abc12(0x10e),'message':_0x5abc12(0x114)}),delete _0x58ee43[_0x5abc12(0x108)];return;}_0x58ee43[_0x5abc12(0x10c)]=_0x58ee43[_0x5abc12(0x108)],delete _0x58ee43[_0x5abc12(0x108)];}}function a40_0x5e82(){const _0x409ac1=['4692592UQFgJw','resources','bff','832257SyxhXs','entries','target','string','isArray','error','functionName','14684jiJHjk','trim','$.commands[','scriptName','50ispKQu','.functionName','bff.exec','push','kind','map','prototype','functionName\x20must\x20be\x20a\x20non-empty\x20string.','6htiWSC','3199482GFGXDj','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','hasOwnProperty','2512797tEMMtD','call','1233918dxIfac','forEach','56564qRJTtc','commands','actions','].target'];a40_0x5e82=function(){return _0x409ac1;};return a40_0x5e82();}function a40_0x52a5(_0xee3503,_0x263dcc){_0xee3503=_0xee3503-0x108;const _0x5e829c=a40_0x5e82();let _0x52a5c9=_0x5e829c[_0xee3503];return _0x52a5c9;}function isBffAction(_0x1fc67d){const _0x1f0997=a40_0x52a5;return _0x1fc67d[_0x1f0997(0x111)]===_0x1f0997(0x123)||_0x1fc67d['action']===_0x1f0997(0x10f)||_0x1fc67d[_0x1f0997(0x126)]==='bff.exec';}function cloneJsonValue(_0x3f2779){const _0x2d0273=a40_0x52a5;if(Array['isArray'](_0x3f2779))return _0x3f2779[_0x2d0273(0x112)](_0x5f0f52=>cloneJsonValue(_0x5f0f52));if(isObjectRecord(_0x3f2779))return Object['fromEntries'](Object[_0x2d0273(0x125)](_0x3f2779)[_0x2d0273(0x112)](([_0x249feb,_0x5cd3ce])=>[_0x249feb,cloneJsonValue(_0x5cd3ce)]));return _0x3f2779;}function isObjectRecord(_0x4388ff){return Boolean(_0x4388ff)&&typeof _0x4388ff==='object'&&!Array['isArray'](_0x4388ff);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a41_0x336e73=a41_0x2531;(function(_0x1a79fd,_0x1e6e79){const _0x236bf5=a41_0x2531,_0x3a0110=_0x1a79fd();while(!![]){try{const _0x8a1893=parseInt(_0x236bf5(0xe9))/0x1*(-parseInt(_0x236bf5(0xed))/0x2)+parseInt(_0x236bf5(0xe6))/0x3+-parseInt(_0x236bf5(0xf4))/0x4+parseInt(_0x236bf5(0x122))/0x5+-parseInt(_0x236bf5(0xfe))/0x6*(-parseInt(_0x236bf5(0x113))/0x7)+-parseInt(_0x236bf5(0x105))/0x8*(parseInt(_0x236bf5(0xfd))/0x9)+parseInt(_0x236bf5(0x109))/0xa*(parseInt(_0x236bf5(0x10f))/0xb);if(_0x8a1893===_0x1e6e79)break;else _0x3a0110['push'](_0x3a0110['shift']());}catch(_0x4ab444){_0x3a0110['push'](_0x3a0110['shift']());}}}(a41_0x3ced,0x7ab2b));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a41_0x336e73(0x106),'type':a41_0x336e73(0x11d),'required':!![],'description':a41_0x336e73(0xf0)},SERVICE_FLAG={'name':'service','type':a41_0x336e73(0x11d),'required':!![],'description':a41_0x336e73(0xea),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a41_0x336e73(0x10c)}};function summarizeService(_0xfea7af){const _0x22d023=a41_0x336e73;return{'serviceCode':_0xfea7af[_0x22d023(0xec)],'name':_0xfea7af[_0x22d023(0x104)][_0x22d023(0x10d)][_0x22d023(0x10e)],'version':_0xfea7af[_0x22d023(0x123)],'importedAt':_0xfea7af['importedAt'],'source':_0xfea7af[_0x22d023(0x128)],'commandCount':_0xfea7af[_0x22d023(0x104)][_0x22d023(0x11b)][_0x22d023(0xef)],'commands':_0xfea7af[_0x22d023(0x104)][_0x22d023(0x11b)][_0x22d023(0xfa)](_0x4e0d4c=>({'path':_0x4e0d4c[_0x22d023(0xf6)],'description':_0x4e0d4c['description'],'risk':_0x4e0d4c[_0x22d023(0x11a)],'target':toPublicServiceTreeTarget(_0x4e0d4c['target']),'flags':_0x4e0d4c[_0x22d023(0xf5)]['map'](_0x4503e5=>({'name':_0x4503e5[_0x22d023(0x10e)],'cliName':_0x4503e5['cliName'],'type':_0x4503e5[_0x22d023(0xe1)],'required':_0x4503e5[_0x22d023(0x112)]===!![]}))}))};}function summarizeLoadedManifest(_0x3caf01){const _0x467024=a41_0x336e73;return{'service':_0x3caf01['normalizedManifest']?.[_0x467024(0x10d)],'version':_0x3caf01[_0x467024(0x104)]?.[_0x467024(0x123)],'commandCount':_0x3caf01[_0x467024(0x104)]?.[_0x467024(0x11b)]['length']??0x0,'commands':_0x3caf01[_0x467024(0x104)]?.[_0x467024(0x11b)]['map'](_0x31d069=>({'path':_0x31d069[_0x467024(0xf6)],'risk':_0x31d069[_0x467024(0x11a)],'target':toPublicServiceTreeTarget(_0x31d069[_0x467024(0xe7)])}))??[],'registryIndex':_0x3caf01['registryIndex'],'registryServiceCode':_0x3caf01[_0x467024(0xe2)],'errors':_0x3caf01['report'][_0x467024(0x10b)],'warnings':_0x3caf01[_0x467024(0x127)][_0x467024(0x116)]};}export const serviceDefinitions=[{'service':a41_0x336e73(0x10d),'command':a41_0x336e73(0xff),'description':a41_0x336e73(0x100),'risk':a41_0x336e73(0x125),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x12169e){const _0x2bb91f=a41_0x336e73,_0x25734c=loadServiceManifestFromFile(_0x12169e['str'](_0x2bb91f(0x106)));if(!_0x25734c[_0x2bb91f(0x127)]['ok'])return{'ok':![],'data':{'file':_0x25734c[_0x2bb91f(0xf3)],'hash':_0x25734c[_0x2bb91f(0xf1)],'kind':_0x25734c[_0x2bb91f(0x11f)],'serviceCount':_0x25734c[_0x2bb91f(0x124)][_0x2bb91f(0xef)],'services':_0x25734c['manifests'][_0x2bb91f(0xfa)](summarizeLoadedManifest),'errors':_0x25734c[_0x2bb91f(0x127)][_0x2bb91f(0x10b)],'warnings':_0x25734c[_0x2bb91f(0x127)][_0x2bb91f(0x116)]},'message':formatValidationFailure(_0x25734c[_0x2bb91f(0x127)])};if(_0x25734c[_0x2bb91f(0x11f)]==='registry'||_0x25734c['manifests']['length']!==0x1)return{'ok':!![],'data':{'file':_0x25734c['filePath'],'hash':_0x25734c[_0x2bb91f(0xf1)],'kind':_0x25734c[_0x2bb91f(0x11f)],'serviceCount':_0x25734c[_0x2bb91f(0x124)][_0x2bb91f(0xef)],'commandCount':_0x25734c[_0x2bb91f(0x124)][_0x2bb91f(0xe4)]((_0xdb4a00,_0x4645c6)=>_0xdb4a00+(_0x4645c6[_0x2bb91f(0x104)]?.[_0x2bb91f(0x11b)][_0x2bb91f(0xef)]??0x0),0x0),'services':_0x25734c[_0x2bb91f(0x124)]['map'](summarizeLoadedManifest),'warnings':_0x25734c['report'][_0x2bb91f(0x116)]},'message':_0x2bb91f(0xf8)};return{'ok':!![],'data':{'file':_0x25734c[_0x2bb91f(0xf3)],'hash':_0x25734c['hash'],'kind':_0x25734c['kind'],'service':_0x25734c[_0x2bb91f(0x104)]?.['service'],'version':_0x25734c['normalizedManifest']?.[_0x2bb91f(0x123)],'commandCount':_0x25734c['normalizedManifest']?.[_0x2bb91f(0x11b)][_0x2bb91f(0xef)]??0x0,'commands':_0x25734c[_0x2bb91f(0x104)]?.['commands'][_0x2bb91f(0xfa)](_0x3ad0f0=>({'path':_0x3ad0f0['cliPath'],'risk':_0x3ad0f0[_0x2bb91f(0x11a)],'target':toPublicServiceTreeTarget(_0x3ad0f0[_0x2bb91f(0xe7)])})),'warnings':_0x25734c['report'][_0x2bb91f(0x116)]},'message':_0x2bb91f(0xf2)};}},{'service':a41_0x336e73(0x10d),'command':a41_0x336e73(0x102),'description':a41_0x336e73(0x117),'risk':'write','confirmationDescription':a41_0x336e73(0x10a),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x37445e){const _0x2d851b=a41_0x336e73,_0x48c167=loadServiceManifestFromFile(_0x37445e[_0x2d851b(0x11e)]('file'));return{'method':_0x2d851b(0xe3),'url':getServiceRegistryPath(),'body':{'file':_0x48c167[_0x2d851b(0xf3)],'hash':_0x48c167[_0x2d851b(0xf1)],'kind':_0x48c167[_0x2d851b(0x11f)],'ok':_0x48c167[_0x2d851b(0x127)]['ok'],'service':_0x48c167['normalizedManifest']?.[_0x2d851b(0x10d)],'version':_0x48c167[_0x2d851b(0x104)]?.['version'],'serviceCount':_0x48c167[_0x2d851b(0x124)][_0x2d851b(0xef)],'services':_0x48c167[_0x2d851b(0x124)][_0x2d851b(0xfa)](_0x18e65b=>({'service':_0x18e65b[_0x2d851b(0x104)]?.['service'],'version':_0x18e65b[_0x2d851b(0x104)]?.[_0x2d851b(0x123)],'commandCount':_0x18e65b['normalizedManifest']?.[_0x2d851b(0x11b)][_0x2d851b(0xef)]??0x0,'errors':_0x18e65b[_0x2d851b(0x127)]['errors']})),'errors':_0x48c167[_0x2d851b(0x127)][_0x2d851b(0x10b)],'commandCount':_0x48c167['normalizedManifest']?.[_0x2d851b(0x11b)][_0x2d851b(0xef)]??0x0},'description':_0x2d851b(0xeb)};},async 'execute'(_0x5c0a9c){const _0x58b3d1=a41_0x336e73,_0x511e4a=importServiceManifest(_0x5c0a9c['str'](_0x58b3d1(0x106)));if(_0x511e4a[_0x58b3d1(0x108)][_0x58b3d1(0xef)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x511e4a['registryPath'],'imported':_0x511e4a[_0x58b3d1(0xe8)],'updated':_0x511e4a[_0x58b3d1(0x110)],'serviceCount':_0x511e4a[_0x58b3d1(0x11c)],'services':_0x511e4a[_0x58b3d1(0x108)][_0x58b3d1(0xfa)](summarizeService)},'message':'Imported\x20'+_0x511e4a[_0x58b3d1(0xe8)]+'\x20service(s),\x20updated\x20'+_0x511e4a[_0x58b3d1(0x110)]+'\x20service(s).'};return{'ok':!![],'data':{'registryPath':_0x511e4a[_0x58b3d1(0xf7)],'replaced':_0x511e4a[_0x58b3d1(0xe5)],'imported':_0x511e4a[_0x58b3d1(0xe8)],'updated':_0x511e4a[_0x58b3d1(0x110)],'serviceCount':_0x511e4a[_0x58b3d1(0x11c)],'service':summarizeService(_0x511e4a[_0x58b3d1(0xfc)])},'message':(_0x511e4a[_0x58b3d1(0xe5)]?_0x58b3d1(0x107):'Imported')+_0x58b3d1(0x120)+_0x511e4a['entry']['serviceCode']+'.'};}},{'service':a41_0x336e73(0x10d),'command':a41_0x336e73(0x103),'description':'将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','risk':a41_0x336e73(0x126),'confirmationDescription':a41_0x336e73(0x121),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x27d062){const _0x313185=a41_0x336e73,_0x5f1bd7=getLocalServiceEntry(_0x27d062[_0x313185(0x11e)](_0x313185(0x10d)));return{'method':'WRITE','url':_0x27d062[_0x313185(0x11e)](_0x313185(0x106)),'body':{'service':_0x27d062['str'](_0x313185(0x10d)),'found':Boolean(_0x5f1bd7),'version':_0x5f1bd7?.[_0x313185(0x123)],'source':_0x5f1bd7?.[_0x313185(0x128)]},'description':_0x313185(0xfb)};},async 'execute'(_0x59658c){const _0x4db5fb=a41_0x336e73,_0x4ffe3f=exportServiceManifest(_0x59658c[_0x4db5fb(0x11e)](_0x4db5fb(0x10d)),_0x59658c[_0x4db5fb(0x11e)](_0x4db5fb(0x106)));return{'ok':!![],'data':{'registryPath':_0x4ffe3f[_0x4db5fb(0xf7)],'file':_0x4ffe3f[_0x4db5fb(0xf3)],'service':summarizeService(_0x4ffe3f[_0x4db5fb(0xfc)])},'message':'Exported\x20service\x20'+_0x4ffe3f[_0x4db5fb(0xfc)][_0x4db5fb(0xec)]+'.'};}},{'service':a41_0x336e73(0x10d),'command':a41_0x336e73(0x119),'description':a41_0x336e73(0xee),'risk':a41_0x336e73(0x125),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x5743f6=a41_0x336e73,_0x4e0a1c=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x4e0a1c[_0x5743f6(0xef)],'services':_0x4e0a1c['map'](summarizeService)}};}},{'service':a41_0x336e73(0x10d),'command':a41_0x336e73(0xf9),'description':a41_0x336e73(0x111),'risk':a41_0x336e73(0x126),'confirmationDescription':a41_0x336e73(0x101),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x4ef1ea){const _0x7d6d7e=a41_0x336e73,_0x15a043=getLocalServiceEntry(_0x4ef1ea[_0x7d6d7e(0x11e)](_0x7d6d7e(0x10d)));return{'method':_0x7d6d7e(0xe3),'url':getServiceRegistryPath(),'body':{'service':_0x4ef1ea[_0x7d6d7e(0x11e)](_0x7d6d7e(0x10d)),'found':Boolean(_0x15a043),'version':_0x15a043?.[_0x7d6d7e(0x123)],'source':_0x15a043?.['source']},'description':_0x7d6d7e(0xe0)};},async 'execute'(_0x5bab0b){const _0x1f0b9f=a41_0x336e73,_0x257f69=removeServiceManifest(_0x5bab0b[_0x1f0b9f(0x11e)](_0x1f0b9f(0x10d)));return{'ok':!![],'data':{'registryPath':_0x257f69[_0x1f0b9f(0xf7)],'serviceCount':_0x257f69[_0x1f0b9f(0x11c)],'service':summarizeService(_0x257f69[_0x1f0b9f(0xfc)])},'message':'Removed\x20service\x20'+_0x257f69['entry'][_0x1f0b9f(0xec)]+'.'};}},{'service':a41_0x336e73(0x10d),'command':'detail','description':a41_0x336e73(0x114),'risk':a41_0x336e73(0x125),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0xb9c5a5){const _0x55b5e0=a41_0x336e73,_0x1fb37f=getLocalServiceEntry(_0xb9c5a5[_0x55b5e0(0x11e)](_0x55b5e0(0x10d)));if(!_0x1fb37f)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0xb9c5a5[_0x55b5e0(0x11e)]('service')},'message':_0x55b5e0(0x115)+_0xb9c5a5[_0x55b5e0(0x11e)](_0x55b5e0(0x10d))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x1fb37f),'manifest':_0x1fb37f[_0x55b5e0(0x118)],'normalizedManifest':toPublicNormalizedServiceTree(_0x1fb37f[_0x55b5e0(0x104)])}};}}];function a41_0x2531(_0x16458f,_0x352fdc){_0x16458f=_0x16458f-0xe0;const _0x3ceda5=a41_0x3ced();let _0x253194=_0x3ceda5[_0x16458f];return _0x253194;}function a41_0x3ced(){const _0x45d5e0=['将\x20Service\x20Tree\x20清单导入本地运行态注册表','manifest','list','risk','commands','serviceCount','string','str','kind','\x20service\x20','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','647475VAAZQW','version','manifests','read','write','report','source','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','type','registryServiceCode','WRITE','reduce','replaced','454251udnpfT','target','imported','22zhUfaN','Local\x20service\x20code,\x20for\x20example\x20crm','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','serviceCode','12092tgayYZ','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','length','Service\x20Tree\x20manifest\x20file\x20path','hash','Service\x20manifest\x20validation\x20passed.','filePath','3290220iQpzCi','flags','cliPath','registryPath','Service\x20registry\x20validation\x20passed.','remove','map','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','entry','9wQuDdA','6XLWuhX','validate','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','import','export','normalizedManifest','1373096nSnKSt','file','Updated','entries','150ThPvbU','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','errors','lower\x20kebab-case\x20service\x20code','service','name','368269pXDLKg','updated','从本地运行态注册表移除\x20Service\x20Tree\x20清单','required','5926746tnfeNE','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Local\x20service\x20not\x20found:\x20','warnings'];a41_0x3ced=function(){return _0x45d5e0;};return a41_0x3ced();}
|
|
1
|
+
function a41_0xb7c3(_0x3b40e2,_0x5d58bd){_0x3b40e2=_0x3b40e2-0xbe;const _0x4fd633=a41_0x4fd6();let _0xb7c3b6=_0x4fd633[_0x3b40e2];return _0xb7c3b6;}const a41_0x569d0f=a41_0xb7c3;(function(_0x3393f8,_0x4a1d2b){const _0x315bae=a41_0xb7c3,_0x3c21f7=_0x3393f8();while(!![]){try{const _0x326e81=parseInt(_0x315bae(0xe4))/0x1*(parseInt(_0x315bae(0xd8))/0x2)+parseInt(_0x315bae(0xde))/0x3+-parseInt(_0x315bae(0x102))/0x4*(-parseInt(_0x315bae(0xe1))/0x5)+parseInt(_0x315bae(0x103))/0x6+-parseInt(_0x315bae(0xf7))/0x7*(parseInt(_0x315bae(0xdb))/0x8)+parseInt(_0x315bae(0xca))/0x9*(parseInt(_0x315bae(0xcf))/0xa)+-parseInt(_0x315bae(0xcc))/0xb;if(_0x326e81===_0x4a1d2b)break;else _0x3c21f7['push'](_0x3c21f7['shift']());}catch(_0x1de5eb){_0x3c21f7['push'](_0x3c21f7['shift']());}}}(a41_0x4fd6,0x8819d));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':'file','type':'string','required':!![],'description':a41_0x569d0f(0x104)},SERVICE_FLAG={'name':a41_0x569d0f(0xe6),'type':a41_0x569d0f(0xbe),'required':!![],'description':a41_0x569d0f(0xf0),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a41_0x569d0f(0xd2)}};function a41_0x4fd6(){const _0x5ebda8=['Service\x20Tree\x20manifest\x20file\x20path','warnings','string','name','list','registryPath','risk','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','report','\x20service(s).','map','file','serviceCode','42426Bozvhk','Local\x20service\x20not\x20found:\x20','26800807QiWuuQ','export','registry','1810atnCTq','\x20service\x20','hash','lower\x20kebab-case\x20service\x20code','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','registryServiceCode','required','registryIndex','updated','10TXdBVC','kind','detail','3654704Ckcefh','commands','str','1935633IGxvlm','manifests','entry','6170XkKNrF','Service\x20manifest\x20validation\x20passed.','importedAt','56765NIdPso','version','service','将\x20Service\x20Tree\x20清单导入本地运行态注册表','normalizedManifest','import','Removed\x20service\x20','replaced','filePath','target','errors','write','Local\x20service\x20code,\x20for\x20example\x20crm','cliName','source','serviceCount','从本地运行态注册表移除\x20Service\x20Tree\x20清单','Service\x20registry\x20validation\x20passed.','length','7MMRZoT','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','cliPath','read','imported','\x20service(s),\x20updated\x20','Imported','reduce','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','WRITE','3064WGhFbD','4339380PbZYnd'];a41_0x4fd6=function(){return _0x5ebda8;};return a41_0x4fd6();}function summarizeService(_0x1b48fb){const _0x36803e=a41_0x569d0f;return{'serviceCode':_0x1b48fb[_0x36803e(0xc9)],'name':_0x1b48fb[_0x36803e(0xe8)][_0x36803e(0xe6)]['name'],'version':_0x1b48fb[_0x36803e(0xe5)],'importedAt':_0x1b48fb[_0x36803e(0xe3)],'source':_0x1b48fb[_0x36803e(0xf2)],'commandCount':_0x1b48fb['normalizedManifest']['commands'][_0x36803e(0xf6)],'commands':_0x1b48fb[_0x36803e(0xe8)]['commands'][_0x36803e(0xc7)](_0x4a56a2=>({'path':_0x4a56a2[_0x36803e(0xfa)],'description':_0x4a56a2['description'],'risk':_0x4a56a2[_0x36803e(0xc2)],'target':toPublicServiceTreeTarget(_0x4a56a2[_0x36803e(0xed)]),'flags':_0x4a56a2['flags'][_0x36803e(0xc7)](_0x3618a2=>({'name':_0x3618a2[_0x36803e(0xbf)],'cliName':_0x3618a2[_0x36803e(0xf1)],'type':_0x3618a2['type'],'required':_0x3618a2[_0x36803e(0xd5)]===!![]}))}))};}function summarizeLoadedManifest(_0x588d28){const _0x46aedc=a41_0x569d0f;return{'service':_0x588d28['normalizedManifest']?.[_0x46aedc(0xe6)],'version':_0x588d28[_0x46aedc(0xe8)]?.[_0x46aedc(0xe5)],'commandCount':_0x588d28[_0x46aedc(0xe8)]?.[_0x46aedc(0xdc)][_0x46aedc(0xf6)]??0x0,'commands':_0x588d28[_0x46aedc(0xe8)]?.['commands'][_0x46aedc(0xc7)](_0x3e295a=>({'path':_0x3e295a[_0x46aedc(0xfa)],'risk':_0x3e295a[_0x46aedc(0xc2)],'target':toPublicServiceTreeTarget(_0x3e295a[_0x46aedc(0xed)])}))??[],'registryIndex':_0x588d28[_0x46aedc(0xd6)],'registryServiceCode':_0x588d28[_0x46aedc(0xd4)],'errors':_0x588d28[_0x46aedc(0xc5)]['errors'],'warnings':_0x588d28[_0x46aedc(0xc5)][_0x46aedc(0x105)]};}export const serviceDefinitions=[{'service':a41_0x569d0f(0xe6),'command':'validate','description':a41_0x569d0f(0x100),'risk':a41_0x569d0f(0xfb),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x373620){const _0x50eead=a41_0x569d0f,_0x4594aa=loadServiceManifestFromFile(_0x373620[_0x50eead(0xdd)](_0x50eead(0xc8)));if(!_0x4594aa['report']['ok'])return{'ok':![],'data':{'file':_0x4594aa[_0x50eead(0xec)],'hash':_0x4594aa[_0x50eead(0xd1)],'kind':_0x4594aa[_0x50eead(0xd9)],'serviceCount':_0x4594aa[_0x50eead(0xdf)][_0x50eead(0xf6)],'services':_0x4594aa[_0x50eead(0xdf)][_0x50eead(0xc7)](summarizeLoadedManifest),'errors':_0x4594aa[_0x50eead(0xc5)]['errors'],'warnings':_0x4594aa[_0x50eead(0xc5)][_0x50eead(0x105)]},'message':formatValidationFailure(_0x4594aa[_0x50eead(0xc5)])};if(_0x4594aa[_0x50eead(0xd9)]===_0x50eead(0xce)||_0x4594aa[_0x50eead(0xdf)][_0x50eead(0xf6)]!==0x1)return{'ok':!![],'data':{'file':_0x4594aa[_0x50eead(0xec)],'hash':_0x4594aa[_0x50eead(0xd1)],'kind':_0x4594aa['kind'],'serviceCount':_0x4594aa[_0x50eead(0xdf)][_0x50eead(0xf6)],'commandCount':_0x4594aa[_0x50eead(0xdf)][_0x50eead(0xff)]((_0x3169bf,_0x4a3a5a)=>_0x3169bf+(_0x4a3a5a[_0x50eead(0xe8)]?.['commands'][_0x50eead(0xf6)]??0x0),0x0),'services':_0x4594aa[_0x50eead(0xdf)][_0x50eead(0xc7)](summarizeLoadedManifest),'warnings':_0x4594aa[_0x50eead(0xc5)]['warnings']},'message':_0x50eead(0xf5)};return{'ok':!![],'data':{'file':_0x4594aa[_0x50eead(0xec)],'hash':_0x4594aa[_0x50eead(0xd1)],'kind':_0x4594aa[_0x50eead(0xd9)],'service':_0x4594aa[_0x50eead(0xe8)]?.['service'],'version':_0x4594aa[_0x50eead(0xe8)]?.[_0x50eead(0xe5)],'commandCount':_0x4594aa['normalizedManifest']?.[_0x50eead(0xdc)][_0x50eead(0xf6)]??0x0,'commands':_0x4594aa[_0x50eead(0xe8)]?.['commands'][_0x50eead(0xc7)](_0x50ca37=>({'path':_0x50ca37[_0x50eead(0xfa)],'risk':_0x50ca37['risk'],'target':toPublicServiceTreeTarget(_0x50ca37[_0x50eead(0xed)])})),'warnings':_0x4594aa['report'][_0x50eead(0x105)]},'message':_0x50eead(0xe2)};}},{'service':a41_0x569d0f(0xe6),'command':a41_0x569d0f(0xe9),'description':a41_0x569d0f(0xe7),'risk':'write','confirmationDescription':'将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x1c23f3){const _0x299b21=a41_0x569d0f,_0x5b2972=loadServiceManifestFromFile(_0x1c23f3['str'](_0x299b21(0xc8)));return{'method':_0x299b21(0x101),'url':getServiceRegistryPath(),'body':{'file':_0x5b2972['filePath'],'hash':_0x5b2972[_0x299b21(0xd1)],'kind':_0x5b2972[_0x299b21(0xd9)],'ok':_0x5b2972['report']['ok'],'service':_0x5b2972['normalizedManifest']?.[_0x299b21(0xe6)],'version':_0x5b2972[_0x299b21(0xe8)]?.[_0x299b21(0xe5)],'serviceCount':_0x5b2972['manifests'][_0x299b21(0xf6)],'services':_0x5b2972['manifests'][_0x299b21(0xc7)](_0x224714=>({'service':_0x224714[_0x299b21(0xe8)]?.['service'],'version':_0x224714[_0x299b21(0xe8)]?.['version'],'commandCount':_0x224714[_0x299b21(0xe8)]?.['commands'][_0x299b21(0xf6)]??0x0,'errors':_0x224714[_0x299b21(0xc5)][_0x299b21(0xee)]})),'errors':_0x5b2972[_0x299b21(0xc5)][_0x299b21(0xee)],'commandCount':_0x5b2972[_0x299b21(0xe8)]?.['commands'][_0x299b21(0xf6)]??0x0},'description':_0x299b21(0xd3)};},async 'execute'(_0x30ccd2){const _0x5e9358=a41_0x569d0f,_0x120874=importServiceManifest(_0x30ccd2[_0x5e9358(0xdd)]('file'));if(_0x120874['entries'][_0x5e9358(0xf6)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x120874[_0x5e9358(0xc1)],'imported':_0x120874[_0x5e9358(0xfc)],'updated':_0x120874[_0x5e9358(0xd7)],'serviceCount':_0x120874[_0x5e9358(0xf3)],'services':_0x120874['entries'][_0x5e9358(0xc7)](summarizeService)},'message':'Imported\x20'+_0x120874[_0x5e9358(0xfc)]+_0x5e9358(0xfd)+_0x120874[_0x5e9358(0xd7)]+_0x5e9358(0xc6)};return{'ok':!![],'data':{'registryPath':_0x120874[_0x5e9358(0xc1)],'replaced':_0x120874[_0x5e9358(0xeb)],'imported':_0x120874[_0x5e9358(0xfc)],'updated':_0x120874[_0x5e9358(0xd7)],'serviceCount':_0x120874[_0x5e9358(0xf3)],'service':summarizeService(_0x120874['entry'])},'message':(_0x120874[_0x5e9358(0xeb)]?'Updated':_0x5e9358(0xfe))+_0x5e9358(0xd0)+_0x120874[_0x5e9358(0xe0)]['serviceCode']+'.'};}},{'service':'service','command':a41_0x569d0f(0xcd),'description':'将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','risk':a41_0x569d0f(0xef),'confirmationDescription':a41_0x569d0f(0xc3),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x50e5a7){const _0x1bbec6=a41_0x569d0f,_0x46e7bf=getLocalServiceEntry(_0x50e5a7[_0x1bbec6(0xdd)](_0x1bbec6(0xe6)));return{'method':'WRITE','url':_0x50e5a7[_0x1bbec6(0xdd)](_0x1bbec6(0xc8)),'body':{'service':_0x50e5a7['str']('service'),'found':Boolean(_0x46e7bf),'version':_0x46e7bf?.[_0x1bbec6(0xe5)],'source':_0x46e7bf?.[_0x1bbec6(0xf2)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0xa089bb){const _0x174324=a41_0x569d0f,_0x868159=exportServiceManifest(_0xa089bb['str'](_0x174324(0xe6)),_0xa089bb[_0x174324(0xdd)](_0x174324(0xc8)));return{'ok':!![],'data':{'registryPath':_0x868159['registryPath'],'file':_0x868159['filePath'],'service':summarizeService(_0x868159[_0x174324(0xe0)])},'message':'Exported\x20service\x20'+_0x868159['entry']['serviceCode']+'.'};}},{'service':'service','command':a41_0x569d0f(0xc0),'description':a41_0x569d0f(0xf9),'risk':a41_0x569d0f(0xfb),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x28c95c=a41_0x569d0f,_0x25bbd2=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x25bbd2[_0x28c95c(0xf6)],'services':_0x25bbd2[_0x28c95c(0xc7)](summarizeService)}};}},{'service':a41_0x569d0f(0xe6),'command':'remove','description':a41_0x569d0f(0xf4),'risk':a41_0x569d0f(0xef),'confirmationDescription':a41_0x569d0f(0xc4),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x4c05e9){const _0x52c914=a41_0x569d0f,_0x1fdeba=getLocalServiceEntry(_0x4c05e9[_0x52c914(0xdd)](_0x52c914(0xe6)));return{'method':_0x52c914(0x101),'url':getServiceRegistryPath(),'body':{'service':_0x4c05e9[_0x52c914(0xdd)]('service'),'found':Boolean(_0x1fdeba),'version':_0x1fdeba?.[_0x52c914(0xe5)],'source':_0x1fdeba?.[_0x52c914(0xf2)]},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x43ec21){const _0x5660da=a41_0x569d0f,_0x1c94ba=removeServiceManifest(_0x43ec21['str'](_0x5660da(0xe6)));return{'ok':!![],'data':{'registryPath':_0x1c94ba[_0x5660da(0xc1)],'serviceCount':_0x1c94ba['serviceCount'],'service':summarizeService(_0x1c94ba['entry'])},'message':_0x5660da(0xea)+_0x1c94ba['entry'][_0x5660da(0xc9)]+'.'};}},{'service':a41_0x569d0f(0xe6),'command':a41_0x569d0f(0xda),'description':a41_0x569d0f(0xf8),'risk':a41_0x569d0f(0xfb),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x2879c6){const _0xbd0d90=a41_0x569d0f,_0x4a4d77=getLocalServiceEntry(_0x2879c6['str'](_0xbd0d90(0xe6)));if(!_0x4a4d77)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x2879c6['str'](_0xbd0d90(0xe6))},'message':_0xbd0d90(0xcb)+_0x2879c6['str'](_0xbd0d90(0xe6))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x4a4d77),'manifest':_0x4a4d77['manifest'],'normalizedManifest':toPublicNormalizedServiceTree(_0x4a4d77[_0xbd0d90(0xe8)])}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1e9f7a,_0x2a9b81){const _0x4aebb9=a42_0x1d44,_0x1cbc8f=_0x1e9f7a();while(!![]){try{const _0x4cfcb4=-parseInt(_0x4aebb9(0xe4))/0x1+parseInt(_0x4aebb9(0xca))/0x2*(-parseInt(_0x4aebb9(0xdc))/0x3)+parseInt(_0x4aebb9(0xe8))/0x4+-parseInt(_0x4aebb9(0xe3))/0x5+-parseInt(_0x4aebb9(0x9d))/0x6*(-parseInt(_0x4aebb9(0x9e))/0x7)+-parseInt(_0x4aebb9(0xa7))/0x8+parseInt(_0x4aebb9(0xa2))/0x9;if(_0x4cfcb4===_0x2a9b81)break;else _0x1cbc8f['push'](_0x1cbc8f['shift']());}catch(_0x3f4c1c){_0x1cbc8f['push'](_0x1cbc8f['shift']());}}}(a42_0xabaa,0x406bf));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME='service.json';export function getServiceRegistryPath(_0x308314={}){const _0x691d91=a42_0x1d44;return resolve(_0x308314[_0x691d91(0xe0)]??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x24d7fc={}){const _0x486d40=a42_0x1d44,_0x14beb4=getServiceRegistryPath(_0x24d7fc);if(!existsSync(_0x14beb4))return emptyServiceRegistry();try{const _0x5d4987=readFileSync(_0x14beb4,_0x486d40(0xdd));if(!_0x5d4987[_0x486d40(0xc8)]())return emptyServiceRegistry();const _0x1f2876=JSON[_0x486d40(0xb9)](_0x5d4987);if(_0x1f2876['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation']('Unsupported\x20service\x20registry\x20schemaVersion:\x20'+String(_0x1f2876['schemaVersion']),'Remove\x20or\x20migrate\x20'+_0x14beb4+'.');if(!Array['isArray'](_0x1f2876[_0x486d40(0xc3)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x1f2876[_0x486d40(0xb4)],'services':_0x1f2876[_0x486d40(0xc3)]};}catch(_0x505a61){if(_0x505a61 instanceof Error&&_0x505a61[_0x486d40(0xd6)]===_0x486d40(0xb2))throw _0x505a61;throw CliErrors[_0x486d40(0xa5)](_0x486d40(0xb3)+_0x14beb4,_0x486d40(0xc6));}}export function writeServiceRegistry(_0x13715b,_0x41a9da={}){const _0x15008=a42_0x1d44,_0x48abbe=getServiceRegistryPath(_0x41a9da),_0x1cc0fa=dirname(_0x48abbe);!existsSync(_0x1cc0fa)&&mkdirSync(_0x1cc0fa,{'recursive':!![]});const _0xb43917=_0x48abbe+'.tmp';try{writeFileSync(_0xb43917,JSON[_0x15008(0xe2)](_0x13715b,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0xb43917,_0x48abbe);}catch(_0x3ce0f2){try{unlinkSync(_0xb43917);}catch{}if(_0x3ce0f2?.[_0x15008(0xc2)]===_0x15008(0xeb))throw CliErrors[_0x15008(0xa5)]('Cannot\x20write\x20service\x20registry:\x20'+_0x48abbe);throw _0x3ce0f2;}return _0x48abbe;}export function loadServiceManifestFromFile(_0x572d0b){const _0x4e9fcf=a42_0x1d44,_0x5ba2e4=resolve(_0x572d0b);if(!existsSync(_0x5ba2e4))throw CliErrors[_0x4e9fcf(0xa5)]('Service\x20manifest\x20file\x20not\x20found:\x20'+_0x572d0b);let _0x5528a2;const _0x517765=readFileSync(_0x5ba2e4,'utf8');try{_0x5528a2=JSON[_0x4e9fcf(0xb9)](_0x517765);}catch{throw CliErrors[_0x4e9fcf(0xa5)](_0x4e9fcf(0xde)+_0x572d0b,'Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.');}const _0x4d4585=sha256(_0x517765),_0x5db4e6=extractLoadedServiceManifests(_0x5528a2,_0x4d4585),_0x1952d7=aggregateValidationReports(_0x5db4e6),_0x356e7e=_0x5db4e6[0x0];return{'filePath':_0x5ba2e4,'hash':_0x4d4585,'kind':isServiceRegistryLike(_0x5528a2)?'registry':_0x4e9fcf(0xb6),'manifest':_0x356e7e?.[_0x4e9fcf(0xb6)]??_0x5528a2,'report':_0x1952d7,'normalizedManifest':_0x5db4e6[_0x4e9fcf(0xe7)]===0x1?_0x356e7e?.[_0x4e9fcf(0xd2)]:undefined,'manifests':_0x5db4e6};}function a42_0x1d44(_0xb5a944,_0x1552ba){_0xb5a944=_0xb5a944-0x99;const _0xabaa28=a42_0xabaa();let _0x1d447e=_0xabaa28[_0xb5a944];return _0x1d447e;}export function importServiceManifest(_0x48eeb9,_0x2f26e9={}){const _0x4a28fa=a42_0x1d44,_0x300e0e=loadServiceManifestFromFile(_0x48eeb9);if(!_0x300e0e[_0x4a28fa(0xc0)]['ok'])throw CliErrors['validation'](formatValidationFailure(_0x300e0e[_0x4a28fa(0xc0)]),_0x4a28fa(0xd4));if(_0x300e0e[_0x4a28fa(0xa8)][_0x4a28fa(0xe7)]===0x0)throw CliErrors[_0x4a28fa(0xa5)](_0x4a28fa(0xda),'Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.');const _0x33eed4=readServiceRegistry(_0x2f26e9),_0xf4c6e0=(_0x2f26e9['now']??(()=>new Date()))()[_0x4a28fa(0xa3)](),_0x226766=[];let _0x83bcf6=0x0,_0x444ec5=0x0;for(const _0x234afc of _0x300e0e[_0x4a28fa(0xa8)]){if(!_0x234afc[_0x4a28fa(0xd2)])continue;const _0xba05c6=_0x234afc[_0x4a28fa(0xd2)][_0x4a28fa(0x9c)][_0x4a28fa(0xc2)],_0x124681={'serviceCode':_0xba05c6,'version':_0x234afc[_0x4a28fa(0xd2)][_0x4a28fa(0xdf)],'importedAt':_0xf4c6e0,'source':{'type':'file','path':_0x300e0e[_0x4a28fa(0xd1)],'hash':_0x234afc[_0x4a28fa(0xe5)]},'manifest':_0x234afc[_0x4a28fa(0xb6)],'normalizedManifest':_0x234afc[_0x4a28fa(0xd2)]},_0x6889f1=_0x33eed4[_0x4a28fa(0xc3)][_0x4a28fa(0xb5)](_0x4a276b=>_0x4a276b[_0x4a28fa(0xd9)]===_0xba05c6);_0x6889f1>=0x0?(_0x33eed4['services'][_0x6889f1]=_0x124681,_0x444ec5++):(_0x33eed4[_0x4a28fa(0xc3)][_0x4a28fa(0xbe)](_0x124681),_0x83bcf6++),_0x226766[_0x4a28fa(0xbe)](_0x124681);}_0x33eed4[_0x4a28fa(0xc3)][_0x4a28fa(0x99)]((_0xa03eda,_0x32365a)=>_0xa03eda[_0x4a28fa(0xd9)][_0x4a28fa(0xa4)](_0x32365a[_0x4a28fa(0xd9)])),_0x33eed4[_0x4a28fa(0xb4)]=_0xf4c6e0;const _0x29c283=writeServiceRegistry(_0x33eed4,_0x2f26e9);return{'registryPath':_0x29c283,'entry':_0x226766[0x0],'replaced':_0x226766[_0x4a28fa(0xe7)]===0x1?_0x444ec5===0x1:_0x444ec5>0x0,'entries':_0x226766,'imported':_0x83bcf6,'updated':_0x444ec5,'serviceCount':_0x33eed4[_0x4a28fa(0xc3)][_0x4a28fa(0xe7)]};}export function exportServiceManifest(_0x2788a7,_0x34fbd4,_0x4f29e0={}){const _0x62d72d=a42_0x1d44,_0x1f03b9=getServiceRegistryPath(_0x4f29e0),_0x1f58c0=getLocalServiceEntry(_0x2788a7,_0x4f29e0);if(!_0x1f58c0)throw CliErrors[_0x62d72d(0xa5)](_0x62d72d(0xa0)+_0x2788a7,_0x62d72d(0xcb));const _0x47e0af=resolve(_0x34fbd4),_0x38f095=dirname(_0x47e0af);return!existsSync(_0x38f095)&&mkdirSync(_0x38f095,{'recursive':!![]}),writeFileSync(_0x47e0af,JSON['stringify'](_0x1f58c0[_0x62d72d(0xb6)],null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),{'registryPath':_0x1f03b9,'filePath':_0x47e0af,'entry':_0x1f58c0};}export function removeServiceManifest(_0x5981f2,_0x44764a={}){const _0x4255e2=a42_0x1d44,_0x2d2c54=readServiceRegistry(_0x44764a),_0x892440=_0x5981f2[_0x4255e2(0xc8)](),_0x10098e=_0x2d2c54[_0x4255e2(0xc3)][_0x4255e2(0xb5)](_0x4f0597=>_0x4f0597[_0x4255e2(0xd9)]===_0x892440);if(_0x10098e<0x0)throw CliErrors[_0x4255e2(0xa5)](_0x4255e2(0xa0)+_0x892440,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const [_0x3bbf15]=_0x2d2c54[_0x4255e2(0xc3)][_0x4255e2(0xd3)](_0x10098e,0x1),_0x363cb1=(_0x44764a['now']??(()=>new Date()))()['toISOString']();_0x2d2c54[_0x4255e2(0xb4)]=_0x363cb1;const _0x2a9f3f=writeServiceRegistry(_0x2d2c54,_0x44764a);return{'registryPath':_0x2a9f3f,'entry':_0x3bbf15,'serviceCount':_0x2d2c54[_0x4255e2(0xc3)]['length']};}export function listLocalServices(_0x12d56d={}){const _0xd8506e=a42_0x1d44;return readServiceRegistry(_0x12d56d)[_0xd8506e(0xc3)];}export function getLocalServiceEntry(_0x2c698c,_0x3f621f={}){const _0x31436d=a42_0x1d44;return readServiceRegistry(_0x3f621f)[_0x31436d(0xc3)][_0x31436d(0xc1)](_0x14afac=>_0x14afac[_0x31436d(0xd9)]===_0x2c698c[_0x31436d(0xc8)]());}export function listLocalServiceTrees(_0xb8edfc={}){const _0x343c84=a42_0x1d44;return readServiceRegistry(_0xb8edfc)[_0x343c84(0xc3)]['map'](_0x212330=>_0x212330[_0x343c84(0xd2)]);}export function inspectServiceRegistry(_0x23b90c={}){const _0xb052d6=a42_0x1d44,_0x1e22d2=getServiceRegistryPath(_0x23b90c);if(!existsSync(_0x1e22d2))return emptyServiceRegistryInspection(_0x1e22d2,_0xb052d6(0xd0),![]);try{const _0x114a6f=readFileSync(_0x1e22d2,_0xb052d6(0xdd));if(!_0x114a6f[_0xb052d6(0xc8)]())return emptyServiceRegistryInspection(_0x1e22d2,_0xb052d6(0xc9),!![]);const _0x576d09=JSON[_0xb052d6(0xb9)](_0x114a6f);if(_0x576d09[_0xb052d6(0xc7)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x1e22d2,_0xb052d6(0xb1),!![]),'schemaVersion':_0x576d09[_0xb052d6(0xc7)],'message':_0xb052d6(0xc4)+String(_0x576d09['schemaVersion'])};if(!Array[_0xb052d6(0xba)](_0x576d09[_0xb052d6(0xc3)]))return{...emptyServiceRegistryInspection(_0x1e22d2,_0xb052d6(0xb1),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x576d09['updatedAt'],'message':_0xb052d6(0xbd)};const _0x2010de=_0x576d09[_0xb052d6(0xc3)][_0xb052d6(0xd8)](summarizeLocalServiceEntry);return{'registryPath':_0x1e22d2,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x576d09[_0xb052d6(0xb4)],'serviceCount':_0x2010de[_0xb052d6(0xe7)],'commandCount':_0x2010de[_0xb052d6(0xe6)]((_0x1a0c7f,_0x159326)=>_0x1a0c7f+_0x159326[_0xb052d6(0xcc)],0x0),'services':_0x2010de};}catch(_0x261770){return{...emptyServiceRegistryInspection(_0x1e22d2,_0xb052d6(0xb1),!![]),'message':_0x261770 instanceof Error?_0x261770[_0xb052d6(0xb0)]:String(_0x261770)};}}export function formatValidationFailure(_0x44fb58){const _0x217047=a42_0x1d44,_0x41207d=_0x44fb58[_0x217047(0x9f)]['map'](_0x2672e0=>_0x2672e0[_0x217047(0xc5)]+':\x20'+_0x2672e0[_0x217047(0xb0)]);return _0x217047(0xea)+_0x41207d[_0x217047(0xe9)]('\x0a');}function extractLoadedServiceManifests(_0x2b7262,_0x11c8fa){const _0x340192=a42_0x1d44;if(!isServiceRegistryLike(_0x2b7262)){const _0x2c66c3=_0x2b7262,{manifest:_0x194d08,errors:_0x4a8e10}=adaptServiceTreeManifestForLegacyFramework(_0x2c66c3),_0x3e6035=validateServiceTreeManifest(_0x194d08),_0x5269a3=mergeValidationErrors(_0x3e6035,_0x4a8e10);return[{'manifest':_0x2c66c3,'report':_0x5269a3,'normalizedManifest':_0x5269a3['ok']?normalizeServiceTreeManifest(_0x194d08):undefined,'sourceHash':_0x11c8fa}];}return _0x2b7262[_0x340192(0xc3)][_0x340192(0xd8)]((_0x2313b5,_0x1037a1)=>{const _0x3be4b2=_0x340192,_0x37c9d3=isObjectRecord(_0x2313b5)?_0x2313b5[_0x3be4b2(0xb6)]:undefined,{manifest:_0x40b752,errors:_0x3a5456}=adaptServiceTreeManifestForLegacyFramework(_0x37c9d3),_0x2b746b=validateServiceTreeManifest(_0x40b752),_0x3f22e9=mergeValidationErrors(_0x2b746b,_0x3a5456),_0x469d57=isObjectRecord(_0x2313b5)&&typeof _0x2313b5[_0x3be4b2(0xd9)]===_0x3be4b2(0xaf)?_0x2313b5[_0x3be4b2(0xd9)]:undefined;return{'manifest':_0x37c9d3,'report':_0x3f22e9,'normalizedManifest':_0x3f22e9['ok']?normalizeServiceTreeManifest(_0x40b752):undefined,'sourceHash':sha256(JSON[_0x3be4b2(0xe2)](_0x37c9d3,null,0x2)+'\x0a'),'registryIndex':_0x1037a1,'registryServiceCode':_0x469d57};});}function mergeValidationErrors(_0x1e06f0,_0x4ab970){const _0xd04a3e=a42_0x1d44,_0x5ee298=_0x1e06f0['errors'][_0xd04a3e(0xd8)](_0x17f9aa=>_0x17f9aa[_0xd04a3e(0xb0)]===_0xd04a3e(0xb7)?{..._0x17f9aa,'message':_0xd04a3e(0xaa)}:_0x17f9aa),_0x5a2c38=[..._0x4ab970,..._0x5ee298];return{'ok':_0x5a2c38[_0xd04a3e(0xe7)]===0x0,'errors':_0x5a2c38,'warnings':_0x1e06f0[_0xd04a3e(0xcf)]};}function aggregateValidationReports(_0x377321){const _0x17cc33=a42_0x1d44,_0x4809b9=_0x377321[_0x17cc33(0xbf)](_0x12c666=>_0x12c666['registryIndex']===undefined?_0x12c666[_0x17cc33(0xc0)][_0x17cc33(0x9f)]:_0x12c666[_0x17cc33(0xc0)][_0x17cc33(0x9f)][_0x17cc33(0xd8)](_0x26ab6f=>({..._0x26ab6f,'path':prefixRegistryIssuePath(_0x12c666[_0x17cc33(0xb8)],_0x26ab6f['path'])}))),_0x555f2e=_0x377321[_0x17cc33(0xbf)](_0x24f121=>_0x24f121['registryIndex']===undefined?_0x24f121[_0x17cc33(0xc0)][_0x17cc33(0xcf)]:_0x24f121[_0x17cc33(0xc0)]['warnings']['map'](_0x453f83=>({..._0x453f83,'path':prefixRegistryIssuePath(_0x24f121[_0x17cc33(0xb8)],_0x453f83[_0x17cc33(0xc5)])})));return{'ok':_0x4809b9[_0x17cc33(0xe7)]===0x0,'errors':_0x4809b9,'warnings':_0x555f2e};}function prefixRegistryIssuePath(_0x37d6d0,_0x42b847){const _0x373b48=a42_0x1d44;if(_0x42b847==='$')return _0x373b48(0xa6)+_0x37d6d0+_0x373b48(0xd7);if(_0x42b847[_0x373b48(0xbb)]('$.'))return _0x373b48(0xa6)+_0x37d6d0+'].manifest'+_0x42b847['slice'](0x1);if(_0x42b847['startsWith']('$['))return _0x373b48(0xa6)+_0x37d6d0+_0x373b48(0xd7)+_0x42b847[_0x373b48(0xa9)](0x1);return _0x373b48(0xa6)+_0x37d6d0+_0x373b48(0xd5)+_0x42b847;}function isServiceRegistryLike(_0x175528){const _0x34f97a=a42_0x1d44;return isObjectRecord(_0x175528)&&_0x175528[_0x34f97a(0xc7)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x34f97a(0xba)](_0x175528['services']);}function isObjectRecord(_0x485b4c){const _0x3c2baa=a42_0x1d44;return Boolean(_0x485b4c)&&typeof _0x485b4c===_0x3c2baa(0xab)&&!Array[_0x3c2baa(0xba)](_0x485b4c);}function emptyServiceRegistryInspection(_0x25313b,_0x512137,_0x138065){return{'registryPath':_0x25313b,'exists':_0x138065,'status':_0x512137,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x76fd29){const _0x1a2780=a42_0x1d44,_0xca4f37=_0x76fd29[_0x1a2780(0xd2)],_0x3887f7=_0xca4f37[_0x1a2780(0xad)][_0x1a2780(0xd8)](_0x3767a4=>({'path':_0x3767a4[_0x1a2780(0x9a)],'description':_0x3767a4[_0x1a2780(0xe1)],'risk':_0x3767a4['risk'],'targetKind':_0x3767a4[_0x1a2780(0xcd)][_0x1a2780(0xac)],'targetCommand':_0x3767a4['target'][_0x1a2780(0xbc)]}));return{'serviceCode':_0x76fd29[_0x1a2780(0xd9)],'name':_0xca4f37[_0x1a2780(0x9c)]['name'],'description':_0xca4f37['service'][_0x1a2780(0xe1)],'version':_0x76fd29[_0x1a2780(0xdf)],'importedAt':_0x76fd29[_0x1a2780(0xa1)],'source':_0x76fd29[_0x1a2780(0xce)],'commandCount':_0x3887f7[_0x1a2780(0xe7)],'commands':_0x3887f7};}function sha256(_0x17e06f){const _0x44a0b1=a42_0x1d44;return createHash('sha256')[_0x44a0b1(0x9b)](_0x17e06f)[_0x44a0b1(0xae)](_0x44a0b1(0xdb));}function a42_0xabaa(){const _0x1724a4=['target','source','warnings','missing','filePath','normalizedManifest','splice','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','].manifest.','name','].manifest','map','serviceCode','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','hex','132OWHCQv','utf8','Invalid\x20service\x20manifest\x20JSON:\x20','version','homeDir','description','stringify','842115NgpZSP','175970Zuzrwn','sourceHash','reduce','length','1856996qKncZS','join','Service\x20manifest\x20validation\x20failed:\x0a','ENOENT','sort','cliPath','update','service','10722SJuqJg','1148iDGHBT','errors','Local\x20service\x20not\x20found:\x20','importedAt','1336554vIfLgg','toISOString','localeCompare','validation','$.services[','1817272HWhajG','manifests','slice','bff\x20target\x20requires\x20functionName.','object','kind','commands','digest','string','message','invalid','CliError','Invalid\x20service\x20registry\x20JSON:\x20','updatedAt','findIndex','manifest','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','registryIndex','parse','isArray','startsWith','command','services\x20must\x20be\x20an\x20array','push','flatMap','report','find','code','services','Unsupported\x20schemaVersion:\x20','path','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','schemaVersion','trim','empty','3200hcHxMx','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','commandCount'];a42_0xabaa=function(){return _0x1724a4;};return a42_0xabaa();}
|
|
1
|
+
const a42_0x3a3caa=a42_0x3a72;(function(_0x253f3f,_0x112752){const _0x28bfa8=a42_0x3a72,_0x475090=_0x253f3f();while(!![]){try{const _0x117450=parseInt(_0x28bfa8(0xe6))/0x1+parseInt(_0x28bfa8(0xfb))/0x2*(parseInt(_0x28bfa8(0xc1))/0x3)+-parseInt(_0x28bfa8(0xcf))/0x4*(parseInt(_0x28bfa8(0xc0))/0x5)+parseInt(_0x28bfa8(0xff))/0x6*(parseInt(_0x28bfa8(0xe1))/0x7)+parseInt(_0x28bfa8(0xe7))/0x8*(parseInt(_0x28bfa8(0xf0))/0x9)+parseInt(_0x28bfa8(0xf4))/0xa*(-parseInt(_0x28bfa8(0x108))/0xb)+parseInt(_0x28bfa8(0xe5))/0xc;if(_0x117450===_0x112752)break;else _0x475090['push'](_0x475090['shift']());}catch(_0x11205f){_0x475090['push'](_0x475090['shift']());}}}(a42_0x17f1,0x3e8a1));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a42_0x3a3caa(0xfe);function a42_0x3a72(_0x44430b,_0x546408){_0x44430b=_0x44430b-0xb5;const _0x17f170=a42_0x17f1();let _0x3a7279=_0x17f170[_0x44430b];return _0x3a7279;}export function getServiceRegistryPath(_0x35bff2={}){const _0x43f450=a42_0x3a3caa;return resolve(_0x35bff2[_0x43f450(0xd1)]??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x4d28ce={}){const _0x536e9e=a42_0x3a3caa,_0x4e59e4=getServiceRegistryPath(_0x4d28ce);if(!existsSync(_0x4e59e4))return emptyServiceRegistry();try{const _0x5fb11a=readFileSync(_0x4e59e4,_0x536e9e(0xdc));if(!_0x5fb11a[_0x536e9e(0xca)]())return emptyServiceRegistry();const _0x26d5b2=JSON[_0x536e9e(0xd0)](_0x5fb11a);if(_0x26d5b2[_0x536e9e(0xb6)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x536e9e(0x102)](_0x536e9e(0xdd)+String(_0x26d5b2[_0x536e9e(0xb6)]),_0x536e9e(0xd2)+_0x4e59e4+'.');if(!Array[_0x536e9e(0xed)](_0x26d5b2[_0x536e9e(0xfa)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x26d5b2[_0x536e9e(0xec)],'services':_0x26d5b2[_0x536e9e(0xfa)]};}catch(_0x1b4fcf){if(_0x1b4fcf instanceof Error&&_0x1b4fcf[_0x536e9e(0xf9)]===_0x536e9e(0xbc))throw _0x1b4fcf;throw CliErrors[_0x536e9e(0x102)](_0x536e9e(0xfc)+_0x4e59e4,_0x536e9e(0xd9));}}export function writeServiceRegistry(_0x53de2c,_0x9fd900={}){const _0x49d598=a42_0x3a3caa,_0x32a8e4=getServiceRegistryPath(_0x9fd900),_0x5a350b=dirname(_0x32a8e4);!existsSync(_0x5a350b)&&mkdirSync(_0x5a350b,{'recursive':!![]});const _0x540b45=_0x32a8e4+_0x49d598(0xeb);try{writeFileSync(_0x540b45,JSON['stringify'](_0x53de2c,null,0x2)+'\x0a',{'encoding':_0x49d598(0xdc),'mode':0x180}),renameSync(_0x540b45,_0x32a8e4);}catch(_0xc8c7b2){try{unlinkSync(_0x540b45);}catch{}if(_0xc8c7b2?.[_0x49d598(0xb9)]==='ENOENT')throw CliErrors[_0x49d598(0x102)]('Cannot\x20write\x20service\x20registry:\x20'+_0x32a8e4);throw _0xc8c7b2;}return _0x32a8e4;}export function loadServiceManifestFromFile(_0x1c2c6d){const _0x49646b=a42_0x3a3caa,_0x2387df=resolve(_0x1c2c6d);if(!existsSync(_0x2387df))throw CliErrors['validation'](_0x49646b(0x106)+_0x1c2c6d);let _0x5213da;const _0x5c574e=readFileSync(_0x2387df,'utf8');try{_0x5213da=JSON[_0x49646b(0xd0)](_0x5c574e);}catch{throw CliErrors[_0x49646b(0x102)](_0x49646b(0xde)+_0x1c2c6d,'Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.');}const _0x27a975=sha256(_0x5c574e),_0x12a953=extractLoadedServiceManifests(_0x5213da,_0x27a975),_0x3456e6=aggregateValidationReports(_0x12a953),_0x3ef93d=_0x12a953[0x0];return{'filePath':_0x2387df,'hash':_0x27a975,'kind':isServiceRegistryLike(_0x5213da)?_0x49646b(0x100):'manifest','manifest':_0x3ef93d?.[_0x49646b(0xba)]??_0x5213da,'report':_0x3456e6,'normalizedManifest':_0x12a953[_0x49646b(0xd7)]===0x1?_0x3ef93d?.[_0x49646b(0xbb)]:undefined,'manifests':_0x12a953};}export function importServiceManifest(_0x27812b,_0x25290c={}){const _0xcdd141=a42_0x3a3caa,_0x4a3d9f=loadServiceManifestFromFile(_0x27812b);if(!_0x4a3d9f[_0xcdd141(0xe0)]['ok'])throw CliErrors[_0xcdd141(0x102)](formatValidationFailure(_0x4a3d9f[_0xcdd141(0xe0)]),'Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.');if(_0x4a3d9f['manifests'][_0xcdd141(0xd7)]===0x0)throw CliErrors[_0xcdd141(0x102)](_0xcdd141(0xc2),_0xcdd141(0xf8));const _0x35b37f=readServiceRegistry(_0x25290c),_0xfa76cf=(_0x25290c['now']??(()=>new Date()))()[_0xcdd141(0x109)](),_0xa26407=[];let _0x460984=0x0,_0x2605b6=0x0;for(const _0xfeaf9 of _0x4a3d9f['manifests']){if(!_0xfeaf9[_0xcdd141(0xbb)])continue;const _0x1bb934=_0xfeaf9['normalizedManifest'][_0xcdd141(0xe4)][_0xcdd141(0xb9)],_0x57dda9={'serviceCode':_0x1bb934,'version':_0xfeaf9[_0xcdd141(0xbb)][_0xcdd141(0xf1)],'importedAt':_0xfa76cf,'source':{'type':_0xcdd141(0xbe),'path':_0x4a3d9f[_0xcdd141(0xd3)],'hash':_0xfeaf9[_0xcdd141(0xf5)]},'manifest':_0xfeaf9[_0xcdd141(0xba)],'normalizedManifest':_0xfeaf9[_0xcdd141(0xbb)]},_0x59c313=_0x35b37f[_0xcdd141(0xfa)][_0xcdd141(0xdf)](_0x1253ce=>_0x1253ce[_0xcdd141(0xb5)]===_0x1bb934);_0x59c313>=0x0?(_0x35b37f['services'][_0x59c313]=_0x57dda9,_0x2605b6++):(_0x35b37f[_0xcdd141(0xfa)]['push'](_0x57dda9),_0x460984++),_0xa26407[_0xcdd141(0x101)](_0x57dda9);}_0x35b37f['services'][_0xcdd141(0xc8)]((_0x3de468,_0xfd0c01)=>_0x3de468['serviceCode']['localeCompare'](_0xfd0c01[_0xcdd141(0xb5)])),_0x35b37f[_0xcdd141(0xec)]=_0xfa76cf;const _0x19a2d3=writeServiceRegistry(_0x35b37f,_0x25290c);return{'registryPath':_0x19a2d3,'entry':_0xa26407[0x0],'replaced':_0xa26407[_0xcdd141(0xd7)]===0x1?_0x2605b6===0x1:_0x2605b6>0x0,'entries':_0xa26407,'imported':_0x460984,'updated':_0x2605b6,'serviceCount':_0x35b37f[_0xcdd141(0xfa)][_0xcdd141(0xd7)]};}export function exportServiceManifest(_0x2e2e97,_0x38a274,_0x3bf1ea={}){const _0x5a4cb5=a42_0x3a3caa,_0x4da34c=getServiceRegistryPath(_0x3bf1ea),_0x54c40c=getLocalServiceEntry(_0x2e2e97,_0x3bf1ea);if(!_0x54c40c)throw CliErrors[_0x5a4cb5(0x102)]('Local\x20service\x20not\x20found:\x20'+_0x2e2e97,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const _0x10e198=resolve(_0x38a274),_0x1f9a05=dirname(_0x10e198);return!existsSync(_0x1f9a05)&&mkdirSync(_0x1f9a05,{'recursive':!![]}),writeFileSync(_0x10e198,JSON[_0x5a4cb5(0xc3)](_0x54c40c[_0x5a4cb5(0xba)],null,0x2)+'\x0a',{'encoding':_0x5a4cb5(0xdc),'mode':0x180}),{'registryPath':_0x4da34c,'filePath':_0x10e198,'entry':_0x54c40c};}export function removeServiceManifest(_0x3b1bbe,_0xa5ee6={}){const _0x3a76f1=a42_0x3a3caa,_0x32247b=readServiceRegistry(_0xa5ee6),_0x386773=_0x3b1bbe[_0x3a76f1(0xca)](),_0xece2ad=_0x32247b[_0x3a76f1(0xfa)][_0x3a76f1(0xdf)](_0x173232=>_0x173232['serviceCode']===_0x386773);if(_0xece2ad<0x0)throw CliErrors[_0x3a76f1(0x102)](_0x3a76f1(0xfd)+_0x386773,_0x3a76f1(0xef));const [_0x34ccfd]=_0x32247b[_0x3a76f1(0xfa)][_0x3a76f1(0xd6)](_0xece2ad,0x1),_0x67a9ce=(_0xa5ee6[_0x3a76f1(0xcc)]??(()=>new Date()))()[_0x3a76f1(0x109)]();_0x32247b[_0x3a76f1(0xec)]=_0x67a9ce;const _0x2fde32=writeServiceRegistry(_0x32247b,_0xa5ee6);return{'registryPath':_0x2fde32,'entry':_0x34ccfd,'serviceCount':_0x32247b[_0x3a76f1(0xfa)][_0x3a76f1(0xd7)]};}export function listLocalServices(_0x4c865c={}){const _0x69772=a42_0x3a3caa;return readServiceRegistry(_0x4c865c)[_0x69772(0xfa)];}export function getLocalServiceEntry(_0x19746b,_0x133bb6={}){const _0x206a33=a42_0x3a3caa;return readServiceRegistry(_0x133bb6)['services']['find'](_0x44108c=>_0x44108c[_0x206a33(0xb5)]===_0x19746b[_0x206a33(0xca)]());}export function listLocalServiceTrees(_0x2d69ac={}){const _0x4f6619=a42_0x3a3caa;return readServiceRegistry(_0x2d69ac)[_0x4f6619(0xfa)][_0x4f6619(0xb8)](_0x2a5f5f=>_0x2a5f5f[_0x4f6619(0xbb)]);}export function inspectServiceRegistry(_0x874924={}){const _0x27b340=a42_0x3a3caa,_0xb38e0e=getServiceRegistryPath(_0x874924);if(!existsSync(_0xb38e0e))return emptyServiceRegistryInspection(_0xb38e0e,'missing',![]);try{const _0x72f80b=readFileSync(_0xb38e0e,_0x27b340(0xdc));if(!_0x72f80b[_0x27b340(0xca)]())return emptyServiceRegistryInspection(_0xb38e0e,_0x27b340(0xcb),!![]);const _0x110c47=JSON[_0x27b340(0xd0)](_0x72f80b);if(_0x110c47[_0x27b340(0xb6)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0xb38e0e,_0x27b340(0xd5),!![]),'schemaVersion':_0x110c47['schemaVersion'],'message':_0x27b340(0xc5)+String(_0x110c47[_0x27b340(0xb6)])};if(!Array[_0x27b340(0xed)](_0x110c47[_0x27b340(0xfa)]))return{...emptyServiceRegistryInspection(_0xb38e0e,'invalid',!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x110c47['updatedAt'],'message':'services\x20must\x20be\x20an\x20array'};const _0x3f5e63=_0x110c47['services'][_0x27b340(0xb8)](summarizeLocalServiceEntry);return{'registryPath':_0xb38e0e,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x110c47['updatedAt'],'serviceCount':_0x3f5e63[_0x27b340(0xd7)],'commandCount':_0x3f5e63[_0x27b340(0xea)]((_0x2dcb13,_0x15cda6)=>_0x2dcb13+_0x15cda6['commandCount'],0x0),'services':_0x3f5e63};}catch(_0x423e6a){return{...emptyServiceRegistryInspection(_0xb38e0e,_0x27b340(0xd5),!![]),'message':_0x423e6a instanceof Error?_0x423e6a[_0x27b340(0xc6)]:String(_0x423e6a)};}}export function formatValidationFailure(_0x58616e){const _0x23e2d1=a42_0x3a3caa,_0xcee6d6=_0x58616e['errors'][_0x23e2d1(0xb8)](_0x14224a=>_0x14224a[_0x23e2d1(0xda)]+':\x20'+_0x14224a[_0x23e2d1(0xc6)]);return'Service\x20manifest\x20validation\x20failed:\x0a'+_0xcee6d6[_0x23e2d1(0x104)]('\x0a');}function extractLoadedServiceManifests(_0x451dd0,_0x183a2d){const _0x52f9db=a42_0x3a3caa;if(!isServiceRegistryLike(_0x451dd0)){const _0x5868cd=_0x451dd0,{manifest:_0x151ce2,errors:_0x4d9fb0}=adaptServiceTreeManifestForLegacyFramework(_0x5868cd),_0x5dfb25=validateServiceTreeManifest(_0x151ce2),_0x1aede9=mergeValidationErrors(_0x5dfb25,_0x4d9fb0);return[{'manifest':_0x5868cd,'report':_0x1aede9,'normalizedManifest':_0x1aede9['ok']?normalizeServiceTreeManifest(_0x151ce2):undefined,'sourceHash':_0x183a2d}];}return _0x451dd0[_0x52f9db(0xfa)][_0x52f9db(0xb8)]((_0x900935,_0x2ddd32)=>{const _0x132360=_0x52f9db,_0x4cfaac=isObjectRecord(_0x900935)?_0x900935[_0x132360(0xba)]:undefined,{manifest:_0x16f1f9,errors:_0x57313f}=adaptServiceTreeManifestForLegacyFramework(_0x4cfaac),_0x39f227=validateServiceTreeManifest(_0x16f1f9),_0x4a95f5=mergeValidationErrors(_0x39f227,_0x57313f),_0x412a02=isObjectRecord(_0x900935)&&typeof _0x900935['serviceCode']===_0x132360(0x103)?_0x900935[_0x132360(0xb5)]:undefined;return{'manifest':_0x4cfaac,'report':_0x4a95f5,'normalizedManifest':_0x4a95f5['ok']?normalizeServiceTreeManifest(_0x16f1f9):undefined,'sourceHash':sha256(JSON[_0x132360(0xc3)](_0x4cfaac,null,0x2)+'\x0a'),'registryIndex':_0x2ddd32,'registryServiceCode':_0x412a02};});}function mergeValidationErrors(_0x207ae7,_0x22cceb){const _0x49b549=a42_0x3a3caa,_0x629d04=_0x207ae7[_0x49b549(0xbf)][_0x49b549(0xb8)](_0x1f0e6f=>_0x1f0e6f[_0x49b549(0xc6)]===_0x49b549(0xce)?{..._0x1f0e6f,'message':_0x49b549(0xc7)}:_0x1f0e6f),_0x4a601c=[..._0x22cceb,..._0x629d04];return{'ok':_0x4a601c['length']===0x0,'errors':_0x4a601c,'warnings':_0x207ae7[_0x49b549(0xbd)]};}function a42_0x17f1(){const _0xe95e55=['10tPMeXh','sourceHash','kind','description','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','name','services','2GqjhMi','Invalid\x20service\x20registry\x20JSON:\x20','Local\x20service\x20not\x20found:\x20','service.json','96wUmMKg','registry','push','validation','string','join','sha256','Service\x20manifest\x20file\x20not\x20found:\x20','update','4507591YGVakV','toISOString','serviceCode','schemaVersion','target','map','code','manifest','normalizedManifest','CliError','warnings','file','errors','115RhQNKs','384357fPQUhH','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','stringify','].manifest.','Unsupported\x20schemaVersion:\x20','message','bff\x20target\x20requires\x20functionName.','sort','flatMap','trim','empty','now','startsWith','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','80708mZjmFT','parse','homeDir','Remove\x20or\x20migrate\x20','filePath','digest','invalid','splice','length','slice','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','path','risk','utf8','Unsupported\x20service\x20registry\x20schemaVersion:\x20','Invalid\x20service\x20manifest\x20JSON:\x20','findIndex','report','45332XWUZED','hex','object','service','3982008OpIGfm','356984AZnoDS','558560akQPJT','registryIndex','cliPath','reduce','.tmp','updatedAt','isArray','].manifest','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','27JjCxHZ','version','$.services[','command'];a42_0x17f1=function(){return _0xe95e55;};return a42_0x17f1();}function aggregateValidationReports(_0x2f5c4d){const _0x3600e6=a42_0x3a3caa,_0x3c441a=_0x2f5c4d['flatMap'](_0x4828cc=>_0x4828cc[_0x3600e6(0xe8)]===undefined?_0x4828cc[_0x3600e6(0xe0)][_0x3600e6(0xbf)]:_0x4828cc[_0x3600e6(0xe0)][_0x3600e6(0xbf)]['map'](_0x33a420=>({..._0x33a420,'path':prefixRegistryIssuePath(_0x4828cc[_0x3600e6(0xe8)],_0x33a420['path'])}))),_0x415f2c=_0x2f5c4d[_0x3600e6(0xc9)](_0x39fe62=>_0x39fe62[_0x3600e6(0xe8)]===undefined?_0x39fe62['report'][_0x3600e6(0xbd)]:_0x39fe62[_0x3600e6(0xe0)][_0x3600e6(0xbd)][_0x3600e6(0xb8)](_0x370cea=>({..._0x370cea,'path':prefixRegistryIssuePath(_0x39fe62[_0x3600e6(0xe8)],_0x370cea[_0x3600e6(0xda)])})));return{'ok':_0x3c441a['length']===0x0,'errors':_0x3c441a,'warnings':_0x415f2c};}function prefixRegistryIssuePath(_0xc39624,_0x51e4ba){const _0x862c92=a42_0x3a3caa;if(_0x51e4ba==='$')return _0x862c92(0xf2)+_0xc39624+_0x862c92(0xee);if(_0x51e4ba['startsWith']('$.'))return'$.services['+_0xc39624+_0x862c92(0xee)+_0x51e4ba[_0x862c92(0xd8)](0x1);if(_0x51e4ba[_0x862c92(0xcd)]('$['))return _0x862c92(0xf2)+_0xc39624+_0x862c92(0xee)+_0x51e4ba[_0x862c92(0xd8)](0x1);return _0x862c92(0xf2)+_0xc39624+_0x862c92(0xc4)+_0x51e4ba;}function isServiceRegistryLike(_0x3d53c2){const _0x1739df=a42_0x3a3caa;return isObjectRecord(_0x3d53c2)&&_0x3d53c2[_0x1739df(0xb6)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x1739df(0xed)](_0x3d53c2[_0x1739df(0xfa)]);}function isObjectRecord(_0x24bcac){const _0x2aeb92=a42_0x3a3caa;return Boolean(_0x24bcac)&&typeof _0x24bcac===_0x2aeb92(0xe3)&&!Array['isArray'](_0x24bcac);}function emptyServiceRegistryInspection(_0x2b7ca4,_0x35d3b4,_0x5bac98){return{'registryPath':_0x2b7ca4,'exists':_0x5bac98,'status':_0x35d3b4,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x2877b0){const _0x5646d3=a42_0x3a3caa,_0x1a4f35=_0x2877b0['normalizedManifest'],_0xc7a077=_0x1a4f35['commands'][_0x5646d3(0xb8)](_0x3e25ca=>({'path':_0x3e25ca[_0x5646d3(0xe9)],'description':_0x3e25ca[_0x5646d3(0xf7)],'risk':_0x3e25ca[_0x5646d3(0xdb)],'targetKind':_0x3e25ca[_0x5646d3(0xb7)][_0x5646d3(0xf6)],'targetCommand':_0x3e25ca[_0x5646d3(0xb7)][_0x5646d3(0xf3)]}));return{'serviceCode':_0x2877b0[_0x5646d3(0xb5)],'name':_0x1a4f35['service']['name'],'description':_0x1a4f35['service']['description'],'version':_0x2877b0[_0x5646d3(0xf1)],'importedAt':_0x2877b0['importedAt'],'source':_0x2877b0['source'],'commandCount':_0xc7a077['length'],'commands':_0xc7a077};}function sha256(_0x18c0ef){const _0x208d53=a42_0x3a3caa;return createHash(_0x208d53(0x105))[_0x208d53(0x107)](_0x18c0ef)[_0x208d53(0xd4)](_0x208d53(0xe2));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x451ff0=a43_0x3785;(function(_0x410ffe,_0x28a75c){const _0x54090b=a43_0x3785,_0x17196c=_0x410ffe();while(!![]){try{const _0x4b0cda=parseInt(_0x54090b(0x1d9))/0x1+parseInt(_0x54090b(0x1e3))/0x2+parseInt(_0x54090b(0x1f0))/0x3+parseInt(_0x54090b(0x1ef))/0x4*(parseInt(_0x54090b(0x1e5))/0x5)+parseInt(_0x54090b(0x1de))/0x6+parseInt(_0x54090b(0x1ee))/0x7+-parseInt(_0x54090b(0x1df))/0x8;if(_0x4b0cda===_0x28a75c)break;else _0x17196c['push'](_0x17196c['shift']());}catch(_0x210424){_0x17196c['push'](_0x17196c['shift']());}}}(a43_0x586f,0x6ea98));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';function a43_0x586f(){const _0x5407c0=['Skill\x20directory\x20already\x20exists:\x20','255986ATwvhN','name','str','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','2731734BrWECL','18088680OXLzak','files','utf8','path','1356174KjkLxe','rendered','5CpZvrV','skillDir','trim','validation','WRITE','bool','isSymbolicLink','read','skillName','1134896wpuGGG','1768204OTOvmp','2162448VATuCt','type','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','创建本地自包含的运行态\x20Skill\x20草稿','Refusing\x20to\x20overwrite\x20symlink:\x20','create','content','isDirectory','map','target'];a43_0x586f=function(){return _0x5407c0;};return a43_0x586f();}import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';function a43_0x3785(_0x510288,_0x478758){_0x510288=_0x510288-0x1d0;const _0x586f8f=a43_0x586f();let _0x37855d=_0x586f8f[_0x510288];return _0x37855d;}import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':'skill','command':a43_0x451ff0(0x1d3),'description':a43_0x451ff0(0x1d1),'risk':a43_0x451ff0(0x1ec),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x10591e){const _0x280f3f=a43_0x451ff0,_0x24ca19=buildSkillCreatePlan(_0x10591e[_0x280f3f(0x1db)]('name'),_0x10591e[_0x280f3f(0x1db)]('type'),_0x10591e[_0x280f3f(0x1db)]('target'));return{'method':_0x280f3f(0x1e9),'url':_0x24ca19['skillDir'],'body':{'skillName':_0x24ca19[_0x280f3f(0x1e4)]['skillName'],'type':_0x24ca19[_0x280f3f(0x1e4)][_0x280f3f(0x1f1)],'selfContained':!![],'files':_0x24ca19[_0x280f3f(0x1e4)][_0x280f3f(0x1e0)][_0x280f3f(0x1d6)](_0x59641b=>_0x59641b[_0x280f3f(0x1e2)])},'description':'Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.'};},async 'execute'(_0x44360f){const _0x4380c7=a43_0x451ff0,_0x60e392=buildSkillCreatePlan(_0x44360f[_0x4380c7(0x1db)](_0x4380c7(0x1da)),_0x44360f[_0x4380c7(0x1db)](_0x4380c7(0x1f1)),_0x44360f[_0x4380c7(0x1db)](_0x4380c7(0x1d7)));return writeSkillDraft(_0x60e392,_0x44360f[_0x4380c7(0x1ea)]('force')),{'ok':!![],'data':{'skillName':_0x60e392['rendered'][_0x4380c7(0x1ed)],'type':_0x60e392[_0x4380c7(0x1e4)][_0x4380c7(0x1f1)],'dir':_0x60e392[_0x4380c7(0x1e6)],'files':_0x60e392[_0x4380c7(0x1e4)][_0x4380c7(0x1e0)][_0x4380c7(0x1d6)](_0x5daea0=>_0x5daea0[_0x4380c7(0x1e2)])},'message':'Created\x20local\x20Skill\x20draft\x20'+_0x60e392[_0x4380c7(0x1e4)]['skillName']};}};function buildSkillCreatePlan(_0x286ca1,_0x581272,_0x2bfbcc){const _0x3b5c1f=a43_0x451ff0,_0x137335=_0x581272['trim'](),_0x5b0e7b=renderSkillTemplate({'skillName':_0x286ca1,'type':_0x137335});!_0x137335&&writeCliSideChannelLine(_0x3b5c1f(0x1dc));const _0x1f1a5d=resolve(normalizeSkillTarget(_0x2bfbcc));return{'rendered':_0x5b0e7b,'targetRoot':_0x1f1a5d,'skillDir':resolve(_0x1f1a5d,_0x5b0e7b[_0x3b5c1f(0x1ed)])};}function normalizeSkillTarget(_0x107302){const _0x2ff6f3=a43_0x451ff0;return(_0x107302||DEFAULT_SKILL_TARGET)[_0x2ff6f3(0x1e7)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x3ea6b7,_0x400d40){const _0x2a9a18=a43_0x451ff0;if(existsSync(_0x3ea6b7['skillDir'])){const _0x1f7944=lstatSync(_0x3ea6b7[_0x2a9a18(0x1e6)]);if(!_0x1f7944[_0x2a9a18(0x1d5)]()||_0x1f7944[_0x2a9a18(0x1eb)]())throw CliErrors[_0x2a9a18(0x1e8)](_0x2a9a18(0x1d0)+_0x3ea6b7['skillDir']);if(!_0x400d40)throw CliErrors[_0x2a9a18(0x1e8)](_0x2a9a18(0x1d8)+_0x3ea6b7[_0x2a9a18(0x1e6)],_0x2a9a18(0x1dd));}for(const _0x1a6edb of _0x3ea6b7[_0x2a9a18(0x1e4)][_0x2a9a18(0x1e0)]){const _0x30be05=resolve(_0x3ea6b7[_0x2a9a18(0x1e6)],_0x1a6edb[_0x2a9a18(0x1e2)]),_0x29f26f=dirname(_0x30be05);mkdirSync(_0x29f26f,{'recursive':!![]});if(existsSync(_0x30be05)&&lstatSync(_0x30be05)[_0x2a9a18(0x1eb)]())throw CliErrors[_0x2a9a18(0x1e8)](_0x2a9a18(0x1d2)+_0x30be05);writeFileSync(_0x30be05,_0x1a6edb[_0x2a9a18(0x1d4)],_0x2a9a18(0x1e1));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a44_0x16e9f4=a44_0x1e33;(function(_0x42bd13,_0xbda83){const _0x1c4f0a=a44_0x1e33,_0x377bc2=_0x42bd13();while(!![]){try{const _0x29a8dc=parseInt(_0x1c4f0a(0x1f2))/0x1+parseInt(_0x1c4f0a(0x1d5))/0x2*(parseInt(_0x1c4f0a(0x1f3))/0x3)+-parseInt(_0x1c4f0a(0x1df))/0x4*(-parseInt(_0x1c4f0a(0x1d8))/0x5)+parseInt(_0x1c4f0a(0x1d6))/0x6+-parseInt(_0x1c4f0a(0x1ca))/0x7*(parseInt(_0x1c4f0a(0x1db))/0x8)+parseInt(_0x1c4f0a(0x1eb))/0x9+-parseInt(_0x1c4f0a(0x1c9))/0xa;if(_0x29a8dc===_0xbda83)break;else _0x377bc2['push'](_0x377bc2['shift']());}catch(_0x1adf7b){_0x377bc2['push'](_0x377bc2['shift']());}}}(a44_0x4dc6,0xd8844));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';import{DIAGRAM_FILE_FLAG,DIAGRAM_SCOPE_FLAG,DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,SOURCE_FINGERPRINT_FLAG}from'../flags.js';const TARGET_FLAGS=[DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,DIAGRAM_SCOPE_FLAG],WRITE_FLAGS=[...TARGET_FLAGS,SOURCE_FINGERPRINT_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,DIAGRAM_FILE_FLAG];function readDiagramTarget(_0x158613){const _0x4ec447=a44_0x1e33,_0x21b932=_0x158613[_0x4ec447(0x1d0)]('skill-code')[_0x4ec447(0x1cc)](),_0x352ed5=_0x158613[_0x4ec447(0x1d0)](_0x4ec447(0x1d7))['trim'](),_0x165a81=_0x158613['str']('scope');if(!_0x21b932||!_0x352ed5||_0x165a81!==_0x4ec447(0x1e4)&&_0x165a81!=='company')throw CliErrors['validation'](_0x4ec447(0x1dd));return{'skillCode':_0x21b932,'version':_0x352ed5,'scope':_0x165a81};}async function readDiagramWriteInput(_0x26cf59){const _0x139e99=a44_0x1e33,_0x32df29=_0x26cf59[_0x139e99(0x1f1)](_0x139e99(0x1ce)),_0x3231d0=_0x26cf59[_0x139e99(0x1d0)](_0x139e99(0x1e9))[_0x139e99(0x1cc)]();if(!Number['isInteger'](_0x32df29)||_0x32df29<0x0)throw CliErrors['validation']('--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.');if(!/^sha256:[0-9a-f]{64}$/[_0x139e99(0x1e3)](_0x3231d0))throw CliErrors[_0x139e99(0x1e1)](_0x139e99(0x1cf));return{'expectedDiagramRevision':_0x32df29,'sourceFingerprint':_0x3231d0,'diagram':await readRequiredSkillDiagram(_0x26cf59[_0x139e99(0x1d0)](_0x139e99(0x1ee)))};}export const diagramValidateCommand={'service':a44_0x16e9f4(0x1e7),'command':'diagram-validate','description':a44_0x16e9f4(0x1e6),'risk':a44_0x16e9f4(0x1dc),'flags':WRITE_FLAGS,async 'execute'(_0xb4b2f1){const _0x1741c5=a44_0x16e9f4,_0xdcf2f7=readDiagramTarget(_0xb4b2f1),_0x16ec7b=await validateRuntimeSkillVersionDiagram(_0xb4b2f1[_0x1741c5(0x1ec)],_0xdcf2f7['skillCode'],_0xdcf2f7[_0x1741c5(0x1d7)],_0xdcf2f7[_0x1741c5(0x1d2)],await readDiagramWriteInput(_0xb4b2f1));return{'ok':!![],'data':_0x16ec7b,'message':_0x1741c5(0x1cb)+_0xdcf2f7['skillCode']+'@'+_0xdcf2f7[_0x1741c5(0x1d7)]+'.'};}};export const diagramPushCommand={'service':'skill','command':a44_0x16e9f4(0x1d4),'description':a44_0x16e9f4(0x1d9),'risk':'write','confirmationDescription':a44_0x16e9f4(0x1ea),'flags':WRITE_FLAGS,async 'execute'(_0x3ca0ac){const _0xc7007a=a44_0x16e9f4,_0x99a3b3=readDiagramTarget(_0x3ca0ac),_0x27dc27=await putRuntimeSkillVersionDiagram(_0x3ca0ac[_0xc7007a(0x1ec)],_0x99a3b3[_0xc7007a(0x1ed)],_0x99a3b3[_0xc7007a(0x1d7)],_0x99a3b3[_0xc7007a(0x1d2)],await readDiagramWriteInput(_0x3ca0ac));return{'ok':!![],'data':_0x27dc27,'message':_0x27dc27[_0xc7007a(0x1d1)]===_0xc7007a(0x1e5)?_0xc7007a(0x1e2)+_0x99a3b3[_0xc7007a(0x1ed)]+'@'+_0x99a3b3['version']+_0xc7007a(0x1cd):(_0x27dc27[_0xc7007a(0x1d1)]===_0xc7007a(0x1de)?_0xc7007a(0x1ef):'Updated')+_0xc7007a(0x1f5)+_0x99a3b3[_0xc7007a(0x1ed)]+'@'+_0x99a3b3['version']+'.'};}};export const diagramShowCommand={'service':a44_0x16e9f4(0x1e7),'command':a44_0x16e9f4(0x1e8),'description':a44_0x16e9f4(0x1d3),'risk':a44_0x16e9f4(0x1dc),'flags':TARGET_FLAGS,async 'execute'(_0x5c20ef){const _0xeeb08=a44_0x16e9f4,_0xba060b=readDiagramTarget(_0x5c20ef),_0x283182=await getRuntimeSkillVersionDiagram(_0x5c20ef['appCode'],_0xba060b[_0xeeb08(0x1ed)],_0xba060b[_0xeeb08(0x1d7)],_0xba060b[_0xeeb08(0x1d2)]);return{'ok':!![],'data':_0x283182,'message':_0x283182[_0xeeb08(0x1f6)]?_0xeeb08(0x1f4)+_0xba060b[_0xeeb08(0x1ed)]+'@'+_0xba060b[_0xeeb08(0x1d7)]+_0xeeb08(0x1e0)+_0x283182[_0xeeb08(0x1da)]+'.':_0xeeb08(0x1f0)+_0xba060b[_0xeeb08(0x1ed)]+'@'+_0xba060b['version']+';\x20first\x20write\x20expects\x20revision\x20'+_0x283182[_0xeeb08(0x1da)]+'.'};}};function a44_0x1e33(_0x17bf07,_0x2a8e5c){_0x17bf07=_0x17bf07-0x1c9;const _0x4dc6d7=a44_0x4dc6();let _0x1e333b=_0x4dc6d7[_0x17bf07];return _0x1e333b;}function a44_0x4dc6(){const _0x2351a2=['Found\x20Skill\x20diagram\x20for\x20','\x20Skill\x20diagram\x20for\x20','found','23634710RaaUQy','3325glSUwq','Skill\x20diagram\x20validation\x20passed\x20for\x20','trim','\x20is\x20unchanged.','expected-diagram-revision','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','str','action','scope','Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','diagram-push','47246PulQNu','1347588StxyvT','version','10VLOhba','为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','expectedDiagramRevision','17168RHsBiu','read','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','created','2663280DKfZRm',';\x20next\x20write\x20expects\x20revision\x20','validation','Skill\x20diagram\x20for\x20','test','personal','unchanged','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','skill','diagram-show','source-fingerprint','将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。','1371150SrxwmQ','appCode','skillCode','diagram-file','Created','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','num','1096459SbGqCm','186tBNLUi'];a44_0x4dc6=function(){return _0x2351a2;};return a44_0x4dc6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x52a54b=a45_0x523f;(function(_0x4ecc97,_0x3fc96c){const _0x10cb1b=a45_0x523f,_0x386fb7=_0x4ecc97();while(!![]){try{const _0x34eba2=parseInt(_0x10cb1b(0x11a))/0x1*(-parseInt(_0x10cb1b(0x110))/0x2)+parseInt(_0x10cb1b(0x132))/0x3+parseInt(_0x10cb1b(0x109))/0x4+-parseInt(_0x10cb1b(0x12e))/0x5*(parseInt(_0x10cb1b(0x10b))/0x6)+parseInt(_0x10cb1b(0x126))/0x7*(parseInt(_0x10cb1b(0x111))/0x8)+-parseInt(_0x10cb1b(0x134))/0x9+parseInt(_0x10cb1b(0x133))/0xa*(parseInt(_0x10cb1b(0x11b))/0xb);if(_0x34eba2===_0x3fc96c)break;else _0x386fb7['push'](_0x386fb7['shift']());}catch(_0x5b58af){_0x386fb7['push'](_0x386fb7['shift']());}}}(a45_0x2950,0x530d2));function a45_0x2950(){const _0x26d829=['length','516069qezyio','1877370PLquIn','5362920opSqxl','map','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','global','926264VAcpTZ','appCode','1018914wpBbez','removed','action','push','../../../core/api-client.js','4hAgRDw','56Qmvjxm','install','filter','bool','authRequired','project','includes','reduce','skillCode','206964Uwupmx','44TrZfsX','accessKey','str','read','Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.','code','version','unchanged','updated','created','Installed\x20','535087kjSDXp','production','../../../skills/runtime-skill-sync.js','all','scope','trim','\x20personal\x20and\x20','flatMap','10xMjfEg','company','personal'];a45_0x2950=function(){return _0x26d829;};return a45_0x2950();}import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':'skill','command':a45_0x52a54b(0x112),'description':a45_0x52a54b(0x107),'risk':a45_0x52a54b(0x11e),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x5c012e){return syncRuntimeSkills(_0x5c012e);}};async function syncRuntimeSkills(_0x3df612){const _0x38e807=a45_0x52a54b,{downloadRuntimeSkillPackage:_0x3316c8,listRuntimeSkills:_0x2ffab7}=await import(_0x38e807(0x10f)),{linkEffectiveRuntimeSkills:_0xe9c227,materializeRuntimeSkill:_0x53880c,pruneStaleRuntimeSkillCache:_0x32076a,pruneStaleRuntimeSkillLinks:_0x4cbdf7,resolveRuntimeSkillInstallTarget:_0x289b80}=await import(_0x38e807(0x128)),_0x14f790=_0x3df612[_0x38e807(0x11d)](_0x38e807(0x120)),_0x32ab26=normalizeSyncScopes(_0x3df612[_0x38e807(0x11d)](_0x38e807(0x12a))),_0x4085a9=_0x3df612['envName']??_0x38e807(0x127),_0x3951a3=_0x3df612[_0x38e807(0x11c)],_0x2f2aa5=_0x3df612[_0x38e807(0x114)]('force');if(!_0x3951a3)throw CliErrors[_0x38e807(0x115)](_0x38e807(0x11f));const _0x55206e=_0x289b80(_0x3df612[_0x38e807(0x10a)],_0x3df612['bool'](_0x38e807(0x116))?_0x38e807(0x116):'global'),_0x461a35=_0x289b80(_0x3df612['appCode'],_0x55206e[_0x38e807(0x12a)]===_0x38e807(0x116)?_0x38e807(0x108):'project'),_0x313da8=await Promise[_0x38e807(0x129)](_0x32ab26[_0x38e807(0x135)](_0x3653a9=>_0x2ffab7({'appCode':_0x3df612[_0x38e807(0x10a)],'scope':_0x3653a9,'code':_0x14f790['trim']()||undefined}))),_0x274672=_0x32ab26[_0x38e807(0x117)]('personal')?_0x313da8['flatMap']((_0xd00be5,_0x1a79a5)=>_0x32ab26[_0x1a79a5]===_0x38e807(0x130)?_0xd00be5[_0x38e807(0x130)]:[]):[],_0x35a37f=_0x32ab26['includes'](_0x38e807(0x12f))?_0x313da8[_0x38e807(0x12d)]((_0x53cd9b,_0x287704)=>_0x32ab26[_0x287704]===_0x38e807(0x12f)?_0x53cd9b[_0x38e807(0x12f)]:[]):[],_0x1f23d8=new Set([..._0x274672['map'](_0x35cd34=>_0x35cd34['skillCode']?.[_0x38e807(0x12b)]())[_0x38e807(0x113)](_0x532e6f=>Boolean(_0x532e6f)),..._0x35a37f[_0x38e807(0x135)](_0x34639b=>_0x34639b[_0x38e807(0x119)]?.[_0x38e807(0x12b)]())[_0x38e807(0x113)](_0x3a06ee=>Boolean(_0x3a06ee))]),_0x1c3c1b=_0x14f790[_0x38e807(0x12b)]()?[_0x14f790['trim']()]:undefined,_0x176c7b=_0x32ab26[_0x38e807(0x131)]===0x2&&_0x32ab26['includes']('personal')&&_0x32ab26[_0x38e807(0x117)]('company'),_0x56756f=_0x176c7b?_0x4cbdf7(_0x55206e,_0x1f23d8,_0x1c3c1b):[],_0x201bc6=_0x32076a({'env':_0x4085a9,'accessKey':_0x3951a3,'appCode':_0x3df612[_0x38e807(0x10a)],'activeSkillCodes':_0x1f23d8,'pruneSkillCodes':_0x1c3c1b,'scopes':_0x32ab26,'protectedLinkRoots':_0x461a35['skillRoots']}),_0x44634a=[];for(const _0x3be3c0 of _0x274672){_0x44634a[_0x38e807(0x10e)](_0x53880c(_0x3be3c0,_0x38e807(0x130),{'env':_0x4085a9,'accessKey':_0x3951a3,'appCode':_0x3df612[_0x38e807(0x10a)],'force':_0x2f2aa5,'packageBytes':await downloadSkillPackage(_0x3be3c0,_0x38e807(0x130),_0x3df612[_0x38e807(0x10a)],_0x3316c8)}));}for(const _0x1dffdc of _0x35a37f){_0x44634a[_0x38e807(0x10e)](_0x53880c(_0x1dffdc,'company',{'env':_0x4085a9,'accessKey':_0x3951a3,'appCode':_0x3df612[_0x38e807(0x10a)],'force':_0x2f2aa5,'packageBytes':await downloadSkillPackage(_0x1dffdc,_0x38e807(0x12f),_0x3df612[_0x38e807(0x10a)],_0x3316c8)}));}const _0x368dae=_0xe9c227(_0x44634a,_0x55206e),_0x1b2678=countLinkActions(_0x368dae);return{'ok':!![],'data':{'appCode':_0x3df612[_0x38e807(0x10a)],..._0x55206e[_0x38e807(0x12a)]===_0x38e807(0x116)?{'installTarget':{'scope':_0x55206e[_0x38e807(0x12a)],'skillRoots':[..._0x55206e['skillRoots']]}}:{},'personal':_0x274672['length'],'company':_0x35a37f['length'],'materialized':_0x44634a[_0x38e807(0x131)],'links':{'total':_0x368dae[_0x38e807(0x131)],'created':_0x1b2678[_0x38e807(0x124)]??0x0,'updated':_0x1b2678[_0x38e807(0x123)]??0x0,'unchanged':_0x1b2678[_0x38e807(0x122)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x56756f[_0x38e807(0x113)](_0x13258c=>_0x13258c['action']===_0x38e807(0x10c))['length'],'cacheDirs':_0x201bc6['filter'](_0x41f3fe=>_0x41f3fe[_0x38e807(0x10d)]===_0x38e807(0x10c))['length'],'skipped':[..._0x56756f,..._0x201bc6][_0x38e807(0x113)](_0x400403=>_0x400403[_0x38e807(0x10d)]==='skipped')[_0x38e807(0x131)]},'skills':{'personal':_0x274672[_0x38e807(0x135)](summarizeRuntimeSkill),'company':_0x35a37f[_0x38e807(0x135)](summarizeRuntimeSkill)}},'message':_0x38e807(0x125)+_0x274672[_0x38e807(0x131)]+_0x38e807(0x12c)+_0x35a37f['length']+'\x20company\x20Skill(s).'};}async function downloadSkillPackage(_0x125c47,_0x5c0155,_0xd1e255,_0x3b5d48){const _0xd4156b=a45_0x52a54b,_0x10a43d=_0x125c47[_0xd4156b(0x121)]?.[_0xd4156b(0x12b)]();return _0x10a43d?_0x3b5d48(_0x5c0155,_0x125c47[_0xd4156b(0x119)],_0xd1e255,_0x10a43d):_0x3b5d48(_0x5c0155,_0x125c47[_0xd4156b(0x119)],_0xd1e255);}function a45_0x523f(_0x4da82e,_0x3af7e2){_0x4da82e=_0x4da82e-0x107;const _0x295008=a45_0x2950();let _0x523fd5=_0x295008[_0x4da82e];return _0x523fd5;}function countLinkActions(_0x4cc784){const _0x334c95=a45_0x52a54b;return _0x4cc784[_0x334c95(0x118)]((_0x4f5a58,_0x3fcc73)=>{const _0x1a4185=_0x334c95;return _0x4f5a58[_0x3fcc73['action']]=(_0x4f5a58[_0x3fcc73[_0x1a4185(0x10d)]]??0x0)+0x1,_0x4f5a58;},{});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x1284f2=a46_0x344d;function a46_0x32e9(){const _0x21a801=['authRequired','builtin','length','production','read','remote','list','243kdJARK','3641ksZqGW','bool','company','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','../../../core/api-client.js','code','10wEZSje','Listed\x20','3155iGbfFD','local','6002563BlXPLG','scope','skill','appCode','\x20remote\x20Skill(s).','25000WYWaaC','53047RSocEk','2376228IQgpXc','1313152CqzkpH','trim','str','project','280408ZnFMFr','map','filter','personal','1002NKoYeE'];a46_0x32e9=function(){return _0x21a801;};return a46_0x32e9();}(function(_0x43554a,_0x417f1d){const _0x28c25d=a46_0x344d,_0x245f85=_0x43554a();while(!![]){try{const _0x2f6c55=-parseInt(_0x28c25d(0x6b))/0x1*(-parseInt(_0x28c25d(0x84))/0x2)+parseInt(_0x28c25d(0x6c))/0x3+parseInt(_0x28c25d(0x6d))/0x4+parseInt(_0x28c25d(0x86))/0x5*(parseInt(_0x28c25d(0x75))/0x6)+parseInt(_0x28c25d(0x88))/0x7+-parseInt(_0x28c25d(0x71))/0x8*(parseInt(_0x28c25d(0x7d))/0x9)+parseInt(_0x28c25d(0x6a))/0xa*(-parseInt(_0x28c25d(0x7e))/0xb);if(_0x2f6c55===_0x417f1d)break;else _0x245f85['push'](_0x245f85['shift']());}catch(_0x350154){_0x245f85['push'](_0x245f85['shift']());}}}(a46_0x32e9,0x8c490));import{CliErrors}from'../../../errors.js';function a46_0x344d(_0x2cfd1a,_0x3aad92){_0x2cfd1a=_0x2cfd1a-0x66;const _0x32e9dd=a46_0x32e9();let _0x344dbe=_0x32e9dd[_0x2cfd1a];return _0x344dbe;}import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':a46_0x1284f2(0x67),'command':a46_0x1284f2(0x7c),'description':a46_0x1284f2(0x81),'risk':a46_0x1284f2(0x7a),'flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x444c21){const _0xc35df1=a46_0x1284f2,_0x4ab9ad=_0x444c21[_0xc35df1(0x6f)](_0xc35df1(0x83)),_0x53ad12=normalizeListScope(_0x444c21[_0xc35df1(0x6f)](_0xc35df1(0x66)));if(_0x444c21[_0xc35df1(0x7f)](_0xc35df1(0x87))){const _0x15bc81=_0x444c21['accessKey'];if(!_0x15bc81)throw CliErrors[_0xc35df1(0x76)]();const {listLocalRuntimeSkills:_0xa62e03,resolveRuntimeSkillInstallTarget:_0x46f009}=await import('../../../skills/runtime-skill-sync.js'),_0x3de18c=_0x46f009(_0x444c21[_0xc35df1(0x68)],_0x444c21[_0xc35df1(0x7f)](_0xc35df1(0x70))?_0xc35df1(0x70):'global'),_0x5000f8=_0xa62e03({'env':_0x444c21['envName']??_0xc35df1(0x79),'accessKey':_0x15bc81,'appCode':_0x444c21[_0xc35df1(0x68)],'scopes':listScopeToRuntimeScopes(_0x53ad12),'code':_0x4ab9ad[_0xc35df1(0x6e)]()||undefined},_0x3de18c),_0x31079e=groupLocalRuntimeSkills(_0x5000f8);return{'ok':!![],'data':{'appCode':_0x444c21[_0xc35df1(0x68)],'source':_0xc35df1(0x87),..._0x3de18c[_0xc35df1(0x66)]===_0xc35df1(0x70)?{'installScope':_0x3de18c[_0xc35df1(0x66)]}:{},'scope':_0x53ad12,'total':_0x5000f8[_0xc35df1(0x78)],'personal':_0x31079e['personal'][_0xc35df1(0x78)],'company':_0x31079e['company']['length'],'items':_0x5000f8['map'](summarizeLocalRuntimeSkill),'skills':{'personal':_0x31079e[_0xc35df1(0x74)][_0xc35df1(0x72)](summarizeLocalRuntimeSkill),'company':_0x31079e[_0xc35df1(0x80)][_0xc35df1(0x72)](summarizeLocalRuntimeSkill)}},'message':_0xc35df1(0x85)+_0x5000f8['length']+'\x20local\x20Skill(s).'};}const {listRuntimeSkills:_0x3b95f8}=await import(_0xc35df1(0x82)),_0x32aa88=await _0x3b95f8({'appCode':_0x444c21[_0xc35df1(0x68)],'scope':listScopeToRemoteScope(_0x53ad12),'code':_0x4ab9ad[_0xc35df1(0x6e)]()||undefined}),_0x485a0d=shouldListScope(_0x53ad12,_0xc35df1(0x74))?_0x32aa88['personal']??[]:[],_0x507e7d=shouldListScope(_0x53ad12,'company')?_0x32aa88['company']??[]:[],_0x4b9ece=[..._0x485a0d,..._0x507e7d];return{'ok':!![],'data':{'appCode':_0x444c21[_0xc35df1(0x68)],'source':_0xc35df1(0x7b),'scope':_0x53ad12,'total':_0x4b9ece[_0xc35df1(0x78)],'personal':_0x485a0d[_0xc35df1(0x78)],'company':_0x507e7d['length'],'items':_0x4b9ece['map'](summarizeRuntimeSkill),'skills':{'personal':_0x485a0d[_0xc35df1(0x72)](summarizeRuntimeSkill),'company':_0x507e7d[_0xc35df1(0x72)](summarizeRuntimeSkill)}},'message':_0xc35df1(0x85)+_0x4b9ece['length']+_0xc35df1(0x69)};}};function groupLocalRuntimeSkills(_0x22d1e9){const _0x271a29=a46_0x1284f2;return{'personal':_0x22d1e9[_0x271a29(0x73)](_0x12566b=>_0x12566b[_0x271a29(0x66)]==='personal'),'company':_0x22d1e9[_0x271a29(0x73)](_0x16ccca=>_0x16ccca[_0x271a29(0x66)]===_0x271a29(0x80)),'builtin':_0x22d1e9[_0x271a29(0x73)](_0x2ba573=>_0x2ba573[_0x271a29(0x66)]===_0x271a29(0x77))};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a47_0x2fbdaf=a47_0x742c;(function(_0x184467,_0x3e1db1){const _0x5631d1=a47_0x742c,_0xb12ebc=_0x184467();while(!![]){try{const _0x33d239=parseInt(_0x5631d1(0x149))/0x1*(parseInt(_0x5631d1(0x13b))/0x2)+-parseInt(_0x5631d1(0x140))/0x3+parseInt(_0x5631d1(0x145))/0x4+-parseInt(_0x5631d1(0x13f))/0x5*(parseInt(_0x5631d1(0x143))/0x6)+parseInt(_0x5631d1(0x144))/0x7*(parseInt(_0x5631d1(0x13e))/0x8)+-parseInt(_0x5631d1(0x146))/0x9+parseInt(_0x5631d1(0x141))/0xa;if(_0x33d239===_0x3e1db1)break;else _0xb12ebc['push'](_0xb12ebc['shift']());}catch(_0x96503e){_0xb12ebc['push'](_0xb12ebc['shift']());}}}(a47_0x138e,0x339fa));import{CONFIRM_WARNINGS_FLAG,DIAGRAM_FILE_FLAG,DIR_FLAG,PUSH_SCOPE_FLAG}from'../flags.js';import{skillPushDryRun,skillPushExecute}from'../push-execute.js';function a47_0x138e(){const _0x4abfd3=['451852nZNgnD','2502180wWafdX','将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','skill','1778AEqHGF','116EavJou','将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','write','1632056JHAyJW','1680910KVdsjF','849012ZnfEAj','4845550cswEVx','push','6GAKIso','14eByulu'];a47_0x138e=function(){return _0x4abfd3;};return a47_0x138e();}function a47_0x742c(_0x1f35ae,_0x211175){_0x1f35ae=_0x1f35ae-0x13b;const _0x138e6d=a47_0x138e();let _0x742c08=_0x138e6d[_0x1f35ae];return _0x742c08;}export const pushCommand={'service':a47_0x2fbdaf(0x148),'command':a47_0x2fbdaf(0x142),'description':a47_0x2fbdaf(0x13c),'risk':a47_0x2fbdaf(0x13d),'confirmationDescription':a47_0x2fbdaf(0x147),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a48_0x1b4028=a48_0x3e4c;function a48_0x2635(){const _0x5eaf77=['1242180rdsrGa','type','10614PHbdOK','errors','validate','1409426VGKTRE','dir','warnings','9djcYdm','bool','16omgICg','read','Skill\x20validation\x20passed.','956544YpUZne','1475JqjdrK','Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','1308223LMqPkB','811506LFDvqf','10834730haEcmI','str'];a48_0x2635=function(){return _0x5eaf77;};return a48_0x2635();}(function(_0x4a5968,_0x3b733c){const _0x30ed05=a48_0x3e4c,_0x4e36af=_0x4a5968();while(!![]){try{const _0x45b5d5=parseInt(_0x30ed05(0x1c9))/0x1+parseInt(_0x30ed05(0x1d1))/0x2+-parseInt(_0x30ed05(0x1cc))/0x3+parseInt(_0x30ed05(0x1d9))/0x4+parseInt(_0x30ed05(0x1c6))/0x5*(parseInt(_0x30ed05(0x1ce))/0x6)+-parseInt(_0x30ed05(0x1c8))/0x7*(parseInt(_0x30ed05(0x1d6))/0x8)+parseInt(_0x30ed05(0x1d4))/0x9*(-parseInt(_0x30ed05(0x1ca))/0xa);if(_0x45b5d5===_0x3b733c)break;else _0x4e36af['push'](_0x4e36af['shift']());}catch(_0x5a3a79){_0x4e36af['push'](_0x4e36af['shift']());}}}(a48_0x2635,0x6318b));import{DIR_FLAG,STRICT_FLAG}from'../flags.js';function a48_0x3e4c(_0x11274b,_0x36bf47){_0x11274b=_0x11274b-0x1c6;const _0x263552=a48_0x2635();let _0x3e4c94=_0x263552[_0x11274b];return _0x3e4c94;}import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';export const validateCommand={'service':'skill','command':a48_0x1b4028(0x1d0),'description':a48_0x1b4028(0x1c7),'risk':a48_0x1b4028(0x1d7),'requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x26ac52){const _0x2ebe49=a48_0x1b4028,_0x5a5d1f=_0x26ac52[_0x2ebe49(0x1d5)]('strict'),_0x15893b=validateSkillDirectory(_0x26ac52[_0x2ebe49(0x1cb)](_0x2ebe49(0x1d2)),{'strict':_0x5a5d1f});return throwIfSkillValidationFailed(_0x15893b,_0x5a5d1f),{'ok':!![],'data':{'dir':_0x15893b[_0x2ebe49(0x1d2)],'type':_0x15893b[_0x2ebe49(0x1cd)],'errors':_0x15893b[_0x2ebe49(0x1cf)],'warnings':_0x15893b[_0x2ebe49(0x1d3)]},'message':_0x2ebe49(0x1d8)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0x4b3ad7,_0x71cf88){const _0x571e96=a49_0x3647,_0xd6a2c8=_0x4b3ad7();while(!![]){try{const _0x40a2a4=-parseInt(_0x571e96(0x82))/0x1+-parseInt(_0x571e96(0x8f))/0x2+parseInt(_0x571e96(0x84))/0x3+-parseInt(_0x571e96(0x80))/0x4+-parseInt(_0x571e96(0x81))/0x5*(-parseInt(_0x571e96(0x86))/0x6)+-parseInt(_0x571e96(0x83))/0x7*(parseInt(_0x571e96(0x85))/0x8)+-parseInt(_0x571e96(0x87))/0x9*(-parseInt(_0x571e96(0x89))/0xa);if(_0x40a2a4===_0x71cf88)break;else _0xd6a2c8['push'](_0xd6a2c8['shift']());}catch(_0x5330dd){_0xd6a2c8['push'](_0xd6a2c8['shift']());}}}(a49_0x24ac,0x1acfc));function a49_0x3647(_0x3ac576,_0x5210f0){_0x3ac576=_0x3ac576-0x78;const _0x24ac38=a49_0x24ac();let _0x364762=_0x24ac38[_0x3ac576];return _0x364762;}function a49_0x24ac(){const _0x4bbf20=['8ricDOz','117438DJmLcR','680904mCVYNm','--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.','40kDHUMZ','replace','utf8','trim','Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','diagram','51402WwQakc','defineProperties','Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.','isFile','parse','mermaid','window','default','Mermaid\x20flowchart\x20file\x20not\x20found:\x20','Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.','document','Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.','validation','623056uEiaWg','5WBaRuA','111659aLiCuY','720482WcRlYZ','551019gznfyj'];a49_0x24ac=function(){return _0x4bbf20;};return a49_0x24ac();}import{existsSync,readFileSync,realpathSync,statSync}from'node:fs';import{resolve}from'node:path';import{JSDOM}from'jsdom';import{CliErrors}from'../../errors.js';let mermaidApiPromise;export async function readRequiredSkillDiagram(_0x408bc3){const _0x8bd932=a49_0x3647;return(await readRequiredSkillDiagramInput(_0x408bc3))[_0x8bd932(0x8e)];}export async function readRequiredSkillDiagramInput(_0xddb575){const _0xd2291a=a49_0x3647,_0x19e3fe=_0xddb575[_0xd2291a(0x8c)]();if(!_0x19e3fe)throw CliErrors[_0xd2291a(0x7f)](_0xd2291a(0x88),_0xd2291a(0x7c));let _0x395d63,_0x242813;if(_0x19e3fe==='-')try{_0x395d63=readFileSync(0x0,_0xd2291a(0x8b));}catch{throw CliErrors[_0xd2291a(0x7f)](_0xd2291a(0x91));}else{const _0x58859c=resolve(_0x19e3fe);if(!existsSync(_0x58859c))throw CliErrors[_0xd2291a(0x7f)](_0xd2291a(0x7b)+_0x58859c);if(!statSync(_0x58859c)[_0xd2291a(0x92)]())throw CliErrors[_0xd2291a(0x7f)](_0xd2291a(0x8d)+_0x58859c);_0x242813=realpathSync(_0x58859c),_0x395d63=readFileSync(_0x242813,_0xd2291a(0x8b));}return{'diagram':{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x395d63)},'sourceFilePath':_0x242813};}export async function validateAndCanonicalizeMermaid(_0x5eb15d){const _0x37a665=a49_0x3647,_0x35ecfc=_0x5eb15d[_0x37a665(0x8a)](/\r\n/g,'\x0a')[_0x37a665(0x8a)](/\r/g,'\x0a')[_0x37a665(0x8a)](/\n+$/,'')+'\x0a';try{const _0xf498b4=await loadMermaidApi();await _0xf498b4[_0x37a665(0x93)](_0x35ecfc);}catch{throw diagramValidationError();}return _0x35ecfc;}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x312524=a49_0x3647;if(!(_0x312524(0x79)in globalThis)||!(_0x312524(0x7d)in globalThis)){const _0x4aa0d1=new JSDOM('');Object[_0x312524(0x90)](globalThis,{'window':{'configurable':!![],'value':_0x4aa0d1[_0x312524(0x79)]},'document':{'configurable':!![],'value':_0x4aa0d1['window']['document']}});}return(await import(_0x312524(0x78)))[_0x312524(0x7a)];})()),mermaidApiPromise;}function diagramValidationError(){const _0x29e3ab=a49_0x3647;return CliErrors[_0x29e3ab(0x7f)]('Mermaid\x20syntax\x20validation\x20failed.',_0x29e3ab(0x7e));}
|