@lovrabet/lovrabet-cli 2.2.1 → 2.2.2-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cli.js +1 -1
- package/lib/commands/api-doc/index.js +1 -1
- package/lib/commands/app/cache.js +1 -1
- package/lib/commands/app/definitions.js +1 -1
- package/lib/commands/app/eligibility.js +1 -1
- package/lib/commands/app/mock-loader.js +1 -1
- package/lib/commands/app/remote-source.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/artifact/index.js +1 -1
- package/lib/commands/auth/device.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/auth/prompt.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/exec.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/common/config-policy.js +1 -1
- package/lib/commands/common/constraints.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/config/definitions.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/sdk-doc.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/personal-bff/index.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/schedule/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/service/dynamic.js +1 -1
- package/lib/commands/service/function-name-adapter.js +1 -1
- package/lib/commands/service/index.js +1 -1
- package/lib/commands/service/registry.js +1 -1
- package/lib/commands/skill/commands/create.js +1 -1
- package/lib/commands/skill/commands/diagram.js +1 -1
- package/lib/commands/skill/commands/install.js +1 -1
- package/lib/commands/skill/commands/list.js +1 -1
- package/lib/commands/skill/commands/push.js +1 -1
- package/lib/commands/skill/commands/validate.js +1 -1
- package/lib/commands/skill/diagram.js +1 -1
- package/lib/commands/skill/flags.js +1 -1
- package/lib/commands/skill/index.js +1 -1
- package/lib/commands/skill/manifest-helpers.js +1 -1
- package/lib/commands/skill/push-execute.js +1 -1
- package/lib/commands/skill/push-flow-helpers.js +1 -1
- package/lib/commands/skill/push-retarget.js +1 -1
- package/lib/commands/skill/scopes.js +1 -1
- package/lib/commands/skill/summary.js +1 -1
- package/lib/commands/skill/templates.js +1 -1
- package/lib/commands/skill/validate.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/update.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/app.js +1 -1
- package/lib/constant/auth-mode.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/distribution.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/product.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/url.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/sdk-client.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/dryrun.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/preparse.js +1 -1
- package/lib/framework/rate-limit.js +1 -1
- package/lib/framework/raw-flags.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-confirmation.js +1 -1
- package/lib/framework/runner-error.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/service-order.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/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(_0x10509c,_0x4a9802){const _0x161134=a39_0x1804,_0x275c0e=_0x10509c();while(!![]){try{const _0x5c84c6=parseInt(_0x161134(0x171))/0x1+-parseInt(_0x161134(0x1b3))/0x2*(-parseInt(_0x161134(0x1b1))/0x3)+parseInt(_0x161134(0x1bf))/0x4*(-parseInt(_0x161134(0x1b5))/0x5)+parseInt(_0x161134(0x193))/0x6+parseInt(_0x161134(0x194))/0x7+-parseInt(_0x161134(0x17c))/0x8*(parseInt(_0x161134(0x1af))/0x9)+-parseInt(_0x161134(0x19b))/0xa;if(_0x5c84c6===_0x4a9802)break;else _0x275c0e['push'](_0x275c0e['shift']());}catch(_0x524144){_0x275c0e['push'](_0x275c0e['shift']());}}}(a39_0x2e6d,0x35410));import{compileServiceTreeCommand,matchServiceTreeCommand}from'@lovrabet/cli-framework';function a39_0x2e6d(){const _0x420bd9=['Run\x20service\x20command\x20','envName','bffCode','operator','rawFlags','ctx.','filter','startsWith','service','2812576WMXOaj','\x20\x20\x20\x20datasetCode:\x20','Define\x20the\x20appRef\x20under\x20appBindings\x20or\x20remove\x20target.appRef.','\x20\x20\x20\x20sqlCode:\x20','bffId','string','app','Unsupported\x20service\x20target\x20kind:\x20','target','cliPath','datasetCode','boolean','`\x20to\x20inspect\x20the\x20manifest.','high-risk-write','将通过\x20Service\x20Tree\x20执行“','Use\x20`','number','length','\x20\x20\x20\x20kind:\x20\x20\x20\x20','kind','padEnd','params','enum','2002626CbPQIs','380604dYlRwC','context.','commands','\x20<command>\x20[flags]','tree','fromEntries','some','76560YaSuDu','risk','\x22\x20to\x20a\x20datasetCode\x20in\x20app\x20','find','employeeId','bff','json','flatMap','datatable','code','\x20\x20\x20\x20','map','join','dbtableConfig','userName','validation','source','username','env','Service\x20command\x20','9NQNEGJ','mapTo','35136LRROAF','read','32rXyAVj','args','45605tqPKTN','\x20->\x20','slice','push','该命令被清单标记为高风险写入,可能产生难以恢复的业务变更。','\x20requires\x20target.sqlCode.','const','tenantCode','now','\x20\x20[','124IkHGIR','trim','\x20\x20SERVICE\x20TREE\x20TARGET','\x22\x20in\x20service\x20command\x20','default','\x20service\x20detail\x20--service\x20','appcode','sqlCode','description','remainingArgs','data','entries','appCode','userId','name','scriptName','sql','required','\x20completed\x20in\x20','fullPath','command','该命令被清单标记为写入,可能修改业务数据或服务状态。','flags','Preview\x20dynamic\x20service\x20command:\x20','normalizedManifest','nickName','\x20\x20\x20\x20functionName:\x20','type','appRef','284572AbjYno','\x20requires\x20target.functionName.'];a39_0x2e6d=function(){return _0x420bd9;};return a39_0x2e6d();}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(_0x561bae,_0x7b3088){const _0x2e2d11=a39_0x1804,_0x3a0b3e=listLocalServiceTrees();let _0x434a60;for(const _0x479a24 of _0x3a0b3e){const _0x1b95fc=matchServiceTreeCommand(_0x479a24,_0x561bae);if(!_0x1b95fc)continue;(!_0x434a60||_0x1b95fc[_0x2e2d11(0x1d3)][_0x2e2d11(0x1d2)]['length']>_0x434a60[_0x2e2d11(0x1d3)]['fullPath']['length'])&&(_0x434a60={'tree':_0x479a24,'command':_0x1b95fc[_0x2e2d11(0x1d3)],'remainingArgs':_0x1b95fc[_0x2e2d11(0x1c8)]});}if(!_0x434a60)return undefined;const _0x1eb1d6={..._0x7b3088};return applyAppBinding(_0x434a60[_0x2e2d11(0x198)],_0x434a60[_0x2e2d11(0x1d3)],_0x1eb1d6),{'definition':buildDynamicCommandDefinition(_0x434a60[_0x2e2d11(0x198)],_0x434a60[_0x2e2d11(0x1d3)]),'args':_0x434a60[_0x2e2d11(0x1c8)],'flags':_0x1eb1d6,'tree':_0x434a60[_0x2e2d11(0x198)],'command':_0x434a60['command']};}export function generateDynamicServiceHelp(_0x18e7e6){const _0x3144ee=a39_0x1804,_0x2c33dd=listLocalServiceTrees()[_0x3144ee(0x19e)](_0x37dca7=>_0x37dca7['service']['code']===_0x18e7e6);if(!_0x2c33dd)return undefined;const _0x27f866=[CLI_BIN_NAME+'\x20'+_0x18e7e6+_0x3144ee(0x197),'',_0x2c33dd[_0x3144ee(0x17b)]['name']||_0x18e7e6,_0x2c33dd[_0x3144ee(0x17b)][_0x3144ee(0x1c7)]?'\x20\x20'+_0x2c33dd[_0x3144ee(0x17b)]['description']:'','','Commands:',..._0x2c33dd['commands'][_0x3144ee(0x1a6)](_0x1cc314=>{const _0x4ab2c2=_0x3144ee,_0x55ac5b=_0x1cc314['fullPath'][_0x4ab2c2(0x1b7)](0x1)[_0x4ab2c2(0x1a7)]('\x20'),_0x402798=_0x1cc314[_0x4ab2c2(0x19c)]==='read'?'':'\x20['+_0x1cc314['risk']+']';return'\x20\x20'+_0x55ac5b[_0x4ab2c2(0x190)](0x18)+'\x20'+(_0x1cc314[_0x4ab2c2(0x1c7)]||'')+_0x402798;}),'',_0x3144ee(0x18b)+CLI_BIN_NAME+_0x3144ee(0x1c4)+_0x18e7e6+_0x3144ee(0x188)][_0x3144ee(0x179)](Boolean);return _0x27f866[_0x3144ee(0x1a7)]('\x0a');}export function listDynamicServiceEntries(){const _0x261c11=a39_0x1804;return listLocalServices()[_0x261c11(0x1a6)](_0x1599d7=>{const _0x3c895f=_0x261c11,_0x16ac0a=_0x1599d7[_0x3c895f(0x1d7)];return{'service':_0x16ac0a[_0x3c895f(0x17b)][_0x3c895f(0x1a4)],'label':_0x16ac0a['service'][_0x3c895f(0x1cd)]||_0x16ac0a[_0x3c895f(0x17b)][_0x3c895f(0x1a4)],'commands':_0x16ac0a['commands'][_0x3c895f(0x1a6)](_0x51dbf6=>({'command':dynamicCommandName(_0x51dbf6),'description':_0x51dbf6[_0x3c895f(0x1c7)]||_0x3c895f(0x173)+_0x51dbf6[_0x3c895f(0x185)],'tag':riskTag(_0x51dbf6[_0x3c895f(0x19c)])}))};});}export function getDynamicServiceEntry(_0x10cfd3){return listDynamicServiceEntries()['find'](_0x466571=>_0x466571['service']===_0x10cfd3);}export function listDynamicServiceDefinitions(_0x2b8107){const _0x10bade=a39_0x1804;return listLocalServiceTrees()[_0x10bade(0x179)](_0x40b63d=>!_0x2b8107||_0x40b63d[_0x10bade(0x17b)]['code']===_0x2b8107)[_0x10bade(0x1a2)](_0x53bb7e=>_0x53bb7e[_0x10bade(0x196)][_0x10bade(0x1a6)](_0xf67b21=>buildDynamicCommandDefinition(_0x53bb7e,_0xf67b21)));}export function getDynamicServiceDefinitions(_0x533d9a){const _0x3ebae7=listDynamicServiceDefinitions(_0x533d9a);return _0x3ebae7['length']>0x0?_0x3ebae7:undefined;}export function findDynamicServiceDefinition(_0xaef93b,_0x206550){const _0x14b8b3=a39_0x1804;return listDynamicServiceDefinitions(_0xaef93b)[_0x14b8b3(0x19e)](_0x3f63f7=>_0x3f63f7[_0x14b8b3(0x1d3)]===_0x206550);}export function buildDynamicCommandDefinition(_0x3df362,_0x7de892){const _0x17bf2e=a39_0x1804;return{'service':_0x3df362[_0x17bf2e(0x17b)]['code'],'command':dynamicCommandName(_0x7de892),'description':_0x7de892['description']||_0x17bf2e(0x173)+_0x7de892[_0x17bf2e(0x185)],'risk':_0x7de892[_0x17bf2e(0x19c)],..._0x7de892[_0x17bf2e(0x19c)]===_0x17bf2e(0x1b2)?{}:{'confirmationDescription':buildDynamicConfirmationDescription(_0x7de892)},'requiresAuth':!![],'requiresAppCode':!![],'args':_0x7de892['args'][_0x17bf2e(0x1a6)](_0x10a349=>({'name':_0x10a349[_0x17bf2e(0x1cd)],'description':_0x10a349[_0x17bf2e(0x1c7)]||_0x10a349[_0x17bf2e(0x1cd)],'required':_0x10a349[_0x17bf2e(0x1d0)]})),'flags':_0x7de892[_0x17bf2e(0x1d5)][_0x17bf2e(0x1a6)](flagToCommandFlag),'helpExtra':()=>renderDynamicCommandHelp(_0x7de892),async 'dryRun'(_0x3a29a3){const _0x4c4b38=_0x17bf2e,_0x2c4359=await compilePlan(_0x7de892,_0x3a29a3);return{'method':'SERVICE_TREE','url':_0x7de892[_0x4c4b38(0x185)],'body':{'target':targetPreview(_0x2c4359),'params':_0x2c4359[_0x4c4b38(0x191)]},'description':_0x4c4b38(0x1d6)+_0x7de892[_0x4c4b38(0x185)]};},async 'execute'(_0x1e3926){const _0x2b8d87=_0x17bf2e,_0x85c846=await compilePlan(_0x7de892,_0x1e3926),_0x1139b2=Date[_0x2b8d87(0x1bd)](),_0x24ac67=await executePlan(_0x85c846,_0x7de892,_0x1e3926),_0x16f870=Date[_0x2b8d87(0x1bd)]()-_0x1139b2;return{'ok':!![],'data':{'service':_0x3df362['service'],'command':_0x7de892[_0x2b8d87(0x185)],'target':targetPreview(_0x85c846),'result':_0x24ac67,'elapsed':_0x16f870},'message':_0x2b8d87(0x1ae)+_0x7de892[_0x2b8d87(0x185)]+_0x2b8d87(0x1d1)+_0x16f870+'ms'};}};}function buildDynamicConfirmationDescription(_0x3ed22a){const _0x27aaef=a39_0x1804,_0x5bb6fc=_0x3ed22a[_0x27aaef(0x1c7)]||_0x3ed22a['cliPath'],_0x44d1c1=_0x3ed22a[_0x27aaef(0x19c)]===_0x27aaef(0x189)?_0x27aaef(0x1b9):_0x27aaef(0x1d4);return _0x27aaef(0x18a)+_0x5bb6fc+'”。'+_0x44d1c1;}function dynamicCommandName(_0x2af0c0){const _0x340710=a39_0x1804;return _0x2af0c0['fullPath'][_0x340710(0x1b7)](0x1)[_0x340710(0x1a7)]('\x20');}function riskTag(_0x4a1ed0){const _0x49775c=a39_0x1804;return _0x4a1ed0===_0x49775c(0x1b2)?'':_0x49775c(0x1be)+_0x4a1ed0+']';}function flagToCommandFlag(_0x2583cc){const _0x2b084c=a39_0x1804;return{'name':_0x2583cc['cliName'],'type':_0x2583cc['type']===_0x2b084c(0x1a1)?'string':_0x2583cc[_0x2b084c(0x16f)],'description':_0x2583cc[_0x2b084c(0x1c7)]||_0x2583cc[_0x2b084c(0x1cd)],'required':_0x2583cc[_0x2b084c(0x1d0)],'default':isPrimitiveFlagDefault(_0x2583cc['default'])?_0x2583cc[_0x2b084c(0x1c3)]:undefined,'enum':_0x2583cc[_0x2b084c(0x192)]};}async function compilePlan(_0x56207d,_0xaf969e){const _0x155dc3=a39_0x1804;return compileServiceTreeCommand(_0x56207d,{'flags':_0xaf969e[_0x155dc3(0x177)],'args':_0xaf969e[_0x155dc3(0x1b4)],'context':await buildServiceContext(_0x56207d,_0xaf969e)});}async function buildServiceContext(_0x5d41fb,_0x3683b3){const _0x145d74=a39_0x1804,_0x437165={'appCode':_0x3683b3[_0x145d74(0x1cb)],'env':_0x3683b3[_0x145d74(0x174)],'envName':_0x3683b3[_0x145d74(0x174)]};if(!usesRuntimeContext(_0x5d41fb))return _0x437165;const _0x49d95b=await getLoginUserInfo(),_0xac9ff2=pickFirst(_0x49d95b[_0x145d74(0x1cc)],_0x49d95b['id']);return{..._0x437165,'user':_0x49d95b,'userId':_0xac9ff2,'id':_0x49d95b['id'],'username':pickFirst(_0x49d95b[_0x145d74(0x1ac)],_0x49d95b[_0x145d74(0x1a9)],_0x49d95b['loginName']),'userName':_0x49d95b[_0x145d74(0x1a9)],'nickname':pickFirst(_0x49d95b['nickname'],_0x49d95b[_0x145d74(0x1d8)]),'nickName':_0x49d95b[_0x145d74(0x1d8)],'tenantCode':_0x49d95b[_0x145d74(0x1bc)],'employeeId':_0x49d95b[_0x145d74(0x19f)]};}function usesRuntimeContext(_0x2e12d2){const _0x14ba52=a39_0x1804;return _0x2e12d2[_0x14ba52(0x1b0)][_0x14ba52(0x19a)](_0x420264=>typeof _0x420264[_0x14ba52(0x1ab)]===_0x14ba52(0x181)&&(_0x420264[_0x14ba52(0x1ab)][_0x14ba52(0x17a)](_0x14ba52(0x195))||_0x420264[_0x14ba52(0x1ab)][_0x14ba52(0x17a)](_0x14ba52(0x178))));}function pickFirst(..._0x4affd5){return _0x4affd5['find'](_0x76f244=>_0x76f244!==undefined&&_0x76f244!==null);}async function executePlan(_0x334676,_0x475c32,_0x437b0d){const _0x481a17=a39_0x1804;if(_0x334676[_0x481a17(0x18f)]===_0x481a17(0x1c9)){const _0x22db43=await resolveDatasetCode(_0x334676,_0x475c32,_0x437b0d);return executeData(_0x22db43,_0x334676['command'],_0x334676[_0x481a17(0x191)]);}if(_0x334676[_0x481a17(0x18f)]===_0x481a17(0x1cf)){if(!_0x334676[_0x481a17(0x1c6)])throw CliErrors[_0x481a17(0x1aa)]('Service\x20command\x20'+_0x475c32[_0x481a17(0x185)]+_0x481a17(0x1ba));return executeSdkSql(_0x334676[_0x481a17(0x1c6)],normalizeScalarParams(_0x334676[_0x481a17(0x191)]));}if(_0x334676[_0x481a17(0x18f)]===_0x481a17(0x1a0)){const _0x257299=_0x334676[_0x481a17(0x1ce)]||_0x334676[_0x481a17(0x175)]||(_0x334676[_0x481a17(0x180)]==null?'':String(_0x334676[_0x481a17(0x180)]));if(!_0x257299)throw CliErrors[_0x481a17(0x1aa)](_0x481a17(0x1ae)+_0x475c32['cliPath']+_0x481a17(0x172));return executeSdkBff(_0x257299,_0x334676['params']);}throw CliErrors[_0x481a17(0x1aa)](_0x481a17(0x183)+_0x334676[_0x481a17(0x18f)]);}async function resolveDatasetCode(_0x10b871,_0x18c967,_0x433dc8){const _0x2fdfd7=a39_0x1804;if(_0x10b871['datasetCode'])return _0x10b871['datasetCode'];if(!_0x10b871[_0x2fdfd7(0x1a3)])throw CliErrors[_0x2fdfd7(0x1aa)]('Service\x20command\x20'+_0x18c967[_0x2fdfd7(0x185)]+'\x20requires\x20target.datasetCode\x20or\x20target.datatable.');const _0x179452=await listDatasets(_0x433dc8[_0x2fdfd7(0x1cb)]),_0x1da465=_0x179452[_0x2fdfd7(0x19e)](_0x372398=>_0x372398[_0x2fdfd7(0x1a8)]?.['tableName']===_0x10b871['datatable']);if(!_0x1da465?.[_0x2fdfd7(0x1a4)])throw CliErrors[_0x2fdfd7(0x1aa)]('Cannot\x20resolve\x20datatable\x20\x22'+_0x10b871[_0x2fdfd7(0x1a3)]+_0x2fdfd7(0x19d)+_0x433dc8[_0x2fdfd7(0x1cb)]+'.','Use\x20lovrabet\x20dataset\x20list\x20to\x20confirm\x20the\x20physical\x20table\x20name\x20or\x20add\x20target.datasetCode\x20to\x20the\x20manifest.');return _0x1da465[_0x2fdfd7(0x1a4)];}function applyAppBinding(_0x52624a,_0x205854,_0x40bc45){const _0x5249eb=a39_0x1804,_0x2d775e=_0x205854[_0x5249eb(0x184)][_0x5249eb(0x170)];if(!_0x2d775e)return;const _0x52b4ed=_0x52624a['appBindings'][_0x2d775e];if(!_0x52b4ed)throw CliErrors[_0x5249eb(0x1aa)]('Unknown\x20appRef\x20\x22'+_0x2d775e+_0x5249eb(0x1c2)+_0x205854['cliPath']+'.',_0x5249eb(0x17e));const _0x1b4d4b=_0x52b4ed[_0x5249eb(0x1c5)]||_0x52b4ed[_0x5249eb(0x1cb)];_0x1b4d4b&&!hasText(_0x40bc45['appcode'])&&(_0x40bc45[_0x5249eb(0x1c5)]=_0x1b4d4b),_0x52b4ed[_0x5249eb(0x182)]&&!hasText(_0x40bc45[_0x5249eb(0x182)])&&!hasText(_0x40bc45['appcode'])&&(_0x40bc45[_0x5249eb(0x182)]=_0x52b4ed['app']),_0x52b4ed[_0x5249eb(0x1ad)]&&!hasText(_0x40bc45[_0x5249eb(0x1ad)])&&(_0x40bc45[_0x5249eb(0x1ad)]=_0x52b4ed[_0x5249eb(0x1ad)]);}function renderDynamicCommandHelp(_0xb1fee5){const _0x43da7d=a39_0x1804,_0x310a4d=[_0x43da7d(0x1c1),_0x43da7d(0x18e)+_0xb1fee5[_0x43da7d(0x184)]['kind'],'\x20\x20\x20\x20command:\x20'+_0xb1fee5[_0x43da7d(0x184)][_0x43da7d(0x1d3)]];if(_0xb1fee5[_0x43da7d(0x184)][_0x43da7d(0x186)])_0x310a4d[_0x43da7d(0x1b8)](_0x43da7d(0x17d)+_0xb1fee5[_0x43da7d(0x184)]['datasetCode']);if(_0xb1fee5[_0x43da7d(0x184)]['datatable'])_0x310a4d[_0x43da7d(0x1b8)]('\x20\x20\x20\x20datatable:\x20'+_0xb1fee5[_0x43da7d(0x184)][_0x43da7d(0x1a3)]);if(_0xb1fee5[_0x43da7d(0x184)][_0x43da7d(0x1c6)])_0x310a4d['push'](_0x43da7d(0x17f)+_0xb1fee5['target']['sqlCode']);if(_0xb1fee5['target'][_0x43da7d(0x1ce)])_0x310a4d[_0x43da7d(0x1b8)](_0x43da7d(0x1d9)+_0xb1fee5['target']['scriptName']);if(_0xb1fee5['mapTo'][_0x43da7d(0x18d)]>0x0){_0x310a4d[_0x43da7d(0x1b8)]('','\x20\x20MAP\x20TO');for(const _0x2c6767 of _0xb1fee5['mapTo']){_0x310a4d[_0x43da7d(0x1b8)](_0x43da7d(0x1a5)+(_0x2c6767[_0x43da7d(0x1ab)]||_0x43da7d(0x1bb))+_0x43da7d(0x1b6)+_0x2c6767[_0x43da7d(0x184)]+(_0x2c6767['operator']?'.'+_0x2c6767[_0x43da7d(0x176)]:''));}}return _0x310a4d[_0x43da7d(0x1a7)]('\x0a');}function a39_0x1804(_0x2be57e,_0x28891d){_0x2be57e=_0x2be57e-0x16f;const _0x2e6d60=a39_0x2e6d();let _0x180456=_0x2e6d60[_0x2be57e];return _0x180456;}function targetPreview(_0x33ce16){const _0x3a8875=a39_0x1804;return{'kind':_0x33ce16['kind'],'command':_0x33ce16[_0x3a8875(0x1d3)],'appRef':_0x33ce16[_0x3a8875(0x170)],'datasetCode':_0x33ce16[_0x3a8875(0x186)],'datatable':_0x33ce16['datatable'],'sqlCode':_0x33ce16[_0x3a8875(0x1c6)],'bffCode':_0x33ce16[_0x3a8875(0x175)],'bffId':_0x33ce16[_0x3a8875(0x180)],'functionName':_0x33ce16['scriptName']};}function normalizeScalarParams(_0x4f0228){const _0x1cbe8d=a39_0x1804;return Object[_0x1cbe8d(0x199)](Object[_0x1cbe8d(0x1ca)](_0x4f0228)[_0x1cbe8d(0x179)](([,_0x154f6a])=>typeof _0x154f6a===_0x1cbe8d(0x181)||typeof _0x154f6a==='number'));}function hasText(_0x25d48b){const _0x51b05a=a39_0x1804;return typeof _0x25d48b==='string'&&_0x25d48b[_0x51b05a(0x1c0)]()['length']>0x0;}function isPrimitiveFlagDefault(_0x2d74d5){const _0x694ef2=a39_0x1804;return _0x2d74d5===undefined||typeof _0x2d74d5===_0x694ef2(0x181)||typeof _0x2d74d5===_0x694ef2(0x18c)||typeof _0x2d74d5===_0x694ef2(0x187);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x573827,_0x3c3a05){const _0x42a2ee=a40_0x5040,_0x5e1409=_0x573827();while(!![]){try{const _0x2fed8d=parseInt(_0x42a2ee(0x205))/0x1*(-parseInt(_0x42a2ee(0x1fc))/0x2)+-parseInt(_0x42a2ee(0x20c))/0x3+parseInt(_0x42a2ee(0x1ff))/0x4+parseInt(_0x42a2ee(0x1f6))/0x5*(-parseInt(_0x42a2ee(0x204))/0x6)+parseInt(_0x42a2ee(0x1f7))/0x7+parseInt(_0x42a2ee(0x214))/0x8+parseInt(_0x42a2ee(0x1fd))/0x9*(parseInt(_0x42a2ee(0x20e))/0xa);if(_0x2fed8d===_0x3c3a05)break;else _0x5e1409['push'](_0x5e1409['shift']());}catch(_0x3a7c80){_0x5e1409['push'](_0x5e1409['shift']());}}}(a40_0x24bb,0x86f05));export function adaptServiceTreeManifestForLegacyFramework(_0x3844fc){const _0x23a79a=a40_0x5040,_0x3bd2f0=cloneJsonValue(_0x3844fc),_0x81dc29=[];if(!isObjectRecord(_0x3bd2f0))return{'manifest':_0x3bd2f0,'errors':_0x81dc29};return Array[_0x23a79a(0x1f9)](_0x3bd2f0[_0x23a79a(0x20d)])&&_0x3bd2f0['commands'][_0x23a79a(0x213)]((_0x5ec9f8,_0x4979ac)=>{const _0x491838=_0x23a79a;if(!isObjectRecord(_0x5ec9f8))return;adaptBffTarget(_0x5ec9f8[_0x491838(0x211)],_0x491838(0x215)+_0x4979ac+_0x491838(0x1f4),_0x81dc29);}),adaptResources(_0x3bd2f0['resources'],_0x23a79a(0x202),_0x81dc29),{'manifest':_0x3bd2f0,'errors':_0x81dc29};}export function toPublicServiceTreeTarget(_0x4cf706){const _0x177552=a40_0x5040,{scriptName:_0x3f1145,..._0x5aa8fd}=_0x4cf706;return typeof _0x3f1145===_0x177552(0x208)&&_0x3f1145[_0x177552(0x1f5)]()&&(_0x5aa8fd[_0x177552(0x206)]=_0x3f1145),_0x5aa8fd;}export function toPublicNormalizedServiceTree(_0x3f831c){const _0x2ef50c=a40_0x5040;return{..._0x3f831c,'commands':_0x3f831c[_0x2ef50c(0x20d)]['map'](_0x4376c5=>({..._0x4376c5,'target':toPublicServiceTreeTarget(_0x4376c5[_0x2ef50c(0x211)])}))};}function a40_0x24bb(){const _0x46b462=['bff','12CBixWX','190241jnRtnH','functionName','Use\x20functionName;\x20scriptName\x20is\x20not\x20part\x20of\x20the\x20runtime\x20Service\x20Tree\x20contract.','string','.functionName','functionName\x20must\x20be\x20a\x20non-empty\x20string.','map','2125101OdgyKn','commands','552940txQWbC','bff.exec','fromEntries','target','push','forEach','3552280QKSHQx','$.commands[','hasOwnProperty','.scriptName','.actions.','].target','trim','1404035ZIizFx','6595925yXIrHd','action','isArray','.resources','scriptName','6zyItSg','144PYDDbg','kind','489596KuMcyA','actions','entries','$.resources'];a40_0x24bb=function(){return _0x46b462;};return a40_0x24bb();}function adaptResources(_0xe0d204,_0x3bf19c,_0x271219){const _0x333491=a40_0x5040;if(!isObjectRecord(_0xe0d204))return;for(const [_0x2236b1,_0x19279e]of Object[_0x333491(0x201)](_0xe0d204)){if(!isObjectRecord(_0x19279e))continue;const _0x162bf7=_0x3bf19c+'.'+_0x2236b1;if(isObjectRecord(_0x19279e[_0x333491(0x200)]))for(const [_0x12aa27,_0x4f001c]of Object[_0x333491(0x201)](_0x19279e[_0x333491(0x200)])){if(!isObjectRecord(_0x4f001c))continue;const _0x3d9875=_0x162bf7+_0x333491(0x1f3)+_0x12aa27,_0x1fa560=isObjectRecord(_0x4f001c['target'])&&_0x4f001c[_0x333491(0x211)][_0x333491(0x1fe)]==='bff';adaptBffTarget(_0x4f001c['target'],_0x3d9875+'.target',_0x271219),(_0x1fa560||isBffAction(_0x4f001c))&&adaptFunctionNameField(_0x4f001c,_0x3d9875,_0x271219);}adaptResources(_0x19279e['resources'],_0x162bf7+_0x333491(0x1fa),_0x271219);}}function adaptBffTarget(_0x18db11,_0x4b6853,_0x4d714d){const _0xd19b4c=a40_0x5040;if(!isObjectRecord(_0x18db11)||_0x18db11[_0xd19b4c(0x1fe)]!==_0xd19b4c(0x203))return;adaptFunctionNameField(_0x18db11,_0x4b6853,_0x4d714d);}function adaptFunctionNameField(_0x300d51,_0x195b5f,_0x2b7db1){const _0xcc37b3=a40_0x5040;Object['prototype'][_0xcc37b3(0x1f1)]['call'](_0x300d51,'scriptName')&&_0x2b7db1[_0xcc37b3(0x212)]({'level':'error','path':_0x195b5f+_0xcc37b3(0x1f2),'message':_0xcc37b3(0x207)});if(Object['prototype'][_0xcc37b3(0x1f1)]['call'](_0x300d51,_0xcc37b3(0x206))){if(typeof _0x300d51[_0xcc37b3(0x206)]!==_0xcc37b3(0x208)||!_0x300d51[_0xcc37b3(0x206)][_0xcc37b3(0x1f5)]()){_0x2b7db1[_0xcc37b3(0x212)]({'level':'error','path':_0x195b5f+_0xcc37b3(0x209),'message':_0xcc37b3(0x20a)}),delete _0x300d51['functionName'];return;}_0x300d51[_0xcc37b3(0x1fb)]=_0x300d51[_0xcc37b3(0x206)],delete _0x300d51['functionName'];}}function isBffAction(_0x307c63){const _0xb9be79=a40_0x5040;return _0x307c63[_0xb9be79(0x1fe)]===_0xb9be79(0x203)||_0x307c63[_0xb9be79(0x1f8)]===_0xb9be79(0x20f)||_0x307c63[_0xb9be79(0x211)]==='bff.exec';}function a40_0x5040(_0x36f860,_0x4d27b2){_0x36f860=_0x36f860-0x1f1;const _0x24bbd2=a40_0x24bb();let _0x5040f9=_0x24bbd2[_0x36f860];return _0x5040f9;}function cloneJsonValue(_0x2a74e2){const _0x48daf3=a40_0x5040;if(Array[_0x48daf3(0x1f9)](_0x2a74e2))return _0x2a74e2[_0x48daf3(0x20b)](_0x3effea=>cloneJsonValue(_0x3effea));if(isObjectRecord(_0x2a74e2))return Object[_0x48daf3(0x210)](Object['entries'](_0x2a74e2)[_0x48daf3(0x20b)](([_0x342002,_0x228c5e])=>[_0x342002,cloneJsonValue(_0x228c5e)]));return _0x2a74e2;}function isObjectRecord(_0x5784f1){const _0x38632e=a40_0x5040;return Boolean(_0x5784f1)&&typeof _0x5784f1==='object'&&!Array[_0x38632e(0x1f9)](_0x5784f1);}
|
|
@@ -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
|
+
function a41_0x3f35(){const _0x172ba1=['normalizedManifest','reduce','list','cliPath','import','str','entry','registryPath','1525825SQfvxP','filePath','version','validate','2532vwDNsJ','List\x20locally\x20imported\x20Service\x20Tree\x20manifests','serviceCount','errors','required','Show\x20a\x20locally\x20imported\x20Service\x20Tree\x20manifest','Validate\x20a\x20Service\x20Tree\x20JSON\x20manifest','Preview\x20Service\x20Tree\x20import\x20into\x20~/.lovrabet/service.json','report','source','detail','manifests','type','string','hash','kind','registry','risk','target','lower\x20kebab-case\x20service\x20code','14646WyaBup','imported','从本地运行态注册表移除\x20Service\x20Tree\x20清单','service','updated','entries','serviceCode','WRITE','warnings','将把指定服务的本地\x20Service\x20Tree\x20清单写入\x20JSON\x20文件;目标位置已有文件时可能被覆盖。确认界面不会展示本地文件路径。','read','Local\x20service\x20not\x20found:\x20','map','6jFoTSJ','write','registryServiceCode','flags','将本地\x20Service\x20Tree\x20清单导出为\x20JSON\x20文件','\x20service\x20','将从本地\x20Service\x20Tree\x20注册表中移除指定服务清单;之后该清单提供的动态命令将不可用。','file','Local\x20service\x20code,\x20for\x20example\x20crm','\x20service(s),\x20updated\x20','importedAt','replaced','length','160qDBWLQ','remove','132zZDAFo','20330nwqdxU','100OsEocp','Imported','description','manifest','846024HaQour','commands','10hZodMe','将读取指定清单并写入本地\x20Service\x20Tree\x20注册表;相同服务编码的现有清单会被更新。确认界面不会展示本地文件路径。','2587617avUXTV','295339BHkYfC','name'];a41_0x3f35=function(){return _0x172ba1;};return a41_0x3f35();}const a41_0x39b7ef=a41_0x54ab;(function(_0x44cf36,_0x14d6a9){const _0x7e30c3=a41_0x54ab,_0xd26a90=_0x44cf36();while(!![]){try{const _0x3aa1da=parseInt(_0x7e30c3(0xa6))/0x1+-parseInt(_0x7e30c3(0x8f))/0x2*(-parseInt(_0x7e30c3(0xba))/0x3)+parseInt(_0x7e30c3(0x8b))/0x4*(parseInt(_0x7e30c3(0x8e))/0x5)+parseInt(_0x7e30c3(0xc7))/0x6*(parseInt(_0x7e30c3(0xa2))/0x7)+parseInt(_0x7e30c3(0x93))/0x8+-parseInt(_0x7e30c3(0x97))/0x9*(parseInt(_0x7e30c3(0x95))/0xa)+-parseInt(_0x7e30c3(0x98))/0xb*(parseInt(_0x7e30c3(0x8d))/0xc);if(_0x3aa1da===_0x14d6a9)break;else _0xd26a90['push'](_0xd26a90['shift']());}catch(_0x4818de){_0xd26a90['push'](_0xd26a90['shift']());}}}(a41_0x3f35,0x24a84));import{exportServiceManifest,formatValidationFailure,getLocalServiceEntry,getServiceRegistryPath,importServiceManifest,listLocalServices,loadServiceManifestFromFile,removeServiceManifest}from'../../commands/service/registry.js';import{toPublicNormalizedServiceTree,toPublicServiceTreeTarget}from'../../commands/service/function-name-adapter.js';const FILE_FLAG={'name':a41_0x39b7ef(0xce),'type':a41_0x39b7ef(0xb3),'required':!![],'description':'Service\x20Tree\x20manifest\x20file\x20path'},SERVICE_FLAG={'name':a41_0x39b7ef(0xbd),'type':a41_0x39b7ef(0xb3),'required':!![],'description':a41_0x39b7ef(0xcf),'pattern':{'regex':/^[a-z][a-z0-9-]*$/,'description':a41_0x39b7ef(0xb9)}};function a41_0x54ab(_0x318ee5,_0x281c14){_0x318ee5=_0x318ee5-0x87;const _0x3f3575=a41_0x3f35();let _0x54ab18=_0x3f3575[_0x318ee5];return _0x54ab18;}function summarizeService(_0x22dba9){const _0x40c16c=a41_0x39b7ef;return{'serviceCode':_0x22dba9[_0x40c16c(0xc0)],'name':_0x22dba9[_0x40c16c(0x9a)][_0x40c16c(0xbd)]['name'],'version':_0x22dba9[_0x40c16c(0xa4)],'importedAt':_0x22dba9[_0x40c16c(0x88)],'source':_0x22dba9[_0x40c16c(0xaf)],'commandCount':_0x22dba9[_0x40c16c(0x9a)][_0x40c16c(0x94)][_0x40c16c(0x8a)],'commands':_0x22dba9[_0x40c16c(0x9a)][_0x40c16c(0x94)][_0x40c16c(0xc6)](_0x17c3db=>({'path':_0x17c3db['cliPath'],'description':_0x17c3db[_0x40c16c(0x91)],'risk':_0x17c3db[_0x40c16c(0xb7)],'target':toPublicServiceTreeTarget(_0x17c3db[_0x40c16c(0xb8)]),'flags':_0x17c3db[_0x40c16c(0xca)][_0x40c16c(0xc6)](_0x29915a=>({'name':_0x29915a[_0x40c16c(0x99)],'cliName':_0x29915a['cliName'],'type':_0x29915a[_0x40c16c(0xb2)],'required':_0x29915a[_0x40c16c(0xaa)]===!![]}))}))};}function summarizeLoadedManifest(_0x5b76c0){const _0x389294=a41_0x39b7ef;return{'service':_0x5b76c0[_0x389294(0x9a)]?.['service'],'version':_0x5b76c0[_0x389294(0x9a)]?.[_0x389294(0xa4)],'commandCount':_0x5b76c0['normalizedManifest']?.[_0x389294(0x94)][_0x389294(0x8a)]??0x0,'commands':_0x5b76c0[_0x389294(0x9a)]?.[_0x389294(0x94)][_0x389294(0xc6)](_0x5af62f=>({'path':_0x5af62f[_0x389294(0x9d)],'risk':_0x5af62f['risk'],'target':toPublicServiceTreeTarget(_0x5af62f['target'])}))??[],'registryIndex':_0x5b76c0['registryIndex'],'registryServiceCode':_0x5b76c0[_0x389294(0xc9)],'errors':_0x5b76c0[_0x389294(0xae)][_0x389294(0xa9)],'warnings':_0x5b76c0[_0x389294(0xae)]['warnings']};}export const serviceDefinitions=[{'service':a41_0x39b7ef(0xbd),'command':a41_0x39b7ef(0xa5),'description':a41_0x39b7ef(0xac),'risk':a41_0x39b7ef(0xc4),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'execute'(_0x10da2a){const _0xe92a7b=a41_0x39b7ef,_0x1bfc0c=loadServiceManifestFromFile(_0x10da2a['str'](_0xe92a7b(0xce)));if(!_0x1bfc0c[_0xe92a7b(0xae)]['ok'])return{'ok':![],'data':{'file':_0x1bfc0c['filePath'],'hash':_0x1bfc0c['hash'],'kind':_0x1bfc0c[_0xe92a7b(0xb5)],'serviceCount':_0x1bfc0c['manifests']['length'],'services':_0x1bfc0c[_0xe92a7b(0xb1)][_0xe92a7b(0xc6)](summarizeLoadedManifest),'errors':_0x1bfc0c['report'][_0xe92a7b(0xa9)],'warnings':_0x1bfc0c[_0xe92a7b(0xae)][_0xe92a7b(0xc2)]},'message':formatValidationFailure(_0x1bfc0c[_0xe92a7b(0xae)])};if(_0x1bfc0c['kind']===_0xe92a7b(0xb6)||_0x1bfc0c[_0xe92a7b(0xb1)][_0xe92a7b(0x8a)]!==0x1)return{'ok':!![],'data':{'file':_0x1bfc0c['filePath'],'hash':_0x1bfc0c['hash'],'kind':_0x1bfc0c['kind'],'serviceCount':_0x1bfc0c[_0xe92a7b(0xb1)]['length'],'commandCount':_0x1bfc0c['manifests'][_0xe92a7b(0x9b)]((_0x464eb4,_0x120e04)=>_0x464eb4+(_0x120e04[_0xe92a7b(0x9a)]?.[_0xe92a7b(0x94)]['length']??0x0),0x0),'services':_0x1bfc0c['manifests'][_0xe92a7b(0xc6)](summarizeLoadedManifest),'warnings':_0x1bfc0c[_0xe92a7b(0xae)][_0xe92a7b(0xc2)]},'message':'Service\x20registry\x20validation\x20passed.'};return{'ok':!![],'data':{'file':_0x1bfc0c['filePath'],'hash':_0x1bfc0c[_0xe92a7b(0xb4)],'kind':_0x1bfc0c[_0xe92a7b(0xb5)],'service':_0x1bfc0c[_0xe92a7b(0x9a)]?.[_0xe92a7b(0xbd)],'version':_0x1bfc0c[_0xe92a7b(0x9a)]?.[_0xe92a7b(0xa4)],'commandCount':_0x1bfc0c['normalizedManifest']?.[_0xe92a7b(0x94)][_0xe92a7b(0x8a)]??0x0,'commands':_0x1bfc0c['normalizedManifest']?.[_0xe92a7b(0x94)]['map'](_0x370a2a=>({'path':_0x370a2a[_0xe92a7b(0x9d)],'risk':_0x370a2a['risk'],'target':toPublicServiceTreeTarget(_0x370a2a['target'])})),'warnings':_0x1bfc0c['report'][_0xe92a7b(0xc2)]},'message':'Service\x20manifest\x20validation\x20passed.'};}},{'service':'service','command':a41_0x39b7ef(0x9e),'description':'将\x20Service\x20Tree\x20清单导入本地运行态注册表','risk':a41_0x39b7ef(0xc8),'confirmationDescription':a41_0x39b7ef(0x96),'requiresAuth':![],'requiresAppCode':![],'flags':[FILE_FLAG],async 'dryRun'(_0x2d1946){const _0x53c216=a41_0x39b7ef,_0x17216e=loadServiceManifestFromFile(_0x2d1946['str']('file'));return{'method':_0x53c216(0xc1),'url':getServiceRegistryPath(),'body':{'file':_0x17216e[_0x53c216(0xa3)],'hash':_0x17216e[_0x53c216(0xb4)],'kind':_0x17216e[_0x53c216(0xb5)],'ok':_0x17216e[_0x53c216(0xae)]['ok'],'service':_0x17216e['normalizedManifest']?.[_0x53c216(0xbd)],'version':_0x17216e[_0x53c216(0x9a)]?.[_0x53c216(0xa4)],'serviceCount':_0x17216e[_0x53c216(0xb1)][_0x53c216(0x8a)],'services':_0x17216e[_0x53c216(0xb1)]['map'](_0x3ffea6=>({'service':_0x3ffea6[_0x53c216(0x9a)]?.['service'],'version':_0x3ffea6[_0x53c216(0x9a)]?.[_0x53c216(0xa4)],'commandCount':_0x3ffea6['normalizedManifest']?.['commands'][_0x53c216(0x8a)]??0x0,'errors':_0x3ffea6[_0x53c216(0xae)][_0x53c216(0xa9)]})),'errors':_0x17216e[_0x53c216(0xae)][_0x53c216(0xa9)],'commandCount':_0x17216e[_0x53c216(0x9a)]?.[_0x53c216(0x94)][_0x53c216(0x8a)]??0x0},'description':_0x53c216(0xad)};},async 'execute'(_0x2eb950){const _0xa0aa57=a41_0x39b7ef,_0x58e070=importServiceManifest(_0x2eb950[_0xa0aa57(0x9f)](_0xa0aa57(0xce)));if(_0x58e070['entries']['length']!==0x1)return{'ok':!![],'data':{'registryPath':_0x58e070[_0xa0aa57(0xa1)],'imported':_0x58e070[_0xa0aa57(0xbb)],'updated':_0x58e070[_0xa0aa57(0xbe)],'serviceCount':_0x58e070[_0xa0aa57(0xa8)],'services':_0x58e070[_0xa0aa57(0xbf)][_0xa0aa57(0xc6)](summarizeService)},'message':'Imported\x20'+_0x58e070[_0xa0aa57(0xbb)]+_0xa0aa57(0x87)+_0x58e070['updated']+'\x20service(s).'};return{'ok':!![],'data':{'registryPath':_0x58e070['registryPath'],'replaced':_0x58e070[_0xa0aa57(0x89)],'imported':_0x58e070[_0xa0aa57(0xbb)],'updated':_0x58e070['updated'],'serviceCount':_0x58e070[_0xa0aa57(0xa8)],'service':summarizeService(_0x58e070[_0xa0aa57(0xa0)])},'message':(_0x58e070['replaced']?'Updated':_0xa0aa57(0x90))+_0xa0aa57(0xcc)+_0x58e070[_0xa0aa57(0xa0)][_0xa0aa57(0xc0)]+'.'};}},{'service':a41_0x39b7ef(0xbd),'command':'export','description':a41_0x39b7ef(0xcb),'risk':a41_0x39b7ef(0xc8),'confirmationDescription':a41_0x39b7ef(0xc3),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG,FILE_FLAG],async 'dryRun'(_0x7c0b63){const _0x14f01f=a41_0x39b7ef,_0x28404c=getLocalServiceEntry(_0x7c0b63[_0x14f01f(0x9f)](_0x14f01f(0xbd)));return{'method':_0x14f01f(0xc1),'url':_0x7c0b63['str'](_0x14f01f(0xce)),'body':{'service':_0x7c0b63[_0x14f01f(0x9f)](_0x14f01f(0xbd)),'found':Boolean(_0x28404c),'version':_0x28404c?.[_0x14f01f(0xa4)],'source':_0x28404c?.[_0x14f01f(0xaf)]},'description':'Preview\x20Service\x20Tree\x20export\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x54b5b3){const _0x8825d4=a41_0x39b7ef,_0x58ddee=exportServiceManifest(_0x54b5b3[_0x8825d4(0x9f)]('service'),_0x54b5b3[_0x8825d4(0x9f)]('file'));return{'ok':!![],'data':{'registryPath':_0x58ddee[_0x8825d4(0xa1)],'file':_0x58ddee['filePath'],'service':summarizeService(_0x58ddee[_0x8825d4(0xa0)])},'message':'Exported\x20service\x20'+_0x58ddee[_0x8825d4(0xa0)]['serviceCode']+'.'};}},{'service':a41_0x39b7ef(0xbd),'command':a41_0x39b7ef(0x9c),'description':a41_0x39b7ef(0xa7),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[],async 'execute'(){const _0x46470c=a41_0x39b7ef,_0x1ef627=listLocalServices();return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'total':_0x1ef627['length'],'services':_0x1ef627[_0x46470c(0xc6)](summarizeService)}};}},{'service':a41_0x39b7ef(0xbd),'command':a41_0x39b7ef(0x8c),'description':a41_0x39b7ef(0xbc),'risk':a41_0x39b7ef(0xc8),'confirmationDescription':a41_0x39b7ef(0xcd),'requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'dryRun'(_0x470812){const _0xe7d735=a41_0x39b7ef,_0x10b4a8=getLocalServiceEntry(_0x470812['str'](_0xe7d735(0xbd)));return{'method':'WRITE','url':getServiceRegistryPath(),'body':{'service':_0x470812['str'](_0xe7d735(0xbd)),'found':Boolean(_0x10b4a8),'version':_0x10b4a8?.[_0xe7d735(0xa4)],'source':_0x10b4a8?.['source']},'description':'Preview\x20Service\x20Tree\x20removal\x20from\x20~/.lovrabet/service.json'};},async 'execute'(_0x352b92){const _0x4ab1c4=a41_0x39b7ef,_0x5a65c2=removeServiceManifest(_0x352b92[_0x4ab1c4(0x9f)](_0x4ab1c4(0xbd)));return{'ok':!![],'data':{'registryPath':_0x5a65c2[_0x4ab1c4(0xa1)],'serviceCount':_0x5a65c2[_0x4ab1c4(0xa8)],'service':summarizeService(_0x5a65c2[_0x4ab1c4(0xa0)])},'message':'Removed\x20service\x20'+_0x5a65c2[_0x4ab1c4(0xa0)]['serviceCode']+'.'};}},{'service':a41_0x39b7ef(0xbd),'command':a41_0x39b7ef(0xb0),'description':a41_0x39b7ef(0xab),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[SERVICE_FLAG],async 'execute'(_0x2a86ac){const _0x132adb=a41_0x39b7ef,_0x201c20=getLocalServiceEntry(_0x2a86ac[_0x132adb(0x9f)](_0x132adb(0xbd)));if(!_0x201c20)return{'ok':![],'data':{'registryPath':getServiceRegistryPath(),'service':_0x2a86ac[_0x132adb(0x9f)](_0x132adb(0xbd))},'message':_0x132adb(0xc5)+_0x2a86ac[_0x132adb(0x9f)]('service')};return{'ok':!![],'data':{'registryPath':getServiceRegistryPath(),'service':summarizeService(_0x201c20),'manifest':_0x201c20[_0x132adb(0x92)],'normalizedManifest':toPublicNormalizedServiceTree(_0x201c20[_0x132adb(0x9a)])}};}}];
|
|
@@ -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_0x299eb5=a42_0x59f0;(function(_0x1367a2,_0x79f06){const _0x44a8ce=a42_0x59f0,_0xac910a=_0x1367a2();while(!![]){try{const _0x5c0fbd=parseInt(_0x44a8ce(0x18d))/0x1*(-parseInt(_0x44a8ce(0x190))/0x2)+parseInt(_0x44a8ce(0x193))/0x3*(parseInt(_0x44a8ce(0x182))/0x4)+-parseInt(_0x44a8ce(0x167))/0x5*(-parseInt(_0x44a8ce(0x176))/0x6)+-parseInt(_0x44a8ce(0x194))/0x7*(parseInt(_0x44a8ce(0x1a4))/0x8)+parseInt(_0x44a8ce(0x188))/0x9+parseInt(_0x44a8ce(0x1a2))/0xa+parseInt(_0x44a8ce(0x17e))/0xb*(parseInt(_0x44a8ce(0x16a))/0xc);if(_0x5c0fbd===_0x79f06)break;else _0xac910a['push'](_0xac910a['shift']());}catch(_0x14a5ec){_0xac910a['push'](_0xac910a['shift']());}}}(a42_0x4446,0xbe93f));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';function a42_0x4446(){const _0x287584=['flatMap','Fix\x20the\x20JSON\x20file\x20or\x20move\x20it\x20aside\x20and\x20import\x20services\x20again.','Service\x20registry\x20has\x20no\x20services\x20to\x20import.','startsWith','warnings','registryIndex','bff\x20target\x20requires\x20bffCode,\x20bffId,\x20or\x20scriptName.','registry','message','reduce','270wxPppq','importedAt','command','].manifest','now','Unsupported\x20schemaVersion:\x20','Cannot\x20write\x20service\x20registry:\x20','version','19162mULhYQ','update','stringify','manifests','76HbHqzZ','Service\x20manifest\x20validation\x20failed:\x0a','errors','name','normalizedManifest','object','3073437JnkmiN','Fix\x20the\x20JSON\x20syntax\x20and\x20run\x20service\x20validate\x20again.','splice','schemaVersion','commandCount','159894lZQHeG','Invalid\x20service\x20manifest\x20JSON:\x20','Add\x20at\x20least\x20one\x20service\x20manifest,\x20then\x20run\x20service\x20import\x20again.','6eBRiNW','.tmp','report','64578mgfoYD','2604AaIBYW','invalid','hex','parse','Run\x20lovrabet\x20service\x20list\x20to\x20see\x20imported\x20services.','sourceHash','localeCompare','commands','manifest','bff\x20target\x20requires\x20functionName.','digest','serviceCode','target','findIndex','6402100zTtVGu','code','31216ZPXTVx','Local\x20service\x20not\x20found:\x20','CliError','validation','trim','utf8','length','cliPath','updatedAt','isArray','path','$.services[','services','Unsupported\x20service\x20registry\x20schemaVersion:\x20','sort','map','service.json','push','Invalid\x20service\x20registry\x20JSON:\x20','file','string','service','].manifest.','services\x20must\x20be\x20an\x20array','86210gDKzOl','source','risk','3756KVrNyy','toISOString'];a42_0x4446=function(){return _0x287584;};return a42_0x4446();}import{adaptServiceTreeManifestForLegacyFramework}from'../../commands/service/function-name-adapter.js';export const SERVICE_REGISTRY_SCHEMA_VERSION=0x1;export const SERVICE_REGISTRY_FILE_NAME=a42_0x299eb5(0x15f);export function getServiceRegistryPath(_0x43cab9={}){return resolve(_0x43cab9['homeDir']??homedir(),PRODUCT_CONFIG['homeDirName'],SERVICE_REGISTRY_FILE_NAME);}export function emptyServiceRegistry(){return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'services':[]};}export function readServiceRegistry(_0x370650={}){const _0x1f3f16=a42_0x299eb5,_0x18ecbb=getServiceRegistryPath(_0x370650);if(!existsSync(_0x18ecbb))return emptyServiceRegistry();try{const _0x1e1c2e=readFileSync(_0x18ecbb,_0x1f3f16(0x154));if(!_0x1e1c2e['trim']())return emptyServiceRegistry();const _0x25b7b7=JSON[_0x1f3f16(0x197)](_0x1e1c2e);if(_0x25b7b7[_0x1f3f16(0x18b)]!==SERVICE_REGISTRY_SCHEMA_VERSION)throw CliErrors['validation'](_0x1f3f16(0x15c)+String(_0x25b7b7[_0x1f3f16(0x18b)]),'Remove\x20or\x20migrate\x20'+_0x18ecbb+'.');if(!Array[_0x1f3f16(0x158)](_0x25b7b7[_0x1f3f16(0x15b)]))return emptyServiceRegistry();return{'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x25b7b7['updatedAt'],'services':_0x25b7b7[_0x1f3f16(0x15b)]};}catch(_0x19e6f6){if(_0x19e6f6 instanceof Error&&_0x19e6f6[_0x1f3f16(0x185)]===_0x1f3f16(0x1a6))throw _0x19e6f6;throw CliErrors['validation'](_0x1f3f16(0x161)+_0x18ecbb,_0x1f3f16(0x16d));}}export function writeServiceRegistry(_0x3bb56f,_0x5bf0a9={}){const _0x1add90=a42_0x299eb5,_0xb8ff3=getServiceRegistryPath(_0x5bf0a9),_0x1c19d3=dirname(_0xb8ff3);!existsSync(_0x1c19d3)&&mkdirSync(_0x1c19d3,{'recursive':!![]});const _0x185ec8=_0xb8ff3+_0x1add90(0x191);try{writeFileSync(_0x185ec8,JSON['stringify'](_0x3bb56f,null,0x2)+'\x0a',{'encoding':_0x1add90(0x154),'mode':0x180}),renameSync(_0x185ec8,_0xb8ff3);}catch(_0x4122b5){try{unlinkSync(_0x185ec8);}catch{}if(_0x4122b5?.[_0x1add90(0x1a3)]==='ENOENT')throw CliErrors[_0x1add90(0x1a7)](_0x1add90(0x17c)+_0xb8ff3);throw _0x4122b5;}return _0xb8ff3;}export function loadServiceManifestFromFile(_0x56b699){const _0x3ada78=a42_0x299eb5,_0x3681e3=resolve(_0x56b699);if(!existsSync(_0x3681e3))throw CliErrors['validation']('Service\x20manifest\x20file\x20not\x20found:\x20'+_0x56b699);let _0x311c9d;const _0x48568b=readFileSync(_0x3681e3,_0x3ada78(0x154));try{_0x311c9d=JSON['parse'](_0x48568b);}catch{throw CliErrors[_0x3ada78(0x1a7)](_0x3ada78(0x18e)+_0x56b699,_0x3ada78(0x189));}const _0x3f65e9=sha256(_0x48568b),_0x34c87c=extractLoadedServiceManifests(_0x311c9d,_0x3f65e9),_0x5c59d6=aggregateValidationReports(_0x34c87c),_0x57192b=_0x34c87c[0x0];return{'filePath':_0x3681e3,'hash':_0x3f65e9,'kind':isServiceRegistryLike(_0x311c9d)?_0x3ada78(0x173):_0x3ada78(0x19c),'manifest':_0x57192b?.['manifest']??_0x311c9d,'report':_0x5c59d6,'normalizedManifest':_0x34c87c[_0x3ada78(0x155)]===0x1?_0x57192b?.['normalizedManifest']:undefined,'manifests':_0x34c87c};}export function importServiceManifest(_0x56443a,_0x2fba8f={}){const _0x5b57f3=a42_0x299eb5,_0x4b4a31=loadServiceManifestFromFile(_0x56443a);if(!_0x4b4a31[_0x5b57f3(0x192)]['ok'])throw CliErrors[_0x5b57f3(0x1a7)](formatValidationFailure(_0x4b4a31['report']),'Fix\x20the\x20service\x20manifest\x20and\x20run\x20service\x20validate\x20again.');if(_0x4b4a31[_0x5b57f3(0x181)][_0x5b57f3(0x155)]===0x0)throw CliErrors['validation'](_0x5b57f3(0x16e),_0x5b57f3(0x18f));const _0x2f82b1=readServiceRegistry(_0x2fba8f),_0xf01ecf=(_0x2fba8f[_0x5b57f3(0x17a)]??(()=>new Date()))()[_0x5b57f3(0x16b)](),_0x1c7a14=[];let _0x529027=0x0,_0x39b26e=0x0;for(const _0x462e8e of _0x4b4a31['manifests']){if(!_0x462e8e[_0x5b57f3(0x186)])continue;const _0x4fdb30=_0x462e8e['normalizedManifest'][_0x5b57f3(0x164)][_0x5b57f3(0x1a3)],_0x506e7a={'serviceCode':_0x4fdb30,'version':_0x462e8e[_0x5b57f3(0x186)][_0x5b57f3(0x17d)],'importedAt':_0xf01ecf,'source':{'type':_0x5b57f3(0x162),'path':_0x4b4a31['filePath'],'hash':_0x462e8e[_0x5b57f3(0x199)]},'manifest':_0x462e8e['manifest'],'normalizedManifest':_0x462e8e[_0x5b57f3(0x186)]},_0x31e787=_0x2f82b1['services'][_0x5b57f3(0x1a1)](_0x3010cd=>_0x3010cd['serviceCode']===_0x4fdb30);_0x31e787>=0x0?(_0x2f82b1[_0x5b57f3(0x15b)][_0x31e787]=_0x506e7a,_0x39b26e++):(_0x2f82b1[_0x5b57f3(0x15b)][_0x5b57f3(0x160)](_0x506e7a),_0x529027++),_0x1c7a14['push'](_0x506e7a);}_0x2f82b1[_0x5b57f3(0x15b)][_0x5b57f3(0x15d)]((_0x492959,_0x51b937)=>_0x492959[_0x5b57f3(0x19f)][_0x5b57f3(0x19a)](_0x51b937[_0x5b57f3(0x19f)])),_0x2f82b1['updatedAt']=_0xf01ecf;const _0x3a66d4=writeServiceRegistry(_0x2f82b1,_0x2fba8f);return{'registryPath':_0x3a66d4,'entry':_0x1c7a14[0x0],'replaced':_0x1c7a14[_0x5b57f3(0x155)]===0x1?_0x39b26e===0x1:_0x39b26e>0x0,'entries':_0x1c7a14,'imported':_0x529027,'updated':_0x39b26e,'serviceCount':_0x2f82b1[_0x5b57f3(0x15b)][_0x5b57f3(0x155)]};}export function exportServiceManifest(_0x3bac12,_0x35713a,_0x30e4a0={}){const _0x48fd28=a42_0x299eb5,_0x19baf5=getServiceRegistryPath(_0x30e4a0),_0x13d425=getLocalServiceEntry(_0x3bac12,_0x30e4a0);if(!_0x13d425)throw CliErrors['validation'](_0x48fd28(0x1a5)+_0x3bac12,_0x48fd28(0x198));const _0x46b267=resolve(_0x35713a),_0x19bedc=dirname(_0x46b267);return!existsSync(_0x19bedc)&&mkdirSync(_0x19bedc,{'recursive':!![]}),writeFileSync(_0x46b267,JSON[_0x48fd28(0x180)](_0x13d425[_0x48fd28(0x19c)],null,0x2)+'\x0a',{'encoding':_0x48fd28(0x154),'mode':0x180}),{'registryPath':_0x19baf5,'filePath':_0x46b267,'entry':_0x13d425};}export function removeServiceManifest(_0x247dfa,_0x2f6719={}){const _0x54524b=a42_0x299eb5,_0x197e91=readServiceRegistry(_0x2f6719),_0x4dc5be=_0x247dfa['trim'](),_0x2f5fc1=_0x197e91[_0x54524b(0x15b)][_0x54524b(0x1a1)](_0x550fa2=>_0x550fa2[_0x54524b(0x19f)]===_0x4dc5be);if(_0x2f5fc1<0x0)throw CliErrors[_0x54524b(0x1a7)](_0x54524b(0x1a5)+_0x4dc5be,_0x54524b(0x198));const [_0x579729]=_0x197e91['services'][_0x54524b(0x18a)](_0x2f5fc1,0x1),_0x30d101=(_0x2f6719[_0x54524b(0x17a)]??(()=>new Date()))()[_0x54524b(0x16b)]();_0x197e91['updatedAt']=_0x30d101;const _0x2382bd=writeServiceRegistry(_0x197e91,_0x2f6719);return{'registryPath':_0x2382bd,'entry':_0x579729,'serviceCount':_0x197e91[_0x54524b(0x15b)][_0x54524b(0x155)]};}export function listLocalServices(_0x53ca65={}){const _0x2eb668=a42_0x299eb5;return readServiceRegistry(_0x53ca65)[_0x2eb668(0x15b)];}export function getLocalServiceEntry(_0x9b5cec,_0x4867f9={}){const _0x3b3c27=a42_0x299eb5;return readServiceRegistry(_0x4867f9)[_0x3b3c27(0x15b)]['find'](_0x16ea79=>_0x16ea79[_0x3b3c27(0x19f)]===_0x9b5cec['trim']());}export function listLocalServiceTrees(_0x56b6b9={}){const _0xe72109=a42_0x299eb5;return readServiceRegistry(_0x56b6b9)[_0xe72109(0x15b)][_0xe72109(0x15e)](_0x2fede7=>_0x2fede7['normalizedManifest']);}export function inspectServiceRegistry(_0x2efc36={}){const _0x123e76=a42_0x299eb5,_0x253346=getServiceRegistryPath(_0x2efc36);if(!existsSync(_0x253346))return emptyServiceRegistryInspection(_0x253346,'missing',![]);try{const _0x161934=readFileSync(_0x253346,'utf8');if(!_0x161934[_0x123e76(0x1a8)]())return emptyServiceRegistryInspection(_0x253346,'empty',!![]);const _0x16c1a6=JSON[_0x123e76(0x197)](_0x161934);if(_0x16c1a6[_0x123e76(0x18b)]!==SERVICE_REGISTRY_SCHEMA_VERSION)return{...emptyServiceRegistryInspection(_0x253346,_0x123e76(0x195),!![]),'schemaVersion':_0x16c1a6[_0x123e76(0x18b)],'message':_0x123e76(0x17b)+String(_0x16c1a6[_0x123e76(0x18b)])};if(!Array[_0x123e76(0x158)](_0x16c1a6['services']))return{...emptyServiceRegistryInspection(_0x253346,_0x123e76(0x195),!![]),'schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x16c1a6[_0x123e76(0x157)],'message':_0x123e76(0x166)};const _0x5b5a8c=_0x16c1a6[_0x123e76(0x15b)][_0x123e76(0x15e)](summarizeLocalServiceEntry);return{'registryPath':_0x253346,'exists':!![],'status':'ok','schemaVersion':SERVICE_REGISTRY_SCHEMA_VERSION,'updatedAt':_0x16c1a6[_0x123e76(0x157)],'serviceCount':_0x5b5a8c[_0x123e76(0x155)],'commandCount':_0x5b5a8c[_0x123e76(0x175)]((_0x4ae019,_0x1cf8dc)=>_0x4ae019+_0x1cf8dc[_0x123e76(0x18c)],0x0),'services':_0x5b5a8c};}catch(_0x377ae2){return{...emptyServiceRegistryInspection(_0x253346,_0x123e76(0x195),!![]),'message':_0x377ae2 instanceof Error?_0x377ae2[_0x123e76(0x174)]:String(_0x377ae2)};}}export function formatValidationFailure(_0x4e4876){const _0x2f8e09=a42_0x299eb5,_0x3c6362=_0x4e4876['errors']['map'](_0x3522a9=>_0x3522a9[_0x2f8e09(0x159)]+':\x20'+_0x3522a9[_0x2f8e09(0x174)]);return _0x2f8e09(0x183)+_0x3c6362['join']('\x0a');}function extractLoadedServiceManifests(_0x41a1d0,_0x469b0e){if(!isServiceRegistryLike(_0x41a1d0)){const _0x368f2f=_0x41a1d0,{manifest:_0x5ab543,errors:_0x35e515}=adaptServiceTreeManifestForLegacyFramework(_0x368f2f),_0x10c051=validateServiceTreeManifest(_0x5ab543),_0x37b71c=mergeValidationErrors(_0x10c051,_0x35e515);return[{'manifest':_0x368f2f,'report':_0x37b71c,'normalizedManifest':_0x37b71c['ok']?normalizeServiceTreeManifest(_0x5ab543):undefined,'sourceHash':_0x469b0e}];}return _0x41a1d0['services']['map']((_0x12fb1f,_0x5c80c6)=>{const _0x4cdafa=a42_0x59f0,_0x560219=isObjectRecord(_0x12fb1f)?_0x12fb1f['manifest']:undefined,{manifest:_0xc1a605,errors:_0x1ef77f}=adaptServiceTreeManifestForLegacyFramework(_0x560219),_0x2bad22=validateServiceTreeManifest(_0xc1a605),_0x596e8d=mergeValidationErrors(_0x2bad22,_0x1ef77f),_0x39f4db=isObjectRecord(_0x12fb1f)&&typeof _0x12fb1f[_0x4cdafa(0x19f)]===_0x4cdafa(0x163)?_0x12fb1f[_0x4cdafa(0x19f)]:undefined;return{'manifest':_0x560219,'report':_0x596e8d,'normalizedManifest':_0x596e8d['ok']?normalizeServiceTreeManifest(_0xc1a605):undefined,'sourceHash':sha256(JSON['stringify'](_0x560219,null,0x2)+'\x0a'),'registryIndex':_0x5c80c6,'registryServiceCode':_0x39f4db};});}function a42_0x59f0(_0x1ee2b6,_0x587da9){_0x1ee2b6=_0x1ee2b6-0x154;const _0x444699=a42_0x4446();let _0x59f0b1=_0x444699[_0x1ee2b6];return _0x59f0b1;}function mergeValidationErrors(_0x1bdf13,_0x1f4736){const _0x13d1f1=a42_0x299eb5,_0x34ae55=_0x1bdf13[_0x13d1f1(0x184)][_0x13d1f1(0x15e)](_0x4ad5fc=>_0x4ad5fc[_0x13d1f1(0x174)]===_0x13d1f1(0x172)?{..._0x4ad5fc,'message':_0x13d1f1(0x19d)}:_0x4ad5fc),_0xfd382b=[..._0x1f4736,..._0x34ae55];return{'ok':_0xfd382b[_0x13d1f1(0x155)]===0x0,'errors':_0xfd382b,'warnings':_0x1bdf13['warnings']};}function aggregateValidationReports(_0x50cfe0){const _0x2fdd4a=a42_0x299eb5,_0xbffc86=_0x50cfe0['flatMap'](_0x547e0b=>_0x547e0b[_0x2fdd4a(0x171)]===undefined?_0x547e0b[_0x2fdd4a(0x192)][_0x2fdd4a(0x184)]:_0x547e0b[_0x2fdd4a(0x192)][_0x2fdd4a(0x184)]['map'](_0x435436=>({..._0x435436,'path':prefixRegistryIssuePath(_0x547e0b[_0x2fdd4a(0x171)],_0x435436['path'])}))),_0xcdebbe=_0x50cfe0[_0x2fdd4a(0x16c)](_0xc2c60f=>_0xc2c60f['registryIndex']===undefined?_0xc2c60f[_0x2fdd4a(0x192)][_0x2fdd4a(0x170)]:_0xc2c60f[_0x2fdd4a(0x192)]['warnings'][_0x2fdd4a(0x15e)](_0x1017c2=>({..._0x1017c2,'path':prefixRegistryIssuePath(_0xc2c60f[_0x2fdd4a(0x171)],_0x1017c2[_0x2fdd4a(0x159)])})));return{'ok':_0xbffc86[_0x2fdd4a(0x155)]===0x0,'errors':_0xbffc86,'warnings':_0xcdebbe};}function prefixRegistryIssuePath(_0x592e7b,_0x3f8928){const _0xe8b97c=a42_0x299eb5;if(_0x3f8928==='$')return'$.services['+_0x592e7b+'].manifest';if(_0x3f8928[_0xe8b97c(0x16f)]('$.'))return _0xe8b97c(0x15a)+_0x592e7b+'].manifest'+_0x3f8928['slice'](0x1);if(_0x3f8928['startsWith']('$['))return _0xe8b97c(0x15a)+_0x592e7b+_0xe8b97c(0x179)+_0x3f8928['slice'](0x1);return _0xe8b97c(0x15a)+_0x592e7b+_0xe8b97c(0x165)+_0x3f8928;}function isServiceRegistryLike(_0x39efa6){const _0x8740c1=a42_0x299eb5;return isObjectRecord(_0x39efa6)&&_0x39efa6[_0x8740c1(0x18b)]===SERVICE_REGISTRY_SCHEMA_VERSION&&Array['isArray'](_0x39efa6[_0x8740c1(0x15b)]);}function isObjectRecord(_0xd554b6){const _0xbb756b=a42_0x299eb5;return Boolean(_0xd554b6)&&typeof _0xd554b6===_0xbb756b(0x187)&&!Array[_0xbb756b(0x158)](_0xd554b6);}function emptyServiceRegistryInspection(_0x2102a2,_0x24aaed,_0x140d65){return{'registryPath':_0x2102a2,'exists':_0x140d65,'status':_0x24aaed,'serviceCount':0x0,'commandCount':0x0,'services':[]};}function summarizeLocalServiceEntry(_0xb8492a){const _0x324475=a42_0x299eb5,_0x3f2293=_0xb8492a[_0x324475(0x186)],_0x4a1c5d=_0x3f2293[_0x324475(0x19b)]['map'](_0x297010=>({'path':_0x297010[_0x324475(0x156)],'description':_0x297010['description'],'risk':_0x297010[_0x324475(0x169)],'targetKind':_0x297010[_0x324475(0x1a0)]['kind'],'targetCommand':_0x297010[_0x324475(0x1a0)][_0x324475(0x178)]}));return{'serviceCode':_0xb8492a[_0x324475(0x19f)],'name':_0x3f2293['service'][_0x324475(0x185)],'description':_0x3f2293[_0x324475(0x164)]['description'],'version':_0xb8492a[_0x324475(0x17d)],'importedAt':_0xb8492a[_0x324475(0x177)],'source':_0xb8492a[_0x324475(0x168)],'commandCount':_0x4a1c5d[_0x324475(0x155)],'commands':_0x4a1c5d};}function sha256(_0x4cfee0){const _0x41011a=a42_0x299eb5;return createHash('sha256')[_0x41011a(0x17f)](_0x4cfee0)[_0x41011a(0x19e)](_0x41011a(0x196));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a43_0x4104cf=a43_0x14f0;function a43_0x14d4(){const _0x13a94e=['content','str','1296546rGPPYg','isSymbolicLink','Pass\x20--force\x20to\x20overwrite\x20generated\x20template\x20files.','validation','force','type','2549580gxLuUS','42JWCJjI','trim','2501212AmvMtv','bool','utf8','274977lneyJn','48gTTriB','map','Refusing\x20to\x20overwrite\x20symlink:\x20','Create\x20a\x20local\x20runtime\x20Skill\x20draft\x20without\x20uploading\x20or\x20publishing\x20it.','read','skillDir','path','skill','Skill\x20directory\x20already\x20exists:\x20','rendered','创建本地自包含的运行态\x20Skill\x20草稿','116850PJJiYs','isDirectory','target','127480TxzxGK','1103024VUDjGj','27PoWvhV','skillName','Omitting\x20--type\x20is\x20deprecated;\x20defaulting\x20to\x20write\x20for\x20compatibility.\x20Pass\x20--type\x20read\x20or\x20--type\x20write\x20explicitly.','WRITE'];a43_0x14d4=function(){return _0x13a94e;};return a43_0x14d4();}(function(_0x41c872,_0x4b6337){const _0x4e3c79=a43_0x14f0,_0x4e99e5=_0x41c872();while(!![]){try{const _0x4de732=-parseInt(_0x4e3c79(0x6c))/0x1+parseInt(_0x4e3c79(0x7d))/0x2+parseInt(_0x4e3c79(0x80))/0x3*(-parseInt(_0x4e3c79(0x81))/0x4)+parseInt(_0x4e3c79(0x69))/0x5+-parseInt(_0x4e3c79(0x74))/0x6*(-parseInt(_0x4e3c79(0x7b))/0x7)+parseInt(_0x4e3c79(0x6d))/0x8*(-parseInt(_0x4e3c79(0x6e))/0x9)+-parseInt(_0x4e3c79(0x7a))/0xa;if(_0x4de732===_0x4b6337)break;else _0x4e99e5['push'](_0x4e99e5['shift']());}catch(_0x1cdee4){_0x4e99e5['push'](_0x4e99e5['shift']());}}}(a43_0x14d4,0xa4aee));import{existsSync,lstatSync,mkdirSync,writeFileSync}from'node:fs';import{dirname,resolve}from'node:path';import{CliErrors}from'../../../errors.js';import{writeCliSideChannelLine}from'../../../utils/write-cli-side-channel.js';import{CREATE_NAME_FLAG,FORCE_FLAG,TARGET_FLAG,TYPE_FLAG}from'../flags.js';function a43_0x14f0(_0x2c0526,_0x16c93d){_0x2c0526=_0x2c0526-0x69;const _0x14d498=a43_0x14d4();let _0x14f025=_0x14d498[_0x2c0526];return _0x14f025;}import{DEFAULT_SKILL_TARGET,renderSkillTemplate}from'../templates.js';export const createCommand={'service':a43_0x4104cf(0x88),'command':'create','description':a43_0x4104cf(0x8b),'risk':a43_0x4104cf(0x85),'requiresAuth':![],'requiresAppCode':![],'flags':[CREATE_NAME_FLAG,TYPE_FLAG,TARGET_FLAG,FORCE_FLAG],async 'dryRun'(_0x437ef1){const _0x4e803f=a43_0x4104cf,_0x379d69=buildSkillCreatePlan(_0x437ef1[_0x4e803f(0x73)]('name'),_0x437ef1['str'](_0x4e803f(0x79)),_0x437ef1[_0x4e803f(0x73)](_0x4e803f(0x6b)));return{'method':_0x4e803f(0x71),'url':_0x379d69[_0x4e803f(0x86)],'body':{'skillName':_0x379d69['rendered'][_0x4e803f(0x6f)],'type':_0x379d69[_0x4e803f(0x8a)]['type'],'selfContained':!![],'files':_0x379d69[_0x4e803f(0x8a)]['files'][_0x4e803f(0x82)](_0x5f2ca4=>_0x5f2ca4[_0x4e803f(0x87)])},'description':_0x4e803f(0x84)};},async 'execute'(_0x5f5d53){const _0x51c1c6=a43_0x4104cf,_0x194a10=buildSkillCreatePlan(_0x5f5d53[_0x51c1c6(0x73)]('name'),_0x5f5d53[_0x51c1c6(0x73)](_0x51c1c6(0x79)),_0x5f5d53['str'](_0x51c1c6(0x6b)));return writeSkillDraft(_0x194a10,_0x5f5d53[_0x51c1c6(0x7e)](_0x51c1c6(0x78))),{'ok':!![],'data':{'skillName':_0x194a10['rendered'][_0x51c1c6(0x6f)],'type':_0x194a10['rendered'][_0x51c1c6(0x79)],'dir':_0x194a10[_0x51c1c6(0x86)],'files':_0x194a10[_0x51c1c6(0x8a)]['files'][_0x51c1c6(0x82)](_0x5c5817=>_0x5c5817[_0x51c1c6(0x87)])},'message':'Created\x20local\x20Skill\x20draft\x20'+_0x194a10[_0x51c1c6(0x8a)][_0x51c1c6(0x6f)]};}};function buildSkillCreatePlan(_0x1aae66,_0x42c0b6,_0x1464b1){const _0x32ae5b=a43_0x4104cf,_0x3bc2c5=_0x42c0b6[_0x32ae5b(0x7c)](),_0x55e80a=renderSkillTemplate({'skillName':_0x1aae66,'type':_0x3bc2c5});!_0x3bc2c5&&writeCliSideChannelLine(_0x32ae5b(0x70));const _0xbec67f=resolve(normalizeSkillTarget(_0x1464b1));return{'rendered':_0x55e80a,'targetRoot':_0xbec67f,'skillDir':resolve(_0xbec67f,_0x55e80a[_0x32ae5b(0x6f)])};}function normalizeSkillTarget(_0x1995c5){const _0x100380=a43_0x4104cf;return(_0x1995c5||DEFAULT_SKILL_TARGET)[_0x100380(0x7c)]()||DEFAULT_SKILL_TARGET;}function writeSkillDraft(_0x2f11f8,_0x55115d){const _0x3fe6aa=a43_0x4104cf;if(existsSync(_0x2f11f8[_0x3fe6aa(0x86)])){const _0x32db00=lstatSync(_0x2f11f8['skillDir']);if(!_0x32db00[_0x3fe6aa(0x6a)]()||_0x32db00[_0x3fe6aa(0x75)]())throw CliErrors[_0x3fe6aa(0x77)]('Skill\x20path\x20already\x20exists\x20and\x20is\x20not\x20a\x20writable\x20directory:\x20'+_0x2f11f8[_0x3fe6aa(0x86)]);if(!_0x55115d)throw CliErrors[_0x3fe6aa(0x77)](_0x3fe6aa(0x89)+_0x2f11f8[_0x3fe6aa(0x86)],_0x3fe6aa(0x76));}for(const _0x1ce79e of _0x2f11f8[_0x3fe6aa(0x8a)]['files']){const _0x46cdc9=resolve(_0x2f11f8[_0x3fe6aa(0x86)],_0x1ce79e[_0x3fe6aa(0x87)]),_0x3c3091=dirname(_0x46cdc9);mkdirSync(_0x3c3091,{'recursive':!![]});if(existsSync(_0x46cdc9)&&lstatSync(_0x46cdc9)['isSymbolicLink']())throw CliErrors['validation'](_0x3fe6aa(0x83)+_0x46cdc9);writeFileSync(_0x46cdc9,_0x1ce79e[_0x3fe6aa(0x72)],_0x3fe6aa(0x7f));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0x5e6a5d=a44_0x26f3;(function(_0x3e0b15,_0xf2a2ad){const _0x559c66=a44_0x26f3,_0x22d1d2=_0x3e0b15();while(!![]){try{const _0xc69ea6=parseInt(_0x559c66(0xe0))/0x1+parseInt(_0x559c66(0xed))/0x2*(-parseInt(_0x559c66(0xdd))/0x3)+-parseInt(_0x559c66(0xde))/0x4*(parseInt(_0x559c66(0xf8))/0x5)+-parseInt(_0x559c66(0xec))/0x6+-parseInt(_0x559c66(0xe2))/0x7*(parseInt(_0x559c66(0xdc))/0x8)+-parseInt(_0x559c66(0xe9))/0x9*(parseInt(_0x559c66(0xeb))/0xa)+-parseInt(_0x559c66(0xe3))/0xb*(-parseInt(_0x559c66(0xf7))/0xc);if(_0xc69ea6===_0xf2a2ad)break;else _0x22d1d2['push'](_0x22d1d2['shift']());}catch(_0x53504e){_0x22d1d2['push'](_0x22d1d2['shift']());}}}(a44_0x4c97,0x86fed));import{getRuntimeSkillVersionDiagram,putRuntimeSkillVersionDiagram,validateRuntimeSkillVersionDiagram}from'../../../core/api-client.js';function a44_0x26f3(_0x4750d7,_0x20e341){_0x4750d7=_0x4750d7-0xd4;const _0x4c97f4=a44_0x4c97();let _0x26f35e=_0x4c97f4[_0x4750d7];return _0x26f35e;}import{CliErrors}from'../../../errors.js';import{readRequiredSkillDiagram}from'../diagram.js';function a44_0x4c97(){const _0x5936b1=['52145ynCKkT','\x20is\x20unchanged.','test','source-fingerprint','version','isInteger','found','scope','Found\x20Skill\x20diagram\x20for\x20','Updated','trim','No\x20Skill\x20diagram\x20is\x20stored\x20for\x20','str','action','--expected-diagram-revision\x20must\x20be\x20a\x20non-negative\x20integer.','write','expectedDiagramRevision','--skill-code,\x20--version,\x20and\x20--scope\x20personal|company\x20are\x20required.','unchanged','136icQWzP','3xNGMwR','300VfzQen','validation','783328GwPvyv','expected-diagram-revision','25340gwqlUG','19621503XQZzFy','skill','num','Skill\x20diagram\x20validation\x20passed\x20for\x20',';\x20first\x20write\x20expects\x20revision\x20','appCode','820044vWeXqj','diagram-validate','90DSFACS','6196410UvQFqs','2202878zUbvmb','personal','Validate\x20a\x20Mermaid\x20diagram\x20replacement\x20for\x20one\x20exact\x20Skill\x20version','created','read',';\x20next\x20write\x20expects\x20revision\x20','diagram-show','skillCode','Skill\x20diagram\x20for\x20','diagram-file','24lEIOwc'];a44_0x4c97=function(){return _0x5936b1;};return a44_0x4c97();}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(_0x957736){const _0x394956=a44_0x26f3,_0x485ea1=_0x957736[_0x394956(0xd5)]('skill-code')[_0x394956(0x102)](),_0x9f7bf9=_0x957736['str'](_0x394956(0xfc))[_0x394956(0x102)](),_0x5888ef=_0x957736[_0x394956(0xd5)]('scope');if(!_0x485ea1||!_0x9f7bf9||_0x5888ef!==_0x394956(0xee)&&_0x5888ef!=='company')throw CliErrors[_0x394956(0xdf)](_0x394956(0xda));return{'skillCode':_0x485ea1,'version':_0x9f7bf9,'scope':_0x5888ef};}async function readDiagramWriteInput(_0x56c49a){const _0x2ee744=a44_0x26f3,_0x406eda=_0x56c49a[_0x2ee744(0xe5)](_0x2ee744(0xe1)),_0x37080b=_0x56c49a[_0x2ee744(0xd5)](_0x2ee744(0xfb))['trim']();if(!Number[_0x2ee744(0xfd)](_0x406eda)||_0x406eda<0x0)throw CliErrors[_0x2ee744(0xdf)](_0x2ee744(0xd7));if(!/^sha256:[0-9a-f]{64}$/[_0x2ee744(0xfa)](_0x37080b))throw CliErrors[_0x2ee744(0xdf)]('--source-fingerprint\x20must\x20be\x20lowercase\x20sha256:<64\x20hex\x20characters>.');return{'expectedDiagramRevision':_0x406eda,'sourceFingerprint':_0x37080b,'diagram':await readRequiredSkillDiagram(_0x56c49a['str'](_0x2ee744(0xf6)))};}export const diagramValidateCommand={'service':'skill','command':a44_0x5e6a5d(0xea),'description':a44_0x5e6a5d(0xef),'risk':'read','flags':WRITE_FLAGS,async 'execute'(_0x118101){const _0x34c856=a44_0x5e6a5d,_0x9be483=readDiagramTarget(_0x118101),_0xde0657=await validateRuntimeSkillVersionDiagram(_0x118101[_0x34c856(0xe8)],_0x9be483[_0x34c856(0xf4)],_0x9be483['version'],_0x9be483[_0x34c856(0xff)],await readDiagramWriteInput(_0x118101));return{'ok':!![],'data':_0xde0657,'message':_0x34c856(0xe6)+_0x9be483[_0x34c856(0xf4)]+'@'+_0x9be483[_0x34c856(0xfc)]+'.'};}};export const diagramPushCommand={'service':a44_0x5e6a5d(0xe4),'command':'diagram-push','description':'为指定版本的\x20Skill\x20创建或替换\x20Mermaid\x20图','risk':a44_0x5e6a5d(0xd8),'confirmationDescription':'将为指定\x20Skill\x20的精确版本创建或替换\x20Mermaid\x20流程图;服务端版本已变化时会拒绝覆盖。确认界面不会展示图表正文。','flags':WRITE_FLAGS,async 'execute'(_0x2bb340){const _0x4dee29=a44_0x5e6a5d,_0x45da7e=readDiagramTarget(_0x2bb340),_0xba686d=await putRuntimeSkillVersionDiagram(_0x2bb340[_0x4dee29(0xe8)],_0x45da7e['skillCode'],_0x45da7e[_0x4dee29(0xfc)],_0x45da7e['scope'],await readDiagramWriteInput(_0x2bb340));return{'ok':!![],'data':_0xba686d,'message':_0xba686d[_0x4dee29(0xd6)]===_0x4dee29(0xdb)?_0x4dee29(0xf5)+_0x45da7e[_0x4dee29(0xf4)]+'@'+_0x45da7e[_0x4dee29(0xfc)]+_0x4dee29(0xf9):(_0xba686d[_0x4dee29(0xd6)]===_0x4dee29(0xf0)?'Created':_0x4dee29(0x101))+'\x20Skill\x20diagram\x20for\x20'+_0x45da7e['skillCode']+'@'+_0x45da7e[_0x4dee29(0xfc)]+'.'};}};export const diagramShowCommand={'service':'skill','command':a44_0x5e6a5d(0xf3),'description':'Show\x20the\x20current\x20Mermaid\x20diagram\x20for\x20one\x20exact\x20Skill\x20version','risk':a44_0x5e6a5d(0xf1),'flags':TARGET_FLAGS,async 'execute'(_0x53709d){const _0x1b8747=a44_0x5e6a5d,_0x392562=readDiagramTarget(_0x53709d),_0x1c5b1c=await getRuntimeSkillVersionDiagram(_0x53709d[_0x1b8747(0xe8)],_0x392562['skillCode'],_0x392562[_0x1b8747(0xfc)],_0x392562[_0x1b8747(0xff)]);return{'ok':!![],'data':_0x1c5b1c,'message':_0x1c5b1c[_0x1b8747(0xfe)]?_0x1b8747(0x100)+_0x392562[_0x1b8747(0xf4)]+'@'+_0x392562[_0x1b8747(0xfc)]+_0x1b8747(0xf2)+_0x1c5b1c[_0x1b8747(0xd9)]+'.':_0x1b8747(0xd4)+_0x392562[_0x1b8747(0xf4)]+'@'+_0x392562[_0x1b8747(0xfc)]+_0x1b8747(0xe7)+_0x1c5b1c[_0x1b8747(0xd9)]+'.'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a45_0x4575a3=a45_0x4b9a;function a45_0x4b9a(_0x512804,_0x428401){_0x512804=_0x512804-0xc6;const _0xe4177b=a45_0xe417();let _0x4b9a2f=_0xe4177b[_0x512804];return _0x4b9a2f;}function a45_0xe417(){const _0x7110ec=['68958imkETY','length','version','trim','6TixFXJ','135620ZbHgvx','authRequired','../../../skills/runtime-skill-sync.js','reduce','flatMap','all','project','code','created','company','Install\x20current-app\x20business\x20Skills\x20into\x20user-level\x20Agent\x20skill\x20directories','updated','6wIDSsT','removed','install','personal','scope','16XwfBhv','read','push','771399kGckKa','force','3097180SmftKn','production','skipped','str','filter','Business\x20Skill\x20installation\x20requires\x20authentication.\x20Run\x20`lovrabet\x20auth\x20login`,\x20or\x20use\x20`lovrabet\x20cli-skill\x20install`\x20for\x20CLI\x20Built-in\x20Skill\x20setup.','global','action','1827397phQAKa','includes','map','skillCode','1023176DwmroW','70zSNart','envName','80139gCWPvL','\x20company\x20Skill(s).','appCode','accessKey'];a45_0xe417=function(){return _0x7110ec;};return a45_0xe417();}(function(_0x1c1f70,_0x1af9d3){const _0x438e81=a45_0x4b9a,_0x4e7b40=_0x1c1f70();while(!![]){try{const _0x111bf7=parseInt(_0x438e81(0xec))/0x1+parseInt(_0x438e81(0xd3))/0x2*(-parseInt(_0x438e81(0xf0))/0x3)+-parseInt(_0x438e81(0xdd))/0x4+parseInt(_0x438e81(0xc7))/0x5*(-parseInt(_0x438e81(0xc6))/0x6)+-parseInt(_0x438e81(0xe9))/0x7+-parseInt(_0x438e81(0xd8))/0x8*(-parseInt(_0x438e81(0xdb))/0x9)+-parseInt(_0x438e81(0xea))/0xa*(-parseInt(_0x438e81(0xe5))/0xb);if(_0x111bf7===_0x1af9d3)break;else _0x4e7b40['push'](_0x4e7b40['shift']());}catch(_0x59d9cf){_0x4e7b40['push'](_0x4e7b40['shift']());}}}(a45_0xe417,0x61251));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG,SCOPE_FLAG}from'../flags.js';import{normalizeSyncScopes}from'../scopes.js';import{summarizeRuntimeSkill}from'../summary.js';export const installCommand={'service':'skill','command':a45_0x4575a3(0xd5),'description':a45_0x4575a3(0xd1),'risk':a45_0x4575a3(0xd9),'requiresAuth':!![],'requiresAppCode':!![],'hasFormat':![],'flags':[CODE_FLAG,SCOPE_FLAG,FORCE_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x7487f9){return syncRuntimeSkills(_0x7487f9);}};async function syncRuntimeSkills(_0x1c7e63){const _0x3de14f=a45_0x4575a3,{downloadRuntimeSkillPackage:_0x5c7a46,listRuntimeSkills:_0x5c8a3c}=await import('../../../core/api-client.js'),{linkEffectiveRuntimeSkills:_0x1508a5,materializeRuntimeSkill:_0x3b03b5,pruneStaleRuntimeSkillCache:_0x4b16a1,pruneStaleRuntimeSkillLinks:_0xaa7c03,resolveRuntimeSkillInstallTarget:_0x48441}=await import(_0x3de14f(0xc9)),_0x2a518b=_0x1c7e63[_0x3de14f(0xe0)](_0x3de14f(0xce)),_0x4611f0=normalizeSyncScopes(_0x1c7e63[_0x3de14f(0xe0)](_0x3de14f(0xd7))),_0x46b938=_0x1c7e63[_0x3de14f(0xeb)]??_0x3de14f(0xde),_0x5d282f=_0x1c7e63[_0x3de14f(0xef)],_0x264885=_0x1c7e63['bool'](_0x3de14f(0xdc));if(!_0x5d282f)throw CliErrors[_0x3de14f(0xc8)](_0x3de14f(0xe2));const _0x1d2ae9=_0x48441(_0x1c7e63['appCode'],_0x1c7e63['bool'](_0x3de14f(0xcd))?'project':_0x3de14f(0xe3)),_0x60ccb1=_0x48441(_0x1c7e63[_0x3de14f(0xee)],_0x1d2ae9[_0x3de14f(0xd7)]==='project'?_0x3de14f(0xe3):'project'),_0x2095b0=await Promise[_0x3de14f(0xcc)](_0x4611f0[_0x3de14f(0xe7)](_0x166ecf=>_0x5c8a3c({'appCode':_0x1c7e63[_0x3de14f(0xee)],'scope':_0x166ecf,'code':_0x2a518b[_0x3de14f(0xf3)]()||undefined}))),_0x229670=_0x4611f0[_0x3de14f(0xe6)](_0x3de14f(0xd6))?_0x2095b0[_0x3de14f(0xcb)]((_0xb196c8,_0x5b88d8)=>_0x4611f0[_0x5b88d8]===_0x3de14f(0xd6)?_0xb196c8[_0x3de14f(0xd6)]:[]):[],_0x456f89=_0x4611f0[_0x3de14f(0xe6)](_0x3de14f(0xd0))?_0x2095b0[_0x3de14f(0xcb)]((_0x24291b,_0x4fbdd5)=>_0x4611f0[_0x4fbdd5]===_0x3de14f(0xd0)?_0x24291b[_0x3de14f(0xd0)]:[]):[],_0x5f5414=new Set([..._0x229670[_0x3de14f(0xe7)](_0x540aaa=>_0x540aaa['skillCode']?.[_0x3de14f(0xf3)]())[_0x3de14f(0xe1)](_0x50b26b=>Boolean(_0x50b26b)),..._0x456f89[_0x3de14f(0xe7)](_0x3324ee=>_0x3324ee[_0x3de14f(0xe8)]?.[_0x3de14f(0xf3)]())[_0x3de14f(0xe1)](_0x3ae501=>Boolean(_0x3ae501))]),_0x50bdc2=_0x2a518b[_0x3de14f(0xf3)]()?[_0x2a518b['trim']()]:undefined,_0x4830c6=_0x4611f0[_0x3de14f(0xf1)]===0x2&&_0x4611f0[_0x3de14f(0xe6)](_0x3de14f(0xd6))&&_0x4611f0[_0x3de14f(0xe6)](_0x3de14f(0xd0)),_0x4098c6=_0x4830c6?_0xaa7c03(_0x1d2ae9,_0x5f5414,_0x50bdc2):[],_0x5eab2b=_0x4b16a1({'env':_0x46b938,'accessKey':_0x5d282f,'appCode':_0x1c7e63['appCode'],'activeSkillCodes':_0x5f5414,'pruneSkillCodes':_0x50bdc2,'scopes':_0x4611f0,'protectedLinkRoots':_0x60ccb1['skillRoots']}),_0x3af06a=[];for(const _0x20b30a of _0x229670){_0x3af06a[_0x3de14f(0xda)](_0x3b03b5(_0x20b30a,_0x3de14f(0xd6),{'env':_0x46b938,'accessKey':_0x5d282f,'appCode':_0x1c7e63[_0x3de14f(0xee)],'force':_0x264885,'packageBytes':await downloadSkillPackage(_0x20b30a,_0x3de14f(0xd6),_0x1c7e63[_0x3de14f(0xee)],_0x5c7a46)}));}for(const _0x267752 of _0x456f89){_0x3af06a[_0x3de14f(0xda)](_0x3b03b5(_0x267752,_0x3de14f(0xd0),{'env':_0x46b938,'accessKey':_0x5d282f,'appCode':_0x1c7e63[_0x3de14f(0xee)],'force':_0x264885,'packageBytes':await downloadSkillPackage(_0x267752,_0x3de14f(0xd0),_0x1c7e63[_0x3de14f(0xee)],_0x5c7a46)}));}const _0x346f54=_0x1508a5(_0x3af06a,_0x1d2ae9),_0x7d941c=countLinkActions(_0x346f54);return{'ok':!![],'data':{'appCode':_0x1c7e63[_0x3de14f(0xee)],..._0x1d2ae9[_0x3de14f(0xd7)]===_0x3de14f(0xcd)?{'installTarget':{'scope':_0x1d2ae9[_0x3de14f(0xd7)],'skillRoots':[..._0x1d2ae9['skillRoots']]}}:{},'personal':_0x229670[_0x3de14f(0xf1)],'company':_0x456f89['length'],'materialized':_0x3af06a[_0x3de14f(0xf1)],'links':{'total':_0x346f54[_0x3de14f(0xf1)],'created':_0x7d941c[_0x3de14f(0xcf)]??0x0,'updated':_0x7d941c[_0x3de14f(0xd2)]??0x0,'unchanged':_0x7d941c['unchanged']??0x0,'skipped':0x0,'conflicted':0x0},'pruned':{'links':_0x4098c6[_0x3de14f(0xe1)](_0x231f44=>_0x231f44['action']===_0x3de14f(0xd4))[_0x3de14f(0xf1)],'cacheDirs':_0x5eab2b['filter'](_0x3609ce=>_0x3609ce[_0x3de14f(0xe4)]==='removed')[_0x3de14f(0xf1)],'skipped':[..._0x4098c6,..._0x5eab2b][_0x3de14f(0xe1)](_0x1de408=>_0x1de408['action']===_0x3de14f(0xdf))[_0x3de14f(0xf1)]},'skills':{'personal':_0x229670[_0x3de14f(0xe7)](summarizeRuntimeSkill),'company':_0x456f89['map'](summarizeRuntimeSkill)}},'message':'Installed\x20'+_0x229670['length']+'\x20personal\x20and\x20'+_0x456f89[_0x3de14f(0xf1)]+_0x3de14f(0xed)};}async function downloadSkillPackage(_0x5ed52e,_0x31e49b,_0x456784,_0x1c73e9){const _0x13a400=a45_0x4575a3,_0x343282=_0x5ed52e[_0x13a400(0xf2)]?.[_0x13a400(0xf3)]();return _0x343282?_0x1c73e9(_0x31e49b,_0x5ed52e['skillCode'],_0x456784,_0x343282):_0x1c73e9(_0x31e49b,_0x5ed52e[_0x13a400(0xe8)],_0x456784);}function countLinkActions(_0x240a34){const _0x3b26b5=a45_0x4575a3;return _0x240a34[_0x3b26b5(0xca)]((_0x10dd21,_0x2b6a3f)=>{const _0x5d45af=_0x3b26b5;return _0x10dd21[_0x2b6a3f[_0x5d45af(0xe4)]]=(_0x10dd21[_0x2b6a3f[_0x5d45af(0xe4)]]??0x0)+0x1,_0x10dd21;},{});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a46_0xc51b8=a46_0x5bfd;function a46_0x1ede(){const _0xd2a57c=['authRequired','skill','Listed\x20','\x20local\x20Skill(s).','../../../core/api-client.js','597605PjQUCR','567730uhOShN','envName','accessKey','81BiAoGn','270338IinoOD','company','bool','length','scope','filter','project','str','\x20remote\x20Skill(s).','30jARpdh','359093KWsBty','trim','remote','../../../skills/runtime-skill-sync.js','production','136tRPbvr','973863ervLYT','446552bNsafH','map','local','1592316VEjqRf','appCode','personal','4NisLdF'];a46_0x1ede=function(){return _0xd2a57c;};return a46_0x1ede();}(function(_0x316066,_0x503b81){const _0x43643a=a46_0x5bfd,_0x3c4fa5=_0x316066();while(!![]){try{const _0x231474=parseInt(_0x43643a(0xc8))/0x1+-parseInt(_0x43643a(0xd9))/0x2+parseInt(_0x43643a(0xd8))/0x3*(parseInt(_0x43643a(0xdf))/0x4)+parseInt(_0x43643a(0xc3))/0x5*(parseInt(_0x43643a(0xd1))/0x6)+-parseInt(_0x43643a(0xd2))/0x7*(parseInt(_0x43643a(0xd7))/0x8)+parseInt(_0x43643a(0xc7))/0x9*(parseInt(_0x43643a(0xc4))/0xa)+-parseInt(_0x43643a(0xdc))/0xb;if(_0x231474===_0x503b81)break;else _0x3c4fa5['push'](_0x3c4fa5['shift']());}catch(_0x41ad25){_0x3c4fa5['push'](_0x3c4fa5['shift']());}}}(a46_0x1ede,0x7122e));import{CliErrors}from'../../../errors.js';import{CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG}from'../flags.js';import{listScopeToRemoteScope,listScopeToRuntimeScopes,normalizeListScope,shouldListScope}from'../scopes.js';import{summarizeLocalRuntimeSkill,summarizeRuntimeSkill}from'../summary.js';export const listCommand={'service':a46_0xc51b8(0xbf),'command':'list','description':'List\x20runtime\x20Skills\x20from\x20remote\x20or\x20CLI-managed\x20local\x20cache','risk':'read','flags':[CODE_FLAG,LIST_SCOPE_FLAG,LOCAL_FLAG,PROJECT_TARGET_FLAG],async 'execute'(_0x10730d){const _0x92e46b=a46_0xc51b8,_0x24f07c=_0x10730d[_0x92e46b(0xcf)]('code'),_0x5bdf56=normalizeListScope(_0x10730d[_0x92e46b(0xcf)]('scope'));if(_0x10730d['bool'](_0x92e46b(0xdb))){const _0x1737a4=_0x10730d[_0x92e46b(0xc6)];if(!_0x1737a4)throw CliErrors[_0x92e46b(0xe0)]();const {listLocalRuntimeSkills:_0x243fe5,resolveRuntimeSkillInstallTarget:_0x251524}=await import(_0x92e46b(0xd5)),_0x5e3830=_0x251524(_0x10730d[_0x92e46b(0xdd)],_0x10730d[_0x92e46b(0xca)](_0x92e46b(0xce))?_0x92e46b(0xce):'global'),_0x627bb=_0x243fe5({'env':_0x10730d[_0x92e46b(0xc5)]??_0x92e46b(0xd6),'accessKey':_0x1737a4,'appCode':_0x10730d[_0x92e46b(0xdd)],'scopes':listScopeToRuntimeScopes(_0x5bdf56),'code':_0x24f07c[_0x92e46b(0xd3)]()||undefined},_0x5e3830),_0x5bef23=groupLocalRuntimeSkills(_0x627bb);return{'ok':!![],'data':{'appCode':_0x10730d[_0x92e46b(0xdd)],'source':_0x92e46b(0xdb),..._0x5e3830[_0x92e46b(0xcc)]===_0x92e46b(0xce)?{'installScope':_0x5e3830['scope']}:{},'scope':_0x5bdf56,'total':_0x627bb[_0x92e46b(0xcb)],'personal':_0x5bef23[_0x92e46b(0xde)][_0x92e46b(0xcb)],'company':_0x5bef23['company'][_0x92e46b(0xcb)],'items':_0x627bb[_0x92e46b(0xda)](summarizeLocalRuntimeSkill),'skills':{'personal':_0x5bef23[_0x92e46b(0xde)]['map'](summarizeLocalRuntimeSkill),'company':_0x5bef23[_0x92e46b(0xc9)][_0x92e46b(0xda)](summarizeLocalRuntimeSkill)}},'message':'Listed\x20'+_0x627bb[_0x92e46b(0xcb)]+_0x92e46b(0xc1)};}const {listRuntimeSkills:_0xa19af4}=await import(_0x92e46b(0xc2)),_0x4137cf=await _0xa19af4({'appCode':_0x10730d['appCode'],'scope':listScopeToRemoteScope(_0x5bdf56),'code':_0x24f07c[_0x92e46b(0xd3)]()||undefined}),_0x2004bb=shouldListScope(_0x5bdf56,_0x92e46b(0xde))?_0x4137cf[_0x92e46b(0xde)]??[]:[],_0x28f454=shouldListScope(_0x5bdf56,_0x92e46b(0xc9))?_0x4137cf['company']??[]:[],_0x18bceb=[..._0x2004bb,..._0x28f454];return{'ok':!![],'data':{'appCode':_0x10730d[_0x92e46b(0xdd)],'source':_0x92e46b(0xd4),'scope':_0x5bdf56,'total':_0x18bceb[_0x92e46b(0xcb)],'personal':_0x2004bb[_0x92e46b(0xcb)],'company':_0x28f454[_0x92e46b(0xcb)],'items':_0x18bceb[_0x92e46b(0xda)](summarizeRuntimeSkill),'skills':{'personal':_0x2004bb[_0x92e46b(0xda)](summarizeRuntimeSkill),'company':_0x28f454[_0x92e46b(0xda)](summarizeRuntimeSkill)}},'message':_0x92e46b(0xc0)+_0x18bceb[_0x92e46b(0xcb)]+_0x92e46b(0xd0)};}};function a46_0x5bfd(_0x529c4d,_0x3352ed){_0x529c4d=_0x529c4d-0xbf;const _0x1edee2=a46_0x1ede();let _0x5bfdac=_0x1edee2[_0x529c4d];return _0x5bfdac;}function groupLocalRuntimeSkills(_0x30242c){const _0xbd6617=a46_0xc51b8;return{'personal':_0x30242c[_0xbd6617(0xcd)](_0x273be5=>_0x273be5[_0xbd6617(0xcc)]===_0xbd6617(0xde)),'company':_0x30242c['filter'](_0x12bcb0=>_0x12bcb0[_0xbd6617(0xcc)]===_0xbd6617(0xc9)),'builtin':_0x30242c['filter'](_0x13461d=>_0x13461d[_0xbd6617(0xcc)]==='builtin')};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a47_0x2db9d2=a47_0x2918;function a47_0x1ee0(){const _0x462912=['push','24CVIimp','将读取本地\x20Skill\x20内容:个人范围会立即保存并生效,公司范围会提交一个新版本进入审核。确认界面不会展示目录路径或\x20Skill\x20正文。','368091XEARaK','401232hsNNXy','将本地\x20Skill\x20目录推送到个人范围,或提交公司范围版本审核','748020PwJtrD','76662UjQBQV','745717afsxlS','160FyuHoI','skill','225797sLNLoB','9866745eYbbve'];a47_0x1ee0=function(){return _0x462912;};return a47_0x1ee0();}(function(_0x145aca,_0x391892){const _0x234fd7=a47_0x2918,_0x397c4f=_0x145aca();while(!![]){try{const _0x578e01=parseInt(_0x234fd7(0x17c))/0x1+-parseInt(_0x234fd7(0x184))/0x2+parseInt(_0x234fd7(0x181))/0x3+-parseInt(_0x234fd7(0x182))/0x4+-parseInt(_0x234fd7(0x187))/0x5*(parseInt(_0x234fd7(0x185))/0x6)+parseInt(_0x234fd7(0x186))/0x7*(-parseInt(_0x234fd7(0x17f))/0x8)+parseInt(_0x234fd7(0x17d))/0x9;if(_0x578e01===_0x391892)break;else _0x397c4f['push'](_0x397c4f['shift']());}catch(_0x3288f1){_0x397c4f['push'](_0x397c4f['shift']());}}}(a47_0x1ee0,0x3b168));import{CONFIRM_WARNINGS_FLAG,DIAGRAM_FILE_FLAG,DIR_FLAG,PUSH_SCOPE_FLAG}from'../flags.js';import{skillPushDryRun,skillPushExecute}from'../push-execute.js';function a47_0x2918(_0x2ceed6,_0x34315a){_0x2ceed6=_0x2ceed6-0x17c;const _0x1ee025=a47_0x1ee0();let _0x2918af=_0x1ee025[_0x2ceed6];return _0x2918af;}export const pushCommand={'service':a47_0x2db9d2(0x188),'command':a47_0x2db9d2(0x17e),'description':a47_0x2db9d2(0x183),'risk':'write','confirmationDescription':a47_0x2db9d2(0x180),'flags':[DIR_FLAG,DIAGRAM_FILE_FLAG,PUSH_SCOPE_FLAG,CONFIRM_WARNINGS_FLAG],'dryRun':skillPushDryRun,'execute':skillPushExecute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x54c89d=a48_0x48ad;function a48_0x48ad(_0x4e8598,_0x327684){_0x4e8598=_0x4e8598-0xf7;const _0x422aac=a48_0x422a();let _0x48ad7f=_0x422aac[_0x4e8598];return _0x48ad7f;}(function(_0x1a6d50,_0x4a9371){const _0x210eb0=a48_0x48ad,_0x1796c8=_0x1a6d50();while(!![]){try{const _0xa46c4b=parseInt(_0x210eb0(0xf9))/0x1+-parseInt(_0x210eb0(0xf8))/0x2+parseInt(_0x210eb0(0xff))/0x3*(-parseInt(_0x210eb0(0xfc))/0x4)+parseInt(_0x210eb0(0x100))/0x5+parseInt(_0x210eb0(0x10a))/0x6+-parseInt(_0x210eb0(0x102))/0x7+-parseInt(_0x210eb0(0x108))/0x8*(-parseInt(_0x210eb0(0x106))/0x9);if(_0xa46c4b===_0x4a9371)break;else _0x1796c8['push'](_0x1796c8['shift']());}catch(_0x47aaa5){_0x1796c8['push'](_0x1796c8['shift']());}}}(a48_0x422a,0x407de));import{DIR_FLAG,STRICT_FLAG}from'../flags.js';import{throwIfSkillValidationFailed,validateSkillDirectory}from'../validate.js';export const validateCommand={'service':a48_0x54c89d(0x103),'command':a48_0x54c89d(0x101),'description':a48_0x54c89d(0xfb),'risk':a48_0x54c89d(0x107),'requiresAuth':![],'requiresAppCode':![],'flags':[DIR_FLAG,STRICT_FLAG],async 'execute'(_0x244948){const _0x2f8129=a48_0x54c89d,_0x301332=_0x244948[_0x2f8129(0xfa)](_0x2f8129(0xf7)),_0x53e4f2=validateSkillDirectory(_0x244948[_0x2f8129(0x105)](_0x2f8129(0x104)),{'strict':_0x301332});return throwIfSkillValidationFailed(_0x53e4f2,_0x301332),{'ok':!![],'data':{'dir':_0x53e4f2[_0x2f8129(0x104)],'type':_0x53e4f2[_0x2f8129(0xfd)],'errors':_0x53e4f2['errors'],'warnings':_0x53e4f2[_0x2f8129(0xfe)]},'message':_0x2f8129(0x109)};}};function a48_0x422a(){const _0x435dfa=['dir','str','9LueJiI','read','7817624kVUnBY','Skill\x20validation\x20passed.','217302JLFBxA','strict','1011724oFTFtU','487215wWcpLx','bool','Validate\x20a\x20local\x20Skill\x20directory\x20as\x20a\x20self-contained\x20delivery\x20package','16DvBcIw','type','warnings','392790yIrNsp','872230cdIAyP','validate','2669387cCyZSJ','skill'];a48_0x422a=function(){return _0x435dfa;};return a48_0x422a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1d6ee3,_0x1917db){const _0x4a7bb1=a49_0xd97f,_0x183f46=_0x1d6ee3();while(!![]){try{const _0x1b681e=parseInt(_0x4a7bb1(0xd4))/0x1+-parseInt(_0x4a7bb1(0xd5))/0x2+parseInt(_0x4a7bb1(0xd1))/0x3+-parseInt(_0x4a7bb1(0xcc))/0x4+parseInt(_0x4a7bb1(0xca))/0x5*(-parseInt(_0x4a7bb1(0xd8))/0x6)+parseInt(_0x4a7bb1(0xda))/0x7+parseInt(_0x4a7bb1(0xdb))/0x8*(parseInt(_0x4a7bb1(0xc6))/0x9);if(_0x1b681e===_0x1917db)break;else _0x183f46['push'](_0x183f46['shift']());}catch(_0x3fe8fb){_0x183f46['push'](_0x183f46['shift']());}}}(a49_0x10b7,0x74d92));function a49_0xd97f(_0x4962c5,_0x4e850e){_0x4962c5=_0x4962c5-0xc5;const _0x10b750=a49_0x10b7();let _0xd97f9a=_0x10b750[_0x4962c5];return _0xd97f9a;}import{existsSync,readFileSync,realpathSync,statSync}from'node:fs';import{resolve}from'node:path';import{JSDOM}from'jsdom';import{CliErrors}from'../../errors.js';let mermaidApiPromise;export async function readRequiredSkillDiagram(_0x3ba145){const _0x2f352e=a49_0xd97f;return(await readRequiredSkillDiagramInput(_0x3ba145))[_0x2f352e(0xc9)];}function a49_0x10b7(){const _0x20d19b=['Unable\x20to\x20read\x20Mermaid\x20flowchart\x20from\x20standard\x20input.','684459YmECSx','utf8','Mermaid\x20flowchart\x20file\x20not\x20found:\x20','715532KQOMus','579898hCUfxZ','window','validation','5343810GwVwJa','replace','4467750UTdMHC','32BuUUqC','Mermaid\x20syntax\x20validation\x20failed.','document','1155348aGibpL','Generate\x20a\x20Mermaid\x20flowchart\x20and\x20pass\x20--diagram-file\x20<path>,\x20or\x20use\x20--diagram-file\x20-\x20for\x20standard\x20input.','trim','diagram','5ERlcjF','isFile','1744916fTQKBu','parse','Fix\x20the\x20Mermaid\x20syntax\x20reported\x20by\x20your\x20editor\x20or\x20preview\x20tool,\x20then\x20retry\x20with\x20the\x20same\x20file.','mermaid'];a49_0x10b7=function(){return _0x20d19b;};return a49_0x10b7();}export async function readRequiredSkillDiagramInput(_0x53b69b){const _0xcd52e1=a49_0xd97f,_0x4070a4=_0x53b69b[_0xcd52e1(0xc8)]();if(!_0x4070a4)throw CliErrors[_0xcd52e1(0xd7)]('--diagram-file\x20is\x20required\x20when\x20publishing\x20a\x20Skill\x20version.',_0xcd52e1(0xc7));let _0x396581,_0x4aed54;if(_0x4070a4==='-')try{_0x396581=readFileSync(0x0,_0xcd52e1(0xd2));}catch{throw CliErrors['validation'](_0xcd52e1(0xd0));}else{const _0x552df2=resolve(_0x4070a4);if(!existsSync(_0x552df2))throw CliErrors['validation'](_0xcd52e1(0xd3)+_0x552df2);if(!statSync(_0x552df2)[_0xcd52e1(0xcb)]())throw CliErrors[_0xcd52e1(0xd7)]('Mermaid\x20flowchart\x20path\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x552df2);_0x4aed54=realpathSync(_0x552df2),_0x396581=readFileSync(_0x4aed54,_0xcd52e1(0xd2));}return{'diagram':{'schemaVersion':0x1,'mermaid':await validateAndCanonicalizeMermaid(_0x396581)},'sourceFilePath':_0x4aed54};}export async function validateAndCanonicalizeMermaid(_0x4c8745){const _0x472033=a49_0xd97f,_0x527428=_0x4c8745[_0x472033(0xd9)](/\r\n/g,'\x0a')[_0x472033(0xd9)](/\r/g,'\x0a')[_0x472033(0xd9)](/\n+$/,'')+'\x0a';try{const _0x577fc7=await loadMermaidApi();await _0x577fc7[_0x472033(0xcd)](_0x527428);}catch{throw diagramValidationError();}return _0x527428;}function loadMermaidApi(){return mermaidApiPromise??=((async()=>{const _0x4f0e60=a49_0xd97f;if(!(_0x4f0e60(0xd6)in globalThis)||!(_0x4f0e60(0xc5)in globalThis)){const _0x4b216e=new JSDOM('');Object['defineProperties'](globalThis,{'window':{'configurable':!![],'value':_0x4b216e['window']},'document':{'configurable':!![],'value':_0x4b216e[_0x4f0e60(0xd6)][_0x4f0e60(0xc5)]}});}return(await import(_0x4f0e60(0xcf)))['default'];})()),mermaidApiPromise;}function diagramValidationError(){const _0x1984bd=a49_0xd97f;return CliErrors[_0x1984bd(0xd7)](_0x1984bd(0xdc),_0x1984bd(0xce));}
|