@lovrabet/lovrabet-cli 2.2.3-beta.1 → 2.2.3
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(_0x37aaeb,_0x4193c2){const _0xcbd582=a39_0x4052,_0x331b44=_0x37aaeb();while(!![]){try{const _0xd5f61d=-parseInt(_0xcbd582(0x72))/0x1*(-parseInt(_0xcbd582(0xb2))/0x2)+-parseInt(_0xcbd582(0xa8))/0x3+parseInt(_0xcbd582(0x71))/0x4*(parseInt(_0xcbd582(0xba))/0x5)+-parseInt(_0xcbd582(0xc7))/0x6*(parseInt(_0xcbd582(0xa4))/0x7)+-parseInt(_0xcbd582(0x95))/0x8*(parseInt(_0xcbd582(0x8f))/0x9)+parseInt(_0xcbd582(0xb6))/0xa+parseInt(_0xcbd582(0xb4))/0xb;if(_0xd5f61d===_0x4193c2)break;else _0x331b44['push'](_0x331b44['shift']());}catch(_0x106a68){_0x331b44['push'](_0x331b44['shift']());}}}(a39_0x29c3,0x83389));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(_0xe3efa7,_0x1ed0a1){const _0x480b65=a39_0x4052,_0x4ada93=listLocalServiceTrees();let _0x4f21df;for(const _0x253cac of _0x4ada93){const _0x4070dd=matchServiceTreeCommand(_0x253cac,_0xe3efa7);if(!_0x4070dd)continue;(!_0x4f21df||_0x4070dd['command'][_0x480b65(0x6d)][_0x480b65(0xca)]>_0x4f21df[_0x480b65(0xc0)][_0x480b65(0x6d)]['length'])&&(_0x4f21df={'tree':_0x253cac,'command':_0x4070dd[_0x480b65(0xc0)],'remainingArgs':_0x4070dd[_0x480b65(0xa3)]});}if(!_0x4f21df)return undefined;const _0x4664a6={..._0x1ed0a1};return applyAppBinding(_0x4f21df[_0x480b65(0xb7)],_0x4f21df[_0x480b65(0xc0)],_0x4664a6),{'definition':buildDynamicCommandDefinition(_0x4f21df[_0x480b65(0xb7)],_0x4f21df[_0x480b65(0xc0)]),'args':_0x4f21df['remainingArgs'],'flags':_0x4664a6,'tree':_0x4f21df[_0x480b65(0xb7)],'command':_0x4f21df[_0x480b65(0xc0)]};}export function generateDynamicServiceHelp(_0x5eba03){const _0x459455=a39_0x4052,_0x21778c=listLocalServiceTrees()['find'](_0x20be7b=>_0x20be7b[_0x459455(0x69)][_0x459455(0x90)]===_0x5eba03);if(!_0x21778c)return undefined;const _0x23efec=[CLI_BIN_NAME+'\x20'+_0x5eba03+'\x20<command>\x20[flags]','',_0x21778c['service'][_0x459455(0xac)]||_0x5eba03,_0x21778c[_0x459455(0x69)]['description']?'\x20\x20'+_0x21778c['service'][_0x459455(0x7a)]:'','',_0x459455(0x88),..._0x21778c[_0x459455(0x96)][_0x459455(0xb5)](_0x23de4f=>{const _0x27ed25=_0x459455,_0x47030c=_0x23de4f[_0x27ed25(0x6d)][_0x27ed25(0x84)](0x1)[_0x27ed25(0xc8)]('\x20'),_0x40f678=_0x23de4f[_0x27ed25(0x83)]==='read'?'':'\x20['+_0x23de4f['risk']+']';return'\x20\x20'+_0x47030c[_0x27ed25(0x82)](0x18)+'\x20'+(_0x23de4f[_0x27ed25(0x7a)]||'')+_0x40f678;}),'',_0x459455(0x7e)+CLI_BIN_NAME+_0x459455(0xaa)+_0x5eba03+_0x459455(0x6e)]['filter'](Boolean);return _0x23efec['join']('\x0a');}export function listDynamicServiceEntries(){const _0xdfbbe=a39_0x4052;return listLocalServices()[_0xdfbbe(0xb5)](_0x2c7d3a=>{const _0x5026c0=_0xdfbbe,_0x54ff49=_0x2c7d3a['normalizedManifest'];return{'service':_0x54ff49[_0x5026c0(0x69)][_0x5026c0(0x90)],'label':_0x54ff49[_0x5026c0(0x69)][_0x5026c0(0xac)]||_0x54ff49[_0x5026c0(0x69)][_0x5026c0(0x90)],'commands':_0x54ff49[_0x5026c0(0x96)][_0x5026c0(0xb5)](_0x19ccf9=>({'command':dynamicCommandName(_0x19ccf9),'description':_0x19ccf9['description']||_0x5026c0(0x99)+_0x19ccf9[_0x5026c0(0x77)],'tag':riskTag(_0x19ccf9['risk'])}))};});}export function getDynamicServiceEntry(_0x4bfe04){return listDynamicServiceEntries()['find'](_0x5891e0=>_0x5891e0['service']===_0x4bfe04);}export function listDynamicServiceDefinitions(_0x5ae29e){const _0x351015=a39_0x4052;return listLocalServiceTrees()[_0x351015(0xcc)](_0xfc47b4=>!_0x5ae29e||_0xfc47b4['service']['code']===_0x5ae29e)[_0x351015(0xa7)](_0x5ce291=>_0x5ce291['commands'][_0x351015(0xb5)](_0x5c20e5=>buildDynamicCommandDefinition(_0x5ce291,_0x5c20e5)));}export function getDynamicServiceDefinitions(_0x1e8fe){const _0x3f638c=a39_0x4052,_0x46eeff=listDynamicServiceDefinitions(_0x1e8fe);return _0x46eeff[_0x3f638c(0xca)]>0x0?_0x46eeff:undefined;}function a39_0x4052(_0x166f4e,_0x58ee78){_0x166f4e=_0x166f4e-0x66;const _0x29c35d=a39_0x29c3();let _0x405273=_0x29c35d[_0x166f4e];return _0x405273;}export function findDynamicServiceDefinition(_0xf74e61,_0x4882bc){const _0x5a9996=a39_0x4052;return listDynamicServiceDefinitions(_0xf74e61)[_0x5a9996(0x91)](_0x3c1df0=>_0x3c1df0[_0x5a9996(0xc0)]===_0x4882bc);}export function buildDynamicCommandDefinition(_0xd199ca,_0x512749){const _0xaa5527=a39_0x4052;return{'service':_0xd199ca[_0xaa5527(0x69)][_0xaa5527(0x90)],'command':dynamicCommandName(_0x512749),'description':_0x512749[_0xaa5527(0x7a)]||_0xaa5527(0x99)+_0x512749[_0xaa5527(0x77)],'risk':_0x512749[_0xaa5527(0x83)],..._0x512749['risk']===_0xaa5527(0xb8)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x512749)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x512749['args'][_0xaa5527(0xb5)](_0x231740=>({'name':_0x231740[_0xaa5527(0xac)],'description':_0x231740[_0xaa5527(0x7a)]||_0x231740[_0xaa5527(0xac)],'required':_0x231740[_0xaa5527(0x87)]})),'flags':_0x512749[_0xaa5527(0x6c)][_0xaa5527(0xb5)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x512749),async 'dryRun'(_0xf3db4a){const _0x33573c=_0xaa5527,_0x4aa784=await compilePlan(_0x512749,_0xf3db4a);return{'method':_0x33573c(0x70),'url':_0x512749['cliPath'],'body':{'target':targetPreview(_0x4aa784),'params':_0x4aa784[_0x33573c(0xc1)]},'description':'Preview\x20dynamic\x20service\x20command:\x20'+_0x512749[_0x33573c(0x77)]};},async 'execute'(_0x34cdf8){const _0x35244d=_0xaa5527,_0x577a4e=await compilePlan(_0x512749,_0x34cdf8),_0x3832fb=Date[_0x35244d(0xb0)](),_0x11d8a0=await executePlan(_0x577a4e,_0x512749,_0x34cdf8),_0x2bc867=Date[_0x35244d(0xb0)]()-_0x3832fb;return{'ok':!![],'data':{'service':_0xd199ca[_0x35244d(0x69)],'command':_0x512749[_0x35244d(0x77)],'target':targetPreview(_0x577a4e),'result':_0x11d8a0,'elapsed':_0x2bc867},'message':'Service\x20command\x20'+_0x512749[_0x35244d(0x77)]+_0x35244d(0x7b)+_0x2bc867+'ms'};}};}function buildDynamicConfirmationDescription(_0x5e1861){const _0x132268=a39_0x4052,_0x22ed6f=_0x5e1861[_0x132268(0x7a)]||_0x5e1861[_0x132268(0x77)],_0x470572=_0x5e1861[_0x132268(0x83)]===_0x132268(0x6b)?_0x132268(0x74):'该命令被清单标记为写入,可能修改业务数据或服务状态。';return'将通过\x20Service\x20Tree\x20执行“'+_0x22ed6f+'”。'+_0x470572;}function dynamicCommandName(_0x37b1c0){const _0x22f402=a39_0x4052;return _0x37b1c0[_0x22f402(0x6d)][_0x22f402(0x84)](0x1)[_0x22f402(0xc8)]('\x20');}function riskTag(_0x23b56b){const _0x253cd6=a39_0x4052;return _0x23b56b===_0x253cd6(0xb8)?'':'\x20\x20['+_0x23b56b+']';}function flagToCommandFlag(_0x3a8088){const _0x20f153=a39_0x4052;return{'name':_0x3a8088[_0x20f153(0x98)],'type':_0x3a8088[_0x20f153(0x81)]==='json'?'string':_0x3a8088[_0x20f153(0x81)],'description':_0x3a8088[_0x20f153(0x7a)]||_0x3a8088[_0x20f153(0xac)],'required':_0x3a8088['required'],'default':isPrimitiveFlagDefault(_0x3a8088[_0x20f153(0xa9)])?_0x3a8088[_0x20f153(0xa9)]:undefined,'enum':_0x3a8088[_0x20f153(0xc6)]};}async function compilePlan(_0x345381,_0x63b04a){const _0x3b108e=a39_0x4052;return compileServiceTreeCommand(_0x345381,{'flags':_0x63b04a[_0x3b108e(0x85)],'args':_0x63b04a[_0x3b108e(0x9b)],'context':await buildServiceContext(_0x345381,_0x63b04a)});}async function buildServiceContext(_0x3bdb18,_0x10d2ce){const _0x1e7979=a39_0x4052,_0x4eca91={'appCode':_0x10d2ce['appCode'],'env':_0x10d2ce[_0x1e7979(0xc3)],'envName':_0x10d2ce[_0x1e7979(0xc3)]};if(!usesRuntimeContext(_0x3bdb18))return _0x4eca91;const _0x31152e=await getLoginUserInfo(),_0x7b7d7b=pickFirst(_0x31152e[_0x1e7979(0x7f)],_0x31152e['id']);return{..._0x4eca91,'user':_0x31152e,'userId':_0x7b7d7b,'id':_0x31152e['id'],'username':pickFirst(_0x31152e[_0x1e7979(0x66)],_0x31152e['userName'],_0x31152e[_0x1e7979(0x7c)]),'userName':_0x31152e[_0x1e7979(0xb9)],'nickname':pickFirst(_0x31152e[_0x1e7979(0x8c)],_0x31152e['nickName']),'nickName':_0x31152e[_0x1e7979(0xa1)],'tenantCode':_0x31152e[_0x1e7979(0x68)],'employeeId':_0x31152e['employeeId']};}function usesRuntimeContext(_0x4de98c){const _0x577c50=a39_0x4052;return _0x4de98c[_0x577c50(0x7d)][_0x577c50(0x73)](_0x538302=>typeof _0x538302['source']==='string'&&(_0x538302[_0x577c50(0x92)][_0x577c50(0xad)](_0x577c50(0xc9))||_0x538302[_0x577c50(0x92)][_0x577c50(0xad)](_0x577c50(0x94))));}function pickFirst(..._0x242b6d){return _0x242b6d['find'](_0x148333=>_0x148333!==undefined&&_0x148333!==null);}async function executePlan(_0x3c2d08,_0x4f3bb3,_0x50f99d){const _0x109b6f=a39_0x4052;if(_0x3c2d08[_0x109b6f(0xb1)]===_0x109b6f(0x6a)){const _0x874c9c=await resolveDatasetCode(_0x3c2d08,_0x4f3bb3,_0x50f99d);return executeData(_0x874c9c,_0x3c2d08[_0x109b6f(0xc0)],_0x3c2d08[_0x109b6f(0xc1)]);}if(_0x3c2d08[_0x109b6f(0xb1)]===_0x109b6f(0x79)){if(!_0x3c2d08[_0x109b6f(0x9c)])throw CliErrors[_0x109b6f(0xbb)](_0x109b6f(0x8d)+_0x4f3bb3[_0x109b6f(0x77)]+_0x109b6f(0xbe));return executeSdkSql(_0x3c2d08[_0x109b6f(0x9c)],normalizeScalarParams(_0x3c2d08[_0x109b6f(0xc1)]));}if(_0x3c2d08['kind']===_0x109b6f(0x8a)){const _0x595dd3=_0x3c2d08['scriptName']||_0x3c2d08['bffCode']||(_0x3c2d08[_0x109b6f(0x97)]==null?'':String(_0x3c2d08[_0x109b6f(0x97)]));if(!_0x595dd3)throw CliErrors[_0x109b6f(0xbb)](_0x109b6f(0x8d)+_0x4f3bb3[_0x109b6f(0x77)]+'\x20requires\x20target.functionName.');return executeSdkBff(_0x595dd3,_0x3c2d08[_0x109b6f(0xc1)]);}throw CliErrors[_0x109b6f(0xbb)]('Unsupported\x20service\x20target\x20kind:\x20'+_0x3c2d08[_0x109b6f(0xb1)]);}async function resolveDatasetCode(_0x59246d,_0xdf6447,_0x3ac48f){const _0x3fc9da=a39_0x4052;if(_0x59246d[_0x3fc9da(0x9f)])return _0x59246d[_0x3fc9da(0x9f)];if(!_0x59246d['datatable'])throw CliErrors[_0x3fc9da(0xbb)]('Service\x20command\x20'+_0xdf6447[_0x3fc9da(0x77)]+_0x3fc9da(0x8b));const _0x66293f=await listDatasets(_0x3ac48f[_0x3fc9da(0x75)]),_0xbcaff4=_0x66293f['find'](_0x58dc9d=>_0x58dc9d[_0x3fc9da(0x67)]?.[_0x3fc9da(0xbc)]===_0x59246d[_0x3fc9da(0x76)]);if(!_0xbcaff4?.['code'])throw CliErrors[_0x3fc9da(0xbb)](_0x3fc9da(0xaf)+_0x59246d[_0x3fc9da(0x76)]+_0x3fc9da(0xb3)+_0x3ac48f['appCode']+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0xbcaff4[_0x3fc9da(0x90)];}function a39_0x29c3(){const _0x4d47b4=['trim','enum','1273872NTyjwr','join','context.','length','appBindings','filter','username','dbtableConfig','tenantCode','service','data','high-risk-write','flags','fullPath','`\x20to\x20inspect\x20the\x20manifest.','\x20\x20\x20\x20','SERVICE_TREE','196hGPmgB','58xODLUS','some','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','appCode','datatable','cliPath','\x20\x20\x20\x20command:\x20','sql','description','\x20completed\x20in\x20','loginName','mapTo','Use\x20`','userId','appcode','type','padEnd','risk','slice','rawFlags','bffCode','required','Commands:','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','bff','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','nickname','Service\x20command\x20','\x20\x20\x20\x20datatable:\x20','18WFPNvQ','code','find','source','target','ctx.','3939616fzZMqc','commands','bffId','cliName','Run\x20service\x20command\x20','operator','args','sqlCode','boolean','env','datasetCode','\x20\x20\x20\x20kind:\x20\x20\x20\x20','nickName','\x20->\x20','remainingArgs','28gJBGSG','fromEntries','string','flatMap','2053326HNdAGg','default','\x20service\x20detail\x20--service\x20','Unknown\x20appRef\x20\x22','name','startsWith','\x20\x20\x20\x20functionName:\x20','Cannot\x20resolve\x20datatable\x20\x22','now','kind','19178toeACn','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','15896089XtBAPy','map','9192310jKuoYO','tree','read','userName','13835WLAovs','validation','tableName','\x20\x20\x20\x20datasetCode:\x20','\x20requires\x20target.sqlCode.','app','command','params','\x20\x20MAP\x20TO','envName','push'];a39_0x29c3=function(){return _0x4d47b4;};return a39_0x29c3();}function applyAppBinding(_0x3f7d8c,_0x7c32d3,_0x461567){const _0x581631=a39_0x4052,_0x440920=_0x7c32d3['target']['appRef'];if(!_0x440920)return;const _0x5638d6=_0x3f7d8c[_0x581631(0xcb)][_0x440920];if(!_0x5638d6)throw CliErrors['validation'](_0x581631(0xab)+_0x440920+'\x22\x20in\x20service\x20command\x20'+_0x7c32d3['cliPath']+'.',_0x581631(0x89));const _0x1f7e4b=_0x5638d6[_0x581631(0x80)]||_0x5638d6['appCode'];_0x1f7e4b&&!hasText(_0x461567[_0x581631(0x80)])&&(_0x461567[_0x581631(0x80)]=_0x1f7e4b),_0x5638d6[_0x581631(0xbf)]&&!hasText(_0x461567[_0x581631(0xbf)])&&!hasText(_0x461567[_0x581631(0x80)])&&(_0x461567[_0x581631(0xbf)]=_0x5638d6[_0x581631(0xbf)]),_0x5638d6[_0x581631(0x9e)]&&!hasText(_0x461567['env'])&&(_0x461567['env']=_0x5638d6[_0x581631(0x9e)]);}function renderDynamicCommandHelp(_0x433a6d){const _0x1c3404=a39_0x4052,_0x2b15f5=['\x20\x20SERVICE\x20TREE\x20TARGET',_0x1c3404(0xa0)+_0x433a6d[_0x1c3404(0x93)][_0x1c3404(0xb1)],_0x1c3404(0x78)+_0x433a6d[_0x1c3404(0x93)]['command']];if(_0x433a6d[_0x1c3404(0x93)][_0x1c3404(0x9f)])_0x2b15f5['push'](_0x1c3404(0xbd)+_0x433a6d['target'][_0x1c3404(0x9f)]);if(_0x433a6d[_0x1c3404(0x93)][_0x1c3404(0x76)])_0x2b15f5[_0x1c3404(0xc4)](_0x1c3404(0x8e)+_0x433a6d[_0x1c3404(0x93)][_0x1c3404(0x76)]);if(_0x433a6d[_0x1c3404(0x93)][_0x1c3404(0x9c)])_0x2b15f5['push']('\x20\x20\x20\x20sqlCode:\x20'+_0x433a6d[_0x1c3404(0x93)][_0x1c3404(0x9c)]);if(_0x433a6d[_0x1c3404(0x93)]['scriptName'])_0x2b15f5[_0x1c3404(0xc4)](_0x1c3404(0xae)+_0x433a6d['target']['scriptName']);if(_0x433a6d[_0x1c3404(0x7d)][_0x1c3404(0xca)]>0x0){_0x2b15f5[_0x1c3404(0xc4)]('',_0x1c3404(0xc2));for(const _0x167e97 of _0x433a6d[_0x1c3404(0x7d)]){_0x2b15f5[_0x1c3404(0xc4)](_0x1c3404(0x6f)+(_0x167e97['source']||'const')+_0x1c3404(0xa2)+_0x167e97[_0x1c3404(0x93)]+(_0x167e97['operator']?'.'+_0x167e97[_0x1c3404(0x9a)]:''));}}return _0x2b15f5[_0x1c3404(0xc8)]('\x0a');}function targetPreview(_0x70d29d){const _0x2494fd=a39_0x4052;return{'kind':_0x70d29d['kind'],'command':_0x70d29d[_0x2494fd(0xc0)],'appRef':_0x70d29d['appRef'],'datasetCode':_0x70d29d[_0x2494fd(0x9f)],'datatable':_0x70d29d['datatable'],'sqlCode':_0x70d29d[_0x2494fd(0x9c)],'bffCode':_0x70d29d[_0x2494fd(0x86)],'bffId':_0x70d29d[_0x2494fd(0x97)],'functionName':_0x70d29d['scriptName']};}function normalizeScalarParams(_0x40697a){const _0x4745f2=a39_0x4052;return Object[_0x4745f2(0xa5)](Object['entries'](_0x40697a)[_0x4745f2(0xcc)](([,_0x24c7e5])=>typeof _0x24c7e5===_0x4745f2(0xa6)||typeof _0x24c7e5==='number'));}function hasText(_0x2cec7a){const _0x57a060=a39_0x4052;return typeof _0x2cec7a===_0x57a060(0xa6)&&_0x2cec7a[_0x57a060(0xc5)]()[_0x57a060(0xca)]>0x0;}function isPrimitiveFlagDefault(_0x4eaf3f){const _0x4027db=a39_0x4052;return _0x4eaf3f===undefined||typeof _0x4eaf3f===_0x4027db(0xa6)||typeof _0x4eaf3f==='number'||typeof _0x4eaf3f===_0x4027db(0x9d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xab03fd,_0x3d6123){const _0x125d59=a40_0x2ca7,_0x2ad205=_0xab03fd();while(!![]){try{const _0x1e8e9d=parseInt(_0x125d59(0xea))/0x1*(-parseInt(_0x125d59(0xf1))/0x2)+-parseInt(_0x125d59(0xe4))/0x3+parseInt(_0x125d59(0xe0))/0x4+parseInt(_0x125d59(0xfe))/0x5*(-parseInt(_0x125d59(0xdd))/0x6)+parseInt(_0x125d59(0xf3))/0x7*(parseInt(_0x125d59(0xdb))/0x8)+-parseInt(_0x125d59(0xfd))/0x9+parseInt(_0x125d59(0xdf))/0xa*(parseInt(_0x125d59(0xe8))/0xb);if(_0x1e8e9d===_0x3d6123)break;else _0x2ad205['push'](_0x2ad205['shift']());}catch(_0xa230b7){_0x2ad205['push'](_0x2ad205['shift']());}}}(a40_0x2e0e,0x91abb));export function adaptServiceTreeManifestForLegacyFramework(_0x16cd28){const _0x334c55=a40_0x2ca7,_0x32fb23=cloneJsonValue(_0x16cd28),_0x40925f=[];if(!isObjectRecord(_0x32fb23))return{'manifest':_0x32fb23,'errors':_0x40925f};return Array[_0x334c55(0xe1)](_0x32fb23[_0x334c55(0xec)])&&_0x32fb23[_0x334c55(0xec)][_0x334c55(0xfa)]((_0x1fedc9,_0x268a5e)=>{const _0x3b49d5=_0x334c55;if(!isObjectRecord(_0x1fedc9))return;adaptBffTarget(_0x1fedc9[_0x3b49d5(0xee)],_0x3b49d5(0xeb)+_0x268a5e+_0x3b49d5(0xf2),_0x40925f);}),adaptResources(_0x32fb23[_0x334c55(0x100)],_0x334c55(0xfc),_0x40925f),{'manifest':_0x32fb23,'errors':_0x40925f};}export function toPublicServiceTreeTarget(_0x3f59a3){const _0x29a922=a40_0x2ca7,{scriptName:_0x37b274,..._0x227009}=_0x3f59a3;return typeof _0x37b274===_0x29a922(0xda)&&_0x37b274[_0x29a922(0xef)]()&&(_0x227009[_0x29a922(0xde)]=_0x37b274),_0x227009;}export function toPublicNormalizedServiceTree(_0x3dc9dc){const _0x453288=a40_0x2ca7;return{..._0x3dc9dc,'commands':_0x3dc9dc[_0x453288(0xec)][_0x453288(0xf6)](_0x3957e9=>({..._0x3957e9,'target':toPublicServiceTreeTarget(_0x3957e9[_0x453288(0xee)])}))};}function adaptResources(_0x1f94a7,_0x4eb14c,_0x540f07){const _0x5cdbb9=a40_0x2ca7;if(!isObjectRecord(_0x1f94a7))return;for(const [_0xf2bbd8,_0x23c321]of Object[_0x5cdbb9(0xe6)](_0x1f94a7)){if(!isObjectRecord(_0x23c321))continue;const _0x32f58b=_0x4eb14c+'.'+_0xf2bbd8;if(isObjectRecord(_0x23c321[_0x5cdbb9(0xe7)]))for(const [_0x1e8298,_0x573d43]of Object[_0x5cdbb9(0xe6)](_0x23c321['actions'])){if(!isObjectRecord(_0x573d43))continue;const _0x5b8008=_0x32f58b+'.actions.'+_0x1e8298,_0x3bc83c=isObjectRecord(_0x573d43[_0x5cdbb9(0xee)])&&_0x573d43[_0x5cdbb9(0xee)][_0x5cdbb9(0xfb)]===_0x5cdbb9(0xf9);adaptBffTarget(_0x573d43[_0x5cdbb9(0xee)],_0x5b8008+_0x5cdbb9(0xf7),_0x540f07),(_0x3bc83c||isBffAction(_0x573d43))&&adaptFunctionNameField(_0x573d43,_0x5b8008,_0x540f07);}adaptResources(_0x23c321[_0x5cdbb9(0x100)],_0x32f58b+'.resources',_0x540f07);}}function adaptBffTarget(_0x13c1cb,_0x10876c,_0x20a778){const _0x21273b=a40_0x2ca7;if(!isObjectRecord(_0x13c1cb)||_0x13c1cb['kind']!==_0x21273b(0xf9))return;adaptFunctionNameField(_0x13c1cb,_0x10876c,_0x20a778);}function a40_0x2e0e(){const _0x283a5f=['error','map','.target','bff.exec','bff','forEach','kind','$.resources','951399dztonI','5TqAPfY','.functionName','resources','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','string','8dHhPit','functionName\x20must\x20be\x20a\x20non-empty\x20string.','4736550NiesTA','functionName','4754830PVDxQn','3244524itwLAB','isArray','scriptName','prototype','598425UjwxWE','call','entries','actions','22FLkHeL','.scriptName','54189gKQimW','$.commands[','commands','push','target','trim','hasOwnProperty','18lKppRt','].target','2918174rHqntt','fromEntries'];a40_0x2e0e=function(){return _0x283a5f;};return a40_0x2e0e();}function adaptFunctionNameField(_0x2b2a54,_0x2f6ecf,_0x3a3cc8){const _0x7f47b1=a40_0x2ca7;Object[_0x7f47b1(0xe3)][_0x7f47b1(0xf0)]['call'](_0x2b2a54,_0x7f47b1(0xe2))&&_0x3a3cc8[_0x7f47b1(0xed)]({'level':_0x7f47b1(0xf5),'path':_0x2f6ecf+_0x7f47b1(0xe9),'message':_0x7f47b1(0x101)});if(Object['prototype'][_0x7f47b1(0xf0)][_0x7f47b1(0xe5)](_0x2b2a54,'functionName')){if(typeof _0x2b2a54[_0x7f47b1(0xde)]!==_0x7f47b1(0xda)||!_0x2b2a54[_0x7f47b1(0xde)][_0x7f47b1(0xef)]()){_0x3a3cc8[_0x7f47b1(0xed)]({'level':_0x7f47b1(0xf5),'path':_0x2f6ecf+_0x7f47b1(0xff),'message':_0x7f47b1(0xdc)}),delete _0x2b2a54[_0x7f47b1(0xde)];return;}_0x2b2a54[_0x7f47b1(0xe2)]=_0x2b2a54[_0x7f47b1(0xde)],delete _0x2b2a54[_0x7f47b1(0xde)];}}function isBffAction(_0x5a8657){const _0x3f7be5=a40_0x2ca7;return _0x5a8657[_0x3f7be5(0xfb)]===_0x3f7be5(0xf9)||_0x5a8657['action']==='bff.exec'||_0x5a8657[_0x3f7be5(0xee)]===_0x3f7be5(0xf8);}function cloneJsonValue(_0x37abbd){const _0x5ed9be=a40_0x2ca7;if(Array[_0x5ed9be(0xe1)](_0x37abbd))return _0x37abbd['map'](_0x50f330=>cloneJsonValue(_0x50f330));if(isObjectRecord(_0x37abbd))return Object[_0x5ed9be(0xf4)](Object[_0x5ed9be(0xe6)](_0x37abbd)['map'](([_0x477c64,_0x2a4ce5])=>[_0x477c64,cloneJsonValue(_0x2a4ce5)]));return _0x37abbd;}function a40_0x2ca7(_0xa96a3,_0x299ef7){_0xa96a3=_0xa96a3-0xda;const _0x2e0e32=a40_0x2e0e();let _0x2ca7ab=_0x2e0e32[_0xa96a3];return _0x2ca7ab;}function isObjectRecord(_0x207d5e){const _0x3e18a6=a40_0x2ca7;return Boolean(_0x207d5e)&&typeof _0x207d5e==='object'&&!Array[_0x3e18a6(0xe1)](_0x207d5e);}
|
|
@@ -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
|
+
const a41_0x37c540=a41_0x2f3e;(function(_0x2939bc,_0x8eb1bc){const _0x55e5e7=a41_0x2f3e,_0x4a9be2=_0x2939bc();while(!![]){try{const _0x180915=-parseInt(_0x55e5e7(0x160))/0x1*(-parseInt(_0x55e5e7(0x17d))/0x2)+-parseInt(_0x55e5e7(0x177))/0x3+parseInt(_0x55e5e7(0x19b))/0x4*(-parseInt(_0x55e5e7(0x157))/0x5)+-parseInt(_0x55e5e7(0x15c))/0x6*(parseInt(_0x55e5e7(0x167))/0x7)+parseInt(_0x55e5e7(0x165))/0x8*(parseInt(_0x55e5e7(0x15d))/0x9)+parseInt(_0x55e5e7(0x183))/0xa*(-parseInt(_0x55e5e7(0x15f))/0xb)+parseInt(_0x55e5e7(0x16c))/0xc;if(_0x180915===_0x8eb1bc)break;else _0x4a9be2['push'](_0x4a9be2['shift']());}catch(_0x293a70){_0x4a9be2['push'](_0x4a9be2['shift']());}}}(a41_0x5410,0x21a4e));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_0x37c540(0x194),'type':'string','required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':a41_0x37c540(0x155),'type':a41_0x37c540(0x18f),'required':!![],'description':a41_0x37c540(0x19a),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':'lower\x20kebab-case\x20service\x20code'}};function a41_0x2f3e(_0x48f758,_0x57a320){_0x48f758=_0x48f758-0x14f;const _0x5410ae=a41_0x5410();let _0x2f3e09=_0x5410ae[_0x48f758];return _0x2f3e09;}function summarizeService(_0x198554){const _0x2aa2b4=a41_0x37c540;return{'serviceCode':_0x198554[_0x2aa2b4(0x18a)],'name':_0x198554[_0x2aa2b4(0x173)][_0x2aa2b4(0x155)][_0x2aa2b4(0x16f)],'version':_0x198554[_0x2aa2b4(0x156)],'importedAt':_0x198554[_0x2aa2b4(0x189)],'source':_0x198554[_0x2aa2b4(0x158)],'commandCount':_0x198554[_0x2aa2b4(0x173)]['commands'][_0x2aa2b4(0x15b)],'commands':_0x198554[_0x2aa2b4(0x173)][_0x2aa2b4(0x191)][_0x2aa2b4(0x180)](_0x26bac1=>({'path':_0x26bac1[_0x2aa2b4(0x17a)],'description':_0x26bac1[_0x2aa2b4(0x16d)],'risk':_0x26bac1['risk'],'target':toPublicServiceTreeTarget(_0x26bac1[_0x2aa2b4(0x16b)]),'flags':_0x26bac1['flags'][_0x2aa2b4(0x180)](_0x5b6988=>({'name':_0x5b6988[_0x2aa2b4(0x16f)],'cliName':_0x5b6988[_0x2aa2b4(0x151)],'type':_0x5b6988['type'],'required':_0x5b6988[_0x2aa2b4(0x196)]===!![]}))}))};}function a41_0x5410(){const _0x534206=['Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','Local\x20service\x20code,\x20for\x20example\x20crm','219988FpumMA','manifest','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','cliName','import','entries','read','service','version','25uQntBw','source','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','\x20service\x20','length','6nWTDtF','63QeuFuh','Exported\x20service\x20','11YAMOmT','8689NBSIoQ','errors','report','export','str','233552ySkwVR','detail','1303757plksHM','updated','replaced','entry','target','4013568mwqolZ','description','将\x20Service\x20Tree\x20清单导入本地运行态注册表','name','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Service\x20manifest\x20validation\x20passed.','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','normalizedManifest','write','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','从本地运行态注册表移除\x20Service\x20Tree\x20清单','176535rdJMjf','Imported\x20','\x20service(s).','cliPath','WRITE','serviceCount','38WWUztx','warnings','registry','map','manifests','imported','460260lEeWct','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','validate','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','Service\x20registry\x20validation\x20passed.','registryPath','importedAt','serviceCode','reduce','\x20service(s),\x20updated\x20','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','hash','string','filePath','commands','kind','risk','file','remove','required','Updated','registryIndex'];a41_0x5410=function(){return _0x534206;};return a41_0x5410();}function summarizeLoadedManifest(_0x308bb4){const _0x47d14f=a41_0x37c540;return{'service':_0x308bb4['normalizedManifest']?.[_0x47d14f(0x155)],'version':_0x308bb4[_0x47d14f(0x173)]?.[_0x47d14f(0x156)],'commandCount':_0x308bb4[_0x47d14f(0x173)]?.['commands'][_0x47d14f(0x15b)]??0x0,'commands':_0x308bb4['normalizedManifest']?.['commands'][_0x47d14f(0x180)](_0x370424=>({'path':_0x370424[_0x47d14f(0x17a)],'risk':_0x370424[_0x47d14f(0x193)],'target':toPublicServiceTreeTarget(_0x370424['target'])}))??[],'registryIndex':_0x308bb4[_0x47d14f(0x198)],'registryServiceCode':_0x308bb4['registryServiceCode'],'errors':_0x308bb4['report'][_0x47d14f(0x161)],'warnings':_0x308bb4[_0x47d14f(0x162)]['warnings']};}export const serviceDefinitions=[{'service':a41_0x37c540(0x155),'command':a41_0x37c540(0x185),'description':a41_0x37c540(0x175),'risk':a41_0x37c540(0x154),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x569ebd){const _0x226053=a41_0x37c540,_0x399826=loadServiceManifestFromFile(_0x569ebd[_0x226053(0x164)](_0x226053(0x194)));if(!_0x399826['report']['ok'])return{'ok':![],'data':{'file':_0x399826[_0x226053(0x190)],'hash':_0x399826[_0x226053(0x18e)],'kind':_0x399826[_0x226053(0x192)],'serviceCount':_0x399826['manifests'][_0x226053(0x15b)],'services':_0x399826['manifests']['map'](summarizeLoadedManifest),'errors':_0x399826[_0x226053(0x162)]['errors'],'warnings':_0x399826[_0x226053(0x162)][_0x226053(0x17e)]},'message':formatValidationFailure(_0x399826[_0x226053(0x162)])};if(_0x399826[_0x226053(0x192)]===_0x226053(0x17f)||_0x399826[_0x226053(0x181)][_0x226053(0x15b)]!==0x1)return{'ok':!![],'data':{'file':_0x399826[_0x226053(0x190)],'hash':_0x399826[_0x226053(0x18e)],'kind':_0x399826[_0x226053(0x192)],'serviceCount':_0x399826[_0x226053(0x181)][_0x226053(0x15b)],'commandCount':_0x399826[_0x226053(0x181)][_0x226053(0x18b)]((_0x7192b8,_0x12e049)=>_0x7192b8+(_0x12e049[_0x226053(0x173)]?.[_0x226053(0x191)]['length']??0x0),0x0),'services':_0x399826['manifests'][_0x226053(0x180)](summarizeLoadedManifest),'warnings':_0x399826[_0x226053(0x162)][_0x226053(0x17e)]},'message':_0x226053(0x187)};return{'ok':!![],'data':{'file':_0x399826[_0x226053(0x190)],'hash':_0x399826[_0x226053(0x18e)],'kind':_0x399826['kind'],'service':_0x399826['normalizedManifest']?.[_0x226053(0x155)],'version':_0x399826[_0x226053(0x173)]?.[_0x226053(0x156)],'commandCount':_0x399826['normalizedManifest']?.['commands'][_0x226053(0x15b)]??0x0,'commands':_0x399826[_0x226053(0x173)]?.[_0x226053(0x191)][_0x226053(0x180)](_0xd52596=>({'path':_0xd52596[_0x226053(0x17a)],'risk':_0xd52596['risk'],'target':toPublicServiceTreeTarget(_0xd52596['target'])})),'warnings':_0x399826[_0x226053(0x162)][_0x226053(0x17e)]},'message':_0x226053(0x171)};}},{'service':'service','command':a41_0x37c540(0x152),'description':a41_0x37c540(0x16e),'risk':a41_0x37c540(0x174),'confirmationDescription':a41_0x37c540(0x172),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x8f1991){const _0x1c496e=a41_0x37c540,_0x1fd18d=loadServiceManifestFromFile(_0x8f1991[_0x1c496e(0x164)](_0x1c496e(0x194)));return{'method':_0x1c496e(0x17b),'url':getServiceRegistryPath(),'body':{'file':_0x1fd18d[_0x1c496e(0x190)],'hash':_0x1fd18d['hash'],'kind':_0x1fd18d[_0x1c496e(0x192)],'ok':_0x1fd18d[_0x1c496e(0x162)]['ok'],'service':_0x1fd18d[_0x1c496e(0x173)]?.['service'],'version':_0x1fd18d[_0x1c496e(0x173)]?.['version'],'serviceCount':_0x1fd18d[_0x1c496e(0x181)]['length'],'services':_0x1fd18d['manifests'][_0x1c496e(0x180)](_0x424417=>({'service':_0x424417['normalizedManifest']?.[_0x1c496e(0x155)],'version':_0x424417[_0x1c496e(0x173)]?.[_0x1c496e(0x156)],'commandCount':_0x424417[_0x1c496e(0x173)]?.[_0x1c496e(0x191)][_0x1c496e(0x15b)]??0x0,'errors':_0x424417[_0x1c496e(0x162)][_0x1c496e(0x161)]})),'errors':_0x1fd18d[_0x1c496e(0x162)][_0x1c496e(0x161)],'commandCount':_0x1fd18d[_0x1c496e(0x173)]?.['commands'][_0x1c496e(0x15b)]??0x0},'description':_0x1c496e(0x184)};},async 'execute'(_0x23dedf){const _0x3960ce=a41_0x37c540,_0x45f860=importServiceManifest(_0x23dedf[_0x3960ce(0x164)](_0x3960ce(0x194)));if(_0x45f860[_0x3960ce(0x153)][_0x3960ce(0x15b)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x45f860['registryPath'],'imported':_0x45f860['imported'],'updated':_0x45f860['updated'],'serviceCount':_0x45f860['serviceCount'],'services':_0x45f860['entries']['map'](summarizeService)},'message':_0x3960ce(0x178)+_0x45f860['imported']+_0x3960ce(0x18c)+_0x45f860['updated']+_0x3960ce(0x179)};return{'ok':!![],'data':{'registryPath':_0x45f860[_0x3960ce(0x188)],'replaced':_0x45f860[_0x3960ce(0x169)],'imported':_0x45f860[_0x3960ce(0x182)],'updated':_0x45f860[_0x3960ce(0x168)],'serviceCount':_0x45f860['serviceCount'],'service':summarizeService(_0x45f860['entry'])},'message':(_0x45f860['replaced']?_0x3960ce(0x197):'Imported')+_0x3960ce(0x15a)+_0x45f860['entry'][_0x3960ce(0x18a)]+'.'};}},{'service':a41_0x37c540(0x155),'command':a41_0x37c540(0x163),'description':a41_0x37c540(0x18d),'risk':'write','confirmationDescription':a41_0x37c540(0x14f),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x332825){const _0x3b9487=a41_0x37c540,_0x3d6334=getLocalServiceEntry(_0x332825['str'](_0x3b9487(0x155)));return{'method':_0x3b9487(0x17b),'url':_0x332825[_0x3b9487(0x164)](_0x3b9487(0x194)),'body':{'service':_0x332825[_0x3b9487(0x164)](_0x3b9487(0x155)),'found':Boolean(_0x3d6334),'version':_0x3d6334?.[_0x3b9487(0x156)],'source':_0x3d6334?.[_0x3b9487(0x158)]},'description':_0x3b9487(0x199)};},async 'execute'(_0xad12b3){const _0x2e39e4=a41_0x37c540,_0x52e5c6=exportServiceManifest(_0xad12b3['str'](_0x2e39e4(0x155)),_0xad12b3['str']('file'));return{'ok':!![],'data':{'registryPath':_0x52e5c6[_0x2e39e4(0x188)],'file':_0x52e5c6[_0x2e39e4(0x190)],'service':summarizeService(_0x52e5c6[_0x2e39e4(0x16a)])},'message':_0x2e39e4(0x15e)+_0x52e5c6[_0x2e39e4(0x16a)][_0x2e39e4(0x18a)]+'.'};}},{'service':a41_0x37c540(0x155),'command':'list','description':a41_0x37c540(0x186),'risk':a41_0x37c540(0x154),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x3e72f5=a41_0x37c540,_0x370be2=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x370be2[_0x3e72f5(0x15b)],'services':_0x370be2[_0x3e72f5(0x180)](summarizeService)}};}},{'service':'service','command':a41_0x37c540(0x195),'description':a41_0x37c540(0x176),'risk':a41_0x37c540(0x174),'confirmationDescription':a41_0x37c540(0x159),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x2015fc){const _0x56cb30=a41_0x37c540,_0x455b2b=getLocalServiceEntry(_0x2015fc[_0x56cb30(0x164)](_0x56cb30(0x155)));return{'method':_0x56cb30(0x17b),'url':getServiceRegistryPath(),'body':{'service':_0x2015fc[_0x56cb30(0x164)](_0x56cb30(0x155)),'found':Boolean(_0x455b2b),'version':_0x455b2b?.[_0x56cb30(0x156)],'source':_0x455b2b?.[_0x56cb30(0x158)]},'description':_0x56cb30(0x150)};},async 'execute'(_0x20beae){const _0x582169=a41_0x37c540,_0x35679f=removeServiceManifest(_0x20beae[_0x582169(0x164)]('service'));return{'ok':!![],'data':{'registryPath':_0x35679f[_0x582169(0x188)],'serviceCount':_0x35679f[_0x582169(0x17c)],'service':summarizeService(_0x35679f[_0x582169(0x16a)])},'message':'Removed\x20service\x20'+_0x35679f['entry'][_0x582169(0x18a)]+'.'};}},{'service':a41_0x37c540(0x155),'command':a41_0x37c540(0x166),'description':a41_0x37c540(0x170),'risk':a41_0x37c540(0x154),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x14ba64){const _0x318325=a41_0x37c540,_0x457c3e=getLocalServiceEntry(_0x14ba64[_0x318325(0x164)](_0x318325(0x155)));if(!_0x457c3e)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x14ba64['str'](_0x318325(0x155))},'message':'Local\x20service\x20not\x20found:\x20'+_0x14ba64[_0x318325(0x164)](_0x318325(0x155))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x457c3e),'manifest':_0x457c3e[_0x318325(0x19c)],'normalizedManifest':toPublicNormalizedServiceTree(_0x457c3e[_0x318325(0x173)])}};}}];
|
|
@@ -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_0x466574=a42_0x38dc;(function(_0x561963,_0x2e9016){const _0x5b781a=a42_0x38dc,_0x38b85f=_0x561963();while(!![]){try{const _0x56e7a0=parseInt(_0x5b781a(0x121))/0x1+parseInt(_0x5b781a(0x122))/0x2+parseInt(_0x5b781a(0xf7))/0x3*(parseInt(_0x5b781a(0xf9))/0x4)+parseInt(_0x5b781a(0x10e))/0x5*(-parseInt(_0x5b781a(0x11a))/0x6)+parseInt(_0x5b781a(0xd5))/0x7+parseInt(_0x5b781a(0x104))/0x8+-parseInt(_0x5b781a(0xf8))/0x9;if(_0x56e7a0===_0x2e9016)break;else _0x38b85f['push'](_0x38b85f['shift']());}catch(_0x502580){_0x38b85f['push'](_0x38b85f['shift']());}}}(a42_0x43bb,0xe4867));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';function a42_0x38dc(_0x4dcfe2,_0x192f7c){_0x4dcfe2=_0x4dcfe2-0xd5;const _0x43bb33=a42_0x43bb();let _0x38dc52=_0x43bb33[_0x4dcfe2];return _0x38dc52;}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_0x466574(0xed);export function getServiceRegistryPath(_0x35c5a7={}){const _0x1fc1a4=a42_0x466574;return resolve(_0x35c5a7[_0x1fc1a4(0x105)]??homedir(),PRODUCT_CONFIG[_0x1fc1a4(0xff)],SERVICE_REGISTRY_FILE_NAME);}function a42_0x43bb(){const _0x44716f=['19989eCwlYL','42147306keLfHE','820wlLbJw','invalid','localeCompare','].manifest.','target','report','homeDirName','validation','map','errors','description','9388040sGdWxN','homeDir','warnings','version','digest','flatMap','now','startsWith','commands','string','414590OjwiOb','length','Remove\x20or\x20migrate\x20','stringify','hex','filePath','update','trim','join','service','registryIndex','Unsupported\x20schemaVersion:\x20','30tVFQmx','object','parse','findIndex','empty','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','isArray','1305435IFVcjv','3402072UdkfQW','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','sha256','utf8','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','Service\x20manifest\x20validation\x20failed:\x0a','manifest','manifests','schemaVersion','3414404qdBytL','sourceHash','updatedAt','Cannot\x20write\x20service\x20registry:\x20','find','services','push','code','risk','Local\x20service\x20not\x20found:\x20','CliError','missing','sort','serviceCode','Invalid\x20service\x20manifest\x20JSON:\x20','bff\x20target\x20requires\x20functionName.','toISOString','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','command','message','slice','normalizedManifest','cliPath','].manifest','service.json','path','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','name','$.services[','source','kind','.tmp','services\x20must\x20be\x20an\x20array','file'];a42_0x43bb=function(){return _0x44716f;};return a42_0x43bb();}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x1da0e2={}){const _0x36540a=a42_0x466574,_0x291464=getServiceRegistryPath(_0x1da0e2);if(!existsSync(_0x291464))return emptyServiceRegistry();try{const _0x183746=readFileSync(_0x291464,_0x36540a(0x125));if(!_0x183746['trim']())return emptyServiceRegistry();const _0x2a5f53=JSON[_0x36540a(0x11c)](_0x183746);if(_0x2a5f53[_0x36540a(0x12a)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x36540a(0x100)]('Unsupported\x20service\x20registry\x20schemaVersion:\x20'+String(_0x2a5f53[_0x36540a(0x12a)]),_0x36540a(0x110)+_0x291464+'.');if(!Array[_0x36540a(0x120)](_0x2a5f53['services']))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x2a5f53[_0x36540a(0xd7)],'services':_0x2a5f53[_0x36540a(0xda)]};}catch(_0x5180f9){if(_0x5180f9 instanceof Error&&_0x5180f9[_0x36540a(0xf0)]===_0x36540a(0xdf))throw _0x5180f9;throw CliErrors[_0x36540a(0x100)]('Invalid\x20service\x20registry\x20JSON:\x20'+_0x291464,_0x36540a(0x11f));}}export function writeServiceRegistry(_0x58a7b1,_0x50b676={}){const _0x4c065e=a42_0x466574,_0x666fdd=getServiceRegistryPath(_0x50b676),_0x17b183=dirname(_0x666fdd);!existsSync(_0x17b183)&&mkdirSync(_0x17b183,{'recursive':!![]});const _0x44f467=_0x666fdd+_0x4c065e(0xf4);try{writeFileSync(_0x44f467,JSON[_0x4c065e(0x111)](_0x58a7b1,null,0x2)+'\x0a',{'encoding':_0x4c065e(0x125),'mode':0x180}),renameSync(_0x44f467,_0x666fdd);}catch(_0x5cdfa8){try{unlinkSync(_0x44f467);}catch{}if(_0x5cdfa8?.[_0x4c065e(0xdc)]==='ENOENT')throw CliErrors[_0x4c065e(0x100)](_0x4c065e(0xd8)+_0x666fdd);throw _0x5cdfa8;}return _0x666fdd;}export function loadServiceManifestFromFile(_0x1aa277){const _0x8b1590=a42_0x466574,_0x42e2a9=resolve(_0x1aa277);if(!existsSync(_0x42e2a9))throw CliErrors['validation']('Service\x20manifest\x20file\x20not\x20found:\x20'+_0x1aa277);let _0x1be86c;const _0x43aba3=readFileSync(_0x42e2a9,'utf8');try{_0x1be86c=JSON[_0x8b1590(0x11c)](_0x43aba3);}catch{throw CliErrors[_0x8b1590(0x100)](_0x8b1590(0xe3)+_0x1aa277,_0x8b1590(0x126));}const _0x3a564e=sha256(_0x43aba3),_0x5dc159=extractLoadedServiceManifests(_0x1be86c,_0x3a564e),_0x393589=aggregateValidationReports(_0x5dc159),_0x45ae99=_0x5dc159[0x0];return{'filePath':_0x42e2a9,'hash':_0x3a564e,'kind':isServiceRegistryLike(_0x1be86c)?'registry':'manifest','manifest':_0x45ae99?.['manifest']??_0x1be86c,'report':_0x393589,'normalizedManifest':_0x5dc159['length']===0x1?_0x45ae99?.[_0x8b1590(0xea)]:undefined,'manifests':_0x5dc159};}export function importServiceManifest(_0x3ee132,_0x4d9ca6={}){const _0x12af5e=a42_0x466574,_0x39b0d6=loadServiceManifestFromFile(_0x3ee132);if(!_0x39b0d6[_0x12af5e(0xfe)]['ok'])throw CliErrors['validation'](formatValidationFailure(_0x39b0d6['report']),'Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.');if(_0x39b0d6[_0x12af5e(0x129)][_0x12af5e(0x10f)]===0x0)throw CliErrors[_0x12af5e(0x100)](_0x12af5e(0xe6),_0x12af5e(0xef));const _0x4d7393=readServiceRegistry(_0x4d9ca6),_0x2d2f4d=(_0x4d9ca6['now']??(()=>new Date()))()[_0x12af5e(0xe5)](),_0x3b9d3c=[];let _0x4e5c6d=0x0,_0x525c6e=0x0;for(const _0x2740bf of _0x39b0d6['manifests']){if(!_0x2740bf['normalizedManifest'])continue;const _0x4892d9=_0x2740bf[_0x12af5e(0xea)]['service'][_0x12af5e(0xdc)],_0x136e07={'serviceCode':_0x4892d9,'version':_0x2740bf[_0x12af5e(0xea)][_0x12af5e(0x107)],'importedAt':_0x2d2f4d,'source':{'type':_0x12af5e(0xf6),'path':_0x39b0d6[_0x12af5e(0x113)],'hash':_0x2740bf[_0x12af5e(0xd6)]},'manifest':_0x2740bf[_0x12af5e(0x128)],'normalizedManifest':_0x2740bf[_0x12af5e(0xea)]},_0x576043=_0x4d7393['services'][_0x12af5e(0x11d)](_0x2b9978=>_0x2b9978[_0x12af5e(0xe2)]===_0x4892d9);_0x576043>=0x0?(_0x4d7393['services'][_0x576043]=_0x136e07,_0x525c6e++):(_0x4d7393[_0x12af5e(0xda)][_0x12af5e(0xdb)](_0x136e07),_0x4e5c6d++),_0x3b9d3c[_0x12af5e(0xdb)](_0x136e07);}_0x4d7393[_0x12af5e(0xda)][_0x12af5e(0xe1)]((_0x40ce6d,_0x3f4d41)=>_0x40ce6d[_0x12af5e(0xe2)][_0x12af5e(0xfb)](_0x3f4d41[_0x12af5e(0xe2)])),_0x4d7393['updatedAt']=_0x2d2f4d;const _0x351fce=writeServiceRegistry(_0x4d7393,_0x4d9ca6);return{'registryPath':_0x351fce,'entry':_0x3b9d3c[0x0],'replaced':_0x3b9d3c['length']===0x1?_0x525c6e===0x1:_0x525c6e>0x0,'entries':_0x3b9d3c,'imported':_0x4e5c6d,'updated':_0x525c6e,'serviceCount':_0x4d7393['services'][_0x12af5e(0x10f)]};}export function exportServiceManifest(_0x3e195d,_0x10ab75,_0x1837f5={}){const _0x540cfc=a42_0x466574,_0x1a63dd=getServiceRegistryPath(_0x1837f5),_0x5a5995=getLocalServiceEntry(_0x3e195d,_0x1837f5);if(!_0x5a5995)throw CliErrors[_0x540cfc(0x100)](_0x540cfc(0xde)+_0x3e195d,_0x540cfc(0x123));const _0x55d530=resolve(_0x10ab75),_0x62b057=dirname(_0x55d530);return!existsSync(_0x62b057)&&mkdirSync(_0x62b057,{'recursive':!![]}),writeFileSync(_0x55d530,JSON[_0x540cfc(0x111)](_0x5a5995['manifest'],null,0x2)+'\x0a',{'encoding':_0x540cfc(0x125),'mode':0x180}),{'registryPath':_0x1a63dd,'filePath':_0x55d530,'entry':_0x5a5995};}export function removeServiceManifest(_0x5cb4ae,_0x3ea6c8={}){const _0x2c61a6=a42_0x466574,_0x6c6191=readServiceRegistry(_0x3ea6c8),_0x6b8fa1=_0x5cb4ae[_0x2c61a6(0x115)](),_0x1966b8=_0x6c6191[_0x2c61a6(0xda)][_0x2c61a6(0x11d)](_0x4e5cc5=>_0x4e5cc5['serviceCode']===_0x6b8fa1);if(_0x1966b8<0x0)throw CliErrors[_0x2c61a6(0x100)](_0x2c61a6(0xde)+_0x6b8fa1,_0x2c61a6(0x123));const [_0x3a0d40]=_0x6c6191[_0x2c61a6(0xda)]['splice'](_0x1966b8,0x1),_0x569d36=(_0x3ea6c8[_0x2c61a6(0x10a)]??(()=>new Date()))()['toISOString']();_0x6c6191[_0x2c61a6(0xd7)]=_0x569d36;const _0x5764c0=writeServiceRegistry(_0x6c6191,_0x3ea6c8);return{'registryPath':_0x5764c0,'entry':_0x3a0d40,'serviceCount':_0x6c6191[_0x2c61a6(0xda)][_0x2c61a6(0x10f)]};}export function listLocalServices(_0x23d9ab={}){const _0x48632e=a42_0x466574;return readServiceRegistry(_0x23d9ab)[_0x48632e(0xda)];}export function getLocalServiceEntry(_0xe6c076,_0x59f49b={}){const _0x361778=a42_0x466574;return readServiceRegistry(_0x59f49b)[_0x361778(0xda)][_0x361778(0xd9)](_0x5c4891=>_0x5c4891[_0x361778(0xe2)]===_0xe6c076['trim']());}export function listLocalServiceTrees(_0x1402e4={}){const _0x5b3adf=a42_0x466574;return readServiceRegistry(_0x1402e4)[_0x5b3adf(0xda)][_0x5b3adf(0x101)](_0x1e5b02=>_0x1e5b02['normalizedManifest']);}export function inspectServiceRegistry(_0x245f02={}){const _0x3fc4ee=a42_0x466574,_0x8c402f=getServiceRegistryPath(_0x245f02);if(!existsSync(_0x8c402f))return emptyServiceRegistryInspection(_0x8c402f,_0x3fc4ee(0xe0),![]);try{const _0x336bd1=readFileSync(_0x8c402f,_0x3fc4ee(0x125));if(!_0x336bd1['trim']())return emptyServiceRegistryInspection(_0x8c402f,_0x3fc4ee(0x11e),!![]);const _0x4767d9=JSON['parse'](_0x336bd1);if(_0x4767d9[_0x3fc4ee(0x12a)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x8c402f,_0x3fc4ee(0xfa),!![]),'schemaVersion':_0x4767d9[_0x3fc4ee(0x12a)],'message':_0x3fc4ee(0x119)+String(_0x4767d9[_0x3fc4ee(0x12a)])};if(!Array[_0x3fc4ee(0x120)](_0x4767d9[_0x3fc4ee(0xda)]))return{...emptyServiceRegistryInspection(_0x8c402f,_0x3fc4ee(0xfa),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x4767d9[_0x3fc4ee(0xd7)],'message':_0x3fc4ee(0xf5)};const _0x418027=_0x4767d9[_0x3fc4ee(0xda)][_0x3fc4ee(0x101)](summarizeLocalServiceEntry);return{'registryPath':_0x8c402f,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x4767d9['updatedAt'],'serviceCount':_0x418027[_0x3fc4ee(0x10f)],'commandCount':_0x418027['reduce']((_0x525998,_0x4d5952)=>_0x525998+_0x4d5952['commandCount'],0x0),'services':_0x418027};}catch(_0x5bbe7a){return{...emptyServiceRegistryInspection(_0x8c402f,_0x3fc4ee(0xfa),!![]),'message':_0x5bbe7a instanceof Error?_0x5bbe7a['message']:String(_0x5bbe7a)};}}export function formatValidationFailure(_0x3b8bcd){const _0x5c42f6=a42_0x466574,_0x29bfdf=_0x3b8bcd[_0x5c42f6(0x102)][_0x5c42f6(0x101)](_0x4c6d28=>_0x4c6d28[_0x5c42f6(0xee)]+':\x20'+_0x4c6d28[_0x5c42f6(0xe8)]);return _0x5c42f6(0x127)+_0x29bfdf[_0x5c42f6(0x116)]('\x0a');}function extractLoadedServiceManifests(_0x410a19,_0x5a6454){const _0x25387b=a42_0x466574;if(!isServiceRegistryLike(_0x410a19)){const _0x128279=_0x410a19,{manifest:_0x2ecdf9,errors:_0x18c4a2}=adaptServiceTreeManifestForLegacyFramework(_0x128279),_0x61415f=validateServiceTreeManifest(_0x2ecdf9),_0x3195a0=mergeValidationErrors(_0x61415f,_0x18c4a2);return[{'manifest':_0x128279,'report':_0x3195a0,'normalizedManifest':_0x3195a0['ok']?normalizeServiceTreeManifest(_0x2ecdf9):undefined,'sourceHash':_0x5a6454}];}return _0x410a19[_0x25387b(0xda)]['map']((_0x76b96b,_0x1c841c)=>{const _0x602a5d=_0x25387b,_0x55a4ce=isObjectRecord(_0x76b96b)?_0x76b96b[_0x602a5d(0x128)]:undefined,{manifest:_0x5c8636,errors:_0x137183}=adaptServiceTreeManifestForLegacyFramework(_0x55a4ce),_0x22fd91=validateServiceTreeManifest(_0x5c8636),_0x6e207f=mergeValidationErrors(_0x22fd91,_0x137183),_0x260098=isObjectRecord(_0x76b96b)&&typeof _0x76b96b['serviceCode']===_0x602a5d(0x10d)?_0x76b96b[_0x602a5d(0xe2)]:undefined;return{'manifest':_0x55a4ce,'report':_0x6e207f,'normalizedManifest':_0x6e207f['ok']?normalizeServiceTreeManifest(_0x5c8636):undefined,'sourceHash':sha256(JSON[_0x602a5d(0x111)](_0x55a4ce,null,0x2)+'\x0a'),'registryIndex':_0x1c841c,'registryServiceCode':_0x260098};});}function mergeValidationErrors(_0x1d4f63,_0xb099d5){const _0x161f0e=a42_0x466574,_0x21bba8=_0x1d4f63[_0x161f0e(0x102)][_0x161f0e(0x101)](_0xae16b2=>_0xae16b2[_0x161f0e(0xe8)]==='bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.'?{..._0xae16b2,'message':_0x161f0e(0xe4)}:_0xae16b2),_0x46eab7=[..._0xb099d5,..._0x21bba8];return{'ok':_0x46eab7['length']===0x0,'errors':_0x46eab7,'warnings':_0x1d4f63[_0x161f0e(0x106)]};}function aggregateValidationReports(_0x292747){const _0x51de11=a42_0x466574,_0x13ca42=_0x292747['flatMap'](_0x4ef3a3=>_0x4ef3a3[_0x51de11(0x118)]===undefined?_0x4ef3a3['report'][_0x51de11(0x102)]:_0x4ef3a3[_0x51de11(0xfe)][_0x51de11(0x102)][_0x51de11(0x101)](_0x3e3aba=>({..._0x3e3aba,'path':prefixRegistryIssuePath(_0x4ef3a3['registryIndex'],_0x3e3aba[_0x51de11(0xee)])}))),_0x70544=_0x292747[_0x51de11(0x109)](_0x5dd91f=>_0x5dd91f[_0x51de11(0x118)]===undefined?_0x5dd91f['report'][_0x51de11(0x106)]:_0x5dd91f['report']['warnings'][_0x51de11(0x101)](_0x4016ae=>({..._0x4016ae,'path':prefixRegistryIssuePath(_0x5dd91f[_0x51de11(0x118)],_0x4016ae['path'])})));return{'ok':_0x13ca42[_0x51de11(0x10f)]===0x0,'errors':_0x13ca42,'warnings':_0x70544};}function prefixRegistryIssuePath(_0x540ba8,_0x22a284){const _0x51bab3=a42_0x466574;if(_0x22a284==='$')return _0x51bab3(0xf1)+_0x540ba8+_0x51bab3(0xec);if(_0x22a284[_0x51bab3(0x10b)]('$.'))return _0x51bab3(0xf1)+_0x540ba8+_0x51bab3(0xec)+_0x22a284[_0x51bab3(0xe9)](0x1);if(_0x22a284[_0x51bab3(0x10b)]('$['))return'$.services['+_0x540ba8+_0x51bab3(0xec)+_0x22a284[_0x51bab3(0xe9)](0x1);return _0x51bab3(0xf1)+_0x540ba8+_0x51bab3(0xfc)+_0x22a284;}function isServiceRegistryLike(_0x2d4d15){const _0x13b2e8=a42_0x466574;return isObjectRecord(_0x2d4d15)&&_0x2d4d15[_0x13b2e8(0x12a)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x13b2e8(0x120)](_0x2d4d15[_0x13b2e8(0xda)]);}function isObjectRecord(_0x2992d5){const _0x243700=a42_0x466574;return Boolean(_0x2992d5)&&typeof _0x2992d5===_0x243700(0x11b)&&!Array[_0x243700(0x120)](_0x2992d5);}function emptyServiceRegistryInspection(_0x2202eb,_0x67a2ee,_0x3f2bd0){return{'registryPath':_0x2202eb,'exists':_0x3f2bd0,'status':_0x67a2ee,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x1269ee){const _0x3f246f=a42_0x466574,_0x342f81=_0x1269ee[_0x3f246f(0xea)],_0x321479=_0x342f81[_0x3f246f(0x10c)]['map'](_0x2b74c2=>({'path':_0x2b74c2[_0x3f246f(0xeb)],'description':_0x2b74c2[_0x3f246f(0x103)],'risk':_0x2b74c2[_0x3f246f(0xdd)],'targetKind':_0x2b74c2[_0x3f246f(0xfd)][_0x3f246f(0xf3)],'targetCommand':_0x2b74c2[_0x3f246f(0xfd)][_0x3f246f(0xe7)]}));return{'serviceCode':_0x1269ee[_0x3f246f(0xe2)],'name':_0x342f81[_0x3f246f(0x117)]['name'],'description':_0x342f81[_0x3f246f(0x117)][_0x3f246f(0x103)],'version':_0x1269ee[_0x3f246f(0x107)],'importedAt':_0x1269ee['importedAt'],'source':_0x1269ee[_0x3f246f(0xf2)],'commandCount':_0x321479[_0x3f246f(0x10f)],'commands':_0x321479};}function sha256(_0xc86d80){const _0x520232=a42_0x466574;return createHash(_0x520232(0x124))[_0x520232(0x114)](_0xc86d80)[_0x520232(0x108)](_0x520232(0x112));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a43_0x5022(){const _0x187f41=['files','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','9816pNQAri','525490Bpdefa','skillName','target','content','Created\x20local\x20Skill\x20draft\x20','path','209UrvOpJ','1509666LoyDZV','name','2GrHOlE','isDirectory','创建本地自包含的运行态\x20Skill\x20草稿','7cPuzcy','1674nJKPHD','68kXxmsA','skillDir','type','1051668OipwqB','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','Refusing\x20to\x20overwrite\x20symlink:\x20','skill','1301367SAbsmJ','trim','140485FSsaed','validation','Skill\x20directory\x20already\x20exists:\x20','bool','14208852FpEYBf','force','str','rendered','isSymbolicLink','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.'];a43_0x5022=function(){return _0x187f41;};return a43_0x5022();}const a43_0x3b179b=a43_0x27e9;(function(_0x48bf4d,_0x126096){const _0x131510=a43_0x27e9,_0x43ab79=_0x48bf4d();while(!![]){try{const _0x2c9b00=parseInt(_0x131510(0x175))/0x1+parseInt(_0x131510(0x18e))/0x2*(-parseInt(_0x131510(0x196))/0x3)+parseInt(_0x131510(0x193))/0x4*(parseInt(_0x131510(0x177))/0x5)+-parseInt(_0x131510(0x18c))/0x6*(parseInt(_0x131510(0x191))/0x7)+-parseInt(_0x131510(0x184))/0x8*(parseInt(_0x131510(0x192))/0x9)+parseInt(_0x131510(0x185))/0xa*(parseInt(_0x131510(0x18b))/0xb)+-parseInt(_0x131510(0x17b))/0xc;if(_0x2c9b00===_0x126096)break;else _0x43ab79['push'](_0x43ab79['shift']());}catch(_0x4e3974){_0x43ab79['push'](_0x43ab79['shift']());}}}(a43_0x5022,0xba46b));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';function a43_0x27e9(_0xc1b04d,_0x441aa9){_0xc1b04d=_0xc1b04d-0x174;const _0x50227b=a43_0x5022();let _0x27e981=_0x50227b[_0xc1b04d];return _0x27e981;}import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':a43_0x3b179b(0x174),'command':'create','description':a43_0x3b179b(0x190),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x436383){const _0xbe3062=a43_0x3b179b,_0x4a2309=buildSkillCreatePlan(_0x436383['str'](_0xbe3062(0x18d)),_0x436383[_0xbe3062(0x17d)](_0xbe3062(0x195)),_0x436383[_0xbe3062(0x17d)]('target'));return{'method':'WRITE','url':_0x4a2309[_0xbe3062(0x194)],'body':{'skillName':_0x4a2309[_0xbe3062(0x17e)]['skillName'],'type':_0x4a2309[_0xbe3062(0x17e)][_0xbe3062(0x195)],'selfContained':!![],'files':_0x4a2309[_0xbe3062(0x17e)]['files']['map'](_0x43115c=>_0x43115c[_0xbe3062(0x18a)])},'description':_0xbe3062(0x180)};},async 'execute'(_0xf5eb31){const _0xf71794=a43_0x3b179b,_0x3f1226=buildSkillCreatePlan(_0xf5eb31[_0xf71794(0x17d)](_0xf71794(0x18d)),_0xf5eb31['str'](_0xf71794(0x195)),_0xf5eb31[_0xf71794(0x17d)](_0xf71794(0x187)));return writeSkillDraft(_0x3f1226,_0xf5eb31[_0xf71794(0x17a)](_0xf71794(0x17c))),{'ok':!![],'data':{'skillName':_0x3f1226[_0xf71794(0x17e)]['skillName'],'type':_0x3f1226[_0xf71794(0x17e)][_0xf71794(0x195)],'dir':_0x3f1226['skillDir'],'files':_0x3f1226[_0xf71794(0x17e)][_0xf71794(0x181)]['map'](_0x28b5b2=>_0x28b5b2[_0xf71794(0x18a)])},'message':_0xf71794(0x189)+_0x3f1226[_0xf71794(0x17e)]['skillName']};}};function buildSkillCreatePlan(_0x3102e9,_0x1e4537,_0x1558c0){const _0x38715e=a43_0x3b179b,_0x56b441=_0x1e4537['trim'](),_0x3489a0=renderSkillTemplate({'skillName':_0x3102e9,'type':_0x56b441});!_0x56b441&&writeCliSideChannelLine(_0x38715e(0x197));const _0xff0e2f=resolve(normalizeSkillTarget(_0x1558c0));return{'rendered':_0x3489a0,'targetRoot':_0xff0e2f,'skillDir':resolve(_0xff0e2f,_0x3489a0[_0x38715e(0x186)])};}function normalizeSkillTarget(_0x5400ea){const _0x317bdf=a43_0x3b179b;return(_0x5400ea||DEFAULT_SKILL_TARGET)[_0x317bdf(0x176)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x4d3b8d,_0x24a7af){const _0x547bde=a43_0x3b179b;if(existsSync(_0x4d3b8d[_0x547bde(0x194)])){const _0x139f17=lstatSync(_0x4d3b8d[_0x547bde(0x194)]);if(!_0x139f17[_0x547bde(0x18f)]()||_0x139f17[_0x547bde(0x17f)]())throw CliErrors[_0x547bde(0x178)](_0x547bde(0x182)+_0x4d3b8d[_0x547bde(0x194)]);if(!_0x24a7af)throw CliErrors[_0x547bde(0x178)](_0x547bde(0x179)+_0x4d3b8d[_0x547bde(0x194)],_0x547bde(0x183));}for(const _0x3a69e6 of _0x4d3b8d[_0x547bde(0x17e)][_0x547bde(0x181)]){const _0x32500b=resolve(_0x4d3b8d[_0x547bde(0x194)],_0x3a69e6['path']),_0xc11e26=dirname(_0x32500b);mkdirSync(_0xc11e26,{'recursive':!![]});if(existsSync(_0x32500b)&&lstatSync(_0x32500b)[_0x547bde(0x17f)]())throw CliErrors[_0x547bde(0x178)](_0x547bde(0x198)+_0x32500b);writeFileSync(_0x32500b,_0x3a69e6[_0x547bde(0x188)],'utf8');}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a44_0x14031d=a44_0x2d36;(function(_0x2041f4,_0x10a67b){const _0x565c8a=a44_0x2d36,_0x5496a5=_0x2041f4();while(!![]){try{const _0x3416e0=-parseInt(_0x565c8a(0x140))/0x1*(-parseInt(_0x565c8a(0x13a))/0x2)+-parseInt(_0x565c8a(0x11d))/0x3+-parseInt(_0x565c8a(0x13b))/0x4+parseInt(_0x565c8a(0x12d))/0x5*(-parseInt(_0x565c8a(0x117))/0x6)+parseInt(_0x565c8a(0x11f))/0x7*(-parseInt(_0x565c8a(0x131))/0x8)+parseInt(_0x565c8a(0x11e))/0x9+parseInt(_0x565c8a(0x133))/0xa;if(_0x3416e0===_0x10a67b)break;else _0x5496a5['push'](_0x5496a5['shift']());}catch(_0x21db14){_0x5496a5['push'](_0x5496a5['shift']());}}}(a44_0x4805,0xedfe3));function a44_0x4805(){const _0x2372ea=['write','unchanged','personal','skill','48935tRfbEt','source-fingerprint','diagram-validate','diagram-show','182808EXLMDo','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','12123400ZFsuIY','Updated','diagram-file','Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','num','\x20is\x20unchanged.','diagram-push','40008ctFeWY','1535608FDpphz','action','expected-diagram-revision','version','Skill\x20diagram\x20for\x20','76NFhNrY','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.','skillCode','Found\x20Skill\x20diagram\x20for\x20','company','834NxNVcg','validation','为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','found','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','299427IVJcLs','16817913enKQWE','546EqhgsC','Skill\x20diagram\x20validation\x20passed\x20for\x20','skill-code','read',';\x20next\x20write\x20expects\x20revision\x20','isInteger','appCode','str','expectedDiagramRevision','scope'];a44_0x4805=function(){return _0x2372ea;};return a44_0x4805();}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';function a44_0x2d36(_0x55a407,_0x1a174b){_0x55a407=_0x55a407-0x115;const _0x4805b7=a44_0x4805();let _0x2d36a7=_0x4805b7[_0x55a407];return _0x2d36a7;}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(_0x4750eb){const _0xed6be7=a44_0x2d36,_0x21f0e9=_0x4750eb['str'](_0xed6be7(0x121))['trim'](),_0x28eaea=_0x4750eb['str']('version')['trim'](),_0x1d1c4c=_0x4750eb[_0xed6be7(0x126)](_0xed6be7(0x128));if(!_0x21f0e9||!_0x28eaea||_0x1d1c4c!==_0xed6be7(0x12b)&&_0x1d1c4c!==_0xed6be7(0x116))throw CliErrors[_0xed6be7(0x118)]('--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.');return{'skillCode':_0x21f0e9,'version':_0x28eaea,'scope':_0x1d1c4c};}async function readDiagramWriteInput(_0x349012){const _0x5eacbc=a44_0x2d36,_0x255f89=_0x349012[_0x5eacbc(0x137)](_0x5eacbc(0x13d)),_0x491503=_0x349012[_0x5eacbc(0x126)](_0x5eacbc(0x12e))['trim']();if(!Number[_0x5eacbc(0x124)](_0x255f89)||_0x255f89<0x0)throw CliErrors[_0x5eacbc(0x118)](_0x5eacbc(0x141));if(!/^sha256:[0-9a-f]{64}$/['test'](_0x491503))throw CliErrors['validation'](_0x5eacbc(0x11c));return{'expectedDiagramRevision':_0x255f89,'sourceFingerprint':_0x491503,'diagram':await readRequiredSkillDiagram(_0x349012[_0x5eacbc(0x126)](_0x5eacbc(0x135)))};}export const diagramValidateCommand={'service':'skill','command':a44_0x14031d(0x12f),'description':a44_0x14031d(0x11a),'risk':a44_0x14031d(0x122),'flags':WRITE_FLAGS,async 'execute'(_0x561c3b){const _0x5a9d38=a44_0x14031d,_0x54fa60=readDiagramTarget(_0x561c3b),_0x392b06=await validateRuntimeSkillVersionDiagram(_0x561c3b[_0x5a9d38(0x125)],_0x54fa60[_0x5a9d38(0x142)],_0x54fa60['version'],_0x54fa60[_0x5a9d38(0x128)],await readDiagramWriteInput(_0x561c3b));return{'ok':!![],'data':_0x392b06,'message':_0x5a9d38(0x120)+_0x54fa60['skillCode']+'@'+_0x54fa60['version']+'.'};}};export const diagramPushCommand={'service':a44_0x14031d(0x12c),'command':a44_0x14031d(0x139),'description':a44_0x14031d(0x119),'risk':a44_0x14031d(0x129),'confirmationDescription':'将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。','flags':WRITE_FLAGS,async 'execute'(_0x4cd30a){const _0x12ddd9=a44_0x14031d,_0x5716c7=readDiagramTarget(_0x4cd30a),_0x32ee65=await putRuntimeSkillVersionDiagram(_0x4cd30a[_0x12ddd9(0x125)],_0x5716c7[_0x12ddd9(0x142)],_0x5716c7[_0x12ddd9(0x13e)],_0x5716c7[_0x12ddd9(0x128)],await readDiagramWriteInput(_0x4cd30a));return{'ok':!![],'data':_0x32ee65,'message':_0x32ee65[_0x12ddd9(0x13c)]===_0x12ddd9(0x12a)?_0x12ddd9(0x13f)+_0x5716c7[_0x12ddd9(0x142)]+'@'+_0x5716c7[_0x12ddd9(0x13e)]+_0x12ddd9(0x138):(_0x32ee65[_0x12ddd9(0x13c)]==='created'?'Created':_0x12ddd9(0x134))+'\x20Skill\x20diagram\x20for\x20'+_0x5716c7[_0x12ddd9(0x142)]+'@'+_0x5716c7[_0x12ddd9(0x13e)]+'.'};}};export const diagramShowCommand={'service':a44_0x14031d(0x12c),'command':a44_0x14031d(0x130),'description':a44_0x14031d(0x136),'risk':a44_0x14031d(0x122),'flags':TARGET_FLAGS,async 'execute'(_0x456559){const _0xed0bd5=a44_0x14031d,_0x3f8e96=readDiagramTarget(_0x456559),_0x55ef7f=await getRuntimeSkillVersionDiagram(_0x456559[_0xed0bd5(0x125)],_0x3f8e96['skillCode'],_0x3f8e96[_0xed0bd5(0x13e)],_0x3f8e96['scope']);return{'ok':!![],'data':_0x55ef7f,'message':_0x55ef7f[_0xed0bd5(0x11b)]?_0xed0bd5(0x115)+_0x3f8e96[_0xed0bd5(0x142)]+'@'+_0x3f8e96[_0xed0bd5(0x13e)]+_0xed0bd5(0x123)+_0x55ef7f['expectedDiagramRevision']+'.':_0xed0bd5(0x132)+_0x3f8e96[_0xed0bd5(0x142)]+'@'+_0x3f8e96[_0xed0bd5(0x13e)]+';\x20first\x20write\x20expects\x20revision\x20'+_0x55ef7f[_0xed0bd5(0x127)]+'.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x27e9c3=a45_0x2ca4;(function(_0x59e7e0,_0x3e6083){const _0x40e2be=a45_0x2ca4,_0x492eb8=_0x59e7e0();while(!![]){try{const _0x2bb47b=parseInt(_0x40e2be(0xdd))/0x1*(-parseInt(_0x40e2be(0xe5))/0x2)+parseInt(_0x40e2be(0xda))/0x3*(-parseInt(_0x40e2be(0xd2))/0x4)+-parseInt(_0x40e2be(0xea))/0x5*(parseInt(_0x40e2be(0xc6))/0x6)+parseInt(_0x40e2be(0xc7))/0x7*(parseInt(_0x40e2be(0xd9))/0x8)+parseInt(_0x40e2be(0xc0))/0x9+-parseInt(_0x40e2be(0xd4))/0xa*(parseInt(_0x40e2be(0xcd))/0xb)+parseInt(_0x40e2be(0xe9))/0xc;if(_0x2bb47b===_0x3e6083)break;else _0x492eb8['push'](_0x492eb8['shift']());}catch(_0xed5a1a){_0x492eb8['push'](_0x492eb8['shift']());}}}(a45_0x6c0e,0xa20c3));function a45_0x2ca4(_0x2a72ee,_0x43a352){_0x2a72ee=_0x2a72ee-0xbf;const _0x6c0efe=a45_0x6c0e();let _0x2ca485=_0x6c0efe[_0x2a72ee];return _0x2ca485;}import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';function a45_0x6c0e(){const _0x2a0f0f=['skillRoots','10625020QvtjCf','action','includes','project','scope','192FerRan','15vtZoHC','Installed\x20','install','432056IQJval','skipped','\x20personal\x20and\x20','all','production','reduce','authRequired','map','2pecaQy','code','str','version','25253772uyWRlu','5yKdboV','length','filter','skill','../../../skills/runtime-skill-sync.js','global','personal','trim','4648122CCsTiP','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','push','company','appCode','bool','5408274PshzLV','200935LVVDuv','force','unchanged','accessKey','skillCode','flatMap','11ebXpmN','Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.','updated','removed','created','200140EUQAzA'];a45_0x6c0e=function(){return _0x2a0f0f;};return a45_0x6c0e();}import{normalizeSyncScopes}from'../scopes.js';import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':a45_0x27e9c3(0xed),'command':a45_0x27e9c3(0xdc),'description':a45_0x27e9c3(0xc1),'risk':'read','requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x253551){return syncRuntimeSkills(_0x253551);}};async function syncRuntimeSkills(_0x40a77c){const _0x18824d=a45_0x27e9c3,{downloadRuntimeSkillPackage:_0x2e60f0,listRuntimeSkills:_0x1b8495}=await import('../../../core/api-client.js'),{linkEffectiveRuntimeSkills:_0x52a577,materializeRuntimeSkill:_0x3fe8b7,pruneStaleRuntimeSkillCache:_0x4b7300,pruneStaleRuntimeSkillLinks:_0x1f0693,resolveRuntimeSkillInstallTarget:_0x5918ab}=await import(_0x18824d(0xee)),_0x5093f8=_0x40a77c[_0x18824d(0xe7)](_0x18824d(0xe6)),_0x1119a8=normalizeSyncScopes(_0x40a77c[_0x18824d(0xe7)](_0x18824d(0xd8))),_0x326bf9=_0x40a77c['envName']??_0x18824d(0xe1),_0x299243=_0x40a77c[_0x18824d(0xca)],_0x853a2d=_0x40a77c[_0x18824d(0xc5)](_0x18824d(0xc8));if(!_0x299243)throw CliErrors[_0x18824d(0xe3)](_0x18824d(0xce));const _0x2f610d=_0x5918ab(_0x40a77c[_0x18824d(0xc4)],_0x40a77c['bool']('project')?_0x18824d(0xd7):_0x18824d(0xef)),_0x5d2e2d=_0x5918ab(_0x40a77c[_0x18824d(0xc4)],_0x2f610d[_0x18824d(0xd8)]===_0x18824d(0xd7)?_0x18824d(0xef):_0x18824d(0xd7)),_0x4cb4bb=await Promise[_0x18824d(0xe0)](_0x1119a8['map'](_0x23b8ce=>_0x1b8495({'appCode':_0x40a77c[_0x18824d(0xc4)],'scope':_0x23b8ce,'code':_0x5093f8['trim']()||undefined}))),_0x511589=_0x1119a8[_0x18824d(0xd6)](_0x18824d(0xf0))?_0x4cb4bb['flatMap']((_0x348c1f,_0x48db34)=>_0x1119a8[_0x48db34]===_0x18824d(0xf0)?_0x348c1f[_0x18824d(0xf0)]:[]):[],_0x5bfd53=_0x1119a8[_0x18824d(0xd6)]('company')?_0x4cb4bb[_0x18824d(0xcc)]((_0x6ff0f5,_0x4c1633)=>_0x1119a8[_0x4c1633]==='company'?_0x6ff0f5[_0x18824d(0xc3)]:[]):[],_0x5c78a2=new Set([..._0x511589['map'](_0x449633=>_0x449633[_0x18824d(0xcb)]?.[_0x18824d(0xbf)]())[_0x18824d(0xec)](_0x1eebc0=>Boolean(_0x1eebc0)),..._0x5bfd53[_0x18824d(0xe4)](_0x3585dd=>_0x3585dd[_0x18824d(0xcb)]?.['trim']())[_0x18824d(0xec)](_0x335cc7=>Boolean(_0x335cc7))]),_0x419d94=_0x5093f8[_0x18824d(0xbf)]()?[_0x5093f8[_0x18824d(0xbf)]()]:undefined,_0x334237=_0x1119a8['length']===0x2&&_0x1119a8[_0x18824d(0xd6)]('personal')&&_0x1119a8[_0x18824d(0xd6)]('company'),_0x5d6565=_0x334237?_0x1f0693(_0x2f610d,_0x5c78a2,_0x419d94):[],_0x3da44b=_0x4b7300({'env':_0x326bf9,'accessKey':_0x299243,'appCode':_0x40a77c[_0x18824d(0xc4)],'activeSkillCodes':_0x5c78a2,'pruneSkillCodes':_0x419d94,'scopes':_0x1119a8,'protectedLinkRoots':_0x5d2e2d[_0x18824d(0xd3)]}),_0x51395e=[];for(const _0x930341 of _0x511589){_0x51395e[_0x18824d(0xc2)](_0x3fe8b7(_0x930341,_0x18824d(0xf0),{'env':_0x326bf9,'accessKey':_0x299243,'appCode':_0x40a77c[_0x18824d(0xc4)],'force':_0x853a2d,'packageBytes':await downloadSkillPackage(_0x930341,'personal',_0x40a77c[_0x18824d(0xc4)],_0x2e60f0)}));}for(const _0xd3e44a of _0x5bfd53){_0x51395e[_0x18824d(0xc2)](_0x3fe8b7(_0xd3e44a,_0x18824d(0xc3),{'env':_0x326bf9,'accessKey':_0x299243,'appCode':_0x40a77c[_0x18824d(0xc4)],'force':_0x853a2d,'packageBytes':await downloadSkillPackage(_0xd3e44a,'company',_0x40a77c[_0x18824d(0xc4)],_0x2e60f0)}));}const _0x53be2b=_0x52a577(_0x51395e,_0x2f610d),_0x4009ee=countLinkActions(_0x53be2b);return{'ok':!![],'data':{'appCode':_0x40a77c['appCode'],..._0x2f610d[_0x18824d(0xd8)]==='project'?{'installTarget':{'scope':_0x2f610d['scope'],'skillRoots':[..._0x2f610d[_0x18824d(0xd3)]]}}:{},'personal':_0x511589['length'],'company':_0x5bfd53[_0x18824d(0xeb)],'materialized':_0x51395e[_0x18824d(0xeb)],'links':{'total':_0x53be2b[_0x18824d(0xeb)],'created':_0x4009ee[_0x18824d(0xd1)]??0x0,'updated':_0x4009ee[_0x18824d(0xcf)]??0x0,'unchanged':_0x4009ee[_0x18824d(0xc9)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x5d6565['filter'](_0x509256=>_0x509256['action']==='removed')[_0x18824d(0xeb)],'cacheDirs':_0x3da44b[_0x18824d(0xec)](_0x2e6375=>_0x2e6375[_0x18824d(0xd5)]===_0x18824d(0xd0))[_0x18824d(0xeb)],'skipped':[..._0x5d6565,..._0x3da44b][_0x18824d(0xec)](_0x2a7320=>_0x2a7320['action']===_0x18824d(0xde))[_0x18824d(0xeb)]},'skills':{'personal':_0x511589[_0x18824d(0xe4)](summarizeRuntimeSkill),'company':_0x5bfd53[_0x18824d(0xe4)](summarizeRuntimeSkill)}},'message':_0x18824d(0xdb)+_0x511589[_0x18824d(0xeb)]+_0x18824d(0xdf)+_0x5bfd53['length']+'\x20company\x20Skill(s).'};}async function downloadSkillPackage(_0x3ad9a5,_0x2d54e2,_0x6d4f38,_0x20455b){const _0x2ad4f0=a45_0x27e9c3,_0x99351b=_0x3ad9a5[_0x2ad4f0(0xe8)]?.[_0x2ad4f0(0xbf)]();return _0x99351b?_0x20455b(_0x2d54e2,_0x3ad9a5[_0x2ad4f0(0xcb)],_0x6d4f38,_0x99351b):_0x20455b(_0x2d54e2,_0x3ad9a5[_0x2ad4f0(0xcb)],_0x6d4f38);}function countLinkActions(_0xa90f98){const _0x2ca2c9=a45_0x27e9c3;return _0xa90f98[_0x2ca2c9(0xe2)]((_0x45a5fe,_0x35d36f)=>{const _0x31633d=_0x2ca2c9;return _0x45a5fe[_0x35d36f['action']]=(_0x45a5fe[_0x35d36f[_0x31633d(0xd5)]]??0x0)+0x1,_0x45a5fe;},{});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a46_0x1dba(){const _0x30112a=['66SAWhHi','remote','\x20local\x20Skill(s).','envName','745497cpUhHF','bool','map','company','production','2bURaYY','accessKey','global','authRequired','\x20remote\x20Skill(s).','read','appCode','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','../../../core/api-client.js','str','363070ZIBMbW','length','personal','../../../skills/runtime-skill-sync.js','11717224KLNctB','2561992dgmUDs','trim','local','2087964fhgYXd','project','1409001xvGVdV','9930354FvbVAt','Listed\x20','filter','list','scope','code'];a46_0x1dba=function(){return _0x30112a;};return a46_0x1dba();}const a46_0x4424e5=a46_0x3539;(function(_0xa4cb08,_0x1472c7){const _0x35bbb4=a46_0x3539,_0x116acb=_0xa4cb08();while(!![]){try{const _0x45ddcf=parseInt(_0x35bbb4(0x1d4))/0x1+parseInt(_0x35bbb4(0x1d9))/0x2*(parseInt(_0x35bbb4(0x1c9))/0x3)+parseInt(_0x35bbb4(0x1c4))/0x4+-parseInt(_0x35bbb4(0x1bf))/0x5*(parseInt(_0x35bbb4(0x1d0))/0x6)+parseInt(_0x35bbb4(0x1ca))/0x7+-parseInt(_0x35bbb4(0x1c3))/0x8+-parseInt(_0x35bbb4(0x1c7))/0x9;if(_0x45ddcf===_0x1472c7)break;else _0x116acb['push'](_0x116acb['shift']());}catch(_0x2d98f6){_0x116acb['push'](_0x116acb['shift']());}}}(a46_0x1dba,0xbe281));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';function a46_0x3539(_0x4793e4,_0x3c52b8){_0x4793e4=_0x4793e4-0x1b8;const _0x1dba8f=a46_0x1dba();let _0x3539c1=_0x1dba8f[_0x4793e4];return _0x3539c1;}import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':'skill','command':a46_0x4424e5(0x1cd),'description':a46_0x4424e5(0x1bc),'risk':a46_0x4424e5(0x1ba),'flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x519feb){const _0x7805ba=a46_0x4424e5,_0xfe3a7a=_0x519feb[_0x7805ba(0x1be)](_0x7805ba(0x1cf)),_0x46a5d2=normalizeListScope(_0x519feb[_0x7805ba(0x1be)]('scope'));if(_0x519feb[_0x7805ba(0x1d5)]('local')){const _0x23b578=_0x519feb[_0x7805ba(0x1da)];if(!_0x23b578)throw CliErrors[_0x7805ba(0x1b8)]();const {listLocalRuntimeSkills:_0x243263,resolveRuntimeSkillInstallTarget:_0x58a065}=await import(_0x7805ba(0x1c2)),_0x3b4b4c=_0x58a065(_0x519feb[_0x7805ba(0x1bb)],_0x519feb[_0x7805ba(0x1d5)](_0x7805ba(0x1c8))?'project':_0x7805ba(0x1db)),_0x14c5db=_0x243263({'env':_0x519feb[_0x7805ba(0x1d3)]??_0x7805ba(0x1d8),'accessKey':_0x23b578,'appCode':_0x519feb[_0x7805ba(0x1bb)],'scopes':listScopeToRuntimeScopes(_0x46a5d2),'code':_0xfe3a7a[_0x7805ba(0x1c5)]()||undefined},_0x3b4b4c),_0x4f0910=groupLocalRuntimeSkills(_0x14c5db);return{'ok':!![],'data':{'appCode':_0x519feb['appCode'],'source':_0x7805ba(0x1c6),..._0x3b4b4c[_0x7805ba(0x1ce)]===_0x7805ba(0x1c8)?{'installScope':_0x3b4b4c[_0x7805ba(0x1ce)]}:{},'scope':_0x46a5d2,'total':_0x14c5db[_0x7805ba(0x1c0)],'personal':_0x4f0910[_0x7805ba(0x1c1)][_0x7805ba(0x1c0)],'company':_0x4f0910[_0x7805ba(0x1d7)][_0x7805ba(0x1c0)],'items':_0x14c5db['map'](summarizeLocalRuntimeSkill),'skills':{'personal':_0x4f0910[_0x7805ba(0x1c1)][_0x7805ba(0x1d6)](summarizeLocalRuntimeSkill),'company':_0x4f0910[_0x7805ba(0x1d7)][_0x7805ba(0x1d6)](summarizeLocalRuntimeSkill)}},'message':_0x7805ba(0x1cb)+_0x14c5db[_0x7805ba(0x1c0)]+_0x7805ba(0x1d2)};}const {listRuntimeSkills:_0xb39e2e}=await import(_0x7805ba(0x1bd)),_0x5943dc=await _0xb39e2e({'appCode':_0x519feb['appCode'],'scope':listScopeToRemoteScope(_0x46a5d2),'code':_0xfe3a7a[_0x7805ba(0x1c5)]()||undefined}),_0x45b8e9=shouldListScope(_0x46a5d2,_0x7805ba(0x1c1))?_0x5943dc[_0x7805ba(0x1c1)]??[]:[],_0x35f92d=shouldListScope(_0x46a5d2,'company')?_0x5943dc[_0x7805ba(0x1d7)]??[]:[],_0x2f0bcb=[..._0x45b8e9,..._0x35f92d];return{'ok':!![],'data':{'appCode':_0x519feb[_0x7805ba(0x1bb)],'source':_0x7805ba(0x1d1),'scope':_0x46a5d2,'total':_0x2f0bcb['length'],'personal':_0x45b8e9[_0x7805ba(0x1c0)],'company':_0x35f92d[_0x7805ba(0x1c0)],'items':_0x2f0bcb['map'](summarizeRuntimeSkill),'skills':{'personal':_0x45b8e9['map'](summarizeRuntimeSkill),'company':_0x35f92d['map'](summarizeRuntimeSkill)}},'message':_0x7805ba(0x1cb)+_0x2f0bcb[_0x7805ba(0x1c0)]+_0x7805ba(0x1b9)};}};function groupLocalRuntimeSkills(_0x23d71a){const _0x552b70=a46_0x4424e5;return{'personal':_0x23d71a['filter'](_0x1a8222=>_0x1a8222[_0x552b70(0x1ce)]===_0x552b70(0x1c1)),'company':_0x23d71a[_0x552b70(0x1cc)](_0x2a7a57=>_0x2a7a57['scope']==='company'),'builtin':_0x23d71a[_0x552b70(0x1cc)](_0x239251=>_0x239251[_0x552b70(0x1ce)]==='builtin')};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a47_0x2e14d7=a47_0x37fe;(function(_0x1bf83d,_0x56a813){const _0x5b39a6=a47_0x37fe,_0x3544ca=_0x1bf83d();while(!![]){try{const _0x40d62c=parseInt(_0x5b39a6(0x100))/0x1+parseInt(_0x5b39a6(0xfc))/0x2*(parseInt(_0x5b39a6(0x105))/0x3)+-parseInt(_0x5b39a6(0x103))/0x4*(parseInt(_0x5b39a6(0xfe))/0x5)+-parseInt(_0x5b39a6(0x10a))/0x6*(parseInt(_0x5b39a6(0x101))/0x7)+-parseInt(_0x5b39a6(0x106))/0x8+-parseInt(_0x5b39a6(0xfd))/0x9*(-parseInt(_0x5b39a6(0x107))/0xa)+parseInt(_0x5b39a6(0x102))/0xb*(-parseInt(_0x5b39a6(0xff))/0xc);if(_0x40d62c===_0x56a813)break;else _0x3544ca['push'](_0x3544ca['shift']());}catch(_0x36153e){_0x3544ca['push'](_0x3544ca['shift']());}}}(a47_0x5e13,0x758f4));import{CONFIRM_WARNINGS_FLAG,DIAGRAM_FILE_FLAG,DIR_FLAG,PUSH_SCOPE_FLAG}from'../flags.js';import{skillPushDryRun,skillPushExecute}from'../push-execute.js';function a47_0x37fe(_0xf289b2,_0x2e8818){_0xf289b2=_0xf289b2-0xfc;const _0x5e13f1=a47_0x5e13();let _0x37fe88=_0x5e13f1[_0xf289b2];return _0x37fe88;}function a47_0x5e13(){const _0x5d9f8e=['7661322jJCIkn','10TrnHeM','3912MFUYKN','943017vBemcM','14KHbSix','15917DzxTCC','1300464INYPmr','将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','3YaOPXU','1932576pyozBJ','10OrohJb','skill','将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','1496532Jtarmo','1099238fuZzVG'];a47_0x5e13=function(){return _0x5d9f8e;};return a47_0x5e13();}export const pushCommand={'service':a47_0x2e14d7(0x108),'command':'push','description':a47_0x2e14d7(0x104),'risk':'write','confirmationDescription':a47_0x2e14d7(0x109),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a48_0xbdaae4=a48_0x85a9;function a48_0x11ab(){const _0xdee402=['12091150IrFdqu','5096850NfVJZq','9ZGOeLB','64sejZQM','18375MenSvK','5905680xNabAn','str','dir','258736tyHyPF','72QZgAvE','953574PbAdzK','820708TtFJws','read','type','warnings','3fAyJfg','errors','Skill\x20validation\x20passed.'];a48_0x11ab=function(){return _0xdee402;};return a48_0x11ab();}(function(_0x11febc,_0x12bb54){const _0x47fa47=a48_0x85a9,_0x231a17=_0x11febc();while(!![]){try{const _0x378614=-parseInt(_0x47fa47(0x124))/0x1+-parseInt(_0x47fa47(0x134))/0x2*(parseInt(_0x47fa47(0x129))/0x3)+parseInt(_0x47fa47(0x135))/0x4*(parseInt(_0x47fa47(0x130))/0x5)+-parseInt(_0x47fa47(0x131))/0x6+parseInt(_0x47fa47(0x125))/0x7*(parseInt(_0x47fa47(0x12f))/0x8)+parseInt(_0x47fa47(0x12e))/0x9*(parseInt(_0x47fa47(0x12c))/0xa)+parseInt(_0x47fa47(0x12d))/0xb;if(_0x378614===_0x12bb54)break;else _0x231a17['push'](_0x231a17['shift']());}catch(_0x32449c){_0x231a17['push'](_0x231a17['shift']());}}}(a48_0x11ab,0x94c41));import{DIR_FLAG,STRICT_FLAG}from'../flags.js';import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';function a48_0x85a9(_0x5e90d1,_0x379b9e){_0x5e90d1=_0x5e90d1-0x124;const _0x11aba1=a48_0x11ab();let _0x85a91=_0x11aba1[_0x5e90d1];return _0x85a91;}export const validateCommand={'service':'skill','command':'validate','description':'Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','risk':a48_0xbdaae4(0x126),'requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x2b4bc1){const _0x2dc51a=a48_0xbdaae4,_0x434c39=_0x2b4bc1['bool']('strict'),_0x41dd5a=validateSkillDirectory(_0x2b4bc1[_0x2dc51a(0x132)](_0x2dc51a(0x133)),{'strict':_0x434c39});return throwIfSkillValidationFailed(_0x41dd5a,_0x434c39),{'ok':!![],'data':{'dir':_0x41dd5a['dir'],'type':_0x41dd5a[_0x2dc51a(0x127)],'errors':_0x41dd5a[_0x2dc51a(0x12a)],'warnings':_0x41dd5a[_0x2dc51a(0x128)]},'message':_0x2dc51a(0x12b)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x8f4782,_0x3d0997){const _0x48c13f=a49_0x2ea2,_0x24487d=_0x8f4782();while(!![]){try{const _0x1f8d0a=-parseInt(_0x48c13f(0x115))/0x1+parseInt(_0x48c13f(0x11f))/0x2+parseInt(_0x48c13f(0x11c))/0x3+-parseInt(_0x48c13f(0x127))/0x4+parseInt(_0x48c13f(0x12b))/0x5+-parseInt(_0x48c13f(0x113))/0x6*(parseInt(_0x48c13f(0x11b))/0x7)+-parseInt(_0x48c13f(0x120))/0x8*(-parseInt(_0x48c13f(0x124))/0x9);if(_0x1f8d0a===_0x3d0997)break;else _0x24487d['push'](_0x24487d['shift']());}catch(_0x1d1c15){_0x24487d['push'](_0x24487d['shift']());}}}(a49_0x632b,0x46a0a));import{existsSync,readFileSync,realpathSync,statSync}from'node:fs';function a49_0x632b(){const _0x21af0c=['7HxThXS','69210HDPvmV','replace','Mermaid\x20syntax\x20validation\x20failed.','374396BXEcaA','64576dFjLUP','window','Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.','--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.','477IAegGT','trim','validation','1059964aBPsKK','parse','utf8','default','2892310wimWMQ','1725342vhczWN','Mermaid\x20flowchart\x20file\x20not\x20found:\x20','374708kBjEXm','diagram','mermaid','Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.','Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.','defineProperties'];a49_0x632b=function(){return _0x21af0c;};return a49_0x632b();}import{resolve}from'node:path';import{JSDOM}from'jsdom';import{CliErrors}from'../../errors.js';let mermaidApiPromise;export async function readRequiredSkillDiagram(_0x3de374){const _0xfad32d=a49_0x2ea2;return(await readRequiredSkillDiagramInput(_0x3de374))[_0xfad32d(0x116)];}export async function readRequiredSkillDiagramInput(_0x1cb1c6){const _0x172424=a49_0x2ea2,_0x5e0a9e=_0x1cb1c6[_0x172424(0x125)]();if(!_0x5e0a9e)throw CliErrors[_0x172424(0x126)](_0x172424(0x123),_0x172424(0x122));let _0x47071c,_0x1d83f9;if(_0x5e0a9e==='-')try{_0x47071c=readFileSync(0x0,'utf8');}catch{throw CliErrors[_0x172424(0x126)](_0x172424(0x119));}else{const _0x14d0bb=resolve(_0x5e0a9e);if(!existsSync(_0x14d0bb))throw CliErrors[_0x172424(0x126)](_0x172424(0x114)+_0x14d0bb);if(!statSync(_0x14d0bb)['isFile']())throw CliErrors[_0x172424(0x126)]('Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x14d0bb);_0x1d83f9=realpathSync(_0x14d0bb),_0x47071c=readFileSync(_0x1d83f9,_0x172424(0x129));}return{'diagram':{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x47071c)},'sourceFilePath':_0x1d83f9};}export async function validateAndCanonicalizeMermaid(_0x13319c){const _0x1bc94e=a49_0x2ea2,_0x493f10=_0x13319c[_0x1bc94e(0x11d)](/\r\n/g,'\x0a')[_0x1bc94e(0x11d)](/\r/g,'\x0a')[_0x1bc94e(0x11d)](/\n+$/,'')+'\x0a';try{const _0x37a03b=await loadMermaidApi();await _0x37a03b[_0x1bc94e(0x128)](_0x493f10);}catch{throw diagramValidationError();}return _0x493f10;}function a49_0x2ea2(_0x32d42e,_0x270ca0){_0x32d42e=_0x32d42e-0x113;const _0x632b1b=a49_0x632b();let _0x2ea26a=_0x632b1b[_0x32d42e];return _0x2ea26a;}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x38872b=a49_0x2ea2;if(!(_0x38872b(0x121)in globalThis)||!('document'in globalThis)){const _0x127732=new JSDOM('');Object[_0x38872b(0x11a)](globalThis,{'window':{'configurable':!![],'value':_0x127732['window']},'document':{'configurable':!![],'value':_0x127732['window']['document']}});}return(await import(_0x38872b(0x117)))[_0x38872b(0x12a)];})()),mermaidApiPromise;}function diagramValidationError(){const _0x4ebb0c=a49_0x2ea2;return CliErrors[_0x4ebb0c(0x126)](_0x4ebb0c(0x11e),_0x4ebb0c(0x118));}
|