@lovrabet/lovrabet-cli 2.2.1 → 2.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/runtime-skill-sync/constants.js +1 -1
- package/lib/skills/runtime-skill-sync/fs-utils.js +1 -1
- package/lib/skills/runtime-skill-sync/hashing.js +1 -1
- package/lib/skills/runtime-skill-sync/install-target.js +1 -1
- package/lib/skills/runtime-skill-sync/links.js +1 -1
- package/lib/skills/runtime-skill-sync/list-local.js +1 -1
- package/lib/skills/runtime-skill-sync/local-files.js +1 -1
- package/lib/skills/runtime-skill-sync/materialize.js +1 -1
- package/lib/skills/runtime-skill-sync/metadata.js +1 -1
- package/lib/skills/runtime-skill-sync/paths.js +1 -1
- package/lib/skills/runtime-skill-sync/push.js +1 -1
- package/lib/skills/runtime-skill-sync/scopes.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-codec.js +1 -1
- package/lib/skills/runtime-skill-sync/zip-package.js +1 -1
- package/lib/skills/runtime-skill-sync.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/lossless-json.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +2 -1
- package/skills/lovrabet/SKILL.md +1 -1
- package/skills/lovrabet.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1c9013,_0x41fbe6){const _0x3ff093=a39_0x2a2a,_0x4b0377=_0x1c9013();while(!![]){try{const _0x47ddfe=parseInt(_0x3ff093(0x132))/0x1*(parseInt(_0x3ff093(0x115))/0x2)+-parseInt(_0x3ff093(0x121))/0x3*(-parseInt(_0x3ff093(0x122))/0x4)+parseInt(_0x3ff093(0x120))/0x5*(-parseInt(_0x3ff093(0x16d))/0x6)+parseInt(_0x3ff093(0x114))/0x7*(parseInt(_0x3ff093(0x116))/0x8)+parseInt(_0x3ff093(0x163))/0x9+-parseInt(_0x3ff093(0x129))/0xa*(-parseInt(_0x3ff093(0x149))/0xb)+-parseInt(_0x3ff093(0x152))/0xc;if(_0x47ddfe===_0x41fbe6)break;else _0x4b0377['push'](_0x4b0377['shift']());}catch(_0x534099){_0x4b0377['push'](_0x4b0377['shift']());}}}(a39_0x5d69,0xb6646));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';function a39_0x5d69(){const _0x4175cc=['\x20\x20MAP\x20TO','risk','find','12xhucQk','rawFlags','ctx.','source','employeeId','read','\x20requires\x20target.functionName.','length','loginName','cliPath','\x20completed\x20in\x20','bffCode','entries','startsWith','fullPath','string','required','dbtableConfig','commands','\x20\x20\x20\x20functionName:\x20','bffId','flatMap','filter','102905pycrwU','context.','join','command','scriptName','\x20\x20\x20\x20datasetCode:\x20','normalizedManifest','\x20\x20\x20\x20kind:\x20\x20\x20\x20','enum','7379556ZsydiD','Cannot\x20resolve\x20datatable\x20\x22','datasetCode','flags','json','name','env','SERVICE_TREE','trim','appCode','\x20service\x20detail\x20--service\x20','slice','tree','fromEntries','operator','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','2861298Xqlano','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','\x22\x20in\x20service\x20command\x20','Use\x20`','code','Unsupported\x20service\x20target\x20kind:\x20','kind','appBindings','datatable','\x20\x20SERVICE\x20TREE\x20TARGET','282bgBEfk','params','const','target','\x20\x20\x20\x20','validation','envName','Preview\x20dynamic\x20service\x20command:\x20','Unknown\x20appRef\x20\x22','\x20<command>\x20[flags]','sql','service','Run\x20service\x20command\x20','high-risk-write','args','\x20\x20\x20\x20command:\x20','default','1840706qlUPhZ','91234HsrknO','8njmBSB','map','sqlCode','boolean','remainingArgs','nickName','app','description','type','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','87685JkaOLa','2559XXyawm','48FsFVGy','mapTo','tableName','data','number','push','appcode','1120FzDmYV','userName','Service\x20command\x20','\x20\x20[','now','\x20requires\x20target.datasetCode\x20or\x20target.datatable.'];a39_0x5d69=function(){return _0x4175cc;};return a39_0x5d69();}import{listLocalServices,listLocalServiceTrees}from'../../commands/service/registry.js';import{CLI_BIN_NAME}from'../../constant/cli.js';export function resolveDynamicServiceCommand(_0x6fb0d8,_0x5d97da){const _0x33ac41=a39_0x2a2a,_0x2ed5ad=listLocalServiceTrees();let _0x3cba32;for(const _0x280f16 of _0x2ed5ad){const _0x466e24=matchServiceTreeCommand(_0x280f16,_0x6fb0d8);if(!_0x466e24)continue;(!_0x3cba32||_0x466e24['command']['fullPath'][_0x33ac41(0x139)]>_0x3cba32[_0x33ac41(0x14c)]['fullPath'][_0x33ac41(0x139)])&&(_0x3cba32={'tree':_0x280f16,'command':_0x466e24[_0x33ac41(0x14c)],'remainingArgs':_0x466e24[_0x33ac41(0x11a)]});}if(!_0x3cba32)return undefined;const _0x312c92={..._0x5d97da};return applyAppBinding(_0x3cba32[_0x33ac41(0x15e)],_0x3cba32[_0x33ac41(0x14c)],_0x312c92),{'definition':buildDynamicCommandDefinition(_0x3cba32[_0x33ac41(0x15e)],_0x3cba32[_0x33ac41(0x14c)]),'args':_0x3cba32[_0x33ac41(0x11a)],'flags':_0x312c92,'tree':_0x3cba32[_0x33ac41(0x15e)],'command':_0x3cba32[_0x33ac41(0x14c)]};}export function generateDynamicServiceHelp(_0x440602){const _0x1ad555=a39_0x2a2a,_0x442016=listLocalServiceTrees()[_0x1ad555(0x131)](_0x501fd3=>_0x501fd3[_0x1ad555(0x10e)][_0x1ad555(0x167)]===_0x440602);if(!_0x442016)return undefined;const _0x1e5616=[CLI_BIN_NAME+'\x20'+_0x440602+_0x1ad555(0x10c),'',_0x442016['service']['name']||_0x440602,_0x442016[_0x1ad555(0x10e)]['description']?'\x20\x20'+_0x442016[_0x1ad555(0x10e)][_0x1ad555(0x11d)]:'','','Commands:',..._0x442016[_0x1ad555(0x144)][_0x1ad555(0x117)](_0x42e7f8=>{const _0xd11701=_0x1ad555,_0x1a637d=_0x42e7f8[_0xd11701(0x140)][_0xd11701(0x15d)](0x1)['join']('\x20'),_0x44d965=_0x42e7f8[_0xd11701(0x130)]===_0xd11701(0x137)?'':'\x20['+_0x42e7f8[_0xd11701(0x130)]+']';return'\x20\x20'+_0x1a637d['padEnd'](0x18)+'\x20'+(_0x42e7f8[_0xd11701(0x11d)]||'')+_0x44d965;}),'',_0x1ad555(0x166)+CLI_BIN_NAME+_0x1ad555(0x15c)+_0x440602+'`\x20to\x20inspect\x20the\x20manifest.'][_0x1ad555(0x148)](Boolean);return _0x1e5616[_0x1ad555(0x14b)]('\x0a');}export function listDynamicServiceEntries(){const _0x33110f=a39_0x2a2a;return listLocalServices()[_0x33110f(0x117)](_0x41ed0a=>{const _0x373107=_0x33110f,_0x1e3eec=_0x41ed0a[_0x373107(0x14f)];return{'service':_0x1e3eec['service'][_0x373107(0x167)],'label':_0x1e3eec[_0x373107(0x10e)]['name']||_0x1e3eec[_0x373107(0x10e)][_0x373107(0x167)],'commands':_0x1e3eec[_0x373107(0x144)][_0x373107(0x117)](_0x564abf=>({'command':dynamicCommandName(_0x564abf),'description':_0x564abf[_0x373107(0x11d)]||'Run\x20service\x20command\x20'+_0x564abf[_0x373107(0x13b)],'tag':riskTag(_0x564abf[_0x373107(0x130)])}))};});}export function getDynamicServiceEntry(_0x26b649){const _0x16d3e5=a39_0x2a2a;return listDynamicServiceEntries()['find'](_0x21dc1b=>_0x21dc1b[_0x16d3e5(0x10e)]===_0x26b649);}export function listDynamicServiceDefinitions(_0x22503e){const _0x341910=a39_0x2a2a;return listLocalServiceTrees()[_0x341910(0x148)](_0x517b9f=>!_0x22503e||_0x517b9f['service'][_0x341910(0x167)]===_0x22503e)[_0x341910(0x147)](_0x2020b5=>_0x2020b5[_0x341910(0x144)]['map'](_0x1e01bf=>buildDynamicCommandDefinition(_0x2020b5,_0x1e01bf)));}export function getDynamicServiceDefinitions(_0x259ace){const _0x45f6c7=a39_0x2a2a,_0x1622bc=listDynamicServiceDefinitions(_0x259ace);return _0x1622bc[_0x45f6c7(0x139)]>0x0?_0x1622bc:undefined;}export function findDynamicServiceDefinition(_0x11ab3a,_0x276ae4){return listDynamicServiceDefinitions(_0x11ab3a)['find'](_0x2614ac=>_0x2614ac['command']===_0x276ae4);}export function buildDynamicCommandDefinition(_0x68cf76,_0x492c7c){const _0x158d9e=a39_0x2a2a;return{'service':_0x68cf76[_0x158d9e(0x10e)][_0x158d9e(0x167)],'command':dynamicCommandName(_0x492c7c),'description':_0x492c7c['description']||_0x158d9e(0x10f)+_0x492c7c[_0x158d9e(0x13b)],'risk':_0x492c7c[_0x158d9e(0x130)],..._0x492c7c[_0x158d9e(0x130)]===_0x158d9e(0x137)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x492c7c)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x492c7c[_0x158d9e(0x111)][_0x158d9e(0x117)](_0x83103=>({'name':_0x83103['name'],'description':_0x83103['description']||_0x83103[_0x158d9e(0x157)],'required':_0x83103[_0x158d9e(0x142)]})),'flags':_0x492c7c[_0x158d9e(0x155)][_0x158d9e(0x117)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x492c7c),async 'dryRun'(_0x244e93){const _0x59fbfe=_0x158d9e,_0x39b8f9=await compilePlan(_0x492c7c,_0x244e93);return{'method':_0x59fbfe(0x159),'url':_0x492c7c[_0x59fbfe(0x13b)],'body':{'target':targetPreview(_0x39b8f9),'params':_0x39b8f9[_0x59fbfe(0x104)]},'description':_0x59fbfe(0x10a)+_0x492c7c[_0x59fbfe(0x13b)]};},async 'execute'(_0x1825ee){const _0x83a7e1=_0x158d9e,_0x34a687=await compilePlan(_0x492c7c,_0x1825ee),_0x4bb982=Date[_0x83a7e1(0x12d)](),_0x3b8870=await executePlan(_0x34a687,_0x492c7c,_0x1825ee),_0x35b305=Date['now']()-_0x4bb982;return{'ok':!![],'data':{'service':_0x68cf76['service'],'command':_0x492c7c[_0x83a7e1(0x13b)],'target':targetPreview(_0x34a687),'result':_0x3b8870,'elapsed':_0x35b305},'message':'Service\x20command\x20'+_0x492c7c['cliPath']+_0x83a7e1(0x13c)+_0x35b305+'ms'};}};}function a39_0x2a2a(_0x4a8b59,_0x555ac0){_0x4a8b59=_0x4a8b59-0x104;const _0x5d696b=a39_0x5d69();let _0x2a2a80=_0x5d696b[_0x4a8b59];return _0x2a2a80;}function buildDynamicConfirmationDescription(_0x3a6562){const _0x43735e=a39_0x2a2a,_0x450e6c=_0x3a6562['description']||_0x3a6562['cliPath'],_0x39ab23=_0x3a6562[_0x43735e(0x130)]===_0x43735e(0x110)?_0x43735e(0x162):'该命令被清单标记为写入,可能修改业务数据或服务状态。';return'将通过\x20Service\x20Tree\x20执行“'+_0x450e6c+'”。'+_0x39ab23;}function dynamicCommandName(_0x3b6e2d){const _0x3f8c02=a39_0x2a2a;return _0x3b6e2d['fullPath'][_0x3f8c02(0x15d)](0x1)['join']('\x20');}function riskTag(_0x39df72){const _0x43ff0d=a39_0x2a2a;return _0x39df72===_0x43ff0d(0x137)?'':_0x43ff0d(0x12c)+_0x39df72+']';}function flagToCommandFlag(_0xbd97ea){const _0x50ea14=a39_0x2a2a;return{'name':_0xbd97ea['cliName'],'type':_0xbd97ea['type']===_0x50ea14(0x156)?'string':_0xbd97ea[_0x50ea14(0x11e)],'description':_0xbd97ea['description']||_0xbd97ea['name'],'required':_0xbd97ea['required'],'default':isPrimitiveFlagDefault(_0xbd97ea[_0x50ea14(0x113)])?_0xbd97ea[_0x50ea14(0x113)]:undefined,'enum':_0xbd97ea[_0x50ea14(0x151)]};}async function compilePlan(_0x1de236,_0x57f120){const _0x1b4d01=a39_0x2a2a;return compileServiceTreeCommand(_0x1de236,{'flags':_0x57f120[_0x1b4d01(0x133)],'args':_0x57f120['args'],'context':await buildServiceContext(_0x1de236,_0x57f120)});}async function buildServiceContext(_0x144d5b,_0x3c3901){const _0x4565a3=a39_0x2a2a,_0x1afddf={'appCode':_0x3c3901[_0x4565a3(0x15b)],'env':_0x3c3901[_0x4565a3(0x109)],'envName':_0x3c3901[_0x4565a3(0x109)]};if(!usesRuntimeContext(_0x144d5b))return _0x1afddf;const _0x3771f9=await getLoginUserInfo(),_0x4de957=pickFirst(_0x3771f9['userId'],_0x3771f9['id']);return{..._0x1afddf,'user':_0x3771f9,'userId':_0x4de957,'id':_0x3771f9['id'],'username':pickFirst(_0x3771f9['username'],_0x3771f9[_0x4565a3(0x12a)],_0x3771f9[_0x4565a3(0x13a)]),'userName':_0x3771f9[_0x4565a3(0x12a)],'nickname':pickFirst(_0x3771f9['nickname'],_0x3771f9[_0x4565a3(0x11b)]),'nickName':_0x3771f9[_0x4565a3(0x11b)],'tenantCode':_0x3771f9['tenantCode'],'employeeId':_0x3771f9[_0x4565a3(0x136)]};}function usesRuntimeContext(_0x178a5d){const _0x4ec600=a39_0x2a2a;return _0x178a5d[_0x4ec600(0x123)]['some'](_0x3dbadd=>typeof _0x3dbadd[_0x4ec600(0x135)]==='string'&&(_0x3dbadd[_0x4ec600(0x135)][_0x4ec600(0x13f)](_0x4ec600(0x14a))||_0x3dbadd[_0x4ec600(0x135)][_0x4ec600(0x13f)](_0x4ec600(0x134))));}function pickFirst(..._0x3446c7){const _0x4def41=a39_0x2a2a;return _0x3446c7[_0x4def41(0x131)](_0x52fc70=>_0x52fc70!==undefined&&_0x52fc70!==null);}async function executePlan(_0x262a55,_0xf66fb5,_0x2e2810){const _0x2b3f86=a39_0x2a2a;if(_0x262a55[_0x2b3f86(0x169)]===_0x2b3f86(0x125)){const _0x44cf1b=await resolveDatasetCode(_0x262a55,_0xf66fb5,_0x2e2810);return executeData(_0x44cf1b,_0x262a55[_0x2b3f86(0x14c)],_0x262a55['params']);}if(_0x262a55[_0x2b3f86(0x169)]===_0x2b3f86(0x10d)){if(!_0x262a55[_0x2b3f86(0x118)])throw CliErrors['validation'](_0x2b3f86(0x12b)+_0xf66fb5[_0x2b3f86(0x13b)]+'\x20requires\x20target.sqlCode.');return executeSdkSql(_0x262a55[_0x2b3f86(0x118)],normalizeScalarParams(_0x262a55[_0x2b3f86(0x104)]));}if(_0x262a55[_0x2b3f86(0x169)]==='bff'){const _0x15df31=_0x262a55[_0x2b3f86(0x14d)]||_0x262a55[_0x2b3f86(0x13d)]||(_0x262a55['bffId']==null?'':String(_0x262a55[_0x2b3f86(0x146)]));if(!_0x15df31)throw CliErrors[_0x2b3f86(0x108)]('Service\x20command\x20'+_0xf66fb5['cliPath']+_0x2b3f86(0x138));return executeSdkBff(_0x15df31,_0x262a55[_0x2b3f86(0x104)]);}throw CliErrors['validation'](_0x2b3f86(0x168)+_0x262a55[_0x2b3f86(0x169)]);}async function resolveDatasetCode(_0x2bd571,_0x2ab5c6,_0x42d334){const _0x1eb22c=a39_0x2a2a;if(_0x2bd571[_0x1eb22c(0x154)])return _0x2bd571[_0x1eb22c(0x154)];if(!_0x2bd571[_0x1eb22c(0x16b)])throw CliErrors[_0x1eb22c(0x108)]('Service\x20command\x20'+_0x2ab5c6[_0x1eb22c(0x13b)]+_0x1eb22c(0x12e));const _0x4f1b5a=await listDatasets(_0x42d334[_0x1eb22c(0x15b)]),_0x5c0437=_0x4f1b5a[_0x1eb22c(0x131)](_0x56130c=>_0x56130c[_0x1eb22c(0x143)]?.[_0x1eb22c(0x124)]===_0x2bd571[_0x1eb22c(0x16b)]);if(!_0x5c0437?.[_0x1eb22c(0x167)])throw CliErrors['validation'](_0x1eb22c(0x153)+_0x2bd571[_0x1eb22c(0x16b)]+_0x1eb22c(0x161)+_0x42d334[_0x1eb22c(0x15b)]+'.',_0x1eb22c(0x164));return _0x5c0437['code'];}function applyAppBinding(_0xc7103b,_0x11ac93,_0x4146bd){const _0x2fd387=a39_0x2a2a,_0x3962a4=_0x11ac93[_0x2fd387(0x106)]['appRef'];if(!_0x3962a4)return;const _0x5a778b=_0xc7103b[_0x2fd387(0x16a)][_0x3962a4];if(!_0x5a778b)throw CliErrors[_0x2fd387(0x108)](_0x2fd387(0x10b)+_0x3962a4+_0x2fd387(0x165)+_0x11ac93[_0x2fd387(0x13b)]+'.',_0x2fd387(0x11f));const _0x4e7372=_0x5a778b['appcode']||_0x5a778b[_0x2fd387(0x15b)];_0x4e7372&&!hasText(_0x4146bd[_0x2fd387(0x128)])&&(_0x4146bd['appcode']=_0x4e7372),_0x5a778b[_0x2fd387(0x11c)]&&!hasText(_0x4146bd['app'])&&!hasText(_0x4146bd[_0x2fd387(0x128)])&&(_0x4146bd['app']=_0x5a778b[_0x2fd387(0x11c)]),_0x5a778b['env']&&!hasText(_0x4146bd['env'])&&(_0x4146bd[_0x2fd387(0x158)]=_0x5a778b[_0x2fd387(0x158)]);}function renderDynamicCommandHelp(_0x209c0d){const _0x4155e3=a39_0x2a2a,_0xb1e0c9=[_0x4155e3(0x16c),_0x4155e3(0x150)+_0x209c0d[_0x4155e3(0x106)][_0x4155e3(0x169)],_0x4155e3(0x112)+_0x209c0d[_0x4155e3(0x106)]['command']];if(_0x209c0d[_0x4155e3(0x106)][_0x4155e3(0x154)])_0xb1e0c9[_0x4155e3(0x127)](_0x4155e3(0x14e)+_0x209c0d[_0x4155e3(0x106)][_0x4155e3(0x154)]);if(_0x209c0d['target'][_0x4155e3(0x16b)])_0xb1e0c9[_0x4155e3(0x127)]('\x20\x20\x20\x20datatable:\x20'+_0x209c0d[_0x4155e3(0x106)][_0x4155e3(0x16b)]);if(_0x209c0d[_0x4155e3(0x106)]['sqlCode'])_0xb1e0c9[_0x4155e3(0x127)]('\x20\x20\x20\x20sqlCode:\x20'+_0x209c0d[_0x4155e3(0x106)][_0x4155e3(0x118)]);if(_0x209c0d[_0x4155e3(0x106)][_0x4155e3(0x14d)])_0xb1e0c9[_0x4155e3(0x127)](_0x4155e3(0x145)+_0x209c0d[_0x4155e3(0x106)][_0x4155e3(0x14d)]);if(_0x209c0d[_0x4155e3(0x123)]['length']>0x0){_0xb1e0c9['push']('',_0x4155e3(0x12f));for(const _0x303618 of _0x209c0d[_0x4155e3(0x123)]){_0xb1e0c9['push'](_0x4155e3(0x107)+(_0x303618[_0x4155e3(0x135)]||_0x4155e3(0x105))+'\x20->\x20'+_0x303618[_0x4155e3(0x106)]+(_0x303618[_0x4155e3(0x160)]?'.'+_0x303618[_0x4155e3(0x160)]:''));}}return _0xb1e0c9['join']('\x0a');}function targetPreview(_0x16c27f){const _0x3a5a80=a39_0x2a2a;return{'kind':_0x16c27f[_0x3a5a80(0x169)],'command':_0x16c27f[_0x3a5a80(0x14c)],'appRef':_0x16c27f['appRef'],'datasetCode':_0x16c27f[_0x3a5a80(0x154)],'datatable':_0x16c27f[_0x3a5a80(0x16b)],'sqlCode':_0x16c27f[_0x3a5a80(0x118)],'bffCode':_0x16c27f[_0x3a5a80(0x13d)],'bffId':_0x16c27f[_0x3a5a80(0x146)],'functionName':_0x16c27f[_0x3a5a80(0x14d)]};}function normalizeScalarParams(_0x249988){const _0x1c25ea=a39_0x2a2a;return Object[_0x1c25ea(0x15f)](Object[_0x1c25ea(0x13e)](_0x249988)[_0x1c25ea(0x148)](([,_0x27bbc8])=>typeof _0x27bbc8===_0x1c25ea(0x141)||typeof _0x27bbc8===_0x1c25ea(0x126)));}function hasText(_0x41d165){const _0x46ea1c=a39_0x2a2a;return typeof _0x41d165==='string'&&_0x41d165[_0x46ea1c(0x15a)]()['length']>0x0;}function isPrimitiveFlagDefault(_0x4c6583){const _0x9f7d32=a39_0x2a2a;return _0x4c6583===undefined||typeof _0x4c6583===_0x9f7d32(0x141)||typeof _0x4c6583===_0x9f7d32(0x126)||typeof _0x4c6583===_0x9f7d32(0x119);}
|
|
1
|
+
(function(_0x362f9c,_0x372e4a){const _0x55124f=a39_0x283c,_0x27f1c7=_0x362f9c();while(!![]){try{const _0xaeccc9=-parseInt(_0x55124f(0xcf))/0x1+parseInt(_0x55124f(0xe3))/0x2+parseInt(_0x55124f(0xdc))/0x3*(-parseInt(_0x55124f(0x10b))/0x4)+-parseInt(_0x55124f(0x125))/0x5+-parseInt(_0x55124f(0x110))/0x6+parseInt(_0x55124f(0x11f))/0x7*(parseInt(_0x55124f(0xf4))/0x8)+-parseInt(_0x55124f(0xdf))/0x9*(-parseInt(_0x55124f(0x107))/0xa);if(_0xaeccc9===_0x372e4a)break;else _0x27f1c7['push'](_0x27f1c7['shift']());}catch(_0x5998eb){_0x27f1c7['push'](_0x27f1c7['shift']());}}}(a39_0xf9b2,0xef35e));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(_0x11d743,_0x17e56d){const _0x101b29=a39_0x283c,_0x3ec457=listLocalServiceTrees();let _0x302dc6;for(const _0x6d8c30 of _0x3ec457){const _0x4add3a=matchServiceTreeCommand(_0x6d8c30,_0x11d743);if(!_0x4add3a)continue;(!_0x302dc6||_0x4add3a[_0x101b29(0xf9)][_0x101b29(0x108)][_0x101b29(0xdd)]>_0x302dc6[_0x101b29(0xf9)][_0x101b29(0x108)][_0x101b29(0xdd)])&&(_0x302dc6={'tree':_0x6d8c30,'command':_0x4add3a[_0x101b29(0xf9)],'remainingArgs':_0x4add3a[_0x101b29(0xca)]});}if(!_0x302dc6)return undefined;const _0x4baee6={..._0x17e56d};return applyAppBinding(_0x302dc6['tree'],_0x302dc6[_0x101b29(0xf9)],_0x4baee6),{'definition':buildDynamicCommandDefinition(_0x302dc6[_0x101b29(0x10a)],_0x302dc6[_0x101b29(0xf9)]),'args':_0x302dc6['remainingArgs'],'flags':_0x4baee6,'tree':_0x302dc6['tree'],'command':_0x302dc6[_0x101b29(0xf9)]};}export function generateDynamicServiceHelp(_0x2bc1f9){const _0x334d2a=a39_0x283c,_0x4b7d07=listLocalServiceTrees()['find'](_0x511814=>_0x511814[_0x334d2a(0xce)]['code']===_0x2bc1f9);if(!_0x4b7d07)return undefined;const _0x1fa315=[CLI_BIN_NAME+'\x20'+_0x2bc1f9+_0x334d2a(0x12a),'',_0x4b7d07['service'][_0x334d2a(0xd2)]||_0x2bc1f9,_0x4b7d07[_0x334d2a(0xce)][_0x334d2a(0xc8)]?'\x20\x20'+_0x4b7d07[_0x334d2a(0xce)][_0x334d2a(0xc8)]:'','',_0x334d2a(0x113),..._0x4b7d07['commands'][_0x334d2a(0x119)](_0x253ffe=>{const _0x5d3578=_0x334d2a,_0x5d0278=_0x253ffe[_0x5d3578(0x108)][_0x5d3578(0x111)](0x1)[_0x5d3578(0xd0)]('\x20'),_0x1cb605=_0x253ffe[_0x5d3578(0xda)]===_0x5d3578(0xe6)?'':'\x20['+_0x253ffe[_0x5d3578(0xda)]+']';return'\x20\x20'+_0x5d0278[_0x5d3578(0xe1)](0x18)+'\x20'+(_0x253ffe['description']||'')+_0x1cb605;}),'',_0x334d2a(0xfe)+CLI_BIN_NAME+_0x334d2a(0x12e)+_0x2bc1f9+_0x334d2a(0xeb)][_0x334d2a(0xf3)](Boolean);return _0x1fa315[_0x334d2a(0xd0)]('\x0a');}export function listDynamicServiceEntries(){const _0x54fb25=a39_0x283c;return listLocalServices()[_0x54fb25(0x119)](_0x2c4598=>{const _0x2fc8f2=_0x54fb25,_0xa5d6f2=_0x2c4598[_0x2fc8f2(0x105)];return{'service':_0xa5d6f2['service'][_0x2fc8f2(0x116)],'label':_0xa5d6f2['service'][_0x2fc8f2(0xd2)]||_0xa5d6f2['service'][_0x2fc8f2(0x116)],'commands':_0xa5d6f2['commands'][_0x2fc8f2(0x119)](_0x5cd6c6=>({'command':dynamicCommandName(_0x5cd6c6),'description':_0x5cd6c6[_0x2fc8f2(0xc8)]||_0x2fc8f2(0xed)+_0x5cd6c6['cliPath'],'tag':riskTag(_0x5cd6c6['risk'])}))};});}export function getDynamicServiceEntry(_0xf32d84){const _0x348c3b=a39_0x283c;return listDynamicServiceEntries()['find'](_0x4928ee=>_0x4928ee[_0x348c3b(0xce)]===_0xf32d84);}function a39_0xf9b2(){const _0x2bf687=['operator','data','userName','tenantCode','\x20->\x20','filter','64MqFjRB','\x22\x20in\x20service\x20command\x20','required','appRef','Preview\x20dynamic\x20service\x20command:\x20','command','\x20\x20\x20\x20','\x20\x20\x20\x20command:\x20','cliPath','kind','Use\x20`','sqlCode','username','number','\x20\x20[','rawFlags','now','normalizedManifest','Unknown\x20appRef\x20\x22','3130uMlDtm','fullPath','employeeId','tree','20044lhFIGj','datasetCode','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','string','boolean','1965534fjHFdp','slice','push','Commands:','bffId','\x20\x20\x20\x20functionName:\x20','code','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','\x20requires\x20target.sqlCode.','map','flatMap','nickname','dbtableConfig','\x20\x20SERVICE\x20TREE\x20TARGET','app','565075yPnZNG','envName','datatable','\x20requires\x20target.datasetCode\x20or\x20target.datatable.','bff','\x20\x20\x20\x20datatable:\x20','9434490zwHgaI','\x20completed\x20in\x20','Unsupported\x20service\x20target\x20kind:\x20','SERVICE_TREE','type','\x20<command>\x20[flags]','\x20\x20MAP\x20TO','appcode','const','\x20service\x20detail\x20--service\x20','startsWith','appBindings','default','description','appCode','remainingArgs','nickName','params','mapTo','service','1953587UkKgUw','join','high-risk-write','name','args','Service\x20command\x20','cliName','target','tableName','sql','\x20\x20\x20\x20kind:\x20\x20\x20\x20','risk','source','171dvALpG','length','将通过\x20Service\x20Tree\x20执行“','122553zjkXro','validation','padEnd','bffCode','1051172FcDGbF','commands','\x20\x20\x20\x20sqlCode:\x20','read','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','env','scriptName','userId','`\x20to\x20inspect\x20the\x20manifest.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.','Run\x20service\x20command\x20'];a39_0xf9b2=function(){return _0x2bf687;};return a39_0xf9b2();}export function listDynamicServiceDefinitions(_0x21d1ad){const _0x135141=a39_0x283c;return listLocalServiceTrees()['filter'](_0x173bd7=>!_0x21d1ad||_0x173bd7['service'][_0x135141(0x116)]===_0x21d1ad)[_0x135141(0x11a)](_0x23d26d=>_0x23d26d[_0x135141(0xe4)][_0x135141(0x119)](_0x20fc73=>buildDynamicCommandDefinition(_0x23d26d,_0x20fc73)));}export function getDynamicServiceDefinitions(_0x5c0849){const _0x325092=a39_0x283c,_0x291faa=listDynamicServiceDefinitions(_0x5c0849);return _0x291faa[_0x325092(0xdd)]>0x0?_0x291faa:undefined;}export function findDynamicServiceDefinition(_0x35d253,_0x52672b){return listDynamicServiceDefinitions(_0x35d253)['find'](_0x2304a4=>_0x2304a4['command']===_0x52672b);}export function buildDynamicCommandDefinition(_0x53dc31,_0x3aa060){const _0x5162db=a39_0x283c;return{'service':_0x53dc31[_0x5162db(0xce)][_0x5162db(0x116)],'command':dynamicCommandName(_0x3aa060),'description':_0x3aa060[_0x5162db(0xc8)]||'Run\x20service\x20command\x20'+_0x3aa060['cliPath'],'risk':_0x3aa060[_0x5162db(0xda)],..._0x3aa060['risk']===_0x5162db(0xe6)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x3aa060)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x3aa060[_0x5162db(0xd3)][_0x5162db(0x119)](_0x4941c1=>({'name':_0x4941c1[_0x5162db(0xd2)],'description':_0x4941c1['description']||_0x4941c1['name'],'required':_0x4941c1[_0x5162db(0xf6)]})),'flags':_0x3aa060['flags'][_0x5162db(0x119)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x3aa060),async 'dryRun'(_0x4987c4){const _0x3e9268=_0x5162db,_0x1f2e75=await compilePlan(_0x3aa060,_0x4987c4);return{'method':_0x3e9268(0x128),'url':_0x3aa060[_0x3e9268(0xfc)],'body':{'target':targetPreview(_0x1f2e75),'params':_0x1f2e75[_0x3e9268(0xcc)]},'description':_0x3e9268(0xf8)+_0x3aa060['cliPath']};},async 'execute'(_0x427086){const _0x5dbc58=_0x5162db,_0x21ac0f=await compilePlan(_0x3aa060,_0x427086),_0x42823e=Date[_0x5dbc58(0x104)](),_0x4414ca=await executePlan(_0x21ac0f,_0x3aa060,_0x427086),_0x5bc712=Date[_0x5dbc58(0x104)]()-_0x42823e;return{'ok':!![],'data':{'service':_0x53dc31[_0x5dbc58(0xce)],'command':_0x3aa060[_0x5dbc58(0xfc)],'target':targetPreview(_0x21ac0f),'result':_0x4414ca,'elapsed':_0x5bc712},'message':_0x5dbc58(0xd4)+_0x3aa060[_0x5dbc58(0xfc)]+_0x5dbc58(0x126)+_0x5bc712+'ms'};}};}function buildDynamicConfirmationDescription(_0x229ef6){const _0x4c1fd2=a39_0x283c,_0x5b6734=_0x229ef6[_0x4c1fd2(0xc8)]||_0x229ef6[_0x4c1fd2(0xfc)],_0x3460de=_0x229ef6['risk']===_0x4c1fd2(0xd1)?_0x4c1fd2(0xe7):'该命令被清单标记为写入,可能修改业务数据或服务状态。';return _0x4c1fd2(0xde)+_0x5b6734+'”。'+_0x3460de;}function dynamicCommandName(_0x5b088b){const _0x3b44f6=a39_0x283c;return _0x5b088b['fullPath']['slice'](0x1)[_0x3b44f6(0xd0)]('\x20');}function riskTag(_0x134f8){const _0x4d66ee=a39_0x283c;return _0x134f8===_0x4d66ee(0xe6)?'':_0x4d66ee(0x102)+_0x134f8+']';}function a39_0x283c(_0x44ffc4,_0xc69245){_0x44ffc4=_0x44ffc4-0xc8;const _0xf9b2ae=a39_0xf9b2();let _0x283cd7=_0xf9b2ae[_0x44ffc4];return _0x283cd7;}function flagToCommandFlag(_0x573020){const _0x496906=a39_0x283c;return{'name':_0x573020[_0x496906(0xd5)],'type':_0x573020[_0x496906(0x129)]==='json'?_0x496906(0x10e):_0x573020[_0x496906(0x129)],'description':_0x573020[_0x496906(0xc8)]||_0x573020[_0x496906(0xd2)],'required':_0x573020[_0x496906(0xf6)],'default':isPrimitiveFlagDefault(_0x573020['default'])?_0x573020[_0x496906(0x131)]:undefined,'enum':_0x573020['enum']};}async function compilePlan(_0x4751f8,_0x42848f){const _0x52c64c=a39_0x283c;return compileServiceTreeCommand(_0x4751f8,{'flags':_0x42848f[_0x52c64c(0x103)],'args':_0x42848f[_0x52c64c(0xd3)],'context':await buildServiceContext(_0x4751f8,_0x42848f)});}async function buildServiceContext(_0x41e41b,_0xda11c2){const _0x153fe6=a39_0x283c,_0xcd27ae={'appCode':_0xda11c2[_0x153fe6(0xc9)],'env':_0xda11c2['envName'],'envName':_0xda11c2[_0x153fe6(0x120)]};if(!usesRuntimeContext(_0x41e41b))return _0xcd27ae;const _0x58756d=await getLoginUserInfo(),_0x38507c=pickFirst(_0x58756d[_0x153fe6(0xea)],_0x58756d['id']);return{..._0xcd27ae,'user':_0x58756d,'userId':_0x38507c,'id':_0x58756d['id'],'username':pickFirst(_0x58756d[_0x153fe6(0x100)],_0x58756d[_0x153fe6(0xf0)],_0x58756d['loginName']),'userName':_0x58756d['userName'],'nickname':pickFirst(_0x58756d[_0x153fe6(0x11b)],_0x58756d[_0x153fe6(0xcb)]),'nickName':_0x58756d[_0x153fe6(0xcb)],'tenantCode':_0x58756d[_0x153fe6(0xf1)],'employeeId':_0x58756d[_0x153fe6(0x109)]};}function usesRuntimeContext(_0x5b0d9f){const _0x4aa7f0=a39_0x283c;return _0x5b0d9f[_0x4aa7f0(0xcd)]['some'](_0x345ad1=>typeof _0x345ad1[_0x4aa7f0(0xdb)]===_0x4aa7f0(0x10e)&&(_0x345ad1[_0x4aa7f0(0xdb)][_0x4aa7f0(0x12f)]('context.')||_0x345ad1['source'][_0x4aa7f0(0x12f)]('ctx.')));}function pickFirst(..._0x449ea2){return _0x449ea2['find'](_0x2b4e6d=>_0x2b4e6d!==undefined&&_0x2b4e6d!==null);}async function executePlan(_0xd83157,_0x129fc2,_0x44c6ed){const _0x37448d=a39_0x283c;if(_0xd83157['kind']===_0x37448d(0xef)){const _0x32bb78=await resolveDatasetCode(_0xd83157,_0x129fc2,_0x44c6ed);return executeData(_0x32bb78,_0xd83157[_0x37448d(0xf9)],_0xd83157[_0x37448d(0xcc)]);}if(_0xd83157[_0x37448d(0xfd)]===_0x37448d(0xd8)){if(!_0xd83157['sqlCode'])throw CliErrors['validation'](_0x37448d(0xd4)+_0x129fc2[_0x37448d(0xfc)]+_0x37448d(0x118));return executeSdkSql(_0xd83157['sqlCode'],normalizeScalarParams(_0xd83157[_0x37448d(0xcc)]));}if(_0xd83157[_0x37448d(0xfd)]===_0x37448d(0x123)){const _0x59dc44=_0xd83157['scriptName']||_0xd83157[_0x37448d(0xe2)]||(_0xd83157[_0x37448d(0x114)]==null?'':String(_0xd83157[_0x37448d(0x114)]));if(!_0x59dc44)throw CliErrors[_0x37448d(0xe0)](_0x37448d(0xd4)+_0x129fc2[_0x37448d(0xfc)]+'\x20requires\x20target.functionName.');return executeSdkBff(_0x59dc44,_0xd83157[_0x37448d(0xcc)]);}throw CliErrors['validation'](_0x37448d(0x127)+_0xd83157[_0x37448d(0xfd)]);}async function resolveDatasetCode(_0x55c0c3,_0x25c5d4,_0x5799e4){const _0x258041=a39_0x283c;if(_0x55c0c3['datasetCode'])return _0x55c0c3[_0x258041(0x10c)];if(!_0x55c0c3[_0x258041(0x121)])throw CliErrors[_0x258041(0xe0)](_0x258041(0xd4)+_0x25c5d4[_0x258041(0xfc)]+_0x258041(0x122));const _0x58c4dc=await listDatasets(_0x5799e4[_0x258041(0xc9)]),_0xa099b5=_0x58c4dc['find'](_0x12ed22=>_0x12ed22[_0x258041(0x11c)]?.[_0x258041(0xd7)]===_0x55c0c3[_0x258041(0x121)]);if(!_0xa099b5?.[_0x258041(0x116)])throw CliErrors[_0x258041(0xe0)]('Cannot\x20resolve\x20datatable\x20\x22'+_0x55c0c3[_0x258041(0x121)]+_0x258041(0x117)+_0x5799e4[_0x258041(0xc9)]+'.',_0x258041(0xec));return _0xa099b5[_0x258041(0x116)];}function applyAppBinding(_0x2f9e3c,_0x2bf10d,_0x33a570){const _0x53a251=a39_0x283c,_0x4756e1=_0x2bf10d[_0x53a251(0xd6)]['appRef'];if(!_0x4756e1)return;const _0x33c7b2=_0x2f9e3c[_0x53a251(0x130)][_0x4756e1];if(!_0x33c7b2)throw CliErrors['validation'](_0x53a251(0x106)+_0x4756e1+_0x53a251(0xf5)+_0x2bf10d['cliPath']+'.',_0x53a251(0x10d));const _0x2841ce=_0x33c7b2[_0x53a251(0x12c)]||_0x33c7b2['appCode'];_0x2841ce&&!hasText(_0x33a570['appcode'])&&(_0x33a570[_0x53a251(0x12c)]=_0x2841ce),_0x33c7b2[_0x53a251(0x11e)]&&!hasText(_0x33a570[_0x53a251(0x11e)])&&!hasText(_0x33a570[_0x53a251(0x12c)])&&(_0x33a570[_0x53a251(0x11e)]=_0x33c7b2[_0x53a251(0x11e)]),_0x33c7b2[_0x53a251(0xe8)]&&!hasText(_0x33a570[_0x53a251(0xe8)])&&(_0x33a570[_0x53a251(0xe8)]=_0x33c7b2['env']);}function renderDynamicCommandHelp(_0x558126){const _0x33a26e=a39_0x283c,_0x140533=[_0x33a26e(0x11d),_0x33a26e(0xd9)+_0x558126[_0x33a26e(0xd6)][_0x33a26e(0xfd)],_0x33a26e(0xfb)+_0x558126[_0x33a26e(0xd6)][_0x33a26e(0xf9)]];if(_0x558126[_0x33a26e(0xd6)][_0x33a26e(0x10c)])_0x140533[_0x33a26e(0x112)]('\x20\x20\x20\x20datasetCode:\x20'+_0x558126[_0x33a26e(0xd6)][_0x33a26e(0x10c)]);if(_0x558126[_0x33a26e(0xd6)]['datatable'])_0x140533[_0x33a26e(0x112)](_0x33a26e(0x124)+_0x558126[_0x33a26e(0xd6)][_0x33a26e(0x121)]);if(_0x558126[_0x33a26e(0xd6)][_0x33a26e(0xff)])_0x140533[_0x33a26e(0x112)](_0x33a26e(0xe5)+_0x558126[_0x33a26e(0xd6)][_0x33a26e(0xff)]);if(_0x558126[_0x33a26e(0xd6)]['scriptName'])_0x140533[_0x33a26e(0x112)](_0x33a26e(0x115)+_0x558126[_0x33a26e(0xd6)][_0x33a26e(0xe9)]);if(_0x558126[_0x33a26e(0xcd)]['length']>0x0){_0x140533[_0x33a26e(0x112)]('',_0x33a26e(0x12b));for(const _0x2f01bf of _0x558126[_0x33a26e(0xcd)]){_0x140533[_0x33a26e(0x112)](_0x33a26e(0xfa)+(_0x2f01bf[_0x33a26e(0xdb)]||_0x33a26e(0x12d))+_0x33a26e(0xf2)+_0x2f01bf[_0x33a26e(0xd6)]+(_0x2f01bf[_0x33a26e(0xee)]?'.'+_0x2f01bf[_0x33a26e(0xee)]:''));}}return _0x140533['join']('\x0a');}function targetPreview(_0x26396b){const _0x2338f6=a39_0x283c;return{'kind':_0x26396b['kind'],'command':_0x26396b['command'],'appRef':_0x26396b[_0x2338f6(0xf7)],'datasetCode':_0x26396b[_0x2338f6(0x10c)],'datatable':_0x26396b[_0x2338f6(0x121)],'sqlCode':_0x26396b[_0x2338f6(0xff)],'bffCode':_0x26396b[_0x2338f6(0xe2)],'bffId':_0x26396b['bffId'],'functionName':_0x26396b[_0x2338f6(0xe9)]};}function normalizeScalarParams(_0x32afba){const _0xf8011d=a39_0x283c;return Object['fromEntries'](Object['entries'](_0x32afba)[_0xf8011d(0xf3)](([,_0x1571b5])=>typeof _0x1571b5===_0xf8011d(0x10e)||typeof _0x1571b5===_0xf8011d(0x101)));}function hasText(_0x24aacf){const _0x3e87f8=a39_0x283c;return typeof _0x24aacf===_0x3e87f8(0x10e)&&_0x24aacf['trim']()[_0x3e87f8(0xdd)]>0x0;}function isPrimitiveFlagDefault(_0xc51dbf){const _0x179665=a39_0x283c;return _0xc51dbf===undefined||typeof _0xc51dbf===_0x179665(0x10e)||typeof _0xc51dbf===_0x179665(0x101)||typeof _0xc51dbf===_0x179665(0x10f);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4d447e,_0x20bed0){const _0x5484f3=a40_0x445b,_0x2e1cf1=_0x4d447e();while(!![]){try{const _0x2b1b5e=parseInt(_0x5484f3(0xe4))/0x1*(parseInt(_0x5484f3(0xdc))/0x2)+parseInt(_0x5484f3(0xd4))/0x3+-parseInt(_0x5484f3(0xe0))/0x4*(parseInt(_0x5484f3(0xef))/0x5)+parseInt(_0x5484f3(0xe2))/0x6+parseInt(_0x5484f3(0xd3))/0x7*(parseInt(_0x5484f3(0xdd))/0x8)+-parseInt(_0x5484f3(0xe9))/0x9+parseInt(_0x5484f3(0xf9))/0xa;if(_0x2b1b5e===_0x20bed0)break;else _0x2e1cf1['push'](_0x2e1cf1['shift']());}catch(_0x134081){_0x2e1cf1['push'](_0x2e1cf1['shift']());}}}(a40_0x6471,0x2933d));function a40_0x445b(_0x48e013,_0x4af187){_0x48e013=_0x48e013-0xd2;const _0x647182=a40_0x6471();let _0x445bae=_0x647182[_0x48e013];return _0x445bae;}export function adaptServiceTreeManifestForLegacyFramework(_0x10d47f){const _0x3a7a15=a40_0x445b,_0x469120=cloneJsonValue(_0x10d47f),_0xa046f=[];if(!isObjectRecord(_0x469120))return{'manifest':_0x469120,'errors':_0xa046f};return Array[_0x3a7a15(0xd7)](_0x469120['commands'])&&_0x469120['commands'][_0x3a7a15(0xda)]((_0x272e1f,_0x32883c)=>{const _0x2a6684=_0x3a7a15;if(!isObjectRecord(_0x272e1f))return;adaptBffTarget(_0x272e1f[_0x2a6684(0xd2)],'$.commands['+_0x32883c+'].target',_0xa046f);}),adaptResources(_0x469120[_0x3a7a15(0xdf)],_0x3a7a15(0xf5),_0xa046f),{'manifest':_0x469120,'errors':_0xa046f};}export function toPublicServiceTreeTarget(_0x585a62){const _0x141038=a40_0x445b,{scriptName:_0x4438e3,..._0x7d8259}=_0x585a62;return typeof _0x4438e3===_0x141038(0xd8)&&_0x4438e3[_0x141038(0xea)]()&&(_0x7d8259[_0x141038(0xf2)]=_0x4438e3),_0x7d8259;}export function toPublicNormalizedServiceTree(_0x352bed){const _0x19a3fd=a40_0x445b;return{..._0x352bed,'commands':_0x352bed[_0x19a3fd(0xf8)][_0x19a3fd(0xfa)](_0x233a57=>({..._0x233a57,'target':toPublicServiceTreeTarget(_0x233a57[_0x19a3fd(0xd2)])}))};}function adaptResources(_0x397b29,_0x4760dc,_0x4ef0f0){const _0x232473=a40_0x445b;if(!isObjectRecord(_0x397b29))return;for(const [_0x539fd1,_0x1bded7]of Object[_0x232473(0xf1)](_0x397b29)){if(!isObjectRecord(_0x1bded7))continue;const _0x606b40=_0x4760dc+'.'+_0x539fd1;if(isObjectRecord(_0x1bded7[_0x232473(0xdb)]))for(const [_0x11e342,_0x413ed8]of Object[_0x232473(0xf1)](_0x1bded7[_0x232473(0xdb)])){if(!isObjectRecord(_0x413ed8))continue;const _0x542e7f=_0x606b40+_0x232473(0xe3)+_0x11e342,_0x127c44=isObjectRecord(_0x413ed8['target'])&&_0x413ed8[_0x232473(0xd2)]['kind']==='bff';adaptBffTarget(_0x413ed8[_0x232473(0xd2)],_0x542e7f+_0x232473(0xf3),_0x4ef0f0),(_0x127c44||isBffAction(_0x413ed8))&&adaptFunctionNameField(_0x413ed8,_0x542e7f,_0x4ef0f0);}adaptResources(_0x1bded7[_0x232473(0xdf)],_0x606b40+_0x232473(0xe6),_0x4ef0f0);}}function adaptBffTarget(_0x233bcc,_0x3b1921,_0x5b1d76){const _0x220b91=a40_0x445b;if(!isObjectRecord(_0x233bcc)||_0x233bcc[_0x220b91(0xee)]!==_0x220b91(0xeb))return;adaptFunctionNameField(_0x233bcc,_0x3b1921,_0x5b1d76);}function adaptFunctionNameField(_0x5452c9,_0x7cd002,_0x147505){const _0x4039c3=a40_0x445b;Object[_0x4039c3(0xd6)][_0x4039c3(0xf0)][_0x4039c3(0xe1)](_0x5452c9,_0x4039c3(0xde))&&_0x147505[_0x4039c3(0xed)]({'level':_0x4039c3(0xe7),'path':_0x7cd002+_0x4039c3(0xe8),'message':_0x4039c3(0xd9)});if(Object[_0x4039c3(0xd6)][_0x4039c3(0xf0)]['call'](_0x5452c9,_0x4039c3(0xf2))){if(typeof _0x5452c9[_0x4039c3(0xf2)]!=='string'||!_0x5452c9['functionName'][_0x4039c3(0xea)]()){_0x147505[_0x4039c3(0xed)]({'level':_0x4039c3(0xe7),'path':_0x7cd002+_0x4039c3(0xf4),'message':_0x4039c3(0xec)}),delete _0x5452c9[_0x4039c3(0xf2)];return;}_0x5452c9['scriptName']=_0x5452c9['functionName'],delete _0x5452c9[_0x4039c3(0xf2)];}}function isBffAction(_0x1c3e59){const _0x154f68=a40_0x445b;return _0x1c3e59[_0x154f68(0xee)]==='bff'||_0x1c3e59[_0x154f68(0xe5)]===_0x154f68(0xd5)||_0x1c3e59['target']===_0x154f68(0xd5);}function cloneJsonValue(_0x19bd58){const _0x336d63=a40_0x445b;if(Array['isArray'](_0x19bd58))return _0x19bd58[_0x336d63(0xfa)](_0x10c64a=>cloneJsonValue(_0x10c64a));if(isObjectRecord(_0x19bd58))return Object[_0x336d63(0xf6)](Object[_0x336d63(0xf1)](_0x19bd58)[_0x336d63(0xfa)](([_0xf119c,_0x3688f3])=>[_0xf119c,cloneJsonValue(_0x3688f3)]));return _0x19bd58;}function a40_0x6471(){const _0x1b9529=['target','203714DncCdx','312171dGKGAX','bff.exec','prototype','isArray','string','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','forEach','actions','1122DGDhXg','8tyvwHE','scriptName','resources','36VBPYMH','call','237882yYFriN','.actions.','113IeFYaR','action','.resources','error','.scriptName','1078704JAmKUb','trim','bff','functionName\x20must\x20be\x20a\x20non-empty\x20string.','push','kind','57215CXDGRh','hasOwnProperty','entries','functionName','.target','.functionName','$.resources','fromEntries','object','commands','1554090gGHkEw','map'];a40_0x6471=function(){return _0x1b9529;};return a40_0x6471();}function isObjectRecord(_0x324dee){const _0x1c8d98=a40_0x445b;return Boolean(_0x324dee)&&typeof _0x324dee===_0x1c8d98(0xf7)&&!Array[_0x1c8d98(0xd7)](_0x324dee);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a41_0x372c56=a41_0xf9c1;function a41_0x2d56(){const _0x56ce6d=['service','replaced','type','read','manifests','validate','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','\x20service(s),\x20updated\x20','hash','502652aumZqh','import','length','warnings','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','cliPath','remove','kind','2HJIbwl','Removed\x20service\x20','risk','396849pPiviY','version','从本地运行态注册表移除\x20Service\x20Tree\x20清单','write','Service\x20registry\x20validation\x20passed.','Updated','required','406935zNfKPv','registryPath','cliName','name','registry','description','target','commands','5004171UXAxoi','updated','Local\x20service\x20not\x20found:\x20','detail','serviceCount','string','350838Oueiju','str','lower\x20kebab-case\x20service\x20code','report','registryServiceCode','filePath','Exported\x20service\x20','entries','568WwRFIc','WRITE','reduce','\x20service\x20','imported','entry','\x20service(s).','2191428GDmbIt','map','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','registryIndex','Local\x20service\x20code,\x20for\x20example\x20crm','file','normalizedManifest','273lKZGXD','Service\x20Tree\x20manifest\x20file\x20path','errors','Imported','list','serviceCode','source','将\x20Service\x20Tree\x20清单导入本地运行态注册表'];a41_0x2d56=function(){return _0x56ce6d;};return a41_0x2d56();}(function(_0x55fa33,_0x3489bb){const _0x204312=a41_0xf9c1,_0x232837=_0x55fa33();while(!![]){try{const _0x1195b7=parseInt(_0x204312(0xe4))/0x1+-parseInt(_0x204312(0xcc))/0x2*(parseInt(_0x204312(0xcf))/0x3)+parseInt(_0x204312(0xc3))/0x4+parseInt(_0x204312(0xd6))/0x5+parseInt(_0x204312(0xf3))/0x6+-parseInt(_0x204312(0xfa))/0x7*(parseInt(_0x204312(0xec))/0x8)+-parseInt(_0x204312(0xde))/0x9;if(_0x1195b7===_0x3489bb)break;else _0x232837['push'](_0x232837['shift']());}catch(_0x7d7b71){_0x232837['push'](_0x232837['shift']());}}}(a41_0x2d56,0x38a77));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';function a41_0xf9c1(_0x21c88b,_0x455ec7){_0x21c88b=_0x21c88b-0xbe;const _0x2d5619=a41_0x2d56();let _0xf9c1cd=_0x2d5619[_0x21c88b];return _0xf9c1cd;}const FILE_FLAG={'name':a41_0x372c56(0xf8),'type':a41_0x372c56(0xe3),'required':!![],'description':a41_0x372c56(0xfb)},SERVICE_FLAG={'name':'service','type':a41_0x372c56(0xe3),'required':!![],'description':a41_0x372c56(0xf7),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a41_0x372c56(0xe6)}};function summarizeService(_0x1e581a){const _0x4e08b1=a41_0x372c56;return{'serviceCode':_0x1e581a[_0x4e08b1(0xff)],'name':_0x1e581a[_0x4e08b1(0xf9)]['service'][_0x4e08b1(0xd9)],'version':_0x1e581a[_0x4e08b1(0xd0)],'importedAt':_0x1e581a['importedAt'],'source':_0x1e581a[_0x4e08b1(0x100)],'commandCount':_0x1e581a[_0x4e08b1(0xf9)][_0x4e08b1(0xdd)]['length'],'commands':_0x1e581a[_0x4e08b1(0xf9)][_0x4e08b1(0xdd)]['map'](_0x5761d9=>({'path':_0x5761d9[_0x4e08b1(0xc9)],'description':_0x5761d9[_0x4e08b1(0xdb)],'risk':_0x5761d9[_0x4e08b1(0xce)],'target':toPublicServiceTreeTarget(_0x5761d9[_0x4e08b1(0xdc)]),'flags':_0x5761d9['flags'][_0x4e08b1(0xf4)](_0x16e8a9=>({'name':_0x16e8a9[_0x4e08b1(0xd9)],'cliName':_0x16e8a9[_0x4e08b1(0xd8)],'type':_0x16e8a9[_0x4e08b1(0x104)],'required':_0x16e8a9[_0x4e08b1(0xd5)]===!![]}))}))};}function summarizeLoadedManifest(_0x478ab3){const _0x123327=a41_0x372c56;return{'service':_0x478ab3[_0x123327(0xf9)]?.['service'],'version':_0x478ab3['normalizedManifest']?.[_0x123327(0xd0)],'commandCount':_0x478ab3[_0x123327(0xf9)]?.['commands'][_0x123327(0xc5)]??0x0,'commands':_0x478ab3[_0x123327(0xf9)]?.[_0x123327(0xdd)][_0x123327(0xf4)](_0x12fe4e=>({'path':_0x12fe4e[_0x123327(0xc9)],'risk':_0x12fe4e[_0x123327(0xce)],'target':toPublicServiceTreeTarget(_0x12fe4e[_0x123327(0xdc)])}))??[],'registryIndex':_0x478ab3[_0x123327(0xf6)],'registryServiceCode':_0x478ab3[_0x123327(0xe8)],'errors':_0x478ab3[_0x123327(0xe7)][_0x123327(0xfc)],'warnings':_0x478ab3[_0x123327(0xe7)][_0x123327(0xc6)]};}export const serviceDefinitions=[{'service':a41_0x372c56(0x102),'command':a41_0x372c56(0xbf),'description':a41_0x372c56(0xf5),'risk':a41_0x372c56(0x105),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x54acbc){const _0x567144=a41_0x372c56,_0x362672=loadServiceManifestFromFile(_0x54acbc['str']('file'));if(!_0x362672[_0x567144(0xe7)]['ok'])return{'ok':![],'data':{'file':_0x362672[_0x567144(0xe9)],'hash':_0x362672[_0x567144(0xc2)],'kind':_0x362672[_0x567144(0xcb)],'serviceCount':_0x362672[_0x567144(0xbe)][_0x567144(0xc5)],'services':_0x362672[_0x567144(0xbe)][_0x567144(0xf4)](summarizeLoadedManifest),'errors':_0x362672[_0x567144(0xe7)][_0x567144(0xfc)],'warnings':_0x362672[_0x567144(0xe7)]['warnings']},'message':formatValidationFailure(_0x362672[_0x567144(0xe7)])};if(_0x362672[_0x567144(0xcb)]===_0x567144(0xda)||_0x362672[_0x567144(0xbe)]['length']!==0x1)return{'ok':!![],'data':{'file':_0x362672[_0x567144(0xe9)],'hash':_0x362672[_0x567144(0xc2)],'kind':_0x362672['kind'],'serviceCount':_0x362672[_0x567144(0xbe)][_0x567144(0xc5)],'commandCount':_0x362672['manifests'][_0x567144(0xee)]((_0x4a75c7,_0x1d9565)=>_0x4a75c7+(_0x1d9565[_0x567144(0xf9)]?.['commands']['length']??0x0),0x0),'services':_0x362672[_0x567144(0xbe)][_0x567144(0xf4)](summarizeLoadedManifest),'warnings':_0x362672[_0x567144(0xe7)][_0x567144(0xc6)]},'message':_0x567144(0xd3)};return{'ok':!![],'data':{'file':_0x362672[_0x567144(0xe9)],'hash':_0x362672[_0x567144(0xc2)],'kind':_0x362672[_0x567144(0xcb)],'service':_0x362672['normalizedManifest']?.[_0x567144(0x102)],'version':_0x362672[_0x567144(0xf9)]?.[_0x567144(0xd0)],'commandCount':_0x362672[_0x567144(0xf9)]?.[_0x567144(0xdd)][_0x567144(0xc5)]??0x0,'commands':_0x362672['normalizedManifest']?.['commands']['map'](_0x3bc620=>({'path':_0x3bc620[_0x567144(0xc9)],'risk':_0x3bc620[_0x567144(0xce)],'target':toPublicServiceTreeTarget(_0x3bc620[_0x567144(0xdc)])})),'warnings':_0x362672[_0x567144(0xe7)][_0x567144(0xc6)]},'message':'Service\x20manifest\x20validation\x20passed.'};}},{'service':'service','command':a41_0x372c56(0xc4),'description':a41_0x372c56(0x101),'risk':a41_0x372c56(0xd2),'confirmationDescription':'将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x534d62){const _0x2ecec1=a41_0x372c56,_0x11bf6a=loadServiceManifestFromFile(_0x534d62[_0x2ecec1(0xe5)](_0x2ecec1(0xf8)));return{'method':_0x2ecec1(0xed),'url':getServiceRegistryPath(),'body':{'file':_0x11bf6a[_0x2ecec1(0xe9)],'hash':_0x11bf6a[_0x2ecec1(0xc2)],'kind':_0x11bf6a[_0x2ecec1(0xcb)],'ok':_0x11bf6a[_0x2ecec1(0xe7)]['ok'],'service':_0x11bf6a[_0x2ecec1(0xf9)]?.[_0x2ecec1(0x102)],'version':_0x11bf6a[_0x2ecec1(0xf9)]?.['version'],'serviceCount':_0x11bf6a['manifests'][_0x2ecec1(0xc5)],'services':_0x11bf6a[_0x2ecec1(0xbe)][_0x2ecec1(0xf4)](_0x599b40=>({'service':_0x599b40[_0x2ecec1(0xf9)]?.['service'],'version':_0x599b40[_0x2ecec1(0xf9)]?.[_0x2ecec1(0xd0)],'commandCount':_0x599b40[_0x2ecec1(0xf9)]?.[_0x2ecec1(0xdd)]['length']??0x0,'errors':_0x599b40[_0x2ecec1(0xe7)][_0x2ecec1(0xfc)]})),'errors':_0x11bf6a[_0x2ecec1(0xe7)][_0x2ecec1(0xfc)],'commandCount':_0x11bf6a[_0x2ecec1(0xf9)]?.[_0x2ecec1(0xdd)][_0x2ecec1(0xc5)]??0x0},'description':'Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json'};},async 'execute'(_0x45c3ad){const _0x267b9e=a41_0x372c56,_0x51112c=importServiceManifest(_0x45c3ad['str'](_0x267b9e(0xf8)));if(_0x51112c['entries'][_0x267b9e(0xc5)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x51112c[_0x267b9e(0xd7)],'imported':_0x51112c[_0x267b9e(0xf0)],'updated':_0x51112c[_0x267b9e(0xdf)],'serviceCount':_0x51112c[_0x267b9e(0xe2)],'services':_0x51112c[_0x267b9e(0xeb)][_0x267b9e(0xf4)](summarizeService)},'message':'Imported\x20'+_0x51112c[_0x267b9e(0xf0)]+_0x267b9e(0xc1)+_0x51112c['updated']+_0x267b9e(0xf2)};return{'ok':!![],'data':{'registryPath':_0x51112c[_0x267b9e(0xd7)],'replaced':_0x51112c[_0x267b9e(0x103)],'imported':_0x51112c['imported'],'updated':_0x51112c[_0x267b9e(0xdf)],'serviceCount':_0x51112c['serviceCount'],'service':summarizeService(_0x51112c[_0x267b9e(0xf1)])},'message':(_0x51112c[_0x267b9e(0x103)]?_0x267b9e(0xd4):_0x267b9e(0xfd))+_0x267b9e(0xef)+_0x51112c[_0x267b9e(0xf1)][_0x267b9e(0xff)]+'.'};}},{'service':a41_0x372c56(0x102),'command':'export','description':'将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','risk':a41_0x372c56(0xd2),'confirmationDescription':'将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0xa95e04){const _0x24d64c=a41_0x372c56,_0x4b7163=getLocalServiceEntry(_0xa95e04[_0x24d64c(0xe5)]('service'));return{'method':_0x24d64c(0xed),'url':_0xa95e04[_0x24d64c(0xe5)](_0x24d64c(0xf8)),'body':{'service':_0xa95e04[_0x24d64c(0xe5)]('service'),'found':Boolean(_0x4b7163),'version':_0x4b7163?.[_0x24d64c(0xd0)],'source':_0x4b7163?.[_0x24d64c(0x100)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0xb2a0fd){const _0x730249=a41_0x372c56,_0x21b6b6=exportServiceManifest(_0xb2a0fd[_0x730249(0xe5)](_0x730249(0x102)),_0xb2a0fd[_0x730249(0xe5)](_0x730249(0xf8)));return{'ok':!![],'data':{'registryPath':_0x21b6b6[_0x730249(0xd7)],'file':_0x21b6b6[_0x730249(0xe9)],'service':summarizeService(_0x21b6b6['entry'])},'message':_0x730249(0xea)+_0x21b6b6['entry'][_0x730249(0xff)]+'.'};}},{'service':a41_0x372c56(0x102),'command':a41_0x372c56(0xfe),'description':'List\x20locally\x20imported\x20Service\x20Tree\x20manifests','risk':a41_0x372c56(0x105),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x5e0920=a41_0x372c56,_0x16f918=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x16f918[_0x5e0920(0xc5)],'services':_0x16f918['map'](summarizeService)}};}},{'service':a41_0x372c56(0x102),'command':a41_0x372c56(0xca),'description':a41_0x372c56(0xd1),'risk':'write','confirmationDescription':a41_0x372c56(0xc8),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x33bc8c){const _0x3df8ed=a41_0x372c56,_0x3d86a2=getLocalServiceEntry(_0x33bc8c[_0x3df8ed(0xe5)](_0x3df8ed(0x102)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x33bc8c['str']('service'),'found':Boolean(_0x3d86a2),'version':_0x3d86a2?.[_0x3df8ed(0xd0)],'source':_0x3d86a2?.[_0x3df8ed(0x100)]},'description':_0x3df8ed(0xc7)};},async 'execute'(_0x40dfd0){const _0x3bf9a5=a41_0x372c56,_0x4481a5=removeServiceManifest(_0x40dfd0['str'](_0x3bf9a5(0x102)));return{'ok':!![],'data':{'registryPath':_0x4481a5['registryPath'],'serviceCount':_0x4481a5['serviceCount'],'service':summarizeService(_0x4481a5[_0x3bf9a5(0xf1)])},'message':_0x3bf9a5(0xcd)+_0x4481a5[_0x3bf9a5(0xf1)][_0x3bf9a5(0xff)]+'.'};}},{'service':a41_0x372c56(0x102),'command':a41_0x372c56(0xe1),'description':a41_0x372c56(0xc0),'risk':a41_0x372c56(0x105),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x284a66){const _0xb19204=a41_0x372c56,_0x5830a0=getLocalServiceEntry(_0x284a66[_0xb19204(0xe5)]('service'));if(!_0x5830a0)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x284a66[_0xb19204(0xe5)](_0xb19204(0x102))},'message':_0xb19204(0xe0)+_0x284a66['str'](_0xb19204(0x102))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x5830a0),'manifest':_0x5830a0['manifest'],'normalizedManifest':toPublicNormalizedServiceTree(_0x5830a0[_0xb19204(0xf9)])}};}}];
|
|
1
|
+
const a41_0x27193f=a41_0x5b09;(function(_0x3b5943,_0xde61be){const _0x4308c3=a41_0x5b09,_0x110b41=_0x3b5943();while(!![]){try{const _0x4c4e8e=-parseInt(_0x4308c3(0xef))/0x1+-parseInt(_0x4308c3(0xcd))/0x2*(-parseInt(_0x4308c3(0xd7))/0x3)+-parseInt(_0x4308c3(0xd5))/0x4+-parseInt(_0x4308c3(0xff))/0x5+-parseInt(_0x4308c3(0xe5))/0x6*(parseInt(_0x4308c3(0xcb))/0x7)+parseInt(_0x4308c3(0x108))/0x8+parseInt(_0x4308c3(0xd3))/0x9;if(_0x4c4e8e===_0xde61be)break;else _0x110b41['push'](_0x110b41['shift']());}catch(_0x165179){_0x110b41['push'](_0x110b41['shift']());}}}(a41_0x57b8,0xbe8c2));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';function a41_0x5b09(_0x2f52e1,_0x5a4ad1){_0x2f52e1=_0x2f52e1-0xc8;const _0x57b867=a41_0x57b8();let _0x5b0913=_0x57b867[_0x2f52e1];return _0x5b0913;}function a41_0x57b8(){const _0x50ef61=['Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','4NxWpla','service','commands','serviceCode','Updated','read','21662037XxVXnR','flags','5356508ehVBHK','length','1628526eFvtTs','string','registryIndex','registry','Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','replaced','将\x20Service\x20Tree\x20清单导入本地运行态注册表','source','Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json','manifest','Removed\x20service\x20','Imported\x20','Service\x20Tree\x20manifest\x20file\x20path','22020hlHjhN','filePath','map','file','errors','Exported\x20service\x20','cliPath','cliName','type','importedAt','627796yQQIkk','description','从本地运行态注册表移除\x20Service\x20Tree\x20清单','lower\x20kebab-case\x20service\x20code','version','\x20service(s).','updated','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','Service\x20manifest\x20validation\x20passed.','risk','normalizedManifest','imported','Imported','name','kind','warnings','1413310glqJvZ','entries','import','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','serviceCount','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','registryPath','detail','entry','1672800bHctFm','Local\x20service\x20code,\x20for\x20example\x20crm','export','required','\x20service(s),\x20updated\x20','hash','str','write','Service\x20registry\x20validation\x20passed.','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','manifests','report','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','WRITE','target','1281EjmrDf'];a41_0x57b8=function(){return _0x50ef61;};return a41_0x57b8();}import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a41_0x27193f(0xe8),'type':a41_0x27193f(0xd8),'required':!![],'description':a41_0x27193f(0xe4)},SERVICE_FLAG={'name':a41_0x27193f(0xce),'type':a41_0x27193f(0xd8),'required':!![],'description':a41_0x27193f(0x109),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a41_0x27193f(0xf2)}};function summarizeService(_0x45c57e){const _0x552e99=a41_0x27193f;return{'serviceCode':_0x45c57e[_0x552e99(0xd0)],'name':_0x45c57e['normalizedManifest'][_0x552e99(0xce)][_0x552e99(0xfc)],'version':_0x45c57e['version'],'importedAt':_0x45c57e[_0x552e99(0xee)],'source':_0x45c57e[_0x552e99(0xdf)],'commandCount':_0x45c57e['normalizedManifest']['commands']['length'],'commands':_0x45c57e[_0x552e99(0xf9)][_0x552e99(0xcf)][_0x552e99(0xe7)](_0x4148c3=>({'path':_0x4148c3[_0x552e99(0xeb)],'description':_0x4148c3[_0x552e99(0xf0)],'risk':_0x4148c3[_0x552e99(0xf8)],'target':toPublicServiceTreeTarget(_0x4148c3[_0x552e99(0xca)]),'flags':_0x4148c3[_0x552e99(0xd4)][_0x552e99(0xe7)](_0x2382ce=>({'name':_0x2382ce[_0x552e99(0xfc)],'cliName':_0x2382ce[_0x552e99(0xec)],'type':_0x2382ce[_0x552e99(0xed)],'required':_0x2382ce[_0x552e99(0x10b)]===!![]}))}))};}function summarizeLoadedManifest(_0x27f326){const _0x33278b=a41_0x27193f;return{'service':_0x27f326['normalizedManifest']?.['service'],'version':_0x27f326[_0x33278b(0xf9)]?.[_0x33278b(0xf3)],'commandCount':_0x27f326[_0x33278b(0xf9)]?.['commands']['length']??0x0,'commands':_0x27f326[_0x33278b(0xf9)]?.['commands'][_0x33278b(0xe7)](_0x4cf065=>({'path':_0x4cf065[_0x33278b(0xeb)],'risk':_0x4cf065['risk'],'target':toPublicServiceTreeTarget(_0x4cf065[_0x33278b(0xca)])}))??[],'registryIndex':_0x27f326[_0x33278b(0xd9)],'registryServiceCode':_0x27f326['registryServiceCode'],'errors':_0x27f326[_0x33278b(0x113)][_0x33278b(0xe9)],'warnings':_0x27f326[_0x33278b(0x113)]['warnings']};}export const serviceDefinitions=[{'service':a41_0x27193f(0xce),'command':'validate','description':a41_0x27193f(0x102),'risk':a41_0x27193f(0xd2),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x265846){const _0x442a12=a41_0x27193f,_0x532170=loadServiceManifestFromFile(_0x265846[_0x442a12(0x10e)]('file'));if(!_0x532170[_0x442a12(0x113)]['ok'])return{'ok':![],'data':{'file':_0x532170['filePath'],'hash':_0x532170[_0x442a12(0x10d)],'kind':_0x532170[_0x442a12(0xfd)],'serviceCount':_0x532170[_0x442a12(0x112)]['length'],'services':_0x532170['manifests']['map'](summarizeLoadedManifest),'errors':_0x532170[_0x442a12(0x113)][_0x442a12(0xe9)],'warnings':_0x532170['report']['warnings']},'message':formatValidationFailure(_0x532170['report'])};if(_0x532170['kind']===_0x442a12(0xda)||_0x532170[_0x442a12(0x112)][_0x442a12(0xd6)]!==0x1)return{'ok':!![],'data':{'file':_0x532170[_0x442a12(0xe6)],'hash':_0x532170['hash'],'kind':_0x532170[_0x442a12(0xfd)],'serviceCount':_0x532170[_0x442a12(0x112)][_0x442a12(0xd6)],'commandCount':_0x532170[_0x442a12(0x112)]['reduce']((_0x474f68,_0x2e5c91)=>_0x474f68+(_0x2e5c91[_0x442a12(0xf9)]?.[_0x442a12(0xcf)][_0x442a12(0xd6)]??0x0),0x0),'services':_0x532170[_0x442a12(0x112)][_0x442a12(0xe7)](summarizeLoadedManifest),'warnings':_0x532170['report'][_0x442a12(0xfe)]},'message':_0x442a12(0x110)};return{'ok':!![],'data':{'file':_0x532170[_0x442a12(0xe6)],'hash':_0x532170['hash'],'kind':_0x532170[_0x442a12(0xfd)],'service':_0x532170[_0x442a12(0xf9)]?.[_0x442a12(0xce)],'version':_0x532170['normalizedManifest']?.[_0x442a12(0xf3)],'commandCount':_0x532170['normalizedManifest']?.[_0x442a12(0xcf)]['length']??0x0,'commands':_0x532170['normalizedManifest']?.[_0x442a12(0xcf)][_0x442a12(0xe7)](_0x14f940=>({'path':_0x14f940['cliPath'],'risk':_0x14f940[_0x442a12(0xf8)],'target':toPublicServiceTreeTarget(_0x14f940[_0x442a12(0xca)])})),'warnings':_0x532170[_0x442a12(0x113)][_0x442a12(0xfe)]},'message':_0x442a12(0xf7)};}},{'service':a41_0x27193f(0xce),'command':a41_0x27193f(0x101),'description':a41_0x27193f(0xde),'risk':a41_0x27193f(0x10f),'confirmationDescription':a41_0x27193f(0x104),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x4a76e2){const _0x2a75aa=a41_0x27193f,_0x2069e8=loadServiceManifestFromFile(_0x4a76e2[_0x2a75aa(0x10e)](_0x2a75aa(0xe8)));return{'method':_0x2a75aa(0xc9),'url':getServiceRegistryPath(),'body':{'file':_0x2069e8[_0x2a75aa(0xe6)],'hash':_0x2069e8['hash'],'kind':_0x2069e8[_0x2a75aa(0xfd)],'ok':_0x2069e8['report']['ok'],'service':_0x2069e8['normalizedManifest']?.[_0x2a75aa(0xce)],'version':_0x2069e8[_0x2a75aa(0xf9)]?.[_0x2a75aa(0xf3)],'serviceCount':_0x2069e8[_0x2a75aa(0x112)]['length'],'services':_0x2069e8[_0x2a75aa(0x112)][_0x2a75aa(0xe7)](_0x164caa=>({'service':_0x164caa[_0x2a75aa(0xf9)]?.[_0x2a75aa(0xce)],'version':_0x164caa[_0x2a75aa(0xf9)]?.[_0x2a75aa(0xf3)],'commandCount':_0x164caa[_0x2a75aa(0xf9)]?.[_0x2a75aa(0xcf)][_0x2a75aa(0xd6)]??0x0,'errors':_0x164caa['report'][_0x2a75aa(0xe9)]})),'errors':_0x2069e8[_0x2a75aa(0x113)][_0x2a75aa(0xe9)],'commandCount':_0x2069e8[_0x2a75aa(0xf9)]?.[_0x2a75aa(0xcf)][_0x2a75aa(0xd6)]??0x0},'description':_0x2a75aa(0xc8)};},async 'execute'(_0x21db22){const _0x32dbba=a41_0x27193f,_0x2c575e=importServiceManifest(_0x21db22[_0x32dbba(0x10e)]('file'));if(_0x2c575e[_0x32dbba(0x100)][_0x32dbba(0xd6)]!==0x1)return{'ok':!![],'data':{'registryPath':_0x2c575e[_0x32dbba(0x105)],'imported':_0x2c575e[_0x32dbba(0xfa)],'updated':_0x2c575e[_0x32dbba(0xf5)],'serviceCount':_0x2c575e[_0x32dbba(0x103)],'services':_0x2c575e[_0x32dbba(0x100)][_0x32dbba(0xe7)](summarizeService)},'message':_0x32dbba(0xe3)+_0x2c575e[_0x32dbba(0xfa)]+_0x32dbba(0x10c)+_0x2c575e[_0x32dbba(0xf5)]+_0x32dbba(0xf4)};return{'ok':!![],'data':{'registryPath':_0x2c575e['registryPath'],'replaced':_0x2c575e[_0x32dbba(0xdd)],'imported':_0x2c575e[_0x32dbba(0xfa)],'updated':_0x2c575e[_0x32dbba(0xf5)],'serviceCount':_0x2c575e['serviceCount'],'service':summarizeService(_0x2c575e['entry'])},'message':(_0x2c575e[_0x32dbba(0xdd)]?_0x32dbba(0xd1):_0x32dbba(0xfb))+'\x20service\x20'+_0x2c575e['entry'][_0x32dbba(0xd0)]+'.'};}},{'service':a41_0x27193f(0xce),'command':a41_0x27193f(0x10a),'description':a41_0x27193f(0x111),'risk':a41_0x27193f(0x10f),'confirmationDescription':'将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x16afc7){const _0x540dcc=a41_0x27193f,_0x3220ef=getLocalServiceEntry(_0x16afc7[_0x540dcc(0x10e)](_0x540dcc(0xce)));return{'method':_0x540dcc(0xc9),'url':_0x16afc7[_0x540dcc(0x10e)](_0x540dcc(0xe8)),'body':{'service':_0x16afc7[_0x540dcc(0x10e)]('service'),'found':Boolean(_0x3220ef),'version':_0x3220ef?.[_0x540dcc(0xf3)],'source':_0x3220ef?.[_0x540dcc(0xdf)]},'description':_0x540dcc(0xdb)};},async 'execute'(_0x1bc2ca){const _0x55c44a=a41_0x27193f,_0x300cb7=exportServiceManifest(_0x1bc2ca[_0x55c44a(0x10e)](_0x55c44a(0xce)),_0x1bc2ca[_0x55c44a(0x10e)](_0x55c44a(0xe8)));return{'ok':!![],'data':{'registryPath':_0x300cb7[_0x55c44a(0x105)],'file':_0x300cb7[_0x55c44a(0xe6)],'service':summarizeService(_0x300cb7[_0x55c44a(0x107)])},'message':_0x55c44a(0xea)+_0x300cb7[_0x55c44a(0x107)][_0x55c44a(0xd0)]+'.'};}},{'service':a41_0x27193f(0xce),'command':'list','description':a41_0x27193f(0xf6),'risk':a41_0x27193f(0xd2),'requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x306c88=a41_0x27193f,_0x2b1eeb=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x2b1eeb[_0x306c88(0xd6)],'services':_0x2b1eeb[_0x306c88(0xe7)](summarizeService)}};}},{'service':a41_0x27193f(0xce),'command':'remove','description':a41_0x27193f(0xf1),'risk':a41_0x27193f(0x10f),'confirmationDescription':a41_0x27193f(0xdc),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x181a8d){const _0x1d0941=a41_0x27193f,_0xca403f=getLocalServiceEntry(_0x181a8d[_0x1d0941(0x10e)]('service'));return{'method':_0x1d0941(0xc9),'url':getServiceRegistryPath(),'body':{'service':_0x181a8d[_0x1d0941(0x10e)](_0x1d0941(0xce)),'found':Boolean(_0xca403f),'version':_0xca403f?.[_0x1d0941(0xf3)],'source':_0xca403f?.[_0x1d0941(0xdf)]},'description':_0x1d0941(0xe0)};},async 'execute'(_0x4769fe){const _0x32b2c0=a41_0x27193f,_0x283047=removeServiceManifest(_0x4769fe['str'](_0x32b2c0(0xce)));return{'ok':!![],'data':{'registryPath':_0x283047[_0x32b2c0(0x105)],'serviceCount':_0x283047['serviceCount'],'service':summarizeService(_0x283047[_0x32b2c0(0x107)])},'message':_0x32b2c0(0xe2)+_0x283047[_0x32b2c0(0x107)][_0x32b2c0(0xd0)]+'.'};}},{'service':a41_0x27193f(0xce),'command':a41_0x27193f(0x106),'description':a41_0x27193f(0xcc),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x1f4aa8){const _0x15d316=a41_0x27193f,_0x4608d2=getLocalServiceEntry(_0x1f4aa8['str']('service'));if(!_0x4608d2)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x1f4aa8[_0x15d316(0x10e)]('service')},'message':'Local\x20service\x20not\x20found:\x20'+_0x1f4aa8[_0x15d316(0x10e)](_0x15d316(0xce))};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x4608d2),'manifest':_0x4608d2[_0x15d316(0xe1)],'normalizedManifest':toPublicNormalizedServiceTree(_0x4608d2[_0x15d316(0xf9)])}};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a42_0x2ce158=a42_0x1d3b;(function(_0x44940e,_0x818a7e){const _0x3a96e6=a42_0x1d3b,_0x25b3c1=_0x44940e();while(!![]){try{const _0x3ad898=parseInt(_0x3a96e6(0xe7))/0x1*(-parseInt(_0x3a96e6(0x12e))/0x2)+-parseInt(_0x3a96e6(0xf5))/0x3+-parseInt(_0x3a96e6(0xe6))/0x4+parseInt(_0x3a96e6(0x11d))/0x5*(-parseInt(_0x3a96e6(0x12f))/0x6)+parseInt(_0x3a96e6(0x104))/0x7*(-parseInt(_0x3a96e6(0x10d))/0x8)+parseInt(_0x3a96e6(0xdf))/0x9+parseInt(_0x3a96e6(0x127))/0xa*(parseInt(_0x3a96e6(0xe2))/0xb);if(_0x3ad898===_0x818a7e)break;else _0x25b3c1['push'](_0x25b3c1['shift']());}catch(_0x78d668){_0x25b3c1['push'](_0x25b3c1['shift']());}}}(a42_0x4dbf,0x33947));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_0x2ce158(0x101);export function getServiceRegistryPath(_0x5d4eab={}){const _0x137166=a42_0x2ce158;return resolve(_0x5d4eab[_0x137166(0x113)]??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x4dafd9={}){const _0x194764=a42_0x2ce158,_0x101360=getServiceRegistryPath(_0x4dafd9);if(!existsSync(_0x101360))return emptyServiceRegistry();try{const _0x28fb07=readFileSync(_0x101360,_0x194764(0x122));if(!_0x28fb07[_0x194764(0xed)]())return emptyServiceRegistry();const _0x3b6241=JSON[_0x194764(0xec)](_0x28fb07);if(_0x3b6241[_0x194764(0x120)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x194764(0x10f)](_0x194764(0x12a)+String(_0x3b6241[_0x194764(0x120)]),_0x194764(0x11f)+_0x101360+'.');if(!Array[_0x194764(0xf9)](_0x3b6241['services']))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x3b6241[_0x194764(0xf6)],'services':_0x3b6241[_0x194764(0xfa)]};}catch(_0x4ec97f){if(_0x4ec97f instanceof Error&&_0x4ec97f[_0x194764(0x123)]===_0x194764(0xdc))throw _0x4ec97f;throw CliErrors[_0x194764(0x10f)](_0x194764(0xe5)+_0x101360,_0x194764(0xe3));}}export function writeServiceRegistry(_0x1ef703,_0x29b58d={}){const _0x354cca=a42_0x2ce158,_0x12732d=getServiceRegistryPath(_0x29b58d),_0x1fc061=dirname(_0x12732d);!existsSync(_0x1fc061)&&mkdirSync(_0x1fc061,{'recursive':!![]});const _0x290115=_0x12732d+_0x354cca(0x110);try{writeFileSync(_0x290115,JSON[_0x354cca(0x112)](_0x1ef703,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x290115,_0x12732d);}catch(_0x3bd507){try{unlinkSync(_0x290115);}catch{}if(_0x3bd507?.[_0x354cca(0x115)]===_0x354cca(0xf4))throw CliErrors['validation'](_0x354cca(0x109)+_0x12732d);throw _0x3bd507;}return _0x12732d;}export function loadServiceManifestFromFile(_0x4fc2a7){const _0x2900b6=a42_0x2ce158,_0x12fcc3=resolve(_0x4fc2a7);if(!existsSync(_0x12fcc3))throw CliErrors[_0x2900b6(0x10f)](_0x2900b6(0xe0)+_0x4fc2a7);let _0x3db71f;const _0x47b115=readFileSync(_0x12fcc3,_0x2900b6(0x122));try{_0x3db71f=JSON[_0x2900b6(0xec)](_0x47b115);}catch{throw CliErrors[_0x2900b6(0x10f)](_0x2900b6(0xeb)+_0x4fc2a7,_0x2900b6(0x103));}const _0x310778=sha256(_0x47b115),_0x18b8e9=extractLoadedServiceManifests(_0x3db71f,_0x310778),_0x4ca6ff=aggregateValidationReports(_0x18b8e9),_0x322681=_0x18b8e9[0x0];return{'filePath':_0x12fcc3,'hash':_0x310778,'kind':isServiceRegistryLike(_0x3db71f)?'registry':_0x2900b6(0x126),'manifest':_0x322681?.[_0x2900b6(0x126)]??_0x3db71f,'report':_0x4ca6ff,'normalizedManifest':_0x18b8e9[_0x2900b6(0xde)]===0x1?_0x322681?.[_0x2900b6(0xea)]:undefined,'manifests':_0x18b8e9};}export function importServiceManifest(_0x2f00dc,_0x220478={}){const _0x151f76=a42_0x2ce158,_0xdddf0=loadServiceManifestFromFile(_0x2f00dc);if(!_0xdddf0[_0x151f76(0x111)]['ok'])throw CliErrors['validation'](formatValidationFailure(_0xdddf0[_0x151f76(0x111)]),'Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.');if(_0xdddf0[_0x151f76(0xee)][_0x151f76(0xde)]===0x0)throw CliErrors['validation'](_0x151f76(0x125),_0x151f76(0xdd));const _0x334292=readServiceRegistry(_0x220478),_0x488fdb=(_0x220478[_0x151f76(0xe4)]??(()=>new Date()))()[_0x151f76(0xe9)](),_0x33aa54=[];let _0x9a08ac=0x0,_0x38c045=0x0;for(const _0x3c2f3f of _0xdddf0[_0x151f76(0xee)]){if(!_0x3c2f3f['normalizedManifest'])continue;const _0x30f422=_0x3c2f3f[_0x151f76(0xea)][_0x151f76(0xfe)][_0x151f76(0x115)],_0x2c2171={'serviceCode':_0x30f422,'version':_0x3c2f3f[_0x151f76(0xea)][_0x151f76(0x12d)],'importedAt':_0x488fdb,'source':{'type':_0x151f76(0x12b),'path':_0xdddf0[_0x151f76(0xe8)],'hash':_0x3c2f3f[_0x151f76(0xda)]},'manifest':_0x3c2f3f[_0x151f76(0x126)],'normalizedManifest':_0x3c2f3f[_0x151f76(0xea)]},_0xb3c8cc=_0x334292[_0x151f76(0xfa)][_0x151f76(0x106)](_0x52a5b9=>_0x52a5b9[_0x151f76(0x107)]===_0x30f422);_0xb3c8cc>=0x0?(_0x334292[_0x151f76(0xfa)][_0xb3c8cc]=_0x2c2171,_0x38c045++):(_0x334292[_0x151f76(0xfa)]['push'](_0x2c2171),_0x9a08ac++),_0x33aa54[_0x151f76(0xfb)](_0x2c2171);}_0x334292[_0x151f76(0xfa)][_0x151f76(0x10e)]((_0x2dc060,_0x44a225)=>_0x2dc060[_0x151f76(0x107)][_0x151f76(0x11e)](_0x44a225[_0x151f76(0x107)])),_0x334292[_0x151f76(0xf6)]=_0x488fdb;const _0x1404de=writeServiceRegistry(_0x334292,_0x220478);return{'registryPath':_0x1404de,'entry':_0x33aa54[0x0],'replaced':_0x33aa54['length']===0x1?_0x38c045===0x1:_0x38c045>0x0,'entries':_0x33aa54,'imported':_0x9a08ac,'updated':_0x38c045,'serviceCount':_0x334292[_0x151f76(0xfa)][_0x151f76(0xde)]};}export function exportServiceManifest(_0x5a1726,_0x455b36,_0xc8121f={}){const _0x4ecd29=a42_0x2ce158,_0x16cc88=getServiceRegistryPath(_0xc8121f),_0x1422e6=getLocalServiceEntry(_0x5a1726,_0xc8121f);if(!_0x1422e6)throw CliErrors[_0x4ecd29(0x10f)]('Local\x20service\x20not\x20found:\x20'+_0x5a1726,_0x4ecd29(0xf3));const _0x489346=resolve(_0x455b36),_0x17d7d=dirname(_0x489346);return!existsSync(_0x17d7d)&&mkdirSync(_0x17d7d,{'recursive':!![]}),writeFileSync(_0x489346,JSON['stringify'](_0x1422e6[_0x4ecd29(0x126)],null,0x2)+'\x0a',{'encoding':_0x4ecd29(0x122),'mode':0x180}),{'registryPath':_0x16cc88,'filePath':_0x489346,'entry':_0x1422e6};}export function removeServiceManifest(_0x436697,_0x3645cd={}){const _0x43ca36=a42_0x2ce158,_0x5ac2b2=readServiceRegistry(_0x3645cd),_0x15e0f4=_0x436697[_0x43ca36(0xed)](),_0x506974=_0x5ac2b2['services'][_0x43ca36(0x106)](_0x1c734f=>_0x1c734f['serviceCode']===_0x15e0f4);if(_0x506974<0x0)throw CliErrors[_0x43ca36(0x10f)](_0x43ca36(0x117)+_0x15e0f4,'Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.');const [_0x5e167a]=_0x5ac2b2[_0x43ca36(0xfa)][_0x43ca36(0xe1)](_0x506974,0x1),_0x96ac98=(_0x3645cd[_0x43ca36(0xe4)]??(()=>new Date()))()[_0x43ca36(0xe9)]();_0x5ac2b2[_0x43ca36(0xf6)]=_0x96ac98;const _0x46ed58=writeServiceRegistry(_0x5ac2b2,_0x3645cd);return{'registryPath':_0x46ed58,'entry':_0x5e167a,'serviceCount':_0x5ac2b2[_0x43ca36(0xfa)][_0x43ca36(0xde)]};}function a42_0x4dbf(){const _0x708fbb=['update','Local\x20service\x20not\x20found:\x20','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','target','services\x20must\x20be\x20an\x20array','].manifest.','warnings','2097085mHkHeK','localeCompare','Remove\x20or\x20migrate\x20','schemaVersion','].manifest','utf8','name','missing','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','manifest','490SrwEIZ','empty','hex','Unsupported\x20service\x20registry\x20schemaVersion:\x20','file','importedAt','version','2XSTqEn','6viEyUq','map','description','bff\x20target\x20requires\x20functionName.','sourceHash','slice','CliError','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','length','261342YtCuMY','Service\x20manifest\x20file\x20not\x20found:\x20','splice','280357hyCwKh','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','now','Invalid\x20service\x20registry\x20JSON:\x20','295844lonYOO','134360MmAckp','filePath','toISOString','normalizedManifest','Invalid\x20service\x20manifest\x20JSON:\x20','parse','trim','manifests','$.services[','flatMap','reduce','commands','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','ENOENT','174687krCXQz','updatedAt','Unsupported\x20schemaVersion:\x20','invalid','isArray','services','push','sha256','startsWith','service','kind','join','service.json','find','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','2664641jXOxVG','message','findIndex','serviceCode','path','Cannot\x20write\x20service\x20registry:\x20','registryIndex','errors','object','8COtVOG','sort','validation','.tmp','report','stringify','homeDir','digest','code'];a42_0x4dbf=function(){return _0x708fbb;};return a42_0x4dbf();}export function listLocalServices(_0x2e847e={}){return readServiceRegistry(_0x2e847e)['services'];}export function getLocalServiceEntry(_0x460280,_0x1332f6={}){const _0x1d7b6f=a42_0x2ce158;return readServiceRegistry(_0x1332f6)[_0x1d7b6f(0xfa)][_0x1d7b6f(0x102)](_0x3ced52=>_0x3ced52['serviceCode']===_0x460280['trim']());}export function listLocalServiceTrees(_0x3daa8e={}){const _0x381330=a42_0x2ce158;return readServiceRegistry(_0x3daa8e)[_0x381330(0xfa)][_0x381330(0xd7)](_0x3dd2b8=>_0x3dd2b8[_0x381330(0xea)]);}export function inspectServiceRegistry(_0x566a22={}){const _0x1cac1f=a42_0x2ce158,_0x1916ff=getServiceRegistryPath(_0x566a22);if(!existsSync(_0x1916ff))return emptyServiceRegistryInspection(_0x1916ff,_0x1cac1f(0x124),![]);try{const _0x1081d5=readFileSync(_0x1916ff,_0x1cac1f(0x122));if(!_0x1081d5[_0x1cac1f(0xed)]())return emptyServiceRegistryInspection(_0x1916ff,_0x1cac1f(0x128),!![]);const _0x5aebd0=JSON[_0x1cac1f(0xec)](_0x1081d5);if(_0x5aebd0[_0x1cac1f(0x120)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x1916ff,'invalid',!![]),'schemaVersion':_0x5aebd0[_0x1cac1f(0x120)],'message':_0x1cac1f(0xf7)+String(_0x5aebd0[_0x1cac1f(0x120)])};if(!Array['isArray'](_0x5aebd0[_0x1cac1f(0xfa)]))return{...emptyServiceRegistryInspection(_0x1916ff,_0x1cac1f(0xf8),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x5aebd0[_0x1cac1f(0xf6)],'message':_0x1cac1f(0x11a)};const _0x3fdf38=_0x5aebd0['services'][_0x1cac1f(0xd7)](summarizeLocalServiceEntry);return{'registryPath':_0x1916ff,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x5aebd0[_0x1cac1f(0xf6)],'serviceCount':_0x3fdf38['length'],'commandCount':_0x3fdf38[_0x1cac1f(0xf1)]((_0x1f693b,_0x102651)=>_0x1f693b+_0x102651['commandCount'],0x0),'services':_0x3fdf38};}catch(_0x5e95ce){return{...emptyServiceRegistryInspection(_0x1916ff,_0x1cac1f(0xf8),!![]),'message':_0x5e95ce instanceof Error?_0x5e95ce[_0x1cac1f(0x105)]:String(_0x5e95ce)};}}export function formatValidationFailure(_0x2b5262){const _0x4478f7=a42_0x2ce158,_0x111f66=_0x2b5262[_0x4478f7(0x10b)]['map'](_0x41ae72=>_0x41ae72[_0x4478f7(0x108)]+':\x20'+_0x41ae72[_0x4478f7(0x105)]);return'Service\x20manifest\x20validation\x20failed:\x0a'+_0x111f66[_0x4478f7(0x100)]('\x0a');}function extractLoadedServiceManifests(_0x331166,_0x98e8e){const _0x5a071d=a42_0x2ce158;if(!isServiceRegistryLike(_0x331166)){const _0x6c88c6=_0x331166,{manifest:_0x19ecae,errors:_0x279e2c}=adaptServiceTreeManifestForLegacyFramework(_0x6c88c6),_0x588b7b=validateServiceTreeManifest(_0x19ecae),_0x4e56eb=mergeValidationErrors(_0x588b7b,_0x279e2c);return[{'manifest':_0x6c88c6,'report':_0x4e56eb,'normalizedManifest':_0x4e56eb['ok']?normalizeServiceTreeManifest(_0x19ecae):undefined,'sourceHash':_0x98e8e}];}return _0x331166[_0x5a071d(0xfa)][_0x5a071d(0xd7)]((_0x26eca8,_0x13fb50)=>{const _0x28745e=_0x5a071d,_0x160877=isObjectRecord(_0x26eca8)?_0x26eca8[_0x28745e(0x126)]:undefined,{manifest:_0x386f02,errors:_0x24b1ff}=adaptServiceTreeManifestForLegacyFramework(_0x160877),_0x323007=validateServiceTreeManifest(_0x386f02),_0x1d3534=mergeValidationErrors(_0x323007,_0x24b1ff),_0x25be3d=isObjectRecord(_0x26eca8)&&typeof _0x26eca8[_0x28745e(0x107)]==='string'?_0x26eca8['serviceCode']:undefined;return{'manifest':_0x160877,'report':_0x1d3534,'normalizedManifest':_0x1d3534['ok']?normalizeServiceTreeManifest(_0x386f02):undefined,'sourceHash':sha256(JSON['stringify'](_0x160877,null,0x2)+'\x0a'),'registryIndex':_0x13fb50,'registryServiceCode':_0x25be3d};});}function mergeValidationErrors(_0x4cbbb7,_0x10163f){const _0x2f36e7=a42_0x2ce158,_0x2a7aa9=_0x4cbbb7['errors'][_0x2f36e7(0xd7)](_0x5b028c=>_0x5b028c[_0x2f36e7(0x105)]===_0x2f36e7(0x118)?{..._0x5b028c,'message':_0x2f36e7(0xd9)}:_0x5b028c),_0x4bf534=[..._0x10163f,..._0x2a7aa9];return{'ok':_0x4bf534[_0x2f36e7(0xde)]===0x0,'errors':_0x4bf534,'warnings':_0x4cbbb7[_0x2f36e7(0x11c)]};}function aggregateValidationReports(_0x4c9183){const _0x56c2a6=a42_0x2ce158,_0x99262=_0x4c9183[_0x56c2a6(0xf0)](_0x88a655=>_0x88a655[_0x56c2a6(0x10a)]===undefined?_0x88a655['report']['errors']:_0x88a655[_0x56c2a6(0x111)]['errors'][_0x56c2a6(0xd7)](_0x2d85d5=>({..._0x2d85d5,'path':prefixRegistryIssuePath(_0x88a655[_0x56c2a6(0x10a)],_0x2d85d5[_0x56c2a6(0x108)])}))),_0x410c0e=_0x4c9183['flatMap'](_0x36214f=>_0x36214f['registryIndex']===undefined?_0x36214f[_0x56c2a6(0x111)]['warnings']:_0x36214f[_0x56c2a6(0x111)][_0x56c2a6(0x11c)][_0x56c2a6(0xd7)](_0x2c767f=>({..._0x2c767f,'path':prefixRegistryIssuePath(_0x36214f[_0x56c2a6(0x10a)],_0x2c767f[_0x56c2a6(0x108)])})));return{'ok':_0x99262[_0x56c2a6(0xde)]===0x0,'errors':_0x99262,'warnings':_0x410c0e};}function prefixRegistryIssuePath(_0x581366,_0x2b53d6){const _0x225bd5=a42_0x2ce158;if(_0x2b53d6==='$')return'$.services['+_0x581366+'].manifest';if(_0x2b53d6[_0x225bd5(0xfd)]('$.'))return _0x225bd5(0xef)+_0x581366+_0x225bd5(0x121)+_0x2b53d6[_0x225bd5(0xdb)](0x1);if(_0x2b53d6[_0x225bd5(0xfd)]('$['))return'$.services['+_0x581366+'].manifest'+_0x2b53d6[_0x225bd5(0xdb)](0x1);return'$.services['+_0x581366+_0x225bd5(0x11b)+_0x2b53d6;}function isServiceRegistryLike(_0xc5fda0){const _0x398010=a42_0x2ce158;return isObjectRecord(_0xc5fda0)&&_0xc5fda0[_0x398010(0x120)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array[_0x398010(0xf9)](_0xc5fda0['services']);}function isObjectRecord(_0x420e80){const _0x4ce663=a42_0x2ce158;return Boolean(_0x420e80)&&typeof _0x420e80===_0x4ce663(0x10c)&&!Array['isArray'](_0x420e80);}function emptyServiceRegistryInspection(_0x32d640,_0x404daa,_0x504f77){return{'registryPath':_0x32d640,'exists':_0x504f77,'status':_0x404daa,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function a42_0x1d3b(_0x5f1754,_0x4b9d06){_0x5f1754=_0x5f1754-0xd7;const _0x4dbfe9=a42_0x4dbf();let _0x1d3beb=_0x4dbfe9[_0x5f1754];return _0x1d3beb;}function summarizeLocalServiceEntry(_0x56e7c7){const _0x39ee19=a42_0x2ce158,_0x4d3d46=_0x56e7c7['normalizedManifest'],_0x53ab64=_0x4d3d46[_0x39ee19(0xf2)][_0x39ee19(0xd7)](_0x406b84=>({'path':_0x406b84['cliPath'],'description':_0x406b84[_0x39ee19(0xd8)],'risk':_0x406b84['risk'],'targetKind':_0x406b84[_0x39ee19(0x119)][_0x39ee19(0xff)],'targetCommand':_0x406b84['target']['command']}));return{'serviceCode':_0x56e7c7['serviceCode'],'name':_0x4d3d46[_0x39ee19(0xfe)][_0x39ee19(0x123)],'description':_0x4d3d46['service'][_0x39ee19(0xd8)],'version':_0x56e7c7[_0x39ee19(0x12d)],'importedAt':_0x56e7c7[_0x39ee19(0x12c)],'source':_0x56e7c7['source'],'commandCount':_0x53ab64[_0x39ee19(0xde)],'commands':_0x53ab64};}function sha256(_0x3557b8){const _0x17aa06=a42_0x2ce158;return createHash(_0x17aa06(0xfc))[_0x17aa06(0x116)](_0x3557b8)[_0x17aa06(0x114)](_0x17aa06(0x129));}
|
|
1
|
+
const a42_0x2e02ac=a42_0x380c;(function(_0x9be9cd,_0x383a40){const _0x1829dd=a42_0x380c,_0x5e6e59=_0x9be9cd();while(!![]){try{const _0x41173b=-parseInt(_0x1829dd(0x1a9))/0x1*(-parseInt(_0x1829dd(0x1c7))/0x2)+-parseInt(_0x1829dd(0x1ce))/0x3*(-parseInt(_0x1829dd(0x197))/0x4)+parseInt(_0x1829dd(0x191))/0x5+parseInt(_0x1829dd(0x1d5))/0x6+-parseInt(_0x1829dd(0x1a6))/0x7+parseInt(_0x1829dd(0x1a8))/0x8*(parseInt(_0x1829dd(0x1b6))/0x9)+-parseInt(_0x1829dd(0x195))/0xa;if(_0x41173b===_0x383a40)break;else _0x5e6e59['push'](_0x5e6e59['shift']());}catch(_0x216385){_0x5e6e59['push'](_0x5e6e59['shift']());}}}(a42_0x4506,0x79101));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;function a42_0x4506(){const _0x1a2b0d=['validation','1734147ZLoreP','findIndex','risk','sourceHash','stringify','$.services[','Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.','trim','manifests','utf8','homeDir','Service\x20manifest\x20file\x20not\x20found:\x20','errors','bff\x20target\x20requires\x20functionName.','slice','push','startsWith','8820XfiEep','homeDirName','digest','parse','splice','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','map','45828hOzaHI','.tmp','normalizedManifest','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','Invalid\x20service\x20registry\x20JSON:\x20','].manifest','1799364mvgQYA','find','now','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','flatMap','version','name','2298375krcQOF','serviceCode','warnings','manifest','26426330cBLnEN','registryIndex','228QFNtZw','report','services','path','kind','registry','code','schemaVersion','target','commandCount','cliPath','file','Invalid\x20service\x20manifest\x20JSON:\x20','invalid','message','1412999KmOtcT','isArray','32Xuruzr','213sBnQHc','length','ENOENT','service','CliError','updatedAt','missing','source','empty','service.json','importedAt','reduce'];a42_0x4506=function(){return _0x1a2b0d;};return a42_0x4506();}export const SERVICE_REGISTRY_FILE_NAME=a42_0x2e02ac(0x1b2);export function getServiceRegistryPath(_0x4f7a11={}){const _0x2e9d95=a42_0x2e02ac;return resolve(_0x4f7a11[_0x2e9d95(0x1c0)]??homedir(),PRODUCT_CONFIG[_0x2e9d95(0x1c8)],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x5a1415={}){const _0x170088=a42_0x2e02ac,_0x2d3595=getServiceRegistryPath(_0x5a1415);if(!existsSync(_0x2d3595))return emptyServiceRegistry();try{const _0x499f05=readFileSync(_0x2d3595,_0x170088(0x1bf));if(!_0x499f05['trim']())return emptyServiceRegistry();const _0x41526a=JSON['parse'](_0x499f05);if(_0x41526a['schemaVersion']!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors[_0x170088(0x1b5)]('Unsupported\x20service\x20registry\x20schemaVersion:\x20'+String(_0x41526a[_0x170088(0x19e)]),'Remove\x20or\x20migrate\x20'+_0x2d3595+'.');if(!Array['isArray'](_0x41526a[_0x170088(0x199)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x41526a[_0x170088(0x1ae)],'services':_0x41526a[_0x170088(0x199)]};}catch(_0x263fd3){if(_0x263fd3 instanceof Error&&_0x263fd3['name']===_0x170088(0x1ad))throw _0x263fd3;throw CliErrors[_0x170088(0x1b5)](_0x170088(0x1d3)+_0x2d3595,_0x170088(0x1cc));}}function a42_0x380c(_0x1f9dbb,_0x28fdd4){_0x1f9dbb=_0x1f9dbb-0x18c;const _0x450688=a42_0x4506();let _0x380cfd=_0x450688[_0x1f9dbb];return _0x380cfd;}export function writeServiceRegistry(_0x2edfe6,_0x541e78={}){const _0x285377=a42_0x2e02ac,_0x48de70=getServiceRegistryPath(_0x541e78),_0x5cf14c=dirname(_0x48de70);!existsSync(_0x5cf14c)&&mkdirSync(_0x5cf14c,{'recursive':!![]});const _0x27be7b=_0x48de70+_0x285377(0x1cf);try{writeFileSync(_0x27be7b,JSON[_0x285377(0x1ba)](_0x2edfe6,null,0x2)+'\x0a',{'encoding':'utf8','mode':0x180}),renameSync(_0x27be7b,_0x48de70);}catch(_0x363370){try{unlinkSync(_0x27be7b);}catch{}if(_0x363370?.[_0x285377(0x19d)]===_0x285377(0x1ab))throw CliErrors[_0x285377(0x1b5)]('Cannot\x20write\x20service\x20registry:\x20'+_0x48de70);throw _0x363370;}return _0x48de70;}export function loadServiceManifestFromFile(_0x2ce2e0){const _0x4ef886=a42_0x2e02ac,_0x3061e9=resolve(_0x2ce2e0);if(!existsSync(_0x3061e9))throw CliErrors[_0x4ef886(0x1b5)](_0x4ef886(0x1c1)+_0x2ce2e0);let _0x8ad2e0;const _0x1badf8=readFileSync(_0x3061e9,_0x4ef886(0x1bf));try{_0x8ad2e0=JSON[_0x4ef886(0x1ca)](_0x1badf8);}catch{throw CliErrors[_0x4ef886(0x1b5)](_0x4ef886(0x1a3)+_0x2ce2e0,_0x4ef886(0x18d));}const _0x104380=sha256(_0x1badf8),_0x605da=extractLoadedServiceManifests(_0x8ad2e0,_0x104380),_0x14c2e9=aggregateValidationReports(_0x605da),_0x14ee53=_0x605da[0x0];return{'filePath':_0x3061e9,'hash':_0x104380,'kind':isServiceRegistryLike(_0x8ad2e0)?_0x4ef886(0x19c):_0x4ef886(0x194),'manifest':_0x14ee53?.['manifest']??_0x8ad2e0,'report':_0x14c2e9,'normalizedManifest':_0x605da[_0x4ef886(0x1aa)]===0x1?_0x14ee53?.[_0x4ef886(0x1d0)]:undefined,'manifests':_0x605da};}export function importServiceManifest(_0x5e9954,_0x104543={}){const _0xcb4b25=a42_0x2e02ac,_0x2c65da=loadServiceManifestFromFile(_0x5e9954);if(!_0x2c65da[_0xcb4b25(0x198)]['ok'])throw CliErrors['validation'](formatValidationFailure(_0x2c65da[_0xcb4b25(0x198)]),_0xcb4b25(0x1bc));if(_0x2c65da[_0xcb4b25(0x1be)]['length']===0x0)throw CliErrors[_0xcb4b25(0x1b5)](_0xcb4b25(0x1d2),'Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.');const _0x329c41=readServiceRegistry(_0x104543),_0x50c30b=(_0x104543[_0xcb4b25(0x18c)]??(()=>new Date()))()['toISOString'](),_0x30e30f=[];let _0x32e3aa=0x0,_0x6a1e94=0x0;for(const _0x326321 of _0x2c65da[_0xcb4b25(0x1be)]){if(!_0x326321[_0xcb4b25(0x1d0)])continue;const _0x515b77=_0x326321[_0xcb4b25(0x1d0)][_0xcb4b25(0x1ac)]['code'],_0x510b35={'serviceCode':_0x515b77,'version':_0x326321[_0xcb4b25(0x1d0)][_0xcb4b25(0x18f)],'importedAt':_0x50c30b,'source':{'type':_0xcb4b25(0x1a2),'path':_0x2c65da['filePath'],'hash':_0x326321[_0xcb4b25(0x1b9)]},'manifest':_0x326321[_0xcb4b25(0x194)],'normalizedManifest':_0x326321[_0xcb4b25(0x1d0)]},_0x1db50e=_0x329c41[_0xcb4b25(0x199)]['findIndex'](_0x36817d=>_0x36817d[_0xcb4b25(0x192)]===_0x515b77);_0x1db50e>=0x0?(_0x329c41[_0xcb4b25(0x199)][_0x1db50e]=_0x510b35,_0x6a1e94++):(_0x329c41[_0xcb4b25(0x199)][_0xcb4b25(0x1c5)](_0x510b35),_0x32e3aa++),_0x30e30f[_0xcb4b25(0x1c5)](_0x510b35);}_0x329c41[_0xcb4b25(0x199)]['sort']((_0x292eba,_0x540cde)=>_0x292eba[_0xcb4b25(0x192)]['localeCompare'](_0x540cde[_0xcb4b25(0x192)])),_0x329c41[_0xcb4b25(0x1ae)]=_0x50c30b;const _0x18c85e=writeServiceRegistry(_0x329c41,_0x104543);return{'registryPath':_0x18c85e,'entry':_0x30e30f[0x0],'replaced':_0x30e30f[_0xcb4b25(0x1aa)]===0x1?_0x6a1e94===0x1:_0x6a1e94>0x0,'entries':_0x30e30f,'imported':_0x32e3aa,'updated':_0x6a1e94,'serviceCount':_0x329c41[_0xcb4b25(0x199)]['length']};}export function exportServiceManifest(_0x17639a,_0x2865a4,_0x3217eb={}){const _0x4af334=a42_0x2e02ac,_0x2b7e90=getServiceRegistryPath(_0x3217eb),_0x37a701=getLocalServiceEntry(_0x17639a,_0x3217eb);if(!_0x37a701)throw CliErrors[_0x4af334(0x1b5)]('Local\x20service\x20not\x20found:\x20'+_0x17639a,_0x4af334(0x1d1));const _0x144671=resolve(_0x2865a4),_0x5c263e=dirname(_0x144671);return!existsSync(_0x5c263e)&&mkdirSync(_0x5c263e,{'recursive':!![]}),writeFileSync(_0x144671,JSON[_0x4af334(0x1ba)](_0x37a701[_0x4af334(0x194)],null,0x2)+'\x0a',{'encoding':_0x4af334(0x1bf),'mode':0x180}),{'registryPath':_0x2b7e90,'filePath':_0x144671,'entry':_0x37a701};}export function removeServiceManifest(_0x6847d7,_0x557f87={}){const _0x2d2804=a42_0x2e02ac,_0x3bb4b0=readServiceRegistry(_0x557f87),_0x3cf676=_0x6847d7[_0x2d2804(0x1bd)](),_0x1e78a6=_0x3bb4b0[_0x2d2804(0x199)][_0x2d2804(0x1b7)](_0x1fe6d1=>_0x1fe6d1[_0x2d2804(0x192)]===_0x3cf676);if(_0x1e78a6<0x0)throw CliErrors[_0x2d2804(0x1b5)]('Local\x20service\x20not\x20found:\x20'+_0x3cf676,_0x2d2804(0x1d1));const [_0x2c045b]=_0x3bb4b0['services'][_0x2d2804(0x1cb)](_0x1e78a6,0x1),_0x385d26=(_0x557f87['now']??(()=>new Date()))()['toISOString']();_0x3bb4b0['updatedAt']=_0x385d26;const _0x1d985e=writeServiceRegistry(_0x3bb4b0,_0x557f87);return{'registryPath':_0x1d985e,'entry':_0x2c045b,'serviceCount':_0x3bb4b0['services']['length']};}export function listLocalServices(_0x1e4d22={}){const _0x2a4312=a42_0x2e02ac;return readServiceRegistry(_0x1e4d22)[_0x2a4312(0x199)];}export function getLocalServiceEntry(_0x32f80f,_0x2489ed={}){const _0xc05cad=a42_0x2e02ac;return readServiceRegistry(_0x2489ed)['services'][_0xc05cad(0x1d6)](_0x479bca=>_0x479bca[_0xc05cad(0x192)]===_0x32f80f[_0xc05cad(0x1bd)]());}export function listLocalServiceTrees(_0x4824ee={}){const _0x460ae5=a42_0x2e02ac;return readServiceRegistry(_0x4824ee)[_0x460ae5(0x199)][_0x460ae5(0x1cd)](_0x337386=>_0x337386[_0x460ae5(0x1d0)]);}export function inspectServiceRegistry(_0x54703b={}){const _0x48c0dc=a42_0x2e02ac,_0x349a23=getServiceRegistryPath(_0x54703b);if(!existsSync(_0x349a23))return emptyServiceRegistryInspection(_0x349a23,_0x48c0dc(0x1af),![]);try{const _0x255a5f=readFileSync(_0x349a23,'utf8');if(!_0x255a5f[_0x48c0dc(0x1bd)]())return emptyServiceRegistryInspection(_0x349a23,_0x48c0dc(0x1b1),!![]);const _0x476695=JSON['parse'](_0x255a5f);if(_0x476695[_0x48c0dc(0x19e)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x349a23,_0x48c0dc(0x1a4),!![]),'schemaVersion':_0x476695[_0x48c0dc(0x19e)],'message':'Unsupported\x20schemaVersion:\x20'+String(_0x476695[_0x48c0dc(0x19e)])};if(!Array[_0x48c0dc(0x1a7)](_0x476695[_0x48c0dc(0x199)]))return{...emptyServiceRegistryInspection(_0x349a23,'invalid',!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x476695['updatedAt'],'message':'services\x20must\x20be\x20an\x20array'};const _0x119a14=_0x476695[_0x48c0dc(0x199)][_0x48c0dc(0x1cd)](summarizeLocalServiceEntry);return{'registryPath':_0x349a23,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x476695[_0x48c0dc(0x1ae)],'serviceCount':_0x119a14[_0x48c0dc(0x1aa)],'commandCount':_0x119a14[_0x48c0dc(0x1b4)]((_0x334a18,_0x177d77)=>_0x334a18+_0x177d77[_0x48c0dc(0x1a0)],0x0),'services':_0x119a14};}catch(_0x5203d0){return{...emptyServiceRegistryInspection(_0x349a23,_0x48c0dc(0x1a4),!![]),'message':_0x5203d0 instanceof Error?_0x5203d0[_0x48c0dc(0x1a5)]:String(_0x5203d0)};}}export function formatValidationFailure(_0x3bf0f0){const _0x34786e=a42_0x2e02ac,_0x1216d3=_0x3bf0f0[_0x34786e(0x1c2)][_0x34786e(0x1cd)](_0x50b990=>_0x50b990[_0x34786e(0x19a)]+':\x20'+_0x50b990[_0x34786e(0x1a5)]);return'Service\x20manifest\x20validation\x20failed:\x0a'+_0x1216d3['join']('\x0a');}function extractLoadedServiceManifests(_0x2a4d57,_0x1c91aa){const _0x53f1b9=a42_0x2e02ac;if(!isServiceRegistryLike(_0x2a4d57)){const _0x29ec15=_0x2a4d57,{manifest:_0x2c0c96,errors:_0x259722}=adaptServiceTreeManifestForLegacyFramework(_0x29ec15),_0x4f83b5=validateServiceTreeManifest(_0x2c0c96),_0x21d593=mergeValidationErrors(_0x4f83b5,_0x259722);return[{'manifest':_0x29ec15,'report':_0x21d593,'normalizedManifest':_0x21d593['ok']?normalizeServiceTreeManifest(_0x2c0c96):undefined,'sourceHash':_0x1c91aa}];}return _0x2a4d57[_0x53f1b9(0x199)][_0x53f1b9(0x1cd)]((_0x366098,_0x2a17ff)=>{const _0x2e0e34=_0x53f1b9,_0x589efa=isObjectRecord(_0x366098)?_0x366098[_0x2e0e34(0x194)]:undefined,{manifest:_0x5fad1c,errors:_0x16235c}=adaptServiceTreeManifestForLegacyFramework(_0x589efa),_0x11d149=validateServiceTreeManifest(_0x5fad1c),_0xc1effa=mergeValidationErrors(_0x11d149,_0x16235c),_0x383774=isObjectRecord(_0x366098)&&typeof _0x366098[_0x2e0e34(0x192)]==='string'?_0x366098[_0x2e0e34(0x192)]:undefined;return{'manifest':_0x589efa,'report':_0xc1effa,'normalizedManifest':_0xc1effa['ok']?normalizeServiceTreeManifest(_0x5fad1c):undefined,'sourceHash':sha256(JSON[_0x2e0e34(0x1ba)](_0x589efa,null,0x2)+'\x0a'),'registryIndex':_0x2a17ff,'registryServiceCode':_0x383774};});}function mergeValidationErrors(_0x3606db,_0x1527f7){const _0x42b4c2=a42_0x2e02ac,_0x1fa30c=_0x3606db[_0x42b4c2(0x1c2)]['map'](_0x1016cd=>_0x1016cd[_0x42b4c2(0x1a5)]==='bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.'?{..._0x1016cd,'message':_0x42b4c2(0x1c3)}:_0x1016cd),_0x513ddd=[..._0x1527f7,..._0x1fa30c];return{'ok':_0x513ddd[_0x42b4c2(0x1aa)]===0x0,'errors':_0x513ddd,'warnings':_0x3606db[_0x42b4c2(0x193)]};}function aggregateValidationReports(_0x5cfaa1){const _0x229011=a42_0x2e02ac,_0x18da32=_0x5cfaa1[_0x229011(0x18e)](_0x365216=>_0x365216[_0x229011(0x196)]===undefined?_0x365216[_0x229011(0x198)][_0x229011(0x1c2)]:_0x365216[_0x229011(0x198)][_0x229011(0x1c2)][_0x229011(0x1cd)](_0x10074a=>({..._0x10074a,'path':prefixRegistryIssuePath(_0x365216[_0x229011(0x196)],_0x10074a[_0x229011(0x19a)])}))),_0x17385f=_0x5cfaa1['flatMap'](_0x43e908=>_0x43e908[_0x229011(0x196)]===undefined?_0x43e908[_0x229011(0x198)][_0x229011(0x193)]:_0x43e908[_0x229011(0x198)][_0x229011(0x193)][_0x229011(0x1cd)](_0x127cf1=>({..._0x127cf1,'path':prefixRegistryIssuePath(_0x43e908[_0x229011(0x196)],_0x127cf1[_0x229011(0x19a)])})));return{'ok':_0x18da32[_0x229011(0x1aa)]===0x0,'errors':_0x18da32,'warnings':_0x17385f};}function prefixRegistryIssuePath(_0x2db357,_0x30fb5b){const _0x26f701=a42_0x2e02ac;if(_0x30fb5b==='$')return _0x26f701(0x1bb)+_0x2db357+_0x26f701(0x1d4);if(_0x30fb5b[_0x26f701(0x1c6)]('$.'))return _0x26f701(0x1bb)+_0x2db357+_0x26f701(0x1d4)+_0x30fb5b[_0x26f701(0x1c4)](0x1);if(_0x30fb5b[_0x26f701(0x1c6)]('$['))return'$.services['+_0x2db357+_0x26f701(0x1d4)+_0x30fb5b[_0x26f701(0x1c4)](0x1);return _0x26f701(0x1bb)+_0x2db357+'].manifest.'+_0x30fb5b;}function isServiceRegistryLike(_0xfbf828){const _0x314b77=a42_0x2e02ac;return isObjectRecord(_0xfbf828)&&_0xfbf828['schemaVersion']===SERVICE_REGISTRY_SCHEMA_VERSION&&Array['isArray'](_0xfbf828[_0x314b77(0x199)]);}function isObjectRecord(_0x10f8ca){const _0x355389=a42_0x2e02ac;return Boolean(_0x10f8ca)&&typeof _0x10f8ca==='object'&&!Array[_0x355389(0x1a7)](_0x10f8ca);}function emptyServiceRegistryInspection(_0x598029,_0x66d6ff,_0x3d49d6){return{'registryPath':_0x598029,'exists':_0x3d49d6,'status':_0x66d6ff,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0x31d5e6){const _0xcfcc72=a42_0x2e02ac,_0x11a834=_0x31d5e6['normalizedManifest'],_0x1204ff=_0x11a834['commands'][_0xcfcc72(0x1cd)](_0x3aa67a=>({'path':_0x3aa67a[_0xcfcc72(0x1a1)],'description':_0x3aa67a['description'],'risk':_0x3aa67a[_0xcfcc72(0x1b8)],'targetKind':_0x3aa67a[_0xcfcc72(0x19f)][_0xcfcc72(0x19b)],'targetCommand':_0x3aa67a[_0xcfcc72(0x19f)]['command']}));return{'serviceCode':_0x31d5e6[_0xcfcc72(0x192)],'name':_0x11a834['service'][_0xcfcc72(0x190)],'description':_0x11a834[_0xcfcc72(0x1ac)]['description'],'version':_0x31d5e6['version'],'importedAt':_0x31d5e6[_0xcfcc72(0x1b3)],'source':_0x31d5e6[_0xcfcc72(0x1b0)],'commandCount':_0x1204ff[_0xcfcc72(0x1aa)],'commands':_0x1204ff};}function sha256(_0x4ad57e){const _0x2fff01=a42_0x2e02ac;return createHash('sha256')['update'](_0x4ad57e)[_0x2fff01(0x1c9)]('hex');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a43_0x116bb1=a43_0xa499;(function(_0x1737b4,_0xec081a){const _0x28faa5=a43_0xa499,_0x27149a=_0x1737b4();while(!![]){try{const _0x2cefb1=-parseInt(_0x28faa5(0x96))/0x1*(-parseInt(_0x28faa5(0x76))/0x2)+parseInt(_0x28faa5(0x7b))/0x3*(parseInt(_0x28faa5(0x91))/0x4)+-parseInt(_0x28faa5(0x95))/0x5*(parseInt(_0x28faa5(0x77))/0x6)+-parseInt(_0x28faa5(0x79))/0x7*(parseInt(_0x28faa5(0x8c))/0x8)+parseInt(_0x28faa5(0x74))/0x9+-parseInt(_0x28faa5(0x73))/0xa+parseInt(_0x28faa5(0x78))/0xb*(parseInt(_0x28faa5(0x90))/0xc);if(_0x2cefb1===_0xec081a)break;else _0x27149a['push'](_0x27149a['shift']());}catch(_0x1cfe86){_0x27149a['push'](_0x27149a['shift']());}}}(a43_0x1d0e,0x8e14a));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';function a43_0xa499(_0x173992,_0x3d3aad){_0x173992=_0x173992-0x73;const _0x1d0ee0=a43_0x1d0e();let _0xa499f4=_0x1d0ee0[_0x173992];return _0xa499f4;}function a43_0x1d0e(){const _0xa71cd3=['9211347cbFEaW','Created\x20local\x20Skill\x20draft\x20','510huSWRD','42aKOYYR','99AFSgZD','175WmRGlF','files','1000050ysyFUe','read','map','path','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','rendered','name','skill','content','create','Refusing\x20to\x20overwrite\x20symlink:\x20','target','skillName','type','skillDir','str','validation','339656WyjMLS','Skill\x20directory\x20already\x20exists:\x20','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','isSymbolicLink','1101444HXxcrp','4KpcdAt','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','trim','bool','210245fxNydq','13EsiqLd','2485010beiYqF'];a43_0x1d0e=function(){return _0xa71cd3;};return a43_0x1d0e();}export const createCommand={'service':a43_0x116bb1(0x82),'command':a43_0x116bb1(0x84),'description':'创建本地自包含的运行态\x20Skill\x20草稿','risk':a43_0x116bb1(0x7c),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0xd7865){const _0x1adce8=a43_0x116bb1,_0xad0c9d=buildSkillCreatePlan(_0xd7865[_0x1adce8(0x8a)](_0x1adce8(0x81)),_0xd7865[_0x1adce8(0x8a)](_0x1adce8(0x88)),_0xd7865['str'](_0x1adce8(0x86)));return{'method':'WRITE','url':_0xad0c9d[_0x1adce8(0x89)],'body':{'skillName':_0xad0c9d[_0x1adce8(0x80)][_0x1adce8(0x87)],'type':_0xad0c9d[_0x1adce8(0x80)][_0x1adce8(0x88)],'selfContained':!![],'files':_0xad0c9d[_0x1adce8(0x80)]['files'][_0x1adce8(0x7d)](_0x1c54b3=>_0x1c54b3[_0x1adce8(0x7e)])},'description':_0x1adce8(0x92)};},async 'execute'(_0x1effbd){const _0x4a9e5d=a43_0x116bb1,_0x1e8861=buildSkillCreatePlan(_0x1effbd[_0x4a9e5d(0x8a)](_0x4a9e5d(0x81)),_0x1effbd[_0x4a9e5d(0x8a)](_0x4a9e5d(0x88)),_0x1effbd[_0x4a9e5d(0x8a)](_0x4a9e5d(0x86)));return writeSkillDraft(_0x1e8861,_0x1effbd[_0x4a9e5d(0x94)]('force')),{'ok':!![],'data':{'skillName':_0x1e8861[_0x4a9e5d(0x80)][_0x4a9e5d(0x87)],'type':_0x1e8861[_0x4a9e5d(0x80)][_0x4a9e5d(0x88)],'dir':_0x1e8861['skillDir'],'files':_0x1e8861[_0x4a9e5d(0x80)][_0x4a9e5d(0x7a)][_0x4a9e5d(0x7d)](_0xf82cf5=>_0xf82cf5['path'])},'message':_0x4a9e5d(0x75)+_0x1e8861[_0x4a9e5d(0x80)][_0x4a9e5d(0x87)]};}};function buildSkillCreatePlan(_0x28c57c,_0x21854,_0x106da7){const _0x5ce367=a43_0x116bb1,_0x204346=_0x21854[_0x5ce367(0x93)](),_0x1d8ca5=renderSkillTemplate({'skillName':_0x28c57c,'type':_0x204346});!_0x204346&&writeCliSideChannelLine(_0x5ce367(0x7f));const _0x4310e7=resolve(normalizeSkillTarget(_0x106da7));return{'rendered':_0x1d8ca5,'targetRoot':_0x4310e7,'skillDir':resolve(_0x4310e7,_0x1d8ca5['skillName'])};}function normalizeSkillTarget(_0x54fd99){const _0x599e33=a43_0x116bb1;return(_0x54fd99||DEFAULT_SKILL_TARGET)[_0x599e33(0x93)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x44b451,_0x45b9dc){const _0x1349fc=a43_0x116bb1;if(existsSync(_0x44b451[_0x1349fc(0x89)])){const _0xe898da=lstatSync(_0x44b451[_0x1349fc(0x89)]);if(!_0xe898da['isDirectory']()||_0xe898da[_0x1349fc(0x8f)]())throw CliErrors[_0x1349fc(0x8b)]('Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20'+_0x44b451[_0x1349fc(0x89)]);if(!_0x45b9dc)throw CliErrors[_0x1349fc(0x8b)](_0x1349fc(0x8d)+_0x44b451[_0x1349fc(0x89)],_0x1349fc(0x8e));}for(const _0x16ff74 of _0x44b451[_0x1349fc(0x80)][_0x1349fc(0x7a)]){const _0x4d10ea=resolve(_0x44b451[_0x1349fc(0x89)],_0x16ff74['path']),_0x543932=dirname(_0x4d10ea);mkdirSync(_0x543932,{'recursive':!![]});if(existsSync(_0x4d10ea)&&lstatSync(_0x4d10ea)['isSymbolicLink']())throw CliErrors[_0x1349fc(0x8b)](_0x1349fc(0x85)+_0x4d10ea);writeFileSync(_0x4d10ea,_0x16ff74[_0x1349fc(0x83)],'utf8');}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0x3bdfbd=a44_0x566d;(function(_0x1a769e,_0x1d1964){const _0x3666b7=a44_0x566d,_0x45205c=_0x1a769e();while(!![]){try{const _0x449460=-parseInt(_0x3666b7(0x1b7))/0x1+-parseInt(_0x3666b7(0x1b9))/0x2*(parseInt(_0x3666b7(0x1c0))/0x3)+-parseInt(_0x3666b7(0x1ca))/0x4+-parseInt(_0x3666b7(0x1c9))/0x5*(parseInt(_0x3666b7(0x1dc))/0x6)+-parseInt(_0x3666b7(0x1b3))/0x7*(-parseInt(_0x3666b7(0x1db))/0x8)+parseInt(_0x3666b7(0x1c8))/0x9+parseInt(_0x3666b7(0x1b2))/0xa;if(_0x449460===_0x1d1964)break;else _0x45205c['push'](_0x45205c['shift']());}catch(_0x42a1cc){_0x45205c['push'](_0x45205c['shift']());}}}(a44_0x118f,0x1c5c8));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';import{DIAGRAM_FILE_FLAG,DIAGRAM_SCOPE_FLAG,DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,SOURCE_FINGERPRINT_FLAG}from'../flags.js';const TARGET_FLAGS=[DIAGRAM_SKILL_CODE_FLAG,DIAGRAM_VERSION_FLAG,DIAGRAM_SCOPE_FLAG],WRITE_FLAGS=[...TARGET_FLAGS,SOURCE_FINGERPRINT_FLAG,EXPECTED_DIAGRAM_REVISION_FLAG,DIAGRAM_FILE_FLAG];function readDiagramTarget(_0x2fb83f){const _0x532d22=a44_0x566d,_0x5db867=_0x2fb83f[_0x532d22(0x1d2)](_0x532d22(0x1d6))[_0x532d22(0x1c2)](),_0x138499=_0x2fb83f[_0x532d22(0x1d2)](_0x532d22(0x1cf))[_0x532d22(0x1c2)](),_0x1cf01c=_0x2fb83f[_0x532d22(0x1d2)]('scope');if(!_0x5db867||!_0x138499||_0x1cf01c!==_0x532d22(0x1dd)&&_0x1cf01c!==_0x532d22(0x1be))throw CliErrors[_0x532d22(0x1ba)](_0x532d22(0x1cd));return{'skillCode':_0x5db867,'version':_0x138499,'scope':_0x1cf01c};}async function readDiagramWriteInput(_0x1ff4d8){const _0x4b9093=a44_0x566d,_0x16bcb8=_0x1ff4d8['num'](_0x4b9093(0x1b8)),_0x3a4bb6=_0x1ff4d8[_0x4b9093(0x1d2)](_0x4b9093(0x1c6))[_0x4b9093(0x1c2)]();if(!Number['isInteger'](_0x16bcb8)||_0x16bcb8<0x0)throw CliErrors[_0x4b9093(0x1ba)](_0x4b9093(0x1d0));if(!/^sha256:[0-9a-f]{64}$/['test'](_0x3a4bb6))throw CliErrors[_0x4b9093(0x1ba)](_0x4b9093(0x1d4));return{'expectedDiagramRevision':_0x16bcb8,'sourceFingerprint':_0x3a4bb6,'diagram':await readRequiredSkillDiagram(_0x1ff4d8[_0x4b9093(0x1d2)](_0x4b9093(0x1d7)))};}function a44_0x118f(){const _0x10b4b4=['Skill\x20diagram\x20for\x20','Updated','5817570iVllpF','644suVyWA','为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','diagram-validate','appCode','217199XlugCI','expected-diagram-revision','2odGxcV','validation','\x20is\x20unchanged.','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20',';\x20next\x20write\x20expects\x20revision\x20','company','created','517623vkonfD','scope','trim','unchanged','diagram-push','skill','source-fingerprint','Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','437130mgiSps','100335IrSMmf','673448YPUeii','将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。','\x20Skill\x20diagram\x20for\x20','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','skillCode','version','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.','found','str','Created','--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','skill-code','diagram-file',';\x20first\x20write\x20expects\x20revision\x20','diagram-show','read','9056TYnYKN','18IHCgIm','personal'];a44_0x118f=function(){return _0x10b4b4;};return a44_0x118f();}export const diagramValidateCommand={'service':a44_0x3bdfbd(0x1c5),'command':a44_0x3bdfbd(0x1b5),'description':a44_0x3bdfbd(0x1d5),'risk':'read','flags':WRITE_FLAGS,async 'execute'(_0x5e5a35){const _0x3782f2=a44_0x3bdfbd,_0x4e48be=readDiagramTarget(_0x5e5a35),_0x316cc0=await validateRuntimeSkillVersionDiagram(_0x5e5a35[_0x3782f2(0x1b6)],_0x4e48be[_0x3782f2(0x1ce)],_0x4e48be[_0x3782f2(0x1cf)],_0x4e48be[_0x3782f2(0x1c1)],await readDiagramWriteInput(_0x5e5a35));return{'ok':!![],'data':_0x316cc0,'message':'Skill\x20diagram\x20validation\x20passed\x20for\x20'+_0x4e48be['skillCode']+'@'+_0x4e48be[_0x3782f2(0x1cf)]+'.'};}};export const diagramPushCommand={'service':a44_0x3bdfbd(0x1c5),'command':a44_0x3bdfbd(0x1c4),'description':a44_0x3bdfbd(0x1b4),'risk':'write','confirmationDescription':a44_0x3bdfbd(0x1cb),'flags':WRITE_FLAGS,async 'execute'(_0x210cdf){const _0x3895d9=a44_0x3bdfbd,_0x57e760=readDiagramTarget(_0x210cdf),_0x557ae9=await putRuntimeSkillVersionDiagram(_0x210cdf[_0x3895d9(0x1b6)],_0x57e760[_0x3895d9(0x1ce)],_0x57e760[_0x3895d9(0x1cf)],_0x57e760[_0x3895d9(0x1c1)],await readDiagramWriteInput(_0x210cdf));return{'ok':!![],'data':_0x557ae9,'message':_0x557ae9['action']===_0x3895d9(0x1c3)?_0x3895d9(0x1b0)+_0x57e760[_0x3895d9(0x1ce)]+'@'+_0x57e760['version']+_0x3895d9(0x1bb):(_0x557ae9['action']===_0x3895d9(0x1bf)?_0x3895d9(0x1d3):_0x3895d9(0x1b1))+_0x3895d9(0x1cc)+_0x57e760[_0x3895d9(0x1ce)]+'@'+_0x57e760['version']+'.'};}};function a44_0x566d(_0xba8993,_0x305424){_0xba8993=_0xba8993-0x1b0;const _0x118f63=a44_0x118f();let _0x566d80=_0x118f63[_0xba8993];return _0x566d80;}export const diagramShowCommand={'service':a44_0x3bdfbd(0x1c5),'command':a44_0x3bdfbd(0x1d9),'description':a44_0x3bdfbd(0x1c7),'risk':a44_0x3bdfbd(0x1da),'flags':TARGET_FLAGS,async 'execute'(_0x42e637){const _0x5f05fb=a44_0x3bdfbd,_0xb92749=readDiagramTarget(_0x42e637),_0x5e3ffd=await getRuntimeSkillVersionDiagram(_0x42e637[_0x5f05fb(0x1b6)],_0xb92749[_0x5f05fb(0x1ce)],_0xb92749[_0x5f05fb(0x1cf)],_0xb92749[_0x5f05fb(0x1c1)]);return{'ok':!![],'data':_0x5e3ffd,'message':_0x5e3ffd[_0x5f05fb(0x1d1)]?'Found\x20Skill\x20diagram\x20for\x20'+_0xb92749['skillCode']+'@'+_0xb92749[_0x5f05fb(0x1cf)]+_0x5f05fb(0x1bd)+_0x5e3ffd['expectedDiagramRevision']+'.':_0x5f05fb(0x1bc)+_0xb92749[_0x5f05fb(0x1ce)]+'@'+_0xb92749['version']+_0x5f05fb(0x1d8)+_0x5e3ffd['expectedDiagramRevision']+'.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a45_0x4d8df2=a45_0x2e84;(function(_0x4d9eef,_0x100299){const _0x531ecf=a45_0x2e84,_0x35e9f6=_0x4d9eef();while(!![]){try{const _0x21d52a=parseInt(_0x531ecf(0x105))/0x1*(parseInt(_0x531ecf(0x10c))/0x2)+-parseInt(_0x531ecf(0xed))/0x3+-parseInt(_0x531ecf(0x103))/0x4*(parseInt(_0x531ecf(0x10f))/0x5)+-parseInt(_0x531ecf(0xfc))/0x6+-parseInt(_0x531ecf(0xfa))/0x7+parseInt(_0x531ecf(0x101))/0x8*(parseInt(_0x531ecf(0xf9))/0x9)+parseInt(_0x531ecf(0xee))/0xa;if(_0x21d52a===_0x100299)break;else _0x35e9f6['push'](_0x35e9f6['shift']());}catch(_0x3dfb56){_0x35e9f6['push'](_0x35e9f6['shift']());}}}(a45_0x2f5c,0x19aed));import{CliErrors}from'../../../errors.js';function a45_0x2e84(_0x503f95,_0x33346b){_0x503f95=_0x503f95-0xe9;const _0x2f5c40=a45_0x2f5c();let _0x2e842e=_0x2f5c40[_0x503f95];return _0x2e842e;}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_0x4d8df2(0x10b),'command':a45_0x4d8df2(0xfb),'description':a45_0x4d8df2(0x107),'risk':a45_0x4d8df2(0x102),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x2d74f5){return syncRuntimeSkills(_0x2d74f5);}};async function syncRuntimeSkills(_0x33bb92){const _0x2caf01=a45_0x4d8df2,{downloadRuntimeSkillPackage:_0x40c6d5,listRuntimeSkills:_0x64699b}=await import('../../../core/api-client.js'),{linkEffectiveRuntimeSkills:_0x2666e0,materializeRuntimeSkill:_0x931557,pruneStaleRuntimeSkillCache:_0x3f9d0c,pruneStaleRuntimeSkillLinks:_0x559c55,resolveRuntimeSkillInstallTarget:_0x1af8eb}=await import(_0x2caf01(0xf5)),_0x22a02c=_0x33bb92[_0x2caf01(0xea)]('code'),_0x40359b=normalizeSyncScopes(_0x33bb92[_0x2caf01(0xea)](_0x2caf01(0xf7))),_0x5de488=_0x33bb92[_0x2caf01(0xf4)]??_0x2caf01(0x108),_0x51ef08=_0x33bb92[_0x2caf01(0xf6)],_0x14fecf=_0x33bb92[_0x2caf01(0xf1)]('force');if(!_0x51ef08)throw CliErrors[_0x2caf01(0xf8)]('Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.');const _0x3aea6b=_0x1af8eb(_0x33bb92[_0x2caf01(0xfd)],_0x33bb92[_0x2caf01(0xf1)](_0x2caf01(0x111))?_0x2caf01(0x111):_0x2caf01(0xfe)),_0x1cf2c2=_0x1af8eb(_0x33bb92[_0x2caf01(0xfd)],_0x3aea6b[_0x2caf01(0xf7)]===_0x2caf01(0x111)?_0x2caf01(0xfe):_0x2caf01(0x111)),_0x14e7fb=await Promise[_0x2caf01(0xf2)](_0x40359b['map'](_0xef2259=>_0x64699b({'appCode':_0x33bb92[_0x2caf01(0xfd)],'scope':_0xef2259,'code':_0x22a02c[_0x2caf01(0xeb)]()||undefined}))),_0x32d966=_0x40359b[_0x2caf01(0xe9)](_0x2caf01(0xec))?_0x14e7fb[_0x2caf01(0xf0)]((_0x4cb7e6,_0x2e41a1)=>_0x40359b[_0x2e41a1]===_0x2caf01(0xec)?_0x4cb7e6[_0x2caf01(0xec)]:[]):[],_0x5553b9=_0x40359b['includes']('company')?_0x14e7fb['flatMap']((_0x3097ae,_0x4c8e5a)=>_0x40359b[_0x4c8e5a]===_0x2caf01(0x100)?_0x3097ae[_0x2caf01(0x100)]:[]):[],_0x166194=new Set([..._0x32d966['map'](_0x216911=>_0x216911[_0x2caf01(0x106)]?.[_0x2caf01(0xeb)]())[_0x2caf01(0x10d)](_0xe88dcc=>Boolean(_0xe88dcc)),..._0x5553b9[_0x2caf01(0x104)](_0x37fe9d=>_0x37fe9d[_0x2caf01(0x106)]?.[_0x2caf01(0xeb)]())[_0x2caf01(0x10d)](_0x4e7c41=>Boolean(_0x4e7c41))]),_0x10bb1e=_0x22a02c[_0x2caf01(0xeb)]()?[_0x22a02c[_0x2caf01(0xeb)]()]:undefined,_0x40e393=_0x40359b[_0x2caf01(0x109)]===0x2&&_0x40359b[_0x2caf01(0xe9)](_0x2caf01(0xec))&&_0x40359b['includes']('company'),_0x23a317=_0x40e393?_0x559c55(_0x3aea6b,_0x166194,_0x10bb1e):[],_0x305944=_0x3f9d0c({'env':_0x5de488,'accessKey':_0x51ef08,'appCode':_0x33bb92['appCode'],'activeSkillCodes':_0x166194,'pruneSkillCodes':_0x10bb1e,'scopes':_0x40359b,'protectedLinkRoots':_0x1cf2c2[_0x2caf01(0x10e)]}),_0x330453=[];for(const _0x52f0f0 of _0x32d966){_0x330453['push'](_0x931557(_0x52f0f0,_0x2caf01(0xec),{'env':_0x5de488,'accessKey':_0x51ef08,'appCode':_0x33bb92[_0x2caf01(0xfd)],'force':_0x14fecf,'packageBytes':await downloadSkillPackage(_0x52f0f0,_0x2caf01(0xec),_0x33bb92[_0x2caf01(0xfd)],_0x40c6d5)}));}for(const _0x2815ba of _0x5553b9){_0x330453['push'](_0x931557(_0x2815ba,'company',{'env':_0x5de488,'accessKey':_0x51ef08,'appCode':_0x33bb92['appCode'],'force':_0x14fecf,'packageBytes':await downloadSkillPackage(_0x2815ba,_0x2caf01(0x100),_0x33bb92['appCode'],_0x40c6d5)}));}const _0x29839d=_0x2666e0(_0x330453,_0x3aea6b),_0x4469c9=countLinkActions(_0x29839d);return{'ok':!![],'data':{'appCode':_0x33bb92['appCode'],..._0x3aea6b[_0x2caf01(0xf7)]===_0x2caf01(0x111)?{'installTarget':{'scope':_0x3aea6b['scope'],'skillRoots':[..._0x3aea6b[_0x2caf01(0x10e)]]}}:{},'personal':_0x32d966[_0x2caf01(0x109)],'company':_0x5553b9[_0x2caf01(0x109)],'materialized':_0x330453[_0x2caf01(0x109)],'links':{'total':_0x29839d[_0x2caf01(0x109)],'created':_0x4469c9['created']??0x0,'updated':_0x4469c9['updated']??0x0,'unchanged':_0x4469c9[_0x2caf01(0x112)]??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x23a317[_0x2caf01(0x10d)](_0x246584=>_0x246584['action']===_0x2caf01(0x110))[_0x2caf01(0x109)],'cacheDirs':_0x305944[_0x2caf01(0x10d)](_0x4e1f92=>_0x4e1f92[_0x2caf01(0x10a)]===_0x2caf01(0x110))[_0x2caf01(0x109)],'skipped':[..._0x23a317,..._0x305944]['filter'](_0x2af2e3=>_0x2af2e3['action']==='skipped')[_0x2caf01(0x109)]},'skills':{'personal':_0x32d966[_0x2caf01(0x104)](summarizeRuntimeSkill),'company':_0x5553b9['map'](summarizeRuntimeSkill)}},'message':_0x2caf01(0xff)+_0x32d966[_0x2caf01(0x109)]+'\x20personal\x20and\x20'+_0x5553b9[_0x2caf01(0x109)]+'\x20company\x20Skill(s).'};}async function downloadSkillPackage(_0x2e28b3,_0x13f699,_0x521536,_0x30fb3d){const _0x2a6c9d=a45_0x4d8df2,_0x4c60ea=_0x2e28b3[_0x2a6c9d(0xf3)]?.[_0x2a6c9d(0xeb)]();return _0x4c60ea?_0x30fb3d(_0x13f699,_0x2e28b3[_0x2a6c9d(0x106)],_0x521536,_0x4c60ea):_0x30fb3d(_0x13f699,_0x2e28b3[_0x2a6c9d(0x106)],_0x521536);}function a45_0x2f5c(){const _0x3cb61a=['install','1177428OaGjYg','appCode','global','Installed\x20','company','896816YWTAXl','read','330464lHHbLo','map','4UmPqOb','skillCode','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','production','length','action','skill','47002AQqOPo','filter','skillRoots','10LRKrMn','removed','project','unchanged','includes','str','trim','personal','156930eoutjy','3173200qcFUFq','reduce','flatMap','bool','all','version','envName','../../../skills/runtime-skill-sync.js','accessKey','scope','authRequired','9qklGcf','31143tqdrVN'];a45_0x2f5c=function(){return _0x3cb61a;};return a45_0x2f5c();}function countLinkActions(_0x30dec7){const _0x20d624=a45_0x4d8df2;return _0x30dec7[_0x20d624(0xef)]((_0x4ab079,_0x4e4a55)=>{const _0x24ab57=_0x20d624;return _0x4ab079[_0x4e4a55[_0x24ab57(0x10a)]]=(_0x4ab079[_0x4e4a55[_0x24ab57(0x10a)]]??0x0)+0x1,_0x4ab079;},{});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a46_0x27fefd=a46_0x287f;(function(_0x1308a2,_0x38b79b){const _0x237810=a46_0x287f,_0x422df2=_0x1308a2();while(!![]){try{const _0xa5e69f=-parseInt(_0x237810(0xe8))/0x1*(parseInt(_0x237810(0xce))/0x2)+-parseInt(_0x237810(0xea))/0x3*(-parseInt(_0x237810(0xef))/0x4)+-parseInt(_0x237810(0xe6))/0x5*(-parseInt(_0x237810(0xd6))/0x6)+parseInt(_0x237810(0xcf))/0x7+-parseInt(_0x237810(0xeb))/0x8+parseInt(_0x237810(0xdb))/0x9*(parseInt(_0x237810(0xcd))/0xa)+-parseInt(_0x237810(0xd9))/0xb;if(_0xa5e69f===_0x38b79b)break;else _0x422df2['push'](_0x422df2['shift']());}catch(_0x249cc4){_0x422df2['push'](_0x422df2['shift']());}}}(a46_0x293d,0xa4a4a));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';function a46_0x293d(){const _0x360a9c=['length','8uExegC','list','List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','157850PYxMVB','138cxnlRS','1576750pdIQVU','appCode','local','authRequired','accessKey','../../../skills/runtime-skill-sync.js','personal','42isOHwu','project','production','17428752nrffMp','str','639HHcSUP','code','\x20local\x20Skill(s).','company','filter','bool','scope','../../../core/api-client.js','envName','remote','trim','772895IRpWul','map','739YZHjwK','builtin','1747194eAHwMD','10264264WyKbdd','Listed\x20','global'];a46_0x293d=function(){return _0x360a9c;};return a46_0x293d();}import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':'skill','command':a46_0x27fefd(0xf0),'description':a46_0x27fefd(0xcc),'risk':'read','flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x25285b){const _0x5973ae=a46_0x27fefd,_0x134ccb=_0x25285b['str'](_0x5973ae(0xdc)),_0x2a3a2d=normalizeListScope(_0x25285b[_0x5973ae(0xda)](_0x5973ae(0xe1)));if(_0x25285b[_0x5973ae(0xe0)]('local')){const _0x217c70=_0x25285b[_0x5973ae(0xd3)];if(!_0x217c70)throw CliErrors[_0x5973ae(0xd2)]();const {listLocalRuntimeSkills:_0x56accc,resolveRuntimeSkillInstallTarget:_0x558b22}=await import(_0x5973ae(0xd4)),_0x591a54=_0x558b22(_0x25285b[_0x5973ae(0xd0)],_0x25285b['bool'](_0x5973ae(0xd7))?_0x5973ae(0xd7):_0x5973ae(0xed)),_0x3639af=_0x56accc({'env':_0x25285b[_0x5973ae(0xe3)]??_0x5973ae(0xd8),'accessKey':_0x217c70,'appCode':_0x25285b[_0x5973ae(0xd0)],'scopes':listScopeToRuntimeScopes(_0x2a3a2d),'code':_0x134ccb['trim']()||undefined},_0x591a54),_0x14fd53=groupLocalRuntimeSkills(_0x3639af);return{'ok':!![],'data':{'appCode':_0x25285b[_0x5973ae(0xd0)],'source':_0x5973ae(0xd1),..._0x591a54[_0x5973ae(0xe1)]===_0x5973ae(0xd7)?{'installScope':_0x591a54[_0x5973ae(0xe1)]}:{},'scope':_0x2a3a2d,'total':_0x3639af[_0x5973ae(0xee)],'personal':_0x14fd53[_0x5973ae(0xd5)]['length'],'company':_0x14fd53[_0x5973ae(0xde)][_0x5973ae(0xee)],'items':_0x3639af[_0x5973ae(0xe7)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x14fd53[_0x5973ae(0xd5)]['map'](summarizeLocalRuntimeSkill),'company':_0x14fd53['company'][_0x5973ae(0xe7)](summarizeLocalRuntimeSkill)}},'message':_0x5973ae(0xec)+_0x3639af['length']+_0x5973ae(0xdd)};}const {listRuntimeSkills:_0xf2bb17}=await import(_0x5973ae(0xe2)),_0x14025b=await _0xf2bb17({'appCode':_0x25285b[_0x5973ae(0xd0)],'scope':listScopeToRemoteScope(_0x2a3a2d),'code':_0x134ccb[_0x5973ae(0xe5)]()||undefined}),_0x4d9731=shouldListScope(_0x2a3a2d,_0x5973ae(0xd5))?_0x14025b[_0x5973ae(0xd5)]??[]:[],_0x462b89=shouldListScope(_0x2a3a2d,'company')?_0x14025b[_0x5973ae(0xde)]??[]:[],_0x49a7d2=[..._0x4d9731,..._0x462b89];return{'ok':!![],'data':{'appCode':_0x25285b[_0x5973ae(0xd0)],'source':_0x5973ae(0xe4),'scope':_0x2a3a2d,'total':_0x49a7d2[_0x5973ae(0xee)],'personal':_0x4d9731[_0x5973ae(0xee)],'company':_0x462b89['length'],'items':_0x49a7d2[_0x5973ae(0xe7)](summarizeRuntimeSkill),'skills':{'personal':_0x4d9731['map'](summarizeRuntimeSkill),'company':_0x462b89[_0x5973ae(0xe7)](summarizeRuntimeSkill)}},'message':_0x5973ae(0xec)+_0x49a7d2[_0x5973ae(0xee)]+'\x20remote\x20Skill(s).'};}};function a46_0x287f(_0x3025fa,_0x1b8c8e){_0x3025fa=_0x3025fa-0xcc;const _0x293d39=a46_0x293d();let _0x287ffc=_0x293d39[_0x3025fa];return _0x287ffc;}function groupLocalRuntimeSkills(_0x30a9ab){const _0x10da6a=a46_0x27fefd;return{'personal':_0x30a9ab[_0x10da6a(0xdf)](_0x207ddc=>_0x207ddc['scope']===_0x10da6a(0xd5)),'company':_0x30a9ab[_0x10da6a(0xdf)](_0x2adaa1=>_0x2adaa1['scope']==='company'),'builtin':_0x30a9ab[_0x10da6a(0xdf)](_0x575651=>_0x575651[_0x10da6a(0xe1)]===_0x10da6a(0xe9))};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a47_0x1055d9=a47_0x265e;function a47_0x265e(_0x25f1ee,_0x3c7f59){_0x25f1ee=_0x25f1ee-0x1ce;const _0x4cb71d=a47_0x4cb7();let _0x265e06=_0x4cb71d[_0x25f1ee];return _0x265e06;}(function(_0x92e43f,_0x8e5731){const _0x491b2f=a47_0x265e,_0x5cd08c=_0x92e43f();while(!![]){try{const _0x38fc45=parseInt(_0x491b2f(0x1d9))/0x1*(-parseInt(_0x491b2f(0x1da))/0x2)+parseInt(_0x491b2f(0x1d7))/0x3*(parseInt(_0x491b2f(0x1d6))/0x4)+parseInt(_0x491b2f(0x1d8))/0x5+parseInt(_0x491b2f(0x1cf))/0x6+-parseInt(_0x491b2f(0x1d1))/0x7*(parseInt(_0x491b2f(0x1d4))/0x8)+parseInt(_0x491b2f(0x1ce))/0x9+-parseInt(_0x491b2f(0x1d0))/0xa;if(_0x38fc45===_0x8e5731)break;else _0x5cd08c['push'](_0x5cd08c['shift']());}catch(_0x372508){_0x5cd08c['push'](_0x5cd08c['shift']());}}}(a47_0x4cb7,0x8762b));function a47_0x4cb7(){const _0x3e80d6=['323067pALaGu','2sXSWOk','9894690WjMJNV','2453892HwYkty','4203410bPHtdg','161eLgtnG','将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','write','219160IXzeDV','将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','8qqPbIP','233559VjPpdV','1319670BSsdkC'];a47_0x4cb7=function(){return _0x3e80d6;};return a47_0x4cb7();}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':'push','description':a47_0x1055d9(0x1d5),'risk':a47_0x1055d9(0x1d3),'confirmationDescription':a47_0x1055d9(0x1d2),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x20351e=a48_0x496b;function a48_0x496b(_0x1f7fd6,_0x54d8ce){_0x1f7fd6=_0x1f7fd6-0x182;const _0xb7338b=a48_0xb733();let _0x496bda=_0xb7338b[_0x1f7fd6];return _0x496bda;}(function(_0x4f17ee,_0x2d3987){const _0x268d1a=a48_0x496b,_0xf9f39f=_0x4f17ee();while(!![]){try{const _0x78a31c=parseInt(_0x268d1a(0x18a))/0x1+parseInt(_0x268d1a(0x187))/0x2*(parseInt(_0x268d1a(0x185))/0x3)+-parseInt(_0x268d1a(0x194))/0x4*(-parseInt(_0x268d1a(0x188))/0x5)+parseInt(_0x268d1a(0x183))/0x6*(parseInt(_0x268d1a(0x184))/0x7)+-parseInt(_0x268d1a(0x193))/0x8*(parseInt(_0x268d1a(0x18c))/0x9)+-parseInt(_0x268d1a(0x18b))/0xa+-parseInt(_0x268d1a(0x190))/0xb;if(_0x78a31c===_0x2d3987)break;else _0xf9f39f['push'](_0xf9f39f['shift']());}catch(_0x4fbac5){_0xf9f39f['push'](_0xf9f39f['shift']());}}}(a48_0xb733,0x454b0));import{DIR_FLAG,STRICT_FLAG}from'../flags.js';import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';function a48_0xb733(){const _0x4ec622=['1654980KqqRhq','18DeSgug','validate','str','warnings','1335620lGBTzX','skill','dir','668680nTGKhq','41188NcHxbm','errors','bool','292602snEacd','7lgJbez','1761xXOvpP','strict','556zPaFXl','30XnNftQ','Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','464177RWNIFY'];a48_0xb733=function(){return _0x4ec622;};return a48_0xb733();}export const validateCommand={'service':a48_0x20351e(0x191),'command':a48_0x20351e(0x18d),'description':a48_0x20351e(0x189),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0xbd6f8c){const _0x195f93=a48_0x20351e,_0x8273b7=_0xbd6f8c[_0x195f93(0x182)](_0x195f93(0x186)),_0x334230=validateSkillDirectory(_0xbd6f8c[_0x195f93(0x18e)](_0x195f93(0x192)),{'strict':_0x8273b7});return throwIfSkillValidationFailed(_0x334230,_0x8273b7),{'ok':!![],'data':{'dir':_0x334230[_0x195f93(0x192)],'type':_0x334230['type'],'errors':_0x334230[_0x195f93(0x195)],'warnings':_0x334230[_0x195f93(0x18f)]},'message':'Skill\x20validation\x20passed.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x18dbc2,_0x37a3ec){const _0x4dbdbe=a49_0x365f,_0x4d246c=_0x18dbc2();while(!![]){try{const _0xe6a84b=-parseInt(_0x4dbdbe(0x202))/0x1+parseInt(_0x4dbdbe(0x209))/0x2*(-parseInt(_0x4dbdbe(0x20a))/0x3)+parseInt(_0x4dbdbe(0x1f2))/0x4+parseInt(_0x4dbdbe(0x1f9))/0x5*(-parseInt(_0x4dbdbe(0x20b))/0x6)+-parseInt(_0x4dbdbe(0x1fa))/0x7+-parseInt(_0x4dbdbe(0x1f8))/0x8+-parseInt(_0x4dbdbe(0x208))/0x9*(-parseInt(_0x4dbdbe(0x206))/0xa);if(_0xe6a84b===_0x37a3ec)break;else _0x4d246c['push'](_0x4d246c['shift']());}catch(_0x3a3cfc){_0x4d246c['push'](_0x4d246c['shift']());}}}(a49_0x3738,0xa3a72));import{existsSync,readFileSync,realpathSync,statSync}from'node:fs';import{resolve}from'node:path';import{JSDOM}from'jsdom';import{CliErrors}from'../../errors.js';function a49_0x3738(){const _0x465a5e=['63Vumaob','505888OkRexL','15ETHNPD','1663302RfHWck','4019884BnOYzd','parse','replace','Mermaid\x20syntax\x20validation\x20failed.','diagram','isFile','6317232bquTEI','15TJAJNO','3764726LlxiKG','Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.','--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.','document','utf8','window','Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.','validation','314955MXqryy','default','mermaid','Mermaid\x20flowchart\x20file\x20not\x20found:\x20','4863070aXxEbP','defineProperties'];a49_0x3738=function(){return _0x465a5e;};return a49_0x3738();}let mermaidApiPromise;export async function readRequiredSkillDiagram(_0x594fc5){const _0x42b045=a49_0x365f;return(await readRequiredSkillDiagramInput(_0x594fc5))[_0x42b045(0x1f6)];}export async function readRequiredSkillDiagramInput(_0x596d83){const _0x312248=a49_0x365f,_0x3a0241=_0x596d83['trim']();if(!_0x3a0241)throw CliErrors[_0x312248(0x201)](_0x312248(0x1fc),_0x312248(0x200));let _0x2b5965,_0x8980d8;if(_0x3a0241==='-')try{_0x2b5965=readFileSync(0x0,_0x312248(0x1fe));}catch{throw CliErrors[_0x312248(0x201)](_0x312248(0x1fb));}else{const _0x138ba6=resolve(_0x3a0241);if(!existsSync(_0x138ba6))throw CliErrors[_0x312248(0x201)](_0x312248(0x205)+_0x138ba6);if(!statSync(_0x138ba6)[_0x312248(0x1f7)]())throw CliErrors[_0x312248(0x201)]('Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x138ba6);_0x8980d8=realpathSync(_0x138ba6),_0x2b5965=readFileSync(_0x8980d8,'utf8');}return{'diagram':{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x2b5965)},'sourceFilePath':_0x8980d8};}export async function validateAndCanonicalizeMermaid(_0x1f5d9f){const _0x3f293f=a49_0x365f,_0x8016e4=_0x1f5d9f['replace'](/\r\n/g,'\x0a')[_0x3f293f(0x1f4)](/\r/g,'\x0a')['replace'](/\n+$/,'')+'\x0a';try{const _0x4b1866=await loadMermaidApi();await _0x4b1866[_0x3f293f(0x1f3)](_0x8016e4);}catch{throw diagramValidationError();}return _0x8016e4;}function a49_0x365f(_0x14b178,_0x3639cf){_0x14b178=_0x14b178-0x1f2;const _0x373874=a49_0x3738();let _0x365fb0=_0x373874[_0x14b178];return _0x365fb0;}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x401ec4=a49_0x365f;if(!(_0x401ec4(0x1ff)in globalThis)||!(_0x401ec4(0x1fd)in globalThis)){const _0x573db5=new JSDOM('');Object[_0x401ec4(0x207)](globalThis,{'window':{'configurable':!![],'value':_0x573db5[_0x401ec4(0x1ff)]},'document':{'configurable':!![],'value':_0x573db5[_0x401ec4(0x1ff)]['document']}});}return(await import(_0x401ec4(0x204)))[_0x401ec4(0x203)];})()),mermaidApiPromise;}function diagramValidationError(){const _0x536ddd=a49_0x365f;return CliErrors[_0x536ddd(0x201)](_0x536ddd(0x1f5),'Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.');}
|