@lovrabet/lovrabet-cli 2.1.22 → 2.1.23-beta.1
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/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/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.d.ts +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.d.ts +2 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x340451,_0x732c5b){const _0x25f7b5=a39_0x531e,_0x4a3181=_0x340451();while(!![]){try{const _0x4c2c12=-parseInt(_0x25f7b5(0x13c))/0x1*(-parseInt(_0x25f7b5(0x13d))/0x2)+parseInt(_0x25f7b5(0x170))/0x3+-parseInt(_0x25f7b5(0x18b))/0x4+-parseInt(_0x25f7b5(0x180))/0x5+parseInt(_0x25f7b5(0x15d))/0x6*(-parseInt(_0x25f7b5(0x193))/0x7)+-parseInt(_0x25f7b5(0x188))/0x8*(-parseInt(_0x25f7b5(0x12a))/0x9)+-parseInt(_0x25f7b5(0x185))/0xa*(-parseInt(_0x25f7b5(0x12b))/0xb);if(_0x4c2c12===_0x732c5b)break;else _0x4a3181['push'](_0x4a3181['shift']());}catch(_0x1e7ad5){_0x4a3181['push'](_0x4a3181['shift']());}}}(a39_0xa0dd,0x80ed4));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';function a39_0x531e(_0x1c7793,_0x28fb49){_0x1c7793=_0x1c7793-0x12a;const _0xa0dda0=a39_0xa0dd();let _0x531e3f=_0xa0dda0[_0x1c7793];return _0x531e3f;}export function resolveDynamicServiceCommand(_0x192deb,_0x582fe7){const _0x559916=a39_0x531e,_0x1e2863=listLocalServiceTrees();let _0x36b7d9;for(const _0x5d3cd6 of _0x1e2863){const _0x196a87=matchServiceTreeCommand(_0x5d3cd6,_0x192deb);if(!_0x196a87)continue;(!_0x36b7d9||_0x196a87['command']['fullPath']['length']>_0x36b7d9[_0x559916(0x14b)][_0x559916(0x12d)][_0x559916(0x13e)])&&(_0x36b7d9={'tree':_0x5d3cd6,'command':_0x196a87[_0x559916(0x14b)],'remainingArgs':_0x196a87[_0x559916(0x15a)]});}if(!_0x36b7d9)return undefined;const _0x57012a={..._0x582fe7};return applyAppBinding(_0x36b7d9['tree'],_0x36b7d9[_0x559916(0x14b)],_0x57012a),{'definition':buildDynamicCommandDefinition(_0x36b7d9[_0x559916(0x163)],_0x36b7d9[_0x559916(0x14b)]),'args':_0x36b7d9[_0x559916(0x15a)],'flags':_0x57012a,'tree':_0x36b7d9[_0x559916(0x163)],'command':_0x36b7d9[_0x559916(0x14b)]};}export function generateDynamicServiceHelp(_0xc6118f){const _0x2d7ba3=a39_0x531e,_0x40e6ef=listLocalServiceTrees()[_0x2d7ba3(0x138)](_0xccad21=>_0xccad21['service'][_0x2d7ba3(0x137)]===_0xc6118f);if(!_0x40e6ef)return undefined;const _0x7f4b95=[CLI_BIN_NAME+'\x20'+_0xc6118f+_0x2d7ba3(0x16a),'',_0x40e6ef[_0x2d7ba3(0x161)][_0x2d7ba3(0x18c)]||_0xc6118f,_0x40e6ef['service'][_0x2d7ba3(0x12e)]?'\x20\x20'+_0x40e6ef['service']['description']:'','',_0x2d7ba3(0x182),..._0x40e6ef['commands'][_0x2d7ba3(0x151)](_0x3a8323=>{const _0x469b64=_0x2d7ba3,_0x29a041=_0x3a8323[_0x469b64(0x12d)]['slice'](0x1)['join']('\x20'),_0x3c5caf=_0x3a8323[_0x469b64(0x17e)]===_0x469b64(0x159)?'':'\x20['+_0x3a8323[_0x469b64(0x17e)]+']';return'\x20\x20'+_0x29a041[_0x469b64(0x17d)](0x18)+'\x20'+(_0x3a8323[_0x469b64(0x12e)]||'')+_0x3c5caf;}),'',_0x2d7ba3(0x140)+CLI_BIN_NAME+_0x2d7ba3(0x186)+_0xc6118f+_0x2d7ba3(0x176)][_0x2d7ba3(0x158)](Boolean);return _0x7f4b95[_0x2d7ba3(0x191)]('\x0a');}export function listDynamicServiceEntries(){const _0x5792e0=a39_0x531e;return listLocalServices()[_0x5792e0(0x151)](_0x1cd65f=>{const _0x2fe41b=_0x5792e0,_0xbcb468=_0x1cd65f[_0x2fe41b(0x183)];return{'service':_0xbcb468[_0x2fe41b(0x161)]['code'],'label':_0xbcb468[_0x2fe41b(0x161)][_0x2fe41b(0x18c)]||_0xbcb468[_0x2fe41b(0x161)][_0x2fe41b(0x137)],'commands':_0xbcb468['commands'][_0x2fe41b(0x151)](_0x3cca15=>({'command':dynamicCommandName(_0x3cca15),'description':_0x3cca15[_0x2fe41b(0x12e)]||_0x2fe41b(0x192)+_0x3cca15[_0x2fe41b(0x148)],'tag':riskTag(_0x3cca15[_0x2fe41b(0x17e)])}))};});}export function getDynamicServiceEntry(_0x239019){const _0x5c13d3=a39_0x531e;return listDynamicServiceEntries()[_0x5c13d3(0x138)](_0x31712c=>_0x31712c[_0x5c13d3(0x161)]===_0x239019);}export function listDynamicServiceDefinitions(_0x28b9f8){const _0x3b5774=a39_0x531e;return listLocalServiceTrees()[_0x3b5774(0x158)](_0x19e654=>!_0x28b9f8||_0x19e654['service'][_0x3b5774(0x137)]===_0x28b9f8)['flatMap'](_0x38fbc7=>_0x38fbc7['commands'][_0x3b5774(0x151)](_0x1bced4=>buildDynamicCommandDefinition(_0x38fbc7,_0x1bced4)));}export function getDynamicServiceDefinitions(_0x4b549a){const _0x51fd2a=listDynamicServiceDefinitions(_0x4b549a);return _0x51fd2a['length']>0x0?_0x51fd2a:undefined;}export function findDynamicServiceDefinition(_0x1c7c2f,_0x1f52f8){const _0x559d40=a39_0x531e;return listDynamicServiceDefinitions(_0x1c7c2f)[_0x559d40(0x138)](_0x24b8a2=>_0x24b8a2[_0x559d40(0x14b)]===_0x1f52f8);}export function buildDynamicCommandDefinition(_0x2f2345,_0x378265){const _0x5a71ee=a39_0x531e;return{'service':_0x2f2345[_0x5a71ee(0x161)][_0x5a71ee(0x137)],'command':dynamicCommandName(_0x378265),'description':_0x378265[_0x5a71ee(0x12e)]||_0x5a71ee(0x192)+_0x378265[_0x5a71ee(0x148)],'risk':_0x378265['risk'],..._0x378265[_0x5a71ee(0x17e)]===_0x5a71ee(0x159)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x378265)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x378265[_0x5a71ee(0x16f)][_0x5a71ee(0x151)](_0x393193=>({'name':_0x393193[_0x5a71ee(0x18c)],'description':_0x393193[_0x5a71ee(0x12e)]||_0x393193[_0x5a71ee(0x18c)],'required':_0x393193['required']})),'flags':_0x378265['flags'][_0x5a71ee(0x151)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x378265),async 'dryRun'(_0x2bc7c4){const _0x8b09c5=_0x5a71ee,_0x10c519=await compilePlan(_0x378265,_0x2bc7c4);return{'method':_0x8b09c5(0x194),'url':_0x378265[_0x8b09c5(0x148)],'body':{'target':targetPreview(_0x10c519),'params':_0x10c519['params']},'description':_0x8b09c5(0x18d)+_0x378265[_0x8b09c5(0x148)]};},async 'execute'(_0x4eaf27){const _0x40acd3=_0x5a71ee,_0x3f500f=await compilePlan(_0x378265,_0x4eaf27),_0x91700c=Date[_0x40acd3(0x168)](),_0x10e789=await executePlan(_0x3f500f,_0x378265,_0x4eaf27),_0x41db00=Date['now']()-_0x91700c;return{'ok':!![],'data':{'service':_0x2f2345['service'],'command':_0x378265[_0x40acd3(0x148)],'target':targetPreview(_0x3f500f),'result':_0x10e789,'elapsed':_0x41db00},'message':'Service\x20command\x20'+_0x378265[_0x40acd3(0x148)]+_0x40acd3(0x14a)+_0x41db00+'ms'};}};}function buildDynamicConfirmationDescription(_0x2e5748){const _0x22e82d=a39_0x531e,_0xf970=_0x2e5748['description']||_0x2e5748[_0x22e82d(0x148)],_0x14aa16=_0x2e5748[_0x22e82d(0x17e)]===_0x22e82d(0x189)?_0x22e82d(0x152):_0x22e82d(0x155);return _0x22e82d(0x166)+_0xf970+'”。'+_0x14aa16;}function a39_0xa0dd(){const _0x2042b5=['Preview\x20dynamic\x20service\x20command:\x20','ctx.','Cannot\x20resolve\x20datatable\x20\x22','scriptName','join','Run\x20service\x20command\x20','1694NOXRyC','SERVICE_TREE','\x20\x20MAP\x20TO','423HpdRPF','11NuxhQi','bff','fullPath','description','employeeId','envName','cliName','required','json','\x20requires\x20target.functionName.','type','\x20\x20[','code','find','bffCode','\x20\x20SERVICE\x20TREE\x20TARGET','appcode','1WtRjhW','2858nuYiIx','length','appBindings','Use\x20`','default','rawFlags','sqlCode','bffId','env','\x20->\x20','loginName','cliPath','push','\x20completed\x20in\x20','command','app','appCode','slice','datasetCode','entries','map','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','\x20\x20\x20\x20','该命令被清单标记为写入,可能修改业务数据或服务状态。','mapTo','boolean','filter','read','remainingArgs','Service\x20command\x20','\x20\x20\x20\x20kind:\x20\x20\x20\x20','24618YZwANA','Unsupported\x20service\x20target\x20kind:\x20','trim','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','service','appRef','tree','datatable','operator','将通过\x20Service\x20Tree\x20执行“','source','now','const','\x20<command>\x20[flags]','data','string','Unknown\x20appRef\x20\x22','target','args','2705352gxIsEk','\x20\x20\x20\x20command:\x20','validation','number','userName','\x20\x20\x20\x20datatable:\x20','`\x20to\x20inspect\x20the\x20manifest.','startsWith','some','tenantCode','fromEntries','params','nickName','padEnd','risk','kind','4254000kRXJWe','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','Commands:','normalizedManifest','userId','16710630XqFspY','\x20service\x20detail\x20--service\x20','sql','7128MpXOHk','high-risk-write','\x20\x20\x20\x20functionName:\x20','977372kxHRHg','name'];a39_0xa0dd=function(){return _0x2042b5;};return a39_0xa0dd();}function dynamicCommandName(_0x1f8e52){const _0x54bd80=a39_0x531e;return _0x1f8e52[_0x54bd80(0x12d)][_0x54bd80(0x14e)](0x1)[_0x54bd80(0x191)]('\x20');}function riskTag(_0x936c44){const _0x543cc2=a39_0x531e;return _0x936c44===_0x543cc2(0x159)?'':_0x543cc2(0x136)+_0x936c44+']';}function flagToCommandFlag(_0x464068){const _0x46b52b=a39_0x531e;return{'name':_0x464068[_0x46b52b(0x131)],'type':_0x464068[_0x46b52b(0x135)]===_0x46b52b(0x133)?'string':_0x464068[_0x46b52b(0x135)],'description':_0x464068[_0x46b52b(0x12e)]||_0x464068['name'],'required':_0x464068[_0x46b52b(0x132)],'default':isPrimitiveFlagDefault(_0x464068[_0x46b52b(0x141)])?_0x464068[_0x46b52b(0x141)]:undefined,'enum':_0x464068['enum']};}async function compilePlan(_0x453c06,_0x41fb5a){const _0x54b0d8=a39_0x531e;return compileServiceTreeCommand(_0x453c06,{'flags':_0x41fb5a[_0x54b0d8(0x142)],'args':_0x41fb5a[_0x54b0d8(0x16f)],'context':await buildServiceContext(_0x453c06,_0x41fb5a)});}async function buildServiceContext(_0x47db1b,_0x5211b7){const _0x2b51ba=a39_0x531e,_0x4cf763={'appCode':_0x5211b7[_0x2b51ba(0x14d)],'env':_0x5211b7[_0x2b51ba(0x130)],'envName':_0x5211b7[_0x2b51ba(0x130)]};if(!usesRuntimeContext(_0x47db1b))return _0x4cf763;const _0x4ff008=await getLoginUserInfo(),_0x47f69d=pickFirst(_0x4ff008[_0x2b51ba(0x184)],_0x4ff008['id']);return{..._0x4cf763,'user':_0x4ff008,'userId':_0x47f69d,'id':_0x4ff008['id'],'username':pickFirst(_0x4ff008['username'],_0x4ff008[_0x2b51ba(0x174)],_0x4ff008[_0x2b51ba(0x147)]),'userName':_0x4ff008['userName'],'nickname':pickFirst(_0x4ff008['nickname'],_0x4ff008[_0x2b51ba(0x17c)]),'nickName':_0x4ff008['nickName'],'tenantCode':_0x4ff008[_0x2b51ba(0x179)],'employeeId':_0x4ff008[_0x2b51ba(0x12f)]};}function usesRuntimeContext(_0x19c380){const _0x3841cb=a39_0x531e;return _0x19c380[_0x3841cb(0x156)][_0x3841cb(0x178)](_0xd878a8=>typeof _0xd878a8['source']==='string'&&(_0xd878a8[_0x3841cb(0x167)][_0x3841cb(0x177)]('context.')||_0xd878a8[_0x3841cb(0x167)]['startsWith'](_0x3841cb(0x18e))));}function pickFirst(..._0x2435cb){return _0x2435cb['find'](_0x42f384=>_0x42f384!==undefined&&_0x42f384!==null);}async function executePlan(_0x10599b,_0x49bc2f,_0x885850){const _0x3502d0=a39_0x531e;if(_0x10599b['kind']===_0x3502d0(0x16b)){const _0x4304c4=await resolveDatasetCode(_0x10599b,_0x49bc2f,_0x885850);return executeData(_0x4304c4,_0x10599b['command'],_0x10599b[_0x3502d0(0x17b)]);}if(_0x10599b[_0x3502d0(0x17f)]===_0x3502d0(0x187)){if(!_0x10599b[_0x3502d0(0x143)])throw CliErrors[_0x3502d0(0x172)](_0x3502d0(0x15b)+_0x49bc2f['cliPath']+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x10599b[_0x3502d0(0x143)],normalizeScalarParams(_0x10599b[_0x3502d0(0x17b)]));}if(_0x10599b[_0x3502d0(0x17f)]===_0x3502d0(0x12c)){const _0x471420=_0x10599b['scriptName']||_0x10599b[_0x3502d0(0x139)]||(_0x10599b[_0x3502d0(0x144)]==null?'':String(_0x10599b[_0x3502d0(0x144)]));if(!_0x471420)throw CliErrors[_0x3502d0(0x172)](_0x3502d0(0x15b)+_0x49bc2f['cliPath']+_0x3502d0(0x134));return executeSdkBff(_0x471420,_0x10599b[_0x3502d0(0x17b)]);}throw CliErrors[_0x3502d0(0x172)](_0x3502d0(0x15e)+_0x10599b[_0x3502d0(0x17f)]);}async function resolveDatasetCode(_0x54a66,_0x457705,_0x5ac14a){const _0x360714=a39_0x531e;if(_0x54a66['datasetCode'])return _0x54a66[_0x360714(0x14f)];if(!_0x54a66[_0x360714(0x164)])throw CliErrors[_0x360714(0x172)](_0x360714(0x15b)+_0x457705[_0x360714(0x148)]+_0x360714(0x153));const _0x43faf9=await listDatasets(_0x5ac14a['appCode']),_0x24b989=_0x43faf9['find'](_0x12bee8=>_0x12bee8['dbtableConfig']?.['tableName']===_0x54a66[_0x360714(0x164)]);if(!_0x24b989?.[_0x360714(0x137)])throw CliErrors[_0x360714(0x172)](_0x360714(0x18f)+_0x54a66[_0x360714(0x164)]+_0x360714(0x160)+_0x5ac14a[_0x360714(0x14d)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x24b989[_0x360714(0x137)];}function applyAppBinding(_0x4ce63e,_0x12a53b,_0x4e5aa7){const _0x208307=a39_0x531e,_0x243c53=_0x12a53b['target'][_0x208307(0x162)];if(!_0x243c53)return;const _0x5dd3ce=_0x4ce63e[_0x208307(0x13f)][_0x243c53];if(!_0x5dd3ce)throw CliErrors[_0x208307(0x172)](_0x208307(0x16d)+_0x243c53+'\x22\x20in\x20service\x20command\x20'+_0x12a53b[_0x208307(0x148)]+'.',_0x208307(0x181));const _0x3de7d5=_0x5dd3ce[_0x208307(0x13b)]||_0x5dd3ce[_0x208307(0x14d)];_0x3de7d5&&!hasText(_0x4e5aa7[_0x208307(0x13b)])&&(_0x4e5aa7['appcode']=_0x3de7d5),_0x5dd3ce[_0x208307(0x14c)]&&!hasText(_0x4e5aa7[_0x208307(0x14c)])&&!hasText(_0x4e5aa7[_0x208307(0x13b)])&&(_0x4e5aa7['app']=_0x5dd3ce[_0x208307(0x14c)]),_0x5dd3ce['env']&&!hasText(_0x4e5aa7[_0x208307(0x145)])&&(_0x4e5aa7[_0x208307(0x145)]=_0x5dd3ce[_0x208307(0x145)]);}function renderDynamicCommandHelp(_0x320eae){const _0x2ae17d=a39_0x531e,_0x262b05=[_0x2ae17d(0x13a),_0x2ae17d(0x15c)+_0x320eae[_0x2ae17d(0x16e)][_0x2ae17d(0x17f)],_0x2ae17d(0x171)+_0x320eae[_0x2ae17d(0x16e)]['command']];if(_0x320eae[_0x2ae17d(0x16e)]['datasetCode'])_0x262b05['push']('\x20\x20\x20\x20datasetCode:\x20'+_0x320eae[_0x2ae17d(0x16e)][_0x2ae17d(0x14f)]);if(_0x320eae[_0x2ae17d(0x16e)][_0x2ae17d(0x164)])_0x262b05[_0x2ae17d(0x149)](_0x2ae17d(0x175)+_0x320eae[_0x2ae17d(0x16e)]['datatable']);if(_0x320eae[_0x2ae17d(0x16e)][_0x2ae17d(0x143)])_0x262b05['push']('\x20\x20\x20\x20sqlCode:\x20'+_0x320eae[_0x2ae17d(0x16e)]['sqlCode']);if(_0x320eae['target'][_0x2ae17d(0x190)])_0x262b05[_0x2ae17d(0x149)](_0x2ae17d(0x18a)+_0x320eae[_0x2ae17d(0x16e)]['scriptName']);if(_0x320eae[_0x2ae17d(0x156)][_0x2ae17d(0x13e)]>0x0){_0x262b05[_0x2ae17d(0x149)]('',_0x2ae17d(0x195));for(const _0x1fba9e of _0x320eae[_0x2ae17d(0x156)]){_0x262b05['push'](_0x2ae17d(0x154)+(_0x1fba9e['source']||_0x2ae17d(0x169))+_0x2ae17d(0x146)+_0x1fba9e['target']+(_0x1fba9e[_0x2ae17d(0x165)]?'.'+_0x1fba9e[_0x2ae17d(0x165)]:''));}}return _0x262b05[_0x2ae17d(0x191)]('\x0a');}function targetPreview(_0x5a09d4){const _0x2581dc=a39_0x531e;return{'kind':_0x5a09d4['kind'],'command':_0x5a09d4[_0x2581dc(0x14b)],'appRef':_0x5a09d4[_0x2581dc(0x162)],'datasetCode':_0x5a09d4['datasetCode'],'datatable':_0x5a09d4[_0x2581dc(0x164)],'sqlCode':_0x5a09d4['sqlCode'],'bffCode':_0x5a09d4[_0x2581dc(0x139)],'bffId':_0x5a09d4['bffId'],'functionName':_0x5a09d4[_0x2581dc(0x190)]};}function normalizeScalarParams(_0x278e86){const _0x4b7aae=a39_0x531e;return Object[_0x4b7aae(0x17a)](Object[_0x4b7aae(0x150)](_0x278e86)[_0x4b7aae(0x158)](([,_0x4c2b21])=>typeof _0x4c2b21===_0x4b7aae(0x16c)||typeof _0x4c2b21===_0x4b7aae(0x173)));}function hasText(_0x3befe9){const _0x20b73f=a39_0x531e;return typeof _0x3befe9===_0x20b73f(0x16c)&&_0x3befe9[_0x20b73f(0x15f)]()['length']>0x0;}function isPrimitiveFlagDefault(_0x435014){const _0x148261=a39_0x531e;return _0x435014===undefined||typeof _0x435014===_0x148261(0x16c)||typeof _0x435014===_0x148261(0x173)||typeof _0x435014===_0x148261(0x157);}
|
|
1
|
+
(function(_0x43223c,_0x2b2791){const _0x254b26=a39_0x7603,_0x87b1aa=_0x43223c();while(!![]){try{const _0x53735c=parseInt(_0x254b26(0xd9))/0x1+parseInt(_0x254b26(0xcd))/0x2+-parseInt(_0x254b26(0xfa))/0x3*(-parseInt(_0x254b26(0x103))/0x4)+parseInt(_0x254b26(0xe2))/0x5*(-parseInt(_0x254b26(0xe4))/0x6)+parseInt(_0x254b26(0xb4))/0x7+parseInt(_0x254b26(0x102))/0x8+parseInt(_0x254b26(0xec))/0x9*(-parseInt(_0x254b26(0x105))/0xa);if(_0x53735c===_0x2b2791)break;else _0x87b1aa['push'](_0x87b1aa['shift']());}catch(_0x353802){_0x87b1aa['push'](_0x87b1aa['shift']());}}}(a39_0x2d56,0x4cccd));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(_0x12d97f,_0x5161){const _0x468519=a39_0x7603,_0x5c73dc=listLocalServiceTrees();let _0x4389a4;for(const _0x469879 of _0x5c73dc){const _0x601d6c=matchServiceTreeCommand(_0x469879,_0x12d97f);if(!_0x601d6c)continue;(!_0x4389a4||_0x601d6c[_0x468519(0xde)][_0x468519(0xda)][_0x468519(0xc6)]>_0x4389a4[_0x468519(0xde)][_0x468519(0xda)][_0x468519(0xc6)])&&(_0x4389a4={'tree':_0x469879,'command':_0x601d6c[_0x468519(0xde)],'remainingArgs':_0x601d6c[_0x468519(0x9f)]});}if(!_0x4389a4)return undefined;const _0x26b87c={..._0x5161};return applyAppBinding(_0x4389a4['tree'],_0x4389a4[_0x468519(0xde)],_0x26b87c),{'definition':buildDynamicCommandDefinition(_0x4389a4[_0x468519(0xb7)],_0x4389a4[_0x468519(0xde)]),'args':_0x4389a4['remainingArgs'],'flags':_0x26b87c,'tree':_0x4389a4['tree'],'command':_0x4389a4[_0x468519(0xde)]};}export function generateDynamicServiceHelp(_0x2c1496){const _0x5e9f9a=a39_0x7603,_0x2d5fdf=listLocalServiceTrees()[_0x5e9f9a(0xd3)](_0x17d9f5=>_0x17d9f5['service']['code']===_0x2c1496);if(!_0x2d5fdf)return undefined;const _0xb8336e=[CLI_BIN_NAME+'\x20'+_0x2c1496+'\x20<command>\x20[flags]','',_0x2d5fdf[_0x5e9f9a(0xd8)]['name']||_0x2c1496,_0x2d5fdf[_0x5e9f9a(0xd8)][_0x5e9f9a(0xba)]?'\x20\x20'+_0x2d5fdf[_0x5e9f9a(0xd8)][_0x5e9f9a(0xba)]:'','',_0x5e9f9a(0xcf),..._0x2d5fdf[_0x5e9f9a(0xb9)]['map'](_0x5ca6ea=>{const _0x16e724=_0x5e9f9a,_0x399ad9=_0x5ca6ea[_0x16e724(0xda)]['slice'](0x1)['join']('\x20'),_0x2dba53=_0x5ca6ea[_0x16e724(0x108)]===_0x16e724(0xf5)?'':'\x20['+_0x5ca6ea[_0x16e724(0x108)]+']';return'\x20\x20'+_0x399ad9[_0x16e724(0xd7)](0x18)+'\x20'+(_0x5ca6ea[_0x16e724(0xba)]||'')+_0x2dba53;}),'','Use\x20`'+CLI_BIN_NAME+_0x5e9f9a(0xa6)+_0x2c1496+_0x5e9f9a(0xf4)][_0x5e9f9a(0xea)](Boolean);return _0xb8336e[_0x5e9f9a(0xc2)]('\x0a');}function a39_0x7603(_0x45c892,_0xe21f09){_0x45c892=_0x45c892-0x9d;const _0x2d56f9=a39_0x2d56();let _0x760363=_0x2d56f9[_0x45c892];return _0x760363;}export function listDynamicServiceEntries(){const _0x3148d1=a39_0x7603;return listLocalServices()[_0x3148d1(0x109)](_0x3bb26a=>{const _0x548021=_0x3148d1,_0x21281b=_0x3bb26a[_0x548021(0xb1)];return{'service':_0x21281b[_0x548021(0xd8)]['code'],'label':_0x21281b['service'][_0x548021(0xc7)]||_0x21281b[_0x548021(0xd8)][_0x548021(0xad)],'commands':_0x21281b[_0x548021(0xb9)][_0x548021(0x109)](_0x4a72fc=>({'command':dynamicCommandName(_0x4a72fc),'description':_0x4a72fc['description']||'Run\x20service\x20command\x20'+_0x4a72fc[_0x548021(0x10a)],'tag':riskTag(_0x4a72fc[_0x548021(0x108)])}))};});}export function getDynamicServiceEntry(_0x503291){const _0x4f1c5c=a39_0x7603;return listDynamicServiceEntries()[_0x4f1c5c(0xd3)](_0x3010c0=>_0x3010c0['service']===_0x503291);}export function listDynamicServiceDefinitions(_0x2205af){const _0x368b11=a39_0x7603;return listLocalServiceTrees()[_0x368b11(0xea)](_0x233f2a=>!_0x2205af||_0x233f2a[_0x368b11(0xd8)]['code']===_0x2205af)[_0x368b11(0xd1)](_0x9bbf3=>_0x9bbf3['commands']['map'](_0x5081d9=>buildDynamicCommandDefinition(_0x9bbf3,_0x5081d9)));}export function getDynamicServiceDefinitions(_0x40995e){const _0x3d2645=a39_0x7603,_0x2fdede=listDynamicServiceDefinitions(_0x40995e);return _0x2fdede[_0x3d2645(0xc6)]>0x0?_0x2fdede:undefined;}export function findDynamicServiceDefinition(_0x1ae556,_0x1b10aa){const _0x2b247b=a39_0x7603;return listDynamicServiceDefinitions(_0x1ae556)['find'](_0x511382=>_0x511382[_0x2b247b(0xde)]===_0x1b10aa);}export function buildDynamicCommandDefinition(_0x15d2ff,_0x393175){const _0x5dcc52=a39_0x7603;return{'service':_0x15d2ff[_0x5dcc52(0xd8)][_0x5dcc52(0xad)],'command':dynamicCommandName(_0x393175),'description':_0x393175[_0x5dcc52(0xba)]||_0x5dcc52(0xdd)+_0x393175[_0x5dcc52(0x10a)],'risk':_0x393175['risk'],..._0x393175['risk']===_0x5dcc52(0xf5)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x393175)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x393175[_0x5dcc52(0x9d)][_0x5dcc52(0x109)](_0x385bd5=>({'name':_0x385bd5['name'],'description':_0x385bd5['description']||_0x385bd5[_0x5dcc52(0xc7)],'required':_0x385bd5['required']})),'flags':_0x393175[_0x5dcc52(0xd2)]['map'](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x393175),async 'dryRun'(_0x4f1a31){const _0x220f88=_0x5dcc52,_0x7f9034=await compilePlan(_0x393175,_0x4f1a31);return{'method':_0x220f88(0xce),'url':_0x393175[_0x220f88(0x10a)],'body':{'target':targetPreview(_0x7f9034),'params':_0x7f9034[_0x220f88(0xbb)]},'description':_0x220f88(0xc8)+_0x393175[_0x220f88(0x10a)]};},async 'execute'(_0x24703c){const _0x4a846e=_0x5dcc52,_0x317bb9=await compilePlan(_0x393175,_0x24703c),_0x4892a2=Date[_0x4a846e(0x100)](),_0x5738e2=await executePlan(_0x317bb9,_0x393175,_0x24703c),_0x4c6f73=Date['now']()-_0x4892a2;return{'ok':!![],'data':{'service':_0x15d2ff[_0x4a846e(0xd8)],'command':_0x393175[_0x4a846e(0x10a)],'target':targetPreview(_0x317bb9),'result':_0x5738e2,'elapsed':_0x4c6f73},'message':_0x4a846e(0xae)+_0x393175[_0x4a846e(0x10a)]+_0x4a846e(0xd6)+_0x4c6f73+'ms'};}};}function buildDynamicConfirmationDescription(_0x2d3f11){const _0x2b2f29=a39_0x7603,_0x37f7cc=_0x2d3f11[_0x2b2f29(0xba)]||_0x2d3f11['cliPath'],_0x4b276b=_0x2d3f11[_0x2b2f29(0x108)]===_0x2b2f29(0xb6)?_0x2b2f29(0xaf):_0x2b2f29(0xa2);return _0x2b2f29(0xa5)+_0x37f7cc+'”。'+_0x4b276b;}function dynamicCommandName(_0x3396bd){const _0x172119=a39_0x7603;return _0x3396bd['fullPath'][_0x172119(0xe8)](0x1)[_0x172119(0xc2)]('\x20');}function riskTag(_0x2d4b6d){const _0x691ff2=a39_0x7603;return _0x2d4b6d===_0x691ff2(0xf5)?'':_0x691ff2(0xc3)+_0x2d4b6d+']';}function flagToCommandFlag(_0x2678bd){const _0x2ba0dc=a39_0x7603;return{'name':_0x2678bd[_0x2ba0dc(0xeb)],'type':_0x2678bd[_0x2ba0dc(0xa4)]===_0x2ba0dc(0xbc)?_0x2ba0dc(0xe9):_0x2678bd[_0x2ba0dc(0xa4)],'description':_0x2678bd['description']||_0x2678bd['name'],'required':_0x2678bd[_0x2ba0dc(0xa0)],'default':isPrimitiveFlagDefault(_0x2678bd[_0x2ba0dc(0xdf)])?_0x2678bd[_0x2ba0dc(0xdf)]:undefined,'enum':_0x2678bd[_0x2ba0dc(0xe3)]};}async function compilePlan(_0x7e1ba2,_0x317cdc){const _0x50bdf0=a39_0x7603;return compileServiceTreeCommand(_0x7e1ba2,{'flags':_0x317cdc['rawFlags'],'args':_0x317cdc[_0x50bdf0(0x9d)],'context':await buildServiceContext(_0x7e1ba2,_0x317cdc)});}async function buildServiceContext(_0x10ef7c,_0x3a21fc){const _0x560acd=a39_0x7603,_0x131915={'appCode':_0x3a21fc[_0x560acd(0xb5)],'env':_0x3a21fc['envName'],'envName':_0x3a21fc[_0x560acd(0xc9)]};if(!usesRuntimeContext(_0x10ef7c))return _0x131915;const _0x128aac=await getLoginUserInfo(),_0x4d7596=pickFirst(_0x128aac[_0x560acd(0xbf)],_0x128aac['id']);return{..._0x131915,'user':_0x128aac,'userId':_0x4d7596,'id':_0x128aac['id'],'username':pickFirst(_0x128aac[_0x560acd(0xfe)],_0x128aac['userName'],_0x128aac['loginName']),'userName':_0x128aac[_0x560acd(0xa7)],'nickname':pickFirst(_0x128aac[_0x560acd(0x106)],_0x128aac[_0x560acd(0xb3)]),'nickName':_0x128aac[_0x560acd(0xb3)],'tenantCode':_0x128aac[_0x560acd(0xbe)],'employeeId':_0x128aac[_0x560acd(0xf2)]};}function usesRuntimeContext(_0x3dd287){const _0x6b0864=a39_0x7603;return _0x3dd287[_0x6b0864(0xd0)][_0x6b0864(0xa8)](_0x1bfb75=>typeof _0x1bfb75['source']===_0x6b0864(0xe9)&&(_0x1bfb75[_0x6b0864(0xdb)]['startsWith'](_0x6b0864(0xa1))||_0x1bfb75[_0x6b0864(0xdb)][_0x6b0864(0xf8)]('ctx.')));}function pickFirst(..._0x3cdf1a){return _0x3cdf1a['find'](_0x35f476=>_0x35f476!==undefined&&_0x35f476!==null);}async function executePlan(_0xf96d3,_0x6fdb9b,_0x346b1f){const _0x29749d=a39_0x7603;if(_0xf96d3[_0x29749d(0xc5)]===_0x29749d(0xfd)){const _0x16ac9b=await resolveDatasetCode(_0xf96d3,_0x6fdb9b,_0x346b1f);return executeData(_0x16ac9b,_0xf96d3[_0x29749d(0xde)],_0xf96d3[_0x29749d(0xbb)]);}if(_0xf96d3[_0x29749d(0xc5)]===_0x29749d(0xee)){if(!_0xf96d3[_0x29749d(0x107)])throw CliErrors[_0x29749d(0xe5)]('Service\x20command\x20'+_0x6fdb9b['cliPath']+_0x29749d(0xd4));return executeSdkSql(_0xf96d3[_0x29749d(0x107)],normalizeScalarParams(_0xf96d3['params']));}if(_0xf96d3[_0x29749d(0xc5)]===_0x29749d(0xff)){const _0x85b53e=_0xf96d3[_0x29749d(0xfb)]||_0xf96d3['bffCode']||(_0xf96d3[_0x29749d(0xaa)]==null?'':String(_0xf96d3[_0x29749d(0xaa)]));if(!_0x85b53e)throw CliErrors['validation'](_0x29749d(0xae)+_0x6fdb9b[_0x29749d(0x10a)]+_0x29749d(0xf7));return executeSdkBff(_0x85b53e,_0xf96d3['params']);}throw CliErrors['validation'](_0x29749d(0xe1)+_0xf96d3[_0x29749d(0xc5)]);}async function resolveDatasetCode(_0x50633e,_0x15c3f5,_0x4748cf){const _0x46c0ba=a39_0x7603;if(_0x50633e[_0x46c0ba(0xab)])return _0x50633e[_0x46c0ba(0xab)];if(!_0x50633e['datatable'])throw CliErrors[_0x46c0ba(0xe5)](_0x46c0ba(0xae)+_0x15c3f5[_0x46c0ba(0x10a)]+_0x46c0ba(0xbd));const _0x52f0ca=await listDatasets(_0x4748cf['appCode']),_0x2a1ae7=_0x52f0ca[_0x46c0ba(0xd3)](_0x4c5797=>_0x4c5797[_0x46c0ba(0xf1)]?.['tableName']===_0x50633e[_0x46c0ba(0x101)]);if(!_0x2a1ae7?.[_0x46c0ba(0xad)])throw CliErrors[_0x46c0ba(0xe5)](_0x46c0ba(0xef)+_0x50633e[_0x46c0ba(0x101)]+'\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20'+_0x4748cf[_0x46c0ba(0xb5)]+'.',_0x46c0ba(0x104));return _0x2a1ae7[_0x46c0ba(0xad)];}function applyAppBinding(_0x44baf9,_0x1c03e2,_0x493a04){const _0x516b42=a39_0x7603,_0x14cdad=_0x1c03e2['target'][_0x516b42(0xa9)];if(!_0x14cdad)return;const _0x3217be=_0x44baf9['appBindings'][_0x14cdad];if(!_0x3217be)throw CliErrors[_0x516b42(0xe5)](_0x516b42(0xd5)+_0x14cdad+'\x22\x20in\x20service\x20command\x20'+_0x1c03e2[_0x516b42(0x10a)]+'.',_0x516b42(0xc1));const _0x5bd4e3=_0x3217be[_0x516b42(0xed)]||_0x3217be[_0x516b42(0xb5)];_0x5bd4e3&&!hasText(_0x493a04['appcode'])&&(_0x493a04[_0x516b42(0xed)]=_0x5bd4e3),_0x3217be[_0x516b42(0xa3)]&&!hasText(_0x493a04[_0x516b42(0xa3)])&&!hasText(_0x493a04[_0x516b42(0xed)])&&(_0x493a04[_0x516b42(0xa3)]=_0x3217be[_0x516b42(0xa3)]),_0x3217be[_0x516b42(0xac)]&&!hasText(_0x493a04[_0x516b42(0xac)])&&(_0x493a04[_0x516b42(0xac)]=_0x3217be[_0x516b42(0xac)]);}function a39_0x2d56(){const _0x4a2a80=['envName','\x20\x20\x20\x20kind:\x20\x20\x20\x20','operator','boolean','607640tEPNgZ','SERVICE_TREE','Commands:','mapTo','flatMap','flags','find','\x20requires\x20target.sqlCode.','Unknown\x20appRef\x20\x22','\x20completed\x20in\x20','padEnd','service','435818iwpyGw','fullPath','source','\x20\x20\x20\x20','Run\x20service\x20command\x20','command','default','entries','Unsupported\x20service\x20target\x20kind:\x20','11915ddWFPX','enum','966XlnKom','validation','trim','push','slice','string','filter','cliName','297PLlRBB','appcode','sql','Cannot\x20resolve\x20datatable\x20\x22','\x20\x20\x20\x20sqlCode:\x20','dbtableConfig','employeeId','const','`\x20to\x20inspect\x20the\x20manifest.','read','\x20\x20SERVICE\x20TREE\x20TARGET','\x20requires\x20target.functionName.','startsWith','bffCode','12KMSyaZ','scriptName','\x20\x20MAP\x20TO','data','username','bff','now','datatable','1615280JdqpjG','270616gQvnVg','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','295830tAGBGP','nickname','sqlCode','risk','map','cliPath','args','\x20\x20\x20\x20command:\x20','remainingArgs','required','context.','该命令被清单标记为写入,可能修改业务数据或服务状态。','app','type','将通过\x20Service\x20Tree\x20执行“','\x20service\x20detail\x20--service\x20','userName','some','appRef','bffId','datasetCode','env','code','Service\x20command\x20','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','\x20\x20\x20\x20datatable:\x20','normalizedManifest','fromEntries','nickName','3236177VDSGMN','appCode','high-risk-write','tree','target','commands','description','params','json','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','tenantCode','userId','number','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','join','\x20\x20[','\x20\x20\x20\x20datasetCode:\x20','kind','length','name','Preview\x20dynamic\x20service\x20command:\x20'];a39_0x2d56=function(){return _0x4a2a80;};return a39_0x2d56();}function renderDynamicCommandHelp(_0x133000){const _0x459dc7=a39_0x7603,_0xfa8063=[_0x459dc7(0xf6),_0x459dc7(0xca)+_0x133000[_0x459dc7(0xb8)][_0x459dc7(0xc5)],_0x459dc7(0x9e)+_0x133000[_0x459dc7(0xb8)][_0x459dc7(0xde)]];if(_0x133000[_0x459dc7(0xb8)][_0x459dc7(0xab)])_0xfa8063[_0x459dc7(0xe7)](_0x459dc7(0xc4)+_0x133000['target'][_0x459dc7(0xab)]);if(_0x133000[_0x459dc7(0xb8)]['datatable'])_0xfa8063[_0x459dc7(0xe7)](_0x459dc7(0xb0)+_0x133000['target'][_0x459dc7(0x101)]);if(_0x133000[_0x459dc7(0xb8)][_0x459dc7(0x107)])_0xfa8063[_0x459dc7(0xe7)](_0x459dc7(0xf0)+_0x133000[_0x459dc7(0xb8)]['sqlCode']);if(_0x133000[_0x459dc7(0xb8)][_0x459dc7(0xfb)])_0xfa8063['push']('\x20\x20\x20\x20functionName:\x20'+_0x133000['target'][_0x459dc7(0xfb)]);if(_0x133000[_0x459dc7(0xd0)][_0x459dc7(0xc6)]>0x0){_0xfa8063[_0x459dc7(0xe7)]('',_0x459dc7(0xfc));for(const _0x58fb02 of _0x133000[_0x459dc7(0xd0)]){_0xfa8063[_0x459dc7(0xe7)](_0x459dc7(0xdc)+(_0x58fb02['source']||_0x459dc7(0xf3))+'\x20->\x20'+_0x58fb02[_0x459dc7(0xb8)]+(_0x58fb02[_0x459dc7(0xcb)]?'.'+_0x58fb02[_0x459dc7(0xcb)]:''));}}return _0xfa8063[_0x459dc7(0xc2)]('\x0a');}function targetPreview(_0x47fa2e){const _0x51672f=a39_0x7603;return{'kind':_0x47fa2e['kind'],'command':_0x47fa2e['command'],'appRef':_0x47fa2e[_0x51672f(0xa9)],'datasetCode':_0x47fa2e[_0x51672f(0xab)],'datatable':_0x47fa2e[_0x51672f(0x101)],'sqlCode':_0x47fa2e[_0x51672f(0x107)],'bffCode':_0x47fa2e[_0x51672f(0xf9)],'bffId':_0x47fa2e[_0x51672f(0xaa)],'functionName':_0x47fa2e['scriptName']};}function normalizeScalarParams(_0x455fcf){const _0xb9b995=a39_0x7603;return Object[_0xb9b995(0xb2)](Object[_0xb9b995(0xe0)](_0x455fcf)[_0xb9b995(0xea)](([,_0x3834a3])=>typeof _0x3834a3==='string'||typeof _0x3834a3===_0xb9b995(0xc0)));}function hasText(_0x371209){const _0x43936f=a39_0x7603;return typeof _0x371209===_0x43936f(0xe9)&&_0x371209[_0x43936f(0xe6)]()['length']>0x0;}function isPrimitiveFlagDefault(_0x378ff4){const _0xddccea=a39_0x7603;return _0x378ff4===undefined||typeof _0x378ff4===_0xddccea(0xe9)||typeof _0x378ff4==='number'||typeof _0x378ff4===_0xddccea(0xcc);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a40_0x3aa5(){const _0x10a603=['$.commands[','string','988808FYjLOY','call','.resources','error','814472UMgIuQ','target','3SAGldX','bff','push','functionName\x20must\x20be\x20a\x20non-empty\x20string.','prototype','.target','kind','.scriptName','actions','scriptName','.actions.','action','commands','.functionName','fromEntries','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','isArray','].target','5491512VaCvrB','entries','3124360lntcye','resources','map','hasOwnProperty','functionName','18944MYfLgZ','bff.exec','$.resources','2270835CHetEd','68LDBTGC','14232213ofrNNA'];a40_0x3aa5=function(){return _0x10a603;};return a40_0x3aa5();}(function(_0x5590a2,_0x141b8a){const _0x4ca401=a40_0x5483,_0x572c28=_0x5590a2();while(!![]){try{const _0x978113=-parseInt(_0x4ca401(0x110))/0x1*(parseInt(_0x4ca401(0x114))/0x2)+parseInt(_0x4ca401(0x11e))/0x3*(parseInt(_0x4ca401(0x118))/0x4)+parseInt(_0x4ca401(0x10b))/0x5+-parseInt(_0x4ca401(0x109))/0x6+-parseInt(_0x4ca401(0x113))/0x7+-parseInt(_0x4ca401(0x11c))/0x8+parseInt(_0x4ca401(0x115))/0x9;if(_0x978113===_0x141b8a)break;else _0x572c28['push'](_0x572c28['shift']());}catch(_0x5e619f){_0x572c28['push'](_0x572c28['shift']());}}}(a40_0x3aa5,0x7239d));export function adaptServiceTreeManifestForLegacyFramework(_0x30d474){const _0x26bfd1=a40_0x5483,_0x31639c=cloneJsonValue(_0x30d474),_0x340e46=[];if(!isObjectRecord(_0x31639c))return{'manifest':_0x31639c,'errors':_0x340e46};return Array['isArray'](_0x31639c[_0x26bfd1(0x103)])&&_0x31639c[_0x26bfd1(0x103)]['forEach']((_0x345977,_0x3834ea)=>{const _0x4a5d3d=_0x26bfd1;if(!isObjectRecord(_0x345977))return;adaptBffTarget(_0x345977[_0x4a5d3d(0x11d)],_0x4a5d3d(0x116)+_0x3834ea+_0x4a5d3d(0x108),_0x340e46);}),adaptResources(_0x31639c[_0x26bfd1(0x10c)],_0x26bfd1(0x112),_0x340e46),{'manifest':_0x31639c,'errors':_0x340e46};}export function toPublicServiceTreeTarget(_0x50cd68){const _0x54554e=a40_0x5483,{scriptName:_0x2a6df6,..._0x4e6c66}=_0x50cd68;return typeof _0x2a6df6===_0x54554e(0x117)&&_0x2a6df6['trim']()&&(_0x4e6c66[_0x54554e(0x10f)]=_0x2a6df6),_0x4e6c66;}export function toPublicNormalizedServiceTree(_0x1923e0){const _0x1dcfcc=a40_0x5483;return{..._0x1923e0,'commands':_0x1923e0['commands']['map'](_0x383fdc=>({..._0x383fdc,'target':toPublicServiceTreeTarget(_0x383fdc[_0x1dcfcc(0x11d)])}))};}function adaptResources(_0x39db9f,_0x3eed6a,_0x343265){const _0x4e19f6=a40_0x5483;if(!isObjectRecord(_0x39db9f))return;for(const [_0x5b5cd6,_0x34675d]of Object['entries'](_0x39db9f)){if(!isObjectRecord(_0x34675d))continue;const _0xcb7c13=_0x3eed6a+'.'+_0x5b5cd6;if(isObjectRecord(_0x34675d[_0x4e19f6(0xff)]))for(const [_0xf489ba,_0x1fec83]of Object['entries'](_0x34675d[_0x4e19f6(0xff)])){if(!isObjectRecord(_0x1fec83))continue;const _0x4dbf7a=_0xcb7c13+_0x4e19f6(0x101)+_0xf489ba,_0x11cba7=isObjectRecord(_0x1fec83['target'])&&_0x1fec83[_0x4e19f6(0x11d)][_0x4e19f6(0xfd)]===_0x4e19f6(0x11f);adaptBffTarget(_0x1fec83[_0x4e19f6(0x11d)],_0x4dbf7a+_0x4e19f6(0x123),_0x343265),(_0x11cba7||isBffAction(_0x1fec83))&&adaptFunctionNameField(_0x1fec83,_0x4dbf7a,_0x343265);}adaptResources(_0x34675d[_0x4e19f6(0x10c)],_0xcb7c13+_0x4e19f6(0x11a),_0x343265);}}function a40_0x5483(_0x55e0e3,_0x3c05ee){_0x55e0e3=_0x55e0e3-0xfd;const _0x3aa53a=a40_0x3aa5();let _0x54839a=_0x3aa53a[_0x55e0e3];return _0x54839a;}function adaptBffTarget(_0x7830c3,_0x28ba94,_0x1acae0){const _0x13209f=a40_0x5483;if(!isObjectRecord(_0x7830c3)||_0x7830c3[_0x13209f(0xfd)]!==_0x13209f(0x11f))return;adaptFunctionNameField(_0x7830c3,_0x28ba94,_0x1acae0);}function adaptFunctionNameField(_0x16b37c,_0x48cbd3,_0xa6b3b1){const _0x3afc43=a40_0x5483;Object[_0x3afc43(0x122)][_0x3afc43(0x10e)]['call'](_0x16b37c,_0x3afc43(0x100))&&_0xa6b3b1[_0x3afc43(0x120)]({'level':_0x3afc43(0x11b),'path':_0x48cbd3+_0x3afc43(0xfe),'message':_0x3afc43(0x106)});if(Object[_0x3afc43(0x122)][_0x3afc43(0x10e)][_0x3afc43(0x119)](_0x16b37c,'functionName')){if(typeof _0x16b37c['functionName']!==_0x3afc43(0x117)||!_0x16b37c[_0x3afc43(0x10f)]['trim']()){_0xa6b3b1[_0x3afc43(0x120)]({'level':_0x3afc43(0x11b),'path':_0x48cbd3+_0x3afc43(0x104),'message':_0x3afc43(0x121)}),delete _0x16b37c[_0x3afc43(0x10f)];return;}_0x16b37c[_0x3afc43(0x100)]=_0x16b37c[_0x3afc43(0x10f)],delete _0x16b37c['functionName'];}}function isBffAction(_0x1affc2){const _0x20ae32=a40_0x5483;return _0x1affc2['kind']==='bff'||_0x1affc2[_0x20ae32(0x102)]==='bff.exec'||_0x1affc2[_0x20ae32(0x11d)]===_0x20ae32(0x111);}function cloneJsonValue(_0x2c7425){const _0xb46fd5=a40_0x5483;if(Array[_0xb46fd5(0x107)](_0x2c7425))return _0x2c7425[_0xb46fd5(0x10d)](_0x11e20e=>cloneJsonValue(_0x11e20e));if(isObjectRecord(_0x2c7425))return Object[_0xb46fd5(0x105)](Object[_0xb46fd5(0x10a)](_0x2c7425)[_0xb46fd5(0x10d)](([_0x4fa5b5,_0x1a8d5d])=>[_0x4fa5b5,cloneJsonValue(_0x1a8d5d)]));return _0x2c7425;}function isObjectRecord(_0x30def4){const _0x1d2de6=a40_0x5483;return Boolean(_0x30def4)&&typeof _0x30def4==='object'&&!Array[_0x1d2de6(0x107)](_0x30def4);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a41_0x299fa2=a41_0x4c22;function a41_0x4c22(_0x572b5e,_0x5246e8){_0x572b5e=_0x572b5e-0xe0;const _0x1648a6=a41_0x1648();let _0x4c226b=_0x1648a6[_0x572b5e];return _0x4c226b;}(function(_0x4710c0,_0x294da9){const _0x12033d=a41_0x4c22,_0x2c2b80=_0x4710c0();while(!![]){try{const _0x2cdf4d=parseInt(_0x12033d(0x11d))/0x1+parseInt(_0x12033d(0xe7))/0x2+-parseInt(_0x12033d(0x128))/0x3*(parseInt(_0x12033d(0xf4))/0x4)+-parseInt(_0x12033d(0xf2))/0x5+-parseInt(_0x12033d(0x127))/0x6+-parseInt(_0x12033d(0xe5))/0x7+-parseInt(_0x12033d(0xeb))/0x8*(-parseInt(_0x12033d(0xf9))/0x9);if(_0x2cdf4d===_0x294da9)break;else _0x2c2b80['push'](_0x2c2b80['shift']());}catch(_0x27adbe){_0x2c2b80['push'](_0x2c2b80['shift']());}}}(a41_0x1648,0xedb70));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a41_0x1648(){const _0x3477fb=['description','92PhfRsJ','Imported\x20','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','replaced','3582tCeShl','file','从本地运行态注册表移除\x20Service\x20Tree\x20清单','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','serviceCode','updated','kind','Local\x20service\x20code,\x20for\x20example\x20crm','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','target','cliName','write','registryServiceCode','manifest','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','remove','map','Local\x20service\x20not\x20found:\x20','risk','length','importedAt','report','normalizedManifest','Service\x20Tree\x20manifest\x20file\x20path','\x20service\x20','registry','detail','filePath','required','entry','\x20service(s),\x20updated\x20','manifests','entries','Service\x20manifest\x20validation\x20passed.','type','Removed\x20service\x20','602490VZUYNT','hash','registryPath','serviceCount','registryIndex','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','errors','Updated','import','10260660ixsdxp','160299tIvIEy','\x20service(s).','service','cliPath','imported','str','10314248weEQLq','read','367404Wkgims','commands','string','source','94672QxtKQu','WRITE','version','export','warnings','validate','Service\x20registry\x20validation\x20passed.','549555IPufvF'];a41_0x1648=function(){return _0x3477fb;};return a41_0x1648();}import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a41_0x299fa2(0xfa),'type':a41_0x299fa2(0xe9),'required':!![],'description':a41_0x299fa2(0x110)},SERVICE_FLAG={'name':a41_0x299fa2(0xe1),'type':a41_0x299fa2(0xe9),'required':!![],'description':a41_0x299fa2(0x100),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':'lower\x20kebab-case\x20service\x20code'}};function summarizeService(_0xcf80e){const _0x3b10df=a41_0x299fa2;return{'serviceCode':_0xcf80e['serviceCode'],'name':_0xcf80e[_0x3b10df(0x10f)][_0x3b10df(0xe1)]['name'],'version':_0xcf80e[_0x3b10df(0xed)],'importedAt':_0xcf80e[_0x3b10df(0x10d)],'source':_0xcf80e[_0x3b10df(0xea)],'commandCount':_0xcf80e[_0x3b10df(0x10f)][_0x3b10df(0xe8)][_0x3b10df(0x10c)],'commands':_0xcf80e[_0x3b10df(0x10f)][_0x3b10df(0xe8)][_0x3b10df(0x109)](_0x2561dc=>({'path':_0x2561dc[_0x3b10df(0xe2)],'description':_0x2561dc[_0x3b10df(0xf3)],'risk':_0x2561dc[_0x3b10df(0x10b)],'target':toPublicServiceTreeTarget(_0x2561dc['target']),'flags':_0x2561dc['flags']['map'](_0x3059d5=>({'name':_0x3059d5['name'],'cliName':_0x3059d5[_0x3b10df(0x103)],'type':_0x3059d5[_0x3b10df(0x11b)],'required':_0x3059d5[_0x3b10df(0x115)]===!![]}))}))};}function summarizeLoadedManifest(_0x272988){const _0x393e4a=a41_0x299fa2;return{'service':_0x272988[_0x393e4a(0x10f)]?.[_0x393e4a(0xe1)],'version':_0x272988['normalizedManifest']?.[_0x393e4a(0xed)],'commandCount':_0x272988[_0x393e4a(0x10f)]?.['commands'][_0x393e4a(0x10c)]??0x0,'commands':_0x272988[_0x393e4a(0x10f)]?.['commands'][_0x393e4a(0x109)](_0x36d1b3=>({'path':_0x36d1b3[_0x393e4a(0xe2)],'risk':_0x36d1b3[_0x393e4a(0x10b)],'target':toPublicServiceTreeTarget(_0x36d1b3[_0x393e4a(0x102)])}))??[],'registryIndex':_0x272988[_0x393e4a(0x121)],'registryServiceCode':_0x272988[_0x393e4a(0x105)],'errors':_0x272988['report'][_0x393e4a(0x124)],'warnings':_0x272988[_0x393e4a(0x10e)][_0x393e4a(0xef)]};}export const serviceDefinitions=[{'service':a41_0x299fa2(0xe1),'command':a41_0x299fa2(0xf0),'description':'Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','risk':a41_0x299fa2(0xe6),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x2352c1){const _0x3e817b=a41_0x299fa2,_0x44507c=loadServiceManifestFromFile(_0x2352c1[_0x3e817b(0xe4)]('file'));if(!_0x44507c[_0x3e817b(0x10e)]['ok'])return{'ok':![],'data':{'file':_0x44507c[_0x3e817b(0x114)],'hash':_0x44507c[_0x3e817b(0x11e)],'kind':_0x44507c[_0x3e817b(0xff)],'serviceCount':_0x44507c['manifests'][_0x3e817b(0x10c)],'services':_0x44507c[_0x3e817b(0x118)][_0x3e817b(0x109)](summarizeLoadedManifest),'errors':_0x44507c['report'][_0x3e817b(0x124)],'warnings':_0x44507c[_0x3e817b(0x10e)]['warnings']},'message':formatValidationFailure(_0x44507c[_0x3e817b(0x10e)])};if(_0x44507c[_0x3e817b(0xff)]===_0x3e817b(0x112)||_0x44507c['manifests']['length']!==0x1)return{'ok':!![],'data':{'file':_0x44507c[_0x3e817b(0x114)],'hash':_0x44507c[_0x3e817b(0x11e)],'kind':_0x44507c[_0x3e817b(0xff)],'serviceCount':_0x44507c[_0x3e817b(0x118)][_0x3e817b(0x10c)],'commandCount':_0x44507c[_0x3e817b(0x118)]['reduce']((_0x328363,_0x56c04d)=>_0x328363+(_0x56c04d[_0x3e817b(0x10f)]?.[_0x3e817b(0xe8)][_0x3e817b(0x10c)]??0x0),0x0),'services':_0x44507c['manifests']['map'](summarizeLoadedManifest),'warnings':_0x44507c[_0x3e817b(0x10e)][_0x3e817b(0xef)]},'message':_0x3e817b(0xf1)};return{'ok':!![],'data':{'file':_0x44507c[_0x3e817b(0x114)],'hash':_0x44507c[_0x3e817b(0x11e)],'kind':_0x44507c['kind'],'service':_0x44507c[_0x3e817b(0x10f)]?.[_0x3e817b(0xe1)],'version':_0x44507c[_0x3e817b(0x10f)]?.[_0x3e817b(0xed)],'commandCount':_0x44507c['normalizedManifest']?.['commands'][_0x3e817b(0x10c)]??0x0,'commands':_0x44507c[_0x3e817b(0x10f)]?.['commands'][_0x3e817b(0x109)](_0xe2b1a=>({'path':_0xe2b1a[_0x3e817b(0xe2)],'risk':_0xe2b1a[_0x3e817b(0x10b)],'target':toPublicServiceTreeTarget(_0xe2b1a['target'])})),'warnings':_0x44507c[_0x3e817b(0x10e)][_0x3e817b(0xef)]},'message':_0x3e817b(0x11a)};}},{'service':a41_0x299fa2(0xe1),'command':a41_0x299fa2(0x126),'description':'将\x20Service\x20Tree\x20清单导入本地运行态注册表','risk':'write','confirmationDescription':a41_0x299fa2(0xf7),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x2f2033){const _0x26465f=a41_0x299fa2,_0x1e2254=loadServiceManifestFromFile(_0x2f2033['str'](_0x26465f(0xfa)));return{'method':_0x26465f(0xec),'url':getServiceRegistryPath(),'body':{'file':_0x1e2254[_0x26465f(0x114)],'hash':_0x1e2254[_0x26465f(0x11e)],'kind':_0x1e2254[_0x26465f(0xff)],'ok':_0x1e2254[_0x26465f(0x10e)]['ok'],'service':_0x1e2254[_0x26465f(0x10f)]?.['service'],'version':_0x1e2254[_0x26465f(0x10f)]?.[_0x26465f(0xed)],'serviceCount':_0x1e2254[_0x26465f(0x118)]['length'],'services':_0x1e2254[_0x26465f(0x118)][_0x26465f(0x109)](_0x4b143b=>({'service':_0x4b143b['normalizedManifest']?.[_0x26465f(0xe1)],'version':_0x4b143b[_0x26465f(0x10f)]?.[_0x26465f(0xed)],'commandCount':_0x4b143b[_0x26465f(0x10f)]?.[_0x26465f(0xe8)][_0x26465f(0x10c)]??0x0,'errors':_0x4b143b[_0x26465f(0x10e)]['errors']})),'errors':_0x1e2254[_0x26465f(0x10e)][_0x26465f(0x124)],'commandCount':_0x1e2254[_0x26465f(0x10f)]?.[_0x26465f(0xe8)]['length']??0x0},'description':_0x26465f(0xfc)};},async 'execute'(_0x35c7fb){const _0x218def=a41_0x299fa2,_0x25efb3=importServiceManifest(_0x35c7fb[_0x218def(0xe4)](_0x218def(0xfa)));if(_0x25efb3[_0x218def(0x119)][_0x218def(0x10c)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x25efb3['registryPath'],'imported':_0x25efb3[_0x218def(0xe3)],'updated':_0x25efb3[_0x218def(0xfe)],'serviceCount':_0x25efb3['serviceCount'],'services':_0x25efb3[_0x218def(0x119)][_0x218def(0x109)](summarizeService)},'message':_0x218def(0xf5)+_0x25efb3['imported']+_0x218def(0x117)+_0x25efb3[_0x218def(0xfe)]+_0x218def(0xe0)};return{'ok':!![],'data':{'registryPath':_0x25efb3[_0x218def(0x11f)],'replaced':_0x25efb3[_0x218def(0xf8)],'imported':_0x25efb3['imported'],'updated':_0x25efb3[_0x218def(0xfe)],'serviceCount':_0x25efb3[_0x218def(0x120)],'service':summarizeService(_0x25efb3[_0x218def(0x116)])},'message':(_0x25efb3[_0x218def(0xf8)]?_0x218def(0x125):'Imported')+_0x218def(0x111)+_0x25efb3[_0x218def(0x116)][_0x218def(0xfd)]+'.'};}},{'service':a41_0x299fa2(0xe1),'command':a41_0x299fa2(0xee),'description':a41_0x299fa2(0x122),'risk':a41_0x299fa2(0x104),'confirmationDescription':a41_0x299fa2(0xf6),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x3ad40d){const _0x92ef59=a41_0x299fa2,_0x15a3d7=getLocalServiceEntry(_0x3ad40d[_0x92ef59(0xe4)](_0x92ef59(0xe1)));return{'method':_0x92ef59(0xec),'url':_0x3ad40d['str']('file'),'body':{'service':_0x3ad40d[_0x92ef59(0xe4)](_0x92ef59(0xe1)),'found':Boolean(_0x15a3d7),'version':_0x15a3d7?.[_0x92ef59(0xed)],'source':_0x15a3d7?.[_0x92ef59(0xea)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x2566b9){const _0x1cf72b=a41_0x299fa2,_0x4eac16=exportServiceManifest(_0x2566b9['str'](_0x1cf72b(0xe1)),_0x2566b9[_0x1cf72b(0xe4)](_0x1cf72b(0xfa)));return{'ok':!![],'data':{'registryPath':_0x4eac16[_0x1cf72b(0x11f)],'file':_0x4eac16[_0x1cf72b(0x114)],'service':summarizeService(_0x4eac16[_0x1cf72b(0x116)])},'message':'Exported\x20service\x20'+_0x4eac16['entry'][_0x1cf72b(0xfd)]+'.'};}},{'service':a41_0x299fa2(0xe1),'command':'list','description':a41_0x299fa2(0x101),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x16ce2a=a41_0x299fa2,_0x56dd36=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x56dd36[_0x16ce2a(0x10c)],'services':_0x56dd36['map'](summarizeService)}};}},{'service':a41_0x299fa2(0xe1),'command':a41_0x299fa2(0x108),'description':a41_0x299fa2(0xfb),'risk':a41_0x299fa2(0x104),'confirmationDescription':a41_0x299fa2(0x107),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x1fc56a){const _0x365749=a41_0x299fa2,_0x53ff42=getLocalServiceEntry(_0x1fc56a[_0x365749(0xe4)]('service'));return{'method':_0x365749(0xec),'url':getServiceRegistryPath(),'body':{'service':_0x1fc56a[_0x365749(0xe4)]('service'),'found':Boolean(_0x53ff42),'version':_0x53ff42?.[_0x365749(0xed)],'source':_0x53ff42?.[_0x365749(0xea)]},'description':_0x365749(0x123)};},async 'execute'(_0xf82a32){const _0x4524c8=a41_0x299fa2,_0x566555=removeServiceManifest(_0xf82a32[_0x4524c8(0xe4)](_0x4524c8(0xe1)));return{'ok':!![],'data':{'registryPath':_0x566555[_0x4524c8(0x11f)],'serviceCount':_0x566555['serviceCount'],'service':summarizeService(_0x566555[_0x4524c8(0x116)])},'message':_0x4524c8(0x11c)+_0x566555[_0x4524c8(0x116)][_0x4524c8(0xfd)]+'.'};}},{'service':a41_0x299fa2(0xe1),'command':a41_0x299fa2(0x113),'description':'Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x489227){const _0x5c4636=a41_0x299fa2,_0x375023=getLocalServiceEntry(_0x489227[_0x5c4636(0xe4)]('service'));if(!_0x375023)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x489227[_0x5c4636(0xe4)]('service')},'message':_0x5c4636(0x10a)+_0x489227[_0x5c4636(0xe4)](_0x5c4636(0xe1))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x375023),'manifest':_0x375023[_0x5c4636(0x106)],'normalizedManifest':toPublicNormalizedServiceTree(_0x375023[_0x5c4636(0x10f)])}};}}];
|
|
1
|
+
const a41_0x274010=a41_0x5b17;(function(_0x25b256,_0x8d7bd5){const _0x5d6a14=a41_0x5b17,_0x360049=_0x25b256();while(!![]){try{const _0x2d812e=parseInt(_0x5d6a14(0x72))/0x1+-parseInt(_0x5d6a14(0x9b))/0x2*(parseInt(_0x5d6a14(0x9e))/0x3)+-parseInt(_0x5d6a14(0x6c))/0x4+-parseInt(_0x5d6a14(0x82))/0x5+-parseInt(_0x5d6a14(0x78))/0x6*(-parseInt(_0x5d6a14(0x86))/0x7)+parseInt(_0x5d6a14(0xa2))/0x8*(parseInt(_0x5d6a14(0x81))/0x9)+-parseInt(_0x5d6a14(0x6f))/0xa*(parseInt(_0x5d6a14(0xad))/0xb);if(_0x2d812e===_0x8d7bd5)break;else _0x360049['push'](_0x360049['shift']());}catch(_0x395ad3){_0x360049['push'](_0x360049['shift']());}}}(a41_0x503a,0x18918));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_0x274010(0x80),'type':a41_0x274010(0x98),'required':!![],'description':a41_0x274010(0x88)},SERVICE_FLAG={'name':'service','type':a41_0x274010(0x98),'required':!![],'description':a41_0x274010(0xa0),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a41_0x274010(0x7e)}};function summarizeService(_0x142eb9){const _0x527eae=a41_0x274010;return{'serviceCode':_0x142eb9[_0x527eae(0x99)],'name':_0x142eb9[_0x527eae(0x97)][_0x527eae(0x7b)]['name'],'version':_0x142eb9[_0x527eae(0x7a)],'importedAt':_0x142eb9['importedAt'],'source':_0x142eb9[_0x527eae(0x8e)],'commandCount':_0x142eb9[_0x527eae(0x97)][_0x527eae(0xb1)][_0x527eae(0x73)],'commands':_0x142eb9[_0x527eae(0x97)][_0x527eae(0xb1)][_0x527eae(0x94)](_0x37be61=>({'path':_0x37be61[_0x527eae(0xa4)],'description':_0x37be61['description'],'risk':_0x37be61[_0x527eae(0x84)],'target':toPublicServiceTreeTarget(_0x37be61[_0x527eae(0x6e)]),'flags':_0x37be61[_0x527eae(0x9d)][_0x527eae(0x94)](_0x4587d4=>({'name':_0x4587d4['name'],'cliName':_0x4587d4[_0x527eae(0x7c)],'type':_0x4587d4[_0x527eae(0x92)],'required':_0x4587d4[_0x527eae(0x71)]===!![]}))}))};}function summarizeLoadedManifest(_0x40edda){const _0xcd2b9=a41_0x274010;return{'service':_0x40edda[_0xcd2b9(0x97)]?.['service'],'version':_0x40edda['normalizedManifest']?.[_0xcd2b9(0x7a)],'commandCount':_0x40edda[_0xcd2b9(0x97)]?.[_0xcd2b9(0xb1)]['length']??0x0,'commands':_0x40edda[_0xcd2b9(0x97)]?.[_0xcd2b9(0xb1)][_0xcd2b9(0x94)](_0x350f41=>({'path':_0x350f41['cliPath'],'risk':_0x350f41['risk'],'target':toPublicServiceTreeTarget(_0x350f41['target'])}))??[],'registryIndex':_0x40edda[_0xcd2b9(0x77)],'registryServiceCode':_0x40edda['registryServiceCode'],'errors':_0x40edda['report']['errors'],'warnings':_0x40edda[_0xcd2b9(0x85)]['warnings']};}function a41_0x5b17(_0x47aa36,_0x101dba){_0x47aa36=_0x47aa36-0x6c;const _0x503a23=a41_0x503a();let _0x5b17f4=_0x503a23[_0x47aa36];return _0x5b17f4;}export const serviceDefinitions=[{'service':'service','command':a41_0x274010(0xb0),'description':a41_0x274010(0x6d),'risk':a41_0x274010(0xa5),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x4fb3ac){const _0x64cac5=a41_0x274010,_0x3ac61a=loadServiceManifestFromFile(_0x4fb3ac[_0x64cac5(0x87)](_0x64cac5(0x80)));if(!_0x3ac61a[_0x64cac5(0x85)]['ok'])return{'ok':![],'data':{'file':_0x3ac61a['filePath'],'hash':_0x3ac61a[_0x64cac5(0x9a)],'kind':_0x3ac61a[_0x64cac5(0x83)],'serviceCount':_0x3ac61a[_0x64cac5(0xa9)]['length'],'services':_0x3ac61a[_0x64cac5(0xa9)][_0x64cac5(0x94)](summarizeLoadedManifest),'errors':_0x3ac61a[_0x64cac5(0x85)][_0x64cac5(0xb2)],'warnings':_0x3ac61a[_0x64cac5(0x85)]['warnings']},'message':formatValidationFailure(_0x3ac61a[_0x64cac5(0x85)])};if(_0x3ac61a[_0x64cac5(0x83)]===_0x64cac5(0x8d)||_0x3ac61a[_0x64cac5(0xa9)][_0x64cac5(0x73)]!==0x1)return{'ok':!![],'data':{'file':_0x3ac61a[_0x64cac5(0xaa)],'hash':_0x3ac61a['hash'],'kind':_0x3ac61a[_0x64cac5(0x83)],'serviceCount':_0x3ac61a[_0x64cac5(0xa9)][_0x64cac5(0x73)],'commandCount':_0x3ac61a[_0x64cac5(0xa9)][_0x64cac5(0xa1)]((_0x37fc1a,_0x18e195)=>_0x37fc1a+(_0x18e195[_0x64cac5(0x97)]?.[_0x64cac5(0xb1)]['length']??0x0),0x0),'services':_0x3ac61a['manifests']['map'](summarizeLoadedManifest),'warnings':_0x3ac61a[_0x64cac5(0x85)][_0x64cac5(0x8a)]},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x3ac61a[_0x64cac5(0xaa)],'hash':_0x3ac61a['hash'],'kind':_0x3ac61a[_0x64cac5(0x83)],'service':_0x3ac61a['normalizedManifest']?.[_0x64cac5(0x7b)],'version':_0x3ac61a[_0x64cac5(0x97)]?.['version'],'commandCount':_0x3ac61a['normalizedManifest']?.[_0x64cac5(0xb1)][_0x64cac5(0x73)]??0x0,'commands':_0x3ac61a[_0x64cac5(0x97)]?.[_0x64cac5(0xb1)][_0x64cac5(0x94)](_0x19b2ca=>({'path':_0x19b2ca[_0x64cac5(0xa4)],'risk':_0x19b2ca[_0x64cac5(0x84)],'target':toPublicServiceTreeTarget(_0x19b2ca[_0x64cac5(0x6e)])})),'warnings':_0x3ac61a[_0x64cac5(0x85)][_0x64cac5(0x8a)]},'message':_0x64cac5(0x91)};}},{'service':a41_0x274010(0x7b),'command':a41_0x274010(0xac),'description':a41_0x274010(0xa3),'risk':a41_0x274010(0x8b),'confirmationDescription':'将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x2cc8ed){const _0x42d252=a41_0x274010,_0x21fc65=loadServiceManifestFromFile(_0x2cc8ed['str']('file'));return{'method':_0x42d252(0x8c),'url':getServiceRegistryPath(),'body':{'file':_0x21fc65['filePath'],'hash':_0x21fc65['hash'],'kind':_0x21fc65['kind'],'ok':_0x21fc65['report']['ok'],'service':_0x21fc65[_0x42d252(0x97)]?.['service'],'version':_0x21fc65[_0x42d252(0x97)]?.[_0x42d252(0x7a)],'serviceCount':_0x21fc65[_0x42d252(0xa9)][_0x42d252(0x73)],'services':_0x21fc65[_0x42d252(0xa9)][_0x42d252(0x94)](_0x5d9e78=>({'service':_0x5d9e78[_0x42d252(0x97)]?.[_0x42d252(0x7b)],'version':_0x5d9e78[_0x42d252(0x97)]?.[_0x42d252(0x7a)],'commandCount':_0x5d9e78[_0x42d252(0x97)]?.['commands']['length']??0x0,'errors':_0x5d9e78[_0x42d252(0x85)]['errors']})),'errors':_0x21fc65[_0x42d252(0x85)]['errors'],'commandCount':_0x21fc65[_0x42d252(0x97)]?.[_0x42d252(0xb1)]['length']??0x0},'description':_0x42d252(0x96)};},async 'execute'(_0x51b077){const _0x9d3853=a41_0x274010,_0x283c36=importServiceManifest(_0x51b077[_0x9d3853(0x87)](_0x9d3853(0x80)));if(_0x283c36[_0x9d3853(0x8f)][_0x9d3853(0x73)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x283c36[_0x9d3853(0x70)],'imported':_0x283c36[_0x9d3853(0x7f)],'updated':_0x283c36[_0x9d3853(0x95)],'serviceCount':_0x283c36[_0x9d3853(0x7d)],'services':_0x283c36[_0x9d3853(0x8f)]['map'](summarizeService)},'message':_0x9d3853(0x9c)+_0x283c36['imported']+_0x9d3853(0xa7)+_0x283c36[_0x9d3853(0x95)]+_0x9d3853(0xae)};return{'ok':!![],'data':{'registryPath':_0x283c36[_0x9d3853(0x70)],'replaced':_0x283c36['replaced'],'imported':_0x283c36[_0x9d3853(0x7f)],'updated':_0x283c36[_0x9d3853(0x95)],'serviceCount':_0x283c36[_0x9d3853(0x7d)],'service':summarizeService(_0x283c36[_0x9d3853(0xb4)])},'message':(_0x283c36[_0x9d3853(0xab)]?'Updated':_0x9d3853(0x75))+_0x9d3853(0x89)+_0x283c36[_0x9d3853(0xb4)][_0x9d3853(0x99)]+'.'};}},{'service':'service','command':a41_0x274010(0x9f),'description':a41_0x274010(0x90),'risk':'write','confirmationDescription':'将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x144fb9){const _0x4bff58=a41_0x274010,_0xe69f7=getLocalServiceEntry(_0x144fb9[_0x4bff58(0x87)](_0x4bff58(0x7b)));return{'method':_0x4bff58(0x8c),'url':_0x144fb9[_0x4bff58(0x87)](_0x4bff58(0x80)),'body':{'service':_0x144fb9[_0x4bff58(0x87)](_0x4bff58(0x7b)),'found':Boolean(_0xe69f7),'version':_0xe69f7?.['version'],'source':_0xe69f7?.[_0x4bff58(0x8e)]},'description':_0x4bff58(0x74)};},async 'execute'(_0x53d6b7){const _0xbcfebe=a41_0x274010,_0x586b86=exportServiceManifest(_0x53d6b7[_0xbcfebe(0x87)]('service'),_0x53d6b7[_0xbcfebe(0x87)](_0xbcfebe(0x80)));return{'ok':!![],'data':{'registryPath':_0x586b86['registryPath'],'file':_0x586b86[_0xbcfebe(0xaa)],'service':summarizeService(_0x586b86[_0xbcfebe(0xb4)])},'message':_0xbcfebe(0xb3)+_0x586b86[_0xbcfebe(0xb4)][_0xbcfebe(0x99)]+'.'};}},{'service':a41_0x274010(0x7b),'command':'list','description':a41_0x274010(0xa6),'risk':a41_0x274010(0xa5),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x395586=a41_0x274010,_0x3e9179=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x3e9179[_0x395586(0x73)],'services':_0x3e9179[_0x395586(0x94)](summarizeService)}};}},{'service':a41_0x274010(0x7b),'command':a41_0x274010(0x76),'description':a41_0x274010(0xaf),'risk':a41_0x274010(0x8b),'confirmationDescription':a41_0x274010(0x93),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x435ac3){const _0x1d53e5=a41_0x274010,_0x295318=getLocalServiceEntry(_0x435ac3[_0x1d53e5(0x87)](_0x1d53e5(0x7b)));return{'method':_0x1d53e5(0x8c),'url':getServiceRegistryPath(),'body':{'service':_0x435ac3['str'](_0x1d53e5(0x7b)),'found':Boolean(_0x295318),'version':_0x295318?.[_0x1d53e5(0x7a)],'source':_0x295318?.['source']},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x1a1ab0){const _0x34f750=a41_0x274010,_0x3e33c9=removeServiceManifest(_0x1a1ab0[_0x34f750(0x87)](_0x34f750(0x7b)));return{'ok':!![],'data':{'registryPath':_0x3e33c9[_0x34f750(0x70)],'serviceCount':_0x3e33c9[_0x34f750(0x7d)],'service':summarizeService(_0x3e33c9[_0x34f750(0xb4)])},'message':_0x34f750(0xa8)+_0x3e33c9[_0x34f750(0xb4)][_0x34f750(0x99)]+'.'};}},{'service':a41_0x274010(0x7b),'command':'detail','description':'Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0xd09fcc){const _0x3f5572=a41_0x274010,_0xc52733=getLocalServiceEntry(_0xd09fcc[_0x3f5572(0x87)](_0x3f5572(0x7b)));if(!_0xc52733)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0xd09fcc[_0x3f5572(0x87)](_0x3f5572(0x7b))},'message':_0x3f5572(0x79)+_0xd09fcc[_0x3f5572(0x87)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0xc52733),'manifest':_0xc52733['manifest'],'normalizedManifest':toPublicNormalizedServiceTree(_0xc52733[_0x3f5572(0x97)])}};}}];function a41_0x503a(){const _0x131a57=['将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','Service\x20manifest\x20validation\x20passed.','type','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','map','updated','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','normalizedManifest','string','serviceCode','hash','2nZkIZb','Imported\x20','flags','36393eicrxu','export','Local\x20service\x20code,\x20for\x20example\x20crm','reduce','223912Ikkukp','将\x20Service\x20Tree\x20清单导入本地运行态注册表','cliPath','read','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','\x20service(s),\x20updated\x20','Removed\x20service\x20','manifests','filePath','replaced','import','269456ZdFkuN','\x20service(s).','从本地运行态注册表移除\x20Service\x20Tree\x20清单','validate','commands','errors','Exported\x20service\x20','entry','154688cEqvjt','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','target','10DIdkvo','registryPath','required','86321gApPAo','length','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','Imported','remove','registryIndex','42BetJKJ','Local\x20service\x20not\x20found:\x20','version','service','cliName','serviceCount','lower\x20kebab-case\x20service\x20code','imported','file','27tGCyyB','163480hQsFDC','kind','risk','report','38339DWLsto','str','Service\x20Tree\x20manifest\x20file\x20path','\x20service\x20','warnings','write','WRITE','registry','source','entries'];a41_0x503a=function(){return _0x131a57;};return a41_0x503a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4d73f2,_0x579435){const _0x4c1225=a42_0x2030,_0xf2457=_0x4d73f2();while(!![]){try{const _0x4f5d03=-parseInt(_0x4c1225(0x235))/0x1+parseInt(_0x4c1225(0x20c))/0x2+parseInt(_0x4c1225(0x20e))/0x3*(parseInt(_0x4c1225(0x1f5))/0x4)+parseInt(_0x4c1225(0x205))/0x5+-parseInt(_0x4c1225(0x223))/0x6*(-parseInt(_0x4c1225(0x202))/0x7)+parseInt(_0x4c1225(0x212))/0x8*(-parseInt(_0x4c1225(0x237))/0x9)+-parseInt(_0x4c1225(0x1f1))/0xa;if(_0x4f5d03===_0x579435)break;else _0xf2457['push'](_0xf2457['shift']());}catch(_0x5496f4){_0xf2457['push'](_0xf2457['shift']());}}}(a42_0x4e58,0xf1da8));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(_0x4fa982={}){const _0xb6a927=a42_0x2030;return resolve(_0x4fa982['homeDir']??homedir(),PRODUCT_CONFIG[_0xb6a927(0x1f0)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}function a42_0x2030(_0x5570e4,_0x89d831){_0x5570e4=_0x5570e4-0x1e9;const _0x4e5839=a42_0x4e58();let _0x20305d=_0x4e5839[_0x5570e4];return _0x20305d;}export function readServiceRegistry(_0x1009e8={}){const _0x442341=a42_0x2030,_0x5a4cd7=getServiceRegistryPath(_0x1009e8);if(!existsSync(_0x5a4cd7))return emptyServiceRegistry();try{const _0xf5b686=readFileSync(_0x5a4cd7,'utf8');if(!_0xf5b686['trim']())return emptyServiceRegistry();const _0x4cad12=JSON['parse'](_0xf5b686);if(_0x4cad12[_0x442341(0x22c)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x442341(0x20a)](_0x442341(0x1fc)+String(_0x4cad12[_0x442341(0x22c)]),_0x442341(0x1ef)+_0x5a4cd7+'.');if(!Array[_0x442341(0x22e)](_0x4cad12[_0x442341(0x21c)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x4cad12[_0x442341(0x21a)],'services':_0x4cad12[_0x442341(0x21c)]};}catch(_0x1d5fb9){if(_0x1d5fb9 instanceof Error&&_0x1d5fb9[_0x442341(0x1f7)]==='CliError')throw _0x1d5fb9;throw CliErrors[_0x442341(0x20a)](_0x442341(0x208)+_0x5a4cd7,'Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.');}}export function writeServiceRegistry(_0x56b136,_0x35c5c8={}){const _0x4ae182=a42_0x2030,_0x5f4194=getServiceRegistryPath(_0x35c5c8),_0x5bf432=dirname(_0x5f4194);!existsSync(_0x5bf432)&&mkdirSync(_0x5bf432,{'recursive':!![]});const _0x1343c8=_0x5f4194+_0x4ae182(0x221);try{writeFileSync(_0x1343c8,JSON[_0x4ae182(0x224)](_0x56b136,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x1343c8,_0x5f4194);}catch(_0x17b7df){try{unlinkSync(_0x1343c8);}catch{}if(_0x17b7df?.[_0x4ae182(0x231)]===_0x4ae182(0x236))throw CliErrors[_0x4ae182(0x20a)](_0x4ae182(0x23b)+_0x5f4194);throw _0x17b7df;}return _0x5f4194;}export function loadServiceManifestFromFile(_0x439de6){const _0x4be528=a42_0x2030,_0x50b61=resolve(_0x439de6);if(!existsSync(_0x50b61))throw CliErrors[_0x4be528(0x20a)]('Service\x20manifest\x20file\x20not\x20found:\x20'+_0x439de6);let _0x261c72;const _0x188778=readFileSync(_0x50b61,_0x4be528(0x1ec));try{_0x261c72=JSON['parse'](_0x188778);}catch{throw CliErrors[_0x4be528(0x20a)](_0x4be528(0x239)+_0x439de6,_0x4be528(0x225));}const _0x2c4b26=sha256(_0x188778),_0x436fb9=extractLoadedServiceManifests(_0x261c72,_0x2c4b26),_0x139c56=aggregateValidationReports(_0x436fb9),_0x13da14=_0x436fb9[0x0];return{'filePath':_0x50b61,'hash':_0x2c4b26,'kind':isServiceRegistryLike(_0x261c72)?_0x4be528(0x209):_0x4be528(0x210),'manifest':_0x13da14?.[_0x4be528(0x210)]??_0x261c72,'report':_0x139c56,'normalizedManifest':_0x436fb9[_0x4be528(0x226)]===0x1?_0x13da14?.['normalizedManifest']:undefined,'manifests':_0x436fb9};}export function importServiceManifest(_0x418d7f,_0x2c7f13={}){const _0x271c66=a42_0x2030,_0x448329=loadServiceManifestFromFile(_0x418d7f);if(!_0x448329['report']['ok'])throw CliErrors[_0x271c66(0x20a)](formatValidationFailure(_0x448329[_0x271c66(0x200)]),_0x271c66(0x1fa));if(_0x448329[_0x271c66(0x216)][_0x271c66(0x226)]===0x0)throw CliErrors['validation'](_0x271c66(0x1eb),_0x271c66(0x21f));const _0x21da5f=readServiceRegistry(_0x2c7f13),_0x1613dc=(_0x2c7f13[_0x271c66(0x1f2)]??(()=>new Date()))()[_0x271c66(0x201)](),_0x58410f=[];let _0x3572d3=0x0,_0x59243a=0x0;for(const _0x42847f of _0x448329['manifests']){if(!_0x42847f['normalizedManifest'])continue;const _0x4033e2=_0x42847f[_0x271c66(0x218)][_0x271c66(0x21b)]['code'],_0x26fc79={'serviceCode':_0x4033e2,'version':_0x42847f['normalizedManifest'][_0x271c66(0x21e)],'importedAt':_0x1613dc,'source':{'type':_0x271c66(0x214),'path':_0x448329[_0x271c66(0x1fd)],'hash':_0x42847f['sourceHash']},'manifest':_0x42847f['manifest'],'normalizedManifest':_0x42847f[_0x271c66(0x218)]},_0x9cd9c9=_0x21da5f['services'][_0x271c66(0x22d)](_0x5ce22e=>_0x5ce22e[_0x271c66(0x222)]===_0x4033e2);_0x9cd9c9>=0x0?(_0x21da5f['services'][_0x9cd9c9]=_0x26fc79,_0x59243a++):(_0x21da5f['services'][_0x271c66(0x206)](_0x26fc79),_0x3572d3++),_0x58410f[_0x271c66(0x206)](_0x26fc79);}_0x21da5f['services'][_0x271c66(0x20b)]((_0x8afa82,_0x21eaf5)=>_0x8afa82[_0x271c66(0x222)]['localeCompare'](_0x21eaf5[_0x271c66(0x222)])),_0x21da5f[_0x271c66(0x21a)]=_0x1613dc;const _0x2256b7=writeServiceRegistry(_0x21da5f,_0x2c7f13);return{'registryPath':_0x2256b7,'entry':_0x58410f[0x0],'replaced':_0x58410f['length']===0x1?_0x59243a===0x1:_0x59243a>0x0,'entries':_0x58410f,'imported':_0x3572d3,'updated':_0x59243a,'serviceCount':_0x21da5f[_0x271c66(0x21c)][_0x271c66(0x226)]};}function a42_0x4e58(){const _0x545334=['2435666HcnqWg','string','3MUWdLz','startsWith','manifest','empty','27640TbelaI','message','file','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','manifests','slice','normalizedManifest','map','updatedAt','service','services','command','version','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','flatMap','.tmp','serviceCode','183762WJjMCT','stringify','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','length','update','Local\x20service\x20not\x20found:\x20','target','errors','warnings','schemaVersion','findIndex','isArray','missing','hex','code','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','].manifest','reduce','1936462aqWRcv','ENOENT','531XJQOnC','$.services[','Invalid\x20service\x20manifest\x20JSON:\x20','risk','Cannot\x20write\x20service\x20registry:\x20','registryIndex','commands','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','utf8','].manifest.','description','Remove\x20or\x20migrate\x20','homeDirName','16790520HqPWoF','now','trim','Unsupported\x20schemaVersion:\x20','6499840gyNkdg','commandCount','name','importedAt','bff\x20target\x20requires\x20functionName.','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','join','Unsupported\x20service\x20registry\x20schemaVersion:\x20','filePath','kind','invalid','report','toISOString','49meHQNY','path','source','8764045vWxhfO','push','sha256','Invalid\x20service\x20registry\x20JSON:\x20','registry','validation','sort'];a42_0x4e58=function(){return _0x545334;};return a42_0x4e58();}export function exportServiceManifest(_0x2f4b6e,_0x5ab781,_0x13de42={}){const _0x236d2e=a42_0x2030,_0xfff8a4=getServiceRegistryPath(_0x13de42),_0x429ab0=getLocalServiceEntry(_0x2f4b6e,_0x13de42);if(!_0x429ab0)throw CliErrors[_0x236d2e(0x20a)](_0x236d2e(0x228)+_0x2f4b6e,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const _0x550dfb=resolve(_0x5ab781),_0x4560ef=dirname(_0x550dfb);return!existsSync(_0x4560ef)&&mkdirSync(_0x4560ef,{'recursive':!![]}),writeFileSync(_0x550dfb,JSON[_0x236d2e(0x224)](_0x429ab0['manifest'],null,0x2)+'\x0a',{'encoding':_0x236d2e(0x1ec),'mode':0x180}),{'registryPath':_0xfff8a4,'filePath':_0x550dfb,'entry':_0x429ab0};}export function removeServiceManifest(_0x395027,_0x86c377={}){const _0xba64e0=a42_0x2030,_0x541322=readServiceRegistry(_0x86c377),_0x27259c=_0x395027['trim'](),_0x58739c=_0x541322['services'][_0xba64e0(0x22d)](_0x33c9cb=>_0x33c9cb[_0xba64e0(0x222)]===_0x27259c);if(_0x58739c<0x0)throw CliErrors[_0xba64e0(0x20a)](_0xba64e0(0x228)+_0x27259c,_0xba64e0(0x232));const [_0xa82902]=_0x541322['services']['splice'](_0x58739c,0x1),_0x52f0df=(_0x86c377['now']??(()=>new Date()))()[_0xba64e0(0x201)]();_0x541322[_0xba64e0(0x21a)]=_0x52f0df;const _0x5ced9c=writeServiceRegistry(_0x541322,_0x86c377);return{'registryPath':_0x5ced9c,'entry':_0xa82902,'serviceCount':_0x541322[_0xba64e0(0x21c)]['length']};}export function listLocalServices(_0x2f5c40={}){const _0x320d40=a42_0x2030;return readServiceRegistry(_0x2f5c40)[_0x320d40(0x21c)];}export function getLocalServiceEntry(_0x541116,_0x3080e8={}){const _0x243cd3=a42_0x2030;return readServiceRegistry(_0x3080e8)[_0x243cd3(0x21c)]['find'](_0x4706e7=>_0x4706e7[_0x243cd3(0x222)]===_0x541116[_0x243cd3(0x1f3)]());}export function listLocalServiceTrees(_0x110765={}){const _0x2cb705=a42_0x2030;return readServiceRegistry(_0x110765)[_0x2cb705(0x21c)][_0x2cb705(0x219)](_0x355715=>_0x355715[_0x2cb705(0x218)]);}export function inspectServiceRegistry(_0x1a6b36={}){const _0x98bb9=a42_0x2030,_0x5ba0cb=getServiceRegistryPath(_0x1a6b36);if(!existsSync(_0x5ba0cb))return emptyServiceRegistryInspection(_0x5ba0cb,_0x98bb9(0x22f),![]);try{const _0x56fbce=readFileSync(_0x5ba0cb,_0x98bb9(0x1ec));if(!_0x56fbce[_0x98bb9(0x1f3)]())return emptyServiceRegistryInspection(_0x5ba0cb,_0x98bb9(0x211),!![]);const _0x3176ae=JSON['parse'](_0x56fbce);if(_0x3176ae[_0x98bb9(0x22c)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x5ba0cb,_0x98bb9(0x1ff),!![]),'schemaVersion':_0x3176ae[_0x98bb9(0x22c)],'message':_0x98bb9(0x1f4)+String(_0x3176ae[_0x98bb9(0x22c)])};if(!Array[_0x98bb9(0x22e)](_0x3176ae[_0x98bb9(0x21c)]))return{...emptyServiceRegistryInspection(_0x5ba0cb,_0x98bb9(0x1ff),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3176ae[_0x98bb9(0x21a)],'message':'services\x20must\x20be\x20an\x20array'};const _0x4a5157=_0x3176ae[_0x98bb9(0x21c)][_0x98bb9(0x219)](summarizeLocalServiceEntry);return{'registryPath':_0x5ba0cb,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3176ae[_0x98bb9(0x21a)],'serviceCount':_0x4a5157[_0x98bb9(0x226)],'commandCount':_0x4a5157[_0x98bb9(0x234)]((_0x3dc0e7,_0x360682)=>_0x3dc0e7+_0x360682[_0x98bb9(0x1f6)],0x0),'services':_0x4a5157};}catch(_0x347d9d){return{...emptyServiceRegistryInspection(_0x5ba0cb,_0x98bb9(0x1ff),!![]),'message':_0x347d9d instanceof Error?_0x347d9d['message']:String(_0x347d9d)};}}export function formatValidationFailure(_0x2f6e9a){const _0x146d17=a42_0x2030,_0xdeb9fa=_0x2f6e9a[_0x146d17(0x22a)][_0x146d17(0x219)](_0x4f3d02=>_0x4f3d02[_0x146d17(0x203)]+':\x20'+_0x4f3d02['message']);return'Service\x20manifest\x20validation\x20failed:\x0a'+_0xdeb9fa[_0x146d17(0x1fb)]('\x0a');}function extractLoadedServiceManifests(_0x5544c7,_0x4becc6){const _0x3f2541=a42_0x2030;if(!isServiceRegistryLike(_0x5544c7)){const _0x450322=_0x5544c7,{manifest:_0x11d07b,errors:_0x440c90}=adaptServiceTreeManifestForLegacyFramework(_0x450322),_0x27c839=validateServiceTreeManifest(_0x11d07b),_0x292817=mergeValidationErrors(_0x27c839,_0x440c90);return[{'manifest':_0x450322,'report':_0x292817,'normalizedManifest':_0x292817['ok']?normalizeServiceTreeManifest(_0x11d07b):undefined,'sourceHash':_0x4becc6}];}return _0x5544c7[_0x3f2541(0x21c)][_0x3f2541(0x219)]((_0x1a2d8a,_0x10d965)=>{const _0x5b57da=_0x3f2541,_0x5656ec=isObjectRecord(_0x1a2d8a)?_0x1a2d8a[_0x5b57da(0x210)]:undefined,{manifest:_0x3481ed,errors:_0x10dd08}=adaptServiceTreeManifestForLegacyFramework(_0x5656ec),_0x3fce91=validateServiceTreeManifest(_0x3481ed),_0xba5589=mergeValidationErrors(_0x3fce91,_0x10dd08),_0x1a5ff2=isObjectRecord(_0x1a2d8a)&&typeof _0x1a2d8a[_0x5b57da(0x222)]===_0x5b57da(0x20d)?_0x1a2d8a[_0x5b57da(0x222)]:undefined;return{'manifest':_0x5656ec,'report':_0xba5589,'normalizedManifest':_0xba5589['ok']?normalizeServiceTreeManifest(_0x3481ed):undefined,'sourceHash':sha256(JSON['stringify'](_0x5656ec,null,0x2)+'\x0a'),'registryIndex':_0x10d965,'registryServiceCode':_0x1a5ff2};});}function mergeValidationErrors(_0x24012c,_0x46ebc8){const _0x351380=a42_0x2030,_0x53f9f8=_0x24012c[_0x351380(0x22a)][_0x351380(0x219)](_0x43ed48=>_0x43ed48[_0x351380(0x213)]===_0x351380(0x215)?{..._0x43ed48,'message':_0x351380(0x1f9)}:_0x43ed48),_0x56aaa8=[..._0x46ebc8,..._0x53f9f8];return{'ok':_0x56aaa8[_0x351380(0x226)]===0x0,'errors':_0x56aaa8,'warnings':_0x24012c[_0x351380(0x22b)]};}function aggregateValidationReports(_0x5bd696){const _0x11cd47=a42_0x2030,_0x2de7d6=_0x5bd696[_0x11cd47(0x220)](_0x4c98f1=>_0x4c98f1['registryIndex']===undefined?_0x4c98f1[_0x11cd47(0x200)][_0x11cd47(0x22a)]:_0x4c98f1['report'][_0x11cd47(0x22a)][_0x11cd47(0x219)](_0x439057=>({..._0x439057,'path':prefixRegistryIssuePath(_0x4c98f1[_0x11cd47(0x1e9)],_0x439057['path'])}))),_0x48b7c8=_0x5bd696['flatMap'](_0x160639=>_0x160639['registryIndex']===undefined?_0x160639[_0x11cd47(0x200)]['warnings']:_0x160639['report'][_0x11cd47(0x22b)][_0x11cd47(0x219)](_0xefb594=>({..._0xefb594,'path':prefixRegistryIssuePath(_0x160639[_0x11cd47(0x1e9)],_0xefb594['path'])})));return{'ok':_0x2de7d6[_0x11cd47(0x226)]===0x0,'errors':_0x2de7d6,'warnings':_0x48b7c8};}function prefixRegistryIssuePath(_0x58cd0f,_0x3d4e83){const _0xec7a8a=a42_0x2030;if(_0x3d4e83==='$')return _0xec7a8a(0x238)+_0x58cd0f+'].manifest';if(_0x3d4e83[_0xec7a8a(0x20f)]('$.'))return _0xec7a8a(0x238)+_0x58cd0f+'].manifest'+_0x3d4e83[_0xec7a8a(0x217)](0x1);if(_0x3d4e83[_0xec7a8a(0x20f)]('$['))return _0xec7a8a(0x238)+_0x58cd0f+_0xec7a8a(0x233)+_0x3d4e83['slice'](0x1);return _0xec7a8a(0x238)+_0x58cd0f+_0xec7a8a(0x1ed)+_0x3d4e83;}function isServiceRegistryLike(_0x20e5fc){const _0x18c137=a42_0x2030;return isObjectRecord(_0x20e5fc)&&_0x20e5fc['schemaVersion']===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x18c137(0x22e)](_0x20e5fc['services']);}function isObjectRecord(_0x343c60){return Boolean(_0x343c60)&&typeof _0x343c60==='object'&&!Array['isArray'](_0x343c60);}function emptyServiceRegistryInspection(_0x31ba18,_0x41668e,_0x10e4f0){return{'registryPath':_0x31ba18,'exists':_0x10e4f0,'status':_0x41668e,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x43dd7b){const _0x4f354e=a42_0x2030,_0x5bd575=_0x43dd7b[_0x4f354e(0x218)],_0x147d3e=_0x5bd575[_0x4f354e(0x1ea)][_0x4f354e(0x219)](_0x4c52b2=>({'path':_0x4c52b2['cliPath'],'description':_0x4c52b2[_0x4f354e(0x1ee)],'risk':_0x4c52b2[_0x4f354e(0x23a)],'targetKind':_0x4c52b2[_0x4f354e(0x229)][_0x4f354e(0x1fe)],'targetCommand':_0x4c52b2[_0x4f354e(0x229)][_0x4f354e(0x21d)]}));return{'serviceCode':_0x43dd7b[_0x4f354e(0x222)],'name':_0x5bd575[_0x4f354e(0x21b)][_0x4f354e(0x1f7)],'description':_0x5bd575[_0x4f354e(0x21b)][_0x4f354e(0x1ee)],'version':_0x43dd7b['version'],'importedAt':_0x43dd7b[_0x4f354e(0x1f8)],'source':_0x43dd7b[_0x4f354e(0x204)],'commandCount':_0x147d3e[_0x4f354e(0x226)],'commands':_0x147d3e};}function sha256(_0x126279){const _0x10722d=a42_0x2030;return createHash(_0x10722d(0x207))[_0x10722d(0x227)](_0x126279)['digest'](_0x10722d(0x230));}
|
|
1
|
+
const a42_0x4dda50=a42_0x217e;function a42_0x2dd2(){const _0x31595f=['validation','startsWith','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','now','registryIndex','schemaVersion','description','8841636kvMaBm','2874144pNolKJ','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','invalid','isArray','parse','code','path','file','update','5663835TdwSOm','toISOString','join','filePath','message','homeDir','empty','trim','push','utf8','errors','report','manifest','reduce','warnings','CliError','string','.tmp','bff\x20target\x20requires\x20functionName.','command','265522OhakOZ','cliPath','].manifest','target','manifests','3sGLLzx','stringify','Local\x20service\x20not\x20found:\x20','$.services[','commandCount','Remove\x20or\x20migrate\x20','services\x20must\x20be\x20an\x20array','updatedAt','flatMap','].manifest.','Invalid\x20service\x20manifest\x20JSON:\x20','4885636KfycES','missing','Unsupported\x20schemaVersion:\x20','services','sourceHash','hex','Cannot\x20write\x20service\x20registry:\x20','localeCompare','Service\x20manifest\x20validation\x20failed:\x0a','Service\x20manifest\x20file\x20not\x20found:\x20','homeDirName','serviceCode','version','findIndex','map','length','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','name','service.json','sort','find','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','digest','source','service','sha256','988761ObWkMI','normalizedManifest','4224216TKcZcf','slice'];a42_0x2dd2=function(){return _0x31595f;};return a42_0x2dd2();}(function(_0x4a41ae,_0x21d285){const _0x49ec95=a42_0x217e,_0x5b18d8=_0x4a41ae();while(!![]){try{const _0x3f0208=-parseInt(_0x49ec95(0x1d1))/0x1*(parseInt(_0x49ec95(0x1cc))/0x2)+-parseInt(_0x49ec95(0x1f6))/0x3+-parseInt(_0x49ec95(0x1dc))/0x4+parseInt(_0x49ec95(0x1b8))/0x5+parseInt(_0x49ec95(0x1ae))/0x6+-parseInt(_0x49ec95(0x1af))/0x7+parseInt(_0x49ec95(0x1a5))/0x8;if(_0x3f0208===_0x21d285)break;else _0x5b18d8['push'](_0x5b18d8['shift']());}catch(_0x2ab3df){_0x5b18d8['push'](_0x5b18d8['shift']());}}}(a42_0x2dd2,0xbd181));import{createHash}from'node:crypto';import{existsSync,mkdirSync,readFileSync,renameSync,unlinkSync,writeFileSync}from'node:fs';import{homedir}from'node:os';import{dirname,resolve}from'node:path';import{normalizeServiceTreeManifest,validateServiceTreeManifest}from'@lovrabet/cli-framework';import{PRODUCT_CONFIG}from'../../constant/product.js';import{CliErrors}from'../../errors.js';import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a42_0x4dda50(0x1ee);export function getServiceRegistryPath(_0x1d68eb={}){const _0x2c74fc=a42_0x4dda50;return resolve(_0x1d68eb[_0x2c74fc(0x1bd)]??homedir(),PRODUCT_CONFIG[_0x2c74fc(0x1e6)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x56d89e={}){const _0x1b6510=a42_0x4dda50,_0x412b88=getServiceRegistryPath(_0x56d89e);if(!existsSync(_0x412b88))return emptyServiceRegistry();try{const _0x8353c=readFileSync(_0x412b88,_0x1b6510(0x1c1));if(!_0x8353c[_0x1b6510(0x1bf)]())return emptyServiceRegistry();const _0x2ef71a=JSON[_0x1b6510(0x1b3)](_0x8353c);if(_0x2ef71a[_0x1b6510(0x1ac)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x1b6510(0x1a7)]('Unsupported\x20service\x20registry\x20schemaVersion:\x20'+String(_0x2ef71a[_0x1b6510(0x1ac)]),_0x1b6510(0x1d6)+_0x412b88+'.');if(!Array[_0x1b6510(0x1b2)](_0x2ef71a['services']))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x2ef71a['updatedAt'],'services':_0x2ef71a['services']};}catch(_0x439524){if(_0x439524 instanceof Error&&_0x439524[_0x1b6510(0x1ed)]===_0x1b6510(0x1c7))throw _0x439524;throw CliErrors[_0x1b6510(0x1a7)]('Invalid\x20service\x20registry\x20JSON:\x20'+_0x412b88,_0x1b6510(0x1b0));}}export function writeServiceRegistry(_0x1e2463,_0x28be4e={}){const _0x228ffb=a42_0x4dda50,_0x35cdde=getServiceRegistryPath(_0x28be4e),_0xd57aa7=dirname(_0x35cdde);!existsSync(_0xd57aa7)&&mkdirSync(_0xd57aa7,{'recursive':!![]});const _0xc91018=_0x35cdde+_0x228ffb(0x1c9);try{writeFileSync(_0xc91018,JSON[_0x228ffb(0x1d2)](_0x1e2463,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0xc91018,_0x35cdde);}catch(_0x2a071b){try{unlinkSync(_0xc91018);}catch{}if(_0x2a071b?.[_0x228ffb(0x1b4)]==='ENOENT')throw CliErrors[_0x228ffb(0x1a7)](_0x228ffb(0x1e2)+_0x35cdde);throw _0x2a071b;}return _0x35cdde;}export function loadServiceManifestFromFile(_0x348877){const _0x31b940=a42_0x4dda50,_0x3fda6a=resolve(_0x348877);if(!existsSync(_0x3fda6a))throw CliErrors[_0x31b940(0x1a7)](_0x31b940(0x1e5)+_0x348877);let _0x478735;const _0xb9786f=readFileSync(_0x3fda6a,_0x31b940(0x1c1));try{_0x478735=JSON['parse'](_0xb9786f);}catch{throw CliErrors[_0x31b940(0x1a7)](_0x31b940(0x1db)+_0x348877,_0x31b940(0x1f1));}const _0x534f72=sha256(_0xb9786f),_0x1106ac=extractLoadedServiceManifests(_0x478735,_0x534f72),_0x54626c=aggregateValidationReports(_0x1106ac),_0x179e7f=_0x1106ac[0x0];return{'filePath':_0x3fda6a,'hash':_0x534f72,'kind':isServiceRegistryLike(_0x478735)?'registry':_0x31b940(0x1c4),'manifest':_0x179e7f?.[_0x31b940(0x1c4)]??_0x478735,'report':_0x54626c,'normalizedManifest':_0x1106ac[_0x31b940(0x1eb)]===0x1?_0x179e7f?.['normalizedManifest']:undefined,'manifests':_0x1106ac};}export function importServiceManifest(_0x2de308,_0x38d751={}){const _0x2ef7d6=a42_0x4dda50,_0x5a6426=loadServiceManifestFromFile(_0x2de308);if(!_0x5a6426[_0x2ef7d6(0x1c3)]['ok'])throw CliErrors[_0x2ef7d6(0x1a7)](formatValidationFailure(_0x5a6426[_0x2ef7d6(0x1c3)]),'Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.');if(_0x5a6426[_0x2ef7d6(0x1d0)]['length']===0x0)throw CliErrors[_0x2ef7d6(0x1a7)](_0x2ef7d6(0x1a9),'Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.');const _0x2fdc0f=readServiceRegistry(_0x38d751),_0x2c5aff=(_0x38d751['now']??(()=>new Date()))()[_0x2ef7d6(0x1b9)](),_0x540c92=[];let _0x59b87f=0x0,_0x2fcda4=0x0;for(const _0x589f10 of _0x5a6426[_0x2ef7d6(0x1d0)]){if(!_0x589f10['normalizedManifest'])continue;const _0x5dc470=_0x589f10[_0x2ef7d6(0x1f7)][_0x2ef7d6(0x1f4)][_0x2ef7d6(0x1b4)],_0xa3e2f2={'serviceCode':_0x5dc470,'version':_0x589f10[_0x2ef7d6(0x1f7)][_0x2ef7d6(0x1e8)],'importedAt':_0x2c5aff,'source':{'type':_0x2ef7d6(0x1b6),'path':_0x5a6426[_0x2ef7d6(0x1bb)],'hash':_0x589f10[_0x2ef7d6(0x1e0)]},'manifest':_0x589f10[_0x2ef7d6(0x1c4)],'normalizedManifest':_0x589f10[_0x2ef7d6(0x1f7)]},_0x55ef10=_0x2fdc0f[_0x2ef7d6(0x1df)][_0x2ef7d6(0x1e9)](_0x141a27=>_0x141a27['serviceCode']===_0x5dc470);_0x55ef10>=0x0?(_0x2fdc0f['services'][_0x55ef10]=_0xa3e2f2,_0x2fcda4++):(_0x2fdc0f[_0x2ef7d6(0x1df)][_0x2ef7d6(0x1c0)](_0xa3e2f2),_0x59b87f++),_0x540c92['push'](_0xa3e2f2);}_0x2fdc0f[_0x2ef7d6(0x1df)][_0x2ef7d6(0x1ef)]((_0x242ade,_0x2d9ba8)=>_0x242ade[_0x2ef7d6(0x1e7)][_0x2ef7d6(0x1e3)](_0x2d9ba8[_0x2ef7d6(0x1e7)])),_0x2fdc0f[_0x2ef7d6(0x1d8)]=_0x2c5aff;const _0x2661c0=writeServiceRegistry(_0x2fdc0f,_0x38d751);return{'registryPath':_0x2661c0,'entry':_0x540c92[0x0],'replaced':_0x540c92[_0x2ef7d6(0x1eb)]===0x1?_0x2fcda4===0x1:_0x2fcda4>0x0,'entries':_0x540c92,'imported':_0x59b87f,'updated':_0x2fcda4,'serviceCount':_0x2fdc0f[_0x2ef7d6(0x1df)]['length']};}export function exportServiceManifest(_0x476666,_0x29481c,_0x19eaa6={}){const _0x2d65e7=a42_0x4dda50,_0x3837e9=getServiceRegistryPath(_0x19eaa6),_0x30410e=getLocalServiceEntry(_0x476666,_0x19eaa6);if(!_0x30410e)throw CliErrors[_0x2d65e7(0x1a7)](_0x2d65e7(0x1d3)+_0x476666,_0x2d65e7(0x1ec));const _0x3a7a24=resolve(_0x29481c),_0x3e964a=dirname(_0x3a7a24);return!existsSync(_0x3e964a)&&mkdirSync(_0x3e964a,{'recursive':!![]}),writeFileSync(_0x3a7a24,JSON[_0x2d65e7(0x1d2)](_0x30410e[_0x2d65e7(0x1c4)],null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),{'registryPath':_0x3837e9,'filePath':_0x3a7a24,'entry':_0x30410e};}export function removeServiceManifest(_0x28bba7,_0x35e3c8={}){const _0x5e0dee=a42_0x4dda50,_0x321afb=readServiceRegistry(_0x35e3c8),_0x3be65c=_0x28bba7[_0x5e0dee(0x1bf)](),_0x5a3507=_0x321afb[_0x5e0dee(0x1df)][_0x5e0dee(0x1e9)](_0x49cd66=>_0x49cd66[_0x5e0dee(0x1e7)]===_0x3be65c);if(_0x5a3507<0x0)throw CliErrors[_0x5e0dee(0x1a7)](_0x5e0dee(0x1d3)+_0x3be65c,_0x5e0dee(0x1ec));const [_0x18fc15]=_0x321afb['services']['splice'](_0x5a3507,0x1),_0x2cfdb1=(_0x35e3c8[_0x5e0dee(0x1aa)]??(()=>new Date()))()[_0x5e0dee(0x1b9)]();_0x321afb[_0x5e0dee(0x1d8)]=_0x2cfdb1;const _0x4c122d=writeServiceRegistry(_0x321afb,_0x35e3c8);return{'registryPath':_0x4c122d,'entry':_0x18fc15,'serviceCount':_0x321afb[_0x5e0dee(0x1df)][_0x5e0dee(0x1eb)]};}export function listLocalServices(_0x1fa274={}){const _0x123899=a42_0x4dda50;return readServiceRegistry(_0x1fa274)[_0x123899(0x1df)];}export function getLocalServiceEntry(_0x3a0567,_0x5502dc={}){const _0x290bc4=a42_0x4dda50;return readServiceRegistry(_0x5502dc)['services'][_0x290bc4(0x1f0)](_0x11247f=>_0x11247f['serviceCode']===_0x3a0567[_0x290bc4(0x1bf)]());}export function listLocalServiceTrees(_0x215d13={}){const _0x2c17e7=a42_0x4dda50;return readServiceRegistry(_0x215d13)[_0x2c17e7(0x1df)][_0x2c17e7(0x1ea)](_0x3256cf=>_0x3256cf[_0x2c17e7(0x1f7)]);}export function inspectServiceRegistry(_0x428833={}){const _0x56e866=a42_0x4dda50,_0x1a2bc4=getServiceRegistryPath(_0x428833);if(!existsSync(_0x1a2bc4))return emptyServiceRegistryInspection(_0x1a2bc4,_0x56e866(0x1dd),![]);try{const _0x14c282=readFileSync(_0x1a2bc4,_0x56e866(0x1c1));if(!_0x14c282[_0x56e866(0x1bf)]())return emptyServiceRegistryInspection(_0x1a2bc4,_0x56e866(0x1be),!![]);const _0x2bb495=JSON['parse'](_0x14c282);if(_0x2bb495[_0x56e866(0x1ac)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x1a2bc4,_0x56e866(0x1b1),!![]),'schemaVersion':_0x2bb495[_0x56e866(0x1ac)],'message':_0x56e866(0x1de)+String(_0x2bb495['schemaVersion'])};if(!Array[_0x56e866(0x1b2)](_0x2bb495[_0x56e866(0x1df)]))return{...emptyServiceRegistryInspection(_0x1a2bc4,'invalid',!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x2bb495[_0x56e866(0x1d8)],'message':_0x56e866(0x1d7)};const _0x3d10ae=_0x2bb495[_0x56e866(0x1df)][_0x56e866(0x1ea)](summarizeLocalServiceEntry);return{'registryPath':_0x1a2bc4,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x2bb495[_0x56e866(0x1d8)],'serviceCount':_0x3d10ae[_0x56e866(0x1eb)],'commandCount':_0x3d10ae[_0x56e866(0x1c5)]((_0x327a71,_0x3e87e4)=>_0x327a71+_0x3e87e4[_0x56e866(0x1d5)],0x0),'services':_0x3d10ae};}catch(_0x2a5647){return{...emptyServiceRegistryInspection(_0x1a2bc4,_0x56e866(0x1b1),!![]),'message':_0x2a5647 instanceof Error?_0x2a5647[_0x56e866(0x1bc)]:String(_0x2a5647)};}}export function formatValidationFailure(_0x3d164a){const _0x1d31fe=a42_0x4dda50,_0x3b16df=_0x3d164a[_0x1d31fe(0x1c2)]['map'](_0x22aeed=>_0x22aeed[_0x1d31fe(0x1b5)]+':\x20'+_0x22aeed[_0x1d31fe(0x1bc)]);return _0x1d31fe(0x1e4)+_0x3b16df[_0x1d31fe(0x1ba)]('\x0a');}function extractLoadedServiceManifests(_0x1640e8,_0x57aee1){const _0x1a4d41=a42_0x4dda50;if(!isServiceRegistryLike(_0x1640e8)){const _0x4214a7=_0x1640e8,{manifest:_0x5b54ea,errors:_0x177dfe}=adaptServiceTreeManifestForLegacyFramework(_0x4214a7),_0x18bde7=validateServiceTreeManifest(_0x5b54ea),_0x53a028=mergeValidationErrors(_0x18bde7,_0x177dfe);return[{'manifest':_0x4214a7,'report':_0x53a028,'normalizedManifest':_0x53a028['ok']?normalizeServiceTreeManifest(_0x5b54ea):undefined,'sourceHash':_0x57aee1}];}return _0x1640e8[_0x1a4d41(0x1df)]['map']((_0x21c0a4,_0x2dffcd)=>{const _0x26b4b6=_0x1a4d41,_0x419198=isObjectRecord(_0x21c0a4)?_0x21c0a4['manifest']:undefined,{manifest:_0x500a1c,errors:_0x5b978f}=adaptServiceTreeManifestForLegacyFramework(_0x419198),_0x31e29d=validateServiceTreeManifest(_0x500a1c),_0x581776=mergeValidationErrors(_0x31e29d,_0x5b978f),_0x44badc=isObjectRecord(_0x21c0a4)&&typeof _0x21c0a4[_0x26b4b6(0x1e7)]===_0x26b4b6(0x1c8)?_0x21c0a4[_0x26b4b6(0x1e7)]:undefined;return{'manifest':_0x419198,'report':_0x581776,'normalizedManifest':_0x581776['ok']?normalizeServiceTreeManifest(_0x500a1c):undefined,'sourceHash':sha256(JSON['stringify'](_0x419198,null,0x2)+'\x0a'),'registryIndex':_0x2dffcd,'registryServiceCode':_0x44badc};});}function mergeValidationErrors(_0x57de11,_0x2b199c){const _0x326cfb=a42_0x4dda50,_0x9f3552=_0x57de11['errors'][_0x326cfb(0x1ea)](_0x2b8cac=>_0x2b8cac['message']==='bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.'?{..._0x2b8cac,'message':_0x326cfb(0x1ca)}:_0x2b8cac),_0x3bc6d9=[..._0x2b199c,..._0x9f3552];return{'ok':_0x3bc6d9[_0x326cfb(0x1eb)]===0x0,'errors':_0x3bc6d9,'warnings':_0x57de11[_0x326cfb(0x1c6)]};}function aggregateValidationReports(_0x5c113e){const _0x582e19=a42_0x4dda50,_0x3b9187=_0x5c113e[_0x582e19(0x1d9)](_0x11e0a3=>_0x11e0a3[_0x582e19(0x1ab)]===undefined?_0x11e0a3[_0x582e19(0x1c3)][_0x582e19(0x1c2)]:_0x11e0a3[_0x582e19(0x1c3)]['errors'][_0x582e19(0x1ea)](_0x38aed9=>({..._0x38aed9,'path':prefixRegistryIssuePath(_0x11e0a3[_0x582e19(0x1ab)],_0x38aed9[_0x582e19(0x1b5)])}))),_0x2217e6=_0x5c113e[_0x582e19(0x1d9)](_0x458fb6=>_0x458fb6[_0x582e19(0x1ab)]===undefined?_0x458fb6['report'][_0x582e19(0x1c6)]:_0x458fb6[_0x582e19(0x1c3)][_0x582e19(0x1c6)][_0x582e19(0x1ea)](_0x260212=>({..._0x260212,'path':prefixRegistryIssuePath(_0x458fb6[_0x582e19(0x1ab)],_0x260212[_0x582e19(0x1b5)])})));return{'ok':_0x3b9187[_0x582e19(0x1eb)]===0x0,'errors':_0x3b9187,'warnings':_0x2217e6};}function prefixRegistryIssuePath(_0x4bf991,_0x8900b9){const _0x216e7c=a42_0x4dda50;if(_0x8900b9==='$')return'$.services['+_0x4bf991+_0x216e7c(0x1ce);if(_0x8900b9[_0x216e7c(0x1a8)]('$.'))return'$.services['+_0x4bf991+_0x216e7c(0x1ce)+_0x8900b9[_0x216e7c(0x1a6)](0x1);if(_0x8900b9[_0x216e7c(0x1a8)]('$['))return'$.services['+_0x4bf991+_0x216e7c(0x1ce)+_0x8900b9[_0x216e7c(0x1a6)](0x1);return _0x216e7c(0x1d4)+_0x4bf991+_0x216e7c(0x1da)+_0x8900b9;}function a42_0x217e(_0x1d0644,_0xd96ece){_0x1d0644=_0x1d0644-0x1a5;const _0x2dd235=a42_0x2dd2();let _0x217e40=_0x2dd235[_0x1d0644];return _0x217e40;}function isServiceRegistryLike(_0x2ce3b7){const _0x48e7b7=a42_0x4dda50;return isObjectRecord(_0x2ce3b7)&&_0x2ce3b7[_0x48e7b7(0x1ac)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x48e7b7(0x1b2)](_0x2ce3b7[_0x48e7b7(0x1df)]);}function isObjectRecord(_0x468d20){const _0x3458cf=a42_0x4dda50;return Boolean(_0x468d20)&&typeof _0x468d20==='object'&&!Array[_0x3458cf(0x1b2)](_0x468d20);}function emptyServiceRegistryInspection(_0x734b2b,_0x2a32a1,_0x206970){return{'registryPath':_0x734b2b,'exists':_0x206970,'status':_0x2a32a1,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x23b031){const _0x63b906=a42_0x4dda50,_0x182931=_0x23b031[_0x63b906(0x1f7)],_0x48ef0d=_0x182931['commands'][_0x63b906(0x1ea)](_0x13182f=>({'path':_0x13182f[_0x63b906(0x1cd)],'description':_0x13182f[_0x63b906(0x1ad)],'risk':_0x13182f['risk'],'targetKind':_0x13182f[_0x63b906(0x1cf)]['kind'],'targetCommand':_0x13182f['target'][_0x63b906(0x1cb)]}));return{'serviceCode':_0x23b031[_0x63b906(0x1e7)],'name':_0x182931[_0x63b906(0x1f4)][_0x63b906(0x1ed)],'description':_0x182931[_0x63b906(0x1f4)][_0x63b906(0x1ad)],'version':_0x23b031[_0x63b906(0x1e8)],'importedAt':_0x23b031['importedAt'],'source':_0x23b031[_0x63b906(0x1f3)],'commandCount':_0x48ef0d[_0x63b906(0x1eb)],'commands':_0x48ef0d};}function sha256(_0x23aa01){const _0x284bcc=a42_0x4dda50;return createHash(_0x284bcc(0x1f5))[_0x284bcc(0x1b7)](_0x23aa01)[_0x284bcc(0x1f2)](_0x284bcc(0x1e1));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x1512af=a43_0x2964;(function(_0x22eb69,_0x17f6e3){const _0x3c5709=a43_0x2964,_0x3738db=_0x22eb69();while(!![]){try{const _0x30fc23=-parseInt(_0x3c5709(0x18c))/0x1*(-parseInt(_0x3c5709(0x180))/0x2)+parseInt(_0x3c5709(0x18a))/0x3+parseInt(_0x3c5709(0x19e))/0x4*(parseInt(_0x3c5709(0x195))/0x5)+-parseInt(_0x3c5709(0x1a0))/0x6*(-parseInt(_0x3c5709(0x185))/0x7)+-parseInt(_0x3c5709(0x194))/0x8*(-parseInt(_0x3c5709(0x1a3))/0x9)+-parseInt(_0x3c5709(0x19f))/0xa*(parseInt(_0x3c5709(0x19c))/0xb)+-parseInt(_0x3c5709(0x182))/0xc;if(_0x30fc23===_0x17f6e3)break;else _0x3738db['push'](_0x3738db['shift']());}catch(_0x305ca3){_0x3738db['push'](_0x3738db['shift']());}}}(a43_0x2b06,0x86775));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';function a43_0x2b06(){const _0x58336d=['1906370WMHNJf','18UICTWO','skillName','force','4376556FVgVUJ','str','创建本地自包含的运行态\x20Skill\x20草稿','1138294BDmsOT','name','38872344uoBBEu','skill','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','2285465TgHrKU','bool','isDirectory','skillDir','将在本地生成一个自包含的\x20Skill\x20草稿目录;使用\x20--force\x20时会覆盖目录中同名的模板文件。确认界面不会展示本地路径。','2610573ItSoeU','Skill\x20directory\x20already\x20exists:\x20','1NVCZnL','Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20','files','isSymbolicLink','Refusing\x20to\x20overwrite\x20symlink:\x20','type','utf8','validation','16bfacKU','15Oxrtpz','path','target','content','trim','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','WRITE','22woHYYz','rendered','1040024eBSBEx'];a43_0x2b06=function(){return _0x58336d;};return a43_0x2b06();}function a43_0x2964(_0x562dde,_0x2157c0){_0x562dde=_0x562dde-0x17f;const _0x2b066d=a43_0x2b06();let _0x296468=_0x2b066d[_0x562dde];return _0x296468;}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';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':a43_0x1512af(0x183),'command':'create','description':a43_0x1512af(0x17f),'risk':'write','confirmationDescription':a43_0x1512af(0x189),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0xccb5eb){const _0x23f30f=a43_0x1512af,_0x2f4cff=buildSkillCreatePlan(_0xccb5eb[_0x23f30f(0x1a4)](_0x23f30f(0x181)),_0xccb5eb[_0x23f30f(0x1a4)](_0x23f30f(0x191)),_0xccb5eb[_0x23f30f(0x1a4)](_0x23f30f(0x197)));return{'method':_0x23f30f(0x19b),'url':_0x2f4cff['skillDir'],'body':{'skillName':_0x2f4cff[_0x23f30f(0x19d)]['skillName'],'type':_0x2f4cff[_0x23f30f(0x19d)][_0x23f30f(0x191)],'selfContained':!![],'files':_0x2f4cff[_0x23f30f(0x19d)]['files']['map'](_0x39d8d7=>_0x39d8d7[_0x23f30f(0x196)])},'description':_0x23f30f(0x184)};},async 'execute'(_0x5065b3){const _0x27b73a=a43_0x1512af,_0x2dd9d1=buildSkillCreatePlan(_0x5065b3[_0x27b73a(0x1a4)](_0x27b73a(0x181)),_0x5065b3[_0x27b73a(0x1a4)]('type'),_0x5065b3[_0x27b73a(0x1a4)](_0x27b73a(0x197)));return writeSkillDraft(_0x2dd9d1,_0x5065b3[_0x27b73a(0x186)](_0x27b73a(0x1a2))),{'ok':!![],'data':{'skillName':_0x2dd9d1[_0x27b73a(0x19d)]['skillName'],'type':_0x2dd9d1[_0x27b73a(0x19d)][_0x27b73a(0x191)],'dir':_0x2dd9d1['skillDir'],'files':_0x2dd9d1[_0x27b73a(0x19d)][_0x27b73a(0x18e)]['map'](_0x1c3966=>_0x1c3966[_0x27b73a(0x196)])},'message':'Created\x20local\x20Skill\x20draft\x20'+_0x2dd9d1[_0x27b73a(0x19d)][_0x27b73a(0x1a1)]};}};function buildSkillCreatePlan(_0x22f9c6,_0x188e2f,_0x5e9b16){const _0xa5c1b9=a43_0x1512af,_0x2d0f33=_0x188e2f[_0xa5c1b9(0x199)](),_0x5db2f1=renderSkillTemplate({'skillName':_0x22f9c6,'type':_0x2d0f33});!_0x2d0f33&&writeCliSideChannelLine('Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.');const _0x42f1a=resolve(normalizeSkillTarget(_0x5e9b16));return{'rendered':_0x5db2f1,'targetRoot':_0x42f1a,'skillDir':resolve(_0x42f1a,_0x5db2f1[_0xa5c1b9(0x1a1)])};}function normalizeSkillTarget(_0x21f302){const _0x34eed2=a43_0x1512af;return(_0x21f302||DEFAULT_SKILL_TARGET)[_0x34eed2(0x199)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x13147c,_0x4cef0a){const _0x4cd245=a43_0x1512af;if(existsSync(_0x13147c[_0x4cd245(0x188)])){const _0x2b0960=lstatSync(_0x13147c[_0x4cd245(0x188)]);if(!_0x2b0960[_0x4cd245(0x187)]()||_0x2b0960[_0x4cd245(0x18f)]())throw CliErrors[_0x4cd245(0x193)](_0x4cd245(0x18d)+_0x13147c['skillDir']);if(!_0x4cef0a)throw CliErrors[_0x4cd245(0x193)](_0x4cd245(0x18b)+_0x13147c[_0x4cd245(0x188)],_0x4cd245(0x19a));}for(const _0x58fa32 of _0x13147c[_0x4cd245(0x19d)][_0x4cd245(0x18e)]){const _0x44eb00=resolve(_0x13147c[_0x4cd245(0x188)],_0x58fa32[_0x4cd245(0x196)]),_0x43eb7c=dirname(_0x44eb00);mkdirSync(_0x43eb7c,{'recursive':!![]});if(existsSync(_0x44eb00)&&lstatSync(_0x44eb00)[_0x4cd245(0x18f)]())throw CliErrors[_0x4cd245(0x193)](_0x4cd245(0x190)+_0x44eb00);writeFileSync(_0x44eb00,_0x58fa32[_0x4cd245(0x198)],_0x4cd245(0x192));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0x888da8=a44_0x581c;(function(_0x27f64b,_0x55d61c){const _0x57dca0=a44_0x581c,_0x6ec478=_0x27f64b();while(!![]){try{const _0x458753=parseInt(_0x57dca0(0x15a))/0x1*(parseInt(_0x57dca0(0x16a))/0x2)+-parseInt(_0x57dca0(0x182))/0x3+-parseInt(_0x57dca0(0x167))/0x4+parseInt(_0x57dca0(0x17c))/0x5*(parseInt(_0x57dca0(0x15e))/0x6)+parseInt(_0x57dca0(0x175))/0x7*(parseInt(_0x57dca0(0x159))/0x8)+parseInt(_0x57dca0(0x180))/0x9*(-parseInt(_0x57dca0(0x184))/0xa)+parseInt(_0x57dca0(0x16c))/0xb;if(_0x458753===_0x55d61c)break;else _0x6ec478['push'](_0x6ec478['shift']());}catch(_0x4c257c){_0x6ec478['push'](_0x6ec478['shift']());}}}(a44_0x25df,0xa81a1));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';function a44_0x581c(_0x275afd,_0x55de9e){_0x275afd=_0x275afd-0x156;const _0x25dff0=a44_0x25df();let _0x581c10=_0x25dff0[_0x275afd];return _0x581c10;}import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';import{DIAGRAM_FILE_FLAG,DIAGRAM_SCOPE_FLAG,DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,SOURCE_FINGERPRINT_FLAG}from'../flags.js';const TARGET_FLAGS=[DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,DIAGRAM_SCOPE_FLAG],WRITE_FLAGS=[...TARGET_FLAGS,SOURCE_FINGERPRINT_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,DIAGRAM_FILE_FLAG];function a44_0x25df(){const _0x49c2a2=['diagram-show','\x20is\x20unchanged.','12856UGfRCI','13sziEYh','skill-code','skillCode','Found\x20Skill\x20diagram\x20for\x20','60tQoeAz','action','source-fingerprint','found','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','version','Updated','write','Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','1736048wCkNkA',';\x20first\x20write\x20expects\x20revision\x20','diagram-push','77494gUxHUn','appCode','920139BosNMH','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','expected-diagram-revision','unchanged','skill','expectedDiagramRevision','diagram-file','num','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','2142zWBeei','read','str','company','test','scope','将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。','328310htDSyb','为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','created',';\x20next\x20write\x20expects\x20revision\x20','9DisOMo','trim','1137744HrivHF','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','2339170RzRTOT','validation'];a44_0x25df=function(){return _0x49c2a2;};return a44_0x25df();}function readDiagramTarget(_0xef3151){const _0x4cb5ce=a44_0x581c,_0x9754bf=_0xef3151['str'](_0x4cb5ce(0x15b))[_0x4cb5ce(0x181)](),_0x1971f7=_0xef3151[_0x4cb5ce(0x177)]('version')[_0x4cb5ce(0x181)](),_0x4a4f92=_0xef3151[_0x4cb5ce(0x177)](_0x4cb5ce(0x17a));if(!_0x9754bf||!_0x1971f7||_0x4a4f92!=='personal'&&_0x4a4f92!==_0x4cb5ce(0x178))throw CliErrors[_0x4cb5ce(0x156)](_0x4cb5ce(0x174));return{'skillCode':_0x9754bf,'version':_0x1971f7,'scope':_0x4a4f92};}async function readDiagramWriteInput(_0x2cf1a3){const _0x45d0a1=a44_0x581c,_0x4eeefd=_0x2cf1a3[_0x45d0a1(0x173)](_0x45d0a1(0x16e)),_0x16bd00=_0x2cf1a3[_0x45d0a1(0x177)](_0x45d0a1(0x160))[_0x45d0a1(0x181)]();if(!Number['isInteger'](_0x4eeefd)||_0x4eeefd<0x0)throw CliErrors[_0x45d0a1(0x156)]('--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.');if(!/^sha256:[0-9a-f]{64}$/[_0x45d0a1(0x179)](_0x16bd00))throw CliErrors[_0x45d0a1(0x156)](_0x45d0a1(0x183));return{'expectedDiagramRevision':_0x4eeefd,'sourceFingerprint':_0x16bd00,'diagram':await readRequiredSkillDiagram(_0x2cf1a3[_0x45d0a1(0x177)](_0x45d0a1(0x172)))};}export const diagramValidateCommand={'service':a44_0x888da8(0x170),'command':'diagram-validate','description':a44_0x888da8(0x16d),'risk':a44_0x888da8(0x176),'flags':WRITE_FLAGS,async 'execute'(_0x1e822a){const _0x307ddd=a44_0x888da8,_0x36a496=readDiagramTarget(_0x1e822a),_0xd46079=await validateRuntimeSkillVersionDiagram(_0x1e822a[_0x307ddd(0x16b)],_0x36a496[_0x307ddd(0x15c)],_0x36a496['version'],_0x36a496[_0x307ddd(0x17a)],await readDiagramWriteInput(_0x1e822a));return{'ok':!![],'data':_0xd46079,'message':'Skill\x20diagram\x20validation\x20passed\x20for\x20'+_0x36a496['skillCode']+'@'+_0x36a496[_0x307ddd(0x163)]+'.'};}};export const diagramPushCommand={'service':a44_0x888da8(0x170),'command':a44_0x888da8(0x169),'description':a44_0x888da8(0x17d),'risk':a44_0x888da8(0x165),'confirmationDescription':a44_0x888da8(0x17b),'flags':WRITE_FLAGS,async 'execute'(_0x5da694){const _0xacdc00=a44_0x888da8,_0x434484=readDiagramTarget(_0x5da694),_0x5a53d8=await putRuntimeSkillVersionDiagram(_0x5da694['appCode'],_0x434484[_0xacdc00(0x15c)],_0x434484[_0xacdc00(0x163)],_0x434484['scope'],await readDiagramWriteInput(_0x5da694));return{'ok':!![],'data':_0x5a53d8,'message':_0x5a53d8['action']===_0xacdc00(0x16f)?'Skill\x20diagram\x20for\x20'+_0x434484[_0xacdc00(0x15c)]+'@'+_0x434484[_0xacdc00(0x163)]+_0xacdc00(0x158):(_0x5a53d8[_0xacdc00(0x15f)]===_0xacdc00(0x17e)?'Created':_0xacdc00(0x164))+'\x20Skill\x20diagram\x20for\x20'+_0x434484[_0xacdc00(0x15c)]+'@'+_0x434484['version']+'.'};}};export const diagramShowCommand={'service':'skill','command':a44_0x888da8(0x157),'description':a44_0x888da8(0x166),'risk':'read','flags':TARGET_FLAGS,async 'execute'(_0x56a101){const _0x3f3478=a44_0x888da8,_0x218448=readDiagramTarget(_0x56a101),_0x17060f=await getRuntimeSkillVersionDiagram(_0x56a101['appCode'],_0x218448[_0x3f3478(0x15c)],_0x218448['version'],_0x218448['scope']);return{'ok':!![],'data':_0x17060f,'message':_0x17060f[_0x3f3478(0x161)]?_0x3f3478(0x15d)+_0x218448[_0x3f3478(0x15c)]+'@'+_0x218448[_0x3f3478(0x163)]+_0x3f3478(0x17f)+_0x17060f['expectedDiagramRevision']+'.':_0x3f3478(0x162)+_0x218448[_0x3f3478(0x15c)]+'@'+_0x218448[_0x3f3478(0x163)]+_0x3f3478(0x168)+_0x17060f[_0x3f3478(0x171)]+'.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x3bea97=a45_0x2231;function a45_0x24e8(){const _0x578943=['bool','Installed\x20','56439YbzayJ','created','../../../skills/runtime-skill-sync.js','accessKey','54timVAO','global','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','unchanged','skillRoots','length','action','trim','updated','skipped','skillCode','all','map','includes','../../../core/api-client.js','company','str','skill','version','3688lLHtYY','flatMap','filter','appCode','removed','\x20company\x20Skill(s).','push','personal','7655436PcuFzG','249858quLvlz','project','151725yNSrLB','8065274xsjJnJ','542065UXTfDQ','envName','120670xGLkCm','reduce','force','install','authRequired','Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.'];a45_0x24e8=function(){return _0x578943;};return a45_0x24e8();}(function(_0xea6a48,_0x1d98c0){const _0x12a54b=a45_0x2231,_0x51c19d=_0xea6a48();while(!![]){try{const _0x5cb553=-parseInt(_0x12a54b(0x18b))/0x1+parseInt(_0x12a54b(0x18f))/0x2+-parseInt(_0x12a54b(0x189))/0x3+parseInt(_0x12a54b(0x188))/0x4+-parseInt(_0x12a54b(0x18d))/0x5*(-parseInt(_0x12a54b(0x19b))/0x6)+parseInt(_0x12a54b(0x18c))/0x7+parseInt(_0x12a54b(0x180))/0x8*(-parseInt(_0x12a54b(0x197))/0x9);if(_0x5cb553===_0x1d98c0)break;else _0x51c19d['push'](_0x51c19d['shift']());}catch(_0x3bb7a2){_0x51c19d['push'](_0x51c19d['shift']());}}}(a45_0x24e8,0xee517));function a45_0x2231(_0x4e8c51,_0x436ba7){_0x4e8c51=_0x4e8c51-0x175;const _0x24e8cc=a45_0x24e8();let _0x223180=_0x24e8cc[_0x4e8c51];return _0x223180;}import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':a45_0x3bea97(0x17e),'command':a45_0x3bea97(0x192),'description':a45_0x3bea97(0x19d),'risk':'read','requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x8dca1d){return syncRuntimeSkills(_0x8dca1d);}};async function syncRuntimeSkills(_0x2b9df5){const _0x5c7ee7=a45_0x3bea97,{downloadRuntimeSkillPackage:_0x32f29d,listRuntimeSkills:_0x28e176}=await import(_0x5c7ee7(0x17b)),{linkEffectiveRuntimeSkills:_0x5307e1,materializeRuntimeSkill:_0x290289,pruneStaleRuntimeSkillCache:_0x613a48,pruneStaleRuntimeSkillLinks:_0x1e1c36,resolveRuntimeSkillInstallTarget:_0x23d102}=await import(_0x5c7ee7(0x199)),_0x2e9737=_0x2b9df5['str']('code'),_0x45951e=normalizeSyncScopes(_0x2b9df5[_0x5c7ee7(0x17d)]('scope')),_0x3bbabd=_0x2b9df5[_0x5c7ee7(0x18e)]??'production',_0x20fa94=_0x2b9df5[_0x5c7ee7(0x19a)],_0xdea9=_0x2b9df5[_0x5c7ee7(0x195)](_0x5c7ee7(0x191));if(!_0x20fa94)throw CliErrors[_0x5c7ee7(0x193)](_0x5c7ee7(0x194));const _0x2c906f=_0x23d102(_0x2b9df5['appCode'],_0x2b9df5[_0x5c7ee7(0x195)](_0x5c7ee7(0x18a))?'project':_0x5c7ee7(0x19c)),_0x1a1a54=_0x23d102(_0x2b9df5[_0x5c7ee7(0x183)],_0x2c906f['scope']==='project'?_0x5c7ee7(0x19c):_0x5c7ee7(0x18a)),_0x5410d1=await Promise[_0x5c7ee7(0x178)](_0x45951e[_0x5c7ee7(0x179)](_0x3cbcea=>_0x28e176({'appCode':_0x2b9df5[_0x5c7ee7(0x183)],'scope':_0x3cbcea,'code':_0x2e9737[_0x5c7ee7(0x1a2)]()||undefined}))),_0x4f80c8=_0x45951e['includes']('personal')?_0x5410d1[_0x5c7ee7(0x181)]((_0x3fd65d,_0x49736e)=>_0x45951e[_0x49736e]==='personal'?_0x3fd65d['personal']:[]):[],_0x5af26d=_0x45951e[_0x5c7ee7(0x17a)](_0x5c7ee7(0x17c))?_0x5410d1[_0x5c7ee7(0x181)]((_0x21ade2,_0x1fee75)=>_0x45951e[_0x1fee75]===_0x5c7ee7(0x17c)?_0x21ade2[_0x5c7ee7(0x17c)]:[]):[],_0x33f0dd=new Set([..._0x4f80c8[_0x5c7ee7(0x179)](_0x451bae=>_0x451bae[_0x5c7ee7(0x177)]?.[_0x5c7ee7(0x1a2)]())['filter'](_0x592a74=>Boolean(_0x592a74)),..._0x5af26d[_0x5c7ee7(0x179)](_0x59bc24=>_0x59bc24[_0x5c7ee7(0x177)]?.[_0x5c7ee7(0x1a2)]())[_0x5c7ee7(0x182)](_0x4b9a00=>Boolean(_0x4b9a00))]),_0x98d584=_0x2e9737[_0x5c7ee7(0x1a2)]()?[_0x2e9737['trim']()]:undefined,_0x2fdd7e=_0x45951e[_0x5c7ee7(0x1a0)]===0x2&&_0x45951e[_0x5c7ee7(0x17a)]('personal')&&_0x45951e['includes'](_0x5c7ee7(0x17c)),_0x424a2f=_0x2fdd7e?_0x1e1c36(_0x2c906f,_0x33f0dd,_0x98d584):[],_0xb0cbcc=_0x613a48({'env':_0x3bbabd,'accessKey':_0x20fa94,'appCode':_0x2b9df5[_0x5c7ee7(0x183)],'activeSkillCodes':_0x33f0dd,'pruneSkillCodes':_0x98d584,'scopes':_0x45951e,'protectedLinkRoots':_0x1a1a54['skillRoots']}),_0x3d798e=[];for(const _0x24695d of _0x4f80c8){_0x3d798e[_0x5c7ee7(0x186)](_0x290289(_0x24695d,_0x5c7ee7(0x187),{'env':_0x3bbabd,'accessKey':_0x20fa94,'appCode':_0x2b9df5[_0x5c7ee7(0x183)],'force':_0xdea9,'packageBytes':await downloadSkillPackage(_0x24695d,_0x5c7ee7(0x187),_0x2b9df5[_0x5c7ee7(0x183)],_0x32f29d)}));}for(const _0x13ddae of _0x5af26d){_0x3d798e['push'](_0x290289(_0x13ddae,_0x5c7ee7(0x17c),{'env':_0x3bbabd,'accessKey':_0x20fa94,'appCode':_0x2b9df5[_0x5c7ee7(0x183)],'force':_0xdea9,'packageBytes':await downloadSkillPackage(_0x13ddae,_0x5c7ee7(0x17c),_0x2b9df5[_0x5c7ee7(0x183)],_0x32f29d)}));}const _0x52f312=_0x5307e1(_0x3d798e,_0x2c906f),_0xac5168=countLinkActions(_0x52f312);return{'ok':!![],'data':{'appCode':_0x2b9df5[_0x5c7ee7(0x183)],..._0x2c906f['scope']==='project'?{'installTarget':{'scope':_0x2c906f['scope'],'skillRoots':[..._0x2c906f[_0x5c7ee7(0x19f)]]}}:{},'personal':_0x4f80c8[_0x5c7ee7(0x1a0)],'company':_0x5af26d[_0x5c7ee7(0x1a0)],'materialized':_0x3d798e[_0x5c7ee7(0x1a0)],'links':{'total':_0x52f312[_0x5c7ee7(0x1a0)],'created':_0xac5168[_0x5c7ee7(0x198)]??0x0,'updated':_0xac5168[_0x5c7ee7(0x175)]??0x0,'unchanged':_0xac5168[_0x5c7ee7(0x19e)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x424a2f[_0x5c7ee7(0x182)](_0x8040d7=>_0x8040d7['action']===_0x5c7ee7(0x184))[_0x5c7ee7(0x1a0)],'cacheDirs':_0xb0cbcc['filter'](_0x2e678d=>_0x2e678d['action']===_0x5c7ee7(0x184))[_0x5c7ee7(0x1a0)],'skipped':[..._0x424a2f,..._0xb0cbcc][_0x5c7ee7(0x182)](_0x1a1615=>_0x1a1615['action']===_0x5c7ee7(0x176))['length']},'skills':{'personal':_0x4f80c8[_0x5c7ee7(0x179)](summarizeRuntimeSkill),'company':_0x5af26d[_0x5c7ee7(0x179)](summarizeRuntimeSkill)}},'message':_0x5c7ee7(0x196)+_0x4f80c8[_0x5c7ee7(0x1a0)]+'\x20personal\x20and\x20'+_0x5af26d[_0x5c7ee7(0x1a0)]+_0x5c7ee7(0x185)};}async function downloadSkillPackage(_0x24ce04,_0x143b19,_0x1e8252,_0x1b0392){const _0x4b66bd=a45_0x3bea97,_0x5d562f=_0x24ce04[_0x4b66bd(0x17f)]?.[_0x4b66bd(0x1a2)]();return _0x5d562f?_0x1b0392(_0x143b19,_0x24ce04[_0x4b66bd(0x177)],_0x1e8252,_0x5d562f):_0x1b0392(_0x143b19,_0x24ce04[_0x4b66bd(0x177)],_0x1e8252);}function countLinkActions(_0x38f594){const _0x468fb0=a45_0x3bea97;return _0x38f594[_0x468fb0(0x190)]((_0x3ae414,_0x31e800)=>{const _0x4d7643=_0x468fb0;return _0x3ae414[_0x31e800[_0x4d7643(0x1a1)]]=(_0x3ae414[_0x31e800['action']]??0x0)+0x1,_0x3ae414;},{});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x293326=a46_0x4536;(function(_0x1493f7,_0x115f7b){const _0x3b92fd=a46_0x4536,_0x599c19=_0x1493f7();while(!![]){try{const _0x16bc77=-parseInt(_0x3b92fd(0x11a))/0x1+parseInt(_0x3b92fd(0x122))/0x2+parseInt(_0x3b92fd(0x110))/0x3+parseInt(_0x3b92fd(0x11b))/0x4+parseInt(_0x3b92fd(0x111))/0x5*(-parseInt(_0x3b92fd(0x11f))/0x6)+-parseInt(_0x3b92fd(0x11d))/0x7*(parseInt(_0x3b92fd(0x10a))/0x8)+parseInt(_0x3b92fd(0x10d))/0x9*(parseInt(_0x3b92fd(0x112))/0xa);if(_0x16bc77===_0x115f7b)break;else _0x599c19['push'](_0x599c19['shift']());}catch(_0x485ed){_0x599c19['push'](_0x599c19['shift']());}}}(a46_0x3c2c,0xd8148));import{CliErrors}from'../../../errors.js';function a46_0x4536(_0x5b1494,_0xe19319){_0x5b1494=_0x5b1494-0x108;const _0x3c2c7f=a46_0x3c2c();let _0x4536e4=_0x3c2c7f[_0x5b1494];return _0x4536e4;}import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';function a46_0x3c2c(){const _0x4936bb=['local','envName','global','skill','1301879UMkMzt','1896436RiGOnb','personal','28IzjjcH','\x20local\x20Skill(s).','363702fYxxPD','scope','bool','1151370ZOMTjH','builtin','remote','filter','company','\x20remote\x20Skill(s).','length','map','project','code','1294288ucXfYy','../../../core/api-client.js','trim','51462TiTBtJ','read','Listed\x20','4005114raAuMt','145nmTcgP','3860PTxPIS','appCode','../../../skills/runtime-skill-sync.js','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache'];a46_0x3c2c=function(){return _0x4936bb;};return a46_0x3c2c();}export const listCommand={'service':a46_0x293326(0x119),'command':'list','description':a46_0x293326(0x115),'risk':a46_0x293326(0x10e),'flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x5ea6d9){const _0x91cfd9=a46_0x293326,_0x59cbc7=_0x5ea6d9['str'](_0x91cfd9(0x109)),_0x523a97=normalizeListScope(_0x5ea6d9['str'](_0x91cfd9(0x120)));if(_0x5ea6d9[_0x91cfd9(0x121)](_0x91cfd9(0x116))){const _0xa6066b=_0x5ea6d9['accessKey'];if(!_0xa6066b)throw CliErrors['authRequired']();const {listLocalRuntimeSkills:_0x562286,resolveRuntimeSkillInstallTarget:_0x2dbd92}=await import(_0x91cfd9(0x114)),_0x3c30dd=_0x2dbd92(_0x5ea6d9[_0x91cfd9(0x113)],_0x5ea6d9[_0x91cfd9(0x121)](_0x91cfd9(0x108))?'project':_0x91cfd9(0x118)),_0x3e51e8=_0x562286({'env':_0x5ea6d9[_0x91cfd9(0x117)]??'production','accessKey':_0xa6066b,'appCode':_0x5ea6d9[_0x91cfd9(0x113)],'scopes':listScopeToRuntimeScopes(_0x523a97),'code':_0x59cbc7[_0x91cfd9(0x10c)]()||undefined},_0x3c30dd),_0x52166c=groupLocalRuntimeSkills(_0x3e51e8);return{'ok':!![],'data':{'appCode':_0x5ea6d9[_0x91cfd9(0x113)],'source':_0x91cfd9(0x116),..._0x3c30dd['scope']===_0x91cfd9(0x108)?{'installScope':_0x3c30dd['scope']}:{},'scope':_0x523a97,'total':_0x3e51e8[_0x91cfd9(0x128)],'personal':_0x52166c['personal']['length'],'company':_0x52166c[_0x91cfd9(0x126)][_0x91cfd9(0x128)],'items':_0x3e51e8[_0x91cfd9(0x129)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x52166c[_0x91cfd9(0x11c)][_0x91cfd9(0x129)](summarizeLocalRuntimeSkill),'company':_0x52166c[_0x91cfd9(0x126)][_0x91cfd9(0x129)](summarizeLocalRuntimeSkill)}},'message':_0x91cfd9(0x10f)+_0x3e51e8[_0x91cfd9(0x128)]+_0x91cfd9(0x11e)};}const {listRuntimeSkills:_0x316372}=await import(_0x91cfd9(0x10b)),_0x489b2e=await _0x316372({'appCode':_0x5ea6d9[_0x91cfd9(0x113)],'scope':listScopeToRemoteScope(_0x523a97),'code':_0x59cbc7[_0x91cfd9(0x10c)]()||undefined}),_0x49473b=shouldListScope(_0x523a97,_0x91cfd9(0x11c))?_0x489b2e['personal']??[]:[],_0x398008=shouldListScope(_0x523a97,_0x91cfd9(0x126))?_0x489b2e[_0x91cfd9(0x126)]??[]:[],_0x588003=[..._0x49473b,..._0x398008];return{'ok':!![],'data':{'appCode':_0x5ea6d9[_0x91cfd9(0x113)],'source':_0x91cfd9(0x124),'scope':_0x523a97,'total':_0x588003['length'],'personal':_0x49473b[_0x91cfd9(0x128)],'company':_0x398008[_0x91cfd9(0x128)],'items':_0x588003['map'](summarizeRuntimeSkill),'skills':{'personal':_0x49473b[_0x91cfd9(0x129)](summarizeRuntimeSkill),'company':_0x398008[_0x91cfd9(0x129)](summarizeRuntimeSkill)}},'message':'Listed\x20'+_0x588003[_0x91cfd9(0x128)]+_0x91cfd9(0x127)};}};function groupLocalRuntimeSkills(_0x237955){const _0x34568c=a46_0x293326;return{'personal':_0x237955[_0x34568c(0x125)](_0xce16b7=>_0xce16b7['scope']===_0x34568c(0x11c)),'company':_0x237955[_0x34568c(0x125)](_0x24758f=>_0x24758f[_0x34568c(0x120)]===_0x34568c(0x126)),'builtin':_0x237955[_0x34568c(0x125)](_0x1710c0=>_0x1710c0[_0x34568c(0x120)]===_0x34568c(0x123))};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x101316=a47_0xbf54;(function(_0x1fdcb5,_0x185621){const _0x4a302a=a47_0xbf54,_0x470efe=_0x1fdcb5();while(!![]){try{const _0x3c8ec0=parseInt(_0x4a302a(0x1ee))/0x1+-parseInt(_0x4a302a(0x1e9))/0x2*(-parseInt(_0x4a302a(0x1f3))/0x3)+-parseInt(_0x4a302a(0x1f2))/0x4*(-parseInt(_0x4a302a(0x1f1))/0x5)+-parseInt(_0x4a302a(0x1ed))/0x6+-parseInt(_0x4a302a(0x1e6))/0x7*(-parseInt(_0x4a302a(0x1f0))/0x8)+parseInt(_0x4a302a(0x1e7))/0x9*(-parseInt(_0x4a302a(0x1e8))/0xa)+parseInt(_0x4a302a(0x1ec))/0xb;if(_0x3c8ec0===_0x185621)break;else _0x470efe['push'](_0x470efe['shift']());}catch(_0x1fae51){_0x470efe['push'](_0x470efe['shift']());}}}(a47_0x306f,0xa89bf));function a47_0xbf54(_0x19da97,_0x442241){_0x19da97=_0x19da97-0x1e6;const _0x306f14=a47_0x306f();let _0xbf54b7=_0x306f14[_0x19da97];return _0xbf54b7;}function a47_0x306f(){const _0x12bf68=['14DgMsyy','1228860uKUNrA','70iOdUFD','2348QpvcIo','将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','push','10017051vMiCEC','4393728JXVXLY','1274lxwVlp','将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','843928taTsTJ','10qvzisv','2044336KPEgwJ','597bnMdDE'];a47_0x306f=function(){return _0x12bf68;};return a47_0x306f();}import{CONFIRM_WARNINGS_FLAG,DIAGRAM_FILE_FLAG,DIR_FLAG,PUSH_SCOPE_FLAG}from'../flags.js';import{skillPushDryRun,skillPushExecute}from'../push-execute.js';export const pushCommand={'service':'skill','command':a47_0x101316(0x1eb),'description':a47_0x101316(0x1ef),'risk':'write','confirmationDescription':a47_0x101316(0x1ea),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x2bc37f=a48_0x31ee;(function(_0x1e30d9,_0x48e0c7){const _0x1489e4=a48_0x31ee,_0x12a673=_0x1e30d9();while(!![]){try{const _0x22ebcf=parseInt(_0x1489e4(0x1ed))/0x1*(-parseInt(_0x1489e4(0x1e6))/0x2)+-parseInt(_0x1489e4(0x1ec))/0x3*(parseInt(_0x1489e4(0x1da))/0x4)+parseInt(_0x1489e4(0x1eb))/0x5+-parseInt(_0x1489e4(0x1df))/0x6*(-parseInt(_0x1489e4(0x1ee))/0x7)+-parseInt(_0x1489e4(0x1db))/0x8*(-parseInt(_0x1489e4(0x1dd))/0x9)+parseInt(_0x1489e4(0x1e9))/0xa*(-parseInt(_0x1489e4(0x1de))/0xb)+-parseInt(_0x1489e4(0x1e0))/0xc*(-parseInt(_0x1489e4(0x1dc))/0xd);if(_0x22ebcf===_0x48e0c7)break;else _0x12a673['push'](_0x12a673['shift']());}catch(_0x21c8d7){_0x12a673['push'](_0x12a673['shift']());}}}(a48_0x4315,0x39056));function a48_0x4315(){const _0x36a80f=['488595kmYsFr','2WcHQet','70acFokY','4tmZdWV','16PCKiqR','4550CsCGEt','911529qZpARg','22gemiPv','7206VvqVfv','18888AOBREl','skill','strict','warnings','Skill\x20validation\x20passed.','errors','32498WrwtZM','read','validate','1803210osBBRV','dir','120455YZwmGa'];a48_0x4315=function(){return _0x36a80f;};return a48_0x4315();}import{DIR_FLAG,STRICT_FLAG}from'../flags.js';import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';function a48_0x31ee(_0x308f30,_0x19a16b){_0x308f30=_0x308f30-0x1da;const _0x43156f=a48_0x4315();let _0x31eec6=_0x43156f[_0x308f30];return _0x31eec6;}export const validateCommand={'service':a48_0x2bc37f(0x1e1),'command':a48_0x2bc37f(0x1e8),'description':'Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','risk':a48_0x2bc37f(0x1e7),'requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x3e508b){const _0x39457f=a48_0x2bc37f,_0x23e3de=_0x3e508b['bool'](_0x39457f(0x1e2)),_0x40f034=validateSkillDirectory(_0x3e508b['str'](_0x39457f(0x1ea)),{'strict':_0x23e3de});return throwIfSkillValidationFailed(_0x40f034,_0x23e3de),{'ok':!![],'data':{'dir':_0x40f034[_0x39457f(0x1ea)],'type':_0x40f034['type'],'errors':_0x40f034[_0x39457f(0x1e5)],'warnings':_0x40f034[_0x39457f(0x1e3)]},'message':_0x39457f(0x1e4)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1e2d9e,_0x2362da){const _0x595621=a49_0x2a8d,_0x330240=_0x1e2d9e();while(!![]){try{const _0x483cce=-parseInt(_0x595621(0x1ae))/0x1+-parseInt(_0x595621(0x1c6))/0x2*(parseInt(_0x595621(0x1b9))/0x3)+-parseInt(_0x595621(0x1b5))/0x4+-parseInt(_0x595621(0x1c5))/0x5+-parseInt(_0x595621(0x1bd))/0x6+parseInt(_0x595621(0x1b3))/0x7*(parseInt(_0x595621(0x1c4))/0x8)+parseInt(_0x595621(0x1af))/0x9*(parseInt(_0x595621(0x1b1))/0xa);if(_0x483cce===_0x2362da)break;else _0x330240['push'](_0x330240['shift']());}catch(_0x4558a2){_0x330240['push'](_0x330240['shift']());}}}(a49_0x3fba,0x6f494));import{existsSync,readFileSync,statSync}from'node:fs';import{resolve}from'node:path';import{JSDOM}from'jsdom';import{CliErrors}from'../../errors.js';let mermaidApiPromise;export async function readRequiredSkillDiagram(_0xeb2f73){const _0x109c39=a49_0x2a8d,_0x2c668c=_0xeb2f73[_0x109c39(0x1b7)]();if(!_0x2c668c)throw CliErrors[_0x109c39(0x1bf)](_0x109c39(0x1b6),'Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.');let _0x9c2976;if(_0x2c668c==='-')try{_0x9c2976=readFileSync(0x0,'utf8');}catch{throw CliErrors[_0x109c39(0x1bf)](_0x109c39(0x1c2));}else{const _0x307cb6=resolve(_0x2c668c);if(!existsSync(_0x307cb6))throw CliErrors[_0x109c39(0x1bf)]('Mermaid\x20flowchart\x20file\x20not\x20found:\x20'+_0x307cb6);if(!statSync(_0x307cb6)[_0x109c39(0x1bc)]())throw CliErrors['validation'](_0x109c39(0x1be)+_0x307cb6);_0x9c2976=readFileSync(_0x307cb6,'utf8');}return{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x9c2976)};}export async function validateAndCanonicalizeMermaid(_0x1f9895){const _0x29bc79=a49_0x2a8d,_0xe6f39d=_0x1f9895[_0x29bc79(0x1b0)](/\r\n/g,'\x0a')[_0x29bc79(0x1b0)](/\r/g,'\x0a')[_0x29bc79(0x1b0)](/\n+$/,'')+'\x0a';try{const _0x5782e2=await loadMermaidApi();await _0x5782e2[_0x29bc79(0x1c0)](_0xe6f39d);}catch{throw diagramValidationError();}return _0xe6f39d;}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x28cd3a=a49_0x2a8d;if(!('window'in globalThis)||!(_0x28cd3a(0x1ba)in globalThis)){const _0x3d65a9=new JSDOM('');Object[_0x28cd3a(0x1c1)](globalThis,{'window':{'configurable':!![],'value':_0x3d65a9[_0x28cd3a(0x1c3)]},'document':{'configurable':!![],'value':_0x3d65a9[_0x28cd3a(0x1c3)][_0x28cd3a(0x1ba)]}});}return(await import(_0x28cd3a(0x1b2)))[_0x28cd3a(0x1b4)];})()),mermaidApiPromise;}function diagramValidationError(){const _0x46b775=a49_0x2a8d;return CliErrors['validation'](_0x46b775(0x1bb),_0x46b775(0x1b8));}function a49_0x2a8d(_0x4d1124,_0x37396e){_0x4d1124=_0x4d1124-0x1ae;const _0x3fba5d=a49_0x3fba();let _0x2a8df7=_0x3fba5d[_0x4d1124];return _0x2a8df7;}function a49_0x3fba(){const _0x37688c=['--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.','trim','Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.','3WztaPr','document','Mermaid\x20syntax\x20validation\x20failed.','isFile','4277928QeDVZG','Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20','validation','parse','defineProperties','Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.','window','208lYYjAO','3961315QHqelC','747306qOUkHn','680951zyBMQI','26487945ejtkUe','replace','10ESdUcf','mermaid','156086vSngef','default','2028680XFfYRE'];a49_0x3fba=function(){return _0x37688c;};return a49_0x3fba();}
|